@elsapiens/cli 0.1.0 → 0.1.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.
@@ -1,3 +1,5 @@
1
+ import { useState } from 'react';
2
+ import { Link } from 'react-router-dom';
1
3
  import {
2
4
  Button,
3
5
  Input,
@@ -6,158 +8,228 @@ import {
6
8
  Card,
7
9
  CardHeader,
8
10
  CardTitle,
11
+ CardDescription,
9
12
  CardContent,
13
+ FormField,
14
+ Separator,
10
15
  } from '@elsapiens/ui';
11
- import { User, Bell, Shield, Palette } from 'lucide-react';
12
- import { useState } from 'react';
16
+ import { PageHeaderWithBreadcrumbs } from '@elsapiens/layout';
17
+ import { usePageHeader } from '@elsapiens/providers';
18
+ import { User, Bell, Shield, Palette, Mail, Moon, Save } from 'lucide-react';
19
+
20
+ interface <%= pascalName %>PageProps {
21
+ className?: string;
22
+ }
13
23
 
14
- export default function <%= pascalName %>() {
24
+ export function <%= pascalName %>Page({ className }: <%= pascalName %>PageProps) {
15
25
  const [notifications, setNotifications] = useState(true);
16
26
  const [emailUpdates, setEmailUpdates] = useState(false);
17
27
 
28
+ // Set page header info
29
+ usePageHeader({
30
+ title: '<%= title %>',
31
+ description: '<%= description %>',
32
+ breadcrumbs: [
33
+ { label: 'Home', href: '/', as: Link },
34
+ { label: '<%= title %>' },
35
+ ],
36
+ });
37
+
38
+ // Theme options
39
+ const themeOptions = [
40
+ { value: 'light', label: 'Light' },
41
+ { value: 'dark', label: 'Dark' },
42
+ { value: 'system', label: 'System' },
43
+ ];
44
+
45
+ // Language options
46
+ const languageOptions = [
47
+ { value: 'en', label: 'English' },
48
+ { value: 'es', label: 'Spanish' },
49
+ { value: 'fr', label: 'French' },
50
+ ];
51
+
18
52
  return (
19
- <div className="p-6 max-w-4xl">
20
- {/* Page Header - pl-6 to align with card content */}
21
- <div className="mb-8 pl-6">
22
- <h1 className="text-2xl font-bold text-foreground"><%= title %></h1>
23
- <p className="text-muted-foreground"><%= description %></p>
24
- </div>
53
+ <div className="flex flex-col">
54
+ <PageHeaderWithBreadcrumbs variant="card" linkComponent={Link} />
25
55
 
26
- <div className="space-y-6">
27
- {/* Profile Section */}
28
- <Card padding="none">
29
- <CardHeader className="p-6">
30
- <CardTitle className="flex items-center gap-3">
31
- <User className="w-5 h-5 text-muted-foreground" />
32
- Profile
33
- </CardTitle>
34
- </CardHeader>
35
- <CardContent className="p-6 pt-0 space-y-4">
36
- <div className="grid grid-cols-2 gap-4">
37
- <div>
38
- <label className="block text-sm font-medium text-foreground mb-1">
39
- First Name
40
- </label>
41
- <Input defaultValue="John" hideMessage />
56
+ <div className="el-p-lg" style={{ overflowX: 'clip' }}>
57
+ <div className="el-space-y-section max-w-3xl">
58
+ {/* Profile Section */}
59
+ <Card>
60
+ <CardHeader>
61
+ <div className="flex items-center el-gap-sm">
62
+ <div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
63
+ <User className="w-5 h-5 text-primary" />
64
+ </div>
65
+ <div>
66
+ <CardTitle>Profile</CardTitle>
67
+ <CardDescription>Manage your personal information</CardDescription>
68
+ </div>
69
+ </div>
70
+ </CardHeader>
71
+ <CardContent className="el-space-y-content">
72
+ <div className="grid grid-cols-1 sm:grid-cols-2 el-gap-field">
73
+ <FormField label="First Name">
74
+ <Input defaultValue="John" />
75
+ </FormField>
76
+ <FormField label="Last Name">
77
+ <Input defaultValue="Doe" />
78
+ </FormField>
42
79
  </div>
43
- <div>
44
- <label className="block text-sm font-medium text-foreground mb-1">
45
- Last Name
46
- </label>
47
- <Input defaultValue="Doe" hideMessage />
80
+ <div className="el-gap-field">
81
+ <FormField label="Email">
82
+ <Input type="email" defaultValue="john.doe@example.com" />
83
+ </FormField>
48
84
  </div>
49
- </div>
50
- <div>
51
- <label className="block text-sm font-medium text-foreground mb-1">
52
- Email
53
- </label>
54
- <Input type="email" defaultValue="john.doe@example.com" hideMessage />
55
- </div>
56
- <div className="pt-2">
57
- <Button>Save Changes</Button>
58
- </div>
59
- </CardContent>
60
- </Card>
85
+ <div className="el-gap-field flex justify-end">
86
+ <Button>
87
+ <Save className="w-4 h-4 el-mr-xs" />
88
+ Save Changes
89
+ </Button>
90
+ </div>
91
+ </CardContent>
92
+ </Card>
61
93
 
62
- {/* Notifications Section */}
63
- <Card padding="none">
64
- <CardHeader className="p-6">
65
- <CardTitle className="flex items-center gap-3">
66
- <Bell className="w-5 h-5 text-muted-foreground" />
67
- Notifications
68
- </CardTitle>
69
- </CardHeader>
70
- <CardContent className="p-6 pt-0 space-y-4">
71
- <div className="flex items-center justify-between">
72
- <div>
73
- <p className="font-medium text-foreground">Push Notifications</p>
74
- <p className="text-sm text-muted-foreground">Receive push notifications for updates</p>
94
+ {/* Appearance Section */}
95
+ <Card>
96
+ <CardHeader>
97
+ <div className="flex items-center el-gap-sm">
98
+ <div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
99
+ <Palette className="w-5 h-5 text-primary" />
100
+ </div>
101
+ <div>
102
+ <CardTitle>Appearance</CardTitle>
103
+ <CardDescription>Customize your visual preferences</CardDescription>
104
+ </div>
75
105
  </div>
76
- <Toggle checked={notifications} onChange={setNotifications} />
77
- </div>
78
- <div className="flex items-center justify-between">
79
- <div>
80
- <p className="font-medium text-foreground">Email Updates</p>
81
- <p className="text-sm text-muted-foreground">Receive weekly email summaries</p>
106
+ </CardHeader>
107
+ <CardContent className="el-space-y-content">
108
+ {/* Theme Setting */}
109
+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
110
+ <div className="flex items-start el-gap-sm">
111
+ <Moon className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
112
+ <div>
113
+ <p className="font-medium text-foreground">Theme</p>
114
+ <p className="text-sm text-muted-foreground">Choose your preferred color scheme</p>
115
+ </div>
116
+ </div>
117
+ <div className="sm:w-48 flex-shrink-0">
118
+ <Select
119
+ options={themeOptions}
120
+ defaultValue="system"
121
+ />
122
+ </div>
82
123
  </div>
83
- <Toggle checked={emailUpdates} onChange={setEmailUpdates} />
84
- </div>
85
- </CardContent>
86
- </Card>
87
124
 
88
- {/* Appearance Section */}
89
- <Card padding="none">
90
- <CardHeader className="p-6">
91
- <CardTitle className="flex items-center gap-3">
92
- <Palette className="w-5 h-5 text-muted-foreground" />
93
- Appearance
94
- </CardTitle>
95
- </CardHeader>
96
- <CardContent className="p-6 pt-0 space-y-4">
97
- <div>
98
- <label className="block text-sm font-medium text-foreground mb-1">
99
- Theme
100
- </label>
101
- <Select
102
- options={[
103
- { value: 'light', label: 'Light' },
104
- { value: 'dark', label: 'Dark' },
105
- { value: 'system', label: 'System' },
106
- ]}
107
- value="light"
108
- hideMessage
109
- />
110
- </div>
111
- <div>
112
- <label className="block text-sm font-medium text-foreground mb-1">
113
- Language
114
- </label>
115
- <Select
116
- options={[
117
- { value: 'en', label: 'English' },
118
- { value: 'es', label: 'Spanish' },
119
- { value: 'fr', label: 'French' },
120
- ]}
121
- value="en"
122
- hideMessage
123
- />
124
- </div>
125
- </CardContent>
126
- </Card>
125
+ <Separator />
126
+
127
+ {/* Language Setting */}
128
+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
129
+ <div className="flex items-start el-gap-sm">
130
+ <Mail className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
131
+ <div>
132
+ <p className="font-medium text-foreground">Language</p>
133
+ <p className="text-sm text-muted-foreground">Select your preferred language</p>
134
+ </div>
135
+ </div>
136
+ <div className="sm:w-48 flex-shrink-0">
137
+ <Select
138
+ options={languageOptions}
139
+ defaultValue="en"
140
+ />
141
+ </div>
142
+ </div>
143
+ </CardContent>
144
+ </Card>
127
145
 
128
- {/* Security Section */}
129
- <Card padding="none">
130
- <CardHeader className="p-6">
131
- <CardTitle className="flex items-center gap-3">
132
- <Shield className="w-5 h-5 text-muted-foreground" />
133
- Security
134
- </CardTitle>
135
- </CardHeader>
136
- <CardContent className="p-6 pt-0 space-y-4">
137
- <div>
138
- <label className="block text-sm font-medium text-foreground mb-1">
139
- Current Password
140
- </label>
141
- <Input type="password" placeholder="Enter current password" hideMessage />
142
- </div>
143
- <div>
144
- <label className="block text-sm font-medium text-foreground mb-1">
145
- New Password
146
- </label>
147
- <Input type="password" placeholder="Enter new password" hideMessage />
148
- </div>
149
- <div>
150
- <label className="block text-sm font-medium text-foreground mb-1">
151
- Confirm New Password
152
- </label>
153
- <Input type="password" placeholder="Confirm new password" hideMessage />
154
- </div>
155
- <div className="pt-2">
156
- <Button>Update Password</Button>
157
- </div>
158
- </CardContent>
159
- </Card>
146
+ {/* Notifications Section */}
147
+ <Card>
148
+ <CardHeader>
149
+ <div className="flex items-center el-gap-sm">
150
+ <div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
151
+ <Bell className="w-5 h-5 text-primary" />
152
+ </div>
153
+ <div>
154
+ <CardTitle>Notifications</CardTitle>
155
+ <CardDescription>Configure your notification preferences</CardDescription>
156
+ </div>
157
+ </div>
158
+ </CardHeader>
159
+ <CardContent className="el-space-y-content">
160
+ {/* Push Notifications */}
161
+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
162
+ <div className="flex items-start el-gap-sm">
163
+ <Bell className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
164
+ <div>
165
+ <p className="font-medium text-foreground">Push Notifications</p>
166
+ <p className="text-sm text-muted-foreground">Receive push notifications for updates</p>
167
+ </div>
168
+ </div>
169
+ <div className="flex-shrink-0">
170
+ <Toggle checked={notifications} onChange={setNotifications} />
171
+ </div>
172
+ </div>
173
+
174
+ <Separator />
175
+
176
+ {/* Email Updates */}
177
+ <div className="flex flex-col sm:flex-row sm:items-center sm:justify-between el-gap-md el-py-sm">
178
+ <div className="flex items-start el-gap-sm">
179
+ <Mail className="w-5 h-5 text-muted-foreground el-mt-xs flex-shrink-0" />
180
+ <div>
181
+ <p className="font-medium text-foreground">Email Updates</p>
182
+ <p className="text-sm text-muted-foreground">Receive weekly email summaries</p>
183
+ </div>
184
+ </div>
185
+ <div className="flex-shrink-0">
186
+ <Toggle checked={emailUpdates} onChange={setEmailUpdates} />
187
+ </div>
188
+ </div>
189
+ </CardContent>
190
+ </Card>
191
+
192
+ {/* Security Section */}
193
+ <Card>
194
+ <CardHeader>
195
+ <div className="flex items-center el-gap-sm">
196
+ <div className="w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center">
197
+ <Shield className="w-5 h-5 text-primary" />
198
+ </div>
199
+ <div>
200
+ <CardTitle>Security</CardTitle>
201
+ <CardDescription>Manage your password and security settings</CardDescription>
202
+ </div>
203
+ </div>
204
+ </CardHeader>
205
+ <CardContent className="el-space-y-content">
206
+ {/* Hidden username field for accessibility - helps password managers */}
207
+ <input type="text" name="username" autoComplete="username" className="sr-only" aria-hidden="true" tabIndex={-1} />
208
+ <div className="el-gap-field">
209
+ <FormField label="Current Password">
210
+ <Input type="password" placeholder="Enter current password" autoComplete="current-password" />
211
+ </FormField>
212
+ </div>
213
+ <div className="grid grid-cols-1 sm:grid-cols-2 el-gap-field">
214
+ <FormField label="New Password">
215
+ <Input type="password" placeholder="Enter new password" autoComplete="new-password" />
216
+ </FormField>
217
+ <FormField label="Confirm Password">
218
+ <Input type="password" placeholder="Confirm new password" autoComplete="new-password" />
219
+ </FormField>
220
+ </div>
221
+ <div className="el-gap-field flex justify-end">
222
+ <Button>
223
+ <Shield className="w-4 h-4 el-mr-xs" />
224
+ Update Password
225
+ </Button>
226
+ </div>
227
+ </CardContent>
228
+ </Card>
229
+ </div>
160
230
  </div>
161
231
  </div>
162
232
  );
163
233
  }
234
+
235
+ export default <%= pascalName %>Page;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elsapiens/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "CLI scaffolding tool for elSapiens SDK projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -57,6 +57,8 @@
57
57
  "build": "tsup",
58
58
  "dev": "tsup --watch",
59
59
  "clean": "rm -rf dist",
60
- "typecheck": "tsc --noEmit"
60
+ "typecheck": "tsc --noEmit",
61
+ "setup:global": "./scripts/setup-global.sh",
62
+ "unlink:global": "pnpm unlink --global"
61
63
  }
62
64
  }