@codeleap/web 7.0.1 → 7.0.2

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 (286) hide show
  1. package/dist/components/ActivityIndicator/index.js +34 -16
  2. package/dist/components/ActivityIndicator/index.js.map +1 -1
  3. package/dist/components/ActivityIndicator/styles.js +2 -1
  4. package/dist/components/ActivityIndicator/types.js +2 -1
  5. package/dist/components/Badge/index.js +42 -24
  6. package/dist/components/Badge/index.js.map +1 -1
  7. package/dist/components/Badge/styles.js +2 -1
  8. package/dist/components/Badge/types.js +2 -1
  9. package/dist/components/Button/index.js +36 -19
  10. package/dist/components/Button/index.js.map +1 -1
  11. package/dist/components/Button/styles.js +2 -1
  12. package/dist/components/Button/types.js +2 -1
  13. package/dist/components/Calendar/index.js +29 -12
  14. package/dist/components/Calendar/index.js.map +1 -1
  15. package/dist/components/Calendar/styles.js +2 -1
  16. package/dist/components/Calendar/types.js +2 -1
  17. package/dist/components/Carousel/index.js +82 -40
  18. package/dist/components/Carousel/index.js.map +1 -1
  19. package/dist/components/Carousel/styles.js +2 -1
  20. package/dist/components/Carousel/types.js +2 -1
  21. package/dist/components/Checkbox/index.js +42 -24
  22. package/dist/components/Checkbox/index.js.map +1 -1
  23. package/dist/components/Checkbox/styles.js +2 -1
  24. package/dist/components/Checkbox/types.js +2 -1
  25. package/dist/components/Collapse/index.js +35 -17
  26. package/dist/components/Collapse/index.js.map +1 -1
  27. package/dist/components/Collapse/styles.js +2 -1
  28. package/dist/components/Collapse/types.js +2 -1
  29. package/dist/components/ColorPicker/index.js +51 -33
  30. package/dist/components/ColorPicker/index.js.map +1 -1
  31. package/dist/components/ColorPicker/styles.js +2 -1
  32. package/dist/components/ColorPicker/types.js +2 -1
  33. package/dist/components/CropPicker/hooks.d.ts +2 -2
  34. package/dist/components/CropPicker/hooks.js +20 -17
  35. package/dist/components/CropPicker/hooks.js.map +1 -1
  36. package/dist/components/CropPicker/index.js +40 -22
  37. package/dist/components/CropPicker/index.js.map +1 -1
  38. package/dist/components/CropPicker/styles.js +2 -1
  39. package/dist/components/CropPicker/types.js +2 -1
  40. package/dist/components/CropPicker/utils.js +9 -3
  41. package/dist/components/CropPicker/utils.js.map +1 -1
  42. package/dist/components/DatePicker/index.js +40 -23
  43. package/dist/components/DatePicker/index.js.map +1 -1
  44. package/dist/components/DatePicker/styles.js +2 -1
  45. package/dist/components/DatePicker/types.js +2 -1
  46. package/dist/components/Drawer/index.js +40 -22
  47. package/dist/components/Drawer/index.js.map +1 -1
  48. package/dist/components/Drawer/styles.js +2 -1
  49. package/dist/components/Drawer/types.js +2 -1
  50. package/dist/components/Dropzone/context.js +16 -11
  51. package/dist/components/Dropzone/context.js.map +1 -1
  52. package/dist/components/Dropzone/elements.js +19 -13
  53. package/dist/components/Dropzone/elements.js.map +1 -1
  54. package/dist/components/Dropzone/index.js +53 -35
  55. package/dist/components/Dropzone/index.js.map +1 -1
  56. package/dist/components/Dropzone/styles.js +2 -1
  57. package/dist/components/Dropzone/types.js +2 -1
  58. package/dist/components/Dropzone/useDropzone.js +6 -3
  59. package/dist/components/Dropzone/useDropzone.js.map +1 -1
  60. package/dist/components/EmptyPlaceholder/index.js +61 -40
  61. package/dist/components/EmptyPlaceholder/index.js.map +1 -1
  62. package/dist/components/EmptyPlaceholder/styles.js +2 -1
  63. package/dist/components/EmptyPlaceholder/types.js +2 -1
  64. package/dist/components/Field/context.js +17 -11
  65. package/dist/components/Field/context.js.map +1 -1
  66. package/dist/components/Field/elements.js +39 -31
  67. package/dist/components/Field/elements.js.map +1 -1
  68. package/dist/components/Field/index.js +41 -23
  69. package/dist/components/Field/index.js.map +1 -1
  70. package/dist/components/Field/styles.js +2 -1
  71. package/dist/components/Field/types.js +2 -1
  72. package/dist/components/Field/useFieldInput.d.ts +1 -1
  73. package/dist/components/Field/useFieldInput.js +11 -8
  74. package/dist/components/Field/useFieldInput.js.map +1 -1
  75. package/dist/components/FileInput/index.js +32 -14
  76. package/dist/components/FileInput/index.js.map +1 -1
  77. package/dist/components/FileInput/types.js +2 -1
  78. package/dist/components/Icon/index.js +44 -26
  79. package/dist/components/Icon/index.js.map +1 -1
  80. package/dist/components/Icon/styles.js +2 -1
  81. package/dist/components/Icon/types.js +2 -1
  82. package/dist/components/List/context.js +25 -20
  83. package/dist/components/List/context.js.map +1 -1
  84. package/dist/components/List/elements.js +74 -33
  85. package/dist/components/List/elements.js.map +1 -1
  86. package/dist/components/List/index.js +35 -18
  87. package/dist/components/List/index.js.map +1 -1
  88. package/dist/components/List/scroll.js +18 -13
  89. package/dist/components/List/scroll.js.map +1 -1
  90. package/dist/components/List/styles.js +2 -1
  91. package/dist/components/List/types.js +2 -1
  92. package/dist/components/LoadingOverlay/index.js +38 -20
  93. package/dist/components/LoadingOverlay/index.js.map +1 -1
  94. package/dist/components/LoadingOverlay/styles.js +2 -1
  95. package/dist/components/LoadingOverlay/types.js +2 -1
  96. package/dist/components/MaskedTextInput/index.js +32 -14
  97. package/dist/components/MaskedTextInput/index.js.map +1 -1
  98. package/dist/components/MaskedTextInput/mask.js +4 -1
  99. package/dist/components/MaskedTextInput/mask.js.map +1 -1
  100. package/dist/components/MaskedTextInput/types.js +2 -1
  101. package/dist/components/Modal/context.js +14 -9
  102. package/dist/components/Modal/context.js.map +1 -1
  103. package/dist/components/Modal/elements.js +31 -23
  104. package/dist/components/Modal/elements.js.map +1 -1
  105. package/dist/components/Modal/index.js +40 -22
  106. package/dist/components/Modal/index.js.map +1 -1
  107. package/dist/components/Modal/styles.js +2 -1
  108. package/dist/components/Modal/types.js +2 -1
  109. package/dist/components/NumberIncrement/index.js +47 -29
  110. package/dist/components/NumberIncrement/index.js.map +1 -1
  111. package/dist/components/NumberIncrement/styles.js +2 -1
  112. package/dist/components/NumberIncrement/types.js +2 -1
  113. package/dist/components/NumberIncrement/useNumberIncrement.js +24 -21
  114. package/dist/components/NumberIncrement/useNumberIncrement.js.map +1 -1
  115. package/dist/components/Overlay/index.js +39 -21
  116. package/dist/components/Overlay/index.js.map +1 -1
  117. package/dist/components/Overlay/styles.js +2 -1
  118. package/dist/components/Overlay/types.js +2 -1
  119. package/dist/components/PaginationButtons/index.js +44 -26
  120. package/dist/components/PaginationButtons/index.js.map +1 -1
  121. package/dist/components/PaginationButtons/styles.js +2 -1
  122. package/dist/components/PaginationButtons/types.js +2 -1
  123. package/dist/components/PaginationIndicator/index.js +42 -24
  124. package/dist/components/PaginationIndicator/index.js.map +1 -1
  125. package/dist/components/PaginationIndicator/styles.js +2 -1
  126. package/dist/components/PaginationIndicator/types.js +2 -1
  127. package/dist/components/Progress/Bar/Segmented.js +23 -19
  128. package/dist/components/Progress/Bar/Segmented.js.map +1 -1
  129. package/dist/components/Progress/Bar/index.js +47 -29
  130. package/dist/components/Progress/Bar/index.js.map +1 -1
  131. package/dist/components/Progress/Bar/styles.js +2 -1
  132. package/dist/components/Progress/Bar/types.js +2 -1
  133. package/dist/components/Progress/Circle/Segmented.js +26 -22
  134. package/dist/components/Progress/Circle/Segmented.js.map +1 -1
  135. package/dist/components/Progress/Circle/index.js +48 -30
  136. package/dist/components/Progress/Circle/index.js.map +1 -1
  137. package/dist/components/Progress/Circle/styles.js +2 -1
  138. package/dist/components/Progress/Circle/types.js +2 -1
  139. package/dist/components/Progress/index.js +18 -2
  140. package/dist/components/Progress/index.js.map +1 -1
  141. package/dist/components/Progress/utils.js +4 -1
  142. package/dist/components/Progress/utils.js.map +1 -1
  143. package/dist/components/RadioInput/index.js +47 -26
  144. package/dist/components/RadioInput/index.js.map +1 -1
  145. package/dist/components/RadioInput/styles.js +2 -1
  146. package/dist/components/RadioInput/types.js +2 -1
  147. package/dist/components/SearchInput/index.js +51 -14
  148. package/dist/components/SearchInput/index.js.map +1 -1
  149. package/dist/components/SectionFilters/index.js +56 -38
  150. package/dist/components/SectionFilters/index.js.map +1 -1
  151. package/dist/components/SectionFilters/styles.js +2 -1
  152. package/dist/components/SectionFilters/types.js +2 -1
  153. package/dist/components/Select/context.js +50 -44
  154. package/dist/components/Select/context.js.map +1 -1
  155. package/dist/components/Select/elements.js +29 -23
  156. package/dist/components/Select/elements.js.map +1 -1
  157. package/dist/components/Select/index.js +41 -24
  158. package/dist/components/Select/index.js.map +1 -1
  159. package/dist/components/Select/styles.js +2 -1
  160. package/dist/components/Select/types.js +2 -1
  161. package/dist/components/Select/useTriggerWidth.js +9 -6
  162. package/dist/components/Select/useTriggerWidth.js.map +1 -1
  163. package/dist/components/Slider/index.js +68 -47
  164. package/dist/components/Slider/index.js.map +1 -1
  165. package/dist/components/Slider/styles.js +2 -1
  166. package/dist/components/Slider/types.js +2 -1
  167. package/dist/components/Switch/index.js +40 -22
  168. package/dist/components/Switch/index.js.map +1 -1
  169. package/dist/components/Switch/styles.js +2 -1
  170. package/dist/components/Switch/types.js +2 -1
  171. package/dist/components/Tag/index.js +55 -34
  172. package/dist/components/Tag/index.js.map +1 -1
  173. package/dist/components/Tag/styles.js +2 -1
  174. package/dist/components/Tag/types.js +2 -1
  175. package/dist/components/Text/index.js +48 -27
  176. package/dist/components/Text/index.js.map +1 -1
  177. package/dist/components/Text/styles.js +2 -1
  178. package/dist/components/Text/types.js +2 -1
  179. package/dist/components/TextEditor/index.js +50 -29
  180. package/dist/components/TextEditor/index.js.map +1 -1
  181. package/dist/components/TextEditor/styles.js +2 -1
  182. package/dist/components/TextEditor/types.js +2 -1
  183. package/dist/components/TextInput/index.js +49 -28
  184. package/dist/components/TextInput/index.js.map +1 -1
  185. package/dist/components/TextInput/styles.js +2 -1
  186. package/dist/components/TextInput/types.js +2 -1
  187. package/dist/components/TextInput/useTextInput.d.ts +2 -2
  188. package/dist/components/TextInput/useTextInput.js +15 -12
  189. package/dist/components/TextInput/useTextInput.js.map +1 -1
  190. package/dist/components/Tooltip/index.js +54 -33
  191. package/dist/components/Tooltip/index.js.map +1 -1
  192. package/dist/components/Tooltip/styles.js +2 -1
  193. package/dist/components/Tooltip/types.js +2 -1
  194. package/dist/components/Touchable/index.js +41 -21
  195. package/dist/components/Touchable/index.js.map +1 -1
  196. package/dist/components/Touchable/styles.js +2 -1
  197. package/dist/components/Touchable/types.js +2 -1
  198. package/dist/components/View/index.js +32 -15
  199. package/dist/components/View/index.js.map +1 -1
  200. package/dist/components/View/styles.js +2 -1
  201. package/dist/components/View/types.js +2 -1
  202. package/dist/components/components.js +57 -41
  203. package/dist/components/components.js.map +1 -1
  204. package/dist/index.js +20 -4
  205. package/dist/index.js.map +1 -1
  206. package/dist/lib/ListMasonry.js +31 -22
  207. package/dist/lib/ListMasonry.js.map +1 -1
  208. package/dist/lib/ThemeVariables.js +11 -6
  209. package/dist/lib/ThemeVariables.js.map +1 -1
  210. package/dist/lib/WebStyleRegistry.js +7 -3
  211. package/dist/lib/WebStyleRegistry.js.map +1 -1
  212. package/dist/lib/hooks/index.js +38 -22
  213. package/dist/lib/hooks/index.js.map +1 -1
  214. package/dist/lib/hooks/useAnimatedStyle.js +9 -5
  215. package/dist/lib/hooks/useAnimatedStyle.js.map +1 -1
  216. package/dist/lib/hooks/useAnimatedVariantStyles.js +9 -6
  217. package/dist/lib/hooks/useAnimatedVariantStyles.js.map +1 -1
  218. package/dist/lib/hooks/useAsyncSelect.js +11 -8
  219. package/dist/lib/hooks/useAsyncSelect.js.map +1 -1
  220. package/dist/lib/hooks/useBreakpointMatch.js +22 -19
  221. package/dist/lib/hooks/useBreakpointMatch.js.map +1 -1
  222. package/dist/lib/hooks/useClick.js +10 -7
  223. package/dist/lib/hooks/useClick.js.map +1 -1
  224. package/dist/lib/hooks/useClickOutside.js +7 -4
  225. package/dist/lib/hooks/useClickOutside.js.map +1 -1
  226. package/dist/lib/hooks/useFileInput.js +7 -3
  227. package/dist/lib/hooks/useFileInput.js.map +1 -1
  228. package/dist/lib/hooks/useIsomorphicEffect.js +5 -2
  229. package/dist/lib/hooks/useIsomorphicEffect.js.map +1 -1
  230. package/dist/lib/hooks/useKeydown.js +13 -9
  231. package/dist/lib/hooks/useKeydown.js.map +1 -1
  232. package/dist/lib/hooks/useListFocus.js +7 -4
  233. package/dist/lib/hooks/useListFocus.js.map +1 -1
  234. package/dist/lib/hooks/useMediaQuery.js +11 -8
  235. package/dist/lib/hooks/useMediaQuery.js.map +1 -1
  236. package/dist/lib/hooks/usePageExitBlocker.js +10 -6
  237. package/dist/lib/hooks/usePageExitBlocker.js.map +1 -1
  238. package/dist/lib/hooks/usePagination.js +13 -10
  239. package/dist/lib/hooks/usePagination.js.map +1 -1
  240. package/dist/lib/hooks/usePopState.js +9 -5
  241. package/dist/lib/hooks/usePopState.js.map +1 -1
  242. package/dist/lib/hooks/usePopoverDismiss.js +8 -5
  243. package/dist/lib/hooks/usePopoverDismiss.js.map +1 -1
  244. package/dist/lib/hooks/useRefresh.js +16 -9
  245. package/dist/lib/hooks/useRefresh.js.map +1 -1
  246. package/dist/lib/hooks/useScrollEffect.js +6 -3
  247. package/dist/lib/hooks/useScrollEffect.js.map +1 -1
  248. package/dist/lib/hooks/useSearchParams.js +10 -7
  249. package/dist/lib/hooks/useSearchParams.js.map +1 -1
  250. package/dist/lib/hooks/useStaticAnimationStyles.js +6 -3
  251. package/dist/lib/hooks/useStaticAnimationStyles.js.map +1 -1
  252. package/dist/lib/hooks/useStylesFor.js +13 -9
  253. package/dist/lib/hooks/useStylesFor.js.map +1 -1
  254. package/dist/lib/hooks/useTouchableEvents.js +7 -4
  255. package/dist/lib/hooks/useTouchableEvents.js.map +1 -1
  256. package/dist/lib/hooks/useWindowFocus.js +11 -7
  257. package/dist/lib/hooks/useWindowFocus.js.map +1 -1
  258. package/dist/lib/hooks/useWindowSize.js +10 -7
  259. package/dist/lib/hooks/useWindowSize.js.map +1 -1
  260. package/dist/lib/index.js +22 -6
  261. package/dist/lib/index.js.map +1 -1
  262. package/dist/lib/tools/index.js +19 -3
  263. package/dist/lib/tools/index.js.map +1 -1
  264. package/dist/lib/tools/localStorage.js +12 -8
  265. package/dist/lib/tools/localStorage.js.map +1 -1
  266. package/dist/lib/tools/mediaQuery.js +8 -3
  267. package/dist/lib/tools/mediaQuery.js.map +1 -1
  268. package/dist/lib/tools/modal.js +18 -13
  269. package/dist/lib/tools/modal.js.map +1 -1
  270. package/dist/lib/utils/attributes.js +6 -3
  271. package/dist/lib/utils/attributes.js.map +1 -1
  272. package/dist/lib/utils/cache.d.ts +2 -2
  273. package/dist/lib/utils/cache.js +11 -4
  274. package/dist/lib/utils/cache.js.map +1 -1
  275. package/dist/lib/utils/index.js +21 -5
  276. package/dist/lib/utils/index.js.map +1 -1
  277. package/dist/lib/utils/pollyfils/scroll.js +5 -1
  278. package/dist/lib/utils/pollyfils/scroll.js.map +1 -1
  279. package/dist/lib/utils/stopPropagation.js +4 -1
  280. package/dist/lib/utils/stopPropagation.js.map +1 -1
  281. package/dist/lib/utils/test.js +7 -3
  282. package/dist/lib/utils/test.js.map +1 -1
  283. package/dist/types/index.js +17 -1
  284. package/dist/types/index.js.map +1 -1
  285. package/dist/types/utility.js +2 -1
  286. package/package.json +1 -1
