@italia/tooltip 1.0.0-alpha.10 → 1.0.0-alpha.11
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/custom-elements.json +117 -117
- package/dist/src/it-tooltip.js +1 -1
- package/dist/src/it-tooltip.js.map +1 -1
- package/package.json +4 -4
package/custom-elements.json
CHANGED
|
@@ -2,6 +2,123 @@
|
|
|
2
2
|
"schemaVersion": "1.0.0",
|
|
3
3
|
"readme": "",
|
|
4
4
|
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "stories/it-tooltip.stories.ts",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "variable",
|
|
11
|
+
"name": "meta",
|
|
12
|
+
"default": "{ title: 'Componenti/Tooltip', component: 'it-tooltip', tags: ['alpha', 'web-component', 'a11y-ok'], parameters: { layout: 'padded', }, args: { placement: 'top', }, argTypes: { placement: { control: 'select', options: TOOLTIP_PLACEMENTS, description: 'Posizione del Tooltip rispetto al suo elemento trigger', table: { defaultValue: { summary: 'top' } }, }, }, } satisfies Meta<TooltipArgs>"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"kind": "variable",
|
|
16
|
+
"name": "Base",
|
|
17
|
+
"type": {
|
|
18
|
+
"text": "Story"
|
|
19
|
+
},
|
|
20
|
+
"default": "{ decorators: [(story) => html`<div style=\"padding:30px 0;text-align:center\">${story()}</div>`], render: (args) => html` <it-tooltip placement=${ifDefined(args.placement)}> <it-button slot=\"trigger\" variant=\"primary\">Mostra tooltip</it-button> <span slot=\"content\">Testo del tooltip</span> </it-tooltip> `, tags: ['!autodocs', '!dev'], }"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"kind": "variable",
|
|
24
|
+
"name": "SuLink",
|
|
25
|
+
"type": {
|
|
26
|
+
"text": "Story"
|
|
27
|
+
},
|
|
28
|
+
"default": "{ name: 'Su link e testo', render: (args) => html` <p style=\"max-width:400px;line-height:2\"> Il tooltip può essere usato su qualsiasi elemento interattivo, come i <it-tooltip placement=${ifDefined(args.placement)}> <a slot=\"trigger\" href=\"#\" @click=${(e: Event) => e.preventDefault()}>link in una frase</a> <span slot=\"content\">Primo link con tooltip</span> </it-tooltip> di testo, per fornire informazioni contestuali senza occupare spazio nella pagina. Basta passare il mouse o portare il focus su un <it-tooltip placement=${ifDefined(args.placement)}> <a slot=\"trigger\" href=\"#\" @click=${(e: Event) => e.preventDefault()}>elemento con tooltip</a> <span slot=\"content\">Secondo link con tooltip</span> </it-tooltip> per vedere l'etichetta comparire. </p> `, }"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"kind": "variable",
|
|
32
|
+
"name": "Posizione",
|
|
33
|
+
"type": {
|
|
34
|
+
"text": "Story"
|
|
35
|
+
},
|
|
36
|
+
"default": "{ argTypes: { ...disabledControls() }, decorators: [ (story) => html`<div style=\"display:grid;gap:.5rem;grid-template:1fr 1fr 1fr / 1fr 1fr 1fr;place-items:center\"> ${story()} </div>`, ], render: () => html` <it-tooltip placement=\"bottom\" style=\"grid-column:2;grid-row:1\"> <it-button slot=\"trigger\" variant=\"primary\">Giù</it-button> <span slot=\"content\">Tooltip in basso</span> </it-tooltip> <it-tooltip placement=\"top\" style=\"grid-column:2;grid-row:3\"> <it-button slot=\"trigger\" variant=\"primary\">Su</it-button> <span slot=\"content\">Tooltip in alto</span> </it-tooltip> <it-tooltip placement=\"right\" style=\"grid-column:1;grid-row:2\"> <it-button slot=\"trigger\" variant=\"primary\">Destra</it-button> <span slot=\"content\">Tooltip a destra</span> </it-tooltip> <it-tooltip placement=\"left\" style=\"grid-column:3;grid-row:2\"> <it-button slot=\"trigger\" variant=\"primary\">Sinistra</it-button> <span slot=\"content\">Tooltip a sinistra</span> </it-tooltip> `, }"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"kind": "variable",
|
|
40
|
+
"name": "TestoFormattato",
|
|
41
|
+
"type": {
|
|
42
|
+
"text": "Story"
|
|
43
|
+
},
|
|
44
|
+
"default": "{ name: 'Testo formattato', argTypes: { ...disabledControls() }, render: () => html` <it-tooltip placement=\"right\"> <it-button slot=\"trigger\" variant=\"primary\">Mostra tooltip</it-button> <span slot=\"content\"><em>Tooltip</em> <u>con</u> <strong>HTML</strong></span> </it-tooltip> `, }"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"kind": "variable",
|
|
48
|
+
"name": "AttivazioneControllata",
|
|
49
|
+
"type": {
|
|
50
|
+
"text": "Story"
|
|
51
|
+
},
|
|
52
|
+
"default": "{ name: 'Attivazione controllata', argTypes: { ...disabledControls() }, decorators: [(story) => html`<div style=\"display:flex;gap:1rem;align-items:flex-start;height:70px\">${story()}</div>`], render: () => { const show = (e: Event) => { const btn = e.currentTarget as HTMLElement; const tooltip = btn.closest('div')?.querySelector('it-tooltip') as any; tooltip?.showTooltip(); }; const hide = (e: Event) => { const btn = e.currentTarget as HTMLElement; const tooltip = btn.closest('div')?.querySelector('it-tooltip') as any; tooltip?.hideTooltip(); }; return html` <it-tooltip placement=\"bottom\" controlled> <it-button slot=\"trigger\" variant=\"primary\">Target</it-button> <span slot=\"content\">Tooltip controllato</span> </it-tooltip> <button @mouseenter=${show} @mouseleave=${hide} class=\"btn btn-secondary\"> Hover qui per mostrare il tooltip </button> `; }, }"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"kind": "variable",
|
|
56
|
+
"name": "Eventi",
|
|
57
|
+
"type": {
|
|
58
|
+
"text": "Story"
|
|
59
|
+
},
|
|
60
|
+
"default": "{ args: { placement: 'right', }, argTypes: { ...disabledControls() }, render: (args) => { const onOpen = (e: CustomEvent) => console.log('Tooltip aperto', e); const onClose = (e: CustomEvent) => console.log('Tooltip chiuso', e); return html` <it-tooltip placement=${ifDefined(args.placement)} @it-tooltip-open=${onOpen} @it-tooltip-close=${onClose}> <it-button slot=\"trigger\" variant=\"primary\">Hover o focus</it-button> <span slot=\"content\">Tooltip con eventi</span> </it-tooltip> `; }, }"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"exports": [
|
|
64
|
+
{
|
|
65
|
+
"kind": "js",
|
|
66
|
+
"name": "default",
|
|
67
|
+
"declaration": {
|
|
68
|
+
"name": "meta",
|
|
69
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"kind": "js",
|
|
74
|
+
"name": "Base",
|
|
75
|
+
"declaration": {
|
|
76
|
+
"name": "Base",
|
|
77
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"kind": "js",
|
|
82
|
+
"name": "SuLink",
|
|
83
|
+
"declaration": {
|
|
84
|
+
"name": "SuLink",
|
|
85
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"kind": "js",
|
|
90
|
+
"name": "Posizione",
|
|
91
|
+
"declaration": {
|
|
92
|
+
"name": "Posizione",
|
|
93
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"kind": "js",
|
|
98
|
+
"name": "TestoFormattato",
|
|
99
|
+
"declaration": {
|
|
100
|
+
"name": "TestoFormattato",
|
|
101
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"kind": "js",
|
|
106
|
+
"name": "AttivazioneControllata",
|
|
107
|
+
"declaration": {
|
|
108
|
+
"name": "AttivazioneControllata",
|
|
109
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"kind": "js",
|
|
114
|
+
"name": "Eventi",
|
|
115
|
+
"declaration": {
|
|
116
|
+
"name": "Eventi",
|
|
117
|
+
"module": "stories/it-tooltip.stories.ts"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
5
122
|
{
|
|
6
123
|
"kind": "javascript-module",
|
|
7
124
|
"path": "src/index.ts",
|
|
@@ -375,123 +492,6 @@
|
|
|
375
492
|
}
|
|
376
493
|
}
|
|
377
494
|
]
|
|
378
|
-
},
|
|
379
|
-
{
|
|
380
|
-
"kind": "javascript-module",
|
|
381
|
-
"path": "stories/it-tooltip.stories.ts",
|
|
382
|
-
"declarations": [
|
|
383
|
-
{
|
|
384
|
-
"kind": "variable",
|
|
385
|
-
"name": "meta",
|
|
386
|
-
"default": "{ title: 'Componenti/Tooltip', component: 'it-tooltip', tags: ['alpha', 'web-component', 'a11y-ok'], parameters: { layout: 'padded', }, args: { placement: 'top', }, argTypes: { placement: { control: 'select', options: TOOLTIP_PLACEMENTS, description: 'Posizione del Tooltip rispetto al suo elemento trigger', table: { defaultValue: { summary: 'top' } }, }, }, } satisfies Meta<TooltipArgs>"
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
"kind": "variable",
|
|
390
|
-
"name": "Base",
|
|
391
|
-
"type": {
|
|
392
|
-
"text": "Story"
|
|
393
|
-
},
|
|
394
|
-
"default": "{ decorators: [(story) => html`<div style=\"padding:30px 0;text-align:center\">${story()}</div>`], render: (args) => html` <it-tooltip placement=${ifDefined(args.placement)}> <it-button slot=\"trigger\" variant=\"primary\">Mostra tooltip</it-button> <span slot=\"content\">Testo del tooltip</span> </it-tooltip> `, tags: ['!autodocs', '!dev'], }"
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
"kind": "variable",
|
|
398
|
-
"name": "SuLink",
|
|
399
|
-
"type": {
|
|
400
|
-
"text": "Story"
|
|
401
|
-
},
|
|
402
|
-
"default": "{ name: 'Su link e testo', render: (args) => html` <p style=\"max-width:400px;line-height:2\"> Il tooltip può essere usato su qualsiasi elemento interattivo, come i <it-tooltip placement=${ifDefined(args.placement)}> <a slot=\"trigger\" href=\"#\" @click=${(e: Event) => e.preventDefault()}>link in una frase</a> <span slot=\"content\">Primo link con tooltip</span> </it-tooltip> di testo, per fornire informazioni contestuali senza occupare spazio nella pagina. Basta passare il mouse o portare il focus su un <it-tooltip placement=${ifDefined(args.placement)}> <a slot=\"trigger\" href=\"#\" @click=${(e: Event) => e.preventDefault()}>elemento con tooltip</a> <span slot=\"content\">Secondo link con tooltip</span> </it-tooltip> per vedere l'etichetta comparire. </p> `, }"
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
"kind": "variable",
|
|
406
|
-
"name": "Posizione",
|
|
407
|
-
"type": {
|
|
408
|
-
"text": "Story"
|
|
409
|
-
},
|
|
410
|
-
"default": "{ argTypes: { ...disabledControls() }, decorators: [ (story) => html`<div style=\"display:grid;gap:.5rem;grid-template:1fr 1fr 1fr / 1fr 1fr 1fr;place-items:center\"> ${story()} </div>`, ], render: () => html` <it-tooltip placement=\"bottom\" style=\"grid-column:2;grid-row:1\"> <it-button slot=\"trigger\" variant=\"primary\">Giù</it-button> <span slot=\"content\">Tooltip in basso</span> </it-tooltip> <it-tooltip placement=\"top\" style=\"grid-column:2;grid-row:3\"> <it-button slot=\"trigger\" variant=\"primary\">Su</it-button> <span slot=\"content\">Tooltip in alto</span> </it-tooltip> <it-tooltip placement=\"right\" style=\"grid-column:1;grid-row:2\"> <it-button slot=\"trigger\" variant=\"primary\">Destra</it-button> <span slot=\"content\">Tooltip a destra</span> </it-tooltip> <it-tooltip placement=\"left\" style=\"grid-column:3;grid-row:2\"> <it-button slot=\"trigger\" variant=\"primary\">Sinistra</it-button> <span slot=\"content\">Tooltip a sinistra</span> </it-tooltip> `, }"
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
"kind": "variable",
|
|
414
|
-
"name": "TestoFormattato",
|
|
415
|
-
"type": {
|
|
416
|
-
"text": "Story"
|
|
417
|
-
},
|
|
418
|
-
"default": "{ name: 'Testo formattato', argTypes: { ...disabledControls() }, render: () => html` <it-tooltip placement=\"right\"> <it-button slot=\"trigger\" variant=\"primary\">Mostra tooltip</it-button> <span slot=\"content\"><em>Tooltip</em> <u>con</u> <strong>HTML</strong></span> </it-tooltip> `, }"
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
"kind": "variable",
|
|
422
|
-
"name": "AttivazioneControllata",
|
|
423
|
-
"type": {
|
|
424
|
-
"text": "Story"
|
|
425
|
-
},
|
|
426
|
-
"default": "{ name: 'Attivazione controllata', argTypes: { ...disabledControls() }, decorators: [(story) => html`<div style=\"display:flex;gap:1rem;align-items:flex-start;height:70px\">${story()}</div>`], render: () => { const show = (e: Event) => { const btn = e.currentTarget as HTMLElement; const tooltip = btn.closest('div')?.querySelector('it-tooltip') as any; tooltip?.showTooltip(); }; const hide = (e: Event) => { const btn = e.currentTarget as HTMLElement; const tooltip = btn.closest('div')?.querySelector('it-tooltip') as any; tooltip?.hideTooltip(); }; return html` <it-tooltip placement=\"bottom\" controlled> <it-button slot=\"trigger\" variant=\"primary\">Target</it-button> <span slot=\"content\">Tooltip controllato</span> </it-tooltip> <button @mouseenter=${show} @mouseleave=${hide} class=\"btn btn-secondary\"> Hover qui per mostrare il tooltip </button> `; }, }"
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
"kind": "variable",
|
|
430
|
-
"name": "Eventi",
|
|
431
|
-
"type": {
|
|
432
|
-
"text": "Story"
|
|
433
|
-
},
|
|
434
|
-
"default": "{ args: { placement: 'right', }, argTypes: { ...disabledControls() }, render: (args) => { const onOpen = (e: CustomEvent) => console.log('Tooltip aperto', e); const onClose = (e: CustomEvent) => console.log('Tooltip chiuso', e); return html` <it-tooltip placement=${ifDefined(args.placement)} @it-tooltip-open=${onOpen} @it-tooltip-close=${onClose}> <it-button slot=\"trigger\" variant=\"primary\">Hover o focus</it-button> <span slot=\"content\">Tooltip con eventi</span> </it-tooltip> `; }, }"
|
|
435
|
-
}
|
|
436
|
-
],
|
|
437
|
-
"exports": [
|
|
438
|
-
{
|
|
439
|
-
"kind": "js",
|
|
440
|
-
"name": "default",
|
|
441
|
-
"declaration": {
|
|
442
|
-
"name": "meta",
|
|
443
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
444
|
-
}
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
"kind": "js",
|
|
448
|
-
"name": "Base",
|
|
449
|
-
"declaration": {
|
|
450
|
-
"name": "Base",
|
|
451
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
452
|
-
}
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
"kind": "js",
|
|
456
|
-
"name": "SuLink",
|
|
457
|
-
"declaration": {
|
|
458
|
-
"name": "SuLink",
|
|
459
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
460
|
-
}
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
"kind": "js",
|
|
464
|
-
"name": "Posizione",
|
|
465
|
-
"declaration": {
|
|
466
|
-
"name": "Posizione",
|
|
467
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
468
|
-
}
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
"kind": "js",
|
|
472
|
-
"name": "TestoFormattato",
|
|
473
|
-
"declaration": {
|
|
474
|
-
"name": "TestoFormattato",
|
|
475
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
476
|
-
}
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
"kind": "js",
|
|
480
|
-
"name": "AttivazioneControllata",
|
|
481
|
-
"declaration": {
|
|
482
|
-
"name": "AttivazioneControllata",
|
|
483
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
484
|
-
}
|
|
485
|
-
},
|
|
486
|
-
{
|
|
487
|
-
"kind": "js",
|
|
488
|
-
"name": "Eventi",
|
|
489
|
-
"declaration": {
|
|
490
|
-
"name": "Eventi",
|
|
491
|
-
"module": "stories/it-tooltip.stories.ts"
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
]
|
|
495
495
|
}
|
|
496
496
|
]
|
|
497
497
|
}
|
package/dist/src/it-tooltip.js
CHANGED