@sincpro/mobile-ui 3.0.1 → 3.2.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 (314) 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 +437 -62
  15. package/dist/Dialog/Dialog.Sheet.d.ts +7 -3
  16. package/dist/Dialog/Dialog.Sheet.js +267 -15
  17. package/dist/Dialog/OverlayHost.d.ts +24 -0
  18. package/dist/Dialog/OverlayHost.js +230 -0
  19. package/dist/Dialog/SheetSurface.d.ts +43 -0
  20. package/dist/Dialog/SheetSurface.js +495 -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 +148 -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 +15 -11
  98. package/dist/Display/icon-map.js +344 -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 +507 -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 +497 -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 +223 -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 +539 -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.d.ts +1 -0
  154. package/dist/Form/Form.RadioButton.js +26 -29
  155. package/dist/Form/Form.Select.d.ts +2 -1
  156. package/dist/Form/Form.Select.js +388 -60
  157. package/dist/Form/Form.Slider.js +133 -10
  158. package/dist/Form/Form.Switch.js +99 -4
  159. package/dist/Form/choice-row.d.ts +15 -0
  160. package/dist/Form/choice-row.js +236 -0
  161. package/dist/Form/index.d.ts +11 -6
  162. package/dist/Form/index.js +26 -27
  163. package/dist/Form/input-text.d.ts +7 -0
  164. package/dist/Form/input-text.js +18 -0
  165. package/dist/Navigation/Navigation.AppBar.d.ts +3 -4
  166. package/dist/Navigation/Navigation.AppBar.js +535 -99
  167. package/dist/Navigation/Navigation.BottomNav.js +363 -98
  168. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +28 -13
  169. package/dist/Navigation/Navigation.CollapsingHeader.js +369 -36
  170. package/dist/Navigation/Navigation.FloatingBar.js +71 -11
  171. package/dist/Navigation/Navigation.Menu.js +309 -95
  172. package/dist/Navigation/Navigation.MenuSection.js +80 -11
  173. package/dist/Navigation/Navigation.RowItem.d.ts +4 -2
  174. package/dist/Navigation/Navigation.RowItem.js +93 -8
  175. package/dist/Navigation/Navigation.Search.js +241 -27
  176. package/dist/Navigation/Navigation.SearchBar.d.ts +7 -1
  177. package/dist/Navigation/Navigation.SearchBar.js +218 -29
  178. package/dist/Navigation/Navigation.SearchSuggestions.js +77 -3
  179. package/dist/Navigation/Navigation.SegmentedControl.js +152 -14
  180. package/dist/Navigation/Navigation.Steps.js +105 -11
  181. package/dist/Navigation/Navigation.Tabs.js +449 -41
  182. package/dist/Navigation/index.d.ts +9 -4
  183. package/dist/Navigation/index.js +13 -13
  184. package/dist/Typography/Typography.Heading.js +33 -3
  185. package/dist/Typography/Typography.SelectableText.js +95 -7
  186. package/dist/Typography/Typography.Text.d.ts +4 -2
  187. package/dist/Typography/Typography.Text.js +217 -7
  188. package/dist/Typography/index.js +3 -3
  189. package/dist/branding.js +29 -13
  190. package/dist/icons/AddItemIcon.js +76 -2
  191. package/dist/icons/ArrangeCircle.js +82 -2
  192. package/dist/icons/ArrowDownIcon.js +63 -3
  193. package/dist/icons/ArrowUpIcon.js +63 -3
  194. package/dist/icons/BoxIcon.js +64 -2
  195. package/dist/icons/BoxTimeIcon.js +63 -2
  196. package/dist/icons/CalendarIcon.js +145 -2
  197. package/dist/icons/CardIcon.js +80 -2
  198. package/dist/icons/CashierIcon.js +39 -2
  199. package/dist/icons/CreditIcon.js +76 -3
  200. package/dist/icons/DuoIcon.js +75 -2
  201. package/dist/icons/HomeIcon.js +39 -2
  202. package/dist/icons/HomeIconOutlined.js +53 -2
  203. package/dist/icons/LogoIcon.js +87 -2
  204. package/dist/icons/MoneyReceiveIcon.js +86 -2
  205. package/dist/icons/PinIcon.js +39 -2
  206. package/dist/icons/ProfileIcon.js +47 -2
  207. package/dist/icons/SettingsIcon.js +114 -2
  208. package/dist/icons/SinpeIcon.js +60 -2
  209. package/dist/icons/ToggleOffIcon.js +53 -2
  210. package/dist/icons/WalletMoneyIcon.js +81 -2
  211. package/dist/index.d.ts +1 -0
  212. package/dist/index.js +8 -2
  213. package/dist/layouts/AuthContainer.d.ts +4 -5
  214. package/dist/layouts/AuthContainer.js +231 -7
  215. package/dist/layouts/BottomInset.js +4 -1
  216. package/dist/layouts/Container.d.ts +2 -2
  217. package/dist/layouts/Container.js +45 -3
  218. package/dist/layouts/GradientContainer.js +37 -5
  219. package/dist/layouts/PlainLayout.js +19 -3
  220. package/dist/layouts/ScrollContainer.d.ts +14 -9
  221. package/dist/layouts/ScrollContainer.js +125 -4
  222. package/dist/layouts/edges.d.ts +2 -0
  223. package/dist/layouts/edges.js +1 -0
  224. package/dist/primitives/AspectRatio.js +75 -3
  225. package/dist/primitives/Box.js +45 -3
  226. package/dist/primitives/Pressable.js +95 -5
  227. package/dist/primitives/Row.js +84 -13
  228. package/dist/primitives/Spacer.js +42 -5
  229. package/dist/primitives/Stack.js +66 -7
  230. package/dist/primitives/index.js +1 -1
  231. package/dist/theme/active.d.ts +2 -0
  232. package/dist/theme/active.js +33 -18
  233. package/dist/theme/build.js +118 -87
  234. package/dist/theme/color.js +87 -87
  235. package/dist/theme/components/ThemedActivityIndicator.d.ts +2 -15
  236. package/dist/theme/components/ThemedActivityIndicator.js +35 -3
  237. package/dist/theme/components/index.js +1 -0
  238. package/dist/theme/contrast.js +32 -33
  239. package/dist/theme/css-vars.js +71 -75
  240. package/dist/theme/dark.js +116 -97
  241. package/dist/theme/default.js +116 -97
  242. package/dist/theme/define.js +16 -12
  243. package/dist/theme/index.d.ts +1 -0
  244. package/dist/theme/index.js +7 -6
  245. package/dist/theme/on-dark-surface.d.ts +12 -0
  246. package/dist/theme/on-dark-surface.js +13 -0
  247. package/dist/theme/theme.js +1 -0
  248. package/dist/theme/tw.js +3 -1
  249. package/dist/theme/types.js +0 -18
  250. package/dist/theme/typography.d.ts +1 -1
  251. package/dist/theme/typography.js +337 -303
  252. package/dist/theme/useTheme.d.ts +4 -0
  253. package/dist/theme/useTheme.js +7 -3
  254. package/dist/theme/useThemeVars.d.ts +9 -0
  255. package/dist/theme/useThemeVars.js +23 -0
  256. package/dist/theme/validate.js +175 -166
  257. package/dist/tokens/index.js +1 -1
  258. package/dist/tokens/motion.js +30 -13
  259. package/dist/utils/async.d.ts +14 -0
  260. package/dist/utils/async.js +22 -0
  261. package/dist/utils/criteria.js +66 -85
  262. package/dist/utils/date.d.ts +8 -2
  263. package/dist/utils/date.js +63 -50
  264. package/dist/utils/image.js +8 -8
  265. package/dist/utils/intl.d.ts +1 -0
  266. package/dist/utils/intl.js +13 -0
  267. package/dist/utils/keys.js +3 -5
  268. package/dist/utils/monetary.d.ts +1 -0
  269. package/dist/utils/monetary.js +28 -24
  270. package/dist/utils/progress.js +2 -3
  271. package/dist/utils/quantity.js +25 -26
  272. package/dist/utils/reorder.js +11 -20
  273. package/dist/utils/search.d.ts +4 -0
  274. package/dist/utils/search.js +12 -0
  275. package/dist/utils/serializer.js +38 -38
  276. package/dist/utils/useReducedMotion.js +32 -30
  277. package/dist/views/AppSplashView.js +117 -3
  278. package/dist/views/AuthFormView.d.ts +4 -5
  279. package/dist/views/AuthFormView.js +119 -11
  280. package/dist/views/FormViewV2.context.js +75 -23
  281. package/dist/views/FormViewV2.d.ts +4 -5
  282. package/dist/views/FormViewV2.js +658 -92
  283. package/dist/views/ListViewV2.context.js +91 -47
  284. package/dist/views/ListViewV2.d.ts +84 -43
  285. package/dist/views/ListViewV2.js +1350 -200
  286. package/dist/views/Wizard/Wizard.context.js +248 -84
  287. package/dist/views/Wizard/Wizard.js +260 -67
  288. package/dist/views/types/IListView.js +34 -31
  289. package/dist/widgets/CollectionOptions.js +557 -138
  290. package/dist/widgets/FilterBar.js +159 -7
  291. package/dist/widgets/FilterBuilder.js +375 -102
  292. package/dist/widgets/JSONViewer.js +275 -129
  293. package/dist/widgets/PromoBanner.js +336 -42
  294. package/dist/widgets/PromoModal.d.ts +2 -2
  295. package/dist/widgets/PromoModal.js +389 -62
  296. package/dist/widgets/QueryChoice.js +150 -8
  297. package/dist/widgets/QuickActions.js +120 -31
  298. package/dist/widgets/ReorderableList.js +399 -128
  299. package/dist/widgets/TimeZoneSelectorModal.js +458 -51
  300. package/dist/widgets/index.js +3 -3
  301. package/package.json +6 -1
  302. package/tailwind.preset.js +7 -5
  303. package/dist/Form/Form.InputField.d.ts +0 -10
  304. package/dist/Form/Form.InputField.js +0 -38
  305. package/dist/Form/Form.KeyboardToolbar.d.ts +0 -22
  306. package/dist/Form/Form.KeyboardToolbar.js +0 -66
  307. package/dist/Form/Form.PasswordInput.d.ts +0 -9
  308. package/dist/Form/Form.PasswordInput.js +0 -17
  309. package/dist/Form/Form.TextInput.d.ts +0 -8
  310. package/dist/Form/Form.TextInput.js +0 -8
  311. package/dist/primitives/BaseButton.d.ts +0 -150
  312. package/dist/primitives/BaseButton.js +0 -229
  313. package/dist/utils/useSheetTranslation.d.ts +0 -5
  314. package/dist/utils/useSheetTranslation.js +0 -23
