@stachelock/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.
Files changed (153) hide show
  1. package/README.md +304 -0
  2. package/dist/CheckboxInput-rWkcde69.js +5 -0
  3. package/dist/CheckboxInput-rWkcde69.js.map +1 -0
  4. package/dist/ComboboxInput-B98P_8CZ.js +5 -0
  5. package/dist/ComboboxInput-B98P_8CZ.js.map +1 -0
  6. package/dist/SelectInput-B5liNv7H.js +5 -0
  7. package/dist/SelectInput-B5liNv7H.js.map +1 -0
  8. package/dist/SwitchInput-D1k9O8gn.js +5 -0
  9. package/dist/SwitchInput-D1k9O8gn.js.map +1 -0
  10. package/dist/TextAreaInput-Di6Kstic.js +5 -0
  11. package/dist/TextAreaInput-Di6Kstic.js.map +1 -0
  12. package/dist/UiLoading-BuzCrLqO.js +5 -0
  13. package/dist/UiLoading-BuzCrLqO.js.map +1 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.js +4763 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/index.umd.cjs +11 -0
  18. package/dist/index.umd.cjs.map +1 -0
  19. package/dist/src/components/UiAvatar.d.ts +57 -0
  20. package/dist/src/components/UiAvatar.d.ts.map +1 -0
  21. package/dist/src/components/UiBadge.d.ts +44 -0
  22. package/dist/src/components/UiBadge.d.ts.map +1 -0
  23. package/dist/src/components/UiBreadcrumb.d.ts +3 -0
  24. package/dist/src/components/UiBreadcrumb.d.ts.map +1 -0
  25. package/dist/src/components/UiButton.d.ts +119 -0
  26. package/dist/src/components/UiButton.d.ts.map +1 -0
  27. package/dist/src/components/UiLoading.d.ts +36 -0
  28. package/dist/src/components/UiLoading.d.ts.map +1 -0
  29. package/dist/src/components/UiLoadingDots.d.ts +53 -0
  30. package/dist/src/components/UiLoadingDots.d.ts.map +1 -0
  31. package/dist/src/components/UiModal.d.ts +102 -0
  32. package/dist/src/components/UiModal.d.ts.map +1 -0
  33. package/dist/src/components/UiNavLink.d.ts +73 -0
  34. package/dist/src/components/UiNavLink.d.ts.map +1 -0
  35. package/dist/src/components/UiProgressBar.d.ts +35 -0
  36. package/dist/src/components/UiProgressBar.d.ts.map +1 -0
  37. package/dist/src/components/UiRadialProgressBar.d.ts +43 -0
  38. package/dist/src/components/UiRadialProgressBar.d.ts.map +1 -0
  39. package/dist/src/components/UiTable.d.ts +94 -0
  40. package/dist/src/components/UiTable.d.ts.map +1 -0
  41. package/dist/src/components/UiTextInput.d.ts +108 -0
  42. package/dist/src/components/UiTextInput.d.ts.map +1 -0
  43. package/dist/src/components/UiTransition.d.ts +41 -0
  44. package/dist/src/components/UiTransition.d.ts.map +1 -0
  45. package/dist/src/components/calendars/CalendarDashboard.d.ts +32 -0
  46. package/dist/src/components/calendars/CalendarDashboard.d.ts.map +1 -0
  47. package/dist/src/components/calendars/CalendarHeader.d.ts +26 -0
  48. package/dist/src/components/calendars/CalendarHeader.d.ts.map +1 -0
  49. package/dist/src/components/calendars/DayCalendar.d.ts +24 -0
  50. package/dist/src/components/calendars/DayCalendar.d.ts.map +1 -0
  51. package/dist/src/components/calendars/EventCard.d.ts +19 -0
  52. package/dist/src/components/calendars/EventCard.d.ts.map +1 -0
  53. package/dist/src/components/calendars/EventsList.d.ts +24 -0
  54. package/dist/src/components/calendars/EventsList.d.ts.map +1 -0
  55. package/dist/src/components/calendars/MonthCalendar.d.ts +36 -0
  56. package/dist/src/components/calendars/MonthCalendar.d.ts.map +1 -0
  57. package/dist/src/components/calendars/WeekCalendar.d.ts +24 -0
  58. package/dist/src/components/calendars/WeekCalendar.d.ts.map +1 -0
  59. package/dist/src/components/calendars/YearCalendar.d.ts +18 -0
  60. package/dist/src/components/calendars/YearCalendar.d.ts.map +1 -0
  61. package/dist/src/components/calendars/index.d.ts +9 -0
  62. package/dist/src/components/calendars/index.d.ts.map +1 -0
  63. package/dist/src/components/forms/DynamicForm.d.ts +70 -0
  64. package/dist/src/components/forms/DynamicForm.d.ts.map +1 -0
  65. package/dist/src/components/forms/DynamicFormField.d.ts +25 -0
  66. package/dist/src/components/forms/DynamicFormField.d.ts.map +1 -0
  67. package/dist/src/components/forms/FormFieldWrapper.d.ts +108 -0
  68. package/dist/src/components/forms/FormFieldWrapper.d.ts.map +1 -0
  69. package/dist/src/components/forms/index.d.ts +4 -0
  70. package/dist/src/components/forms/index.d.ts.map +1 -0
  71. package/dist/src/components/index.d.ts +18 -0
  72. package/dist/src/components/index.d.ts.map +1 -0
  73. package/dist/src/components/inputs/CheckboxInput.d.ts +68 -0
  74. package/dist/src/components/inputs/CheckboxInput.d.ts.map +1 -0
  75. package/dist/src/components/inputs/ComboboxInput.d.ts +76 -0
  76. package/dist/src/components/inputs/ComboboxInput.d.ts.map +1 -0
  77. package/dist/src/components/inputs/InputsShowcase.d.ts +3 -0
  78. package/dist/src/components/inputs/InputsShowcase.d.ts.map +1 -0
  79. package/dist/src/components/inputs/SelectInput.d.ts +67 -0
  80. package/dist/src/components/inputs/SelectInput.d.ts.map +1 -0
  81. package/dist/src/components/inputs/SwitchInput.d.ts +80 -0
  82. package/dist/src/components/inputs/SwitchInput.d.ts.map +1 -0
  83. package/dist/src/components/inputs/TagifyInput.d.ts +183 -0
  84. package/dist/src/components/inputs/TagifyInput.d.ts.map +1 -0
  85. package/dist/src/components/inputs/TextAreaInput.d.ts +68 -0
  86. package/dist/src/components/inputs/TextAreaInput.d.ts.map +1 -0
  87. package/dist/src/components/inputs/index.d.ts +8 -0
  88. package/dist/src/components/inputs/index.d.ts.map +1 -0
  89. package/dist/src/components/layouts/DashboardLayout.d.ts +33 -0
  90. package/dist/src/components/layouts/DashboardLayout.d.ts.map +1 -0
  91. package/dist/src/components/layouts/DefaultLayout.d.ts +58 -0
  92. package/dist/src/components/layouts/DefaultLayout.d.ts.map +1 -0
  93. package/dist/src/components/layouts/HeaderLayout.d.ts +15 -0
  94. package/dist/src/components/layouts/HeaderLayout.d.ts.map +1 -0
  95. package/dist/src/components/layouts/NavigationGroup.d.ts +25 -0
  96. package/dist/src/components/layouts/NavigationGroup.d.ts.map +1 -0
  97. package/dist/src/components/layouts/NavigationItem.d.ts +30 -0
  98. package/dist/src/components/layouts/NavigationItem.d.ts.map +1 -0
  99. package/dist/src/components/layouts/SidebarLayout.d.ts +27 -0
  100. package/dist/src/components/layouts/SidebarLayout.d.ts.map +1 -0
  101. package/dist/src/components/layouts/index.d.ts +7 -0
  102. package/dist/src/components/layouts/index.d.ts.map +1 -0
  103. package/dist/src/composables/index.d.ts +4 -0
  104. package/dist/src/composables/index.d.ts.map +1 -0
  105. package/dist/src/composables/useCalendar.d.ts +146 -0
  106. package/dist/src/composables/useCalendar.d.ts.map +1 -0
  107. package/dist/src/composables/useFormValidation.d.ts +52 -0
  108. package/dist/src/composables/useFormValidation.d.ts.map +1 -0
  109. package/dist/src/composables/useModal.d.ts +36 -0
  110. package/dist/src/composables/useModal.d.ts.map +1 -0
  111. package/dist/src/dev.d.ts +2 -0
  112. package/dist/src/dev.d.ts.map +1 -0
  113. package/dist/src/index.d.ts +11 -0
  114. package/dist/src/index.d.ts.map +1 -0
  115. package/dist/src/plugin.d.ts +21 -0
  116. package/dist/src/plugin.d.ts.map +1 -0
  117. package/dist/src/types/avatars.d.ts +10 -0
  118. package/dist/src/types/avatars.d.ts.map +1 -0
  119. package/dist/src/types/badges.d.ts +10 -0
  120. package/dist/src/types/badges.d.ts.map +1 -0
  121. package/dist/src/types/calendars.d.ts +28 -0
  122. package/dist/src/types/calendars.d.ts.map +1 -0
  123. package/dist/src/types/form.d.ts +86 -0
  124. package/dist/src/types/form.d.ts.map +1 -0
  125. package/dist/src/types/forms.d.ts +17 -0
  126. package/dist/src/types/forms.d.ts.map +1 -0
  127. package/dist/src/types/index.d.ts +13 -0
  128. package/dist/src/types/index.d.ts.map +1 -0
  129. package/dist/src/types/inputs.d.ts +22 -0
  130. package/dist/src/types/inputs.d.ts.map +1 -0
  131. package/dist/src/types/layouts.d.ts +41 -0
  132. package/dist/src/types/layouts.d.ts.map +1 -0
  133. package/dist/src/types/loading.d.ts +11 -0
  134. package/dist/src/types/loading.d.ts.map +1 -0
  135. package/dist/src/types/navigation.d.ts +18 -0
  136. package/dist/src/types/navigation.d.ts.map +1 -0
  137. package/dist/src/types/tables.d.ts +24 -0
  138. package/dist/src/types/tables.d.ts.map +1 -0
  139. package/dist/src/types/transitions.d.ts +16 -0
  140. package/dist/src/types/transitions.d.ts.map +1 -0
  141. package/dist/src/types/ui.d.ts +353 -0
  142. package/dist/src/types/ui.d.ts.map +1 -0
  143. package/dist/src/utils/calendar.d.ts +50 -0
  144. package/dist/src/utils/calendar.d.ts.map +1 -0
  145. package/dist/src/utils/component-registry.d.ts +48 -0
  146. package/dist/src/utils/component-registry.d.ts.map +1 -0
  147. package/dist/src/utils/id.d.ts +13 -0
  148. package/dist/src/utils/id.d.ts.map +1 -0
  149. package/dist/src/utils/index.d.ts +4 -0
  150. package/dist/src/utils/index.d.ts.map +1 -0
  151. package/dist/style.css +1 -0
  152. package/package.json +143 -0
  153. package/tailwind.config.js +110 -0
