@maggioli-design-system/mds-progress 2.0.0 → 2.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.
Files changed (64) hide show
  1. package/dist/cjs/{index-70bc96f7.js → index-db3031a9.js} +395 -182
  2. package/dist/cjs/loader.cjs.js +3 -3
  3. package/dist/cjs/mds-progress.cjs.entry.js +29 -3
  4. package/dist/cjs/mds-progress.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +2 -2
  6. package/dist/collection/common/aria.js +19 -0
  7. package/dist/collection/components/mds-progress/mds-progress.css +5 -11
  8. package/dist/collection/components/mds-progress/mds-progress.js +131 -72
  9. package/dist/collection/dictionary/typography.js +14 -3
  10. package/dist/components/index.d.ts +1 -5
  11. package/dist/components/index.js +1 -0
  12. package/dist/components/mds-progress.js +32 -4
  13. package/dist/esm/{index-38630cc3.js → index-c2cf8238.js} +395 -183
  14. package/dist/esm/loader.js +3 -3
  15. package/dist/esm/mds-progress.entry.js +29 -3
  16. package/dist/esm/mds-progress.js +3 -3
  17. package/dist/esm/polyfills/css-shim.js +1 -1
  18. package/dist/esm-es5/index-c2cf8238.js +2 -0
  19. package/dist/esm-es5/loader.js +1 -1
  20. package/dist/esm-es5/mds-progress.entry.js +1 -1
  21. package/dist/esm-es5/mds-progress.js +1 -1
  22. package/dist/mds-progress/mds-progress.esm.js +1 -1
  23. package/dist/mds-progress/mds-progress.js +2 -1
  24. package/dist/mds-progress/p-763baf47.js +2 -0
  25. package/dist/mds-progress/p-c94616ee.system.js +2 -0
  26. package/dist/mds-progress/p-ccaf7022.system.entry.js +1 -0
  27. package/dist/mds-progress/p-e91b0c4d.entry.js +1 -0
  28. package/dist/mds-progress/p-f219ebba.system.js +1 -0
  29. package/dist/stats.json +109 -46
  30. package/dist/types/common/aria.d.ts +4 -0
  31. package/dist/types/components/mds-progress/mds-progress.d.ts +11 -0
  32. package/dist/types/components.d.ts +8 -0
  33. package/dist/types/dictionary/typography.d.ts +5 -3
  34. package/dist/types/stencil-public-runtime.d.ts +15 -4
  35. package/dist/types/types/typography.d.ts +4 -2
  36. package/loader/package.json +1 -0
  37. package/package.json +3 -3
  38. package/readme.md +6 -5
  39. package/src/common/aria.ts +27 -0
  40. package/src/components/mds-progress/.gitlab-ci.yml +2 -2
  41. package/src/components/mds-progress/mds-progress.css +7 -10
  42. package/src/components/mds-progress/mds-progress.tsx +33 -3
  43. package/src/components/mds-progress/readme.md +6 -5
  44. package/src/components.d.ts +8 -0
  45. package/src/dictionary/typography.ts +19 -4
  46. package/src/types/typography.ts +13 -2
  47. package/www/build/mds-progress.esm.js +1 -1
  48. package/www/build/mds-progress.js +2 -1
  49. package/www/build/p-763baf47.js +2 -0
  50. package/www/build/p-c94616ee.system.js +2 -0
  51. package/www/build/p-ccaf7022.system.entry.js +1 -0
  52. package/www/build/p-e91b0c4d.entry.js +1 -0
  53. package/www/build/p-f219ebba.system.js +1 -0
  54. package/dist/esm-es5/index-38630cc3.js +0 -2
  55. package/dist/mds-progress/p-284f97ac.entry.js +0 -1
  56. package/dist/mds-progress/p-d402cd92.system.js +0 -2
  57. package/dist/mds-progress/p-d64b07f9.system.js +0 -1
  58. package/dist/mds-progress/p-dadd4466.js +0 -2
  59. package/dist/mds-progress/p-f93dfdf4.system.entry.js +0 -1
  60. package/www/build/p-284f97ac.entry.js +0 -1
  61. package/www/build/p-d402cd92.system.js +0 -2
  62. package/www/build/p-d64b07f9.system.js +0 -1
  63. package/www/build/p-dadd4466.js +0 -2
  64. package/www/build/p-f93dfdf4.system.entry.js +0 -1
