ps-helix 6.2.4 → 7.0.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.
Files changed (31) hide show
  1. package/CONFIGURATION.md +492 -0
  2. package/README.md +131 -125
  3. package/THEME.md +37 -27
  4. package/TOKENS.md +662 -0
  5. package/fesm2022/ps-helix.mjs +7715 -5651
  6. package/fesm2022/ps-helix.mjs.map +1 -1
  7. package/package.json +18 -8
  8. package/src/lib/styles/base/a11y.css +36 -0
  9. package/src/lib/styles/base/behavior.css +15 -0
  10. package/src/lib/styles/base/global.css +9 -26
  11. package/src/lib/styles/compat.css +580 -0
  12. package/src/lib/styles/themes/dark-auto.css +315 -0
  13. package/src/lib/styles/themes/dark.css +259 -157
  14. package/src/lib/styles/themes/light.css +236 -221
  15. package/src/lib/styles/tokens/animations.tokens.css +30 -21
  16. package/src/lib/styles/tokens/breakpoints.tokens.css +22 -6
  17. package/src/lib/styles/tokens/effects.tokens.css +25 -25
  18. package/src/lib/styles/tokens/layout.tokens.css +32 -32
  19. package/src/lib/styles/tokens/sizing.tokens.css +87 -75
  20. package/src/lib/styles/tokens/spacing.tokens.css +18 -18
  21. package/src/lib/styles/tokens/typography.tokens.css +34 -34
  22. package/src/lib/styles/utilities/animations.utils.css +18 -18
  23. package/src/lib/styles/utilities/colors.utils.css +196 -196
  24. package/src/lib/styles/utilities/focus.utils.css +13 -13
  25. package/src/lib/styles/utilities/layout.utils.css +9 -9
  26. package/src/lib/styles/utilities/responsive.utils.css +49 -49
  27. package/src/lib/styles/utilities/spacing.utils.css +96 -96
  28. package/src/lib/styles/utilities/typography.utils.css +25 -25
  29. package/styles-full.css +25 -0
  30. package/styles.css +17 -8
  31. package/types/ps-helix.d.ts +3252 -1724
