@silas-test/molecules-slider 0.1.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.
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Props for the Modal component.
3
+ * @typedef {Object} SliderProps
4
+ * @property {string} [id] - Component identification.
5
+ * @property {string} [dataTestId] - React-testing-library identification.
6
+ * @property {string} [currentPage] - The current page of the slider.
7
+ * @property {number} [slidesPerPage] - Number of slides that should be shown per page. On mobile, it will automatically be 1.
8
+ * @property {boolean} [showArrows] - Boolean representing if the arrows for next and previous page should be displayed. On mobile, they will be automatically hidden.
9
+ * @property {boolean} [showBullets] - Boolean representing if the bullets representing the pages should be displayed.
10
+ * @property {number} [duration] - Durations in milliseconds of each slide. If 0 is provided, they will not change automatically.
11
+ * @property {React.ReactNode | React.ReactNode[]} [children] - The content of the Sliders. This should be a SliderItem with the content inside.
12
+ * @property {(index?: number) => void} [onChange] - Function that runs when a slide change if you need to run any code when it changes.
13
+ */
14
+ export type SliderProps = {
15
+ id?: string;
16
+ dataTestId?: string;
17
+ currentPage: number;
18
+ slidesPerPage?: number;
19
+ showArrows?: boolean;
20
+ showBullets?: boolean;
21
+ duration?: number;
22
+ count?: number;
23
+ children: React.ReactNode | React.ReactNode[];
24
+ /**
25
+ * Function that runs when a slide change if you need to run any code when it changes.
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * <Slider onChange={(index: number) => console.log(index)} {...props}>
30
+ * <SliderItem>
31
+ * <p>slide 1</p>
32
+ * </SliderItem>
33
+ * <SliderItem>
34
+ * <p>slide 2</p>
35
+ * </SliderItem>
36
+ * <SliderItem>
37
+ * <p>slide 3</p>
38
+ * </SliderItem>
39
+ *</Slider>
40
+ * ```
41
+ */
42
+ onChange?: (index: number) => void;
43
+ };
44
+ /**
45
+ * Props for the Modal component.
46
+ * @typedef {Object} SliderItemProps
47
+ * @property {React.ReactNode | React.ReactNode[]} [children] - The content of the SliderItem.
48
+ */
49
+ export type SliderItemProps = {
50
+ children: React.ReactNode | React.ReactNode[];
51
+ };