@awes-io/ui 2.142.3 → 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.
- package/assets/css/components/_index.css +7 -1
- package/assets/css/components/action-card.css +1 -0
- package/assets/css/components/action-icon.css +2 -2
- package/assets/css/components/alert.css +28 -22
- package/assets/css/components/animation.css +52 -32
- package/assets/css/components/badge.css +1 -0
- package/assets/css/components/banner-text.css +15 -4
- package/assets/css/components/card.css +0 -1
- package/assets/css/components/content-placeholder.css +104 -0
- package/assets/css/components/dropdown.css +20 -7
- package/assets/css/components/empty-container.css +69 -1
- package/assets/css/components/filter-chosen.css +6 -0
- package/assets/css/components/filter-date-range.css +17 -1
- package/assets/css/components/filter-month.css +23 -17
- package/assets/css/components/filter-select.css +11 -0
- package/assets/css/components/icon-menu-item.css +12 -7
- package/assets/css/components/layout.css +1 -32
- package/assets/css/components/mobile-menu-nav.css +8 -4
- package/assets/css/components/modal.css +1 -1
- package/assets/css/components/number.css +12 -0
- package/assets/css/components/page-aside.css +54 -0
- package/assets/css/components/text-field.css +4 -0
- package/assets/js/css.js +1 -1
- package/assets/js/icons/mono.js +59 -91
- package/assets/js/icons/multicolor.js +1 -31
- package/components/1_atoms/AwActionIcon.vue +11 -2
- package/components/1_atoms/AwContentPlaceholder.vue +60 -0
- package/components/1_atoms/AwFlow.vue +37 -49
- package/components/1_atoms/AwGrid.vue +11 -3
- package/components/1_atoms/AwIcon/AwIcon.vue +5 -3
- package/components/1_atoms/AwIcon/AwIconSystemMono.vue +3 -2
- package/components/1_atoms/AwInput.vue +2 -2
- package/components/1_atoms/AwLabel.vue +1 -1
- package/components/1_atoms/AwList.vue +3 -1
- package/components/1_atoms/AwRadio.vue +1 -1
- package/components/1_atoms/AwSlider.vue +15 -1
- package/components/1_atoms/AwTag.vue +6 -1
- package/components/2_molecules/AwAlert.vue +63 -42
- package/components/2_molecules/AwBadge.vue +1 -1
- package/components/2_molecules/AwBannerText.vue +8 -2
- package/components/2_molecules/AwButton.vue +1 -1
- package/components/2_molecules/AwDescriptionInput.vue +19 -1
- package/components/2_molecules/AwEmptyContainer.vue +74 -72
- package/components/2_molecules/AwNumber.vue +180 -0
- package/components/2_molecules/AwSelect.vue +11 -4
- package/components/3_organisms/AwBottomBar.vue +22 -4
- package/components/3_organisms/AwFilterChosen.vue +73 -0
- package/components/3_organisms/AwFilterDateRange.vue +177 -0
- package/components/3_organisms/AwFilterMonth.vue +37 -40
- package/components/3_organisms/AwFilterSelect.vue +368 -0
- package/components/3_organisms/AwMultiBlockBuilder.vue +1 -1
- package/components/3_organisms/AwSubnav.vue +11 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +20 -60
- package/components/3_organisms/AwTable/_AwTableCellDropdown.vue +6 -1
- package/components/3_organisms/AwTable/_AwTableRow.vue +2 -1
- package/components/4_pages/AwPage.vue +1 -0
- package/components/4_pages/AwPageAside.vue +108 -0
- package/components/5_layouts/AwLayoutCenter.vue +3 -8
- package/components/5_layouts/_AwMenuItemIcon.vue +9 -2
- package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
- package/components/5_layouts/_AwUserMenu.vue +1 -1
- package/components/_config.js +26 -1
- package/docs/_template.md +80 -0
- package/docs/components/atoms/aw-accordion-fold.md +129 -0
- package/docs/components/atoms/aw-action-card-body.md +99 -0
- package/docs/components/atoms/aw-action-card.md +130 -0
- package/docs/components/atoms/aw-action-icon.md +126 -0
- package/docs/components/atoms/aw-avatar.md +106 -0
- package/docs/components/atoms/aw-card.md +137 -0
- package/docs/components/atoms/aw-checkbox.md +288 -0
- package/docs/components/atoms/aw-content-placeholder.md +147 -0
- package/docs/components/atoms/aw-description.md +83 -0
- package/docs/components/atoms/aw-dock.md +90 -0
- package/docs/components/atoms/aw-dropdown-button.md +94 -0
- package/docs/components/atoms/aw-dropdown.md +178 -0
- package/docs/components/atoms/aw-file.md +73 -0
- package/docs/components/atoms/aw-flow.md +140 -0
- package/docs/components/atoms/aw-grid.md +109 -0
- package/docs/components/atoms/aw-headline.md +71 -0
- package/docs/components/atoms/aw-icon-system-color.md +122 -0
- package/docs/components/atoms/aw-icon-system-mono.md +206 -0
- package/docs/components/atoms/aw-icon.md +235 -0
- package/docs/components/atoms/aw-info.md +123 -0
- package/docs/components/atoms/aw-input.md +212 -0
- package/docs/components/atoms/aw-label.md +136 -0
- package/docs/components/atoms/aw-link.md +151 -0
- package/docs/components/atoms/aw-list.md +152 -0
- package/docs/components/atoms/aw-progress.md +119 -0
- package/docs/components/atoms/aw-radio.md +182 -0
- package/docs/components/atoms/aw-refresh-wrapper.md +81 -0
- package/docs/components/atoms/aw-select-native.md +234 -0
- package/docs/components/atoms/aw-slider.md +189 -0
- package/docs/components/atoms/aw-sub-headline.md +73 -0
- package/docs/components/atoms/aw-switcher.md +192 -0
- package/docs/components/atoms/aw-tag.md +144 -0
- package/docs/components/atoms/aw-title.md +70 -0
- package/docs/components/atoms/aw-toggler.md +90 -0
- package/docs/components/layouts/aw-layout-center.md +168 -0
- package/docs/components/layouts/aw-layout-error.md +153 -0
- package/docs/components/layouts/aw-layout-provider.md +238 -0
- package/docs/components/layouts/aw-layout.md +88 -0
- package/docs/components/molecules/aw-action-button.md +138 -0
- package/docs/components/molecules/aw-alert.md +191 -0
- package/docs/components/molecules/aw-badge.md +129 -0
- package/docs/components/molecules/aw-banner-text.md +156 -0
- package/docs/components/molecules/aw-button-nav.md +111 -0
- package/docs/components/molecules/aw-button.md +193 -0
- package/docs/components/molecules/aw-description-input.md +124 -0
- package/docs/components/molecules/aw-empty-container.md +235 -0
- package/docs/components/molecules/aw-island.md +506 -0
- package/docs/components/molecules/aw-number.md +138 -0
- package/docs/components/molecules/aw-select-object.md +401 -0
- package/docs/components/molecules/aw-select.md +215 -0
- package/docs/components/molecules/aw-tab-nav.md +108 -0
- package/docs/components/molecules/aw-tel.md +129 -0
- package/docs/components/molecules/aw-textarea.md +83 -0
- package/docs/components/molecules/aw-userpic.md +115 -0
- package/docs/components/organisms/aw-address-block.md +64 -0
- package/docs/components/organisms/aw-address.md +132 -0
- package/docs/components/organisms/aw-birthday-picker.md +73 -0
- package/docs/components/organisms/aw-bottom-bar.md +66 -0
- package/docs/components/organisms/aw-calendar-days.md +115 -0
- package/docs/components/organisms/aw-calendar-nav.md +98 -0
- package/docs/components/organisms/aw-calendar-view.md +98 -0
- package/docs/components/organisms/aw-calendar.md +166 -0
- package/docs/components/organisms/aw-chart.md +154 -0
- package/docs/components/organisms/aw-chip-select.md +164 -0
- package/docs/components/organisms/aw-chip.md +126 -0
- package/docs/components/organisms/aw-code-snippet.md +94 -0
- package/docs/components/organisms/aw-code.md +132 -0
- package/docs/components/organisms/aw-context-menu.md +117 -0
- package/docs/components/organisms/aw-cropper.md +151 -0
- package/docs/components/organisms/aw-date.md +161 -0
- package/docs/components/organisms/aw-display-date.md +33 -0
- package/docs/components/organisms/aw-download-link.md +46 -0
- package/docs/components/organisms/aw-fetch-data.md +161 -0
- package/docs/components/organisms/aw-filter-chosen.md +226 -0
- package/docs/components/organisms/aw-filter-date-range.md +205 -0
- package/docs/components/organisms/aw-filter-month.md +43 -0
- package/docs/components/organisms/aw-filter-select.md +239 -0
- package/docs/components/organisms/aw-form.md +174 -0
- package/docs/components/organisms/aw-gmap-marker.md +86 -0
- package/docs/components/organisms/aw-gmap.md +90 -0
- package/docs/components/organisms/aw-image-upload.md +56 -0
- package/docs/components/organisms/aw-island-avatar.md +87 -0
- package/docs/components/organisms/aw-markdown-editor.md +104 -0
- package/docs/components/organisms/aw-modal-buttons.md +57 -0
- package/docs/components/organisms/aw-modal.md +246 -0
- package/docs/components/organisms/aw-model-edit.md +74 -0
- package/docs/components/organisms/aw-money.md +53 -0
- package/docs/components/organisms/aw-multi-block-builder.md +165 -0
- package/docs/components/organisms/aw-pagination.md +121 -0
- package/docs/components/organisms/aw-password.md +103 -0
- package/docs/components/organisms/aw-preview-card.md +45 -0
- package/docs/components/organisms/aw-search.md +116 -0
- package/docs/components/organisms/aw-subnav.md +122 -0
- package/docs/components/organisms/aw-table-builder.md +165 -0
- package/docs/components/organisms/aw-table-col.md +123 -0
- package/docs/components/organisms/aw-table-head.md +92 -0
- package/docs/components/organisms/aw-table-row.md +91 -0
- package/docs/components/organisms/aw-table.md +172 -0
- package/docs/components/organisms/aw-tags.md +54 -0
- package/docs/components/organisms/aw-toggle-show-aside.md +43 -0
- package/docs/components/organisms/aw-uploader-files.md +125 -0
- package/docs/components/organisms/aw-uploader.md +163 -0
- package/docs/components/organisms/aw-user-menu.md +87 -0
- package/docs/components/pages/aw-page-aside.md +296 -0
- package/docs/components/pages/aw-page-menu-buttons.md +172 -0
- package/docs/components/pages/aw-page-modal.md +198 -0
- package/docs/components/pages/aw-page-single.md +300 -0
- package/docs/components/pages/aw-page.md +194 -0
- package/docs/configuration.md +493 -0
- package/docs/cookbook/advanced-patterns.md +1388 -0
- package/docs/cookbook/common-patterns.md +965 -0
- package/docs/cookbook/index.md +786 -0
- package/docs/getting-started.md +596 -0
- package/docs/guides/best-practices.md +1106 -0
- package/docs/guides/data-fetching.md +852 -0
- package/docs/guides/error-handling.md +1172 -0
- package/docs/guides/forms-guide.md +1329 -0
- package/docs/guides/mobile-subnavigation.md +359 -0
- package/docs/guides/page-patterns/aside-pages.md +1418 -0
- package/docs/guides/page-patterns/dashboard-pages.md +990 -0
- package/docs/guides/page-patterns/detail-pages.md +1556 -0
- package/docs/guides/page-patterns/list-pages.md +1242 -0
- package/docs/index.md +263 -1
- package/docs/integrations.md +870 -0
- package/docs/reference/colors.md +232 -0
- package/docs/reference/icons.md +163 -0
- package/docs/reference/menu.md +462 -0
- package/docs/reference/plugins.md +970 -0
- package/docs/reference/troubleshooting.md +964 -0
- package/nuxt/awes.config.js +9 -8
- package/nuxt/index.js +2 -2
- package/nuxt/pages/more.vue +1 -1
- package/package.json +5 -3
- package/readme.md +171 -1
- package/store/awesIo.js +11 -0
- package/CHANGELOG.md +0 -4520
- package/docs/aw-accordion-fold.md +0 -46
- package/docs/aw-address.md +0 -44
- package/docs/aw-avatar.md +0 -51
- package/docs/aw-badge.md +0 -32
- package/docs/aw-button-nav.md +0 -44
- package/docs/aw-button.md +0 -50
- package/docs/aw-calendar-days.md +0 -46
- package/docs/aw-calendar-nav.md +0 -25
- package/docs/aw-calendar-view.md +0 -12
- package/docs/aw-calendar.md +0 -59
- package/docs/aw-card.md +0 -48
- package/docs/aw-chart.md +0 -51
- package/docs/aw-checkbox.md +0 -56
- package/docs/aw-chip-select.md +0 -46
- package/docs/aw-chip.md +0 -53
- package/docs/aw-code-snippet.md +0 -18
- package/docs/aw-code.md +0 -56
- package/docs/aw-content-wrapper.md +0 -40
- package/docs/aw-context-menu.md +0 -31
- package/docs/aw-cropper.md +0 -60
- package/docs/aw-dashboard-card.md +0 -37
- package/docs/aw-dashboard-donut.md +0 -30
- package/docs/aw-dashboard-line.md +0 -20
- package/docs/aw-dashboard-progress.md +0 -33
- package/docs/aw-dashboard-section.md +0 -32
- package/docs/aw-dashboard-speed.md +0 -30
- package/docs/aw-date.md +0 -52
- package/docs/aw-dropdown-button.md +0 -31
- package/docs/aw-dropdown.md +0 -69
- package/docs/aw-fetch-data.md +0 -45
- package/docs/aw-form.md +0 -52
- package/docs/aw-grid.md +0 -48
- package/docs/aw-icon.md +0 -50
- package/docs/aw-info.md +0 -53
- package/docs/aw-input.md +0 -55
- package/docs/aw-layout-default.md +0 -30
- package/docs/aw-layout-frame-center.md +0 -29
- package/docs/aw-layout-simple.md +0 -49
- package/docs/aw-link.md +0 -54
- package/docs/aw-markdown-editor.md +0 -51
- package/docs/aw-modal.md +0 -63
- package/docs/aw-multi-block-builder.md +0 -66
- package/docs/aw-page.md +0 -36
- package/docs/aw-pagination.md +0 -54
- package/docs/aw-password.md +0 -48
- package/docs/aw-radio.md +0 -54
- package/docs/aw-search.md +0 -49
- package/docs/aw-select.md +0 -93
- package/docs/aw-slider.md +0 -40
- package/docs/aw-svg-image.md +0 -19
- package/docs/aw-switcher.md +0 -51
- package/docs/aw-tab-nav.md +0 -55
- package/docs/aw-table-builder.md +0 -58
- package/docs/aw-table-col.md +0 -33
- package/docs/aw-table-head.md +0 -28
- package/docs/aw-table-row.md +0 -33
- package/docs/aw-table.md +0 -59
- package/docs/aw-tel.md +0 -47
- package/docs/aw-textarea.md +0 -47
- package/docs/aw-toggler.md +0 -41
- package/docs/aw-uploader-files.md +0 -20
- package/docs/aw-uploader.md +0 -60
- package/docs/aw-user-menu.md +0 -34
- package/docs/aw-userpic.md +0 -34
- /package/components/{3_organisms → 2_molecules}/AwTel.vue +0 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Action Icon component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwActionIcon /> component is used to render Action Icon - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Action Icon
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Action Icon
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwActionIcon` component displays an icon with optional text, with customizable size, color, and styling.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwActionIcon` provides a flexible icon display component that can show an icon, image, or custom content. It supports multiple sizes, colors, and can display text alongside the icon.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Different Sizes
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwActionIcon icon="awesio/check" size="xxs" />
|
|
25
|
+
<AwActionIcon icon="awesio/check" size="xs" />
|
|
26
|
+
<AwActionIcon icon="awesio/check" size="sm" />
|
|
27
|
+
<AwActionIcon icon="awesio/check" size="md" />
|
|
28
|
+
<AwActionIcon icon="awesio/check" size="lg" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Different Colors
|
|
32
|
+
|
|
33
|
+
```markup
|
|
34
|
+
<AwActionIcon icon="awesio/star" color="accent" />
|
|
35
|
+
<AwActionIcon icon="awesio/star" color="success" />
|
|
36
|
+
<AwActionIcon icon="awesio/star" color="warning" />
|
|
37
|
+
<AwActionIcon icon="awesio/star" color="error" />
|
|
38
|
+
<AwActionIcon icon="awesio/star" color="info" />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### With Text
|
|
42
|
+
|
|
43
|
+
```markup
|
|
44
|
+
<AwActionIcon icon="awesio/download" text="Download" size="sm" />
|
|
45
|
+
<AwActionIcon icon="awesio/upload" text="Upload" size="md" />
|
|
46
|
+
<AwActionIcon icon="awesio/mail" text="Send" size="lg" />
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Custom Icon Color
|
|
50
|
+
|
|
51
|
+
```markup
|
|
52
|
+
<AwActionIcon
|
|
53
|
+
icon="awesio/heart"
|
|
54
|
+
color="mono-100"
|
|
55
|
+
icon-color="error"
|
|
56
|
+
/>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Outline Style
|
|
60
|
+
|
|
61
|
+
```markup
|
|
62
|
+
<AwActionIcon
|
|
63
|
+
icon="awesio/check"
|
|
64
|
+
color="success"
|
|
65
|
+
modifiers="outline"
|
|
66
|
+
/>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### With Image
|
|
70
|
+
|
|
71
|
+
```markup
|
|
72
|
+
<AwActionIcon
|
|
73
|
+
:image="{ src: 'url', alt: 'Alt text' }"
|
|
74
|
+
size="md"
|
|
75
|
+
/>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Custom Size (px)
|
|
79
|
+
|
|
80
|
+
You can provide a numeric value for the `size` prop to set a custom size in pixels.
|
|
81
|
+
|
|
82
|
+
```markup
|
|
83
|
+
<AwActionIcon icon="awesio/settings" :size="30" />
|
|
84
|
+
<AwActionIcon icon="awesio/settings" :size="50" />
|
|
85
|
+
<AwActionIcon icon="awesio/settings" :size="70" />
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## API
|
|
89
|
+
|
|
90
|
+
### Props
|
|
91
|
+
|
|
92
|
+
| Name | Description | Type | Required | Default | Validator |
|
|
93
|
+
|------|-------------|------|----------|---------|-----------|
|
|
94
|
+
| image | Image object with src and alt | `Object` | `false` | `null` | - |
|
|
95
|
+
| icon | Icon name | `String` | `false` | `'arrow-animated'` | - |
|
|
96
|
+
| text | Text to display alongside icon | `String` | `false` | `''` | - |
|
|
97
|
+
| size | Icon size preset or custom pixels | `String` / `Number` | `false` | `'md'` | Must be one of: xxs, xs, sm, md, lg or any `Number` |
|
|
98
|
+
| color | Background color | `String` | `false` | `'mono-700'` | - |
|
|
99
|
+
| onColor | Text/icon color | `String` | `false` | `''` | - |
|
|
100
|
+
| iconColor | Custom icon color | `String` | `false` | `''` | - |
|
|
101
|
+
| modifiers | CSS modifiers (e.g., 'outline') | `String` / `Array` | `false` | `''` | - |
|
|
102
|
+
| desktopFrom | Breakpoint for desktop sizing | `String` | `false` | `'lg'` | - |
|
|
103
|
+
|
|
104
|
+
### Slots
|
|
105
|
+
|
|
106
|
+
| Name | Description | Props | Default Slot Content |
|
|
107
|
+
|------|-------------|-------|---------------------|
|
|
108
|
+
| default | Custom content (replaces icon) | - | Icon with optional text |
|
|
109
|
+
|
|
110
|
+
### Events
|
|
111
|
+
|
|
112
|
+
No events are emitted by this component.
|
|
113
|
+
|
|
114
|
+
## Related Components
|
|
115
|
+
|
|
116
|
+
- `AwIcon` - Basic icon component
|
|
117
|
+
- `AwActionCard` - Card component that may use action icons
|
|
118
|
+
|
|
119
|
+
## Notes
|
|
120
|
+
|
|
121
|
+
- **Import Method:** Global - Available as atom component
|
|
122
|
+
- Supports animated icons (automatically detected)
|
|
123
|
+
- Size adapts on mobile devices when `desktopFrom` breakpoint is not met
|
|
124
|
+
- When `image` prop is provided, icon and text are not displayed
|
|
125
|
+
- Text is only shown when size supports it (sm, md, lg)
|
|
126
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Avatar component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwAvatar /> component is used to render Avatar - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Avatar
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Avatar
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwAvatar` component displays a user avatar with image, initials, or placeholder icon.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwAvatar` provides a flexible avatar component that can display a user image, initials from a name, or a placeholder icon. It automatically generates colors for initials based on the user's name and supports loading states.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwAvatar src="/user.jpg" name="John Doe" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Initials
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwAvatar name="Jane Smith" :size="48" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Custom Size
|
|
34
|
+
|
|
35
|
+
```markup
|
|
36
|
+
<AwAvatar name="User" :size="64" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Different Types
|
|
40
|
+
|
|
41
|
+
```markup
|
|
42
|
+
<AwAvatar name="User" type="initials" /> <!-- Shows initials -->
|
|
43
|
+
<AwAvatar name="User" type="empty" /> <!-- Empty circle -->
|
|
44
|
+
<AwAvatar name="User" type="no-img" /> <!-- Placeholder icon -->
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Without Color
|
|
48
|
+
|
|
49
|
+
```markup
|
|
50
|
+
<AwAvatar name="User" :is-colored="false" />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## API
|
|
54
|
+
|
|
55
|
+
### Props
|
|
56
|
+
|
|
57
|
+
| Name | Description | Type | Required | Default | Validator |
|
|
58
|
+
|------|-------------|------|----------|---------|-----------|
|
|
59
|
+
| tag | HTML tag for wrapper | `String` | `false` | `'span'` | - |
|
|
60
|
+
| src | Full URL to the picture | `String` | `false` | `''` | - |
|
|
61
|
+
| name | User name (for initials) | `String` | `false` | `''` | - |
|
|
62
|
+
| size | Size of the avatar in pixels | `Number` / `String` | `false` | `36` | Must be a number |
|
|
63
|
+
| type | Display type when no image | `String` | `false` | `'initials'` | Must be: initials, empty, no-img |
|
|
64
|
+
| isColored | Use colored background for initials | `Boolean` | `false` | `true` | - |
|
|
65
|
+
| loading | Show loading indicator | `Boolean` | `false` | `false` | - |
|
|
66
|
+
| colors | Array of color objects for initials | `Array` | `false` | From config | - |
|
|
67
|
+
| square | Use square shape instead of circle | `Boolean` | `false` | `false` | - |
|
|
68
|
+
|
|
69
|
+
### Slots
|
|
70
|
+
|
|
71
|
+
| Name | Description | Props | Default Slot Content |
|
|
72
|
+
|------|-------------|-------|---------------------|
|
|
73
|
+
| default | Custom avatar content | `{ src, name, initials, color, onColor, imageError }` | Image or initials |
|
|
74
|
+
| no-img | Custom no-image placeholder | `{ initials, color, onColor }` | Default placeholder icon |
|
|
75
|
+
| loading | Custom loading indicator | `{ isLoading }` | Default loader |
|
|
76
|
+
|
|
77
|
+
### Events
|
|
78
|
+
|
|
79
|
+
No events are emitted by this component.
|
|
80
|
+
|
|
81
|
+
### Config Options
|
|
82
|
+
|
|
83
|
+
The component uses default configuration from `@AwConfig`:
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
export default {
|
|
87
|
+
AwAvatar: {
|
|
88
|
+
colors: COLORS // Array of color objects
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Related Components
|
|
94
|
+
|
|
95
|
+
- `AwUserpic` - User picture component
|
|
96
|
+
- `AwIslandAvatar` - Avatar in island layout
|
|
97
|
+
|
|
98
|
+
## Notes
|
|
99
|
+
|
|
100
|
+
- **Import Method:** Global - Available as atom component
|
|
101
|
+
- Automatically extracts initials from name (first letter of first two words)
|
|
102
|
+
- Colors are deterministically generated from name hash for consistency
|
|
103
|
+
- Falls back to initials/placeholder when image fails to load
|
|
104
|
+
- Supports loading state indicator
|
|
105
|
+
- Square variant available for different design needs
|
|
106
|
+
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Card component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwCard /> component is used to render Card - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Card
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Card
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwCard` component is a flexible container with optional header, title, description, and content sections.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwCard` provides a structured card container with an optional header section containing title, description, and badge. It's a fundamental building block for displaying grouped content.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwCard>
|
|
25
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
26
|
+
</AwCard>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### With Title
|
|
30
|
+
|
|
31
|
+
```markup
|
|
32
|
+
<AwCard title="Card Title">
|
|
33
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
34
|
+
</AwCard>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### With Title and Description
|
|
38
|
+
|
|
39
|
+
```markup
|
|
40
|
+
<AwCard
|
|
41
|
+
title="Card Title"
|
|
42
|
+
description="Card description text"
|
|
43
|
+
>
|
|
44
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
45
|
+
</AwCard>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With Badge
|
|
49
|
+
|
|
50
|
+
```markup
|
|
51
|
+
<AwCard title="Featured Card">
|
|
52
|
+
<template #badge>
|
|
53
|
+
<AwBadge text="New" color="info" />
|
|
54
|
+
</template>
|
|
55
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
56
|
+
</AwCard>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Custom Header
|
|
60
|
+
|
|
61
|
+
```markup
|
|
62
|
+
<AwCard>
|
|
63
|
+
<template #header>
|
|
64
|
+
<AwFlow class="pb-2 mb-2 border-b">
|
|
65
|
+
<AwActionIcon icon="awesio/settings" size="sm" />
|
|
66
|
+
<AwDescription>Custom header content</AwDescription>
|
|
67
|
+
</AwFlow>
|
|
68
|
+
</template>
|
|
69
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
70
|
+
</AwCard>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Custom Title Slot
|
|
74
|
+
|
|
75
|
+
```markup
|
|
76
|
+
<AwCard>
|
|
77
|
+
<template #title>
|
|
78
|
+
<AwFlow :gap="1">
|
|
79
|
+
<AwActionIcon icon="awesio/check" size="xs" color="success" />
|
|
80
|
+
<strong>Custom Title with Icon</strong>
|
|
81
|
+
</AwFlow>
|
|
82
|
+
</template>
|
|
83
|
+
<template #badge>
|
|
84
|
+
<AwBadge text="3" color="error" />
|
|
85
|
+
</template>
|
|
86
|
+
<AwDescription tag="div">Card content</AwDescription>
|
|
87
|
+
</AwCard>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Custom Tag
|
|
91
|
+
|
|
92
|
+
```markup
|
|
93
|
+
<AwCard tag="article" title="Article Title">
|
|
94
|
+
<AwDescription tag="div">Article content</AwDescription>
|
|
95
|
+
</AwCard>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## API
|
|
99
|
+
|
|
100
|
+
### Props
|
|
101
|
+
|
|
102
|
+
| Name | Description | Type | Required | Default |
|
|
103
|
+
|------|-------------|------|----------|---------|
|
|
104
|
+
| tag | HTML tag for card element | `String` | `false` | `'div'` |
|
|
105
|
+
| titleTag | HTML tag for title | `String` | `false` | `'h3'` |
|
|
106
|
+
| title | Card title text | `String` | `false` | `''` |
|
|
107
|
+
| description | Card description text | `String` | `false` | `''` |
|
|
108
|
+
|
|
109
|
+
All standard HTML attributes are supported via `$attrs`.
|
|
110
|
+
|
|
111
|
+
### Slots
|
|
112
|
+
|
|
113
|
+
| Name | Description | Props | Default Slot Content |
|
|
114
|
+
|------|-------------|-------|---------------------|
|
|
115
|
+
| default | Main card content | - | - |
|
|
116
|
+
| header | Custom header (replaces default header) | - | Default header with title/description |
|
|
117
|
+
| title | Custom title content | - | Title text |
|
|
118
|
+
| description | Custom description content | - | Description text |
|
|
119
|
+
| badge | Badge content in header | - | - |
|
|
120
|
+
|
|
121
|
+
### Events
|
|
122
|
+
|
|
123
|
+
No events are emitted by this component.
|
|
124
|
+
|
|
125
|
+
## Related Components
|
|
126
|
+
|
|
127
|
+
- `AwActionCard` - Card with action button
|
|
128
|
+
- `AwDescription` - Description component used in cards
|
|
129
|
+
- `AwBadge` - Badge component for card headers
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
- **Import Method:** Global - Available as atom component
|
|
134
|
+
- Header is automatically shown when title, title slot, or badge slot is provided
|
|
135
|
+
- Description uses `AwDescription` component internally
|
|
136
|
+
- Header has offset styling when content is present
|
|
137
|
+
- Use for grouping related content with consistent styling
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Checkbox component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwCheckbox /> component is used to render Checkbox - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Checkbox
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Checkbox
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwCheckbox` component is a styled checkbox input with label support and error handling.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwCheckbox` provides a checkbox input with consistent styling, label support, and error states. It supports both single checkboxes and checkbox groups (when used with arrays).
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwCheckbox v-model="checked" label="Accept terms" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Custom Value
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwCheckbox
|
|
31
|
+
v-model="selected"
|
|
32
|
+
value="option1"
|
|
33
|
+
label="Option 1"
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Checkbox Group
|
|
38
|
+
|
|
39
|
+
```markup
|
|
40
|
+
<AwCheckbox
|
|
41
|
+
v-model="selectedItems"
|
|
42
|
+
value="item1"
|
|
43
|
+
label="Item 1"
|
|
44
|
+
/>
|
|
45
|
+
<AwCheckbox
|
|
46
|
+
v-model="selectedItems"
|
|
47
|
+
value="item2"
|
|
48
|
+
label="Item 2"
|
|
49
|
+
/>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### With Error
|
|
53
|
+
|
|
54
|
+
```markup
|
|
55
|
+
<AwCheckbox
|
|
56
|
+
v-model="checked"
|
|
57
|
+
label="Required field"
|
|
58
|
+
:error="errorMessage"
|
|
59
|
+
/>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Partial State
|
|
63
|
+
|
|
64
|
+
```markup
|
|
65
|
+
<AwCheckbox
|
|
66
|
+
v-model="selectedItems"
|
|
67
|
+
value="item1"
|
|
68
|
+
label="Item 1"
|
|
69
|
+
:partial="isPartial"
|
|
70
|
+
/>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## API
|
|
74
|
+
|
|
75
|
+
### Props
|
|
76
|
+
|
|
77
|
+
| Name | Description | Type | Required | Default |
|
|
78
|
+
|------|-------------|------|----------|---------|
|
|
79
|
+
| value | Value emitted when checked | `String` / `Number` / `Boolean` / `Object` | `false` | `'on'` |
|
|
80
|
+
| checked | Checked state (boolean, number, or array for groups) | `Array` / `Boolean` / `Number` | `false` | `false` |
|
|
81
|
+
| label | Label text displayed next to checkbox | `String` | `false` | `''` |
|
|
82
|
+
| partial | Show partial/indeterminate state | `Boolean` | `false` | `false` |
|
|
83
|
+
|
|
84
|
+
All standard HTML checkbox attributes are supported via `$attrs` (e.g., `disabled`, `required`).
|
|
85
|
+
|
|
86
|
+
Inherits props from `FieldMixin` and `ErrorMixin` for additional field and error handling functionality.
|
|
87
|
+
|
|
88
|
+
### Slots
|
|
89
|
+
|
|
90
|
+
| Name | Description | Props | Default Slot Content |
|
|
91
|
+
|------|-------------|-------|---------------------|
|
|
92
|
+
| default | Custom checkbox element | `{ id, checked, onChange, setError, value }` | Default checkbox input |
|
|
93
|
+
| label | Custom label content | `{ label, value, isChecked }` | Label text |
|
|
94
|
+
|
|
95
|
+
### Events
|
|
96
|
+
|
|
97
|
+
| Name | Payload | Description |
|
|
98
|
+
|------|---------|-------------|
|
|
99
|
+
| change | `value` | Emitted when checkbox state changes |
|
|
100
|
+
|
|
101
|
+
## Component Behavior
|
|
102
|
+
|
|
103
|
+
### V-Model Implementation
|
|
104
|
+
|
|
105
|
+
`AwCheckbox` uses a custom v-model configuration:
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
model: {
|
|
109
|
+
prop: 'checked',
|
|
110
|
+
event: 'change'
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
This means:
|
|
115
|
+
- `v-model="value"` is equivalent to `:checked="value" @change="value = $event"`
|
|
116
|
+
- The `checked` prop receives the current state
|
|
117
|
+
- The `change` event emits the new state
|
|
118
|
+
|
|
119
|
+
**Single Checkbox (Boolean):**
|
|
120
|
+
```vue
|
|
121
|
+
<template>
|
|
122
|
+
<AwCheckbox v-model="accepted" label="I accept" />
|
|
123
|
+
</template>
|
|
124
|
+
|
|
125
|
+
<script>
|
|
126
|
+
export default {
|
|
127
|
+
data() {
|
|
128
|
+
return {
|
|
129
|
+
accepted: false // Boolean value
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</script>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Checkbox Group (Array):**
|
|
137
|
+
```vue
|
|
138
|
+
<template>
|
|
139
|
+
<AwCheckbox v-model="selected" value="option1" label="Option 1" />
|
|
140
|
+
<AwCheckbox v-model="selected" value="option2" label="Option 2" />
|
|
141
|
+
<AwCheckbox v-model="selected" value="option3" label="Option 3" />
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<script>
|
|
145
|
+
export default {
|
|
146
|
+
data() {
|
|
147
|
+
return {
|
|
148
|
+
selected: [] // Array of selected values
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
</script>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
When `checked` is an array, the component automatically:
|
|
156
|
+
- Adds `value` to the array when checked
|
|
157
|
+
- Removes `value` from the array when unchecked
|
|
158
|
+
- Maintains the immutability of the array (returns new arrays)
|
|
159
|
+
|
|
160
|
+
### Label Usage
|
|
161
|
+
|
|
162
|
+
The component provides two ways to add a label:
|
|
163
|
+
|
|
164
|
+
**Via Label Prop (Recommended):**
|
|
165
|
+
```markup
|
|
166
|
+
<AwCheckbox v-model="checked" label="Accept terms" />
|
|
167
|
+
```
|
|
168
|
+
- Simple text label
|
|
169
|
+
- Proper `for` attribute linking
|
|
170
|
+
- Automatic styling
|
|
171
|
+
|
|
172
|
+
**Via Label Slot (Advanced):**
|
|
173
|
+
```markup
|
|
174
|
+
<AwCheckbox v-model="checked">
|
|
175
|
+
<template #label="{ label, value, isChecked }">
|
|
176
|
+
<span :class="{ 'font-bold': isChecked }">{{ label }}</span>
|
|
177
|
+
</template>
|
|
178
|
+
</AwCheckbox>
|
|
179
|
+
```
|
|
180
|
+
- Custom label rendering
|
|
181
|
+
- Access to component state
|
|
182
|
+
- Full control over styling
|
|
183
|
+
|
|
184
|
+
**Note:** The default slot is for completely custom checkbox rendering, not for labels. Use the `label` prop or `label` slot for labels.
|
|
185
|
+
|
|
186
|
+
### Value Handling
|
|
187
|
+
|
|
188
|
+
The `value` prop determines what gets emitted when the checkbox is checked:
|
|
189
|
+
|
|
190
|
+
**Default (String):**
|
|
191
|
+
```markup
|
|
192
|
+
<AwCheckbox v-model="checked" />
|
|
193
|
+
<!-- Emits: 'on' when checked -->
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Custom String:**
|
|
197
|
+
```markup
|
|
198
|
+
<AwCheckbox v-model="items" value="item1" />
|
|
199
|
+
<!-- Emits: 'item1' when checked -->
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Number:**
|
|
203
|
+
```markup
|
|
204
|
+
<AwCheckbox v-model="items" :value="42" />
|
|
205
|
+
<!-- Emits: 42 when checked -->
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Object:**
|
|
209
|
+
```markup
|
|
210
|
+
<AwCheckbox v-model="items" :value="{ id: 1, name: 'Item' }" />
|
|
211
|
+
<!-- Emits: the object when checked -->
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Partial/Indeterminate State
|
|
215
|
+
|
|
216
|
+
The `partial` prop shows a partial/indeterminate state:
|
|
217
|
+
```markup
|
|
218
|
+
<AwCheckbox
|
|
219
|
+
v-model="selectAll"
|
|
220
|
+
:partial="someSelected && !allSelected"
|
|
221
|
+
label="Select All"
|
|
222
|
+
/>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Common use case: "Select All" checkbox in a list:
|
|
226
|
+
- `partial: false` - None or all selected (shows check or empty)
|
|
227
|
+
- `partial: true` - Some selected (shows indeterminate dash)
|
|
228
|
+
|
|
229
|
+
### Error Handling
|
|
230
|
+
|
|
231
|
+
Inherits error management from `ErrorMixin`:
|
|
232
|
+
|
|
233
|
+
```vue
|
|
234
|
+
<template>
|
|
235
|
+
<AwCheckbox
|
|
236
|
+
v-model="accepted"
|
|
237
|
+
label="I accept terms"
|
|
238
|
+
:error="error"
|
|
239
|
+
/>
|
|
240
|
+
</template>
|
|
241
|
+
|
|
242
|
+
<script>
|
|
243
|
+
export default {
|
|
244
|
+
data() {
|
|
245
|
+
return {
|
|
246
|
+
accepted: false,
|
|
247
|
+
error: ''
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
validate() {
|
|
252
|
+
if (!this.accepted) {
|
|
253
|
+
this.error = 'You must accept the terms'
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</script>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Features:
|
|
262
|
+
- Error displayed via tooltip on hover
|
|
263
|
+
- Adds `has-error` class for styling
|
|
264
|
+
- Error clears automatically when state changes
|
|
265
|
+
- Error text shown in tooltip
|
|
266
|
+
|
|
267
|
+
### Field States
|
|
268
|
+
|
|
269
|
+
CSS classes applied based on component state:
|
|
270
|
+
- `is-checkbox` - Always present for checkbox type
|
|
271
|
+
- `has-error` - When error is present
|
|
272
|
+
- `fb-field` - When using default slot (custom rendering)
|
|
273
|
+
|
|
274
|
+
## Related Components
|
|
275
|
+
|
|
276
|
+
- `AwSwitcher` - Toggle switch component
|
|
277
|
+
- `AwRadio` - Radio button component
|
|
278
|
+
- `AwInput` - Text input component
|
|
279
|
+
|
|
280
|
+
## Notes
|
|
281
|
+
|
|
282
|
+
- **Import Method:** Global - Available as atom component
|
|
283
|
+
- Uses v-model with `checked` prop and `change` event
|
|
284
|
+
- Supports checkbox groups when `checked` is an array
|
|
285
|
+
- Automatically manages array when used in groups
|
|
286
|
+
- Supports partial/indeterminate state
|
|
287
|
+
- Extends field and error mixins for label and error handling
|
|
288
|
+
- Value can be any type (string, number, boolean, object)
|