package/dist/stats.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-06-22T09:20:00",
2
+ "timestamp": "2022-11-18T09:22:31",
3
3
  "compiler": {
4
4
  "name": "node",
5
5
  "version": "18.3.0"
@@ -9,12 +9,13 @@
9
9
  "fsNamespace": "mds-progress",
10
10
  "components": 1,
11
11
  "entries": 1,
12
- "bundles": 65,
12
+ "bundles": 66,
13
13
  "outputs": [
14
14
  {
15
15
  "name": "dist-collection",
16
- "files": 24,
16
+ "files": 25,
17
17
  "generatedFiles": [
18
+ "./dist/collection/common/aria.js",
18
19
  "./dist/collection/components/mds-progress/mds-progress.js",
19
20
  "./dist/collection/components/mds-progress/meta/dictionary.js",
20
21
  "./dist/collection/components/mds-progress/meta/types.js",
@@ -55,17 +56,17 @@
55
56
  "name": "dist-lazy",
56
57
  "files": 35,
57
58
  "generatedFiles": [
58
- "./dist/cjs/index-70bc96f7.js",
59
+ "./dist/cjs/index-db3031a9.js",
59
60
  "./dist/cjs/index.cjs.js",
60
61
  "./dist/cjs/loader.cjs.js",
61
62
  "./dist/cjs/mds-progress.cjs.entry.js",
62
63
  "./dist/cjs/mds-progress.cjs.js",
63
- "./dist/esm-es5/index-38630cc3.js",
64
+ "./dist/esm-es5/index-c2cf8238.js",
64
65
  "./dist/esm-es5/index.js",
65
66
  "./dist/esm-es5/loader.js",
66
67
  "./dist/esm-es5/mds-progress.entry.js",
67
68
  "./dist/esm-es5/mds-progress.js",
68
- "./dist/esm/index-38630cc3.js",
69
+ "./dist/esm/index-c2cf8238.js",
69
70
  "./dist/esm/index.js",
70
71
  "./dist/esm/loader.js",
71
72
  "./dist/esm/mds-progress.entry.js",
@@ -75,21 +76,21 @@
75
76
  "./dist/mds-progress/index.esm.js",
76
77
  "./dist/mds-progress/mds-progress.esm.js",
77
78
  "./dist/mds-progress/mds-progress.js",
78
- "./dist/mds-progress/p-284f97ac.entry.js",
79
79
  "./dist/mds-progress/p-50ea2036.system.js",
80
- "./dist/mds-progress/p-d402cd92.system.js",
81
- "./dist/mds-progress/p-d64b07f9.system.js",
82
- "./dist/mds-progress/p-dadd4466.js",
83
- "./dist/mds-progress/p-f93dfdf4.system.entry.js",
80
+ "./dist/mds-progress/p-763baf47.js",
81
+ "./dist/mds-progress/p-c94616ee.system.js",
82
+ "./dist/mds-progress/p-ccaf7022.system.entry.js",
83
+ "./dist/mds-progress/p-e91b0c4d.entry.js",
84
+ "./dist/mds-progress/p-f219ebba.system.js",
84
85
  "./www/build/index.esm.js",
85
86
  "./www/build/mds-progress.esm.js",
86
87
  "./www/build/mds-progress.js",
87
- "./www/build/p-284f97ac.entry.js",
88
88
  "./www/build/p-50ea2036.system.js",
89
- "./www/build/p-d402cd92.system.js",
90
- "./www/build/p-d64b07f9.system.js",
91
- "./www/build/p-dadd4466.js",
92
- "./www/build/p-f93dfdf4.system.entry.js"
89
+ "./www/build/p-763baf47.js",
90
+ "./www/build/p-c94616ee.system.js",
91
+ "./www/build/p-ccaf7022.system.entry.js",
92
+ "./www/build/p-e91b0c4d.entry.js",
93
+ "./www/build/p-f219ebba.system.js"
93
94
  ]
94
95
  },
95
96
  {
@@ -122,12 +123,12 @@
122
123
  "components": [
123
124
  "mds-progress"
124
125
  ],
125
- "bundleId": "p-284f97ac",
126
- "fileName": "p-284f97ac.entry.js",
126
+ "bundleId": "p-e91b0c4d",
127
+ "fileName": "p-e91b0c4d.entry.js",
127
128
  "imports": [
128
- "p-dadd4466.js"
129
+ "p-763baf47.js"
129
130
  ],
130
- "originalByteSize": 3552
131
+ "originalByteSize": 4458
131
132
  }
132
133
  ],
133
134
  "esm": [
@@ -139,9 +140,9 @@
139
140
  "bundleId": "mds-progress",
140
141
  "fileName": "mds-progress.entry.js",
141
142
  "imports": [
142
- "index-38630cc3.js"
143
+ "index-c2cf8238.js"
143
144
  ],
144
- "originalByteSize": 3556
145
+ "originalByteSize": 4462
145
146
  }
146
147
  ],
147
148
  "es5": [
@@ -153,9 +154,9 @@
153
154
  "bundleId": "mds-progress",
154
155
  "fileName": "mds-progress.entry.js",
155
156
  "imports": [
156
- "index-38630cc3.js"
157
+ "index-c2cf8238.js"
157
158
  ],
158
- "originalByteSize": 3556
159
+ "originalByteSize": 4462
159
160
  }
160
161
  ],
