@alfalab/core-components-page-indicator 3.0.3 → 3.0.4-alfasans

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 (195) hide show
  1. package/components/bullet/Component.js +4 -4
  2. package/components/bullet/Component.js.map +1 -1
  3. package/components/bullet/default.css +2 -2
  4. package/components/bullet/default.module.css.js +1 -1
  5. package/components/bullet/index.css +7 -9
  6. package/components/bullet/index.module.css.js +1 -1
  7. package/components/bullet/index.module.css.js.map +1 -1
  8. package/components/bullet/inverted.css +2 -2
  9. package/components/bullet/inverted.module.css.js +1 -1
  10. package/components/bullet/static-inverted.css +2 -2
  11. package/components/bullet/static-inverted.module.css.js +1 -1
  12. package/components/bullet/static.css +2 -2
  13. package/components/bullet/static.module.css.js +1 -1
  14. package/components/dynamic/Component.js +3 -3
  15. package/components/dynamic/Component.js.map +1 -1
  16. package/components/dynamic/default.css +3 -3
  17. package/components/dynamic/default.module.css.js +1 -1
  18. package/components/dynamic/index.css +6 -8
  19. package/components/dynamic/index.module.css.js +1 -1
  20. package/components/dynamic/index.module.css.js.map +1 -1
  21. package/components/dynamic/inverted.css +3 -3
  22. package/components/dynamic/inverted.module.css.js +1 -1
  23. package/components/dynamic/static-inverted.css +3 -3
  24. package/components/dynamic/static-inverted.module.css.js +1 -1
  25. package/components/dynamic/static.css +3 -3
  26. package/components/dynamic/static.module.css.js +1 -1
  27. package/components/runner/Component.js +2 -2
  28. package/components/runner/Component.js.map +1 -1
  29. package/components/runner/default.css +2 -2
  30. package/components/runner/default.module.css.js +1 -1
  31. package/components/runner/index.css +4 -1
  32. package/components/runner/index.module.css.js +1 -1
  33. package/components/runner/index.module.css.js.map +1 -1
  34. package/components/runner/inverted.css +2 -2
  35. package/components/runner/inverted.module.css.js +1 -1
  36. package/components/runner/static-inverted.css +2 -2
  37. package/components/runner/static-inverted.module.css.js +1 -1
  38. package/components/runner/static.css +2 -2
  39. package/components/runner/static.module.css.js +1 -1
  40. package/components/step/Component.js +3 -3
  41. package/components/step/Component.js.map +1 -1
  42. package/components/step/default.css +2 -2
  43. package/components/step/default.module.css.js +1 -1
  44. package/components/step/index.css +3 -4
  45. package/components/step/index.module.css.js +1 -1
  46. package/components/step/index.module.css.js.map +1 -1
  47. package/components/step/inverted.css +2 -2
  48. package/components/step/inverted.module.css.js +1 -1
  49. package/components/step/static-inverted.css +2 -2
  50. package/components/step/static-inverted.module.css.js +1 -1
  51. package/components/step/static.css +2 -2
  52. package/components/step/static.module.css.js +1 -1
  53. package/cssm/components/bullet/Component.js +4 -4
  54. package/cssm/components/bullet/Component.js.map +1 -1
  55. package/cssm/components/bullet/index.module.css +0 -2
  56. package/cssm/components/dynamic/Component.js +3 -3
  57. package/cssm/components/dynamic/Component.js.map +1 -1
  58. package/cssm/components/dynamic/index.module.css +0 -2
  59. package/cssm/components/runner/Component.js +2 -2
  60. package/cssm/components/runner/Component.js.map +1 -1
  61. package/cssm/components/runner/index.module.css +3 -0
  62. package/cssm/components/step/Component.js +3 -3
  63. package/cssm/components/step/Component.js.map +1 -1
  64. package/cssm/components/step/index.module.css +1 -2
  65. package/cssm/types.d.ts +15 -35
  66. package/esm/components/bullet/Component.js +4 -4
  67. package/esm/components/bullet/Component.js.map +1 -1
  68. package/esm/components/bullet/default.css +2 -2
  69. package/esm/components/bullet/default.module.css.js +1 -1
  70. package/esm/components/bullet/index.css +7 -9
  71. package/esm/components/bullet/index.module.css.js +1 -1
  72. package/esm/components/bullet/index.module.css.js.map +1 -1
  73. package/esm/components/bullet/inverted.css +2 -2
  74. package/esm/components/bullet/inverted.module.css.js +1 -1
  75. package/esm/components/bullet/static-inverted.css +2 -2
  76. package/esm/components/bullet/static-inverted.module.css.js +1 -1
  77. package/esm/components/bullet/static.css +2 -2
  78. package/esm/components/bullet/static.module.css.js +1 -1
  79. package/esm/components/dynamic/Component.js +3 -3
  80. package/esm/components/dynamic/Component.js.map +1 -1
  81. package/esm/components/dynamic/default.css +3 -3
  82. package/esm/components/dynamic/default.module.css.js +1 -1
  83. package/esm/components/dynamic/index.css +6 -8
  84. package/esm/components/dynamic/index.module.css.js +1 -1
  85. package/esm/components/dynamic/index.module.css.js.map +1 -1
  86. package/esm/components/dynamic/inverted.css +3 -3
  87. package/esm/components/dynamic/inverted.module.css.js +1 -1
  88. package/esm/components/dynamic/static-inverted.css +3 -3
  89. package/esm/components/dynamic/static-inverted.module.css.js +1 -1
  90. package/esm/components/dynamic/static.css +3 -3
  91. package/esm/components/dynamic/static.module.css.js +1 -1
  92. package/esm/components/runner/Component.js +2 -2
  93. package/esm/components/runner/Component.js.map +1 -1
  94. package/esm/components/runner/default.css +2 -2
  95. package/esm/components/runner/default.module.css.js +1 -1
  96. package/esm/components/runner/index.css +4 -1
  97. package/esm/components/runner/index.module.css.js +1 -1
  98. package/esm/components/runner/index.module.css.js.map +1 -1
  99. package/esm/components/runner/inverted.css +2 -2
  100. package/esm/components/runner/inverted.module.css.js +1 -1
  101. package/esm/components/runner/static-inverted.css +2 -2
  102. package/esm/components/runner/static-inverted.module.css.js +1 -1
  103. package/esm/components/runner/static.css +2 -2
  104. package/esm/components/runner/static.module.css.js +1 -1
  105. package/esm/components/step/Component.js +3 -3
  106. package/esm/components/step/Component.js.map +1 -1
  107. package/esm/components/step/default.css +2 -2
  108. package/esm/components/step/default.module.css.js +1 -1
  109. package/esm/components/step/index.css +3 -4
  110. package/esm/components/step/index.module.css.js +1 -1
  111. package/esm/components/step/index.module.css.js.map +1 -1
  112. package/esm/components/step/inverted.css +2 -2
  113. package/esm/components/step/inverted.module.css.js +1 -1
  114. package/esm/components/step/static-inverted.css +2 -2
  115. package/esm/components/step/static-inverted.module.css.js +1 -1
  116. package/esm/components/step/static.css +2 -2
  117. package/esm/components/step/static.module.css.js +1 -1
  118. package/esm/types.d.ts +15 -35
  119. package/modern/components/bullet/Component.js +4 -4
  120. package/modern/components/bullet/Component.js.map +1 -1
  121. package/modern/components/bullet/default.css +2 -2
  122. package/modern/components/bullet/default.module.css.js +1 -1
  123. package/modern/components/bullet/index.css +7 -9
  124. package/modern/components/bullet/index.module.css.js +1 -1
  125. package/modern/components/bullet/index.module.css.js.map +1 -1
  126. package/modern/components/bullet/inverted.css +2 -2
  127. package/modern/components/bullet/inverted.module.css.js +1 -1
  128. package/modern/components/bullet/static-inverted.css +2 -2
  129. package/modern/components/bullet/static-inverted.module.css.js +1 -1
  130. package/modern/components/bullet/static.css +2 -2
  131. package/modern/components/bullet/static.module.css.js +1 -1
  132. package/modern/components/dynamic/Component.js +3 -3
  133. package/modern/components/dynamic/Component.js.map +1 -1
  134. package/modern/components/dynamic/default.css +3 -3
  135. package/modern/components/dynamic/default.module.css.js +1 -1
  136. package/modern/components/dynamic/index.css +6 -8
  137. package/modern/components/dynamic/index.module.css.js +1 -1
  138. package/modern/components/dynamic/index.module.css.js.map +1 -1
  139. package/modern/components/dynamic/inverted.css +3 -3
  140. package/modern/components/dynamic/inverted.module.css.js +1 -1
  141. package/modern/components/dynamic/static-inverted.css +3 -3
  142. package/modern/components/dynamic/static-inverted.module.css.js +1 -1
  143. package/modern/components/dynamic/static.css +3 -3
  144. package/modern/components/dynamic/static.module.css.js +1 -1
  145. package/modern/components/runner/Component.js +1 -1
  146. package/modern/components/runner/Component.js.map +1 -1
  147. package/modern/components/runner/default.css +2 -2
  148. package/modern/components/runner/default.module.css.js +1 -1
  149. package/modern/components/runner/index.css +4 -1
  150. package/modern/components/runner/index.module.css.js +1 -1
  151. package/modern/components/runner/index.module.css.js.map +1 -1
  152. package/modern/components/runner/inverted.css +2 -2
  153. package/modern/components/runner/inverted.module.css.js +1 -1
  154. package/modern/components/runner/static-inverted.css +2 -2
  155. package/modern/components/runner/static-inverted.module.css.js +1 -1
  156. package/modern/components/runner/static.css +2 -2
  157. package/modern/components/runner/static.module.css.js +1 -1
  158. package/modern/components/step/Component.js +1 -1
  159. package/modern/components/step/Component.js.map +1 -1
  160. package/modern/components/step/default.css +2 -2
  161. package/modern/components/step/default.module.css.js +1 -1
  162. package/modern/components/step/index.css +3 -4
  163. package/modern/components/step/index.module.css.js +1 -1
  164. package/modern/components/step/index.module.css.js.map +1 -1
  165. package/modern/components/step/inverted.css +2 -2
  166. package/modern/components/step/inverted.module.css.js +1 -1
  167. package/modern/components/step/static-inverted.css +2 -2
  168. package/modern/components/step/static-inverted.module.css.js +1 -1
  169. package/modern/components/step/static.css +2 -2
  170. package/modern/components/step/static.module.css.js +1 -1
  171. package/modern/types.d.ts +15 -35
  172. package/moderncssm/components/bullet/Component.js +4 -4
  173. package/moderncssm/components/bullet/Component.js.map +1 -1
  174. package/moderncssm/components/bullet/index.module.css +0 -2
  175. package/moderncssm/components/dynamic/Component.js +3 -3
  176. package/moderncssm/components/dynamic/Component.js.map +1 -1
  177. package/moderncssm/components/dynamic/index.module.css +0 -2
  178. package/moderncssm/components/runner/Component.js +1 -1
  179. package/moderncssm/components/runner/Component.js.map +1 -1
  180. package/moderncssm/components/runner/index.module.css +4 -0
  181. package/moderncssm/components/step/Component.js +1 -1
  182. package/moderncssm/components/step/Component.js.map +1 -1
  183. package/moderncssm/components/step/index.module.css +1 -2
  184. package/moderncssm/types.d.ts +15 -35
  185. package/package.json +7 -4
  186. package/src/components/bullet/Component.tsx +9 -5
  187. package/src/components/bullet/index.module.css +0 -2
  188. package/src/components/dynamic/Component.tsx +5 -4
  189. package/src/components/dynamic/index.module.css +0 -2
  190. package/src/components/runner/Component.tsx +2 -1
  191. package/src/components/runner/index.module.css +4 -0
  192. package/src/components/step/Component.tsx +4 -3
  193. package/src/components/step/index.module.css +1 -2
  194. package/src/types.ts +15 -35
  195. package/types.d.ts +15 -35
