ps-helix 0.1.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/README.md +286 -0
- package/fesm2022/ps-helix.mjs +3304 -0
- package/fesm2022/ps-helix.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/alert/alert.component.d.ts +26 -0
- package/lib/components/alert/alert.types.d.ts +46 -0
- package/lib/components/avatar/avatar.component.d.ts +20 -0
- package/lib/components/avatar/avatar.types.d.ts +33 -0
- package/lib/components/badge/badge.component.d.ts +25 -0
- package/lib/components/badge/badge.types.d.ts +4 -0
- package/lib/components/button/button.component.d.ts +25 -0
- package/lib/components/button/button.types.d.ts +16 -0
- package/lib/components/card/card.component.d.ts +82 -0
- package/lib/components/card/card.types.d.ts +31 -0
- package/lib/components/charts/pie-chart/pie-chart.component.d.ts +29 -0
- package/lib/components/charts/pie-chart/pie-chart.types.d.ts +45 -0
- package/lib/components/checkbox/checkbox.component.d.ts +23 -0
- package/lib/components/checkbox/checkbox.types.d.ts +4 -0
- package/lib/components/collapse/collapse.component.d.ts +17 -0
- package/lib/components/collapse/collapse.types.d.ts +8 -0
- package/lib/components/dropdown/dropdown.component.d.ts +32 -0
- package/lib/components/dropdown/dropdown.types.d.ts +36 -0
- package/lib/components/horizontal-card/horizontal-card.component.d.ts +33 -0
- package/lib/components/info-card/info-card.component.d.ts +28 -0
- package/lib/components/info-card/info-card.types.d.ts +12 -0
- package/lib/components/input/input.component.d.ts +63 -0
- package/lib/components/input/input.types.d.ts +28 -0
- package/lib/components/menu/menu.component.d.ts +24 -0
- package/lib/components/menu/menu.types.d.ts +33 -0
- package/lib/components/modal/modal.component.d.ts +73 -0
- package/lib/components/modal/modal.types.d.ts +27 -0
- package/lib/components/pagination/pagination.component.d.ts +36 -0
- package/lib/components/pagination/pagination.types.d.ts +27 -0
- package/lib/components/progressbar/progressbar.component.d.ts +22 -0
- package/lib/components/progressbar/progressbar.types.d.ts +29 -0
- package/lib/components/radio/radio.component.d.ts +32 -0
- package/lib/components/radio/radio.types.d.ts +29 -0
- package/lib/components/select/select.component.d.ts +84 -0
- package/lib/components/select/select.types.d.ts +82 -0
- package/lib/components/sidebar/sidebar.component.d.ts +30 -0
- package/lib/components/sidebar/sidebar.types.d.ts +21 -0
- package/lib/components/spinloader/spinloader.component.d.ts +21 -0
- package/lib/components/spinloader/spinloader.types.d.ts +23 -0
- package/lib/components/stat-card/stat-card.component.d.ts +48 -0
- package/lib/components/stepper/stepper.component.d.ts +42 -0
- package/lib/components/stepper/stepper.types.d.ts +59 -0
- package/lib/components/switch/switch.component.d.ts +34 -0
- package/lib/components/switch/switch.types.d.ts +25 -0
- package/lib/components/tab-bar/tab-bar.component.d.ts +27 -0
- package/lib/components/tab-bar/tab-bar.types.d.ts +28 -0
- package/lib/components/table/table.component.d.ts +56 -0
- package/lib/components/table/table.types.d.ts +70 -0
- package/lib/components/tabs/tabs.component.d.ts +37 -0
- package/lib/components/tabs/tabs.types.d.ts +32 -0
- package/lib/components/tag/tag.component.d.ts +24 -0
- package/lib/components/tag/tag.types.d.ts +25 -0
- package/lib/components/toast/toast.component.d.ts +24 -0
- package/lib/components/toast/toast.service.d.ts +38 -0
- package/lib/components/toast/toast.types.d.ts +40 -0
- package/lib/components/tooltip/tooltip.component.d.ts +38 -0
- package/lib/components/tooltip/tooltip.types.d.ts +21 -0
- package/lib/services/scroll.service.d.ts +8 -0
- package/lib/services/theme/theme.service.d.ts +41 -0
- package/lib/services/theme/types/theme.types.d.ts +9 -0
- package/lib/services/translation/translation.service.d.ts +25 -0
- package/lib/services/translation/types/i18n.types.d.ts +8 -0
- package/package.json +47 -0
- package/public-api.d.ts +62 -0
- package/src/lib/styles/reset.css +164 -0
- package/src/lib/styles/themes/dark.css +174 -0
- package/src/lib/styles/themes/light.css +258 -0
- package/src/lib/styles/utils/animations.css +176 -0
- package/src/lib/styles/utils/colors.css +228 -0
- package/src/lib/styles/utils/focus.css +76 -0
- package/src/lib/styles/utils/layout.css +149 -0
- package/src/lib/styles/utils/responsive.css +227 -0
- package/src/lib/styles/utils/spacing.css +172 -0
- package/src/lib/styles/utils/typography.css +68 -0
- package/styles.css +10 -0
package/README.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# ps-helix
|
|
2
|
+
|
|
3
|
+
Helix Design System - A comprehensive Angular component library built with Angular 19+ and modern best practices.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install ps-helix
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Peer Dependencies
|
|
12
|
+
|
|
13
|
+
This library requires the following peer dependencies:
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"@angular/common": "^19.0.0",
|
|
18
|
+
"@angular/core": "^19.0.0",
|
|
19
|
+
"@angular/forms": "^19.0.0",
|
|
20
|
+
"@ngx-translate/core": "^15.0.0",
|
|
21
|
+
"rxjs": "^7.8.0"
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Getting Started
|
|
26
|
+
|
|
27
|
+
### 1. Import Global Styles
|
|
28
|
+
|
|
29
|
+
In your `styles.css` or `styles.scss` file, import the Helix Design System styles:
|
|
30
|
+
|
|
31
|
+
```css
|
|
32
|
+
@import 'ps-helix/styles.css';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This will include:
|
|
36
|
+
- CSS Reset
|
|
37
|
+
- Theme variables (light and dark modes)
|
|
38
|
+
- Typography utilities
|
|
39
|
+
- Spacing system
|
|
40
|
+
- Layout utilities
|
|
41
|
+
- Animation utilities
|
|
42
|
+
- Focus styles
|
|
43
|
+
- Responsive breakpoints
|
|
44
|
+
|
|
45
|
+
### 2. Import Components
|
|
46
|
+
|
|
47
|
+
All components are standalone and can be imported directly:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { Component } from '@angular/core';
|
|
51
|
+
import { PshButtonComponent } from 'ps-helix';
|
|
52
|
+
|
|
53
|
+
@Component({
|
|
54
|
+
selector: 'app-root',
|
|
55
|
+
standalone: true,
|
|
56
|
+
imports: [PshButtonComponent],
|
|
57
|
+
template: `
|
|
58
|
+
<psh-button
|
|
59
|
+
[variant]="'primary'"
|
|
60
|
+
[size]="'medium'">
|
|
61
|
+
Click me
|
|
62
|
+
</psh-button>
|
|
63
|
+
`
|
|
64
|
+
})
|
|
65
|
+
export class AppComponent {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 3. Configure Services (Optional)
|
|
69
|
+
|
|
70
|
+
#### Theme Service
|
|
71
|
+
|
|
72
|
+
The ThemeService allows you to manage light/dark theme switching:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { Component, inject } from '@angular/core';
|
|
76
|
+
import { ThemeService } from 'ps-helix';
|
|
77
|
+
|
|
78
|
+
@Component({
|
|
79
|
+
selector: 'app-root',
|
|
80
|
+
standalone: true,
|
|
81
|
+
template: `
|
|
82
|
+
<button (click)="toggleTheme()">
|
|
83
|
+
Current theme: {{ themeService.themeName() }}
|
|
84
|
+
</button>
|
|
85
|
+
`
|
|
86
|
+
})
|
|
87
|
+
export class AppComponent {
|
|
88
|
+
themeService = inject(ThemeService);
|
|
89
|
+
|
|
90
|
+
toggleTheme() {
|
|
91
|
+
this.themeService.toggleTheme();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
#### Translation Service
|
|
97
|
+
|
|
98
|
+
Configure internationalization with the TranslationService:
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
import { ApplicationConfig } from '@angular/core';
|
|
102
|
+
import { TranslationService } from 'ps-helix';
|
|
103
|
+
|
|
104
|
+
export const appConfig: ApplicationConfig = {
|
|
105
|
+
providers: [
|
|
106
|
+
TranslationService
|
|
107
|
+
]
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Available Components
|
|
112
|
+
|
|
113
|
+
### Form Components
|
|
114
|
+
- `PshButtonComponent` - Versatile button with multiple variants and states
|
|
115
|
+
- `PshInputComponent` - Text input with validation support
|
|
116
|
+
- `PshCheckboxComponent` - Checkbox with customizable states
|
|
117
|
+
- `PshRadioComponent` - Radio button for single selection
|
|
118
|
+
- `PshSelectComponent` - Dropdown select with search
|
|
119
|
+
- `PshSwitchComponent` - Toggle switch component
|
|
120
|
+
|
|
121
|
+
### Layout Components
|
|
122
|
+
- `PshCardComponent` - Content container with variants
|
|
123
|
+
- `PshModalComponent` - Modal dialog overlay
|
|
124
|
+
- `PshSidebarComponent` - Collapsible sidebar navigation
|
|
125
|
+
- `PshCollapseComponent` - Expandable content section
|
|
126
|
+
- `PshTabsComponent` - Tabbed content organization
|
|
127
|
+
- `PshTabBarComponent` - Bottom tab bar navigation
|
|
128
|
+
|
|
129
|
+
### Feedback Components
|
|
130
|
+
- `PshAlertComponent` - Alert messages with severity levels
|
|
131
|
+
- `PshToastComponent` - Toast notifications
|
|
132
|
+
- `PshSpinloaderComponent` - Loading spinner
|
|
133
|
+
- `PshProgressbarComponent` - Progress indicator
|
|
134
|
+
- `PshTooltipComponent` - Contextual tooltips
|
|
135
|
+
|
|
136
|
+
### Data Display Components
|
|
137
|
+
- `PshTableComponent` - Data table with sorting and pagination
|
|
138
|
+
- `PshBadgeComponent` - Status badges and indicators
|
|
139
|
+
- `PshTagComponent` - Removable tags
|
|
140
|
+
- `PshAvatarComponent` - User avatar with fallback
|
|
141
|
+
- `PshPieChartComponent` - Pie chart visualization
|
|
142
|
+
|
|
143
|
+
### Navigation Components
|
|
144
|
+
- `PshMenuComponent` - Dropdown menu
|
|
145
|
+
- `PshPaginationComponent` - Pagination controls
|
|
146
|
+
- `PshStepperComponent` - Step-by-step wizard
|
|
147
|
+
- `PshDropdownComponent` - Dropdown trigger and content
|
|
148
|
+
|
|
149
|
+
## Component Usage Examples
|
|
150
|
+
|
|
151
|
+
### Button
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
import { PshButtonComponent } from 'ps-helix';
|
|
155
|
+
|
|
156
|
+
<psh-button
|
|
157
|
+
[variant]="'primary'"
|
|
158
|
+
[size]="'medium'"
|
|
159
|
+
[appearance]="'filled'"
|
|
160
|
+
[disabled]="false"
|
|
161
|
+
[loading]="false"
|
|
162
|
+
(clicked)="handleClick($event)">
|
|
163
|
+
Submit
|
|
164
|
+
</psh-button>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Input
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
import { PshInputComponent } from 'ps-helix';
|
|
171
|
+
import { FormControl } from '@angular/forms';
|
|
172
|
+
|
|
173
|
+
export class MyComponent {
|
|
174
|
+
emailControl = new FormControl('');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
<psh-input
|
|
178
|
+
[label]="'Email'"
|
|
179
|
+
[placeholder]="'Enter your email'"
|
|
180
|
+
[type]="'email'"
|
|
181
|
+
[formControl]="emailControl"
|
|
182
|
+
[required]="true">
|
|
183
|
+
</psh-input>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Modal
|
|
187
|
+
|
|
188
|
+
```typescript
|
|
189
|
+
import { PshModalComponent } from 'ps-helix';
|
|
190
|
+
import { signal } from '@angular/core';
|
|
191
|
+
|
|
192
|
+
export class MyComponent {
|
|
193
|
+
isOpen = signal(false);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
<psh-modal
|
|
197
|
+
[(open)]="isOpen"
|
|
198
|
+
[title]="'Confirm Action'"
|
|
199
|
+
[size]="'medium'">
|
|
200
|
+
<p>Are you sure you want to proceed?</p>
|
|
201
|
+
<div class="actions">
|
|
202
|
+
<psh-button (clicked)="isOpen.set(false)">Cancel</psh-button>
|
|
203
|
+
<psh-button [variant]="'primary'" (clicked)="confirm()">Confirm</psh-button>
|
|
204
|
+
</div>
|
|
205
|
+
</psh-modal>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Toast Notifications
|
|
209
|
+
|
|
210
|
+
```typescript
|
|
211
|
+
import { Component, inject } from '@angular/core';
|
|
212
|
+
import { ToastService } from 'ps-helix';
|
|
213
|
+
|
|
214
|
+
export class MyComponent {
|
|
215
|
+
private toastService = inject(ToastService);
|
|
216
|
+
|
|
217
|
+
showSuccess() {
|
|
218
|
+
this.toastService.success('Operation completed successfully!');
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
showError() {
|
|
222
|
+
this.toastService.error('An error occurred');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
showInfo() {
|
|
226
|
+
this.toastService.info('Information message', { duration: 5000 });
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Theming
|
|
232
|
+
|
|
233
|
+
The design system includes built-in support for light and dark themes. Theme switching is handled automatically through the ThemeService.
|
|
234
|
+
|
|
235
|
+
### Custom Theme Colors
|
|
236
|
+
|
|
237
|
+
You can customize theme colors by providing an InsurerContextService:
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import { InjectionToken } from '@angular/core';
|
|
241
|
+
import { INSURER_CONTEXT_SERVICE } from 'ps-helix';
|
|
242
|
+
|
|
243
|
+
const myContextService = {
|
|
244
|
+
primaryColor: () => '#0F02C4',
|
|
245
|
+
secondaryColor: () => '#7B3AEC'
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
export const appConfig: ApplicationConfig = {
|
|
249
|
+
providers: [
|
|
250
|
+
{
|
|
251
|
+
provide: INSURER_CONTEXT_SERVICE,
|
|
252
|
+
useValue: myContextService
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
};
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## TypeScript Support
|
|
259
|
+
|
|
260
|
+
All components are fully typed with TypeScript. Import types as needed:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
import {
|
|
264
|
+
ButtonVariant,
|
|
265
|
+
ButtonSize,
|
|
266
|
+
ButtonAppearance
|
|
267
|
+
} from 'ps-helix';
|
|
268
|
+
|
|
269
|
+
const variant: ButtonVariant = 'primary';
|
|
270
|
+
const size: ButtonSize = 'medium';
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Browser Support
|
|
274
|
+
|
|
275
|
+
- Chrome (latest)
|
|
276
|
+
- Firefox (latest)
|
|
277
|
+
- Safari (latest)
|
|
278
|
+
- Edge (latest)
|
|
279
|
+
|
|
280
|
+
## License
|
|
281
|
+
|
|
282
|
+
MIT
|
|
283
|
+
|
|
284
|
+
## Contributing
|
|
285
|
+
|
|
286
|
+
Issues and pull requests are welcome on the repository.
|