@maayan-albert/moab-sdk 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.
package/README.md ADDED
@@ -0,0 +1,101 @@
1
+ # moab-sdk
2
+
3
+ A JavaScript/TypeScript SDK for Moab.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @maayan-albert/moab-sdk
9
+ # or
10
+ npm install @maayan-albert/moab-sdk
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### SDK Usage
16
+
17
+ ```javascript
18
+ const MoabSDK = require('@maayan-albert/moab-sdk');
19
+
20
+ const sdk = new MoabSDK({
21
+ // your options here
22
+ });
23
+
24
+ sdk.hello();
25
+ ```
26
+
27
+ ### UI Components (React TypeScript)
28
+
29
+ ```tsx
30
+ import React from 'react';
31
+ import { Button, Card, Input } from '@maayan-albert/moab-sdk/components';
32
+
33
+ const MyApp: React.FC = () => {
34
+ return (
35
+ <div>
36
+ <Card title="Welcome">
37
+ <Input label="Name" placeholder="Enter your name" />
38
+ <Button variant="primary" onClick={() => alert('Clicked!')}>
39
+ Submit
40
+ </Button>
41
+ </Card>
42
+ </div>
43
+ );
44
+ };
45
+ ```
46
+
47
+ ## Development
48
+
49
+ ```bash
50
+ # Install dependencies
51
+ pnpm install
52
+
53
+ # Run the SDK example
54
+ pnpm start
55
+ # or
56
+ pnpm example
57
+
58
+ # Run the component demo (dev server with hot reload)
59
+ pnpm demo
60
+ # This will start a Vite dev server (usually http://localhost:5173) where you can preview all UI components
61
+
62
+ # Build the demo for production
63
+ pnpm run demo:build
64
+
65
+ # Preview the production build
66
+ pnpm run demo:preview
67
+
68
+ # Type check
69
+ pnpm type-check
70
+
71
+ # Build
72
+ pnpm run build
73
+
74
+ # Test
75
+ pnpm test
76
+ ```
77
+
78
+ ### Previewing Components
79
+
80
+ To preview and test the UI components, run:
81
+
82
+ ```bash
83
+ pnpm demo
84
+ ```
85
+
86
+ This starts a Vite development server (typically at `http://localhost:5173`) with:
87
+ - ⚡ Fast hot module replacement (HMR) - changes appear instantly
88
+ - 🔥 Zero-config setup - works out of the box
89
+ - 📦 Automatic TypeScript/React bundling
90
+ - 🎨 See all components in action with live reload
91
+
92
+ You can:
93
+ - See all components in action
94
+ - Test different variants and props
95
+ - Interact with components to verify behavior
96
+ - Edit components and see changes instantly
97
+ - Use this as a reference for implementing components in your apps
98
+
99
+ ## License
100
+
101
+ MIT
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+
3
+ type ButtonVariant = "primary" | "secondary" | "outline";
4
+ type ButtonSize = "small" | "medium" | "large";
5
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ children: React.ReactNode;
7
+ variant?: ButtonVariant;
8
+ size?: ButtonSize;
9
+ disabled?: boolean;
10
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Button component
15
+ */
16
+ declare const Button: React.FC<ButtonProps>;
17
+
18
+ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
19
+ children: React.ReactNode;
20
+ title?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Card component
25
+ */
26
+ declare const Card: React.FC<CardProps>;
27
+
28
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
29
+ label?: string;
30
+ type?: string;
31
+ placeholder?: string;
32
+ value?: string;
33
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
34
+ required?: boolean;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * Input component
39
+ */
40
+ declare const Input: React.FC<InputProps>;
41
+
42
+ interface DrawingToolProps extends React.HTMLAttributes<HTMLDivElement> {
43
+ width?: number;
44
+ height?: number;
45
+ className?: string;
46
+ overlay?: boolean;
47
+ }
48
+ /**
49
+ * DrawingTool component - A canvas-based drawing tool
50
+ */
51
+ declare const DrawingTool: React.FC<DrawingToolProps>;
52
+
53
+ export { Button, Button as ButtonDefault, type ButtonProps, type ButtonSize, type ButtonVariant, Card, Card as CardDefault, type CardProps, DrawingTool, DrawingTool as DrawingToolDefault, type DrawingToolProps, Input, Input as InputDefault, type InputProps };
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+
3
+ type ButtonVariant = "primary" | "secondary" | "outline";
4
+ type ButtonSize = "small" | "medium" | "large";
5
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
6
+ children: React.ReactNode;
7
+ variant?: ButtonVariant;
8
+ size?: ButtonSize;
9
+ disabled?: boolean;
10
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Button component
15
+ */
16
+ declare const Button: React.FC<ButtonProps>;
17
+
18
+ interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
19
+ children: React.ReactNode;
20
+ title?: string;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * Card component
25
+ */
26
+ declare const Card: React.FC<CardProps>;
27
+
28
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
29
+ label?: string;
30
+ type?: string;
31
+ placeholder?: string;
32
+ value?: string;
33
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
34
+ required?: boolean;
35
+ className?: string;
36
+ }
37
+ /**
38
+ * Input component
39
+ */
40
+ declare const Input: React.FC<InputProps>;
41
+
42
+ interface DrawingToolProps extends React.HTMLAttributes<HTMLDivElement> {
43
+ width?: number;
44
+ height?: number;
45
+ className?: string;
46
+ overlay?: boolean;
47
+ }
48
+ /**
49
+ * DrawingTool component - A canvas-based drawing tool
50
+ */
51
+ declare const DrawingTool: React.FC<DrawingToolProps>;
52
+
53
+ export { Button, Button as ButtonDefault, type ButtonProps, type ButtonSize, type ButtonVariant, Card, Card as CardDefault, type CardProps, DrawingTool, DrawingTool as DrawingToolDefault, type DrawingToolProps, Input, Input as InputDefault, type InputProps };