@sincpro/mobile-ui 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (308) hide show
  1. package/dist/Actions/Actions.Button.d.ts +6 -6
  2. package/dist/Actions/Actions.Button.js +650 -180
  3. package/dist/Actions/Actions.Dock.d.ts +1 -1
  4. package/dist/Actions/Actions.Dock.js +297 -18
  5. package/dist/Actions/Actions.FAB.js +100 -12
  6. package/dist/Actions/Actions.FilterButton.d.ts +17 -0
  7. package/dist/Actions/Actions.FilterButton.js +263 -33
  8. package/dist/Actions/Actions.IconButton.d.ts +1 -0
  9. package/dist/Actions/Actions.IconButton.js +196 -33
  10. package/dist/Actions/index.js +13 -13
  11. package/dist/Dialog/Confirmation.context.js +82 -16
  12. package/dist/Dialog/Dialog.ActionSheet.js +200 -41
  13. package/dist/Dialog/Dialog.Confirmation.js +168 -31
  14. package/dist/Dialog/Dialog.EditValue.js +449 -61
  15. package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
  16. package/dist/Dialog/Dialog.Sheet.js +231 -15
  17. package/dist/Dialog/OverlayHost.d.ts +23 -0
  18. package/dist/Dialog/OverlayHost.js +196 -0
  19. package/dist/Dialog/SheetSurface.d.ts +24 -0
  20. package/dist/Dialog/SheetSurface.js +441 -0
  21. package/dist/Dialog/dialog-actions.d.ts +17 -0
  22. package/dist/Dialog/dialog-actions.js +59 -0
  23. package/dist/Dialog/index.d.ts +4 -1
  24. package/dist/Dialog/index.js +8 -7
  25. package/dist/Dialog/overlay.store.d.ts +24 -0
  26. package/dist/Dialog/overlay.store.js +59 -0
  27. package/dist/Dialog/requestConfirmation.js +20 -10
  28. package/dist/Display/Display.Accordion.js +185 -13
  29. package/dist/Display/Display.AmountSummary.js +206 -15
  30. package/dist/Display/Display.Avatar.js +93 -31
  31. package/dist/Display/Display.AvatarGroup.js +132 -17
  32. package/dist/Display/Display.Badge.d.ts +18 -2
  33. package/dist/Display/Display.Badge.js +117 -49
  34. package/dist/Display/Display.Card.js +163 -26
  35. package/dist/Display/Display.Carousel.js +459 -105
  36. package/dist/Display/Display.Chip.d.ts +4 -1
  37. package/dist/Display/Display.Chip.js +165 -31
  38. package/dist/Display/Display.CircleButton.d.ts +1 -0
  39. package/dist/Display/Display.CircleButton.js +86 -27
  40. package/dist/Display/Display.CopyableText.js +289 -66
  41. package/dist/Display/Display.CountRecords.js +60 -3
  42. package/dist/Display/Display.DataTable.js +123 -13
  43. package/dist/Display/Display.Date.js +243 -33
  44. package/dist/Display/Display.Divider.d.ts +10 -10
  45. package/dist/Display/Display.Divider.js +67 -20
  46. package/dist/Display/Display.ExpoImage.js +97 -8
  47. package/dist/Display/Display.GradientSurface.d.ts +9 -4
  48. package/dist/Display/Display.GradientSurface.js +196 -46
  49. package/dist/Display/Display.Icon.js +129 -15
  50. package/dist/Display/Display.IconBadge.js +95 -25
  51. package/dist/Display/Display.Image.d.ts +7 -1
  52. package/dist/Display/Display.Image.js +344 -39
  53. package/dist/Display/Display.KeyValue.js +90 -5
  54. package/dist/Display/Display.ListGroup.js +181 -9
  55. package/dist/Display/Display.ListItem.js +324 -28
  56. package/dist/Display/Display.Logo.js +84 -29
  57. package/dist/Display/Display.MediaCard.js +125 -4
  58. package/dist/Display/Display.MediaEmbed.d.ts +0 -5
  59. package/dist/Display/Display.MediaEmbed.js +170 -26
  60. package/dist/Display/Display.MenuButton.d.ts +2 -2
  61. package/dist/Display/Display.MenuButton.js +380 -94
  62. package/dist/Display/Display.MenuCard.js +122 -18
  63. package/dist/Display/Display.MenuGrid.js +43 -3
  64. package/dist/Display/Display.Monetary.js +90 -5
  65. package/dist/Display/Display.Pattern.js +306 -47
  66. package/dist/Display/Display.PriceTag.js +117 -14
  67. package/dist/Display/Display.ProductCard.js +154 -4
  68. package/dist/Display/Display.Rating.js +92 -11
  69. package/dist/Display/Display.SearchHistory.js +132 -6
  70. package/dist/Display/Display.SectionHeader.d.ts +5 -1
  71. package/dist/Display/Display.SectionHeader.js +125 -12
  72. package/dist/Display/Display.Stat.js +62 -3
  73. package/dist/Display/Display.StatCard.js +131 -7
  74. package/dist/Display/Display.StatusBadge.d.ts +29 -0
  75. package/dist/Display/Display.StatusBadge.js +68 -0
  76. package/dist/Display/Display.StatusDot.js +93 -18
  77. package/dist/Display/Display.Story.js +285 -35
  78. package/dist/Display/Display.StoryTray.js +354 -34
  79. package/dist/Display/Display.StoryViewer.js +571 -72
  80. package/dist/Display/Display.SwipeableRow.js +141 -20
  81. package/dist/Display/Display.Tag.d.ts +4 -1
  82. package/dist/Display/Display.Tag.js +66 -4
  83. package/dist/Display/Display.Timeline.js +102 -13
  84. package/dist/Display/Display.Tooltip.js +122 -26
  85. package/dist/Display/chevron.d.ts +6 -0
  86. package/dist/Display/chevron.js +32 -0
  87. package/dist/Display/count-badge.d.ts +21 -0
  88. package/dist/Display/count-badge.js +124 -0
  89. package/dist/Display/group-title.d.ts +10 -0
  90. package/dist/Display/group-title.js +53 -0
  91. package/dist/Display/icon-font.d.ts +3 -0
  92. package/dist/Display/icon-font.ios.d.ts +3 -0
  93. package/dist/Display/icon-font.ios.js +4 -0
  94. package/dist/Display/icon-font.js +7 -0
  95. package/dist/Display/icon-glyphs.d.ts +2 -0
  96. package/dist/Display/icon-glyphs.js +87 -0
  97. package/dist/Display/icon-map.d.ts +5 -1
  98. package/dist/Display/icon-map.js +340 -84
  99. package/dist/Display/icon-registry.d.ts +21 -0
  100. package/dist/Display/icon-registry.js +21 -0
  101. package/dist/Display/index.d.ts +6 -1
  102. package/dist/Display/index.js +53 -48
  103. package/dist/Display/pill.d.ts +16 -0
  104. package/dist/Display/pill.js +47 -0
  105. package/dist/Feedback/ErrorBoundary.js +35 -23
  106. package/dist/Feedback/Feedback.Banner.js +202 -24
  107. package/dist/Feedback/Feedback.DomainSplashScreen.js +246 -70
  108. package/dist/Feedback/Feedback.Empty.js +54 -3
  109. package/dist/Feedback/Feedback.EmptyState.js +114 -5
  110. package/dist/Feedback/Feedback.Error.d.ts +1 -1
  111. package/dist/Feedback/Feedback.Error.js +130 -5
  112. package/dist/Feedback/Feedback.Loading.d.ts +1 -1
  113. package/dist/Feedback/Feedback.Loading.js +70 -3
  114. package/dist/Feedback/Feedback.PermissionCard.js +161 -5
  115. package/dist/Feedback/Feedback.Progress.js +199 -41
  116. package/dist/Feedback/Feedback.ProgressCircle.js +184 -12
  117. package/dist/Feedback/Feedback.Skeleton.js +149 -36
  118. package/dist/Feedback/Feedback.Spinner.js +407 -79
  119. package/dist/Feedback/Feedback.Splash.js +240 -33
  120. package/dist/Feedback/Feedback.State.d.ts +17 -0
  121. package/dist/Feedback/Feedback.State.js +104 -0
  122. package/dist/Feedback/Toast.context.js +883 -167
  123. package/dist/Feedback/index.d.ts +3 -0
  124. package/dist/Feedback/index.js +15 -13
  125. package/dist/Form/Form.Checkbox.js +212 -22
  126. package/dist/Form/Form.ControlledCheckbox.d.ts +1 -1
  127. package/dist/Form/Form.ControlledCheckbox.js +46 -4
  128. package/dist/Form/Form.ControlledDropdown.d.ts +1 -1
  129. package/dist/Form/Form.ControlledDropdown.js +62 -4
  130. package/dist/Form/Form.ControlledInput.d.ts +4 -3
  131. package/dist/Form/Form.ControlledInput.js +72 -4
  132. package/dist/Form/Form.ControlledMonetaryInput.d.ts +6 -3
  133. package/dist/Form/Form.ControlledMonetaryInput.js +50 -4
  134. package/dist/Form/Form.ControlledRadioButton.d.ts +2 -2
  135. package/dist/Form/Form.ControlledRadioButton.js +45 -4
  136. package/dist/Form/Form.DatePicker.js +505 -107
  137. package/dist/Form/Form.Dropdown.js +303 -52
  138. package/dist/Form/Form.ErrorSummary.js +236 -44
  139. package/dist/Form/Form.Field.d.ts +24 -0
  140. package/dist/Form/Form.Field.js +55 -0
  141. package/dist/Form/Form.FractionalQuantityInput.js +508 -96
  142. package/dist/Form/Form.Input.d.ts +17 -3
  143. package/dist/Form/Form.Input.js +478 -29
  144. package/dist/Form/Form.KeyboardForm.d.ts +22 -8
  145. package/dist/Form/Form.KeyboardForm.js +83 -8
  146. package/dist/Form/Form.KeyboardToolbarHost.d.ts +14 -0
  147. package/dist/Form/Form.KeyboardToolbarHost.js +182 -0
  148. package/dist/Form/Form.MonetaryInput.js +164 -17
  149. package/dist/Form/Form.PickerField.d.ts +31 -0
  150. package/dist/Form/Form.PickerField.js +562 -0
  151. package/dist/Form/Form.PinInput.js +150 -15
  152. package/dist/Form/Form.QuantitySelector.js +229 -25
  153. package/dist/Form/Form.RadioButton.js +132 -24
  154. package/dist/Form/Form.Select.js +487 -56
  155. package/dist/Form/Form.Slider.js +133 -10
  156. package/dist/Form/Form.Switch.js +99 -4
  157. package/dist/Form/index.d.ts +11 -6
  158. package/dist/Form/index.js +26 -27
  159. package/dist/Form/input-text.d.ts +7 -0
  160. package/dist/Form/input-text.js +18 -0
  161. package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
  162. package/dist/Navigation/Navigation.AppBar.js +535 -99
  163. package/dist/Navigation/Navigation.BottomNav.js +363 -98
  164. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
  165. package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
  166. package/dist/Navigation/Navigation.FloatingBar.js +71 -11
  167. package/dist/Navigation/Navigation.Menu.js +309 -95
  168. package/dist/Navigation/Navigation.MenuSection.js +80 -11
  169. package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
  170. package/dist/Navigation/Navigation.RowItem.js +93 -8
  171. package/dist/Navigation/Navigation.Search.js +241 -27
  172. package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
  173. package/dist/Navigation/Navigation.SearchBar.js +218 -29
  174. package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
  175. package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
  176. package/dist/Navigation/Navigation.Steps.js +105 -11
  177. package/dist/Navigation/Navigation.Tabs.js +449 -41
  178. package/dist/Navigation/index.d.ts +9 -4
  179. package/dist/Navigation/index.js +13 -13
  180. package/dist/Typography/Typography.Heading.js +33 -3
  181. package/dist/Typography/Typography.SelectableText.js +95 -7
  182. package/dist/Typography/Typography.Text.d.ts +4 -2
  183. package/dist/Typography/Typography.Text.js +217 -7
  184. package/dist/Typography/index.js +3 -3
  185. package/dist/branding.js +29 -13
  186. package/dist/icons/AddItemIcon.js +76 -2
  187. package/dist/icons/ArrangeCircle.js +82 -2
  188. package/dist/icons/ArrowDownIcon.js +63 -3
  189. package/dist/icons/ArrowUpIcon.js +63 -3
  190. package/dist/icons/BoxIcon.js +64 -2
  191. package/dist/icons/BoxTimeIcon.js +63 -2
  192. package/dist/icons/CalendarIcon.js +145 -2
  193. package/dist/icons/CardIcon.js +80 -2
  194. package/dist/icons/CashierIcon.js +39 -2
  195. package/dist/icons/CreditIcon.js +76 -3
  196. package/dist/icons/DuoIcon.js +75 -2
  197. package/dist/icons/HomeIcon.js +39 -2
  198. package/dist/icons/HomeIconOutlined.js +53 -2
  199. package/dist/icons/LogoIcon.js +87 -2
  200. package/dist/icons/MoneyReceiveIcon.js +86 -2
  201. package/dist/icons/PinIcon.js +39 -2
  202. package/dist/icons/ProfileIcon.js +47 -2
  203. package/dist/icons/SettingsIcon.js +114 -2
  204. package/dist/icons/SinpeIcon.js +60 -2
  205. package/dist/icons/ToggleOffIcon.js +53 -2
  206. package/dist/icons/WalletMoneyIcon.js +81 -2
  207. package/dist/index.d.ts +1 -0
  208. package/dist/index.js +8 -2
  209. package/dist/layouts/AuthContainer.d.ts +4 -5
  210. package/dist/layouts/AuthContainer.js +231 -7
  211. package/dist/layouts/BottomInset.js +4 -1
  212. package/dist/layouts/Container.d.ts +2 -2
  213. package/dist/layouts/Container.js +45 -3
  214. package/dist/layouts/GradientContainer.js +37 -5
  215. package/dist/layouts/PlainLayout.js +19 -3
  216. package/dist/layouts/ScrollContainer.d.ts +14 -9
  217. package/dist/layouts/ScrollContainer.js +125 -4
  218. package/dist/layouts/edges.d.ts +2 -0
  219. package/dist/layouts/edges.js +1 -0
  220. package/dist/primitives/AspectRatio.js +75 -3
  221. package/dist/primitives/Box.js +45 -3
  222. package/dist/primitives/Pressable.js +95 -5
  223. package/dist/primitives/Row.js +84 -13
  224. package/dist/primitives/Spacer.js +42 -5
  225. package/dist/primitives/Stack.js +66 -7
  226. package/dist/primitives/index.js +1 -1
  227. package/dist/theme/active.js +20 -18
  228. package/dist/theme/build.js +118 -87
  229. package/dist/theme/color.js +87 -87
  230. package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
  231. package/dist/theme/components/ThemedActivityIndicator.js +35 -3
  232. package/dist/theme/components/index.js +1 -0
  233. package/dist/theme/contrast.js +32 -33
  234. package/dist/theme/css-vars.js +71 -75
  235. package/dist/theme/dark.js +116 -97
  236. package/dist/theme/default.js +116 -97
  237. package/dist/theme/define.js +16 -12
  238. package/dist/theme/index.d.ts +1 -0
  239. package/dist/theme/index.js +7 -6
  240. package/dist/theme/on-dark-surface.d.ts +12 -0
  241. package/dist/theme/on-dark-surface.js +13 -0
  242. package/dist/theme/theme.js +1 -0
  243. package/dist/theme/tw.js +3 -1
  244. package/dist/theme/types.js +0 -18
  245. package/dist/theme/typography.d.ts +1 -1
  246. package/dist/theme/typography.js +337 -303
  247. package/dist/theme/useTheme.js +12 -3
  248. package/dist/theme/useThemeVars.d.ts +9 -0
  249. package/dist/theme/useThemeVars.js +23 -0
  250. package/dist/theme/validate.js +175 -166
  251. package/dist/tokens/index.js +1 -1
  252. package/dist/tokens/motion.js +30 -13
  253. package/dist/utils/async.d.ts +14 -0
  254. package/dist/utils/async.js +22 -0
  255. package/dist/utils/criteria.js +66 -85
  256. package/dist/utils/date.d.ts +8 -2
  257. package/dist/utils/date.js +63 -50
  258. package/dist/utils/image.js +8 -8
  259. package/dist/utils/intl.d.ts +1 -0
  260. package/dist/utils/intl.js +13 -0
  261. package/dist/utils/keys.js +3 -5
  262. package/dist/utils/monetary.d.ts +1 -0
  263. package/dist/utils/monetary.js +28 -24
  264. package/dist/utils/progress.js +2 -3
  265. package/dist/utils/quantity.js +25 -26
  266. package/dist/utils/reorder.js +11 -20
  267. package/dist/utils/search.d.ts +4 -0
  268. package/dist/utils/search.js +12 -0
  269. package/dist/utils/serializer.js +38 -38
  270. package/dist/utils/useReducedMotion.js +32 -30
  271. package/dist/views/AppSplashView.js +117 -3
  272. package/dist/views/AuthFormView.d.ts +4 -5
  273. package/dist/views/AuthFormView.js +119 -11
  274. package/dist/views/FormViewV2.context.js +75 -23
  275. package/dist/views/FormViewV2.d.ts +4 -5
  276. package/dist/views/FormViewV2.js +658 -92
  277. package/dist/views/ListViewV2.context.js +91 -47
  278. package/dist/views/ListViewV2.d.ts +84 -43
  279. package/dist/views/ListViewV2.js +1350 -200
  280. package/dist/views/Wizard/Wizard.context.js +248 -84
  281. package/dist/views/Wizard/Wizard.js +260 -67
  282. package/dist/views/types/IListView.js +34 -31
  283. package/dist/widgets/CollectionOptions.js +557 -138
  284. package/dist/widgets/FilterBar.js +159 -7
  285. package/dist/widgets/FilterBuilder.js +375 -102
  286. package/dist/widgets/JSONViewer.js +275 -129
  287. package/dist/widgets/PromoBanner.js +336 -42
  288. package/dist/widgets/PromoModal.d.ts +2 -2
  289. package/dist/widgets/PromoModal.js +389 -62
  290. package/dist/widgets/QueryChoice.js +150 -8
  291. package/dist/widgets/QuickActions.js +120 -31
  292. package/dist/widgets/ReorderableList.js +399 -128
  293. package/dist/widgets/TimeZoneSelectorModal.js +458 -51
  294. package/dist/widgets/index.js +3 -3
  295. package/package.json +7 -2
  296. package/tailwind.preset.js +7 -5
  297. package/dist/Form/Form.InputField.d.ts +0 -10
  298. package/dist/Form/Form.InputField.js +0 -38
  299. package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
  300. package/dist/Form/Form.KeyboardToolbar.js +0 -66
  301. package/dist/Form/Form.PasswordInput.d.ts +0 -9
  302. package/dist/Form/Form.PasswordInput.js +0 -17
  303. package/dist/Form/Form.TextInput.d.ts +0 -8
  304. package/dist/Form/Form.TextInput.js +0 -8
  305. package/dist/primitives/BaseButton.d.ts +0 -150
  306. package/dist/primitives/BaseButton.js +0 -229
  307. package/dist/utils/useSheetTranslation.d.ts +0 -5
  308. package/dist/utils/useSheetTranslation.js +0 -23