package/README.md ADDED
@@ -0,0 +1,304 @@
1
+ # @stachelock/ui
2
+
3
+ A comprehensive, tree-shakeable Vue 3 TypeScript UI component library built with Tailwind CSS. Designed for modern web applications with a focus on developer experience, accessibility, and performance.
4
+
5
+ ## โœจ Features
6
+
7
+ - ๐ŸŒฒ **Tree-shakeable**: Import only what you need
8
+ - ๐ŸŽจ **Tailwind CSS**: Built with utility-first CSS framework
9
+ - ๐Ÿ”ง **TypeScript**: Full TypeScript support with comprehensive types
10
+ - โ™ฟ **Accessible**: WCAG compliant components with proper ARIA support
11
+ - ๐ŸŽฏ **Composables**: Powerful Vue 3 composables for common patterns
12
+ - ๐ŸŽจ **Theming**: Consistent design system with customizable themes
13
+ - ๐Ÿ“ฑ **Responsive**: Mobile-first responsive design
14
+ - โšก **Performance**: Optimized bundle sizes and lazy loading
15
+ - ๐Ÿงช **Tested**: Comprehensive test coverage
16
+ - ๐Ÿ“– **Documented**: Storybook documentation and examples
17
+
18
+ ## ๐Ÿ“ฆ Installation
19
+
20
+ ```bash
21
+ npm install @stachelock/ui
22
+ ```
23
+
24
+ ### Peer Dependencies
25
+
26
+ Make sure you have the required peer dependencies installed:
27
+
28
+ ```bash
29
+ npm install vue@^3.3.0 tailwindcss@^3.4.0
30
+ ```
31
+
32
+ ## ๐Ÿš€ Quick Start
33
+
34
+ ### 1. Import Styles
35
+
36
+ Import the CSS in your main entry file:
37
+
38
+ ```typescript
39
+ // main.ts
40
+ import '@stachelock/ui/style.css'
41
+ ```
42
+
43
+ ### 2. Configure Tailwind CSS
44
+
45
+ Add our Tailwind config to your `tailwind.config.js`:
46
+
47
+ ```javascript
48
+ // tailwind.config.js
49
+ import stachelockConfig from '@stachelock/ui/tailwind.config.js'
50
+
51
+ export default {
52
+ // Merge with our config or extend it
53
+ presets: [stachelockConfig],
54
+ content: [
55
+ './src/**/*.{vue,js,ts,jsx,tsx}',
56
+ './node_modules/@stachelock/ui/**/*.{vue,js,ts,jsx,tsx}',
57
+ ],
58
+ // Your custom config here...
59
+ }
60
+ ```
61
+
62
+ ### 3. Use Components
63
+
64
+ #### Individual Imports (Recommended)
65
+
66
+ ```vue
67
+ <template>
68
+ <div>
69
+ <Button @button-click="handleClick" theme="primary" size="md">
70
+ Click me!
71
+ </Button>
72
+
73
+ <TextInput
74
+ name="email"
75
+ label="Email Address"
76
+ type="email"
77
+ v-model:value="email"
78
+ :rules="emailValidation"
79
+ placeholder="Enter your email"
80
+ />
81
+ </div>
82
+ </template>
83
+
84
+ <script setup lang="ts">
85
+ import { Button, TextInput } from '@stachelock/ui'
86
+ import { string } from 'yup'
87
+
88
+ const email = ref('')
89
+
90
+ const emailValidation = string()
91
+ .email('Please enter a valid email')
92
+ .required('Email is required')
93
+
94
+ const handleClick = () => {
95
+ console.log('Button clicked!')
96
+ }
97
+ </script>
98
+ ```
99
+
100
+ #### Global Installation
101
+
102
+ ```typescript
103
+ // main.ts
104
+ import { createApp } from 'vue'
105
+ import StachelockUI from '@stachelock/ui'
106
+ import '@stachelock/ui/style.css'
107
+
108
+ const app = createApp(App)
109
+
110
+ // Install all components globally
111
+ app.use(StachelockUI, {
112
+ installAll: true
113
+ })
114
+
115
+ // Or install specific components
116
+ app.use(StachelockUI, {
117
+ components: ['Button', 'TextInput']
118
+ })
119
+
120
+ app.mount('#app')
121
+ ```
122
+
123
+ ## ๐Ÿงฉ Components
124
+
125
+ ### Buttons
126
+
127
+ ```vue
128
+ <template>
129
+ <!-- Basic Button -->
130
+ <Button theme="primary" size="md">Primary Button</Button>
131
+
132
+ <!-- Loading Button -->
133
+ <Button :loading="isLoading" @button-click="submit">
134
+ Submit
135
+ </Button>
136
+
137
+ <!-- Icon Button -->
138
+ <Button theme="secondary" size="sm">
139
+ <template #leading-icon>
140
+ <PlusIcon class="sl-h-4 sl-w-4" />
141
+ </template>
142
+ Add Item
143
+ </Button>
144
+ </template>
145
+ ```
146
+
147
+ ### Form Inputs
148
+
149
+ ```vue
150
+ <template>
151
+ <!-- Text Input with Validation -->
152
+ <TextInput
153
+ name="username"
154
+ label="Username"
155
+ v-model:value="form.username"
156
+ :rules="usernameRules"
157
+ placeholder="Enter username"
158
+ />
159
+
160
+ <!-- Input with Prefix -->
161
+ <TextInput
162
+ name="website"
163
+ label="Website"
164
+ v-model:value="form.website"
165
+ >
166
+ <template #prefix>
167
+ <span class="sl-text-gray-500">https://</span>
168
+ </template>
169
+ </TextInput>
170
+ </template>
171
+ ```
172
+
173
+ ### Loading States
174
+
175
+ ```vue
176
+ <template>
177
+ <!-- Spinner -->
178
+ <Loading theme="primary" size="md" />
179
+
180
+ <!-- Loading Overlay -->
181
+ <Loading overlay text="Loading data..." />
182
+ </template>
183
+ ```
184
+
185
+ ## ๐ŸŽจ Theming
186
+
187
+ Components support multiple themes out of the box:
188
+
189
+ - `primary` - Your brand primary color (default: Stachelock blue)
190
+ - `secondary` - Secondary gray theme
191
+ - `success` - Green theme for success states
192
+ - `warning` - Yellow theme for warnings
193
+ - `danger` - Red theme for destructive actions
194
+ - `ghost` - Transparent theme
195
+
196
+ ```vue
197
+ <template>
198
+ <Button theme="success">Success</Button>
199
+ <Button theme="danger" outlined>Delete</Button>
200
+ </template>
201
+ ```
202
+
203
+ ## ๐Ÿ”ง Composables
204
+
205
+ ### useFormValidation
206
+
207
+ Powerful form validation with Yup integration:
208
+
209
+ ```typescript
210
+ import { useFormValidation } from '@stachelock/ui'
211
+ import { object, string } from 'yup'
212
+
213
+ const schema = object({
214
+ name: string().required('Name is required'),
215
+ email: string().email().required('Email is required'),
216
+ })
217
+
218
+ const {
219
+ getFieldProps,
220
+ handleSubmit,
221
+ isValid,
222
+ values,
223
+ errors
224
+ } = useFormValidation({
225
+ schema,
226
+ initialValues: { name: '', email: '' }
227
+ })
228
+
229
+ // In template
230
+ const nameProps = getFieldProps('name')
231
+ const emailProps = getFieldProps('email')
232
+
233
+ const onSubmit = handleSubmit(async (values) => {
234
+ console.log('Form submitted:', values)
235
+ })
236
+ ```
237
+
238
+ ### useModal
239
+
240
+ Modal state management with accessibility:
241
+
242
+ ```typescript
243
+ import { useModal } from '@stachelock/ui'
244
+
245
+ const {
246
+ isOpen,
247
+ open,
248
+ close,
249
+ modalRef
250
+ } = useModal()
251
+ ```
252
+
253
+ ## ๐ŸŽฏ CSS Prefix
254
+
255
+ All CSS classes are prefixed with `sl-` to avoid conflicts with your existing styles:
256
+
257
+ ```css
258
+ .sl-button { ... }
259
+ .sl-text-input { ... }
260
+ .sl-form { ... }
261
+ ```
262
+
263
+ ## ๐Ÿงช Testing
264
+
265
+ Components are thoroughly tested. To run tests:
266
+
267
+ ```bash
268
+ npm test
269
+ ```
270
+
271
+ ## ๐Ÿ“š Documentation
272
+
273
+ Visit our [Storybook documentation](https://stachelock.github.io/ui) for interactive examples and API documentation.
274
+
275
+ ## ๐Ÿค Contributing
276
+
277
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
278
+
279
+ ## ๐Ÿ“ License
280
+
281
+ MIT License - see [LICENSE](LICENSE) file for details.
282
+
283
+ ## ๐Ÿ”— Links
284
+
285
+ - [Documentation](https://stachelock.github.io/ui)
286
+ - [GitHub Repository](https://github.com/stachelock/ui)
287
+ - [NPM Package](https://www.npmjs.com/package/@stachelock/ui)
288
+ - [Issue Tracker](https://github.com/stachelock/ui/issues)
289
+
290
+ ## ๐Ÿ“Š Bundle Size
291
+
292
+ This library is designed to be tree-shakeable. When you import individual components, only the necessary code is included in your bundle:
293
+
294
+ | Component | Gzipped Size |
295
+ |-----------|--------------|
296
+ | Button | ~2.1kb |
297
+ | TextInput | ~3.2kb |
298
+ | Loading | ~1.1kb |
299
+
300
+ Full library (all components): ~8.5kb gzipped
301
+
302
+ ---
303
+
304
+ Built with โค๏ธ by the Stachelock team
@@ -0,0 +1,5 @@
1
+ import { CheckboxInput as o } from "./index.js";
2
+ export {
3
+ o as default
4
+ };
5
+ //# sourceMappingURL=CheckboxInput-rWkcde69.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckboxInput-rWkcde69.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { ComboboxInput as a } from "./index.js";
2
+ export {
3
+ a as default
4
+ };
5
+ //# sourceMappingURL=ComboboxInput-B98P_8CZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComboboxInput-B98P_8CZ.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { SelectInput as a } from "./index.js";
2
+ export {
3
+ a as default
4
+ };
5
+ //# sourceMappingURL=SelectInput-B5liNv7H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectInput-B5liNv7H.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { SwitchInput as a } from "./index.js";
2
+ export {
3
+ a as default
4
+ };
5
+ //# sourceMappingURL=SwitchInput-D1k9O8gn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwitchInput-D1k9O8gn.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { TextAreaInput as t } from "./index.js";
2
+ export {
3
+ t as default
4
+ };
5
+ //# sourceMappingURL=TextAreaInput-Di6Kstic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAreaInput-Di6Kstic.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,5 @@
1
+ import { Loading as o } from "./index.js";
2
+ export {
3
+ o as default
4
+ };
5
+ //# sourceMappingURL=UiLoading-BuzCrLqO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UiLoading-BuzCrLqO.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
1
+ export * from './src/index'
2
+ import StachelockUI from './src/index'
3
+ export default StachelockUI