@italia/carousel 1.0.0-alpha.7
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 +3 -0
- package/LICENSE +11 -0
- package/README.md +77 -0
- package/custom-elements.json +716 -0
- package/dist/src/constants.d.ts +10 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +8 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-carousel-slide.d.ts +11 -0
- package/dist/src/it-carousel-slide.d.ts.map +1 -0
- package/dist/src/it-carousel-slide.js +20 -0
- package/dist/src/it-carousel-slide.js.map +1 -0
- package/dist/src/it-carousel.d.ts +75 -0
- package/dist/src/it-carousel.d.ts.map +1 -0
- package/dist/src/it-carousel.js +3979 -0
- package/dist/src/it-carousel.js.map +1 -0
- package/dist/src/locales/en.d.ts +4 -0
- package/dist/src/locales/en.d.ts.map +1 -0
- package/dist/src/locales/it.d.ts +4 -0
- package/dist/src/locales/it.d.ts.map +1 -0
- package/dist/src/types.d.ts +4 -0
- package/dist/src/types.d.ts.map +1 -0
- package/package.json +72 -0
- package/styles/globals.scss +12 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Options } from '@splidejs/splide';
|
|
2
|
+
import { CarouselVariants } from './types.js';
|
|
3
|
+
export declare const CONFIGS: Record<string, Options>;
|
|
4
|
+
/** Maps a CarouselVariant to its BSI wrapper class and Splide config key. */
|
|
5
|
+
export declare const VARIANT_MAP: Record<CarouselVariants, {
|
|
6
|
+
wrapperClass: string;
|
|
7
|
+
imageClass?: string;
|
|
8
|
+
configKey: keyof typeof CONFIGS;
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAqI3C,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,WAAW,EAAE,MAAM,CAC9B,gBAAgB,EAChB;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,OAAO,OAAO,CAAA;CAAE,CA8B/E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ItCarousel } from './it-carousel.js';
|
|
2
|
+
export { ItCarouselSlide } from './it-carousel-slide.js';
|
|
3
|
+
import '../carousel-tmmxAvSb.js';
|
|
4
|
+
import 'lit/directive.js';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import 'lit/decorators.js';
|
|
7
|
+
import 'lit/directives/when.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseComponent } from '@italia/globals';
|
|
2
|
+
export declare class ItCarouselSlide extends BaseComponent {
|
|
3
|
+
static styles: import("lit").CSSResultGroup;
|
|
4
|
+
render(): import("lit").TemplateResult<1>;
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface HTMLElementTagNameMap {
|
|
8
|
+
'it-carousel-slide': ItCarouselSlide;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=it-carousel-slide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-carousel-slide.d.ts","sourceRoot":"","sources":["../../src/it-carousel-slide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKhD,qBACa,eAAgB,SAAQ,aAAa;IAChD,MAAM,CAAC,MAAM,+BAAU;IAKd,MAAM;CAGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { s as styles, _ as __decorate, B as BaseComponent } from '../carousel-tmmxAvSb.js';
|
|
2
|
+
import { html } from 'lit';
|
|
3
|
+
import { customElement } from 'lit/decorators.js';
|
|
4
|
+
import 'lit/directive.js';
|
|
5
|
+
|
|
6
|
+
let ItCarouselSlide = class ItCarouselSlide extends BaseComponent {
|
|
7
|
+
// The host element itself is moved into it-carousel's shadow DOM and gets
|
|
8
|
+
// the 'splide__slide' class added programmatically.
|
|
9
|
+
// <!-- ShadowDOM boundaries issues require div instead of li -->
|
|
10
|
+
render() {
|
|
11
|
+
return html `<div class="splide__slide__container it-single-slide-wrapper" part="slide"><slot></slot></div>`;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
ItCarouselSlide.styles = styles;
|
|
15
|
+
ItCarouselSlide = __decorate([
|
|
16
|
+
customElement('it-carousel-slide')
|
|
17
|
+
], ItCarouselSlide);
|
|
18
|
+
|
|
19
|
+
export { ItCarouselSlide };
|
|
20
|
+
//# sourceMappingURL=it-carousel-slide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-carousel-slide.js","sources":["../../../src/it-carousel-slide.ts"],"sourcesContent":["import { BaseComponent } from '@italia/globals';\nimport { html } from 'lit';\nimport { customElement } from 'lit/decorators.js';\nimport styles from './carousel.scss';\n\n@customElement('it-carousel-slide')\nexport class ItCarouselSlide extends BaseComponent {\n static styles = styles;\n\n // The host element itself is moved into it-carousel's shadow DOM and gets\n // the 'splide__slide' class added programmatically.\n // <!-- ShadowDOM boundaries issues require div instead of li -->\n override render() {\n return html`<div class=\"splide__slide__container it-single-slide-wrapper\" part=\"slide\"><slot></slot></div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'it-carousel-slide': ItCarouselSlide;\n }\n}\n"],"names":[],"mappings":";;;;;AAMO,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,aAAa,CAAA;;;;IAMvC,MAAM,GAAA;QACb,OAAO,IAAI,CAAA,CAAA,8FAAA,CAAgG;IAC7G;;AAPO,eAAA,CAAA,MAAM,GAAG,MAAH;AADF,eAAe,GAAA,UAAA,CAAA;IAD3B,aAAa,CAAC,mBAAmB;AACrB,CAAA,EAAA,eAAe,CAS3B;;;;"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseLocalizedComponent } from '@italia/globals';
|
|
2
|
+
import { type Options } from '@splidejs/splide';
|
|
3
|
+
import { type CarouselVariants, type CarouselType } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* @csspart arrows - Wrapper element containing the prev/next arrow buttons.
|
|
6
|
+
* @csspart arrow-prev - The "previous" arrow button.
|
|
7
|
+
* @csspart arrow-next - The "next" arrow button.
|
|
8
|
+
* @csspart pagination-track - The pagination list element (dots). When autoplay is enabled it lives inside the controls wrapper; otherwise Splide appends it to the carousel root.
|
|
9
|
+
* @csspart pagination-dot - Each individual pagination dot button.
|
|
10
|
+
* @csspart autoplay-toggle - The play/pause toggle button (rendered when `autoplay` prop is true or `config.autoplay` is set).
|
|
11
|
+
* @csspart autoplay-play - The play SVG icon inside the toggle button.
|
|
12
|
+
* @csspart autoplay-pause - The pause SVG icon inside the toggle button.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ItCarousel extends BaseLocalizedComponent {
|
|
15
|
+
static styles: import("lit").CSSResultGroup;
|
|
16
|
+
config?: Options;
|
|
17
|
+
variant: CarouselVariants;
|
|
18
|
+
fullscreen?: boolean;
|
|
19
|
+
arrows: boolean;
|
|
20
|
+
separator: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Splide movement type. Overrides the variant's default type.
|
|
23
|
+
* - `slide` (default for most variants) — linear slide
|
|
24
|
+
* - `loop` — infinite loop
|
|
25
|
+
* - `fade` — crossfade
|
|
26
|
+
*/
|
|
27
|
+
type?: CarouselType;
|
|
28
|
+
/**
|
|
29
|
+
* If true, enables Splide autoplay in `'pause'` mode: the carousel
|
|
30
|
+
* auto-advances but starts paused so the user must explicitly press Play.
|
|
31
|
+
* A play/pause toggle button is rendered automatically.
|
|
32
|
+
* To customise the interval or other autoplay options use `config.autoplay`.
|
|
33
|
+
*/
|
|
34
|
+
autoplay: boolean;
|
|
35
|
+
titleElements: HTMLElement[];
|
|
36
|
+
mainSlot: HTMLSlotElement;
|
|
37
|
+
wrapper: HTMLElement;
|
|
38
|
+
list: HTMLElement;
|
|
39
|
+
private _isInitialized;
|
|
40
|
+
private _splide?;
|
|
41
|
+
pauseAutoplay(): void;
|
|
42
|
+
playAutoplay(): void;
|
|
43
|
+
private _handleSlotChange;
|
|
44
|
+
private _initSplide;
|
|
45
|
+
/**
|
|
46
|
+
* Adds `inert` to every slide that Splide has not marked as visible,
|
|
47
|
+
* and removes it from the ones that are. Called after mount and on every
|
|
48
|
+
* `moved` event so the tab order always reflects what is on screen.
|
|
49
|
+
* Clone slides (loop mode) are always inert per splide docs.
|
|
50
|
+
*/
|
|
51
|
+
private _updateInert;
|
|
52
|
+
/**
|
|
53
|
+
* After Splide mounts it injects elements (arrows, pagination) directly into
|
|
54
|
+
* the shadow DOM. We annotate each one with a CSS `part` so that consumers
|
|
55
|
+
* can reach them from outside the shadow root with `::part()`.
|
|
56
|
+
*
|
|
57
|
+
* Exposed parts:
|
|
58
|
+
* - `arrows` – the arrows wrapper element
|
|
59
|
+
* - `arrow-prev` – the "previous" button
|
|
60
|
+
* - `arrow-next` – the "next" button
|
|
61
|
+
* - `pagination-track` – the pagination `<ul>` (dots)
|
|
62
|
+
* - `pagination-dot` – each individual dot `<button>`
|
|
63
|
+
*/
|
|
64
|
+
private _applyParts;
|
|
65
|
+
disconnectedCallback(): void;
|
|
66
|
+
private handleTitleSlotChange;
|
|
67
|
+
private _sectionClass;
|
|
68
|
+
render(): import("lit").TemplateResult<1>;
|
|
69
|
+
}
|
|
70
|
+
declare global {
|
|
71
|
+
interface HTMLElementTagNameMap {
|
|
72
|
+
'it-carousel': ItCarousel;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=it-carousel.d.ts.map
|
|
@@ -0,0 +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;IAgGnB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAapB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,WAAW;IAkBV,oBAAoB;IAK7B,OAAO,CAAC,qBAAqB;IAgB7B,OAAO,CAAC,aAAa;IAeZ,MAAM;CAgDhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|