@awes-io/ui 2.143.0 → 2.144.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 (86) hide show
  1. package/assets/css/components/action-card.css +1 -0
  2. package/assets/css/components/action-icon.css +2 -2
  3. package/assets/css/components/alert.css +28 -22
  4. package/assets/css/components/animation.css +14 -0
  5. package/assets/css/components/badge.css +1 -0
  6. package/assets/css/components/banner-text.css +15 -4
  7. package/assets/css/components/card.css +0 -1
  8. package/assets/css/components/content-placeholder.css +4 -3
  9. package/assets/css/components/dropdown.css +20 -7
  10. package/assets/css/components/icon-menu-item.css +12 -7
  11. package/assets/css/components/mobile-menu-nav.css +8 -4
  12. package/assets/css/components/text-field.css +4 -0
  13. package/components/1_atoms/AwActionIcon.vue +11 -2
  14. package/components/1_atoms/AwFlow.vue +26 -11
  15. package/components/1_atoms/AwGrid.vue +11 -3
  16. package/components/1_atoms/AwIcon/AwIcon.vue +5 -3
  17. package/components/1_atoms/AwIcon/AwIconSystemMono.vue +3 -2
  18. package/components/1_atoms/AwInput.vue +2 -2
  19. package/components/1_atoms/AwList.vue +3 -1
  20. package/components/1_atoms/AwRadio.vue +1 -1
  21. package/components/1_atoms/AwSlider.vue +15 -1
  22. package/components/1_atoms/AwTag.vue +6 -1
  23. package/components/2_molecules/AwAlert.vue +63 -42
  24. package/components/2_molecules/AwBadge.vue +1 -1
  25. package/components/2_molecules/AwBannerText.vue +8 -2
  26. package/components/2_molecules/AwDescriptionInput.vue +19 -1
  27. package/components/3_organisms/AwBottomBar.vue +22 -4
  28. package/components/3_organisms/AwSubnav.vue +11 -1
  29. package/components/3_organisms/AwTable/AwTableBuilder.vue +8 -0
  30. package/components/3_organisms/AwTable/_AwTableCellDropdown.vue +6 -1
  31. package/components/3_organisms/AwTable/_AwTableRow.vue +2 -1
  32. package/components/4_pages/AwPage.vue +1 -0
  33. package/components/5_layouts/_AwMenuItemIcon.vue +9 -2
  34. package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
  35. package/components/_config.js +26 -1
  36. package/docs/components/atoms/aw-accordion-fold.md +55 -17
  37. package/docs/components/atoms/aw-action-card-body.md +37 -5
  38. package/docs/components/atoms/aw-action-card.md +47 -11
  39. package/docs/components/atoms/aw-action-icon.md +50 -12
  40. package/docs/components/atoms/aw-card.md +35 -10
  41. package/docs/components/atoms/aw-checkbox.md +176 -0
  42. package/docs/components/atoms/aw-content-placeholder.md +33 -2
  43. package/docs/components/atoms/aw-dock.md +20 -14
  44. package/docs/components/atoms/aw-dropdown.md +72 -22
  45. package/docs/components/atoms/aw-flow.md +71 -23
  46. package/docs/components/atoms/aw-grid.md +30 -12
  47. package/docs/components/atoms/aw-icon-system-color.md +1 -0
  48. package/docs/components/atoms/aw-icon-system-mono.md +1 -0
  49. package/docs/components/atoms/aw-icon.md +3 -3
  50. package/docs/components/atoms/aw-info.md +38 -0
  51. package/docs/components/atoms/aw-input.md +94 -2
  52. package/docs/components/atoms/aw-label.md +62 -9
  53. package/docs/components/atoms/aw-link.md +61 -9
  54. package/docs/components/atoms/aw-list.md +68 -4
  55. package/docs/components/atoms/aw-progress.md +52 -3
  56. package/docs/components/atoms/aw-radio.md +73 -0
  57. package/docs/components/atoms/aw-select-native.md +128 -0
  58. package/docs/components/atoms/aw-slider.md +114 -7
  59. package/docs/components/atoms/aw-switcher.md +77 -0
  60. package/docs/components/atoms/aw-tag.md +67 -3
  61. package/docs/components/atoms/aw-toggler.md +22 -1
  62. package/docs/components/molecules/aw-action-button.md +58 -11
  63. package/docs/components/molecules/aw-alert.md +122 -27
  64. package/docs/components/molecules/aw-badge.md +31 -10
  65. package/docs/components/molecules/aw-banner-text.md +84 -18
  66. package/docs/components/molecules/aw-button-nav.md +65 -0
  67. package/docs/components/molecules/aw-button.md +76 -6
  68. package/docs/components/molecules/aw-description-input.md +63 -6
  69. package/docs/components/molecules/aw-empty-container.md +172 -23
  70. package/docs/components/molecules/aw-island.md +282 -10
  71. package/docs/components/organisms/aw-filter-select.md +14 -0
  72. package/docs/components/pages/aw-page-single.md +47 -0
  73. package/docs/guides/page-patterns/detail-pages.md +89 -26
  74. package/docs/guides/page-patterns/list-pages.md +158 -10
  75. package/docs/reference/colors.md +232 -0
  76. package/docs/reference/icons.md +163 -0
  77. package/docs/reference/troubleshooting.md +19 -0
  78. package/package.json +2 -2
  79. package/store/awesIo.js +11 -0
  80. package/CHANGELOG.md +0 -4544
  81. package/dist/css/aw-icons.css +0 -26
  82. package/dist/fonts/aw-icons.svg +0 -18
  83. package/dist/fonts/aw-icons.ttf +0 -0
  84. package/dist/fonts/aw-icons.woff +0 -0
  85. package/dist/fonts/aw-icons.woff2 +0 -0
  86. package/nuxt/icons.css +0 -26
