@chayns-components/core 5.0.0-beta.1004 → 5.0.0-beta.1005

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 (192) hide show
  1. package/lib/cjs/components/accordion/Accordion.js +30 -30
  2. package/lib/cjs/components/accordion/Accordion.js.map +1 -1
  3. package/lib/cjs/components/accordion/Accordion.styles.js +22 -21
  4. package/lib/cjs/components/accordion/Accordion.styles.js.map +1 -1
  5. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js +2 -2
  6. package/lib/cjs/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  7. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js +16 -16
  8. package/lib/cjs/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  9. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js +26 -26
  10. package/lib/cjs/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  11. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js +11 -11
  12. package/lib/cjs/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  13. package/lib/cjs/components/amount-control/AmountControl.js +31 -31
  14. package/lib/cjs/components/amount-control/AmountControl.js.map +1 -1
  15. package/lib/cjs/components/amount-control/AmountControl.styles.js +2 -2
  16. package/lib/cjs/components/amount-control/AmountControl.styles.js.map +1 -1
  17. package/lib/cjs/components/button/Button.js +12 -12
  18. package/lib/cjs/components/button/Button.js.map +1 -1
  19. package/lib/cjs/components/button/Button.styles.js +4 -4
  20. package/lib/cjs/components/button/Button.styles.js.map +1 -1
  21. package/lib/cjs/components/combobox/ComboBox.js +48 -48
  22. package/lib/cjs/components/combobox/ComboBox.js.map +1 -1
  23. package/lib/cjs/components/combobox/ComboBox.styles.js +2 -2
  24. package/lib/cjs/components/combobox/ComboBox.styles.js.map +1 -1
  25. package/lib/cjs/components/context-menu/ContextMenu.js +23 -23
  26. package/lib/cjs/components/context-menu/ContextMenu.js.map +1 -1
  27. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.styles.js +2 -2
  28. package/lib/cjs/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
  29. package/lib/cjs/components/expandable-content/ExpandableContent.js +4 -4
  30. package/lib/cjs/components/expandable-content/ExpandableContent.js.map +1 -1
  31. package/lib/cjs/components/expandable-content/ExpandableContent.styles.js +2 -2
  32. package/lib/cjs/components/expandable-content/ExpandableContent.styles.js.map +1 -1
  33. package/lib/cjs/components/file-input/FileInput.js +27 -27
  34. package/lib/cjs/components/file-input/FileInput.js.map +1 -1
  35. package/lib/cjs/components/file-input/FileInput.styles.js +2 -2
  36. package/lib/cjs/components/file-input/FileInput.styles.js.map +1 -1
  37. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js +2 -2
  38. package/lib/cjs/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  39. package/lib/cjs/components/input/Input.styles.js +4 -4
  40. package/lib/cjs/components/input/Input.styles.js.map +1 -1
  41. package/lib/cjs/components/list/List.js +11 -11
  42. package/lib/cjs/components/list/List.js.map +1 -1
  43. package/lib/cjs/components/list/list-item/ListItem.js +17 -17
  44. package/lib/cjs/components/list/list-item/ListItem.js.map +1 -1
  45. package/lib/cjs/components/list/list-item/ListItem.styles.js +2 -2
  46. package/lib/cjs/components/list/list-item/ListItem.styles.js.map +1 -1
  47. package/lib/cjs/components/list/list-item/list-item-body/ListItemBody.styles.js +2 -2
  48. package/lib/cjs/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  49. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js +5 -5
  50. package/lib/cjs/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  51. package/lib/cjs/components/mention-finder/MentionFinder.js +17 -17
  52. package/lib/cjs/components/mention-finder/MentionFinder.js.map +1 -1
  53. package/lib/cjs/components/mention-finder/MentionFinder.styles.js +2 -2
  54. package/lib/cjs/components/mention-finder/MentionFinder.styles.js.map +1 -1
  55. package/lib/cjs/components/popup/Popup.js +34 -34
  56. package/lib/cjs/components/popup/Popup.js.map +1 -1
  57. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +2 -2
  58. package/lib/cjs/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  59. package/lib/cjs/components/progress-bar/ProgressBar.styles.js +2 -2
  60. package/lib/cjs/components/progress-bar/ProgressBar.styles.js.map +1 -1
  61. package/lib/cjs/components/radio-button/RadioButton.js +17 -17
  62. package/lib/cjs/components/radio-button/RadioButton.js.map +1 -1
  63. package/lib/cjs/components/radio-button/RadioButton.styles.js +2 -2
  64. package/lib/cjs/components/radio-button/RadioButton.styles.js.map +1 -1
  65. package/lib/cjs/components/search-box/SearchBox.js +64 -64
  66. package/lib/cjs/components/search-box/SearchBox.js.map +1 -1
  67. package/lib/cjs/components/search-box/SearchBox.styles.js +2 -2
  68. package/lib/cjs/components/search-box/SearchBox.styles.js.map +1 -1
  69. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js +2 -2
  70. package/lib/cjs/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  71. package/lib/cjs/components/search-input/SearchInput.js +16 -16
  72. package/lib/cjs/components/search-input/SearchInput.js.map +1 -1
  73. package/lib/cjs/components/search-input/SearchInput.styles.js +3 -3
  74. package/lib/cjs/components/search-input/SearchInput.styles.js.map +1 -1
  75. package/lib/cjs/components/slider/Slider.styles.js +2 -2
  76. package/lib/cjs/components/slider/Slider.styles.js.map +1 -1
  77. package/lib/cjs/components/slider-button/SliderButton.js +44 -44
  78. package/lib/cjs/components/slider-button/SliderButton.js.map +1 -1
  79. package/lib/cjs/components/slider-button/SliderButton.styles.js +2 -2
  80. package/lib/cjs/components/slider-button/SliderButton.styles.js.map +1 -1
  81. package/lib/cjs/components/truncation/Truncation.styles.js +2 -2
  82. package/lib/cjs/components/truncation/Truncation.styles.js.map +1 -1
  83. package/lib/cjs/utils/sliderButton.js.map +1 -1
  84. package/lib/esm/components/accordion/Accordion.js +1 -1
  85. package/lib/esm/components/accordion/Accordion.js.map +1 -1
  86. package/lib/esm/components/accordion/Accordion.styles.js +21 -20
  87. package/lib/esm/components/accordion/Accordion.styles.js.map +1 -1
  88. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js +1 -1
  89. package/lib/esm/components/accordion/accordion-body/AccordionBody.styles.js.map +1 -1
  90. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js +1 -1
  91. package/lib/esm/components/accordion/accordion-group/AccordionGroup.js.map +1 -1
  92. package/lib/esm/components/accordion/accordion-head/AccordionHead.js +1 -1
  93. package/lib/esm/components/accordion/accordion-head/AccordionHead.js.map +1 -1
  94. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js +1 -1
  95. package/lib/esm/components/accordion/accordion-head/AccordionHead.styles.js.map +1 -1
  96. package/lib/esm/components/amount-control/AmountControl.js +2 -2
  97. package/lib/esm/components/amount-control/AmountControl.js.map +1 -1
  98. package/lib/esm/components/amount-control/AmountControl.styles.js +1 -1
  99. package/lib/esm/components/amount-control/AmountControl.styles.js.map +1 -1
  100. package/lib/esm/components/button/Button.js +1 -1
  101. package/lib/esm/components/button/Button.js.map +1 -1
  102. package/lib/esm/components/button/Button.styles.js +1 -1
  103. package/lib/esm/components/button/Button.styles.js.map +1 -1
  104. package/lib/esm/components/combobox/ComboBox.js +1 -1
  105. package/lib/esm/components/combobox/ComboBox.js.map +1 -1
  106. package/lib/esm/components/combobox/ComboBox.styles.js +1 -1
  107. package/lib/esm/components/combobox/ComboBox.styles.js.map +1 -1
  108. package/lib/esm/components/context-menu/ContextMenu.js +1 -1
  109. package/lib/esm/components/context-menu/ContextMenu.js.map +1 -1
  110. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.styles.js +1 -1
  111. package/lib/esm/components/context-menu/context-menu-content/ContextMenuContent.styles.js.map +1 -1
  112. package/lib/esm/components/expandable-content/ExpandableContent.js +1 -1
  113. package/lib/esm/components/expandable-content/ExpandableContent.js.map +1 -1
  114. package/lib/esm/components/expandable-content/ExpandableContent.styles.js +1 -1
  115. package/lib/esm/components/expandable-content/ExpandableContent.styles.js.map +1 -1
  116. package/lib/esm/components/file-input/FileInput.js +1 -1
  117. package/lib/esm/components/file-input/FileInput.js.map +1 -1
  118. package/lib/esm/components/file-input/FileInput.styles.js +1 -1
  119. package/lib/esm/components/file-input/FileInput.styles.js.map +1 -1
  120. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js +1 -1
  121. package/lib/esm/components/filter-buttons/filter-button/FilterButton.styles.js.map +1 -1
  122. package/lib/esm/components/input/Input.styles.js +1 -1
  123. package/lib/esm/components/input/Input.styles.js.map +1 -1
  124. package/lib/esm/components/list/List.js +1 -1
  125. package/lib/esm/components/list/List.js.map +1 -1
  126. package/lib/esm/components/list/list-item/ListItem.js +1 -1
  127. package/lib/esm/components/list/list-item/ListItem.js.map +1 -1
  128. package/lib/esm/components/list/list-item/ListItem.styles.js +1 -1
  129. package/lib/esm/components/list/list-item/ListItem.styles.js.map +1 -1
  130. package/lib/esm/components/list/list-item/list-item-body/ListItemBody.styles.js +1 -1
  131. package/lib/esm/components/list/list-item/list-item-body/ListItemBody.styles.js.map +1 -1
  132. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js +1 -1
  133. package/lib/esm/components/list/list-item/list-item-head/ListItemHead.styles.js.map +1 -1
  134. package/lib/esm/components/mention-finder/MentionFinder.js +1 -1
  135. package/lib/esm/components/mention-finder/MentionFinder.js.map +1 -1
  136. package/lib/esm/components/mention-finder/MentionFinder.styles.js +1 -1
  137. package/lib/esm/components/mention-finder/MentionFinder.styles.js.map +1 -1
  138. package/lib/esm/components/popup/Popup.js +1 -1
  139. package/lib/esm/components/popup/Popup.js.map +1 -1
  140. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js +1 -1
  141. package/lib/esm/components/popup/popup-content-wrapper/PopupContentWrapper.styles.js.map +1 -1
  142. package/lib/esm/components/progress-bar/ProgressBar.styles.js +1 -1
  143. package/lib/esm/components/progress-bar/ProgressBar.styles.js.map +1 -1
  144. package/lib/esm/components/radio-button/RadioButton.js +2 -2
  145. package/lib/esm/components/radio-button/RadioButton.js.map +1 -1
  146. package/lib/esm/components/radio-button/RadioButton.styles.js +1 -1
  147. package/lib/esm/components/radio-button/RadioButton.styles.js.map +1 -1
  148. package/lib/esm/components/search-box/SearchBox.js +1 -1
  149. package/lib/esm/components/search-box/SearchBox.js.map +1 -1
  150. package/lib/esm/components/search-box/SearchBox.styles.js +1 -1
  151. package/lib/esm/components/search-box/SearchBox.styles.js.map +1 -1
  152. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js +1 -1
  153. package/lib/esm/components/search-box/search-box-body/SearchBoxBody.styles.js.map +1 -1
  154. package/lib/esm/components/search-input/SearchInput.js +1 -1
  155. package/lib/esm/components/search-input/SearchInput.js.map +1 -1
  156. package/lib/esm/components/search-input/SearchInput.styles.js +1 -1
  157. package/lib/esm/components/search-input/SearchInput.styles.js.map +1 -1
  158. package/lib/esm/components/slider/Slider.styles.js +1 -1
  159. package/lib/esm/components/slider/Slider.styles.js.map +1 -1
  160. package/lib/esm/components/slider-button/SliderButton.js +1 -1
  161. package/lib/esm/components/slider-button/SliderButton.js.map +1 -1
  162. package/lib/esm/components/slider-button/SliderButton.styles.js +1 -1
  163. package/lib/esm/components/slider-button/SliderButton.styles.js.map +1 -1
  164. package/lib/esm/components/truncation/Truncation.styles.js +1 -1
  165. package/lib/esm/components/truncation/Truncation.styles.js.map +1 -1
  166. package/lib/esm/utils/sliderButton.js.map +1 -1
  167. package/lib/types/components/accordion/Accordion.styles.d.ts +2 -263
  168. package/lib/types/components/accordion/accordion-body/AccordionBody.styles.d.ts +2 -263
  169. package/lib/types/components/accordion/accordion-head/AccordionHead.styles.d.ts +20 -2660
  170. package/lib/types/components/amount-control/AmountControl.styles.d.ts +2 -273
  171. package/lib/types/components/button/Button.styles.d.ts +6 -799
  172. package/lib/types/components/combobox/ComboBox.styles.d.ts +2 -263
  173. package/lib/types/components/context-menu/context-menu-content/ContextMenuContent.styles.d.ts +2 -263
  174. package/lib/types/components/expandable-content/ExpandableContent.styles.d.ts +2 -263
  175. package/lib/types/components/file-input/FileInput.styles.d.ts +2 -263
  176. package/lib/types/components/filter-buttons/filter-button/FilterButton.styles.d.ts +2 -263
  177. package/lib/types/components/input/Input.styles.d.ts +6 -791
  178. package/lib/types/components/list/list-item/ListItem.styles.d.ts +2 -263
  179. package/lib/types/components/list/list-item/list-item-body/ListItemBody.styles.d.ts +2 -263
  180. package/lib/types/components/list/list-item/list-item-head/ListItemHead.styles.d.ts +8 -1052
  181. package/lib/types/components/mention-finder/MentionFinder.styles.d.ts +2 -263
  182. package/lib/types/components/popup/popup-content-wrapper/PopupContentWrapper.styles.d.ts +2 -263
  183. package/lib/types/components/progress-bar/ProgressBar.styles.d.ts +2 -263
  184. package/lib/types/components/radio-button/RadioButton.styles.d.ts +3 -264
  185. package/lib/types/components/search-box/SearchBox.styles.d.ts +2 -263
  186. package/lib/types/components/search-box/search-box-body/SearchBoxBody.styles.d.ts +2 -263
  187. package/lib/types/components/search-input/SearchInput.styles.d.ts +4 -526
  188. package/lib/types/components/slider/Slider.styles.d.ts +3 -585
  189. package/lib/types/components/slider-button/SliderButton.styles.d.ts +2 -263
  190. package/lib/types/components/truncation/Truncation.styles.d.ts +2 -263
  191. package/lib/types/utils/sliderButton.d.ts +1 -1
  192. package/package.json +3 -3
