@design-factory/core 21.1.0-next.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 +3 -0
- package/accordion-B0vs8JWM.cjs +314 -0
- package/accordion-D9ba0XYq.js +315 -0
- package/alert-AhaliJ17.cjs +9 -0
- package/alert-Cb9FhbFQ.js +10 -0
- package/collapse-Bn8iHKrd.js +95 -0
- package/collapse-BnWw4Hnc.cjs +94 -0
- package/common-B5jS-Ih_.cjs +73 -0
- package/common-DFyZvkII.js +74 -0
- package/components/accordion/accordion.d.ts +333 -0
- package/components/accordion/index.cjs +7 -0
- package/components/accordion/index.d.ts +1 -0
- package/components/accordion/index.js +7 -0
- package/components/alert/alert.d.ts +37 -0
- package/components/alert/common.d.ts +138 -0
- package/components/alert/index.cjs +5 -0
- package/components/alert/index.d.ts +1 -0
- package/components/alert/index.js +5 -0
- package/components/carousel/carousel.d.ts +247 -0
- package/components/carousel/index.cjs +292 -0
- package/components/carousel/index.d.ts +1 -0
- package/components/carousel/index.js +292 -0
- package/components/collapse/collapse.d.ts +135 -0
- package/components/collapse/index.cjs +5 -0
- package/components/collapse/index.d.ts +1 -0
- package/components/collapse/index.js +5 -0
- package/components/commonProps.d.ts +11 -0
- package/components/drawer/drawer.d.ts +279 -0
- package/components/drawer/index.cjs +5 -0
- package/components/drawer/index.d.ts +1 -0
- package/components/drawer/index.js +5 -0
- package/components/modal/index.cjs +8 -0
- package/components/modal/index.d.ts +1 -0
- package/components/modal/index.js +8 -0
- package/components/modal/modal.d.ts +245 -0
- package/components/pagination/index.cjs +5 -0
- package/components/pagination/index.d.ts +1 -0
- package/components/pagination/index.js +5 -0
- package/components/pagination/pagination.d.ts +313 -0
- package/components/progressbar/index.cjs +5 -0
- package/components/progressbar/index.d.ts +1 -0
- package/components/progressbar/index.js +5 -0
- package/components/progressbar/progressbar.d.ts +91 -0
- package/components/rating/index.cjs +5 -0
- package/components/rating/index.d.ts +1 -0
- package/components/rating/index.js +5 -0
- package/components/rating/rating.d.ts +191 -0
- package/components/slider/index.cjs +5 -0
- package/components/slider/index.d.ts +1 -0
- package/components/slider/index.js +5 -0
- package/components/slider/slider-utils.d.ts +25 -0
- package/components/slider/slider.d.ts +383 -0
- package/components/toast/index.cjs +7 -0
- package/components/toast/index.d.ts +2 -0
- package/components/toast/index.js +7 -0
- package/components/toast/toast.d.ts +66 -0
- package/components/toast/toaster.d.ts +128 -0
- package/components/tree/index.cjs +5 -0
- package/components/tree/index.d.ts +1 -0
- package/components/tree/index.js +5 -0
- package/components/tree/tree.d.ts +143 -0
- package/config.cjs +36 -0
- package/config.d.ts +117 -0
- package/config.js +36 -0
- package/directive-CNNSo5Yn.js +524 -0
- package/directive-DyTodNPd.cjs +523 -0
- package/drawer-BIIfJa0F.js +329 -0
- package/drawer-C8ojtwIn.cjs +328 -0
- package/index.cjs +134 -0
- package/index.d.ts +29 -0
- package/index.js +134 -0
- package/isFocusable-Ckwus82R.js +32 -0
- package/isFocusable-DfzDLeAN.cjs +31 -0
- package/modal-C13G13jV.js +253 -0
- package/modal-DWv0VqiG.cjs +252 -0
- package/package.json +56 -0
- package/pagination-BLVa1UsZ.cjs +254 -0
- package/pagination-BQWusWXN.js +255 -0
- package/progressbar-RopgvVeA.cjs +86 -0
- package/progressbar-S1pNn5rM.js +87 -0
- package/promise-CxCD3NYv.cjs +118 -0
- package/promise-D-RZVPuv.js +119 -0
- package/rating-DWgGgwk3.js +184 -0
- package/rating-DZ3OQgtt.cjs +183 -0
- package/scrollbars-CT87iv_6.cjs +30 -0
- package/scrollbars-CcxSrnCx.js +31 -0
- package/services/extendWidget.cjs +41 -0
- package/services/extendWidget.d.ts +31 -0
- package/services/extendWidget.js +41 -0
- package/services/floatingUI.cjs +111 -0
- package/services/floatingUI.d.ts +76 -0
- package/services/floatingUI.js +111 -0
- package/services/focusElement.cjs +46 -0
- package/services/focusElement.d.ts +9 -0
- package/services/focusElement.js +46 -0
- package/services/focustrack.cjs +47 -0
- package/services/focustrack.d.ts +40 -0
- package/services/focustrack.js +47 -0
- package/services/hash.cjs +15 -0
- package/services/hash.d.ts +3 -0
- package/services/hash.js +15 -0
- package/services/intersection.cjs +53 -0
- package/services/intersection.d.ts +30 -0
- package/services/intersection.js +53 -0
- package/services/matchMedia.cjs +14 -0
- package/services/matchMedia.d.ts +8 -0
- package/services/matchMedia.js +14 -0
- package/services/navManager.cjs +166 -0
- package/services/navManager.d.ts +144 -0
- package/services/navManager.js +166 -0
- package/services/pointerdownPosition.cjs +60 -0
- package/services/pointerdownPosition.d.ts +42 -0
- package/services/pointerdownPosition.js +60 -0
- package/services/portal.cjs +42 -0
- package/services/portal.d.ts +16 -0
- package/services/portal.js +42 -0
- package/services/resizeObserver.cjs +54 -0
- package/services/resizeObserver.d.ts +18 -0
- package/services/resizeObserver.js +54 -0
- package/services/siblingsInert.cjs +44 -0
- package/services/siblingsInert.d.ts +16 -0
- package/services/siblingsInert.js +44 -0
- package/services/transitions/baseTransitions.cjs +186 -0
- package/services/transitions/baseTransitions.d.ts +166 -0
- package/services/transitions/baseTransitions.js +186 -0
- package/services/transitions/collapse.cjs +40 -0
- package/services/transitions/collapse.d.ts +49 -0
- package/services/transitions/collapse.js +40 -0
- package/services/transitions/cssTransitions.cjs +32 -0
- package/services/transitions/cssTransitions.d.ts +25 -0
- package/services/transitions/cssTransitions.js +32 -0
- package/services/transitions/simpleClassTransition.cjs +37 -0
- package/services/transitions/simpleClassTransition.d.ts +47 -0
- package/services/transitions/simpleClassTransition.js +37 -0
- package/slider-Br_Qiopx.js +808 -0
- package/slider-pgDq1V5r.cjs +807 -0
- package/textDirection-cNgt24LJ.js +4 -0
- package/textDirection-zqcZ5-eK.cjs +3 -0
- package/toaster-BUBzFeJM.js +162 -0
- package/toaster-Dlube4Ya.cjs +161 -0
- package/tree-Chcy4ulJ.cjs +228 -0
- package/tree-vD7ZkV8Z.js +229 -0
- package/types.cjs +6 -0
- package/types.d.ts +246 -0
- package/types.js +6 -0
- package/utils/directive.cjs +28 -0
- package/utils/directive.d.ts +352 -0
- package/utils/directive.js +28 -0
- package/utils/func.cjs +7 -0
- package/utils/func.d.ts +11 -0
- package/utils/func.js +7 -0
- package/utils/id.cjs +5 -0
- package/utils/id.d.ts +6 -0
- package/utils/id.js +5 -0
- package/utils/internal/assign.d.ts +10 -0
- package/utils/internal/checks.d.ts +57 -0
- package/utils/internal/dom.d.ts +75 -0
- package/utils/internal/isFocusable.d.ts +9 -0
- package/utils/internal/math.d.ts +5 -0
- package/utils/internal/promise.d.ts +98 -0
- package/utils/internal/scrollbars.d.ts +8 -0
- package/utils/internal/sort.d.ts +16 -0
- package/utils/internal/ssrHTMLElement.d.ts +17 -0
- package/utils/internal/textDirection.d.ts +7 -0
- package/utils/internal/traversal.d.ts +54 -0
- package/utils/stores.cjs +172 -0
- package/utils/stores.d.ts +224 -0
- package/utils/stores.js +172 -0
- package/utils/widget.cjs +8 -0
- package/utils/widget.d.ts +11 -0
- package/utils/widget.js +8 -0
- package/utils/writables.cjs +16 -0
- package/utils/writables.d.ts +95 -0
- package/utils/writables.js +16 -0
- package/writables-DYGjj5T3.js +103 -0
- package/writables-Dt68gADJ.cjs +102 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CommonAlertApi, CommonAlertDirectives, CommonAlertProps, CommonAlertState } from './common';
|
|
2
|
+
import type { Widget, WidgetFactory } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the state of an alert component.
|
|
5
|
+
*/
|
|
6
|
+
export interface AlertState extends CommonAlertState {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Represents the properties for the alert component.
|
|
10
|
+
*/
|
|
11
|
+
export interface AlertProps extends CommonAlertProps {
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Represents the API for an alert component.
|
|
15
|
+
*/
|
|
16
|
+
export interface AlertApi extends CommonAlertApi {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Represents the directives for an alert component.
|
|
20
|
+
*/
|
|
21
|
+
export interface AlertDirectives extends CommonAlertDirectives {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Represents an alert widget with specific properties, state, API, and directives.
|
|
25
|
+
*/
|
|
26
|
+
export type AlertWidget = Widget<AlertProps, AlertState, AlertApi, AlertDirectives>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieve a shallow copy of the default alert config
|
|
29
|
+
* @returns the default alert config
|
|
30
|
+
*/
|
|
31
|
+
export declare function getAlertDefaultConfig(): AlertProps;
|
|
32
|
+
/**
|
|
33
|
+
* Create an AlertWidget with given config props
|
|
34
|
+
* @param config - an optional alert config
|
|
35
|
+
* @returns an AlertWidget
|
|
36
|
+
*/
|
|
37
|
+
export declare const createAlert: WidgetFactory<AlertWidget>;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { TransitionFn } from '../../services/transitions/baseTransitions';
|
|
2
|
+
import type { WidgetsCommonPropsAndState } from '../commonProps';
|
|
3
|
+
import type { Directive, PropsConfig, Widget } from '../../types';
|
|
4
|
+
/**
|
|
5
|
+
* Interface representing the common properties and state for an alert component.
|
|
6
|
+
*/
|
|
7
|
+
export interface CommonAlertCommonPropsAndState extends WidgetsCommonPropsAndState {
|
|
8
|
+
/**
|
|
9
|
+
* If `true`, alert can be dismissed by the user.
|
|
10
|
+
* The close button (×) will be displayed and you can be notified of the event with the (close) output.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue `true`
|
|
13
|
+
*/
|
|
14
|
+
dismissible: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* If `true` the alert is visible to the user
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue `true`
|
|
19
|
+
*/
|
|
20
|
+
visible: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Accessibility close button label
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue `'Close'`
|
|
25
|
+
*/
|
|
26
|
+
ariaCloseButtonLabel: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Represents the state of a common alert component.
|
|
30
|
+
*/
|
|
31
|
+
export interface CommonAlertState extends CommonAlertCommonPropsAndState {
|
|
32
|
+
/**
|
|
33
|
+
* Is `true` when the alert is hidden. Compared to `visible`, this is updated after the transition is executed.
|
|
34
|
+
*/
|
|
35
|
+
hidden: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Interface representing the common properties for an alert component.
|
|
39
|
+
*/
|
|
40
|
+
export interface CommonAlertProps extends CommonAlertCommonPropsAndState {
|
|
41
|
+
/**
|
|
42
|
+
* Callback called when the alert visibility changed.
|
|
43
|
+
*
|
|
44
|
+
* @defaultValue
|
|
45
|
+
* ```ts
|
|
46
|
+
* () => {}
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
onVisibleChange: (visible: boolean) => void;
|
|
50
|
+
/**
|
|
51
|
+
* Callback called when the alert is hidden.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue
|
|
54
|
+
* ```ts
|
|
55
|
+
* () => {}
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
onHidden: () => void;
|
|
59
|
+
/**
|
|
60
|
+
* Callback called when the alert is shown.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue
|
|
63
|
+
* ```ts
|
|
64
|
+
* () => {}
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
onShown: () => void;
|
|
68
|
+
/**
|
|
69
|
+
* The transition function will be executed when the alert is displayed or hidden.
|
|
70
|
+
*
|
|
71
|
+
* Depending on the value of `animatedOnInit`, the animation can be optionally skipped during the showing process.
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue
|
|
74
|
+
* ```ts
|
|
75
|
+
* () => {}
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
transition: TransitionFn;
|
|
79
|
+
/**
|
|
80
|
+
* If `true`, alert opening will be animated.
|
|
81
|
+
*
|
|
82
|
+
* Animation is triggered when the `.open()` function is called
|
|
83
|
+
* or the visible prop is changed
|
|
84
|
+
*
|
|
85
|
+
* @defaultValue `false`
|
|
86
|
+
*/
|
|
87
|
+
animatedOnInit: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* If `true`, alert closing will be animated.
|
|
90
|
+
*
|
|
91
|
+
* Animation is triggered when clicked on the close button (×),
|
|
92
|
+
* via the `.close()` function or the visible prop is changed
|
|
93
|
+
*
|
|
94
|
+
* @defaultValue `true`
|
|
95
|
+
*/
|
|
96
|
+
animated: boolean;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Interface representing the common API for alert components.
|
|
100
|
+
*/
|
|
101
|
+
export interface CommonAlertApi {
|
|
102
|
+
/**
|
|
103
|
+
* Triggers alert closing programmatically (same as clicking on the close button (×)).
|
|
104
|
+
*
|
|
105
|
+
* @param animated - whether the transition should be animated. If the parameter is not defined, the `animated` property is used.
|
|
106
|
+
*/
|
|
107
|
+
close(animated?: boolean): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Triggers the alert to be displayed for the user.
|
|
110
|
+
*
|
|
111
|
+
* @param animated - whether the transition should be animated. If the parameter is not defined, the `animated` property is used.
|
|
112
|
+
*/
|
|
113
|
+
open(animated?: boolean): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Interface representing common alert directives.
|
|
117
|
+
*/
|
|
118
|
+
export interface CommonAlertDirectives {
|
|
119
|
+
/**
|
|
120
|
+
* the transition directive, piloting what is the visual effect of going from hidden to visible
|
|
121
|
+
*/
|
|
122
|
+
transitionDirective: Directive;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Represents a common alert widget with specified properties, state, API, and directives.
|
|
126
|
+
*/
|
|
127
|
+
export type CommonAlertWidget = Widget<CommonAlertProps, CommonAlertState, CommonAlertApi, CommonAlertDirectives>;
|
|
128
|
+
/**
|
|
129
|
+
* Retrieve a shallow copy of the default alert config
|
|
130
|
+
* @returns the default alert config
|
|
131
|
+
*/
|
|
132
|
+
export declare function getCommonAlertDefaultConfig(): CommonAlertProps;
|
|
133
|
+
/**
|
|
134
|
+
* Create an AlertWidget with given config props
|
|
135
|
+
* @param config - an optional alert config
|
|
136
|
+
* @returns an AlertWidget
|
|
137
|
+
*/
|
|
138
|
+
export declare function createCommonAlert(config?: PropsConfig<CommonAlertProps>): CommonAlertWidget;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './alert';
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import type { Directive, Widget, WidgetFactory } from '../../types';
|
|
2
|
+
import type { EmblaCarouselType, EmblaPluginsType, EmblaPluginType } from 'embla-carousel';
|
|
3
|
+
import type { ReadableSignal } from '@amadeus-it-group/tansu';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the Embla carousel options
|
|
6
|
+
*/
|
|
7
|
+
interface EmblaOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Align the slides relative to the carousel viewport
|
|
10
|
+
*
|
|
11
|
+
* @see {@link https://www.embla-carousel.com/api/options/#align}
|
|
12
|
+
* @defaultValue `'center'`
|
|
13
|
+
*/
|
|
14
|
+
align: 'start' | 'center' | 'end';
|
|
15
|
+
/**
|
|
16
|
+
* Enables choosing a custom container element which holds the slides. By default, Embla will choose the first direct child element of the root element. Provide a valid CSS selector string.
|
|
17
|
+
*
|
|
18
|
+
* @see {@link https://www.embla-carousel.com/api/options/#container}
|
|
19
|
+
*
|
|
20
|
+
* @defaultValue `null`
|
|
21
|
+
*/
|
|
22
|
+
container: string | null;
|
|
23
|
+
/**
|
|
24
|
+
* Clear leading and trailing empty space that causes excessive scrolling
|
|
25
|
+
*
|
|
26
|
+
* @see {@link https://www.embla-carousel.com/api/options/#containScroll}
|
|
27
|
+
* @defaultValue `'trimSnaps'`
|
|
28
|
+
*/
|
|
29
|
+
containScroll: false | 'trimSnaps' | 'keepSnaps';
|
|
30
|
+
/**
|
|
31
|
+
* Choose content direction between `ltr` and `rtl`
|
|
32
|
+
*
|
|
33
|
+
* @see {@link https://www.embla-carousel.com/api/options/#direction}
|
|
34
|
+
* @defaultValue `'ltr'`
|
|
35
|
+
*/
|
|
36
|
+
direction: 'ltr' | 'rtl';
|
|
37
|
+
/**
|
|
38
|
+
* Enables momentum scrolling
|
|
39
|
+
*
|
|
40
|
+
* @see {@link https://www.embla-carousel.com/api/options/#dragFree}
|
|
41
|
+
* @defaultValue `false`
|
|
42
|
+
*/
|
|
43
|
+
dragFree: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Drag threshold in pixels
|
|
46
|
+
*
|
|
47
|
+
* @see {@link https://www.embla-carousel.com/api/options/#dragThreshold}
|
|
48
|
+
* @defaultValue `10`
|
|
49
|
+
*/
|
|
50
|
+
dragThreshold: number;
|
|
51
|
+
/**
|
|
52
|
+
* Set scroll duration when triggered by any of the API methods
|
|
53
|
+
*
|
|
54
|
+
* @see {@link https://www.embla-carousel.com/api/options/#duration}
|
|
55
|
+
* @defaultValue `25`
|
|
56
|
+
*/
|
|
57
|
+
duration: number;
|
|
58
|
+
/**
|
|
59
|
+
* Enables infinite looping
|
|
60
|
+
*
|
|
61
|
+
* @see {@link https://www.embla-carousel.com/api/options/#loop}
|
|
62
|
+
* @defaultValue `false`
|
|
63
|
+
*/
|
|
64
|
+
loop: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Allow the carousel to skip scroll snaps if it's dragged vigorously
|
|
67
|
+
*
|
|
68
|
+
* @see {@link https://www.embla-carousel.com/api/options/#skipsnaps}
|
|
69
|
+
* @defaultValue `false`
|
|
70
|
+
*/
|
|
71
|
+
skipSnaps: boolean;
|
|
72
|
+
}
|
|
73
|
+
interface CarouselCommonPropsState extends Pick<EmblaOptions, 'direction'> {
|
|
74
|
+
/**
|
|
75
|
+
* If `true`, 'previous' and 'next' navigation arrows will be visible.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue `true`
|
|
78
|
+
*/
|
|
79
|
+
showNavigationArrows: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* If `true`, navigation indicators at the bottom of the slide will be visible.
|
|
82
|
+
*
|
|
83
|
+
* @defaultValue `true`
|
|
84
|
+
*/
|
|
85
|
+
showNavigationIndicators: boolean;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Represents the properties for the carousel component.
|
|
89
|
+
*/
|
|
90
|
+
export interface CarouselProps extends EmblaOptions, CarouselCommonPropsState {
|
|
91
|
+
/**
|
|
92
|
+
* Plugins to extend the carousel with additional features
|
|
93
|
+
* @defaultValue `[]`
|
|
94
|
+
*/
|
|
95
|
+
plugins: EmblaPluginType[];
|
|
96
|
+
/**
|
|
97
|
+
* Aria label for navigation indicators
|
|
98
|
+
*
|
|
99
|
+
* @defaultValue
|
|
100
|
+
* ```ts
|
|
101
|
+
* (index: number) => `Select slide ${index + 1}`
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
ariaIndicatorLabel: (index: number) => string;
|
|
105
|
+
/**
|
|
106
|
+
* Aria label for previous button
|
|
107
|
+
*
|
|
108
|
+
* @defaultValue `'Select previous slide'`
|
|
109
|
+
*/
|
|
110
|
+
ariaPrevLabel: string;
|
|
111
|
+
/**
|
|
112
|
+
* Aria label for next button
|
|
113
|
+
*
|
|
114
|
+
* @defaultValue `'Select next slide'`
|
|
115
|
+
*/
|
|
116
|
+
ariaNextLabel: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Represents the state of a carousel component.
|
|
120
|
+
*/
|
|
121
|
+
export interface CarouselState extends CarouselCommonPropsState {
|
|
122
|
+
/**
|
|
123
|
+
* is the carousel currently scrolling
|
|
124
|
+
*/
|
|
125
|
+
scrolling: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* can carousel scroll to previous slide
|
|
128
|
+
*/
|
|
129
|
+
canScrollPrev: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* can carousel scroll to next slide
|
|
132
|
+
*/
|
|
133
|
+
canScrollNext: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* selected scroll snap
|
|
136
|
+
*/
|
|
137
|
+
selectedScrollSnap: number;
|
|
138
|
+
/**
|
|
139
|
+
* is the carousel initialized
|
|
140
|
+
*/
|
|
141
|
+
initialized: boolean;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Represents the API for a carousel component.
|
|
145
|
+
*/
|
|
146
|
+
export interface CarouselApi {
|
|
147
|
+
/**
|
|
148
|
+
* Scroll to the previous snap point if possible.
|
|
149
|
+
* @param jump - scroll instantly
|
|
150
|
+
*/
|
|
151
|
+
scrollPrev: (jump?: boolean) => void;
|
|
152
|
+
/**
|
|
153
|
+
* Scroll to the next snap point if possible.
|
|
154
|
+
* @param jump - scroll instantly
|
|
155
|
+
*/
|
|
156
|
+
scrollNext: (jump?: boolean) => void;
|
|
157
|
+
/**
|
|
158
|
+
* Scroll to a snap point by index
|
|
159
|
+
* @param index - the snap point index
|
|
160
|
+
* @param jump - scroll instantly
|
|
161
|
+
*/
|
|
162
|
+
scrollTo: (index: number, jump?: boolean) => void;
|
|
163
|
+
/**
|
|
164
|
+
* Retrieve the enabled plugins
|
|
165
|
+
*/
|
|
166
|
+
plugins: () => EmblaPluginsType | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Retrieve the inner EmblaApi object
|
|
169
|
+
*/
|
|
170
|
+
emblaApi: () => EmblaCarouselType | undefined;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Represents the directives for a carousel component.
|
|
174
|
+
*/
|
|
175
|
+
export interface CarouselDirectives {
|
|
176
|
+
/**
|
|
177
|
+
* the root directive
|
|
178
|
+
*/
|
|
179
|
+
root: Directive;
|
|
180
|
+
/**
|
|
181
|
+
* A directive to be applied to a navigation button allowing to scroll to the previous slide.
|
|
182
|
+
*/
|
|
183
|
+
scrollPrev: Directive;
|
|
184
|
+
/**
|
|
185
|
+
* A directive to be applied to a navigation button allowing to scroll to the next slide.
|
|
186
|
+
*/
|
|
187
|
+
scrollNext: Directive;
|
|
188
|
+
/**
|
|
189
|
+
* A directive to be applied to each slide in the carousel.
|
|
190
|
+
*/
|
|
191
|
+
slide: Directive<{
|
|
192
|
+
id: string;
|
|
193
|
+
index: number;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* A directive to be applied to a tab list allowing to navigate to the corresponding slide.
|
|
197
|
+
* This directive adds the role `tablist` and is recommended to be used together with {@link tabIndicator}.
|
|
198
|
+
*/
|
|
199
|
+
tabList: Directive;
|
|
200
|
+
/**
|
|
201
|
+
* A directive to be applied to a navigation indicator allowing to scroll to the corresponding slide.
|
|
202
|
+
* As this directive adds the role `tab` to the element, it is recommended to use it on a button or a link and the parent element should have the {@link tabList} directive attached.
|
|
203
|
+
*/
|
|
204
|
+
tabIndicator: Directive<{
|
|
205
|
+
index: number;
|
|
206
|
+
id: string;
|
|
207
|
+
jump?: boolean;
|
|
208
|
+
}>;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Represents a carousel widget with specific properties, state, API, and directives.
|
|
212
|
+
*/
|
|
213
|
+
export type CarouselWidget = Widget<CarouselProps, CarouselState, CarouselApi, CarouselDirectives>;
|
|
214
|
+
/**
|
|
215
|
+
* Retrieve a shallow copy of the default Carousel config
|
|
216
|
+
* @returns the default Carousel config
|
|
217
|
+
*/
|
|
218
|
+
export declare function getCarouselDefaultConfig(): CarouselProps;
|
|
219
|
+
/**
|
|
220
|
+
* An Embla Carousel widget factory.
|
|
221
|
+
*
|
|
222
|
+
* @internal
|
|
223
|
+
* @param options$ - the store of Embla options
|
|
224
|
+
* @param plugins$ - the store of Embla plugins
|
|
225
|
+
* @returns the Embla carousel widget
|
|
226
|
+
*/
|
|
227
|
+
export declare function createEmblaCarousel(options$: ReadableSignal<Partial<EmblaOptions>>, plugins$?: ReadableSignal<EmblaPluginType[]>): {
|
|
228
|
+
directive: Directive;
|
|
229
|
+
stores: {
|
|
230
|
+
scrolling$: ReadableSignal<boolean>;
|
|
231
|
+
canScrollPrev$: ReadableSignal<boolean>;
|
|
232
|
+
canScrollNext$: ReadableSignal<boolean>;
|
|
233
|
+
selectedScrollSnap$: ReadableSignal<number>;
|
|
234
|
+
initialized$: ReadableSignal<boolean>;
|
|
235
|
+
slideNodes$: ReadableSignal<HTMLElement[]>;
|
|
236
|
+
};
|
|
237
|
+
api: EmblaCarouselType | undefined;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Create an CarouselWidget with given config props
|
|
241
|
+
*
|
|
242
|
+
* @template SlideData - The type of data used by each slide in the carousel.
|
|
243
|
+
* @param config - an optional carousel config
|
|
244
|
+
* @returns a CarouselWidget
|
|
245
|
+
*/
|
|
246
|
+
export declare const createCarousel: WidgetFactory<CarouselWidget>;
|
|
247
|
+
export {};
|