@@ -33,7 +33,7 @@ The `AwIsland` component is an enhanced card component that displays content wit
33
33
  title="Feature Title"
34
34
  description="This is a description of the feature"
35
35
  icon="awesio/settings"
36
- icon-color="accent-500"
36
+ icon-color="accent"
37
37
  >
38
38
  <p>Content goes here</p>
39
39
  </AwIsland>
@@ -86,6 +86,7 @@ The `AwIsland` component is an enhanced card component that displays content wit
86
86
  title="With Actions"
87
87
  description="Section with action buttons"
88
88
  icon="awesio/settings"
89
+ expanded
89
90
  >
90
91
  <template #options>
91
92
  <AwButton size="sm" icon="awesio/edit" theme="icon" />
@@ -96,8 +97,14 @@ The `AwIsland` component is an enhanced card component that displays content wit
96
97
  </AwIsland>
97
98
  ```
98
99
 
100
+ **Note:** The options slot is usually used with the `expanded` prop to keep the content visible while providing action buttons.
101
+
99
102
  ### With Custom Icon
100
103
 
104
+ You can use the `icon` slot to replace the default icon with custom content, such as images or avatar components.
105
+
106
+ **Using Custom Image:**
107
+
101
108
  ```markup
102
109
  <AwIsland title="Custom Icon" description="Using slot for custom icon">
103
110
  <template #icon>
@@ -108,13 +115,38 @@ The `AwIsland` component is an enhanced card component that displays content wit
108
115
  </AwIsland>
109
116
  ```
110
117
 
118
+ **Using AwAvatar Component:**
119
+
120
+ ```markup
121
+ <AwIsland
122
+ title="Personal Information"
123
+ description="Your personal details"
124
+ :model="personalModel"
125
+ >
126
+ <template #icon>
127
+ <AwAvatar
128
+ :src="personalModel.$.avatar"
129
+ :name="personalModel.$.name"
130
+ :size="42"
131
+ />
132
+ </template>
133
+
134
+ <AwGrid>
135
+ <AwInput v-model="personalModel.name" label="Name" />
136
+ <AwInput v-model="personalModel.email" label="Email" />
137
+ </AwGrid>
138
+ </AwIsland>
139
+ ```
140
+
141
+ This pattern is commonly used for user profile sections where an avatar provides better visual representation than an icon.
142
+
111
143
  ### With Footer
112
144
 
113
145
  ```markup