161
162
  "system": [
@@ -164,12 +165,12 @@
164
165
  "components": [
165
166
  "mds-progress"
166
167
  ],
167
- "bundleId": "p-f93dfdf4.system",
168
- "fileName": "p-f93dfdf4.system.entry.js",
168
+ "bundleId": "p-ccaf7022.system",
169
+ "fileName": "p-ccaf7022.system.entry.js",
169
170
  "imports": [
170
- "p-d402cd92.system.js"
171
+ "p-c94616ee.system.js"
171
172
  ],
172
- "originalByteSize": 3897
173
+ "originalByteSize": 4983
173
174
  }
174
175
  ],
175
176
  "commonjs": [
@@ -181,9 +182,9 @@
181
182
  "bundleId": "mds-progress.cjs",
182
183
  "fileName": "mds-progress.cjs.entry.js",
183
184
  "imports": [
184
- "index-70bc96f7.js"
185
+ "index-db3031a9.js"
185
186
  ],
186
- "originalByteSize": 3626
187
+ "originalByteSize": 4521
187
188
  }
188
189
  ]
189
190
  },
@@ -192,7 +193,7 @@
192
193
  "tag": "mds-progress",
193
194
  "path": "./src/components/mds-progress/mds-progress.js",
194
195
  "source": "./src/components/mds-progress/mds-progress.tsx",
195
- "elementRef": null,
196
+ "elementRef": "element",
196
197
  "componentClassName": "MdsProgress",
197
198
  "assetsDirs": [],
198
199
  "dependencies": [],
@@ -237,7 +238,7 @@
237
238
  "name": "direction",
238
239
  "type": "string",
239
240
  "attribute": "direction",
240
- "reflect": false,
241
+ "reflect": true,
241
242
  "mutable": false,
242
243
  "required": false,
243
244
  "optional": true,
@@ -282,10 +283,34 @@
282
283
  "text": "Sets the theme variant colors"
283
284
  },
284
285
  "internal": false
286
+ },
287
+ {
288
+ "name": "steps",
289
+ "type": "string",
290
+ "attribute": "steps",
291
+ "reflect": false,
292
+ "mutable": false,
293
+ "required": false,
294
+ "optional": true,
295
+ "defaultValue": "'Inizio,Un quarto,Metà,Tre quarti,Fine'",
296
+ "complexType": {
297
+ "original": "string",
298
+ "resolved": "string",
299
+ "references": {}
300
+ },
301
+ "docs": {
302
+ "tags": [],
303
+ "text": "Sets the steps that can be pronounced by accessibility technologies"
304
+ },
305
+ "internal": false
285
306
  }