@@ -1,28 +1,46 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { View } from '../View';
3
- import { useStylesFor } from '../../lib/hooks/useStylesFor';
4
- import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
5
- export * from './styles';
6
- export * from './types';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ActivityIndicator = void 0;
18
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
19
+ const View_1 = require("../View");
20
+ const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
21
+ const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
22
+ __exportStar(require("./styles"), exports);
23
+ __exportStar(require("./types"), exports);
7
24
  /**
8
25
  * Loading spinner whose visual appearance is delegated entirely to style
9
26
  * composition; ships no built-in spinner markup.
10
27
  * Uses: `useStylesFor`, `WebStyleRegistry`
11
28
  */
12
- export const ActivityIndicator = (props) => {
29
+ const ActivityIndicator = (props) => {
13
30
  const { style, component: Component, size, ...rest } = {
14
- ...ActivityIndicator.defaultProps,
31
+ ...exports.ActivityIndicator.defaultProps,
15
32
  ...props,
16
33
  };
17
- const styles = useStylesFor(ActivityIndicator.styleRegistryName, style);
18
- return (_jsx(Component, { ...rest, css: styles.wrapper }));
34
+ const styles = (0, useStylesFor_1.useStylesFor)(exports.ActivityIndicator.styleRegistryName, style);
35
+ return ((0, jsx_runtime_1.jsx)(Component, { ...rest, css: styles.wrapper }));
19
36
  };
20
- ActivityIndicator.styleRegistryName = 'ActivityIndicator';
21
- ActivityIndicator.elements = ['wrapper'];
22
- ActivityIndicator.rootElement = 'wrapper';
23
- ActivityIndicator.defaultProps = {
24
- component: View,
37
+ exports.ActivityIndicator = ActivityIndicator;
38
+ exports.ActivityIndicator.styleRegistryName = 'ActivityIndicator';
39
+ exports.ActivityIndicator.elements = ['wrapper'];
40
+ exports.ActivityIndicator.rootElement = 'wrapper';
41
+ exports.ActivityIndicator.defaultProps = {
42
+ component: View_1.View,
25
43
  size: null,
26
44
  };
27
- WebStyleRegistry.registerComponent(ActivityIndicator);
45
+ WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.ActivityIndicator);
28
46
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ActivityIndicator/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAI9B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAG7D,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,MAAM,EACJ,KAAK,EACL,SAAS,EAAE,SAAS,EACpB,IAAI,EACJ,GAAG,IAAI,EACR,GAAG;QACF,GAAG,iBAAiB,CAAC,YAAY;QACjC,GAAG,KAAK;KACT,CAAA;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEvE,OAAO,CACL,KAAC,SAAS,OACJ,IAAI,EACR,GAAG,EAAE,MAAM,CAAC,OAAO,GACnB,CACH,CAAA;AACH,CAAC,CAAA;AAED,iBAAiB,CAAC,iBAAiB,GAAG,mBAAmB,CAAA;AACzD,iBAAiB,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,CAAA;AACxC,iBAAiB,CAAC,WAAW,GAAG,SAAS,CAAA;AAIzC,iBAAiB,CAAC,YAAY,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,IAAI;CACwB,CAAA;AAEpC,gBAAgB,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ActivityIndicator/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,kCAA8B;AAI9B,+DAA2D;AAC3D,iEAA6D;AAG7D,2CAAwB;AACxB,0CAAuB;AAEvB;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAAC,KAA6B,EAAE,EAAE;IACjE,MAAM,EACJ,KAAK,EACL,SAAS,EAAE,SAAS,EACpB,IAAI,EACJ,GAAG,IAAI,EACR,GAAG;QACF,GAAG,yBAAiB,CAAC,YAAY;QACjC,GAAG,KAAK;KACT,CAAA;IAED,MAAM,MAAM,GAAG,IAAA,2BAAY,EAAC,yBAAiB,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEvE,OAAO,CACL,uBAAC,SAAS,OACJ,IAAI,EACR,GAAG,EAAE,MAAM,CAAC,OAAO,GACnB,CACH,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,iBAAiB,qBAmB7B;AAED,yBAAiB,CAAC,iBAAiB,GAAG,mBAAmB,CAAA;AACzD,yBAAiB,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,CAAA;AACxC,yBAAiB,CAAC,WAAW,GAAG,SAAS,CAAA;AAIzC,yBAAiB,CAAC,YAAY,GAAG;IAC/B,SAAS,EAAE,WAAI;IACf,IAAI,EAAE,IAAI;CACwB,CAAA;AAEpC,mCAAgB,CAAC,iBAAiB,CAAC,yBAAiB,CAAC,CAAA"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=styles.js.map
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=types.js.map
@@ -1,11 +1,28 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- import { TypeGuards } from '@codeleap/types';
3
- import { Text } from '../Text';
4
- import { View } from '../View';
5
- import { useStylesFor } from '../../lib/hooks/useStylesFor';
6
- import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
7
- export * from './styles';
8
- export * from './types';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Badge = void 0;
18
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
19
+ const types_1 = require("@codeleap/types");
20
+ const Text_1 = require("../Text");
21
+ const View_1 = require("../View");
22
+ const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
23
+ const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
24
+ __exportStar(require("./styles"), exports);
25
+ __exportStar(require("./types"), exports);
9
26
  const defaultGetBadgeContent = ({ count, maxCount }) => {
10
27
  if (Number(count) > maxCount) {
11
28
  return `${maxCount}+`;
@@ -20,13 +37,13 @@ const defaultGetBadgeContent = ({ count, maxCount }) => {
20
37
  * Renders nothing when `badge` is `false` or absent.
21
38
  * Uses: `View`, `Text`, `useStylesFor`, `WebStyleRegistry`
22
39
  */
23
- export const Badge = (props) => {
40
+ const Badge = (props) => {
24
41
  const { debugName, innerWrapperProps, textProps, maxCount, minCount, getBadgeContent, renderBadgeContent, disabled, style, badge, ...rest } = {
25
- ...Badge.defaultProps,
42
+ ...exports.Badge.defaultProps,
26
43
  ...props,
27
44
  };
28
- const styles = useStylesFor(Badge.styleRegistryName, style);
29
- const visible = (TypeGuards.isBoolean(badge) && badge === true) || TypeGuards.isNumber(badge);
45
+ const styles = (0, useStylesFor_1.useStylesFor)(exports.Badge.styleRegistryName, style);
46
+ const visible = (types_1.TypeGuards.isBoolean(badge) && badge === true) || types_1.TypeGuards.isNumber(badge);
30
47
  if (!visible)
31
48
  return null;
32
49
  const wrapperStyles = [
@@ -43,26 +60,27 @@ export const Badge = (props) => {
43
60
  (disabled && styles?.['count:disabled']),
44
61
  textProps?.style,
45
62
  ];
46
- const count = TypeGuards.isNumber(badge) ? badge : null;
63
+ const count = types_1.TypeGuards.isNumber(badge) ? badge : null;
47
64
  const content = getBadgeContent({ ...props, maxCount, minCount, count });
48
- const showContent = TypeGuards.isNumber(count) && count >= minCount;
49
- const BadgeContent = TypeGuards.isNil(renderBadgeContent) ? () => _jsx(Text, { text: content, ...textProps }) : renderBadgeContent;
50
- return (_jsx(View, { ...rest, style: wrapperStyles, children: _jsx(View, { ...innerWrapperProps, style: innerWrapperStyles, children: showContent
51
- ? _jsx(BadgeContent, { ...props, style: countStyles, maxCount: maxCount, minCount: minCount, count: count, getBadgeContent: getBadgeContent, content: content })
65
+ const showContent = types_1.TypeGuards.isNumber(count) && count >= minCount;
66
+ const BadgeContent = types_1.TypeGuards.isNil(renderBadgeContent) ? () => (0, jsx_runtime_1.jsx)(Text_1.Text, { text: content, ...textProps }) : renderBadgeContent;
67
+ return ((0, jsx_runtime_1.jsx)(View_1.View, { ...rest, style: wrapperStyles, children: (0, jsx_runtime_1.jsx)(View_1.View, { ...innerWrapperProps, style: innerWrapperStyles, children: showContent
68
+ ? (0, jsx_runtime_1.jsx)(BadgeContent, { ...props, style: countStyles, maxCount: maxCount, minCount: minCount, count: count, getBadgeContent: getBadgeContent, content: content })
52
69
  : null }) }));
53
70
  };
54
- Badge.styleRegistryName = 'Badge';
55
- Badge.elements = ['wrapper', 'innerWrapper', 'count'];
56
- Badge.rootElement = 'wrapper';
57
- Badge.withVariantTypes = (styles) => {
58
- return Badge;
71
+ exports.Badge = Badge;
72
+ exports.Badge.styleRegistryName = 'Badge';
73
+ exports.Badge.elements = ['wrapper', 'innerWrapper', 'count'];
74
+ exports.Badge.rootElement = 'wrapper';
75
+ exports.Badge.withVariantTypes = (styles) => {
76
+ return exports.Badge;
59
77
  };
60
- Badge.defaultProps = {
78
+ exports.Badge.defaultProps = {
61
79
  maxCount: 9,
62
80
  minCount: 1,
63
81
  getBadgeContent: defaultGetBadgeContent,
64
82
  disabled: false,
65
83
  badge: true,
66
84
  };
67
- WebStyleRegistry.registerComponent(Badge);
85
+ WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.Badge);
68
86
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAG7D,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AAEvB,MAAM,sBAAsB,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAgB,EAAE,EAAE;IACnE,IAAI,MAAM,CAAC,KAAK,CAAC,GAAG,QAAQ,EAAE,CAAC;QAC7B,OAAO,GAAG,QAAQ,GAAG,CAAA;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,KAAK,CAAC,CAAA;IACtB,CAAC;AACH,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAiB,EAAE,EAAE;IACzC,MAAM,EACJ,SAAS,EACT,iBAAiB,EACjB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,KAAK,EACL,KAAK,EACL,GAAG,IAAI,EACR,GAAG;QACF,GAAG,KAAK,CAAC,YAAY;QACrB,GAAG,KAAK;KACT,CAAA;IAED,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA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
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=styles.js.map
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=types.js.map
@@ -1,23 +1,40 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { TypeGuards } from '@codeleap/types';
3
- import { Text } from '../Text';
4
- import { Touchable } from '../Touchable';
5
- import { Icon } from '../Icon';
6
- import { ActivityIndicator } from '../ActivityIndicator';
7
- import { useStylesFor } from '../../lib/hooks/useStylesFor';
8
- import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
9
- import { mergeStyles } from '@codeleap/styles';
10
- import { toDataAttrs } from '../../lib';
11
- export * from './styles';
12
- export * from './types';
13
- export function Button(buttonProps) {
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Button = Button;
18
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
19
+ const types_1 = require("@codeleap/types");
20
+ const Text_1 = require("../Text");
21
+ const Touchable_1 = require("../Touchable");
22
+ const Icon_1 = require("../Icon");
23
+ const ActivityIndicator_1 = require("../ActivityIndicator");
24
+ const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
25
+ const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
26
+ const styles_1 = require("@codeleap/styles");
27
+ const lib_1 = require("../../lib");
28
+ __exportStar(require("./styles"), exports);
29
+ __exportStar(require("./types"), exports);
30
+ function Button(buttonProps) {
14
31
  const allProps = {
15
32
  ...Button.defaultProps,
16
33
  ...buttonProps,
17
34
  };
18
35
  const { children, icon, text, loading, loadingShowText, onPress, disabled, rightIcon, selected, loaderProps, debugName, style, context, ...props } = allProps;
19
- const styles = useStylesFor(Button.styleRegistryName, style);
20
- const getStyles = (key, partialStyle = null) => mergeStyles([
36
+ const styles = (0, useStylesFor_1.useStylesFor)(Button.styleRegistryName, style);
37
+ const getStyles = (key, partialStyle = null) => (0, styles_1.mergeStyles)([
21
38
  partialStyle,
22
39
  styles?.[key],
23
40
  ]);
@@ -33,12 +50,12 @@ export function Button(buttonProps) {
33
50
  const isLeftIconHide = componentStyles?.leftIcon?.display === 'none';
34
51
  const shouldRenderLeftIcon = !loading && !isLeftIconHide && !!icon;
35
52
  const _hideTextOnLoading = !loadingShowText && loading;
36
- const attrs = toDataAttrs([{ selected, loading }, context]);
37
- return (_jsxs(Touchable, { component: 'button', debugComponent: 'Button', disabled: disabled, "aria-pressed": selected || undefined, "aria-busy": loading || undefined, onPress: onPress, debugName: debugName, ...props, ...attrs, style: componentStyles.wrapper, className: 'button__wrapper', children: [shouldRenderLeftIcon ? _jsx(Icon, { debugName: debugName, icon: icon, style: componentStyles.leftIcon, className: 'button__icon button__left_icon' }) : null, TypeGuards.isString(text) && !_hideTextOnLoading ? _jsx(Text.Span, { debugName: debugName, text: text, style: componentStyles.text, className: 'button__text' }) : null, children, loading ? _jsx(ActivityIndicator, { debugName: `${debugName} loader`, ...loaderProps, style: componentStyles.loader, className: 'button__loader' }) : null, !!rightIcon ? _jsx(Icon, { debugName: debugName, icon: rightIcon, style: componentStyles.rightIcon, className: 'button__icon button__right_icon' }) : null] }));
53
+ const attrs = (0, lib_1.toDataAttrs)([{ selected, loading }, context]);
54
+ return ((0, jsx_runtime_1.jsxs)(Touchable_1.Touchable, { component: 'button', debugComponent: 'Button', disabled: disabled, "aria-pressed": selected || undefined, "aria-busy": loading || undefined, onPress: onPress, debugName: debugName, ...props, ...attrs, style: componentStyles.wrapper, className: 'button__wrapper', children: [shouldRenderLeftIcon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { debugName: debugName, icon: icon, style: componentStyles.leftIcon, className: 'button__icon button__left_icon' }) : null, types_1.TypeGuards.isString(text) && !_hideTextOnLoading ? (0, jsx_runtime_1.jsx)(Text_1.Text.Span, { debugName: debugName, text: text, style: componentStyles.text, className: 'button__text' }) : null, children, loading ? (0, jsx_runtime_1.jsx)(ActivityIndicator_1.ActivityIndicator, { debugName: `${debugName} loader`, ...loaderProps, style: componentStyles.loader, className: 'button__loader' }) : null, !!rightIcon ? (0, jsx_runtime_1.jsx)(Icon_1.Icon, { debugName: debugName, icon: rightIcon, style: componentStyles.rightIcon, className: 'button__icon button__right_icon' }) : null] }));
38
55
  }
39
56
  function TabButton(buttonProps) {
40
57
  // @ts-ignore
41
- return _jsx(Button, { ...buttonProps, role: 'tab', "aria-pressed": undefined, "aria-selected": buttonProps?.selected || undefined });
58
+ return (0, jsx_runtime_1.jsx)(Button, { ...buttonProps, role: 'tab', "aria-pressed": undefined, "aria-selected": buttonProps?.selected || undefined });
42
59
  }
43
60
  Button.Tab = TabButton;
44
61
  Button.styleRegistryName = 'Button';
@@ -48,5 +65,5 @@ Button.defaultProps = {
48
65
  debounce: 600,
49
66
  loadingShowText: false,
50
67
  };
51
- WebStyleRegistry.registerComponent(Button);
68
+ WebStyleRegistry_1.WebStyleRegistry.registerComponent(Button);
52
69
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Button/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAY,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,IA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AAK,kBACI,SAAS,mBACR,WAAW,EAAE,QAAQ,IAAI,SAAS,GACjD,CAAA;AACJ,CAAC;AACD,MAAM,CAAC,GAAG,GAAG,SAAS,CAAA;AAEtB,MAAM,CAAC,iBAAiB,GAAG,QAAQ,CAAA;AACnC,MAAM,CAAC,QAAQ,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAA;AAChF,MAAM,CAAC,WAAW,GAAG,SAAS,CAAA;AAG9B,MAAM,CAAC,YAAY,GAAG;IACpB,QAAQ,EAAE,GAAG;IACb,eAAe,EAAE,KAAK;CACM,CAAA;AAE9B,mCAAgB,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAA"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=styles.js.map
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=types.js.map
@@ -1,13 +1,30 @@
1
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { Calendar as AriaCalendar, CalendarGrid, CalendarGridHeader as AriaCalendarGridHeader, CalendarGridBody, CalendarHeaderCell, CalendarCell, Heading, useContextProps, ButtonContext, } from 'react-aria-components';
3
- import { useStylesFor } from '../../lib/hooks/useStylesFor';
4
- import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
5
- import { View } from '../View';
6
- export * from './styles';
7
- export * from './types';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Calendar = Calendar;
18
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
19
+ const react_aria_components_1 = require("react-aria-components");
20
+ const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
21
+ const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
22
+ const View_1 = require("../View");
23
+ __exportStar(require("./styles"), exports);
24
+ __exportStar(require("./types"), exports);
8
25
  function SlotForwader(allProps) {
9
26
  let { ref: providedRef, context, render, ...actualProps } = allProps;
10
- let [props, ref] = useContextProps(actualProps, providedRef, context);
27
+ let [props, ref] = (0, react_aria_components_1.useContextProps)(actualProps, providedRef, context);
11
28
  return render(props, ref);
12
29
  }
13
30
  /**
@@ -16,14 +33,14 @@ function SlotForwader(allProps) {
16
33
  * First day of week defaults to Sunday (`'sun'`).
17
34
  * Uses: `View`, `Icon`
18
35
  */
19
- export function Calendar(calendarProps) {
36
+ function Calendar(calendarProps) {
20
37
  const { style, prevIcon, nextIcon, debugName, renderNext, renderPrevious, ...props } = {
21
38
  ...Calendar.defaultProps,
22
39
  ...calendarProps,
23
40
  };
24
- const styles = useStylesFor(Calendar.styleRegistryName, style);
41
+ const styles = (0, useStylesFor_1.useStylesFor)(Calendar.styleRegistryName, style);
25
42
  const s = styles;
26
- return (_jsxs(AriaCalendar, { ...props, css: s.wrapper, children: [_jsxs(View, { component: 'header', style: styles.header, children: [_jsx(SlotForwader, { context: ButtonContext, slot: 'previous', css: styles.prevButton, render: renderPrevious ?? (() => _jsx(_Fragment, {})) }), _jsx(Heading, { css: s.heading }), _jsx(SlotForwader, { context: ButtonContext, slot: 'next', css: styles.nextButton, render: renderNext ?? (() => _jsx(_Fragment, {})) })] }), _jsxs(CalendarGrid, { css: s.grid, children: [_jsx(AriaCalendarGridHeader, { children: (day) => _jsx(CalendarHeaderCell, { css: s.gridHeaderCell, children: day }) }), _jsx(CalendarGridBody, { children: (date) => _jsx(CalendarCell, { date: date, css: s.cell }) })] })] }));
43
+ return ((0, jsx_runtime_1.jsxs)(react_aria_components_1.Calendar, { ...props, css: s.wrapper, children: [(0, jsx_runtime_1.jsxs)(View_1.View, { component: 'header', style: styles.header, children: [(0, jsx_runtime_1.jsx)(SlotForwader, { context: react_aria_components_1.ButtonContext, slot: 'previous', css: styles.prevButton, render: renderPrevious ?? (() => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.Heading, { css: s.heading }), (0, jsx_runtime_1.jsx)(SlotForwader, { context: react_aria_components_1.ButtonContext, slot: 'next', css: styles.nextButton, render: renderNext ?? (() => (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, {})) })] }), (0, jsx_runtime_1.jsxs)(react_aria_components_1.CalendarGrid, { css: s.grid, children: [(0, jsx_runtime_1.jsx)(react_aria_components_1.CalendarGridHeader, { children: (day) => (0, jsx_runtime_1.jsx)(react_aria_components_1.CalendarHeaderCell, { css: s.gridHeaderCell, children: day }) }), (0, jsx_runtime_1.jsx)(react_aria_components_1.CalendarGridBody, { children: (date) => (0, jsx_runtime_1.jsx)(react_aria_components_1.CalendarCell, { date: date, css: s.cell }) })] })] }));
27
44
  }
28
45
  Calendar.styleRegistryName = 'Calendar';
29
46
  Calendar.elements = [
@@ -46,5 +63,5 @@ Calendar.defaultProps = {
46
63
  nextIcon: 'chevronRight',
47
64
  firstDayOfWeek: 'sun'
48
65
  };
49
- WebStyleRegistry.registerComponent(Calendar);
66
+ WebStyleRegistry_1.WebStyleRegistry.registerComponent(Calendar);
50
67
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version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DAAK,CAAC,GACvC,EACJ,uBAAC,+BAAO,IAAC,GAAG,EAAE,CAAC,CAAC,OAAO,GAAI,EAE3B,uBAAC,YAAY,IACX,OAAO,EAAE,qCAAa,EACtB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,CAAC,UAAU,EACtB,MAAM,EAAE,UAAU,IAAI,CAAC,GAAG,EAAE,CAAC,kDAAK,CAAC,GACnC,IAGG,EACP,wBAAC,oCAAY,IAAC,GAAG,EAAE,CAAC,CAAC,IAAI,aACvB,uBAAC,0CAAsB,cACpB,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAC,0CAAkB,IAAC,GAAG,EAAE,CAAC,CAAC,cAAc,YAAG,GAAG,GAAsB,GACxD,EACzB,uBAAC,wCAAgB,cACd,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAC,oCAAY,IAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,GAAI,GACnC,IACN,IAEF,CAChB,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,iBAAiB,GAAG,UAAU,CAAA;AACvC,QAAQ,CAAC,QAAQ,GAAG;IAClB,SAAS;IACT,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,gBAAgB;IAChB,MAAM;IACN,gBAAgB;IAChB,MAAM;IACN,cAAc;CACf,CAAA;AACD,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAA;AAIhC,QAAQ,CAAC,YAAY,GAAG;IACtB,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,aAAwB;IAClC,QAAQ,EAAE,cAAyB;IACnC,cAAc,EAAE,KAAK;CACI,CAAA;AAE3B,mCAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA"}
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=styles.js.map
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# sourceMappingURL=types.js.map
@@ -1,24 +1,66 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- import { onUpdate } from '@codeleap/hooks';
3
- import React, { forwardRef, useCallback, useImperativeHandle, useEffect, useState, useMemo } from 'react';
4
- import useEmblaCarousel from 'embla-carousel-react';
5
- import Autoplay from 'embla-carousel-autoplay';
6
- import { View } from '../View';
7
- import { Touchable } from '../Touchable';
8
- import { WebStyleRegistry } from '../../lib/WebStyleRegistry';
9
- import { useStylesFor } from '../../lib/hooks/useStylesFor';
10
- export * from './styles';
11
- export * from './types';
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
40
+ };
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.Carousel = void 0;
43
+ const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
44
+ const hooks_1 = require("@codeleap/hooks");
45
+ const react_1 = __importStar(require("react"));
46
+ const embla_carousel_react_1 = __importDefault(require("embla-carousel-react"));
47
+ const embla_carousel_autoplay_1 = __importDefault(require("embla-carousel-autoplay"));
48
+ const View_1 = require("../View");
49
+ const Touchable_1 = require("../Touchable");
50
+ const WebStyleRegistry_1 = require("../../lib/WebStyleRegistry");
51
+ const useStylesFor_1 = require("../../lib/hooks/useStylesFor");
52
+ __exportStar(require("./styles"), exports);
53
+ __exportStar(require("./types"), exports);
12
54
  const Dots = (params) => {
13
55
  const { page, childArray, onPress, styles, dotsDisabled } = params;
14
- return (_jsx(View, { style: styles.dots, children: childArray.map((_, index) => {
56
+ return ((0, jsx_runtime_1.jsx)(View_1.View, { style: styles.dots, children: childArray.map((_, index) => {
15
57
  const isSelected = index === page;
16
58
  const style = [
17
59
  styles.dot,
18
60
  isSelected && styles['dot:selected'],
19
61
  dotsDisabled && styles['dot:disabled'],
20
62
  ];
21
- return (_jsx(Touchable, { onPress: () => onPress?.(index), style: style, disabled: dotsDisabled, debugName: 'dots' }, index));
63
+ return ((0, jsx_runtime_1.jsx)(Touchable_1.Touchable, { onPress: () => onPress?.(index), style: style, disabled: dotsDisabled, debugName: 'dots' }, index));
22
64
  }) }));
23
65
  };
24
66
  /**
@@ -26,22 +68,22 @@ const Dots = (params) => {
26
68
  * The `page` prop is semi-controlled — it syncs to Embla whenever it changes but internal swipe still updates the active index independently.
27
69
  * Uses: `Touchable`
28
70
  */
29
- export const Carousel = forwardRef((props, ref) => {
71
+ exports.Carousel = (0, react_1.forwardRef)((props, ref) => {
30
72
  const { style, children, renderSlideWrapper: SlideWrapper, page, dots, dotsDisabled, infinite, disableSwipe, onChange, footer, dotsProps, slideWrapperProps, autoplay, autoplayDelay, spaceBetween, slidesPerView, ...rest } = {
31
- ...Carousel.defaultProps,
73
+ ...exports.Carousel.defaultProps,
32
74
  ...props,
33
75
  };
34
- const styles = useStylesFor(Carousel.styleRegistryName, style);
35
- const childArray = React.Children.toArray(children);
36
- const [currentIndex, setCurrentIndex] = useState(0);
37
- const plugins = useMemo(() => {
76
+ const styles = (0, useStylesFor_1.useStylesFor)(exports.Carousel.styleRegistryName, style);
77
+ const childArray = react_1.default.Children.toArray(children);
78
+ const [currentIndex, setCurrentIndex] = (0, react_1.useState)(0);
79
+ const plugins = (0, react_1.useMemo)(() => {
38
80
  const pluginList = [];
39
81
  if (autoplay) {
40
- pluginList.push(Autoplay({ delay: autoplayDelay, stopOnInteraction: false }));
82
+ pluginList.push((0, embla_carousel_autoplay_1.default)({ delay: autoplayDelay, stopOnInteraction: false }));
41
83
  }
42
84
  return pluginList;
43
85
  }, [autoplay, autoplayDelay]);
44
- const [emblaRef, emblaApi] = useEmblaCarousel({
86
+ const [emblaRef, emblaApi] = (0, embla_carousel_react_1.default)({
45
87
  loop: infinite,
46
88
  dragFree: false,
47
89
  containScroll: 'trimSnaps',
@@ -49,28 +91,28 @@ export const Carousel = forwardRef((props, ref) => {
49
91
  slidesToScroll: 1,
50
92
  ...(disableSwipe && { watchDrag: false }),
51
93
  }, plugins);
52
- const goTo = useCallback((index) => {
94
+ const goTo = (0, react_1.useCallback)((index) => {
53
95
  if (emblaApi) {
54
96
  emblaApi.scrollTo(index);
55
97
  }
56
98
  }, [emblaApi]);
57
- const next = useCallback(() => {
99
+ const next = (0, react_1.useCallback)(() => {
58
100
  if (emblaApi) {
59
101
  emblaApi.scrollNext();
60
102
  }
61
103
  }, [emblaApi]);
62
- const prev = useCallback(() => {
104
+ const prev = (0, react_1.useCallback)(() => {
63
105
  if (emblaApi) {
64
106
  emblaApi.scrollPrev();
65
107
  }
66
108
  }, [emblaApi]);
67
- useImperativeHandle(ref, () => ({
109
+ (0, react_1.useImperativeHandle)(ref, () => ({
68
110
  goTo,
69
111
  next,
70
112
  prev,
71
113
  emblaApi,
72
114
  }), [goTo, next, prev, emblaApi]);
73
- useEffect(() => {
115
+ (0, react_1.useEffect)(() => {
74
116
  if (!emblaApi)
75
117
  return;
76
118
  const onSelect = () => {
@@ -84,46 +126,46 @@ export const Carousel = forwardRef((props, ref) => {
84
126
  emblaApi.off('select', onSelect);
85
127
  };
86
128
  }, [emblaApi, onChange]);
87
- onUpdate(() => {
129
+ (0, hooks_1.onUpdate)(() => {
88
130
  if (page !== undefined && page !== currentIndex && emblaApi) {
89
131
  goTo(page);
90
132
  }
91
133
  }, [page]);
92
- return (_jsxs(View, { style: styles.wrapper, children: [_jsx(View, { ref: emblaRef, style: {
134
+ return ((0, jsx_runtime_1.jsxs)(View_1.View, { style: styles.wrapper, children: [(0, jsx_runtime_1.jsx)(View_1.View, { ref: emblaRef, style: {
93
135
  overflow: 'hidden',
94
- }, children: _jsx(View, { style: {
136
+ }, children: (0, jsx_runtime_1.jsx)(View_1.View, { style: {
95
137
  display: 'flex',
96
138
  flexDirection: 'row',
97
139
  gap: spaceBetween,
98
140
  }, children: childArray.map((child, index) => {
99
- return (_jsx(View, { style: {
141
+ return ((0, jsx_runtime_1.jsx)(View_1.View, { style: {
100
142
  flex: slidesPerView === 1 ? '0 0 100%' : slidesPerView === 'auto' ? '0 0 auto' : `0 0 ${100 / slidesPerView}%`,
101
143
  minWidth: 0,
102
- }, children: _jsx(SlideWrapper, { style: styles.slideWrapper, ...slideWrapperProps, children: child }) }, index));
103
- }) }) }), _jsxs(View, { style: styles.footerWrapper, children: [footer, dots ? (_jsx(Dots, { page: currentIndex, onPress: goTo, childArray: childArray, styles: styles, dotsDisabled: dotsDisabled, ...dotsProps })) : null] })] }));
144
+ }, children: (0, jsx_runtime_1.jsx)(SlideWrapper, { style: styles.slideWrapper, ...slideWrapperProps, children: child }) }, index));
145
+ }) }) }), (0, jsx_runtime_1.jsxs)(View_1.View, { style: styles.footerWrapper, children: [footer, dots ? ((0, jsx_runtime_1.jsx)(Dots, { page: currentIndex, onPress: goTo, childArray: childArray, styles: styles, dotsDisabled: dotsDisabled, ...dotsProps })) : null] })] }));
104
146
  });
105
- Carousel.styleRegistryName = 'Carousel';
106
- Carousel.elements = [
147
+ exports.Carousel.styleRegistryName = 'Carousel';
148
+ exports.Carousel.elements = [
107
149
  'wrapper',
108
150
  'dot',
109
151
  'dots',
110
152
  'slideWrapper',
111
153
  'footerWrapper',
112
154
  ];
113
- Carousel.rootElement = 'wrapper';
114
- Carousel.withVariantTypes = (styles) => {
115
- return Carousel;
155
+ exports.Carousel.rootElement = 'wrapper';
156
+ exports.Carousel.withVariantTypes = (styles) => {
157
+ return exports.Carousel;
116
158
  };
117
- Carousel.defaultProps = {
159
+ exports.Carousel.defaultProps = {
118
160
  dots: false,
119
161
  dotsDisabled: false,
120
162
  infinite: false,
121
163
  disableSwipe: false,
122
- renderSlideWrapper: View,
164
+ renderSlideWrapper: View_1.View,
123
165
  autoplay: false,
124
166
  autoplayDelay: 3000,
125
167
  spaceBetween: 0,
126
168
  slidesPerView: 1,
127
169
  };
128
- WebStyleRegistry.registerComponent(Carousel);
170
+ WebStyleRegistry_1.WebStyleRegistry.registerComponent(exports.Carousel);
129
171
  //# sourceMappingURL=index.js.map