114
146
  <AwIsland
115
147
  title="With Footer"
116
148
  description="Island with footer section"
117
- icon="box"
149
+ icon="awesio/check"
118
150
  >
119
151
  <p>Main content</p>
120
152
 
@@ -131,17 +163,26 @@ The `AwIsland` component is an enhanced card component that displays content wit
131
163
  | Name | Description | Type | Required | Default |
132
164
  |------|-------------|------|----------|---------|
133
165
  | title | Island title | `String` | `false` | `''` |
134
- | titleTag | HTML tag for title | `String` | `false` | `'div'` |
166
+ | titleTag | HTML tag for title | `String` | `false` | `'h2'` |
135
167
  | description | Description text below title | `String` | `false` | `''` |
136
- | icon | Icon name | `String` | `false` | `''` |
137
- | iconColor | Icon color (CSS custom property) | `String` | `false` | `''` |
168
+ | icon | Icon name - see [Built-in Icons](/reference/icons) | `String` | `false` | `''` |
169
+ | iconColor | Icon color (CSS custom property name) | `String` | `false` | `'mono-400'` |
138
170
  | expanded | Always show content (not collapsible) | `Boolean` | `false` | `false` |
139
171
  | show | Initial collapsed state | `Boolean` | `false` | `false` |
140
172
  | showArrow | Force show arrow icon | `Boolean` | `false` | `false` |
141
- | tag | Root element tag (use 'AwLink' for links) | `String` | `false` | `'div'` |
173
+ | tag | Root element tag (use 'AwLink' for links) | `String` | `false` | `'section'` |
174
+ | model | vue-mc Model instance for save/reset functionality | `Object` | `false` | `null` |
175
+ | disabled | Disable island interactions | `Boolean` | `false` | `false` |
142
176
 
143
177
  All AwCard props are also supported (inherited).
144
178
 
179
+ **Model Object Requirements:**
180
+
181
+ When providing a `model` prop, the object must implement:
182
+ - `changed()` - Method that returns `true` if model has unsaved changes
183
+ - `save()` - Method that returns a Promise to save changes
184
+ - `reset()` - Method to reset changes to original values
185
+
145
186
  ### Slots
146
187
 
147
188
  | Name | Description | Props | Default Slot Content |
@@ -184,6 +225,28 @@ When `expanded` prop is true:
184
225
  - Arrow icon rotates 180° (pointing down)
185
226
  - Header not clickable for toggle
186
227
 
228
+ **Common Pattern with Options Slot:**
229
+
230
+ The `expanded` prop is commonly used together with the `options` slot to create always-visible panels with action buttons:
231
+
232
+ ```markup
233
+ <AwIsland
234
+ title="User Settings"
235
+ description="Manage your preferences"
236
+ icon="awesio/settings"
237
+ expanded
238
+ >
239
+ <template #options>
240
+ <AwButton size="sm" icon="awesio/edit" theme="icon" />
241
+ <AwButton size="sm" icon="awesio/delete" theme="icon" />
242
+ </template>
243
+
244
+ <p>Settings content here</p>
245
+ </AwIsland>
246
+ ```
247
+
248
+ This pattern ensures the content remains visible while users interact with the action buttons, avoiding the need to expand/collapse to access both content and actions.
249
+
187
250
  ### Link Mode
188
251
 
189
252
  When `tag="AwLink"`:
@@ -191,6 +254,207 @@ When `tag="AwLink"`:
191
254
  - Inherits all AwLink props (href, to, etc.)