286
307
  ],
287
308
  "shadowDelegatesFocus": false,
288
- "states": []
309
+ "states": [
310
+ {
311
+ "name": "currentStep"
312
+ }
313
+ ]
289
314
  }
290
315
  ],
291
316
  "entries": [
@@ -296,7 +321,7 @@
296
321
  "excludeFromCollection": false,
297
322
  "isCollectionDependency": false,
298
323
  "componentClassName": "MdsProgress",
299
- "elementRef": null,
324
+ "elementRef": "element",
300
325
  "encapsulation": "shadow",
301
326
  "shadowDelegatesFocus": false,
302
327
  "properties": [
@@ -324,7 +349,7 @@
324
349
  "name": "direction",
325
350
  "type": "string",
326
351
  "attribute": "direction",
327
- "reflect": false,
352
+ "reflect": true,
328
353
  "mutable": false,
329
354
  "required": false,
330
355
  "optional": true,
@@ -369,14 +394,47 @@
369
394
  "text": "Sets the theme variant colors"
370
395
  },
371
396
  "internal": false
397
+ },
398
+ {
399
+ "name": "steps",
400
+ "type": "string",
401
+ "attribute": "steps",
402
+ "reflect": false,
403
+ "mutable": false,
404
+ "required": false,
405
+ "optional": true,
406
+ "defaultValue": "'Inizio,Un quarto,Metà,Tre quarti,Fine'",
407
+ "complexType": {
408
+ "original": "string",
409
+ "resolved": "string",
410
+ "references": {}
411
+ },
412
+ "docs": {
413
+ "tags": [],
414
+ "text": "Sets the steps that can be pronounced by accessibility technologies"
415
+ },
416
+ "internal": false
372
417
  }
373
418
  ],
374
419
  "virtualProperties": [],
375
- "states": [],
420
+ "states": [
421
+ {
422
+ "name": "currentStep"
423
+ }
424
+ ],
376
425
  "methods": [],
377
426
  "listeners": [],
378
427
  "events": [],