@@ -1,43 +1,273 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import Icon from "../Display/Display.Icon.js";
3
3
  import Pressable from "../primitives/Pressable.js";
4
4
  import { useTheme } from "../theme/index.js";
5
5
  import { cn, tv } from "../theme/tw.js";
6
6
  import { Typography } from "../Typography/index.js";
7
- import { ScrollView, TouchableOpacity, View } from "react-native";
8
- const filterButton = tv({
9
- base: "rounded-lg items-center justify-center py-2 px-3 min-h-[36px]",
10
- variants: {
11
- active: {
12
- true: "bg-primary border-0",
13
- false: "bg-transparent border border-brand-primary",
14
- },
15
- },
16
- defaultVariants: { active: false },
17
- });
18
- const filterText = tv({
19
- base: "font-bold",
20
- variants: {
21
- active: {
22
- true: "text-white",
23
- false: "text-text-accent",
24
- },
25
- },
26
- defaultVariants: { active: false },
7
+ import { ScrollView, View } from "react-native";
8
+
9
+ // The one filter chip of the DS: list headers, search, filter bars and the
10
+ // trigger of a filter sheet all render this shape.
11
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
12
+ const filterChip = tv({
13
+ base: "flex-row items-center self-start gap-1.5 py-1.5 px-3.5 rounded-full",
14
+ variants: {
15
+ active: {
16
+ true: "bg-primary",
17
+ false: "bg-bg-muted"
18
+ }
19
+ },
20
+ defaultVariants: {
21
+ active: false
22
+ }
27
23
  });
28
- export const FilterButton = ({ title, active, onPress, variant = "default", disabled = false, className, testID, }) => {
29
- const theme = useTheme();
30
- if (variant === "mobile") {
31
- return (_jsxs(Pressable, { accessibilityLabel: title, accessibilityRole: "button", accessibilityState: { selected: active, disabled }, activeOpacity: 1 - theme.state.press, className: cn("flex-row items-center self-start rounded-full px-3 py-2 gap-2 max-w-full", active ? "bg-container-primary" : "bg-bg-muted", className), disabled: disabled, onPress: onPress, style: {
32
- minHeight: 48,
33
- minWidth: 48,
34
- }, testID: testID, children: [active ? (_jsx(View, { accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: _jsx(Icon, { color: theme.container.onPrimary, name: "check", size: 18 }) })) : null, _jsx(Typography.Text, { className: cn("flex-shrink", active ? "text-container-on-primary" : "text-text-primary"), variant: "bodyLarge", children: title })] }));
24
+ const filterChipText = tv({
25
+ variants: {
26
+ active: {
27
+ true: "text-text-on-primary",
28
+ false: "text-text-secondary"
35
29
  }
36
- return (_jsx(TouchableOpacity, { accessibilityLabel: title, accessibilityRole: "button", accessibilityState: { selected: active, disabled }, activeOpacity: 0.8, className: filterButton({ active, className }), disabled: disabled, onPress: onPress, testID: testID, children: _jsx(Typography.Text, { className: filterText({ active }), variant: "buttonSmall", children: title }) }));
30
+ },
31
+ defaultVariants: {
32
+ active: false
33
+ }
34
+ });
35
+
36
+ /** The chip stays compact; the touch target grows to 48 points vertically. */
37
+ const TOUCH_SLOP = {
38
+ top: 8,
39
+ bottom: 8,
40
+ left: 4,
41
+ right: 4
37
42
  };
38
- export function FilterButtonGroup({ children, layout = "row", className, testID, }) {
39
- if (layout === "scroll") {
40
- return (_jsx(ScrollView, { className: cn("py-1", className), contentContainerStyle: { gap: 8 }, horizontal: true, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, testID: testID, children: children }));
43
+ export function FilterChip(t0) {
44
+ const $ = _c(27);
45
+ const {
46
+ label,
47
+ active: t1,
48
+ onPress,
49
+ icon,
50
+ count,
51
+ disabled: t2,
52
+ accessibilityLabel,
53
+ className,
54
+ testID
55
+ } = t0;
56
+ const active = t1 === undefined ? false : t1;
57
+ const disabled = t2 === undefined ? false : t2;
58
+ const theme = useTheme();
59
+ const tint = active ? theme.text.onPrimary : theme.text.secondary;
60
+ let t3;
61
+ if ($[0] !== active) {
62
+ t3 = filterChipText({
63
+ active
64
+ });
65
+ $[0] = active;
66
+ $[1] = t3;
67
+ } else {
68
+ t3 = $[1];
69
+ }
70
+ const textClass = t3;
71
+ const t4 = accessibilityLabel ?? label;
72
+ let t5;
73
+ if ($[2] !== active || $[3] !== disabled) {
74
+ t5 = {
75
+ selected: active,
76
+ disabled
77
+ };
78
+ $[2] = active;
79
+ $[3] = disabled;
80
+ $[4] = t5;
81
+ } else {
82
+ t5 = $[4];
83
+ }
84
+ let t6;
85
+ if ($[5] !== active || $[6] !== className) {
86
+ t6 = filterChip({
87
+ active,
88
+ className
89
+ });
90
+ $[5] = active;
91
+ $[6] = className;
92
+ $[7] = t6;
93
+ } else {
94
+ t6 = $[7];
95
+ }
96
+ let t7;
97
+ if ($[8] !== icon || $[9] !== tint) {
98
+ t7 = icon ? _jsx(View, {
99
+ accessibilityElementsHidden: true,
100
+ importantForAccessibility: "no-hide-descendants",
101
+ children: _jsx(Icon, {
102
+ color: tint,
103
+ name: icon,
104
+ size: 16
105
+ })
106
+ }) : null;
107
+ $[8] = icon;
108
+ $[9] = tint;
109
+ $[10] = t7;
110
+ } else {
111
+ t7 = $[10];
112
+ }
113
+ let t8;
114
+ if ($[11] !== label || $[12] !== textClass) {
115
+ t8 = _jsx(Typography.Text, {
116
+ className: textClass,
117
+ variant: "bodySmall",
118
+ children: label
119
+ });
120
+ $[11] = label;
121
+ $[12] = textClass;
122
+ $[13] = t8;
123
+ } else {
124
+ t8 = $[13];
125
+ }
126
+ let t9;
127
+ if ($[14] !== count || $[15] !== textClass) {
128
+ t9 = count ? _jsx(Typography.Text, {
129
+ className: textClass,
130
+ variant: "bodySmall",
131
+ children: count
132
+ }) : null;
133
+ $[14] = count;
134
+ $[15] = textClass;
135
+ $[16] = t9;
136
+ } else {
137
+ t9 = $[16];
138
+ }
139
+ let t10;
140
+ if ($[17] !== disabled || $[18] !== onPress || $[19] !== t4 || $[20] !== t5 || $[21] !== t6 || $[22] !== t7 || $[23] !== t8 || $[24] !== t9 || $[25] !== testID) {
141
+ t10 = _jsxs(Pressable, {
142
+ accessibilityLabel: t4,
143
+ accessibilityRole: "button",
144
+ accessibilityState: t5,
145
+ className: t6,
146
+ disabled: disabled,
147
+ hitSlop: TOUCH_SLOP,
148
+ onPress: onPress,
149
+ testID: testID,
150
+ children: [t7, t8, t9]
151
+ });
152
+ $[17] = disabled;
153
+ $[18] = onPress;
154
+ $[19] = t4;
155
+ $[20] = t5;
156
+ $[21] = t6;
157
+ $[22] = t7;
158
+ $[23] = t8;
159
+ $[24] = t9;
160
+ $[25] = testID;
161
+ $[26] = t10;
162
+ } else {
163
+ t10 = $[26];
164
+ }
165
+ return t10;
166
+ }
167
+ /** A filter toggle. Same chip as `ListViewV2.Header.Filters.Chip` and `Search.Filters`. */
168
+ export const FilterButton = t0 => {
169
+ const $ = _c(7);
170
+ const {
171
+ title,
172
+ active,
173
+ onPress,
174
+ disabled: t1,
175
+ className,
176
+ testID
177
+ } = t0;
178
+ const disabled = t1 === undefined ? false : t1;
179
+ let t2;
180
+ if ($[0] !== active || $[1] !== className || $[2] !== disabled || $[3] !== onPress || $[4] !== testID || $[5] !== title) {
181
+ t2 = _jsx(FilterChip, {
182
+ active: active,
183
+ className: className,
184
+ disabled: disabled,
185
+ label: title,
186
+ onPress: onPress,
187
+ testID: testID
188
+ });
189
+ $[0] = active;
190
+ $[1] = className;
191
+ $[2] = disabled;
192
+ $[3] = onPress;
193
+ $[4] = testID;
194
+ $[5] = title;
195
+ $[6] = t2;
196
+ } else {
197
+ t2 = $[6];
198
+ }
199
+ return t2;
200
+ };
201
+ export function FilterButtonGroup(t0) {
202
+ const $ = _c(14);
203
+ const {
204
+ children,
205
+ layout: t1,
206
+ className,
207
+ testID
208
+ } = t0;
209
+ const layout = t1 === undefined ? "row" : t1;
210
+ if (layout === "scroll") {
211
+ let t2;
212
+ if ($[0] !== className) {
213
+ t2 = cn("py-1", className);
214
+ $[0] = className;
215
+ $[1] = t2;
216
+ } else {
217
+ t2 = $[1];
218
+ }
219
+ let t3;
220
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
221
+ t3 = {
222
+ gap: 8
223
+ };
224
+ $[2] = t3;
225
+ } else {
226
+ t3 = $[2];
227
+ }
228
+ let t4;
229
+ if ($[3] !== children || $[4] !== t2 || $[5] !== testID) {
230
+ t4 = _jsx(ScrollView, {
231
+ className: t2,
232
+ contentContainerStyle: t3,
233
+ horizontal: true,
234
+ keyboardShouldPersistTaps: "handled",
235
+ showsHorizontalScrollIndicator: false,
236
+ testID: testID,
237
+ children: children
238
+ });
239
+ $[3] = children;
240
+ $[4] = t2;
241
+ $[5] = testID;
242
+ $[6] = t4;
243
+ } else {
244
+ t4 = $[6];
41
245
  }
42
- return (_jsx(View, { className: cn("flex-row gap-2 p-3", layout === "wrap" && "flex-wrap", className), testID: testID, children: children }));
246
+ return t4;
247
+ }
248
+ const t2 = layout === "wrap" && "flex-wrap";
249
+ let t3;
250
+ if ($[7] !== className || $[8] !== t2) {
251
+ t3 = cn("flex-row gap-2 p-3", t2, className);
252
+ $[7] = className;
253
+ $[8] = t2;
254
+ $[9] = t3;
255
+ } else {
256
+ t3 = $[9];
257
+ }
258
+ let t4;
259
+ if ($[10] !== children || $[11] !== t3 || $[12] !== testID) {
260
+ t4 = _jsx(View, {
261
+ className: t3,
262
+ testID: testID,
263
+ children: children
264
+ });
265
+ $[10] = children;
266
+ $[11] = t3;
267
+ $[12] = testID;
268
+ $[13] = t4;
269
+ } else {
270
+ t4 = $[13];
271
+ }
272
+ return t4;
43
273
  }
@@ -60,6 +60,7 @@ export interface IconButtonProps extends VariantProps<typeof iconButton>, Access
60
60
  icon: IconName;
61
61
  onPress: () => void;
62
62
  loading?: boolean;
63
+ /** Overrides the ink of the variant, e.g. an inverse icon over a brand header. */
63
64
  iconColor?: string;
64
65
  className?: string;
65
66
  testID?: string;
@@ -1,42 +1,205 @@
1
- import { jsx as _jsx } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import Icon from "../Display/Display.Icon.js";
3
- import { theme } from "../theme/index.js";
3
+ import { useTheme } from "../theme/index.js";
4
4
  import { tv } from "../theme/tw.js";
5
5
  import { ActivityIndicator, TouchableOpacity } from "react-native";
6
+ import { jsx as _jsx } from "nativewind/jsx-runtime";
6
7
  const iconButton = tv({
7
- base: "rounded-lg items-center justify-center",
8
- variants: {
9
- variant: {
10
- primary: "bg-primary",
11
- secondary: "bg-bg-card border border-primary",
12
- tertiary: "bg-accent",
13
- ghost: "bg-transparent",
14
- },
15
- size: {
16
- small: "w-8 h-8",
17
- medium: "w-10 h-10",
18
- large: "w-12 h-12",
19
- },
20
- rounded: {
21
- true: "rounded-full",
22
- },
23
- disabled: {
24
- true: "opacity-50",
25
- },
8
+ base: "rounded-lg items-center justify-center",
9
+ variants: {
10
+ variant: {
11
+ primary: "bg-primary",
12
+ secondary: "bg-bg-card border border-primary",
13
+ tertiary: "bg-accent",
14
+ ghost: "bg-transparent"
26
15
  },
27
- defaultVariants: {
28
- variant: "ghost",
29
- size: "medium",
30
- rounded: false,
31
- disabled: false,
16
+ size: {
17
+ small: "w-8 h-8",
18
+ medium: "w-10 h-10",
19
+ large: "w-12 h-12"
32
20
  },
21
+ rounded: {
22
+ true: "rounded-full"
23
+ },
24
+ disabled: {
25
+ true: "opacity-50"
26
+ }
27
+ },
28
+ defaultVariants: {
29
+ variant: "ghost",
30
+ size: "medium",
31
+ rounded: false,
32
+ disabled: false
33
+ }
33
34
  });
34
- function IconButton({ icon, onPress, variant = "ghost", size = "medium", loading = false, disabled = false, rounded = false, iconColor, className, testID, accessibilityState, ...accessibilityProps }) {
35
- const resolvedColor = iconColor ?? theme.text.accent;
36
- return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: iconButton({ variant, size, rounded, disabled, className }), disabled: disabled || loading, onPress: onPress, ...accessibilityProps, accessibilityRole: "button", accessibilityState: {
37
- ...accessibilityState,
38
- disabled: disabled || loading,
39
- busy: loading,
40
- }, style: { minHeight: 48, minWidth: 48 }, testID: testID, children: loading ? (_jsx(ActivityIndicator, { color: resolvedColor, size: "small" })) : (_jsx(Icon, { color: resolvedColor, name: icon, size: 24 })) }));
35
+ /** The visible button keeps its size; the touch target always reaches 48 points. */
36
+ const TOUCH_SLOP = {
37
+ small: 8,
38
+ medium: 4,
39
+ large: 0
40
+ };
41
+ function useIconColor(variant) {
42
+ const $ = _c(4);
43
+ const theme = useTheme();
44
+ let t0;
45
+ if ($[0] !== theme.text.accent || $[1] !== theme.text.onAccent || $[2] !== theme.text.onPrimary) {
46
+ t0 = {
47
+ primary: theme.text.onPrimary,
48
+ secondary: theme.text.accent,
49
+ tertiary: theme.text.onAccent,
50
+ ghost: theme.text.accent
51
+ };
52
+ $[0] = theme.text.accent;
53
+ $[1] = theme.text.onAccent;
54
+ $[2] = theme.text.onPrimary;
55
+ $[3] = t0;
56
+ } else {
57
+ t0 = $[3];
58
+ }
59
+ const colors = t0;
60
+ return colors[variant];
61
+ }
62
+ function IconButton(t0) {
63
+ const $ = _c(36);
64
+ let accessibilityProps;
65
+ let accessibilityState;
66
+ let className;
67
+ let icon;
68
+ let iconColor;
69
+ let onPress;
70
+ let t1;
71
+ let t2;
72
+ let t3;
73
+ let t4;
74
+ let t5;
75
+ let testID;
76
+ if ($[0] !== t0) {
77
+ ({
78
+ icon,
79
+ onPress,
80
+ variant: t1,
81
+ size: t2,
82
+ loading: t3,
83
+ disabled: t4,
84
+ rounded: t5,
85
+ iconColor,
86
+ className,
87
+ testID,
88
+ accessibilityState,
89
+ ...accessibilityProps
90
+ } = t0);
91
+ $[0] = t0;
92
+ $[1] = accessibilityProps;
93
+ $[2] = accessibilityState;
94
+ $[3] = className;
95
+ $[4] = icon;
96
+ $[5] = iconColor;
97
+ $[6] = onPress;
98
+ $[7] = t1;
99
+ $[8] = t2;
100
+ $[9] = t3;
101
+ $[10] = t4;
102
+ $[11] = t5;
103
+ $[12] = testID;
104
+ } else {
105
+ accessibilityProps = $[1];
106
+ accessibilityState = $[2];
107
+ className = $[3];
108
+ icon = $[4];
109
+ iconColor = $[5];
110
+ onPress = $[6];
111
+ t1 = $[7];
112
+ t2 = $[8];
113
+ t3 = $[9];
114
+ t4 = $[10];
115
+ t5 = $[11];
116
+ testID = $[12];
117
+ }
118
+ const variant = t1 === undefined ? "ghost" : t1;
119
+ const size = t2 === undefined ? "medium" : t2;
120
+ const loading = t3 === undefined ? false : t3;
121
+ const disabled = t4 === undefined ? false : t4;
122
+ const rounded = t5 === undefined ? false : t5;
123
+ const variantColor = useIconColor(variant ?? "ghost");
124
+ const resolvedColor = iconColor ?? variantColor;
125
+ let t6;
126
+ if ($[13] !== className || $[14] !== disabled || $[15] !== rounded || $[16] !== size || $[17] !== variant) {
127
+ t6 = iconButton({
128
+ variant,
129
+ size,
130
+ rounded,
131
+ disabled,
132
+ className
133
+ });
134
+ $[13] = className;
135
+ $[14] = disabled;
136
+ $[15] = rounded;
137
+ $[16] = size;
138
+ $[17] = variant;
139
+ $[18] = t6;
140
+ } else {
141
+ t6 = $[18];
142
+ }
143
+ const t7 = disabled || loading;
144
+ const t8 = TOUCH_SLOP[size ?? "medium"];
145
+ const t9 = disabled || loading;
146
+ let t10;
147
+ if ($[19] !== accessibilityState || $[20] !== loading || $[21] !== t9) {
148
+ t10 = {
149
+ ...accessibilityState,
150
+ disabled: t9,
151
+ busy: loading
152
+ };
153
+ $[19] = accessibilityState;
154
+ $[20] = loading;
155
+ $[21] = t9;
156
+ $[22] = t10;
157
+ } else {
158
+ t10 = $[22];
159
+ }
160
+ let t11;
161
+ if ($[23] !== icon || $[24] !== loading || $[25] !== resolvedColor) {
162
+ t11 = loading ? _jsx(ActivityIndicator, {
163
+ color: resolvedColor,
164
+ size: "small"
165
+ }) : _jsx(Icon, {
166
+ color: resolvedColor,
167
+ name: icon,
168
+ size: 24
169
+ });
170
+ $[23] = icon;
171
+ $[24] = loading;
172
+ $[25] = resolvedColor;
173
+ $[26] = t11;
174
+ } else {
175
+ t11 = $[26];
176
+ }
177
+ let t12;
178
+ if ($[27] !== accessibilityProps || $[28] !== onPress || $[29] !== t10 || $[30] !== t11 || $[31] !== t6 || $[32] !== t7 || $[33] !== t8 || $[34] !== testID) {
179
+ t12 = _jsx(TouchableOpacity, {
180
+ activeOpacity: 0.7,
181
+ className: t6,
182
+ disabled: t7,
183
+ hitSlop: t8,
184
+ onPress: onPress,
185
+ ...accessibilityProps,
186
+ accessibilityRole: "button",
187
+ accessibilityState: t10,
188
+ testID: testID,
189
+ children: t11
190
+ });
191
+ $[27] = accessibilityProps;
192
+ $[28] = onPress;
193
+ $[29] = t10;
194
+ $[30] = t11;
195
+ $[31] = t6;
196
+ $[32] = t7;
197
+ $[33] = t8;
198
+ $[34] = testID;
199
+ $[35] = t12;
200
+ } else {
201
+ t12 = $[35];
202
+ }
203
+ return t12;
41
204
  }
42
205
  export default IconButton;
@@ -1,20 +1,20 @@
1
1
  import ButtonWithIcon from "./Actions.Button.js";
2
2
  import Dock from "./Actions.Dock.js";
3
3
  import FAB from "./Actions.FAB.js";
4
- import { FilterButton, FilterButtonGroup, } from "./Actions.FilterButton.js";
4
+ import { FilterButton, FilterButtonGroup } from "./Actions.FilterButton.js";
5
5
  import IconButton from "./Actions.IconButton.js";
6
6
  export const Actions = {
7
- /** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
8
- Button: ButtonWithIcon,
9
- /** Compact primary-action dock with additional options in a dismissible sheet. */
10
- Dock,
11
- /** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
12
- IconButton,
13
- /** Floating Action Button — fixed bottom-right/left, label-optional. */
14
- FAB,
15
- /** Chip-style active/inactive toggle — use inside `Actions.FilterButtonGroup`. */
16
- FilterButton,
17
- /** Filter chip layout; opt into horizontal scrolling or wrapping with `layout`. */
18
- FilterButtonGroup,
7
+ /** Primary action button. The filled one is gold; navy is text. Supports confirm dialog. */
8
+ Button: ButtonWithIcon,
9
+ /** Compact primary-action dock with additional options in a dismissible sheet. */
10
+ Dock,
11
+ /** Small icon-only tap target — ghost, primary, secondary, tertiary variants. */
12
+ IconButton,
13
+ /** Floating Action Button — fixed bottom-right/left, label-optional. */
14
+ FAB,
15
+ /** Chip-style active/inactive toggle — use inside `Actions.FilterButtonGroup`. */
16
+ FilterButton,
17
+ /** Filter chip layout; opt into horizontal scrolling or wrapping with `layout`. */
18
+ FilterButtonGroup
19
19
  };
20
20
  export default Actions;
@@ -1,22 +1,88 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
1
+ import { c as _c } from "react/compiler-runtime";
2
2
  import Confirmation from "./Dialog.Confirmation.js";
3
- import { createContext, useCallback, useContext, useMemo, useState, } from "react";
3
+ import { createContext, useCallback, useContext, useMemo, useState } from "react";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
4
5
  export { requestConfirmation } from "./requestConfirmation.js";
5
6
  const ConfirmationContext = createContext(null);
6
- export function ConfirmationProvider({ children }) {
7
- const [options, setOptions] = useState();
8
- const [visible, setVisible] = useState(false);
9
- const show = useCallback(({ title = "Confirmación", message = "¿Estás seguro de que quieres continuar?", confirmText = "Confirmar", cancelText = "Cancelar", destructive = false, ...next }) => {
10
- setOptions({ title, message, confirmText, cancelText, destructive, ...next });
11
- setVisible(true);
12
- }, []);
13
- const value = useMemo(() => ({ show }), [show]);
14
- return (_jsxs(ConfirmationContext.Provider, { value: value, children: [children, options ? (_jsx(Confirmation, { ...options, onClose: () => setVisible(false), visible: visible })) : null] }));
7
+ export function ConfirmationProvider(t0) {
8
+ const $ = _c(8);
9
+ const {
10
+ children
11
+ } = t0;
12
+ const [options, setOptions] = useState();
13
+ const [visible, setVisible] = useState(false);
14
+ let t1;
15
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
16
+ t1 = t2 => {
17
+ const {
18
+ title: t3,
19
+ message: t4,
20
+ confirmText: t5,
21
+ cancelText: t6,
22
+ destructive: t7,
23
+ ...next
24
+ } = t2;
25
+ const title = t3 === undefined ? "Confirmaci\xF3n" : t3;
26
+ const message = t4 === undefined ? "\xBFEst\xE1s seguro de que quieres continuar?" : t4;
27
+ const confirmText = t5 === undefined ? "Confirmar" : t5;
28
+ const cancelText = t6 === undefined ? "Cancelar" : t6;
29
+ const destructive = t7 === undefined ? false : t7;
30
+ setOptions({
31
+ title,
32
+ message,
33
+ confirmText,
34
+ cancelText,
35
+ destructive,
36
+ ...next
37
+ });
38
+ setVisible(true);
39
+ };
40
+ $[0] = t1;
41
+ } else {
42
+ t1 = $[0];
43
+ }
44
+ const show = t1;
45
+ let t2;
46
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
47
+ t2 = {
48
+ show
49
+ };
50
+ $[1] = t2;
51
+ } else {
52
+ t2 = $[1];
53
+ }
54
+ const value = t2;
55
+ let t3;
56
+ if ($[2] !== options || $[3] !== visible) {
57
+ t3 = options ? _jsx(Confirmation, {
58
+ ...options,
59
+ onClose: () => setVisible(false),
60
+ visible: visible
61
+ }) : null;
62
+ $[2] = options;
63
+ $[3] = visible;
64
+ $[4] = t3;
65
+ } else {
66
+ t3 = $[4];
67
+ }
68
+ let t4;
69
+ if ($[5] !== children || $[6] !== t3) {
70
+ t4 = _jsxs(ConfirmationContext.Provider, {
71
+ value: value,
72
+ children: [children, t3]
73
+ });
74
+ $[5] = children;
75
+ $[6] = t3;
76
+ $[7] = t4;
77
+ } else {
78
+ t4 = $[7];
79
+ }
80
+ return t4;
15
81
  }
16
82
  export function useConfirmationContext() {
17
- const context = useContext(ConfirmationContext);
18
- if (!context) {
19
- throw new Error("useConfirmationContext requires ConfirmationProvider.");
20
- }
21
- return context;
83
+ const context = useContext(ConfirmationContext);
84
+ if (!context) {
85
+ throw new Error("useConfirmationContext requires ConfirmationProvider.");
86
+ }
87
+ return context;
22
88
  }