@italia/progress 1.0.0-alpha.7

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.
@@ -0,0 +1,675 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "src/index.ts",
8
+ "declarations": [],
9
+ "exports": [
10
+ {
11
+ "kind": "js",
12
+ "name": "ItProgress",
13
+ "declaration": {
14
+ "name": "ItProgress",
15
+ "module": "./it-progress.js"
16
+ }
17
+ },
18
+ {
19
+ "kind": "js",
20
+ "name": "ProgressBarColor",
21
+ "declaration": {
22
+ "name": "ProgressBarColor",
23
+ "module": "./types.js"
24
+ }
25
+ },
26
+ {
27
+ "kind": "js",
28
+ "name": "ProgressSpinnerSize",
29
+ "declaration": {
30
+ "name": "ProgressSpinnerSize",
31
+ "module": "./types.js"
32
+ }
33
+ },
34
+ {
35
+ "kind": "js",
36
+ "name": "ProgressType",
37
+ "declaration": {
38
+ "name": "ProgressType",
39
+ "module": "./types.js"
40
+ }
41
+ }
42
+ ]
43
+ },
44
+ {
45
+ "kind": "javascript-module",
46
+ "path": "src/it-progress.ts",
47
+ "declarations": [
48
+ {
49
+ "kind": "class",
50
+ "description": "",
51
+ "name": "ItProgress",
52
+ "members": [
53
+ {
54
+ "kind": "field",
55
+ "name": "type",
56
+ "type": {
57
+ "text": "ProgressType"
58
+ },
59
+ "default": "'bar'",
60
+ "attribute": "type",
61
+ "reflects": true
62
+ },
63
+ {
64
+ "kind": "field",
65
+ "name": "value",
66
+ "type": {
67
+ "text": "number"
68
+ },
69
+ "default": "0",
70
+ "attribute": "value",
71
+ "reflects": true
72
+ },
73
+ {
74
+ "kind": "field",
75
+ "name": "itAriaLabel",
76
+ "type": {
77
+ "text": "string"
78
+ },
79
+ "default": "'Caricamento'",
80
+ "attribute": "it-aria-label",
81
+ "reflects": true
82
+ },
83
+ {
84
+ "kind": "field",
85
+ "name": "showValue",
86
+ "type": {
87
+ "text": "boolean"
88
+ },
89
+ "default": "false",
90
+ "attribute": "show-value",
91
+ "reflects": true
92
+ },
93
+ {
94
+ "kind": "field",
95
+ "name": "label",
96
+ "type": {
97
+ "text": "string"
98
+ },
99
+ "default": "''",
100
+ "attribute": "label",
101
+ "reflects": true
102
+ },
103
+ {
104
+ "kind": "field",
105
+ "name": "indeterminate",
106
+ "type": {
107
+ "text": "boolean"
108
+ },
109
+ "default": "false",
110
+ "attribute": "indeterminate",
111
+ "reflects": true
112
+ },
113
+ {
114
+ "kind": "field",
115
+ "name": "color",
116
+ "type": {
117
+ "text": "ProgressBarColor | string"
118
+ },
119
+ "default": "'default'",
120
+ "attribute": "color",
121
+ "reflects": true
122
+ },
123
+ {
124
+ "kind": "field",
125
+ "name": "trailColor",
126
+ "type": {
127
+ "text": "string"
128
+ },
129
+ "privacy": "private",
130
+ "default": "'#D4E9FF'"
131
+ },
132
+ {
133
+ "kind": "field",
134
+ "name": "strokeWidth",
135
+ "type": {
136
+ "text": "number"
137
+ },
138
+ "privacy": "private",
139
+ "default": "24"
140
+ },
141
+ {
142
+ "kind": "field",
143
+ "name": "trailWidth",
144
+ "type": {
145
+ "text": "number"
146
+ },
147
+ "privacy": "private",
148
+ "default": "12"
149
+ },
150
+ {
151
+ "kind": "field",
152
+ "name": "easing",
153
+ "type": {
154
+ "text": "string"
155
+ },
156
+ "privacy": "private",
157
+ "default": "'easeInOut'"
158
+ },
159
+ {
160
+ "kind": "field",
161
+ "name": "duration",
162
+ "type": {
163
+ "text": "number"
164
+ },
165
+ "privacy": "private",
166
+ "default": "1400"
167
+ },
168
+ {
169
+ "kind": "field",
170
+ "name": "animated",
171
+ "type": {
172
+ "text": "boolean"
173
+ },
174
+ "privacy": "private",
175
+ "default": "true"
176
+ },
177
+ {
178
+ "kind": "field",
179
+ "name": "active",
180
+ "type": {
181
+ "text": "boolean"
182
+ },
183
+ "default": "false",
184
+ "attribute": "active",
185
+ "reflects": true
186
+ },
187
+ {
188
+ "kind": "field",
189
+ "name": "double",
190
+ "type": {
191
+ "text": "boolean"
192
+ },
193
+ "default": "false",
194
+ "attribute": "double",
195
+ "reflects": true
196
+ },
197
+ {
198
+ "kind": "field",
199
+ "name": "size",
200
+ "type": {
201
+ "text": "ProgressSpinnerSize"
202
+ },
203
+ "default": "'md'",
204
+ "attribute": "size",
205
+ "reflects": true
206
+ },
207
+ {
208
+ "kind": "field",
209
+ "name": "_bar",
210
+ "type": {
211
+ "text": "ProgressDonut | null"
212
+ },
213
+ "privacy": "private",
214
+ "default": "null"
215
+ },
216
+ {
217
+ "kind": "field",
218
+ "name": "_donutContainer",
219
+ "type": {
220
+ "text": "HTMLElement | null"
221
+ },
222
+ "privacy": "private",
223
+ "default": "null"
224
+ },
225
+ {
226
+ "kind": "method",
227
+ "name": "set",
228
+ "privacy": "public",
229
+ "parameters": [
230
+ {
231
+ "name": "progress",
232
+ "type": {
233
+ "text": "number"
234
+ }
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "kind": "method",
240
+ "name": "_isBarColorVariant",
241
+ "privacy": "private",
242
+ "static": true,
243
+ "return": {
244
+ "type": {
245
+ "text": "color is ProgressBarColor"
246
+ }
247
+ },
248
+ "parameters": [
249
+ {
250
+ "name": "color",
251
+ "type": {
252
+ "text": "string"
253
+ }
254
+ }
255
+ ]
256
+ },
257
+ {
258
+ "kind": "field",
259
+ "name": "_barColorClass",
260
+ "privacy": "private",
261
+ "readonly": true
262
+ },
263
+ {
264
+ "kind": "field",
265
+ "name": "_displayLabel",
266
+ "privacy": "private",
267
+ "readonly": true
268
+ },
269
+ {
270
+ "kind": "method",
271
+ "name": "_setDonutProgress",
272
+ "privacy": "private",
273
+ "parameters": [
274
+ {
275
+ "name": "progress",
276
+ "type": {
277
+ "text": "number"
278
+ }
279
+ }
280
+ ]
281
+ },
282
+ {
283
+ "kind": "method",
284
+ "name": "_initDonutBar",
285
+ "privacy": "private"
286
+ },
287
+ {
288
+ "kind": "method",
289
+ "name": "_renderBar",
290
+ "privacy": "private"
291
+ },
292
+ {
293
+ "kind": "method",
294
+ "name": "_renderDonut",
295
+ "privacy": "private"
296
+ },
297
+ {
298
+ "kind": "method",
299
+ "name": "_renderSpinner",
300
+ "privacy": "private"
301
+ }
302
+ ],
303
+ "events": [
304
+ {
305
+ "name": "it-donut-updated",
306
+ "type": {
307
+ "text": "CustomEvent"
308
+ }
309
+ }
310
+ ],
311
+ "attributes": [
312
+ {
313
+ "name": "type",
314
+ "type": {
315
+ "text": "ProgressType"
316
+ },
317
+ "default": "'bar'",
318
+ "fieldName": "type"
319
+ },
320
+ {
321
+ "name": "value",
322
+ "type": {
323
+ "text": "number"
324
+ },
325
+ "default": "0",
326
+ "fieldName": "value"
327
+ },
328
+ {
329
+ "name": "it-aria-label",
330
+ "type": {
331
+ "text": "string"
332
+ },
333
+ "default": "'Caricamento'",
334
+ "fieldName": "itAriaLabel"
335
+ },
336
+ {
337
+ "name": "show-value",
338
+ "type": {
339
+ "text": "boolean"
340
+ },
341
+ "default": "false",
342
+ "fieldName": "showValue"
343
+ },
344
+ {
345
+ "name": "label",
346
+ "type": {
347
+ "text": "string"
348
+ },
349
+ "default": "''",
350
+ "fieldName": "label"
351
+ },
352
+ {
353
+ "name": "indeterminate",
354
+ "type": {
355
+ "text": "boolean"
356
+ },
357
+ "default": "false",
358
+ "fieldName": "indeterminate"
359
+ },
360
+ {
361
+ "name": "color",
362
+ "type": {
363
+ "text": "ProgressBarColor | string"
364
+ },
365
+ "default": "'default'",
366
+ "fieldName": "color"
367
+ },
368
+ {
369
+ "name": "active",
370
+ "type": {
371
+ "text": "boolean"
372
+ },
373
+ "default": "false",
374
+ "fieldName": "active"
375
+ },
376
+ {
377
+ "name": "double",
378
+ "type": {
379
+ "text": "boolean"
380
+ },
381
+ "default": "false",
382
+ "fieldName": "double"
383
+ },
384
+ {
385
+ "name": "size",
386
+ "type": {
387
+ "text": "ProgressSpinnerSize"
388
+ },
389
+ "default": "'md'",
390
+ "fieldName": "size"
391
+ }
392
+ ],
393
+ "superclass": {
394
+ "name": "BaseComponent",
395
+ "package": "@italia/globals"
396
+ },
397
+ "tagName": "it-progress",
398
+ "customElement": true
399
+ }
400
+ ],
401
+ "exports": [
402
+ {
403
+ "kind": "js",
404
+ "name": "ItProgress",
405
+ "declaration": {
406
+ "name": "ItProgress",
407
+ "module": "src/it-progress.ts"
408
+ }
409
+ },
410
+ {
411
+ "kind": "custom-element-definition",
412
+ "name": "it-progress",
413
+ "declaration": {
414
+ "name": "ItProgress",
415
+ "module": "src/it-progress.ts"
416
+ }
417
+ }
418
+ ]
419
+ },
420
+ {
421
+ "kind": "javascript-module",
422
+ "path": "src/types.ts",
423
+ "declarations": [],
424
+ "exports": []
425
+ },
426
+ {
427
+ "kind": "javascript-module",
428
+ "path": "stories/it-progress.stories.ts",
429
+ "declarations": [
430
+ {
431
+ "kind": "variable",
432
+ "name": "meta",
433
+ "default": "{ title: 'Componenti/Progress', tags: ['a11y-ok', 'web-component', 'alpha'], component: 'it-progress', args: { type: 'bar', value: 50, 'it-aria-label': 'Caricamento', showValue: false, label: '', indeterminate: false, color: 'default', active: true, double: false, size: 'md', }, argTypes: { type: { control: 'select', options: ['bar', 'donut', 'spinner'], description: 'Tipologia di progress indicator', table: { defaultValue: { summary: 'bar' } }, }, value: { control: { type: 'range', min: 0, max: 100, step: 1 }, description: 'Percentuale di avanzamento (da 0 a 100)', table: { defaultValue: { summary: '50' } }, }, showValue: { name: 'show-value', control: 'boolean', description: 'mostra la percentuale di avanzamento <br/><i>(solo per `type=\"bar\"`)</i>', table: { defaultValue: { summary: 'false' } }, }, 'it-aria-label': { control: 'text', description: 'Etichetta accessibile per gli screen reader (aria-label)', table: { defaultValue: { summary: 'Caricamento' } }, }, label: { name: 'label', control: 'text', description: 'se si vuole mostrare un testo personalizzato per l\\'etichetta, invece della percentuale di avanzamento <br/><i>(solo per `type=\"bar\"`)</i>', }, indeterminate: { control: 'boolean', description: 'stato indeterminato (animazione infinita) <br/><i>(solo per `type=\"bar\"`)</i>', table: { defaultValue: { summary: 'false' } }, }, color: { control: 'text', description: '<strong>Bar:</strong> default|success|info|warning|danger. <br/><br/><strong>Donut:</strong> colore CSS della barra (default: `var(--bsi-secondary)`)<br/><br/><i>(solo per `type=\"bar\"` e `type=\"donut\"`)</i>', table: { defaultValue: { summary: 'default' } }, }, active: { control: 'boolean', description: 'attiva/disattiva l\\'animazione <br/><i>(solo per `type=\"spinner\"`)</i>', table: { defaultValue: { summary: 'true' } }, }, double: { control: 'boolean', description: 'variante doppia <br/><i>(solo per `type=\"spinner\"`)</i>', table: { defaultValue: { summary: 'false' } }, }, size: { control: 'select', options: ['sm', 'md', 'lg', 'xl'], description: 'dimensione <br/><i>(solo per `type=\"spinner\"`)</i>', table: { defaultValue: { summary: 'md' } }, }, }, parameters: { pageLayout: 'w-100', }, } satisfies Meta<ProgressStoryProps>"
434
+ },
435
+ {
436
+ "kind": "variable",
437
+ "name": "EsempioInterattivo",
438
+ "type": {
439
+ "text": "Story"
440
+ },
441
+ "default": "{ name: 'Esempio interattivo', tags: ['!dev'], args: { type: 'bar', value: 50, color: 'default', showValue: false, label: '', indeterminate: false, }, parameters: { docs: { canvas: { sourceState: 'shown' } }, }, render: renderComponent, }"
442
+ },
443
+ {
444
+ "kind": "variable",
445
+ "name": "Bar",
446
+ "type": {
447
+ "text": "Story"
448
+ },
449
+ "default": "{ args: { type: 'bar', value: 50 }, parameters: { controls: { exclude: ['active', 'double', 'size'], }, }, render: renderComponent, }"
450
+ },
451
+ {
452
+ "kind": "variable",
453
+ "name": "ConEtichetta",
454
+ "type": {
455
+ "text": "Story"
456
+ },
457
+ "default": "{ name: 'Bar con etichetta', args: { type: 'bar', value: 35, showValue: true, label: '35%' }, render: (params) => html` <it-progress type=\"bar\" value=\"${params.value}\" ?show-value=\"${params.showValue}\" it-aria-label=\"Progresso\"> ${params.label} </it-progress> `, }"
458
+ },
459
+ {
460
+ "kind": "variable",
461
+ "name": "Indeterminato",
462
+ "type": {
463
+ "text": "Story"
464
+ },
465
+ "default": "{ name: 'Bar indeterminata', args: { type: 'bar', indeterminate: true }, render: (params) => html` <it-progress type=\"bar\" ?indeterminate=\"${params.indeterminate}\" it-aria-label=\"In elaborazione...\"></it-progress> `, }"
466
+ },
467
+ {
468
+ "kind": "variable",
469
+ "name": "Colori",
470
+ "type": {
471
+ "text": "Story"
472
+ },
473
+ "default": "{ name: 'Bar: varianti di colore', render: () => html` <div style=\"display: flex; flex-direction: column; gap: 12px;\"> <it-progress type=\"bar\" value=\"25\" color=\"success\" it-aria-label=\"Caricamento - successo\"></it-progress> <it-progress type=\"bar\" value=\"33\" color=\"info\" it-aria-label=\"Caricamento - info\"></it-progress> <it-progress type=\"bar\" value=\"50\" color=\"warning\" it-aria-label=\"Caricamento - warning\"></it-progress> <it-progress type=\"bar\" value=\"66\" color=\"danger\" it-aria-label=\"Caricamento - danger\"></it-progress> </div> `, }"
474
+ },
475
+ {
476
+ "kind": "variable",
477
+ "name": "Button",
478
+ "type": {
479
+ "text": "Story"
480
+ },
481
+ "default": "{ name: 'Pulsante con progress bar', args: { type: 'bar', showValue: false }, parameters: { pageLayout: '', }, render: (params) => html` <it-button variant=\"primary\" disabled class=\"m-4\"> Label del pulsante <it-icon name=\"it-github\" color=\"inverse\"></it-icon> ${renderComponent({ ...params, type: 'bar' })} </it-button> <it-button variant=\"secondary\" disabled class=\"m-4\"> Label del pulsante <it-icon name=\"it-github\" color=\"inverse\"></it-icon> ${renderComponent({ ...params, type: 'bar' })} </it-button> `, }"
482
+ },
483
+ {
484
+ "kind": "variable",
485
+ "name": "Donut",
486
+ "type": {
487
+ "text": "Story"
488
+ },
489
+ "default": "{ args: { type: 'donut', value: 75, 'it-aria-label': 'Caricamento', }, parameters: { controls: { exclude: ['show-value', 'label', 'indeterminate', 'active', 'double', 'size'], }, pageLayout: 'center', }, render: (params: ProgressStoryProps) => html` <div class=\"row\"> <div class=\"col-6 px-5\"> <div class=\"text-center mb-3\">Stato iniziale<br />(0%):</div> ${renderComponent({ ...params, value: 0 })} </div> <div class=\"col-6 px-5\"> <div class=\"text-center mb-3\">Stato di avanzamento<br />(75%):</div> ${renderComponent({ ...params })} </div> </div> `, }"
490
+ },
491
+ {
492
+ "kind": "variable",
493
+ "name": "Spinner",
494
+ "type": {
495
+ "text": "Story"
496
+ },
497
+ "default": "{ args: { type: 'spinner', active: true, double: false, size: 'md', }, parameters: { controls: { exclude: ['show-value', 'label', 'indeterminate'], }, }, render: (params) => renderSpinner(params, 'Spinner'), }"
498
+ },
499
+ {
500
+ "kind": "variable",
501
+ "name": "SpinnerDoppio",
502
+ "type": {
503
+ "text": "Story"
504
+ },
505
+ "default": "{ name: 'Spinner doppio', args: { type: 'spinner', active: true, double: true, size: 'md' }, render: (params) => renderSpinner(params, 'Spinner doppio'), }"
506
+ }
507
+ ],
508
+ "exports": [
509
+ {
510
+ "kind": "js",
511
+ "name": "default",
512
+ "declaration": {
513
+ "name": "meta",
514
+ "module": "stories/it-progress.stories.ts"
515
+ }
516
+ },
517
+ {
518
+ "kind": "js",
519
+ "name": "EsempioInterattivo",
520
+ "declaration": {
521
+ "name": "EsempioInterattivo",
522
+ "module": "stories/it-progress.stories.ts"
523
+ }
524
+ },
525
+ {
526
+ "kind": "js",
527
+ "name": "Bar",
528
+ "declaration": {
529
+ "name": "Bar",
530
+ "module": "stories/it-progress.stories.ts"
531
+ }
532
+ },
533
+ {
534
+ "kind": "js",
535
+ "name": "ConEtichetta",
536
+ "declaration": {
537
+ "name": "ConEtichetta",
538
+ "module": "stories/it-progress.stories.ts"
539
+ }
540
+ },
541
+ {
542
+ "kind": "js",
543
+ "name": "Indeterminato",
544
+ "declaration": {
545
+ "name": "Indeterminato",
546
+ "module": "stories/it-progress.stories.ts"
547
+ }
548
+ },
549
+ {
550
+ "kind": "js",
551
+ "name": "Colori",
552
+ "declaration": {
553
+ "name": "Colori",
554
+ "module": "stories/it-progress.stories.ts"
555
+ }
556
+ },
557
+ {
558
+ "kind": "js",
559
+ "name": "Button",
560
+ "declaration": {
561
+ "name": "Button",
562
+ "module": "stories/it-progress.stories.ts"
563
+ }
564
+ },
565
+ {
566
+ "kind": "js",
567
+ "name": "Donut",
568
+ "declaration": {
569
+ "name": "Donut",
570
+ "module": "stories/it-progress.stories.ts"
571
+ }
572
+ },
573
+ {
574
+ "kind": "js",
575
+ "name": "Spinner",
576
+ "declaration": {
577
+ "name": "Spinner",
578
+ "module": "stories/it-progress.stories.ts"
579
+ }
580
+ },
581
+ {
582
+ "kind": "js",
583
+ "name": "SpinnerDoppio",
584
+ "declaration": {
585
+ "name": "SpinnerDoppio",
586
+ "module": "stories/it-progress.stories.ts"
587
+ }
588
+ }
589
+ ]
590
+ },
591
+ {
592
+ "kind": "javascript-module",
593
+ "path": "src/utils/progress-donut.ts",
594
+ "declarations": [
595
+ {
596
+ "kind": "class",
597
+ "description": "",
598
+ "name": "ProgressDonut",
599
+ "members": [
600
+ {
601
+ "kind": "field",
602
+ "name": "_bar",
603
+ "type": {
604
+ "text": "ProgressbarCircle"
605
+ },
606
+ "privacy": "private",
607
+ "readonly": true,
608
+ "default": "new CircleConstructor(container, { color: config.color, trailColor: config.trailColor, strokeWidth: config.strokeWidth, trailWidth: config.trailWidth, easing: config.easing, duration: config.duration, text: { autoStyleContainer: false, }, step: (_state, circle) => { const value = Math.round(circle.value() * 100); circle.setText(`${value}%`); config.onStep?.(value); }, })"
609
+ },
610
+ {
611
+ "kind": "method",
612
+ "name": "create",
613
+ "static": true,
614
+ "parameters": [
615
+ {
616
+ "name": "container",
617
+ "type": {
618
+ "text": "HTMLElement"
619
+ }
620
+ },
621
+ {
622
+ "name": "config",
623
+ "type": {
624
+ "text": "ProgressDonutConfig"
625
+ }
626
+ }
627
+ ]
628
+ },
629
+ {
630
+ "kind": "method",
631
+ "name": "setValue",
632
+ "parameters": [
633
+ {
634
+ "name": "value",
635
+ "type": {
636
+ "text": "number"
637
+ }
638
+ },
639
+ {
640
+ "name": "animate",
641
+ "default": "true"
642
+ }
643
+ ]
644
+ },
645
+ {
646
+ "kind": "method",
647
+ "name": "destroy"
648
+ },
649
+ {
650
+ "kind": "method",
651
+ "name": "_loadCircleConstructor",
652
+ "privacy": "private",
653
+ "static": true,
654
+ "return": {
655
+ "type": {
656
+ "text": "Promise<ProgressbarCircleConstructor>"
657
+ }
658
+ }
659
+ }
660
+ ]
661
+ }
662
+ ],
663
+ "exports": [
664
+ {
665
+ "kind": "js",
666
+ "name": "ProgressDonut",
667
+ "declaration": {
668
+ "name": "ProgressDonut",
669
+ "module": "src/utils/progress-donut.ts"
670
+ }
671
+ }
672
+ ]
673
+ }
674
+ ]
675
+ }
@@ -0,0 +1,3 @@
1
+ export { ItProgress } from './it-progress.js';
2
+ export type { ProgressBarColor, ProgressSpinnerSize, ProgressType } from './types.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { ItProgress } from './it-progress.js';
2
+ import '@italia/globals';
3
+ import 'lit';
4
+ import 'lit/decorators.js';
5
+ import 'lit/directives/if-defined.js';
6
+ import 'lit/directives/style-map.js';
7
+ import 'lit/directives/when.js';
8
+ //# sourceMappingURL=index.js.map