@ankhorage/surface 4.1.0 → 4.2.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 (574) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/components/field/Field.js +1 -1
  4. package/dist/components/field/Field.js.map +1 -1
  5. package/dist/components/helper-text/HelperText.js +1 -1
  6. package/dist/components/helper-text/HelperText.js.map +1 -1
  7. package/dist/components/label/Label.js +1 -1
  8. package/dist/components/label/Label.js.map +1 -1
  9. package/dist/components/list-item/ListItem.js +2 -2
  10. package/dist/components/list-item/ListItem.js.map +1 -1
  11. package/dist/components/menu/Menu.d.ts.map +1 -1
  12. package/dist/components/menu/Menu.js +4 -2
  13. package/dist/components/menu/Menu.js.map +1 -1
  14. package/dist/components/modal/Modal.d.ts.map +1 -1
  15. package/dist/components/modal/Modal.js +2 -1
  16. package/dist/components/modal/Modal.js.map +1 -1
  17. package/dist/components/switch/Switch.js +2 -2
  18. package/dist/components/switch/Switch.js.map +1 -1
  19. package/dist/components/tabs/Tab.js +2 -2
  20. package/dist/components/tabs/Tab.js.map +1 -1
  21. package/dist/components/tabs/TabList.js +1 -1
  22. package/dist/components/tabs/TabList.js.map +1 -1
  23. package/dist/components/tabs/Tabs.js +1 -1
  24. package/dist/components/tabs/Tabs.js.map +1 -1
  25. package/dist/components/textarea/Textarea.js +1 -1
  26. package/dist/components/textarea/Textarea.js.map +1 -1
  27. package/dist/components/textarea/types.d.ts +1 -1
  28. package/dist/components/textarea/types.d.ts.map +1 -1
  29. package/dist/components/textarea/types.js.map +1 -1
  30. package/dist/components/toast/Toast.d.ts.map +1 -1
  31. package/dist/components/toast/Toast.js +4 -2
  32. package/dist/components/toast/Toast.js.map +1 -1
  33. package/dist/components/toast/ToastProvider.js +1 -1
  34. package/dist/components/toast/ToastProvider.js.map +1 -1
  35. package/dist/components/tooltip/Tooltip.js +2 -2
  36. package/dist/components/tooltip/Tooltip.js.map +1 -1
  37. package/dist/examples/DocsExamples.js +6 -6
  38. package/dist/examples/DocsExamples.js.map +1 -1
  39. package/dist/features/badge/adapters/inbound/Badge.d.ts +5 -0
  40. package/dist/features/badge/adapters/inbound/Badge.d.ts.map +1 -0
  41. package/dist/features/badge/adapters/inbound/Badge.js +30 -0
  42. package/dist/features/badge/adapters/inbound/Badge.js.map +1 -0
  43. package/dist/features/badge/public.d.ts +3 -0
  44. package/dist/features/badge/public.d.ts.map +1 -0
  45. package/dist/features/badge/public.js +2 -0
  46. package/dist/features/badge/public.js.map +1 -0
  47. package/dist/{components/button → features/button/adapters/inbound}/Button.d.ts +2 -1
  48. package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -0
  49. package/dist/features/button/adapters/inbound/Button.js +60 -0
  50. package/dist/features/button/adapters/inbound/Button.js.map +1 -0
  51. package/dist/{components/icon-button → features/button/adapters/inbound}/IconButton.d.ts +2 -1
  52. package/dist/features/button/adapters/inbound/IconButton.d.ts.map +1 -0
  53. package/dist/features/button/adapters/inbound/IconButton.js +33 -0
  54. package/dist/features/button/adapters/inbound/IconButton.js.map +1 -0
  55. package/dist/features/button/public.d.ts +4 -0
  56. package/dist/features/button/public.d.ts.map +1 -0
  57. package/dist/features/button/public.js +3 -0
  58. package/dist/features/button/public.js.map +1 -0
  59. package/dist/features/card/adapters/inbound/Card.d.ts +5 -0
  60. package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -0
  61. package/dist/features/card/adapters/inbound/Card.js +44 -0
  62. package/dist/features/card/adapters/inbound/Card.js.map +1 -0
  63. package/dist/features/card/public.d.ts +3 -0
  64. package/dist/features/card/public.d.ts.map +1 -0
  65. package/dist/features/card/public.js +2 -0
  66. package/dist/features/card/public.js.map +1 -0
  67. package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts +5 -0
  68. package/dist/features/form/checkbox/adapters/inbound/Checkbox.d.ts.map +1 -0
  69. package/dist/features/form/checkbox/adapters/inbound/Checkbox.js +88 -0
  70. package/dist/features/form/checkbox/adapters/inbound/Checkbox.js.map +1 -0
  71. package/dist/features/form/checkbox/public.d.ts +3 -0
  72. package/dist/features/form/checkbox/public.d.ts.map +1 -0
  73. package/dist/features/form/checkbox/public.js +2 -0
  74. package/dist/features/form/checkbox/public.js.map +1 -0
  75. package/dist/features/form/radio/adapters/inbound/Radio.d.ts +5 -0
  76. package/dist/features/form/radio/adapters/inbound/Radio.d.ts.map +1 -0
  77. package/dist/features/form/radio/adapters/inbound/Radio.js +91 -0
  78. package/dist/features/form/radio/adapters/inbound/Radio.js.map +1 -0
  79. package/dist/features/form/radio/public.d.ts +3 -0
  80. package/dist/features/form/radio/public.d.ts.map +1 -0
  81. package/dist/features/form/radio/public.js +2 -0
  82. package/dist/features/form/radio/public.js.map +1 -0
  83. package/dist/features/form/radio/utils/isRadioTextContent.d.ts +4 -0
  84. package/dist/features/form/radio/utils/isRadioTextContent.d.ts.map +1 -0
  85. package/dist/features/form/radio/utils/isRadioTextContent.js +5 -0
  86. package/dist/features/form/radio/utils/isRadioTextContent.js.map +1 -0
  87. package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +5 -0
  88. package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -0
  89. package/dist/features/form/text-input/adapters/inbound/TextInput.js +41 -0
  90. package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -0
  91. package/dist/features/form/text-input/public.d.ts +3 -0
  92. package/dist/features/form/text-input/public.d.ts.map +1 -0
  93. package/dist/features/form/text-input/public.js +2 -0
  94. package/dist/features/form/text-input/public.js.map +1 -0
  95. package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts +15 -0
  96. package/dist/features/form/text-input/utils/resolveTextInputPresentation.d.ts.map +1 -0
  97. package/dist/features/form/text-input/utils/resolveTextInputPresentation.js +56 -0
  98. package/dist/features/form/text-input/utils/resolveTextInputPresentation.js.map +1 -0
  99. package/dist/features/icon/adapters/inbound/Icon.d.ts +4 -0
  100. package/dist/features/icon/adapters/inbound/Icon.d.ts.map +1 -0
  101. package/dist/{primitives/icon → features/icon/adapters/inbound}/Icon.js +3 -3
  102. package/dist/features/icon/adapters/inbound/Icon.js.map +1 -0
  103. package/dist/features/icon/adapters/inbound/PortableIcon.d.ts +19 -0
  104. package/dist/features/icon/adapters/inbound/PortableIcon.d.ts.map +1 -0
  105. package/dist/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.js +37 -43
  106. package/dist/features/icon/adapters/inbound/PortableIcon.js.map +1 -0
  107. package/dist/features/icon/constants.d.ts +2 -0
  108. package/dist/features/icon/constants.d.ts.map +1 -0
  109. package/dist/features/icon/constants.js +8 -0
  110. package/dist/features/icon/constants.js.map +1 -0
  111. package/dist/features/icon/public.d.ts +4 -0
  112. package/dist/features/icon/public.d.ts.map +1 -0
  113. package/dist/features/icon/public.js +3 -0
  114. package/dist/features/icon/public.js.map +1 -0
  115. package/dist/{primitives/image → features/image/adapters/inbound}/Image.d.ts +2 -1
  116. package/dist/features/image/adapters/inbound/Image.d.ts.map +1 -0
  117. package/dist/features/image/adapters/inbound/Image.js +28 -0
  118. package/dist/features/image/adapters/inbound/Image.js.map +1 -0
  119. package/dist/features/image/public.d.ts +3 -0
  120. package/dist/features/image/public.d.ts.map +1 -0
  121. package/dist/features/image/public.js +2 -0
  122. package/dist/features/image/public.js.map +1 -0
  123. package/dist/features/image/utils/getSourceKey.d.ts +4 -0
  124. package/dist/features/image/utils/getSourceKey.d.ts.map +1 -0
  125. package/dist/features/image/utils/getSourceKey.js +33 -0
  126. package/dist/features/image/utils/getSourceKey.js.map +1 -0
  127. package/dist/features/image/utils/normalizeSource.d.ts +5 -0
  128. package/dist/features/image/utils/normalizeSource.d.ts.map +1 -0
  129. package/dist/features/image/utils/normalizeSource.js +9 -0
  130. package/dist/features/image/utils/normalizeSource.js.map +1 -0
  131. package/dist/features/image/utils/resolveAccessibilityLabel.d.ts +4 -0
  132. package/dist/features/image/utils/resolveAccessibilityLabel.d.ts.map +1 -0
  133. package/dist/features/image/utils/resolveAccessibilityLabel.js +5 -0
  134. package/dist/features/image/utils/resolveAccessibilityLabel.js.map +1 -0
  135. package/dist/features/image/utils/resolveAlt.d.ts +4 -0
  136. package/dist/features/image/utils/resolveAlt.d.ts.map +1 -0
  137. package/dist/features/image/utils/resolveAlt.js +5 -0
  138. package/dist/features/image/utils/resolveAlt.js.map +1 -0
  139. package/dist/features/image/utils/resolveImageStyle.d.ts +6 -0
  140. package/dist/features/image/utils/resolveImageStyle.d.ts.map +1 -0
  141. package/dist/features/image/utils/resolveImageStyle.js +15 -0
  142. package/dist/features/image/utils/resolveImageStyle.js.map +1 -0
  143. package/dist/features/image/utils/resolveRenderedSource.d.ts +4 -0
  144. package/dist/features/image/utils/resolveRenderedSource.d.ts.map +1 -0
  145. package/dist/features/image/utils/resolveRenderedSource.js +7 -0
  146. package/dist/features/image/utils/resolveRenderedSource.js.map +1 -0
  147. package/dist/features/image/utils/resolveResizeMode.d.ts +5 -0
  148. package/dist/features/image/utils/resolveResizeMode.d.ts.map +1 -0
  149. package/dist/features/image/utils/resolveResizeMode.js +5 -0
  150. package/dist/features/image/utils/resolveResizeMode.js.map +1 -0
  151. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts +5 -0
  152. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.d.ts.map +1 -0
  153. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.js +7 -0
  154. package/dist/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.js.map +1 -0
  155. package/dist/features/keyboard-avoiding-view/public.d.ts +3 -0
  156. package/dist/features/keyboard-avoiding-view/public.d.ts.map +1 -0
  157. package/dist/features/keyboard-avoiding-view/public.js +2 -0
  158. package/dist/features/keyboard-avoiding-view/public.js.map +1 -0
  159. package/dist/features/layout/adapters/inbound/Box.d.ts +5 -0
  160. package/dist/features/layout/adapters/inbound/Box.d.ts.map +1 -0
  161. package/dist/{layout → features/layout/adapters/inbound}/Box.js +5 -4
  162. package/dist/features/layout/adapters/inbound/Box.js.map +1 -0
  163. package/dist/features/layout/adapters/inbound/Container.d.ts +5 -0
  164. package/dist/features/layout/adapters/inbound/Container.d.ts.map +1 -0
  165. package/dist/features/layout/adapters/inbound/Container.js +28 -0
  166. package/dist/features/layout/adapters/inbound/Container.js.map +1 -0
  167. package/dist/features/layout/adapters/inbound/Divider.d.ts +5 -0
  168. package/dist/features/layout/adapters/inbound/Divider.d.ts.map +1 -0
  169. package/dist/{layout → features/layout/adapters/inbound}/Divider.js +1 -0
  170. package/dist/features/layout/adapters/inbound/Divider.js.map +1 -0
  171. package/dist/features/layout/adapters/inbound/Grid.d.ts +5 -0
  172. package/dist/features/layout/adapters/inbound/Grid.d.ts.map +1 -0
  173. package/dist/features/layout/adapters/inbound/Grid.js +48 -0
  174. package/dist/features/layout/adapters/inbound/Grid.js.map +1 -0
  175. package/dist/features/layout/adapters/inbound/Stack.d.ts +5 -0
  176. package/dist/features/layout/adapters/inbound/Stack.d.ts.map +1 -0
  177. package/dist/{layout → features/layout/adapters/inbound}/Stack.js +4 -3
  178. package/dist/features/layout/adapters/inbound/Stack.js.map +1 -0
  179. package/dist/features/layout/public.d.ts +7 -0
  180. package/dist/features/layout/public.d.ts.map +1 -0
  181. package/dist/features/layout/public.js +6 -0
  182. package/dist/features/layout/public.js.map +1 -0
  183. package/dist/features/surface/adapters/inbound/Surface.d.ts +5 -0
  184. package/dist/features/surface/adapters/inbound/Surface.d.ts.map +1 -0
  185. package/dist/{layout → features/surface/adapters/inbound}/Surface.js +17 -28
  186. package/dist/features/surface/adapters/inbound/Surface.js.map +1 -0
  187. package/dist/features/surface/public.d.ts +3 -0
  188. package/dist/features/surface/public.d.ts.map +1 -0
  189. package/dist/features/surface/public.js +2 -0
  190. package/dist/features/surface/public.js.map +1 -0
  191. package/dist/features/typography/adapters/inbound/Heading.d.ts +5 -0
  192. package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -0
  193. package/dist/features/typography/adapters/inbound/Heading.js +29 -0
  194. package/dist/features/typography/adapters/inbound/Heading.js.map +1 -0
  195. package/dist/{primitives/text → features/typography/adapters/inbound}/Text.d.ts +2 -1
  196. package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -0
  197. package/dist/{primitives/text → features/typography/adapters/inbound}/Text.js +18 -25
  198. package/dist/features/typography/adapters/inbound/Text.js.map +1 -0
  199. package/dist/features/typography/public.d.ts +4 -0
  200. package/dist/features/typography/public.d.ts.map +1 -0
  201. package/dist/features/typography/public.js +3 -0
  202. package/dist/features/typography/public.js.map +1 -0
  203. package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts +7 -0
  204. package/dist/features/typography/utils/resolveHeadingTextStyle.d.ts.map +1 -0
  205. package/dist/features/typography/utils/resolveHeadingTextStyle.js +10 -0
  206. package/dist/features/typography/utils/resolveHeadingTextStyle.js.map +1 -0
  207. package/dist/index.d.ts +24 -22
  208. package/dist/index.d.ts.map +1 -1
  209. package/dist/index.js +12 -11
  210. package/dist/index.js.map +1 -1
  211. package/dist/layout/AppBar.d.ts +1 -1
  212. package/dist/layout/AppBar.d.ts.map +1 -1
  213. package/dist/layout/AppBar.js +1 -2
  214. package/dist/layout/AppBar.js.map +1 -1
  215. package/dist/layout/Center.d.ts +1 -1
  216. package/dist/layout/Center.d.ts.map +1 -1
  217. package/dist/layout/Center.js +1 -1
  218. package/dist/layout/Center.js.map +1 -1
  219. package/dist/layout/Inline.d.ts +1 -1
  220. package/dist/layout/Inline.d.ts.map +1 -1
  221. package/dist/layout/Inline.js +1 -1
  222. package/dist/layout/Inline.js.map +1 -1
  223. package/dist/layout/ScrollArea.d.ts +1 -1
  224. package/dist/layout/ScrollArea.d.ts.map +1 -1
  225. package/dist/layout/ScrollArea.js +1 -1
  226. package/dist/layout/ScrollArea.js.map +1 -1
  227. package/dist/layout/Spacer.d.ts +1 -1
  228. package/dist/layout/Spacer.d.ts.map +1 -1
  229. package/dist/layout/Spacer.js +1 -1
  230. package/dist/layout/Spacer.js.map +1 -1
  231. package/dist/layout/Template.d.ts +2 -2
  232. package/dist/layout/Template.d.ts.map +1 -1
  233. package/dist/layout/Template.js +2 -2
  234. package/dist/layout/Template.js.map +1 -1
  235. package/dist/layout/index.d.ts +0 -12
  236. package/dist/layout/index.d.ts.map +1 -1
  237. package/dist/layout/index.js +0 -6
  238. package/dist/layout/index.js.map +1 -1
  239. package/dist/primitives/button-base/ButtonBase.js +1 -1
  240. package/dist/primitives/button-base/ButtonBase.js.map +1 -1
  241. package/dist/primitives/button-base/types.d.ts +1 -1
  242. package/dist/primitives/button-base/types.d.ts.map +1 -1
  243. package/dist/primitives/button-base/types.js.map +1 -1
  244. package/dist/types/badge.d.ts +12 -0
  245. package/dist/types/badge.d.ts.map +1 -0
  246. package/dist/types/badge.js +2 -0
  247. package/dist/types/badge.js.map +1 -0
  248. package/dist/types/button.d.ts +25 -0
  249. package/dist/types/button.d.ts.map +1 -0
  250. package/dist/types/button.js +2 -0
  251. package/dist/types/button.js.map +1 -0
  252. package/dist/{components/card/types.d.ts → types/card.d.ts} +2 -2
  253. package/dist/types/card.d.ts.map +1 -0
  254. package/dist/types/card.js +2 -0
  255. package/dist/types/card.js.map +1 -0
  256. package/dist/{components/checkbox/types.d.ts → types/checkbox.d.ts} +4 -4
  257. package/dist/types/checkbox.d.ts.map +1 -0
  258. package/dist/types/checkbox.js +2 -0
  259. package/dist/types/checkbox.js.map +1 -0
  260. package/dist/types/icon.d.ts +66 -0
  261. package/dist/types/icon.d.ts.map +1 -0
  262. package/dist/types/icon.js +2 -0
  263. package/dist/types/icon.js.map +1 -0
  264. package/dist/{primitives/image/types.d.ts → types/image.d.ts} +3 -4
  265. package/dist/types/image.d.ts.map +1 -0
  266. package/dist/types/image.js +2 -0
  267. package/dist/types/image.js.map +1 -0
  268. package/dist/types/keyboard-avoiding-view.d.ts +4 -0
  269. package/dist/types/keyboard-avoiding-view.d.ts.map +1 -0
  270. package/dist/types/keyboard-avoiding-view.js +2 -0
  271. package/dist/types/keyboard-avoiding-view.js.map +1 -0
  272. package/dist/{layout/helpers.d.ts → types/layout.d.ts} +39 -5
  273. package/dist/types/layout.d.ts.map +1 -0
  274. package/dist/types/layout.js +2 -0
  275. package/dist/types/layout.js.map +1 -0
  276. package/dist/{components/radio/types.d.ts → types/radio.d.ts} +4 -4
  277. package/dist/types/radio.d.ts.map +1 -0
  278. package/dist/types/radio.js +2 -0
  279. package/dist/types/radio.js.map +1 -0
  280. package/dist/types/surface.d.ts +6 -0
  281. package/dist/types/surface.d.ts.map +1 -0
  282. package/dist/types/surface.js +2 -0
  283. package/dist/types/surface.js.map +1 -0
  284. package/dist/{components/text-input/types.d.ts → types/text-input.d.ts} +3 -3
  285. package/dist/types/text-input.d.ts.map +1 -0
  286. package/dist/types/text-input.js +2 -0
  287. package/dist/types/text-input.js.map +1 -0
  288. package/dist/types/typography.d.ts +29 -0
  289. package/dist/types/typography.d.ts.map +1 -0
  290. package/dist/types/typography.js +2 -0
  291. package/dist/types/typography.js.map +1 -0
  292. package/dist/utils/resolveBoxStyles.d.ts +7 -0
  293. package/dist/utils/resolveBoxStyles.d.ts.map +1 -0
  294. package/dist/utils/resolveBoxStyles.js +83 -0
  295. package/dist/utils/resolveBoxStyles.js.map +1 -0
  296. package/dist/utils/resolveSpacing.d.ts +5 -0
  297. package/dist/utils/resolveSpacing.d.ts.map +1 -0
  298. package/dist/utils/resolveSpacing.js +6 -0
  299. package/dist/utils/resolveSpacing.js.map +1 -0
  300. package/package.json +1 -1
  301. package/src/components/field/Field.tsx +1 -1
  302. package/src/components/helper-text/HelperText.tsx +1 -1
  303. package/src/components/label/Label.tsx +1 -1
  304. package/src/components/list-item/ListItem.tsx +2 -2
  305. package/src/components/menu/Menu.tsx +4 -2
  306. package/src/components/modal/Modal.tsx +2 -1
  307. package/src/components/switch/Switch.tsx +2 -2
  308. package/src/components/tabs/Tab.tsx +2 -2
  309. package/src/components/tabs/TabList.tsx +1 -1
  310. package/src/components/tabs/Tabs.tsx +1 -1
  311. package/src/components/textarea/Textarea.tsx +1 -1
  312. package/src/components/textarea/types.ts +1 -1
  313. package/src/components/toast/Toast.tsx +4 -2
  314. package/src/components/toast/ToastProvider.tsx +1 -1
  315. package/src/components/tooltip/Tooltip.tsx +2 -2
  316. package/src/examples/DocsExamples.tsx +6 -6
  317. package/src/features/badge/adapters/inbound/Badge.tsx +58 -0
  318. package/src/features/badge/public.ts +2 -0
  319. package/src/features/button/adapters/inbound/Button.tsx +159 -0
  320. package/src/features/button/adapters/inbound/IconButton.tsx +69 -0
  321. package/src/features/button/public.ts +3 -0
  322. package/src/features/card/adapters/inbound/Card.tsx +88 -0
  323. package/src/features/card/public.ts +2 -0
  324. package/src/features/form/checkbox/adapters/inbound/Checkbox.tsx +207 -0
  325. package/src/features/form/checkbox/public.ts +2 -0
  326. package/src/{components/radio → features/form/radio/adapters/inbound}/Radio.test.ts +5 -5
  327. package/src/features/form/radio/adapters/inbound/Radio.tsx +214 -0
  328. package/src/features/form/radio/public.ts +2 -0
  329. package/src/{components/radio → features/form/radio/utils}/isRadioTextContent.ts +1 -3
  330. package/src/features/form/text-input/adapters/inbound/TextInput.tsx +72 -0
  331. package/src/features/form/text-input/public.ts +2 -0
  332. package/src/features/form/text-input/utils/resolveTextInputPresentation.ts +91 -0
  333. package/src/features/icon/adapters/inbound/Icon.tsx +14 -0
  334. package/src/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.tsx +41 -97
  335. package/src/{primitives/icon → features/icon/adapters/inbound}/PortableIcon.web.test.tsx +6 -10
  336. package/src/features/icon/constants.ts +9 -0
  337. package/src/features/icon/public.ts +10 -0
  338. package/src/features/image/adapters/inbound/Image.tsx +55 -0
  339. package/src/features/image/public.ts +2 -0
  340. package/src/features/image/utils/getSourceKey.ts +32 -0
  341. package/src/features/image/utils/normalizeSource.ts +12 -0
  342. package/src/features/image/utils/resolveAccessibilityLabel.ts +9 -0
  343. package/src/features/image/utils/resolveAlt.ts +9 -0
  344. package/src/{primitives/image → features/image/utils}/resolveImageProps.test.ts +10 -22
  345. package/src/features/image/utils/resolveImageStyle.ts +23 -0
  346. package/src/features/image/utils/resolveRenderedSource.ts +11 -0
  347. package/src/features/image/utils/resolveResizeMode.ts +11 -0
  348. package/src/features/keyboard-avoiding-view/adapters/inbound/KeyboardAvoidingView.tsx +9 -0
  349. package/src/features/keyboard-avoiding-view/public.ts +5 -0
  350. package/src/{layout → features/layout/adapters/inbound}/Box.tsx +7 -15
  351. package/src/features/layout/adapters/inbound/Container.tsx +43 -0
  352. package/src/{layout → features/layout/adapters/inbound}/Divider.tsx +3 -8
  353. package/src/features/layout/adapters/inbound/Grid.tsx +78 -0
  354. package/src/{layout → features/layout/adapters/inbound}/Stack.test.ts +0 -1
  355. package/src/{layout → features/layout/adapters/inbound}/Stack.tsx +6 -15
  356. package/src/features/layout/public.ts +12 -0
  357. package/src/{layout → features/surface/adapters/inbound}/Surface.tsx +24 -41
  358. package/src/features/surface/public.ts +2 -0
  359. package/src/{primitives/heading → features/typography/adapters/inbound}/Heading.tsx +35 -38
  360. package/src/{primitives/text → features/typography/adapters/inbound}/Text.tsx +25 -35
  361. package/src/features/typography/public.ts +3 -0
  362. package/src/{primitives/heading/resolveHeadingStyle.test.ts → features/typography/utils/resolveHeadingTextStyle.test.ts} +5 -12
  363. package/src/features/typography/utils/resolveHeadingTextStyle.ts +21 -0
  364. package/src/index.test.ts +59 -19
  365. package/src/index.ts +37 -26
  366. package/src/layout/AppBar.tsx +1 -2
  367. package/src/layout/Center.tsx +1 -1
  368. package/src/layout/Inline.tsx +1 -1
  369. package/src/layout/ScrollArea.tsx +2 -1
  370. package/src/layout/Spacer.tsx +2 -2
  371. package/src/layout/Template.tsx +3 -2
  372. package/src/layout/index.ts +0 -12
  373. package/src/primitives/button-base/ButtonBase.tsx +1 -1
  374. package/src/primitives/button-base/types.ts +1 -1
  375. package/src/{components/badge/types.ts → types/badge.ts} +3 -3
  376. package/src/types/button.ts +34 -0
  377. package/src/{components/card/types.ts → types/card.ts} +1 -1
  378. package/src/{components/checkbox/types.ts → types/checkbox.ts} +3 -3
  379. package/src/types/icon.ts +52 -0
  380. package/src/{primitives/image/types.ts → types/image.ts} +3 -3
  381. package/src/types/keyboard-avoiding-view.ts +6 -0
  382. package/src/types/layout.ts +96 -0
  383. package/src/{components/radio/types.ts → types/radio.ts} +3 -3
  384. package/src/types/surface.ts +7 -0
  385. package/src/{components/text-input/types.ts → types/text-input.ts} +2 -2
  386. package/src/types/typography.ts +32 -0
  387. package/src/{layout/helpers.test.ts → utils/resolveBoxStyles.test.ts} +8 -25
  388. package/src/utils/resolveBoxStyles.ts +135 -0
  389. package/src/utils/resolveSpacing.ts +11 -0
  390. package/src/webAcceptance.test.tsx +18 -2
  391. package/dist/components/badge/Badge.d.ts +0 -4
  392. package/dist/components/badge/Badge.d.ts.map +0 -1
  393. package/dist/components/badge/Badge.js +0 -30
  394. package/dist/components/badge/Badge.js.map +0 -1
  395. package/dist/components/badge/index.d.ts +0 -3
  396. package/dist/components/badge/index.d.ts.map +0 -1
  397. package/dist/components/badge/index.js +0 -2
  398. package/dist/components/badge/index.js.map +0 -1
  399. package/dist/components/badge/types.d.ts +0 -12
  400. package/dist/components/badge/types.d.ts.map +0 -1
  401. package/dist/components/badge/types.js +0 -2
  402. package/dist/components/badge/types.js.map +0 -1
  403. package/dist/components/button/Button.d.ts.map +0 -1
  404. package/dist/components/button/Button.js +0 -51
  405. package/dist/components/button/Button.js.map +0 -1
  406. package/dist/components/button/index.d.ts +0 -3
  407. package/dist/components/button/index.d.ts.map +0 -1
  408. package/dist/components/button/index.js +0 -2
  409. package/dist/components/button/index.js.map +0 -1
  410. package/dist/components/button/types.d.ts +0 -18
  411. package/dist/components/button/types.d.ts.map +0 -1
  412. package/dist/components/button/types.js +0 -2
  413. package/dist/components/button/types.js.map +0 -1
  414. package/dist/components/card/Card.d.ts +0 -4
  415. package/dist/components/card/Card.d.ts.map +0 -1
  416. package/dist/components/card/Card.js +0 -46
  417. package/dist/components/card/Card.js.map +0 -1
  418. package/dist/components/card/index.d.ts +0 -3
  419. package/dist/components/card/index.d.ts.map +0 -1
  420. package/dist/components/card/index.js +0 -2
  421. package/dist/components/card/index.js.map +0 -1
  422. package/dist/components/card/types.d.ts.map +0 -1
  423. package/dist/components/card/types.js +0 -2
  424. package/dist/components/card/types.js.map +0 -1
  425. package/dist/components/checkbox/Checkbox.d.ts +0 -4
  426. package/dist/components/checkbox/Checkbox.d.ts.map +0 -1
  427. package/dist/components/checkbox/Checkbox.js +0 -69
  428. package/dist/components/checkbox/Checkbox.js.map +0 -1
  429. package/dist/components/checkbox/index.d.ts +0 -3
  430. package/dist/components/checkbox/index.d.ts.map +0 -1
  431. package/dist/components/checkbox/index.js +0 -2
  432. package/dist/components/checkbox/index.js.map +0 -1
  433. package/dist/components/checkbox/types.d.ts.map +0 -1
  434. package/dist/components/checkbox/types.js +0 -2
  435. package/dist/components/checkbox/types.js.map +0 -1
  436. package/dist/components/icon-button/IconButton.d.ts.map +0 -1
  437. package/dist/components/icon-button/IconButton.js +0 -28
  438. package/dist/components/icon-button/IconButton.js.map +0 -1
  439. package/dist/components/icon-button/index.d.ts +0 -3
  440. package/dist/components/icon-button/index.d.ts.map +0 -1
  441. package/dist/components/icon-button/index.js +0 -2
  442. package/dist/components/icon-button/index.js.map +0 -1
  443. package/dist/components/icon-button/types.d.ts +0 -13
  444. package/dist/components/icon-button/types.d.ts.map +0 -1
  445. package/dist/components/icon-button/types.js +0 -2
  446. package/dist/components/icon-button/types.js.map +0 -1
  447. package/dist/components/radio/Radio.d.ts +0 -7
  448. package/dist/components/radio/Radio.d.ts.map +0 -1
  449. package/dist/components/radio/Radio.js +0 -75
  450. package/dist/components/radio/Radio.js.map +0 -1
  451. package/dist/components/radio/index.d.ts +0 -3
  452. package/dist/components/radio/index.d.ts.map +0 -1
  453. package/dist/components/radio/index.js +0 -2
  454. package/dist/components/radio/index.js.map +0 -1
  455. package/dist/components/radio/isRadioTextContent.d.ts +0 -6
  456. package/dist/components/radio/isRadioTextContent.d.ts.map +0 -1
  457. package/dist/components/radio/isRadioTextContent.js +0 -7
  458. package/dist/components/radio/isRadioTextContent.js.map +0 -1
  459. package/dist/components/radio/types.d.ts.map +0 -1
  460. package/dist/components/radio/types.js +0 -2
  461. package/dist/components/radio/types.js.map +0 -1
  462. package/dist/components/text-input/TextInput.d.ts +0 -4
  463. package/dist/components/text-input/TextInput.d.ts.map +0 -1
  464. package/dist/components/text-input/TextInput.js +0 -72
  465. package/dist/components/text-input/TextInput.js.map +0 -1
  466. package/dist/components/text-input/index.d.ts +0 -3
  467. package/dist/components/text-input/index.d.ts.map +0 -1
  468. package/dist/components/text-input/index.js +0 -2
  469. package/dist/components/text-input/index.js.map +0 -1
  470. package/dist/components/text-input/types.d.ts.map +0 -1
  471. package/dist/components/text-input/types.js +0 -2
  472. package/dist/components/text-input/types.js.map +0 -1
  473. package/dist/layout/Box.d.ts +0 -14
  474. package/dist/layout/Box.d.ts.map +0 -1
  475. package/dist/layout/Box.js.map +0 -1
  476. package/dist/layout/Container.d.ts +0 -11
  477. package/dist/layout/Container.d.ts.map +0 -1
  478. package/dist/layout/Container.js +0 -24
  479. package/dist/layout/Container.js.map +0 -1
  480. package/dist/layout/Divider.d.ts +0 -10
  481. package/dist/layout/Divider.d.ts.map +0 -1
  482. package/dist/layout/Divider.js.map +0 -1
  483. package/dist/layout/Grid.d.ts +0 -14
  484. package/dist/layout/Grid.d.ts.map +0 -1
  485. package/dist/layout/Grid.js +0 -51
  486. package/dist/layout/Grid.js.map +0 -1
  487. package/dist/layout/Stack.d.ts +0 -14
  488. package/dist/layout/Stack.d.ts.map +0 -1
  489. package/dist/layout/Stack.js.map +0 -1
  490. package/dist/layout/Surface.d.ts +0 -8
  491. package/dist/layout/Surface.d.ts.map +0 -1
  492. package/dist/layout/Surface.js.map +0 -1
  493. package/dist/layout/helpers.d.ts.map +0 -1
  494. package/dist/layout/helpers.js +0 -91
  495. package/dist/layout/helpers.js.map +0 -1
  496. package/dist/primitives/heading/Heading.d.ts +0 -4
  497. package/dist/primitives/heading/Heading.d.ts.map +0 -1
  498. package/dist/primitives/heading/Heading.js +0 -30
  499. package/dist/primitives/heading/Heading.js.map +0 -1
  500. package/dist/primitives/heading/index.d.ts +0 -3
  501. package/dist/primitives/heading/index.d.ts.map +0 -1
  502. package/dist/primitives/heading/index.js +0 -2
  503. package/dist/primitives/heading/index.js.map +0 -1
  504. package/dist/primitives/heading/resolveHeadingStyle.d.ts +0 -6
  505. package/dist/primitives/heading/resolveHeadingStyle.d.ts.map +0 -1
  506. package/dist/primitives/heading/resolveHeadingStyle.js +0 -9
  507. package/dist/primitives/heading/resolveHeadingStyle.js.map +0 -1
  508. package/dist/primitives/heading/types.d.ts +0 -15
  509. package/dist/primitives/heading/types.d.ts.map +0 -1
  510. package/dist/primitives/heading/types.js +0 -2
  511. package/dist/primitives/heading/types.js.map +0 -1
  512. package/dist/primitives/icon/Icon.d.ts +0 -16
  513. package/dist/primitives/icon/Icon.d.ts.map +0 -1
  514. package/dist/primitives/icon/Icon.js.map +0 -1
  515. package/dist/primitives/icon/PortableIcon.d.ts +0 -70
  516. package/dist/primitives/icon/PortableIcon.d.ts.map +0 -1
  517. package/dist/primitives/icon/PortableIcon.js.map +0 -1
  518. package/dist/primitives/icon/index.d.ts +0 -4
  519. package/dist/primitives/icon/index.d.ts.map +0 -1
  520. package/dist/primitives/icon/index.js +0 -3
  521. package/dist/primitives/icon/index.js.map +0 -1
  522. package/dist/primitives/image/Image.d.ts.map +0 -1
  523. package/dist/primitives/image/Image.js +0 -26
  524. package/dist/primitives/image/Image.js.map +0 -1
  525. package/dist/primitives/image/index.d.ts +0 -3
  526. package/dist/primitives/image/index.d.ts.map +0 -1
  527. package/dist/primitives/image/index.js +0 -2
  528. package/dist/primitives/image/index.js.map +0 -1
  529. package/dist/primitives/image/resolveImageProps.d.ts +0 -12
  530. package/dist/primitives/image/resolveImageProps.d.ts.map +0 -1
  531. package/dist/primitives/image/resolveImageProps.js +0 -67
  532. package/dist/primitives/image/resolveImageProps.js.map +0 -1
  533. package/dist/primitives/image/types.d.ts.map +0 -1
  534. package/dist/primitives/image/types.js +0 -2
  535. package/dist/primitives/image/types.js.map +0 -1
  536. package/dist/primitives/text/Text.d.ts.map +0 -1
  537. package/dist/primitives/text/Text.js.map +0 -1
  538. package/dist/primitives/text/index.d.ts +0 -3
  539. package/dist/primitives/text/index.d.ts.map +0 -1
  540. package/dist/primitives/text/index.js +0 -2
  541. package/dist/primitives/text/index.js.map +0 -1
  542. package/dist/primitives/text/types.d.ts +0 -17
  543. package/dist/primitives/text/types.d.ts.map +0 -1
  544. package/dist/primitives/text/types.js +0 -2
  545. package/dist/primitives/text/types.js.map +0 -1
  546. package/src/components/badge/Badge.tsx +0 -52
  547. package/src/components/badge/index.ts +0 -2
  548. package/src/components/button/Button.tsx +0 -98
  549. package/src/components/button/index.ts +0 -2
  550. package/src/components/button/types.ts +0 -23
  551. package/src/components/card/Card.tsx +0 -81
  552. package/src/components/card/index.ts +0 -2
  553. package/src/components/checkbox/Checkbox.tsx +0 -120
  554. package/src/components/checkbox/index.ts +0 -2
  555. package/src/components/icon-button/IconButton.tsx +0 -55
  556. package/src/components/icon-button/index.ts +0 -2
  557. package/src/components/icon-button/types.ts +0 -16
  558. package/src/components/radio/Radio.tsx +0 -124
  559. package/src/components/radio/index.ts +0 -2
  560. package/src/components/text-input/TextInput.tsx +0 -124
  561. package/src/components/text-input/index.ts +0 -2
  562. package/src/layout/Container.tsx +0 -43
  563. package/src/layout/Grid.tsx +0 -83
  564. package/src/layout/helpers.ts +0 -205
  565. package/src/primitives/heading/index.ts +0 -2
  566. package/src/primitives/heading/resolveHeadingStyle.ts +0 -20
  567. package/src/primitives/heading/types.ts +0 -17
  568. package/src/primitives/icon/Icon.tsx +0 -34
  569. package/src/primitives/icon/index.ts +0 -10
  570. package/src/primitives/image/Image.tsx +0 -65
  571. package/src/primitives/image/index.ts +0 -2
  572. package/src/primitives/image/resolveImageProps.ts +0 -92
  573. package/src/primitives/text/index.ts +0 -2
  574. package/src/primitives/text/types.ts +0 -18
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/types/layout.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { StyleProp, ViewProps as ReactNativeViewProps, ViewStyle } from 'react-native';\n\nimport type { Responsive } from '../core/responsive';\nimport type { SurfaceTheme } from '../theme/types';\n\ntype SpaceToken = keyof SurfaceTheme['spacing'];\ntype RadiusToken = keyof SurfaceTheme['radii'];\ntype ColorToken = keyof SurfaceTheme['colors'];\ntype RadiusValue = number | RadiusToken;\n\nexport type SpaceValue = number | SpaceToken;\nexport type ColorValue = string | ColorToken;\n\nexport interface BoxStyleProps {\n p?: Responsive<SpaceValue>;\n px?: Responsive<SpaceValue>;\n py?: Responsive<SpaceValue>;\n pt?: Responsive<SpaceValue>;\n pb?: Responsive<SpaceValue>;\n pl?: Responsive<SpaceValue>;\n pr?: Responsive<SpaceValue>;\n m?: Responsive<SpaceValue>;\n mx?: Responsive<SpaceValue>;\n my?: Responsive<SpaceValue>;\n mt?: Responsive<SpaceValue>;\n mb?: Responsive<SpaceValue>;\n ml?: Responsive<SpaceValue>;\n mr?: Responsive<SpaceValue>;\n bg?: Responsive<ColorValue>;\n radius?: Responsive<RadiusValue>;\n borderWidth?: Responsive<number>;\n borderColor?: Responsive<ColorValue>;\n width?: Responsive<number | string>;\n height?: Responsive<number | string>;\n minWidth?: Responsive<number | string>;\n maxWidth?: Responsive<number | string>;\n minHeight?: Responsive<number | string>;\n maxHeight?: Responsive<number | string>;\n flex?: Responsive<number>;\n flexGrow?: Responsive<number>;\n flexShrink?: Responsive<number>;\n flexBasis?: Responsive<number | string>;\n alignSelf?: Responsive<ViewStyle['alignSelf']>;\n position?: Responsive<ViewStyle['position']>;\n top?: Responsive<number>;\n bottom?: Responsive<number>;\n left?: Responsive<number>;\n right?: Responsive<number>;\n overflow?: Responsive<ViewStyle['overflow']>;\n zIndex?: Responsive<number>;\n opacity?: Responsive<number>;\n style?: StyleProp<ViewStyle>;\n}\n\nexport interface BoxProps extends BoxStyleProps {\n accessibilityLabel?: ReactNativeViewProps['accessibilityLabel'];\n accessibilityRole?: ReactNativeViewProps['accessibilityRole'];\n accessibilityState?: ReactNativeViewProps['accessibilityState'];\n accessible?: ReactNativeViewProps['accessible'];\n children?: React.ReactNode;\n pointerEvents?: ReactNativeViewProps['pointerEvents'];\n testID?: string;\n}\n\nexport interface ContainerProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n maxWidth?: Responsive<number>;\n px?: Responsive<number | keyof SurfaceTheme['spacing']>;\n}\n\nexport interface DividerProps extends Omit<BoxProps, 'bg' | 'height' | 'width'> {\n orientation?: 'horizontal' | 'vertical';\n color?: ColorValue;\n thickness?: number;\n}\n\nexport interface GridProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n cols: Responsive<number>;\n gap?: Responsive<SpaceValue>;\n rowGap?: Responsive<SpaceValue>;\n colGap?: Responsive<SpaceValue>;\n minItemWidth?: Responsive<number>;\n}\n\nexport interface StackProps extends Omit<BoxProps, 'children'> {\n children?: React.ReactNode;\n direction?: Responsive<'row' | 'column'>;\n gap?: Responsive<SpaceValue>;\n align?: Responsive<'flex-start' | 'center' | 'flex-end' | 'stretch' | 'baseline'>;\n justify?: Responsive<\n 'flex-start' | 'center' | 'flex-end' | 'space-between' | 'space-around' | 'space-evenly'\n >;\n wrap?: Responsive<'nowrap' | 'wrap'>;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
- import type { ControlSize } from '../../internal/resolvers/resolveControlSize';
3
- import type { ButtonBaseProps } from '../../primitives/button-base';
4
- import type { SurfaceColor } from '../../surfaceColor';
2
+ import type { ControlSize } from '../internal/resolvers/resolveControlSize';
3
+ import type { ButtonBaseProps } from '../primitives/button-base';
4
+ import type { SurfaceColor } from '../surfaceColor';
5
5
  export interface RadioProps extends Omit<ButtonBaseProps, 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'> {
6
6
  children?: React.ReactNode;
7
7
  checked?: boolean;
@@ -12,4 +12,4 @@ export interface RadioProps extends Omit<ButtonBaseProps, 'accessibilityRole' |
12
12
  invalid?: boolean;
13
13
  readOnly?: boolean;
14
14
  }
