@sincpro/mobile-ui 0.7.2 → 1.0.1

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 (270) hide show
  1. package/README.md +7 -5
  2. package/dist/Actions/Actions.Button.d.ts +91 -91
  3. package/dist/Actions/Actions.Button.js +36 -43
  4. package/dist/Actions/Actions.FAB.js +5 -5
  5. package/dist/Actions/Actions.FilterButton.js +3 -3
  6. package/dist/Actions/Actions.IconButton.d.ts +31 -31
  7. package/dist/Actions/Actions.IconButton.js +4 -4
  8. package/dist/Actions/index.d.ts +11 -11
  9. package/dist/Actions/index.js +5 -5
  10. package/dist/Dialog/BottomSheet/BottomSheet.Root.js +1 -1
  11. package/dist/Dialog/BottomSheet/index.d.ts +1 -1
  12. package/dist/Dialog/BottomSheet/index.js +1 -1
  13. package/dist/Dialog/Confirmation.context.js +3 -3
  14. package/dist/Dialog/Dialog.ActionSheet.js +6 -6
  15. package/dist/Dialog/Dialog.Confirmation.js +4 -4
  16. package/dist/Dialog/Dialog.EditValue.js +4 -4
  17. package/dist/Dialog/Dialog.Sheet.js +6 -4
  18. package/dist/Dialog/index.d.ts +5 -5
  19. package/dist/Dialog/index.js +5 -5
  20. package/dist/Display/Display.Accordion.js +5 -5
  21. package/dist/Display/Display.Avatar.d.ts +30 -30
  22. package/dist/Display/Display.Avatar.js +2 -2
  23. package/dist/Display/Display.AvatarGroup.js +3 -3
  24. package/dist/Display/Display.Badge.d.ts +3 -3
  25. package/dist/Display/Display.Badge.js +1 -1
  26. package/dist/Display/Display.Card.d.ts +15 -15
  27. package/dist/Display/Display.Card.js +4 -4
  28. package/dist/Display/Display.Carousel.js +2 -2
  29. package/dist/Display/Display.Chip.d.ts +3 -3
  30. package/dist/Display/Display.Chip.js +12 -12
  31. package/dist/Display/Display.CircleButton.d.ts +1 -1
  32. package/dist/Display/Display.CircleButton.js +3 -3
  33. package/dist/Display/Display.CopyableText.js +2 -2
  34. package/dist/Display/Display.CountRecords.js +2 -2
  35. package/dist/Display/Display.DataTable.js +2 -2
  36. package/dist/Display/Display.Date.d.ts +1 -1
  37. package/dist/Display/Display.Date.js +5 -5
  38. package/dist/Display/Display.Divider.d.ts +24 -24
  39. package/dist/Display/Display.Divider.js +1 -1
  40. package/dist/Display/Display.GradientSurface.d.ts +58 -39
  41. package/dist/Display/Display.GradientSurface.js +31 -15
  42. package/dist/Display/Display.Icon.d.ts +1 -1
  43. package/dist/Display/Display.Icon.js +1 -1
  44. package/dist/Display/Display.IconBadge.js +3 -3
  45. package/dist/Display/Display.Image.js +4 -4
  46. package/dist/Display/Display.KeyValue.js +2 -2
  47. package/dist/Display/Display.ListItem.js +5 -5
  48. package/dist/Display/Display.Logo.d.ts +3 -3
  49. package/dist/Display/Display.Logo.js +2 -2
  50. package/dist/Display/Display.MediaCard.js +4 -4
  51. package/dist/Display/Display.MediaEmbed.js +7 -7
  52. package/dist/Display/Display.MenuButton.d.ts +4 -4
  53. package/dist/Display/Display.MenuButton.js +6 -6
  54. package/dist/Display/Display.MenuCard.d.ts +1 -1
  55. package/dist/Display/Display.MenuCard.js +3 -3
  56. package/dist/Display/Display.MenuGrid.d.ts +1 -1
  57. package/dist/Display/Display.MenuGrid.js +1 -1
  58. package/dist/Display/Display.Monetary.d.ts +1 -1
  59. package/dist/Display/Display.Monetary.js +2 -2
  60. package/dist/Display/Display.Pattern.d.ts +33 -12
  61. package/dist/Display/Display.Pattern.js +60 -14
  62. package/dist/Display/Display.PriceTag.js +2 -2
  63. package/dist/Display/Display.ProductCard.js +7 -7
  64. package/dist/Display/Display.Rating.js +3 -3
  65. package/dist/Display/Display.SearchHistory.js +6 -6
  66. package/dist/Display/Display.SectionHeader.js +4 -4
  67. package/dist/Display/Display.Stat.js +2 -2
  68. package/dist/Display/Display.StatCard.js +4 -4
  69. package/dist/Display/Display.StatusDot.js +3 -3
  70. package/dist/Display/Display.Story.js +3 -3
  71. package/dist/Display/Display.StoryTray.js +5 -5
  72. package/dist/Display/Display.StoryViewer.js +4 -4
  73. package/dist/Display/Display.SwipeableRow.js +4 -4
  74. package/dist/Display/Display.Tag.js +2 -2
  75. package/dist/Display/Display.Timeline.js +4 -4
  76. package/dist/Display/Display.Tooltip.js +3 -3
  77. package/dist/Display/index.d.ts +45 -45
  78. package/dist/Display/index.js +42 -42
  79. package/dist/Feedback/ErrorBoundary.d.ts +1 -1
  80. package/dist/Feedback/ErrorBoundary.js +1 -1
  81. package/dist/Feedback/Feedback.Banner.d.ts +3 -3
  82. package/dist/Feedback/Feedback.Banner.js +5 -5
  83. package/dist/Feedback/Feedback.DomainSplashScreen.js +5 -4
  84. package/dist/Feedback/Feedback.Empty.js +3 -3
  85. package/dist/Feedback/Feedback.EmptyState.js +5 -5
  86. package/dist/Feedback/Feedback.Error.js +4 -4
  87. package/dist/Feedback/Feedback.Loading.d.ts +1 -1
  88. package/dist/Feedback/Feedback.Loading.js +2 -2
  89. package/dist/Feedback/Feedback.PermissionCard.js +5 -5
  90. package/dist/Feedback/Feedback.Progress.js +2 -2
  91. package/dist/Feedback/Feedback.ProgressCircle.js +1 -1
  92. package/dist/Feedback/Feedback.Skeleton.js +2 -2
  93. package/dist/Feedback/Feedback.Spinner.js +3 -3
  94. package/dist/Feedback/Feedback.Splash.d.ts +1 -1
  95. package/dist/Feedback/Feedback.Splash.js +7 -6
  96. package/dist/Feedback/Toast.context.js +7 -7
  97. package/dist/Feedback/index.d.ts +13 -13
  98. package/dist/Feedback/index.js +13 -13
  99. package/dist/Form/Form.Button.d.ts +2 -2
  100. package/dist/Form/Form.Button.js +1 -1
  101. package/dist/Form/Form.Checkbox.js +4 -4
  102. package/dist/Form/Form.ControlledCheckbox.js +1 -1
  103. package/dist/Form/Form.ControlledInput.js +1 -1
  104. package/dist/Form/Form.ControlledMonetaryInput.js +1 -1
  105. package/dist/Form/Form.ControlledRadioButton.js +1 -1
  106. package/dist/Form/Form.DatePicker.js +5 -5
  107. package/dist/Form/Form.Dropdown.js +7 -7
  108. package/dist/Form/Form.FAB.d.ts +2 -2
  109. package/dist/Form/Form.FAB.js +1 -1
  110. package/dist/Form/Form.FilterButton.d.ts +2 -2
  111. package/dist/Form/Form.FilterButton.js +1 -1
  112. package/dist/Form/Form.FractionalQuantityInput.js +4 -4
  113. package/dist/Form/Form.IconButton.d.ts +2 -2
  114. package/dist/Form/Form.IconButton.js +1 -1
  115. package/dist/Form/Form.Input.js +4 -4
  116. package/dist/Form/Form.InputField.d.ts +1 -1
  117. package/dist/Form/Form.InputField.js +3 -3
  118. package/dist/Form/Form.MonetaryInput.js +5 -4
  119. package/dist/Form/Form.PasswordInput.d.ts +1 -1
  120. package/dist/Form/Form.PasswordInput.js +3 -3
  121. package/dist/Form/Form.PinInput.js +5 -5
  122. package/dist/Form/Form.QuantitySelector.js +3 -3
  123. package/dist/Form/Form.RadioButton.js +4 -4
  124. package/dist/Form/Form.SearchBar.js +4 -4
  125. package/dist/Form/Form.Select.js +6 -6
  126. package/dist/Form/Form.Slider.js +3 -3
  127. package/dist/Form/Form.Switch.js +4 -4
  128. package/dist/Form/Form.TextInput.js +3 -3
  129. package/dist/Form/index.d.ts +27 -27
  130. package/dist/Form/index.js +25 -25
  131. package/dist/Navigation/Navigation.AppBar.d.ts +5 -4
  132. package/dist/Navigation/Navigation.AppBar.js +10 -10
  133. package/dist/Navigation/Navigation.BottomNav.d.ts +1 -1
  134. package/dist/Navigation/Navigation.BottomNav.js +25 -16
  135. package/dist/Navigation/Navigation.CollapsingHeader.d.ts +1 -1
  136. package/dist/Navigation/Navigation.CollapsingHeader.js +3 -3
  137. package/dist/Navigation/Navigation.FloatingBar.js +2 -2
  138. package/dist/Navigation/Navigation.Header.js +6 -6
  139. package/dist/Navigation/Navigation.HeaderToolbar.js +5 -5
  140. package/dist/Navigation/Navigation.Menu.js +6 -6
  141. package/dist/Navigation/Navigation.MenuSection.js +2 -2
  142. package/dist/Navigation/Navigation.RowItem.d.ts +1 -1
  143. package/dist/Navigation/Navigation.RowItem.js +2 -2
  144. package/dist/Navigation/Navigation.SearchBar.js +6 -6
  145. package/dist/Navigation/Navigation.SegmentedControl.js +4 -4
  146. package/dist/Navigation/Navigation.Steps.js +5 -5
  147. package/dist/Navigation/Navigation.TabIcon.js +2 -2
  148. package/dist/Navigation/Navigation.TabItem.js +2 -2
  149. package/dist/Navigation/Navigation.Tabs.js +5 -5
  150. package/dist/Navigation/index.d.ts +19 -19
  151. package/dist/Navigation/index.js +15 -15
  152. package/dist/Typography/Typography.Heading.d.ts +1 -1
  153. package/dist/Typography/Typography.Heading.js +1 -1
  154. package/dist/Typography/Typography.Text.d.ts +2 -2
  155. package/dist/Typography/Typography.Text.js +8 -6
  156. package/dist/Typography/index.d.ts +2 -2
  157. package/dist/Typography/index.js +2 -2
  158. package/dist/branding.d.ts +22 -0
  159. package/dist/branding.js +20 -3
  160. package/dist/icons/AddItemIcon.d.ts +1 -1
  161. package/dist/icons/ArrangeCircle.d.ts +1 -1
  162. package/dist/icons/ArrowDownIcon.d.ts +1 -1
  163. package/dist/icons/ArrowUpIcon.d.ts +1 -1
  164. package/dist/icons/BoxIcon.d.ts +1 -1
  165. package/dist/icons/BoxTimeIcon.d.ts +1 -1
  166. package/dist/icons/CalendarIcon.d.ts +1 -1
  167. package/dist/icons/CardIcon.d.ts +1 -1
  168. package/dist/icons/CashierIcon.d.ts +1 -1
  169. package/dist/icons/DuoIcon.d.ts +1 -1
  170. package/dist/icons/HomeIcon.d.ts +1 -1
  171. package/dist/icons/HomeIconOutlined.d.ts +1 -1
  172. package/dist/icons/LogoIcon.d.ts +1 -1
  173. package/dist/icons/MoneyReceiveIcon.d.ts +1 -1
  174. package/dist/icons/PinIcon.d.ts +1 -1
  175. package/dist/icons/PrinterIcon.d.ts +1 -1
  176. package/dist/icons/ProfileIcon.d.ts +1 -1
  177. package/dist/icons/SettingsIcon.d.ts +1 -1
  178. package/dist/icons/SinpeIcon.d.ts +1 -1
  179. package/dist/icons/ToggleOffIcon.d.ts +1 -1
  180. package/dist/icons/WalletMoneyIcon.d.ts +1 -1
  181. package/dist/index.d.ts +24 -23
  182. package/dist/index.js +26 -24
  183. package/dist/layouts/AuthContainer.d.ts +5 -2
  184. package/dist/layouts/AuthContainer.js +6 -6
  185. package/dist/layouts/Container.js +1 -1
  186. package/dist/layouts/GradientContainer.js +1 -1
  187. package/dist/layouts/ScrollContainer.js +1 -1
  188. package/dist/layouts/TabNavigatorLayout.js +4 -4
  189. package/dist/primitives/AspectRatio.js +1 -1
  190. package/dist/primitives/BaseButton.d.ts +85 -85
  191. package/dist/primitives/BaseButton.js +34 -50
  192. package/dist/primitives/Box.js +1 -1
  193. package/dist/primitives/Pressable.js +1 -1
  194. package/dist/primitives/Row.js +1 -1
  195. package/dist/primitives/Stack.js +1 -1
  196. package/dist/primitives/index.d.ts +6 -6
  197. package/dist/primitives/index.js +6 -6
  198. package/dist/theme/active.d.ts +1 -1
  199. package/dist/theme/active.js +14 -1
  200. package/dist/theme/build.d.ts +33 -0
  201. package/dist/theme/build.js +118 -0
  202. package/dist/theme/color.d.ts +26 -0
  203. package/dist/theme/color.js +109 -0
  204. package/dist/theme/components/index.d.ts +1 -1
  205. package/dist/theme/components/index.js +1 -1
  206. package/dist/theme/contrast.d.ts +29 -0
  207. package/dist/theme/contrast.js +57 -0
  208. package/dist/theme/css-vars.d.ts +3 -1
  209. package/dist/theme/css-vars.js +29 -3
  210. package/dist/theme/dark.d.ts +3 -4
  211. package/dist/theme/dark.js +91 -48
  212. package/dist/theme/default.d.ts +5 -1
  213. package/dist/theme/default.js +89 -41
  214. package/dist/theme/define.d.ts +4 -1
  215. package/dist/theme/define.js +4 -1
  216. package/dist/theme/globals.css +61 -46
  217. package/dist/theme/index.d.ts +14 -10
  218. package/dist/theme/index.js +13 -9
  219. package/dist/theme/theme.d.ts +1 -1
  220. package/dist/theme/theme.js +2 -2
  221. package/dist/theme/types.d.ts +77 -16
  222. package/dist/theme/types.js +13 -3
  223. package/dist/theme/typography.d.ts +4 -4
  224. package/dist/theme/typography.js +26 -28
  225. package/dist/theme/useTheme.d.ts +1 -1
  226. package/dist/theme/useTheme.js +1 -1
  227. package/dist/theme/validate.d.ts +16 -0
  228. package/dist/theme/validate.js +200 -0
  229. package/dist/tokens/index.d.ts +2 -2
  230. package/dist/tokens/index.js +2 -2
  231. package/dist/views/AppSplashView.d.ts +2 -2
  232. package/dist/views/AppSplashView.js +3 -3
  233. package/dist/views/AuthFormView.d.ts +1 -1
  234. package/dist/views/AuthFormView.js +3 -3
  235. package/dist/views/FormViewV2.d.ts +2 -2
  236. package/dist/views/FormViewV2.js +9 -9
  237. package/dist/views/ListViewV2.d.ts +3 -3
  238. package/dist/views/ListViewV2.js +16 -16
  239. package/dist/views/Wizard/Wizard.context.js +1 -1
  240. package/dist/views/Wizard/Wizard.d.ts +1 -1
  241. package/dist/views/Wizard/Wizard.js +1 -1
  242. package/dist/views/Wizard/index.d.ts +4 -4
  243. package/dist/views/Wizard/index.js +2 -2
  244. package/dist/views/types/IFormView.d.ts +1 -1
  245. package/dist/views/types/IListView.d.ts +1 -1
  246. package/dist/widgets/CircleButton.d.ts +2 -2
  247. package/dist/widgets/CircleButton.js +1 -1
  248. package/dist/widgets/GeoPermissionCard.js +3 -3
  249. package/dist/widgets/HomeHeader.js +3 -3
  250. package/dist/widgets/JSONViewer.js +2 -2
  251. package/dist/widgets/MenuCard.d.ts +2 -2
  252. package/dist/widgets/MenuCard.js +1 -1
  253. package/dist/widgets/MenuGrid.d.ts +3 -3
  254. package/dist/widgets/MenuGrid.js +1 -1
  255. package/dist/widgets/MenuSection.d.ts +2 -2
  256. package/dist/widgets/MenuSection.js +1 -1
  257. package/dist/widgets/PromoBanner.js +3 -3
  258. package/dist/widgets/PromoModal.js +3 -3
  259. package/dist/widgets/QuickActions.js +3 -3
  260. package/dist/widgets/ScreenHeader.js +2 -2
  261. package/dist/widgets/TimeZoneSelector.d.ts +1 -1
  262. package/dist/widgets/TimeZoneSelector.js +4 -4
  263. package/dist/widgets/TimeZoneSelectorModal.d.ts +1 -1
  264. package/dist/widgets/TimeZoneSelectorModal.js +5 -5
  265. package/dist/widgets/index.d.ts +16 -16
  266. package/dist/widgets/index.js +10 -10
  267. package/package.json +56 -50
  268. package/tailwind.preset.js +19 -0
  269. package/dist/icons/icon_getters.d.ts +0 -6
  270. package/dist/icons/icon_getters.js +0 -23
