@design-factory/angular 21.1.0-next.0 → 21.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.
Files changed (191) hide show
  1. package/fesm2022/design-factory-angular-drawer.mjs +22 -29
  2. package/fesm2022/design-factory-angular-drawer.mjs.map +1 -1
  3. package/fesm2022/design-factory-angular-internals.mjs +5 -5
  4. package/fesm2022/design-factory-angular-internals.mjs.map +1 -1
  5. package/fesm2022/design-factory-angular-sidenav.mjs +139 -62
  6. package/fesm2022/design-factory-angular-sidenav.mjs.map +1 -1
  7. package/fesm2022/design-factory-angular-theme.mjs +1 -1
  8. package/fesm2022/design-factory-angular-theme.mjs.map +1 -1
  9. package/fesm2022/design-factory-angular-topnav.mjs +152 -75
  10. package/fesm2022/design-factory-angular-topnav.mjs.map +1 -1
  11. package/package.json +3 -6
  12. package/types/design-factory-angular-drawer.d.ts +13 -14
  13. package/types/design-factory-angular-internals.d.ts +3 -3
  14. package/types/design-factory-angular-sidenav.d.ts +19 -6
  15. package/types/design-factory-angular-topnav.d.ts +13 -6
  16. package/node_modules/@agnos-ui/core/README.md +0 -5
  17. package/node_modules/@agnos-ui/core/accordion-BC_9xn23.cjs +0 -314
  18. package/node_modules/@agnos-ui/core/accordion-Ca_0T8Bc.js +0 -315
  19. package/node_modules/@agnos-ui/core/alert-AhaliJ17.cjs +0 -9
  20. package/node_modules/@agnos-ui/core/alert-Cb9FhbFQ.js +0 -10
  21. package/node_modules/@agnos-ui/core/collapse-COriZO7o.cjs +0 -94
  22. package/node_modules/@agnos-ui/core/collapse-CP79atna.js +0 -95
  23. package/node_modules/@agnos-ui/core/common-B5jS-Ih_.cjs +0 -73
  24. package/node_modules/@agnos-ui/core/common-DFyZvkII.js +0 -74
  25. package/node_modules/@agnos-ui/core/components/accordion/accordion.d.ts +0 -333
  26. package/node_modules/@agnos-ui/core/components/accordion/index.cjs +0 -7
  27. package/node_modules/@agnos-ui/core/components/accordion/index.d.ts +0 -1
  28. package/node_modules/@agnos-ui/core/components/accordion/index.js +0 -7
  29. package/node_modules/@agnos-ui/core/components/alert/alert.d.ts +0 -37
  30. package/node_modules/@agnos-ui/core/components/alert/common.d.ts +0 -138
  31. package/node_modules/@agnos-ui/core/components/alert/index.cjs +0 -5
  32. package/node_modules/@agnos-ui/core/components/alert/index.d.ts +0 -1
  33. package/node_modules/@agnos-ui/core/components/alert/index.js +0 -5
  34. package/node_modules/@agnos-ui/core/components/carousel/carousel.d.ts +0 -247
  35. package/node_modules/@agnos-ui/core/components/carousel/index.cjs +0 -292
  36. package/node_modules/@agnos-ui/core/components/carousel/index.d.ts +0 -1
  37. package/node_modules/@agnos-ui/core/components/carousel/index.js +0 -292
  38. package/node_modules/@agnos-ui/core/components/collapse/collapse.d.ts +0 -135
  39. package/node_modules/@agnos-ui/core/components/collapse/index.cjs +0 -5
  40. package/node_modules/@agnos-ui/core/components/collapse/index.d.ts +0 -1
  41. package/node_modules/@agnos-ui/core/components/collapse/index.js +0 -5
  42. package/node_modules/@agnos-ui/core/components/commonProps.d.ts +0 -11
  43. package/node_modules/@agnos-ui/core/components/drawer/drawer.d.ts +0 -279
  44. package/node_modules/@agnos-ui/core/components/drawer/index.cjs +0 -5
  45. package/node_modules/@agnos-ui/core/components/drawer/index.d.ts +0 -1
  46. package/node_modules/@agnos-ui/core/components/drawer/index.js +0 -5
  47. package/node_modules/@agnos-ui/core/components/modal/index.cjs +0 -8
  48. package/node_modules/@agnos-ui/core/components/modal/index.d.ts +0 -1
  49. package/node_modules/@agnos-ui/core/components/modal/index.js +0 -8
  50. package/node_modules/@agnos-ui/core/components/modal/modal.d.ts +0 -245
  51. package/node_modules/@agnos-ui/core/components/pagination/index.cjs +0 -5
  52. package/node_modules/@agnos-ui/core/components/pagination/index.d.ts +0 -1
  53. package/node_modules/@agnos-ui/core/components/pagination/index.js +0 -5
  54. package/node_modules/@agnos-ui/core/components/pagination/pagination.d.ts +0 -313
  55. package/node_modules/@agnos-ui/core/components/progressbar/index.cjs +0 -5
  56. package/node_modules/@agnos-ui/core/components/progressbar/index.d.ts +0 -1
  57. package/node_modules/@agnos-ui/core/components/progressbar/index.js +0 -5
  58. package/node_modules/@agnos-ui/core/components/progressbar/progressbar.d.ts +0 -91
  59. package/node_modules/@agnos-ui/core/components/rating/index.cjs +0 -5
  60. package/node_modules/@agnos-ui/core/components/rating/index.d.ts +0 -1
  61. package/node_modules/@agnos-ui/core/components/rating/index.js +0 -5
  62. package/node_modules/@agnos-ui/core/components/rating/rating.d.ts +0 -191
  63. package/node_modules/@agnos-ui/core/components/slider/index.cjs +0 -5
  64. package/node_modules/@agnos-ui/core/components/slider/index.d.ts +0 -1
  65. package/node_modules/@agnos-ui/core/components/slider/index.js +0 -5
  66. package/node_modules/@agnos-ui/core/components/slider/slider-utils.d.ts +0 -25
  67. package/node_modules/@agnos-ui/core/components/slider/slider.d.ts +0 -383
  68. package/node_modules/@agnos-ui/core/components/toast/index.cjs +0 -7
  69. package/node_modules/@agnos-ui/core/components/toast/index.d.ts +0 -2
  70. package/node_modules/@agnos-ui/core/components/toast/index.js +0 -7
  71. package/node_modules/@agnos-ui/core/components/toast/toast.d.ts +0 -66
  72. package/node_modules/@agnos-ui/core/components/toast/toaster.d.ts +0 -128
  73. package/node_modules/@agnos-ui/core/components/tree/index.cjs +0 -5
  74. package/node_modules/@agnos-ui/core/components/tree/index.d.ts +0 -1
  75. package/node_modules/@agnos-ui/core/components/tree/index.js +0 -5
  76. package/node_modules/@agnos-ui/core/components/tree/tree.d.ts +0 -143
  77. package/node_modules/@agnos-ui/core/config.cjs +0 -36
  78. package/node_modules/@agnos-ui/core/config.d.ts +0 -117
  79. package/node_modules/@agnos-ui/core/config.js +0 -36
  80. package/node_modules/@agnos-ui/core/directive-Bsreu2z1.js +0 -523
  81. package/node_modules/@agnos-ui/core/directive-DCaXmRe_.cjs +0 -522
  82. package/node_modules/@agnos-ui/core/drawer-BbFAHV07.cjs +0 -328
  83. package/node_modules/@agnos-ui/core/drawer-C6Qa0xEu.js +0 -329
  84. package/node_modules/@agnos-ui/core/index.cjs +0 -134
  85. package/node_modules/@agnos-ui/core/index.d.ts +0 -29
  86. package/node_modules/@agnos-ui/core/index.js +0 -134
  87. package/node_modules/@agnos-ui/core/isFocusable-Ckwus82R.js +0 -32
  88. package/node_modules/@agnos-ui/core/isFocusable-DfzDLeAN.cjs +0 -31
  89. package/node_modules/@agnos-ui/core/modal-BsNuHhT7.cjs +0 -252
  90. package/node_modules/@agnos-ui/core/modal-CgzY8ezz.js +0 -253
  91. package/node_modules/@agnos-ui/core/package.json +0 -57
  92. package/node_modules/@agnos-ui/core/pagination-ZxGaNWZz.js +0 -255
  93. package/node_modules/@agnos-ui/core/pagination-xbcOHnhd.cjs +0 -254
  94. package/node_modules/@agnos-ui/core/progressbar-CRbMKp4b.cjs +0 -86
  95. package/node_modules/@agnos-ui/core/progressbar-CSEIFnlD.js +0 -87
  96. package/node_modules/@agnos-ui/core/promise-CxCD3NYv.cjs +0 -118
  97. package/node_modules/@agnos-ui/core/promise-D-RZVPuv.js +0 -119
  98. package/node_modules/@agnos-ui/core/rating-BIdiiPUo.js +0 -184
  99. package/node_modules/@agnos-ui/core/rating-qx1xaBmz.cjs +0 -183
  100. package/node_modules/@agnos-ui/core/scrollbars-CT87iv_6.cjs +0 -30
  101. package/node_modules/@agnos-ui/core/scrollbars-CcxSrnCx.js +0 -31
  102. package/node_modules/@agnos-ui/core/services/extendWidget.cjs +0 -41
  103. package/node_modules/@agnos-ui/core/services/extendWidget.d.ts +0 -31
  104. package/node_modules/@agnos-ui/core/services/extendWidget.js +0 -41
  105. package/node_modules/@agnos-ui/core/services/floatingUI.cjs +0 -111
  106. package/node_modules/@agnos-ui/core/services/floatingUI.d.ts +0 -76
  107. package/node_modules/@agnos-ui/core/services/floatingUI.js +0 -111
  108. package/node_modules/@agnos-ui/core/services/focusElement.cjs +0 -46
  109. package/node_modules/@agnos-ui/core/services/focusElement.d.ts +0 -9
  110. package/node_modules/@agnos-ui/core/services/focusElement.js +0 -46
  111. package/node_modules/@agnos-ui/core/services/focustrack.cjs +0 -47
  112. package/node_modules/@agnos-ui/core/services/focustrack.d.ts +0 -40
  113. package/node_modules/@agnos-ui/core/services/focustrack.js +0 -47
  114. package/node_modules/@agnos-ui/core/services/hash.cjs +0 -15
  115. package/node_modules/@agnos-ui/core/services/hash.d.ts +0 -3
  116. package/node_modules/@agnos-ui/core/services/hash.js +0 -15
  117. package/node_modules/@agnos-ui/core/services/intersection.cjs +0 -53
  118. package/node_modules/@agnos-ui/core/services/intersection.d.ts +0 -30
  119. package/node_modules/@agnos-ui/core/services/intersection.js +0 -53
  120. package/node_modules/@agnos-ui/core/services/matchMedia.cjs +0 -14
  121. package/node_modules/@agnos-ui/core/services/matchMedia.d.ts +0 -8
  122. package/node_modules/@agnos-ui/core/services/matchMedia.js +0 -14
  123. package/node_modules/@agnos-ui/core/services/navManager.cjs +0 -166
  124. package/node_modules/@agnos-ui/core/services/navManager.d.ts +0 -144
  125. package/node_modules/@agnos-ui/core/services/navManager.js +0 -166
  126. package/node_modules/@agnos-ui/core/services/pointerdownPosition.cjs +0 -60
  127. package/node_modules/@agnos-ui/core/services/pointerdownPosition.d.ts +0 -42
  128. package/node_modules/@agnos-ui/core/services/pointerdownPosition.js +0 -60
  129. package/node_modules/@agnos-ui/core/services/portal.cjs +0 -42
  130. package/node_modules/@agnos-ui/core/services/portal.d.ts +0 -16
  131. package/node_modules/@agnos-ui/core/services/portal.js +0 -42
  132. package/node_modules/@agnos-ui/core/services/resizeObserver.cjs +0 -54
  133. package/node_modules/@agnos-ui/core/services/resizeObserver.d.ts +0 -18
  134. package/node_modules/@agnos-ui/core/services/resizeObserver.js +0 -54
  135. package/node_modules/@agnos-ui/core/services/siblingsInert.cjs +0 -44
  136. package/node_modules/@agnos-ui/core/services/siblingsInert.d.ts +0 -16
  137. package/node_modules/@agnos-ui/core/services/siblingsInert.js +0 -44
  138. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.cjs +0 -186
  139. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.d.ts +0 -166
  140. package/node_modules/@agnos-ui/core/services/transitions/baseTransitions.js +0 -186
  141. package/node_modules/@agnos-ui/core/services/transitions/collapse.cjs +0 -40
  142. package/node_modules/@agnos-ui/core/services/transitions/collapse.d.ts +0 -49
  143. package/node_modules/@agnos-ui/core/services/transitions/collapse.js +0 -40
  144. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.cjs +0 -32
  145. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.d.ts +0 -25
  146. package/node_modules/@agnos-ui/core/services/transitions/cssTransitions.js +0 -32
  147. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.cjs +0 -37
  148. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.d.ts +0 -47
  149. package/node_modules/@agnos-ui/core/services/transitions/simpleClassTransition.js +0 -37
  150. package/node_modules/@agnos-ui/core/slider-B93hE0ag.cjs +0 -807
  151. package/node_modules/@agnos-ui/core/slider-Cjiq9FgI.js +0 -808
  152. package/node_modules/@agnos-ui/core/textDirection-cNgt24LJ.js +0 -4
  153. package/node_modules/@agnos-ui/core/textDirection-zqcZ5-eK.cjs +0 -3
  154. package/node_modules/@agnos-ui/core/toaster-BQWqxYv-.cjs +0 -190
  155. package/node_modules/@agnos-ui/core/toaster-BzEkshT2.js +0 -191
  156. package/node_modules/@agnos-ui/core/tree-DY04XPPg.cjs +0 -228
  157. package/node_modules/@agnos-ui/core/tree-HwcvZ0_p.js +0 -229
  158. package/node_modules/@agnos-ui/core/types.cjs +0 -6
  159. package/node_modules/@agnos-ui/core/types.d.ts +0 -246
  160. package/node_modules/@agnos-ui/core/types.js +0 -6
  161. package/node_modules/@agnos-ui/core/utils/directive.cjs +0 -28
  162. package/node_modules/@agnos-ui/core/utils/directive.d.ts +0 -352
  163. package/node_modules/@agnos-ui/core/utils/directive.js +0 -28
  164. package/node_modules/@agnos-ui/core/utils/func.cjs +0 -7
  165. package/node_modules/@agnos-ui/core/utils/func.d.ts +0 -11
  166. package/node_modules/@agnos-ui/core/utils/func.js +0 -7
  167. package/node_modules/@agnos-ui/core/utils/id.cjs +0 -5
  168. package/node_modules/@agnos-ui/core/utils/id.d.ts +0 -6
  169. package/node_modules/@agnos-ui/core/utils/id.js +0 -5
  170. package/node_modules/@agnos-ui/core/utils/internal/assign.d.ts +0 -10
  171. package/node_modules/@agnos-ui/core/utils/internal/checks.d.ts +0 -57
  172. package/node_modules/@agnos-ui/core/utils/internal/dom.d.ts +0 -75
  173. package/node_modules/@agnos-ui/core/utils/internal/isFocusable.d.ts +0 -9
  174. package/node_modules/@agnos-ui/core/utils/internal/math.d.ts +0 -5
  175. package/node_modules/@agnos-ui/core/utils/internal/promise.d.ts +0 -98
  176. package/node_modules/@agnos-ui/core/utils/internal/scrollbars.d.ts +0 -8
  177. package/node_modules/@agnos-ui/core/utils/internal/sort.d.ts +0 -16
  178. package/node_modules/@agnos-ui/core/utils/internal/ssrHTMLElement.d.ts +0 -17
  179. package/node_modules/@agnos-ui/core/utils/internal/textDirection.d.ts +0 -7
  180. package/node_modules/@agnos-ui/core/utils/internal/traversal.d.ts +0 -54
  181. package/node_modules/@agnos-ui/core/utils/stores.cjs +0 -172
  182. package/node_modules/@agnos-ui/core/utils/stores.d.ts +0 -224
  183. package/node_modules/@agnos-ui/core/utils/stores.js +0 -172
  184. package/node_modules/@agnos-ui/core/utils/widget.cjs +0 -8
  185. package/node_modules/@agnos-ui/core/utils/widget.d.ts +0 -11
  186. package/node_modules/@agnos-ui/core/utils/widget.js +0 -8
  187. package/node_modules/@agnos-ui/core/utils/writables.cjs +0 -16
  188. package/node_modules/@agnos-ui/core/utils/writables.d.ts +0 -95
  189. package/node_modules/@agnos-ui/core/utils/writables.js +0 -16
  190. package/node_modules/@agnos-ui/core/writables-DYGjj5T3.js +0 -103
  191. package/node_modules/@agnos-ui/core/writables-Dt68gADJ.cjs +0 -102