15
- //# sourceMappingURL=types.d.ts.map
15
+ //# sourceMappingURL=radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.d.ts","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,WAAW,UAAW,SAAQ,IAAI,CACtC,eAAe,EACf,mBAAmB,GAAG,oBAAoB,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAC9E;IACC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAC3D,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/types/radio.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\n\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\nimport type { ButtonBaseProps } from '../primitives/button-base';\nimport type { SurfaceColor } from '../surfaceColor';\n\nexport interface RadioProps extends Omit<\n ButtonBaseProps,\n 'accessibilityRole' | 'accessibilityState' | 'children' | 'onPress' | 'style'\n> {\n children?: React.ReactNode;\n checked?: boolean;\n defaultChecked?: boolean;\n onCheckedChange?: ((checked: boolean) => void) | undefined;\n color?: SurfaceColor;\n size?: ControlSize;\n invalid?: boolean;\n readOnly?: boolean;\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import type { BoxProps } from './layout';
2
+ export type SurfaceVariant = 'default' | 'subtle' | 'raised' | 'outline';
3
+ export interface SurfaceProps extends Omit<BoxProps, 'bg' | 'borderColor' | 'borderWidth'> {
4
+ variant?: SurfaceVariant;
5
+ }
6
+ //# sourceMappingURL=surface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.d.ts","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,aAAa,GAAG,aAAa,CAAC;IACxF,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=surface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surface.js","sourceRoot":"","sources":["../../src/types/surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { BoxProps } from './layout';\n\nexport type SurfaceVariant = 'default' | 'subtle' | 'raised' | 'outline';\n\nexport interface SurfaceProps extends Omit<BoxProps, 'bg' | 'borderColor' | 'borderWidth'> {\n variant?: SurfaceVariant;\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type React from 'react';
2
2
  import type { StyleProp, TextInputProps as ReactNativeTextInputProps, TextStyle } from 'react-native';