192
255
  - Card reset styling applied
193
256
 
257
+ ## Model Integration
258
+
259
+ ### Using with vue-mc Models
260
+
261
+ `AwIsland` integrates with vue-mc models to provide automatic save/reset functionality in the footer. When a model is provided and has unsaved changes, the footer automatically displays Save and Reset buttons.
262
+
263
+ ```javascript
264
+ import { BaseModel } from '@awes-io/vue-mc'
265
+
266
+ class SettingsModel extends BaseModel {
267
+ defaults() {
268
+ return {
269
+ notifications: true,
270
+ darkMode: false
271
+ }
272
+ }
273
+
274
+ routes() {
275
+ return {
276
+ save: '/api/settings'
277
+ }
278
+ }
279
+ }
280
+
281
+ export default {
282
+ data() {
283
+ return {
284
+ settingsModel: new SettingsModel()
285
+ }
286
+ }
287
+ }
288
+ ```
289
+
290
+ ```markup
291
+ <AwIsland
292
+ title="Settings"
293
+ description="Configure your preferences"
294
+ icon="awesio/settings"
295
+ :model="settingsModel"
296
+ >
297
+ <AwGrid>
298
+ <AwCheckbox v-model="settingsModel.notifications" label="Enable notifications" />
299
+ <AwCheckbox v-model="settingsModel.darkMode" label="Dark mode" />
300
+ </AwGrid>
301
+ </AwIsland>
302
+ ```
303
+
304
+ **Automatic Behavior:**
305
+
306
+ - **No Changes**: Footer shows only "Close" button
307
+ - **Has Changes**: Footer shows "Reset" and "Save" buttons
308
+ - **Saving**: Save button disabled during save operation
309
+ - **Success**: Shows success notification and closes island
310
+ - **Error**: Shows error notification and keeps island open
311
+
312
+ ### Custom Footer with Model
313
+
314
+ You can override the default footer buttons while still using model integration:
315
+
316
+ ```markup
317
+ <AwIsland
318
+ title="Settings"
319
+ :model="settingsModel"
320
+ >
321
+ <AwCheckbox v-model="settingsModel.notifications" label="Notifications" />
322
+
323
+ <template #buttons>
324
+ <AwButton
325
+ v-if="settingsModel.changed()"
326
+ @click="settingsModel.reset()"
327
+ color="mono"
328
+ >
329
+ Cancel
330
+ </AwButton>
331
+ <AwButton
332
+ v-if="settingsModel.changed()"
333
+ @click="customSave"
334
+ :disabled="settingsModel.saving"
335
+ >
336
+ Apply Changes
337
+ </AwButton>
338
+ </template>
339
+ </AwIsland>
340
+ ```
341
+
342
+ ## AwIslandBuilder
343
+
344
+ ### Overview
345
+
346
+ `AwIslandBuilder` is a wrapper component that manages multiple `AwIsland` components with accordion behavior. Only one island can be open at a time, and it provides unsaved changes protection when switching between islands.
347
+
348
+ ### Basic Usage
349
+
350
+ ```markup
351
+ <AwIslandBuilder>
352
+ <AwIsland
353
+ title="Personal Information"
354
+ description="Your personal details"
355
+ icon="awesio/user"
356
+ :model="personalModel"
357
+ >
358
+ <AwInput v-model="personalModel.name" label="Name" />
359
+ <AwInput v-model="personalModel.email" label="Email" />
360
+ </AwIsland>
361
+
362
+ <AwIsland
363
+ title="Account Settings"
364
+ description="Manage your preferences"
365
+ icon="awesio/settings"
366
+ :model="accountModel"
367
+ >
368
+ <AwCheckbox v-model="accountModel.notifications" label="Email notifications" />
369
+ <AwCheckbox v-model="accountModel.twoFactor" label="Two-factor authentication" />
370
+ </AwIsland>
371
+
372
+ <AwIsland
373
+ title="Privacy"
374
+ description="Control your privacy"
375
+ icon="awesio/lock"
376
+ :model="privacyModel"
377
+ >
378
+ <AwCheckbox v-model="privacyModel.publicProfile" label="Public profile" />
379
+ <AwCheckbox v-model="privacyModel.showEmail" label="Show email" />
380
+ </AwIsland>
381
+ </AwIslandBuilder>
382
+ ```
383
+
384
+ ### AwIslandBuilder Props
385
+
386
+ | Name | Description | Type | Required | Default |
387
+ |------|-------------|------|----------|---------|
388
+ | confirmText | Confirmation message for unsaved changes | `String` | `false` | `'There is unsaved data...'` |
389
+
390
+ All `AwGrid` props are also supported (inherited).
391
+
392
+ ### Accordion Behavior
393
+
394
+ **Single Open Island:**
395
+ - Only one island can be expanded at a time
396
+ - Clicking an island header collapses the currently open island
397
+ - Click the same header again to collapse it
398
+
399
+ **Unsaved Changes Protection:**
400
+
401
+ When switching islands with unsaved changes:
402
+ 1. Confirmation dialog appears
403
+ 2. User can confirm (discards changes) or cancel (stays on current island)
404
+ 3. If confirmed, model is reset and new island opens
405
+
406
+ **Route Navigation Protection:**
407
+
408
+ Automatically prevents navigation with unsaved changes:
409
+ - Intercepts router navigation
410
+ - Shows confirmation dialog
411
+ - Resets model if user confirms
412
+ - Cancels navigation if user declines
413
+
414
+ **Window Close Protection:**
415
+
416
+ Prevents accidental window close with unsaved changes:
417
+ - Browser shows native "Leave site?" dialog
418
+ - Uses `confirmText` prop as message (where supported)
419
+
420
+ ### Use Cases
421
+
422
+ **Settings Pages:**
423
+ Perfect for grouped settings with separate save contexts:
424
+
425
+ ```markup
426
+ <AwIslandBuilder>
427
+ <AwIsland title="Profile" :model="profileModel">...</AwIsland>
428
+ <AwIsland title="Security" :model="securityModel">...</AwIsland>
429
+ <AwIsland title="Notifications" :model="notificationsModel">...</AwIsland>
430
+ </AwIslandBuilder>
431
+ ```
432
+
433
+ **Wizard Steps:**
434
+ Multi-step forms with independent save operations:
435
+
436
+ ```markup
437
+ <AwIslandBuilder>
438
+ <AwIsland title="Step 1: Basic Info" :model="step1Model">...</AwIsland>
439
+ <AwIsland title="Step 2: Details" :model="step2Model">...</AwIsland>
440
+ <AwIsland title="Step 3: Review" :model="step3Model">...</AwIsland>
441
+ </AwIslandBuilder>
442
+ ```
443
+
444
+ **Expandable Sections:**
445
+ Read-only information sections (without models):
446
+
447
+ ```markup
448
+ <AwIslandBuilder>
449
+ <AwIsland title="Documentation">
450
+ <p>Documentation content...</p>
451
+ </AwIsland>
452
+ <AwIsland title="Examples">
453
+ <p>Example code...</p>
454
+ </AwIsland>
455
+ </AwIslandBuilder>
456
+ ```
457
+
194
458
  ## Icon Colors