379
- "watchers": [],
428
+ "watchers": [
429
+ {
430
+ "propName": "progress",
431
+ "methodName": "progressChanged"
432
+ },
433
+ {
434
+ "propName": "steps",
435
+ "methodName": "stepsChanged"
436
+ }
437
+ ],
380
438
  "styles": [
381
439
  {
382
440
  "modeName": "$",
@@ -385,7 +443,7 @@
385
443
  "styleIdentifier": "mdsProgressStyle",
386
444
  "externalStyles": [
387
445
  {
388
- "absolutePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.css",
446
+ "absolutePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/magma/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.css",
389
447
  "relativePath": "mds-progress.css",
390
448
  "originalComponentPath": "mds-progress.css"
391
449
  }
@@ -401,11 +459,11 @@
401
459
  "tags": [],
402
460
  "text": ""
403
461
  },
404
- "jsFilePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.js",
405
- "sourceFilePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.tsx",
462
+ "jsFilePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/magma/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.js",
463
+ "sourceFilePath": "/builds/maggiolispa/ricerca-sviluppo-new-media/magma/design-system/projects/stencil/.build/mds-progress/src/components/mds-progress/mds-progress.tsx",
406
464
  "sourceMapPath": null,
407
465
  "hasAttributeChangedCallbackFn": false,
408
- "hasComponentWillLoadFn": false,
466
+ "hasComponentWillLoadFn": true,
409
467
  "hasComponentDidLoadFn": false,
410
468
  "hasComponentShouldUpdateFn": false,
411
469
  "hasComponentWillUpdateFn": false,
@@ -417,7 +475,7 @@
417
475
  "hasDisconnectedCallbackFn": false,
418
476
  "hasElement": false,
419
477
  "hasEvent": false,
420
- "hasLifecycle": false,
478
+ "hasLifecycle": true,
421
479
  "hasListener": false,
422
480
  "hasListenerTarget": false,
423
481
  "hasListenerTargetWindow": false,
@@ -435,7 +493,7 @@
435
493
  "hasPropMutable": false,
436
494
  "hasReflect": true,
437
495
  "hasRenderFn": true,
438
- "hasState": false,
496
+ "hasState": true,
439
497
  "hasStyle": true,
440
498
  "hasVdomAttribute": true,
441
499
  "hasVdomXlink": false,
@@ -443,14 +501,18 @@
443
501
  "hasVdomFunctional": false,
444
502
  "hasVdomKey": false,
445
503
  "hasVdomListener": false,
446
- "hasVdomPropOrAttr": false,
504
+ "hasVdomPropOrAttr": true,
447
505
  "hasVdomRef": false,
448
506
  "hasVdomRender": true,
449
507
  "hasVdomStyle": true,
450
508
  "hasVdomText": false,
451
- "hasWatchCallback": false,
509
+ "hasWatchCallback": true,
452
510
  "isPlain": false,
453
511
  "htmlAttrNames": [
512
+ "aria-valuemax",
513
+ "aria-valuemin",
514
+ "aria-valuenow",
515
+ "role",
454
516
  "class",
455
517
  "style"
456
518
  ],
@@ -471,10 +533,11 @@
471
533
  ],
472
534
  "componentGraph": {
473
535
  "sc-mds-progress": [
474
- "p-dadd4466.js"
536
+ "p-763baf47.js"
475
537
  ]
476
538
  },
477
539
  "sourceGraph": {
540
+ "./src/common/aria.ts": [],
478
541
  "./src/components/mds-progress/mds-progress.tsx": [],
479
542
  "./src/components/mds-progress/meta/dictionary.ts": [],
480
543
  "./src/components/mds-progress/meta/types.ts": [],
@@ -0,0 +1,4 @@
1
+ declare const unslugName: (name: string) => string;
2
+ declare const setAttributeIfEmpty: (element: HTMLElement, attribute: string, value: string) => string;
3
+ declare const hashValue: (value: string) => string;
4
+ export { unslugName, setAttributeIfEmpty, hashValue, };
@@ -1,6 +1,9 @@
1
1
  import { DirectionType } from './meta/types';
2
2
  import { ThemeVariantType } from '../../types/variant';
3
3
  export declare class MdsProgress {
4
+ private element;
5
+ currentStep: string;
6
+ private stepsList;
4
7
  /**
5
8
  * A value between 0 and 1 that rapresents the status progress
6
9
  */
@@ -13,5 +16,13 @@ export declare class MdsProgress {
13
16
  * Sets the theme variant colors
14
17
  */
15
18
  readonly variant?: ThemeVariantType;
19
+ /**
20
+ * Sets the steps that can be pronounced by accessibility technologies
21
+ */
22
+ readonly steps?: string;
23
+ componentWillLoad(): void;
24
+ private setProgress;
25
+ progressChanged(progress: number): void;
26
+ stepsChanged(steps: string): void;
16
27
  render(): any;
17
28
  }
@@ -17,6 +17,10 @@ export namespace Components {
17
17
  * A value between 0 and 1 that rapresents the status progress
18
18
  */
19
19
  "progress"?: number;
20
+ /**
21
+ * Sets the steps that can be pronounced by accessibility technologies
22
+ */
23
+ "steps"?: string;
20
24
  /**
21
25
  * Sets the theme variant colors
22
26
  */
@@ -44,6 +48,10 @@ declare namespace LocalJSX {
44
48
  * A value between 0 and 1 that rapresents the status progress
45
49
  */
46
50
  "progress"?: number;
51
+ /**
52
+ * Sets the steps that can be pronounced by accessibility technologies
53
+ */
54
+ "steps"?: string;
47
55
  /**
48
56
  * Sets the theme variant colors
49
57
  */
@@ -1,7 +1,9 @@
1
1
  declare const typographyDictionary: string[];
2
+ declare const typographyVariationsDictionary: string[];
2
3
  declare const typographyMonoDictionary: string[];
3
- declare const typographyPrimaryDictionary: string[];
4
- declare const typographySecondaryDictionary: string[];
4
+ declare const typographyTitleDictionary: string[];
5
+ declare const typographyInfoDictionary: string[];
6
+ declare const typographyReadDictionary: string[];
5
7
  declare const typographySmallerDictionary: string[];
6
8
  declare const typographyTooltipDictionary: string[];
7
- export { typographyDictionary, typographyMonoDictionary, typographyPrimaryDictionary, typographySecondaryDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
9
+ export { typographyDictionary, typographyVariationsDictionary, typographyMonoDictionary, typographyTitleDictionary, typographyInfoDictionary, typographyReadDictionary, typographySmallerDictionary, typographyTooltipDictionary, };
@@ -221,7 +221,8 @@ export declare type ErrorHandler = (err: any, element?: HTMLElement) => void;
221
221
  */
222
222
  export declare const setMode: (handler: ResolutionHandler) => void;
223
223
  /**
224
- * getMode
224
+ * `getMode()` is used for libraries which provide multiple "modes" for styles.
225
+ * @param ref a reference to the node to get styles for
225
226
  */
226
227
  export declare function getMode<T = string | undefined>(ref: any): T;
227
228
  export declare function setPlatformHelpers(helpers: {
@@ -234,6 +235,8 @@ export declare function setPlatformHelpers(helpers: {
234
235
  /**
235
236
  * Get the base path to where the assets can be found. Use `setAssetPath(path)`
236
237
  * if the path needs to be customized.
238
+ * @param path the path to use in calculating the asset path. this value will be
239
+ * used in conjunction with the base asset path
237
240
  */
238
241
  export declare function getAssetPath(path: string): string;
239
242
  /**
@@ -246,18 +249,22 @@ export declare function getAssetPath(path: string): string;
246
249
  * `setAssetPath(document.currentScript.src)`, or using a bundler's replace plugin to
247
250
  * dynamically set the path at build time, such as `setAssetPath(process.env.ASSET_PATH)`.
248
251
  * But do note that this configuration depends on how your script is bundled, or lack of
249
- * bunding, and where your assets can be loaded from. Additionally custom bundling
252
+ * bundling, and where your assets can be loaded from. Additionally custom bundling
250
253
  * will have to ensure the static assets are copied to its build directory.
254
+ * @param path the asset path to set
251
255
  */
252
256
  export declare function setAssetPath(path: string): string;
253
257
  /**
254
- * getElement
258
+ * Retrieve a Stencil element for a given reference
259
+ * @param ref the ref to get the Stencil element for
255
260
  */
256
261
  export declare function getElement(ref: any): HTMLStencilElement;
257
262
  /**
258
263
  * Schedules a new render of the given instance or element even if no state changed.
259
264
  *
260
- * Notice `forceUpdate()` is not syncronous and might perform the DOM render in the next frame.
265
+ * Notice `forceUpdate()` is not synchronous and might perform the DOM render in the next frame.
266
+ *
267
+ * @param ref the node/element to force the re-render of
261
268
  */
262
269
  export declare function forceUpdate(ref: any): void;
263
270
  /**
@@ -272,6 +279,8 @@ export interface HTMLStencilElement extends HTMLElement {
272
279
  * in the best moment to perform DOM mutation without causing layout thrashing.
273
280
  *
274
281
  * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
282
+ *
283
+ * @param task the DOM-write to schedule
275
284
  */
276
285
  export declare function writeTask(task: RafCallback): void;
277
286
  /**
@@ -279,6 +288,8 @@ export declare function writeTask(task: RafCallback): void;
279
288
  * in the best moment to perform DOM reads without causing layout thrashing.
280
289
  *
281
290
  * For further information: https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing
291
+ *
292
+ * @param task the DOM-read to schedule
282
293
  */
283
294
  export declare function readTask(task: RafCallback): void;
284
295
  /**
@@ -1,6 +1,8 @@
1
1
  export declare type TypographyType = 'action' | 'caption' | 'code' | 'detail' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'hack' | 'label' | 'option' | 'paragraph' | 'tip';
2
- export declare type TypographyPrimaryType = 'action' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
3
- export declare type TypographySecondaryType = 'caption' | 'detail' | 'label' | 'option' | 'paragraph' | 'tip';
2
+ export declare type TypographyVariants = 'title' | 'info' | 'read' | 'mono';
3
+ export declare type TypographyTitleType = 'action' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
+ export declare type TypographyInfoType = 'caption' | 'detail' | 'label' | 'option' | 'paragraph' | 'tip';
5
+ export declare type TypographyReadType = 'caption' | 'detail' | 'paragraph';
4
6
  export declare type TypographySmallerType = 'tip' | 'option';
5
7
  export declare type TypographyMonoType = 'code' | 'hack';
6
8
  export declare type TypographyTooltipType = 'caption' | 'detail' | 'tip';
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "mds-progress-loader",
3
+ "private": true,
3
4
  "typings": "./index.d.ts",
4
5
  "module": "./index.js",
5
6
  "main": "./index.cjs.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-progress",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "mds-progress is a web-component from Maggioli Design System Magma, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "test": "stencil test --spec --e2e"
24
24
  },
25
25
  "dependencies": {
26
- "@maggioli-design-system/styles": "^7.0.0",
27
- "@stencil/core": "^2.16.1"
26
+ "@maggioli-design-system/styles": "^9.0.0",
27
+ "@stencil/core": "^2.18.1"
28
28
  },
29
29
  "license": "MIT",
30
30
  "author": {
package/readme.md CHANGED
@@ -7,11 +7,12 @@
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Description | Type | Default |
11
- | ----------- | ----------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -------------- |
12
- | `direction` | `direction` | Specifies the direction of the progress bar, if horizonatl or vertical | `"horizontal" \| "vertical"` | `'horizontal'` |
13
- | `progress` | `progress` | A value between 0 and 1 that rapresents the status progress | `number` | `0` |
14
- | `variant` | `variant` | Sets the theme variant colors | `"dark" \| "error" \| "info" \| "light" \| "primary" \| "success" \| "warning"` | `'dark'` |
10
+ | Property | Attribute | Description | Type | Default |
11
+ | ----------- | ----------- | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------- |
12
+ | `direction` | `direction` | Specifies the direction of the progress bar, if horizonatl or vertical | `"horizontal" \| "vertical"` | `'horizontal'` |
13
+ | `progress` | `progress` | A value between 0 and 1 that rapresents the status progress | `number` | `0` |
14
+ | `steps` | `steps` | Sets the steps that can be pronounced by accessibility technologies | `string` | `'Inizio,Un quarto,Metà,Tre quarti,Fine'` |
15
+ | `variant` | `variant` | Sets the theme variant colors | `"dark" \| "error" \| "info" \| "light" \| "primary" \| "success" \| "warning"` | `'dark'` |
15
16
 
16
17
 
17
18
  ## Dependencies
@@ -0,0 +1,27 @@
1
+ const hash = (s: string): string => {
2
+ let i: number, h: number
3
+ for (i = 0, h = 0; i < s.length; i ++) {
4
+ h = Math.imul(31, h) + s.charCodeAt(i) | 0
5
+ }
6
+ return h.toString()
7
+ }
8
+
9
+ const unslugName = (name: string): string => {
10
+ return name.split('/').slice(-1).pop().replace(/-/g, ' ')
11
+ }
12
+
13
+ const setAttributeIfEmpty = (element: HTMLElement, attribute: string, value: string): string => {
14
+ if (element.hasAttribute(attribute)) {
15
+ return element.getAttribute(attribute)
16
+ }
17
+ element.setAttribute(attribute, value)
18
+ return value
19
+ }
20
+
21
+ const hashValue = (value: string): string => `${value}-${hash(value)}`
22
+
23
+ export {
24
+ unslugName,
25
+ setAttributeIfEmpty,
26
+ hashValue,
27
+ }
@@ -21,5 +21,5 @@ progress-publish:
21
21
  # INSTALL TEST
22
22
  progress-install-test:
23
23
  extends: [.base-stencil-install-test, .base-progress]
24
- dependencies: [progress-publish, progress-isolate]
25
-
24
+ dependencies: [base-stencil-build, progress-isolate]
25
+ needs: [base-stencil-build, progress-isolate, progress-publish]
@@ -19,27 +19,24 @@
19
19
  @apply
20
20
  flex
21
21
  overflow-hidden
22
- transition-colors;
22
+ transition-colors
23
+ w-full;
23
24
 
24
25
  background-color: var(--background);
25
26
  border-radius: var(--radius);
26
27
  height: var(--thickness);
27
- }
28
-
29
- :host ( .horizontal ) {
30
- @apply w-full;
31
-
32
- height: var(--thickness);
33
28
  min-width: var(--thickness);
34
29
  }
35
30
 
36
- :host ( .vertical ) {
31
+ :host ( [direction=vertical] ) {
37
32
  @apply
38
33
  h-full
39
- min-h-8
40
- flex-col;
34
+ flex-col
35
+ w-auto;
41
36
 
37
+ height: unset;
42
38
  width: var(--thickness);
39
+ min-height: var(--thickness);
43
40
  }
44
41
 
45
42
  .progress {
@@ -1,4 +1,4 @@
1
- import { Component, Host, h, Prop } from '@stencil/core'
1
+ import { Component, Element, Host, h, Prop, Watch, State } from '@stencil/core'
2
2
  import { DirectionType } from './meta/types'
3
3
  import { ThemeVariantType } from '../../types/variant'
4
4
 
@@ -8,6 +8,9 @@ import { ThemeVariantType } from '../../types/variant'
8
8
  shadow: true,
9
9
  })
10
10
  export class MdsProgress {
11
+ @Element() private element: HTMLMdsAccordionTimerElement
12
+ @State() currentStep: string
13
+ private stepsList = []
11
14
 
12
15
  /**
13
16
  * A value between 0 and 1 that rapresents the status progress
@@ -17,16 +20,43 @@ export class MdsProgress {
17
20
  /**
18
21
  * Specifies the direction of the progress bar, if horizonatl or vertical
19
22
  */
20
- @Prop() readonly direction?: DirectionType = 'horizontal'
23
+ @Prop({ reflect: true }) readonly direction?: DirectionType = 'horizontal'
21
24
 
22
25
  /**
23
26
  * Sets the theme variant colors
24
27
  */
25
28
  @Prop({ reflect: true }) readonly variant?: ThemeVariantType = 'dark'
26
29
 
30
+ /**
31
+ * Sets the steps that can be pronounced by accessibility technologies
32
+ */
33
+ @Prop() readonly steps?: string = 'Inizio,Un quarto,Metà,Tre quarti,Fine'
34
+
35
+ componentWillLoad (): void {
36
+ this.stepsList = this.steps.split(',')
37
+ this.setProgress(this.progress)
38
+ }
39
+
40
+ private setProgress (progress: number): void {
41
+ if (this.steps) {
42
+ this.currentStep = this.stepsList[Math.round(progress * (this.stepsList.length - 1))]
43
+ this.element.setAttribute('aria-valuetext', this.currentStep)
44
+ }
45
+ }
46
+
47
+ @Watch('progress')
48
+ progressChanged (progress: number): void {
49
+ this.setProgress(progress)
50
+ }
51
+
52
+ @Watch('steps')
53
+ stepsChanged (steps: string): void {
54
+ this.stepsList = steps.split(',')
55
+ }
56
+
27
57
  render () {
28
58
  return (
29
- <Host class={this.direction}>
59
+ <Host aria-valuemax="100" aria-valuemin="0" aria-valuenow={ Math.round(this.progress * 100) } role="progressbar">
30
60
  <div class="progress" style={
31
61
  this.direction === 'horizontal'
32
62
  ? { flexGrow: `${this.progress}` }