3
- import type { InteractionPolicy } from '../../interactionPolicy';
4
- import type { ControlSize } from '../../internal/resolvers/resolveControlSize';
3
+ import type { InteractionPolicy } from '../interactionPolicy';
4
+ import type { ControlSize } from '../internal/resolvers/resolveControlSize';
5
5
  export interface TextInputProps extends Omit<ReactNativeTextInputProps, 'defaultValue' | 'editable' | 'onChangeText' | 'placeholderTextColor' | 'style' | 'testID' | 'value'> {
6
6
  value?: string;
7
7
  defaultValue?: string;
@@ -17,4 +17,4 @@ export interface TextInputProps extends Omit<ReactNativeTextInputProps, 'default
17
17
  style?: StyleProp<TextStyle>;
18
18
  testID?: string;
19
19
  }
20
- //# sourceMappingURL=types.d.ts.map
20
+ //# sourceMappingURL=text-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-input.d.ts","sourceRoot":"","sources":["../../src/types/text-input.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EACV,SAAS,EACT,cAAc,IAAI,yBAAyB,EAC3C,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,yBAAyB,EACvB,cAAc,GACd,UAAU,GACV,cAAc,GACd,sBAAsB,GACtB,OAAO,GACP,QAAQ,GACR,OAAO,CACV;IACC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACpC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=text-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../src/types/text-input.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type {\n StyleProp,\n TextInputProps as ReactNativeTextInputProps,\n TextStyle,\n} from 'react-native';\n\nimport type { InteractionPolicy } from '../interactionPolicy';\nimport type { ControlSize } from '../internal/resolvers/resolveControlSize';\n\nexport interface TextInputProps extends Omit<\n ReactNativeTextInputProps,\n | 'defaultValue'\n | 'editable'\n | 'onChangeText'\n | 'placeholderTextColor'\n | 'style'\n | 'testID'\n | 'value'\n> {\n value?: string;\n defaultValue?: string;\n onChangeText?: ((text: string) => void) | undefined;\n placeholder?: string;\n size?: ControlSize;\n disabled?: boolean;\n readOnly?: boolean;\n invalid?: boolean;\n leadingAccessory?: React.ReactNode;\n trailingAccessory?: React.ReactNode;\n interactionPolicy?: InteractionPolicy;\n style?: StyleProp<TextStyle>;\n testID?: string;\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import type React from 'react';
2
+ import type { TextStyle } from 'react-native';
3
+ import type { TextVariant, TextWeight } from '../internal/resolvers/resolveTextStyles';
4
+ import type { SurfaceColor, SurfaceEmphasis } from '../surfaceColor';
5
+ export type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
6
+ export interface HeadingProps {
7
+ text?: string;
8
+ children?: React.ReactNode;
9
+ level?: HeadingLevel;
10
+ align?: 'auto' | 'left' | 'right' | 'center' | 'justify';
11
+ color?: SurfaceColor;
12
+ emphasis?: SurfaceEmphasis;
13
+ numberOfLines?: number;
14
+ i18nKey?: string;
15
+ testID?: string;
16
+ }
17
+ export interface TextProps {
18
+ children?: React.ReactNode;
19
+ i18nKey?: string;
20
+ variant?: TextVariant;
21
+ emphasis?: SurfaceEmphasis;
22
+ color?: SurfaceColor;
23
+ align?: TextStyle['textAlign'];
24
+ weight?: TextWeight;
25
+ italic?: boolean;
26
+ numberOfLines?: number;
27
+ testID?: string;
28
+ }
29
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/types/typography.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;IACzD,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.js","sourceRoot":"","sources":["../../src/types/typography.ts"],"names":[],"mappings":"","sourcesContent":["import type React from 'react';\nimport type { TextStyle } from 'react-native';\n\nimport type { TextVariant, TextWeight } from '../internal/resolvers/resolveTextStyles';\nimport type { SurfaceColor, SurfaceEmphasis } from '../surfaceColor';\n\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport interface HeadingProps {\n text?: string;\n children?: React.ReactNode;\n level?: HeadingLevel;\n align?: 'auto' | 'left' | 'right' | 'center' | 'justify';\n color?: SurfaceColor;\n emphasis?: SurfaceEmphasis;\n numberOfLines?: number;\n i18nKey?: string;\n testID?: string;\n}\n\nexport interface TextProps {\n children?: React.ReactNode;\n i18nKey?: string;\n variant?: TextVariant;\n emphasis?: SurfaceEmphasis;\n color?: SurfaceColor;\n align?: TextStyle['textAlign'];\n weight?: TextWeight;\n italic?: boolean;\n numberOfLines?: number;\n testID?: string;\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { ViewStyle } from 'react-native';
2
+ import type { Breakpoint } from '../core/responsive/types';
3
+ import type { SurfaceTheme } from '../theme/types';
4
+ import type { BoxStyleProps } from '../types/layout';
5
+ /*** Resolves responsive Box style props into one React Native view style. */
6
+ export declare function resolveBoxStyles(theme: SurfaceTheme, breakpoint: Breakpoint, props: BoxStyleProps): ViewStyle;
7
+ //# sourceMappingURL=resolveBoxStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveBoxStyles.d.ts","sourceRoot":"","sources":["../../src/utils/resolveBoxStyles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAc,MAAM,iBAAiB,CAAC;AAGjE,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,aAAa,GACnB,SAAS,CAQX"}
@@ -0,0 +1,83 @@
1
+ import { resolveResponsive } from '../core/responsive/resolve';
2
+ import { resolveToken } from '../theme/resolveToken';
3
+ import { resolveSpacing } from './resolveSpacing';
4
+ /*** Resolves responsive Box style props into one React Native view style. */
5
+ export function resolveBoxStyles(theme, breakpoint, props) {
6
+ return {
7
+ elevation: 0,
8
+ ...resolveSpacingStyles(theme, breakpoint, props),
9
+ ...resolveVisualStyles(theme, breakpoint, props),
10
+ ...resolveDimensionStyles(theme, breakpoint, props),
11
+ ...resolveLayoutStyles(breakpoint, props),
12
+ };
13
+ }
14
+ /*** Resolves padding and margin styles from responsive spacing props. */
15
+ function resolveSpacingStyles(theme, breakpoint, props) {
16
+ return {
17
+ padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),
18
+ paddingHorizontal: resolveSpacing(theme, resolveResponsive(props.px, breakpoint)),
19
+ paddingVertical: resolveSpacing(theme, resolveResponsive(props.py, breakpoint)),
20
+ paddingTop: resolveSpacing(theme, resolveResponsive(props.pt, breakpoint)),
21
+ paddingBottom: resolveSpacing(theme, resolveResponsive(props.pb, breakpoint)),
22
+ paddingLeft: resolveSpacing(theme, resolveResponsive(props.pl, breakpoint)),
23
+ paddingRight: resolveSpacing(theme, resolveResponsive(props.pr, breakpoint)),
24
+ margin: resolveSpacing(theme, resolveResponsive(props.m, breakpoint)),
25
+ marginHorizontal: resolveSpacing(theme, resolveResponsive(props.mx, breakpoint)),
26
+ marginVertical: resolveSpacing(theme, resolveResponsive(props.my, breakpoint)),
27
+ marginTop: resolveSpacing(theme, resolveResponsive(props.mt, breakpoint)),
28
+ marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),
29
+ marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),
30
+ marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),
31
+ };
32
+ }
33
+ /*** Resolves background, radius, and border styles. */
34
+ function resolveVisualStyles(theme, breakpoint, props) {
35
+ return {
36
+ backgroundColor: resolveColor(theme, resolveResponsive(props.bg, breakpoint)),
37
+ borderRadius: resolveRadius(theme, resolveResponsive(props.radius, breakpoint)),
38
+ borderWidth: resolveResponsive(props.borderWidth, breakpoint),
39
+ borderColor: resolveColor(theme, resolveResponsive(props.borderColor, breakpoint)),
40
+ };
41
+ }
42
+ /*** Resolves responsive dimension props through spacing tokens. */
43
+ function resolveDimensionStyles(theme, breakpoint, props) {
44
+ return {
45
+ width: resolveDimension(theme, resolveResponsive(props.width, breakpoint)),
46
+ height: resolveDimension(theme, resolveResponsive(props.height, breakpoint)),
47
+ minWidth: resolveDimension(theme, resolveResponsive(props.minWidth, breakpoint)),
48
+ maxWidth: resolveDimension(theme, resolveResponsive(props.maxWidth, breakpoint)),
49
+ minHeight: resolveDimension(theme, resolveResponsive(props.minHeight, breakpoint)),
50
+ maxHeight: resolveDimension(theme, resolveResponsive(props.maxHeight, breakpoint)),
51
+ };
52
+ }
53
+ /*** Resolves responsive flex, positioning, and visibility styles. */
54
+ function resolveLayoutStyles(breakpoint, props) {
55
+ return {
56
+ flex: resolveResponsive(props.flex, breakpoint),
57
+ flexGrow: resolveResponsive(props.flexGrow, breakpoint),
58
+ flexShrink: resolveResponsive(props.flexShrink, breakpoint),
59
+ flexBasis: resolveResponsive(props.flexBasis, breakpoint),
60
+ alignSelf: resolveResponsive(props.alignSelf, breakpoint),
61
+ position: resolveResponsive(props.position, breakpoint),
62
+ top: resolveResponsive(props.top, breakpoint),
63
+ bottom: resolveResponsive(props.bottom, breakpoint),
64
+ left: resolveResponsive(props.left, breakpoint),
65
+ right: resolveResponsive(props.right, breakpoint),
66
+ overflow: resolveResponsive(props.overflow, breakpoint),
67
+ zIndex: resolveResponsive(props.zIndex, breakpoint),
68
+ opacity: resolveResponsive(props.opacity, breakpoint),
69
+ };
70
+ }
71
+ /*** Resolves a Surface radius token or raw number. */
72
+ function resolveRadius(theme, value) {
73
+ return resolveToken(theme.radii, value);
74
+ }
75
+ /*** Resolves a Surface color token while preserving arbitrary color strings. */
76
+ function resolveColor(theme, value) {
77
+ return resolveToken(theme.colors, value);
78
+ }
79
+ /*** Resolves spacing-token dimensions while preserving raw dimension strings. */
80
+ function resolveDimension(theme, value) {
81
+ return resolveToken(theme.spacing, value);
82
+ }
83
+ //# sourceMappingURL=resolveBoxStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveBoxStyles.js","sourceRoot":"","sources":["../../src/utils/resolveBoxStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import type { ViewStyle } from 'react-native';\n\nimport { resolveResponsive } from '../core/responsive/resolve';\nimport type { Breakpoint } from '../core/responsive/types';\nimport { resolveToken } from '../theme/resolveToken';\nimport type { SurfaceTheme } from '../theme/types';\nimport type { BoxStyleProps, ColorValue } from '../types/layout';\nimport { resolveSpacing } from './resolveSpacing';\n\n/*** Resolves responsive Box style props into one React Native view style. */\nexport function resolveBoxStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: BoxStyleProps,\n): ViewStyle {\n return {\n elevation: 0,\n ...resolveSpacingStyles(theme, breakpoint, props),\n ...resolveVisualStyles(theme, breakpoint, props),\n ...resolveDimensionStyles(theme, breakpoint, props),\n ...resolveLayoutStyles(breakpoint, props),\n };\n}\n\n/*** Resolves padding and margin styles from responsive spacing props. */\nfunction resolveSpacingStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: BoxStyleProps,\n): ViewStyle {\n return {\n padding: resolveSpacing(theme, resolveResponsive(props.p, breakpoint)),\n paddingHorizontal: resolveSpacing(theme, resolveResponsive(props.px, breakpoint)),\n paddingVertical: resolveSpacing(theme, resolveResponsive(props.py, breakpoint)),\n paddingTop: resolveSpacing(theme, resolveResponsive(props.pt, breakpoint)),\n paddingBottom: resolveSpacing(theme, resolveResponsive(props.pb, breakpoint)),\n paddingLeft: resolveSpacing(theme, resolveResponsive(props.pl, breakpoint)),\n paddingRight: resolveSpacing(theme, resolveResponsive(props.pr, breakpoint)),\n margin: resolveSpacing(theme, resolveResponsive(props.m, breakpoint)),\n marginHorizontal: resolveSpacing(theme, resolveResponsive(props.mx, breakpoint)),\n marginVertical: resolveSpacing(theme, resolveResponsive(props.my, breakpoint)),\n marginTop: resolveSpacing(theme, resolveResponsive(props.mt, breakpoint)),\n marginBottom: resolveSpacing(theme, resolveResponsive(props.mb, breakpoint)),\n marginLeft: resolveSpacing(theme, resolveResponsive(props.ml, breakpoint)),\n marginRight: resolveSpacing(theme, resolveResponsive(props.mr, breakpoint)),\n };\n}\n\n/*** Resolves background, radius, and border styles. */\nfunction resolveVisualStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: BoxStyleProps,\n): ViewStyle {\n return {\n backgroundColor: resolveColor(theme, resolveResponsive(props.bg, breakpoint)),\n borderRadius: resolveRadius(theme, resolveResponsive(props.radius, breakpoint)),\n borderWidth: resolveResponsive(props.borderWidth, breakpoint),\n borderColor: resolveColor(theme, resolveResponsive(props.borderColor, breakpoint)),\n };\n}\n\n/*** Resolves responsive dimension props through spacing tokens. */\nfunction resolveDimensionStyles(\n theme: SurfaceTheme,\n breakpoint: Breakpoint,\n props: BoxStyleProps,\n): ViewStyle {\n return {\n width: resolveDimension(\n theme,\n resolveResponsive(props.width, breakpoint),\n ) as ViewStyle['width'],\n height: resolveDimension(\n theme,\n resolveResponsive(props.height, breakpoint),\n ) as ViewStyle['height'],\n minWidth: resolveDimension(\n theme,\n resolveResponsive(props.minWidth, breakpoint),\n ) as ViewStyle['minWidth'],\n maxWidth: resolveDimension(\n theme,\n resolveResponsive(props.maxWidth, breakpoint),\n ) as ViewStyle['maxWidth'],\n minHeight: resolveDimension(\n theme,\n resolveResponsive(props.minHeight, breakpoint),\n ) as ViewStyle['minHeight'],\n maxHeight: resolveDimension(\n theme,\n resolveResponsive(props.maxHeight, breakpoint),\n ) as ViewStyle['maxHeight'],\n };\n}\n\n/*** Resolves responsive flex, positioning, and visibility styles. */\nfunction resolveLayoutStyles(breakpoint: Breakpoint, props: BoxStyleProps): ViewStyle {\n return {\n flex: resolveResponsive(props.flex, breakpoint),\n flexGrow: resolveResponsive(props.flexGrow, breakpoint),\n flexShrink: resolveResponsive(props.flexShrink, breakpoint),\n flexBasis: resolveResponsive(props.flexBasis, breakpoint) as ViewStyle['flexBasis'],\n alignSelf: resolveResponsive(props.alignSelf, breakpoint),\n position: resolveResponsive(props.position, breakpoint),\n top: resolveResponsive(props.top, breakpoint),\n bottom: resolveResponsive(props.bottom, breakpoint),\n left: resolveResponsive(props.left, breakpoint),\n right: resolveResponsive(props.right, breakpoint),\n overflow: resolveResponsive(props.overflow, breakpoint),\n zIndex: resolveResponsive(props.zIndex, breakpoint),\n opacity: resolveResponsive(props.opacity, breakpoint),\n };\n}\n\n/*** Resolves a Surface radius token or raw number. */\nfunction resolveRadius(\n theme: SurfaceTheme,\n value: number | keyof SurfaceTheme['radii'] | undefined,\n): number | undefined {\n return resolveToken(theme.radii, value);\n}\n\n/*** Resolves a Surface color token while preserving arbitrary color strings. */\nfunction resolveColor(theme: SurfaceTheme, value: ColorValue | undefined): string | undefined {\n return resolveToken(theme.colors, value);\n}\n\n/*** Resolves spacing-token dimensions while preserving raw dimension strings. */\nfunction resolveDimension(\n theme: SurfaceTheme,\n value: number | string | undefined,\n): number | string | undefined {\n return resolveToken(theme.spacing, value);\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { SurfaceTheme } from '../theme/types';
2
+ import type { SpaceValue } from '../types/layout';
3
+ /*** Resolves a numeric spacing value or a Surface spacing token. */
4
+ export declare function resolveSpacing(theme: SurfaceTheme, value: SpaceValue | undefined): number | undefined;
5
+ //# sourceMappingURL=resolveSpacing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveSpacing.d.ts","sourceRoot":"","sources":["../../src/utils/resolveSpacing.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,oEAAoE;AACpE,wBAAgB,cAAc,CAC5B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,UAAU,GAAG,SAAS,GAC5B,MAAM,GAAG,SAAS,CAEpB"}
@@ -0,0 +1,6 @@
1
+ import { resolveToken } from '../theme/resolveToken';
2
+ /*** Resolves a numeric spacing value or a Surface spacing token. */
3
+ export function resolveSpacing(theme, value) {
4
+ return resolveToken(theme.spacing, value);
5
+ }
6
+ //# sourceMappingURL=resolveSpacing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveSpacing.js","sourceRoot":"","sources":["../../src/utils/resolveSpacing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,oEAAoE;AACpE,MAAM,UAAU,cAAc,CAC5B,KAAmB,EACnB,KAA6B;IAE7B,OAAO,YAAY,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import { resolveToken } from '../theme/resolveToken';\nimport type { SurfaceTheme } from '../theme/types';\nimport type { SpaceValue } from '../types/layout';\n\n/*** Resolves a numeric spacing value or a Surface spacing token. */\nexport function resolveSpacing(\n theme: SurfaceTheme,\n value: SpaceValue | undefined,\n): number | undefined {\n return resolveToken(theme.spacing, value);\n}\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/surface",
3
3
  "type": "module",
