@redseed/redseed-ui-vue3 6.0.4 → 6.0.5
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/00-component-overview.md +294 -0
- package/01-layout-components.md +103 -0
- package/02-button-components.md +136 -0
- package/03-form-components.md +488 -0
- package/04-card-components.md +188 -0
- package/05-text-components.md +207 -0
- package/06-data-display-components.md +349 -0
- package/07-interactive-components.md +315 -0
- package/08-media-components.md +256 -0
- package/09-social-components.md +192 -0
- package/10-helper-components.md +289 -0
- package/package.json +2 -2
- package/src/components/Layouts/TwoColumnLayout.vue +1 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# RedSeed UI Component Library - Vue 3
|
|
2
|
+
|
|
3
|
+
A comprehensive Vue 3 component library designed for building modern, accessible, and responsive user interfaces. This library provides a complete set of components organized by functionality and use case.
|
|
4
|
+
|
|
5
|
+
## Component Categories
|
|
6
|
+
|
|
7
|
+
### 1. [Layout Components](./01-layout-components.md)
|
|
8
|
+
Structural components for organizing page content, including layouts, headers, sections, and page structure.
|
|
9
|
+
|
|
10
|
+
**Key Components:** SingleColumnLayout, TwoColumnLayout, PageHeader, SectionHeader, HeroSection
|
|
11
|
+
|
|
12
|
+
### 2. [Button Components](./02-button-components.md)
|
|
13
|
+
Interactive elements for user actions, with various styles and grouping options.
|
|
14
|
+
|
|
15
|
+
**Key Components:** ButtonPrimary, ButtonSecondary, ButtonTertiary, ButtonGroup, ButtonCard
|
|
16
|
+
|
|
17
|
+
### 3. [Form Components](./03-form-components.md)
|
|
18
|
+
Complete form system including wrappers, fields, and validation support.
|
|
19
|
+
|
|
20
|
+
**Key Components:** FormWrapperBuild, FormWrapperLMS, FormFieldText, FormFieldEmail, FormFieldSelect
|
|
21
|
+
|
|
22
|
+
### 4. [Card Components](./04-card-components.md)
|
|
23
|
+
Content containers for displaying information in organized, visually appealing sections.
|
|
24
|
+
|
|
25
|
+
**Key Components:** Card, CardHeader, ButtonCard, RadioCard, MetricCard, CardGroup
|
|
26
|
+
|
|
27
|
+
### 5. [Text Components](./05-text-components.md)
|
|
28
|
+
Typography and text formatting components for consistent content presentation.
|
|
29
|
+
|
|
30
|
+
**Key Components:** BodyText, ReadMore, Badge components, MessageBox, MetaInfo
|
|
31
|
+
|
|
32
|
+
### 6. [Data Display Components](./06-data-display-components.md)
|
|
33
|
+
Components for presenting structured data, lists, tables, and pagination.
|
|
34
|
+
|
|
35
|
+
**Key Components:** Table, List, Pagination, Sorting, ActivityFeed
|
|
36
|
+
|
|
37
|
+
### 7. [Interactive Components](./07-interactive-components.md)
|
|
38
|
+
Dynamic UI elements that respond to user interactions.
|
|
39
|
+
|
|
40
|
+
**Key Components:** Modal, DropdownMenu, Toggle, Switcher, ProgressTracker, Loader
|
|
41
|
+
|
|
42
|
+
### 8. [Media Components](./08-media-components.md)
|
|
43
|
+
Components for displaying images, logos, and visual content.
|
|
44
|
+
|
|
45
|
+
**Key Components:** Image variants, Logo components, responsive image handling
|
|
46
|
+
|
|
47
|
+
### 9. [Social Components](./09-social-components.md)
|
|
48
|
+
Social media integration and authentication components.
|
|
49
|
+
|
|
50
|
+
**Key Components:** SignInWithGoogle, SignUpWithGoogle
|
|
51
|
+
|
|
52
|
+
### 10. [Helper Components](./10-helper-components.md)
|
|
53
|
+
Utility functions and supporting components for enhanced development experience.
|
|
54
|
+
|
|
55
|
+
**Key Components:** ResponsiveWidth, Lottie integration, Lodash utilities
|
|
56
|
+
|
|
57
|
+
## Getting Started
|
|
58
|
+
|
|
59
|
+
### Installation
|
|
60
|
+
```bash
|
|
61
|
+
npm install @redseed/ui-vue3
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Basic Usage
|
|
65
|
+
```vue
|
|
66
|
+
<template>
|
|
67
|
+
<SingleColumnLayout>
|
|
68
|
+
<PageHeader title="Welcome" subtitle="Get started with our platform">
|
|
69
|
+
<template #actions>
|
|
70
|
+
<ButtonPrimary>Get Started</ButtonPrimary>
|
|
71
|
+
</template>
|
|
72
|
+
</PageHeader>
|
|
73
|
+
|
|
74
|
+
<Card>
|
|
75
|
+
<CardHeader title="Quick Start">
|
|
76
|
+
<template #actions>
|
|
77
|
+
<ButtonSecondary>Learn More</ButtonSecondary>
|
|
78
|
+
</template>
|
|
79
|
+
</CardHeader>
|
|
80
|
+
<BodyText>
|
|
81
|
+
Welcome to our platform. This is a comprehensive guide to get you started.
|
|
82
|
+
</BodyText>
|
|
83
|
+
</Card>
|
|
84
|
+
</SingleColumnLayout>
|
|
85
|
+
</template>
|
|
86
|
+
|
|
87
|
+
<script setup>
|
|
88
|
+
import {
|
|
89
|
+
SingleColumnLayout,
|
|
90
|
+
PageHeader,
|
|
91
|
+
ButtonPrimary,
|
|
92
|
+
ButtonSecondary,
|
|
93
|
+
Card,
|
|
94
|
+
CardHeader,
|
|
95
|
+
BodyText
|
|
96
|
+
} from '@redseed/ui-vue3'
|
|
97
|
+
</script>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Design Principles
|
|
101
|
+
|
|
102
|
+
### 1. **Consistency**
|
|
103
|
+
All components follow consistent design patterns, spacing, and interaction behaviors.
|
|
104
|
+
|
|
105
|
+
### 2. **Accessibility**
|
|
106
|
+
Every component is built with accessibility in mind, including proper ARIA attributes, keyboard navigation, and screen reader support.
|
|
107
|
+
|
|
108
|
+
### 3. **Responsive Design**
|
|
109
|
+
Components are designed to work seamlessly across all device sizes and screen resolutions.
|
|
110
|
+
|
|
111
|
+
### 4. **Performance**
|
|
112
|
+
Optimized components with minimal bundle impact and efficient rendering.
|
|
113
|
+
|
|
114
|
+
### 5. **Flexibility**
|
|
115
|
+
Components are highly customizable while maintaining design consistency.
|
|
116
|
+
|
|
117
|
+
## Platform-Specific Components
|
|
118
|
+
|
|
119
|
+
The library includes components specifically designed for different RedSeed platforms:
|
|
120
|
+
|
|
121
|
+
- **Build Platform:** FormWrapperBuild, LogoRedSeedBuild
|
|
122
|
+
- **LMS Platform:** FormWrapperLMS, LogoRedSeedLMS
|
|
123
|
+
- **Coach Platform:** LogoRedSeedCoach
|
|
124
|
+
- **Courses Platform:** LogoRedSeedCourses
|
|
125
|
+
|
|
126
|
+
## Styling and Theming
|
|
127
|
+
|
|
128
|
+
### Tailwind CSS Integration
|
|
129
|
+
The library is built on Tailwind CSS and includes custom design tokens for consistent styling.
|
|
130
|
+
|
|
131
|
+
### Custom Properties
|
|
132
|
+
Components use CSS custom properties for easy theming and customization.
|
|
133
|
+
|
|
134
|
+
### Responsive Breakpoints
|
|
135
|
+
Consistent breakpoint system for responsive design across all components.
|
|
136
|
+
|
|
137
|
+
## Best Practices
|
|
138
|
+
|
|
139
|
+
### 1. **Component Selection**
|
|
140
|
+
- Choose components based on functionality, not appearance
|
|
141
|
+
- Use the most specific component for your use case
|
|
142
|
+
- Combine components to create complex interfaces
|
|
143
|
+
|
|
144
|
+
### 2. **Accessibility**
|
|
145
|
+
- Always provide meaningful labels and descriptions
|
|
146
|
+
- Test with keyboard navigation and screen readers
|
|
147
|
+
- Ensure sufficient color contrast
|
|
148
|
+
|
|
149
|
+
### 3. **Performance**
|
|
150
|
+
- Use lazy loading for images and heavy components
|
|
151
|
+
- Implement proper loading states
|
|
152
|
+
- Optimize bundle size by importing only needed components
|
|
153
|
+
|
|
154
|
+
### 4. **Responsive Design**
|
|
155
|
+
- Test components on various screen sizes
|
|
156
|
+
- Use responsive utilities appropriately
|
|
157
|
+
- Consider mobile-first design principles
|
|
158
|
+
|
|
159
|
+
### 5. **Error Handling**
|
|
160
|
+
- Provide clear error messages
|
|
161
|
+
- Implement proper validation
|
|
162
|
+
- Handle edge cases gracefully
|
|
163
|
+
|
|
164
|
+
## Common Patterns
|
|
165
|
+
|
|
166
|
+
### Form Patterns
|
|
167
|
+
```vue
|
|
168
|
+
<template>
|
|
169
|
+
<FormWrapperBuild @submit="handleSubmit">
|
|
170
|
+
<FormFieldset legend="Personal Information">
|
|
171
|
+
<FormFieldText v-model="name" label="Name" required />
|
|
172
|
+
<FormFieldEmail v-model="email" label="Email" required />
|
|
173
|
+
</FormFieldset>
|
|
174
|
+
|
|
175
|
+
<FormFieldset legend="Preferences">
|
|
176
|
+
<FormFieldCheckbox v-model="newsletter" label="Subscribe to newsletter" />
|
|
177
|
+
<Toggle v-model="notifications" label="Enable notifications" />
|
|
178
|
+
</FormFieldset>
|
|
179
|
+
|
|
180
|
+
<ButtonPrimary type="submit">Save Changes</ButtonPrimary>
|
|
181
|
+
</FormWrapperBuild>
|
|
182
|
+
</template>
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Data Display Patterns
|
|
186
|
+
```vue
|
|
187
|
+
<template>
|
|
188
|
+
<div class="data-section">
|
|
189
|
+
<SectionHeader title="Users" description="Manage user accounts">
|
|
190
|
+
<template #actions>
|
|
191
|
+
<ButtonPrimary>Add User</ButtonPrimary>
|
|
192
|
+
</template>
|
|
193
|
+
</SectionHeader>
|
|
194
|
+
|
|
195
|
+
<Table>
|
|
196
|
+
<thead>
|
|
197
|
+
<tr>
|
|
198
|
+
<Th sortable @sort="handleSort">Name</Th>
|
|
199
|
+
<Th>Email</Th>
|
|
200
|
+
<Th>Status</Th>
|
|
201
|
+
<Th>Actions</Th>
|
|
202
|
+
</tr>
|
|
203
|
+
</thead>
|
|
204
|
+
<tbody>
|
|
205
|
+
<Tr v-for="user in users" :key="user.id">
|
|
206
|
+
<TdUser :user="user" />
|
|
207
|
+
<Td>{{ user.email }}</Td>
|
|
208
|
+
<Td>
|
|
209
|
+
<BadgeSuccess v-if="user.active">Active</BadgeSuccess>
|
|
210
|
+
<BadgeNeutral v-else>Inactive</BadgeNeutral>
|
|
211
|
+
</Td>
|
|
212
|
+
<Td>
|
|
213
|
+
<ButtonSecondary size="sm">Edit</ButtonSecondary>
|
|
214
|
+
</Td>
|
|
215
|
+
</Tr>
|
|
216
|
+
</tbody>
|
|
217
|
+
</Table>
|
|
218
|
+
|
|
219
|
+
<SectionFooter>
|
|
220
|
+
<RecordCount :current="users.length" :total="totalUsers" />
|
|
221
|
+
<Pagination
|
|
222
|
+
:currentPage="currentPage"
|
|
223
|
+
:totalPages="totalPages"
|
|
224
|
+
@pageChange="handlePageChange"
|
|
225
|
+
/>
|
|
226
|
+
</SectionFooter>
|
|
227
|
+
</div>
|
|
228
|
+
</template>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Modal Patterns
|
|
232
|
+
```vue
|
|
233
|
+
<template>
|
|
234
|
+
<Modal
|
|
235
|
+
:isOpen="showModal"
|
|
236
|
+
@close="closeModal"
|
|
237
|
+
title="Confirm Action"
|
|
238
|
+
>
|
|
239
|
+
<BodyText>
|
|
240
|
+
Are you sure you want to perform this action? This cannot be undone.
|
|
241
|
+
</BodyText>
|
|
242
|
+
|
|
243
|
+
<template #actions>
|
|
244
|
+
<ButtonSecondary @click="closeModal">Cancel</ButtonSecondary>
|
|
245
|
+
<ButtonPrimary @click="confirmAction">Confirm</ButtonPrimary>
|
|
246
|
+
</template>
|
|
247
|
+
</Modal>
|
|
248
|
+
</template>
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
## Migration and Updates
|
|
252
|
+
|
|
253
|
+
### Version Compatibility
|
|
254
|
+
- Check the changelog for breaking changes
|
|
255
|
+
- Test components after updates
|
|
256
|
+
- Follow migration guides for major version changes
|
|
257
|
+
|
|
258
|
+
### Deprecation Notices
|
|
259
|
+
- Monitor deprecation warnings
|
|
260
|
+
- Plan migration for deprecated components
|
|
261
|
+
- Use recommended alternatives
|
|
262
|
+
|
|
263
|
+
## Support and Resources
|
|
264
|
+
|
|
265
|
+
### Documentation
|
|
266
|
+
- Each component category has detailed documentation
|
|
267
|
+
- Examples and use cases provided
|
|
268
|
+
- Best practices and accessibility guidelines
|
|
269
|
+
|
|
270
|
+
### Storybook
|
|
271
|
+
- Interactive component examples
|
|
272
|
+
- Props documentation
|
|
273
|
+
- Visual testing and development
|
|
274
|
+
|
|
275
|
+
### Community
|
|
276
|
+
- GitHub repository for issues and contributions
|
|
277
|
+
- Discussion forums for questions and feedback
|
|
278
|
+
- Regular updates and improvements
|
|
279
|
+
|
|
280
|
+
## Contributing
|
|
281
|
+
|
|
282
|
+
### Development Guidelines
|
|
283
|
+
- Follow established patterns and conventions
|
|
284
|
+
- Include proper documentation and examples
|
|
285
|
+
- Ensure accessibility compliance
|
|
286
|
+
- Add comprehensive tests
|
|
287
|
+
|
|
288
|
+
### Component Development
|
|
289
|
+
- Use TypeScript for type safety
|
|
290
|
+
- Follow Vue 3 Composition API patterns
|
|
291
|
+
- Include proper prop validation
|
|
292
|
+
- Implement responsive design principles
|
|
293
|
+
|
|
294
|
+
This component library is designed to accelerate development while maintaining high quality and consistency across RedSeed applications. Each component is carefully crafted to provide the best possible user experience while being easy to use and customize.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Layout Components
|
|
2
|
+
|
|
3
|
+
Layout components provide the structural foundation for organizing content on pages. They handle page-level organization, section management, and responsive layouts.
|
|
4
|
+
|
|
5
|
+
## Components
|
|
6
|
+
|
|
7
|
+
### SingleColumnLayout
|
|
8
|
+
**When to use:** For pages that need a simple, centered single-column layout with consistent spacing and maximum width constraints.
|
|
9
|
+
**Implementation:**
|
|
10
|
+
```vue
|
|
11
|
+
<template>
|
|
12
|
+
<SingleColumnLayout>
|
|
13
|
+
<h1>Page Title</h1>
|
|
14
|
+
<p>Page content goes here...</p>
|
|
15
|
+
</SingleColumnLayout>
|
|
16
|
+
</template>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### TwoColumnLayout
|
|
20
|
+
**When to use:** For pages that need a sidebar and main content area, such as dashboards, documentation pages, or admin interfaces.
|
|
21
|
+
**Implementation:**
|
|
22
|
+
```vue
|
|
23
|
+
<template>
|
|
24
|
+
<TwoColumnLayout>
|
|
25
|
+
<template #sidebar>
|
|
26
|
+
<nav>Sidebar navigation</nav>
|
|
27
|
+
</template>
|
|
28
|
+
<template #main>
|
|
29
|
+
<h1>Main Content</h1>
|
|
30
|
+
<p>Main content area...</p>
|
|
31
|
+
</template>
|
|
32
|
+
</TwoColumnLayout>
|
|
33
|
+
</template>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### PageHeader
|
|
37
|
+
**When to use:** At the top of pages to provide consistent page titles, breadcrumbs, and action buttons.
|
|
38
|
+
**Implementation:**
|
|
39
|
+
```vue
|
|
40
|
+
<template>
|
|
41
|
+
<PageHeader title="Page Title" subtitle="Optional subtitle">
|
|
42
|
+
<template #actions>
|
|
43
|
+
<ButtonPrimary>Action Button</ButtonPrimary>
|
|
44
|
+
</template>
|
|
45
|
+
</PageHeader>
|
|
46
|
+
</template>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### SectionHeader
|
|
50
|
+
**When to use:** To introduce sections of content with titles, descriptions, and optional actions.
|
|
51
|
+
**Implementation:**
|
|
52
|
+
```vue
|
|
53
|
+
<template>
|
|
54
|
+
<SectionHeader title="Section Title" description="Section description">
|
|
55
|
+
<template #actions>
|
|
56
|
+
<ButtonSecondary>Section Action</ButtonSecondary>
|
|
57
|
+
</template>
|
|
58
|
+
</SectionHeader>
|
|
59
|
+
</template>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### SectionFooter
|
|
63
|
+
**When to use:** At the bottom of content sections to provide pagination, action buttons, or summary information.
|
|
64
|
+
**Implementation:**
|
|
65
|
+
```vue
|
|
66
|
+
<template>
|
|
67
|
+
<SectionFooter>
|
|
68
|
+
<Pagination />
|
|
69
|
+
<ButtonPrimary>Save Changes</ButtonPrimary>
|
|
70
|
+
</SectionFooter>
|
|
71
|
+
</template>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### HeroSection
|
|
75
|
+
**When to use:** For landing pages, marketing pages, or any page that needs a prominent introduction section with large text and call-to-action buttons.
|
|
76
|
+
**Implementation:**
|
|
77
|
+
```vue
|
|
78
|
+
<template>
|
|
79
|
+
<HeroSection
|
|
80
|
+
title="Welcome to Our Platform"
|
|
81
|
+
subtitle="The best solution for your needs"
|
|
82
|
+
>
|
|
83
|
+
<template #actions>
|
|
84
|
+
<ButtonPrimary>Get Started</ButtonPrimary>
|
|
85
|
+
<ButtonSecondary>Learn More</ButtonSecondary>
|
|
86
|
+
</template>
|
|
87
|
+
</HeroSection>
|
|
88
|
+
</template>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Best Practices
|
|
92
|
+
|
|
93
|
+
1. **Consistent Structure:** Use layout components consistently across your application to maintain visual hierarchy and user experience.
|
|
94
|
+
2. **Responsive Design:** Layout components are designed to be responsive - test on different screen sizes.
|
|
95
|
+
3. **Content Hierarchy:** Use PageHeader for page-level titles and SectionHeader for content section titles.
|
|
96
|
+
4. **Action Placement:** Place primary actions in PageHeader or SectionHeader, secondary actions in SectionFooter.
|
|
97
|
+
5. **Nesting:** Layout components can be nested - use SectionHeader/SectionFooter within layout containers for complex pages.
|
|
98
|
+
|
|
99
|
+
## Accessibility
|
|
100
|
+
|
|
101
|
+
- Layout components include proper semantic HTML structure
|
|
102
|
+
- Screen readers can navigate through the layout hierarchy
|
|
103
|
+
- Focus management is handled appropriately for keyboard navigation
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Button Components
|
|
2
|
+
|
|
3
|
+
Button components provide interactive elements for user actions. They come in various styles and sizes to match different use cases and visual hierarchies.
|
|
4
|
+
|
|
5
|
+
## Button Variants
|
|
6
|
+
|
|
7
|
+
### ButtonPrimary
|
|
8
|
+
**When to use:** For the main call-to-action on a page or form, such as "Submit", "Save", "Continue", or "Get Started".
|
|
9
|
+
**Implementation:**
|
|
10
|
+
```vue
|
|
11
|
+
<template>
|
|
12
|
+
<ButtonPrimary @click="handleSubmit">Submit Form</ButtonPrimary>
|
|
13
|
+
</template>
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### ButtonPrimaryFull
|
|
17
|
+
**When to use:** Same as ButtonPrimary but spans the full width of its container. Use when the button should be the primary focus of a section.
|
|
18
|
+
**Implementation:**
|
|
19
|
+
```vue
|
|
20
|
+
<template>
|
|
21
|
+
<ButtonPrimaryFull @click="handleSubmit">Submit Form</ButtonPrimaryFull>
|
|
22
|
+
</template>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### ButtonSecondary
|
|
26
|
+
**When to use:** For secondary actions that support the primary action, such as "Cancel", "Back", or "Edit".
|
|
27
|
+
**Implementation:**
|
|
28
|
+
```vue
|
|
29
|
+
<template>
|
|
30
|
+
<ButtonSecondary @click="handleCancel">Cancel</ButtonSecondary>
|
|
31
|
+
</template>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### ButtonSecondaryFull
|
|
35
|
+
**When to use:** Same as ButtonSecondary but spans the full width of its container.
|
|
36
|
+
**Implementation:**
|
|
37
|
+
```vue
|
|
38
|
+
<template>
|
|
39
|
+
<ButtonSecondaryFull @click="handleCancel">Cancel</ButtonSecondaryFull>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### ButtonSecondaryBrand
|
|
44
|
+
**When to use:** For brand-specific secondary actions that need to stand out while still being secondary to the primary action.
|
|
45
|
+
**Implementation:**
|
|
46
|
+
```vue
|
|
47
|
+
<template>
|
|
48
|
+
<ButtonSecondaryBrand @click="handleBrandAction">Brand Action</ButtonSecondaryBrand>
|
|
49
|
+
</template>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### ButtonSecondaryBrandFull
|
|
53
|
+
**When to use:** Same as ButtonSecondaryBrand but spans the full width of its container.
|
|
54
|
+
**Implementation:**
|
|
55
|
+
```vue
|
|
56
|
+
<template>
|
|
57
|
+
<ButtonSecondaryBrandFull @click="handleBrandAction">Brand Action</ButtonSecondaryBrandFull>
|
|
58
|
+
</template>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### ButtonTertiary
|
|
62
|
+
**When to use:** For less prominent actions, such as "Learn More", "View Details", or utility actions.
|
|
63
|
+
**Implementation:**
|
|
64
|
+
```vue
|
|
65
|
+
<template>
|
|
66
|
+
<ButtonTertiary @click="handleLearnMore">Learn More</ButtonTertiary>
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### ButtonTertiaryFull
|
|
71
|
+
**When to use:** Same as ButtonTertiary but spans the full width of its container.
|
|
72
|
+
**Implementation:**
|
|
73
|
+
```vue
|
|
74
|
+
<template>
|
|
75
|
+
<ButtonTertiaryFull @click="handleLearnMore">Learn More</ButtonTertiaryFull>
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Button Groups
|
|
80
|
+
|
|
81
|
+
### ButtonGroup
|
|
82
|
+
**When to use:** When you have related actions that should be visually grouped together, such as "Save" and "Cancel" buttons.
|
|
83
|
+
**Implementation:**
|
|
84
|
+
```vue
|
|
85
|
+
<template>
|
|
86
|
+
<ButtonGroup>
|
|
87
|
+
<ButtonGroupItem>
|
|
88
|
+
<ButtonSecondary @click="handleCancel">Cancel</ButtonSecondary>
|
|
89
|
+
</ButtonGroupItem>
|
|
90
|
+
<ButtonGroupItem>
|
|
91
|
+
<ButtonPrimary @click="handleSave">Save</ButtonPrimary>
|
|
92
|
+
</ButtonGroupItem>
|
|
93
|
+
</ButtonGroup>
|
|
94
|
+
</template>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### ButtonGroupItem
|
|
98
|
+
**When to use:** As a wrapper for individual buttons within a ButtonGroup to ensure proper spacing and styling.
|
|
99
|
+
**Implementation:**
|
|
100
|
+
```vue
|
|
101
|
+
<template>
|
|
102
|
+
<ButtonGroupItem>
|
|
103
|
+
<ButtonPrimary>Action</ButtonPrimary>
|
|
104
|
+
</ButtonGroupItem>
|
|
105
|
+
</template>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Button Cards
|
|
109
|
+
|
|
110
|
+
### ButtonCard
|
|
111
|
+
**When to use:** When you need a clickable card that acts as a button, such as for feature selection or navigation cards.
|
|
112
|
+
**Implementation:**
|
|
113
|
+
```vue
|
|
114
|
+
<template>
|
|
115
|
+
<ButtonCard @click="handleCardClick">
|
|
116
|
+
<h3>Card Title</h3>
|
|
117
|
+
<p>Card description</p>
|
|
118
|
+
</ButtonCard>
|
|
119
|
+
</template>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Best Practices
|
|
123
|
+
|
|
124
|
+
1. **Visual Hierarchy:** Use ButtonPrimary for the most important action, ButtonSecondary for supporting actions, and ButtonTertiary for less important actions.
|
|
125
|
+
2. **Consistent Spacing:** Use ButtonGroup when you have multiple related buttons to ensure consistent spacing.
|
|
126
|
+
3. **Full Width:** Use full-width variants when the button should be the primary focus of a section or form.
|
|
127
|
+
4. **Accessibility:** All buttons include proper ARIA attributes and keyboard navigation support.
|
|
128
|
+
5. **Loading States:** Consider adding loading states to buttons that trigger async actions.
|
|
129
|
+
6. **Icon Usage:** You can add icons to buttons using slots or by placing them before/after the button text.
|
|
130
|
+
|
|
131
|
+
## Accessibility
|
|
132
|
+
|
|
133
|
+
- All buttons are keyboard accessible
|
|
134
|
+
- Proper ARIA labels and roles are included
|
|
135
|
+
- Focus states are clearly visible
|
|
136
|
+
- Screen reader support for button descriptions and states
|