@pecb-ui/components 1.1.2
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/README.md +556 -0
- package/esm2022/lib/components/button/button.component.mjs +171 -0
- package/esm2022/lib/components/card/card.component.mjs +182 -0
- package/esm2022/lib/components/checkbox/checkbox.component.mjs +126 -0
- package/esm2022/lib/components/datepicker/datepicker.component.mjs +349 -0
- package/esm2022/lib/components/dropdown/dropdown.component.mjs +329 -0
- package/esm2022/lib/components/input/input.component.mjs +321 -0
- package/esm2022/lib/components/pagination/pagination.component.mjs +197 -0
- package/esm2022/lib/components/radio/radio.component.mjs +147 -0
- package/esm2022/lib/components/right-modal/right-modal.component.mjs +234 -0
- package/esm2022/lib/components/sidebar/sidebar.component.mjs +155 -0
- package/esm2022/lib/components/status/status.component.mjs +50 -0
- package/esm2022/lib/components/tab/tab.component.mjs +151 -0
- package/esm2022/lib/components/table/table.component.mjs +503 -0
- package/esm2022/lib/components/toggle/toggle.component.mjs +126 -0
- package/esm2022/lib/pecb-components.module.mjs +118 -0
- package/esm2022/lib/services/loading.service.mjs +182 -0
- package/esm2022/lib/services/notification.service.mjs +144 -0
- package/esm2022/lib/services/theme.service.mjs +232 -0
- package/esm2022/lib/shared/interfaces/component.interfaces.mjs +2 -0
- package/esm2022/lib/shared/types/common.types.mjs +6 -0
- package/esm2022/lib/shared/utils/accessibility.utils.mjs +223 -0
- package/esm2022/lib/shared/utils/dom.utils.mjs +240 -0
- package/esm2022/lib/shared/utils/error.utils.mjs +277 -0
- package/esm2022/lib/shared/utils/string.utils.mjs +204 -0
- package/esm2022/pecb-ui-components.mjs +5 -0
- package/esm2022/public-api.mjs +53 -0
- package/fesm2022/pecb-ui-components.mjs +4587 -0
- package/fesm2022/pecb-ui-components.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/button/button.component.d.ts +130 -0
- package/lib/components/card/card.component.d.ts +140 -0
- package/lib/components/checkbox/checkbox.component.d.ts +74 -0
- package/lib/components/datepicker/datepicker.component.d.ts +155 -0
- package/lib/components/dropdown/dropdown.component.d.ts +144 -0
- package/lib/components/input/input.component.d.ts +215 -0
- package/lib/components/pagination/pagination.component.d.ts +53 -0
- package/lib/components/radio/radio.component.d.ts +93 -0
- package/lib/components/right-modal/right-modal.component.d.ts +137 -0
- package/lib/components/sidebar/sidebar.component.d.ts +97 -0
- package/lib/components/status/status.component.d.ts +19 -0
- package/lib/components/tab/tab.component.d.ts +102 -0
- package/lib/components/table/table.component.d.ts +403 -0
- package/lib/components/toggle/toggle.component.d.ts +74 -0
- package/lib/pecb-components.module.d.ts +37 -0
- package/lib/services/loading.service.d.ts +129 -0
- package/lib/services/notification.service.d.ts +136 -0
- package/lib/services/theme.service.d.ts +142 -0
- package/lib/shared/interfaces/component.interfaces.d.ts +283 -0
- package/lib/shared/types/common.types.d.ts +86 -0
- package/lib/shared/utils/accessibility.utils.d.ts +167 -0
- package/lib/shared/utils/dom.utils.d.ts +108 -0
- package/lib/shared/utils/error.utils.d.ts +191 -0
- package/lib/shared/utils/string.utils.d.ts +144 -0
- package/package.json +61 -0
- package/public-api.d.ts +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
# @pecb-ui/components
|
|
2
|
+
|
|
3
|
+
A professional Angular 17 UI components library built with TypeScript and SCSS. Features Storybook for component development and documentation, full accessibility compliance (WCAG 2.1 AA), and tree-shakeable, AOT-compatible builds.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@pecb-ui/components)
|
|
6
|
+
[](https://angular.io/)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- 🎯 **Angular 17.3+** - Built with the latest Angular features
|
|
12
|
+
- 📦 **APF Compliant** - Angular Package Format for maximum compatibility
|
|
13
|
+
- 🌳 **Tree-shakeable** - Only import what you use
|
|
14
|
+
- âš¡ **AOT Compatible** - Optimized for Ahead-of-Time compilation
|
|
15
|
+
- ♿ **WCAG 2.1 AA** - Full accessibility compliance
|
|
16
|
+
- 🎨 **SCSS Design System** - Professional variables, mixins, and utilities
|
|
17
|
+
- 📚 **Storybook** - Interactive component documentation
|
|
18
|
+
- 🔒 **Strict TypeScript** - Full type safety
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
### From npm (recommended)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install @pecb-ui/components
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### From local package
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install /path/to/dist/ui-components/pecb-ui-components-1.0.0.tgz
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Peer Dependencies
|
|
35
|
+
|
|
36
|
+
This library requires the following peer dependencies:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"@angular/common": "^17.3.0",
|
|
41
|
+
"@angular/core": "^17.3.0",
|
|
42
|
+
"@angular/animations": "^17.3.0"
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Quick Start
|
|
47
|
+
|
|
48
|
+
### 1. Import the Module
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
// app.module.ts
|
|
52
|
+
import { NgModule } from '@angular/core';
|
|
53
|
+
import { BrowserModule } from '@angular/platform-browser';
|
|
54
|
+
import { PecbComponentsModule } from '@pecb-ui/components';
|
|
55
|
+
|
|
56
|
+
import { AppComponent } from './app.component';
|
|
57
|
+
|
|
58
|
+
@NgModule({
|
|
59
|
+
declarations: [AppComponent],
|
|
60
|
+
imports: [
|
|
61
|
+
BrowserModule,
|
|
62
|
+
PecbComponentsModule // Import the PECB UI components module
|
|
63
|
+
],
|
|
64
|
+
bootstrap: [AppComponent]
|
|
65
|
+
})
|
|
66
|
+
export class AppModule { }
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### 2. Import Global Styles (Optional)
|
|
70
|
+
|
|
71
|
+
If you want to use the PECB design system variables in your application:
|
|
72
|
+
|
|
73
|
+
```scss
|
|
74
|
+
// styles.scss
|
|
75
|
+
@import '@pecb-ui/components/styles/main';
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Or import specific abstracts:
|
|
79
|
+
|
|
80
|
+
```scss
|
|
81
|
+
// In your component SCSS
|
|
82
|
+
@import '@pecb-ui/components/styles/abstracts/variables';
|
|
83
|
+
@import '@pecb-ui/components/styles/abstracts/mixins';
|
|
84
|
+
|
|
85
|
+
.my-component {
|
|
86
|
+
color: $primary-color;
|
|
87
|
+
padding: $spacing-md;
|
|
88
|
+
@include elevation(2);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 3. Use Components
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<!-- app.component.html -->
|
|
96
|
+
<pecb-button variant="primary" size="medium" (clicked)="handleClick()">
|
|
97
|
+
Click Me
|
|
98
|
+
</pecb-button>
|
|
99
|
+
|
|
100
|
+
<pecb-card elevation="md">
|
|
101
|
+
<pecb-card-header>
|
|
102
|
+
<h3>Welcome</h3>
|
|
103
|
+
</pecb-card-header>
|
|
104
|
+
<pecb-card-body>
|
|
105
|
+
<p>Your content goes here</p>
|
|
106
|
+
</pecb-card-body>
|
|
107
|
+
</pecb-card>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Components
|
|
111
|
+
|
|
112
|
+
### Button Component
|
|
113
|
+
|
|
114
|
+
A versatile button component with multiple variants, sizes, and accessibility features.
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<!-- Basic button -->
|
|
118
|
+
<pecb-button variant="primary" (clicked)="onClick()">
|
|
119
|
+
Submit
|
|
120
|
+
</pecb-button>
|
|
121
|
+
|
|
122
|
+
<!-- With loading state -->
|
|
123
|
+
<pecb-button variant="primary" [loading]="isLoading">
|
|
124
|
+
Save
|
|
125
|
+
</pecb-button>
|
|
126
|
+
|
|
127
|
+
<!-- Disabled button -->
|
|
128
|
+
<pecb-button variant="danger" [disabled]="true">
|
|
129
|
+
Delete
|
|
130
|
+
</pecb-button>
|
|
131
|
+
|
|
132
|
+
<!-- Full width button -->
|
|
133
|
+
<pecb-button variant="success" [fullWidth]="true">
|
|
134
|
+
Continue
|
|
135
|
+
</pecb-button>
|
|
136
|
+
|
|
137
|
+
<!-- Icon button with accessibility label -->
|
|
138
|
+
<pecb-button variant="secondary" ariaLabel="Close dialog" iconLeft="✕">
|
|
139
|
+
</pecb-button>
|
|
140
|
+
|
|
141
|
+
<!-- Toggle button -->
|
|
142
|
+
<pecb-button variant="secondary" [ariaPressed]="isActive" (clicked)="toggle()">
|
|
143
|
+
Toggle
|
|
144
|
+
</pecb-button>
|
|
145
|
+
|
|
146
|
+
<!-- Button that controls a dropdown -->
|
|
147
|
+
<pecb-button
|
|
148
|
+
variant="primary"
|
|
149
|
+
[ariaExpanded]="isOpen"
|
|
150
|
+
ariaHasPopup="menu"
|
|
151
|
+
ariaControls="dropdown-menu"
|
|
152
|
+
(clicked)="toggleDropdown()">
|
|
153
|
+
Menu
|
|
154
|
+
</pecb-button>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Properties:**
|
|
158
|
+
|
|
159
|
+
| Property | Type | Default | Description |
|
|
160
|
+
|----------|------|---------|-------------|
|
|
161
|
+
| `variant` | `'primary' \| 'secondary' \| 'success' \| 'danger' \| 'warning' \| 'info' \| 'text'` | `'primary'` | Visual style variant |
|
|
162
|
+
| `size` | `'small' \| 'medium' \| 'large'` | `'medium'` | Button size |
|
|
163
|
+
| `disabled` | `boolean` | `false` | Disable the button |
|
|
164
|
+
| `loading` | `boolean` | `false` | Show loading spinner |
|
|
165
|
+
| `fullWidth` | `boolean` | `false` | Make button full width |
|
|
166
|
+
| `type` | `'button' \| 'submit' \| 'reset'` | `'button'` | HTML button type |
|
|
167
|
+
| `iconLeft` | `string` | - | Icon before text |
|
|
168
|
+
| `iconRight` | `string` | - | Icon after text |
|
|
169
|
+
| `ariaLabel` | `string` | - | Accessible label |
|
|
170
|
+
| `ariaExpanded` | `boolean` | - | ARIA expanded state |
|
|
171
|
+
| `ariaPressed` | `boolean` | - | ARIA pressed state (toggle buttons) |
|
|
172
|
+
| `ariaHasPopup` | `boolean \| 'menu' \| 'listbox' \| 'tree' \| 'grid' \| 'dialog'` | - | Popup type |
|
|
173
|
+
| `ariaControls` | `string` | - | ID of controlled element |
|
|
174
|
+
|
|
175
|
+
**Events:**
|
|
176
|
+
|
|
177
|
+
| Event | Type | Description |
|
|
178
|
+
|-------|------|-------------|
|
|
179
|
+
| `clicked` | `EventEmitter<MouseEvent>` | Emitted on button click |
|
|
180
|
+
|
|
181
|
+
### Card Component
|
|
182
|
+
|
|
183
|
+
A container component for displaying content with optional header, body, and footer sections.
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<!-- Basic card -->
|
|
187
|
+
<pecb-card elevation="md">
|
|
188
|
+
<pecb-card-header>
|
|
189
|
+
<h3>Card Title</h3>
|
|
190
|
+
</pecb-card-header>
|
|
191
|
+
<pecb-card-body>
|
|
192
|
+
<p>Card content goes here</p>
|
|
193
|
+
</pecb-card-body>
|
|
194
|
+
<pecb-card-footer>
|
|
195
|
+
<pecb-button variant="primary">Action</pecb-button>
|
|
196
|
+
</pecb-card-footer>
|
|
197
|
+
</pecb-card>
|
|
198
|
+
|
|
199
|
+
<!-- Hoverable card -->
|
|
200
|
+
<pecb-card elevation="sm" [hoverable]="true">
|
|
201
|
+
<pecb-card-body>
|
|
202
|
+
<p>Hover over me!</p>
|
|
203
|
+
</pecb-card-body>
|
|
204
|
+
</pecb-card>
|
|
205
|
+
|
|
206
|
+
<!-- Card as article (accessible) -->
|
|
207
|
+
<pecb-card role="article" ariaLabelledBy="article-title">
|
|
208
|
+
<pecb-card-header>
|
|
209
|
+
<h2 id="article-title">Article Headline</h2>
|
|
210
|
+
</pecb-card-header>
|
|
211
|
+
<pecb-card-body>
|
|
212
|
+
<p>Article content...</p>
|
|
213
|
+
</pecb-card-body>
|
|
214
|
+
</pecb-card>
|
|
215
|
+
|
|
216
|
+
<!-- Card as region -->
|
|
217
|
+
<pecb-card role="region" ariaLabel="Product Information">
|
|
218
|
+
<pecb-card-body>
|
|
219
|
+
<p>Product details...</p>
|
|
220
|
+
</pecb-card-body>
|
|
221
|
+
</pecb-card>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Properties:**
|
|
225
|
+
|
|
226
|
+
| Property | Type | Default | Description |
|
|
227
|
+
|----------|------|---------|-------------|
|
|
228
|
+
| `elevation` | `'none' \| 'sm' \| 'md' \| 'lg' \| 'xl'` | `'md'` | Shadow depth |
|
|
229
|
+
| `hoverable` | `boolean` | `false` | Enable hover effect |
|
|
230
|
+
| `noPadding` | `boolean` | `false` | Remove default padding |
|
|
231
|
+
| `role` | `'article' \| 'region' \| 'group' \| 'listitem' \| 'none'` | `'none'` | Semantic role |
|
|
232
|
+
| `ariaLabel` | `string` | - | Accessible label |
|
|
233
|
+
| `ariaLabelledBy` | `string` | - | ID of labelling element |
|
|
234
|
+
| `ariaDescribedBy` | `string` | - | ID of describing element |
|
|
235
|
+
|
|
236
|
+
## Services
|
|
237
|
+
|
|
238
|
+
### NotificationService
|
|
239
|
+
|
|
240
|
+
A stateless, injectable service for displaying toast notifications.
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
import { NotificationService } from '@pecb-ui/components';
|
|
244
|
+
|
|
245
|
+
@Component({...})
|
|
246
|
+
export class MyComponent {
|
|
247
|
+
constructor(private notificationService: NotificationService) {}
|
|
248
|
+
|
|
249
|
+
showSuccess(): void {
|
|
250
|
+
this.notificationService.success('Operation completed successfully!');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
showError(): void {
|
|
254
|
+
this.notificationService.error('An error occurred', 'Error');
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
showWarning(): void {
|
|
258
|
+
this.notificationService.warning('Please review your input', 'Warning');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
showInfo(): void {
|
|
262
|
+
this.notificationService.info('New updates available');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
showCustom(): void {
|
|
266
|
+
this.notificationService.show({
|
|
267
|
+
message: 'Custom notification',
|
|
268
|
+
type: 'info',
|
|
269
|
+
duration: 10000,
|
|
270
|
+
position: 'bottom-right',
|
|
271
|
+
dismissible: true
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### ThemeService
|
|
278
|
+
|
|
279
|
+
A stateless, injectable service for managing application themes.
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
import { ThemeService } from '@pecb-ui/components';
|
|
283
|
+
|
|
284
|
+
@Component({...})
|
|
285
|
+
export class MyComponent {
|
|
286
|
+
isDarkMode$ = this.themeService.theme$.pipe(
|
|
287
|
+
map(config => config.resolvedTheme === 'dark')
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
constructor(private themeService: ThemeService) {}
|
|
291
|
+
|
|
292
|
+
toggleTheme(): void {
|
|
293
|
+
this.themeService.toggleTheme();
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
setDarkMode(): void {
|
|
297
|
+
this.themeService.setTheme('dark');
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
useSystemPreference(): void {
|
|
301
|
+
this.themeService.useSystemTheme();
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
setCustomColors(): void {
|
|
305
|
+
this.themeService.setCustomVariables({
|
|
306
|
+
primaryColor: '#007bff',
|
|
307
|
+
backgroundColor: '#f8f9fa'
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### LoadingService
|
|
314
|
+
|
|
315
|
+
A stateless, injectable service for managing loading states.
|
|
316
|
+
|
|
317
|
+
```typescript
|
|
318
|
+
import { LoadingService } from '@pecb-ui/components';
|
|
319
|
+
|
|
320
|
+
@Component({...})
|
|
321
|
+
export class MyComponent {
|
|
322
|
+
isLoading$ = this.loadingService.isLoading$('data-fetch');
|
|
323
|
+
|
|
324
|
+
constructor(private loadingService: LoadingService) {}
|
|
325
|
+
|
|
326
|
+
async loadData(): Promise<void> {
|
|
327
|
+
this.loadingService.start('data-fetch', 'Loading data...');
|
|
328
|
+
try {
|
|
329
|
+
const data = await this.fetchData();
|
|
330
|
+
// Process data
|
|
331
|
+
} finally {
|
|
332
|
+
this.loadingService.stop('data-fetch');
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
// Or use the helper method
|
|
337
|
+
async loadDataAlt(): Promise<void> {
|
|
338
|
+
const data = await this.loadingService.withLoading(
|
|
339
|
+
'data-fetch',
|
|
340
|
+
() => this.fetchData(),
|
|
341
|
+
'Loading data...'
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
## Utilities
|
|
348
|
+
|
|
349
|
+
The library exports utility functions for common operations:
|
|
350
|
+
|
|
351
|
+
```typescript
|
|
352
|
+
import {
|
|
353
|
+
// String utilities
|
|
354
|
+
toKebabCase,
|
|
355
|
+
toCamelCase,
|
|
356
|
+
truncate,
|
|
357
|
+
slugify,
|
|
358
|
+
|
|
359
|
+
// DOM utilities
|
|
360
|
+
generateUniqueId,
|
|
361
|
+
getFocusableElements,
|
|
362
|
+
trapFocus,
|
|
363
|
+
copyToClipboard,
|
|
364
|
+
|
|
365
|
+
// Accessibility utilities
|
|
366
|
+
announceToScreenReader,
|
|
367
|
+
getButtonAriaAttributes,
|
|
368
|
+
prefersReducedMotion,
|
|
369
|
+
|
|
370
|
+
// Error handling
|
|
371
|
+
createError,
|
|
372
|
+
wrapError,
|
|
373
|
+
tryAsync
|
|
374
|
+
} from '@pecb-ui/components';
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
## Types & Interfaces
|
|
378
|
+
|
|
379
|
+
```typescript
|
|
380
|
+
import {
|
|
381
|
+
// Common types
|
|
382
|
+
Size,
|
|
383
|
+
ComponentSize,
|
|
384
|
+
ColorVariant,
|
|
385
|
+
Position,
|
|
386
|
+
|
|
387
|
+
// Component interfaces
|
|
388
|
+
Disableable,
|
|
389
|
+
Loadable,
|
|
390
|
+
Focusable,
|
|
391
|
+
SelectableItem,
|
|
392
|
+
MenuItem,
|
|
393
|
+
|
|
394
|
+
// Service interfaces
|
|
395
|
+
NotificationConfig,
|
|
396
|
+
ThemeConfig,
|
|
397
|
+
LoadingState
|
|
398
|
+
} from '@pecb-ui/components';
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## SCSS Design System
|
|
402
|
+
|
|
403
|
+
### Variables
|
|
404
|
+
|
|
405
|
+
```scss
|
|
406
|
+
// Colors
|
|
407
|
+
$primary-color: #1976d2;
|
|
408
|
+
$accent-color: #ff4081;
|
|
409
|
+
$success-color: #4caf50;
|
|
410
|
+
$warn-color: #f44336;
|
|
411
|
+
$info-color: #2196f3;
|
|
412
|
+
|
|
413
|
+
// Spacing (8px base unit)
|
|
414
|
+
$spacing-xs: 4px;
|
|
415
|
+
$spacing-sm: 8px;
|
|
416
|
+
$spacing-md: 16px;
|
|
417
|
+
$spacing-lg: 24px;
|
|
418
|
+
$spacing-xl: 32px;
|
|
419
|
+
|
|
420
|
+
// Typography
|
|
421
|
+
$font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
422
|
+
$font-size-sm: 0.875rem;
|
|
423
|
+
$font-size-md: 1rem;
|
|
424
|
+
$font-size-lg: 1.125rem;
|
|
425
|
+
|
|
426
|
+
// Border radius
|
|
427
|
+
$border-radius-sm: 4px;
|
|
428
|
+
$border-radius-md: 8px;
|
|
429
|
+
$border-radius-lg: 12px;
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Mixins
|
|
433
|
+
|
|
434
|
+
```scss
|
|
435
|
+
// Responsive breakpoints
|
|
436
|
+
@include respond-to('md') {
|
|
437
|
+
// Styles for medium screens and up
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// Flexbox utilities
|
|
441
|
+
@include flex-center;
|
|
442
|
+
@include flex-between;
|
|
443
|
+
|
|
444
|
+
// Elevation (shadows)
|
|
445
|
+
@include elevation(2);
|
|
446
|
+
|
|
447
|
+
// Focus visible
|
|
448
|
+
@include focus-visible {
|
|
449
|
+
outline: 2px solid $primary-color;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Transitions
|
|
453
|
+
@include transition(background-color, color);
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
## Development
|
|
457
|
+
|
|
458
|
+
### Prerequisites
|
|
459
|
+
|
|
460
|
+
- Node.js 18+
|
|
461
|
+
- npm 9+
|
|
462
|
+
- Angular CLI 17.3+
|
|
463
|
+
|
|
464
|
+
### Setup
|
|
465
|
+
|
|
466
|
+
```bash
|
|
467
|
+
# Clone the repository
|
|
468
|
+
git clone https://github.com/pecb-ui/components.git
|
|
469
|
+
cd components
|
|
470
|
+
|
|
471
|
+
# Install dependencies
|
|
472
|
+
npm install
|
|
473
|
+
|
|
474
|
+
# Build the library
|
|
475
|
+
npm run build
|
|
476
|
+
|
|
477
|
+
# Run Storybook
|
|
478
|
+
npm run storybook
|
|
479
|
+
|
|
480
|
+
# Run tests
|
|
481
|
+
npm test
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### Building
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
# Development build
|
|
488
|
+
npm run build
|
|
489
|
+
|
|
490
|
+
# Production build
|
|
491
|
+
npm run build:prod
|
|
492
|
+
|
|
493
|
+
# Create npm package
|
|
494
|
+
npm run publish:lib
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
### Testing
|
|
498
|
+
|
|
499
|
+
```bash
|
|
500
|
+
# Run tests in watch mode
|
|
501
|
+
npm test
|
|
502
|
+
|
|
503
|
+
# Run tests once with coverage
|
|
504
|
+
npm run test:ci
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### Storybook
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
# Start Storybook dev server
|
|
511
|
+
npm run storybook
|
|
512
|
+
|
|
513
|
+
# Build Storybook for deployment
|
|
514
|
+
npm run build-storybook
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
## Browser Support
|
|
518
|
+
|
|
519
|
+
- Chrome (latest)
|
|
520
|
+
- Firefox (latest)
|
|
521
|
+
- Safari (latest)
|
|
522
|
+
- Edge (latest)
|
|
523
|
+
|
|
524
|
+
## Roadmap
|
|
525
|
+
|
|
526
|
+
Planned components:
|
|
527
|
+
|
|
528
|
+
- Input/Form controls
|
|
529
|
+
- Modal/Dialog
|
|
530
|
+
- Dropdown/Select
|
|
531
|
+
- Tabs
|
|
532
|
+
- Accordion
|
|
533
|
+
- Table
|
|
534
|
+
- Pagination
|
|
535
|
+
- Badge
|
|
536
|
+
- Avatar
|
|
537
|
+
- Tooltip
|
|
538
|
+
- Alert/Toast
|
|
539
|
+
- Progress indicators
|
|
540
|
+
- Date picker
|
|
541
|
+
|
|
542
|
+
## Contributing
|
|
543
|
+
|
|
544
|
+
1. Fork the repository
|
|
545
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
546
|
+
3. Commit your changes using [Conventional Commits](https://www.conventionalcommits.org/)
|
|
547
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
548
|
+
5. Open a Pull Request
|
|
549
|
+
|
|
550
|
+
## License
|
|
551
|
+
|
|
552
|
+
MIT License - see the [LICENSE](LICENSE) file for details.
|
|
553
|
+
|
|
554
|
+
## Support
|
|
555
|
+
|
|
556
|
+
For issues and questions, please use the [GitHub issue tracker](https://github.com/pecb-ui/components/issues).
|