@arkyn/components 3.0.1-beta.22 → 3.0.1-beta.24
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 +265 -0
- package/dist/bundle.js +1485 -859
- package/dist/bundle.umd.cjs +1 -1
- package/dist/components/audioUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/audioUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/audioUpload/hasFileContent/index.js +26 -0
- package/dist/components/audioUpload/index.d.ts +82 -0
- package/dist/components/audioUpload/index.d.ts.map +1 -0
- package/dist/components/audioUpload/index.js +120 -0
- package/dist/components/audioUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/audioUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/audioUpload/noFileContent/index.js +29 -0
- package/dist/components/clientOnly.d.ts +86 -0
- package/dist/components/clientOnly.d.ts.map +1 -0
- package/dist/components/clientOnly.js +86 -0
- package/dist/components/fileUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/fileUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/fileUpload/hasFileContent/index.js +34 -0
- package/dist/components/fileUpload/index.d.ts +94 -0
- package/dist/components/fileUpload/index.d.ts.map +1 -0
- package/dist/components/fileUpload/index.js +127 -0
- package/dist/components/fileUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/fileUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/fileUpload/noFileContent/index.js +29 -0
- package/dist/components/imageUpload/hasFileContent/index.d.ts +13 -0
- package/dist/components/imageUpload/hasFileContent/index.d.ts.map +1 -0
- package/dist/components/imageUpload/hasFileContent/index.js +24 -0
- package/dist/components/imageUpload/index.d.ts +114 -0
- package/dist/components/imageUpload/index.d.ts.map +1 -0
- package/dist/components/imageUpload/index.js +148 -0
- package/dist/components/imageUpload/noFileContent/index.d.ts +12 -0
- package/dist/components/imageUpload/noFileContent/index.d.ts.map +1 -0
- package/dist/components/imageUpload/noFileContent/index.js +29 -0
- package/dist/components/tab/tabContainer/index.d.ts +1 -1
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.d.ts +67 -0
- package/dist/components/table/tableBody/index.d.ts.map +1 -0
- package/dist/components/table/tableBody/index.js +69 -0
- package/dist/components/table/tableCaption/index.d.ts +62 -0
- package/dist/components/table/tableCaption/index.d.ts.map +1 -0
- package/dist/components/table/tableCaption/index.js +64 -0
- package/dist/components/table/tableContainer/index.d.ts +64 -0
- package/dist/components/table/tableContainer/index.d.ts.map +1 -0
- package/dist/components/table/tableContainer/index.js +66 -0
- package/dist/components/table/tableFooter/index.d.ts +45 -0
- package/dist/components/table/tableFooter/index.d.ts.map +1 -0
- package/dist/components/table/tableFooter/index.js +47 -0
- package/dist/components/table/tableHeader/index.d.ts +44 -0
- package/dist/components/table/tableHeader/index.d.ts.map +1 -0
- package/dist/components/table/tableHeader/index.js +46 -0
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/hooks/useDrawer.d.ts +86 -0
- package/dist/hooks/useDrawer.d.ts.map +1 -0
- package/dist/hooks/useDrawer.js +20 -0
- package/dist/hooks/useHydrated.d.ts +76 -0
- package/dist/hooks/useHydrated.d.ts.map +1 -0
- package/dist/hooks/useHydrated.js +81 -0
- package/dist/hooks/useModal.d.ts +81 -0
- package/dist/hooks/useModal.d.ts.map +1 -0
- package/dist/hooks/useModal.js +20 -0
- package/dist/hooks/useToast.d.ts +70 -0
- package/dist/hooks/useToast.d.ts.map +1 -0
- package/dist/hooks/useToast.js +72 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -0
- package/dist/providers/drawerProvider.d.ts +106 -0
- package/dist/providers/drawerProvider.d.ts.map +1 -0
- package/dist/providers/drawerProvider.js +120 -0
- package/dist/providers/modalProvider.d.ts +103 -0
- package/dist/providers/modalProvider.d.ts.map +1 -0
- package/dist/providers/modalProvider.js +119 -0
- package/dist/providers/toastProvider.d.ts +48 -0
- package/dist/providers/toastProvider.d.ts.map +1 -0
- package/dist/providers/toastProvider.js +73 -0
- package/dist/style.css +1 -1
- package/package.json +21 -3
package/README.md
ADDED
@@ -0,0 +1,265 @@
|
|
1
|
+
# @arkyn/components
|
2
|
+
|
3
|
+
A modern and comprehensive React component library. Built with TypeScript, featuring smooth animations powered by Framer Motion, and providing a complete set of UI components for building beautiful web applications.
|
4
|
+
|
5
|
+
[](https://www.npmjs.com/package/@arkyn/components)
|
6
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
7
|
+
[](https://www.typescriptlang.org/)
|
8
|
+
|
9
|
+
## ✨ Features
|
10
|
+
|
11
|
+
- 🎨 **40+ UI Components** - Complete set of modern, accessible components
|
12
|
+
- 🎭 **Smooth Animations** - Powered by Framer Motion for fluid interactions
|
13
|
+
- 🪝 **Custom Hooks** - Powerful hooks for form handling, modals, drawers, and more
|
14
|
+
- 🎯 **TypeScript First** - Full type safety and excellent IntelliSense support
|
15
|
+
- 📱 **Responsive Design** - Mobile-first approach with modern CSS
|
16
|
+
- ♿ **Accessibility** - Built with accessibility best practices in mind
|
17
|
+
- 🎨 **Customizable** - Easy to theme and customize for your brand
|
18
|
+
- 🚀 **Remix Optimized** - Designed specifically for Remix applications
|
19
|
+
|
20
|
+
## 📦 Installation
|
21
|
+
|
22
|
+
```bash
|
23
|
+
npm install @arkyn/components
|
24
|
+
```
|
25
|
+
|
26
|
+
### Peer Dependencies
|
27
|
+
|
28
|
+
Make sure you have these peer dependencies installed:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
npm install react react-dom lucide-react
|
32
|
+
```
|
33
|
+
|
34
|
+
## 🚀 Quick Start
|
35
|
+
|
36
|
+
```tsx
|
37
|
+
import { Button, Input, Modal, useModal } from "@arkyn/components";
|
38
|
+
|
39
|
+
function App() {
|
40
|
+
const { isOpen, openModal, closeModal } = useModal();
|
41
|
+
|
42
|
+
return (
|
43
|
+
<div>
|
44
|
+
<Input placeholder="Enter your email" />
|
45
|
+
<Button onClick={openModal}>Open Modal</Button>
|
46
|
+
|
47
|
+
<Modal isOpen={isOpen} onClose={closeModal}>
|
48
|
+
<h2>Welcome to Arkyn!</h2>
|
49
|
+
<p>This is a beautiful modal component.</p>
|
50
|
+
</Modal>
|
51
|
+
</div>
|
52
|
+
);
|
53
|
+
}
|
54
|
+
```
|
55
|
+
|
56
|
+
## 🧩 Components
|
57
|
+
|
58
|
+
### Form Components
|
59
|
+
|
60
|
+
- **Input** - Text input with validation support
|
61
|
+
- **Textarea** - Multi-line text input
|
62
|
+
- **Checkbox** - Checkbox with custom styling
|
63
|
+
- **Radio** - Radio button groups
|
64
|
+
- **Switch** - Toggle switch component
|
65
|
+
- **MultiSelect** - Multi-selection dropdown
|
66
|
+
- **PhoneInput** - International phone number input
|
67
|
+
- **CurrencyInput** - Currency input with formatting
|
68
|
+
- **MaskedInput** - Input with custom masking
|
69
|
+
- **Slider** - Range slider component
|
70
|
+
|
71
|
+
### Upload Components
|
72
|
+
|
73
|
+
- **FileUpload** - File upload with drag & drop
|
74
|
+
- **ImageUpload** - Image upload with preview
|
75
|
+
- **AudioUpload** - Audio file upload component
|
76
|
+
- **AudioPlayer** - Audio playback component
|
77
|
+
|
78
|
+
### Navigation
|
79
|
+
|
80
|
+
- **Button** - Versatile button component
|
81
|
+
- **IconButton** - Icon-only button
|
82
|
+
- **Tab** - Tab navigation system
|
83
|
+
- **CardTab** - Card-style tabs
|
84
|
+
- **Drawer** - Side drawer/panel
|
85
|
+
|
86
|
+
### Feedback
|
87
|
+
|
88
|
+
- **Alert** - Alert messages with different variants
|
89
|
+
- **Modal** - Modal dialogs
|
90
|
+
- **Tooltip** - Contextual tooltips
|
91
|
+
- **Badge** - Status and count badges
|
92
|
+
|
93
|
+
### Layout
|
94
|
+
|
95
|
+
- **Table** - Data table components
|
96
|
+
- **Divider** - Section dividers
|
97
|
+
- **FieldWrapper** - Form field container
|
98
|
+
- **FieldLabel** - Form field labels
|
99
|
+
- **FieldError** - Form field error messages
|
100
|
+
|
101
|
+
### Utility
|
102
|
+
|
103
|
+
- **ClientOnly** - Client-side only rendering
|
104
|
+
|
105
|
+
## 🪝 Hooks
|
106
|
+
|
107
|
+
- **useForm** - Comprehensive form state management
|
108
|
+
- **useModal** - Modal state management
|
109
|
+
- **useDrawer** - Drawer state management
|
110
|
+
- **useSlider** - Slider component logic
|
111
|
+
- **useHydrated** - Check if component is hydrated
|
112
|
+
- **useScopedParams** - URL parameter utilities
|
113
|
+
- **useScrollLock** - Prevent page scrolling
|
114
|
+
- **useToast** - Toast state management
|
115
|
+
|
116
|
+
## 🎨 Component Examples
|
117
|
+
|
118
|
+
### Button
|
119
|
+
|
120
|
+
```tsx
|
121
|
+
import { Button } from "@arkyn/components";
|
122
|
+
import { Plus, Save } from "lucide-react";
|
123
|
+
|
124
|
+
function Examples() {
|
125
|
+
return (
|
126
|
+
<>
|
127
|
+
{/* Basic button */}
|
128
|
+
<Button>Click me</Button>
|
129
|
+
|
130
|
+
{/* With variants */}
|
131
|
+
<Button variant="outline" scheme="success">
|
132
|
+
Success
|
133
|
+
</Button>
|
134
|
+
|
135
|
+
{/* With icons */}
|
136
|
+
<Button leftIcon={Plus} rightIcon={Save}>
|
137
|
+
Save Item
|
138
|
+
</Button>
|
139
|
+
|
140
|
+
{/* Loading state */}
|
141
|
+
<Button isLoading loadingText="Saving...">
|
142
|
+
Save
|
143
|
+
</Button>
|
144
|
+
</>
|
145
|
+
);
|
146
|
+
}
|
147
|
+
```
|
148
|
+
|
149
|
+
### Form with Validation
|
150
|
+
|
151
|
+
```tsx
|
152
|
+
import { Input, Button, FormProvider } from "@arkyn/components";
|
153
|
+
|
154
|
+
function ContactForm() {
|
155
|
+
const onSubmit = (data) => {
|
156
|
+
console.log(data);
|
157
|
+
};
|
158
|
+
|
159
|
+
const fieldErrors = {
|
160
|
+
email: "Email is required",
|
161
|
+
};
|
162
|
+
|
163
|
+
return (
|
164
|
+
<FormProvider
|
165
|
+
fieldErrors={fieldErrors}
|
166
|
+
form={<form onSubmit={handleSubmit(onSubmit)} />}
|
167
|
+
>
|
168
|
+
<Input
|
169
|
+
label="E-mail:"
|
170
|
+
showAsterisk
|
171
|
+
name="email"
|
172
|
+
placeholder="your@email.com"
|
173
|
+
/>
|
174
|
+
|
175
|
+
<Button type="submit">Submit</Button>
|
176
|
+
</FormProvider>
|
177
|
+
);
|
178
|
+
}
|
179
|
+
```
|
180
|
+
|
181
|
+
### Modal with Drawer
|
182
|
+
|
183
|
+
```tsx
|
184
|
+
import { Button, Modal, Drawer, useModal, useDrawer } from "@arkyn/components";
|
185
|
+
|
186
|
+
function App() {
|
187
|
+
const modal = useModal();
|
188
|
+
const drawer = useDrawer();
|
189
|
+
|
190
|
+
return (
|
191
|
+
<>
|
192
|
+
<Button onClick={modal.openModal}>Open Modal</Button>
|
193
|
+
<Button onClick={drawer.openDrawer}>Open Drawer</Button>
|
194
|
+
|
195
|
+
<Modal isOpen={modal.isOpen} onClose={modal.closeModal}>
|
196
|
+
<h2>Modal Content</h2>
|
197
|
+
<Button onClick={modal.closeModal}>Close</Button>
|
198
|
+
</Modal>
|
199
|
+
|
200
|
+
<Drawer isOpen={drawer.isOpen} onClose={drawer.closeDrawer}>
|
201
|
+
<h2>Drawer Content</h2>
|
202
|
+
<Button onClick={drawer.closeDrawer}>Close</Button>
|
203
|
+
</Drawer>
|
204
|
+
</>
|
205
|
+
);
|
206
|
+
}
|
207
|
+
```
|
208
|
+
|
209
|
+
## 🎯 TypeScript Support
|
210
|
+
|
211
|
+
All components are built with TypeScript and provide excellent type safety:
|
212
|
+
|
213
|
+
```tsx
|
214
|
+
import { ButtonProps, InputProps } from "@arkyn/components";
|
215
|
+
|
216
|
+
// Extend component props
|
217
|
+
interface CustomButtonProps extends ButtonProps {
|
218
|
+
customProp?: string;
|
219
|
+
}
|
220
|
+
|
221
|
+
const CustomButton: React.FC<CustomButtonProps> = ({
|
222
|
+
customProp,
|
223
|
+
...props
|
224
|
+
}) => {
|
225
|
+
return <Button {...props} />;
|
226
|
+
};
|
227
|
+
```
|
228
|
+
|
229
|
+
## 🎨 Styling
|
230
|
+
|
231
|
+
Components come with default styling that can be customized through CSS variables or by overriding the CSS classes. Each component has its own CSS file that can be imported separately if needed.
|
232
|
+
|
233
|
+
```css
|
234
|
+
/* Customize button colors */
|
235
|
+
.arkyn-button {
|
236
|
+
--spotlight-primary: #your-color;
|
237
|
+
--text-heading: #your-text-color;
|
238
|
+
}
|
239
|
+
```
|
240
|
+
|
241
|
+
## 📱 Responsive Design
|
242
|
+
|
243
|
+
All components are built with mobile-first responsive design:
|
244
|
+
|
245
|
+
```tsx
|
246
|
+
<Button size="lg">Responsive Button</Button>
|
247
|
+
```
|
248
|
+
|
249
|
+
## 🤝 Contributing
|
250
|
+
|
251
|
+
Contributions are welcome! Please read our contributing guidelines and submit pull requests to help improve the library.
|
252
|
+
|
253
|
+
## 📄 License
|
254
|
+
|
255
|
+
This project is licensed under the Apache 2.0 License - see the [LICENSE](./LICENSE.txt) file for details.
|
256
|
+
|
257
|
+
## 🔗 Links
|
258
|
+
|
259
|
+
- [Documentation](https://docs.arkyn.dev)
|
260
|
+
- [GitHub Repository](https://github.com/Lucas-Eduardo-Goncalves/arkyn)
|
261
|
+
- [NPM Package](https://www.npmjs.com/package/@arkyn/components)
|
262
|
+
|
263
|
+
---
|
264
|
+
|
265
|
+
Made with ❤️ by the Arkyn team
|