@@ -0,0 +1,492 @@
1
+ # Configuration
2
+
3
+ > **Generated from the config tokens — do not edit by hand.**
4
+ > Run `npm run docs:config` after changing a token's defaults.
5
+
6
+ Every component reads its defaults from an `InjectionToken`, so an application can set them
7
+ once instead of repeating an attribute on every instance.
8
+
9
+ ```typescript
10
+ import { bootstrapApplication } from '@angular/platform-browser';
11
+ import { provideHelix } from 'ps-helix';
12
+
13
+ bootstrapApplication(App, {
14
+ providers: [
15
+ provideHelix({
16
+ theme: { targetContrast: 'AAA', customerContext: BrandService },
17
+ components: {
18
+ button: { size: 'large', appearance: 'outline' },
19
+ modal: { dismissLabel: 'Fermer', confirmLabel: 'Valider', cancelLabel: 'Annuler' },
20
+ toast: { position: 'bottom-right', duration: 3000 },
21
+ },
22
+ }),
23
+ ],
24
+ });
25
+ ```
26
+
27
+ **A partial override stays partial.** Each component reads
28
+ `this.config.<key> ?? <its own literal>`, so `{ button: { size: 'large' } }` leaves the
29
+ button's colour and appearance where they were.
30
+
31
+ **An input always wins over the configuration.** The config sets the *default* of the input;
32
+ writing the attribute on an element overrides it for that element.
33
+
34
+ Three narrower functions exist for an application that wants one part of it —
35
+ `provideHelixTheme`, `provideHelixComponentDefaults` and `provideHelixToast`. Mixing them
36
+ with `provideHelix` is harmless: the later provider wins, as anywhere else in Angular.
37
+
38
+ Each token is also exported by name, for the cases a single component needs a different
39
+ default in one part of the application:
40
+
41
+ ```typescript
42
+ import { BUTTON_CONFIG } from 'ps-helix';
43
+
44
+ @Component({ providers: [{ provide: BUTTON_CONFIG, useValue: { size: 'small' } }] })
45
+ ```
46
+
47
+ **31 tokens, 226 settable defaults.**
48
+
49
+ ---
50
+
51
+ ### `alert`
52
+
53
+ `ALERT_CONFIG` · `Partial<AlertConfig>` · [alert.tokens.ts](src/lib/components/alert/alert.tokens.ts)
54
+
55
+ | Key | Default |
56
+ |---|---|
57
+ | `color` | `'info'` |
58
+ | `iconPosition` | `'left'` |
59
+ | `closable` | `false` |
60
+ | `size` | `'medium'` |
61
+ | `showIcon` | `true` |
62
+ | `labels` | `{ dismiss: 'Dismiss alert' }` |
63
+
64
+ ### `avatar`
65
+
66
+ `AVATAR_CONFIG` · `Partial<AvatarConfig>` · [avatar.tokens.ts](src/lib/components/avatar/avatar.tokens.ts)
67
+
68
+ | Key | Default |
69
+ |---|---|
70
+ | `size` | `'medium'` |
71
+ | `shape` | `'circle'` |
72
+ | `alt` | `'User avatar'` |
73
+ | `icon` | `'user'` |
74
+
75
+ ### `badge`
76
+
77
+ `BADGE_CONFIG` · `Partial<BadgeConfig>` · [badge.tokens.ts](src/lib/components/badge/badge.tokens.ts)
78
+
79
+ | Key | Default |
80
+ |---|---|
81
+ | `color` | `'primary'` |
82
+ | `size` | `'medium'` |
83
+ | `displayType` | `'text'` |
84
+ | `position` | `'top-right'` |
85
+ | `max` | `99` |
86
+ | `showZero` | `false` |
87
+ | `overlap` | `false` |
88
+ | `disabled` | `false` |
89
+
90
+ ### `button`
91
+
92
+ `BUTTON_CONFIG` · `Partial<ButtonConfig>` · [button.tokens.ts](src/lib/components/button/button.tokens.ts)
93
+
94
+ | Key | Default |
95
+ |---|---|
96
+ | `appearance` | `'solid'` |
97
+ | `color` | `'primary'` |
98
+ | `size` | `'medium'` |
99
+ | `type` | `'button'` |
100
+ | `iconPosition` | `'left'` |
101
+ | `fullWidth` | `false` |
102
+ | `loadingText` | `'Loading...'` |
103
+ | `disabledText` | `'This action is currently unavailable'` |
104
+
105
+ ### `card`
106
+
107
+ `CARD_CONFIG` · `Partial<CardConfig>` · [card.tokens.ts](src/lib/components/card/card.tokens.ts)
108
+
109
+ | Key | Default |
110
+ |---|---|
111
+ | `appearance` | `'flat'` |
112
+ | `color` | `'neutral'` |
113
+ | `density` | `'normal'` |
114
+ | `hoverable` | `false` |
115
+ | `interactive` | `false` |
116
+ | `bodyPadding` | `true` |
117
+ | `showHeaderDivider` | `true` |
118
+ | `showFooterDivider` | `true` |
119
+ | `showActionsDivider` | `true` |
120
+ | `actionsAlignment` | `'right'` |
121
+
122
+ ### `checkbox`
123
+
124
+ `CHECKBOX_CONFIG` · `Partial<CheckboxConfig>` · [checkbox.component.ts](src/lib/components/checkbox/checkbox.component.ts)
125
+
126
+ | Key | Default |
127
+ |---|---|
128
+ | `checked` | `false` |
129
+ | `disabled` | `false` |
130
+ | `required` | `false` |
131
+ | `indeterminate` | `false` |
132
+ | `size` | `'medium'` |
133
+ | `labelPosition` | `'right'` |
134
+ | `label` | `''` |
135
+
136
+ ### `collapse`
137
+
138
+ `COLLAPSE_CONFIG` · `Partial<CollapseConfig>` · [collapse.tokens.ts](src/lib/components/collapse/collapse.tokens.ts)
139
+
140
+ | Key | Default |
141
+ |---|---|
142
+ | `appearance` | `'flat'` |
143
+ | `size` | `'medium'` |
144
+ | `icon` | `'caret-down'` |
145
+ | `maxHeight` | `'auto'` |
146
+ | `defaultHeaderText` | `'Collapsible section'` |
147
+ | `disableAnimation` | `false` |
148
+
149
+ ### `dropdown`
150
+
151
+ `DROPDOWN_CONFIG` · `Partial<DropdownConfig>` · [dropdown.tokens.ts](src/lib/components/dropdown/dropdown.tokens.ts)
152
+
153
+ | Key | Default |
154
+ |---|---|
155
+ | `appearance` | `'solid'` |
156
+ | `color` | `'primary'` |
157
+ | `size` | `'medium'` |
158
+ | `placement` | `'bottom-start'` |
159
+ | `iconOnly` | `false` |
160
+ | `disabled` | `false` |
161
+ | `label` | `'Dropdown Menu'` |
162
+
163
+ ### `horizontalCard`
164
+
165
+ `HORIZONTAL_CARD_CONFIG` · `Partial<HorizontalCardConfig>` · [horizontal-card.tokens.ts](src/lib/components/horizontal-card/horizontal-card.tokens.ts)
166
+
167
+ | Key | Default |
168
+ |---|---|
169
+ | `appearance` | `'elevated'` |
170
+ | `hoverable` | `false` |
171
+ | `interactive` | `false` |
172
+ | `sideWidth` | `'var(--psh-size-48)'` |
173
+ | `gap` | `'var(--psh-spacing-md)'` |
174
+ | `sidePadding` | `'0'` |
175
+ | `contentPadding` | `'var(--psh-spacing-md)'` |
176
+ | `mobileHeight` | `'var(--psh-size-48)'` |
177
+
178
+ ### `infoCard`
179
+
180
+ `INFO_CARD_CONFIG` · `Partial<InfoCardConfig>` · [info-card.tokens.ts](src/lib/components/info-card/info-card.tokens.ts)
181
+
182
+ | Key | Default |
183
+ |---|---|
184
+ | `appearance` | `'outline'` |
185
+ | `icon` | `'circle-dashed'` |
186
+ | `hoverable` | `false` |
187
+ | `interactive` | `false` |
188
+ | `copyable` | `false` |
189
+ | `copyButtonLabel` | `'Copy'` |
190
+ | `copyFeedbackText` | `'Copied'` |
191
+ | `autoFullWidthOnMobile` | `true` |
192
+ | `emptyStateMessage` | `'No information available'` |
193
+ | `notProvidedText` | `'Not provided'` |
194
+
195
+ ### `input`
196
+
197
+ `INPUT_CONFIG` · `Partial<InputConfig>` · [input.tokens.ts](src/lib/components/input/input.tokens.ts)
198
+
199
+ | Key | Default |
200
+ |---|---|
201
+ | `appearance` | `'outline'` |
202
+ | `size` | `'medium'` |
203
+ | `type` | `'text'` |
204
+ | `required` | `false` |
205
+ | `showPasswordLabel` | `INPUT_LABELS.showPassword` |
206
+ | `hidePasswordLabel` | `INPUT_LABELS.hidePassword` |
207
+ | `fullWidth` | `false` |
208
+ | `showLabel` | `true` |
209
+ | `label` | `''` |
210
+ | `placeholder` | `''` |
211
+
212
+ ### `menu`
213
+
214
+ `MENU_CONFIG` · `Partial<MenuConfig>` · [menu.tokens.ts](src/lib/components/menu/menu.tokens.ts)
215
+
216
+ | Key | Default |
217
+ |---|---|
218
+ | `mode` | `'vertical'` |
219
+ | `variant` | `'default'` |
220
+ | `collapsible` | `false` |
221
+
222
+ ### `modal`
223
+
224
+ `MODAL_CONFIG` · `Partial<ModalConfig>` · [modal.component.ts](src/lib/components/modal/modal.component.ts)
225
+
226
+ | Key | Default |
227
+ |---|---|
228
+ | `size` | `'medium'` |
229
+ | `showClose` | `true` |
230
+ | `closeOnBackdrop` | `true` |
231
+ | `closeOnEscape` | `true` |
232
+ | `preventScroll` | `true` |
233
+ | `showFooter` | `true` |
234
+ | `dismissLabel` | `'Close'` |
235
+ | `confirmLabel` | `'Confirm'` |
236
+ | `cancelLabel` | `'Cancel'` |
237
+
238
+ ### `pagination`
239
+
240
+ `PAGINATION_CONFIG` · `Partial<PaginationConfig>` · [pagination.component.ts](src/lib/components/pagination/pagination.component.ts)
241
+
242
+ | Key | Default |
243
+ |---|---|
244
+ | `size` | `'medium'` |
245
+ | `appearance` | `'flat'` |
246
+ | `showFirstLast` | `true` |
247
+ | `showPrevNext` | `true` |
248
+ | `maxVisiblePages` | `5` |
249
+ | `showItemsPerPage` | `false` |
250
+ | `itemsPerPageOptions` | `[5, 10, 25, 50]` |
251
+ | `firstLabel` | `'First'` |
252
+ | `previousLabel` | `'Previous'` |
253
+ | `nextLabel` | `'Next'` |
254
+ | `lastLabel` | `'Last'` |
255
+ | `pageLabel` | `'Page'` |
256
+ | `itemsLabel` | `'items'` |
257
+ | `itemsPerPageLabel` | `'Items per page'` |
258
+ | `ariaLabel` | `'Pagination navigation'` |
259
+
260
+ ### `progressbar`
261
+
262
+ `PROGRESSBAR_CONFIG` · `Partial<ProgressbarConfig>` · [progressbar.component.ts](src/lib/components/progressbar/progressbar.component.ts)
263
+
264
+ | Key | Default |
265
+ |---|---|
266
+ | `value` | `0` |
267
+ | `max` | `100` |
268
+ | `color` | `'primary'` |
269
+ | `size` | `'medium'` |
270
+ | `showLabel` | `true` |
271
+ | `mode` | `'default'` |
272
+ | `labelPosition` | `'top'` |
273
+
274
+ ### `radioGroup`
275
+
276
+ `RADIO_GROUP_CONFIG` · `Partial<RadioGroupConfig>` · [radio-group.component.ts](src/lib/components/radio/radio-group.component.ts)
277
+
278
+ | Key | Default |
279
+ |---|---|
280
+ | `size` | `'medium'` |
281
+ | `orientation` | `'vertical'` |
282
+ | `required` | `false` |
283
+
284
+ ### `radio`
285
+
286
+ `RADIO_CONFIG` · `Partial<RadioConfig>` · [radio.component.ts](src/lib/components/radio/radio.component.ts)
287
+
288
+ | Key | Default |
289
+ |---|---|
290
+ | `checked` | `false` |
291
+ | `disabled` | `false` |
292
+ | `required` | `false` |
293
+ | `size` | `'medium'` |
294
+ | `labelPosition` | `'right'` |
295
+
296
+ ### `select`
297
+
298
+ `SELECT_CONFIG` · `Partial<SelectConfig>` · [select.tokens.ts](src/lib/components/select/select.tokens.ts)
299
+
300
+ | Key | Default |
301
+ |---|---|
302
+ | `appearance` | `'outline'` |
303
+ | `size` | `'medium'` |
304
+ | `searchable` | `false` |
305
+ | `clearable` | `false` |
306
+ | `fullWidth` | `false` |
307
+ | `placeholder` | `'Select an option'` |
308
+ | `multiplePlaceholder` | `'Select options'` |
309
+ | `noResultsText` | `'No results'` |
310
+ | `clearLabel` | `'Clear selection'` |
311
+ | `searchPlaceholder` | `'Search...'` |
312
+
313
+ ### `sidebar`
314
+
315
+ `SIDEBAR_CONFIG` · `Partial<SidebarConfig>` · [sidebar.component.ts](src/lib/components/sidebar/sidebar.component.ts)
316
+
317
+ | Key | Default |
318
+ |---|---|
319
+ | `mode` | `'fixed'` |
320
+ | `position` | `'left'` |
321
+ | `width` | `'250px'` |
322
+ | `breakpoint` | `'768px'` |
323
+ | `autoFocus` | `true` |
324
+ | `ariaLabel` | `'Sidebar navigation'` |
325
+ | `closeOnBackdrop` | `true` |
326
+ | `closeOnEscape` | `true` |
327
+
328
+ ### `spinloader`
329
+
330
+ `SPINLOADER_CONFIG` · `Partial<SpinLoaderConfig>` · [spinloader.component.ts](src/lib/components/spinloader/spinloader.component.ts)
331
+
332
+ | Key | Default |
333
+ |---|---|
334
+ | `variant` | `'circle'` |
335
+ | `size` | `'medium'` |
336
+ | `color` | `'primary'` |
337
+ | `ariaLabel` | `'Loading'` |
338
+
339
+ ### `statCard`
340
+
341
+ `STAT_CARD_CONFIG` · `Partial<StatCardConfig>` · [stat-card.tokens.ts](src/lib/components/stat-card/stat-card.tokens.ts)
342
+
343
+ | Key | Default |
344
+ |---|---|
345
+ | `appearance` | `'elevated'` |
346
+ | `layout` | `'horizontal'` |
347
+ | `hoverable` | `false` |
348
+ | `interactive` | `false` |
349
+ | `rowDirection` | `false` |
350
+
351
+ ### `stateFlowIndicator`
352
+
353
+ `STATE_FLOW_INDICATOR_CONFIG` · `Partial<StateFlowIndicatorConfig>` · [state-flow-indicator.component.ts](src/lib/components/state-flow-indicator/state-flow-indicator.component.ts)
354
+
355
+ | Key | Default |
356
+ |---|---|
357
+ | `linear` | `true` |
358
+ | `ariaLabels` | `DEFAULT_ARIA_LABELS` |
359
+ | `ariaLabel` | `'Progress indicator'` |
360
+
361
+ ### `stepper`
362
+
363
+ `STEPPER_CONFIG` · `Partial<StepperConfig>` · [stepper.component.ts](src/lib/components/stepper/stepper.component.ts)
364
+
365
+ | Key | Default |
366
+ |---|---|
367
+ | `variant` | `'default'` |
368
+ | `linear` | `true` |
369
+ | `ariaLabels` | `DEFAULT_ARIA_LABELS` |
370
+ | `ariaLabel` | `'Step navigation'` |
371
+
372
+ ### `switch`
373
+
374
+ `SWITCH_CONFIG` · `Partial<SwitchConfig>` · [switch.component.ts](src/lib/components/switch/switch.component.ts)
375
+
376
+ | Key | Default |
377
+ |---|---|
378
+ | `checked` | `false` |
379
+ | `disabled` | `false` |
380
+ | `required` | `false` |
381
+ | `size` | `'medium'` |
382
+ | `labelPosition` | `'right'` |
383
+
384
+ ### `tabBar`
385
+
386
+ `TAB_BAR_CONFIG` · `Partial<TabBarConfig>` · [tab-bar.component.ts](src/lib/components/tab-bar/tab-bar.component.ts)
387
+
388
+ | Key | Default |
389
+ |---|---|
390
+ | `disabled` | `false` |
391
+ | `position` | `'bottom'` |
392
+ | `animated` | `true` |
393
+ | `ariaLabel` | `'Tab navigation'` |
394
+
395
+ ### `table`
396
+
397
+ `TABLE_CONFIG` · `Partial<TableConfig>` · [table.component.ts](src/lib/components/table/table.component.ts)
398
+
399
+ | Key | Default |
400
+ |---|---|
401
+ | `appearance` | `'flat'` |
402
+ | `size` | `'medium'` |
403
+ | `striped` | `false` |
404
+ | `hoverable` | `false` |
405
+ | `bordered` | `false` |
406
+ | `loading` | `false` |
407
+ | `emptyMessage` | `'No data available'` |
408
+ | `noResultsMessage` | `'No results found'` |
409
+ | `globalSearch` | `false` |
410
+ | `globalSearchPlaceholder` | `'Search in all columns...'` |
411
+ | `tableLayout` | `'auto'` |
412
+ | `truncateText` | `false` |
413
+ | `fullWidth` | `false` |
414
+ | `expandable` | `false` |
415
+ | `singleExpand` | `false` |
416
+ | `expandColumnLabel` | `'Expand'` |
417
+ | `expandRowLabel` | `'Expand row'` |
418
+ | `collapseRowLabel` | `'Collapse row'` |
419
+ | `sortedAscendingLabel` | `'sorted ascending'` |
420
+ | `sortedDescendingLabel` | `'sorted descending'` |
421
+ | `resultsFoundLabel` | `'results found'` |
422
+
423
+ ### `tabs`
424
+
425
+ `TABS_CONFIG` · `Partial<TabsConfig>` · [tabs.component.ts](src/lib/components/tabs/tabs.component.ts)
426
+
427
+ | Key | Default |
428
+ |---|---|
429
+ | `ariaLabel` | `'Tab navigation'` |
430
+ | `variant` | `'default'` |
431
+ | `size` | `'medium'` |
432
+ | `activeIndex` | `0` |
433
+ | `animated` | `true` |
434
+
435
+ ### `tag`
436
+
437
+ `TAG_CONFIG` · `Partial<TagConfig>` · [tag.component.ts](src/lib/components/tag/tag.component.ts)
438
+
439
+ | Key | Default |
440
+ |---|---|
441
+ | `color` | `'primary'` |
442
+ | `size` | `'medium'` |
443
+ | `closable` | `false` |
444
+ | `disabled` | `false` |
445
+ | `interactive` | `false` |
446
+ | `closeLabel` | `'Remove tag'` |
447
+
448
+ ### `textarea`
449
+
450
+ `TEXTAREA_CONFIG` · `Partial<TextareaConfig>` · [textarea.tokens.ts](src/lib/components/textarea/textarea.tokens.ts)
451
+
452
+ | Key | Default |
453
+ |---|---|
454
+ | `appearance` | `'outline'` |
455
+ | `size` | `'medium'` |
456
+ | `resize` | `'vertical'` |
457
+ | `rows` | `4` |
458
+ | `required` | `false` |
459
+ | `characterCountSuffix` | `TEXTAREA_LABELS.characterCountSuffix` |
460
+ | `fullWidth` | `false` |
461
+ | `showLabel` | `true` |
462
+ | `showCharacterCount` | `false` |
463
+ | `autoSize` | `false` |
464
+ | `label` | `''` |
465
+ | `placeholder` | `''` |
466
+
467
+ ### `toast`
468
+
469
+ `TOAST_CONFIG` · `Partial<ToastConfig>` · [toast.tokens.ts](src/lib/components/toast/toast.tokens.ts)
470
+
471
+ | Key | Default |
472
+ |---|---|
473
+ | `position` | `'top-right'` |
474
+ | `duration` | `5000` |
475
+ | `maxToasts` | `5` |
476
+ | `pauseOnHover` | `true` |
477
+ | `showIcon` | `true` |
478
+ | `showCloseButton` | `true` |
479
+ | `ariaLabel` | `'Notifications'` |
480
+
481
+ ### `tooltip`
482
+
483
+ `TOOLTIP_CONFIG` · `Partial<TooltipConfig>` · [tooltip.component.ts](src/lib/components/tooltip/tooltip.component.ts)
484
+
485
+ | Key | Default |
486
+ |---|---|
487
+ | `variant` | `'dark'` |
488
+ | `position` | `'top'` |
489
+ | `showDelay` | `200` |
490
+ | `hideDelay` | `100` |
491
+ | `maxWidth` | `200` |
492
+ | `autoFlip` | `true` |