4
- "version": "4.1.0",
4
+ "version": "4.2.1",
5
5
  "description": "Stable UI foundation for React Native and React Native Web.",
6
6
  "homepage": "https://github.com/ankhorage/surface#readme",
7
7
  "bugs": {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Box, Stack } from '../../features/layout/public';
3
4
  import { resolveFieldPresentation, resolveFieldState } from '../../internal/resolvers';
4
- import { Box, Stack } from '../../layout';
5
5
  import { HelperText } from '../helper-text';
6
6
  import { Label } from '../label';
7
7
  import type { FieldProps } from './types';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Text } from '../../primitives/text';
3
+ import { Text } from '../../features/typography/public';
4
4
  import type { HelperTextProps } from './types';
5
5
 
6
6
  export function HelperText({ children, emphasis = 'muted', color, testID }: HelperTextProps) {
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Text } from '../../primitives/text';
3
+ import { Text } from '../../features/typography/public';
4
4
  import type { LabelProps } from './types';
5
5
 
6
6
  export function Label({
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
2
  import { View } from 'react-native';
3
3
 
4
- import { Box } from '../../layout';
4
+ import { Box } from '../../features/layout/public';
5
+ import { Text } from '../../features/typography/public';
5
6
  import { ButtonBase } from '../../primitives/button-base';
6
- import { Text } from '../../primitives/text';
7
7
  import { useTheme } from '../../theme/ThemeContext';
8
8
  import type { ListItemProps } from './types';
9
9
 
@@ -1,14 +1,16 @@
1
1
  import React from 'react';
2
2
  import { type LayoutRectangle, Pressable, View } from 'react-native';
3
3
 
4
+ import { Box, Stack } from '../../features/layout/public';
5
+ import { Surface } from '../../features/surface/public';
6
+ import { Text } from '../../features/typography/public';
4
7
  import { FocusScope } from '../../internal/focus/FocusScope';
5
8
  import { useFocusManager } from '../../internal/focus/useFocusManager';
6
9
  import { Portal } from '../../internal/overlay/Portal';
7
10
  import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
8
11
  import { resolveOverlayAnimation } from '../../internal/resolvers';
9
- import { Box, Inline, Stack, Surface } from '../../layout';
12
+ import { Inline } from '../../layout';
10
13
  import { ButtonBase } from '../../primitives/button-base';
11
- import { Text } from '../../primitives/text';
12
14
  import { useTheme } from '../../theme/ThemeContext';
13
15
  import { resolveNextMenuIndex } from './navigation';
14
16
  import type { MenuAction, MenuProps } from './types';
@@ -1,11 +1,12 @@
1
1
  import React from 'react';
2
2
  import { Pressable, View } from 'react-native';
3
3
 
4
+ import { Surface } from '../../features/surface/public';
4
5
  import { FocusScope } from '../../internal/focus/FocusScope';
5
6
  import { Portal } from '../../internal/overlay/Portal';
6
7
  import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
7
8
  import { resolveOverlayAnimation } from '../../internal/resolvers';
8
- import { Center, Surface } from '../../layout';
9
+ import { Center } from '../../layout';
9
10
  import { useTheme } from '../../theme/ThemeContext';
10
11
  import type { ModalProps } from './types';
11
12
 
@@ -1,5 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Box } from '../../features/layout/public';
4
+ import { Text } from '../../features/typography/public';
3
5
  import {
4
6
  resolveFieldState,
5
7
  resolveIndicatorSize,
@@ -7,9 +9,7 @@ import {
7
9
  resolveSelectionControlNextChecked,
8
10
  } from '../../internal/resolvers';
9
11
  import { useControllableState } from '../../internal/useControllableState';
10
- import { Box } from '../../layout';
11
12
  import { ButtonBase } from '../../primitives/button-base';
12
- import { Text } from '../../primitives/text';
13
13
  import { useTheme } from '../../theme/ThemeContext';
14
14
  import type { SwitchProps } from './types';
15
15
 
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Pressable } from 'react-native';
3
3
 
4
- import { Box } from '../../layout';
5
- import { Text } from '../../primitives/text';
4
+ import { Box } from '../../features/layout/public';
5
+ import { Text } from '../../features/typography/public';
6
6
  import { useTheme } from '../../theme/ThemeContext';
7
7
  import { useTabsContext } from './context';
8
8
  import type { TabProps } from './types';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Box } from '../../features/layout/public';