@@ -25,11 +25,11 @@ var colorsStyle = {
25
25
  };
26
26
  var transitionClassess = {};
27
27
  var PageIndicatorBullet = function (_a) {
28
- var _b = _a.elements, count = _b === void 0 ? 10 : _b, activeElementIndex = _a.activeElement, _c = _a.size, size = _c === void 0 ? 8 : _c, _d = _a.gap, gap = _d === void 0 ? 8 : _d, _e = _a.colors, colors = _e === void 0 ? 'default' : _e;
28
+ var _b = _a.elements, count = _b === void 0 ? 10 : _b, activeElementIndex = _a.activeElement, _c = _a.size, size = _c === void 0 ? 8 : _c, _d = _a.gap, gap = _d === void 0 ? 8 : _d, _e = _a.colors, colors = _e === void 0 ? 'default' : _e, className = _a.className;
29
29
  var refs = React.useMemo(function () { return Array.from({ length: count }, function () { return React.createRef(); }); }, [count]);
30
30
  var _f = React.useMemo(function () { return utils.calcParams(size, gap, activeElementIndex, count); }, [activeElementIndex, count, gap, size]), height = _f[0], width = _f[1], offset = _f[2], elementSize = _f[3], firstVisibleElementIndex = _f[4], lastVisibleElementIndex = _f[5];
31
- return (React__default.default.createElement("div", { className: cn__default.default(index_module.pageIndicator, index_module.bullet), style: { height: height, width: width } },
32
- React__default.default.createElement("ol", { className: index_module.elementsList, style: { gap: gap, transform: "translate(".concat(offset, "px)") } }, refs.map(function (ref, index) {
31
+ return (React__default.default.createElement("div", { className: cn__default.default(index_module.pageIndicator, index_module.bullet, className), style: { height: height, width: width } },
32
+ React__default.default.createElement("div", { className: index_module.elementsList, style: { gap: gap, transform: "translate(".concat(offset, "px)") } }, refs.map(function (ref, index) {
33
33
  var sizeOfElement = elementSize(index);
34
34
  var isActive = activeElementIndex === index;
35
35
  var isVisible = firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;
@@ -46,7 +46,7 @@ var PageIndicatorBullet = function (_a) {
46
46
  // passed empty object so any classes aren't added
47
47
  classNames: transitionClassess }, function (status) {
48
48
  var _a;
49
- return (React__default.default.createElement("li", { ref: ref, "data-index": index, className: cn__default.default(index_module.element, colorsStyle[colors].element, (_a = {}, _a[colorsStyle[colors].active] = isActive, _a), index_module[status]), style: { height: sizeOfElement, width: sizeOfElement } }));
49
+ return (React__default.default.createElement("div", { ref: ref, "data-index": index, className: cn__default.default(index_module.element, colorsStyle[colors].element, (_a = {}, _a[colorsStyle[colors].active] = isActive, _a), index_module[status]), style: { height: sizeOfElement, width: sizeOfElement } }));
50
50
  }));
51
51
  }))));
52
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../src/components/bullet/Component.tsx"],"sourcesContent":["import React, { createRef, type FC, useMemo } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport cn from 'classnames';\n\nimport { type PageIndicatorBulletProps } from '../../types';\n\nimport { calcParams } from './utils';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst transitionClassess = {} as const;\n\nexport const PageIndicatorBullet: FC<PageIndicatorBulletProps> = ({\n elements: count = 10,\n activeElement: activeElementIndex,\n size = 8,\n gap = 8,\n colors = 'default',\n}) => {\n const refs = useMemo(\n () => Array.from({ length: count }, () => createRef<HTMLLIElement>()),\n [count],\n );\n const [height, width, offset, elementSize, firstVisibleElementIndex, lastVisibleElementIndex] =\n useMemo(\n () => calcParams(size, gap, activeElementIndex, count),\n [activeElementIndex, count, gap, size],\n );\n\n return (\n <div className={cn(styles.pageIndicator, styles.bullet)} style={{ height, width }}>\n <ol\n className={styles.elementsList}\n style={{ gap, transform: `translate(${offset}px)` }}\n >\n {refs.map((ref, index) => {\n const sizeOfElement = elementSize(index);\n const isActive = activeElementIndex === index;\n const isVisible =\n firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;\n const addListTransitionEndListener = (done: () => void) => {\n const parentElement = ref.current?.parentElement;\n\n parentElement?.addEventListener('transitionend', done, { once: true });\n };\n\n return (\n <CSSTransition\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n nodeRef={ref}\n addEndListener={addListTransitionEndListener}\n in={isVisible}\n // passed empty object so any classes aren't added\n classNames={transitionClassess}\n >\n {(status) => (\n <li\n ref={ref}\n data-index={index}\n className={cn(\n styles.element,\n colorsStyle[colors].element,\n { [colorsStyle[colors].active]: isActive },\n styles[status],\n )}\n style={{ height: sizeOfElement, width: sizeOfElement }}\n />\n )}\n </CSSTransition>\n );\n })}\n </ol>\n </div>\n );\n};\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","useMemo","createRef","calcParams","React","cn","styles","CSSTransition"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEV,IAAM,kBAAkB,GAAG,EAAW;AAE/B,IAAM,mBAAmB,GAAiC,UAAC,EAMjE,EAAA;AALG,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,QAAoB,EAAV,KAAK,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACL,kBAAkB,GAAA,EAAA,CAAA,aAAA,EACjC,EAAA,GAAA,EAAA,CAAA,IAAQ,EAAR,IAAI,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,GAAA,EAAA,EACR,EAAO,GAAA,EAAA,CAAA,GAAA,EAAP,GAAG,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,GAAA,EAAA,EACP,EAAA,GAAA,EAAA,CAAA,MAAkB,EAAlB,MAAM,GAAG,EAAA,KAAA,MAAA,GAAA,SAAS,GAAA,EAAA;AAElB,IAAA,IAAM,IAAI,GAAGC,aAAO,CAChB,YAAM,EAAA,OAAA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,YAAA,EAAM,OAAAC,eAAS,EAAiB,CAAA,EAAA,CAAC,CAA/D,EAA+D,EACrE,CAAC,KAAK,CAAC,CACV;IACK,IAAA,EAAA,GACFD,aAAO,CACH,YAAA,EAAM,OAAAE,gBAAU,CAAC,IAAI,EAAE,GAAG,EAAE,kBAAkB,EAAE,KAAK,CAAC,CAAA,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I,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1E,aAAC;YAED,QACIF,qCAACG;;;;AAEG,gBAAA,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,4BAA4B,EAC5C,EAAE,EAAE,SAAS;;AAEb,gBAAA,UAAU,EAAE,kBAAkB,EAE7B,EAAA,UAAC,MAAM,EAAA;;gBAAK,QACTH,6CACI,GAAG,EAAE,GAAG,EACI,YAAA,EAAA,KAAK,EACjB,SAAS,EAAEC,mBAAE,CACTC,YAAM,CAAC,OAAO,EACd,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,GAAA,EAAA,GAAA,EAAA,EACzB,EAAC,CAAA,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,CAAG,GAAA,QAAQ,OACxCA,YAAM,CAAC,MAAM,CAAC,CACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,CACxD;aACL,CACW;AAExB,SAAC,CAAC,CACD,CACH;AAEd;;;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../src/components/bullet/Component.tsx"],"sourcesContent":["import React, { createRef, type FC, useMemo } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport cn from 'classnames';\n\nimport { type PageIndicatorBulletProps } from '../../types';\n\nimport { calcParams } from './utils';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst transitionClassess = {} as const;\n\nexport const PageIndicatorBullet: FC<PageIndicatorBulletProps> = ({\n elements: count = 10,\n activeElement: activeElementIndex,\n size = 8,\n gap = 8,\n colors = 'default',\n className,\n}) => {\n const refs = useMemo(\n () => Array.from({ length: count }, () => createRef<HTMLDivElement>()),\n [count],\n );\n const [height, width, offset, elementSize, firstVisibleElementIndex, lastVisibleElementIndex] =\n useMemo(\n () => calcParams(size, gap, activeElementIndex, count),\n [activeElementIndex, count, gap, size],\n );\n\n return (\n <div\n className={cn(styles.pageIndicator, styles.bullet, className)}\n style={{ height, width }}\n >\n <div\n className={styles.elementsList}\n style={{ gap, transform: `translate(${offset}px)` }}\n >\n {refs.map((ref, index) => {\n const sizeOfElement = elementSize(index);\n const isActive = activeElementIndex === index;\n const isVisible =\n firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;\n const addListTransitionEndListener = (done: () => void) => {\n const parentElement = ref.current?.parentElement;\n\n parentElement?.addEventListener('transitionend', done, { once: true });\n };\n\n return (\n <CSSTransition\n // eslint-disable-next-line react/no-array-index-key\n key={index}\n nodeRef={ref}\n addEndListener={addListTransitionEndListener}\n in={isVisible}\n // passed empty object so any classes aren't added\n classNames={transitionClassess}\n >\n {(status) => (\n <div\n ref={ref}\n data-index={index}\n className={cn(\n styles.element,\n colorsStyle[colors].element,\n { [colorsStyle[colors].active]: isActive },\n styles[status],\n )}\n style={{ height: sizeOfElement, width: sizeOfElement }}\n />\n )}\n </CSSTransition>\n );\n })}\n </div>\n </div>\n );\n};\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","useMemo","createRef","calcParams","React","cn","styles","CSSTransition"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEV,IAAM,kBAAkB,GAAG,EAAW;AAE/B,IAAM,mBAAmB,GAAiC,UAAC,EAOjE,EAAA;AANG,IAAA,IAAA,EAAA,GAAA,EAAA,CAAA,QAAoB,EAAV,KAAK,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,GAAA,EAAA,EACL,kBAAkB,G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AAC,CACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,CACxD;aACL,CACW;AAExB,SAAC,CAAC,CACA,CACJ;AAEd;;;;"}
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color: var(--color-light-neutral-translucent-300);
7
7
  --page-indicator-active-color: var(--color-light-neutral-translucent-1300);
8
8
  }
9
- .page-indicator__element_e3ryn {
9
+ .page-indicator__element_p30ls {
10
10
  background: var(--page-indicator-color);
11
11
  }
12
- .page-indicator__element_e3ryn.page-indicator__active_e3ryn {
12
+ .page-indicator__element_p30ls.page-indicator__active_p30ls {
13
13
  background: var(--page-indicator-active-color);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./default.css');
4
4
 
5
- var defaultColors = {"element":"page-indicator__element_e3ryn","active":"page-indicator__active_e3ryn"};
5
+ var defaultColors = {"element":"page-indicator__element_p30ls","active":"page-indicator__active_p30ls"};
6
6
 
7
7
  module.exports = defaultColors;
8
8
  //# sourceMappingURL=default.module.css.js.map
@@ -5,29 +5,27 @@
5
5
  --page-indicator-animation-duration: 0.2s;
6
6
  --page-indicator-animation-timing-function: ease-in-out;
7
7
  }
8
- .page-indicator__pageIndicator_1b9v5.page-indicator__bullet_1b9v5 {
8
+ .page-indicator__pageIndicator_wp2vf.page-indicator__bullet_wp2vf {
9
9
  overflow: hidden;
10
10
  }
11
- .page-indicator__elementsList_1b9v5 {
12
- margin: 0;
13
- padding: 0;
11
+ .page-indicator__elementsList_wp2vf {
14
12
  display: flex;
15
13
  align-items: center;
16
14
  will-change: transform;
17
15
  transition: transform var(--page-indicator-animation-duration)
18
16
  var(--page-indicator-animation-timing-function);
19
17
  }
20
- .page-indicator__element_1b9v5 {
18
+ .page-indicator__element_wp2vf {
21
19
  list-style-type: none;
22
20
  flex-shrink: 0;
23
21
  transition: background var(--page-indicator-animation-duration)
24
22
  var(--page-indicator-animation-timing-function);
25
23
  border-radius: var(--border-radius-circle);
26
24
  }
27
- .page-indicator__element_1b9v5.page-indicator__entering_1b9v5 {
25
+ .page-indicator__element_wp2vf.page-indicator__entering_wp2vf {
28
26
  opacity: 0;
29
27
  }
30
- .page-indicator__element_1b9v5.page-indicator__entered_1b9v5 {
28
+ .page-indicator__element_wp2vf.page-indicator__entered_wp2vf {
31
29
  opacity: 1;
32
30
  transition:
33
31
  background var(--page-indicator-animation-duration)
@@ -35,9 +33,9 @@
35
33
  opacity var(--page-indicator-animation-duration)
36
34
  var(--page-indicator-animation-timing-function);
37
35
  }
38
- .page-indicator__element_1b9v5.page-indicator__exiting_1b9v5 {
36
+ .page-indicator__element_wp2vf.page-indicator__exiting_wp2vf {
39
37
  opacity: 0;
40
38
  }
41
- .page-indicator__element_1b9v5.page-indicator__exited_1b9v5 {
39
+ .page-indicator__element_wp2vf.page-indicator__exited_wp2vf {
42
40
  opacity: 0;
43
41
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"pageIndicator":"page-indicator__pageIndicator_1b9v5","bullet":"page-indicator__bullet_1b9v5","elementsList":"page-indicator__elementsList_1b9v5","element":"page-indicator__element_1b9v5","entering":"page-indicator__entering_1b9v5","entered":"page-indicator__entered_1b9v5","exiting":"page-indicator__exiting_1b9v5","exited":"page-indicator__exited_1b9v5"};
5
+ var styles = {"pageIndicator":"page-indicator__pageIndicator_wp2vf","bullet":"page-indicator__bullet_wp2vf","elementsList":"page-indicator__elementsList_wp2vf","element":"page-indicator__element_wp2vf","entering":"page-indicator__entering_wp2vf","entered":"page-indicator__entered_wp2vf","exiting":"page-indicator__exiting_wp2vf","exited":"page-indicator__exited_wp2vf"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["../../src/components/bullet/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n &.bullet {\n overflow: hidden;\n }\n}\n\n.elementsList {\n margin: 0;\n padding: 0;\n display: flex;\n align-items: center;\n will-change: transform;\n transition: transform var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n}\n\n.element {\n list-style-type: none;\n flex-shrink: 0;\n transition: background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n border-radius: var(--border-radius-circle);\n\n &.entering {\n opacity: 0;\n }\n &.entered {\n opacity: 1;\n transition:\n background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function),\n opacity var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n }\n &.exiting {\n opacity: 0;\n }\n &.exited {\n opacity: 0;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,QAAQ,CAAC,8BAA8B,CAAC,cAAc,CAAC,oCAAoC,CAAC,SAAS,CAAC,+BAA+B,CAAC,UAAU,CAAC,gCAAgC,CAAC,SAAS,CAAC,+BAA+B,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["../../src/components/bullet/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n &.bullet {\n overflow: hidden;\n }\n}\n\n.elementsList {\n display: flex;\n align-items: center;\n will-change: transform;\n transition: transform var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n}\n\n.element {\n list-style-type: none;\n flex-shrink: 0;\n transition: background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n border-radius: var(--border-radius-circle);\n\n &.entering {\n opacity: 0;\n }\n &.entered {\n opacity: 1;\n transition:\n background var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function),\n opacity var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n }\n &.exiting {\n opacity: 0;\n }\n &.exited {\n opacity: 0;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,QAAQ,CAAC,8BAA8B,CAAC,cAAc,CAAC,oCAAoC,CAAC,SAAS,CAAC,+BAA+B,CAAC,UAAU,CAAC,gCAAgC,CAAC,SAAS,CAAC,+BAA+B,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC;;;;"}
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-inverted: var(--color-light-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-inverted: var(--color-light-neutral-translucent-1300-inverted);
8
8
  }
9
- .page-indicator__element_psio5 {
9
+ .page-indicator__element_jrt7t {
10
10
  background: var(--page-indicator-color-inverted);
11
11
  }
12
- .page-indicator__element_psio5.page-indicator__active_psio5 {
12
+ .page-indicator__element_jrt7t.page-indicator__active_jrt7t {
13
13
  background: var(--page-indicator-active-color-inverted);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./inverted.css');
4
4
 
5
- var invertedColors = {"element":"page-indicator__element_psio5","active":"page-indicator__active_psio5"};
5
+ var invertedColors = {"element":"page-indicator__element_jrt7t","active":"page-indicator__active_jrt7t"};
6
6
 
7
7
  module.exports = invertedColors;
8
8
  //# sourceMappingURL=inverted.module.css.js.map
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
8
8
  }
9
- .page-indicator__element_hggv9 {
9
+ .page-indicator__element_l4x8q {
10
10
  background: var(--page-indicator-color-static-inverted);
11
11
  }
12
- .page-indicator__element_hggv9.page-indicator__active_hggv9 {
12
+ .page-indicator__element_l4x8q.page-indicator__active_l4x8q {
13
13
  background: var(--page-indicator-active-color-static-inverted);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static-inverted.css');
4
4
 
5
- var staticInvertedColors = {"element":"page-indicator__element_hggv9","active":"page-indicator__active_hggv9"};
5
+ var staticInvertedColors = {"element":"page-indicator__element_l4x8q","active":"page-indicator__active_l4x8q"};
6
6
 
7
7
  module.exports = staticInvertedColors;
8
8
  //# sourceMappingURL=static-inverted.module.css.js.map
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-static: var(--color-static-neutral-translucent-300);
7
7
  --page-indicator-active-color-static: var(--color-static-neutral-1300);
8
8
  }
9
- .page-indicator__element_2j1m7 {
9
+ .page-indicator__element_1fl6e {
10
10
  background: var(--page-indicator-color-static);
11
11
  }
12
- .page-indicator__element_2j1m7.page-indicator__active_2j1m7 {
12
+ .page-indicator__element_1fl6e.page-indicator__active_1fl6e {
13
13
  background: var(--page-indicator-active-color-static);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static.css');
4
4
 
5
- var staticColors = {"element":"page-indicator__element_2j1m7","active":"page-indicator__active_2j1m7"};
5
+ var staticColors = {"element":"page-indicator__element_1fl6e","active":"page-indicator__active_1fl6e"};
6
6
 
7
7
  module.exports = staticColors;
8
8
  //# sourceMappingURL=static.module.css.js.map
@@ -24,7 +24,7 @@ var colorsStyle = {
24
24
  };
25
25
  var FULL_PROGRESS = 100;
26
26
  var PageIndicatorDynamic = function (props) {
27
- var _a = props.size, height = _a === void 0 ? 8 : _a, _b = props.gap, gap = _b === void 0 ? 8 : _b, _c = props.activeElementWidth, activeElementWidth = _c === void 0 ? height * 7 : _c, _d = props.elements, count = _d === void 0 ? 10 : _d, indexFromProps = props.activeElement, onActiveElementChange = props.onActiveElementChange, _e = props.defaultActiveElement, defaultIndex = _e === void 0 ? 0 : _e, _f = props.active, active = _f === void 0 ? true : _f, _g = props.duration, durationFromProps = _g === void 0 ? 3000 : _g, _h = props.cycle, cycle = _h === void 0 ? false : _h, _j = props.colors, colors = _j === void 0 ? 'default' : _j;
27
+ var _a = props.size, height = _a === void 0 ? 8 : _a, _b = props.gap, gap = _b === void 0 ? 8 : _b, _c = props.activeElementWidth, activeElementWidth = _c === void 0 ? height * 7 : _c, _d = props.elements, count = _d === void 0 ? 10 : _d, indexFromProps = props.activeElement, onActiveElementChange = props.onActiveElementChange, _e = props.defaultActiveElement, defaultIndex = _e === void 0 ? 0 : _e, _f = props.active, active = _f === void 0 ? true : _f, _g = props.duration, durationFromProps = _g === void 0 ? 3000 : _g, _h = props.cycle, cycle = _h === void 0 ? false : _h, _j = props.colors, colors = _j === void 0 ? 'default' : _j, className = props.className;
28
28
  var _k = React.useState(indexFromProps !== null && indexFromProps !== void 0 ? indexFromProps : defaultIndex), activeIndex = _k[0], setActiveIndex = _k[1];
29
29
  var _l = React.useState(0), progress = _l[0], setProgress = _l[1];
30
30
  var inProgress = progress < FULL_PROGRESS;
@@ -62,7 +62,7 @@ var PageIndicatorDynamic = function (props) {
62
62
  setActiveIndex(nextActiveIndex);
63
63
  setProgress(0);
64
64
  }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);
65
- return (React__default.default.createElement("ol", { className: index_module.pageIndicator, style: { height: height, gap: gap } }, Array.from({ length: count }, function (_, index) {
65
+ return (React__default.default.createElement("div", { className: cn__default.default(index_module.pageIndicator, className), style: { height: height, gap: gap } }, Array.from({ length: count }, function (_, index) {
66
66
  var _a;
67
67
  var isActive = index === activeIndex;
68
68
  var style = {
@@ -72,7 +72,7 @@ var PageIndicatorDynamic = function (props) {
72
72
  var progressStyle = isActive
73
73
  ? { transform: "translateX(".concat(progress - FULL_PROGRESS, "%)") }
74
74
  : undefined;
75
- return (React__default.default.createElement("li", { key: index, style: style, className: cn__default.default(index_module.element, colorsStyle[colors].element, (_a = {},
75
+ return (React__default.default.createElement("div", { key: index, style: style, className: cn__default.default(index_module.element, colorsStyle[colors].element, (_a = {},
76
76
  _a[index_module.active] = isActive,
77
77
  _a[colorsStyle[colors].active] = isActive,
78
78
  _a)) },
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../src/components/dynamic/Component.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n hasOwnProperty,\n isFn,\n isNonNullable,\n isNullable,\n noop,\n} from '@alfalab/core-components-shared';\n\nimport { type PageIndicatorDynamicProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst FULL_PROGRESS = 100;\n\nexport const PageIndicatorDynamic: React.FC<PageIndicatorDynamicProps> = (props) => {\n const {\n size: height = 8,\n gap = 8,\n activeElementWidth = height * 7,\n elements: count = 10,\n activeElement: indexFromProps,\n onActiveElementChange,\n defaultActiveElement: defaultIndex = 0,\n active = true,\n duration: durationFromProps = 3000,\n cycle = false,\n colors = 'default',\n } = props;\n const [activeIndex, setActiveIndex] = useState<number | undefined>(\n indexFromProps ?? defaultIndex,\n );\n const [progress, setProgress] = useState(0);\n const inProgress = progress < FULL_PROGRESS;\n const activeIndexInProps = hasOwnProperty(props, 'activeElement');\n let duration: number;\n\n if (active && isNonNullable(activeIndex) && inProgress) {\n duration = isFn(durationFromProps) ? durationFromProps(activeIndex) : durationFromProps;\n } else {\n duration = -1;\n }\n\n // getDerivedStateFromProps\n if (activeIndexInProps && !(activeIndex === indexFromProps)) {\n setActiveIndex(indexFromProps);\n setProgress(0);\n }\n\n useEffect(() => {\n if (duration === -1) {\n return noop;\n }\n\n const interval = duration / FULL_PROGRESS;\n const timer = setInterval(\n () => setProgress((prevProgress) => Math.min(prevProgress + 1, FULL_PROGRESS)),\n interval,\n );\n\n return () => clearInterval(timer);\n }, [duration]);\n\n useEffect(() => {\n const isLast = activeIndex === count - 1;\n\n if (inProgress || isNullable(activeIndex) || (isLast && !cycle)) {\n return;\n }\n\n const nextActiveIndex = isLast && cycle ? 0 : activeIndex + 1;\n\n onActiveElementChange?.(nextActiveIndex);\n\n if (activeIndexInProps) {\n return;\n }\n\n setActiveIndex(nextActiveIndex);\n setProgress(0);\n }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);\n\n return (\n <ol className={styles.pageIndicator} style={{ height, gap }}>\n {Array.from({ length: count }, (_, index) => {\n const isActive = index === activeIndex;\n const style: React.CSSProperties = {\n width: isActive ? activeElementWidth : height,\n borderRadius: height / 2,\n };\n const progressStyle: React.CSSProperties | undefined = isActive\n ? { transform: `translateX(${progress - FULL_PROGRESS}%)` }\n : undefined;\n\n return (\n <li\n key={index}\n style={style}\n className={cn(styles.element, colorsStyle[colors].element, {\n [styles.active]: isActive,\n [colorsStyle[colors].active]: isActive,\n })}\n >\n <div\n style={progressStyle}\n className={cn(styles.progress, colorsStyle[colors].progress)}\n />\n </li>\n );\n })}\n </ol>\n );\n};\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","useState","hasOwnProperty","isNonNullable","isFn","useEffect","noop","isNullable","React","styles","cn"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEV,IAAM,aAAa,GAAG,GAAG;AAElB,IAAM,oBAAoB,GAAwC,UAAC,KAAK,EAAA;IAEvE,IAAA,EAAA,GAWA,KAAK,CAXW,IAAA,EAAV,MAAM,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,KAAA,EAChB,EAAA,GAUA,KAAK,CAVE,GAAA,EAAP,GAAG,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,KAAA,EACP,EAAA,GASA,KAAK,CAT0B,kBAAA,EAA/B,kBAAkB,GAAG,EAAA,KAAA,MAAA,GAAA,MAAM,GAAG,CAAC,GAAA,EAAA,EAC/B,EAQA,GAAA,KAAK,SARe,EAAV,KAAK,mBAAG,EAAE,GAAA,EAAA,EACL,cAAc,GAO7B,KAAK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EAAA,GAAA,EAAE,EACtD,EAAA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,UAAC,CAAC,EAAE,KAAK,EAAA;;AACpC,QAAA,IAAM,QAAQ,GAAG,KAAK,KAAK,WAAW;AACtC,QAAA,IAAM,KAAK,GAAwB;YAC/B,KAAK,EAAE,QAAQ,GAAG,kBAAkB,GAAG,MAAM;YAC7C,YAAY,EAAE,MAAM,GAAG,CAAC;SAC3B;QACD,IAAM,aAAa,GAAoC;cACjD,EAAE,SAAS,EAAE,qBAAc,QAAQ,GAAG,aAAa,EAAA,IAAA,CAAI;cACvD,SAAS;QAEf,QACID,6CACI,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAEE,mBAAE,CAACD,YAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,GAAA,EAAA,GAAA,EAAA;AACrD,gBAAA,EAAA,CAACA,YAAM,CAAC,MAAM,CAAA,GAAG,QAAQ;AACzB,gBAAA,EAAA,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,IAAG,QAAQ;AACxC,gBAAA,EAAA,EAAA,EAAA;YAEFD,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,aAAa,EACpB,SAAS,EAAEE,mBAAE,CAACD,YAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAA,CAC9D,CACD;KAEZ,CAAC,CACD;AAEb;;;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../src/components/dynamic/Component.tsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport cn from 'classnames';\n\nimport {\n hasOwnProperty,\n isFn,\n isNonNullable,\n isNullable,\n noop,\n} from '@alfalab/core-components-shared';\n\nimport { type PageIndicatorDynamicProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nconst FULL_PROGRESS = 100;\n\nexport const PageIndicatorDynamic: React.FC<PageIndicatorDynamicProps> = (props) => {\n const {\n size: height = 8,\n gap = 8,\n activeElementWidth = height * 7,\n elements: count = 10,\n activeElement: indexFromProps,\n onActiveElementChange,\n defaultActiveElement: defaultIndex = 0,\n active = true,\n duration: durationFromProps = 3000,\n cycle = false,\n colors = 'default',\n className,\n } = props;\n const [activeIndex, setActiveIndex] = useState<number | undefined>(\n indexFromProps ?? defaultIndex,\n );\n const [progress, setProgress] = useState(0);\n const inProgress = progress < FULL_PROGRESS;\n const activeIndexInProps = hasOwnProperty(props, 'activeElement');\n let duration: number;\n\n if (active && isNonNullable(activeIndex) && inProgress) {\n duration = isFn(durationFromProps) ? durationFromProps(activeIndex) : durationFromProps;\n } else {\n duration = -1;\n }\n\n // getDerivedStateFromProps\n if (activeIndexInProps && !(activeIndex === indexFromProps)) {\n setActiveIndex(indexFromProps);\n setProgress(0);\n }\n\n useEffect(() => {\n if (duration === -1) {\n return noop;\n }\n\n const interval = duration / FULL_PROGRESS;\n const timer = setInterval(\n () => setProgress((prevProgress) => Math.min(prevProgress + 1, FULL_PROGRESS)),\n interval,\n );\n\n return () => clearInterval(timer);\n }, [duration]);\n\n useEffect(() => {\n const isLast = activeIndex === count - 1;\n\n if (inProgress || isNullable(activeIndex) || (isLast && !cycle)) {\n return;\n }\n\n const nextActiveIndex = isLast && cycle ? 0 : activeIndex + 1;\n\n onActiveElementChange?.(nextActiveIndex);\n\n if (activeIndexInProps) {\n return;\n }\n\n setActiveIndex(nextActiveIndex);\n setProgress(0);\n }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);\n\n return (\n <div className={cn(styles.pageIndicator, className)} style={{ height, gap }}>\n {Array.from({ length: count }, (_, index) => {\n const isActive = index === activeIndex;\n const style: React.CSSProperties = {\n width: isActive ? activeElementWidth : height,\n borderRadius: height / 2,\n };\n const progressStyle: React.CSSProperties | undefined = isActive\n ? { transform: `translateX(${progress - FULL_PROGRESS}%)` }\n : undefined;\n\n return (\n <div\n key={index}\n style={style}\n className={cn(styles.element, colorsStyle[colors].element, {\n [styles.active]: isActive,\n [colorsStyle[colors].active]: isActive,\n })}\n >\n <div\n style={progressStyle}\n className={cn(styles.progress, colorsStyle[colors].progress)}\n />\n </div>\n );\n })}\n </div>\n );\n};\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","useState","hasOwnProperty","isNonNullable","isFn","useEffect","noop","isNullable","React","cn","styles"],"mappings":";;;;;;;;;;;;;;;;;;AAmBA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEV,IAAM,aAAa,GAAG,GAAG;AAElB,IAAM,oBAAoB,GAAwC,UAAC,KAAK,EAAA;IAEvE,IAAA,EAAA,GAYA,KAAK,CAZW,IAAA,EAAV,MAAM,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,KAAA,EAChB,EAAA,GAWA,KAAK,CAXE,GAAA,EAAP,GAAG,GAAG,EAAA,KAAA,MAAA,GAAA,CAAC,KAAA,EACP,EAAA,GAUA,KAAK,CAAA,kBAV0B,EAA/B,kBAAkB,mBAAG,MAAM,GAAG,CAAC,GAAA,EAAA,EAC/B,KASA,KAAK,CAAA,QATe,EAAV,KAAK,GAAA,EAAA,KAAA,MAAA,GAAG,EAAE,GAAA,EAAA,EACL,cAAc,GAQ7B,KAAK,cARwB,EAC7B,qBAAqB,GAOrB,KAAK,CAPgB,qBAAA,EACrB,KAMA,KAAK,CAAA,oBANiC,EAAhB,YAAY,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,GA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UAAC,CAAC,EAAE,KAAK,EAAA;;AACpC,QAAA,IAAM,QAAQ,GAAG,KAAK,KAAK,WAAW;AACtC,QAAA,IAAM,KAAK,GAAwB;YAC/B,KAAK,EAAE,QAAQ,GAAG,kBAAkB,GAAG,MAAM;YAC7C,YAAY,EAAE,MAAM,GAAG,CAAC;SAC3B;QACD,IAAM,aAAa,GAAoC;cACjD,EAAE,SAAS,EAAE,qBAAc,QAAQ,GAAG,aAAa,EAAA,IAAA,CAAI;cACvD,SAAS;QAEf,QACIF,8CACI,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,GAAA,EAAA,GAAA,EAAA;AACrD,gBAAA,EAAA,CAACA,YAAM,CAAC,MAAM,CAAA,GAAG,QAAQ;AACzB,gBAAA,EAAA,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,IAAG,QAAQ;AACxC,gBAAA,EAAA,EAAA,EAAA;YAEFF,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,aAAa,EACpB,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAA,CAC9D,CACA;KAEb,CAAC,CACA;AAEd;;;;"}
@@ -6,11 +6,11 @@
6
6
  --page-indicator-color: var(--color-light-neutral-translucent-300);
7
7
  --page-indicator-active-color: var(--color-light-neutral-translucent-1300);
8
8
  }
9
- .page-indicator__element_k9ry7 {
9
+ .page-indicator__element_o4ub7 {
10
10
  background: var(--page-indicator-color);
11
11
  }
12
- .page-indicator__element_k9ry7.page-indicator__active_k9ry7 {
13
- .page-indicator__progress_k9ry7 {
12
+ .page-indicator__element_o4ub7.page-indicator__active_o4ub7 {
13
+ .page-indicator__progress_o4ub7 {
14
14
  background: var(--page-indicator-active-color);
15
15
  }
16
16
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./default.css');
4
4
 
5
- var defaultColors = {"element":"page-indicator__element_k9ry7","active":"page-indicator__active_k9ry7","progress":"page-indicator__progress_k9ry7"};
5
+ var defaultColors = {"element":"page-indicator__element_o4ub7","active":"page-indicator__active_o4ub7","progress":"page-indicator__progress_o4ub7"};
6
6
 
7
7
  module.exports = defaultColors;
8
8
  //# sourceMappingURL=default.module.css.js.map
@@ -1,24 +1,22 @@
1
1
  :root {
2
2
  --page-indicator-animation-duration: 0.2s;
3
3
  }
4
- .page-indicator__pageIndicator_zobdi {
5
- margin: 0;
6
- padding: 0;
4
+ .page-indicator__pageIndicator_h7ekc {
7
5
  display: flex;
8
6
  }
9
- .page-indicator__element_zobdi {
7
+ .page-indicator__element_h7ekc {
10
8
  list-style-type: none;
11
9
  overflow: hidden;
12
10
  transition: width var(--page-indicator-animation-duration) linear;
13
11
  }
14
- .page-indicator__element_zobdi:not(.page-indicator__active_zobdi) {
15
- .page-indicator__progress_zobdi {
12
+ .page-indicator__element_h7ekc:not(.page-indicator__active_h7ekc) {
13
+ .page-indicator__progress_h7ekc {
16
14
  display: none;
17
15
  }
18
16
  }
19
- .page-indicator__element_zobdi {
17
+ .page-indicator__element_h7ekc {
20
18
 
21
- .page-indicator__progress_zobdi {
19
+ .page-indicator__progress_h7ekc {
22
20
  width: 100%;
23
21
  height: 100%;
24
22
  will-change: transform;
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"pageIndicator":"page-indicator__pageIndicator_zobdi","element":"page-indicator__element_zobdi","active":"page-indicator__active_zobdi","progress":"page-indicator__progress_zobdi"};
5
+ var styles = {"pageIndicator":"page-indicator__pageIndicator_h7ekc","element":"page-indicator__element_h7ekc","active":"page-indicator__active_h7ekc","progress":"page-indicator__progress_h7ekc"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["../../src/components/dynamic/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n margin: 0;\n padding: 0;\n display: flex;\n}\n\n.element {\n list-style-type: none;\n overflow: hidden;\n transition: width var(--page-indicator-animation-duration) linear;\n\n &:not(.active) {\n .progress {\n display: none;\n }\n }\n\n .progress {\n width: 100%;\n height: 100%;\n will-change: transform;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC,UAAU,CAAC,gCAAgC,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["../../src/components/dynamic/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n display: flex;\n}\n\n.element {\n list-style-type: none;\n overflow: hidden;\n transition: width var(--page-indicator-animation-duration) linear;\n\n &:not(.active) {\n .progress {\n display: none;\n }\n }\n\n .progress {\n width: 100%;\n height: 100%;\n will-change: transform;\n }\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,SAAS,CAAC,+BAA+B,CAAC,QAAQ,CAAC,8BAA8B,CAAC,UAAU,CAAC,gCAAgC,CAAC;;;;"}
@@ -6,11 +6,11 @@
6
6
  --page-indicator-color-inverted: var(--color-light-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-inverted: var(--color-light-neutral-translucent-1300-inverted);
8
8
  }
9
- .page-indicator__element_qpgvo {
9
+ .page-indicator__element_mqocy {
10
10
  background: var(--page-indicator-color-inverted);
11
11
  }
12
- .page-indicator__element_qpgvo.page-indicator__active_qpgvo {
13
- .page-indicator__progress_qpgvo {
12
+ .page-indicator__element_mqocy.page-indicator__active_mqocy {
13
+ .page-indicator__progress_mqocy {
14
14
  background: var(--page-indicator-active-color-inverted);
15
15
  }
16
16
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./inverted.css');
4
4
 
5
- var invertedColors = {"element":"page-indicator__element_qpgvo","active":"page-indicator__active_qpgvo","progress":"page-indicator__progress_qpgvo"};
5
+ var invertedColors = {"element":"page-indicator__element_mqocy","active":"page-indicator__active_mqocy","progress":"page-indicator__progress_mqocy"};
6
6
 
7
7
  module.exports = invertedColors;
8
8
  //# sourceMappingURL=inverted.module.css.js.map
@@ -6,11 +6,11 @@
6
6
  --page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
8
8
  }
9
- .page-indicator__element_1umjl {
9
+ .page-indicator__element_6rxth {
10
10
  background: var(--page-indicator-color-static-inverted);
11
11
  }
12
- .page-indicator__element_1umjl.page-indicator__active_1umjl {
13
- .page-indicator__progress_1umjl {
12
+ .page-indicator__element_6rxth.page-indicator__active_6rxth {
13
+ .page-indicator__progress_6rxth {
14
14
  background: var(--page-indicator-active-color-static-inverted);
15
15
  }
16
16
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static-inverted.css');
4
4
 
5
- var staticInvertedColors = {"element":"page-indicator__element_1umjl","active":"page-indicator__active_1umjl","progress":"page-indicator__progress_1umjl"};
5
+ var staticInvertedColors = {"element":"page-indicator__element_6rxth","active":"page-indicator__active_6rxth","progress":"page-indicator__progress_6rxth"};
6
6
 
7
7
  module.exports = staticInvertedColors;
8
8
  //# sourceMappingURL=static-inverted.module.css.js.map
@@ -6,11 +6,11 @@
6
6
  --page-indicator-color-static: var(--color-static-neutral-translucent-300);
7
7
  --page-indicator-active-color-static: var(--color-static-neutral-1300);
8
8
  }
9
- .page-indicator__element_1196f {
9
+ .page-indicator__element_1u5rb {
10
10
  background: var(--page-indicator-color-static);
11
11
  }
12
- .page-indicator__element_1196f.page-indicator__active_1196f {
13
- .page-indicator__progress_1196f {
12
+ .page-indicator__element_1u5rb.page-indicator__active_1u5rb {
13
+ .page-indicator__progress_1u5rb {
14
14
  background: var(--page-indicator-active-color-static);
15
15
  }
16
16
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static.css');
4
4
 
5
- var staticColors = {"element":"page-indicator__element_1196f","active":"page-indicator__active_1196f","progress":"page-indicator__progress_1196f"};
5
+ var staticColors = {"element":"page-indicator__element_1u5rb","active":"page-indicator__active_1u5rb","progress":"page-indicator__progress_1u5rb"};
6
6
 
7
7
  module.exports = staticColors;
8
8
  //# sourceMappingURL=static.module.css.js.map
@@ -22,8 +22,8 @@ var colorsStyle = {
22
22
  'static-inverted': staticInverted_module,
23
23
  };
24
24
  var PageIndicatorRunner = function (_a) {
25
- var activeElement = _a.activeElement, _b = _a.elements, count = _b === void 0 ? 10 : _b, _c = _a.size, size = _c === void 0 ? 4 : _c, _d = _a.colors, colors = _d === void 0 ? 'default' : _d;
26
- return (React__default.default.createElement("div", { className: cn__default.default(index_module.pageIndicator, colorsStyle[colors].pageIndicator), style: { height: size, borderRadius: size / 2 } },
25
+ var activeElement = _a.activeElement, _b = _a.elements, count = _b === void 0 ? 10 : _b, _c = _a.size, size = _c === void 0 ? 4 : _c, _d = _a.colors, colors = _d === void 0 ? 'default' : _d, className = _a.className;
26
+ return (React__default.default.createElement("div", { className: cn__default.default(index_module.pageIndicator, colorsStyle[colors].pageIndicator, className), style: { height: size, borderRadius: size / 2 } },
27
27
  React__default.default.createElement("div", { style: {
28
28
  transform: "translate(".concat(activeElement * 100, "%, 0)"),
29
29
  height: size,
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../src/components/runner/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorRunnerProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nexport const PageIndicatorRunner: React.FC<PageIndicatorRunnerProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n colors = 'default',\n}) => (\n <div\n className={cn(styles.pageIndicator, colorsStyle[colors].pageIndicator)}\n style={{ height: size, borderRadius: size / 2 }}\n >\n <div\n style={{\n transform: `translate(${activeElement * 100}%, 0)`,\n height: size,\n width: `${100 / count}%`,\n borderRadius: size / 2,\n }}\n className={cn(styles.element, colorsStyle[colors].element)}\n />\n </div>\n);\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","React","cn","styles"],"mappings":";;;;;;;;;;;;;;;;;AAWA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEH,IAAM,mBAAmB,GAAuC,UAAC,EAKvE,EAAA;QAJG,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,EAAoB,GAAA,EAAA,CAAA,QAAA,EAAV,KAAK,GAAG,EAAA,KAAA,MAAA,GAAA,EAAE,KAAA,EACpB,EAAA,GAAA,EAAA,CAAA,IAAQ,EAAR,IAAI,GAAA,EAAA,KAAA,MAAA,GAAG,CAAC,GAAA,EAAA,EACR,cAAkB,EAAlB,MAAM,GAAG,EAAA,KAAA,MAAA,GAAA,SAAS,GAAA,EAAA;AAChB,IAAA,QACFC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,EACtE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAAA;AAE/C,QAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,gBAAA,SAAS,EAAE,YAAA,CAAA,MAAA,CAAa,aAAa,GAAG,GAAG,EAAO,OAAA,CAAA;AAClD,gBAAA,MAAM,EAAE,IAAI;AACZ,gBAAA,KAAK,EAAE,EAAA,CAAA,MAAA,CAAG,GAAG,GAAG,KAAK,EAAG,GAAA,CAAA;gBACxB,YAAY,EAAE,IAAI,GAAG,CAAC;AACzB,aAAA,EACD,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAA,CAC5D,CACA;AAdJ;;;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../src/components/runner/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorRunnerProps } from '../../types';\n\nimport defaultColors from './default.module.css';\nimport styles from './index.module.css';\nimport invertedColors from './inverted.module.css';\nimport staticColors from './static.module.css';\nimport staticInvertedColors from './static-inverted.module.css';\n\nconst colorsStyle = {\n inverted: invertedColors,\n default: defaultColors,\n static: staticColors,\n 'static-inverted': staticInvertedColors,\n} as const;\n\nexport const PageIndicatorRunner: React.FC<PageIndicatorRunnerProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n colors = 'default',\n className,\n}) => (\n <div\n className={cn(styles.pageIndicator, colorsStyle[colors].pageIndicator, className)}\n style={{ height: size, borderRadius: size / 2 }}\n >\n <div\n style={{\n transform: `translate(${activeElement * 100}%, 0)`,\n height: size,\n width: `${100 / count}%`,\n borderRadius: size / 2,\n }}\n className={cn(styles.element, colorsStyle[colors].element)}\n />\n </div>\n);\n"],"names":["invertedColors","defaultColors","staticColors","staticInvertedColors","React","cn","styles"],"mappings":";;;;;;;;;;;;;;;;;AAWA,IAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAEA,eAAc;AACxB,IAAA,OAAO,EAAEC,cAAa;AACtB,IAAA,MAAM,EAAEC,aAAY;AACpB,IAAA,iBAAiB,EAAEC,qBAAoB;CACjC;AAEH,IAAM,mBAAmB,GAAuC,UAAC,EAMvE,EAAA;QALG,aAAa,GAAA,EAAA,CAAA,aAAA,EACb,EAAA,GAAA,EAAA,CAAA,QAAoB,EAAV,KAAK,mBAAG,EAAE,GAAA,EAAA,EACpB,EAAA,GAAA,EAAA,CAAA,IAAQ,EAAR,IAAI,mBAAG,CAAC,GAAA,EAAA,EACR,EAAA,GAAA,EAAA,CAAA,MAAkB,EAAlB,MAAM,mBAAG,SAAS,GAAA,EAAA,EAClB,SAAS,GAAA,EAAA,CAAA,SAAA;AACP,IAAA,QACFC,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,SAAS,CAAC,EACjF,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAAA;AAE/C,QAAAF,sBAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,gBAAA,SAAS,EAAE,YAAA,CAAA,MAAA,CAAa,aAAa,GAAG,GAAG,EAAO,OAAA,CAAA;AAClD,gBAAA,MAAM,EAAE,IAAI;AACZ,gBAAA,KAAK,EAAE,EAAA,CAAA,MAAA,CAAG,GAAG,GAAG,KAAK,EAAG,GAAA,CAAA;gBACxB,YAAY,EAAE,IAAI,GAAG,CAAC;AACzB,aAAA,EACD,SAAS,EAAEC,mBAAE,CAACC,YAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAA,CAC5D,CACA;AAdJ;;;;"}
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color: var(--color-light-neutral-translucent-300);
7
7
  --page-indicator-active-color: var(--color-light-neutral-translucent-1300);
8
8
  }
9
- .page-indicator__pageIndicator_1ddtz {
9
+ .page-indicator__pageIndicator_wiz49 {
10
10
  background: var(--page-indicator-color);
11
11
  }
12
- .page-indicator__element_1ddtz {
12
+ .page-indicator__element_wiz49 {
13
13
  background: var(--page-indicator-active-color);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./default.css');
4
4
 
5
- var defaultColors = {"pageIndicator":"page-indicator__pageIndicator_1ddtz","element":"page-indicator__element_1ddtz"};
5
+ var defaultColors = {"pageIndicator":"page-indicator__pageIndicator_wiz49","element":"page-indicator__element_wiz49"};
6
6
 
7
7
  module.exports = defaultColors;
8
8
  //# sourceMappingURL=default.module.css.js.map
@@ -1,7 +1,10 @@
1
1
  :root {
2
2
  --page-indicator-animation-duration: 0.2s;
3
3
  }
4
- .page-indicator__element_qlc1d {
4
+ .page-indicator__element_1nev8 {
5
5
  transition: transform var(--page-indicator-animation-duration) linear;
6
6
  will-change: transition;
7
7
  }
8
+ .page-indicator__pageIndicator_1nev8 {
9
+ width: 100%;
10
+ }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./index.css');
4
4
 
5
- var styles = {"element":"page-indicator__element_qlc1d"};
5
+ var styles = {"element":"page-indicator__element_1nev8","pageIndicator":"page-indicator__pageIndicator_1nev8"};
6
6
 
7
7
  module.exports = styles;
8
8
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["../../src/components/runner/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.element {\n transition: transform var(--page-indicator-animation-duration) linear;\n will-change: transition;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,SAAS,CAAC,+BAA+B,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["../../src/components/runner/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.element {\n transition: transform var(--page-indicator-animation-duration) linear;\n will-change: transition;\n}\n\n.pageIndicator {\n width: 100%;\n}\n"],"names":[],"mappings":";;;;AAEgB,aAAe,CAAC,SAAS,CAAC,+BAA+B,CAAC,eAAe,CAAC,qCAAqC,CAAC;;;;"}
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-inverted: var(--color-light-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-inverted: var(--color-light-neutral-translucent-1300-inverted);
8
8
  }
9
- .page-indicator__pageIndicator_1hqt5 {
9
+ .page-indicator__pageIndicator_7wz43 {
10
10
  background: var(--page-indicator-color-inverted);
11
11
  }
12
- .page-indicator__element_1hqt5 {
12
+ .page-indicator__element_7wz43 {
13
13
  background: var(--page-indicator-active-color-inverted);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./inverted.css');
4
4
 
5
- var invertedColors = {"pageIndicator":"page-indicator__pageIndicator_1hqt5","element":"page-indicator__element_1hqt5"};
5
+ var invertedColors = {"pageIndicator":"page-indicator__pageIndicator_7wz43","element":"page-indicator__element_7wz43"};
6
6
 
7
7
  module.exports = invertedColors;
8
8
  //# sourceMappingURL=inverted.module.css.js.map
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-static-inverted: var(--color-static-neutral-translucent-300-inverted);
7
7
  --page-indicator-active-color-static-inverted: var(--color-static-neutral-1300-inverted);
8
8
  }
9
- .page-indicator__pageIndicator_43pau {
9
+ .page-indicator__pageIndicator_3tgal {
10
10
  background: var(--page-indicator-color-static-inverted);
11
11
  }
12
- .page-indicator__element_43pau {
12
+ .page-indicator__element_3tgal {
13
13
  background: var(--page-indicator-active-color-static-inverted);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static-inverted.css');
4
4
 
5
- var staticInvertedColors = {"pageIndicator":"page-indicator__pageIndicator_43pau","element":"page-indicator__element_43pau"};
5
+ var staticInvertedColors = {"pageIndicator":"page-indicator__pageIndicator_3tgal","element":"page-indicator__element_3tgal"};
6
6
 
7
7
  module.exports = staticInvertedColors;
8
8
  //# sourceMappingURL=static-inverted.module.css.js.map
@@ -6,9 +6,9 @@
6
6
  --page-indicator-color-static: var(--color-static-neutral-translucent-300);
7
7
  --page-indicator-active-color-static: var(--color-static-neutral-1300);
8
8
  }
9
- .page-indicator__pageIndicator_19jfy {
9
+ .page-indicator__pageIndicator_b9y6s {
10
10
  background: var(--page-indicator-color-static);
11
11
  }
12
- .page-indicator__element_19jfy {
12
+ .page-indicator__element_b9y6s {
13
13
  background: var(--page-indicator-active-color-static);
14
14
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  require('./static.css');
4
4
 
5
- var staticColors = {"pageIndicator":"page-indicator__pageIndicator_19jfy","element":"page-indicator__element_19jfy"};
5
+ var staticColors = {"pageIndicator":"page-indicator__pageIndicator_b9y6s","element":"page-indicator__element_b9y6s"};
6
6
 
7
7
  module.exports = staticColors;
8
8
  //# sourceMappingURL=static.module.css.js.map