@@ -1,47 +1,205 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "../theme/tw.js";
3
3
  import { motion } from "../tokens/motion.js";
4
4
  import { normalizeProgress } from "../utils/progress.js";
5
5
  import { useReducedMotion } from "../utils/useReducedMotion.js";
6
- import { useEffect, useRef } from "react";
7
- import { Animated, Easing, View, } from "react-native";
8
- function Progress({ value = 0, indeterminate = false, height = 6, className, animated = true, indicatorClassName, indicatorStyle, style, ...props }) {
9
- const reducedMotion = useReducedMotion();
10
- const shouldAnimate = indeterminate && animated && !reducedMotion;
11
- const progress = indeterminate ? 0 : normalizeProgress(value);
12
- // eslint-disable-next-line react-hooks/refs
13
- const translate = useRef(new Animated.Value(0)).current;
14
- useEffect(() => {
15
- translate.setValue(0);
16
- if (!shouldAnimate)
17
- return;
18
- const loop = Animated.loop(Animated.timing(translate, {
19
- toValue: 1,
20
- duration: motion.duration.slower,
21
- easing: Easing.inOut(Easing.ease),
22
- useNativeDriver: true,
23
- isInteraction: false,
24
- }));
25
- loop.start();
26
- return () => loop.stop();
27
- }, [shouldAnimate, translate]);
28
- return (_jsx(View, { ...props, accessibilityRole: "progressbar", accessibilityState: { busy: indeterminate }, accessibilityValue: indeterminate ? undefined : { now: Math.round(progress * 100), min: 0, max: 100 }, accessible: true, className: cn("w-full overflow-hidden rounded-full bg-bg-muted", className), style: [{ height }, style], children: indeterminate ? (_jsx(Animated.View, { className: cn("h-full rounded-full bg-primary", indicatorClassName), style: [
29
- {
30
- width: "40%",
31
- marginLeft: shouldAnimate ? 0 : "30%",
32
- transform: shouldAnimate
33
- ? [
34
- {
35
- // eslint-disable-next-line react-hooks/refs
36
- translateX: translate.interpolate({
37
- inputRange: [0, 1],
38
- outputRange: ["-40%", "250%"],
39
- }),
40
- },
41
- ]
42
- : [],
43
- },
44
- indicatorStyle,
45
- ] })) : (_jsx(View, { className: cn("h-full rounded-full bg-primary", indicatorClassName), style: [{ width: `${progress * 100}%` }, indicatorStyle] })) }));
6
+ import { useEffect, useState } from "react";
7
+ import { Animated, Easing, View } from "react-native";
8
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
9
+ function Progress(t0) {
10
+ const $ = _c(43);
11
+ let className;
12
+ let indicatorClassName;
13
+ let indicatorStyle;
14
+ let props;
15
+ let style;
16
+ let t1;
17
+ let t2;
18
+ let t3;
19
+ let t4;
20
+ if ($[0] !== t0) {
21
+ ({
22
+ value: t1,
23
+ indeterminate: t2,
24
+ height: t3,
25
+ className,
26
+ animated: t4,
27
+ indicatorClassName,
28
+ indicatorStyle,
29
+ style,
30
+ ...props
31
+ } = t0);
32
+ $[0] = t0;
33
+ $[1] = className;
34
+ $[2] = indicatorClassName;
35
+ $[3] = indicatorStyle;
36
+ $[4] = props;
37
+ $[5] = style;
38
+ $[6] = t1;
39
+ $[7] = t2;
40
+ $[8] = t3;
41
+ $[9] = t4;
42
+ } else {
43
+ className = $[1];
44
+ indicatorClassName = $[2];
45
+ indicatorStyle = $[3];
46
+ props = $[4];
47
+ style = $[5];
48
+ t1 = $[6];
49
+ t2 = $[7];
50
+ t3 = $[8];
51
+ t4 = $[9];
52
+ }
53
+ const value = t1 === undefined ? 0 : t1;
54
+ const indeterminate = t2 === undefined ? false : t2;
55
+ const height = t3 === undefined ? 6 : t3;
56
+ const animated = t4 === undefined ? true : t4;
57
+ const reducedMotion = useReducedMotion();
58
+ const shouldAnimate = indeterminate && animated && !reducedMotion;
59
+ let t5;
60
+ if ($[10] !== indeterminate || $[11] !== value) {
61
+ t5 = indeterminate ? 0 : normalizeProgress(value);
62
+ $[10] = indeterminate;
63
+ $[11] = value;
64
+ $[12] = t5;
65
+ } else {
66
+ t5 = $[12];
67
+ }
68
+ const progress = t5;
69
+ const [translate] = useState(_temp);
70
+ let t6;
71
+ let t7;
72
+ if ($[13] !== shouldAnimate || $[14] !== translate) {
73
+ t6 = () => {
74
+ translate.setValue(0);
75
+ if (!shouldAnimate) {
76
+ return;
77
+ }
78
+ const loop = Animated.loop(Animated.timing(translate, {
79
+ toValue: 1,
80
+ duration: motion.duration.slower,
81
+ easing: Easing.inOut(Easing.ease),
82
+ useNativeDriver: true,
83
+ isInteraction: false
84
+ }));
85
+ loop.start();
86
+ return () => loop.stop();
87
+ };
88
+ t7 = [shouldAnimate, translate];
89
+ $[13] = shouldAnimate;
90
+ $[14] = translate;
91
+ $[15] = t6;
92
+ $[16] = t7;
93
+ } else {
94
+ t6 = $[15];
95
+ t7 = $[16];
96
+ }
97
+ useEffect(t6, t7);
98
+ let t8;
99
+ if ($[17] !== indeterminate) {
100
+ t8 = {
101
+ busy: indeterminate
102
+ };
103
+ $[17] = indeterminate;
104
+ $[18] = t8;
105
+ } else {
106
+ t8 = $[18];
107
+ }
108
+ let t9;
109
+ if ($[19] !== indeterminate || $[20] !== progress) {
110
+ t9 = indeterminate ? undefined : {
111
+ now: Math.round(progress * 100),
112
+ min: 0,
113
+ max: 100
114
+ };
115
+ $[19] = indeterminate;
116
+ $[20] = progress;
117
+ $[21] = t9;
118
+ } else {
119
+ t9 = $[21];
120
+ }
121
+ let t10;
122
+ if ($[22] !== className) {
123
+ t10 = cn("w-full overflow-hidden rounded-full bg-bg-muted", className);
124
+ $[22] = className;
125
+ $[23] = t10;
126
+ } else {
127
+ t10 = $[23];
128
+ }
129
+ let t11;
130
+ if ($[24] !== height) {
131
+ t11 = {
132
+ height
133
+ };
134
+ $[24] = height;
135
+ $[25] = t11;
136
+ } else {
137
+ t11 = $[25];
138
+ }
139
+ let t12;
140
+ if ($[26] !== style || $[27] !== t11) {
141
+ t12 = [t11, style];
142
+ $[26] = style;
143
+ $[27] = t11;
144
+ $[28] = t12;
145
+ } else {
146
+ t12 = $[28];
147
+ }
148
+ let t13;
149
+ if ($[29] !== indeterminate || $[30] !== indicatorClassName || $[31] !== indicatorStyle || $[32] !== progress || $[33] !== shouldAnimate || $[34] !== translate) {
150
+ t13 = indeterminate ? _jsx(Animated.View, {
151
+ className: cn("h-full rounded-full bg-primary", indicatorClassName),
152
+ style: [{
153
+ width: "40%",
154
+ marginLeft: shouldAnimate ? 0 : "30%",
155
+ transform: shouldAnimate ? [{
156
+ translateX: translate.interpolate({
157
+ inputRange: [0, 1],
158
+ outputRange: ["-40%", "250%"]
159
+ })
160
+ }] : []
161
+ }, indicatorStyle]
162
+ }) : _jsx(View, {
163
+ className: cn("h-full rounded-full bg-primary", indicatorClassName),
164
+ style: [{
165
+ width: `${progress * 100}%`
166
+ }, indicatorStyle]
167
+ });
168
+ $[29] = indeterminate;
169
+ $[30] = indicatorClassName;
170
+ $[31] = indicatorStyle;
171
+ $[32] = progress;
172
+ $[33] = shouldAnimate;
173
+ $[34] = translate;
174
+ $[35] = t13;
175
+ } else {
176
+ t13 = $[35];
177
+ }
178
+ let t14;
179
+ if ($[36] !== props || $[37] !== t10 || $[38] !== t12 || $[39] !== t13 || $[40] !== t8 || $[41] !== t9) {
180
+ t14 = _jsx(View, {
181
+ ...props,
182
+ accessibilityRole: "progressbar",
183
+ accessibilityState: t8,
184
+ accessibilityValue: t9,
185
+ accessible: true,
186
+ className: t10,
187
+ style: t12,
188
+ children: t13
189
+ });
190
+ $[36] = props;
191
+ $[37] = t10;
192
+ $[38] = t12;
193
+ $[39] = t13;
194
+ $[40] = t8;
195
+ $[41] = t9;
196
+ $[42] = t14;
197
+ } else {
198
+ t14 = $[42];
199
+ }
200
+ return t14;
201
+ }
202
+ function _temp() {
203
+ return new Animated.Value(0);
46
204
  }
47
205
  export default Progress;
@@ -1,18 +1,190 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { useTheme } from "../theme/index.js";
3
3
  import { normalizeProgress } from "../utils/progress.js";
4
4
  import { View } from "react-native";
5
5
  import Svg, { Circle } from "react-native-svg";
6
- function ProgressCircle({ value = 0, size = 64, strokeWidth = 6, color, trackColor, children, style, ...props }) {
7
- const theme = useTheme();
8
- const progress = normalizeProgress(value);
9
- const radius = (size - strokeWidth) / 2;
10
- const circumference = 2 * Math.PI * radius;
11
- const offset = circumference * (1 - progress);
12
- const center = size / 2;
13
- return (_jsxs(View, { ...props, accessibilityRole: "progressbar", accessibilityValue: { now: Math.round(progress * 100), min: 0, max: 100 }, accessible: true, style: [
14
- { width: size, height: size, alignItems: "center", justifyContent: "center" },
15
- style,
16
- ], children: [_jsxs(Svg, { height: size, style: { position: "absolute" }, width: size, children: [_jsx(Circle, { cx: center, cy: center, fill: "none", r: radius, stroke: trackColor ?? theme.bg.muted, strokeWidth: strokeWidth }), _jsx(Circle, { cx: center, cy: center, fill: "none", r: radius, stroke: color ?? theme.primary, strokeDasharray: `${circumference} ${circumference}`, strokeDashoffset: offset, strokeLinecap: "round", strokeWidth: strokeWidth, transform: `rotate(-90 ${center} ${center})` })] }), children] }));
6
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
7
+ function ProgressCircle(t0) {
8
+ const $ = _c(42);
9
+ let children;
10
+ let color;
11
+ let props;
12
+ let style;
13
+ let t1;
14
+ let t2;
15
+ let t3;
16
+ let trackColor;
17
+ if ($[0] !== t0) {
18
+ ({
19
+ value: t1,
20
+ size: t2,
21
+ strokeWidth: t3,
22
+ color,
23
+ trackColor,
24
+ children,
25
+ style,
26
+ ...props
27
+ } = t0);
28
+ $[0] = t0;
29
+ $[1] = children;
30
+ $[2] = color;
31
+ $[3] = props;
32
+ $[4] = style;
33
+ $[5] = t1;
34
+ $[6] = t2;
35
+ $[7] = t3;
36
+ $[8] = trackColor;
37
+ } else {
38
+ children = $[1];
39
+ color = $[2];
40
+ props = $[3];
41
+ style = $[4];
42
+ t1 = $[5];
43
+ t2 = $[6];
44
+ t3 = $[7];
45
+ trackColor = $[8];
46
+ }
47
+ const value = t1 === undefined ? 0 : t1;
48
+ const size = t2 === undefined ? 64 : t2;
49
+ const strokeWidth = t3 === undefined ? 6 : t3;
50
+ const theme = useTheme();
51
+ const progress = normalizeProgress(value);
52
+ const radius = (size - strokeWidth) / 2;
53
+ const circumference = 2 * Math.PI * radius;
54
+ const offset = circumference * (1 - progress);
55
+ const center = size / 2;
56
+ let t4;
57
+ if ($[9] !== progress) {
58
+ t4 = Math.round(progress * 100);
59
+ $[9] = progress;
60
+ $[10] = t4;
61
+ } else {
62
+ t4 = $[10];
63
+ }
64
+ let t5;
65
+ if ($[11] !== t4) {
66
+ t5 = {
67
+ now: t4,
68
+ min: 0,
69
+ max: 100
70
+ };
71
+ $[11] = t4;
72
+ $[12] = t5;
73
+ } else {
74
+ t5 = $[12];
75
+ }
76
+ let t6;
77
+ if ($[13] !== size) {
78
+ t6 = {
79
+ width: size,
80
+ height: size,
81
+ alignItems: "center",
82
+ justifyContent: "center"
83
+ };
84
+ $[13] = size;
85
+ $[14] = t6;
86
+ } else {
87
+ t6 = $[14];
88
+ }
89
+ let t7;
90
+ if ($[15] !== style || $[16] !== t6) {
91
+ t7 = [t6, style];
92
+ $[15] = style;
93
+ $[16] = t6;
94
+ $[17] = t7;
95
+ } else {
96
+ t7 = $[17];
97
+ }
98
+ let t8;
99
+ if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
100
+ t8 = {
101
+ position: "absolute"
102
+ };
103
+ $[18] = t8;
104
+ } else {
105
+ t8 = $[18];
106
+ }
107
+ const t9 = trackColor ?? theme.bg.muted;
108
+ let t10;
109
+ if ($[19] !== center || $[20] !== radius || $[21] !== strokeWidth || $[22] !== t9) {
110
+ t10 = _jsx(Circle, {
111
+ cx: center,
112
+ cy: center,
113
+ fill: "none",
114
+ r: radius,
115
+ stroke: t9,
116
+ strokeWidth: strokeWidth
117
+ });
118
+ $[19] = center;
119
+ $[20] = radius;
120
+ $[21] = strokeWidth;
121
+ $[22] = t9;
122
+ $[23] = t10;
123
+ } else {
124
+ t10 = $[23];
125
+ }
126
+ const t11 = color ?? theme.primary;
127
+ const t12 = `${circumference} ${circumference}`;
128
+ const t13 = `rotate(-90 ${center} ${center})`;
129
+ let t14;
130
+ if ($[24] !== center || $[25] !== offset || $[26] !== radius || $[27] !== strokeWidth || $[28] !== t11 || $[29] !== t12 || $[30] !== t13) {
131
+ t14 = _jsx(Circle, {
132
+ cx: center,
133
+ cy: center,
134
+ fill: "none",
135
+ r: radius,
136
+ stroke: t11,
137
+ strokeDasharray: t12,
138
+ strokeDashoffset: offset,
139
+ strokeLinecap: "round",
140
+ strokeWidth: strokeWidth,
141
+ transform: t13
142
+ });
143
+ $[24] = center;
144
+ $[25] = offset;
145
+ $[26] = radius;
146
+ $[27] = strokeWidth;
147
+ $[28] = t11;
148
+ $[29] = t12;
149
+ $[30] = t13;
150
+ $[31] = t14;
151
+ } else {
152
+ t14 = $[31];
153
+ }
154
+ let t15;
155
+ if ($[32] !== size || $[33] !== t10 || $[34] !== t14) {
156
+ t15 = _jsxs(Svg, {
157
+ height: size,
158
+ style: t8,
159
+ width: size,
160
+ children: [t10, t14]
161
+ });
162
+ $[32] = size;
163
+ $[33] = t10;
164
+ $[34] = t14;
165
+ $[35] = t15;
166
+ } else {
167
+ t15 = $[35];
168
+ }
169
+ let t16;
170
+ if ($[36] !== children || $[37] !== props || $[38] !== t15 || $[39] !== t5 || $[40] !== t7) {
171
+ t16 = _jsxs(View, {
172
+ ...props,
173
+ accessibilityRole: "progressbar",
174
+ accessibilityValue: t5,
175
+ accessible: true,
176
+ style: t7,
177
+ children: [t15, children]
178
+ });
179
+ $[36] = children;
180
+ $[37] = props;
181
+ $[38] = t15;
182
+ $[39] = t5;
183
+ $[40] = t7;
184
+ $[41] = t16;
185
+ } else {
186
+ t16 = $[41];
187
+ }
188
+ return t16;
17
189
  }
18
190
  export default ProgressCircle;
@@ -1,42 +1,155 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import { cn } from "../theme/tw.js";
3
3
  import { motion } from "../tokens/motion.js";
4
4
  import { useReducedMotion } from "../utils/useReducedMotion.js";
5
- import { useEffect, useRef } from "react";
5
+ import { useEffect, useState } from "react";
6
6
  import { Animated, Easing } from "react-native";
7
- function Skeleton({ width = "100%", height = 16, radius = 8, circle = false, className, style, animated = true, ...props }) {
8
- const reducedMotion = useReducedMotion();
9
- const shouldAnimate = animated && !reducedMotion;
10
- // eslint-disable-next-line react-hooks/refs
11
- const opacity = useRef(new Animated.Value(0.5)).current;
12
- useEffect(() => {
13
- opacity.setValue(0.5);
14
- if (!shouldAnimate)
15
- return;
16
- const pulse = Animated.loop(Animated.sequence([
17
- Animated.timing(opacity, {
18
- toValue: 1,
19
- duration: motion.duration.slow,
20
- easing: Easing.inOut(Easing.ease),
21
- useNativeDriver: true,
22
- isInteraction: false,
23
- }),
24
- Animated.timing(opacity, {
25
- toValue: 0.5,
26
- duration: motion.duration.slow,
27
- easing: Easing.inOut(Easing.ease),
28
- useNativeDriver: true,
29
- isInteraction: false,
30
- }),
31
- ]));
32
- pulse.start();
33
- return () => pulse.stop();
34
- }, [opacity, shouldAnimate]);
35
- const resolvedRadius = circle && typeof height === "number" ? height / 2 : radius;
36
- return (_jsx(Animated.View, { ...props, accessibilityElementsHidden: true, className: cn("bg-bg-muted", className), importantForAccessibility: "no-hide-descendants", style: [
37
- { width, height, borderRadius: resolvedRadius },
38
- style,
39
- { opacity: shouldAnimate ? opacity : 0.5 },
40
- ] }));
7
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
8
+ function Skeleton(t0) {
9
+ const $ = _c(29);
10
+ let className;
11
+ let props;
12
+ let style;
13
+ let t1;
14
+ let t2;
15
+ let t3;
16
+ let t4;
17
+ let t5;
18
+ if ($[0] !== t0) {
19
+ ({
20
+ width: t1,
21
+ height: t2,
22
+ radius: t3,
23
+ circle: t4,
24
+ className,
25
+ style,
26
+ animated: t5,
27
+ ...props
28
+ } = t0);
29
+ $[0] = t0;
30
+ $[1] = className;
31
+ $[2] = props;
32
+ $[3] = style;
33
+ $[4] = t1;
34
+ $[5] = t2;
35
+ $[6] = t3;
36
+ $[7] = t4;
37
+ $[8] = t5;
38
+ } else {
39
+ className = $[1];
40
+ props = $[2];
41
+ style = $[3];
42
+ t1 = $[4];
43
+ t2 = $[5];
44
+ t3 = $[6];
45
+ t4 = $[7];
46
+ t5 = $[8];
47
+ }
48
+ const width = t1 === undefined ? "100%" : t1;
49
+ const height = t2 === undefined ? 16 : t2;
50
+ const radius = t3 === undefined ? 8 : t3;
51
+ const circle = t4 === undefined ? false : t4;
52
+ const animated = t5 === undefined ? true : t5;
53
+ const reducedMotion = useReducedMotion();
54
+ const shouldAnimate = animated && !reducedMotion;
55
+ const [opacity] = useState(_temp);
56
+ let t6;
57
+ let t7;
58
+ if ($[9] !== opacity || $[10] !== shouldAnimate) {
59
+ t6 = () => {
60
+ opacity.setValue(0.5);
61
+ if (!shouldAnimate) {
62
+ return;
63
+ }
64
+ const pulse = Animated.loop(Animated.sequence([Animated.timing(opacity, {
65
+ toValue: 1,
66
+ duration: motion.duration.slow,
67
+ easing: Easing.inOut(Easing.ease),
68
+ useNativeDriver: true,
69
+ isInteraction: false
70
+ }), Animated.timing(opacity, {
71
+ toValue: 0.5,
72
+ duration: motion.duration.slow,
73
+ easing: Easing.inOut(Easing.ease),
74
+ useNativeDriver: true,
75
+ isInteraction: false
76
+ })]));
77
+ pulse.start();
78
+ return () => pulse.stop();
79
+ };
80
+ t7 = [opacity, shouldAnimate];
81
+ $[9] = opacity;
82
+ $[10] = shouldAnimate;
83
+ $[11] = t6;
84
+ $[12] = t7;
85
+ } else {
86
+ t6 = $[11];
87
+ t7 = $[12];
88
+ }
89
+ useEffect(t6, t7);
90
+ const resolvedRadius = circle && typeof height === "number" ? height / 2 : radius;
91
+ let t8;
92
+ if ($[13] !== className) {
93
+ t8 = cn("bg-bg-muted", className);
94
+ $[13] = className;
95
+ $[14] = t8;
96
+ } else {
97
+ t8 = $[14];
98
+ }
99
+ let t9;
100
+ if ($[15] !== height || $[16] !== resolvedRadius || $[17] !== width) {
101
+ t9 = {
102
+ width,
103
+ height,
104
+ borderRadius: resolvedRadius
105
+ };
106
+ $[15] = height;
107
+ $[16] = resolvedRadius;
108
+ $[17] = width;
109
+ $[18] = t9;
110
+ } else {
111
+ t9 = $[18];
112
+ }
113
+ const t10 = shouldAnimate ? opacity : 0.5;
114
+ let t11;
115
+ if ($[19] !== t10) {
116
+ t11 = {
117
+ opacity: t10
118
+ };
119
+ $[19] = t10;
120
+ $[20] = t11;
121
+ } else {
122
+ t11 = $[20];
123
+ }
124
+ let t12;
125
+ if ($[21] !== style || $[22] !== t11 || $[23] !== t9) {
126
+ t12 = [t9, style, t11];
127
+ $[21] = style;
128
+ $[22] = t11;
129
+ $[23] = t9;
130
+ $[24] = t12;
131
+ } else {
132
+ t12 = $[24];
133
+ }
134
+ let t13;
135
+ if ($[25] !== props || $[26] !== t12 || $[27] !== t8) {
136
+ t13 = _jsx(Animated.View, {
137
+ ...props,
138
+ accessibilityElementsHidden: true,
139
+ className: t8,
140
+ importantForAccessibility: "no-hide-descendants",
141
+ style: t12
142
+ });
143
+ $[25] = props;
144
+ $[26] = t12;
145
+ $[27] = t8;
146
+ $[28] = t13;
147
+ } else {
148
+ t13 = $[28];
149
+ }
150
+ return t13;
151
+ }
152
+ function _temp() {
153
+ return new Animated.Value(0.5);
41
154
  }
42
155
  export default Skeleton;