3
4
  import { useFocusManager } from '../../internal/focus/useFocusManager';
4
- import { Box } from '../../layout';
5
5
  import { useTabsContext } from './context';
6
6
  import { resolveNextTabValue } from './navigation';
7
7
  import type { TabListProps } from './types';
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Box } from '../../features/layout/public';
3
4
  import { useControllableState } from '../../internal/useControllableState';
4
- import { Box } from '../../layout';
5
5
  import { getTabId as resolveTabId, getTabPanelId as resolveTabPanelId } from './a11y';
6
6
  import { type TabRegistration, TabsContext } from './context';
7
7
  import type { TabsProps } from './types';
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { TextInput } from '../text-input';
3
+ import { TextInput } from '../../features/form/text-input/public';
4
4
  import type { TextareaProps } from './types';
5
5
 
6
6
  export function Textarea({ rows = 4, numberOfLines, style, ...props }: TextareaProps) {
@@ -1,4 +1,4 @@
1
- import type { TextInputProps } from '../text-input';
1
+ import type { TextInputProps } from '../../types/text-input';
2
2
 
3
3
  export interface TextareaProps extends Omit<TextInputProps, 'multiline'> {
4
4
  rows?: number;
@@ -1,8 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Pressable } from 'react-native';
3
3
 
4
- import { Box, Inline, Surface } from '../../layout';
5
- import { Text } from '../../primitives/text';
4
+ import { Box } from '../../features/layout/public';
5
+ import { Surface } from '../../features/surface/public';
6
+ import { Text } from '../../features/typography/public';
7
+ import { Inline } from '../../layout';
6
8
  import type { SurfaceColor } from '../../surfaceColor';
7
9
  import { useTheme } from '../../theme/ThemeContext';
8
10
  import type { SurfaceTheme } from '../../theme/types';
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
 
3
+ import { Stack } from '../../features/layout/public';
3
4
  import { Portal } from '../../internal/overlay/Portal';
4
5
  import { resolveOverlayAnimation } from '../../internal/resolvers';
5
- import { Stack } from '../../layout';
6
6
  import { Toast } from './Toast';
7
7
  import type { ToastOptions } from './types';
8
8
 
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import { type LayoutRectangle, Platform, Pressable, View } from 'react-native';
3
3
 
4
+ import { Surface } from '../../features/surface/public';
5
+ import { Text } from '../../features/typography/public';
4
6
  import { Portal } from '../../internal/overlay/Portal';
5
7
  import { resolvePointerEvents } from '../../internal/resolvePointerEvents';
6
8
  import { resolveOverlayAnimation } from '../../internal/resolvers';
7
- import { Surface } from '../../layout';
8
- import { Text } from '../../primitives/text';
9
9
  import { useTheme } from '../../theme/ThemeContext';
10
10
  import type { TooltipProps } from './types';
11
11
 
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
 
3
- import { Button } from '../components/button';
4
- import { Card } from '../components/card';
5
- import { Checkbox } from '../components/checkbox';
6
3
  import { Field } from '../components/field';
7
4
  import { HelperText } from '../components/helper-text';
8
5
  import { Menu } from '../components/menu';
9
6
  import { Modal } from '../components/modal';
10
7
  import { Tab, TabList, TabPanel, Tabs } from '../components/tabs';
11
- import { TextInput } from '../components/text-input';
12
8
  import { ToastProvider, useToast } from '../components/toast';
13
9
  import { Tooltip } from '../components/tooltip';
14
- import { Box, Stack } from '../layout';
15
- import { Text } from '../primitives/text';
10
+ import { Button } from '../features/button/public';
11
+ import { Card } from '../features/card/public';
12
+ import { Checkbox } from '../features/form/checkbox/public';
13
+ import { TextInput } from '../features/form/text-input/public';
14
+ import { Box, Stack } from '../features/layout/public';
15
+ import { Text } from '../features/typography/public';
16
16
  import { ThemeProvider } from '../theme';
17
17
  import type { ThemeConfig } from '../theme/types';
18
18
 
@@ -0,0 +1,58 @@
1
+ import React from 'react';
2
+ import type { ViewStyle } from 'react-native';
3
+
4
+ import { resolveButtonColors, resolveControlSize } from '../../../../internal/resolvers';
5
+ import { useTheme } from '../../../../theme/ThemeContext';
6
+ import type { BadgeProps } from '../../../../types/badge';
7
+ import { Box } from '../../../layout/public';
8
+ import { Text } from '../../../typography/public';
9
+
10
+ /*** Renders compact semantic status or metadata content. */
11
+ export function Badge({
12
+ content,
13
+ variant = 'soft',
14
+ color = 'primary',
15
+ size = 's',
16
+ testID,
17
+ }: BadgeProps) {
18
+ const { theme } = useTheme();
19
+ const controlSize = resolveControlSize(theme, size);
20
+ const colors = resolveButtonColors(theme, {
21
+ variant,
22
+ color,
23
+ state: { disabled: false, focused: false, hovered: false, pressed: false },
24
+ });
25
+
26
+ return (
27
+ <Box
28
+ px={Math.max(theme.spacing.xs, controlSize.paddingHorizontal - 4)}
29
+ py={Math.max(4, controlSize.paddingVertical - 2)}
30
+ radius={controlSize.borderRadius}
31
+ style={resolveBadgeStyle(colors.backgroundColor, colors.borderColor, variant)}
32
+ testID={testID}
33
+ >
34
+ <Text
35
+ color={color}
36
+ emphasis={variant === 'solid' ? 'inverse' : 'default'}
37
+ variant="bodySmall"
38
+ weight="medium"
39
+ >
40
+ {content}
41
+ </Text>
42
+ </Box>
43
+ );
44
+ }
45
+
46
+ /*** Resolves the visual container style for one badge variant. */
47
+ function resolveBadgeStyle(
48
+ backgroundColor: string,
49
+ borderColor: string,
50
+ variant: NonNullable<BadgeProps['variant']>,
51
+ ): ViewStyle {
52
+ return {
53
+ alignSelf: 'flex-start',
54
+ backgroundColor,
55
+ borderColor,
56
+ borderWidth: variant === 'solid' ? 0 : 1,
57
+ };
58
+ }
@@ -0,0 +1,2 @@
1
+ export type { BadgeProps } from '../../types/badge';
2
+ export { Badge } from './adapters/inbound/Badge';