@adam-milo/ui 1.0.5
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/LICENSE +23 -0
- package/README.md +461 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +41 -0
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +11 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +38 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +82 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +61 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +69 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +119 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +92 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +115 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +43 -0
- package/dist/src/components/core/button/Button.component.d.ts +32 -0
- package/dist/src/components/core/button/Button.component.d.ts.map +1 -0
- package/dist/src/components/core/icon/Icon.component.d.ts +6 -0
- package/dist/src/components/core/icon/Icon.component.d.ts.map +1 -0
- package/dist/src/components/data-display/card/Card.component.d.ts +42 -0
- package/dist/src/components/data-display/card/Card.component.d.ts.map +1 -0
- package/dist/src/components/data-display/datatable/DataTable.component.d.ts +25 -0
- package/dist/src/components/data-display/datatable/DataTable.component.d.ts.map +1 -0
- package/dist/src/components/feedback/alert/Alert.component.d.ts +19 -0
- package/dist/src/components/feedback/alert/Alert.component.d.ts.map +1 -0
- package/dist/src/components/forms/input/Input.component.d.ts +20 -0
- package/dist/src/components/forms/input/Input.component.d.ts.map +1 -0
- package/dist/src/components/layout/stack/Stack.component.d.ts +21 -0
- package/dist/src/components/layout/stack/Stack.component.d.ts.map +1 -0
- package/dist/src/components/navigation/tabs/Tabs.component.d.ts +44 -0
- package/dist/src/components/navigation/tabs/Tabs.component.d.ts.map +1 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts +44 -0
- package/dist/src/components/overlays/dialog/Dialog.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +18 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/lib/index.d.ts +6 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/package.json +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Adam Milo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
# @adam-milo/ui
|
|
2
|
+
|
|
3
|
+
> A modern, accessible, and fully-typed React component library built with TypeScript and TailwindCSS.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@adam-milo/ui)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 🎨 Features
|
|
11
|
+
|
|
12
|
+
- **React 18** with TypeScript for type-safe development
|
|
13
|
+
- **Modern CSS** with native nesting and logical properties for RTL support
|
|
14
|
+
- **TailwindCSS** integration with comprehensive design tokens
|
|
15
|
+
- **Radix UI** primitives for accessible components
|
|
16
|
+
- **Fully Typed** with comprehensive TypeScript definitions
|
|
17
|
+
- **Tested** with Vitest and React Testing Library
|
|
18
|
+
- **Documented** with Storybook
|
|
19
|
+
- **Accessible** - WCAG compliant components
|
|
20
|
+
- **RTL Ready** - Built-in right-to-left language support
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## 📦 Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @adam-milo/ui
|
|
28
|
+
# or
|
|
29
|
+
yarn add @adam-milo/ui
|
|
30
|
+
# or
|
|
31
|
+
pnpm add @adam-milo/ui
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Peer Dependencies
|
|
35
|
+
|
|
36
|
+
Make sure you have React 18+ installed:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm install react react-dom
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 🚀 Quick Start
|
|
45
|
+
|
|
46
|
+
### 1. Import Styles
|
|
47
|
+
|
|
48
|
+
Import the styles in your app's entry point:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// App.tsx or index.tsx
|
|
52
|
+
import '@adam-milo/ui/styles.css';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Use Components
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { Button, Input, Card } from '@adam-milo/ui';
|
|
59
|
+
|
|
60
|
+
function App() {
|
|
61
|
+
return (
|
|
62
|
+
<Card>
|
|
63
|
+
<h2>Welcome</h2>
|
|
64
|
+
<Input label="Name" placeholder="Enter your name" />
|
|
65
|
+
<Button variant="primary-workspace">Submit</Button>
|
|
66
|
+
</Card>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 3. With TypeScript
|
|
72
|
+
|
|
73
|
+
Full TypeScript support out of the box:
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
import { Button, type ButtonProps } from '@adam-milo/ui';
|
|
77
|
+
|
|
78
|
+
const MyButton: React.FC<{ customProp: string }> = ({ customProp }) => {
|
|
79
|
+
const buttonProps: ButtonProps = {
|
|
80
|
+
variant: 'primary-workspace',
|
|
81
|
+
fullWidth: true,
|
|
82
|
+
onClick: () => console.log(customProp),
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
return <Button {...buttonProps}>Click me</Button>;
|
|
86
|
+
};
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## 📚 Components
|
|
92
|
+
|
|
93
|
+
### Core Components
|
|
94
|
+
|
|
95
|
+
#### Button
|
|
96
|
+
|
|
97
|
+
Multiple variants with full accessibility support:
|
|
98
|
+
|
|
99
|
+
```tsx
|
|
100
|
+
import { Button } from '@adam-milo/ui';
|
|
101
|
+
|
|
102
|
+
// Variants
|
|
103
|
+
<Button variant="primary-workspace">Primary Workspace</Button>
|
|
104
|
+
<Button variant="primary-builder">Primary Builder</Button>
|
|
105
|
+
<Button variant="secondary">Secondary</Button>
|
|
106
|
+
<Button variant="ghost">Ghost</Button>
|
|
107
|
+
|
|
108
|
+
// With icons
|
|
109
|
+
<Button
|
|
110
|
+
variant="primary-workspace"
|
|
111
|
+
iconLeft={<Icon name="plus" />}
|
|
112
|
+
>
|
|
113
|
+
Add Item
|
|
114
|
+
</Button>
|
|
115
|
+
|
|
116
|
+
// Full width
|
|
117
|
+
<Button variant="primary-workspace" fullWidth>
|
|
118
|
+
Submit
|
|
119
|
+
</Button>
|
|
120
|
+
|
|
121
|
+
// Disabled state
|
|
122
|
+
<Button variant="primary-workspace" disabled>
|
|
123
|
+
Loading...
|
|
124
|
+
</Button>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Icon
|
|
128
|
+
|
|
129
|
+
SVG icon wrapper component:
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
import { Icon } from '@adam-milo/ui';
|
|
133
|
+
|
|
134
|
+
<Icon name="check" size="md" />;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Form Components
|
|
138
|
+
|
|
139
|
+
#### Input
|
|
140
|
+
|
|
141
|
+
Text input with label and validation:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
import { Input } from '@adam-milo/ui';
|
|
145
|
+
|
|
146
|
+
<Input label="Email" type="email" placeholder="you@example.com" required />;
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Layout Components
|
|
150
|
+
|
|
151
|
+
#### Stack
|
|
152
|
+
|
|
153
|
+
Flexbox-based spacing utility:
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { Stack } from '@adam-milo/ui';
|
|
157
|
+
|
|
158
|
+
<Stack direction="vertical" spacing={4}>
|
|
159
|
+
<Button>Button 1</Button>
|
|
160
|
+
<Button>Button 2</Button>
|
|
161
|
+
</Stack>;
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### Card
|
|
165
|
+
|
|
166
|
+
Content container with elevation:
|
|
167
|
+
|
|
168
|
+
```tsx
|
|
169
|
+
import { Card } from '@adam-milo/ui';
|
|
170
|
+
|
|
171
|
+
<Card>
|
|
172
|
+
<h3>Card Title</h3>
|
|
173
|
+
<p>Card content goes here</p>
|
|
174
|
+
</Card>;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Data Display
|
|
178
|
+
|
|
179
|
+
#### DataTable
|
|
180
|
+
|
|
181
|
+
Semantic table component:
|
|
182
|
+
|
|
183
|
+
```tsx
|
|
184
|
+
import { DataTable } from '@adam-milo/ui';
|
|
185
|
+
|
|
186
|
+
<DataTable headers={['Name', 'Email', 'Status']} rows={data} />;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Feedback Components
|
|
190
|
+
|
|
191
|
+
#### Alert
|
|
192
|
+
|
|
193
|
+
Contextual feedback messages:
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
import { Alert } from '@adam-milo/ui';
|
|
197
|
+
|
|
198
|
+
<Alert variant="success">Operation completed!</Alert>
|
|
199
|
+
<Alert variant="error">Something went wrong</Alert>
|
|
200
|
+
<Alert variant="warning">Please review your input</Alert>
|
|
201
|
+
<Alert variant="info">New updates available</Alert>
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
### Navigation Components
|
|
205
|
+
|
|
206
|
+
#### Tabs
|
|
207
|
+
|
|
208
|
+
Accessible tabbed interface:
|
|
209
|
+
|
|
210
|
+
```tsx
|
|
211
|
+
import { Tabs } from '@adam-milo/ui';
|
|
212
|
+
|
|
213
|
+
<Tabs defaultValue="tab1">
|
|
214
|
+
<Tabs.List>
|
|
215
|
+
<Tabs.Trigger value="tab1">Tab 1</Tabs.Trigger>
|
|
216
|
+
<Tabs.Trigger value="tab2">Tab 2</Tabs.Trigger>
|
|
217
|
+
</Tabs.List>
|
|
218
|
+
<Tabs.Content value="tab1">Content 1</Tabs.Content>
|
|
219
|
+
<Tabs.Content value="tab2">Content 2</Tabs.Content>
|
|
220
|
+
</Tabs>;
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Overlay Components
|
|
224
|
+
|
|
225
|
+
#### Dialog
|
|
226
|
+
|
|
227
|
+
Accessible modal dialog:
|
|
228
|
+
|
|
229
|
+
```tsx
|
|
230
|
+
import { Dialog } from '@adam-milo/ui';
|
|
231
|
+
|
|
232
|
+
<Dialog>
|
|
233
|
+
<Dialog.Trigger asChild>
|
|
234
|
+
<Button>Open Dialog</Button>
|
|
235
|
+
</Dialog.Trigger>
|
|
236
|
+
<Dialog.Content>
|
|
237
|
+
<Dialog.Title>Dialog Title</Dialog.Title>
|
|
238
|
+
<Dialog.Description>Dialog content goes here</Dialog.Description>
|
|
239
|
+
</Dialog.Content>
|
|
240
|
+
</Dialog>;
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## 🎨 Design Tokens
|
|
246
|
+
|
|
247
|
+
### CSS Variables
|
|
248
|
+
|
|
249
|
+
All design tokens are available as CSS custom properties:
|
|
250
|
+
|
|
251
|
+
```css
|
|
252
|
+
/* Colors */
|
|
253
|
+
--color-text: #191a39;
|
|
254
|
+
--color-action: #272643;
|
|
255
|
+
--color-popup: #ed6726;
|
|
256
|
+
--color-card: #ffffff;
|
|
257
|
+
|
|
258
|
+
/* Spacing */
|
|
259
|
+
--spacing-1: 0.25rem; /* 4px */
|
|
260
|
+
--spacing-2: 0.5rem; /* 8px */
|
|
261
|
+
--spacing-4: 1rem; /* 16px */
|
|
262
|
+
|
|
263
|
+
/* Typography */
|
|
264
|
+
--font-size-8: 1rem; /* 16px */
|
|
265
|
+
--font-size-6: 1.25rem; /* 20px */
|
|
266
|
+
|
|
267
|
+
/* Border Radius */
|
|
268
|
+
--radius-default: 0.25rem; /* 4px */
|
|
269
|
+
--radius-lg: 0.75rem; /* 12px */
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Using Design Tokens
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
// In your components
|
|
276
|
+
const CustomComponent = styled.div`
|
|
277
|
+
color: var(--color-text);
|
|
278
|
+
padding: var(--spacing-4);
|
|
279
|
+
border-radius: var(--radius-default);
|
|
280
|
+
`;
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## ♿ Accessibility
|
|
286
|
+
|
|
287
|
+
All components follow WCAG 2.1 Level AA guidelines:
|
|
288
|
+
|
|
289
|
+
- ✅ Semantic HTML structure
|
|
290
|
+
- ✅ ARIA attributes where needed
|
|
291
|
+
- ✅ Keyboard navigation support
|
|
292
|
+
- ✅ Focus management
|
|
293
|
+
- ✅ Screen reader friendly
|
|
294
|
+
- ✅ Color contrast compliance
|
|
295
|
+
- ✅ Focus-visible indicators
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
## 🌍 RTL Support
|
|
300
|
+
|
|
301
|
+
Components automatically support right-to-left languages:
|
|
302
|
+
|
|
303
|
+
```tsx
|
|
304
|
+
// Set direction on your root element
|
|
305
|
+
<html dir="rtl">
|
|
306
|
+
<body>
|
|
307
|
+
<App />
|
|
308
|
+
</body>
|
|
309
|
+
</html>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
All components use logical CSS properties that automatically adapt to text direction.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## 🧪 Testing
|
|
317
|
+
|
|
318
|
+
### Unit Tests
|
|
319
|
+
|
|
320
|
+
Run tests with Vitest:
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
npm run test
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
Watch mode:
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
npm run test:watch
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
### E2E Tests
|
|
333
|
+
|
|
334
|
+
Cypress tests are available in the main repository.
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## 📖 Documentation
|
|
339
|
+
|
|
340
|
+
### Storybook
|
|
341
|
+
|
|
342
|
+
View interactive component documentation:
|
|
343
|
+
|
|
344
|
+
```bash
|
|
345
|
+
# Clone the repository
|
|
346
|
+
git clone https://github.com/adam-milo/adam-milo-design-system.git
|
|
347
|
+
cd adam-milo-design-system
|
|
348
|
+
|
|
349
|
+
# Install dependencies
|
|
350
|
+
npm install
|
|
351
|
+
|
|
352
|
+
# Run Storybook
|
|
353
|
+
npm run storybook
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
Visit `http://localhost:6006` to explore all components.
|
|
357
|
+
|
|
358
|
+
---
|
|
359
|
+
|
|
360
|
+
## 🛠️ Development
|
|
361
|
+
|
|
362
|
+
### Project Structure
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
packages/ui/
|
|
366
|
+
├── src/
|
|
367
|
+
│ ├── components/
|
|
368
|
+
│ │ ├── core/ # Button, Icon
|
|
369
|
+
│ │ ├── forms/ # Input, Checkbox, Select
|
|
370
|
+
│ │ ├── navigation/ # Tabs, Breadcrumb
|
|
371
|
+
│ │ ├── feedback/ # Alert, Toast
|
|
372
|
+
│ │ ├── data-display/ # Card, DataTable
|
|
373
|
+
│ │ ├── overlays/ # Dialog, Modal
|
|
374
|
+
│ │ └── layout/ # Stack, Grid
|
|
375
|
+
│ ├── lib/ # Utilities
|
|
376
|
+
│ ├── index.ts # Main exports
|
|
377
|
+
│ └── styles.css # Global styles
|
|
378
|
+
├── dist/ # Build output
|
|
379
|
+
├── package.json
|
|
380
|
+
├── vite.config.ts
|
|
381
|
+
└── README.md
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Component Naming
|
|
385
|
+
|
|
386
|
+
Each component follows this structure:
|
|
387
|
+
|
|
388
|
+
```
|
|
389
|
+
ComponentName/
|
|
390
|
+
├── ComponentName.component.tsx # Implementation
|
|
391
|
+
├── ComponentName.css # Styles (if needed)
|
|
392
|
+
├── ComponentName.stories.tsx # Storybook stories
|
|
393
|
+
└── ComponentName.spec.tsx # Tests
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## 📋 Requirements
|
|
399
|
+
|
|
400
|
+
- **Node.js**: >= 18.0.0
|
|
401
|
+
- **npm**: >= 9.0.0
|
|
402
|
+
- **React**: >= 18.2.0
|
|
403
|
+
- **TypeScript**: >= 5.0.0
|
|
404
|
+
|
|
405
|
+
---
|
|
406
|
+
|
|
407
|
+
## 🤝 Contributing
|
|
408
|
+
|
|
409
|
+
We welcome contributions! Please see [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines.
|
|
410
|
+
|
|
411
|
+
### Quick Contribution Guide
|
|
412
|
+
|
|
413
|
+
1. Fork the repository
|
|
414
|
+
2. Create a feature branch: `git checkout -b feature/my-feature`
|
|
415
|
+
3. Make your changes
|
|
416
|
+
4. Run tests: `npm test`
|
|
417
|
+
5. Commit: `git commit -m "feat: add new feature"`
|
|
418
|
+
6. Push: `git push origin feature/my-feature`
|
|
419
|
+
7. Open a Pull Request
|
|
420
|
+
|
|
421
|
+
---
|
|
422
|
+
|
|
423
|
+
## 📄 License
|
|
424
|
+
|
|
425
|
+
MIT © Adam Milo
|
|
426
|
+
|
|
427
|
+
See [LICENSE](./LICENSE) for details.
|
|
428
|
+
|
|
429
|
+
---
|
|
430
|
+
|
|
431
|
+
## 🔗 Links
|
|
432
|
+
|
|
433
|
+
- [GitHub Repository](https://github.com/adam-milo/adam-milo-design-system)
|
|
434
|
+
- [npm Package](https://www.npmjs.com/package/@adam-milo/ui)
|
|
435
|
+
- [Issue Tracker](https://github.com/adam-milo/adam-milo-design-system/issues)
|
|
436
|
+
- [Changelog](https://github.com/adam-milo/adam-milo-design-system/releases)
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 💬 Support
|
|
441
|
+
|
|
442
|
+
- 📧 Email: support@adam-milo.com
|
|
443
|
+
- 🐛 Issues: [GitHub Issues](https://github.com/adam-milo/adam-milo-design-system/issues)
|
|
444
|
+
- 💬 Discussions: [GitHub Discussions](https://github.com/adam-milo/adam-milo-design-system/discussions)
|
|
445
|
+
|
|
446
|
+
---
|
|
447
|
+
|
|
448
|
+
## 🙏 Acknowledgments
|
|
449
|
+
|
|
450
|
+
Built with:
|
|
451
|
+
|
|
452
|
+
- [React](https://react.dev/)
|
|
453
|
+
- [TypeScript](https://www.typescriptlang.org/)
|
|
454
|
+
- [TailwindCSS](https://tailwindcss.com/)
|
|
455
|
+
- [Radix UI](https://www.radix-ui.com/)
|
|
456
|
+
- [Vite](https://vitejs.dev/)
|
|
457
|
+
- [Storybook](https://storybook.js.org/)
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
Made with ❤️ by the Adam Milo team
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index2.cjs"),i=require("./index3.cjs"),t=require("./index4.cjs"),l=require("./index5.cjs"),o=require("./index6.cjs"),c=require("./index7.cjs"),e=require("./index8.cjs"),g=require("./index9.cjs"),a=require("./index10.cjs"),r=require("@adam-milo/icons");exports.Button=n.Button;exports.Input=i.Input;exports.Tabs=t.Tabs;exports.TabsContent=t.TabsContent;exports.TabsList=t.TabsList;exports.TabsTrigger=t.TabsTrigger;exports.Alert=l.Alert;exports.Card=o.Card;exports.CardContent=o.CardContent;exports.CardDescription=o.CardDescription;exports.CardFooter=o.CardFooter;exports.CardHeader=o.CardHeader;exports.CardTitle=o.CardTitle;exports.DataTable=c.DataTable;exports.Dialog=e.Dialog;exports.DialogClose=e.DialogClose;exports.DialogContent=e.DialogContent;exports.DialogDescription=e.DialogDescription;exports.DialogFooter=e.DialogFooter;exports.DialogHeader=e.DialogHeader;exports.DialogOverlay=e.DialogOverlay;exports.DialogPortal=e.DialogPortal;exports.DialogTitle=e.DialogTitle;exports.DialogTrigger=e.DialogTrigger;exports.Stack=g.Stack;exports.cn=a.cn;exports.generateId=a.generateId;Object.defineProperty(exports,"Icon",{enumerable:!0,get:()=>r.Icon});Object.defineProperty(exports,"availableIcons",{enumerable:!0,get:()=>r.availableIcons});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/index'
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Button as e } from "./index2.js";
|
|
2
|
+
import { Input as t } from "./index3.js";
|
|
3
|
+
import { Tabs as l, TabsContent as g, TabsList as n, TabsTrigger as p } from "./index4.js";
|
|
4
|
+
import { Alert as f } from "./index5.js";
|
|
5
|
+
import { Card as x, CardContent as C, CardDescription as d, CardFooter as s, CardHeader as T, CardTitle as b } from "./index6.js";
|
|
6
|
+
import { DataTable as I } from "./index7.js";
|
|
7
|
+
import { Dialog as v, DialogClose as F, DialogContent as H, DialogDescription as k, DialogFooter as y, DialogHeader as A, DialogOverlay as B, DialogPortal as L, DialogTitle as O, DialogTrigger as P } from "./index8.js";
|
|
8
|
+
import { Stack as h } from "./index9.js";
|
|
9
|
+
import { cn as q, generateId as w } from "./index10.js";
|
|
10
|
+
import { Icon as E, availableIcons as G } from "@adam-milo/icons";
|
|
11
|
+
export {
|
|
12
|
+
f as Alert,
|
|
13
|
+
e as Button,
|
|
14
|
+
x as Card,
|
|
15
|
+
C as CardContent,
|
|
16
|
+
d as CardDescription,
|
|
17
|
+
s as CardFooter,
|
|
18
|
+
T as CardHeader,
|
|
19
|
+
b as CardTitle,
|
|
20
|
+
I as DataTable,
|
|
21
|
+
v as Dialog,
|
|
22
|
+
F as DialogClose,
|
|
23
|
+
H as DialogContent,
|
|
24
|
+
k as DialogDescription,
|
|
25
|
+
y as DialogFooter,
|
|
26
|
+
A as DialogHeader,
|
|
27
|
+
B as DialogOverlay,
|
|
28
|
+
L as DialogPortal,
|
|
29
|
+
O as DialogTitle,
|
|
30
|
+
P as DialogTrigger,
|
|
31
|
+
E as Icon,
|
|
32
|
+
t as Input,
|
|
33
|
+
h as Stack,
|
|
34
|
+
l as Tabs,
|
|
35
|
+
g as TabsContent,
|
|
36
|
+
n as TabsList,
|
|
37
|
+
p as TabsTrigger,
|
|
38
|
+
G as availableIcons,
|
|
39
|
+
q as cn,
|
|
40
|
+
w as generateId
|
|
41
|
+
};
|
package/dist/index10.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(...e){return e.filter(Boolean).join(" ")}let n=0;function r(e="id"){return n+=1,`${e}-${n}`}exports.cn=t;exports.generateId=r;
|
package/dist/index10.js
ADDED
package/dist/index2.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),m=require("react"),y=require("./index10.cjs");;/* empty css */const n=m.forwardRef(({variant:t="primary-workspace",fullWidth:r=!1,icon:e,className:a,children:c,disabled:o,"data-testid":u,"data-cy":d,...i},l)=>{const b=y.cn("btn",`btn--${t}`,r&&"btn--full-width",a);return s.jsxs("button",{ref:l,disabled:o,className:b,"data-testid":u||`button-${t}`,"data-cy":d||`button-${t}`,...i,children:[e&&s.jsx("span",{className:"btn__icon",children:e}),c]})});n.displayName="Button";exports.Button=n;
|
package/dist/index2.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as l, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as b } from "react";
|
|
3
|
+
import { cn as f } from "./index10.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const u = b(
|
|
6
|
+
({
|
|
7
|
+
variant: t = "primary-workspace",
|
|
8
|
+
fullWidth: o = !1,
|
|
9
|
+
icon: s,
|
|
10
|
+
className: a,
|
|
11
|
+
children: r,
|
|
12
|
+
disabled: n,
|
|
13
|
+
"data-testid": e,
|
|
14
|
+
"data-cy": c,
|
|
15
|
+
...d
|
|
16
|
+
}, m) => {
|
|
17
|
+
const i = f("btn", `btn--${t}`, o && "btn--full-width", a);
|
|
18
|
+
return /* @__PURE__ */ l(
|
|
19
|
+
"button",
|
|
20
|
+
{
|
|
21
|
+
ref: m,
|
|
22
|
+
disabled: n,
|
|
23
|
+
className: i,
|
|
24
|
+
"data-testid": e || `button-${t}`,
|
|
25
|
+
"data-cy": c || `button-${t}`,
|
|
26
|
+
...d,
|
|
27
|
+
children: [
|
|
28
|
+
s && /* @__PURE__ */ p("span", { className: "btn__icon", children: s }),
|
|
29
|
+
r
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
u.displayName = "Button";
|
|
36
|
+
export {
|
|
37
|
+
u as Button
|
|
38
|
+
};
|
package/dist/index3.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),p=require("react"),u=require("./index10.cjs");;/* empty css */const o=p.forwardRef(({label:s,error:a,helperText:r,fullWidth:n=!1,className:y,id:$,"data-cy":h,"data-testid":m,...f},I)=>{const b=p.useId(),d=$||b,l=`${d}-error`,c=`${d}-helper`,t=h||"input",e=m||"input";return i.jsxs("div",{className:u.cn("input-wrapper",n&&"input-wrapper--full-width"),"data-cy":`${t}-wrapper`,"data-testid":`${e}-wrapper`,children:[s&&i.jsx("label",{htmlFor:d,className:"input__label","data-cy":`${t}-label`,"data-testid":`${e}-label`,children:s}),i.jsx("input",{ref:I,id:d,className:u.cn("input",a&&"input--error",n&&"input--full-width",y),"aria-invalid":a?"true":"false","aria-describedby":a?l:r?c:void 0,"data-cy":t,"data-testid":e,...f}),a&&i.jsx("span",{id:l,className:"input__error",role:"alert","data-cy":`${t}-error`,"data-testid":`${e}-error`,children:a}),r&&!a&&i.jsx("span",{id:c,className:"input__helper","data-cy":`${t}-helper`,"data-testid":`${e}-helper`,children:r})]})});o.displayName="Input";exports.Input=o;
|
package/dist/index3.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as w, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as I, useId as N } from "react";
|
|
3
|
+
import { cn as c } from "./index10.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
const _ = I(
|
|
6
|
+
({
|
|
7
|
+
label: s,
|
|
8
|
+
error: a,
|
|
9
|
+
helperText: r,
|
|
10
|
+
fullWidth: n = !1,
|
|
11
|
+
className: o,
|
|
12
|
+
id: u,
|
|
13
|
+
"data-cy": m,
|
|
14
|
+
"data-testid": f,
|
|
15
|
+
...$
|
|
16
|
+
}, h) => {
|
|
17
|
+
const y = N(), d = u || y, p = `${d}-error`, l = `${d}-helper`, t = m || "input", e = f || "input";
|
|
18
|
+
return /* @__PURE__ */ w(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: c("input-wrapper", n && "input-wrapper--full-width"),
|
|
22
|
+
"data-cy": `${t}-wrapper`,
|
|
23
|
+
"data-testid": `${e}-wrapper`,
|
|
24
|
+
children: [
|
|
25
|
+
s && /* @__PURE__ */ i(
|
|
26
|
+
"label",
|
|
27
|
+
{
|
|
28
|
+
htmlFor: d,
|
|
29
|
+
className: "input__label",
|
|
30
|
+
"data-cy": `${t}-label`,
|
|
31
|
+
"data-testid": `${e}-label`,
|
|
32
|
+
children: s
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ i(
|
|
36
|
+
"input",
|
|
37
|
+
{
|
|
38
|
+
ref: h,
|
|
39
|
+
id: d,
|
|
40
|
+
className: c(
|
|
41
|
+
"input",
|
|
42
|
+
a && "input--error",
|
|
43
|
+
n && "input--full-width",
|
|
44
|
+
o
|
|
45
|
+
),
|
|
46
|
+
"aria-invalid": a ? "true" : "false",
|
|
47
|
+
"aria-describedby": a ? p : r ? l : void 0,
|
|
48
|
+
"data-cy": t,
|
|
49
|
+
"data-testid": e,
|
|
50
|
+
...$
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
a && /* @__PURE__ */ i(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
id: p,
|
|
57
|
+
className: "input__error",
|
|
58
|
+
role: "alert",
|
|
59
|
+
"data-cy": `${t}-error`,
|
|
60
|
+
"data-testid": `${e}-error`,
|
|
61
|
+
children: a
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
r && !a && /* @__PURE__ */ i(
|
|
65
|
+
"span",
|
|
66
|
+
{
|
|
67
|
+
id: l,
|
|
68
|
+
className: "input__helper",
|
|
69
|
+
"data-cy": `${t}-helper`,
|
|
70
|
+
"data-testid": `${e}-helper`,
|
|
71
|
+
children: r
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
_.displayName = "Input";
|
|
80
|
+
export {
|
|
81
|
+
_ as Input
|
|
82
|
+
};
|
package/dist/index4.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),b=require("react"),T=require("@radix-ui/react-tabs"),g=require("./index10.cjs");;/* empty css */function m(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const n=m(T),u=n.Root,f=b.forwardRef(({className:a,"data-cy":t,"data-testid":e,...s},r)=>{const i=t||"tabs-list",c=e||"tabs-list";return d.jsx(n.List,{ref:r,className:g.cn("tabs-list",a),"data-cy":i,"data-testid":c,...s})});f.displayName=n.List.displayName;const l=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-trigger-${t}`:"tabs-trigger"),o=s||(t?`tabs-trigger-${t}`:"tabs-trigger");return d.jsx(n.Trigger,{ref:i,className:g.cn("tabs-trigger",a),value:t,"data-cy":c,"data-testid":o,...r})});l.displayName=n.Trigger.displayName;const y=b.forwardRef(({className:a,value:t,"data-cy":e,"data-testid":s,...r},i)=>{const c=e||(t?`tabs-content-${t}`:"tabs-content"),o=s||(t?`tabs-content-${t}`:"tabs-content");return d.jsx(n.Content,{ref:i,className:g.cn("tabs-content",a),value:t,"data-cy":c,"data-testid":o,...r})});y.displayName=n.Content.displayName;exports.Tabs=u;exports.TabsContent=y;exports.TabsList=f;exports.TabsTrigger=l;
|