@ramme-io/create-app 1.2.1 → 1.2.2

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 (89) hide show
  1. package/package.json +1 -2
  2. package/template/package.json +41 -0
  3. package/template/pkg.json +1 -1
  4. package/template/src/App.tsx +62 -31
  5. package/template/src/components/AIChatWidget.tsx +2 -2
  6. package/template/src/components/AppHeader.tsx +2 -2
  7. package/template/src/components/AutoForm.tsx +13 -0
  8. package/template/src/{pages/styleguide → components}/NotFound.tsx +1 -1
  9. package/template/src/components/PageTitleUpdater.tsx +2 -2
  10. package/template/src/components/ProtectedRoute.tsx +18 -1
  11. package/template/src/components/ScrollToTop.tsx +19 -0
  12. package/template/src/config/app.manifest.ts +3 -1
  13. package/template/src/{core → config}/component-registry.tsx +1 -1
  14. package/template/src/config/navigation.ts +1 -1
  15. package/template/src/data/mock-charts.ts +32 -28
  16. package/template/src/{components → engine/renderers}/DynamicBlock.tsx +27 -7
  17. package/template/src/{pages → engine/renderers}/DynamicPage.tsx +23 -4
  18. package/template/src/{contexts → engine/runtime}/MqttContext.tsx +25 -11
  19. package/template/src/{contexts → engine/runtime}/SitemapContext.tsx +1 -1
  20. package/template/src/{core → engine/runtime}/data-seeder.ts +15 -5
  21. package/template/src/{hooks → engine/runtime}/useAction.ts +19 -8
  22. package/template/src/{hooks → engine/runtime}/useCrudLocalStorage.ts +27 -8
  23. package/template/src/{hooks → engine/runtime}/useDataQuery.ts +15 -1
  24. package/template/src/engine/runtime/useSignal.ts +51 -0
  25. package/template/src/{generated/hooks.ts → engine/runtime/useSignalStore.ts} +35 -8
  26. package/template/src/{hooks → engine/runtime}/useWorkflowEngine.ts +34 -13
  27. package/template/src/{core → engine/types}/manifest-types.ts +35 -3
  28. package/template/src/{types → engine/validation}/schema.ts +17 -0
  29. package/template/src/{pages → features/ai/pages}/AiChat.tsx +1 -1
  30. package/template/src/features/auth/AuthContext.tsx +118 -0
  31. package/template/src/features/auth/pages/AuthLayout.tsx +55 -0
  32. package/template/src/features/auth/pages/LoginPage.tsx +106 -0
  33. package/template/src/features/auth/pages/SignupPage.tsx +96 -0
  34. package/template/src/{blocks → features/datagrid}/SmartTable.tsx +4 -6
  35. package/template/src/{pages → features/onboarding/pages}/Welcome.tsx +0 -1
  36. package/template/src/features/overview/index.ts +1 -0
  37. package/template/src/features/overview/pages/OverviewPage.tsx +127 -0
  38. package/template/src/{pages → features/playground/pages}/AccountingLedgerPage.tsx +1 -1
  39. package/template/src/{pages/prototypes → features/playground/pages}/ItemSelectorPage.tsx +1 -1
  40. package/template/src/{pages/settings → features/settings/pages}/BillingPage.tsx +1 -1
  41. package/template/src/features/settings/pages/ProfilePage.tsx +153 -0
  42. package/template/src/{pages/settings → features/settings/pages}/TeamPage.tsx +1 -1
  43. package/template/src/features/styleguide/Styleguide.tsx +75 -0
  44. package/template/src/features/users/components/UserDrawer.tsx +138 -0
  45. package/template/src/features/users/index.ts +2 -0
  46. package/template/src/features/users/pages/UsersPage.tsx +151 -0
  47. package/template/src/index.css +1 -1
  48. package/template/src/main.tsx +3 -3
  49. package/template/src/templates/dashboard/DashboardLayout.tsx +75 -106
  50. package/template/src/templates/dashboard/dashboard.sitemap.ts +26 -22
  51. package/template/src/templates/docs/DocsLayout.tsx +49 -38
  52. package/template/src/templates/docs/docs.sitemap.ts +22 -34
  53. package/template/src/templates/settings/SettingsLayout.tsx +83 -143
  54. package/template/src/templates/settings/settings.sitemap.ts +6 -6
  55. package/template/vite.config.ts +12 -9
  56. package/template/src/adaptors/.gitkeep +0 -0
  57. package/template/src/components/LocalSideNav.tsx +0 -120
  58. package/template/src/components/PageWithSideNav.tsx +0 -69
  59. package/template/src/config/dashboard.layout.ts +0 -110
  60. package/template/src/contexts/AuthContext.tsx +0 -64
  61. package/template/src/data/mockUsers.ts +0 -18
  62. package/template/src/hooks/useSignal.ts +0 -83
  63. package/template/src/layouts/DataLayout.tsx +0 -37
  64. package/template/src/layouts/SideNavLayout.tsx +0 -28
  65. package/template/src/pages/Dashboard.tsx +0 -60
  66. package/template/src/pages/DataGridPage.tsx +0 -184
  67. package/template/src/pages/LoginPage.tsx +0 -58
  68. package/template/src/pages/settings/ProfilePage.tsx +0 -10
  69. package/template/src/pages/styleguide/Styleguide.tsx +0 -40
  70. package/template/src/templates/docs/pages/Introduction.tsx +0 -13
  71. package/template/src/types/signal.ts +0 -23
  72. /package/template/src/{core → engine/renderers}/route-generator.tsx +0 -0
  73. /package/template/src/{core → engine/types}/sitemap-entry.ts +0 -0
  74. /package/template/src/{pages → features}/GenericContentPage.tsx +0 -0
  75. /package/template/src/{hooks → features/assistant}/useMockChat.ts +0 -0
  76. /package/template/src/{components/dev → features/developer}/GhostOverlay.tsx +0 -0
  77. /package/template/src/{hooks → features/developer}/useDevTools.ts +0 -0
  78. /package/template/src/{pages → features}/styleguide/sections/charts/ChartsSection.tsx +0 -0
  79. /package/template/src/{pages → features}/styleguide/sections/colors/ColorsSection.tsx +0 -0
  80. /package/template/src/{pages → features}/styleguide/sections/elements/ElementsSection.tsx +0 -0
  81. /package/template/src/{pages → features}/styleguide/sections/feedback/FeedbackSection.tsx +0 -0
  82. /package/template/src/{pages → features}/styleguide/sections/forms/FormsSection.tsx +0 -0
  83. /package/template/src/{pages → features}/styleguide/sections/icons/IconsSection.tsx +0 -0
  84. /package/template/src/{pages → features}/styleguide/sections/layout/LayoutSection.tsx +0 -0
  85. /package/template/src/{pages → features}/styleguide/sections/navigation/NavigationSection.tsx +0 -0
  86. /package/template/src/{pages → features}/styleguide/sections/tables/TablesSection.tsx +0 -0
  87. /package/template/src/{pages → features}/styleguide/sections/templates/TemplatesSection.tsx +0 -0
  88. /package/template/src/{pages → features}/styleguide/sections/theming/ThemingSection.tsx +0 -0
  89. /package/template/src/{pages → features}/styleguide/sections/utilities/UtilitiesSection.tsx +0 -0