@@ -4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.StyledSearchBoxLeftWrapper = exports.StyledSearchBoxIcon = exports.StyledSearchBox = exports.StyledMotionSearchBoxBody = void 0;
7
- var _framerMotion = require("framer-motion");
7
+ var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
11
  const StyledSearchBox = exports.StyledSearchBox = _styledComponents.default.div``;
12
- const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_framerMotion.motion.div)`
12
+ const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_react.motion.div)`
13
13
  background: ${({
14
14
  theme
15
15
  }) => theme['101']};
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBox.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledSearchBox","exports","styled","div","StyledMotionSearchBoxBody","motion","theme","$width","$height","$browser","css","StyledSearchBoxIcon","StyledSearchBoxLeftWrapper"],"sources":["../../../../src/components/search-box/SearchBox.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBox = styled.div``;\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $height: number;\n $width: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['101']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n cursor: pointer;\n width: ${({ $width }) => $width}px;\n max-height: 300px;\n overflow-y: ${({ $height }) => ($height <= 300 ? 'hidden' : 'auto')};\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledMotionSearchBoxBodyProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n\nexport const StyledSearchBoxIcon = styled.div`\n cursor: pointer;\n padding: 0 10px;\n`;\n\nexport const StyledSearchBoxLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAA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A,KAAK,CAAC,SAAS,CAAC;AAC9E;AACA;AACA,MAAM,CAAC;EAAEG,QAAQ;EAAEH;AAAsC,CAAC,KAClDG,QAAQ,KAAK,SAAS,GAChB,IAAAC,qBAAG;AACjB,0CAA0CJ,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAI,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CJ,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC;AAEM,MAAMK,mBAAmB,GAAAV,OAAA,CAAAU,mBAAA,GAAGT,yBAAM,CAACC,GAAG;AAC7C;AACA;AACA,CAAC;AAEM,MAAMS,0BAA0B,GAAAX,OAAA,CAAAW,0BAAA,GAAGV,yBAAM,CAACC,GAAG;AACpD;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBox.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledSearchBox","exports","styled","div","StyledMotionSearchBoxBody","motion","theme","$width","$height","$browser","css","StyledSearchBoxIcon","StyledSearchBoxLeftWrapper"],"sources":["../../../../src/components/search-box/SearchBox.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../types/chayns';\nimport type { WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\nexport const StyledSearchBox = styled.div``;\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $height: number;\n $width: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['101']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n cursor: pointer;\n width: ${({ $width }) => $width}px;\n max-height: 300px;\n overflow-y: ${({ $height }) => ($height <= 300 ? 'hidden' : 'auto')};\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledMotionSearchBoxBodyProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n\nexport const StyledSearchBoxIcon = styled.div`\n cursor: pointer;\n padding: 0 10px;\n`;\n\nexport const StyledSearchBoxLeftWrapper = styled.div`\n display: flex;\n align-items: center;\n gap: 8px;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAA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AAQ;EAAEH;AAAsC,CAAC,KAClDG,QAAQ,KAAK,SAAS,GAChB,IAAAC,qBAAG;AACjB,0CAA0CJ,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAI,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CJ,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC;AAEM,MAAMK,mBAAmB,GAAAV,OAAA,CAAAU,mBAAA,GAAGT,yBAAM,CAACC,GAAG;AAC7C;AACA;AACA,CAAC;AAEM,MAAMS,0BAA0B,GAAAX,OAAA,CAAAW,0BAAA,GAAGV,yBAAM,CAACC,GAAG;AACpD;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.StyledSearchBoxBodyHeadGroupName = exports.StyledSearchBoxBodyHead = exports.StyledSearchBoxBodyContent = exports.StyledMotionSearchBoxBody = void 0;
7
- var _framerMotion = require("framer-motion");
7
+ var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
9
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
10
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
- const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_framerMotion.motion.div)`
11
+ const StyledMotionSearchBoxBody = exports.StyledMotionSearchBoxBody = (0, _styledComponents.default)(_react.motion.div)`
12
12
  background: ${({
13
13
  theme
14
14
  }) => theme['101']};
