@italia/carousel 1.0.0-beta.0 → 1.0.0-beta.1
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/README.md +6 -72
- package/custom-elements.json +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/it-carousel-slide.js +1 -1
- package/dist/src/it-carousel.d.ts.map +1 -1
- package/dist/src/it-carousel.js +10 -1
- package/dist/src/it-carousel.js.map +1 -1
- package/package.json +26 -26
package/README.md
CHANGED
|
@@ -1,77 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# <it-carousel>
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package is part of [dev-kit-italia](https://italia.github.io/dev-kit-italia), a Web Components kit for the **.italia** design-system.
|
|
4
4
|
|
|
5
|
-
## Installation
|
|
5
|
+
## Installation and usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
npm i @italia/carousel
|
|
9
|
-
npm i @italia/card
|
|
10
|
-
```
|
|
7
|
+
Most users want to install the full kit by installing [`@italia/dev-kit-italia`](https://npmjs.com/package/@italia/dev-kit-italia), but you have the option of installing this single Web Component separately if needed. Please find detailed installation and usage instructions in the [official documentation](https://italia.github.io/dev-kit-italia/?path=/docs/introduzione--documentazione).
|
|
11
8
|
|
|
12
|
-
##
|
|
9
|
+
## Documentation
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
<script type="module">
|
|
16
|
-
import '@italia/carousel';
|
|
17
|
-
import '@italia/card';
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<it-carousel>...</it-carousel>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Linting and formatting
|
|
24
|
-
|
|
25
|
-
To scan the project for linting and formatting errors, run
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm run lint
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
To automatically fix linting and formatting errors, run
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
npm run format
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Testing with Web Test Runner
|
|
38
|
-
|
|
39
|
-
To execute a single test run:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
npm run test
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
To run the tests in interactive watch mode run:
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm run test:watch
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Demoing with Storybook
|
|
52
|
-
|
|
53
|
-
To run a local instance of Storybook for your component, run
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
npm run storybook
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
To build a production version of Storybook, run
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
npm run storybook:build
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Tooling configs
|
|
66
|
-
|
|
67
|
-
For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
|
|
68
|
-
|
|
69
|
-
If you customize the configuration a lot, you can consider moving them to individual files.
|
|
70
|
-
|
|
71
|
-
## Local Demo with `web-dev-server`
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
npm start
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
To run a local development server that serves the basic demo located in `demo/index.html`
|
|
11
|
+
Find the usage instructions for this specific component in its [dedicated documentation page](https://italia.github.io/dev-kit-italia/?path=/docs/componenti-carousel--documentazione).
|
package/custom-elements.json
CHANGED
|
@@ -442,7 +442,7 @@
|
|
|
442
442
|
"type": {
|
|
443
443
|
"text": "Meta<any>"
|
|
444
444
|
},
|
|
445
|
-
"default": "{ title: 'Componenti/Carousel', tags: ['
|
|
445
|
+
"default": "{ title: 'Componenti/Carousel', tags: ['web-component', 'a11y-ok'], component: 'it-carousel', args: { arrows: false, autoplay: false, fullscreen: false, separator: false, type: undefined, variant: 'single', config: undefined, title: 'Titolo carousel', }, argTypes: { fullscreen: { control: 'boolean', description: 'Se true, il carousel occupa tutta la larghezza disponibile.', table: { defaultValue: { summary: 'false' } }, }, arrows: { control: 'boolean', description: 'Se true, mostra le frecce di navigazione del carousel.', table: { defaultValue: { summary: 'false' } }, }, separator: { control: 'boolean', description: 'Se true, mostra un separatore verticale tra le slide.', table: { defaultValue: { summary: 'false' } }, }, variant: { control: 'select', description: 'Variante di layout del carousel.', options: VARIANTS, type: 'string', table: { defaultValue: { summary: 'single' } }, }, type: { control: 'select', description: 'Tipo di scorrimento del carousel. Se non specificato, viene usato il default della variante.', options: ['slide', 'loop', 'fade'], type: 'string', table: { defaultValue: { summary: '-' } }, }, autoplay: { control: 'boolean', description: \"Se true, abilita l'autoplay del carousel con modalità \\\"pause\\\" (il carousel avanza automaticamente ma parte in pausa, l'utente deve premere play per avviarlo). Viene renderizzato automaticamente un pulsante di toggle play/pause. Per personalizzare l'intervallo o altre opzioni dell'autoplay, usa config.autoplay.\", table: { defaultValue: { summary: 'false' } }, }, config: { control: false, description: 'Oggetto di configurazione avanzata da passare a Splide. Consulta la documentazione del componente Carousel e quella di Splide v4.x per conoscere le opzioni disponibili.', table: { defaultValue: { summary: '-' } }, }, cardOptions: { table: { disable: true }, }, title: { table: { disable: true }, }, }, parameters: { docs: { source: { excludeDecorators: true, }, }, layout: 'padded', a11y: { config: { rules: [ { id: 'aria-valid-attr-value', // La regola che sta urlando enabled: false, }, ], }, }, }, decorators: [(story) => html`<div style=\"padding:2rem\">${story()}</div>`], }"
|
|
446
446
|
},
|
|
447
447
|
{
|
|
448
448
|
"kind": "variable",
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as styles, _ as __decorate, B as BaseComponent } from '../carousel-
|
|
1
|
+
import { s as styles, _ as __decorate, B as BaseComponent } from '../carousel-Dw2eJSN2.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { customElement } from 'lit/decorators.js';
|
|
4
4
|
import 'lit/directive.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"it-carousel.d.ts","sourceRoot":"","sources":["../../src/it-carousel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAQtE;;;;;;;;;GASG;AACH,qBACa,UAAW,SAAQ,sBAAsB;IACpD,MAAM,CAAC,MAAM,+BAAU;IAGvB,MAAM,CAAC,EAAE,OAAO,CAAM;IAGtB,OAAO,EAAE,gBAAgB,CAAY;IAGrC,UAAU,CAAC,EAAE,OAAO,CAAS;IAG7B,MAAM,EAAE,OAAO,CAAS;IAGxB,SAAS,EAAE,OAAO,CAAS;IAE3B;;;;;OAKG;IAEH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;;OAKG;IAEH,QAAQ,EAAE,OAAO,CAAS;IAG1B,aAAa,EAAG,WAAW,EAAE,CAAC;IAG9B,QAAQ,EAAG,eAAe,CAAC;IAG3B,OAAO,EAAG,WAAW,CAAC;IAGtB,IAAI,EAAG,WAAW,CAAC;IAGnB,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,OAAO,CAAC,CAAS;IAElB,aAAa;IAIb,YAAY;IAOnB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,WAAW;IA8GnB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"it-carousel.d.ts","sourceRoot":"","sources":["../../src/it-carousel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAKzD,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,kBAAkB,CAAC;AAGxD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAQtE;;;;;;;;;GASG;AACH,qBACa,UAAW,SAAQ,sBAAsB;IACpD,MAAM,CAAC,MAAM,+BAAU;IAGvB,MAAM,CAAC,EAAE,OAAO,CAAM;IAGtB,OAAO,EAAE,gBAAgB,CAAY;IAGrC,UAAU,CAAC,EAAE,OAAO,CAAS;IAG7B,MAAM,EAAE,OAAO,CAAS;IAGxB,SAAS,EAAE,OAAO,CAAS;IAE3B;;;;;OAKG;IAEH,IAAI,CAAC,EAAE,YAAY,CAAC;IAEpB;;;;;OAKG;IAEH,QAAQ,EAAE,OAAO,CAAS;IAG1B,aAAa,EAAG,WAAW,EAAE,CAAC;IAG9B,QAAQ,EAAG,eAAe,CAAC;IAG3B,OAAO,EAAG,WAAW,CAAC;IAGtB,IAAI,EAAG,WAAW,CAAC;IAGnB,OAAO,CAAC,cAAc,CAAS;IAE/B,OAAO,CAAC,OAAO,CAAC,CAAS;IAElB,aAAa;IAIb,YAAY;IAOnB,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,WAAW;IA8GnB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;IAgCV,iBAAiB;IAUjB,oBAAoB;IAK7B,OAAO,CAAC,qBAAqB;IAmB7B,OAAO,CAAC,aAAa;IAeZ,MAAM;CA+ChB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
package/dist/src/it-carousel.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerTranslation, s as styles, _ as __decorate, a as __metadata, b as BaseLocalizedComponent } from '../carousel-
|
|
1
|
+
import { r as registerTranslation, s as styles, _ as __decorate, a as __metadata, b as BaseLocalizedComponent } from '../carousel-Dw2eJSN2.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
import { property, queryAssignedElements, query as query$1, state, customElement } from 'lit/decorators.js';
|
|
4
4
|
import { when } from 'lit/directives/when.js';
|
|
@@ -3857,6 +3857,15 @@ let ItCarousel = class ItCarousel extends BaseLocalizedComponent {
|
|
|
3857
3857
|
// handleTitleSlotChange), so the inner div's landmark role is redundant and would
|
|
3858
3858
|
// cause a landmark-unique Axe violation. Demote it to a generic container.
|
|
3859
3859
|
this.wrapper?.setAttribute('role', 'presentation');
|
|
3860
|
+
// Splide also sets aria-roledescription on the same div, but per the ARIA spec
|
|
3861
|
+
// aria-roledescription has no effect (and shouldn't be used) on an element with
|
|
3862
|
+
// role="presentation": the element is removed from the accessibility tree, so
|
|
3863
|
+
// the roledescription would never be announced. Move it to the host, where the
|
|
3864
|
+
// "region" landmark actually lives, for consistency with Bootstrap Italia.
|
|
3865
|
+
this.wrapper?.removeAttribute('aria-roledescription');
|
|
3866
|
+
if (!this.hasAttribute('aria-roledescription')) {
|
|
3867
|
+
this.setAttribute('aria-roledescription', this.$t('carousel_carousel'));
|
|
3868
|
+
}
|
|
3860
3869
|
}
|
|
3861
3870
|
connectedCallback() {
|
|
3862
3871
|
super.connectedCallback?.();
|