@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
@@ -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
+ }
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"element":"page-indicator__element_qlc1d"};
3
+ const styles = {"element":"page-indicator__element_1nev8","pageIndicator":"page-indicator__pageIndicator_1nev8"};
4
4
 
5
5
  export { styles as default };
6
6
  //# 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,eAAe,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,eAAe,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
  }
@@ -1,6 +1,6 @@
1
1
  import './inverted.css';
2
2
 
3
- const invertedColors = {"pageIndicator":"page-indicator__pageIndicator_1hqt5","element":"page-indicator__element_1hqt5"};
3
+ const invertedColors = {"pageIndicator":"page-indicator__pageIndicator_7wz43","element":"page-indicator__element_7wz43"};
4
4
 
5
5
  export { invertedColors as default };
6
6
  //# 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
  }
@@ -1,6 +1,6 @@
1
1
  import './static-inverted.css';
2
2
 
3
- const staticInvertedColors = {"pageIndicator":"page-indicator__pageIndicator_43pau","element":"page-indicator__element_43pau"};
3
+ const staticInvertedColors = {"pageIndicator":"page-indicator__pageIndicator_3tgal","element":"page-indicator__element_3tgal"};
4
4
 
5
5
  export { staticInvertedColors as default };
6
6
  //# 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
  }
@@ -1,6 +1,6 @@
1
1
  import './static.css';
2
2
 
3
- const staticColors = {"pageIndicator":"page-indicator__pageIndicator_19jfy","element":"page-indicator__element_19jfy"};
3
+ const staticColors = {"pageIndicator":"page-indicator__pageIndicator_b9y6s","element":"page-indicator__element_b9y6s"};
4
4
 
5
5
  export { staticColors as default };
6
6
  //# sourceMappingURL=static.module.css.js.map
@@ -12,7 +12,7 @@ const colorsStyle = {
12
12
  static: staticColors,
13
13
  'static-inverted': staticInvertedColors,
14
14
  };