195
459
 
196
460
  Use CSS custom property names for icon colors:
@@ -198,27 +462,30 @@ Use CSS custom property names for icon colors:
198
462
  ```markup
199
463
  <AwIsland
200
464
  icon="awesio/info-circle"
201
- icon-color="accent-500"
465
+ icon-color="accent"
202
466
  />
203
467
 
204
468
  <AwIsland
205
469
  icon="awesio/warning"
206
- icon-color="error-500"
470
+ icon-color="error"
207
471
  />
208
472
 
209
473
  <AwIsland
210
- icon="success"
211
- icon-color="success-500"
474
+ icon="awesio/check"
475
+ icon-color="success"
212
476
  />
213
477
  ```
214
478
 
215
479
  ## Related Components
216
480
 
481
+ - `AwIslandBuilder` - Accordion wrapper for multiple islands
217
482
  - `AwCard` - Base card component
218
483
  - `AwAccordionFold` - Collapse animation (used internally)
219
484
  - `AwIcon` - Icon component
220
485
  - `AwIconSystemMono` - System icons
486
+ - `AwAvatar` - Avatar component (can be used in icon slot)
221
487
  - `AwIslandAvatar` - Island variant with avatar
488
+ - [vue-mc Models](/vue-mc/models) - Model integration documentation
222
489
 