@@ -1,247 +0,0 @@
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 {};
@@ -1,292 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const utils_stores = require("../../utils/stores.cjs");
4
- const utils_directive = require("../../directive-DCaXmRe_.cjs");
5
- const EmblaCarousel = require("embla-carousel");
6
- const tansu = require("@amadeus-it-group/tansu");
7
- const utils_writables = require("../../writables-Dt68gADJ.cjs");
8
- const services_navManager = require("../../services/navManager.cjs");
9
- const utils_widget = require("../../utils/widget.cjs");
10
- const defaultConfig = {
11
- align: "center",
12
- container: null,
13
- containScroll: "trimSnaps",
14
- direction: "ltr",
15
- dragFree: false,
16
- dragThreshold: 10,
17
- duration: 25,
18
- loop: false,
19
- skipSnaps: false,
20
- plugins: [],
21
- showNavigationArrows: true,
22
- showNavigationIndicators: true,
23
- ariaPrevLabel: "Select previous slide",
24
- ariaNextLabel: "Select next slide",
25
- ariaIndicatorLabel: (index) => `Select slide ${index + 1}`
26
- };
27
- function getCarouselDefaultConfig() {
28
- return { ...defaultConfig };
29
- }
30
- const configValidator = {
31
- dragFree: utils_writables.typeBoolean,
32
- plugins: utils_writables.typeArray,
33
- align: utils_writables.createTypeEnum(["start", "center", "end"]),
34
- container: utils_writables.typeStringOrNull,
35
- containScroll: utils_writables.createTypeEnum([false, "trimSnaps", "keepSnaps"]),
36
- direction: utils_writables.createTypeEnum(["ltr", "rtl"]),
37
- dragThreshold: utils_writables.typeNumber,
38
- duration: utils_writables.typeNumber,
39
- loop: utils_writables.typeBoolean,
40
- skipSnaps: utils_writables.typeBoolean,
41
- showNavigationArrows: utils_writables.typeBoolean,
42
- showNavigationIndicators: utils_writables.typeBoolean,
43
- ariaPrevLabel: utils_writables.typeString,
44
- ariaNextLabel: utils_writables.typeString,
45
- ariaIndicatorLabel: utils_writables.typeFunction
46
- };
47
- function createEmblaCarousel(options$, plugins$) {
48
- let emblaApi;
49
- const scrolling$ = tansu.writable(false);
50
- const canScrollPrev$ = tansu.writable(false);
51
- const canScrollNext$ = tansu.writable(true);
52
- const selectedScrollSnap$ = tansu.writable(0);
53
- const initialized$ = tansu.writable(false);
54
- const slideNodes$ = tansu.writable([]);
55
- const directiveArgs$ = tansu.computed(() => ({
56
- options: options$(),
57
- plugins: plugins$ ? plugins$() : []
58
- }));
59
- return {
60
- directive: utils_directive.bindDirective(
61
- utils_directive.browserDirective(
62
- (element, { options, plugins }) => {
63
- if (emblaApi) {
64
- throw new Error("Only one Embla directive can be attached per carousel widget !");
65
- }
66
- emblaApi = EmblaCarousel(element, options, plugins);
67
- emblaApi.on("scroll", () => {
68
- scrolling$.set(true);
69
- });
70
- emblaApi.on("settle", () => {
71
- scrolling$.set(false);
72
- });
73
- emblaApi.on("select", (api) => {
74
- canScrollNext$.set(api.canScrollNext());
75
- canScrollPrev$.set(api.canScrollPrev());
76
- selectedScrollSnap$.set(api.selectedScrollSnap());
77
- });
78
- emblaApi.on("init", () => {
79
- initialized$.set(true);
80
- });
81
- emblaApi.on("reInit", (api) => {
82
- canScrollNext$.set(api.canScrollNext());
83
- canScrollPrev$.set(api.canScrollPrev());
84
- scrolling$.set(false);
85
- selectedScrollSnap$.set(api.selectedScrollSnap());
86
- });
87
- emblaApi.on("slidesChanged", (api) => {
88
- slideNodes$.set(api.slideNodes());
89
- });
90
- canScrollNext$.set(emblaApi.canScrollNext());
91
- canScrollPrev$.set(emblaApi.canScrollPrev());
92
- slideNodes$.set(emblaApi.slideNodes());
93
- return {
94
- update: ({ options: options2, plugins: plugins2 }) => {
95
- emblaApi.reInit(options2, plugins2);
96
- },
97
- destroy: () => {
98
- emblaApi?.destroy();
99
- emblaApi = void 0;
100
- initialized$.set(false);
101
- scrolling$.set(false);
102
- canScrollPrev$.set(false);
103
- canScrollNext$.set(true);
104
- selectedScrollSnap$.set(0);
105
- slideNodes$.set([]);
106
- }
107
- };
108
- }
109
- ),
110
- directiveArgs$
111
- ),
112
- stores: {
113
- scrolling$: tansu.asReadable(scrolling$),
114
- canScrollPrev$: tansu.asReadable(canScrollPrev$),
115
- canScrollNext$: tansu.asReadable(canScrollNext$),
116
- selectedScrollSnap$: tansu.asReadable(selectedScrollSnap$),
117
- initialized$: tansu.asReadable(initialized$),
118
- slideNodes$: tansu.asReadable(slideNodes$)
119
- },
120
- get api() {
121
- return emblaApi;
122
- }
123
- };
124
- }
125
- const createCarousel = utils_widget.createWidgetFactory(
126
- "carousel",
127
- (config) => {
128
- const [
129
- {
130
- align$,
131
- container$,
132
- containScroll$,
133
- direction$,
134
- dragFree$,
135
- dragThreshold$,
136
- duration$,
137
- loop$,
138
- skipSnaps$,
139
- plugins$,
140
- ariaPrevLabel$,
141
- ariaNextLabel$,
142
- ariaIndicatorLabel$,
143
- showNavigationIndicators$,
144
- ...stateProps
145
- },
146
- patch
147
- ] = utils_stores.writablesForProps(defaultConfig, config, configValidator);
148
- const emblaOptions$ = tansu.computed(() => ({
149
- align: align$(),
150
- container: container$(),
151
- containScroll: containScroll$(),
152
- direction: direction$(),
153
- dragFree: dragFree$(),
154
- dragThreshold: dragThreshold$(),
155
- duration: duration$(),
156
- loop: loop$(),
157
- skipSnaps: skipSnaps$()
158
- }));
159
- const emblaCarousel = createEmblaCarousel(emblaOptions$, plugins$);
160
- const {
161
- stores: { slideNodes$, ...emblaStores }
162
- } = emblaCarousel;
163
- const {
164
- directive: navDirective,
165
- refreshElements,
166
- focusLeft,
167
- focusRight,
168
- focusFirst,
169
- focusLast
170
- } = services_navManager.createNavManager();
171
- const navManagerConfig = {
172
- keys: {
173
- ArrowLeft: focusLeft,
174
- ArrowRight: focusRight,
175
- Home: focusFirst,
176
- End: focusLast
177
- },
178
- selector: (node) => node.querySelectorAll("[role='tab']")
179
- };
180
- return {
181
- ...utils_stores.stateStores({
182
- ...emblaStores,
183
- ...stateProps,
184
- direction$,
185
- showNavigationIndicators$
186
- }),
187
- patch,
188
- api: {
189
- scrollPrev: (jump) => {
190
- emblaCarousel.api?.scrollPrev?.(jump);
191
- },
192
- scrollNext: (jump) => {
193
- emblaCarousel.api?.scrollNext?.(jump);
194
- },
195
- scrollTo: (index, jump) => {
196
- emblaCarousel.api?.scrollTo?.(index, jump);
197
- },
198
- plugins: () => emblaCarousel.api?.plugins?.(),
199
- emblaApi: () => emblaCarousel.api
200
- },
201
- directives: {
202
- root: utils_directive.mergeDirectives(
203
- emblaCarousel.directive,
204
- utils_directive.createAttributesDirective(() => ({
205
- classNames: {
206
- "au-carousel": utils_stores.true$
207
- },
208
- attributes: {
209
- role: tansu.readable("region"),
210
- "aria-roledescription": tansu.readable("carousel"),
211
- dir: direction$
212
- }
213
- }))
214
- ),
215
- scrollPrev: utils_directive.createAttributesDirective(() => ({
216
- attributes: {
217
- "aria-label": ariaPrevLabel$,
218
- disabled: tansu.computed(() => !emblaCarousel.stores.canScrollPrev$() || void 0)
219
- },
220
- events: {
221
- click: () => emblaCarousel.api?.scrollPrev(),
222
- pointerdown: (event) => event.preventDefault(),
223
- touchstart: (event) => event.stopPropagation()
224
- }
225
- })),
226
- scrollNext: utils_directive.createAttributesDirective(() => ({
227
- attributes: {
228
- "aria-label": ariaNextLabel$,
229
- disabled: tansu.computed(() => !emblaCarousel.stores.canScrollNext$() || void 0)
230
- },
231
- events: {
232
- click: () => emblaCarousel.api?.scrollNext(),
233
- pointerdown: (event) => event.preventDefault(),
234
- touchstart: (event) => event.stopPropagation()
235
- }
236
- })),
237
- tabList: utils_directive.mergeDirectives(
238
- utils_directive.bindDirective(navDirective, tansu.readable(navManagerConfig)),
239
- utils_directive.browserDirective(() => {
240
- const unsubscribe = slideNodes$.subscribe(() => {
241
- refreshElements();
242
- });
243
- return {
244
- destroy: unsubscribe
245
- };
246
- }),
247
- utils_directive.createAttributesDirective(() => ({
248
- attributes: {
249
- role: tansu.readable("tablist")
250
- }
251
- }))
252
- ),
253
- tabIndicator: utils_directive.createAttributesDirective(
254
- (slide$) => ({
255
- events: {
256
- click: () => {
257
- emblaCarousel.api?.scrollTo(slide$().index, slide$().jump ?? true);
258
- }
259
- },
260
- attributes: {
261
- "aria-label": tansu.computed(() => ariaIndicatorLabel$()(slide$().index)),
262
- "aria-selected": tansu.computed(
263
- () => slide$().index === emblaCarousel.stores.selectedScrollSnap$() ? "true" : void 0
264
- ),
265
- "aria-controls": tansu.computed(() => slide$().id),
266
- role: tansu.readable("tab"),
267
- tabindex: tansu.computed(() => slide$().index === emblaCarousel.stores.selectedScrollSnap$() ? "0" : "-1")
268
- }
269
- })
270
- ),
271
- slide: utils_directive.createAttributesDirective((slide$) => {
272
- const selected$ = tansu.computed(() => slide$().index === emblaCarousel.stores.selectedScrollSnap$());
273
- return {
274
- attributes: {
275
- id: tansu.computed(() => slide$().id),
276
- "aria-hidden": tansu.computed(() => selected$() ? void 0 : "true"),
277
- role: tansu.computed(() => showNavigationIndicators$() ? "tabpanel" : "group"),
278
- "aria-roledescription": tansu.computed(() => showNavigationIndicators$() ? void 0 : "slide"),
279
- tabindex: tansu.computed(() => showNavigationIndicators$() && selected$() ? "0" : void 0)
280
- },
281
- classNames: {
282
- "au-carousel-slide": utils_stores.true$
283
- }
284
- };
285
- })
286
- }
287
- };
288
- }
289
- );
290
- exports.createCarousel = createCarousel;
291
- exports.createEmblaCarousel = createEmblaCarousel;
292
- exports.getCarouselDefaultConfig = getCarouselDefaultConfig;
@@ -1 +0,0 @@
1
- export * from './carousel';