15
- const PageIndicatorStep = ({ activeElement, elements: count = 10, size = 4, gap = 4, colors = 'default', }) => (React.createElement("ol", { className: styles.pageIndicator, style: { height: size, gap } }, Array.from({ length: count }, (_, index) => (React.createElement("li", { key: index, style: { height: size, borderRadius: size / 2 }, className: cn(styles.element, colorsStyle[colors].element, {
15
+ const PageIndicatorStep = ({ activeElement, elements: count = 10, size = 4, gap = 4, colors = 'default', className, }) => (React.createElement("div", { className: cn(styles.pageIndicator, className), style: { height: size, gap } }, Array.from({ length: count }, (_, index) => (React.createElement("div", { key: index, style: { height: size, borderRadius: size / 2 }, className: cn(styles.element, colorsStyle[colors].element, {
16
16
  [colorsStyle[colors].active]: index === activeElement,
17
17
  }) })))));
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorStepProps } 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 PageIndicatorStep: React.FC<PageIndicatorStepProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n gap = 4,\n colors = 'default',\n}) => (\n <ol className={styles.pageIndicator} style={{ height: size, gap }}>\n {Array.from({ length: count }, (_, index) => (\n <li\n key={index}\n style={{ height: size, borderRadius: size / 2 }}\n className={cn(styles.element, colorsStyle[colors].element, {\n [colorsStyle[colors].active]: index === activeElement,\n })}\n />\n ))}\n </ol>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;MAEG,iBAAiB,GAAqC,CAAC,EAChE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,SAAS,GACrB,MACG,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAA,EAC5D,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,MACpC,KACI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAC/C,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QACvD,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,KAAK,aAAa;AACxD,KAAA,CAAC,EACJ,CAAA,CACL,CAAC,CACD;;;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorStepProps } 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 PageIndicatorStep: React.FC<PageIndicatorStepProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n gap = 4,\n colors = 'default',\n className,\n}) => (\n <div className={cn(styles.pageIndicator, className)} style={{ height: size, gap }}>\n {Array.from({ length: count }, (_, index) => (\n <div\n key={index}\n style={{ height: size, borderRadius: size / 2 }}\n className={cn(styles.element, colorsStyle[colors].element, {\n [colorsStyle[colors].active]: index === activeElement,\n })}\n />\n ))}\n </div>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;MAEG,iBAAiB,GAAqC,CAAC,EAChE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,MACG,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAC5E,EAAA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,MACpC,6BACI,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAC/C,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QACvD,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,KAAK,aAAa;AACxD,KAAA,CAAC,EACJ,CAAA,CACL,CAAC,CACA;;;;"}
@@ -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_1ea0d {
9
+ .page-indicator__element_nqwqn {
10
10
  background: var(--page-indicator-color);
11
11
  }
12
- .page-indicator__element_1ea0d.page-indicator__active_1ea0d {
12
+ .page-indicator__element_nqwqn.page-indicator__active_nqwqn {
13
13
  background: var(--page-indicator-active-color);
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import './default.css';
2
2
 
3
- const defaultColors = {"element":"page-indicator__element_1ea0d","active":"page-indicator__active_1ea0d"};
3
+ const defaultColors = {"element":"page-indicator__element_nqwqn","active":"page-indicator__active_nqwqn"};
4
4
 
5
5
  export { defaultColors as default };
6
6
  //# sourceMappingURL=default.module.css.js.map
@@ -2,12 +2,11 @@
2
2
  --page-indicator-animation-duration: 0.2s;
3
3
  --page-indicator-animation-timing-function: ease-in-out;
4
4
  }
5
- .page-indicator__pageIndicator_1n6uh {
6
- margin: 0;
7
- padding: 0;
5
+ .page-indicator__pageIndicator_yfjk6 {
8
6
  display: flex;
7
+ width: 100%;
9
8
  }
10
- .page-indicator__element_1n6uh {
9
+ .page-indicator__element_yfjk6 {
11
10
  list-style-type: none;
12
11
  flex-grow: 1;
13
12
  transition: backgroud var(--page-indicator-animation-duration)
@@ -1,6 +1,6 @@
1
1
  import './index.css';
2
2
 
3
- const styles = {"pageIndicator":"page-indicator__pageIndicator_1n6uh","element":"page-indicator__element_1n6uh"};
3
+ const styles = {"pageIndicator":"page-indicator__pageIndicator_yfjk6","element":"page-indicator__element_yfjk6"};
4
4
 
5
5
  export { styles as default };
6
6
  //# sourceMappingURL=index.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.module.css.js","sources":["../../src/components/step/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 flex-grow: 1;\n transition: backgroud var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,SAAS,CAAC,+BAA+B,CAAC;;;;"}
1
+ {"version":3,"file":"index.module.css.js","sources":["../../src/components/step/index.module.css"],"sourcesContent":["@import '../../vars.css';\n\n.pageIndicator {\n display: flex;\n width: 100%;\n}\n\n.element {\n list-style-type: none;\n flex-grow: 1;\n transition: backgroud var(--page-indicator-animation-duration)\n var(--page-indicator-animation-timing-function);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,eAAe,CAAC,qCAAqC,CAAC,SAAS,CAAC,+BAA+B,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_1ebaj {
9
+ .page-indicator__element_7acin {
10
10
  background: var(--page-indicator-color-inverted);
11
11
  }
12
- .page-indicator__element_1ebaj.page-indicator__active_1ebaj {
12
+ .page-indicator__element_7acin.page-indicator__active_7acin {
13
13
  background: var(--page-indicator-active-color-inverted);
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import './inverted.css';
2
2
 
3
- const invertedColors = {"element":"page-indicator__element_1ebaj","active":"page-indicator__active_1ebaj"};
3
+ const invertedColors = {"element":"page-indicator__element_7acin","active":"page-indicator__active_7acin"};
4
4
 
5
5
  export { invertedColors as default };
6
6
  //# 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_16rgk {
9
+ .page-indicator__element_13iar {
10
10
  background: var(--page-indicator-color-static-inverted);
11
11
  }
12
- .page-indicator__element_16rgk.page-indicator__active_16rgk {
12
+ .page-indicator__element_13iar.page-indicator__active_13iar {
13
13
  background: var(--page-indicator-active-color-static-inverted);
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import './static-inverted.css';
2
2
 
3
- const staticInvertedColors = {"element":"page-indicator__element_16rgk","active":"page-indicator__active_16rgk"};
3
+ const staticInvertedColors = {"element":"page-indicator__element_13iar","active":"page-indicator__active_13iar"};
4
4
 
5
5
  export { staticInvertedColors as default };
6
6
  //# 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_1c81w {
9
+ .page-indicator__element_r31gi {
10
10
  background: var(--page-indicator-color-static);
11
11
  }
12
- .page-indicator__element_1c81w.page-indicator__active_1c81w {
12
+ .page-indicator__element_r31gi.page-indicator__active_r31gi {
13
13
  background: var(--page-indicator-active-color-static);
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import './static.css';
2
2
 
3
- const staticColors = {"element":"page-indicator__element_1c81w","active":"page-indicator__active_1c81w"};
3
+ const staticColors = {"element":"page-indicator__element_r31gi","active":"page-indicator__active_r31gi"};
4
4
 
5
5
  export { staticColors as default };
6
6
  //# sourceMappingURL=static.module.css.js.map
package/modern/types.d.ts CHANGED
@@ -1,18 +1,24 @@
1
- export interface PageIndicatorDynamicProps {
1
+ interface BasePageIndicatorProps {
2
2
  /**
3
- * Индекс выбранного элемента по-умолчанию
4
- * @default 0
3
+ * Имя класса
5
4
  */
6
- defaultActiveElement?: number;
5
+ className?: string;
7
6
  /**
8
7
  * Индекс выбранного элемента
9
8
  */
10
- activeElement?: number;
9
+ activeElement: number;
11
10
  /**
12
11
  * Количество элементов (минимум 2)
13
12
  * @default 10
14
13
  */
15
14
  elements?: number;
15
+ }
16
+ export interface PageIndicatorDynamicProps extends BasePageIndicatorProps {
17
+ /**
18
+ * Индекс выбранного элемента по-умолчанию
19
+ * @default 0
20
+ */
21
+ defaultActiveElement?: number;
16
22
  /**
17
23
  * Высота компонента
18
24
  * @default 8
@@ -53,16 +59,7 @@ export interface PageIndicatorDynamicProps {
53
59
  */
54
60
  colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
55
61
  }
56
- export interface PageIndicatorBulletProps {
57
- /**
58
- * Индекс выбранного элемента
59
- */
60
- activeElement: number;
61
- /**
62
- * Количество элементов (минимум 2)
63
- * @default 10
64
- */
65
- elements?: number;
62
+ export interface PageIndicatorBulletProps extends BasePageIndicatorProps {
66
63
  /**
67
64
  * Высота компонента
68
65
  * @default 8
@@ -79,16 +76,7 @@ export interface PageIndicatorBulletProps {
79
76
  */
80
77
  colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
81
78
  }
82
- export interface PageIndicatorStepProps {
83
- /**
84
- * Индекс выбранного элемента
85
- */
86
- activeElement: number;
87
- /**
88
- * Количество элементов (минимум 2)
89
- * @default 10
90
- */
91
- elements?: number;
79
+ export interface PageIndicatorStepProps extends BasePageIndicatorProps {
92
80
  /**
93
81
  * Высота компонента
94
82
  * @default 4
@@ -105,16 +93,7 @@ export interface PageIndicatorStepProps {
105
93
  */
106
94
  colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
107
95
  }
108
- export interface PageIndicatorRunnerProps {
109
- /**
110
- * Индекс выбранного элемента
111
- */
112
- activeElement: number;
113
- /**
114
- * Количество элементов (минимум 2)
115
- * @default 10
116
- */
117
- elements?: number;
96
+ export interface PageIndicatorRunnerProps extends BasePageIndicatorProps {
118
97
  /**
119
98
  * Высота компонента
120
99
  * @default 4
@@ -126,3 +105,4 @@ export interface PageIndicatorRunnerProps {
126
105
  */
127
106
  colors?: 'default' | 'inverted' | 'static' | 'static-inverted';
128
107
  }
108
+ export {};
@@ -15,11 +15,11 @@ const colorsStyle = {
15
15
  'static-inverted': staticInvertedColors,
16
16
  };
17
17
  const transitionClassess = {};
18
- const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElementIndex, size = 8, gap = 8, colors = 'default', }) => {
18
+ const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElementIndex, size = 8, gap = 8, colors = 'default', className, }) => {
19
19
  const refs = useMemo(() => Array.from({ length: count }, () => createRef()), [count]);
20
20
  const [height, width, offset, elementSize, firstVisibleElementIndex, lastVisibleElementIndex] = useMemo(() => calcParams(size, gap, activeElementIndex, count), [activeElementIndex, count, gap, size]);
21
- return (React.createElement("div", { className: cn(styles.pageIndicator, styles.bullet), style: { height, width } },
22
- React.createElement("ol", { className: styles.elementsList, style: { gap, transform: `translate(${offset}px)` } }, refs.map((ref, index) => {
21
+ return (React.createElement("div", { className: cn(styles.pageIndicator, styles.bullet, className), style: { height, width } },
22
+ React.createElement("div", { className: styles.elementsList, style: { gap, transform: `translate(${offset}px)` } }, refs.map((ref, index) => {
23
23
  const sizeOfElement = elementSize(index);
24
24
  const isActive = activeElementIndex === index;
25
25
  const isVisible = firstVisibleElementIndex <= index && index <= lastVisibleElementIndex;
@@ -33,7 +33,7 @@ const PageIndicatorBullet = ({ elements: count = 10, activeElement: activeElemen
33
33
  // eslint-disable-next-line react/no-array-index-key
34
34
  key: index, nodeRef: ref, addEndListener: addListTransitionEndListener, in: isVisible,
35
35
  // passed empty object so any classes aren't added
36
- classNames: transitionClassess }, (status) => (React.createElement("li", { ref: ref, "data-index": index, className: cn(styles.element, colorsStyle[colors].element, { [colorsStyle[colors].active]: isActive }, styles[status]), style: { height: sizeOfElement, width: sizeOfElement } }))));
36
+ classNames: transitionClassess }, (status) => (React.createElement("div", { ref: ref, "data-index": index, className: cn(styles.element, colorsStyle[colors].element, { [colorsStyle[colors].active]: isActive }, styles[status]), style: { height: sizeOfElement, width: sizeOfElement } }))));
37
37
  }))));
38
38
  };
39
39
 
@@ -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":[],"mappings":";;;;;;;;;;AAcA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEV,MAAM,kBAAkB,GAAG,EAAW;AAE/B,MAAM,mBAAmB,GAAiC,CAAC,EAC9D,QAAQ,EAAE,KAAK,GAAG,EAAE,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B,CAAC,eAAe,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1E,aAAC;YAED,QACI,oBAAC;;;;AAEG,gBAAA,GAAG,EAAE,KAAK,EACV,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,4BAA4B,EAC5C,EAAE,EAAE,SAAS;;AAEb,gBAAA,UAAU,EAAE,kBAAkB,EAE7B,EAAA,CAAC,MAAM,MACJ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACI,YAAA,EAAA,KAAK,EACjB,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,OAAO,EACd,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAC3B,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,QAAQ,EAAE,EAC1C,MAAM,CAAC,MAAM,CAAC,CACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,CACxD,CACL,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":[],"mappings":";;;;;;;;;;AAcA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEV,MAAM,kBAAkB,GAAG,EAAW;AAE/B,MAAM,mBAAmB,GAAiC,CAAC,EAC9D,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,aAAa,EAAE,kBAAkB,EACjC,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,KAAI;AACD,IAAA,MAAM,IAAI,GAAG,OAAO,CAChB,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OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,4BAA4B,EAC5C,EAAE,EAAE,SAAS;;AAEb,gBAAA,UAAU,EAAE,kBAAkB,EAE7B,EAAA,CAAC,MAAM,MACJ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,GAAG,EAAE,GAAG,EACI,YAAA,EAAA,KAAK,EACjB,SAAS,EAAE,EAAE,CACT,MAAM,CAAC,OAAO,EACd,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAC3B,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,QAAQ,EAAE,EAC1C,MAAM,CAAC,MAAM,CAAC,CACjB,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE,EAAA,CACxD,CACL,CACW;AAExB,SAAC,CAAC,CACA,CACJ;AAEd;;;;"}
@@ -10,8 +10,6 @@
10
10
  }
11
11
 
12
12
  .elementsList {
13
- margin: 0;
14
- padding: 0;
15
13
  display: flex;
16
14
  align-items: center;
17
15
  will-change: transform;
@@ -15,7 +15,7 @@ const colorsStyle = {
15
15
  };
16
16
  const FULL_PROGRESS = 100;
17
17
  const PageIndicatorDynamic = (props) => {
18
- const { size: height = 8, gap = 8, activeElementWidth = height * 7, elements: count = 10, activeElement: indexFromProps, onActiveElementChange, defaultActiveElement: defaultIndex = 0, active = true, duration: durationFromProps = 3000, cycle = false, colors = 'default', } = props;
18
+ const { size: height = 8, gap = 8, activeElementWidth = height * 7, elements: count = 10, activeElement: indexFromProps, onActiveElementChange, defaultActiveElement: defaultIndex = 0, active = true, duration: durationFromProps = 3000, cycle = false, colors = 'default', className, } = props;
19
19
  const [activeIndex, setActiveIndex] = useState(indexFromProps ?? defaultIndex);
20
20
  const [progress, setProgress] = useState(0);
21
21
  const inProgress = progress < FULL_PROGRESS;
@@ -53,7 +53,7 @@ const PageIndicatorDynamic = (props) => {
53
53
  setActiveIndex(nextActiveIndex);
54
54
  setProgress(0);
55
55
  }, [activeIndex, activeIndexInProps, count, cycle, inProgress, onActiveElementChange]);
56
- return (React.createElement("ol", { className: styles.pageIndicator, style: { height, gap } }, Array.from({ length: count }, (_, index) => {
56
+ return (React.createElement("div", { className: cn(styles.pageIndicator, className), style: { height, gap } }, Array.from({ length: count }, (_, index) => {
57
57
  const isActive = index === activeIndex;
58
58
  const style = {
59
59
  width: isActive ? activeElementWidth : height,
@@ -62,7 +62,7 @@ const PageIndicatorDynamic = (props) => {
62
62
  const progressStyle = isActive
63
63
  ? { transform: `translateX(${progress - FULL_PROGRESS}%)` }
64
64
  : undefined;
65
- return (React.createElement("li", { key: index, style: style, className: cn(styles.element, colorsStyle[colors].element, {
65
+ return (React.createElement("div", { key: index, style: style, className: cn(styles.element, colorsStyle[colors].element, {
66
66
  [styles.active]: isActive,
67
67
  [colorsStyle[colors].active]: isActive,
68
68
  }) },
@@ -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":[],"mappings":";;;;;;;;;AAmBA,MAAM,WAAW,GAAG;AAChB,IA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G,MAAM;YAC7C,YAAY,EAAE,MAAM,GAAG,CAAC;SAC3B;QACD,MAAM,aAAa,GAAoC;cACjD,EAAE,SAAS,EAAE,cAAc,QAAQ,GAAG,aAAa,CAAA,EAAA,CAAI;cACvD,SAAS;QAEf,QACI,KACI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;AACvD,gBAAA,CAAC,MAAM,CAAC,MAAM,GAAG,QAAQ;gBACzB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,QAAQ;aACzC,CAAC,EAAA;YAEF,KACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,EAAE,CAAC,MAAM,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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K,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,KAAI;AACxC,QAAA,MAAM,QAAQ,GAAG,KAAK,KAAK,WAAW;AACtC,QAAA,MAAM,KAAK,GAAwB;YAC/B,KAAK,EAAE,QAAQ,GAAG,kBAAkB,GAAG,MAAM;YAC7C,YAAY,EAAE,MAAM,GAAG,CAAC;SAC3B;QACD,MAAM,aAAa,GAAoC;cACjD,EAAE,SAAS,EAAE,cAAc,QAAQ,GAAG,aAAa,CAAA,EAAA,CAAI;cACvD,SAAS;QAEf,QACI,KACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;AACvD,gBAAA,CAAC,MAAM,CAAC,MAAM,GAAG,QAAQ;gBACzB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,QAAQ;aACzC,CAAC,EAAA;YAEF,KACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,aAAa,EACpB,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EAAA,CAC9D,CACA;KAEb,CAAC,CACA;AAEd;;;;"}
@@ -5,8 +5,6 @@
5
5
  }
6
6
 
7
7
  .pageIndicator {
8
- margin: 0;
9
- padding: 0;
10
8
  display: flex;
11
9
  }
12
10
 
@@ -12,7 +12,7 @@ const colorsStyle = {
12
12
  static: staticColors,
13
13
  'static-inverted': staticInvertedColors,
14
14
  };
15
- const PageIndicatorRunner = ({ activeElement, elements: count = 10, size = 4, colors = 'default', }) => (React.createElement("div", { className: cn(styles.pageIndicator, colorsStyle[colors].pageIndicator), style: { height: size, borderRadius: size / 2 } },
15
+ const PageIndicatorRunner = ({ activeElement, elements: count = 10, size = 4, colors = 'default', className, }) => (React.createElement("div", { className: cn(styles.pageIndicator, colorsStyle[colors].pageIndicator, className), style: { height: size, borderRadius: size / 2 } },
16
16
  React.createElement("div", { style: {
17
17
  transform: `translate(${activeElement * 100}%, 0)`,
18
18
  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":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEG,MAAA,mBAAmB,GAAuC,CAAC,EACpE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,SAAS,GACrB,MACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,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,IAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,YAAA,SAAS,EAAE,CAAA,UAAA,EAAa,aAAa,GAAG,GAAG,CAAO,KAAA,CAAA;AAClD,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,KAAK,EAAE,CAAA,EAAG,GAAG,GAAG,KAAK,CAAG,CAAA,CAAA;YACxB,YAAY,EAAE,IAAI,GAAG,CAAC;AACzB,SAAA,EACD,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC5D,CAAA,CACA;;;;"}
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":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;AAEG,MAAA,mBAAmB,GAAuC,CAAC,EACpE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,MACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,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,IAAA,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,KAAK,EAAE;AACH,YAAA,SAAS,EAAE,CAAA,UAAA,EAAa,aAAa,GAAG,GAAG,CAAO,KAAA,CAAA;AAClD,YAAA,MAAM,EAAE,IAAI;AACZ,YAAA,KAAK,EAAE,CAAA,EAAG,GAAG,GAAG,KAAK,CAAG,CAAA,CAAA;YACxB,YAAY,EAAE,IAAI,GAAG,CAAC;AACzB,SAAA,EACD,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAC5D,CAAA,CACA;;;;"}
@@ -8,3 +8,7 @@
8
8
  transition: transform var(--page-indicator-animation-duration) linear;
9
9
  will-change: transition;
10
10
  }
11
+
12
+ .pageIndicator {
13
+ width: 100%;
14
+ }
@@ -12,7 +12,7 @@ const colorsStyle = {
12
12
  static: staticColors,
13
13
  'static-inverted': staticInvertedColors,
14
14
  };
15
- const PageIndicatorStep = ({ activeElement, elements: count = 10, size = 4, gap = 4, colors = 'default', }) => (React.createElement("ol", { className: styles.pageIndicator, style: { height: size, gap } }, Array.from({ length: count }, (_, index) => (React.createElement("li", { key: index, style: { height: size, borderRadius: size / 2 }, className: cn(styles.element, colorsStyle[colors].element, {
15
+ const PageIndicatorStep = ({ activeElement, elements: count = 10, size = 4, gap = 4, colors = 'default', className, }) => (React.createElement("div", { className: cn(styles.pageIndicator, className), style: { height: size, gap } }, Array.from({ length: count }, (_, index) => (React.createElement("div", { key: index, style: { height: size, borderRadius: size / 2 }, className: cn(styles.element, colorsStyle[colors].element, {
16
16
  [colorsStyle[colors].active]: index === activeElement,
17
17
  }) })))));
18
18
 
@@ -1 +1 @@
1
- {"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorStepProps } 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 PageIndicatorStep: React.FC<PageIndicatorStepProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n gap = 4,\n colors = 'default',\n}) => (\n <ol className={styles.pageIndicator} style={{ height: size, gap }}>\n {Array.from({ length: count }, (_, index) => (\n <li\n key={index}\n style={{ height: size, borderRadius: size / 2 }}\n className={cn(styles.element, colorsStyle[colors].element, {\n [colorsStyle[colors].active]: index === activeElement,\n })}\n />\n ))}\n </ol>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;MAEG,iBAAiB,GAAqC,CAAC,EAChE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,SAAS,GACrB,MACG,KAAI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,SAAS,EAAE,MAAM,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAA,EAC5D,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,MACpC,KACI,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAC/C,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QACvD,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,KAAK,aAAa;AACxD,KAAA,CAAC,EACJ,CAAA,CACL,CAAC,CACD;;;;"}
1
+ {"version":3,"file":"Component.js","sources":["../../../src/components/step/Component.tsx"],"sourcesContent":["import React from 'react';\nimport cn from 'classnames';\n\nimport { type PageIndicatorStepProps } 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 PageIndicatorStep: React.FC<PageIndicatorStepProps> = ({\n activeElement,\n elements: count = 10,\n size = 4,\n gap = 4,\n colors = 'default',\n className,\n}) => (\n <div className={cn(styles.pageIndicator, className)} style={{ height: size, gap }}>\n {Array.from({ length: count }, (_, index) => (\n <div\n key={index}\n style={{ height: size, borderRadius: size / 2 }}\n className={cn(styles.element, colorsStyle[colors].element, {\n [colorsStyle[colors].active]: index === activeElement,\n })}\n />\n ))}\n </div>\n);\n"],"names":[],"mappings":";;;;;;;;AAWA,MAAM,WAAW,GAAG;AAChB,IAAA,QAAQ,EAAE,cAAc;AACxB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,MAAM,EAAE,YAAY;AACpB,IAAA,iBAAiB,EAAE,oBAAoB;CACjC;MAEG,iBAAiB,GAAqC,CAAC,EAChE,aAAa,EACb,QAAQ,EAAE,KAAK,GAAG,EAAE,EACpB,IAAI,GAAG,CAAC,EACR,GAAG,GAAG,CAAC,EACP,MAAM,GAAG,SAAS,EAClB,SAAS,GACZ,MACG,KAAK,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAC5E,EAAA,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,MACpC,6BACI,GAAG,EAAE,KAAK,EACV,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,GAAG,CAAC,EAAE,EAC/C,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE;QACvD,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,KAAK,KAAK,aAAa;AACxD,KAAA,CAAC,EACJ,CAAA,CACL,CAAC,CACA;;;;"}
@@ -6,9 +6,8 @@
6
6
  }
7
7
 
8
8
  .pageIndicator {
9
- margin: 0;
10
- padding: 0;
11
9
  display: flex;
10
+ width: 100%;
12
11
  }
13
12
 
14
13
  .element {