@@ -1,128 +1,128 @@
1
- import { type VariantProps } from "../theme/tw";
1
+ import { type VariantProps } from "../theme/tw.js";
2
2
  import type React from "react";
3
3
  import { FC } from "react";
4
4
  declare const button: import("tailwind-variants").TVReturnType<{
5
5
  variant: {
6
- primary: string;
7
- accent: string;
8
- secondary: string;
9
- outline: string;
10
- outlineDanger: string;
11
- outlineBlack: string;
12
- flat: string;
13
- link: string;
14
- transparent: string;
6
+ primary: "bg-accent";
7
+ accent: "bg-transparent";
8
+ secondary: "bg-bg-muted border border-border-strong";
9
+ outline: "bg-transparent border border-primary";
10
+ outlineDanger: "bg-transparent border border-danger";
11
+ outlineBlack: "bg-transparent border border-border-strong";
12
+ flat: "bg-text-primary/10";
13
+ link: "bg-transparent min-h-0";
14
+ transparent: "bg-transparent border border-border-light";
15
15
  };
16
16
  size: {
17
- small: string;
18
- medium: string;
19
- large: string;
17
+ small: "py-1.5 px-3 min-h-[36px]";
18
+ medium: "py-2.5 px-4 min-h-[44px]";
19
+ large: "py-3 px-5 min-h-[48px]";
20
20
  };
21
21
  disabled: {
22
- true: string;
22
+ true: "opacity-70";
23
23
  };
24
- }, undefined, "rounded-lg items-center justify-center flex-row min-h-[44px]", {
24
+ }, undefined, "rounded-md items-center justify-center flex-row min-h-[44px]", {
25
25
  variant: {
26
- primary: string;
27
- accent: string;
28
- secondary: string;
29
- outline: string;
30
- outlineDanger: string;
31
- outlineBlack: string;
32
- flat: string;
33
- link: string;
34
- transparent: string;
26
+ primary: "bg-accent";
27
+ accent: "bg-transparent";
28
+ secondary: "bg-bg-muted border border-border-strong";
29
+ outline: "bg-transparent border border-primary";
30
+ outlineDanger: "bg-transparent border border-danger";
31
+ outlineBlack: "bg-transparent border border-border-strong";
32
+ flat: "bg-text-primary/10";
33
+ link: "bg-transparent min-h-0";
34
+ transparent: "bg-transparent border border-border-light";
35
35
  };
36
36
  size: {
37
- small: string;
38
- medium: string;
39
- large: string;
37
+ small: "py-1.5 px-3 min-h-[36px]";
38
+ medium: "py-2.5 px-4 min-h-[44px]";
39
+ large: "py-3 px-5 min-h-[48px]";
40
40
  };
41
41
  disabled: {
42
- true: string;
42
+ true: "opacity-70";
43
43
  };
44
- }, undefined, import("tailwind-variants").TVReturnType<{
44
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
45
45
  variant: {
46
- primary: string;
47
- accent: string;
48
- secondary: string;
49
- outline: string;
50
- outlineDanger: string;
51
- outlineBlack: string;
52
- flat: string;
53
- link: string;
54
- transparent: string;
46
+ primary: "bg-accent";
47
+ accent: "bg-transparent";
48
+ secondary: "bg-bg-muted border border-border-strong";
49
+ outline: "bg-transparent border border-primary";
50
+ outlineDanger: "bg-transparent border border-danger";
51
+ outlineBlack: "bg-transparent border border-border-strong";
52
+ flat: "bg-text-primary/10";
53
+ link: "bg-transparent min-h-0";
54
+ transparent: "bg-transparent border border-border-light";
55
55
  };
56
56
  size: {
57
- small: string;
58
- medium: string;
59
- large: string;
57
+ small: "py-1.5 px-3 min-h-[36px]";
58
+ medium: "py-2.5 px-4 min-h-[44px]";
59
+ large: "py-3 px-5 min-h-[48px]";
60
60
  };
61
61
  disabled: {
62
- true: string;
62
+ true: "opacity-70";
63
63
  };
64
- }, undefined, "rounded-lg items-center justify-center flex-row min-h-[44px]", unknown, unknown, undefined>>;
64
+ }, undefined>>;
65
65
  declare const buttonIcon: import("tailwind-variants").TVReturnType<{
66
66
  variant: {
67
- primary: string;
68
- accent: string;
69
- secondary: string;
70
- outline: string;
71
- outlineDanger: string;
72
- outlineBlack: string;
73
- flat: string;
74
- link: string;
75
- transparent: string;
67
+ primary: "bg-accent";
68
+ accent: "bg-transparent";
69
+ secondary: "bg-bg-muted border border-border-strong";
70
+ outline: "bg-transparent border border-primary";
71
+ outlineDanger: "bg-transparent border border-danger";
72
+ outlineBlack: "bg-transparent border border-border-strong";
73
+ flat: "bg-text-primary/10";
74
+ link: "bg-transparent";
75
+ transparent: "bg-transparent border border-border-light";
76
76
  };
77
77
  size: {
78
- small: string;
79
- medium: string;
80
- large: string;
78
+ small: "w-9 h-9";
79
+ medium: "w-11 h-11";
80
+ large: "w-[52px] h-[52px]";
81
81
  };
82
82
  disabled: {
83
- true: string;
83
+ true: "opacity-70";
84
84
  };
85
- }, undefined, "rounded-lg items-center justify-center aspect-square", {
85
+ }, undefined, "rounded-md items-center justify-center aspect-square", {
86
86
  variant: {
87
- primary: string;
88
- accent: string;
89
- secondary: string;
90
- outline: string;
91
- outlineDanger: string;
92
- outlineBlack: string;
93
- flat: string;
94
- link: string;
95
- transparent: string;
87
+ primary: "bg-accent";
88
+ accent: "bg-transparent";
89
+ secondary: "bg-bg-muted border border-border-strong";
90
+ outline: "bg-transparent border border-primary";
91
+ outlineDanger: "bg-transparent border border-danger";
92
+ outlineBlack: "bg-transparent border border-border-strong";
93
+ flat: "bg-text-primary/10";
94
+ link: "bg-transparent";
95
+ transparent: "bg-transparent border border-border-light";
96
96
  };
97
97
  size: {
98
- small: string;
99
- medium: string;
100
- large: string;
98
+ small: "w-9 h-9";
99
+ medium: "w-11 h-11";
100
+ large: "w-[52px] h-[52px]";
101
101
  };
102
102
  disabled: {
103
- true: string;
103
+ true: "opacity-70";
104
104
  };
105
- }, undefined, import("tailwind-variants").TVReturnType<{
105
+ }, undefined, import("tailwind-variants").TVReturnTypeLike<{
106
106
  variant: {
107
- primary: string;
108
- accent: string;
109
- secondary: string;
110
- outline: string;
111
- outlineDanger: string;
112
- outlineBlack: string;
113
- flat: string;
114
- link: string;
115
- transparent: string;
107
+ primary: "bg-accent";
108
+ accent: "bg-transparent";
109
+ secondary: "bg-bg-muted border border-border-strong";
110
+ outline: "bg-transparent border border-primary";
111
+ outlineDanger: "bg-transparent border border-danger";
112
+ outlineBlack: "bg-transparent border border-border-strong";
113
+ flat: "bg-text-primary/10";
114
+ link: "bg-transparent";
115
+ transparent: "bg-transparent border border-border-light";
116
116
  };
117
117
  size: {
118
- small: string;
119
- medium: string;
120
- large: string;
118
+ small: "w-9 h-9";
119
+ medium: "w-11 h-11";
120
+ large: "w-[52px] h-[52px]";
121
121
  };
122
122
  disabled: {
123
- true: string;
123
+ true: "opacity-70";
124
124
  };
125
- }, undefined, "rounded-lg items-center justify-center aspect-square", unknown, unknown, undefined>>;
125
+ }, undefined>>;
126
126
  export interface BaseButtonProps extends VariantProps<typeof button> {
127
127
  title: string;
128
128
  onPress?: () => void;
@@ -1,20 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "nativewind/jsx-runtime";
2
- import Icon from "../Display/Display.Icon";
3
- import { theme } from "../theme";
4
- import { tv } from "../theme/tw";
5
- import { Typography } from "../Typography";
6
- import { LinearGradient } from "expo-linear-gradient";
2
+ import Icon from "../Display/Display.Icon.js";
3
+ import { theme } from "../theme/index.js";
4
+ import { tv } from "../theme/tw.js";
5
+ import { Typography } from "../Typography/index.js";
7
6
  import { ActivityIndicator, TouchableOpacity, View } from "react-native";
8
7
  // ============================================================================
9
8
  // STYLE VARIANTS
10
9
  // ============================================================================
11
10
  const button = tv({
12
- base: "rounded-lg items-center justify-center flex-row min-h-[44px]",
11
+ base: "rounded-md items-center justify-center flex-row min-h-[44px]",
13
12
  variants: {
14
13
  variant: {
15
- primary: "shadow-sm",
16
- accent: "shadow-sm",
17
- secondary: "bg-bg-card border border-primary shadow-sm",
14
+ primary: "bg-accent",
15
+ accent: "bg-transparent",
16
+ secondary: "bg-bg-muted border border-border-strong",
18
17
  outline: "bg-transparent border border-primary",
19
18
  outlineDanger: "bg-transparent border border-danger",
20
19
  outlineBlack: "bg-transparent border border-border-strong",
@@ -37,12 +36,12 @@ const button = tv({
37
36
  },
38
37
  });
39
38
  const buttonIcon = tv({
40
- base: "rounded-lg items-center justify-center aspect-square",
39
+ base: "rounded-md items-center justify-center aspect-square",
41
40
  variants: {
42
41
  variant: {
43
- primary: "shadow-sm",
44
- accent: "shadow-sm",
45
- secondary: "bg-bg-card border border-primary shadow-sm",
42
+ primary: "bg-accent",
43
+ accent: "bg-transparent",
44
+ secondary: "bg-bg-muted border border-border-strong",
46
45
  outline: "bg-transparent border border-primary",
47
46
  outlineDanger: "bg-transparent border border-danger",
48
47
  outlineBlack: "bg-transparent border border-border-strong",
@@ -67,15 +66,15 @@ const buttonIcon = tv({
67
66
  const textColor = tv({
68
67
  variants: {
69
68
  variant: {
70
- primary: "text-white",
71
- accent: "text-white",
72
- secondary: "text-primary",
73
- outline: "text-primary",
69
+ primary: "text-text-on-accent",
70
+ accent: "text-text-accent",
71
+ secondary: "text-text-primary",
72
+ outline: "text-text-accent",
74
73
  outlineDanger: "text-danger",
75
74
  outlineBlack: "text-text-primary",
76
75
  flat: "text-text-primary",
77
- link: "text-primary",
78
- transparent: "text-white",
76
+ link: "text-text-accent",
77
+ transparent: "text-text-inverse",
79
78
  },
80
79
  disabled: {
81
80
  true: "opacity-50",
@@ -85,17 +84,17 @@ const textColor = tv({
85
84
  {
86
85
  variant: "primary",
87
86
  disabled: true,
88
- className: "text-white/70",
87
+ className: "text-text-on-accent",
89
88
  },
90
89
  {
91
90
  variant: "accent",
92
91
  disabled: true,
93
- className: "text-white/70",
92
+ className: "text-text-accent",
94
93
  },
95
94
  {
96
95
  variant: "transparent",
97
96
  disabled: true,
98
- className: "text-white/70",
97
+ className: "text-text-inverse/70",
99
98
  },
100
99
  {
101
100
  variant: ["secondary", "outline", "link"],
@@ -128,14 +127,14 @@ const textColor = tv({
128
127
  // ============================================================================
129
128
  function getLoadingColorDynamic(variant) {
130
129
  const map = {
131
- primary: theme.text.inverse,
132
- accent: theme.text.inverse,
133
- secondary: theme.primary,
134
- outline: theme.primary,
130
+ primary: theme.text.onAccent,
131
+ accent: theme.text.accent,
132
+ secondary: theme.text.primary,
133
+ outline: theme.text.accent,
135
134
  outlineDanger: theme.danger,
136
135
  outlineBlack: theme.text.primary,
137
136
  flat: theme.text.primary,
138
- link: theme.primary,
137
+ link: theme.text.accent,
139
138
  transparent: theme.text.inverse,
140
139
  };
141
140
  return map[variant] ?? theme.text.inverse;
@@ -143,8 +142,8 @@ function getLoadingColorDynamic(variant) {
143
142
  function getIconColorDynamic(variant, disabled) {
144
143
  if (disabled) {
145
144
  const disabledMap = {
146
- primary: theme.icon.inverse + "70",
147
- accent: theme.icon.inverse + "70",
145
+ primary: theme.text.onAccent + "70",
146
+ accent: theme.text.accent + "70",
148
147
  secondary: theme.icon.disabled,
149
148
  outline: theme.icon.disabled,
150
149
  outlineDanger: theme.danger + "7f",
@@ -156,14 +155,14 @@ function getIconColorDynamic(variant, disabled) {
156
155
  return disabledMap[variant] ?? theme.icon.disabled;
157
156
  }
158
157
  const enabledMap = {
159
- primary: theme.icon.inverse,
160
- accent: theme.icon.inverse,
161
- secondary: theme.primary,
162
- outline: theme.primary,
158
+ primary: theme.text.onAccent,
159
+ accent: theme.text.accent,
160
+ secondary: theme.text.primary,
161
+ outline: theme.text.accent,
163
162
  outlineDanger: theme.danger,
164
163
  outlineBlack: theme.text.primary,
165
164
  flat: theme.text.primary,
166
- link: theme.primary,
165
+ link: theme.text.accent,
167
166
  transparent: theme.icon.inverse,
168
167
  };
169
168
  return enabledMap[variant] ?? theme.icon.inverse;
@@ -203,27 +202,12 @@ export const BaseButton = ({ title, onPress, variant = "primary", size = "medium
203
202
  if (variant === "link") {
204
203
  return (_jsx(TouchableOpacity, { activeOpacity: 0.7, className: className, disabled: disabled || loading, onPress: onPress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title })) }));
205
204
  }
206
- if (variant === "primary" || variant === "accent") {
207
- const gradientColors = variant === "primary" ? theme.gradient.primary : theme.gradient.accent;
208
- const hasFlex = className?.includes("flex-1");
209
- return (_jsx(View, { className: className, style: hasFlex ? { flex: 1 } : undefined, children: _jsx(LinearGradient, { colors: gradientColors, end: { x: 1, y: 1 }, start: { x: 0, y: 0 }, style: {
210
- borderRadius: 8,
211
- opacity: disabled ? 0.7 : 1,
212
- }, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: onPress, children: _jsxs(View, { className: button({ size, disabled }), style: { backgroundColor: "transparent" }, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title }))] }) }) }) }));
213
- }
214
- return (_jsxs(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, variant: textVariantValue, children: title }))] }));
205
+ return (_jsxs(TouchableOpacity, { activeOpacity: 0.8, className: button({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, children: [icon && !loading && _jsx(View, { className: "mr-2", children: icon }), loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Typography.Text, { className: textColorClass, semibold: variant === "primary", variant: textVariantValue, children: title }))] }));
215
206
  };
216
207
  export const BaseButtonIcon = ({ icon, onPress, variant = "primary", size = "medium", loading = false, disabled = false, className, }) => {
217
208
  const iconColorValue = getIconColor(variant ?? "primary", disabled);
218
209
  const loadingColorValue = getLoadingColor(variant ?? "primary");
219
210
  const iconSizeValue = getIconSize(size ?? "medium");
220
- if (variant === "primary" || variant === "accent") {
221
- const gradientColors = variant === "primary" ? theme.gradient.primary : theme.gradient.accent;
222
- return (_jsx(LinearGradient, { colors: gradientColors, end: { x: 1, y: 1 }, start: { x: 0, y: 0 }, style: {
223
- borderRadius: 8,
224
- opacity: disabled ? 0.7 : 1,
225
- }, children: _jsx(TouchableOpacity, { activeOpacity: 0.8, disabled: disabled || loading, onPress: onPress, children: _jsx(View, { className: buttonIcon({ size, disabled }), style: { backgroundColor: "transparent" }, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }) }) }));
226
- }
227
211
  return (_jsx(TouchableOpacity, { activeOpacity: 0.8, className: buttonIcon({ variant, size, disabled, className }), disabled: disabled || loading, onPress: onPress, children: loading ? (_jsx(ActivityIndicator, { color: loadingColorValue, size: "small" })) : (_jsx(Icon, { color: iconColorValue, name: icon, size: iconSizeValue })) }));
228
212
  };
229
213
  // ============================================================================
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { cn } from "../theme/tw";
2
+ import { cn } from "../theme/tw.js";
3
3
  import { View } from "react-native";
4
4
  function Box({ className, style, ...props }) {
5
5
  return _jsx(View, { className: cn(className), style: style, ...props });
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { cn } from "../theme/tw";
2
+ import { cn } from "../theme/tw.js";
3
3
  import { TouchableOpacity, } from "react-native";
4
4
  function Pressable({ className, disabled = false, hitSlop = 8, activeOpacity = 0.7, accessibilityRole = "button", style, children, ...rest }) {
5
5
  const isDisabled = !!disabled;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { cn } from "../theme/tw";
2
+ import { cn } from "../theme/tw.js";
3
3
  import { View } from "react-native";
4
4
  function Row({ spacing = 2, align = "center", justify = "start", wrap = false, className, style, ...props }) {
5
5
  const alignMap = {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "nativewind/jsx-runtime";
2
- import { cn } from "../theme/tw";
2
+ import { cn } from "../theme/tw.js";
3
3
  import { View } from "react-native";
4
4
  function Stack({ spacing = 4, align = "stretch", className, style, ...props }) {
5
5
  const alignMap = {
@@ -1,6 +1,6 @@
1
- export { AspectRatio, type AspectRatioProps, } from "../primitives/AspectRatio";
2
- export { Box } from "../primitives/Box";
3
- export { Pressable, type PressableProps } from "../primitives/Pressable";
4
- export { Row } from "../primitives/Row";
5
- export { Spacer, type SpacerProps } from "../primitives/Spacer";
6
- export { Stack } from "../primitives/Stack";
1
+ export { AspectRatio, type AspectRatioProps, } from "./AspectRatio.js";
2
+ export { Box } from "./Box.js";
3
+ export { Pressable, type PressableProps } from "./Pressable.js";
4
+ export { Row } from "./Row.js";
5
+ export { Spacer, type SpacerProps } from "./Spacer.js";
6
+ export { Stack } from "./Stack.js";
@@ -1,6 +1,6 @@
1
- export { AspectRatio, } from "../primitives/AspectRatio";
2
- export { Box } from "../primitives/Box";
3
- export { Pressable } from "../primitives/Pressable";
4
- export { Row } from "../primitives/Row";
5
- export { Spacer } from "../primitives/Spacer";
6
- export { Stack } from "../primitives/Stack";
1
+ export { AspectRatio, } from "./AspectRatio.js";
2
+ export { Box } from "./Box.js";
3
+ export { Pressable } from "./Pressable.js";
4
+ export { Row } from "./Row.js";
5
+ export { Spacer } from "./Spacer.js";
6
+ export { Stack } from "./Stack.js";
@@ -1,4 +1,4 @@
1
- import type { ThemeTokens } from "../theme/types";
1
+ import type { ThemeTokens } from "./types.js";
2
2
  export declare function setActiveTheme(tokens: ThemeTokens): void;
3
3
  export declare function getActiveTheme(): ThemeTokens;
4
4
  export declare function subscribeTheme(listener: () => void): () => void;
@@ -1,8 +1,21 @@
1
- import { DEFAULT_THEME } from "../theme/default";
1
+ import { DEFAULT_THEME } from "./default.js";
2
+ import { validateTheme } from "./validate.js";
2
3
  const activeTheme = { ...DEFAULT_THEME };
3
4
  const listeners = new Set();
4
5
  let version = 0;
6
+ // Detection helper: we don't want validation warnings to spam the console while running
7
+ // runtime tests under Node (they intentionally pass partial themes). The check is cheap
8
+ // and runs once at module load.
9
+ const isReactNative = typeof navigator !== "undefined" &&
10
+ navigator.product === "ReactNative";
5
11
  export function setActiveTheme(tokens) {
12
+ if (__DEV__ && isReactNative) {
13
+ const issues = validateTheme(tokens);
14
+ if (issues.length > 0) {
15
+ const fmt = issues.map((i) => ` · ${i.path}: ${i.message}`).join("\n");
16
+ console.warn(`[@sincpro/mobile-ui] setActiveTheme received a theme with issues:\n${fmt}\nRendering will fall back to default styles for missing keys.`);
17
+ }
18
+ }
6
19
  Object.assign(activeTheme, tokens);
7
20
  version += 1;
8
21
  listeners.forEach((listener) => listener());
@@ -0,0 +1,33 @@
1
+ import type { ThemeTokens } from "./types.js";
2
+ export type BrandThemeMode = "light" | "dark";
3
+ export type BuildThemeFromBrandOptions = {
4
+ /** Theme name (e.g. `acme-light`). */
5
+ name: string;
6
+ /** Brand seed fill (CTA / primary). */
7
+ brand: string;
8
+ mode: BrandThemeMode;
9
+ /**
10
+ * Brand-colored text on page/card. If omitted, derived by darkening (light)
11
+ * or lightening (dark) the seed until it is usable as text.
12
+ */
13
+ brandText?: string;
14
+ /** Optional secondary seed; defaults to a shifted brand hue. */
15
+ secondary?: string;
16
+ /** Optional accent seed; defaults to brand. */
17
+ accent?: string;
18
+ };
19
+ /**
20
+ * Builds a complete `ThemeTokens` from a brand seed — Material-style derivation
21
+ * for mobile apps that rebrand without hand-authoring every token.
22
+ *
23
+ * Starts from `DEFAULT_THEME` / `DEFAULT_DARK_THEME` and overlays derived roles
24
+ * so consumers always get containers, state layers, and material chrome.
25
+ *
26
+ * @example
27
+ * setActiveTheme(buildThemeFromBrand({
28
+ * name: "acme-light",
29
+ * brand: "#0066FF",
30
+ * mode: "light",
31
+ * }));
32
+ */
33
+ export declare function buildThemeFromBrand(opts: BuildThemeFromBrandOptions): ThemeTokens;
@@ -0,0 +1,118 @@
1
+ import { containerPair, mixHex, shiftLightness } from "./color.js";
2
+ import { resolveOnColor } from "./contrast.js";
3
+ import { DEFAULT_DARK_THEME } from "./dark.js";
4
+ import { DEFAULT_THEME } from "./default.js";
5
+ import { mergeTheme } from "./define.js";
6
+ const STATE_LIGHT = { hover: 0.08, press: 0.12, focus: 0.12, drag: 0.16 };
7
+ const STATE_DARK = { hover: 0.1, press: 0.16, focus: 0.14, drag: 0.2 };
8
+ const MATERIAL_LIGHT = { blur: 24, opacity: 0.78, borderOpacity: 0.18 };
9
+ const MATERIAL_DARK = { blur: 28, opacity: 0.62, borderOpacity: 0.22 };
10
+ const SUCCESS = "#2F6B3C";
11
+ const WARNING = "#7E5E12";
12
+ const DANGER = "#9B3B30";
13
+ const INFO = "#0F5C6E";
14
+ function deriveBrandText(brand, mode) {
15
+ if (mode === "light") {
16
+ return shiftLightness(brand, -0.28);
17
+ }
18
+ // Dark surfaces need a light brand text — mix toward white until AA-friendly.
19
+ return mixHex(brand, "#FFFFFF", 0.62);
20
+ }
21
+ /**
22
+ * Builds a complete `ThemeTokens` from a brand seed — Material-style derivation
23
+ * for mobile apps that rebrand without hand-authoring every token.
24
+ *
25
+ * Starts from `DEFAULT_THEME` / `DEFAULT_DARK_THEME` and overlays derived roles
26
+ * so consumers always get containers, state layers, and material chrome.
27
+ *
28
+ * @example
29
+ * setActiveTheme(buildThemeFromBrand({
30
+ * name: "acme-light",
31
+ * brand: "#0066FF",
32
+ * mode: "light",
33
+ * }));
34
+ */
35
+ export function buildThemeFromBrand(opts) {
36
+ const { name, brand, mode } = opts;
37
+ const base = mode === "light" ? DEFAULT_THEME : DEFAULT_DARK_THEME;
38
+ const secondary = opts.secondary ?? shiftLightness(brand, mode === "light" ? -0.18 : -0.08);
39
+ const accent = opts.accent ?? brand;
40
+ const brandText = opts.brandText ?? deriveBrandText(brand, mode);
41
+ const primaryC = containerPair(brand, mode);
42
+ const secondaryC = containerPair(secondary, mode);
43
+ const accentC = containerPair(accent, mode);
44
+ const successC = containerPair(SUCCESS, mode);
45
+ const warningC = containerPair(WARNING, mode);
46
+ const dangerC = containerPair(DANGER, mode);
47
+ const infoC = containerPair(INFO, mode);
48
+ const page = mode === "light" ? mixHex(brand, "#FFFFFF", 0.96) : "#0C0C0C";
49
+ const card = mode === "light" ? "#FFFFFF" : "#161616";
50
+ const muted = mode === "light" ? mixHex(brand, "#FFFFFF", 0.92) : mixHex(brand, "#000000", 0.88);
51
+ const bgAccent = primaryC.container;
52
+ const hover = mode === "light" ? mixHex(brand, "#FFFFFF", 0.9) : mixHex(brand, "#000000", 0.82);
53
+ const disabled = mode === "light" ? mixHex(brand, "#FFFFFF", 0.86) : mixHex("#FFFFFF", "#000000", 0.85);
54
+ return mergeTheme(base, {
55
+ name,
56
+ primary: brand,
57
+ secondary,
58
+ accent,
59
+ bg: {
60
+ page,
61
+ card,
62
+ popover: card,
63
+ muted,
64
+ accent: bgAccent,
65
+ hover,
66
+ disabled,
67
+ inverse: mode === "light" ? "#0C0C0C" : mixHex(brand, "#FFFFFF", 0.94),
68
+ containerLowest: mode === "light" ? page : "#0A0A0A",
69
+ container: muted,
70
+ containerHigh: mode === "light" ? mixHex(brand, "#FFFFFF", 0.84) : "#1E1E1E",
71
+ },
72
+ text: {
73
+ accent: brandText,
74
+ onPrimary: resolveOnColor(brand),
75
+ onSecondary: resolveOnColor(secondary),
76
+ onAccent: resolveOnColor(accent),
77
+ onDanger: resolveOnColor(DANGER),
78
+ onSuccess: resolveOnColor(SUCCESS),
79
+ },
80
+ border: {
81
+ focus: brandText,
82
+ default: mode === "light" ? mixHex(brand, "#FFFFFF", 0.82) : "#262626",
83
+ light: muted,
84
+ strong: mode === "light" ? mixHex(brand, "#000000", 0.25) : "#3A3A3A",
85
+ },
86
+ ring: brandText,
87
+ success: SUCCESS,
88
+ warning: WARNING,
89
+ danger: DANGER,
90
+ info: INFO,
91
+ successLight: successC.container,
92
+ warningLight: warningC.container,
93
+ dangerLight: dangerC.container,
94
+ infoLight: infoC.container,
95
+ container: {
96
+ primary: primaryC.container,
97
+ onPrimary: primaryC.onContainer,
98
+ secondary: secondaryC.container,
99
+ onSecondary: secondaryC.onContainer,
100
+ accent: accentC.container,
101
+ onAccent: accentC.onContainer,
102
+ success: successC.container,
103
+ onSuccess: successC.onContainer,
104
+ warning: warningC.container,
105
+ onWarning: warningC.onContainer,
106
+ danger: dangerC.container,
107
+ onDanger: dangerC.onContainer,
108
+ info: infoC.container,
109
+ onInfo: infoC.onContainer,
110
+ },
111
+ state: mode === "light" ? { ...STATE_LIGHT } : { ...STATE_DARK },
112
+ material: mode === "light" ? { ...MATERIAL_LIGHT } : { ...MATERIAL_DARK },
113
+ gradient: {
114
+ primary: [shiftLightness(brand, 0.12), brand],
115
+ accent: [brand, secondary],
116
+ },
117
+ });
118
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Color primitives for theme derivation (HSL). Used by buildThemeFromBrand
3
+ * and container/tonal helpers — keeps brand math in one place.
4
+ */
5
+ export type Hsl = {
6
+ h: number;
7
+ s: number;
8
+ l: number;
9
+ };
10
+ export declare function hexToRgb(hex: string): {
11
+ r: number;
12
+ g: number;
13
+ b: number;
14
+ };
15
+ export declare function rgbToHex(r: number, g: number, b: number): string;
16
+ export declare function hexToHsl(hex: string): Hsl;
17
+ export declare function hslToHex({ h, s, l }: Hsl): string;
18
+ /** Mix two hex colors. `t=0` → a, `t=1` → b. */
19
+ export declare function mixHex(a: string, b: string, t: number): string;
20
+ /** Shift lightness in HSL. delta in [-1, 1] absolute L change. */
21
+ export declare function shiftLightness(hex: string, delta: number): string;
22
+ /** Soft container fill + on-container ink (M3-style tonal pair). */
23
+ export declare function containerPair(seed: string, mode: "light" | "dark"): {
24
+ container: string;
25
+ onContainer: string;
26
+ };