@aex.is/zero 0.1.1 → 0.1.3

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,62 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Box, Text } from 'ink';
3
- import { SelectList, SelectItem } from '../components/SelectList.js';
4
- import { frameworks } from '../../config/frameworks.js';
5
- import { modules } from '../../config/modules.js';
6
- import type { FrameworkId, ModuleId } from '../../types.js';
7
-
8
- export type ConfirmAction =
9
- | 'continue'
10
- | 'edit-name'
11
- | 'edit-domain'
12
- | 'edit-framework'
13
- | 'edit-modules'
14
- | 'cancel';
15
-
16
- interface ConfirmProps {
17
- name: string;
18
- domain: string;
19
- framework: FrameworkId;
20
- modules: ModuleId[];
21
- onAction: (action: ConfirmAction) => void;
22
- }
23
-
24
- const actionItems: SelectItem[] = [
25
- { id: 'continue', label: 'Continue' },
26
- { id: 'edit-name', label: 'Edit name' },
27
- { id: 'edit-domain', label: 'Edit domain' },
28
- { id: 'edit-framework', label: 'Edit framework' },
29
- { id: 'edit-modules', label: 'Edit modules' },
30
- { id: 'cancel', label: 'Cancel' }
31
- ];
32
-
33
- export function Confirm({ name, domain, framework, modules: selectedModules, onAction }: ConfirmProps) {
34
- const [selection, setSelection] = useState<ConfirmAction>('continue');
35
-
36
- const frameworkLabel = frameworks.find((item) => item.id === framework)?.label ?? framework;
37
- const moduleLabels = selectedModules
38
- .map((id) => modules.find((item) => item.id === id)?.label ?? id)
39
- .join(', ');
40
-
41
- return (
42
- <Box flexDirection="column">
43
- <Text color="cyan">Confirm</Text>
44
- <Box flexDirection="column" marginTop={1}>
45
- <Text>App name: {name}</Text>
46
- <Text>Domain: {domain || 'None'}</Text>
47
- <Text>Framework: {frameworkLabel}</Text>
48
- <Text>Modules: {moduleLabels || 'None'}</Text>
49
- </Box>
50
- <Box marginTop={1}>
51
- <SelectList
52
- items={actionItems}
53
- selectedIds={[selection]}
54
- onChange={(next) => setSelection(next[0] as ConfirmAction)}
55
- onSubmit={() => onAction(selection)}
56
- multi={false}
57
- hint="Select an action and press Enter."
58
- />
59
- </Box>
60
- </Box>
61
- );
62
- }
@@ -1,29 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Box, Text } from 'ink';
3
- import TextInput from 'ink-text-input';
4
-
5
- interface DomainPromptProps {
6
- initialValue: string;
7
- onSubmit: (value: string) => void;
8
- }
9
-
10
- export function DomainPrompt({ initialValue, onSubmit }: DomainPromptProps) {
11
- const [value, setValue] = useState(initialValue);
12
-
13
- const handleSubmit = () => {
14
- onSubmit(value.trim());
15
- };
16
-
17
- return (
18
- <Box flexDirection="column">
19
- <Text color="cyan">Domain (optional)</Text>
20
- <Text color="gray">Press Enter to continue or leave blank.</Text>
21
- <TextInput
22
- value={value}
23
- onChange={setValue}
24
- onSubmit={handleSubmit}
25
- placeholder="example.com"
26
- />
27
- </Box>
28
- );
29
- }
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { Box, Text } from 'ink';
3
- import { SelectList, SelectItem } from '../components/SelectList.js';
4
- import { frameworks } from '../../config/frameworks.js';
5
- import type { FrameworkId } from '../../types.js';
6
-
7
- interface FrameworkSelectProps {
8
- value: FrameworkId;
9
- onChange: (value: FrameworkId) => void;
10
- onConfirm: () => void;
11
- }
12
-
13
- export function FrameworkSelect({ value, onChange, onConfirm }: FrameworkSelectProps) {
14
- const items: SelectItem[] = frameworks.map((framework) => ({
15
- id: framework.id,
16
- label: framework.label,
17
- description: framework.description
18
- }));
19
-
20
- return (
21
- <Box flexDirection="column">
22
- <Text color="cyan">Framework</Text>
23
- <Text color="gray">Use arrows to move, space to select, Enter to confirm.</Text>
24
- <SelectList
25
- items={items}
26
- selectedIds={[value]}
27
- onChange={(next) => onChange(next[0] as FrameworkId)}
28
- onSubmit={onConfirm}
29
- multi={false}
30
- hint="( ) radio select"
31
- />
32
- </Box>
33
- );
34
- }
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import { Box, Text, useInput } from 'ink';
3
-
4
- interface IntroProps {
5
- onContinue: () => void;
6
- }
7
-
8
- const introArt = [
9
- ' _____',
10
- ' / ___ \\ ',
11
- ' / / _ \\ \\ ',
12
- ' | |/ /| |',
13
- ' \\ \\_/ / /',
14
- ' \\___/_/'
15
- ].join('\n');
16
-
17
- export function Intro({ onContinue }: IntroProps) {
18
- useInput((input, key) => {
19
- if (key.return || input === ' ') {
20
- onContinue();
21
- }
22
- });
23
-
24
- return (
25
- <Box flexDirection="column">
26
- <Text>{introArt}</Text>
27
- <Text color="cyan">Aexis Zero</Text>
28
- <Text color="gray">Press Enter to begin.</Text>
29
- </Box>
30
- );
31
- }
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { Box, Text } from 'ink';
3
- import { SelectList, SelectItem } from '../components/SelectList.js';
4
- import { modules } from '../../config/modules.js';
5
- import type { ModuleId } from '../../types.js';
6
-
7
- interface ModuleSelectProps {
8
- value: ModuleId[];
9
- onChange: (value: ModuleId[]) => void;
10
- onConfirm: () => void;
11
- }
12
-
13
- export function ModuleSelect({ value, onChange, onConfirm }: ModuleSelectProps) {
14
- const items: SelectItem[] = modules.map((module) => ({
15
- id: module.id,
16
- label: module.label,
17
- description: module.description
18
- }));
19
-
20
- return (
21
- <Box flexDirection="column">
22
- <Text color="cyan">Modules</Text>
23
- <Text color="gray">Use arrows to move, space to toggle, Enter to confirm.</Text>
24
- <SelectList
25
- items={items}
26
- selectedIds={value}
27
- onChange={(next) => onChange(next as ModuleId[])}
28
- onSubmit={onConfirm}
29
- multi
30
- hint="[ ] multi-select"
31
- />
32
- </Box>
33
- );
34
- }
@@ -1,37 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Box, Text } from 'ink';
3
- import TextInput from 'ink-text-input';
4
-
5
- interface NamePromptProps {
6
- initialValue: string;
7
- onSubmit: (value: string) => void;
8
- }
9
-
10
- export function NamePrompt({ initialValue, onSubmit }: NamePromptProps) {
11
- const [value, setValue] = useState(initialValue);
12
- const [error, setError] = useState('');
13
-
14
- const handleSubmit = () => {
15
- const trimmed = value.trim();
16
- if (!trimmed) {
17
- setError('App name is required.');
18
- return;
19
- }
20
- setError('');
21
- onSubmit(trimmed);
22
- };
23
-
24
- return (
25
- <Box flexDirection="column">
26
- <Text color="cyan">App name</Text>
27
- <Text color="gray">Required. Press Enter to continue.</Text>
28
- <TextInput
29
- value={value}
30
- onChange={setValue}
31
- onSubmit={handleSubmit}
32
- placeholder="my-app"
33
- />
34
- {error ? <Text color="red">{error}</Text> : null}
35
- </Box>
36
- );
37
- }