@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.
- 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 +14 -0
- 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 +4 -3
- package/assets/css/components/dropdown.css +20 -7
- package/assets/css/components/icon-menu-item.css +12 -7
- package/assets/css/components/mobile-menu-nav.css +8 -4
- package/assets/css/components/text-field.css +4 -0
- package/components/1_atoms/AwActionIcon.vue +11 -2
- package/components/1_atoms/AwFlow.vue +26 -11
- 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/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/AwDescriptionInput.vue +19 -1
- package/components/3_organisms/AwBottomBar.vue +22 -4
- package/components/3_organisms/AwSubnav.vue +11 -1
- package/components/3_organisms/AwTable/AwTableBuilder.vue +8 -0
- 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/5_layouts/_AwMenuItemIcon.vue +9 -2
- package/components/5_layouts/_AwMobileMenuItem.vue +5 -3
- package/components/_config.js +26 -1
- package/docs/components/atoms/aw-accordion-fold.md +55 -17
- package/docs/components/atoms/aw-action-card-body.md +37 -5
- package/docs/components/atoms/aw-action-card.md +47 -11
- package/docs/components/atoms/aw-action-icon.md +50 -12
- package/docs/components/atoms/aw-card.md +35 -10
- package/docs/components/atoms/aw-checkbox.md +176 -0
- package/docs/components/atoms/aw-content-placeholder.md +33 -2
- package/docs/components/atoms/aw-dock.md +20 -14
- package/docs/components/atoms/aw-dropdown.md +72 -22
- package/docs/components/atoms/aw-flow.md +71 -23
- package/docs/components/atoms/aw-grid.md +30 -12
- package/docs/components/atoms/aw-icon-system-color.md +1 -0
- package/docs/components/atoms/aw-icon-system-mono.md +1 -0
- package/docs/components/atoms/aw-icon.md +3 -3
- package/docs/components/atoms/aw-info.md +38 -0
- package/docs/components/atoms/aw-input.md +94 -2
- package/docs/components/atoms/aw-label.md +62 -9
- package/docs/components/atoms/aw-link.md +61 -9
- package/docs/components/atoms/aw-list.md +68 -4
- package/docs/components/atoms/aw-progress.md +52 -3
- package/docs/components/atoms/aw-radio.md +73 -0
- package/docs/components/atoms/aw-select-native.md +128 -0
- package/docs/components/atoms/aw-slider.md +114 -7
- package/docs/components/atoms/aw-switcher.md +77 -0
- package/docs/components/atoms/aw-tag.md +67 -3
- package/docs/components/atoms/aw-toggler.md +22 -1
- package/docs/components/molecules/aw-action-button.md +58 -11
- package/docs/components/molecules/aw-alert.md +122 -27
- package/docs/components/molecules/aw-badge.md +31 -10
- package/docs/components/molecules/aw-banner-text.md +84 -18
- package/docs/components/molecules/aw-button-nav.md +65 -0
- package/docs/components/molecules/aw-button.md +76 -6
- package/docs/components/molecules/aw-description-input.md +63 -6
- package/docs/components/molecules/aw-empty-container.md +172 -23
- package/docs/components/molecules/aw-island.md +282 -10
- package/docs/components/organisms/aw-filter-select.md +14 -0
- package/docs/components/pages/aw-page-single.md +47 -0
- package/docs/guides/page-patterns/detail-pages.md +89 -26
- package/docs/guides/page-patterns/list-pages.md +158 -10
- package/docs/reference/colors.md +232 -0
- package/docs/reference/icons.md +163 -0
- package/docs/reference/troubleshooting.md +19 -0
- package/package.json +2 -2
- package/store/awesIo.js +11 -0
- package/CHANGELOG.md +0 -4544
- package/dist/css/aw-icons.css +0 -26
- package/dist/fonts/aw-icons.svg +0 -18
- package/dist/fonts/aw-icons.ttf +0 -0
- package/dist/fonts/aw-icons.woff +0 -0
- package/dist/fonts/aw-icons.woff2 +0 -0
- package/nuxt/icons.css +0 -26
|
@@ -22,38 +22,75 @@ The `AwFlow` component provides a flexible flow layout system with configurable
|
|
|
22
22
|
|
|
23
23
|
```markup
|
|
24
24
|
<AwFlow>
|
|
25
|
-
<
|
|
26
|
-
<
|
|
27
|
-
<
|
|
25
|
+
<AwButton>Item 1</AwButton>
|
|
26
|
+
<AwButton>Item 2</AwButton>
|
|
27
|
+
<AwButton>Item 3</AwButton>
|
|
28
28
|
</AwFlow>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
###
|
|
31
|
+
### Vertical Layout
|
|
32
|
+
|
|
33
|
+
In vertical mode, items stack vertically. Use the `align` prop to control horizontal alignment.
|
|
32
34
|
|
|
33
35
|
```markup
|
|
34
|
-
<AwFlow :gap="
|
|
35
|
-
<
|
|
36
|
-
<
|
|
36
|
+
<AwFlow vertical :gap="2">
|
|
37
|
+
<AwButton>Item 1</AwButton>
|
|
38
|
+
<AwButton>Item 2</AwButton>
|
|
39
|
+
<AwButton>Item 3</AwButton>
|
|
37
40
|
</AwFlow>
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
### Vertical
|
|
43
|
+
### Vertical with Alignment
|
|
44
|
+
|
|
45
|
+
When the `vertical` prop is set, `align` controls horizontal alignment (items-center, items-end, items-start) and `justify` controls vertical distribution.
|
|
46
|
+
|
|
47
|
+
```markup
|
|
48
|
+
<AwFlow vertical align="center" justify="center" :gap="2">
|
|
49
|
+
<AwButton>Centered Vertically</AwButton>
|
|
50
|
+
<AwButton>and Horizontally</AwButton>
|
|
51
|
+
</AwFlow>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Horizontal with Alignment
|
|
55
|
+
|
|
56
|
+
In horizontal mode (default), `align` controls vertical alignment and `justify` controls horizontal distribution. Note: horizontal mode has `align="center"` by default.
|
|
41
57
|
|
|
42
58
|
```markup
|
|
43
|
-
<AwFlow
|
|
44
|
-
<
|
|
45
|
-
<div>Item 2</div>
|
|
59
|
+
<AwFlow justify="center" :gap="6">
|
|
60
|
+
<AwButton>Centered Item</AwButton>
|
|
46
61
|
</AwFlow>
|
|
47
62
|
```
|
|
48
63
|
|
|
49
|
-
### With
|
|
64
|
+
### With Wrap
|
|
65
|
+
|
|
66
|
+
The `wrap` prop allows items to wrap to the next line when they exceed the container width.
|
|
50
67
|
|
|
51
68
|
```markup
|
|
52
|
-
<AwFlow
|
|
53
|
-
<
|
|
69
|
+
<AwFlow wrap :gap="2">
|
|
70
|
+
<AwButton>Item 1</AwButton>
|
|
71
|
+
<AwButton>Item 2</AwButton>
|
|
72
|
+
<AwButton>Item 3</AwButton>
|
|
73
|
+
<AwButton>Item 4</AwButton>
|
|
74
|
+
<AwButton>Item 5</AwButton>
|
|
75
|
+
<AwButton>Item 6</AwButton>
|
|
54
76
|
</AwFlow>
|
|
55
77
|
```
|
|
56
78
|
|
|
79
|
+
### Inline Flow
|
|
80
|
+
|
|
81
|
+
Use the `inline` prop to render as inline-flex, allowing the flow to sit inline with surrounding content.
|
|
82
|
+
|
|
83
|
+
```markup
|
|
84
|
+
<AwDescription tag="div">
|
|
85
|
+
This is text before
|
|
86
|
+
<AwFlow inline :gap="2">
|
|
87
|
+
<AwButton size="sm">Action 1</AwButton>
|
|
88
|
+
<AwButton size="sm">Action 2</AwButton>
|
|
89
|
+
</AwFlow>
|
|
90
|
+
and text after.
|
|
91
|
+
</AwDescription>
|
|
92
|
+
```
|
|
93
|
+
|
|
57
94
|
## API
|
|
58
95
|
|
|
59
96
|
### Props
|
|
@@ -61,11 +98,12 @@ The `AwFlow` component provides a flexible flow layout system with configurable
|
|
|
61
98
|
| Name | Description | Type | Required | Default |
|
|
62
99
|
|------|-------------|------|----------|---------|
|
|
63
100
|
| tag | HTML tag to render | `String` | `false` | `'span'` |
|
|
64
|
-
| gap | Gap scale (spacing multiplier) | `Number` | `false` | `4` |
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
|
|
|
101
|
+
| gap | Gap scale (spacing multiplier, supports: 1, 2, 3, 4, 5, 6, 8) | `Number` | `false` | `4` |
|
|
102
|
+
| justify | Flexbox justify-content (start, center, between, end) | `String` | `false` | `''` |
|
|
103
|
+
| align | Flexbox align-items (start, center, end) | `String` | `false` | `'center'` (horizontal mode only) |
|
|
104
|
+
| vertical | Use vertical layout (flex-col) | `Boolean` | `false` | `false` |
|
|
105
|
+
| wrap | Allow items to wrap to next line (flex-wrap) | `Boolean` | `false` | `false` |
|
|
106
|
+
| inline | Use inline-flex instead of flex | `Boolean` | `false` | `false` |
|
|
69
107
|
|
|
70
108
|
### Slots
|
|
71
109
|
|
|
@@ -85,8 +123,18 @@ No events are emitted by this component.
|
|
|
85
123
|
## Notes
|
|
86
124
|
|
|
87
125
|
- **Import Method:** Global - Available as atom component
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
126
|
+
- Built on top of Tailwind's flexbox utilities
|
|
127
|
+
- **Gap values:** Accepts numbers 1-6 and 8, which map to Tailwind's gap classes (gap-1 through gap-8)
|
|
128
|
+
- **Default alignment behavior:**
|
|
129
|
+
- Horizontal mode (default): Items have `align="center"` by default for vertical centering
|
|
130
|
+
- Vertical mode: No default alignment, items align to start unless specified
|
|
131
|
+
- **Alignment and justify behavior:**
|
|
132
|
+
- **Horizontal mode:** `align` controls vertical alignment (items-*), `justify` controls horizontal distribution (justify-*)
|
|
133
|
+
- **Vertical mode:** `align` controls horizontal alignment (items-*), `justify` controls vertical distribution (justify-*)
|
|
134
|
+
- **Available alignment values:**
|
|
135
|
+
- `align`: `start`, `center`, `end`
|
|
136
|
+
- `justify`: `start`, `center`, `between`, `end`
|
|
137
|
+
- Use `wrap` prop to enable multi-line layouts when items exceed container width
|
|
138
|
+
- Use `inline` prop to render as inline-flex instead of block-level flex
|
|
139
|
+
- Component renders as a `<span>` by default (can be changed via `tag` prop)
|
|
92
140
|
|
|
@@ -40,20 +40,26 @@ The `AwGrid` component provides a CSS Grid-based layout system with configurable
|
|
|
40
40
|
|
|
41
41
|
### With Column Spanning
|
|
42
42
|
|
|
43
|
+
Children can span multiple columns using the `span` attribute:
|
|
44
|
+
|
|
43
45
|
```markup
|
|
44
46
|
<AwGrid :col="3" :gap="6">
|
|
45
|
-
<div span="2">Spans 2 columns</div>
|
|
47
|
+
<div :span="2">Spans 2 columns</div>
|
|
46
48
|
<div>Normal</div>
|
|
47
49
|
<div>Normal</div>
|
|
48
50
|
</AwGrid>
|
|
49
51
|
```
|
|
50
52
|
|
|
51
|
-
###
|
|
53
|
+
### Responsive Spanning
|
|
54
|
+
|
|
55
|
+
Spanning can also be responsive:
|
|
52
56
|
|
|
53
57
|
```markup
|
|
54
|
-
<AwGrid :col="
|
|
55
|
-
<div
|
|
56
|
-
|
|
58
|
+
<AwGrid :col="{ default: 1, md: 3 }" :gap="6">
|
|
59
|
+
<div :span="{ default: 1, md: 2 }">
|
|
60
|
+
Spans full width on mobile, 2 columns on desktop
|
|
61
|
+
</div>
|
|
62
|
+
<div>Normal</div>
|
|
57
63
|
</AwGrid>
|
|
58
64
|
```
|
|
59
65
|
|
|
@@ -63,9 +69,10 @@ The `AwGrid` component provides a CSS Grid-based layout system with configurable
|
|
|
63
69
|
|
|
64
70
|
| Name | Description | Type | Required | Default |
|
|
65
71
|
|------|-------------|------|----------|---------|
|
|
66
|
-
| col | Number of columns or responsive object | `Number` / `Object` | `false` | `1` |
|
|
67
|
-
| gap | Gap scale or responsive object | `Number` / `Object` | `false` | `6` |
|
|
68
|
-
| align | Vertical alignment (start, center, end) | `String` | `false` | `'start'` |
|
|
72
|
+
| col | Number of columns or responsive object (e.g., `{ default: 1, md: 2, lg: 3 }`) | `Number` / `Object` | `false` | `1` |
|
|
73
|
+
| gap | Gap scale or responsive object (supports same values as AwFlow: 1-6, 8) | `Number` / `Object` | `false` | `6` |
|
|
74
|
+
| align | Vertical alignment within grid cells (start, center, end) | `String` | `false` | `'start'` |
|
|
75
|
+
| span | Column span for the grid itself (used when nesting grids) | `Number` / `Object` | `false` | `null` |
|
|
69
76
|
|
|
70
77
|
### Slots
|
|
71
78
|
|
|
@@ -85,7 +92,18 @@ No events are emitted by this component.
|
|
|
85
92
|
## Notes
|
|
86
93
|
|
|
87
94
|
- **Import Method:** Global - Available as atom component
|
|
88
|
-
-
|
|
89
|
-
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
95
|
+
- **Functional Component:** AwGrid is a functional component (no instance, lighter weight)
|
|
96
|
+
- Built on top of Tailwind's CSS Grid utilities
|
|
97
|
+
- **Gap values:** Accepts numbers 1-6 and 8, which map to Tailwind's gap classes (gap-1 through gap-8)
|
|
98
|
+
- **Responsive configuration:** Both `col` and `gap` support responsive objects
|
|
99
|
+
- Use `{ default: 1, md: 2, lg: 3 }` syntax for responsive columns
|
|
100
|
+
- The `default` key is used for the base (mobile) value
|
|
101
|
+
- Available breakpoints: `sm`, `md`, `lg`, `xl`, `2xl`
|
|
102
|
+
- **Column spanning:** Children can use the `span` attribute to span multiple columns
|
|
103
|
+
- Use `:span="2"` for static spanning
|
|
104
|
+
- Use `:span="{ default: 1, md: 2 }"` for responsive spanning
|
|
105
|
+
- The `span` attribute is automatically converted to `col-span-*` classes
|
|
106
|
+
- **Grid nesting:** The grid component itself can have a `span` prop when nested inside another grid
|
|
107
|
+
- **Alignment:** The `align` prop controls vertical alignment of items within grid cells (items-start, items-center, items-end)
|
|
108
|
+
- Empty nodes (whitespace, comments) are automatically filtered out
|
|
109
|
+
- Component always renders as a `<div>` element
|
|
@@ -112,6 +112,7 @@ The component renders inline SVG, allowing CSS styling:
|
|
|
112
112
|
## Notes
|
|
113
113
|
|
|
114
114
|
- **Import Method:** Global - Available as atom component
|
|
115
|
+
- **Preferred Usage:** Use `<AwIcon name="awesiocolor/icon-name" />` instead of using this component directly. The AwIcon component automatically detects the icon type and provides a simpler API.
|
|
115
116
|
- Icons maintain their original colors from design
|
|
116
117
|
- Inline SVG allows for advanced CSS styling
|
|
117
118
|
- Icon viewBox and content come from icon library
|
|
@@ -193,6 +193,7 @@ The component automatically includes `aria-hidden="true"` since icons are decora
|
|
|
193
193
|
## Notes
|
|
194
194
|
|
|
195
195
|
- **Import Method:** Global - Available as atom component
|
|
196
|
+
- **Preferred Usage:** Use `<AwIcon name="awesio/icon-name" />` instead of using this component directly. The AwIcon component automatically detects the icon type and provides a simpler API.
|
|
196
197
|
- Functional component for optimal performance
|
|
197
198
|
- Icons inherit current text color
|
|
198
199
|
- SVG paths defined in `@AwUtils/icons/mono`
|
|
@@ -39,7 +39,7 @@ It automatically detects the icon type and renders the appropriate component.
|
|
|
39
39
|
### With Color
|
|
40
40
|
|
|
41
41
|
```markup
|
|
42
|
-
<AwIcon name="star" color="accent
|
|
42
|
+
<AwIcon name="star" color="accent" />
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### System Icons
|
|
@@ -67,9 +67,9 @@ It automatically detects the icon type and renders the appropriate component.
|
|
|
67
67
|
|
|
68
68
|
| Name | Description | Type | Required | Default |
|
|
69
69
|
|------|-------------|------|----------|---------|
|
|
70
|
-
| name | Icon name (required) | `String` | `true` | - |
|
|
70
|
+
| name | Icon name (required) - see [Built-in Icons](/reference/icons) | `String` | `true` | - |
|
|
71
71
|
| size | Icon size (pixels or number) | `String` / `Number` | `false` | `null` |
|
|
72
|
-
| color | Icon fill color | `String` | `false` | `''` |
|
|
72
|
+
| color | Icon fill color - see [Built-in Colors](/reference/colors) | `String` | `false` | `''` |
|
|
73
73
|
| viewBox | Custom SVG viewBox | `String` | `false` | `null` |
|
|
74
74
|
| className | Additional CSS class | `String` | `false` | - |
|
|
75
75
|
|
|
@@ -76,6 +76,42 @@ No events are emitted by this component.
|
|
|
76
76
|
- `AwLabel` - Label component
|
|
77
77
|
- `AwInput` - Input component
|
|
78
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
|
+
|
|
79
115
|
## Notes
|
|
80
116
|
|
|
81
117
|
- **Import Method:** Global - Available as atom component
|
|
@@ -83,3 +119,5 @@ No events are emitted by this component.
|
|
|
83
119
|
- Help icon appears when `help` prop is provided
|
|
84
120
|
- Default help icon is `info-circle` from system icons
|
|
85
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
|
|
@@ -46,7 +46,7 @@ The `AwInput` component is a styled text input field with label, error handling,
|
|
|
46
46
|
```markup
|
|
47
47
|
<AwInput v-model="search" label="Search">
|
|
48
48
|
<template #icon>
|
|
49
|
-
<AwIcon name="awesio/search" />
|
|
49
|
+
<AwIcon name="awesio/search" class="mx-3" />
|
|
50
50
|
</template>
|
|
51
51
|
</AwInput>
|
|
52
52
|
```
|
|
@@ -102,6 +102,91 @@ export default {
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
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
|
+
|
|
105
190
|
## Related Components
|
|
106
191
|
|
|
107
192
|
- `AwTextarea` - Multi-line text input
|
|
@@ -109,12 +194,19 @@ export default {
|
|
|
109
194
|
- `AwSelect` - Select dropdown
|
|
110
195
|
- `AwDate` - Date input
|
|
111
196
|
- `AwTel` - Telephone input
|
|
197
|
+
- `AwNumber` - Number input with formatting
|
|
198
|
+
- `AwMoney` - Money/currency input with formatting
|
|
112
199
|
|
|
113
200
|
## Notes
|
|
114
201
|
|
|
115
202
|
- **Import Method:** Global - Available as atom component
|
|
116
|
-
- Extends `TextFieldMixin` for common field functionality
|
|
203
|
+
- Extends `TextFieldMixin` for common field functionality (value, error, label, validation)
|
|
117
204
|
- Supports error states with tooltip display
|
|
118
205
|
- Invalid input types (checkbox, radio, date, tel, color) will show console errors
|
|
119
206
|
- Use appropriate specialized components for specific input types
|
|
120
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`
|
|
@@ -27,15 +27,15 @@ The `AwLabel` component displays a styled label with optional icons and customiz
|
|
|
27
27
|
### With Icons
|
|
28
28
|
|
|
29
29
|
```markup
|
|
30
|
-
<AwLabel label="Featured" icon="star" />
|
|
30
|
+
<AwLabel label="Featured" icon="awesio/star" />
|
|
31
31
|
<AwLabel label="Verified" icon="awesio/check" icon-second="awesio/close" />
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
### With Colors
|
|
35
35
|
|
|
36
36
|
```markup
|
|
37
|
-
<AwLabel label="Success" color="success
|
|
38
|
-
<AwLabel label="Warning" color="warning
|
|
37
|
+
<AwLabel label="Success" color="success" />
|
|
38
|
+
<AwLabel label="Warning" color="warning" />
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Boolean Icon
|
|
@@ -51,10 +51,10 @@ The `AwLabel` component displays a styled label with optional icons and customiz
|
|
|
51
51
|
| Name | Description | Type | Required | Default |
|
|
52
52
|
|------|-------------|------|----------|---------|
|
|
53
53
|
| label | Label text | `String` | `true` | - |
|
|
54
|
-
| color | Background color | `String` | `false` | `''` |
|
|
55
|
-
| onColor | Text/icon color | `String` | `false` | `''` |
|
|
56
|
-
| icon | Leading icon (boolean for default, string for custom) | `Boolean` / `String` | `false` | `null` |
|
|
57
|
-
| iconSecond | Trailing icon name | `String` | `false` | `null` |
|
|
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
58
|
|
|
59
59
|
### Slots
|
|
60
60
|
|
|
@@ -66,6 +66,56 @@ The `AwLabel` component displays a styled label with optional icons and customiz
|
|
|
66
66
|
|
|
67
67
|
No events are emitted by this component.
|
|
68
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
|
+
|
|
69
119
|
## Related Components
|
|
70
120
|
|
|
71
121
|
- `AwTag` - Tag component
|
|
@@ -75,9 +125,12 @@ No events are emitted by this component.
|
|
|
75
125
|
## Notes
|
|
76
126
|
|
|
77
127
|
- **Import Method:** Global - Available as atom component
|
|
78
|
-
- When `icon` is `true`, displays default circle icon
|
|
128
|
+
- When `icon` is `true`, displays default circle icon (`awesio/circle`)
|
|
79
129
|
- When `icon` is a string, displays that icon
|
|
80
|
-
- System icons are automatically detected
|
|
130
|
+
- System icons are automatically detected from mono icon set
|
|
81
131
|
- Default colors are mono-900 background with mono-400 text if no colors specified
|
|
82
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
|
|
83
136
|
|
|
@@ -30,16 +30,16 @@ The `AwLink` component is a flexible link component that supports routing, exter
|
|
|
30
30
|
<AwLink href="https://example.com">External Link</AwLink>
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
### With Router
|
|
33
|
+
### With Router Object
|
|
34
34
|
|
|
35
35
|
```markup
|
|
36
|
-
<AwLink :
|
|
36
|
+
<AwLink :href="{ name: 'page', params: { id: 1 } }">Router Link</AwLink>
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### With Custom Color
|
|
40
40
|
|
|
41
41
|
```markup
|
|
42
|
-
<AwLink href="/page" color="accent
|
|
42
|
+
<AwLink href="/page" color="accent">Colored Link</AwLink>
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
### Reset Styling
|
|
@@ -54,11 +54,11 @@ The `AwLink` component is a flexible link component that supports routing, exter
|
|
|
54
54
|
|
|
55
55
|
| Name | Description | Type | Required | Default |
|
|
56
56
|
|------|-------------|------|----------|---------|
|
|
57
|
-
| href | Link destination (string or router object) | `String` / `Object` | `false` |
|
|
58
|
-
|
|
|
57
|
+
| href | Link destination (string or router object) | `String` / `Object` | `false` | `''` |
|
|
58
|
+
| back | Enable back button behavior | `Boolean` | `false` | `false` |
|
|
59
59
|
| className | CSS class name | `String` | `false` | From config |
|
|
60
60
|
| text | Link text content | `String` | `false` | - |
|
|
61
|
-
| color | Link color | `String` | `false` | `null` |
|
|
61
|
+
| color | Link color - see [Built-in Colors](/reference/colors) | `String` | `false` | `null` |
|
|
62
62
|
| reset | Remove default link styling | `Boolean` | `false` | `false` |
|
|
63
63
|
|
|
64
64
|
### Slots
|
|
@@ -84,6 +84,51 @@ export default {
|
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
## Component Behavior
|
|
88
|
+
|
|
89
|
+
### Link Type Detection
|
|
90
|
+
- **Internal links:** Uses router component (default: `router-link`) when no protocol detected
|
|
91
|
+
- **External links:** Uses `<a>` tag when URL starts with `http://` or `https://`
|
|
92
|
+
- Detection handled by linkMixin
|
|
93
|
+
|
|
94
|
+
### Routing
|
|
95
|
+
- **href prop:** Accepts string URL or router object
|
|
96
|
+
- **String href:** Direct URL path (e.g., `/page` or `https://example.com`)
|
|
97
|
+
- **Object href:** Vue Router location descriptor
|
|
98
|
+
- Named routes: `{ name: 'routeName' }`
|
|
99
|
+
- Path with params: `{ path: '/path', query: { ... } }`
|
|
100
|
+
- All Vue Router location options supported
|
|
101
|
+
- **Internal conversion:** `href` is converted to `to` prop when rendering NuxtLink/router-link
|
|
102
|
+
|
|
103
|
+
### Component Rendering
|
|
104
|
+
- Uses dynamic component (`:is="_linkComponent"`)
|
|
105
|
+
- Component type determined by linkMixin based on URL
|
|
106
|
+
- Router component configurable via `_config.routerComponent`
|
|
107
|
+
|
|
108
|
+
### Styling System
|
|
109
|
+
- **Default:** Uses `baseClass` from config (`link`)
|
|
110
|
+
- **With color:** Sets `--btn-color` CSS variable via `colorStyle`
|
|
111
|
+
- **With reset:** Removes all default classes when `reset={true}`
|
|
112
|
+
- **Custom className:** Can override default class via `className` prop
|
|
113
|
+
|
|
114
|
+
### Color Handling
|
|
115
|
+
- Color prop uses `toColor` utility for conversion
|
|
116
|
+
- Sets CSS custom property `--btn-color`
|
|
117
|
+
- Supports all color names (semantic, mono, named)
|
|
118
|
+
- Color is optional (default: null)
|
|
119
|
+
|
|
120
|
+
### Content
|
|
121
|
+
- **Default slot:** Primary way to add content
|
|
122
|
+
- **Text prop:** Alternative to slot for simple text
|
|
123
|
+
- **Slot takes precedence:** If slot has content, text prop ignored
|
|
124
|
+
|
|
125
|
+
### Structure
|
|
126
|
+
```
|
|
127
|
+
<component :is="router-link | a" :class="className" :style="colorStyle">
|
|
128
|
+
<slot>{{ text }}</slot>
|
|
129
|
+
</component>
|
|
130
|
+
```
|
|
131
|
+
|
|
87
132
|
## Related Components
|
|
88
133
|
|
|
89
134
|
- `AwButton` - Button component that extends AwLink
|
|
@@ -92,8 +137,15 @@ export default {
|
|
|
92
137
|
## Notes
|
|
93
138
|
|
|
94
139
|
- **Import Method:** Global - Available as atom component
|
|
140
|
+
- Extends `linkMixin` for consistent link behavior
|
|
95
141
|
- Automatically uses `router-link` for internal links and `<a>` for external links
|
|
96
142
|
- External links are detected by protocol (http://, https://)
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
143
|
+
- Only `href` prop is used - it accepts both strings and router objects
|
|
144
|
+
- Internally converts `href` to `to` when rendering router-link component
|
|
145
|
+
- `back` prop enables special back button behavior with router
|
|
146
|
+
- Color prop sets CSS custom property `--btn-color` for link color
|
|
147
|
+
- Reset prop removes default link styling completely
|
|
148
|
+
- All standard link events supported via `$listeners`
|
|
149
|
+
- Component type (router-link vs a vs button) determined automatically at runtime
|
|
150
|
+
- Config allows customizing router component name
|
|
151
|
+
- Renders as `<button>` when no href provided or when disabled
|