@italia/button 0.0.1-alpha.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.
package/AUTHORS ADDED
@@ -0,0 +1,3 @@
1
+ Copyright (c) 2025 Dipartimento per la trasformazione digitale - Presidenza del Consiglio dei Ministri
2
+
3
+ The version control system provides attribution for specific lines of code.
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,75 @@
1
+ # \<it-button>
2
+
3
+ This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i it-button
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import '@italia/it-button';
16
+ </script>
17
+
18
+ <it-button></it-button>
19
+ ```
20
+
21
+ ## Linting and formatting
22
+
23
+ To scan the project for linting and formatting errors, run
24
+
25
+ ```bash
26
+ npm run lint
27
+ ```
28
+
29
+ To automatically fix linting and formatting errors, run
30
+
31
+ ```bash
32
+ npm run format
33
+ ```
34
+
35
+ ## Testing with Web Test Runner
36
+
37
+ To execute a single test run:
38
+
39
+ ```bash
40
+ npm run test
41
+ ```
42
+
43
+ To run the tests in interactive watch mode run:
44
+
45
+ ```bash
46
+ npm run test:watch
47
+ ```
48
+
49
+ ## Demoing with Storybook
50
+
51
+ To run a local instance of Storybook for your component, run
52
+
53
+ ```bash
54
+ npm run storybook
55
+ ```
56
+
57
+ To build a production version of Storybook, run
58
+
59
+ ```bash
60
+ npm run storybook:build
61
+ ```
62
+
63
+ ## Tooling configs
64
+
65
+ For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
66
+
67
+ If you customize the configuration a lot, you can consider moving them to individual files.
68
+
69
+ ## Local Demo with `web-dev-server`
70
+
71
+ ```bash
72
+ npm start
73
+ ```
74
+
75
+ To run a local development server that serves the basic demo located in `demo/index.html`
@@ -0,0 +1,418 @@
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": "ItButton",
13
+ "declaration": {
14
+ "name": "ItButton",
15
+ "module": "./it-button.js"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "kind": "javascript-module",
22
+ "path": "src/it-button.ts",
23
+ "declarations": [
24
+ {
25
+ "kind": "class",
26
+ "description": "",
27
+ "name": "ItButton",
28
+ "members": [
29
+ {
30
+ "kind": "field",
31
+ "name": "formAssociated",
32
+ "static": true,
33
+ "readonly": true
34
+ },
35
+ {
36
+ "kind": "field",
37
+ "name": "_buttonClasses",
38
+ "type": {
39
+ "text": "string"
40
+ },
41
+ "privacy": "private",
42
+ "default": "''",
43
+ "attribute": "_buttonClasses"
44
+ },
45
+ {
46
+ "kind": "field",
47
+ "name": "type",
48
+ "type": {
49
+ "text": "string"
50
+ },
51
+ "default": "'button'",
52
+ "attribute": "type"
53
+ },
54
+ {
55
+ "kind": "field",
56
+ "name": "variant",
57
+ "type": {
58
+ "text": "Variants"
59
+ },
60
+ "default": "''",
61
+ "attribute": "variant"
62
+ },
63
+ {
64
+ "kind": "field",
65
+ "name": "size",
66
+ "type": {
67
+ "text": "Sizes"
68
+ },
69
+ "default": "''",
70
+ "attribute": "size"
71
+ },
72
+ {
73
+ "kind": "field",
74
+ "name": "outline",
75
+ "type": {
76
+ "text": "boolean"
77
+ },
78
+ "default": "false",
79
+ "attribute": "outline"
80
+ },
81
+ {
82
+ "kind": "field",
83
+ "name": "block",
84
+ "type": {
85
+ "text": "boolean"
86
+ },
87
+ "default": "false",
88
+ "attribute": "block"
89
+ },
90
+ {
91
+ "kind": "field",
92
+ "name": "icon",
93
+ "type": {
94
+ "text": "boolean"
95
+ },
96
+ "default": "false",
97
+ "attribute": "icon"
98
+ },
99
+ {
100
+ "kind": "field",
101
+ "name": "value",
102
+ "type": {
103
+ "text": "string"
104
+ },
105
+ "default": "''",
106
+ "attribute": "value"
107
+ },
108
+ {
109
+ "kind": "field",
110
+ "name": "internals",
111
+ "attribute": "internals"
112
+ },
113
+ {
114
+ "kind": "method",
115
+ "name": "surfaceSubmitEvent",
116
+ "parameters": [
117
+ {
118
+ "name": "event",
119
+ "type": {
120
+ "text": "any"
121
+ }
122
+ }
123
+ ]
124
+ },
125
+ {
126
+ "kind": "field",
127
+ "name": "form",
128
+ "readonly": true
129
+ }
130
+ ],
131
+ "attributes": [
132
+ {
133
+ "name": "_buttonClasses",
134
+ "type": {
135
+ "text": "string"
136
+ },
137
+ "default": "''",
138
+ "fieldName": "_buttonClasses"
139
+ },
140
+ {
141
+ "name": "type",
142
+ "type": {
143
+ "text": "string"
144
+ },
145
+ "default": "'button'",
146
+ "fieldName": "type"
147
+ },
148
+ {
149
+ "name": "variant",
150
+ "type": {
151
+ "text": "Variants"
152
+ },
153
+ "default": "''",
154
+ "fieldName": "variant"
155
+ },
156
+ {
157
+ "name": "size",
158
+ "type": {
159
+ "text": "Sizes"
160
+ },
161
+ "default": "''",
162
+ "fieldName": "size"
163
+ },
164
+ {
165
+ "name": "outline",
166
+ "type": {
167
+ "text": "boolean"
168
+ },
169
+ "default": "false",
170
+ "fieldName": "outline"
171
+ },
172
+ {
173
+ "name": "block",
174
+ "type": {
175
+ "text": "boolean"
176
+ },
177
+ "default": "false",
178
+ "fieldName": "block"
179
+ },
180
+ {
181
+ "name": "icon",
182
+ "type": {
183
+ "text": "boolean"
184
+ },
185
+ "default": "false",
186
+ "fieldName": "icon"
187
+ },
188
+ {
189
+ "name": "value",
190
+ "type": {
191
+ "text": "string"
192
+ },
193
+ "default": "''",
194
+ "fieldName": "value"
195
+ },
196
+ {
197
+ "name": "internals",
198
+ "fieldName": "internals"
199
+ }
200
+ ],
201
+ "superclass": {
202
+ "name": "BaseComponent",
203
+ "package": "@italia/globals"
204
+ },
205
+ "tagName": "it-button",
206
+ "customElement": true
207
+ }
208
+ ],
209
+ "exports": [
210
+ {
211
+ "kind": "js",
212
+ "name": "ItButton",
213
+ "declaration": {
214
+ "name": "ItButton",
215
+ "module": "src/it-button.ts"
216
+ }
217
+ },
218
+ {
219
+ "kind": "custom-element-definition",
220
+ "name": "it-button",
221
+ "declaration": {
222
+ "name": "ItButton",
223
+ "module": "src/it-button.ts"
224
+ }
225
+ }
226
+ ]
227
+ },
228
+ {
229
+ "kind": "javascript-module",
230
+ "path": "src/types.ts",
231
+ "declarations": [
232
+ {
233
+ "kind": "variable",
234
+ "name": "BUTTON_SIZES",
235
+ "type": {
236
+ "text": "array"
237
+ },
238
+ "default": "['lg', 'sm', 'xs']"
239
+ },
240
+ {
241
+ "kind": "variable",
242
+ "name": "BUTTON_VARIANTS",
243
+ "type": {
244
+ "text": "array"
245
+ },
246
+ "default": "['primary', 'secondary', 'success', 'danger', 'warning', 'link']"
247
+ }
248
+ ],
249
+ "exports": [
250
+ {
251
+ "kind": "js",
252
+ "name": "BUTTON_SIZES",
253
+ "declaration": {
254
+ "name": "BUTTON_SIZES",
255
+ "module": "src/types.ts"
256
+ }
257
+ },
258
+ {
259
+ "kind": "js",
260
+ "name": "BUTTON_VARIANTS",
261
+ "declaration": {
262
+ "name": "BUTTON_VARIANTS",
263
+ "module": "src/types.ts"
264
+ }
265
+ }
266
+ ]
267
+ },
268
+ {
269
+ "kind": "javascript-module",
270
+ "path": "stories/it-button.stories.ts",
271
+ "declarations": [
272
+ {
273
+ "kind": "variable",
274
+ "name": "meta",
275
+ "default": "{ title: 'Componenti/Button', tags: ['autodocs'], component: 'it-button', args: { slot: 'Testo del pulsante', variant: 'primary', size: undefined, block: false, outline: false, ariaDisabled: false, icon: false, type: 'button', value: '', }, argTypes: { variant: { control: 'select', description: 'Varianti di colore', options: BUTTON_VARIANTS, }, size: { control: 'select', description: 'Dimensione del pulsante', options: BUTTON_SIZES, }, block: { control: 'boolean', type: 'boolean', description: 'Quando abilitato, estende il componente Button fino a prendere tutta la larghezza disponibile', table: { defaultValue: { summary: 'false' } }, }, ariaDisabled: { control: 'boolean', type: 'boolean', name: 'aria-disabled', table: { defaultValue: { summary: 'false' } }, }, outline: { control: 'boolean', type: 'boolean', description: 'Applica il colore solamente al bordo, usando il colore di sfondo come colore interno del pulsante.', table: { defaultValue: { summary: 'false' } }, }, icon: { control: 'boolean', type: 'boolean', description: \"Se il pulsante mostra un'icona, è necessario aggiungere questo attributo.\", table: { defaultValue: { summary: 'false' } }, }, slot: { control: 'text', description: 'Testo del pulsante', }, type: { control: 'select', description: 'Tipologia di pulsante', options: ['button', 'submit', 'reset'], table: { defaultValue: { summary: 'button' } }, }, value: { control: 'text', }, }, parameters: { docs: { description: { component: ` <Description>Pulsante con etichetta di testo o icona che al click inizia un'azione o un evento.</Description> Per indicazioni su \"Come e Quando usarlo\" si fa riferimento alla [guida del design-system](https://designers.italia.it/design-system/componenti/buttons/). `, }, }, }, } satisfies Meta<ButtonProps>"
276
+ },
277
+ {
278
+ "kind": "variable",
279
+ "name": "EsempioInterattivo",
280
+ "type": {
281
+ "text": "Story"
282
+ },
283
+ "default": "{ ...meta, name: 'Esempio interattivo', args: { variant: 'primary', }, tags: ['!autodocs', '!dev'], parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, render: (params) => html` ${renderComponent({ ...params, })}`, }"
284
+ },
285
+ {
286
+ "kind": "variable",
287
+ "name": "PersonalizzazioneDegliStili",
288
+ "type": {
289
+ "text": "Story"
290
+ },
291
+ "default": "{ name: 'Personalizzazione degli stili', tags: ['!dev'], parameters: { viewMode: 'docs', // assicura che si apra la tab Docs anziché Canvas docs: { canvas: { hidden: true, sourceState: 'none' }, // nasconde solo il canvas nella docs page description: { story: ` Per la personalizzazione degli stili si può usare il selettore \\`::part\\` passando il valore \\`button\\`. [Vedi qui la guida dettagliata](/docs/personalizzazione-degli-stili--documentazione#selettore-part). `, }, }, }, render: () => html`<div class=\"hide-preview\"></div>`, }"
292
+ },
293
+ {
294
+ "kind": "variable",
295
+ "name": "VariantiColore",
296
+ "type": {
297
+ "text": "Story"
298
+ },
299
+ "default": "{ name: 'Varianti di colore', args: { slot: '' }, argTypes: { variant: { table: { disable: true, }, }, outline: { table: { disable: true, }, }, ariaDisabled: { table: { disable: true, }, }, }, parameters: { docs: { description: { story: ` Gli stili definiti da Bootstrap Italia utilizzano un naming consistente con Bootstrap, con alcune personalizzazioni. <div class=\"callout callout-success\"><div class=\"callout-inner\"><div class=\"callout-title\"><span class=\"text\">Accessibilità</span></div> <p> Le classi \\`.btn\\` e \\`.btn-\\` conferiscono agli elementi html l’aspetto visivo di un pulsante. Anche elementi \\`<a>\\` o \\`<span>\\` possono subire questa trasformazione provocando discrepanza tra ciò che si rappresenta e la funzione semantica dell’elemento. <br/> Questo può provocare complesse problematiche di accessibilità. <br/><br/> Dove il click sul pulsante non genera un cambio di pagina utilizzare esclusivamente il componente \\`<it-button>\\`. <br/><br/> Qualora non fosse possibile, è necessario applicare in modo appropriato l’attributo \\`role=\"button\"\\` per trasmetterne lo scopo alle tecnologie assistive.</p></div></div> #### Note sullo stato disabilitato I pulsanti disabilitati dovranno avere l'attributo \\`aria-disabled=\"true\"\\` per indicare lo stato dell’elemento alle tecnologie assistive. Quando si utilizza l'attributo \\`aria-disabled\\` è consigliato usare anche l'attributo \\`aria-describedby\\` (o un elemento all'interno del bottone con classe \\`.sr-only\\`) per informare tramite gli screen-reader il motivo per il quale il pulsante è disabilitato. <br/> E' sconsigliato l'uso dell'attributo \\`disabled\\`. `, }, }, }, render: (args) => html` ${renderVariant({ ...args, variant: 'primary' }, 'Primary')} ${renderVariant({ ...args, variant: 'secondary' }, 'Secondary')} ${renderVariant({ ...args, variant: 'success' }, 'Success')} ${renderVariant({ ...args, variant: 'danger' }, 'Danger')} ${renderVariant({ ...args, variant: 'warning' }, 'Warning')} ${renderVariant({ ...args, variant: 'link' }, 'Pulsante link')} `, }"
300
+ },
301
+ {
302
+ "kind": "variable",
303
+ "name": "VariantiDimensione",
304
+ "type": {
305
+ "text": "Story"
306
+ },
307
+ "default": "{ name: 'Varianti di dimensione', args: { slot: '' }, argTypes: { variant: { table: { disable: true, }, }, size: { table: { disable: true, }, }, block: { table: { disable: true, }, }, }, parameters: { docs: { description: { story: ` Per ottenere pulsanti di dimensione più grande o più piccola, è sufficiente utilizzare l'attributo \\`size\\` con i valori \\`lg\\` o \\`xs\\`. Utilizzando invece l'attributo \\`block\\` si ottengono pulsanti che prendono tutta l’ampiezza a loro disposizione, a seconda delle dimensioni del loro contenitore. `, }, }, }, render: (args) => html` ${renderSizeVariant({ ...args, size: 'lg' }, 'Large')} ${renderSizeVariant({ ...args }, 'Default')} ${renderSizeVariant({ ...args, size: 'xs' }, 'Extra Small')} <div class=\"flex\"> ${renderComponent( { ...args, block: true, variant: 'primary', }, 'Primary Block', )} </div> <div class=\"flex\"> ${renderComponent( { ...args, block: true, variant: 'secondary', }, 'Secondary Block', )} </div> `, }"
308
+ },
309
+ {
310
+ "kind": "variable",
311
+ "name": "Tipologie",
312
+ "type": {
313
+ "text": "Story"
314
+ },
315
+ "default": "{ ...meta, // name: 'Tipologie', args: { variant: 'primary', }, render: (params) => html` <div class=\"flex\"> ${renderComponent({ ...params, slot: `Button - ${params.slot}`, type: 'button', })} ${renderComponent({ ...params, slot: `Submit - ${params.slot}`, type: 'submit', })} ${renderComponent({ ...params, slot: `Reset - ${params.slot}`, type: 'reset', })} </div> `, }"
316
+ },
317
+ {
318
+ "kind": "variable",
319
+ "name": "SfondoScuro",
320
+ "type": {
321
+ "text": "Story"
322
+ },
323
+ "default": "{ name: 'Sfondo scuro', args: { slot: '' }, argTypes: { variant: { table: { disable: true, }, }, outline: { table: { disable: true, }, }, ariaDisabled: { table: { disable: true, }, }, }, parameters: { docs: { description: { story: ` <div class=\"callout callout-success\"><div class=\"callout-inner\"><div class=\"callout-title\"><span class=\"text\">Trasmettere significato alle tecnologie assistive</span></div> <p> L’uso del colore per aggiungere un significato fornisce solo un’indicazione visiva, che non sarà trasmesso agli utenti di tecnologie assistive – come gli screen reader. Assicurati che le informazioni denotate dal colore siano rese disponibili anche dal contenuto stesso (es.: il testo visibile), o siano incluse attraverso mezzi alternativi, come testo aggiuntivo nascosto con la classe <code>.visually-hidden</code>.</p></div></div>`, }, }, }, render: (args) => html` <div class=\"bg-dark p-4\"> ${renderVariant({ ...args, variant: 'primary' }, 'Primary')} ${renderVariant({ ...args, variant: 'secondary' }, 'Secondary')} ${renderVariant({ ...args, variant: 'link' }, 'Pulsante link')} </div> `, }"
324
+ },
325
+ {
326
+ "kind": "variable",
327
+ "name": "ConIcona",
328
+ "type": {
329
+ "text": "Story"
330
+ },
331
+ "default": "{ ...meta, name: 'Con icona', args: {}, argTypes: { variant: { table: { disable: true, }, }, size: { table: { disable: true, }, }, }, parameters: { docs: { description: { story: ` E' necessario passare l'attributo \\`icon=\"true\"\\` (o \\`icon=\"\"\\`, o semplicemente \\`icon\\`) a \\`<it-button>\\` per applicargli gli stili corretti. L’icona può essere posizionata a sinistra o a destra del testo, a seconda della posizione in cui viene inserita all’interno del pulsante. <br/><br/> #### Dimensione dell'icona - Nei pulsanti di dimensione \\`lg\\` o default (\\`sm\\`), è necessario passare l'attributo \\`size=\"sm\"\\` all'icona. - Nei pulsanti di dimensione \\`xs\\`, è necessario passare l'attributo \\`size=\"xs\"\\` all'icona . #### Allineamento e spaziatura dell’icona Nel caso si utilizzi un’icona all’interno di un elemento \\`<it-button>\\` è necessario inserire il testo del pulsante all’interno di un tag \\`<span/>\\` al fine di garantire un perfetto allineamento ed una corretta spaziatura tra l’icona e lo stesso testo. <div class=\"callout callout-success\"><div class=\"callout-inner\"><div class=\"callout-title\"><span class=\"text\">Accessibilità</span></div> <p> Le icone sono di default puramente decorative. Nel caso in cui l'icona non debba essere un elemento decorativo, è necessario utilizzare correttamente gli attributi \\`label\\`, \\`role\\` e \\`aria-hidden\\` sul componente \\`<it-icon>\\`. Per maggiori dettagli visita la [guida dedicata](?path=/docs/componenti-icon--documentazione) al componente \\`<it-icon>\\`.</p></div></div> `, }, }, }, render: (params) => { const slot = params.slot?.length > 0 ? params.slot : null; return html` <div class=\"flex\"> <it-button variant=\"success\" size=\"lg\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <it-icon name=\"it-star-full\" color=\"white\" size=\"sm\"></it-icon> <span>${slot ?? 'Pulsante Large con icona'}</span> </it-button> <it-button variant=\"primary\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <it-icon name=\"it-star-full\" color=\"white\" size=\"sm\"></it-icon> <span>${slot ?? 'Pulsante con icona'}</span> </it-button> <it-button variant=\"danger\" size=\"xs\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <it-icon name=\"it-star-full\" color=\"white\" size=\"xs\"></it-icon> <span>${slot ?? 'Pulsante Extra Small con icona'}</span> </it-button> <it-button variant=\"link\" size=\"xs\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <it-icon name=\"it-star-full\" color=\"primary\" size=\"xs\"></it-icon> <span>${slot ?? 'Pulsante Link Extra Small con icona'}</span> </it-button> </div>`; }, }"
332
+ },
333
+ {
334
+ "kind": "variable",
335
+ "name": "ConIconaCerchiata",
336
+ "type": {
337
+ "text": "Story"
338
+ },
339
+ "default": "{ ...meta, name: 'Con icona cerchiata', args: {}, argTypes: { variant: { table: { disable: true, }, }, size: { table: { disable: true, }, }, }, parameters: { docs: { description: { story: ` E' necessario passare l'attributo \\`icon=\"true\"\\` (o \\`icon=\"\"\\`, o semplicemente \\`icon\\`) a \\`<it-button>\\` per applicargli gli stili corretti. L’icona può essere posizionata a sinistra o a destra del testo, a seconda della posizione in cui viene inserita all’interno del pulsante. <br/>Deve essere contenuta all'interno di uno elemento con classe\\`.rounded-icon\\` per poter avere il contorno circolare. <br/><br/> #### Dimensione dell'icona La dimensione dell'icona deve sempre essere \\`xs\\`, quindi \\`<it-icon>\\` deve avere sempre l'attributo \\`size=\"xs\"\\`. `, }, }, }, render: (params) => { const slot = params.slot?.length > 0 ? params.slot : null; return html` <it-button class=\"me-2\" variant=\"success\" size=\"lg\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <span class=\"rounded-icon\"> <it-icon name=\"it-user\" color=\"success\" size=\"xs\"></it-icon> </span> <span>${slot ?? 'Pulsante Large con icona'}</span> </it-button> <it-button class=\"me-2\" variant=\"primary\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <span class=\"rounded-icon\" size=\"sm\"> <it-icon name=\"it-user\" color=\"primary\" size=\"xs\"></it-icon> </span> <span>${slot ?? 'Pulsante con icona'}</span> </it-button> <it-button class=\"me-2\" variant=\"danger\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <span class=\"rounded-icon\"> <it-icon name=\"it-user\" color=\"danger\" size=\"xs\"></it-icon> </span> <span>${slot ?? 'Pulsante Small con icona'}</span> </it-button> <it-button class=\"me-2\" variant=\"secondary\" size=\"xs\" icon ?outline=\"${params.outline}\" ?block=\"${params.block}\" ?aria-disabled=\"${params.ariaDisabled}\" type=\"${params.type}\" > <span class=\"rounded-icon\"> <it-icon name=\"it-user\" color=\"secondary\" size=\"xs\"></it-icon> </span> <span>${slot ?? 'Pulsante Link Extra Small con icona'}</span> </it-button> `; }, }"
340
+ }
341
+ ],
342
+ "exports": [
343
+ {
344
+ "kind": "js",
345
+ "name": "default",
346
+ "declaration": {
347
+ "name": "meta",
348
+ "module": "stories/it-button.stories.ts"
349
+ }
350
+ },
351
+ {
352
+ "kind": "js",
353
+ "name": "EsempioInterattivo",
354
+ "declaration": {
355
+ "name": "EsempioInterattivo",
356
+ "module": "stories/it-button.stories.ts"
357
+ }
358
+ },
359
+ {
360
+ "kind": "js",
361
+ "name": "PersonalizzazioneDegliStili",
362
+ "declaration": {
363
+ "name": "PersonalizzazioneDegliStili",
364
+ "module": "stories/it-button.stories.ts"
365
+ }
366
+ },
367
+ {
368
+ "kind": "js",
369
+ "name": "VariantiColore",
370
+ "declaration": {
371
+ "name": "VariantiColore",
372
+ "module": "stories/it-button.stories.ts"
373
+ }
374
+ },
375
+ {
376
+ "kind": "js",
377
+ "name": "VariantiDimensione",
378
+ "declaration": {
379
+ "name": "VariantiDimensione",
380
+ "module": "stories/it-button.stories.ts"
381
+ }
382
+ },
383
+ {
384
+ "kind": "js",
385
+ "name": "Tipologie",
386
+ "declaration": {
387
+ "name": "Tipologie",
388
+ "module": "stories/it-button.stories.ts"
389
+ }
390
+ },
391
+ {
392
+ "kind": "js",
393
+ "name": "SfondoScuro",
394
+ "declaration": {
395
+ "name": "SfondoScuro",
396
+ "module": "stories/it-button.stories.ts"
397
+ }
398
+ },
399
+ {
400
+ "kind": "js",
401
+ "name": "ConIcona",
402
+ "declaration": {
403
+ "name": "ConIcona",
404
+ "module": "stories/it-button.stories.ts"
405
+ }
406
+ },
407
+ {
408
+ "kind": "js",
409
+ "name": "ConIconaCerchiata",
410
+ "declaration": {
411
+ "name": "ConIconaCerchiata",
412
+ "module": "stories/it-button.stories.ts"
413
+ }
414
+ }
415
+ ]
416
+ }
417
+ ]
418
+ }
@@ -0,0 +1,2 @@
1
+ export { ItButton } from './it-button.js';
2
+ //# 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,QAAQ,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { ItButton } from './it-button.js';
2
+ import 'lit/directive.js';
3
+ import 'lit';
4
+ import 'lit/decorators.js';
5
+ import 'lit/directives/if-defined.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,28 @@
1
+ import { BaseComponent } from '@italia/globals';
2
+ import { PropertyValues } from 'lit';
3
+ import { type Sizes, type Variants } from './types.js';
4
+ export declare class ItButton extends BaseComponent {
5
+ static styles: import("lit").CSSResultGroup;
6
+ static get formAssociated(): boolean;
7
+ private _buttonClasses;
8
+ type: string;
9
+ variant: Variants;
10
+ size: Sizes;
11
+ outline: boolean;
12
+ block: boolean;
13
+ icon: boolean;
14
+ value: string;
15
+ internals: ElementInternals;
16
+ protected firstUpdated(_changedProperties: PropertyValues): void;
17
+ updated(): void;
18
+ surfaceSubmitEvent(event: any): void;
19
+ get form(): HTMLFormElement | null;
20
+ connectedCallback(): void;
21
+ render(): import("lit").TemplateResult<1>;
22
+ }
23
+ declare global {
24
+ interface HTMLElementTagNameMap {
25
+ 'it-button': ItButton;
26
+ }
27
+ }
28
+ //# sourceMappingURL=it-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-button.d.ts","sourceRoot":"","sources":["../../src/it-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAiB,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAQ,cAAc,EAAE,MAAM,KAAK,CAAC;AAG3C,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGvD,qBACa,QAAS,SAAQ,aAAa;IACzC,MAAM,CAAC,MAAM,+BAAU;IAEvB,MAAM,KAAK,cAAc,YAExB;IAGD,OAAO,CAAC,cAAc,CAAM;IAG5B,IAAI,SAAY;IAGhB,OAAO,EAAE,QAAQ,CAAM;IAGvB,IAAI,EAAE,KAAK,CAAM;IAGjB,OAAO,UAAS;IAGhB,KAAK,UAAS;IAGd,IAAI,UAAS;IAGb,KAAK,SAAM;IAGX,SAAS,mBAA0B;cAGhB,YAAY,CAAC,kBAAkB,EAAE,cAAc,GAAG,IAAI;IAOhE,OAAO;IAYhB,kBAAkB,CAAC,KAAK,EAAE,GAAG;IAa7B,IAAI,IAAI,2BAEP;IAED,iBAAiB,IAAI,IAAI;IAShB,MAAM;CAmBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}