@@ -1 +1 @@
1
- {"version":3,"file":"SearchBoxBody.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledMotionSearchBoxBody","exports","styled","motion","div","theme","$width","StyledSearchBoxBodyHead","$hasGroupName","css","$hasScrolled","StyledSearchBoxBodyHeadGroupName","text","StyledSearchBoxBodyContent","$headHeight","$height","$browser"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../../types/chayns';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $width: number;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['101']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n width: ${({ $width }) => $width - 2}px;\n max-height: 300px;\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n`;\n\nexport const StyledSearchBoxBodyHead = styled.div<StyledSearchBoxHeadProps>`\n padding: 10px 10px 5px;\n display: flex;\n flex-direction: column;\n\n ${({ $hasGroupName }) =>\n $hasGroupName &&\n css`\n gap: 15px;\n `}\n\n ${({ $hasScrolled }) =>\n $hasScrolled &&\n css`\n box-shadow: 0 1px 4px #0000001a;\n `}\n`;\n\ntype StyledSearchBoxHeadProps = WithTheme<{ $hasScrolled: boolean; $hasGroupName: boolean }>;\n\ntype StyledSearchBoxBodyHeadGroupNameNameProps = WithTheme<unknown>;\n\nexport const StyledSearchBoxBodyHeadGroupName = styled.div<StyledSearchBoxBodyHeadGroupNameNameProps>`\n color: ${({ theme }: StyledSearchBoxBodyHeadGroupNameNameProps) => theme.text};\n font-weight: bold;\n`;\n\ntype StyledSearchBoxBodyContentProps = WithTheme<{\n $height: number;\n $headHeight: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledSearchBoxBodyContent = styled.div<StyledSearchBoxBodyContentProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n width: 100%;\n max-height: ${({ $headHeight }) => 300 - $headHeight}px;\n overflow-y: ${({ $height, $headHeight }) => ($height + $headHeight <= 300 ? 'hidden' : 'auto')};\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledSearchBoxBodyContentProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAA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M,MAAME,uBAAuB,GAAAN,OAAA,CAAAM,uBAAA,GAAGL,yBAAM,CAACE,GAA6B;AAC3E;AACA;AACA;AACA;AACA,MAAM,CAAC;EAAEI;AAAc,CAAC,KAChBA,aAAa,IACb,IAAAC,qBAAG;AACX;AACA,SAAS;AACT;AACA,MAAM,CAAC;EAAEC;AAAa,CAAC,KACfA,YAAY,IACZ,IAAAD,qBAAG;AACX;AACA,SAAS;AACT,CAAC;AAMM,MAAME,gCAAgC,GAAAV,OAAA,CAAAU,gCAAA,GAAGT,yBAAM,CAACE,GAA8C;AACrG,aAAa,CAAC;EAAEC;AAAiD,CAAC,KAAKA,KAAK,CAACO,IAAI;AACjF;AACA,CAAC;AAQM,MAAMC,0BAA0B,GAAAZ,OAAA,CAAAY,0BAAA,GAAGX,yBAAM,CAACE,GAAoC;AACrF;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEU;AAAY,CAAC,KAAK,GAAG,GAAGA,WAAW;AACxD,kBAAkB,CAAC;EAAEC,OAAO;EAAED;AAAY,CAAC,KAAMC,OAAO,GAAGD,WAAW,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AAClG;AACA;AACA,MAAM,CAAC;EAAEE,QAAQ;EAAEX;AAAuC,CAAC,KACnDW,QAAQ,KAAK,SAAS,GAChB,IAAAP,qBAAG;AACjB,0CAA0CJ,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAI,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CJ,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchBoxBody.styles.js","names":["_react","require","_styledComponents","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","StyledMotionSearchBoxBody","exports","styled","motion","div","theme","$width","StyledSearchBoxBodyHead","$hasGroupName","css","$hasScrolled","StyledSearchBoxBodyHeadGroupName","text","StyledSearchBoxBodyContent","$headHeight","$height","$browser"],"sources":["../../../../../src/components/search-box/search-box-body/SearchBoxBody.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled, { css } from 'styled-components';\nimport { BrowserName } from '../../../types/chayns';\nimport type { WithTheme } from '../../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledMotionSearchBoxBodyProps = WithTheme<{\n $width: number;\n}>;\n\nexport const StyledMotionSearchBoxBody = styled(motion.div)<StyledMotionSearchBoxBodyProps>`\n background: ${({ theme }: StyledMotionSearchBoxBodyProps) => theme['101']};\n position: absolute;\n z-index: 4;\n display: flex;\n flex-direction: column;\n border: 1px solid rgba(160, 160, 160, 0.3);\n border-bottom-left-radius: 3px;\n border-bottom-right-radius: 3px;\n border-top: none;\n width: ${({ $width }) => $width - 2}px;\n max-height: 300px;\n box-shadow: 0 0 0 1px\n rgba(${({ theme }: StyledMotionSearchBoxBodyProps) => theme['009-rgb']}, 0.08) inset;\n`;\n\nexport const StyledSearchBoxBodyHead = styled.div<StyledSearchBoxHeadProps>`\n padding: 10px 10px 5px;\n display: flex;\n flex-direction: column;\n\n ${({ $hasGroupName }) =>\n $hasGroupName &&\n css`\n gap: 15px;\n `}\n\n ${({ $hasScrolled }) =>\n $hasScrolled &&\n css`\n box-shadow: 0 1px 4px #0000001a;\n `}\n`;\n\ntype StyledSearchBoxHeadProps = WithTheme<{ $hasScrolled: boolean; $hasGroupName: boolean }>;\n\ntype StyledSearchBoxBodyHeadGroupNameNameProps = WithTheme<unknown>;\n\nexport const StyledSearchBoxBodyHeadGroupName = styled.div<StyledSearchBoxBodyHeadGroupNameNameProps>`\n color: ${({ theme }: StyledSearchBoxBodyHeadGroupNameNameProps) => theme.text};\n font-weight: bold;\n`;\n\ntype StyledSearchBoxBodyContentProps = WithTheme<{\n $height: number;\n $headHeight: number;\n $browser: BrowserName;\n}>;\n\nexport const StyledSearchBoxBodyContent = styled.div<StyledSearchBoxBodyContentProps>`\n display: flex;\n flex-direction: column;\n cursor: pointer;\n width: 100%;\n max-height: ${({ $headHeight }) => 300 - $headHeight}px;\n overflow-y: ${({ $height, $headHeight }) => ($height + $headHeight <= 300 ? 'hidden' : 'auto')};\n\n // Styles for custom scrollbar\n ${({ $browser, theme }: StyledSearchBoxBodyContentProps) =>\n $browser === 'firefox'\n ? css`\n scrollbar-color: rgba(${theme['text-rgb']}, 0.15) transparent;\n scrollbar-width: thin;\n `\n : css`\n &::-webkit-scrollbar {\n width: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background-color: transparent;\n }\n\n &::-webkit-scrollbar-button {\n background-color: transparent;\n height: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(${theme['text-rgb']}, 0.15);\n border-radius: 20px;\n }\n `}\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD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AACrG,aAAa,CAAC;EAAEC;AAAiD,CAAC,KAAKA,KAAK,CAACO,IAAI;AACjF;AACA,CAAC;AAQM,MAAMC,0BAA0B,GAAAZ,OAAA,CAAAY,0BAAA,GAAGX,yBAAM,CAACE,GAAoC;AACrF;AACA;AACA;AACA;AACA,kBAAkB,CAAC;EAAEU;AAAY,CAAC,KAAK,GAAG,GAAGA,WAAW;AACxD,kBAAkB,CAAC;EAAEC,OAAO;EAAED;AAAY,CAAC,KAAMC,OAAO,GAAGD,WAAW,IAAI,GAAG,GAAG,QAAQ,GAAG,MAAO;AAClG;AACA;AACA,MAAM,CAAC;EAAEE,QAAQ;EAAEX;AAAuC,CAAC,KACnDW,QAAQ,KAAK,SAAS,GAChB,IAAAP,qBAAG;AACjB,0CAA0CJ,KAAK,CAAC,UAAU,CAAC;AAC3D;AACA,eAAe,GACD,IAAAI,qBAAG;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+CJ,KAAK,CAAC,UAAU,CAAC;AAChE;AACA;AACA,eAAe;AACf,CAAC","ignoreList":[]}
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _framerMotion = require("framer-motion");
8
- var _react = _interopRequireWildcard(require("react"));
7
+ var _react = require("motion/react");
8
+ var _react2 = _interopRequireWildcard(require("react"));
9
9
  var _styledComponents = require("styled-components");
10
10
  var _Icon = _interopRequireDefault(require("../icon/Icon"));
11
11
  var _Input = _interopRequireWildcard(require("../input/Input"));
@@ -23,12 +23,12 @@ const SearchInput = ({
23
23
  size = _Input.InputSize.Medium,
24
24
  value
25
25
  }) => {
26
- const [isSearchInputActive, setIsSearchInputActive] = (0, _react.useState)(isActive ?? (typeof value === 'string' && value.trim() !== ''));
27
- const inputRef = (0, _react.useRef)(null);
26
+ const [isSearchInputActive, setIsSearchInputActive] = (0, _react2.useState)(isActive ?? (typeof value === 'string' && value.trim() !== ''));
27
+ const inputRef = (0, _react2.useRef)(null);
28
28
  const theme = (0, _styledComponents.useTheme)();
29
- const handleBackIconClick = (0, _react.useCallback)(() => setIsSearchInputActive(false), []);
30
- const handleSearchIconClick = (0, _react.useCallback)(() => setIsSearchInputActive(true), []);
31
- (0, _react.useEffect)(() => {
29
+ const handleBackIconClick = (0, _react2.useCallback)(() => setIsSearchInputActive(false), []);
30
+ const handleSearchIconClick = (0, _react2.useCallback)(() => setIsSearchInputActive(true), []);
31
+ (0, _react2.useEffect)(() => {
32
32
  if (typeof onActiveChange === 'function') {
33
33
  onActiveChange(isSearchInputActive);
34
34
  }
@@ -37,17 +37,17 @@ const SearchInput = ({
37
37
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
38
38
  }
39
39
  }, [isSearchInputActive, onActiveChange]);
40
- (0, _react.useEffect)(() => {
40
+ (0, _react2.useEffect)(() => {
41
41
  if (typeof isActive === 'boolean') {
42
42
  setIsSearchInputActive(isActive);
43
43
  }
44
44
  }, [isActive]);
45
- return /*#__PURE__*/_react.default.createElement(_SearchInput.StyledSearchInput, {
45
+ return /*#__PURE__*/_react2.default.createElement(_SearchInput.StyledSearchInput, {
46
46
  className: "beta-chayns-search-input",
47
47
  $size: size
48
- }, /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapper, null, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
48
+ }, /*#__PURE__*/_react2.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapper, null, /*#__PURE__*/_react2.default.createElement(_react.AnimatePresence, {
49
49
  initial: false
50
- }, /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapperContent, {
50
+ }, /*#__PURE__*/_react2.default.createElement(_SearchInput.StyledMotionSearchInputIconWrapperContent, {
51
51
  animate: {
52
52
  opacity: 1
53
53
  },
@@ -63,14 +63,14 @@ const SearchInput = ({
63
63
  duration: 0.3
64
64
  },
65
65
  id: isSearchInputActive ? 'search-input-backIcon' : 'search-input-searchIcon'
66
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
66
+ }, /*#__PURE__*/_react2.default.createElement(_Icon.default, {
67
67
  color: iconColor,
68
68
  icons: isSearchInputActive ? ['fa fa-arrow-left'] : ['fa fa-search'],
69
69
  onClick: isSearchInputActive ? handleBackIconClick : handleSearchIconClick,
70
70
  size: 18
71
- })))), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
71
+ })))), /*#__PURE__*/_react2.default.createElement(_react.AnimatePresence, {
72
72
  initial: false
73
- }, isSearchInputActive && /*#__PURE__*/_react.default.createElement(_SearchInput.StyledMotionSearchInputContentWrapper, {
73
+ }, isSearchInputActive && /*#__PURE__*/_react2.default.createElement(_SearchInput.StyledMotionSearchInputContentWrapper, {
74
74
  animate: {
75
75
  opacity: 1,
76
76
  width: '100%'
@@ -87,8 +87,8 @@ const SearchInput = ({
87
87
  transition: {
88
88
  duration: 0.3
89
89
  }
90
- }, /*#__PURE__*/_react.default.createElement(_Input.default, {
91
- leftElement: /*#__PURE__*/_react.default.createElement(_Icon.default, {
90
+ }, /*#__PURE__*/_react2.default.createElement(_Input.default, {
91
+ leftElement: /*#__PURE__*/_react2.default.createElement(_Icon.default, {
92
92
  color: theme.text,
93
93
  icons: ['far fa-search']
94
94
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.js","names":["_framerMotion","require","_react","_interopRequireWildcard","_styledComponents","_Icon","_interopRequireDefault","_Input","_SearchInput","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SearchInput","iconColor","isActive","onActiveChange","onChange","onKeyDown","placeholder","size","InputSize","Medium","value","isSearchInputActive","setIsSearchInputActive","useState","trim","inputRef","useRef","theme","useTheme","handleBackIconClick","useCallback","handleSearchIconClick","useEffect","_inputRef$current","current","focus","createElement","StyledSearchInput","className","$size","StyledMotionSearchInputIconWrapper","AnimatePresence","initial","StyledMotionSearchInputIconWrapperContent","animate","opacity","exit","position","key","transition","duration","id","color","icons","onClick","StyledMotionSearchInputContentWrapper","width","leftElement","text","ref","shouldShowClearIcon","displayName","_default","exports"],"sources":["../../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { AnimatePresence } from 'framer-motion';\nimport React, {\n ChangeEventHandler,\n CSSProperties,\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport Input, { InputRef, InputSize } from '../input/Input';\nimport {\n StyledMotionSearchInputContentWrapper,\n StyledMotionSearchInputIconWrapper,\n StyledMotionSearchInputIconWrapperContent,\n StyledSearchInput,\n} from './SearchInput.styles';\n\nexport type SearchInputProps = {\n /**\n * Color of the icon\n */\n iconColor?: CSSProperties['color'];\n /**\n * Force the active state of the input and override the internal state\n */\n isActive?: boolean;\n /**\n * Function that is executed when the active state of the input changes\n */\n onActiveChange?: (isActive: boolean) => void;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a key is pressed\n */\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * The size of the input field\n */\n size?: InputSize;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n};\n\nconst SearchInput: FC<SearchInputProps> = ({\n iconColor,\n isActive,\n onActiveChange,\n onChange,\n onKeyDown,\n placeholder,\n size = InputSize.Medium,\n value,\n}) => {\n const [isSearchInputActive, setIsSearchInputActive] = useState(\n isActive ?? (typeof value === 'string' && value.trim() !== ''),\n );\n\n const inputRef = useRef<InputRef>(null);\n\n const theme = useTheme() as Theme;\n\n const handleBackIconClick = useCallback(() => setIsSearchInputActive(false), []);\n\n const handleSearchIconClick = useCallback(() => setIsSearchInputActive(true), []);\n\n useEffect(() => {\n if (typeof onActiveChange === 'function') {\n onActiveChange(isSearchInputActive);\n }\n\n if (isSearchInputActive) {\n inputRef.current?.focus();\n }\n }, [isSearchInputActive, onActiveChange]);\n\n useEffect(() => {\n if (typeof isActive === 'boolean') {\n setIsSearchInputActive(isActive);\n }\n }, [isActive]);\n\n return (\n <StyledSearchInput className=\"beta-chayns-search-input\" $size={size}>\n <StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n <StyledMotionSearchInputIconWrapperContent\n animate={{ opacity: 1 }}\n exit={{ opacity: 0, position: 'absolute' }}\n initial={{ opacity: 0 }}\n key={isSearchInputActive ? 'backIcon' : 'searchIcon'}\n transition={{ duration: 0.3 }}\n id={\n isSearchInputActive\n ? 'search-input-backIcon'\n : 'search-input-searchIcon'\n }\n >\n <Icon\n color={iconColor}\n icons={isSearchInputActive ? ['fa fa-arrow-left'] : ['fa fa-search']}\n onClick={\n isSearchInputActive ? handleBackIconClick : handleSearchIconClick\n }\n size={18}\n />\n </StyledMotionSearchInputIconWrapperContent>\n </AnimatePresence>\n </StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n {isSearchInputActive && (\n <StyledMotionSearchInputContentWrapper\n animate={{ opacity: 1, width: '100%' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"searchInputContentWrapper\"\n transition={{ duration: 0.3 }}\n >\n <Input\n leftElement={<Icon color={theme.text} icons={['far fa-search']} />}\n onChange={onChange}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n ref={inputRef}\n shouldShowClearIcon\n size={size}\n value={value}\n />\n </StyledMotionSearchInputContentWrapper>\n )}\n </AnimatePresence>\n </StyledSearchInput>\n );\n};\n\nSearchInput.displayName = 'SearchInput';\n\nexport default SearchInput;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;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AqC;IAClCX,OAAO,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAO,CAAE;IACvCV,IAAI,EAAE;MAAED,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAE,CAAE;IAC/Bd,OAAO,EAAE;MAAEG,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAE,CAAE;IAClCR,GAAG,EAAC,2BAA2B;IAC/BC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE9BnE,MAAA,CAAAS,OAAA,CAAA4C,aAAA,CAAChD,MAAA,CAAAI,OAAK;IACFiE,WAAW,eAAE1E,MAAA,CAAAS,OAAA,CAAA4C,aAAA,CAAClD,KAAA,CAAAM,OAAI;MAAC4D,KAAK,EAAEzB,KAAK,CAAC+B,IAAK;MAACL,KAAK,EAAE,CAAC,eAAe;IAAE,CAAE,CAAE;IACnEvC,QAAQ,EAAEA,QAAS;IACnBC,SAAS,EAAEA,SAAU;IACrBC,WAAW,EAAEA,WAAY;IACzB2C,GAAG,EAAElC,QAAS;IACdmC,mBAAmB;IACnB3C,IAAI,EAAEA,IAAK;IACXG,KAAK,EAAEA;EAAM,CAChB,CACkC,CAE9B,CACF,CAAC;AAE5B,CAAC;AAEDV,WAAW,CAACmD,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvE,OAAA,GAEzBkB,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"SearchInput.js","names":["_react","require","_react2","_interopRequireWildcard","_styledComponents","_Icon","_interopRequireDefault","_Input","_SearchInput","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SearchInput","iconColor","isActive","onActiveChange","onChange","onKeyDown","placeholder","size","InputSize","Medium","value","isSearchInputActive","setIsSearchInputActive","useState","trim","inputRef","useRef","theme","useTheme","handleBackIconClick","useCallback","handleSearchIconClick","useEffect","_inputRef$current","current","focus","createElement","StyledSearchInput","className","$size","StyledMotionSearchInputIconWrapper","AnimatePresence","initial","StyledMotionSearchInputIconWrapperContent","animate","opacity","exit","position","key","transition","duration","id","color","icons","onClick","StyledMotionSearchInputContentWrapper","width","leftElement","text","ref","shouldShowClearIcon","displayName","_default","exports"],"sources":["../../../../src/components/search-input/SearchInput.tsx"],"sourcesContent":["import { AnimatePresence } from 'motion/react';\nimport React, {\n ChangeEventHandler,\n CSSProperties,\n FC,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { useTheme } from 'styled-components';\nimport type { Theme } from '../color-scheme-provider/ColorSchemeProvider';\nimport Icon from '../icon/Icon';\nimport Input, { InputRef, InputSize } from '../input/Input';\nimport {\n StyledMotionSearchInputContentWrapper,\n StyledMotionSearchInputIconWrapper,\n StyledMotionSearchInputIconWrapperContent,\n StyledSearchInput,\n} from './SearchInput.styles';\n\nexport type SearchInputProps = {\n /**\n * Color of the icon\n */\n iconColor?: CSSProperties['color'];\n /**\n * Force the active state of the input and override the internal state\n */\n isActive?: boolean;\n /**\n * Function that is executed when the active state of the input changes\n */\n onActiveChange?: (isActive: boolean) => void;\n /**\n * Function that is executed when the text of the input changes\n */\n onChange: ChangeEventHandler<HTMLInputElement>;\n /**\n * Function that is executed when a key is pressed\n */\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n /**\n * Placeholder for the input field\n */\n placeholder?: string;\n /**\n * The size of the input field\n */\n size?: InputSize;\n /**\n * Value if the input field should be controlled\n */\n value?: string;\n};\n\nconst SearchInput: FC<SearchInputProps> = ({\n iconColor,\n isActive,\n onActiveChange,\n onChange,\n onKeyDown,\n placeholder,\n size = InputSize.Medium,\n value,\n}) => {\n const [isSearchInputActive, setIsSearchInputActive] = useState(\n isActive ?? (typeof value === 'string' && value.trim() !== ''),\n );\n\n const inputRef = useRef<InputRef>(null);\n\n const theme = useTheme() as Theme;\n\n const handleBackIconClick = useCallback(() => setIsSearchInputActive(false), []);\n\n const handleSearchIconClick = useCallback(() => setIsSearchInputActive(true), []);\n\n useEffect(() => {\n if (typeof onActiveChange === 'function') {\n onActiveChange(isSearchInputActive);\n }\n\n if (isSearchInputActive) {\n inputRef.current?.focus();\n }\n }, [isSearchInputActive, onActiveChange]);\n\n useEffect(() => {\n if (typeof isActive === 'boolean') {\n setIsSearchInputActive(isActive);\n }\n }, [isActive]);\n\n return (\n <StyledSearchInput className=\"beta-chayns-search-input\" $size={size}>\n <StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n <StyledMotionSearchInputIconWrapperContent\n animate={{ opacity: 1 }}\n exit={{ opacity: 0, position: 'absolute' }}\n initial={{ opacity: 0 }}\n key={isSearchInputActive ? 'backIcon' : 'searchIcon'}\n transition={{ duration: 0.3 }}\n id={\n isSearchInputActive\n ? 'search-input-backIcon'\n : 'search-input-searchIcon'\n }\n >\n <Icon\n color={iconColor}\n icons={isSearchInputActive ? ['fa fa-arrow-left'] : ['fa fa-search']}\n onClick={\n isSearchInputActive ? handleBackIconClick : handleSearchIconClick\n }\n size={18}\n />\n </StyledMotionSearchInputIconWrapperContent>\n </AnimatePresence>\n </StyledMotionSearchInputIconWrapper>\n <AnimatePresence initial={false}>\n {isSearchInputActive && (\n <StyledMotionSearchInputContentWrapper\n animate={{ opacity: 1, width: '100%' }}\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n key=\"searchInputContentWrapper\"\n transition={{ duration: 0.3 }}\n >\n <Input\n leftElement={<Icon color={theme.text} icons={['far fa-search']} />}\n onChange={onChange}\n onKeyDown={onKeyDown}\n placeholder={placeholder}\n ref={inputRef}\n shouldShowClearIcon\n size={size}\n value={value}\n />\n </StyledMotionSearchInputContentWrapper>\n )}\n </AnimatePresence>\n </StyledSearchInput>\n );\n};\n\nSearchInput.displayName = 'SearchInput';\n\nexport default SearchInput;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OA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aAAA,CAAC/C,YAAA,CAAAkE,qCAAqC;IAClCX,OAAO,EAAE;MAAEC,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAO,CAAE;IACvCV,IAAI,EAAE;MAAED,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAE,CAAE;IAC/Bd,OAAO,EAAE;MAAEG,OAAO,EAAE,CAAC;MAAEW,KAAK,EAAE;IAAE,CAAE;IAClCR,GAAG,EAAC,2BAA2B;IAC/BC,UAAU,EAAE;MAAEC,QAAQ,EAAE;IAAI;EAAE,gBAE9BnE,OAAA,CAAAS,OAAA,CAAA4C,aAAA,CAAChD,MAAA,CAAAI,OAAK;IACFiE,WAAW,eAAE1E,OAAA,CAAAS,OAAA,CAAA4C,aAAA,CAAClD,KAAA,CAAAM,OAAI;MAAC4D,KAAK,EAAEzB,KAAK,CAAC+B,IAAK;MAACL,KAAK,EAAE,CAAC,eAAe;IAAE,CAAE,CAAE;IACnEvC,QAAQ,EAAEA,QAAS;IACnBC,SAAS,EAAEA,SAAU;IACrBC,WAAW,EAAEA,WAAY;IACzB2C,GAAG,EAAElC,QAAS;IACdmC,mBAAmB;IACnB3C,IAAI,EAAEA,IAAK;IACXG,KAAK,EAAEA;EAAM,CAChB,CACkC,CAE9B,CACF,CAAC;AAE5B,CAAC;AAEDV,WAAW,CAACmD,WAAW,GAAG,aAAa;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvE,OAAA,GAEzBkB,WAAW","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.StyledSearchInput = exports.StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputContentWrapper = void 0;
7
- var _framerMotion = require("framer-motion");
7
+ var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const StyledSearchInput = exports.StyledSearchInput = _styledComponents.default.div`
@@ -17,13 +17,13 @@ const StyledSearchInput = exports.StyledSearchInput = _styledComponents.default.
17
17
  justify-content: flex-end;
18
18
  width: 100%;
19
19
  `;
20
- const StyledMotionSearchInputContentWrapper = exports.StyledMotionSearchInputContentWrapper = (0, _styledComponents.default)(_framerMotion.motion.div)`
20
+ const StyledMotionSearchInputContentWrapper = exports.StyledMotionSearchInputContentWrapper = (0, _styledComponents.default)(_react.motion.div)`
21
21
  overflow: hidden;
22
22
  `;
23
23
  const StyledMotionSearchInputIconWrapper = exports.StyledMotionSearchInputIconWrapper = _styledComponents.default.div`
24
24
  width: 18px;
25
25
  `;
26
- const StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapperContent = (0, _styledComponents.default)(_framerMotion.motion.div)`
26
+ const StyledMotionSearchInputIconWrapperContent = exports.StyledMotionSearchInputIconWrapperContent = (0, _styledComponents.default)(_react.motion.div)`
27
27
  display: flex;
28
28
  `;
29
29
  //# sourceMappingURL=SearchInput.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SearchInput.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSearchInput","exports","styled","div","$size","StyledMotionSearchInputContentWrapper","motion","StyledMotionSearchInputIconWrapper","StyledMotionSearchInputIconWrapperContent"],"sources":["../../../../src/components/search-input/SearchInput.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { FramerMotionBugFix } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputSize } from '../input/Input';\n\ntype StyledSearchInputProps = {\n $size: InputSize;\n};\n\nexport const StyledSearchInput = styled.div<StyledSearchInputProps>`\n align-items: center;\n display: flex;\n gap: 8px;\n height: ${({ $size }) => ($size === 'medium' ? '42px' : '32px')};\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport const StyledMotionSearchInputContentWrapper = styled(motion.div)<FramerMotionBugFix>`\n overflow: hidden;\n`;\n\nexport const StyledMotionSearchInputIconWrapper = styled.div`\n width: 18px;\n`;\n\nexport const StyledMotionSearchInputIconWrapperContent = styled(motion.div)<FramerMotionBugFix>`\n display: flex;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQhC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,yBAAM,CAACC,GAA2B;AACnE;AACA;AACA;AACA,cAAc,CAAC;EAAEC;AAAM,CAAC,KAAMA,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;AACnE;AACA;AACA,CAAC;AAEM,MAAMC,qCAAqC,GAAAJ,OAAA,CAAAI,qCAAA,GAAG,IAAAH,yBAAM,EAACI,oBAAM,CAACH,GAAG,CAAqB;AAC3F;AACA,CAAC;AAEM,MAAMI,kCAAkC,GAAAN,OAAA,CAAAM,kCAAA,GAAGL,yBAAM,CAACC,GAAG;AAC5D;AACA,CAAC;AAEM,MAAMK,yCAAyC,GAAAP,OAAA,CAAAO,yCAAA,GAAG,IAAAN,yBAAM,EAACI,oBAAM,CAACH,GAAG,CAAqB;AAC/F;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SearchInput.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSearchInput","exports","styled","div","$size","StyledMotionSearchInputContentWrapper","motion","StyledMotionSearchInputIconWrapper","StyledMotionSearchInputIconWrapperContent"],"sources":["../../../../src/components/search-input/SearchInput.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\nimport type { FramerMotionBugFix } from '../color-scheme-provider/ColorSchemeProvider';\nimport type { InputSize } from '../input/Input';\n\ntype StyledSearchInputProps = {\n $size: InputSize;\n};\n\nexport const StyledSearchInput = styled.div<StyledSearchInputProps>`\n align-items: center;\n display: flex;\n gap: 8px;\n height: ${({ $size }) => ($size === 'medium' ? '42px' : '32px')};\n justify-content: flex-end;\n width: 100%;\n`;\n\nexport const StyledMotionSearchInputContentWrapper = styled(motion.div)<FramerMotionBugFix>`\n overflow: hidden;\n`;\n\nexport const StyledMotionSearchInputIconWrapper = styled.div`\n width: 18px;\n`;\n\nexport const StyledMotionSearchInputIconWrapperContent = styled(motion.div)<FramerMotionBugFix>`\n display: flex;\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQhC,MAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAGE,yBAAM,CAACC,GAA2B;AACnE;AACA;AACA;AACA,cAAc,CAAC;EAAEC;AAAM,CAAC,KAAMA,KAAK,KAAK,QAAQ,GAAG,MAAM,GAAG,MAAO;AACnE;AACA;AACA,CAAC;AAEM,MAAMC,qCAAqC,GAAAJ,OAAA,CAAAI,qCAAA,GAAG,IAAAH,yBAAM,EAACI,aAAM,CAACH,GAAG,CAAqB;AAC3F;AACA,CAAC;AAEM,MAAMI,kCAAkC,GAAAN,OAAA,CAAAM,kCAAA,GAAGL,yBAAM,CAACC,GAAG;AAC5D;AACA,CAAC;AAEM,MAAMK,yCAAyC,GAAAP,OAAA,CAAAO,yCAAA,GAAG,IAAAN,yBAAM,EAACI,aAAM,CAACH,GAAG,CAAqB;AAC/F;AACA,CAAC","ignoreList":[]}
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.StyledSliderThumbLabel = exports.StyledSliderThumb = exports.StyledSliderInput = exports.StyledSlider = void 0;
7
- var _framerMotion = require("framer-motion");
7
+ var _react = require("motion/react");
8
8
  var _styledComponents = _interopRequireDefault(require("styled-components"));
9
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
10
  const StyledSlider = exports.StyledSlider = _styledComponents.default.div`
@@ -23,7 +23,7 @@ const StyledSlider = exports.StyledSlider = _styledComponents.default.div`
23
23
  $isDisabled
24
24
  }) => $isDisabled ? 0.5 : 1};
25
25
  `;
26
- const StyledSliderInput = exports.StyledSliderInput = (0, _styledComponents.default)(_framerMotion.motion.input).attrs(({
26
+ const StyledSliderInput = exports.StyledSliderInput = (0, _styledComponents.default)(_react.motion.input).attrs(({
27
27
  $isInterval,
28
28
  $value,
29
29
  $thumbWidth,
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.styles.js","names":["_framerMotion","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSlider","exports","styled","div","$isDisabled","StyledSliderInput","motion","input","attrs","$isInterval","$value","$thumbWidth","$min","$max","theme","style","pointerEvents","width","background","undefined","StyledSliderThumb","$position","$isBigSlider","left","height","StyledSliderThumbLabel","span","$width","minWidth","top"],"sources":["../../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import { motion } from 'framer-motion';\nimport styled from 'styled-components';\nimport type { Theme, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSlider = styled.div<StyledSliderProps>`\n width: 100%;\n height: 30px;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')} !important;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n touch-action: none;\n user-select: none;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledSliderInputProps = WithTheme<{\n $min: number;\n $max: number;\n $value: number;\n $isInterval: boolean;\n $thumbWidth: number;\n}>;\n\nexport const StyledSliderInput = styled(motion.input).attrs<StyledSliderInputProps>(\n ({ $isInterval, $value, $thumbWidth, $min, $max, theme }) => ({\n style: {\n pointerEvents: $isInterval ? 'none' : 'all',\n width: `calc(100% - ${$thumbWidth}px)`,\n background: !$isInterval\n ? `linear-gradient(\n to right,\n ${(theme as Theme)['409'] ?? ''} 0%,\n ${(theme as Theme)['409'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n )`\n : undefined,\n },\n }),\n)`\n position: absolute;\n border-radius: 100px;\n -webkit-appearance: none;\n\n outline: none;\n cursor: pointer !important;\n z-index: 2;\n appearance: none;\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n\n // slider thumb for firefox\n\n &::-moz-range-thumb {\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n`;\n\ntype StyledSliderThumbProps = WithTheme<{\n $position: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumb = styled.div.attrs<StyledSliderThumbProps>(\n ({ $position, $isBigSlider }) => ({\n style: {\n left: `${$position}px`,\n height: `${$isBigSlider ? 0 : 20}px`,\n },\n }),\n)`\n width: 20px;\n height: 20px;\n cursor: pointer;\n border-radius: 100px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n pointer-events: none;\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 8px;\n white-space: nowrap;\n top: 5px;\n\n transition: top 0.2s ease 0s;\n`;\n\ntype StyledSliderThumbLabelProps = WithTheme<{\n $position: number;\n $width: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumbLabel = styled.span.attrs<StyledSliderThumbLabelProps>(\n ({ $position, $isBigSlider, $width }) => ({\n style: {\n minWidth: `${$width}px`,\n top: `-${$isBigSlider ? 56 : 48}px`,\n left: `${$position}px`,\n },\n }),\n)`\n pointer-events: none;\n color: #222;\n\n height: 20px;\n cursor: pointer;\n border-radius: 3px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n white-space: nowrap;\n\n transition: top 0.2s ease 0s;\n\n &::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.4);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n left: ${({ $position }) => $position * -1}px;\n transform: rotate(225deg);\n bottom: -7px;\n }\n\n &::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n border-radius: 3px;\n top: 0;\n z-index: -1;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKhC,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,yBAAM,CAACC,GAAsB;AACzD;AACA;AACA,cAAc,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,SAAS,GAAG,SAAU;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,CAAC;EAAEA;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D,CAAC;AAUM,MAAMC,iBAAiB,GAAAJ,OAAA,CAAAI,iBAAA,GAAG,IAAAH,yBAAM,EAACI,oBAAM,CAACC,KAAK,CAAC,CAACC,KAAK,CACvD,CAAC;EAAEC,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wB,sBAAA,GAAGvB,yBAAM,CAACwB,IAAI,CAAClB,KAAK,CACnD,CAAC;EAAEa,SAAS;EAAEC,YAAY;EAAEK;AAAO,CAAC,MAAM;EACtCZ,KAAK,EAAE;IACHa,QAAQ,EAAE,GAAGD,MAAM,IAAI;IACvBE,GAAG,EAAE,IAAIP,YAAY,GAAG,EAAE,GAAG,EAAE,IAAI;IACnCC,IAAI,EAAE,GAAGF,SAAS;EACtB;AACJ,CAAC,CACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,CAAC;EAAEA;AAAU,CAAC,KAAKA,SAAS,GAAG,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Slider.styles.js","names":["_react","require","_styledComponents","_interopRequireDefault","e","__esModule","default","StyledSlider","exports","styled","div","$isDisabled","StyledSliderInput","motion","input","attrs","$isInterval","$value","$thumbWidth","$min","$max","theme","style","pointerEvents","width","background","undefined","StyledSliderThumb","$position","$isBigSlider","left","height","StyledSliderThumbLabel","span","$width","minWidth","top"],"sources":["../../../../src/components/slider/Slider.styles.ts"],"sourcesContent":["import { motion } from 'motion/react';\nimport styled from 'styled-components';\nimport type { Theme, WithTheme } from '../color-scheme-provider/ColorSchemeProvider';\n\ntype StyledSliderProps = WithTheme<{ $isDisabled?: boolean }>;\n\nexport const StyledSlider = styled.div<StyledSliderProps>`\n width: 100%;\n height: 30px;\n cursor: ${({ $isDisabled }) => ($isDisabled ? 'default' : 'pointer')} !important;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n touch-action: none;\n user-select: none;\n opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};\n`;\n\ntype StyledSliderInputProps = WithTheme<{\n $min: number;\n $max: number;\n $value: number;\n $isInterval: boolean;\n $thumbWidth: number;\n}>;\n\nexport const StyledSliderInput = styled(motion.input).attrs<StyledSliderInputProps>(\n ({ $isInterval, $value, $thumbWidth, $min, $max, theme }) => ({\n style: {\n pointerEvents: $isInterval ? 'none' : 'all',\n width: `calc(100% - ${$thumbWidth}px)`,\n background: !$isInterval\n ? `linear-gradient(\n to right,\n ${(theme as Theme)['409'] ?? ''} 0%,\n ${(theme as Theme)['409'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n ${(($value - $min) / ($max - $min)) * 100}%,\n ${(theme as Theme)['403'] ?? ''}\n )`\n : undefined,\n },\n }),\n)`\n position: absolute;\n border-radius: 100px;\n -webkit-appearance: none;\n\n outline: none;\n cursor: pointer !important;\n z-index: 2;\n appearance: none;\n\n // Slider thumb for chrome\n &::-webkit-slider-thumb {\n -webkit-appearance: none;\n appearance: none;\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n\n // slider thumb for firefox\n\n &::-moz-range-thumb {\n width: 50px;\n height: 20px;\n cursor: pointer;\n opacity: 0;\n pointer-events: all;\n position: relative;\n }\n`;\n\ntype StyledSliderThumbProps = WithTheme<{\n $position: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumb = styled.div.attrs<StyledSliderThumbProps>(\n ({ $position, $isBigSlider }) => ({\n style: {\n left: `${$position}px`,\n height: `${$isBigSlider ? 0 : 20}px`,\n },\n }),\n)`\n width: 20px;\n height: 20px;\n cursor: pointer;\n border-radius: 100px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n pointer-events: none;\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 8px;\n white-space: nowrap;\n top: 5px;\n\n transition: top 0.2s ease 0s;\n`;\n\ntype StyledSliderThumbLabelProps = WithTheme<{\n $position: number;\n $width: number;\n $isBigSlider: boolean;\n}>;\n\nexport const StyledSliderThumbLabel = styled.span.attrs<StyledSliderThumbLabelProps>(\n ({ $position, $isBigSlider, $width }) => ({\n style: {\n minWidth: `${$width}px`,\n top: `-${$isBigSlider ? 56 : 48}px`,\n left: `${$position}px`,\n },\n }),\n)`\n pointer-events: none;\n color: #222;\n\n height: 20px;\n cursor: pointer;\n border-radius: 3px;\n background-color: white;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);\n z-index: 3;\n position: absolute;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 16px;\n white-space: nowrap;\n\n transition: top 0.2s ease 0s;\n\n &::after {\n background-color: inherit;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n border-right: 1px solid rgba(0, 0, 0, 0.1);\n box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.4);\n content: '';\n height: 14px;\n position: absolute;\n width: 14px;\n z-index: -2;\n left: ${({ $position }) => $position * -1}px;\n transform: rotate(225deg);\n bottom: -7px;\n }\n\n &::before {\n background-color: inherit;\n bottom: 0;\n content: '';\n left: 0;\n position: absolute;\n right: 0;\n border-radius: 3px;\n top: 0;\n z-index: -1;\n }\n`;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAKhC,MAAMG,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAGE,yBAAM,CAACC,GAAsB;AACzD;AACA;AACA,cAAc,CAAC;EAAEC;AAAY,CAAC,KAAMA,WAAW,GAAG,SAAS,GAAG,SAAU;AACxE;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,CAAC;EAAEA;AAAY,CAAC,KAAMA,WAAW,GAAG,GAAG,GAAG,CAAE;AAC3D,CAAC;AAUM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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAQM,MAAMG,sBAAsB,GAAAxB,OAAA,CAAAwB,sBAAA,GAAGvB,yBAAM,CAACwB,IAAI,CAAClB,KAAK,CACnD,CAAC;EAAEa,SAAS;EAAEC,YAAY;EAAEK;AAAO,CAAC,MAAM;EACtCZ,KAAK,EAAE;IACHa,QAAQ,EAAE,GAAGD,MAAM,IAAI;IACvBE,GAAG,EAAE,IAAIP,YAAY,GAAG,EAAE,GAAG,EAAE,IAAI;IACnCC,IAAI,EAAE,GAAGF,SAAS;EACtB;AACJ,CAAC,CACL,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,CAAC;EAAEA;AAAU,CAAC,KAAKA,SAAS,GAAG,CAAC,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _chaynsApi = require("chayns-api");
8
- var _framerMotion = require("framer-motion");
9
- var _react = _interopRequireWildcard(require("react"));
8
+ var _react = require("motion/react");
9
+ var _react2 = _interopRequireWildcard(require("react"));
10
10
  var _useElementSize = require("../../hooks/useElementSize");
11
11
  var _calculate = require("../../utils/calculate");
12
12
  var _sliderButton = require("../../utils/sliderButton");
@@ -22,27 +22,27 @@ const SliderButton = ({
22
22
  items,
23
23
  onChange
24
24
  }) => {
25
- const [dragRange, setDragRange] = (0, _react.useState)({
25
+ const [dragRange, setDragRange] = (0, _react2.useState)({
26
26
  left: 0,
27
27
  right: 0
28
28
  });
29
- const [shownItemsCount, setShownItemsCount] = (0, _react.useState)(items.length);
30
- const [sliderSize, setSliderSize] = (0, _react.useState)({
29
+ const [shownItemsCount, setShownItemsCount] = (0, _react2.useState)(items.length);
30
+ const [sliderSize, setSliderSize] = (0, _react2.useState)({
31
31
  width: 0
32
32
  });
33
- const [currentId, setCurrentId] = (0, _react.useState)('');
34
- const [currentPopupId, setCurrentPopupId] = (0, _react.useState)('');
35
- const [currentIndex, setCurrentIndex] = (0, _react.useState)(0);
36
- const sliderButtonRef = (0, _react.useRef)(null);
37
- const sliderButtonWrapperRef = (0, _react.useRef)(null);
38
- const popupRef = (0, _react.useRef)(null);
39
- const [scope, animate] = (0, _framerMotion.useAnimate)();
40
- const initialItemWidth = (0, _react.useMemo)(() => (0, _calculate.calculateBiggestWidth)(items), [items]);
33
+ const [currentId, setCurrentId] = (0, _react2.useState)('');
34
+ const [currentPopupId, setCurrentPopupId] = (0, _react2.useState)('');
35
+ const [currentIndex, setCurrentIndex] = (0, _react2.useState)(0);
36
+ const sliderButtonRef = (0, _react2.useRef)(null);
37
+ const sliderButtonWrapperRef = (0, _react2.useRef)(null);
38
+ const popupRef = (0, _react2.useRef)(null);
39
+ const [scope, animate] = (0, _react.useAnimate)();
40
+ const initialItemWidth = (0, _react2.useMemo)(() => (0, _calculate.calculateBiggestWidth)(items), [items]);
41
41
  const elementSize = (0, _useElementSize.useElementSize)(sliderButtonRef);
42
- (0, _react.useEffect)(() => {
42
+ (0, _react2.useEffect)(() => {
43
43
  if (elementSize) setSliderSize(elementSize);
44
44
  }, [elementSize]);
45
- const setPopupId = (0, _react.useCallback)(selectedId => {
45
+ const setPopupId = (0, _react2.useCallback)(selectedId => {
46
46
  const ids = items.slice(shownItemsCount - 1).map(({
47
47
  id
48
48
  }) => id);
@@ -54,8 +54,8 @@ const SliderButton = ({
54
54
  }
55
55
  setCurrentId(selectedId);
56
56
  }, [items, shownItemsCount]);
57
- const isSliderBigger = (0, _react.useMemo)(() => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1, [initialItemWidth, items.length, sliderSize]);
58
- const maxShownItemsCount = (0, _react.useMemo)(() => {
57
+ const isSliderBigger = (0, _react2.useMemo)(() => sliderSize && Math.floor(sliderSize.width / initialItemWidth) < items.length - 1, [initialItemWidth, items.length, sliderSize]);
58
+ const maxShownItemsCount = (0, _react2.useMemo)(() => {
59
59
  let totalWidth = 0;
60
60
  let count = 0;
61
61
  while (count < items.length) {
@@ -67,13 +67,13 @@ const SliderButton = ({
67
67
  }
68
68
  return count;
69
69
  }, [items, sliderSize.width]);
70
- const itemWidth = (0, _react.useMemo)(() => {
70
+ const itemWidth = (0, _react2.useMemo)(() => {
71
71
  const sliderWidth = (sliderSize === null || sliderSize === void 0 ? void 0 : sliderSize.width) || 0;
72
72
  const itemCount = items.length || 1;
73
73
  setShownItemsCount(isSliderBigger ? maxShownItemsCount : itemCount);
74
74
  return sliderWidth / (isSliderBigger ? maxShownItemsCount : itemCount);
75
75
  }, [isSliderBigger, items.length, maxShownItemsCount, sliderSize === null || sliderSize === void 0 ? void 0 : sliderSize.width]);
76
- (0, _react.useEffect)(() => {
76
+ (0, _react2.useEffect)(() => {
77
77
  if (sliderSize) {
78
78
  const sliderWidth = itemWidth * (items.length - 1);
79
79
  const count = Math.floor(sliderSize.width / itemWidth);
@@ -83,7 +83,7 @@ const SliderButton = ({
83
83
  });
84
84
  }
85
85
  }, [isSliderBigger, itemWidth, items.length, sliderSize]);
86
- const animation = (0, _react.useCallback)(async x => {
86
+ const animation = (0, _react2.useCallback)(async x => {
87
87
  await animate(scope.current, {
88
88
  x
89
89
  }, {
@@ -91,11 +91,11 @@ const SliderButton = ({
91
91
  duration: 0.2
92
92
  });
93
93
  }, [animate, scope]);
94
- const setItemPosition = (0, _react.useCallback)(index => {
94
+ const setItemPosition = (0, _react2.useCallback)(index => {
95
95
  setCurrentIndex(index);
96
96
  void animation(itemWidth * index);
97
97
  }, [animation, itemWidth]);
98
- (0, _react.useEffect)(() => {
98
+ (0, _react2.useEffect)(() => {
99
99
  if (typeof selectedButtonId === 'string') {
100
100
  let index = items.findIndex(({
101
101
  id
@@ -110,7 +110,7 @@ const SliderButton = ({
110
110
  }
111
111
  }
112
112
  }, [animation, dragRange.right, isSliderBigger, itemWidth, items, selectedButtonId, setItemPosition, setPopupId, shownItemsCount]);
113
- const handleClick = (0, _react.useCallback)((id, index) => {
113
+ const handleClick = (0, _react2.useCallback)((id, index) => {
114
114
  if (isDisabled) {
115
115
  return;
116
116
  }
@@ -127,14 +127,14 @@ const SliderButton = ({
127
127
  }
128
128
  setItemPosition(index);
129
129
  }, [isDisabled, onChange, setItemPosition, setPopupId]);
130
- const buttons = (0, _react.useMemo)(() => {
130
+ const buttons = (0, _react2.useMemo)(() => {
131
131
  if (items.length > shownItemsCount) {
132
132
  const newItems = items.slice(0, shownItemsCount - 1);
133
133
  const otherItems = items.slice(shownItemsCount - 1);
134
134
  const elements = newItems.map(({
135
135
  id,
136
136
  text
137
- }, index) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
137
+ }, index) => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
138
138
  $width: itemWidth,
139
139
  key: `slider-button-${id}`,
140
140
  onClick: () => handleClick(id, index)
@@ -142,19 +142,19 @@ const SliderButton = ({
142
142
  const popupContent = otherItems.map(({
143
143
  id,
144
144
  text
145
- }) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonPopupContentItem, {
145
+ }) => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonPopupContentItem, {
146
146
  key: `slider-button-${id}`,
147
147
  onClick: () => handleClick(id, newItems.length),
148
148
  $isSelected: id === currentPopupId
149
149
  }, text));
150
150
  const id = 'more';
151
- elements.push(/*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
151
+ elements.push(/*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
152
152
  $width: itemWidth,
153
153
  key: `slider-button-${id}`
154
- }, /*#__PURE__*/_react.default.createElement(_Popup.default, {
154
+ }, /*#__PURE__*/_react2.default.createElement(_Popup.default, {
155
155
  ref: popupRef,
156
- content: /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonPopupContent, null, popupContent)
157
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
156
+ content: /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonPopupContent, null, popupContent)
157
+ }, /*#__PURE__*/_react2.default.createElement(_Icon.default, {
158
158
  icons: ['fa fa-ellipsis'],
159
159
  color: "white"
160
160
  }))));
@@ -163,28 +163,28 @@ const SliderButton = ({
163
163
  return items.map(({
164
164
  id,
165
165
  text
166
- }) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
166
+ }) => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
167
167
  $width: itemWidth,
168
168
  key: `slider-button-${id}`
169
169
  }, text));
170
170
  }, [currentPopupId, handleClick, itemWidth, items, shownItemsCount]);
171
- const pseudoButtons = (0, _react.useMemo)(() => {
171
+ const pseudoButtons = (0, _react2.useMemo)(() => {
172
172
  if (items.length > shownItemsCount) {
173
173
  const newItems = items.slice(0, shownItemsCount - 1);
174
174
  const elements = newItems.map(({
175
175
  id,
176
176
  text
177
- }, index) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
177
+ }, index) => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
178
178
  $width: itemWidth,
179
179
  key: `pseudo-slider-button-${id}`,
180
180
  onClick: () => handleClick(id, index)
181
181
  }, text));
182
182
  const id = 'more';
183
- elements.push(/*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
183
+ elements.push(/*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
184
184
  $width: itemWidth,
185
185
  key: `pseudo-slider-button-${id}`,
186
186
  onClick: () => handleClick(id, newItems.length)
187
- }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
187
+ }, /*#__PURE__*/_react2.default.createElement(_Icon.default, {
188
188
  icons: ['fa fa-ellipsis']
189
189
  })));
190
190
  return elements;
@@ -192,7 +192,7 @@ const SliderButton = ({
192
192
  return items.map(({
193
193
  id,
194
194
  text
195
- }, index) => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonItem, {
195
+ }, index) => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonItem, {
196
196
  $width: itemWidth,
197
197
  key: `pseudo-slider-button-${id}`,
198
198
  onClick: () => handleClick(id, index)
@@ -202,17 +202,17 @@ const SliderButton = ({
202
202
  /**
203
203
  * Creates an array with the snap points relative to the width of the items
204
204
  */
205
- const snapPoints = (0, _react.useMemo)(() => {
205
+ const snapPoints = (0, _react2.useMemo)(() => {
206
206
  const points = [0];
207
207
  for (let i = 1; i < items.length; i++) {
208
208
  points.push(itemWidth * i);
209
209
  }
210
210
  return points;
211
211
  }, [itemWidth, items.length]);
212
- const handleDragStart = (0, _react.useCallback)(() => {
212
+ const handleDragStart = (0, _react2.useCallback)(() => {
213
213
  void (0, _chaynsApi.setRefreshScrollEnabled)(false);
214
214
  }, []);
215
- const handleDragEnd = (0, _react.useCallback)(() => {
215
+ const handleDragEnd = (0, _react2.useCallback)(() => {
216
216
  void (0, _chaynsApi.setRefreshScrollEnabled)(true);
217
217
  const position = (0, _sliderButton.getThumbPosition)({
218
218
  scope,
@@ -269,12 +269,12 @@ const SliderButton = ({
269
269
  }
270
270
  }
271
271
  }, [animation, itemWidth, items, onChange, scope, shownItemsCount, snapPoints]);
272
- return (0, _react.useMemo)(() => /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButton, {
272
+ return (0, _react2.useMemo)(() => /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButton, {
273
273
  $isDisabled: isDisabled,
274
274
  ref: sliderButtonRef
275
- }, /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, {
275
+ }, /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, {
276
276
  $isInvisible: true
277
- }, pseudoButtons), /*#__PURE__*/_react.default.createElement(_SliderButton.StyledMotionSliderButtonThumb, {
277
+ }, pseudoButtons), /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledMotionSliderButtonThumb, {
278
278
  ref: scope,
279
279
  drag: isDisabled ? false : 'x',
280
280
  dragElastic: 0,
@@ -288,11 +288,11 @@ const SliderButton = ({
288
288
  onDragEnd: handleDragEnd,
289
289
  onDragStart: handleDragStart,
290
290
  onClick: () => handleClick(currentId, currentIndex)
291
- }), /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonWrapper, {
291
+ }), /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonWrapper, {
292
292
  $isDisabled: isDisabled,
293
293
  $width: !isSliderBigger ? dragRange.right + itemWidth : dragRange.right,
294
294
  ref: sliderButtonWrapperRef
295
- }, /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, null, /*#__PURE__*/_react.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, currentId, currentIndex, dragRange, handleClick, handleDragEnd, handleDragStart, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
295
+ }, /*#__PURE__*/_react2.default.createElement(_react.AnimatePresence, null, /*#__PURE__*/_react2.default.createElement(_SliderButton.StyledSliderButtonButtonsWrapper, null, buttons)))), [buttons, currentId, currentIndex, dragRange, handleClick, handleDragEnd, handleDragStart, isDisabled, isSliderBigger, itemWidth, pseudoButtons, scope]);
296
296
  };
297
297
  SliderButton.displayName = 'SliderButton';
298
298
  var _default = exports.default = SliderButton;