vuiii 1.0.0-beta.9 → 1.0.0-beta.90

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 (134) hide show
  1. package/CLAUDE.md +1136 -0
  2. package/README.md +44 -9
  3. package/dist/arrow-narrow-down-ByOTsj_3.js +7 -0
  4. package/dist/arrow-narrow-left-8CXxtWVB.js +7 -0
  5. package/dist/arrow-narrow-right-BhU8e_zV.js +7 -0
  6. package/dist/arrow-narrow-up-7chFDqFR.js +7 -0
  7. package/dist/arrow-top-right-on-square-ncaAU5g2.js +7 -0
  8. package/dist/arrow-up-tray-IGOOsXks.js +7 -0
  9. package/dist/caret-sort-pX4FtRak.js +7 -0
  10. package/dist/check-B2Fprftn.js +7 -0
  11. package/dist/chevron-down-ChnVgQD9.js +7 -0
  12. package/dist/chevron-left-Bu3LbUng.js +7 -0
  13. package/dist/chevron-right-BnrrRNda.js +7 -0
  14. package/dist/chevron-up-LF9Q5sql.js +7 -0
  15. package/dist/components/Autocomplete.vue.d.ts +133 -0
  16. package/dist/components/Breadcrumbs.vue.d.ts +5 -78
  17. package/dist/components/Button.vue.d.ts +40 -93
  18. package/dist/components/ButtonGroup.vue.d.ts +17 -0
  19. package/dist/components/Checkbox.vue.d.ts +113 -95
  20. package/dist/components/CheckboxGroup.vue.d.ts +42 -91
  21. package/dist/components/Divider.vue.d.ts +39 -0
  22. package/dist/components/Dropdown.vue.d.ts +57 -0
  23. package/dist/components/DropdownMenu.vue.d.ts +64 -0
  24. package/dist/components/FilePicker.vue.d.ts +36 -0
  25. package/dist/components/FormFields.vue.d.ts +30 -99
  26. package/dist/components/FormGroup.vue.d.ts +84 -83
  27. package/dist/components/Icon.vue.d.ts +5 -64
  28. package/dist/components/IconButton.vue.d.ts +11 -0
  29. package/dist/components/Input.vue.d.ts +93 -106
  30. package/dist/components/InputWrapper.vue.d.ts +40 -0
  31. package/dist/components/RadioButtonGroup.vue.d.ts +22 -0
  32. package/dist/components/RadioGroup.vue.d.ts +119 -96
  33. package/dist/components/Select.vue.d.ts +106 -152
  34. package/dist/components/ShortcutIcon.vue.d.ts +6 -0
  35. package/dist/components/Table.vue.d.ts +83 -70
  36. package/dist/components/Textarea.vue.d.ts +73 -74
  37. package/dist/components/Tooltip.vue.d.ts +75 -0
  38. package/dist/components/dialogStack/DialogLayout.vue.d.ts +42 -0
  39. package/dist/components/dialogStack/DialogStack.vue.d.ts +2 -0
  40. package/dist/components/snackbar/SnackbarStack.vue.d.ts +1 -19
  41. package/dist/components/transitions/FadeTransition.vue.d.ts +22 -0
  42. package/dist/composables/useAttrsWithoutClass.d.ts +3 -0
  43. package/dist/composables/useCursor.d.ts +53 -0
  44. package/dist/composables/useDropArea.d.ts +68 -0
  45. package/dist/composables/useFilteredProps.d.ts +3 -0
  46. package/dist/composables/useLoadData.d.ts +106 -0
  47. package/dist/composables/useLoadPaginatedData.d.ts +78 -0
  48. package/dist/composables/useOnClickOutside.d.ts +33 -0
  49. package/dist/composables/useOnFocusOutside.d.ts +26 -0
  50. package/dist/composables/useOnKeyPress.d.ts +26 -0
  51. package/dist/composables/usePageFromRouteQuery.d.ts +24 -0
  52. package/dist/composables/usePreventHandlingDrop.d.ts +20 -0
  53. package/dist/composables/useRouteQuery.d.ts +13 -0
  54. package/dist/composables/useSubmitAction.d.ts +110 -0
  55. package/dist/composables/useValidation.d.ts +81 -0
  56. package/dist/dialogStack.d.ts +538 -0
  57. package/dist/exclamation-B69D_VJe.js +7 -0
  58. package/dist/index.d.ts +40 -11
  59. package/dist/mail-CGnWRGbX.js +7 -0
  60. package/dist/minus-BMyw4wXP.js +7 -0
  61. package/dist/pencil-BsDhpPVD.js +7 -0
  62. package/dist/plus-CPM4Dbh5.js +7 -0
  63. package/dist/search-S-R7KP0P.js +7 -0
  64. package/dist/snackbar.d.ts +37 -15
  65. package/dist/spinner-CJXiitEY.js +24 -0
  66. package/dist/stories/assets/iconSizes.d.ts +2 -0
  67. package/dist/stories/assets/inputSizes.d.ts +2 -0
  68. package/dist/stories/assets/options.d.ts +12 -0
  69. package/dist/stories/assets/tableItems.d.ts +8 -0
  70. package/dist/trash-CV6xtGDj.js +7 -0
  71. package/dist/triangle-down-DMAYm2wS.js +7 -0
  72. package/dist/triangle-left-1wQ7e1YI.js +7 -0
  73. package/dist/triangle-right-BL6A-Pxf.js +7 -0
  74. package/dist/triangle-up-B0v_SupF.js +7 -0
  75. package/dist/types.d.ts +201 -30
  76. package/dist/utils/createTypeParser.d.ts +2 -0
  77. package/dist/utils/debounce.d.ts +1 -0
  78. package/dist/utils/iconsResolver.d.ts +40 -2
  79. package/dist/utils/loadURLAsFile.d.ts +1 -0
  80. package/dist/utils/normalizeOptions.d.ts +61 -3
  81. package/dist/utils/resolveFilesFromClipboardEvent.d.ts +4 -0
  82. package/dist/utils/retrieveFilesFromDataTransfer.d.ts +1 -0
  83. package/dist/utils/retrieveMediaUrlFromHTML copy.d.ts +1 -0
  84. package/dist/utils/retrieveMediaUrlFromHTML.d.ts +1 -0
  85. package/dist/utils/transformInputAttrs.d.ts +4 -4
  86. package/dist/valueParsers/dateValueParser.d.ts +2 -0
  87. package/dist/valueParsers/numberValueParser.d.ts +2 -0
  88. package/dist/vuiii.css +1 -0
  89. package/dist/vuiii.js +2111 -0
  90. package/dist/x-mPmCtkau.js +7 -0
  91. package/package.json +54 -48
  92. package/dist/components/Form.vue.d.ts +0 -189
  93. package/dist/components/modal/ModalLayout.vue.d.ts +0 -39
  94. package/dist/components/modal/ModalLayoutDialog.vue.d.ts +0 -36
  95. package/dist/components/modal/ModalStack.vue.d.ts +0 -28
  96. package/dist/hooks/useLoadData.d.ts +0 -21
  97. package/dist/hooks/useOnClickOutside.d.ts +0 -2
  98. package/dist/hooks/useOnKeyPress.d.ts +0 -1
  99. package/dist/hooks/useRouteQuery.d.ts +0 -17
  100. package/dist/hooks/useSubmitAction.d.ts +0 -33
  101. package/dist/icons/arrow-narrow-down.vue.d.ts +0 -2
  102. package/dist/icons/arrow-narrow-left.vue.d.ts +0 -2
  103. package/dist/icons/arrow-narrow-right.vue.d.ts +0 -2
  104. package/dist/icons/arrow-narrow-up.vue.d.ts +0 -2
  105. package/dist/icons/check-circle.vue.d.ts +0 -2
  106. package/dist/icons/check.vue.d.ts +0 -2
  107. package/dist/icons/chevron-down.vue.d.ts +0 -2
  108. package/dist/icons/chevron-left.vue.d.ts +0 -2
  109. package/dist/icons/chevron-right.vue.d.ts +0 -2
  110. package/dist/icons/chevron-up.vue.d.ts +0 -2
  111. package/dist/icons/exclamation-circle.vue.d.ts +0 -2
  112. package/dist/icons/exclamation.vue.d.ts +0 -2
  113. package/dist/icons/mail.vue.d.ts +0 -2
  114. package/dist/icons/minus.vue.d.ts +0 -2
  115. package/dist/icons/plus.vue.d.ts +0 -2
  116. package/dist/icons/search.vue.d.ts +0 -2
  117. package/dist/icons/spinner.vue.d.ts +0 -2
  118. package/dist/icons/trash.vue.d.ts +0 -2
  119. package/dist/icons/x.vue.d.ts +0 -2
  120. package/dist/modal.d.ts +0 -69
  121. package/dist/stories/Button.stories.d.ts +0 -449
  122. package/dist/stories/Checkbox.stories.d.ts +0 -272
  123. package/dist/stories/CheckboxGroup.stories.d.ts +0 -272
  124. package/dist/stories/Icon.stories.d.ts +0 -152
  125. package/dist/stories/Input.stories.d.ts +0 -422
  126. package/dist/stories/Radio.stories.d.ts +0 -284
  127. package/dist/stories/Select.stories.d.ts +0 -686
  128. package/dist/stories/options.d.ts +0 -7
  129. package/dist/style.css +0 -1
  130. package/dist/utils/generateId.d.ts +0 -1
  131. package/dist/utils/resolveGlobImport.d.ts +0 -3
  132. package/dist/vuiii.mjs +0 -1562
  133. package/dist/vuiii.umd.js +0 -1
  134. /package/dist/stories/{icons.d.ts → assets/icons.d.ts} +0 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,1136 @@
