@italia/dimmer 1.0.0-alpha.10
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/AUTHORS +2 -0
- package/LICENSE +11 -0
- package/README.md +63 -0
- package/custom-elements.json +481 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-dimmer.d.ts +82 -0
- package/dist/src/it-dimmer.d.ts.map +1 -0
- package/dist/src/it-dimmer.js +1504 -0
- package/dist/src/it-dimmer.js.map +1 -0
- package/dist/src/types.d.ts +7 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +74 -0
- package/styles/globals.scss +66 -0
package/AUTHORS
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright (c) 2025, the respective contributors, as shown by the AUTHORS file.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
+
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
+
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# it-dimmer
|
|
2
|
+
|
|
3
|
+
Web component `it-dimmer` del [Design system .italia](https://designers.italia.it/).
|
|
4
|
+
|
|
5
|
+
Il dimmer focalizza l'attenzione dell'utente su un contenuto sovrapposto, oscurando il contenuto principale sottostante.
|
|
6
|
+
|
|
7
|
+
## Installazione
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @italia/dimmer
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script type="module">
|
|
15
|
+
import '@italia/dimmer';
|
|
16
|
+
</script>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Utilizzo
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<it-dimmer active icon-name="it-info-circle">
|
|
23
|
+
<!-- contenuto dell'overlay -->
|
|
24
|
+
<p slot="content">Testo descrittivo dell'overlay.</p>
|
|
25
|
+
|
|
26
|
+
<!-- contenuto da oscurare (sfondo) -->
|
|
27
|
+
<div>Contenuto di sfondo da oscurare</div>
|
|
28
|
+
</it-dimmer>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Proprietà
|
|
32
|
+
|
|
33
|
+
| Proprietà | Attributo | Tipo | Default | Descrizione |
|
|
34
|
+
| ----------- | ------------ | ---------------------- | -------- | -------------------------------------------------- |
|
|
35
|
+
| `active` | `active` | `boolean` | `false` | Mostra o nasconde il dimmer |
|
|
36
|
+
| `variant` | `variant` | `'primary' \| ''` | `''` | Variante cromatica (`''` = scuro, `'primary'`) |
|
|
37
|
+
| `iconName` | `icon-name` | `string` | `''` | Nome icona Bootstrap Italia da mostrare nel dimmer |
|
|
38
|
+
|
|
39
|
+
## Slot
|
|
40
|
+
|
|
41
|
+
| Nome | Descrizione |
|
|
42
|
+
| ---------- | ------------------------------------------------------------------- |
|
|
43
|
+
| *(default)*| Contenuto di sfondo da oscurare (card, immagini, testo, ecc.) |
|
|
44
|
+
| `content` | Contenuto libero dell'overlay (testo, titolo, pulsanti, ecc.) |
|
|
45
|
+
|
|
46
|
+
## Metodi
|
|
47
|
+
|
|
48
|
+
| Metodo | Descrizione |
|
|
49
|
+
| ---------- | -------------------------------------- |
|
|
50
|
+
| `show()` | Rende visibile il dimmer |
|
|
51
|
+
| `hide()` | Nasconde il dimmer |
|
|
52
|
+
| `toggle()` | Alterna lo stato di visibilità |
|
|
53
|
+
|
|
54
|
+
## Eventi
|
|
55
|
+
|
|
56
|
+
| Evento | Descrizione |
|
|
57
|
+
| ----------------- | ------------------------------------- |
|
|
58
|
+
| `it-dimmer-show` | Emesso quando il dimmer diventa visibile |
|
|
59
|
+
| `it-dimmer-hide` | Emesso quando il dimmer viene nascosto |
|
|
60
|
+
|
|
61
|
+
## Licenza
|
|
62
|
+
|
|
63
|
+
BSD-3-Clause © Presidenza del Consiglio dei Ministri
|
|
@@ -0,0 +1,481 @@
|
|
|
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": "ItDimmer",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "ItDimmer",
|
|
15
|
+
"module": "./it-dimmer.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"kind": "js",
|
|
20
|
+
"name": "DimmerVariant",
|
|
21
|
+
"declaration": {
|
|
22
|
+
"name": "DimmerVariant",
|
|
23
|
+
"module": "./types.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"kind": "js",
|
|
28
|
+
"name": "DimmerEventDetail",
|
|
29
|
+
"declaration": {
|
|
30
|
+
"name": "DimmerEventDetail",
|
|
31
|
+
"module": "./types.js"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"kind": "javascript-module",
|
|
38
|
+
"path": "src/it-dimmer.ts",
|
|
39
|
+
"declarations": [
|
|
40
|
+
{
|
|
41
|
+
"kind": "class",
|
|
42
|
+
"description": "Componente Dimmer per focalizzare l'attenzione su un contenuto sovrapposto.\n\nIl dimmer occupa tutta l'altezza e la larghezza dell'elemento contenitore,",
|
|
43
|
+
"name": "ItDimmer",
|
|
44
|
+
"slots": [
|
|
45
|
+
{
|
|
46
|
+
"description": "Contenuto di sfondo (cards, immagini, testo da oscurare)",
|
|
47
|
+
"name": ""
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"description": "Contenuto dell'overlay (testo, titolo, azioni) — a carico dell'utilizzatore; per i pulsanti wrappare in `<div class=\"dimmer-buttons bg-dark\">`",
|
|
51
|
+
"name": "content"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"members": [
|
|
55
|
+
{
|
|
56
|
+
"kind": "field",
|
|
57
|
+
"name": "active",
|
|
58
|
+
"type": {
|
|
59
|
+
"text": "boolean"
|
|
60
|
+
},
|
|
61
|
+
"default": "false",
|
|
62
|
+
"description": "Se `true`, il dimmer è visibile e oscura il contenuto di sfondo.",
|
|
63
|
+
"attribute": "active",
|
|
64
|
+
"reflects": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"kind": "field",
|
|
68
|
+
"name": "variant",
|
|
69
|
+
"type": {
|
|
70
|
+
"text": "DimmerVariant"
|
|
71
|
+
},
|
|
72
|
+
"default": "'primary'",
|
|
73
|
+
"description": "Variante cromatica del dimmer. Con `\"primary\"` lo sfondo è il colore primario;\ncon `\"dark\"` lo sfondo è il colore scuro standard; senza valore (default) usa il colore scuro.",
|
|
74
|
+
"attribute": "variant",
|
|
75
|
+
"reflects": true
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"kind": "field",
|
|
79
|
+
"name": "iconName",
|
|
80
|
+
"type": {
|
|
81
|
+
"text": "string"
|
|
82
|
+
},
|
|
83
|
+
"default": "''",
|
|
84
|
+
"description": "Nome dell'icona Bootstrap Italia da mostrare nel dimmer (es. `\"it-info-circle\"`).\nSe valorizzato, viene renderizzata automaticamente una `<it-icon>` nella sezione `.dimmer-icon`.",
|
|
85
|
+
"attribute": "icon-name",
|
|
86
|
+
"reflects": true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"kind": "field",
|
|
90
|
+
"name": "_dimmerElement",
|
|
91
|
+
"type": {
|
|
92
|
+
"text": "HTMLElement"
|
|
93
|
+
},
|
|
94
|
+
"privacy": "private"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"kind": "field",
|
|
98
|
+
"name": "_dimmerAnimation",
|
|
99
|
+
"type": {
|
|
100
|
+
"text": "Animation | null"
|
|
101
|
+
},
|
|
102
|
+
"privacy": "private",
|
|
103
|
+
"default": "null"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"kind": "field",
|
|
107
|
+
"name": "_animationDuration",
|
|
108
|
+
"type": {
|
|
109
|
+
"text": "number"
|
|
110
|
+
},
|
|
111
|
+
"privacy": "private",
|
|
112
|
+
"readonly": true,
|
|
113
|
+
"default": "150"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"kind": "method",
|
|
117
|
+
"name": "show",
|
|
118
|
+
"privacy": "public",
|
|
119
|
+
"return": {
|
|
120
|
+
"type": {
|
|
121
|
+
"text": "Promise<void>"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"description": "Rende visibile il dimmer con un'animazione di fade-in.\nRestituisce una Promise che si risolve al termine dell'animazione."
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"kind": "method",
|
|
128
|
+
"name": "hide",
|
|
129
|
+
"privacy": "public",
|
|
130
|
+
"return": {
|
|
131
|
+
"type": {
|
|
132
|
+
"text": "Promise<void>"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"description": "Nasconde il dimmer con un'animazione di fade-out.\nRestituisce una Promise che si risolve al termine dell'animazione."
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"kind": "method",
|
|
139
|
+
"name": "toggle",
|
|
140
|
+
"privacy": "public",
|
|
141
|
+
"return": {
|
|
142
|
+
"type": {
|
|
143
|
+
"text": "Promise<void>"
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"description": "Alterna lo stato di visibilità del dimmer.\nRestituisce una Promise che si risolve al termine dell'animazione."
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"kind": "method",
|
|
150
|
+
"name": "_dispatchShow",
|
|
151
|
+
"privacy": "private",
|
|
152
|
+
"return": {
|
|
153
|
+
"type": {
|
|
154
|
+
"text": "void"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"kind": "method",
|
|
160
|
+
"name": "_dispatchHide",
|
|
161
|
+
"privacy": "private",
|
|
162
|
+
"return": {
|
|
163
|
+
"type": {
|
|
164
|
+
"text": "void"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"kind": "method",
|
|
170
|
+
"name": "_applyChildStyles",
|
|
171
|
+
"privacy": "private",
|
|
172
|
+
"return": {
|
|
173
|
+
"type": {
|
|
174
|
+
"text": "void"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"description": "Applica automaticamente colori e varianti agli elementi `it-icon`\nslottati nello slot `content`, garantendo il contrasto visivo sull'overlay.\n\n- `it-icon` → riceve `color=\"inverse\"` (il dimmer ha sempre sfondo scuro/primario)"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"kind": "method",
|
|
181
|
+
"name": "_findSlottedByTag",
|
|
182
|
+
"privacy": "private",
|
|
183
|
+
"return": {
|
|
184
|
+
"type": {
|
|
185
|
+
"text": "Element[]"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"parameters": [
|
|
189
|
+
{
|
|
190
|
+
"name": "elements",
|
|
191
|
+
"type": {
|
|
192
|
+
"text": "Element[]"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"name": "tagName",
|
|
197
|
+
"type": {
|
|
198
|
+
"text": "string"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
],
|
|
202
|
+
"description": "Cerca ricorsivamente tag specifici tra gli elementi slottati e i loro discendenti light DOM."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"kind": "method",
|
|
206
|
+
"name": "_updateBackgroundInert",
|
|
207
|
+
"privacy": "private",
|
|
208
|
+
"return": {
|
|
209
|
+
"type": {
|
|
210
|
+
"text": "void"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"description": "Applica/rimuove `inert` sugli elementi slottati nel background slot.\nNecessario per Safari, che non rispetta `aria-hidden` sull'overlay\ne lascia interagibili gli elementi sotto il dimmer."
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"kind": "field",
|
|
217
|
+
"name": "_onBackgroundSlotChange",
|
|
218
|
+
"privacy": "private"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"kind": "field",
|
|
222
|
+
"name": "_onContentSlotChange",
|
|
223
|
+
"privacy": "private"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"kind": "field",
|
|
227
|
+
"name": "_dimmerClasses",
|
|
228
|
+
"privacy": "private",
|
|
229
|
+
"readonly": true
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"events": [
|
|
233
|
+
{
|
|
234
|
+
"name": "it-dimmer-show",
|
|
235
|
+
"type": {
|
|
236
|
+
"text": "CustomEvent"
|
|
237
|
+
},
|
|
238
|
+
"description": "Quando il dimmer diventa visibile"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "it-dimmer-hide",
|
|
242
|
+
"type": {
|
|
243
|
+
"text": "CustomEvent"
|
|
244
|
+
},
|
|
245
|
+
"description": "Quando il dimmer viene nascosto"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"attributes": [
|
|
249
|
+
{
|
|
250
|
+
"name": "active",
|
|
251
|
+
"type": {
|
|
252
|
+
"text": "boolean"
|
|
253
|
+
},
|
|
254
|
+
"default": "false",
|
|
255
|
+
"description": "Se `true`, il dimmer è visibile e oscura il contenuto di sfondo.",
|
|
256
|
+
"fieldName": "active"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "variant",
|
|
260
|
+
"type": {
|
|
261
|
+
"text": "DimmerVariant"
|
|
262
|
+
},
|
|
263
|
+
"default": "'primary'",
|
|
264
|
+
"description": "Variante cromatica del dimmer. Con `\"primary\"` lo sfondo è il colore primario;\ncon `\"dark\"` lo sfondo è il colore scuro standard; senza valore (default) usa il colore scuro.",
|
|
265
|
+
"fieldName": "variant"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
"name": "icon-name",
|
|
269
|
+
"type": {
|
|
270
|
+
"text": "string"
|
|
271
|
+
},
|
|
272
|
+
"default": "''",
|
|
273
|
+
"description": "Nome dell'icona Bootstrap Italia da mostrare nel dimmer (es. `\"it-info-circle\"`).\nSe valorizzato, viene renderizzata automaticamente una `<it-icon>` nella sezione `.dimmer-icon`.",
|
|
274
|
+
"fieldName": "iconName"
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"superclass": {
|
|
278
|
+
"name": "BaseComponent",
|
|
279
|
+
"package": "@italia/globals"
|
|
280
|
+
},
|
|
281
|
+
"tagName": "it-dimmer",
|
|
282
|
+
"customElement": true
|
|
283
|
+
}
|
|
284
|
+
],
|
|
285
|
+
"exports": [
|
|
286
|
+
{
|
|
287
|
+
"kind": "js",
|
|
288
|
+
"name": "ItDimmer",
|
|
289
|
+
"declaration": {
|
|
290
|
+
"name": "ItDimmer",
|
|
291
|
+
"module": "src/it-dimmer.ts"
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"kind": "custom-element-definition",
|
|
296
|
+
"name": "it-dimmer",
|
|
297
|
+
"declaration": {
|
|
298
|
+
"name": "ItDimmer",
|
|
299
|
+
"module": "src/it-dimmer.ts"
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"kind": "javascript-module",
|
|
306
|
+
"path": "src/types.ts",
|
|
307
|
+
"declarations": [
|
|
308
|
+
{
|
|
309
|
+
"kind": "variable",
|
|
310
|
+
"name": "DIMMER_VARIANTS",
|
|
311
|
+
"type": {
|
|
312
|
+
"text": "['primary', 'dark']"
|
|
313
|
+
},
|
|
314
|
+
"default": "['primary', 'dark']"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"exports": [
|
|
318
|
+
{
|
|
319
|
+
"kind": "js",
|
|
320
|
+
"name": "DIMMER_VARIANTS",
|
|
321
|
+
"declaration": {
|
|
322
|
+
"name": "DIMMER_VARIANTS",
|
|
323
|
+
"module": "src/types.ts"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
"kind": "javascript-module",
|
|
330
|
+
"path": "stories/it-dimmer.stories.ts",
|
|
331
|
+
"declarations": [
|
|
332
|
+
{
|
|
333
|
+
"kind": "variable",
|
|
334
|
+
"name": "meta",
|
|
335
|
+
"type": {
|
|
336
|
+
"text": "Meta<DimmerProps>"
|
|
337
|
+
},
|
|
338
|
+
"default": "{ title: 'Componenti/Dimmer', component: 'it-dimmer', tags: ['alpha', 'web-component'], parameters: { layout: 'padded', docs: { story: { inline: true, }, }, }, args: { active: false, variant: '', 'icon-name': '', contentText: 'Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras.', }, argTypes: { active: { control: 'boolean', description: 'Stato del dimmer (visibile/nascosto), il default è `false`', table: { defaultValue: { summary: 'false' } }, }, variant: { control: 'select', options: DIMMER_VARIANTS, description: 'Variante cromatica del dimmer, il default è primary', table: { defaultValue: { summary: \"''\" } }, }, 'icon-name': { control: 'text', description: 'Nome icona Bootstrap Italia da mostrare (es. `it-info-circle`)', table: { defaultValue: { summary: \"''\" } }, }, contentText: { table: { disable: true }, }, }, decorators: [(Story) => html` <div data-demo-wrapper>${Story()}</div> `], }"
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
"kind": "variable",
|
|
342
|
+
"name": "EsempioInterattivo",
|
|
343
|
+
"type": {
|
|
344
|
+
"text": "Story"
|
|
345
|
+
},
|
|
346
|
+
"default": "{ render: (args) => html` <it-dimmer ?active=\"${args.active}\" variant=\"${ifDefined(args.variant || undefined)}\" icon-name=\"${ifDefined(args['icon-name'] || undefined)}\" > <p slot=\"content\">${args.contentText}</p> ${backgroundCards} </it-dimmer> `, parameters: { docs: { canvas: { sourceState: 'hidden' }, }, }, }"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
"kind": "variable",
|
|
350
|
+
"name": "AttivoDefault",
|
|
351
|
+
"type": {
|
|
352
|
+
"text": "Story"
|
|
353
|
+
},
|
|
354
|
+
"default": "{ name: 'Attivo di default', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" icon-name=\"it-info-circle\" active> <p slot=\"content\">Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras.</p> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); // Usa show(), hide() o toggle() per controllare lo stato del dimmer document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer icon-name=\"it-info-circle\" active> <p slot=\"content\">Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras.</p> ${backgroundCards} </it-dimmer> `, }"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"kind": "variable",
|
|
358
|
+
"name": "ColorePrimario",
|
|
359
|
+
"type": {
|
|
360
|
+
"text": "Story"
|
|
361
|
+
},
|
|
362
|
+
"default": "{ name: 'Colore primario', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" active variant=\"primary\" icon-name=\"it-pa\"> <p slot=\"content\"> Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras. Dictum sit amet justo donec enim diam vulputate ut. Eu nisl nunc mi ipsum faucibus. Nulla vulputate luctus sem, eu maximus lacus faucibus eget. </p> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer active variant=\"primary\" icon-name=\"it-pa\"> <p slot=\"content\"> Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras. Dictum sit amet justo donec enim diam vulputate ut. Eu nisl nunc mi ipsum faucibus. Nulla vulputate luctus sem, eu maximus lacus faucibus eget. </p> ${backgroundCards} </it-dimmer> `, }"
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
"kind": "variable",
|
|
366
|
+
"name": "ColoreDark",
|
|
367
|
+
"type": {
|
|
368
|
+
"text": "Story"
|
|
369
|
+
},
|
|
370
|
+
"default": "{ name: 'Colore scuro', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" active variant=\"dark\" icon-name=\"it-pa\"> <p slot=\"content\"> Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras. Dictum sit amet justo donec enim diam vulputate ut. Eu nisl nunc mi ipsum faucibus. Nulla vulputate luctus sem, eu maximus lacus faucibus eget. </p> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer active variant=\"dark\" icon-name=\"it-pa\"> <p slot=\"content\"> Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras. Dictum sit amet justo donec enim diam vulputate ut. Eu nisl nunc mi ipsum faucibus. Nulla vulputate luctus sem, eu maximus lacus faucibus eget. </p> ${backgroundCards} </it-dimmer> `, }"
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
"kind": "variable",
|
|
374
|
+
"name": "ConAzioni",
|
|
375
|
+
"type": {
|
|
376
|
+
"text": "Story"
|
|
377
|
+
},
|
|
378
|
+
"default": "{ name: 'Con azioni', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" active variant=\"dark\" icon-name=\"it-info-circle\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <p>Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras.</p> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> <it-button variant=\"primary\" outline>Azione secondaria</it-button> </div> </div> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer active variant=\"dark\" icon-name=\"it-info-circle\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <p>Platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper dignissim cras.</p> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> <it-button variant=\"primary\" outline=\"\">Azione secondaria</it-button> </div> </div> ${backgroundCards} </it-dimmer> `, }"
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"kind": "variable",
|
|
382
|
+
"name": "ConAzioniPrimario",
|
|
383
|
+
"type": {
|
|
384
|
+
"text": "Story"
|
|
385
|
+
},
|
|
386
|
+
"default": "{ name: 'Con azioni - colore primario', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" active variant=\"primary\" icon-name=\"it-pa\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> <it-button variant=\"primary\" outline=\"\">Azione secondaria</it-button> </div> </div> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer active variant=\"primary\" icon-name=\"it-pa\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> <it-button variant=\"primary\" outline=\"\">Azione secondaria</it-button> </div> </div> ${backgroundCards} </it-dimmer> `, }"
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"kind": "variable",
|
|
390
|
+
"name": "ConAzioneSingola",
|
|
391
|
+
"type": {
|
|
392
|
+
"text": "Story"
|
|
393
|
+
},
|
|
394
|
+
"default": "{ name: 'Con azioni - azione singola', parameters: { docs: { source: { code: ` <div> <div class=\"mb-3\"> <it-button variant=\"primary\" id=\"btn-dimmer\">Toggle dimmer</it-button> </div> <it-dimmer id=\"dimmer\" active variant=\"primary\" icon-name=\"it-pa\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> </div> </div> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#dimmer'); document.querySelector('#btn-dimmer').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, render: () => html` <div class=\"mb-3\"> <it-button variant=\"primary\" @click=\"${toggleDimmer}\">Toggle dimmer</it-button> </div> <it-dimmer active variant=\"primary\" icon-name=\"it-pa\"> <div slot=\"content\"> <h4>Titolo Dimmer</h4> <div class=\"dimmer-buttons bg-dark\"> <it-button variant=\"primary\">Azione primaria</it-button> </div> </div> ${backgroundCards} </it-dimmer> `, }"
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"kind": "variable",
|
|
398
|
+
"name": "AttivazioneViaJS",
|
|
399
|
+
"type": {
|
|
400
|
+
"text": "Story"
|
|
401
|
+
},
|
|
402
|
+
"default": "{ name: 'Attivazione via JS', render: () => html` <div class=\"mb-3 d-flex gap-2\"> <it-button variant=\"primary\" @click=\"${showDimmer}\">show()</it-button> <it-button variant=\"primary\" outline=\"\" @click=\"${hideDimmer}\">hide()</it-button> <it-button variant=\"secondary\" outline=\"\" @click=\"${toggleDimmer}\">toggle()</it-button> </div> <it-dimmer id=\"js-dimmer\" icon-name=\"it-info-circle\"> <p slot=\"content\">Controllato via <code>show()</code>, <code>hide()</code> e <code>toggle()</code>.</p> ${backgroundCards} </it-dimmer> `, parameters: { docs: { source: { code: ` <div> <div class=\"mb-3 d-flex gap-2\"> <it-button variant=\"primary\" id=\"btn-show\">show()</it-button> <it-button variant=\"primary\" outline id=\"btn-hide\">hide()</it-button> <it-button variant=\"secondary\" outline id=\"btn-toggle\">toggle()</it-button> </div> <it-dimmer id=\"js-dimmer\" icon-name=\"it-info-circle\"> <p slot=\"content\">Controllato via show(), hide() e toggle().</p> <!-- contenuto di sfondo --> </it-dimmer> <script> const dimmer = document.querySelector('#js-dimmer'); document.querySelector('#btn-show').addEventListener('click', () => dimmer.show()); document.querySelector('#btn-hide').addEventListener('click', () => dimmer.hide()); document.querySelector('#btn-toggle').addEventListener('click', () => dimmer.toggle()); </script> </div> `, }, }, }, }"
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
"exports": [
|
|
406
|
+
{
|
|
407
|
+
"kind": "js",
|
|
408
|
+
"name": "default",
|
|
409
|
+
"declaration": {
|
|
410
|
+
"name": "meta",
|
|
411
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"kind": "js",
|
|
416
|
+
"name": "EsempioInterattivo",
|
|
417
|
+
"declaration": {
|
|
418
|
+
"name": "EsempioInterattivo",
|
|
419
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"kind": "js",
|
|
424
|
+
"name": "AttivoDefault",
|
|
425
|
+
"declaration": {
|
|
426
|
+
"name": "AttivoDefault",
|
|
427
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"kind": "js",
|
|
432
|
+
"name": "ColorePrimario",
|
|
433
|
+
"declaration": {
|
|
434
|
+
"name": "ColorePrimario",
|
|
435
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"kind": "js",
|
|
440
|
+
"name": "ColoreDark",
|
|
441
|
+
"declaration": {
|
|
442
|
+
"name": "ColoreDark",
|
|
443
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"kind": "js",
|
|
448
|
+
"name": "ConAzioni",
|
|
449
|
+
"declaration": {
|
|
450
|
+
"name": "ConAzioni",
|
|
451
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"kind": "js",
|
|
456
|
+
"name": "ConAzioniPrimario",
|
|
457
|
+
"declaration": {
|
|
458
|
+
"name": "ConAzioniPrimario",
|
|
459
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"kind": "js",
|
|
464
|
+
"name": "ConAzioneSingola",
|
|
465
|
+
"declaration": {
|
|
466
|
+
"name": "ConAzioneSingola",
|
|
467
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"kind": "js",
|
|
472
|
+
"name": "AttivazioneViaJS",
|
|
473
|
+
"declaration": {
|
|
474
|
+
"name": "AttivazioneViaJS",
|
|
475
|
+
"module": "stories/it-dimmer.stories.ts"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
]
|
|
481
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|