@mehdashti/ui 0.1.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 +228 -0
- package/dist/components/__tests__/button.test.d.ts +2 -0
- package/dist/components/__tests__/button.test.d.ts.map +1 -0
- package/dist/components/__tests__/button.test.js +105 -0
- package/dist/components/__tests__/button.test.js.map +1 -0
- package/dist/components/__tests__/input.test.d.ts +2 -0
- package/dist/components/__tests__/input.test.d.ts.map +1 -0
- package/dist/components/__tests__/input.test.js +270 -0
- package/dist/components/__tests__/input.test.js.map +1 -0
- package/dist/components/__tests__/label.test.d.ts +2 -0
- package/dist/components/__tests__/label.test.d.ts.map +1 -0
- package/dist/components/__tests__/label.test.js +181 -0
- package/dist/components/__tests__/label.test.js.map +1 -0
- package/dist/components/button.d.ts +28 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +45 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/button.stories.js +103 -0
- package/dist/components/button.stories.js.map +1 -0
- package/dist/components/dialog.d.ts +20 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +22 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dialog.stories.d.ts +44 -0
- package/dist/components/dialog.stories.d.ts.map +1 -0
- package/dist/components/dialog.stories.js +64 -0
- package/dist/components/dialog.stories.js.map +1 -0
- package/dist/components/input.d.ts +14 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +17 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/input.stories.d.ts +80 -0
- package/dist/components/input.stories.d.ts.map +1 -0
- package/dist/components/input.stories.js +142 -0
- package/dist/components/input.stories.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +10 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/label.stories.d.ts +52 -0
- package/dist/components/label.stories.d.ts.map +1 -0
- package/dist/components/label.stories.js +74 -0
- package/dist/components/label.stories.js.map +1 -0
- package/dist/components/select.d.ts +14 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +26 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/select.stories.d.ts +48 -0
- package/dist/components/select.stories.d.ts.map +1 -0
- package/dist/components/select.stories.js +67 -0
- package/dist/components/select.stories.js.map +1 -0
- package/dist/components/table.d.ts +11 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +21 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +13 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tabs.stories.d.ts +40 -0
- package/dist/components/tabs.stories.d.ts.map +1 -0
- package/dist/components/tabs.stories.js +100 -0
- package/dist/components/tabs.stories.js.map +1 -0
- package/dist/components/toast.d.ts +16 -0
- package/dist/components/toast.d.ts.map +1 -0
- package/dist/components/toast.js +34 -0
- package/dist/components/toast.js.map +1 -0
- package/dist/components/toast.stories.d.ts +371 -0
- package/dist/components/toast.stories.d.ts.map +1 -0
- package/dist/components/toast.stories.js +228 -0
- package/dist/components/toast.stories.js.map +1 -0
- package/dist/hooks/use-toast.d.ts +45 -0
- package/dist/hooks/use-toast.d.ts.map +1 -0
- package/dist/hooks/use-toast.js +125 -0
- package/dist/hooks/use-toast.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +115 -0
package/README.md
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# @smart/ui
|
|
2
|
+
|
|
3
|
+
> React UI components for Smart Platform
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @smart/ui @smart/tokens
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Required peer dependencies:**
|
|
12
|
+
```bash
|
|
13
|
+
pnpm add react react-dom
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Setup
|
|
17
|
+
|
|
18
|
+
### 1. Import Theme CSS
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import "@smart/tokens/theme.css";
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 2. Configure Tailwind (if using)
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
// tailwind.config.js
|
|
28
|
+
export default {
|
|
29
|
+
content: [
|
|
30
|
+
"./src/**/*.{ts,tsx}",
|
|
31
|
+
"./node_modules/@smart/ui/dist/**/*.js",
|
|
32
|
+
],
|
|
33
|
+
theme: {
|
|
34
|
+
extend: {
|
|
35
|
+
colors: {
|
|
36
|
+
border: "var(--border)",
|
|
37
|
+
input: "var(--border)",
|
|
38
|
+
ring: "var(--primary)",
|
|
39
|
+
background: "var(--background)",
|
|
40
|
+
foreground: "var(--foreground)",
|
|
41
|
+
primary: {
|
|
42
|
+
DEFAULT: "var(--primary)",
|
|
43
|
+
foreground: "var(--primary-foreground)",
|
|
44
|
+
},
|
|
45
|
+
secondary: {
|
|
46
|
+
DEFAULT: "var(--secondary)",
|
|
47
|
+
foreground: "var(--secondary-foreground)",
|
|
48
|
+
},
|
|
49
|
+
destructive: {
|
|
50
|
+
DEFAULT: "var(--destructive)",
|
|
51
|
+
foreground: "var(--destructive-foreground)",
|
|
52
|
+
},
|
|
53
|
+
muted: {
|
|
54
|
+
DEFAULT: "var(--muted)",
|
|
55
|
+
foreground: "var(--muted-foreground)",
|
|
56
|
+
},
|
|
57
|
+
accent: {
|
|
58
|
+
DEFAULT: "var(--accent)",
|
|
59
|
+
foreground: "var(--accent-foreground)",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Components
|
|
68
|
+
|
|
69
|
+
### Button
|
|
70
|
+
|
|
71
|
+
```tsx
|
|
72
|
+
import { Button } from "@smart/ui";
|
|
73
|
+
|
|
74
|
+
function App() {
|
|
75
|
+
return (
|
|
76
|
+
<>
|
|
77
|
+
<Button variant="default">Default</Button>
|
|
78
|
+
<Button variant="destructive">Delete</Button>
|
|
79
|
+
<Button variant="outline">Outline</Button>
|
|
80
|
+
<Button variant="secondary">Secondary</Button>
|
|
81
|
+
<Button variant="ghost">Ghost</Button>
|
|
82
|
+
<Button variant="link">Link</Button>
|
|
83
|
+
|
|
84
|
+
{/* Sizes */}
|
|
85
|
+
<Button size="sm">Small</Button>
|
|
86
|
+
<Button size="default">Default</Button>
|
|
87
|
+
<Button size="lg">Large</Button>
|
|
88
|
+
<Button size="icon">
|
|
89
|
+
<svg>...</svg>
|
|
90
|
+
</Button>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Input
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
import { Input } from "@smart/ui";
|
|
100
|
+
|
|
101
|
+
function App() {
|
|
102
|
+
return (
|
|
103
|
+
<>
|
|
104
|
+
<Input type="text" placeholder="Enter text" />
|
|
105
|
+
<Input type="email" placeholder="Enter email" />
|
|
106
|
+
<Input type="password" placeholder="Enter password" />
|
|
107
|
+
<Input type="file" />
|
|
108
|
+
|
|
109
|
+
{/* Disabled */}
|
|
110
|
+
<Input disabled placeholder="Disabled" />
|
|
111
|
+
|
|
112
|
+
{/* With error */}
|
|
113
|
+
<Input aria-invalid placeholder="Invalid input" />
|
|
114
|
+
</>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Select
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import {
|
|
123
|
+
Select,
|
|
124
|
+
SelectTrigger,
|
|
125
|
+
SelectValue,
|
|
126
|
+
SelectContent,
|
|
127
|
+
SelectItem,
|
|
128
|
+
SelectGroup,
|
|
129
|
+
SelectLabel,
|
|
130
|
+
} from "@smart/ui";
|
|
131
|
+
|
|
132
|
+
function App() {
|
|
133
|
+
return (
|
|
134
|
+
<Select>
|
|
135
|
+
<SelectTrigger className="w-[180px]">
|
|
136
|
+
<SelectValue placeholder="Select a fruit" />
|
|
137
|
+
</SelectTrigger>
|
|
138
|
+
<SelectContent>
|
|
139
|
+
<SelectGroup>
|
|
140
|
+
<SelectLabel>Fruits</SelectLabel>
|
|
141
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
142
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
143
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
144
|
+
</SelectGroup>
|
|
145
|
+
</SelectContent>
|
|
146
|
+
</Select>
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Utilities
|
|
152
|
+
|
|
153
|
+
### cn (className merger)
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { cn } from "@smart/ui";
|
|
157
|
+
|
|
158
|
+
// Merge classes with proper precedence
|
|
159
|
+
const className = cn(
|
|
160
|
+
"base-class",
|
|
161
|
+
condition && "conditional-class",
|
|
162
|
+
"text-red-500 text-blue-500" // blue wins (last one)
|
|
163
|
+
);
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Styling
|
|
167
|
+
|
|
168
|
+
All components use CSS variables from `@smart/tokens`:
|
|
169
|
+
|
|
170
|
+
- `--primary`, `--primary-foreground`
|
|
171
|
+
- `--secondary`, `--secondary-foreground`
|
|
172
|
+
- `--destructive`, `--destructive-foreground`
|
|
173
|
+
- `--accent`, `--accent-foreground`
|
|
174
|
+
- `--muted`, `--muted-foreground`
|
|
175
|
+
- `--background`, `--foreground`
|
|
176
|
+
- `--border`
|
|
177
|
+
|
|
178
|
+
Components automatically support dark mode via `[data-theme="dark"]`.
|
|
179
|
+
|
|
180
|
+
## Examples
|
|
181
|
+
|
|
182
|
+
### Form with validation
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import { Button, Input } from "@smart/ui";
|
|
186
|
+
import { useState } from "react";
|
|
187
|
+
|
|
188
|
+
function LoginForm() {
|
|
189
|
+
const [email, setEmail] = useState("");
|
|
190
|
+
const [isInvalid, setIsInvalid] = useState(false);
|
|
191
|
+
|
|
192
|
+
const handleSubmit = (e: React.FormEvent) => {
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
if (!email.includes("@")) {
|
|
195
|
+
setIsInvalid(true);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
// Submit
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
<form onSubmit={handleSubmit} className="space-y-4">
|
|
203
|
+
<Input
|
|
204
|
+
type="email"
|
|
205
|
+
placeholder="Email"
|
|
206
|
+
value={email}
|
|
207
|
+
onChange={(e) => setEmail(e.target.value)}
|
|
208
|
+
aria-invalid={isInvalid}
|
|
209
|
+
/>
|
|
210
|
+
<Button type="submit">Sign in</Button>
|
|
211
|
+
</form>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Architecture
|
|
217
|
+
|
|
218
|
+
- **Radix UI**: Accessibility primitives
|
|
219
|
+
- **class-variance-authority**: Variant management
|
|
220
|
+
- **clsx + tailwind-merge**: className merging
|
|
221
|
+
- **CSS Variables**: Theme integration with `@smart/tokens`
|
|
222
|
+
|
|
223
|
+
## Browser Support
|
|
224
|
+
|
|
225
|
+
- Chrome (latest)
|
|
226
|
+
- Firefox (latest)
|
|
227
|
+
- Safari (latest)
|
|
228
|
+
- Edge (latest)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/button.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { Button } from '../button';
|
|
6
|
+
describe('Button', () => {
|
|
7
|
+
it('renders with text', () => {
|
|
8
|
+
render(_jsx(Button, { children: "Click me" }));
|
|
9
|
+
expect(screen.getByText('Click me')).toBeInTheDocument();
|
|
10
|
+
});
|
|
11
|
+
it('calls onClick when clicked', async () => {
|
|
12
|
+
const onClick = vi.fn();
|
|
13
|
+
const user = userEvent.setup();
|
|
14
|
+
render(_jsx(Button, { onClick: onClick, children: "Click" }));
|
|
15
|
+
await user.click(screen.getByText('Click'));
|
|
16
|
+
expect(onClick).toHaveBeenCalledTimes(1);
|
|
17
|
+
});
|
|
18
|
+
it('renders with default variant', () => {
|
|
19
|
+
render(_jsx(Button, { children: "Default" }));
|
|
20
|
+
const button = screen.getByText('Default');
|
|
21
|
+
expect(button).toHaveAttribute('data-variant', 'default');
|
|
22
|
+
});
|
|
23
|
+
it('renders with primary/default variant styles', () => {
|
|
24
|
+
render(_jsx(Button, { variant: "default", children: "Primary" }));
|
|
25
|
+
const button = screen.getByText('Primary');
|
|
26
|
+
expect(button).toHaveClass('bg-primary', 'text-primary-foreground');
|
|
27
|
+
});
|
|
28
|
+
it('renders with destructive variant', () => {
|
|
29
|
+
render(_jsx(Button, { variant: "destructive", children: "Delete" }));
|
|
30
|
+
const button = screen.getByText('Delete');
|
|
31
|
+
expect(button).toHaveAttribute('data-variant', 'destructive');
|
|
32
|
+
expect(button).toHaveClass('bg-destructive');
|
|
33
|
+
});
|
|
34
|
+
it('renders with outline variant', () => {
|
|
35
|
+
render(_jsx(Button, { variant: "outline", children: "Outline" }));
|
|
36
|
+
const button = screen.getByText('Outline');
|
|
37
|
+
expect(button).toHaveAttribute('data-variant', 'outline');
|
|
38
|
+
expect(button).toHaveClass('border', 'border-border');
|
|
39
|
+
});
|
|
40
|
+
it('renders with secondary variant', () => {
|
|
41
|
+
render(_jsx(Button, { variant: "secondary", children: "Secondary" }));
|
|
42
|
+
const button = screen.getByText('Secondary');
|
|
43
|
+
expect(button).toHaveAttribute('data-variant', 'secondary');
|
|
44
|
+
expect(button).toHaveClass('bg-secondary');
|
|
45
|
+
});
|
|
46
|
+
it('renders with ghost variant', () => {
|
|
47
|
+
render(_jsx(Button, { variant: "ghost", children: "Ghost" }));
|
|
48
|
+
const button = screen.getByText('Ghost');
|
|
49
|
+
expect(button).toHaveAttribute('data-variant', 'ghost');
|
|
50
|
+
});
|
|
51
|
+
it('renders with link variant', () => {
|
|
52
|
+
render(_jsx(Button, { variant: "link", children: "Link" }));
|
|
53
|
+
const button = screen.getByText('Link');
|
|
54
|
+
expect(button).toHaveAttribute('data-variant', 'link');
|
|
55
|
+
expect(button).toHaveClass('text-primary', 'underline-offset-4');
|
|
56
|
+
});
|
|
57
|
+
it('renders with default size', () => {
|
|
58
|
+
render(_jsx(Button, { children: "Default size" }));
|
|
59
|
+
const button = screen.getByText('Default size');
|
|
60
|
+
expect(button).toHaveAttribute('data-size', 'default');
|
|
61
|
+
expect(button).toHaveClass('h-9', 'px-4', 'py-2');
|
|
62
|
+
});
|
|
63
|
+
it('renders with sm size', () => {
|
|
64
|
+
render(_jsx(Button, { size: "sm", children: "Small" }));
|
|
65
|
+
const button = screen.getByText('Small');
|
|
66
|
+
expect(button).toHaveAttribute('data-size', 'sm');
|
|
67
|
+
expect(button).toHaveClass('h-8');
|
|
68
|
+
});
|
|
69
|
+
it('renders with lg size', () => {
|
|
70
|
+
render(_jsx(Button, { size: "lg", children: "Large" }));
|
|
71
|
+
const button = screen.getByText('Large');
|
|
72
|
+
expect(button).toHaveAttribute('data-size', 'lg');
|
|
73
|
+
expect(button).toHaveClass('h-10');
|
|
74
|
+
});
|
|
75
|
+
it('renders as disabled', () => {
|
|
76
|
+
render(_jsx(Button, { disabled: true, children: "Disabled" }));
|
|
77
|
+
const button = screen.getByText('Disabled');
|
|
78
|
+
expect(button).toBeDisabled();
|
|
79
|
+
expect(button).toHaveClass('disabled:pointer-events-none', 'disabled:opacity-50');
|
|
80
|
+
});
|
|
81
|
+
it('does not call onClick when disabled', async () => {
|
|
82
|
+
const onClick = vi.fn();
|
|
83
|
+
const user = userEvent.setup();
|
|
84
|
+
render(_jsx(Button, { disabled: true, onClick: onClick, children: "Disabled" }));
|
|
85
|
+
await user.click(screen.getByText('Disabled'));
|
|
86
|
+
expect(onClick).not.toHaveBeenCalled();
|
|
87
|
+
});
|
|
88
|
+
it('renders with custom className', () => {
|
|
89
|
+
render(_jsx(Button, { className: "custom-class", children: "Custom" }));
|
|
90
|
+
const button = screen.getByText('Custom');
|
|
91
|
+
expect(button).toHaveClass('custom-class');
|
|
92
|
+
});
|
|
93
|
+
it('renders with children', () => {
|
|
94
|
+
render(_jsxs(Button, { children: [_jsx("span", { children: "Icon" }), _jsx("span", { children: "Text" })] }));
|
|
95
|
+
expect(screen.getByText('Icon')).toBeInTheDocument();
|
|
96
|
+
expect(screen.getByText('Text')).toBeInTheDocument();
|
|
97
|
+
});
|
|
98
|
+
it('passes through HTML attributes', () => {
|
|
99
|
+
render(_jsx(Button, { type: "submit", "aria-label": "Submit form", children: "Submit" }));
|
|
100
|
+
const button = screen.getByText('Submit');
|
|
101
|
+
expect(button).toHaveAttribute('type', 'submit');
|
|
102
|
+
expect(button).toHaveAttribute('aria-label', 'Submit form');
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
//# sourceMappingURL=button.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/button.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OA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,CAAC,CAAA;IAEF,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;QACvC,MAAM,CAAC,KAAC,MAAM,IAAC,SAAS,EAAC,cAAc,uBAAgB,CAAC,CAAA;QACxD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QAEzC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;IAC5C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CACJ,MAAC,MAAM,eACL,kCAAiB,EACjB,kCAAiB,IACV,CACV,CAAA;QAED,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;QACpD,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;IACtD,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,CACJ,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,gBAAY,aAAa,uBAErC,CACV,CAAA;QACD,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QAEzC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAChD,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,YAAY,EAAE,aAAa,CAAC,CAAA;IAC7D,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/input.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { describe, it, expect, vi } from 'vitest';
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { Input } from '../input';
|
|
6
|
+
describe('Input', () => {
|
|
7
|
+
describe('Rendering', () => {
|
|
8
|
+
it('renders with text type by default', () => {
|
|
9
|
+
render(_jsx(Input, { "data-testid": "input" }));
|
|
10
|
+
const input = screen.getByTestId('input');
|
|
11
|
+
expect(input).toBeInTheDocument();
|
|
12
|
+
// Input type defaults to 'text' in browsers even without the attribute
|
|
13
|
+
expect(input.type).toBe('text');
|
|
14
|
+
});
|
|
15
|
+
it('renders with specified type', () => {
|
|
16
|
+
render(_jsx(Input, { type: "email", "data-testid": "input" }));
|
|
17
|
+
const input = screen.getByTestId('input');
|
|
18
|
+
expect(input).toHaveAttribute('type', 'email');
|
|
19
|
+
});
|
|
20
|
+
it('renders with placeholder', () => {
|
|
21
|
+
render(_jsx(Input, { placeholder: "Enter email", "data-testid": "input" }));
|
|
22
|
+
const input = screen.getByTestId('input');
|
|
23
|
+
expect(input).toHaveAttribute('placeholder', 'Enter email');
|
|
24
|
+
});
|
|
25
|
+
it('renders with default value', () => {
|
|
26
|
+
render(_jsx(Input, { defaultValue: "Hello", "data-testid": "input" }));
|
|
27
|
+
const input = screen.getByTestId('input');
|
|
28
|
+
expect(input.value).toBe('Hello');
|
|
29
|
+
});
|
|
30
|
+
it('applies custom className', () => {
|
|
31
|
+
render(_jsx(Input, { className: "custom-class", "data-testid": "input" }));
|
|
32
|
+
const input = screen.getByTestId('input');
|
|
33
|
+
expect(input).toHaveClass('custom-class');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('Input Types', () => {
|
|
37
|
+
it.each([
|
|
38
|
+
['text', 'text'],
|
|
39
|
+
['email', 'email'],
|
|
40
|
+
['password', 'password'],
|
|
41
|
+
['number', 'number'],
|
|
42
|
+
['search', 'search'],
|
|
43
|
+
['tel', 'tel'],
|
|
44
|
+
['url', 'url'],
|
|
45
|
+
['date', 'date'],
|
|
46
|
+
['time', 'time'],
|
|
47
|
+
['file', 'file'],
|
|
48
|
+
])('renders with type %s', (inputType, expectedType) => {
|
|
49
|
+
render(_jsx(Input, { type: inputType, "data-testid": "input" }));
|
|
50
|
+
const input = screen.getByTestId('input');
|
|
51
|
+
expect(input).toHaveAttribute('type', expectedType);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
describe('States', () => {
|
|
55
|
+
it('renders in disabled state', () => {
|
|
56
|
+
render(_jsx(Input, { disabled: true, "data-testid": "input" }));
|
|
57
|
+
const input = screen.getByTestId('input');
|
|
58
|
+
expect(input).toBeDisabled();
|
|
59
|
+
});
|
|
60
|
+
it('renders in error state with aria-invalid', () => {
|
|
61
|
+
render(_jsx(Input, { "aria-invalid": true, "data-testid": "input" }));
|
|
62
|
+
const input = screen.getByTestId('input');
|
|
63
|
+
expect(input).toHaveAttribute('aria-invalid', 'true');
|
|
64
|
+
});
|
|
65
|
+
it('renders as required', () => {
|
|
66
|
+
render(_jsx(Input, { required: true, "data-testid": "input" }));
|
|
67
|
+
const input = screen.getByTestId('input');
|
|
68
|
+
expect(input).toBeRequired();
|
|
69
|
+
});
|
|
70
|
+
it('renders as readonly', () => {
|
|
71
|
+
render(_jsx(Input, { readOnly: true, "data-testid": "input" }));
|
|
72
|
+
const input = screen.getByTestId('input');
|
|
73
|
+
expect(input).toHaveAttribute('readonly');
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
describe('User Interaction', () => {
|
|
77
|
+
it('accepts text input', async () => {
|
|
78
|
+
const user = userEvent.setup();
|
|
79
|
+
render(_jsx(Input, { "data-testid": "input" }));
|
|
80
|
+
const input = screen.getByTestId('input');
|
|
81
|
+
await user.type(input, 'Hello World');
|
|
82
|
+
expect(input.value).toBe('Hello World');
|
|
83
|
+
});
|
|
84
|
+
it('calls onChange when value changes', async () => {
|
|
85
|
+
const onChange = vi.fn();
|
|
86
|
+
const user = userEvent.setup();
|
|
87
|
+
render(_jsx(Input, { onChange: onChange, "data-testid": "input" }));
|
|
88
|
+
const input = screen.getByTestId('input');
|
|
89
|
+
await user.type(input, 'test');
|
|
90
|
+
expect(onChange).toHaveBeenCalled();
|
|
91
|
+
expect(onChange).toHaveBeenCalledTimes(4); // Once per character
|
|
92
|
+
});
|
|
93
|
+
it('calls onFocus when focused', async () => {
|
|
94
|
+
const onFocus = vi.fn();
|
|
95
|
+
const user = userEvent.setup();
|
|
96
|
+
render(_jsx(Input, { onFocus: onFocus, "data-testid": "input" }));
|
|
97
|
+
const input = screen.getByTestId('input');
|
|
98
|
+
await user.click(input);
|
|
99
|
+
expect(onFocus).toHaveBeenCalledTimes(1);
|
|
100
|
+
});
|
|
101
|
+
it('calls onBlur when focus is lost', async () => {
|
|
102
|
+
const onBlur = vi.fn();
|
|
103
|
+
const user = userEvent.setup();
|
|
104
|
+
render(_jsxs(_Fragment, { children: [_jsx(Input, { onBlur: onBlur, "data-testid": "input" }), _jsx("button", { children: "Other element" })] }));
|
|
105
|
+
const input = screen.getByTestId('input');
|
|
106
|
+
await user.click(input);
|
|
107
|
+
await user.tab(); // Move focus away
|
|
108
|
+
expect(onBlur).toHaveBeenCalledTimes(1);
|
|
109
|
+
});
|
|
110
|
+
it('does not accept input when disabled', async () => {
|
|
111
|
+
const user = userEvent.setup();
|
|
112
|
+
render(_jsx(Input, { disabled: true, "data-testid": "input" }));
|
|
113
|
+
const input = screen.getByTestId('input');
|
|
114
|
+
await user.type(input, 'test');
|
|
115
|
+
expect(input.value).toBe('');
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe('Number Input', () => {
|
|
119
|
+
it('accepts numeric input', async () => {
|
|
120
|
+
const user = userEvent.setup();
|
|
121
|
+
render(_jsx(Input, { type: "number", "data-testid": "input" }));
|
|
122
|
+
const input = screen.getByTestId('input');
|
|
123
|
+
await user.type(input, '123');
|
|
124
|
+
expect(input.value).toBe('123');
|
|
125
|
+
});
|
|
126
|
+
it('respects min and max attributes', () => {
|
|
127
|
+
render(_jsx(Input, { type: "number", min: "0", max: "100", "data-testid": "input" }));
|
|
128
|
+
const input = screen.getByTestId('input');
|
|
129
|
+
expect(input).toHaveAttribute('min', '0');
|
|
130
|
+
expect(input).toHaveAttribute('max', '100');
|
|
131
|
+
});
|
|
132
|
+
it('respects step attribute', () => {
|
|
133
|
+
render(_jsx(Input, { type: "number", step: "0.1", "data-testid": "input" }));
|
|
134
|
+
const input = screen.getByTestId('input');
|
|
135
|
+
expect(input).toHaveAttribute('step', '0.1');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe('Email Input', () => {
|
|
139
|
+
it('renders with email type', () => {
|
|
140
|
+
render(_jsx(Input, { type: "email", "data-testid": "input" }));
|
|
141
|
+
const input = screen.getByTestId('input');
|
|
142
|
+
expect(input).toHaveAttribute('type', 'email');
|
|
143
|
+
});
|
|
144
|
+
it('accepts email input', async () => {
|
|
145
|
+
const user = userEvent.setup();
|
|
146
|
+
render(_jsx(Input, { type: "email", "data-testid": "input" }));
|
|
147
|
+
const input = screen.getByTestId('input');
|
|
148
|
+
await user.type(input, 'test@example.com');
|
|
149
|
+
expect(input.value).toBe('test@example.com');
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
describe('Password Input', () => {
|
|
153
|
+
it('renders with password type', () => {
|
|
154
|
+
render(_jsx(Input, { type: "password", "data-testid": "input" }));
|
|
155
|
+
const input = screen.getByTestId('input');
|
|
156
|
+
expect(input).toHaveAttribute('type', 'password');
|
|
157
|
+
});
|
|
158
|
+
it('accepts password input', async () => {
|
|
159
|
+
const user = userEvent.setup();
|
|
160
|
+
render(_jsx(Input, { type: "password", "data-testid": "input" }));
|
|
161
|
+
const input = screen.getByTestId('input');
|
|
162
|
+
await user.type(input, 'secretPassword123');
|
|
163
|
+
expect(input.value).toBe('secretPassword123');
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
describe('Accessibility', () => {
|
|
167
|
+
it('has data-slot attribute', () => {
|
|
168
|
+
render(_jsx(Input, { "data-testid": "input" }));
|
|
169
|
+
const input = screen.getByTestId('input');
|
|
170
|
+
expect(input).toHaveAttribute('data-slot', 'input');
|
|
171
|
+
});
|
|
172
|
+
it('can be labeled with htmlFor', () => {
|
|
173
|
+
render(_jsxs(_Fragment, { children: [_jsx("label", { htmlFor: "test-input", children: "Email" }), _jsx(Input, { id: "test-input" })] }));
|
|
174
|
+
const input = screen.getByLabelText('Email');
|
|
175
|
+
expect(input).toBeInTheDocument();
|
|
176
|
+
});
|
|
177
|
+
it('can have aria-describedby', () => {
|
|
178
|
+
render(_jsxs(_Fragment, { children: [_jsx(Input, { "aria-describedby": "helper-text", "data-testid": "input" }), _jsx("span", { id: "helper-text", children: "Helper text" })] }));
|
|
179
|
+
const input = screen.getByTestId('input');
|
|
180
|
+
expect(input).toHaveAttribute('aria-describedby', 'helper-text');
|
|
181
|
+
});
|
|
182
|
+
it('can have aria-label', () => {
|
|
183
|
+
render(_jsx(Input, { "aria-label": "Email address", "data-testid": "input" }));
|
|
184
|
+
const input = screen.getByTestId('input');
|
|
185
|
+
expect(input).toHaveAttribute('aria-label', 'Email address');
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
describe('Form Integration', () => {
|
|
189
|
+
it('can be used in a form', () => {
|
|
190
|
+
render(_jsx("form", { "data-testid": "form", children: _jsx(Input, { name: "email", "data-testid": "input" }) }));
|
|
191
|
+
const form = screen.getByTestId('form');
|
|
192
|
+
const input = screen.getByTestId('input');
|
|
193
|
+
expect(form).toContainElement(input);
|
|
194
|
+
expect(input).toHaveAttribute('name', 'email');
|
|
195
|
+
});
|
|
196
|
+
it('submits form data correctly', async () => {
|
|
197
|
+
const onSubmit = vi.fn((e) => e.preventDefault());
|
|
198
|
+
const user = userEvent.setup();
|
|
199
|
+
render(_jsxs("form", { onSubmit: onSubmit, children: [_jsx(Input, { name: "email", defaultValue: "test@example.com" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
200
|
+
await user.click(screen.getByText('Submit'));
|
|
201
|
+
expect(onSubmit).toHaveBeenCalledTimes(1);
|
|
202
|
+
});
|
|
203
|
+
it('prevents form submission when required and empty', async () => {
|
|
204
|
+
const onSubmit = vi.fn((e) => e.preventDefault());
|
|
205
|
+
const user = userEvent.setup();
|
|
206
|
+
render(_jsxs("form", { onSubmit: onSubmit, children: [_jsx(Input, { name: "email", required: true, "data-testid": "input" }), _jsx("button", { type: "submit", children: "Submit" })] }));
|
|
207
|
+
const input = screen.getByTestId('input');
|
|
208
|
+
expect(input).toBeRequired();
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
describe('File Input', () => {
|
|
212
|
+
it('renders with file type', () => {
|
|
213
|
+
render(_jsx(Input, { type: "file", "data-testid": "input" }));
|
|
214
|
+
const input = screen.getByTestId('input');
|
|
215
|
+
expect(input).toHaveAttribute('type', 'file');
|
|
216
|
+
});
|
|
217
|
+
it('accepts accept attribute', () => {
|
|
218
|
+
render(_jsx(Input, { type: "file", accept: "image/*", "data-testid": "input" }));
|
|
219
|
+
const input = screen.getByTestId('input');
|
|
220
|
+
expect(input).toHaveAttribute('accept', 'image/*');
|
|
221
|
+
});
|
|
222
|
+
it('accepts multiple attribute', () => {
|
|
223
|
+
render(_jsx(Input, { type: "file", multiple: true, "data-testid": "input" }));
|
|
224
|
+
const input = screen.getByTestId('input');
|
|
225
|
+
expect(input).toHaveAttribute('multiple');
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
describe('Ref Forwarding', () => {
|
|
229
|
+
it('forwards ref correctly', () => {
|
|
230
|
+
const ref = vi.fn();
|
|
231
|
+
render(_jsx(Input, { ref: ref }));
|
|
232
|
+
expect(ref).toHaveBeenCalledWith(expect.any(HTMLInputElement));
|
|
233
|
+
});
|
|
234
|
+
it('allows ref to be used for focus', () => {
|
|
235
|
+
let inputRef = null;
|
|
236
|
+
render(_jsx(Input, { ref: (el) => (inputRef = el) }));
|
|
237
|
+
expect(inputRef).toBeInstanceOf(HTMLInputElement);
|
|
238
|
+
inputRef?.focus();
|
|
239
|
+
expect(inputRef).toHaveFocus();
|
|
240
|
+
});
|
|
241
|
+
});
|
|
242
|
+
describe('CSS Classes', () => {
|
|
243
|
+
it('has base input styles', () => {
|
|
244
|
+
render(_jsx(Input, { "data-testid": "input" }));
|
|
245
|
+
const input = screen.getByTestId('input');
|
|
246
|
+
// Check for some key CSS classes
|
|
247
|
+
expect(input.className).toContain('border-input');
|
|
248
|
+
expect(input.className).toContain('bg-transparent');
|
|
249
|
+
expect(input.className).toContain('px-3');
|
|
250
|
+
});
|
|
251
|
+
it('has focus styles', () => {
|
|
252
|
+
render(_jsx(Input, { "data-testid": "input" }));
|
|
253
|
+
const input = screen.getByTestId('input');
|
|
254
|
+
expect(input.className).toContain('focus-visible:border-ring');
|
|
255
|
+
expect(input.className).toContain('focus-visible:ring-ring');
|
|
256
|
+
});
|
|
257
|
+
it('has disabled styles', () => {
|
|
258
|
+
render(_jsx(Input, { disabled: true, "data-testid": "input" }));
|
|
259
|
+
const input = screen.getByTestId('input');
|
|
260
|
+
expect(input.className).toContain('disabled:opacity-50');
|
|
261
|
+
expect(input.className).toContain('disabled:cursor-not-allowed');
|
|
262
|
+
});
|
|
263
|
+
it('has error styles when aria-invalid', () => {
|
|
264
|
+
render(_jsx(Input, { "aria-invalid": true, "data-testid": "input" }));
|
|
265
|
+
const input = screen.getByTestId('input');
|
|
266
|
+
expect(input.className).toContain('aria-invalid:border-destructive');
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
//# sourceMappingURL=input.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.test.js","sourceRoot":"","sources":["../../../src/components/__tests__/input.test.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,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