1
+ # VUIII - Vue Component Library
2
+
3
+ > AI Agent Context File - Auto-generated from source code JSDoc comments.
4
+ > Run `npm run docs` to regenerate.
5
+
6
+ ## Overview
7
+
8
+ VUIII is a Vue 3 component library with TypeScript support, providing a comprehensive set of UI components, composables, and utilities for building modern web applications.
9
+
10
+ ## Installation
11
+
12
+ ```bash
13
+ npm install vuiii
14
+ ```
15
+
16
+ ```typescript
17
+ import { Button, Input, Select, FormFields } from 'vuiii'
18
+ import 'vuiii/style.css'
19
+ ```
20
+
21
+ ## Components
22
+
23
+ ### Autocomplete
24
+
25
+ **File:** `src/components/Autocomplete.vue`
26
+
27
+ Autocomplete input with dropdown suggestions and keyboard navigation.
28
+ Supports custom option rendering, filtering, and various data formats.
29
+
30
+ **Examples:**
31
+
32
+ ```typescript
33
+ // Basic usage with string array
34
+ import { Autocomplete } from 'vuiii'
35
+
36
+ <Autocomplete v-model="search" :options="['Apple', 'Banana', 'Cherry']" />
37
+ ```
38
+
39
+ ```typescript
40
+ // With object options and extractors
41
+ const users = [
42
+ { id: 1, name: 'John Doe', email: 'john@example.com' },
43
+ { id: 2, name: 'Jane Smith', email: 'jane@example.com' }
44
+ ]
45
+
46
+ <Autocomplete
47
+ v-model="search"
48
+ :options="users"
49
+ option-label="name"
50
+ option-value="id"
51
+ option-description="email"
52
+ @select="(option) => selectedUser = option.data"
53
+ />
54
+ ```
55
+
56
+ ```typescript
57
+ // With custom filter function
58
+ const customFilter = (option, query) => {
59
+ return option.label.startsWith(query)
60
+ }
61
+
62
+ <Autocomplete
63
+ v-model="search"
64
+ :options="options"
65
+ :filter="customFilter"
66
+ />
67
+ ```
68
+
69
+ ### Breadcrumbs
70
+
71
+ **File:** `src/components/Breadcrumbs.vue`
72
+
73
+ Navigation breadcrumbs with router-link support.
74
+
75
+ **Examples:**
76
+
77
+ ```typescript
78
+ // Basic usage
79
+ import { Breadcrumbs } from 'vuiii'
80
+ import type { BreadcrumbItems } from 'vuiii'
81
+
82
+ const breadcrumbs: BreadcrumbItems = [
83
+ { label: 'Home', link: '/' },
84
+ { label: 'Products', link: '/products' },
85
+ { label: 'Electronics', link: '/products/electronics' }
86
+ ]
87
+
88
+ <Breadcrumbs :breadcrumbs="breadcrumbs" />
89
+ ```
90
+
91
+ ```typescript
92
+ // With named routes
93
+ const breadcrumbs: BreadcrumbItems = [
94
+ { label: 'Dashboard', link: { name: 'dashboard' } },
95
+ { label: 'Users', link: { name: 'users' } },
96
+ { label: 'John Doe', link: { name: 'user', params: { id: 123 } } }
97
+ ]
98
+ ```
99
+
100
+ ### Button
101
+
102
+ **File:** `src/components/Button.vue`
103
+
104
+ Polymorphic button component that renders as <button>, <a>, or <router-link>.
105
+ Supports multiple variants, sizes, icons, and loading states.
106
+
107
+ **Examples:**
108
+
109
+ ```typescript
110
+ // Basic button
111
+ import { Button } from 'vuiii'
112
+
113
+ <Button label="Click me" />
114
+ <Button variant="primary" label="Submit" />
115
+ <Button variant="danger" label="Delete" />
116
+ ```
117
+
118
+ ```typescript
119
+ // With icons
120
+ <Button prefixIcon="plus" label="Add Item" />
121
+ <Button label="Download" suffixIcon="arrow-down" />
122
+ <Button prefixIcon="save" suffixIcon="chevron-down" label="Save" />
123
+ ```
124
+
125
+ ```typescript
126
+ // Different sizes
127
+ <Button size="small" label="Small" />
128
+ <Button size="normal" label="Normal" />
129
+ <Button size="large" label="Large" />
130
+ ```
131
+
132
+ ### Checkbox
133
+
134
+ **File:** `src/components/Checkbox.vue`
135
+
136
+ Checkbox input with toggle/switch variant and indeterminate state support.
137
+ Can be used standalone or within CheckboxGroup.
138
+
139
+ **Examples:**
140
+
141
+ ```typescript
142
+ // Basic usage
143
+ import { Checkbox } from 'vuiii'
144
+
145
+ <Checkbox v-model="accepted" label="I accept the terms" />
146
+ ```
147
+
148
+ ```typescript
149
+ // Switch variant (toggle)
150
+ <Checkbox v-model="enabled" switch label="Enable notifications" />
151
+ ```
152
+
153
+ ```typescript
154
+ // With description
155
+ <Checkbox
156
+ v-model="newsletter"
157
+ label="Subscribe to newsletter"
158
+ description="Get weekly updates about new features"
159
+ />
160
+ ```
161
+
162
+ ### CheckboxGroup
163
+
164
+ **File:** `src/components/CheckboxGroup.vue`
165
+
166
+ Group of checkboxes for multi-select from a list of options.
167
+ Normalizes various option formats and supports custom value parsing.
168
+
169
+ **Examples:**
170
+
171
+ ```typescript
172
+ // Basic usage with string array
173
+ import { CheckboxGroup } from 'vuiii'
174
+
175
+ <CheckboxGroup v-model="selectedFruits" :options="['Apple', 'Banana', 'Cherry']" />
176
+ ```
177
+
178
+ ```typescript
179
+ // With object options and extractors
180
+ const permissions = [
181
+ { id: 'read', name: 'Read', info: 'View content' },
182
+ { id: 'write', name: 'Write', info: 'Edit content' },
183
+ { id: 'delete', name: 'Delete', info: 'Remove content' }
184
+ ]
185
+
186
+ <CheckboxGroup
187
+ v-model="selectedPermissions"
188
+ :options="permissions"
189
+ option-value="id"
190
+ option-label="name"
191
+ option-description="info"
192
+ />
193
+ ```
194
+
195
+ ```typescript
196
+ // Inline layout (horizontal)
197
+ <CheckboxGroup
198
+ v-model="selected"
199
+ :options="['Option A', 'Option B', 'Option C']"
200
+ inline
201
+ />
202
+ ```
203
+
204
+ ### Divider
205
+
206
+ **File:** `src/components/Divider.vue`
207
+
208
+ Visual separator line for content sections.
209
+ Can be horizontal (default) or vertical.
210
+
211
+ **Examples:**
212
+
213
+ ```typescript
214
+ // Horizontal divider (default)
215
+ import { Divider } from 'vuiii'
216
+
217
+ <div>Section 1</div>
218
+ <Divider />
219
+ <div>Section 2</div>
220
+ ```
221
+
222
+ ```typescript
223
+ // Vertical divider (for inline content)
224
+ <div style="display: flex; align-items: center;">
225
+ <span>Item 1</span>
226
+ <Divider orientation="vertical" />
227
+ <span>Item 2</span>
228
+ </div>
229
+ ```
230
+
231
+ ```typescript
232
+ // In FormFields (using FORM_DIVIDER constant)
233
+ import { FORM_DIVIDER } from 'vuiii'
234
+
235
+ const fields = [
236
+ { name: 'name', component: Input, label: 'Name' },
237
+ FORM_DIVIDER,
238
+ { name: 'email', component: Input, label: 'Email' }
239
+ ]
240
+ ```
241
+
242
+ ### Dropdown
243
+
244
+ **File:** `src/components/Dropdown.vue`
245
+
246
+ Popover dropdown component with customizable trigger and content.
247
+ Closes on click outside or Escape key. Supports programmatic control.
248
+
249
+ **Examples:**
250
+
251
+ ```typescript
252
+ // Basic dropdown with default button trigger
253
+ import { Dropdown, DropdownMenu } from 'vuiii'
254
+
255
+ <Dropdown label="Options" variant="primary">
256
+ <DropdownMenu :items="menuItems" @itemClick="handleClick" />
257
+ </Dropdown>
258
+ ```
259
+
260
+ ```typescript
261
+ // With custom trigger slot
262
+ <Dropdown>
263
+ <template #trigger="{ open, close, toggle, isOpen }">
264
+ <IconButton icon="ellipsis-vertical" @click="toggle()" />
265
+ </template>
266
+
267
+ <template #default="{ close }">
268
+ <div class="custom-dropdown-content">
269
+ <button @click="doSomething(); close()">Action</button>
270
+ </div>
271
+ </template>
272
+ </Dropdown>
273
+ ```
274
+
275
+ ```typescript
276
+ // Programmatic control via ref
277
+ const dropdownRef = ref<DropdownRef>()
278
+
279
+ // Open/close programmatically
280
+ dropdownRef.value?.open()
281
+ dropdownRef.value?.close()
282
+ dropdownRef.value?.toggle()
283
+
284
+ // Check state
285
+ if (dropdownRef.value?.isOpen.value) { ... }
286
+ ```
287
+
288
+ ### FilePicker
289
+
290
+ **File:** `src/components/FilePicker.vue`
291
+
292
+ File picker with drag-and-drop support. Opens native file dialog on click
293
+ and accepts files dropped onto the component.
294
+
295
+ **Examples:**
296
+
297
+ ```typescript
298
+ // Basic usage
299
+ import { FilePicker } from 'vuiii'
300
+
301
+ <FilePicker @files="handleFiles" />
302
+ ```
303
+
304
+ ```typescript
305
+ // Multiple files with accept filter
306
+ <FilePicker
307
+ multiple
308
+ accept="image/*"
309
+ label="Upload Images"
310
+ @files="(files) => images = files"
311
+ />
312
+ ```
313
+
314
+ ```typescript
315
+ // Multiple accept types as array
316
+ <FilePicker
317
+ :accept="['image/png', 'image/jpeg', '.pdf']"
318
+ label="Upload Documents"
319
+ @files="handleFiles"
320
+ />
321
+ ```
322
+
323
+ ### FormFields
324
+
325
+ **File:** `src/components/FormFields.vue`
326
+
327
+ Dynamic form generator that renders fields from a configuration array.
328
+ Supports vertical/horizontal layouts, nested rows, dividers, and validation integration.
329
+
330
+
331
+ @example <template #field:email="{ name, label, index }">Custom email input</template>
332
+
333
+ **Examples:**
334
+
335
+ ```typescript
336
+ // Basic vertical form
337
+ import { FormFields, Input, Select } from 'vuiii'
338
+
339
+ const fields: FormField<UserData>[] = [
340
+ { name: 'email', component: Input, label: 'Email', props: { type: 'email' } },
341
+ { name: 'name', component: Input, label: 'Name' },
342
+ { name: 'role', component: Select, label: 'Role', props: { options: ['admin', 'user'] } }
343
+ ]
344
+
345
+ <FormFields :fields="fields" v-model="formData" />
346
+ ```
347
+
348
+ ```typescript
349
+ // Horizontal row (fields side-by-side) - nest arrays for horizontal grouping
350
+ const fields: FormFieldOrRow<UserData>[] = [
351
+ [
352
+ { name: 'firstName', component: Input, label: 'First Name' },
353
+ { name: 'lastName', component: Input, label: 'Last Name' }
354
+ ],
355
+ { name: 'email', component: Input, label: 'Email' }
356
+ ]
357
+ ```
358
+
359
+ ```typescript
360
+ // With dividers between sections
361
+ import { FORM_DIVIDER } from 'vuiii'
362
+
363
+ const fields: FormFieldOrRow<UserData>[] = [
364
+ { name: 'name', component: Input, label: 'Name' },
365
+ FORM_DIVIDER,
366
+ { name: 'email', component: Input, label: 'Email' }
367
+ ]
368
+ ```
369
+
370
+ ### FormGroup
371
+
372
+ **File:** `src/components/FormGroup.vue`
373
+
374
+ Form field wrapper with label, description, hint, and error message support.
375
+ Used by FormFields internally, but can be used standalone for custom form layouts.
376
+
377
+ **Examples:**
378
+
379
+ ```typescript
380
+ // Basic usage with label
381
+ import { FormGroup, Input } from 'vuiii'
382
+
383
+ <FormGroup label="Email">
384
+ <Input v-model="email" type="email" />
385
+ </FormGroup>
386
+ ```
387
+
388
+ ```typescript
389
+ // With description and hint
390
+ <FormGroup
391
+ label="Password"
392
+ description="Choose a strong password for your account"
393
+ hint="Must be at least 8 characters"
394
+ >
395
+ <Input v-model="password" type="password" />
396
+ </FormGroup>
397
+ ```
398
+
399
+ ```typescript
400
+ // With required indicator and validation error
401
+ <FormGroup
402
+ label="Username"
403
+ required
404
+ :error="errors.username"
405
+ >
406
+ <Input v-model="username" :invalid="!!errors.username" />
407
+ </FormGroup>
408
+ ```
409
+
410
+ ### Icon
411
+
412
+ **File:** `src/components/Icon.vue`
413
+
414
+ Icon component that resolves icons through a customizable resolver.
415
+ Register your icon library using registerCustomIconResolver.
416
+
417
+ **Examples:**
418
+
419
+ ```typescript
420
+ // Basic usage
421
+ import { Icon } from 'vuiii'
422
+
423
+ <Icon name="check" />
424
+ <Icon name="user" size="large" />
425
+ ```
426
+
427
+ ```typescript
428
+ // Different sizes
429
+ <Icon name="star" size="small" />
430
+ <Icon name="star" size="normal" />
431
+ <Icon name="star" size="large" />
432
+ ```
433
+
434
+ ```typescript
435
+ // Register custom icon resolver (typically in app setup)
436
+ import { registerCustomIconResolver } from 'vuiii'
437
+ import { defineAsyncComponent } from 'vue'
438
+
439
+ registerCustomIconResolver((name) => {
440
+ return defineAsyncComponent(() => import(`./icons/${name}.vue`))
441
+ })
442
+ ```
443
+
444
+ ### IconButton
445
+
446
+ **File:** `src/components/IconButton.vue`
447
+
448
+ Icon-only button. A simplified Button wrapper for actions that only need an icon.
449
+
450
+ **Examples:**
451
+
452
+ ```typescript
453
+ // Basic usage
454
+ import { IconButton } from 'vuiii'
455
+
456
+ <IconButton icon="pencil" @click="edit()" />
457
+ <IconButton icon="trash" variant="danger" @click="remove()" />
458
+ ```
459
+
460
+ ```typescript
461
+ // Different variants
462
+ <IconButton icon="plus" variant="primary" />
463
+ <IconButton icon="check" variant="secondary" />
464
+ <IconButton icon="x-mark" variant="danger" />
465
+ ```
466
+
467
+ ```typescript
468
+ // Different sizes
469
+ <IconButton icon="cog" size="small" />
470
+ <IconButton icon="cog" size="normal" />
471
+ <IconButton icon="cog" size="large" />
472
+ ```
473
+
474
+ ### Input
475
+
476
+ **File:** `src/components/Input.vue`
477
+
478
+ Text input component with icon support, size variants, and validation states.
479
+ Wraps native input with InputWrapper for consistent styling.
480
+
481
+ **Examples:**
482
+
483
+ ```typescript
484
+ // Basic usage
485
+ import { Input } from 'vuiii'
486
+
487
+ <Input v-model="name" placeholder="Enter your name" />
488
+ ```
489
+
490
+ ```typescript
491
+ // Different input types (passed via attrs)
492
+ <Input v-model="email" type="email" placeholder="Email" />
493
+ <Input v-model="password" type="password" placeholder="Password" />
494
+ <Input v-model="count" type="number" placeholder="Count" />
495
+ ```
496
+
497
+ ```typescript
498
+ // With icons
499
+ <Input v-model="search" prefixIcon="magnifying-glass" placeholder="Search..." />
500
+ <Input v-model="email" suffixIcon="envelope" placeholder="Email" />
501
+ ```
502
+
503
+ ### InputWrapper
504
+
505
+ **File:** `src/components/InputWrapper.vue`
506
+
507
+ Base wrapper component for input styling. Used internally by Input, Select, Autocomplete.
508
+ Provides consistent styling, icon slots, and size variants across all input components.
509
+
510
+ **Examples:**
511
+
512
+ ```typescript
513
+ // Typically used internally, but can be used for custom inputs
514
+ import { InputWrapper } from 'vuiii'
515
+
516
+ <InputWrapper size="normal" prefix-icon="user">
517
+ <input class="vuiii-input__nested" v-model="value" />
518
+ </InputWrapper>
519
+ ```
520
+
521
+ ```typescript
522
+ // With validation state
523
+ <InputWrapper :invalid="hasError" size="normal">
524
+ <input class="vuiii-input__nested" v-model="value" />
525
+ </InputWrapper>
526
+ ```
527
+
528
+ ```typescript
529
+ // With clickable icons
530
+ <InputWrapper
531
+ suffix-icon="x-mark"
532
+ @suffix-icon-click="clearValue"
533
+ >
534
+ <input class="vuiii-input__nested" v-model="value" />
535
+ </InputWrapper>
536
+ ```
537
+
538
+ ### RadioButtonGroup
539
+
540
+ **File:** `src/components/RadioButtonGroup.vue`
541
+
542
+ Button-styled radio group for single selection with visual button appearance.
543
+ Each option is rendered as a Button within a ButtonGroup.
544
+
545
+ **Examples:**
546
+
547
+ ```typescript
548
+ // Basic usage
549
+ <RadioButtonGroup v-model="view" :options="['List', 'Grid', 'Table']" />
550
+ ```
551
+
552
+ ```typescript
553
+ // With object options
554
+ <RadioButtonGroup
555
+ v-model="status"
556
+ :options="[{ id: 'active', name: 'Active' }, { id: 'inactive', name: 'Inactive' }]"
557
+ option-value="id"
558
+ option-label="name"
559
+ />
560
+ ```
561
+
562
+ ```typescript
563
+ // With icons
564
+ <RadioButtonGroup
565
+ v-model="view"
566
+ :options="[
567
+ { value: 'list', label: 'List', icon: 'list' },
568
+ { value: 'grid', label: 'Grid', icon: 'grid' }
569
+ ]"
570
+ option-value="value"
571
+ option-label="label"
572
+ option-icon="icon"
573
+ />
574
+ ```
575
+
576
+ ### RadioGroup
577
+
578
+ **File:** `src/components/RadioGroup.vue`
579
+
580
+ Radio button group for single selection from a list of options.
581
+ Normalizes various option formats and supports custom value parsing.
582
+
583
+ **Examples:**
584
+
585
+ ```typescript
586
+ // Basic usage with string array
587
+ import { RadioGroup } from 'vuiii'
588
+
589
+ <RadioGroup v-model="color" :options="['Red', 'Green', 'Blue']" />
590
+ ```
591
+
592
+ ```typescript
593
+ // With object options and extractors
594
+ const plans = [
595
+ { id: 'free', name: 'Free', info: '0$/month' },
596
+ { id: 'pro', name: 'Pro', info: '10$/month' },
597
+ { id: 'enterprise', name: 'Enterprise', info: 'Contact us' }
598
+ ]
599
+
600
+ <RadioGroup
601
+ v-model="selectedPlan"
602
+ :options="plans"
603
+ option-value="id"
604
+ option-label="name"
605
+ option-description="info"
606
+ />
607
+ ```
608
+
609
+ ```typescript
610
+ // Inline layout (horizontal)
611
+ <RadioGroup
612
+ v-model="size"
613
+ :options="['Small', 'Medium', 'Large']"
614
+ inline
615
+ />
616
+ ```
617
+
618
+ ### Select
619
+
620
+ **File:** `src/components/Select.vue`
621
+
622
+ Native select dropdown with support for various option formats and type parsing.
623
+ Normalizes arrays, objects, and grouped options into a consistent format.
624
+
625
+ **Examples:**
626
+
627
+ ```typescript
628
+ // Basic usage with string array
629
+ import { Select } from 'vuiii'
630
+
631
+ <Select v-model="color" :options="['Red', 'Green', 'Blue']" />
632
+ ```
633
+
634
+ ```typescript
635
+ // With object array and extractors
636
+ const countries = [
637
+ { code: 'us', name: 'United States' },
638
+ { code: 'uk', name: 'United Kingdom' }
639
+ ]
640
+
641
+ <Select
642
+ v-model="country"
643
+ :options="countries"
644
+ option-value="code"
645
+ option-label="name"
646
+ placeholder="Select a country"
647
+ />
648
+ ```
649
+
650
+ ```typescript
651
+ // With key-value object options
652
+ const statuses = { draft: 'Draft', published: 'Published', archived: 'Archived' }
653
+
654
+ <Select v-model="status" :options="statuses" />
655
+ ```
656
+
657
+ ### Table
658
+
659
+ **File:** `src/components/Table.vue`
660
+
661
+ Data table component with sorting, custom columns, cell formatting, and row customization.
662
+ Supports dynamic slot-based cell rendering and sortable columns.
663
+
664
+ **Examples:**
665
+
666
+ ```typescript
667
+ // Basic table with typed columns
668
+ import { Table } from 'vuiii'
669
+ import type { TableColumn } from 'vuiii'
670
+
671
+ type User = { id: number; name: string; email: string }
672
+
673
+ const columns: TableColumn<User>[] = [
674
+ { name: 'name', label: 'Name' },
675
+ { name: 'email', label: 'Email' }
676
+ ]
677
+
678
+ <Table :items="users" :columns="columns" />
679
+ ```
680
+
681
+ ```typescript
682
+ // With custom cell rendering via slots
683
+ <Table :items="users" :columns="columns">
684
+ <template #column:name="{ item, value }">
685
+ <strong>{{ value }}</strong>
686
+ </template>
687
+ <template #column:status="{ item }">
688
+ <Badge :variant="item.active ? 'success' : 'danger'">
689
+ {{ item.active ? 'Active' : 'Inactive' }}
690
+ </Badge>
691
+ </template>
692
+ </Table>
693
+ ```
694
+
695
+ ```typescript
696
+ // With row actions (rowOptions slot)
697
+ <Table :items="users" :columns="columns">
698
+ <template #rowOptions="{ item, index }">
699
+ <IconButton icon="pencil" @click="edit(item)" />
700
+ <IconButton icon="trash" @click="remove(item)" />
701
+ </template>
702
+ </Table>
703
+ ```
704
+
705
+ ### Textarea
706
+
707
+ **File:** `src/components/Textarea.vue`
708
+
709
+ Multi-line text input with InputWrapper styling.
710
+ Supports prefix icon and programmatic control.
711
+
712
+ **Examples:**
713
+
714
+ ```typescript
715
+ // Basic usage
716
+ import { Textarea } from 'vuiii'
717
+
718
+ <Textarea v-model="description" placeholder="Enter description..." />
719
+ ```
720
+
721
+ ```typescript
722
+ // With rows and placeholder
723
+ <Textarea
724
+ v-model="content"
725
+ placeholder="Write your message..."
726
+ rows="5"
727
+ />
728
+ ```
729
+
730
+ ```typescript
731
+ // With prefix icon
732
+ <Textarea v-model="notes" prefix-icon="document-text" placeholder="Notes..." />
733
+ ```
734
+
735
+ ### Typography
736
+
737
+ **File:** `src/components/Typography.vue`
738
+
739
+ Typography component for consistent text styling.
740
+ Automatically selects appropriate HTML tag based on variant.
741
+
742
+ **Examples:**
743
+
744
+ ```typescript
745
+ // Different variants
746
+ import { Typography } from 'vuiii'
747
+
748
+ <Typography variant="display">Display Text</Typography>
749
+ <Typography variant="heading1">Heading 1</Typography>
750
+ <Typography variant="heading2">Heading 2</Typography>
751
+ <Typography variant="body1">Body text paragraph</Typography>
752
+ <Typography variant="caption">Small caption text</Typography>
753
+ <Typography variant="label">Form label</Typography>
754
+ ```
755
+
756
+ ```typescript
757
+ // Automatic tag selection
758
+ <Typography variant="heading1">Renders as h1</Typography>
759
+ <Typography variant="body1">Renders as p</Typography>
760
+ <Typography variant="label">Renders as span</Typography>
761
+ ```
762
+
763
+ ```typescript
764
+ // Override the HTML tag
765
+ <Typography variant="heading1" tag="h2">
766
+ Styled as heading1, but renders as h2
767
+ </Typography>
768
+ ```
769
+
770
+ ## Composables
771
+
772
+ ### dialogStack
773
+
774
+ **File:** `src/dialogStack.ts`
775
+
776
+ Dialog stack system for managing modal dialogs with promise-based APIs.
777
+ Supports custom dialog components, alerts, and confirmation dialogs.
778
+
779
+ **Examples:**
780
+
781
+ ```typescript
782
+ // Setup: Add DialogStack component to your app root
783
+ import { DialogStack } from 'vuiii'
784
+
785
+ // In App.vue
786
+ <template>
787
+ <router-view />
788
+ <DialogStack />
789
+ </template>
790
+ ```
791
+
792
+ ```typescript
793
+ // Open a simple alert
794
+ import { useDialogStack } from 'vuiii'
795
+
796
+ const dialog = useDialogStack()
797
+ await dialog.alert('Operation completed!')
798
+ ```
799
+
800
+ ### snackbar
801
+
802
+ **File:** `src/snackbar.ts`
803
+
804
+ Snackbar/toast notification system for displaying brief messages.
805
+ Messages auto-dismiss after a configurable duration (default 7 seconds).
806
+
807
+ **Examples:**
808
+
809
+ ```typescript
810
+ // Setup: Add SnackbarStack component to your app root
811
+ import { SnackbarStack } from 'vuiii'
812
+
813
+ // In App.vue
814
+ <template>
815
+ <router-view />
816
+ <SnackbarStack />
817
+ </template>
818
+ ```
819
+
820
+ ```typescript
821
+ // Show success message
822
+ import { useSnackbar } from 'vuiii'
823
+
824
+ const snackbar = useSnackbar()
825
+ snackbar.success('Item saved!')
826
+ ```
827
+
828
+ ### useCursor
829
+
830
+ **File:** `src/composables/useCursor.ts`
831
+
832
+ Manages cursor position for navigating through arrays.
833
+ Used internally by Autocomplete for keyboard navigation.
834
+
835
+ **Examples:**
836
+
837
+ ```typescript
838
+ // Basic usage
839
+ import { useCursor } from 'vuiii'
840
+
841
+ const items = ref(['Apple', 'Banana', 'Cherry'])
842
+
843
+ const {
844
+ cursorIndex,
845
+ cursorItem,
846
+ moveCursorForward,
847
+ moveCursorBack,
848
+ resetCursor
849
+ } = useCursor(items)
850
+
851
+ console.log(cursorItem.value) // 'Apple'
852
+ moveCursorForward()
853
+ console.log(cursorItem.value) // 'Banana'
854
+ ```
855
+
856
+ ```typescript
857
+ // With cycling
858
+ const { moveCursorForward } = useCursor(items, { cycle: true })
859
+ // At last item, moveCursorForward() goes back to first
860
+ ```
861
+
862
+ ### useDropArea
863
+
864
+ **File:** `src/composables/useDropArea.ts`
865
+
866
+ Enables drag-and-drop file handling on an element.
867
+ Provides dropzone active state for visual feedback.
868
+
869
+ **Examples:**
870
+
871
+ ```typescript
872
+ // Basic usage
873
+ import { useDropArea } from 'vuiii'
874
+
875
+ const dropElement = ref<HTMLElement>()
876
+
877
+ const { isDropzoneActive } = useDropArea(
878
+ dropElement,
879
+ (files) => console.log('Dropped files:', files)
880
+ )
881
+
882
+ // In template
883
+ <div
884
+ ref="dropElement"
885
+ :class="{ 'dropzone-active': isDropzoneActive }"
886
+ >
887
+ Drop files here
888
+ </div>
889
+ ```
890
+
891
+ ```typescript
892
+ // With file type filter
893
+ useDropArea(
894
+ dropElement,
895
+ handleFiles,
896
+ { accept: 'image/*' }
897
+ )
898
+ ```
899
+
900
+ ### useLoadData
901
+
902
+ **File:** `src/composables/useLoadData.ts`
903
+
904
+ Wraps a data loading function with loading state, error handling,
905
+ and optional success/error messages. Built on top of useSubmitAction.
906
+
907
+ **Examples:**
908
+
909
+ ```typescript
910
+ // Basic data loading
911
+ import { useLoadData } from 'vuiii'
912
+
913
+ const { load, isLoading, data } = useLoadData(
914
+ () => api.fetchUsers()
915
+ )
916
+
917
+ onMounted(load)
918
+
919
+ // In template
920
+ <div v-if="isLoading">Loading...</div>
921
+ <div v-else>{{ data }}</div>
922
+ ```
923
+
924
+ ```typescript
925
+ // With immediate loading
926
+ const { isLoading, data } = useLoadData(
927
+ () => api.fetchUsers(),
928
+ { immediate: true }
929
+ )
930
+ ```
931
+
932
+ ### useLoadPaginatedData
933
+
934
+ **File:** `src/composables/useLoadPaginatedData.ts`
935
+
936
+ Extends useLoadData with pagination support for loading data in pages.
937
+ Provides methods for loading specific pages, next/previous navigation,
938
+ and optional append mode for infinite scroll.
939
+
940
+ **Examples:**
941
+
942
+ ```typescript
943
+ // Basic paginated data loading
944
+ import { useLoadPaginatedData } from 'vuiii'
945
+ import type { PaginatedData } from 'vuiii'
946
+
947
+ const { items, pagination, loadPage, isLoading } = useLoadPaginatedData(
948
+ ({ page, itemsPerPage }) => api.getUsers({ page, itemsPerPage })
949
+ )
950
+
951
+ onMounted(() => loadPage(1))
952
+ ```
953
+
954
+ ```typescript
955
+ // With immediate loading
956
+ const { items, pagination } = useLoadPaginatedData(
957
+ ({ page, itemsPerPage }) => api.getItems({ page, itemsPerPage }),
958
+ { immediate: true }
959
+ )
960
+ ```
961
+
962
+ ### useSubmitAction
963
+
964
+ **File:** `src/composables/useSubmitAction.ts`
965
+
966
+ Wraps an async action with submission state tracking, error handling,
967
+ success/error messages, and optional redirect on success.
968
+
969
+ **Examples:**
970
+
971
+ ```typescript
972
+ // Basic form submission
973
+ import { useSubmitAction } from 'vuiii'
974
+
975
+ const { submit, isSubmitting } = useSubmitAction(
976
+ (data) => api.createUser(data),
977
+ {
978
+ successMessage: 'User created!',
979
+ errorMessage: 'Failed to create user',
980
+ redirectOnSuccess: { name: 'users' }
981
+ }
982
+ )
983
+
984
+ // In template
985
+ <Button :loading="isSubmitting" @click="submit(formData)">Save</Button>
986
+ ```
987
+
988
+ ```typescript
989
+ // With confirmation before submit
990
+ const { submit, isSubmitting } = useSubmitAction(
991
+ (id) => api.deleteUser(id),
992
+ {
993
+ onBeforeSubmit: async ({ dialog }) => {
994
+ return await dialog.confirm('Are you sure?')
995
+ },
996
+ successMessage: 'User deleted'
997
+ }
998
+ )
999
+ ```
1000
+
1001
+ ### useValidation
1002
+
1003
+ **File:** `src/composables/useValidation.ts`
1004
+
1005
+ Manages form validation state with async validation support.
1006
+ Integrates with FormFields via the validatedFields computed property.
1007
+
1008
+ **Examples:**
1009
+
1010
+ ```typescript
1011
+ // Basic validation
1012
+ import { useValidation } from 'vuiii'
1013
+ import type { ValidationResults } from 'vuiii'
1014
+
1015
+ type FormData = { email: string; password: string }
1016
+
1017
+ function validateForm(data: FormData): ValidationResults<FormData> {
1018
+ const errors: Record<string, string> = {}
1019
+
1020
+ if (!data.email) errors.email = 'Email is required'
1021
+ if (!data.password) errors.password = 'Password is required'
1022
+
1023
+ return {
1024
+ isValid: Object.keys(errors).length === 0,
1025
+ isInvalid: Object.keys(errors).length > 0,
1026
+ errorMessages: errors,
1027
+ validatedFields: {
1028
+ email: { isInvalid: !!errors.email, errorMessage: errors.email },
1029
+ password: { isInvalid: !!errors.password, errorMessage: errors.password }
1030
+ }
1031
+ }
1032
+ }
1033
+
1034
+ const { validate, isValid, validatedFields } = useValidation(validateForm)
1035
+ ```
1036
+
1037
+ ```typescript
1038
+ // With FormFields integration
1039
+ <FormFields
1040
+ :fields="fields"
1041
+ v-model="formData"
1042
+ :validation-results="validatedFields"
1043
+ />
1044
+
1045
+ async function submit() {
1046
+ if (await validate(formData)) {
1047
+ // form is valid, proceed with submission
1048
+ }
1049
+ }
1050
+ ```
1051
+
1052
+ ## Utilities
1053
+
1054
+ ### iconsResolver
1055
+
1056
+ **File:** `src/utils/iconsResolver.ts`
1057
+
1058
+ Icon resolution system for the Icon component.
1059
+ Allows registering custom icon libraries (Heroicons, FontAwesome, etc.)
1060
+
1061
+ ### normalizeOptions
1062
+
1063
+ **File:** `src/utils/normalizeOptions.ts`
1064
+
1065
+ Utilities for normalizing various option formats into a consistent Option[] structure.
1066
+ Used by Select, Autocomplete, RadioGroup, CheckboxGroup, and RadioButtonGroup components.
1067
+
1068
+
1069
+ ## Option Parsing
1070
+
1071
+ Components that display selectable options (Select, Autocomplete, RadioGroup, CheckboxGroup,
1072
+ RadioButtonGroup) support flexible option formats. The following props control how options
1073
+ are parsed:
1074
+
1075
+ ### Extractor Props
1076
+
1077
+ | Prop | Description | Components |
1078
+ |------|-------------|------------|
1079
+ | `option-value` | Key or function to extract the option's value | All |
1080
+ | `option-label` | Key or function to extract the display label | All |
1081
+ | `option-disabled` | Key or function to determine if option is disabled | All |
1082
+ | `option-description` | Key or function to extract description text | RadioGroup, CheckboxGroup, Autocomplete, RadioButtonGroup |
1083
+ | `option-icon` | Key or function to extract icon name | Autocomplete, RadioButtonGroup |
1084
+ | `group-label` | Key or function to extract group label | Select, Autocomplete |
1085
+ | `group-options` | Key or function to extract group's options array | Select, Autocomplete |
1086
+
1087
+ ### Supported Option Formats
1088
+
1089
+ **1. Primitive Array** - Value and label are the same
1090
+ ```ts
1091
+ :options="['Apple', 'Banana', 'Cherry']"
1092
+ :options="[1, 2, 3, 4, 5]"
1093
+ ```
1094
+
1095
+ **2. Object Array** - Use extractors to specify which properties to use
1096
+ ```ts
1097
+ :options="[{ id: 1, name: 'Apple' }, { id: 2, name: 'Banana' }]"
1098
+ option-value="id"
1099
+ option-label="name"
1100
+ ```
1101
+
1102
+ **3. Key-Value Object** - Keys become values, values become labels
1103
+ ```ts
1104
+ :options="{ draft: 'Draft', published: 'Published', archived: 'Archived' }"
1105
+ ```
1106
+
1107
+ **4. Grouped Options** - For Select and Autocomplete with optgroup support
1108
+ ```ts
1109
+ :options="[
1110
+ { category: 'Fruits', items: [{ id: 1, name: 'Apple' }] },
1111
+ { category: 'Vegetables', items: [{ id: 2, name: 'Carrot' }] }
1112
+ ]"
1113
+ group-label="category"
1114
+ group-options="items"
1115
+ option-value="id"
1116
+ option-label="name"
1117
+ ```
1118
+
1119
+ ### Function Extractors
1120
+
1121
+ Instead of property keys, you can use functions for complex extraction:
1122
+ ```ts
1123
+ :option-label="(user) => `${user.firstName} ${user.lastName}`"
1124
+ :option-value="(item) => item.id"
1125
+ :option-disabled="(item) => item.status === 'inactive'"
1126
+ ```
1127
+
1128
+ ## Types
1129
+
1130
+ ### types
1131
+
1132
+ **File:** `src/types.ts`
1133
+
1134
+ Core type definitions for vuiii components.
1135
+ Import these types for TypeScript support in your application.
1136
+