@@ -1,58 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useNavigate } from 'react-router-dom';
3
- import { useAuth } from '../contexts/AuthContext';
4
- import { Button, Card, FormTemplate, Alert, Icon, type FormField } from '@ramme-io/ui';
5
-
6
- const LoginPage: React.FC = () => {
7
- const navigate = useNavigate();
8
- const { login } = useAuth();
9
- const [error, setError] = useState<string | null>(null);
10
- const [isLoading, setIsLoading] = useState(false);
11
-
12
- const handleLogin = async (formData: Record<string, any>) => {
13
- setIsLoading(true);
14
- setError(null);
15
- try {
16
- const user = await login(formData.username, formData.password);
17
- if (user) {
18
- navigate('/dashboard');
19
- } else {
20
- setError('Invalid username or password.');
21
- }
22
- } catch (err) {
23
- setError('An unexpected error occurred.');
24
- } finally {
25
- setIsLoading(false);
26
- }
27
- };
28
-
29
- const formFields: FormField[] = [
30
- { name: 'username', label: 'Username', type: 'text', placeholder: 'e.g., jane' },
31
- { name: 'password', label: 'Password', type: 'password', placeholder: 'e.g., password' },
32
- ];
33
-
34
- return (
35
- <div className="flex min-h-screen items-center justify-center bg-background p-4">
36
- <Card className="w-full max-w-md p-8">
37
- <div className="text-center mb-8">
38
- <Icon name="layout-template" size={48} className="text-primary mx-auto mb-4" />
39
- <h1 className="text-3xl font-bold text-text">Welcome to Ramme</h1>
40
- <p className="text-muted-foreground">Please sign in to continue</p>
41
- </div>
42
-
43
- {error && <Alert variant="danger" title="Login Failed" className="mb-4">{error}</Alert>}
44
-
45
- <FormTemplate
46
- fields={formFields}
47
- onSubmit={handleLogin}
48
- >
49
- <Button type="submit" loading={isLoading} className="w-full">
50
- Sign In
51
- </Button>
52
- </FormTemplate>
53
- </Card>
54
- </div>
55
- );
56
- };
57
-
58
- export default LoginPage;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- // --- 1. Import the new generic page ---
3
- import GenericContentPage from '../GenericContentPage';
4
-
5
- const ProfilePage: React.FC = () => {
6
- // --- 2. Use the generic page component ---
7
- return <GenericContentPage pageTitle="Profile Settings" />;
8
- };
9
-
10
- export default ProfilePage;
@@ -1,40 +0,0 @@
1
- import React from 'react';
2
- import { Outlet, useLocation } from 'react-router-dom';
3
- import { PageWithSideNav } from '../../components/PageWithSideNav';
4
- import { useSitemap } from '../../contexts/SitemapContext';
5
-
6
- const Styleguide: React.FC = () => {
7
- const location = useLocation();
8
- const sitemap = useSitemap();
9
- const isDocsTemplate = location.pathname.startsWith('/docs');
10
-
11
- if (isDocsTemplate) {
12
- // Find the 'styleguide' section from the sitemap to get its children
13
- const styleguideSitemapSection = sitemap.find(item => item.id === 'styleguide');
14
-
15
- // Transform the sitemap children into the shape the nav component expects
16
- const navItems = (styleguideSitemapSection?.children || []).map(child => ({
17
- label: child.title,
18
- href: child.path,
19
- icon: child.icon,
20
- }));
21
-
22
- return (
23
- <PageWithSideNav
24
- sideNavHeader={
25
- <h2 className="text-lg font-semibold tracking-tight mb-2">
26
- {styleguideSitemapSection?.title || 'Style Guide'}
27
- </h2>
28
- }
29
- navItems={navItems}
30
- >
31
- <Outlet />
32
- </PageWithSideNav>
33
- );
34
- }
35
-
36
- // In the dashboard template, the main layout handles navigation.
37
- return <Outlet />;
38
- };
39
-
40
- export default Styleguide;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { Card } from '@ramme-io/ui';
3
-
4
- const IntroductionPage: React.FC = () => {
5
- return (
6
- <Card className="p-4">
7
- <h2 className="text-xl font-bold mb-2">Introduction</h2>
8
- <p>This is the introduction page for the 'Docs' template.</p>
9
- </Card>
10
- );
11
- };
12
-
13
- export default IntroductionPage;
@@ -1,23 +0,0 @@
1
- // src/types/signal.ts
2
- /**
3
- * @file signal.d.ts
4
- * @description Defines the universal contract for "Live Data" in the Ramme ecosystem.
5
- *
6
- * A "Signal" is a single data point that changes over time.
7
- * unlike a "Record" (which is static database row), a Signal is ephemeral.
8
- */
9
-
10
- export type SignalStatus = 'fresh' | 'stale' | 'disconnected' | 'error';
11
-
12
- export interface Signal<T = any> {
13
- max: number;
14
- id: string; // The unique ID (e.g., "temp_01")
15
- value: T; // The actual data (e.g., 24.5)
16
- unit?: string; // Optional unit (e.g., "°C")
17
- timestamp: number; // Unix timestamp of last update
18
- status: SignalStatus;
19
- meta?: Record<string, any>; // Extra metadata (e.g., limits)
20
- }
21
-
22
- // A simple map for looking up signals by ID
23
- export type SignalMap = Record<string, Signal>;