@italia/chip 0.1.0-alpha.2

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-chip>
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-chip
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import '@italia/it-chip';
16
+ </script>
17
+
18
+ <it-chip></it-chip>
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,467 @@
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": "ItChip",
13
+ "declaration": {
14
+ "name": "ItChip",
15
+ "module": "./it-chip.js"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "kind": "javascript-module",
22
+ "path": "src/it-chip.ts",
23
+ "declarations": [
24
+ {
25
+ "kind": "class",
26
+ "description": "",
27
+ "name": "ItChip",
28
+ "members": [
29
+ {
30
+ "kind": "field",
31
+ "name": "dismissable",
32
+ "type": {
33
+ "text": "boolean"
34
+ },
35
+ "default": "false",
36
+ "attribute": "dismissable",
37
+ "reflects": true
38
+ },
39
+ {
40
+ "kind": "field",
41
+ "name": "size",
42
+ "type": {
43
+ "text": "ChipSize"
44
+ },
45
+ "default": "'sm'",
46
+ "attribute": "size",
47
+ "reflects": true
48
+ },
49
+ {
50
+ "kind": "field",
51
+ "name": "avatar",
52
+ "type": {
53
+ "text": "string"
54
+ },
55
+ "default": "''",
56
+ "attribute": "avatar",
57
+ "reflects": true
58
+ },
59
+ {
60
+ "kind": "field",
61
+ "name": "avatarAlt",
62
+ "type": {
63
+ "text": "string"
64
+ },
65
+ "default": "''",
66
+ "attribute": "avatar-alt",
67
+ "reflects": true
68
+ },
69
+ {
70
+ "kind": "field",
71
+ "name": "label",
72
+ "type": {
73
+ "text": "string"
74
+ },
75
+ "default": "''",
76
+ "attribute": "label",
77
+ "reflects": true
78
+ },
79
+ {
80
+ "kind": "field",
81
+ "name": "href",
82
+ "type": {
83
+ "text": "string"
84
+ },
85
+ "default": "''",
86
+ "attribute": "href",
87
+ "reflects": true
88
+ },
89
+ {
90
+ "kind": "field",
91
+ "name": "a11yDescription",
92
+ "type": {
93
+ "text": "string"
94
+ },
95
+ "default": "''",
96
+ "attribute": "a11y-description",
97
+ "reflects": true
98
+ },
99
+ {
100
+ "kind": "field",
101
+ "name": "variant",
102
+ "type": {
103
+ "text": "ChipVariant"
104
+ },
105
+ "default": "''",
106
+ "attribute": "variant",
107
+ "reflects": true
108
+ },
109
+ {
110
+ "kind": "field",
111
+ "name": "isDisabled",
112
+ "type": {
113
+ "text": "boolean"
114
+ },
115
+ "default": "false",
116
+ "attribute": "is-disabled",
117
+ "reflects": true
118
+ },
119
+ {
120
+ "kind": "field",
121
+ "name": "closeButton",
122
+ "type": {
123
+ "text": "HTMLButtonElement[]"
124
+ }
125
+ },
126
+ {
127
+ "kind": "field",
128
+ "name": "icon",
129
+ "type": {
130
+ "text": "ItIcon[]"
131
+ }
132
+ },
133
+ {
134
+ "kind": "method",
135
+ "name": "getAvatarSize",
136
+ "privacy": "private"
137
+ },
138
+ {
139
+ "kind": "method",
140
+ "name": "updateIcon",
141
+ "privacy": "private"
142
+ }
143
+ ],
144
+ "attributes": [
145
+ {
146
+ "name": "dismissable",
147
+ "type": {
148
+ "text": "boolean"
149
+ },
150
+ "default": "false",
151
+ "fieldName": "dismissable"
152
+ },
153
+ {
154
+ "name": "size",
155
+ "type": {
156
+ "text": "ChipSize"
157
+ },
158
+ "default": "'sm'",
159
+ "fieldName": "size"
160
+ },
161
+ {
162
+ "name": "avatar",
163
+ "type": {
164
+ "text": "string"
165
+ },
166
+ "default": "''",
167
+ "fieldName": "avatar"
168
+ },
169
+ {
170
+ "name": "avatar-alt",
171
+ "type": {
172
+ "text": "string"
173
+ },
174
+ "default": "''",
175
+ "fieldName": "avatarAlt"
176
+ },
177
+ {
178
+ "name": "label",
179
+ "type": {
180
+ "text": "string"
181
+ },
182
+ "default": "''",
183
+ "fieldName": "label"
184
+ },
185
+ {
186
+ "name": "href",
187
+ "type": {
188
+ "text": "string"
189
+ },
190
+ "default": "''",
191
+ "fieldName": "href"
192
+ },
193
+ {
194
+ "name": "a11y-description",
195
+ "type": {
196
+ "text": "string"
197
+ },
198
+ "default": "''",
199
+ "fieldName": "a11yDescription"
200
+ },
201
+ {
202
+ "name": "variant",
203
+ "type": {
204
+ "text": "ChipVariant"
205
+ },
206
+ "default": "''",
207
+ "fieldName": "variant"
208
+ },
209
+ {
210
+ "name": "is-disabled",
211
+ "type": {
212
+ "text": "boolean"
213
+ },
214
+ "default": "false",
215
+ "fieldName": "isDisabled"
216
+ }
217
+ ],
218
+ "superclass": {
219
+ "name": "BaseComponent",
220
+ "package": "@italia/globals"
221
+ },
222
+ "tagName": "it-chip",
223
+ "customElement": true
224
+ }
225
+ ],
226
+ "exports": [
227
+ {
228
+ "kind": "js",
229
+ "name": "ItChip",
230
+ "declaration": {
231
+ "name": "ItChip",
232
+ "module": "src/it-chip.ts"
233
+ }
234
+ },
235
+ {
236
+ "kind": "custom-element-definition",
237
+ "name": "it-chip",
238
+ "declaration": {
239
+ "name": "ItChip",
240
+ "module": "src/it-chip.ts"
241
+ }
242
+ }
243
+ ]
244
+ },
245
+ {
246
+ "kind": "javascript-module",
247
+ "path": "src/types.ts",
248
+ "declarations": [
249
+ {
250
+ "kind": "variable",
251
+ "name": "CHIP_VARIANTS",
252
+ "type": {
253
+ "text": "['primary', 'secondary', 'success', 'danger', 'warning', '']"
254
+ },
255
+ "default": "['primary', 'secondary', 'success', 'danger', 'warning', '']"
256
+ },
257
+ {
258
+ "kind": "variable",
259
+ "name": "CHIP_SIZES",
260
+ "type": {
261
+ "text": "['sm', 'lg']"
262
+ },
263
+ "default": "['sm', 'lg']"
264
+ }
265
+ ],
266
+ "exports": [
267
+ {
268
+ "kind": "js",
269
+ "name": "CHIP_VARIANTS",
270
+ "declaration": {
271
+ "name": "CHIP_VARIANTS",
272
+ "module": "src/types.ts"
273
+ }
274
+ },
275
+ {
276
+ "kind": "js",
277
+ "name": "CHIP_SIZES",
278
+ "declaration": {
279
+ "name": "CHIP_SIZES",
280
+ "module": "src/types.ts"
281
+ }
282
+ }
283
+ ]
284
+ },
285
+ {
286
+ "kind": "javascript-module",
287
+ "path": "stories/it-chip.stories.ts",
288
+ "declarations": [
289
+ {
290
+ "kind": "variable",
291
+ "name": "meta",
292
+ "default": "{ title: 'Componenti/Chip', component: 'it-chip', tags: ['autodocs'], args: { size: 'sm', label: 'Etichetta', href: undefined, variant: 'primary', isDisabled: false, avatar: '', avatarAlt: 'Avatar', a11yDescription: '', dismissable: false, withIcon: false, withDismissButton: false, }, argTypes: { size: { control: 'select', description: 'Dimensione del chip (`sm` o `lg`).', options: CHIP_SIZES, table: { defaultValue: { summary: 'sm' } }, }, label: { control: 'text', description: \"Testo mostrato all'interno della chip.\", }, href: { control: 'text', description: 'Se valorizzato, la chip sarà un link (elemento `<a>`).', }, variant: { control: 'select', description: 'Colore della chip, secondo le varianti di Bootstrap Italia.', options: CHIP_VARIANTS, }, dismissable: { control: 'boolean', description: \"Indica che la chip può essere chiusa, ma non inserisce alcun pulsante automaticamente. Il pulsante deve essere inserito nello slot `dismiss-button` dall'utilizzatore, comprensivo di eventuale JavaScript per handling di eventi. Per un esempio completo con Javascript, vedi la story [Chip con chiusura](?path=/story/componenti-chip--chip-con-chiusura).\", table: { defaultValue: { summary: 'false' } }, }, isDisabled: { control: 'boolean', description: 'Disabilita la chip. Utile in contesti non interattivi o di sola lettura.', table: { defaultValue: { summary: 'false' } }, }, avatar: { control: 'text', description: `Percorso a un'immagine da mostrare come avatar, es. [randomuser.me](https://randomuser.me/api/portraits/men/46.jpg).`, table: { defaultValue: { summary: 'https://randomuser.me/api/portraits/men/46.jpg' } }, }, avatarAlt: { control: 'text', description: `Testo alternativo per l'immagine dell'avatar, utile per l'accessibilità.`, table: { defaultValue: { summary: 'Alt avatar' } }, }, a11yDescription: { control: 'text', description: `Testo descrittivo aggiuntivo per la chip, utile per l'accessibilità. Viene inserito come contenuto visivamente nascosto all'inizio della chip, ad esempio per specificare a che contenuto si fa riferimento, o assegnare una dicitur come \"Argomento:\".`, table: { defaultValue: { summary: '' } }, }, withIcon: { control: 'boolean', description: \"Simula la presenza di un'icona nella chip. Non è una proprietà del componente, ma serve per mostrare composizioni nel playground interattivo.\", }, withDismissButton: { control: 'boolean', description: 'Simula la presenza di un pulsante di rimozione nella chip. Non è una proprietà del componente, ma serve per mostrare composizioni nel playground interattivo.', }, }, parameters: { docs: { description: { component: ` <Description>Elementi compatti che rappresentano un input, attributo o azione.</Description> Il componente \\`<it-chip>\\` si compone principalmente di una label testuale e, opzionalmente, di: - un avatar (immagine) a sinistra, tramite la proprietà \\`avatar\\`; - un'icona inserita nello slot \\`icon\\`; - un pulsante di chiusura nello slot \\`dismiss-button\\`, per le chip cancellabili/rimuovibili (la logica di rimozione è a carico dell'utilizzatore, vedi sezione dedicata). Per indicazioni su \"Come e Quando usarlo\" si fa riferimento alla [guida del design-system](https://designers.italia.it/design-system/componenti/chips/). `, }, }, }, } satisfies Meta< ChipProps & { withIcon?: boolean; withDismissButton?: boolean; } >"
293
+ },
294
+ {
295
+ "kind": "variable",
296
+ "name": "EsempioInterattivo",
297
+ "type": {
298
+ "text": "Story"
299
+ },
300
+ "default": "{ ...meta, name: 'Esempio interattivo', args: { variant: 'primary', }, tags: ['!autodocs', '!dev'], parameters: { docs: { canvas: { sourceState: 'shown', }, }, }, render: (params) => html`${renderComponent(params)}`, }"
301
+ },
302
+ {
303
+ "kind": "variable",
304
+ "name": "PersonalizzazioneDegliStili",
305
+ "type": {
306
+ "text": "Story"
307
+ },
308
+ "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 \\`chip\\`. [Vedi qui la guida dettagliata](/docs/personalizzazione-degli-stili--documentazione#selettore-part). `, }, }, }, render: () => html`<div class=\"hide-preview\"></div>`, }"
309
+ },
310
+ {
311
+ "kind": "variable",
312
+ "name": "VarianteConLink",
313
+ "type": {
314
+ "text": "Story"
315
+ },
316
+ "default": "{ name: 'Variante con link', args: { size: 'sm', variant: '', href: '#', }, render: () => html` <it-chip label=\"Etichetta\" size=\"sm\" variant=\"\" href=\"#\"></it-chip> `, }"
317
+ },
318
+ {
319
+ "kind": "variable",
320
+ "name": "VariantiColore",
321
+ "type": {
322
+ "text": "Story"
323
+ },
324
+ "default": "{ name: 'Varianti di colore', args: { label: 'Etichetta', size: 'sm', dismissable: false }, parameters: { docs: { description: { story: ` Gli stili definiti da Bootstrap Italia utilizzano un naming consistente con Bootstrap, con alcune personalizzazioni: `, }, }, }, render: () => html` <div style=\"display: flex; gap: 1rem; flex-wrap: wrap;\"> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"primary\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"secondary\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"success\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"danger\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"warning\"></it-chip> </div> `, }"
325
+ },
326
+ {
327
+ "kind": "variable",
328
+ "name": "VariantiColoreLink",
329
+ "type": {
330
+ "text": "Story"
331
+ },
332
+ "default": "{ name: 'Varianti di colore link', args: { label: 'Etichetta', size: 'sm', dismissable: false }, parameters: { docs: { description: { story: ` `, }, }, }, render: () => html` <div style=\"display: flex; gap: 1rem; flex-wrap: wrap;\"> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"primary\" href=\"#\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"secondary\" href=\"#\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"success\" href=\"#\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"danger\" href=\"#\"></it-chip> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"warning\" href=\"#\"></it-chip> </div> `, }"
333
+ },
334
+ {
335
+ "kind": "variable",
336
+ "name": "VariantiDimensione",
337
+ "type": {
338
+ "text": "Story"
339
+ },
340
+ "default": "{ name: 'Varianti di dimensione', args: { size: 'sm', variant: '', dismissable: true, }, render: () => html` <div style=\"display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;\"> <it-chip label=\"Etichetta\" size=\"sm\" variant=\"\" dismissable></it-chip> <it-chip label=\"Etichetta\" size=\"lg\" variant=\"\" dismissable></it-chip> </div> `, }"
341
+ },
342
+ {
343
+ "kind": "variable",
344
+ "name": "ChipConChiusura",
345
+ "type": {
346
+ "text": "Story"
347
+ },
348
+ "default": "{ name: 'Chip con chiusura', render: () => html` <it-chip label=\"Etichetta\" size=\"sm\" variant=\"primary\" dismissable id=\"chip-dismissable\"> <it-button slot=\"dismiss-button\" icon it-aria-label=\"Elimina etichetta\" it-aria-description=\"Puoi premere per eliminare la chip.\" @click=${(e: Event) => { const chip = (e.currentTarget as HTMLElement).closest('it-chip'); if (chip) chip.remove(); }} @keydown=${(e: KeyboardEvent) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); const chip = (e.currentTarget as HTMLElement).closest('it-chip'); if (chip) chip.remove(); } }} > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> `, parameters: { docs: { canvas: { sourceState: 'shown', }, description: { story: ` Questa composizione mostra una chip con funzionalità di chiusura. La proprietà \\`dismissable\\` **non aggiunge automaticamente il pulsante**: è responsabilità dell'utilizzatore fornire un \\`<it-button>\\` con \\`slot=\"dismiss-button\"\\` e logica di rimozione/logiche di esecuzione. L'icona di chiusura deve avere dimensione \\`sm\\` per rispettare il design. Il codice JS dell'esempio gestisce la rimozione della chip sia via click che via tastiera (\\`Enter\\` o \\`Spazio\\`). `, }, source: { code: `<it-chip label=\"Etichetta\" size=\"sm\" variant=\"primary\" dismissable id=\"chip-dismissable\"> <it-button slot=\"dismiss-button\" icon it-aria-label=\"Elimina etichetta\" it-aria-description=\"Puoi premere per eliminare la chip.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> <script type=\"module\"> const dismissButtons = document.querySelectorAll('it-chip#chip-dismissable [slot=\"dismiss-button\"]'); dismissButtons.forEach((btn) => { const removeChip = (e) => { const chip = btn.closest('it-chip'); if (chip) chip.remove(); }; btn.addEventListener('click', removeChip); btn.addEventListener('keydown', (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); removeChip(e); } }); }); </script> `, language: 'html', }, }, }, }"
349
+ },
350
+ {
351
+ "kind": "variable",
352
+ "name": "ChipDisabilitata",
353
+ "type": {
354
+ "text": "Story"
355
+ },
356
+ "default": "{ name: 'Chip disabilitata', args: { isDisabled: true, }, parameters: { docs: { description: { story: ` Aggiungendo l'attributo \\`is-disabled\\` si ottiene una chip disabilitata. `, }, }, }, render: (args) => html` <it-chip label=\"Etichetta\" size=\"sm\" variant=\"${args.variant}\" dismissable is-disabled> <it-button slot=\"dismiss-button\" icon it-aria-label=\"Elimina etichetta\" it-aria-disabled=\"true\" it-aria-description=\"Questa chip è disabilitata e non può essere rimossa.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> `, }"
357
+ },
358
+ {
359
+ "kind": "variable",
360
+ "name": "ChipConAvatar",
361
+ "type": {
362
+ "text": "Story"
363
+ },
364
+ "default": "{ name: 'Chip con avatar', parameters: { docs: { description: { story: ` Le chip possono includere un avatar utilizzando gli attributi \\`avatar\\` e \\`avatar-alt\\`. `, }, }, }, render: () => html` <div class=\"d-flex gap-2 flex-wrap align-items-center\"> <it-chip label=\"Mario Rossi\" size=\"sm\" variant=\"primary\" avatar=\"https://randomuser.me/api/portraits/men/46.jpg\" avatar-alt=\"Mario Rossi\" dismissable > <it-button slot=\"dismiss-button\" icon it-aria-label=\"Rimuovi Mario Rossi\" it-aria-description=\"Puoi premere per rimuovere questo utente.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> <it-chip label=\"Anna Verdi\" size=\"lg\" variant=\"secondary\" avatar=\"https://randomuser.me/api/portraits/women/32.jpg\" avatar-alt=\"Anna Verdi\" dismissable > <it-button slot=\"dismiss-button\" icon it-aria-label=\"Rimuovi Anna Verdi\" it-aria-description=\"Puoi premere per rimuovere questo utente.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> </div> `, }"
365
+ },
366
+ {
367
+ "kind": "variable",
368
+ "name": "ChipConIcona",
369
+ "type": {
370
+ "text": "Story"
371
+ },
372
+ "default": "{ name: 'Chip con icona', parameters: { docs: { description: { story: ` Le chip possono includere un'icona utilizzando lo slot \\`icon\\` con il componente it-icon. `, }, }, }, render: () => html` <div class=\"d-flex gap-2 flex-wrap align-items-center\"> <it-chip label=\"Download\" size=\"sm\" variant=\"primary\" dismissable> <it-icon slot=\"icon\" name=\"it-download\"></it-icon> <it-button slot=\"dismiss-button\" icon it-aria-label=\"Rimuovi download\" it-aria-description=\"Puoi premere per rimuovere questa azione.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> <it-chip label=\"Carica file\" size=\"lg\" variant=\"success\" dismissable> <it-icon slot=\"icon\" name=\"it-upload\"></it-icon> <it-button slot=\"dismiss-button\" icon it-aria-label=\"Rimuovi carica file\" it-aria-description=\"Puoi premere per rimuovere questa azione.\" > <it-icon name=\"it-close\" size=\"sm\"></it-icon> </it-button> </it-chip> <it-chip href=\"#\" label=\"Preferiti\" size=\"sm\" variant=\"warning\"> <it-icon slot=\"icon\" name=\"it-star-full\"></it-icon> </it-chip> </div> `, }"
373
+ }
374
+ ],
375
+ "exports": [
376
+ {
377
+ "kind": "js",
378
+ "name": "default",
379
+ "declaration": {
380
+ "name": "meta",
381
+ "module": "stories/it-chip.stories.ts"
382
+ }
383
+ },
384
+ {
385
+ "kind": "js",
386
+ "name": "EsempioInterattivo",
387
+ "declaration": {
388
+ "name": "EsempioInterattivo",
389
+ "module": "stories/it-chip.stories.ts"
390
+ }
391
+ },
392
+ {
393
+ "kind": "js",
394
+ "name": "PersonalizzazioneDegliStili",
395
+ "declaration": {
396
+ "name": "PersonalizzazioneDegliStili",
397
+ "module": "stories/it-chip.stories.ts"
398
+ }
399
+ },
400
+ {
401
+ "kind": "js",
402
+ "name": "VarianteConLink",
403
+ "declaration": {
404
+ "name": "VarianteConLink",
405
+ "module": "stories/it-chip.stories.ts"
406
+ }
407
+ },
408
+ {
409
+ "kind": "js",
410
+ "name": "VariantiColore",
411
+ "declaration": {
412
+ "name": "VariantiColore",
413
+ "module": "stories/it-chip.stories.ts"
414
+ }
415
+ },
416
+ {
417
+ "kind": "js",
418
+ "name": "VariantiColoreLink",
419
+ "declaration": {
420
+ "name": "VariantiColoreLink",
421
+ "module": "stories/it-chip.stories.ts"
422
+ }
423
+ },
424
+ {
425
+ "kind": "js",
426
+ "name": "VariantiDimensione",
427
+ "declaration": {
428
+ "name": "VariantiDimensione",
429
+ "module": "stories/it-chip.stories.ts"
430
+ }
431
+ },
432
+ {
433
+ "kind": "js",
434
+ "name": "ChipConChiusura",
435
+ "declaration": {
436
+ "name": "ChipConChiusura",
437
+ "module": "stories/it-chip.stories.ts"
438
+ }
439
+ },
440
+ {
441
+ "kind": "js",
442
+ "name": "ChipDisabilitata",
443
+ "declaration": {
444
+ "name": "ChipDisabilitata",
445
+ "module": "stories/it-chip.stories.ts"
446
+ }
447
+ },
448
+ {
449
+ "kind": "js",
450
+ "name": "ChipConAvatar",
451
+ "declaration": {
452
+ "name": "ChipConAvatar",
453
+ "module": "stories/it-chip.stories.ts"
454
+ }
455
+ },
456
+ {
457
+ "kind": "js",
458
+ "name": "ChipConIcona",
459
+ "declaration": {
460
+ "name": "ChipConIcona",
461
+ "module": "stories/it-chip.stories.ts"
462
+ }
463
+ }
464
+ ]
465
+ }
466
+ ]
467
+ }
@@ -0,0 +1,2 @@
1
+ export { ItChip } from './it-chip.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,MAAM,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,6 @@
1
+ export { ItChip } from './it-chip.js';
2
+ import 'lit';
3
+ import 'lit/directive.js';
4
+ import 'lit/decorators.js';
5
+ import 'lit/directives/class-map.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,27 @@
1
+ import { BaseComponent } from '@italia/globals';
2
+ import type { ItIcon } from '@italia/icon';
3
+ import { ChipSize, ChipVariant } from './types.js';
4
+ export declare class ItChip extends BaseComponent {
5
+ static styles: import("lit").CSSResultGroup;
6
+ dismissable: boolean;
7
+ size: ChipSize;
8
+ avatar: string;
9
+ avatarAlt: string;
10
+ label: string;
11
+ href: string;
12
+ a11yDescription: string;
13
+ variant: ChipVariant;
14
+ isDisabled: boolean;
15
+ closeButton: HTMLButtonElement[];
16
+ icon: ItIcon[];
17
+ private getAvatarSize;
18
+ private updateIcon;
19
+ updated(): void;
20
+ render(): import("lit").TemplateResult<1>;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'it-chip': ItChip;
25
+ }
26
+ }
27
+ //# sourceMappingURL=it-chip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"it-chip.d.ts","sourceRoot":"","sources":["../../src/it-chip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAInD,qBACa,MAAO,SAAQ,aAAa;IACvC,MAAM,CAAC,MAAM,+BAAU;IAEqB,WAAW,UAAS;IAErB,IAAI,EAAE,QAAQ,CAAQ;IAEtB,MAAM,SAAM;IAEa,SAAS,SAAM;IAExC,KAAK,SAAM;IAEX,IAAI,SAAM;IAEqB,eAAe,SAAM;IAEpD,OAAO,EAAE,WAAW,CAAM;IAEC,UAAU,UAAS;IAGzF,WAAW,EAAG,iBAAiB,EAAE,CAAC;IAGlC,IAAI,EAAG,MAAM,EAAE,CAAC;IAEhB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAaT,OAAO;IAmChB,MAAM;CAyCP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}