@carbon/ibm-products-web-components 0.20.0 → 0.21.0-rc.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 (216) hide show
  1. package/custom-elements.json +2374 -352
  2. package/es/components/about-modal/about-modal.scss.js +1 -1
  3. package/es/components/interstitial-screen/index.d.ts +13 -0
  4. package/es/components/interstitial-screen/index.js +13 -0
  5. package/es/components/interstitial-screen/index.js.map +1 -0
  6. package/es/components/interstitial-screen/interstitial-screen-body-item.d.ts +372 -0
  7. package/es/components/interstitial-screen/interstitial-screen-body-item.js +69 -0
  8. package/es/components/interstitial-screen/interstitial-screen-body-item.js.map +1 -0
  9. package/es/components/interstitial-screen/interstitial-screen-body-item.scss.js +13 -0
  10. package/es/components/interstitial-screen/interstitial-screen-body-item.scss.js.map +1 -0
  11. package/es/components/interstitial-screen/interstitial-screen-body.d.ts +384 -0
  12. package/es/components/interstitial-screen/interstitial-screen-body.js +129 -0
  13. package/es/components/interstitial-screen/interstitial-screen-body.js.map +1 -0
  14. package/es/components/interstitial-screen/interstitial-screen-body.scss.js +13 -0
  15. package/es/components/interstitial-screen/interstitial-screen-body.scss.js.map +1 -0
  16. package/es/components/interstitial-screen/interstitial-screen-context.d.ts +18 -0
  17. package/es/components/interstitial-screen/interstitial-screen-context.js +48 -0
  18. package/es/components/interstitial-screen/interstitial-screen-context.js.map +1 -0
  19. package/es/components/interstitial-screen/interstitial-screen-footer.d.ts +409 -0
  20. package/es/components/interstitial-screen/interstitial-screen-footer.js +229 -0
  21. package/es/components/interstitial-screen/interstitial-screen-footer.js.map +1 -0
  22. package/es/components/interstitial-screen/interstitial-screen-footer.scss.js +13 -0
  23. package/es/components/interstitial-screen/interstitial-screen-footer.scss.js.map +1 -0
  24. package/es/components/interstitial-screen/interstitial-screen-header.d.ts +394 -0
  25. package/es/components/interstitial-screen/interstitial-screen-header.js +157 -0
  26. package/es/components/interstitial-screen/interstitial-screen-header.js.map +1 -0
  27. package/es/components/interstitial-screen/interstitial-screen-header.scss.js +13 -0
  28. package/es/components/interstitial-screen/interstitial-screen-header.scss.js.map +1 -0
  29. package/es/components/interstitial-screen/interstitial-screen.d.ts +420 -0
  30. package/es/components/interstitial-screen/interstitial-screen.js +186 -0
  31. package/es/components/interstitial-screen/interstitial-screen.js.map +1 -0
  32. package/es/components/interstitial-screen/interstitial-screen.scss.js +13 -0
  33. package/es/components/interstitial-screen/interstitial-screen.scss.js.map +1 -0
  34. package/es/components/notification-panel/notification-panel.scss.js +1 -1
  35. package/es/components/page-header/_story-assets/overflowHandler.d.ts +98 -0
  36. package/es/components/page-header/_story-assets/overflowHandler.js +156 -0
  37. package/es/components/page-header/_story-assets/overflowHandler.js.map +1 -0
  38. package/es/components/page-header/_story-assets/set-of-breadcrumbs.d.ts +43 -0
  39. package/es/components/page-header/_story-assets/set-of-breadcrumbs.js +153 -0
  40. package/es/components/page-header/_story-assets/set-of-breadcrumbs.js.map +1 -0
  41. package/es/components/page-header/_story-assets/set-of-breadcrumbs.scss.js +13 -0
  42. package/es/components/page-header/_story-assets/set-of-breadcrumbs.scss.js.map +1 -0
  43. package/es/components/page-header/context.d.ts +14 -0
  44. package/es/components/page-header/context.js +26 -0
  45. package/es/components/page-header/context.js.map +1 -0
  46. package/es/components/page-header/index.d.ts +2 -0
  47. package/es/components/page-header/index.js +2 -0
  48. package/es/components/page-header/index.js.map +1 -1
  49. package/es/components/page-header/page-header-scroller.d.ts +56 -0
  50. package/es/components/page-header/page-header-scroller.js +165 -0
  51. package/es/components/page-header/page-header-scroller.js.map +1 -0
  52. package/es/components/page-header/page-header-tabs.js +1 -0
  53. package/es/components/page-header/page-header-tabs.js.map +1 -1
  54. package/es/components/page-header/page-header-title-breadcrumb.d.ts +20 -0
  55. package/es/components/page-header/page-header-title-breadcrumb.js +65 -0
  56. package/es/components/page-header/page-header-title-breadcrumb.js.map +1 -0
  57. package/es/components/page-header/page-header.d.ts +11 -1
  58. package/es/components/page-header/page-header.js +54 -71
  59. package/es/components/page-header/page-header.js.map +1 -1
  60. package/es/components/page-header/page-header.scss.js +1 -1
  61. package/es/components/page-header/page-header.test.js +136 -2
  62. package/es/components/page-header/page-header.test.js.map +1 -1
  63. package/es/components/page-header/utils.d.ts +32 -0
  64. package/es/components/page-header/utils.js +76 -0
  65. package/es/components/page-header/utils.js.map +1 -0
  66. package/es/components/side-panel/side-panel.d.ts +4 -0
  67. package/es/components/side-panel/side-panel.js +33 -15
  68. package/es/components/side-panel/side-panel.js.map +1 -1
  69. package/es/components/tearsheet/tearsheet.scss.js +1 -1
  70. package/es/components/truncated-text/truncated-text.d.ts +16 -11
  71. package/es/components/truncated-text/truncated-text.js +65 -58
  72. package/es/components/truncated-text/truncated-text.js.map +1 -1
  73. package/es/components/truncated-text/truncated-text.scss.js +1 -1
  74. package/es/components/truncated-text/truncated-text.test.js +6 -6
  75. package/es/components/user-avatar/user-avatar.d.ts +8 -0
  76. package/es/components/user-avatar/user-avatar.js +1 -0
  77. package/es/components/user-avatar/user-avatar.js.map +1 -1
  78. package/es/components/user-avatar/user-avatar.scss.js +1 -1
  79. package/es/packages/ibm-products-web-components/package.json.js +1 -1
  80. package/es/utilities/carousel/carousel.d.ts +8 -0
  81. package/es/utilities/carousel/carousel.js +210 -0
  82. package/es/utilities/carousel/carousel.js.map +1 -0
  83. package/es/utilities/carousel/index.d.ts +8 -0
  84. package/es/utilities/carousel/index.js +9 -0
  85. package/es/utilities/carousel/index.js.map +1 -0
  86. package/es/utilities/carousel/swipeEvents.d.ts +7 -0
  87. package/es/utilities/carousel/swipeEvents.js +109 -0
  88. package/es/utilities/carousel/swipeEvents.js.map +1 -0
  89. package/es/utilities/carousel/types.d.ts +36 -0
  90. package/es/utilities/carousel/types.js +8 -0
  91. package/es/utilities/carousel/types.js.map +1 -0
  92. package/es-custom/components/about-modal/about-modal.scss.js +1 -1
  93. package/es-custom/components/interstitial-screen/index.d.ts +13 -0
  94. package/es-custom/components/interstitial-screen/index.js +13 -0
  95. package/es-custom/components/interstitial-screen/index.js.map +1 -0
  96. package/es-custom/components/interstitial-screen/interstitial-screen-body-item.d.ts +372 -0
  97. package/es-custom/components/interstitial-screen/interstitial-screen-body-item.js +69 -0
  98. package/es-custom/components/interstitial-screen/interstitial-screen-body-item.js.map +1 -0
  99. package/es-custom/components/interstitial-screen/interstitial-screen-body-item.scss.js +13 -0
  100. package/es-custom/components/interstitial-screen/interstitial-screen-body-item.scss.js.map +1 -0
  101. package/es-custom/components/interstitial-screen/interstitial-screen-body.d.ts +384 -0
  102. package/es-custom/components/interstitial-screen/interstitial-screen-body.js +129 -0
  103. package/es-custom/components/interstitial-screen/interstitial-screen-body.js.map +1 -0
  104. package/es-custom/components/interstitial-screen/interstitial-screen-body.scss.js +13 -0
  105. package/es-custom/components/interstitial-screen/interstitial-screen-body.scss.js.map +1 -0
  106. package/es-custom/components/interstitial-screen/interstitial-screen-context.d.ts +18 -0
  107. package/es-custom/components/interstitial-screen/interstitial-screen-context.js +48 -0
  108. package/es-custom/components/interstitial-screen/interstitial-screen-context.js.map +1 -0
  109. package/es-custom/components/interstitial-screen/interstitial-screen-footer.d.ts +409 -0
  110. package/es-custom/components/interstitial-screen/interstitial-screen-footer.js +229 -0
  111. package/es-custom/components/interstitial-screen/interstitial-screen-footer.js.map +1 -0
  112. package/es-custom/components/interstitial-screen/interstitial-screen-footer.scss.js +13 -0
  113. package/es-custom/components/interstitial-screen/interstitial-screen-footer.scss.js.map +1 -0
  114. package/es-custom/components/interstitial-screen/interstitial-screen-header.d.ts +394 -0
  115. package/es-custom/components/interstitial-screen/interstitial-screen-header.js +157 -0
  116. package/es-custom/components/interstitial-screen/interstitial-screen-header.js.map +1 -0
  117. package/es-custom/components/interstitial-screen/interstitial-screen-header.scss.js +13 -0
  118. package/es-custom/components/interstitial-screen/interstitial-screen-header.scss.js.map +1 -0
  119. package/es-custom/components/interstitial-screen/interstitial-screen.d.ts +420 -0
  120. package/es-custom/components/interstitial-screen/interstitial-screen.js +186 -0
  121. package/es-custom/components/interstitial-screen/interstitial-screen.js.map +1 -0
  122. package/es-custom/components/interstitial-screen/interstitial-screen.scss.js +13 -0
  123. package/es-custom/components/interstitial-screen/interstitial-screen.scss.js.map +1 -0
  124. package/es-custom/components/notification-panel/notification-panel.scss.js +1 -1
  125. package/es-custom/components/page-header/_story-assets/overflowHandler.d.ts +98 -0
  126. package/es-custom/components/page-header/_story-assets/overflowHandler.js +156 -0
  127. package/es-custom/components/page-header/_story-assets/overflowHandler.js.map +1 -0
  128. package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.d.ts +43 -0
  129. package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.js +153 -0
  130. package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.js.map +1 -0
  131. package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.scss.js +13 -0
  132. package/es-custom/components/page-header/_story-assets/set-of-breadcrumbs.scss.js.map +1 -0
  133. package/es-custom/components/page-header/context.d.ts +14 -0
  134. package/es-custom/components/page-header/context.js +26 -0
  135. package/es-custom/components/page-header/context.js.map +1 -0
  136. package/es-custom/components/page-header/index.d.ts +2 -0
  137. package/es-custom/components/page-header/index.js +2 -0
  138. package/es-custom/components/page-header/index.js.map +1 -1
  139. package/es-custom/components/page-header/page-header-scroller.d.ts +56 -0
  140. package/es-custom/components/page-header/page-header-scroller.js +165 -0
  141. package/es-custom/components/page-header/page-header-scroller.js.map +1 -0
  142. package/es-custom/components/page-header/page-header-tabs.js +1 -0
  143. package/es-custom/components/page-header/page-header-tabs.js.map +1 -1
  144. package/es-custom/components/page-header/page-header-title-breadcrumb.d.ts +20 -0
  145. package/es-custom/components/page-header/page-header-title-breadcrumb.js +65 -0
  146. package/es-custom/components/page-header/page-header-title-breadcrumb.js.map +1 -0
  147. package/es-custom/components/page-header/page-header.d.ts +11 -1
  148. package/es-custom/components/page-header/page-header.js +54 -71
  149. package/es-custom/components/page-header/page-header.js.map +1 -1
  150. package/es-custom/components/page-header/page-header.scss.js +1 -1
  151. package/es-custom/components/page-header/page-header.test.js +136 -2
  152. package/es-custom/components/page-header/page-header.test.js.map +1 -1
  153. package/es-custom/components/page-header/utils.d.ts +32 -0
  154. package/es-custom/components/page-header/utils.js +76 -0
  155. package/es-custom/components/page-header/utils.js.map +1 -0
  156. package/es-custom/components/side-panel/side-panel.d.ts +4 -0
  157. package/es-custom/components/side-panel/side-panel.js +33 -15
  158. package/es-custom/components/side-panel/side-panel.js.map +1 -1
  159. package/es-custom/components/tearsheet/tearsheet.scss.js +1 -1
  160. package/es-custom/components/truncated-text/truncated-text.d.ts +16 -11
  161. package/es-custom/components/truncated-text/truncated-text.js +65 -58
  162. package/es-custom/components/truncated-text/truncated-text.js.map +1 -1
  163. package/es-custom/components/truncated-text/truncated-text.scss.js +1 -1
  164. package/es-custom/components/truncated-text/truncated-text.test.js +6 -6
  165. package/es-custom/components/user-avatar/user-avatar.d.ts +8 -0
  166. package/es-custom/components/user-avatar/user-avatar.js +1 -0
  167. package/es-custom/components/user-avatar/user-avatar.js.map +1 -1
  168. package/es-custom/components/user-avatar/user-avatar.scss.js +1 -1
  169. package/es-custom/packages/ibm-products-web-components/package.json.js +1 -1
  170. package/es-custom/utilities/carousel/carousel.d.ts +8 -0
  171. package/es-custom/utilities/carousel/carousel.js +210 -0
  172. package/es-custom/utilities/carousel/carousel.js.map +1 -0
  173. package/es-custom/utilities/carousel/index.d.ts +8 -0
  174. package/es-custom/utilities/carousel/index.js +9 -0
  175. package/es-custom/utilities/carousel/index.js.map +1 -0
  176. package/es-custom/utilities/carousel/swipeEvents.d.ts +7 -0
  177. package/es-custom/utilities/carousel/swipeEvents.js +109 -0
  178. package/es-custom/utilities/carousel/swipeEvents.js.map +1 -0
  179. package/es-custom/utilities/carousel/types.d.ts +36 -0
  180. package/es-custom/utilities/carousel/types.js +8 -0
  181. package/es-custom/utilities/carousel/types.js.map +1 -0
  182. package/lib/components/interstitial-screen/index.d.ts +13 -0
  183. package/lib/components/interstitial-screen/interstitial-screen-body-item.d.ts +372 -0
  184. package/lib/components/interstitial-screen/interstitial-screen-body.d.ts +384 -0
  185. package/lib/components/interstitial-screen/interstitial-screen-context.d.ts +18 -0
  186. package/lib/components/interstitial-screen/interstitial-screen-footer.d.ts +409 -0
  187. package/lib/components/interstitial-screen/interstitial-screen-header.d.ts +394 -0
  188. package/lib/components/interstitial-screen/interstitial-screen.d.ts +420 -0
  189. package/lib/components/page-header/_story-assets/overflowHandler.d.ts +98 -0
  190. package/lib/components/page-header/_story-assets/set-of-breadcrumbs.d.ts +43 -0
  191. package/lib/components/page-header/context.d.ts +14 -0
  192. package/lib/components/page-header/index.d.ts +2 -0
  193. package/lib/components/page-header/page-header-scroller.d.ts +56 -0
  194. package/lib/components/page-header/page-header-title-breadcrumb.d.ts +20 -0
  195. package/lib/components/page-header/page-header.d.ts +11 -1
  196. package/lib/components/page-header/utils.d.ts +32 -0
  197. package/lib/components/side-panel/side-panel.d.ts +4 -0
  198. package/lib/components/truncated-text/truncated-text.d.ts +16 -11
  199. package/lib/components/user-avatar/user-avatar.d.ts +8 -0
  200. package/lib/utilities/carousel/carousel.d.ts +8 -0
  201. package/lib/utilities/carousel/index.d.ts +8 -0
  202. package/lib/utilities/carousel/swipeEvents.d.ts +7 -0
  203. package/lib/utilities/carousel/types.d.ts +36 -0
  204. package/package.json +7 -6
  205. package/scss/components/interstitial-screen/interstitial-screen-body-item.scss +18 -0
  206. package/scss/components/interstitial-screen/interstitial-screen-body.scss +30 -0
  207. package/scss/components/interstitial-screen/interstitial-screen-footer.scss +40 -0
  208. package/scss/components/interstitial-screen/interstitial-screen-header.scss +13 -0
  209. package/scss/components/interstitial-screen/interstitial-screen.scss +28 -0
  210. package/scss/components/interstitial-screen/story-styles.scss +27 -0
  211. package/scss/components/notification-panel/notification-panel.scss +0 -1
  212. package/scss/components/page-header/_story-assets/set-of-breadcrumbs.scss +41 -0
  213. package/scss/components/page-header/page-header.scss +85 -0
  214. package/scss/components/truncated-text/story-styles.scss +11 -10
  215. package/scss/components/truncated-text/truncated-text.scss +0 -15
  216. package/scss/components/user-avatar/user-avatar.scss +5 -2
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { registerSwipeEvents } from './swipeEvents.js';
9
+
10
+ /**
11
+ * Copyright IBM Corp. 2025
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ const initCarousel = (carouselContainer, config) => {
17
+ const prefix = 'carousel';
18
+ let viewIndexStack = [0];
19
+ let previousViewIndexStack = [0];
20
+ const refs = {};
21
+ const minHeight = 10; // 10 rem
22
+ const { onViewChangeStart, onViewChangeEnd, excludeSwipeSupport } = config || {};
23
+ const registerRef = (index, ref) => {
24
+ refs[index] = ref;
25
+ };
26
+ const wrapAllItems = (container, wrapperClass) => {
27
+ if (container.querySelector(`.${wrapperClass}`)) {
28
+ return;
29
+ }
30
+ const wrapper = document.createElement('div');
31
+ wrapper.classList.add(`${wrapperClass}`);
32
+ while (container.firstChild) {
33
+ wrapper.appendChild(container.firstChild);
34
+ }
35
+ container.appendChild(wrapper);
36
+ };
37
+ const getHistory = () => {
38
+ return viewIndexStack.map((id) => ({
39
+ id,
40
+ elem: refs[id],
41
+ }));
42
+ };
43
+ const getCallbackResponse = () => {
44
+ const totalRefs = Object.keys(refs).length;
45
+ const lastElementRef = refs[totalRefs - 1];
46
+ const historicalData = getHistory();
47
+ return {
48
+ currentIndex: viewIndexStack[0],
49
+ lastIndex: parseInt((lastElementRef === null || lastElementRef === void 0 ? void 0 : lastElementRef.dataset.index) || viewIndexStack[0].toString(), 10),
50
+ totalViews: totalRefs,
51
+ historyStack: historicalData,
52
+ };
53
+ };
54
+ const handleTransitionStart = () => {
55
+ previousViewIndexStack = [...viewIndexStack];
56
+ const callbackData = getCallbackResponse();
57
+ onViewChangeStart === null || onViewChangeStart === void 0 ? void 0 : onViewChangeStart(callbackData);
58
+ };
59
+ const handleTransitionEnd = (el) => {
60
+ if (!el) {
61
+ return;
62
+ }
63
+ const tmpElementIndex = el.dataset.index;
64
+ if (tmpElementIndex &&
65
+ viewIndexStack[0] === parseInt(tmpElementIndex, 10)) {
66
+ const callbackData = getCallbackResponse();
67
+ onViewChangeEnd === null || onViewChangeEnd === void 0 ? void 0 : onViewChangeEnd(callbackData);
68
+ }
69
+ };
70
+ const sanitizeIndex = (idx) => {
71
+ const floorVal = 0;
72
+ const ceilVal = Object.keys(refs).length - 1;
73
+ return Math.max(floorVal, Math.min(idx, ceilVal));
74
+ };
75
+ const transitionToViewIndex = (idx) => {
76
+ const sanitizedIndex = sanitizeIndex(idx);
77
+ if (viewIndexStack[0] !== sanitizedIndex) {
78
+ handleTransitionStart();
79
+ viewIndexStack = [sanitizedIndex, ...viewIndexStack];
80
+ performAnimation(false);
81
+ }
82
+ };
83
+ const transitionComplete = (ref) => {
84
+ handleTransitionEnd(ref);
85
+ };
86
+ const attachClassNames = (viewItem, isInViewStack, isActive, isBeingRecycledOut, isBeingRecycledIn) => {
87
+ viewItem.classList.add(`${prefix}__view`);
88
+ viewItem.classList.toggle(`${prefix}__view-in-stack`, isInViewStack && !isActive);
89
+ viewItem.classList.toggle(`${prefix}__view-active`, isInViewStack && isActive);
90
+ if (isBeingRecycledIn && !isBeingRecycledOut) {
91
+ viewItem.classList.add(`${prefix}__view-recycle-in`);
92
+ }
93
+ if (!isBeingRecycledIn && isBeingRecycledOut) {
94
+ viewItem.classList.add(`${prefix}__view-recycle-out`);
95
+ }
96
+ };
97
+ const removeReCycleClasses = (viewItem) => {
98
+ viewItem.classList.remove(`${prefix}__view-recycle-in`, `${prefix}__view-recycle-out`);
99
+ };
100
+ const remToPx = (rem) => {
101
+ return (rem * parseFloat(getComputedStyle(document.documentElement).fontSize));
102
+ };
103
+ const updateHeightForWrapper = (itemHeightSmallest) => {
104
+ const thresholdHeight = remToPx(minHeight);
105
+ const containerHeight = carouselContainer.clientHeight;
106
+ if (containerHeight < thresholdHeight) {
107
+ if (itemHeightSmallest < thresholdHeight) {
108
+ itemHeightSmallest = thresholdHeight;
109
+ }
110
+ const itemsWrapper = carouselContainer.querySelector(`.${prefix}__itemsWrapper`);
111
+ if (itemsWrapper) {
112
+ itemsWrapper.style.blockSize = `${itemHeightSmallest}px`;
113
+ }
114
+ }
115
+ };
116
+ const performAnimation = (isInitial) => {
117
+ let itemHeightSmallest = 0;
118
+ Array.from(viewItems).forEach((viewItem, index) => {
119
+ const stackIndex = viewIndexStack.findIndex((idx) => idx === index);
120
+ const stackIndexInstanceCount = previousViewIndexStack.filter((viIdx) => viIdx === index).length;
121
+ const isBeingRecycledOut = previousViewIndexStack.length > viewIndexStack.length &&
122
+ previousViewIndexStack[0] === index &&
123
+ stackIndexInstanceCount > 0;
124
+ const isBeingRecycledIn = previousViewIndexStack.length < viewIndexStack.length &&
125
+ viewIndexStack[0] === index &&
126
+ stackIndexInstanceCount > 0;
127
+ const isInViewStack = stackIndex > -1;
128
+ const isActive = index === viewIndexStack[0];
129
+ attachClassNames(viewItem, isInViewStack, isActive, isBeingRecycledOut, isBeingRecycledIn);
130
+ if (isInitial) {
131
+ registerRef(index, viewItem);
132
+ setTimeout(() => {
133
+ if (!itemHeightSmallest ||
134
+ (viewItem.offsetHeight < itemHeightSmallest &&
135
+ itemHeightSmallest > remToPx(minHeight))) {
136
+ itemHeightSmallest = viewItem.offsetHeight;
137
+ }
138
+ viewItem.style.position = 'absolute';
139
+ updateHeightForWrapper(itemHeightSmallest);
140
+ });
141
+ const listener = (e) => {
142
+ removeReCycleClasses(viewItem);
143
+ if (e.target === refs[viewIndexStack[0]]) {
144
+ //transitionend will trigger twice for pervious card and current card
145
+ transitionComplete(viewItem);
146
+ }
147
+ };
148
+ viewItem.addEventListener('animationend', listener);
149
+ viewItem.addEventListener('transitionend', listener);
150
+ viewItem.setAttribute('data-index', index.toString());
151
+ }
152
+ });
153
+ if (isInitial) {
154
+ handleTransitionEnd(Array.from(viewItems)[0]);
155
+ }
156
+ };
157
+ const navigateNext = () => {
158
+ const targetViewIndex = viewIndexStack[0] + 1;
159
+ transitionToViewIndex(targetViewIndex);
160
+ };
161
+ const navigatePrev = () => {
162
+ if (viewIndexStack.length - 1 >= 1) {
163
+ handleTransitionStart();
164
+ viewIndexStack = viewIndexStack.slice(1);
165
+ performAnimation(false);
166
+ }
167
+ };
168
+ const goToIndex = (index) => {
169
+ transitionToViewIndex(index);
170
+ };
171
+ const getActiveItem = () => {
172
+ return {
173
+ index: viewIndexStack[0],
174
+ item: refs[viewIndexStack[0]],
175
+ };
176
+ };
177
+ const reset = () => {
178
+ viewIndexStack = [0];
179
+ performAnimation(false);
180
+ };
181
+ const destroyEvents = () => {
182
+ registerSwipeEvents(carouselContainer, navigateNext, navigatePrev, true);
183
+ };
184
+ const getCarouselItems = (container) => {
185
+ const slot = container.querySelector('slot');
186
+ return slot
187
+ ? slot.assignedElements({ flatten: true })
188
+ : Array.from(container.children);
189
+ };
190
+ // initialize
191
+ wrapAllItems(carouselContainer, `${prefix}__itemsWrapper`);
192
+ const wrapper = carouselContainer.querySelector(`.${prefix}__itemsWrapper`);
193
+ const viewItems = getCarouselItems(wrapper);
194
+ carouselContainer.classList.add(`${prefix}__view-stack`);
195
+ performAnimation(true);
196
+ if (!excludeSwipeSupport) {
197
+ registerSwipeEvents(carouselContainer, navigateNext, navigatePrev, false);
198
+ }
199
+ return {
200
+ next: navigateNext,
201
+ prev: navigatePrev,
202
+ reset,
203
+ goToIndex,
204
+ getActiveItem,
205
+ destroyEvents: !excludeSwipeSupport ? destroyEvents : null,
206
+ };
207
+ };
208
+
209
+ export { initCarousel };
210
+ //# sourceMappingURL=carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.js","sources":["../../../src/utilities/carousel/carousel.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;M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C,gBAAgB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;cACvC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAmB;AACvD,KAAC;;AAGD,IAAA,YAAY,CAAC,iBAAiB,EAAE,GAAG,MAAM,CAAA,cAAA,CAAgB,CAAC;IAC1D,MAAM,OAAO,GAAG,iBAAiB,CAAC,aAAa,CAAC,CAAI,CAAA,EAAA,MAAM,CAAgB,cAAA,CAAA,CAAC;AAC3E,IAAA,MAAM,SAAS,GAAG,gBAAgB,CAAC,OAAsB,CAAC;IAE1D,iBAAiB,CAAC,SAAS,CAAC,GAAG,CAAC,CAAG,EAAA,MAAM,CAAc,YAAA,CAAA,CAAC;IACxD,gBAAgB,CAAC,IAAI,CAAC;IAEtB,IAAI,CAAC,mBAAmB,EAAE;QACxB,mBAAmB,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,CAAC;;IAG3E,OAAO;AACL,QAAA,IAAI,EAAE,YAAY;AAClB,QAAA,IAAI,EAAE,YAAY;QAClB,KAAK;QACL,SAAS;QACT,aAAa;QACb,aAAa,EAAE,CAAC,mBAAmB,GAAG,aAAa,GAAG,IAAI;KAC3D;AACH;;;;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export * from './carousel';
8
+ export * from './types';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ export { initCarousel } from './carousel.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export declare const registerSwipeEvents: (carousel: HTMLElement, next: () => void, prev: () => void, destroy: boolean) => void;
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ /**
9
+ * Copyright IBM Corp. 2025
10
+ *
11
+ * This source code is licensed under the Apache-2.0 license found in the
12
+ * LICENSE file in the root directory of this source tree.
13
+ */
14
+ const registerSwipeEvents = (carousel, next, prev, destroy) => {
15
+ const minSwipeDistance = 50;
16
+ // Touch support
17
+ let touchStartX = null;
18
+ let touchEndX = null;
19
+ let lastScrollTime = 0;
20
+ const scrollCoolDown = 400;
21
+ let isMouseDown = false;
22
+ let mouseStartX = null;
23
+ let mouseEndX = null;
24
+ //handlers
25
+ const touchStartHandler = (e) => {
26
+ touchStartX = e.touches[0].clientX;
27
+ };
28
+ const touchMoveHandler = (e) => {
29
+ touchEndX = e.touches[0].clientX;
30
+ };
31
+ const touchEndHandler = () => {
32
+ if (touchStartX !== null && touchEndX !== null) {
33
+ const distance = touchStartX - touchEndX;
34
+ if (Math.abs(distance) > minSwipeDistance) {
35
+ if (distance > 0) {
36
+ next();
37
+ }
38
+ else {
39
+ prev();
40
+ }
41
+ }
42
+ }
43
+ touchStartX = null;
44
+ touchEndX = null;
45
+ };
46
+ const mouseDownHandler = (e) => {
47
+ isMouseDown = true;
48
+ mouseStartX = e.clientX;
49
+ };
50
+ const mouseMoveHandler = (e) => {
51
+ if (!isMouseDown) {
52
+ return;
53
+ }
54
+ mouseEndX = e.clientX;
55
+ };
56
+ const mouseUpHandler = () => {
57
+ if (isMouseDown && mouseStartX !== null && mouseEndX !== null) {
58
+ const distance = mouseStartX - mouseEndX;
59
+ if (Math.abs(distance) > minSwipeDistance) {
60
+ if (distance > 0) {
61
+ next();
62
+ }
63
+ else {
64
+ prev();
65
+ }
66
+ }
67
+ }
68
+ isMouseDown = false;
69
+ mouseStartX = null;
70
+ mouseEndX = null;
71
+ };
72
+ const wheelHandler = (e) => {
73
+ const now = Date.now();
74
+ if (Math.abs(e.deltaX) > Math.abs(e.deltaY) && Math.abs(e.deltaX) > 20) {
75
+ e.preventDefault(); // Prevent page from scrolling
76
+ if (now - lastScrollTime < scrollCoolDown) {
77
+ return;
78
+ }
79
+ if (e.deltaX > 0) {
80
+ next();
81
+ }
82
+ else {
83
+ prev();
84
+ }
85
+ lastScrollTime = now;
86
+ }
87
+ };
88
+ if (destroy) {
89
+ carousel.removeEventListener('touchstart', touchStartHandler);
90
+ carousel.removeEventListener('touchmove', touchMoveHandler);
91
+ carousel.removeEventListener('touchend', touchEndHandler);
92
+ carousel.removeEventListener('mousedown', mouseDownHandler);
93
+ carousel.removeEventListener('mousemove', mouseMoveHandler);
94
+ carousel.removeEventListener('mouseup', mouseUpHandler);
95
+ carousel.removeEventListener('wheel', wheelHandler);
96
+ }
97
+ carousel.addEventListener('touchstart', touchStartHandler);
98
+ carousel.addEventListener('touchmove', touchMoveHandler);
99
+ carousel.addEventListener('touchend', touchEndHandler);
100
+ // Mouse drag support
101
+ carousel.addEventListener('mousedown', mouseDownHandler);
102
+ carousel.addEventListener('mousemove', mouseMoveHandler);
103
+ carousel.addEventListener('mouseup', mouseUpHandler);
104
+ // Wheel gesture support
105
+ carousel.addEventListener('wheel', wheelHandler);
106
+ };
107
+
108
+ export { registerSwipeEvents };
109
+ //# sourceMappingURL=swipeEvents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipeEvents.js","sources":["../../../src/utilities/carousel/swipeEvents.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AACI,MAAM,mBAAmB,GAAG,CACjC,QAAqB,EACrB,IAAgB,EAChB,IAAgB,EAChB,OAAgB,KACd;IACF,MAAM,gBAAgB,GAAG,EAAE;;IAG3B,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CAAC,SAAS,EAAE,cAAc,CAAC;AACvD,QAAA,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC;;AAGrD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,YAAY,EAAE,iBAAiB,CAAC;AAE1D,IAAA,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC;AAExD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,UAAU,EAAE,eAAe,CAAC;;AAItD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC;AAExD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,WAAW,EAAE,gBAAgB,CAAC;AAExD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC;;AAIpD,IAAA,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,CAAC;AAClD;;;;"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ interface CarouselStackHistory {
10
+ id: number;
11
+ elem: HTMLLIElement;
12
+ }
13
+ type CarouselResponse = {
14
+ currentIndex: number;
15
+ lastIndex: number;
16
+ totalViews: number;
17
+ historyStack: CarouselStackHistory[];
18
+ };
19
+ type ActiveItem = {
20
+ index: number;
21
+ item: HTMLElement | null;
22
+ };
23
+ export type Config = {
24
+ onViewChangeStart?: (args: CarouselResponse) => void;
25
+ onViewChangeEnd?: (args: CarouselResponse) => void;
26
+ excludeSwipeSupport?: boolean;
27
+ };
28
+ interface InitCarousel {
29
+ next: () => void;
30
+ prev: () => void;
31
+ reset: () => void;
32
+ goToIndex: (index: number) => void;
33
+ getActiveItem: () => ActiveItem;
34
+ destroyEvents: (() => void) | null;
35
+ }
36
+ export type { CarouselStackHistory, CarouselResponse, InitCarousel };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}