@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,235 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Icon component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwIcon /> component is used to render Icon - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Icon
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Icon
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwIcon` component renders SVG icons from the icon system, supporting custom icons, system icons, and animated icons.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwIcon` is a functional component that renders icons from multiple sources:
|
|
18
|
+
- Custom SVG icons (via SVG sprite)
|
|
19
|
+
- System icons (mono and color variants)
|
|
20
|
+
- Animated icons
|
|
21
|
+
|
|
22
|
+
It automatically detects the icon type and renders the appropriate component.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Basic Example
|
|
27
|
+
|
|
28
|
+
```markup
|
|
29
|
+
<AwIcon name="star" />
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Custom Size
|
|
33
|
+
|
|
34
|
+
```markup
|
|
35
|
+
<AwIcon name="star" size="24" />
|
|
36
|
+
<AwIcon name="star" :size="32" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### With Color
|
|
40
|
+
|
|
41
|
+
```markup
|
|
42
|
+
<AwIcon name="star" color="accent" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### System Icons
|
|
46
|
+
|
|
47
|
+
```markup
|
|
48
|
+
<AwIcon name="awesio/arrow" />
|
|
49
|
+
<AwIcon name="awesiocolor/check" />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Animated Icons
|
|
53
|
+
|
|
54
|
+
```markup
|
|
55
|
+
<AwIcon name="arrow-animated" />
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### With Rotation
|
|
59
|
+
|
|
60
|
+
```markup
|
|
61
|
+
<AwIcon name="awesio/arrow::180" />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Name | Description | Type | Required | Default |
|
|
69
|
+
|------|-------------|------|----------|---------|
|
|
70
|
+
| name | Icon name (required) - see [Built-in Icons](/reference/icons) | `String` | `true` | - |
|
|
71
|
+
| size | Icon size (pixels or number) | `String` / `Number` | `false` | `null` |
|
|
72
|
+
| color | Icon fill color - see [Built-in Colors](/reference/colors) | `String` | `false` | `''` |
|
|
73
|
+
| viewBox | Custom SVG viewBox | `String` | `false` | `null` |
|
|
74
|
+
| className | Additional CSS class | `String` | `false` | - |
|
|
75
|
+
|
|
76
|
+
### Slots
|
|
77
|
+
|
|
78
|
+
No slots are available for this component.
|
|
79
|
+
|
|
80
|
+
### Events
|
|
81
|
+
|
|
82
|
+
No events are emitted by this component.
|
|
83
|
+
|
|
84
|
+
## Icon Types
|
|
85
|
+
|
|
86
|
+
`AwIcon` automatically detects the icon type based on the `name` prop and renders the appropriate component internally. The detection follows this priority order:
|
|
87
|
+
|
|
88
|
+
1. **Animated Icons** - Checked first by exact name match
|
|
89
|
+
2. **System Icons** - Detected by prefix (`awesio/` or `awesiocolor/`)
|
|
90
|
+
3. **Custom Icons** - Fallback to SVG sprite system
|
|
91
|
+
|
|
92
|
+
### Custom Icons
|
|
93
|
+
Custom SVG icons loaded via SVG sprite system. These are icons you add to your project's SVG sprite:
|
|
94
|
+
```markup
|
|
95
|
+
<AwIcon name="custom-icon-name" />
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**How it works:**
|
|
99
|
+
- Component renders `SvgIcon` which looks up the icon in the SVG sprite
|
|
100
|
+
- Icons are loaded from your project's sprite system
|
|
101
|
+
- Use for project-specific icons not in the built-in sets
|
|
102
|
+
|
|
103
|
+
### System Mono Icons
|
|
104
|
+
Built-in monochrome system icons from `@AwUtils/icons/mono`. Single-color SVG paths that inherit text color:
|
|
105
|
+
```markup
|
|
106
|
+
<AwIcon name="awesio/arrow" />
|
|
107
|
+
<AwIcon name="awesio/check" />
|
|
108
|
+
<AwIcon name="awesio/settings" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**How it works:**
|
|
112
|
+
- Component detects `awesio/` prefix and renders `AwIconSystemMono`
|
|
113
|
+
- Icon name is extracted (e.g., `arrow` from `awesio/arrow`)
|
|
114
|
+
- Supports rotation using `::` syntax: `awesio/arrow::180`
|
|
115
|
+
- Icons inherit current text color via CSS
|
|
116
|
+
- All icons are 24x24 viewBox by default
|
|
117
|
+
|
|
118
|
+
**Available Mono Icons:**
|
|
119
|
+
`angle`, `angle-r`, `arrow`, `arrow-r`, `ban`, `check`, `check-circle`, `circle`, `close`, `close-circle`, `delete`, `download`, `drag`, `edit`, `empty-box`, `external`, `eye`, `eye-no`, `filter`, `file-csv`, `file-excel`, `file-image`, `file-pdf`, `file-word`, `image`, `info-circle`, `light`, `lock`, `mail`, `menu`, `menu-dots`, `more`, `more-v`, `phone`, `plus`, `plus-circle`, `plus-fill-square`, `profile`, `save`, `search`, `settings`, `triangle`, `undo`, `upload`, `user`, `warning`
|
|
120
|
+
|
|
121
|
+
### System Color Icons
|
|
122
|
+
Built-in multicolor system icons from `@AwUtils/icons/multicolor`. Icons with multiple colors for illustrations and decorative purposes:
|
|
123
|
+
```markup
|
|
124
|
+
<AwIcon name="awesiocolor/loader" />
|
|
125
|
+
<AwIcon name="awesiocolor/spinner" />
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**How it works:**
|
|
129
|
+
- Component detects `awesiocolor/` prefix and renders `AwIconSystemColor`
|
|
130
|
+
- Icon name is extracted (e.g., `loader` from `awesiocolor/loader`)
|
|
131
|
+
- Icons have predefined dimensions and colors
|
|
132
|
+
- Best for loading states and animated indicators
|
|
133
|
+
|
|
134
|
+
**Available Color Icons:**
|
|
135
|
+
`loader`, `spinner`
|
|
136
|
+
|
|
137
|
+
**Note:** Color icons have predefined dimensions. Use `width` and `height` props on `AwIconSystemColor` to override if needed. Color icons are best for loading states and animated indicators.
|
|
138
|
+
|
|
139
|
+
### Animated Icons
|
|
140
|
+
Special animated icons from `@AwUtils/icons/animated`. Icons with CSS animations:
|
|
141
|
+
```markup
|
|
142
|
+
<AwIcon name="arrow-animated" />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**How it works:**
|
|
146
|
+
- Component checks for exact name match in animated icons first
|
|
147
|
+
- Renders inline SVG with animation classes
|
|
148
|
+
- Animations are defined via CSS classes in the icon content
|
|
149
|
+
- Use for loading states and interactive feedback
|
|
150
|
+
|
|
151
|
+
**Available Animated Icons:**
|
|
152
|
+
`arrow-animated`
|
|
153
|
+
|
|
154
|
+
## Related Components
|
|
155
|
+
|
|
156
|
+
- `AwIconSystemMono` - System mono icon component
|
|
157
|
+
- `AwIconSystemColor` - System color icon component
|
|
158
|
+
- `AwButton` - Button component that uses icons
|
|
159
|
+
|
|
160
|
+
## Icon Detection Logic
|
|
161
|
+
|
|
162
|
+
The component uses the following detection logic (in order):
|
|
163
|
+
|
|
164
|
+
1. **Animated Icons**: Checks if name exists in `ANIMATED_ICONS` object
|
|
165
|
+
- If found: Renders inline SVG with animation classes
|
|
166
|
+
- Example: `arrow-animated` → renders animated SVG
|
|
167
|
+
|
|
168
|
+
2. **System Icons**: Checks if name matches pattern `/^awesio(color)?\/.+/`
|
|
169
|
+
- If `awesiocolor/` prefix: Renders `AwIconSystemColor` with extracted name
|
|
170
|
+
- If `awesio/` prefix: Renders `AwIconSystemMono` with extracted name and optional rotation
|
|
171
|
+
- Example: `awesio/arrow::180` → extracts `arrow` and `180` for rotation
|
|
172
|
+
|
|
173
|
+
3. **Custom Icons**: Falls back to `SvgIcon` component
|
|
174
|
+
- Looks up icon in SVG sprite system
|
|
175
|
+
- Example: `custom-icon` → searches sprite for matching icon
|
|
176
|
+
|
|
177
|
+
## Examples
|
|
178
|
+
|
|
179
|
+
### Mono Icons with Rotation
|
|
180
|
+
```markup
|
|
181
|
+
<AwIcon name="awesio/arrow" />
|
|
182
|
+
<AwIcon name="awesio/arrow::90" />
|
|
183
|
+
<AwIcon name="awesio/arrow::180" />
|
|
184
|
+
<AwIcon name="awesio/arrow::270" />
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Color Icons for Loading States
|
|
188
|
+
```markup
|
|
189
|
+
<div v-if="loading">
|
|
190
|
+
<AwIcon name="awesiocolor/loader" />
|
|
191
|
+
<p>Loading...</p>
|
|
192
|
+
</div>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Animated Loading States
|
|
196
|
+
```markup
|
|
197
|
+
<AwIcon name="arrow-animated" size="32" />
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Different Icon Types Together
|
|
201
|
+
```markup
|
|
202
|
+
<div class="flex gap-4">
|
|
203
|
+
<!-- Mono icon -->
|
|
204
|
+
<AwIcon name="awesio/check" color="success" />
|
|
205
|
+
|
|
206
|
+
<!-- Color icon -->
|
|
207
|
+
<AwIcon name="awesiocolor/loader" />
|
|
208
|
+
|
|
209
|
+
<!-- Animated icon -->
|
|
210
|
+
<AwIcon name="arrow-animated" />
|
|
211
|
+
|
|
212
|
+
<!-- Custom icon -->
|
|
213
|
+
<AwIcon name="custom-logo" />
|
|
214
|
+
</div>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Viewing All Available Icons
|
|
218
|
+
|
|
219
|
+
To see all available built-in icons, visit the Icons page in the example project at `/icons`. The page displays:
|
|
220
|
+
- All mono icons with `awesio/` prefix
|
|
221
|
+
- All color icons with `awesiocolor/` prefix
|
|
222
|
+
- All animated icons
|
|
223
|
+
- Search functionality to find icons by name
|
|
224
|
+
|
|
225
|
+
## Notes
|
|
226
|
+
|
|
227
|
+
- **Import Method:** Global - Available as atom component
|
|
228
|
+
- Functional component for optimal performance
|
|
229
|
+
- Automatically detects icon type from name pattern
|
|
230
|
+
- Size defaults to text size (1em) if not specified
|
|
231
|
+
- Supports rotation for mono system icons using `::` syntax (e.g., `awesio/arrow::180`)
|
|
232
|
+
- Animated icons are automatically detected and rendered with CSS animations
|
|
233
|
+
- Color prop sets fill color via CSS custom properties (works with mono icons)
|
|
234
|
+
- Mono icons inherit text color when color prop is not provided
|
|
235
|
+
- Color icons have fixed colors defined in the icon data
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Info component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwInfo /> component is used to render Info - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Info
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Info
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwInfo` component displays information with an optional label and help tooltip.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwInfo` provides a structured way to display information with a label and optional help icon. It's useful for displaying read-only data in forms or detail views.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwInfo label="Email" text="user@example.com" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Help Tooltip
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwInfo
|
|
31
|
+
label="Status"
|
|
32
|
+
text="Active"
|
|
33
|
+
help="Current account status"
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### With Custom Content
|
|
38
|
+
|
|
39
|
+
```markup
|
|
40
|
+
<AwInfo label="Details">
|
|
41
|
+
<div>Custom content here</div>
|
|
42
|
+
</AwInfo>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Required Field
|
|
46
|
+
|
|
47
|
+
```markup
|
|
48
|
+
<AwInfo label="Name" text="John Doe" required />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## API
|
|
52
|
+
|
|
53
|
+
### Props
|
|
54
|
+
|
|
55
|
+
| Name | Description | Type | Required | Default |
|
|
56
|
+
|------|-------------|------|----------|---------|
|
|
57
|
+
| label | Subtitle/label for the element | `String` | `false` | `''` |
|
|
58
|
+
| help | Tooltip text with help icon | `String` | `false` | `''` |
|
|
59
|
+
| text | Text content (string or number) | `String` / `Number` | `false` | `''` |
|
|
60
|
+
| required | Show required indicator | `Boolean` | `false` | `false` |
|
|
61
|
+
|
|
62
|
+
### Slots
|
|
63
|
+
|
|
64
|
+
| Name | Description | Props | Default Slot Content |
|
|
65
|
+
|------|-------------|-------|---------------------|
|
|
66
|
+
| default | Custom content (replaces text) | - | Text prop value or '—' |
|
|
67
|
+
| icon | Custom help icon | - | Default info-circle icon |
|
|
68
|
+
|
|
69
|
+
### Events
|
|
70
|
+
|
|
71
|
+
No events are emitted by this component.
|
|
72
|
+
|
|
73
|
+
## Related Components
|
|
74
|
+
|
|
75
|
+
- `AwDescription` - Description component
|
|
76
|
+
- `AwLabel` - Label component
|
|
77
|
+
- `AwInput` - Input component
|
|
78
|
+
|
|
79
|
+
## Component Behavior
|
|
80
|
+
|
|
81
|
+
### Label Display
|
|
82
|
+
- Label is rendered only when `label` prop is provided
|
|
83
|
+
- Label uses `AwDescription` component with `<span>` tag
|
|
84
|
+
- When `required` is true, label receives `aw-info__label--required` class for styling
|
|
85
|
+
|
|
86
|
+
### Help Tooltip
|
|
87
|
+
- Help icon appears only when `help` prop is provided
|
|
88
|
+
- Tooltip is positioned to the right of the label
|
|
89
|
+
- Tooltip uses Vue tooltip directive with `:right.prepend` modifiers
|
|
90
|
+
- Default help icon is `info-circle` from AwIconSystemMono
|
|
91
|
+
- Help icon can be customized using the `icon` slot
|
|
92
|
+
|
|
93
|
+
### Content Display
|
|
94
|
+
- Default slot takes precedence over `text` prop
|
|
95
|
+
- When default slot has content, `text` prop is ignored
|
|
96
|
+
- When no slot content and no `text` prop, displays '—' (em dash)
|
|
97
|
+
- Slot detection uses `notEmptyNode` utility to filter empty nodes
|
|
98
|
+
- Text content is rendered in a `<div>` wrapper
|
|
99
|
+
|
|
100
|
+
### Structure
|
|
101
|
+
```
|
|
102
|
+
<div class="aw-info">
|
|
103
|
+
<div class="aw-info__label" [class.aw-info__label--required]>
|
|
104
|
+
<AwDescription tag="span">{{ label }}</AwDescription>
|
|
105
|
+
<slot name="icon">
|
|
106
|
+
<span v-tooltip>
|
|
107
|
+
<AwIconSystemMono name="info-circle" />
|
|
108
|
+
</span>
|
|
109
|
+
</slot>
|
|
110
|
+
</div>
|
|
111
|
+
<slot /> or <div>{{ text || '—' }}</div>
|
|
112
|
+
</div>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Notes
|
|
116
|
+
|
|
117
|
+
- **Import Method:** Global - Available as atom component
|
|
118
|
+
- Shows '—' (em dash) when text is empty and no slot content
|
|
119
|
+
- Help icon appears when `help` prop is provided
|
|
120
|
+
- Default help icon is `info-circle` from system icons
|
|
121
|
+
- Use for displaying read-only information in forms or detail views
|
|
122
|
+
- Component checks for non-empty slot nodes using `$scopedSlots` API
|
|
123
|
+
- Supports both string and number values for `text` prop
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Input component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwInput /> component is used to render Input - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Input
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Input
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwInput` component is a styled text input field with label, error handling, and optional prefix/postfix slots.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwInput` provides a comprehensive text input component with consistent styling, label support, error states, and flexible slot-based customization. It extends the text field mixin for common input functionality.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwInput v-model="value" placeholder="Enter text" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Label
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwInput v-model="email" label="Email" placeholder="your@email.com" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### With Prefix and Postfix
|
|
34
|
+
|
|
35
|
+
```markup
|
|
36
|
+
<AwInput
|
|
37
|
+
v-model="url"
|
|
38
|
+
label="Website"
|
|
39
|
+
prefix="https://"
|
|
40
|
+
postfix=".com"
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### With Icon
|
|
45
|
+
|
|
46
|
+
```markup
|
|
47
|
+
<AwInput v-model="search" label="Search">
|
|
48
|
+
<template #icon>
|
|
49
|
+
<AwIcon name="awesio/search" class="mx-3" />
|
|
50
|
+
</template>
|
|
51
|
+
</AwInput>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### With Error
|
|
55
|
+
|
|
56
|
+
```markup
|
|
57
|
+
<AwInput
|
|
58
|
+
v-model="value"
|
|
59
|
+
label="Required Field"
|
|
60
|
+
:error="errorMessage"
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## API
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Name | Description | Type | Required | Default | Validator |
|
|
69
|
+
|------|-------------|------|----------|---------|-----------|
|
|
70
|
+
| type | Input type (text, email, number, etc.) | `String` | `false` | `'text'` | Must not be checkbox, radio, date, tel, color |
|
|
71
|
+
| prefix | Prefix text or slot content | `String` | `false` | `''` | - |
|
|
72
|
+
| postfix | Postfix text or slot content | `String` | `false` | `''` | - |
|
|
73
|
+
| size | Input size (sm, md) | `String` | `false` | `'md'` | Must be one of configured sizes |
|
|
74
|
+
| theme | CSS theme modifiers | `String` | `false` | `''` | - |
|
|
75
|
+
|
|
76
|
+
All standard HTML input attributes are also supported via `$attrs`.
|
|
77
|
+
|
|
78
|
+
### Slots
|
|
79
|
+
|
|
80
|
+
| Name | Description | Props | Default Slot Content |
|
|
81
|
+
|------|-------------|-------|---------------------|
|
|
82
|
+
| default | Custom input element | `{ cssClass, value, errorTooltip, mergedListeners, mergedAttributes, errorText, errorId }` | Default input element |
|
|
83
|
+
| prefix | Custom prefix content | - | Prefix text |
|
|
84
|
+
| postfix | Custom postfix content | - | Postfix text |
|
|
85
|
+
| icon | Icon slot | - | - |
|
|
86
|
+
| label | Custom label content | `{ cssClass }` | Label text |
|
|
87
|
+
|
|
88
|
+
### Events
|
|
89
|
+
|
|
90
|
+
All standard input events are supported (e.g., `input`, `focus`, `blur`, `change`).
|
|
91
|
+
|
|
92
|
+
### Config Options
|
|
93
|
+
|
|
94
|
+
The component uses default configuration from `@AwConfig`:
|
|
95
|
+
|
|
96
|
+
```javascript
|
|
97
|
+
export default {
|
|
98
|
+
AwInput: {
|
|
99
|
+
baseClass: 'aw-text-field',
|
|
100
|
+
sizes: ['sm', 'md']
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Component Behavior
|
|
106
|
+
|
|
107
|
+
### Input Type Validation
|
|
108
|
+
- Invalid types (checkbox, radio, date, tel, color) trigger console errors
|
|
109
|
+
- Invalid type suggestions:
|
|
110
|
+
- `checkbox` → Use `<AwCheckbox />` or `<AwSwitcher />`
|
|
111
|
+
- `radio` → Use `<AwRadio />`
|
|
112
|
+
- `date/datetime/time/month/week` → Use `<AwDate />`
|
|
113
|
+
- `tel` → Use `<AwTel />`
|
|
114
|
+
- Type validation runs via prop validator
|
|
115
|
+
- **Preferred alternatives for number/money:**
|
|
116
|
+
- For number inputs → Use `<AwNumber />` (preferred over `type="number"`)
|
|
117
|
+
- For money/currency inputs → Use `<AwMoney />` (preferred over `type="number"` with prefix/postfix)
|
|
118
|
+
|
|
119
|
+
### Label Behavior
|
|
120
|
+
- Label appears only when `label` prop or `label` slot is provided
|
|
121
|
+
- Label is rendered inside the input wrapper (floating label pattern)
|
|
122
|
+
- Required indicator shown when `isRequired` is true (from TextFieldMixin)
|
|
123
|
+
- Label receives `aw-text-field__label--required` class when required
|
|
124
|
+
|
|
125
|
+
### Prefix and Postfix
|
|
126
|
+
- Prefix/postfix can be text (via props) or custom content (via slots)
|
|
127
|
+
- When using text props, wrapper receives `px-4` padding
|
|
128
|
+
- Prefix appears before the input, postfix after
|
|
129
|
+
- CSS classes: `aw-text-field__prefix`, `aw-text-field__postfix`
|
|
130
|
+
- Wrapper adds `has-prefix` or `has-postfix` classes for styling
|
|
131
|
+
|
|
132
|
+
### Icon Slot
|
|
133
|
+
- Icon slot renders inside the input wrapper
|
|
134
|
+
- When icon slot has content, wrapper adds `has-icon` class
|
|
135
|
+
- Icon positioned with `aw-text-field__icon` class
|
|
136
|
+
- Recommended to add `mx-3` class to icons for proper spacing
|
|
137
|
+
|
|
138
|
+
### Size and Padding
|
|
139
|
+
- Two sizes: `md` (default) and `sm`
|
|
140
|
+
- Size affects input padding:
|
|
141
|
+
- `md` → `p-3` (12px padding)
|
|
142
|
+
- `sm` → `p-2` (8px padding)
|
|
143
|
+
- Size validation checks against configured sizes in `_config.sizes`
|
|
144
|
+
|
|
145
|
+
### Error Handling
|
|
146
|
+
- Error state managed by TextFieldMixin
|
|
147
|
+
- Error tooltip shows on input with `v-tooltip.show.prepend`
|
|
148
|
+
- Input receives `data-error` attribute when error exists
|
|
149
|
+
- Input uses `aria-describedby` for error accessibility
|
|
150
|
+
- Error text and ID provided via scoped slot bindings
|
|
151
|
+
|
|
152
|
+
### Theme Modifiers
|
|
153
|
+
- `theme` prop accepts comma-separated modifiers
|
|
154
|
+
- Each modifier adds `aw-text-field--{modifier}` class
|
|
155
|
+
- Example: `theme="compact,bordered"` → `aw-text-field--compact aw-text-field--bordered`
|
|
156
|
+
|
|
157
|
+
### Structure
|
|
158
|
+
```
|
|
159
|
+
<label class="aw-text-field is-{type} [has-icon] [has-prefix] [has-postfix]">
|
|
160
|
+
<div class="aw-text-field__prefix [px-4]">
|
|
161
|
+
<slot name="prefix">{{ prefix }}</slot>
|
|
162
|
+
</div>
|
|
163
|
+
|
|
164
|
+
<div class="relative w-full">
|
|
165
|
+
<slot name="element" v-bind="{ cssClass, value, errorTooltip, ... }">
|
|
166
|
+
<input
|
|
167
|
+
class="aw-text-field__element [p-3|p-2]"
|
|
168
|
+
:value="inputValue"
|
|
169
|
+
:aria-describedby="errorId"
|
|
170
|
+
:data-error="errorText"
|
|
171
|
+
v-tooltip.show.prepend="errorTooltip"
|
|
172
|
+
/>
|
|
173
|
+
</slot>
|
|
174
|
+
|
|
175
|
+
<div class="aw-text-field__label [aw-text-field__label--required]">
|
|
176
|
+
<slot name="label">{{ label }}</slot>
|
|
177
|
+
</div>
|
|
178
|
+
|
|
179
|
+
<span class="aw-text-field__icon">
|
|
180
|
+
<slot name="icon" />
|
|
181
|
+
</span>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<div class="aw-text-field__postfix [px-4]">
|
|
185
|
+
<slot name="postfix">{{ postfix }}</slot>
|
|
186
|
+
</div>
|
|
187
|
+
</label>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Related Components
|
|
191
|
+
|
|
192
|
+
- `AwTextarea` - Multi-line text input
|
|
193
|
+
- `AwPassword` - Password input
|
|
194
|
+
- `AwSelect` - Select dropdown
|
|
195
|
+
- `AwDate` - Date input
|
|
196
|
+
- `AwTel` - Telephone input
|
|
197
|
+
- `AwNumber` - Number input with formatting
|
|
198
|
+
- `AwMoney` - Money/currency input with formatting
|
|
199
|
+
|
|
200
|
+
## Notes
|
|
201
|
+
|
|
202
|
+
- **Import Method:** Global - Available as atom component
|
|
203
|
+
- Extends `TextFieldMixin` for common field functionality (value, error, label, validation)
|
|
204
|
+
- Supports error states with tooltip display
|
|
205
|
+
- Invalid input types (checkbox, radio, date, tel, color) will show console errors
|
|
206
|
+
- Use appropriate specialized components for specific input types
|
|
207
|
+
- Size affects padding: `md` uses `p-3`, `sm` uses `p-2`
|
|
208
|
+
- Base CSS class: `aw-text-field` (from config)
|
|
209
|
+
- Wrapper is a `<label>` element for better accessibility
|
|
210
|
+
- Input element uses `mergedAttributes` (combines type, skipAttr, $attrs, and id)
|
|
211
|
+
- All standard HTML input attributes supported via `$attrs` (inheritAttrs enabled)
|
|
212
|
+
- All standard input events supported via `mergedListeners`
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
metaTitle: Label component | AwesCode UI
|
|
3
|
+
meta:
|
|
4
|
+
- name: description
|
|
5
|
+
content: The <AwLabel /> component is used to render Label - UI Vue component for AwesCode UI.
|
|
6
|
+
title: Label
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Label
|
|
10
|
+
|
|
11
|
+
**Category:** Atom | **Import:** Global
|
|
12
|
+
|
|
13
|
+
The `AwLabel` component displays a styled label with optional icons and customizable colors.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
`AwLabel` provides a badge-like label component that can display text with optional leading and trailing icons. It supports custom colors and is commonly used for tags, categories, and status indicators.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
### Basic Example
|
|
22
|
+
|
|
23
|
+
```markup
|
|
24
|
+
<AwLabel label="New" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### With Icons
|
|
28
|
+
|
|
29
|
+
```markup
|
|
30
|
+
<AwLabel label="Featured" icon="awesio/star" />
|
|
31
|
+
<AwLabel label="Verified" icon="awesio/check" icon-second="awesio/close" />
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### With Colors
|
|
35
|
+
|
|
36
|
+
```markup
|
|
37
|
+
<AwLabel label="Success" color="success" />
|
|
38
|
+
<AwLabel label="Warning" color="warning" />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Boolean Icon
|
|
42
|
+
|
|
43
|
+
```markup
|
|
44
|
+
<AwLabel label="Active" :icon="true" />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## API
|
|
48
|
+
|
|
49
|
+
### Props
|
|
50
|
+
|
|
51
|
+
| Name | Description | Type | Required | Default |
|
|
52
|
+
|------|-------------|------|----------|---------|
|
|
53
|
+
| label | Label text | `String` | `true` | - |
|
|
54
|
+
| color | Background color - see [Built-in Colors](/reference/colors) | `String` | `false` | `''` |
|
|
55
|
+
| onColor | Text/icon color - see [Built-in Colors](/reference/colors) | `String` | `false` | `''` |
|
|
56
|
+
| icon | Leading icon (boolean for default, string for custom) - see [Built-in Icons](/reference/icons) | `Boolean` / `String` | `false` | `null` |
|
|
57
|
+
| iconSecond | Trailing icon name - see [Built-in Icons](/reference/icons) | `String` | `false` | `null` |
|
|
58
|
+
|
|
59
|
+
### Slots
|
|
60
|
+
|
|
61
|
+
| Name | Description | Props | Default Slot Content |
|
|
62
|
+
|------|-------------|-------|---------------------|
|
|
63
|
+
| default | Custom label content (replaces label prop) | - | Label text |
|
|
64
|
+
|
|
65
|
+
### Events
|
|
66
|
+
|
|
67
|
+
No events are emitted by this component.
|
|
68
|
+
|
|
69
|
+
## Component Behavior
|
|
70
|
+
|
|
71
|
+
### Icon Handling
|
|
72
|
+
- **Boolean icon:** When `icon` is `true`, displays `awesio/circle` icon
|
|
73
|
+
- **String icon:** When `icon` is a string, displays that icon name
|
|
74
|
+
- **Null/false icon:** When `icon` is `null` or `false`, no icon displayed
|
|
75
|
+
- Icons are automatically rendered using `AwIcon` component with size 16
|
|
76
|
+
- Icons have `aria-hidden="true"` for accessibility
|
|
77
|
+
|
|
78
|
+
### Icon Type Detection
|
|
79
|
+
- Component checks if icon exists in mono icon set
|
|
80
|
+
- System icons (mono) are detected automatically
|
|
81
|
+
- Non-system icons handled via AwIcon component
|
|
82
|
+
|
|
83
|
+
### Color System
|
|
84
|
+
- **Default colors (no color/onColor specified):**
|
|
85
|
+
- Background: `var(--c-mono-900)`
|
|
86
|
+
- Text/icon: `var(--c-mono-400)`
|
|
87
|
+
- **With color prop:**
|
|
88
|
+
- Background: Uses `toColor(color)` utility
|
|
89
|
+
- Text/icon: Auto-calculated using `toOnColor(color)` for contrast
|
|
90
|
+
- **With onColor prop:**
|
|
91
|
+
- Overrides automatic text/icon color
|
|
92
|
+
- Uses `toColor(onColor)` utility
|
|
93
|
+
|
|
94
|
+
### Available Colors
|
|
95
|
+
- **Semantic colors:** `success`, `warning`, `error`, `info`, `accent`, `notify`
|
|
96
|
+
- **Mono scale:** `mono-0` through `mono-900` (in increments of 50/100)
|
|
97
|
+
- **Named colors:** `red`, `peach`, `yellow`, `magenta`, `purple`, `light-blue`, `blue`, `green`, `lime`, `grey`, `light-grey`, `black`, `forest`, `brown`
|
|
98
|
+
- All colors automatically get proper contrast text/icon colors via `toOnColor` utility
|
|
99
|
+
|
|
100
|
+
### Style Variables
|
|
101
|
+
Component uses CSS custom properties:
|
|
102
|
+
- `--aw-label-bg` - Background color
|
|
103
|
+
- `--aw-label-on-color` - Text and icon color
|
|
104
|
+
|
|
105
|
+
### Rendering
|
|
106
|
+
- Component only renders if `label` prop is provided
|
|
107
|
+
- Default slot replaces label text but label prop is still required
|
|
108
|
+
- Icons positioned via flexbox: leading icon → text → trailing icon
|
|
109
|
+
|
|
110
|
+
### Structure
|
|
111
|
+
```
|
|
112
|
+
<div class="aw-label" :style="{ --aw-label-bg, --aw-label-on-color }">
|
|
113
|
+
<AwIcon v-if="_icon" :name="_icon" size="16" />
|
|
114
|
+
<slot>{{ label }}</slot>
|
|
115
|
+
<AwIcon v-if="iconSecond" :name="iconSecond" size="16" />
|
|
116
|
+
</div>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Related Components
|
|
120
|
+
|
|
121
|
+
- `AwTag` - Tag component
|
|
122
|
+
- `AwBadge` - Badge component
|
|
123
|
+
- `AwIcon` - Icon component
|
|
124
|
+
|
|
125
|
+
## Notes
|
|
126
|
+
|
|
127
|
+
- **Import Method:** Global - Available as atom component
|
|
128
|
+
- When `icon` is `true`, displays default circle icon (`awesio/circle`)
|
|
129
|
+
- When `icon` is a string, displays that icon
|
|
130
|
+
- System icons are automatically detected from mono icon set
|
|
131
|
+
- Default colors are mono-900 background with mono-400 text if no colors specified
|
|
132
|
+
- Use `onColor` to override text color when using custom background color
|
|
133
|
+
- Label prop is required even when using default slot
|
|
134
|
+
- Icons are always size 16 and have aria-hidden attribute
|
|
135
|
+
- Color utilities (`toColor`, `toOnColor`) handle color name to CSS variable conversion
|
|
136
|
+
|