223
490
  ## Notes
224
491
 
@@ -230,5 +497,10 @@ Use CSS custom property names for icon colors:
230
497
  - Icon color uses CSS custom properties (--c-{color})
231
498
  - Content toggle only works when `expanded` is false
232
499
  - Title slot provides titleTag for custom heading levels
500
+ - Icon slot can be used with AwAvatar for user profile sections
233
501
  - Options slot appears before arrow icon
234
502
  - Footer only visible when footer slot is used
503
+ - Model prop enables automatic save/reset functionality
504
+ - Works seamlessly with vue-mc BaseModel instances
505
+ - AwIslandBuilder provides accordion behavior for multiple islands
506
+ - Builder automatically handles unsaved changes protection
@@ -40,6 +40,20 @@ The `AwFilterSelect` component is a dropdown filter that syncs with URL query pa
40
40
  />
41
41
  ```
42
42
 
43
+ **Note:** When using boolean values in filter options, they must be represented as strings:
44
+
45
+ ```markup
46
+ <AwFilterSelect
47
+ param="is_active"
48
+ label="Status"
49
+ :options="[
50
+ { id: 'true', title: 'Active' },
51
+ { id: 'false', title: 'Inactive' }
52
+ ]"
53
+ single
54
+ />
55
+ ```
56
+
43
57
  ### Multiple Selection
44
58
 
45
59
  ```markup
@@ -77,6 +77,53 @@ export default {
77
77
  </AwPageSingle>
78
78
  ```
79
79
 
80
+ ### Preview Slot Patterns
81
+
82
+ We have two standard patterns for the `#preview` slot depending on the entity type:
83
+
84
+ #### Human Pattern (Users, Customers)
85
+
86
+ Used for people. Displays a large avatar and the person's name.
87
+
88
+ ```markup
89
+ <template #preview>
90
+ <AwCard class="text-center">
91
+ <AwAvatar
92
+ :src="user.avatar"
93
+ :name="userName"
94
+ size="240"
95
+ class="mx-auto"
96
+ />
97
+ <AwHeadline class="mt-4">
98
+ {{ userName }}
99
+ </AwHeadline>
100
+ </AwCard>
101
+ </template>
102
+ ```
103
+
104
+ #### Item Pattern (Services, Products, Locations)
105
+
106
+ Used for non-human entities with an image. Displays a large image with rounded corners.
107
+
108
+ ```markup
109
+ <template #preview>
110
+ <AwCard style="--card-padding-x: 0.5rem; --card-padding-y: 0.5rem;">
111
+ <AwActionIcon
112
+ :size="380"
113
+ :image="item.image ? { src: item.image, alt: item.name } : null"
114
+ icon="awesio/image"
115
+ icon-color="mono-400"
116
+ color="mono-800"
117
+ class="w-full"
118
+ style="--icon-size: 48px; --radius: 0.5rem;"
119
+ />
120
+ <AwHeadline class="p-4 mt-2">
121
+ {{ item.name }}
122
+ </AwHeadline>
123
+ </AwCard>
124
+ </template>
125
+ ```
126
+
80
127
  ### With Action Button
81
128
 
82
129
  ```markup