pytech-ui 1.0.30 → 1.0.32

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 (243) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +40 -40
  3. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  4. package/android/.gradle/nb-cache/trust/8732A504261C070E1F639E78DF65F8E6DC6FFC865B3D7178A7609BB57105805F +1 -1
  5. package/android/build.gradle +48 -47
  6. package/android/src/main/AndroidManifest.xml +2 -2
  7. package/android/src/main/java/expo/modules/pytechui/Dialog.kt +39 -39
  8. package/android/src/main/java/expo/modules/pytechui/ForEach/ForEachRecords.kt +23 -23
  9. package/android/src/main/java/expo/modules/pytechui/ForEach/index.kt +82 -82
  10. package/android/src/main/java/expo/modules/pytechui/Gradient/GradientView.kt +124 -124
  11. package/android/src/main/java/expo/modules/pytechui/Icon/index.kt +36 -36
  12. package/android/src/main/java/expo/modules/pytechui/Icon/utils.kt +42 -42
  13. package/android/src/main/java/expo/modules/pytechui/ListItem/Data/ListItemDataRecords.kt +84 -84
  14. package/android/src/main/java/expo/modules/pytechui/ListItem/Data/ListItemFromData.kt +127 -127
  15. package/android/src/main/java/expo/modules/pytechui/ListItem/Slots/ListItemFromSlots.kt +60 -60
  16. package/android/src/main/java/expo/modules/pytechui/ListItem/Slots/types.kt +42 -42
  17. package/android/src/main/java/expo/modules/pytechui/ListItem/_shared/Decorator/Decorator.kt +79 -79
  18. package/android/src/main/java/expo/modules/pytechui/ListItem/_shared/Decorator/Divider.kt +36 -36
  19. package/android/src/main/java/expo/modules/pytechui/ListItem/_shared/Decorator/utilsDecorator.kt +19 -19
  20. package/android/src/main/java/expo/modules/pytechui/ListItem/_shared/Dynamic/Dynamic.kt +163 -163
  21. package/android/src/main/java/expo/modules/pytechui/ListItem/_shared/Dynamic/Row.kt +136 -136
  22. package/android/src/main/java/expo/modules/pytechui/Navigation/NavigationWrapperView.kt +80 -0
  23. package/android/src/main/java/expo/modules/pytechui/PytechUiModifiers.kt +93 -93
  24. package/android/src/main/java/expo/modules/pytechui/PytechUiModule.kt +186 -168
  25. package/android/src/main/java/expo/modules/pytechui/SearchBar.kt +213 -213
  26. package/android/src/main/java/expo/modules/pytechui/Section/SectionHost.kt +81 -81
  27. package/android/src/main/java/expo/modules/pytechui/Section/SectionHostView.kt +65 -65
  28. package/android/src/main/java/expo/modules/pytechui/TextField.kt +251 -251
  29. package/android/src/main/java/expo/modules/pytechui/TypographySlot/TypographySlotBridge.kt +120 -120
  30. package/android/src/main/java/expo/modules/pytechui/TypographySlot/constants.kt +47 -47
  31. package/android/src/main/java/expo/modules/pytechui/extended-theme/ExtendedThemeView.kt +19 -19
  32. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Colors/ExtendedColorBridge.kt +76 -76
  33. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Constants/Constants.kt +10 -10
  34. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarLargeFlexibleTokens.kt +20 -20
  35. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarLargeTokens.kt +19 -19
  36. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarMediumFlexibleTokens.kt +20 -20
  37. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarMediumTokens.kt +19 -19
  38. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarSmallTokens.kt +19 -19
  39. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AppBarTokens.kt +23 -23
  40. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/AssistChipTokens.kt +25 -25
  41. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/BadgeTokens.kt +20 -20
  42. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/BaselineButtonTokens.kt +26 -26
  43. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/BottomAppBarTokens.kt +19 -19
  44. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonGroupSmallTokens.kt +20 -20
  45. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonLargeTokens.kt +24 -24
  46. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonMediumTokens.kt +24 -24
  47. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonSmallTokens.kt +24 -24
  48. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonXLargeTokens.kt +24 -24
  49. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ButtonXSmallTokens.kt +24 -24
  50. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/CheckboxTokens.kt +35 -35
  51. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/CircularProgressIndicatorTokens.kt +25 -25
  52. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ConnectedButtonGroupSmallTokens.kt +21 -21
  53. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DateInputModalTokens.kt +22 -22
  54. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DatePickerModalTokens.kt +33 -33
  55. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DialogTokens.kt +19 -19
  56. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DividerTokens.kt +19 -19
  57. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DockedToolbarTokens.kt +23 -23
  58. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/DragHandleTokens.kt +25 -25
  59. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ElevatedButtonTokens.kt +19 -19
  60. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ElevatedCardTokens.kt +20 -20
  61. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ElevationTokens.kt +24 -24
  62. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ExpressiveMotionTokens.kt +28 -28
  63. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ExtendedFabLargeTokens.kt +23 -23
  64. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ExtendedFabMediumTokens.kt +24 -24
  65. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ExtendedFabPrimaryTokens.kt +20 -20
  66. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ExtendedFabSmallTokens.kt +23 -23
  67. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FabBaselineTokens.kt +21 -21
  68. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FabLargeTokens.kt +21 -21
  69. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FabMediumTokens.kt +22 -22
  70. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FabMenuBaselineTokens.kt +28 -28
  71. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FabSmallTokens.kt +21 -21
  72. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledAutocompleteTokens.kt +31 -31
  73. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledButtonTokens.kt +19 -19
  74. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledCardTokens.kt +20 -20
  75. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledIconButtonTokens.kt +18 -18
  76. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledTextFieldTokens.kt +31 -31
  77. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledTonalButtonTokens.kt +23 -23
  78. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilledTonalIconButtonTokens.kt +18 -18
  79. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FilterChipTokens.kt +28 -28
  80. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/FloatingToolbarTokens.kt +23 -23
  81. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/IconButtonTokens.kt +17 -17
  82. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/InputChipTokens.kt +30 -30
  83. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/LargeIconButtonTokens.kt +27 -27
  84. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/LinearProgressIndicatorTokens.kt +28 -28
  85. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ListTokens.kt +57 -57
  86. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/LoadingIndicatorTokens.kt +21 -21
  87. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/MediumIconButtonTokens.kt +27 -27
  88. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/MotionTokens.kt +44 -44
  89. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationBarHorizontalItemTokens.kt +22 -22
  90. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationBarTokens.kt +23 -23
  91. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationBarVerticalItemTokens.kt +22 -22
  92. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationDrawerTokens.kt +23 -23
  93. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationRailBaselineItemTokens.kt +25 -25
  94. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationRailCollapsedTokens.kt +23 -23
  95. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationRailExpandedTokens.kt +22 -22
  96. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationRailHorizontalItemTokens.kt +24 -24
  97. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/NavigationRailVerticalItemTokens.kt +24 -24
  98. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedAutocompleteTokens.kt +30 -30
  99. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedButtonTokens.kt +19 -19
  100. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedCardTokens.kt +21 -21
  101. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedIconButtonTokens.kt +18 -18
  102. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedSegmentedButtonTokens.kt +24 -24
  103. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/OutlinedTextFieldTokens.kt +31 -31
  104. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/PrimaryNavigationTabTokens.kt +24 -24
  105. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/RadioButtonTokens.kt +22 -22
  106. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ScrimTokens.kt +17 -17
  107. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SearchBarTokens.kt +20 -20
  108. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SearchViewTokens.kt +20 -20
  109. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SecondaryNavigationTabTokens.kt +21 -21
  110. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SegmentedMenuTokens.kt +42 -42
  111. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/ShapeTokens.kt +74 -74
  112. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SheetBottomTokens.kt +20 -20
  113. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SliderTokens.kt +39 -39
  114. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SmallIconButtonTokens.kt +27 -27
  115. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SnackbarTokens.kt +21 -21
  116. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SplitButtonLargeTokens.kt +26 -26
  117. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SplitButtonMediumTokens.kt +26 -26
  118. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SplitButtonSmallTokens.kt +26 -26
  119. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SplitButtonXLargeTokens.kt +26 -26
  120. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SplitButtonXSmallTokens.kt +27 -27
  121. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/StandardMenuTokens.kt +25 -25
  122. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/StandardMotionTokens.kt +27 -27
  123. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/StateTokens.kt +20 -20
  124. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SuggestionChipTokens.kt +25 -25
  125. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/SwitchTokens.kt +37 -37
  126. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/TextButtonTokens.kt +18 -18
  127. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/TimeInputTokens.kt +24 -24
  128. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/TimePickerTokens.kt +30 -30
  129. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/TonalButtonTokens.kt +19 -19
  130. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/TypeScaleTokens.kt +72 -72
  131. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/VibrantMenuTokens.kt +26 -26
  132. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/XLargeIconButtonTokens.kt +27 -27
  133. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/assets/XSmallIconButtonTokens.kt +27 -27
  134. package/android/src/main/java/expo/modules/pytechui/extended-theme/assets/Tokens/index.kt +216 -216
  135. package/android/src/main/java/expo/modules/pytechui/extended-theme/index.kt +38 -38
  136. package/android/src/main/java/expo/modules/pytechui/utils/children.kt +126 -126
  137. package/android/src/main/java/expo/modules/pytechui/utils/modifiers.kt +44 -44
  138. package/build/constants/utils.d.ts +1 -1
  139. package/build/contexts/alert/components/Alert/index.js +16 -16
  140. package/build/contexts/alert/components/Button/index.js +5 -5
  141. package/build/contexts/alert/components/Provider/index.ios.js +2 -2
  142. package/build/contexts/alert/components/Provider/index.js +3 -3
  143. package/build/contexts/alert/context/provider.d.ts +1 -1
  144. package/build/contexts/alert/context/provider.js +1 -1
  145. package/build/contexts/app/context.d.ts +1 -1
  146. package/build/contexts/app/context.js +15 -15
  147. package/build/contexts/app/index.d.ts +2 -2
  148. package/build/contexts/app/index.js +2 -2
  149. package/build/contexts/app/src/Head/index.d.ts +1 -1
  150. package/build/contexts/app/src/Head/index.web.js +12 -12
  151. package/build/contexts/app/src/Wrapper/index.d.ts +1 -1
  152. package/build/contexts/app/src/Wrapper/index.js +2 -2
  153. package/build/contexts/app/src/styles.css +16 -16
  154. package/build/contexts/app/types.d.ts +1 -1
  155. package/build/contexts/router/index.d.ts +1 -1
  156. package/build/contexts/router/index.js +3 -3
  157. package/build/jetpack-compose/components/Columns/CommonColumn/index.js +2 -2
  158. package/build/jetpack-compose/components/Columns/CommonColumn/types.d.ts +1 -1
  159. package/build/jetpack-compose/components/Columns/CommonColumn/utils.d.ts +1 -1
  160. package/build/jetpack-compose/components/Columns/CommonColumn/utils.js +1 -1
  161. package/build/jetpack-compose/components/DropdownMenu/index.d.ts +1 -1
  162. package/build/jetpack-compose/components/DropdownMenu/index.js +3 -3
  163. package/build/jetpack-compose/components/DropdownPicker/Picker.d.ts +3 -3
  164. package/build/jetpack-compose/components/DropdownPicker/Picker.js +24 -24
  165. package/build/jetpack-compose/components/DropdownPicker/PickerItem.js +5 -5
  166. package/build/jetpack-compose/components/DropdownPicker/context.d.ts +4 -10
  167. package/build/jetpack-compose/components/ForEach/src/ForEach.d.ts +1 -1
  168. package/build/jetpack-compose/components/ForEach/src/ForEach.js +5 -5
  169. package/build/jetpack-compose/components/ForEach/src/ListItem.d.ts +1 -1
  170. package/build/jetpack-compose/components/ForEach/src/types.d.ts +1 -1
  171. package/build/jetpack-compose/components/Gradient/Gradient.js +1 -1
  172. package/build/jetpack-compose/components/Gradient/types.d.ts +1 -1
  173. package/build/jetpack-compose/components/Host.d.ts +4 -3
  174. package/build/jetpack-compose/components/Host.js +6 -2
  175. package/build/jetpack-compose/components/Icon/Icon/Icon.js +1 -1
  176. package/build/jetpack-compose/components/Icon/index.d.ts +1 -1
  177. package/build/jetpack-compose/components/IconSection/IconSection.js +19 -19
  178. package/build/jetpack-compose/components/IconSection/types.d.ts +1 -1
  179. package/build/jetpack-compose/components/IconSection/utils.js +1 -1
  180. package/build/jetpack-compose/components/List/CommonColumn.js +3 -3
  181. package/build/jetpack-compose/components/List/index.d.ts +1 -1
  182. package/build/jetpack-compose/components/List/index.js +11 -11
  183. package/build/jetpack-compose/components/ListItem/SlotListItem.d.ts +2 -2
  184. package/build/jetpack-compose/components/ListItem/SlotListItem.js +9 -9
  185. package/build/jetpack-compose/components/Menu/src/components/Divider.js +2 -2
  186. package/build/jetpack-compose/components/Menu/src/components/Icon.d.ts +1 -1
  187. package/build/jetpack-compose/components/Menu/src/components/Icon.js +1 -1
  188. package/build/jetpack-compose/components/Menu/src/components/Item.d.ts +2 -3
  189. package/build/jetpack-compose/components/Menu/src/components/Item.js +26 -26
  190. package/build/jetpack-compose/components/Menu/src/components/Label.d.ts +4 -1
  191. package/build/jetpack-compose/components/Menu/src/components/Label.js +3 -3
  192. package/build/jetpack-compose/components/Menu/src/components/Menu.d.ts +2 -2
  193. package/build/jetpack-compose/components/Menu/src/components/Menu.js +26 -26
  194. package/build/jetpack-compose/components/Menu/src/components/Trigger.js +7 -7
  195. package/build/jetpack-compose/components/Menu/src/context.d.ts +8 -6
  196. package/build/jetpack-compose/components/Menu/src/utils.js +3 -3
  197. package/build/jetpack-compose/components/NavigationButton.d.ts +7 -0
  198. package/build/jetpack-compose/components/NavigationButton.js +16 -0
  199. package/build/jetpack-compose/components/NavigationWrapper.d.ts +10 -0
  200. package/build/jetpack-compose/components/NavigationWrapper.js +16 -0
  201. package/build/jetpack-compose/components/PagePicker/Item.js +11 -11
  202. package/build/jetpack-compose/components/PagePicker/Picker.js +5 -5
  203. package/build/jetpack-compose/components/PagePicker/context/index.d.ts +1 -1
  204. package/build/jetpack-compose/components/PagePicker/context/index.js +8 -8
  205. package/build/jetpack-compose/components/PullToRefreshBox.js +1 -1
  206. package/build/jetpack-compose/components/SearchBar.d.ts +1 -1
  207. package/build/jetpack-compose/components/SearchBar.js +1 -1
  208. package/build/jetpack-compose/components/Section/components/Column.d.ts +1 -1
  209. package/build/jetpack-compose/components/Section/components/Column.js +3 -3
  210. package/build/jetpack-compose/components/Section/components/Section.js +18 -18
  211. package/build/jetpack-compose/components/Section/components/Slot.d.ts +1 -1
  212. package/build/jetpack-compose/components/Section/components/Slot.js +3 -3
  213. package/build/jetpack-compose/components/SectionHost/index.d.ts +1 -1
  214. package/build/jetpack-compose/components/SectionHost/index.js +3 -3
  215. package/build/jetpack-compose/components/TextField.d.ts +1 -1
  216. package/build/jetpack-compose/components/TextField.js +1 -1
  217. package/build/jetpack-compose/components/TextSlot.js +2 -3
  218. package/build/jetpack-compose/extended-theme/assets/Colors/index.js +2 -2
  219. package/build/jetpack-compose/index.d.ts +2 -0
  220. package/build/jetpack-compose/index.js +2 -0
  221. package/build/jetpack-compose/modifiers/flexWeight.d.ts +1 -1
  222. package/build/jetpack-compose/modifiers/heightIn.d.ts +1 -1
  223. package/build/swift-ui/Image.js +2 -2
  224. package/build/swift-ui/ListItem.js +2 -2
  225. package/build/swift-ui/Slot.js +2 -2
  226. package/build/swift-ui/Text.js +2 -2
  227. package/build/universal/Column/index.android.js +2 -2
  228. package/build/universal/Column/index.ios.js +2 -2
  229. package/build/universal/Column/index.js +2 -2
  230. package/build/universal/Host/index.ios.js +2 -2
  231. package/build/universal/Row/index.android.js +2 -2
  232. package/build/universal/Row/index.ios.js +2 -2
  233. package/build/universal/Row/index.js +2 -2
  234. package/expo-module.config.json +11 -11
  235. package/ios/ChevronForwardView.swift +21 -21
  236. package/ios/GradientView.swift +40 -40
  237. package/ios/ImageView.swift +32 -32
  238. package/ios/ListItem.swift +161 -161
  239. package/ios/PytechUi.podspec +24 -24
  240. package/ios/PytechUiModule.swift +15 -15
  241. package/ios/SlotView.swift +107 -107
  242. package/ios/_shared/utils.swift +58 -58
  243. package/package.json +19 -15
@@ -1,120 +1,120 @@
1
- package expo.modules.pytechui.TypographySlot
2
-
3
- import androidx.compose.material3.MaterialTheme
4
- import androidx.compose.runtime.Composable
5
- import androidx.compose.ui.graphics.Color
6
- import androidx.compose.ui.text.TextStyle
7
- import androidx.compose.ui.text.font.FontWeight
8
- import androidx.compose.ui.text.style.TextAlign
9
- import androidx.compose.ui.unit.sp
10
- import expo.modules.kotlin.records.Field
11
- import expo.modules.kotlin.records.Record
12
- import expo.modules.pytechui.theme.ExtendedTheme
13
-
14
- data class SlotTypographyStyleRecord(
15
- @Field val typography: String? = null,
16
- @Field val fontSize: Double? = null,
17
- @Field val lineHeight: Double? = null,
18
- @Field val fontWeight: String? = null,
19
- @Field val textAlign: String? = null,
20
- ) : Record
21
-
22
- data class SlotTextStyleRecord(
23
- @Field val style: SlotTypographyStyleRecord,
24
- @Field val color: String? = null,
25
- @Field val overflow: String? = null,
26
- @Field val maxLines: Int? = null,
27
- ) : Record
28
-
29
- /**
30
- * Bridge de estilos por slot (Compose + JS vía [slotTextStylePayload]).
31
- * Los valores viven en [Typographies.specs].
32
- */
33
- internal object TypographySlotBridge {
34
-
35
- fun slotTextStylePayload(slotName: String): SlotTextStyleRecord? {
36
- val spec = Typographies.specs[slotName.lowercase()] ?: return null
37
- return SlotTextStyleRecord(
38
- style = SlotTypographyStyleRecord(
39
- typography = spec.typography,
40
- fontSize = spec.fontSize?.toDouble(),
41
- lineHeight = spec.lineHeight?.toDouble(),
42
- fontWeight = spec.fontWeight?.toString(),
43
- textAlign = spec.textAlign,
44
- ),
45
- color = spec.color,
46
- overflow = spec.overflow,
47
- maxLines = spec.maxLines,
48
- )
49
- }
50
-
51
- @Composable
52
- fun textStyleForSlot(slotName: String): TextStyle? {
53
- val spec = Typographies.specs[slotName.lowercase()] ?: return null
54
- var style = typographyFromToken(spec.typography)
55
- spec.fontSize?.let { style = style.copy(fontSize = it.sp) }
56
- spec.lineHeight?.let { style = style.copy(lineHeight = it.sp) }
57
- spec.fontWeight?.let { style = style.copy(fontWeight = fontWeightFromValue(it)) }
58
- spec.textAlign?.let { align ->
59
- textAlignFromValue(align)?.let { style = style.copy(textAlign = it) }
60
- }
61
- colorFromToken(spec.color)?.let { style = style.copy(color = it) }
62
- return style
63
- }
64
-
65
- @Composable
66
- private fun typographyFromToken(token: String): TextStyle =
67
- when (token) {
68
- "displayLarge" -> MaterialTheme.typography.displayLarge
69
- "displayMedium" -> MaterialTheme.typography.displayMedium
70
- "displaySmall" -> MaterialTheme.typography.displaySmall
71
- "headlineLarge" -> MaterialTheme.typography.headlineLarge
72
- "headlineMedium" -> MaterialTheme.typography.headlineMedium
73
- "headlineSmall" -> MaterialTheme.typography.headlineSmall
74
- "titleLarge" -> MaterialTheme.typography.titleLarge
75
- "titleMedium" -> MaterialTheme.typography.titleMedium
76
- "titleSmall" -> MaterialTheme.typography.titleSmall
77
- "bodyLarge" -> MaterialTheme.typography.bodyLarge
78
- "bodyMedium" -> MaterialTheme.typography.bodyMedium
79
- "bodySmall" -> MaterialTheme.typography.bodySmall
80
- "labelLarge" -> MaterialTheme.typography.labelLarge
81
- "labelMedium" -> MaterialTheme.typography.labelMedium
82
- "labelSmall" -> MaterialTheme.typography.labelSmall
83
- else -> MaterialTheme.typography.bodyLarge
84
- }
85
-
86
- private fun textAlignFromValue(value: String): TextAlign? =
87
- when (value.lowercase()) {
88
- "left" -> TextAlign.Left
89
- "right" -> TextAlign.Right
90
- "center" -> TextAlign.Center
91
- "justify" -> TextAlign.Justify
92
- "start" -> TextAlign.Start
93
- "end" -> TextAlign.End
94
- else -> null
95
- }
96
-
97
- private fun fontWeightFromValue(value: Int): FontWeight =
98
- when (value) {
99
- 100 -> FontWeight.Thin
100
- 200 -> FontWeight.ExtraLight
101
- 300 -> FontWeight.Light
102
- 400 -> FontWeight.Normal
103
- 500 -> FontWeight.Medium
104
- 600 -> FontWeight.SemiBold
105
- 700 -> FontWeight.Bold
106
- 800 -> FontWeight.ExtraBold
107
- 900 -> FontWeight.Black
108
- else -> FontWeight(value)
109
- }
110
-
111
- @Composable
112
- private fun colorFromToken(token: String?): Color? =
113
- when (token?.lowercase()) {
114
- "label" -> ExtendedTheme.colorScheme.label
115
- "secondarylabel" -> ExtendedTheme.colorScheme.secondaryLabel
116
- "tertiarylabel" -> ExtendedTheme.colorScheme.tertiaryLabel
117
- "link" -> ExtendedTheme.colorScheme.link
118
- else -> null
119
- }
120
- }
1
+ package expo.modules.pytechui.TypographySlot
2
+
3
+ import androidx.compose.material3.MaterialTheme
4
+ import androidx.compose.runtime.Composable
5
+ import androidx.compose.ui.graphics.Color
6
+ import androidx.compose.ui.text.TextStyle
7
+ import androidx.compose.ui.text.font.FontWeight
8
+ import androidx.compose.ui.text.style.TextAlign
9
+ import androidx.compose.ui.unit.sp
10
+ import expo.modules.kotlin.records.Field
11
+ import expo.modules.kotlin.records.Record
12
+ import expo.modules.pytechui.theme.ExtendedTheme
13
+
14
+ data class SlotTypographyStyleRecord(
15
+ @Field val typography: String? = null,
16
+ @Field val fontSize: Double? = null,
17
+ @Field val lineHeight: Double? = null,
18
+ @Field val fontWeight: String? = null,
19
+ @Field val textAlign: String? = null,
20
+ ) : Record
21
+
22
+ data class SlotTextStyleRecord(
23
+ @Field val style: SlotTypographyStyleRecord,
24
+ @Field val color: String? = null,
25
+ @Field val overflow: String? = null,
26
+ @Field val maxLines: Int? = null,
27
+ ) : Record
28
+
29
+ /**
30
+ * Bridge de estilos por slot (Compose + JS vía [slotTextStylePayload]).
31
+ * Los valores viven en [Typographies.specs].
32
+ */
33
+ internal object TypographySlotBridge {
34
+
35
+ fun slotTextStylePayload(slotName: String): SlotTextStyleRecord? {
36
+ val spec = Typographies.specs[slotName.lowercase()] ?: return null
37
+ return SlotTextStyleRecord(
38
+ style = SlotTypographyStyleRecord(
39
+ typography = spec.typography,
40
+ fontSize = spec.fontSize?.toDouble(),
41
+ lineHeight = spec.lineHeight?.toDouble(),
42
+ fontWeight = spec.fontWeight?.toString(),
43
+ textAlign = spec.textAlign,
44
+ ),
45
+ color = spec.color,
46
+ overflow = spec.overflow,
47
+ maxLines = spec.maxLines,
48
+ )
49
+ }
50
+
51
+ @Composable
52
+ fun textStyleForSlot(slotName: String): TextStyle? {
53
+ val spec = Typographies.specs[slotName.lowercase()] ?: return null
54
+ var style = typographyFromToken(spec.typography)
55
+ spec.fontSize?.let { style = style.copy(fontSize = it.sp) }
56
+ spec.lineHeight?.let { style = style.copy(lineHeight = it.sp) }
57
+ spec.fontWeight?.let { style = style.copy(fontWeight = fontWeightFromValue(it)) }
58
+ spec.textAlign?.let { align ->
59
+ textAlignFromValue(align)?.let { style = style.copy(textAlign = it) }
60
+ }
61
+ colorFromToken(spec.color)?.let { style = style.copy(color = it) }
62
+ return style
63
+ }
64
+
65
+ @Composable
66
+ private fun typographyFromToken(token: String): TextStyle =
67
+ when (token) {
68
+ "displayLarge" -> MaterialTheme.typography.displayLarge
69
+ "displayMedium" -> MaterialTheme.typography.displayMedium
70
+ "displaySmall" -> MaterialTheme.typography.displaySmall
71
+ "headlineLarge" -> MaterialTheme.typography.headlineLarge
72
+ "headlineMedium" -> MaterialTheme.typography.headlineMedium
73
+ "headlineSmall" -> MaterialTheme.typography.headlineSmall
74
+ "titleLarge" -> MaterialTheme.typography.titleLarge
75
+ "titleMedium" -> MaterialTheme.typography.titleMedium
76
+ "titleSmall" -> MaterialTheme.typography.titleSmall
77
+ "bodyLarge" -> MaterialTheme.typography.bodyLarge
78
+ "bodyMedium" -> MaterialTheme.typography.bodyMedium
79
+ "bodySmall" -> MaterialTheme.typography.bodySmall
80
+ "labelLarge" -> MaterialTheme.typography.labelLarge
81
+ "labelMedium" -> MaterialTheme.typography.labelMedium
82
+ "labelSmall" -> MaterialTheme.typography.labelSmall
83
+ else -> MaterialTheme.typography.bodyLarge
84
+ }
85
+
86
+ private fun textAlignFromValue(value: String): TextAlign? =
87
+ when (value.lowercase()) {
88
+ "left" -> TextAlign.Left
89
+ "right" -> TextAlign.Right
90
+ "center" -> TextAlign.Center
91
+ "justify" -> TextAlign.Justify
92
+ "start" -> TextAlign.Start
93
+ "end" -> TextAlign.End
94
+ else -> null
95
+ }
96
+
97
+ private fun fontWeightFromValue(value: Int): FontWeight =
98
+ when (value) {
99
+ 100 -> FontWeight.Thin
100
+ 200 -> FontWeight.ExtraLight
101
+ 300 -> FontWeight.Light
102
+ 400 -> FontWeight.Normal
103
+ 500 -> FontWeight.Medium
104
+ 600 -> FontWeight.SemiBold
105
+ 700 -> FontWeight.Bold
106
+ 800 -> FontWeight.ExtraBold
107
+ 900 -> FontWeight.Black
108
+ else -> FontWeight(value)
109
+ }
110
+
111
+ @Composable
112
+ private fun colorFromToken(token: String?): Color? =
113
+ when (token?.lowercase()) {
114
+ "label" -> ExtendedTheme.colorScheme.label
115
+ "secondarylabel" -> ExtendedTheme.colorScheme.secondaryLabel
116
+ "tertiarylabel" -> ExtendedTheme.colorScheme.tertiaryLabel
117
+ "link" -> ExtendedTheme.colorScheme.link
118
+ else -> null
119
+ }
120
+ }
@@ -1,47 +1,47 @@
1
- package expo.modules.pytechui.TypographySlot
2
-
3
- internal data class SlotTextSpec(
4
- val typography: String,
5
- val fontSize: Float? = null,
6
- val lineHeight: Float? = null,
7
- val fontWeight: Int? = null,
8
- val color: String? = null,
9
- /** Valores de `@expo/ui` Text: `clip`, `ellipsis`, `visible`. */
10
- val overflow: String? = null,
11
- val maxLines: Int? = null,
12
- /** Valores de `@expo/ui` Text: `left`, `right`, `center`, `justify`, `start`, `end`. */
13
- val textAlign: String? = null,
14
- )
15
-
16
- /**
17
- * Estilos por slot (minúsculas). Compartidos por [TypographySlotBridge] (Compose + JS).
18
- */
19
- internal object Typographies {
20
-
21
- val specs: Map<String, SlotTextSpec> = mapOf(
22
- "headlinecontent" to SlotTextSpec("bodyLarge", 17f, 22f, 400 /*, maxLines = 1*/, textAlign = "left"),
23
- "trailingcontent" to SlotTextSpec("bodyLarge", 17f, 22f, 400 /*, , maxLines = 1*/, textAlign = "end", overflow = "ellipsis"),
24
- "supportingcontent" to SlotTextSpec("bodyMedium", 15f, 20f, 400),
25
- "leadingcontent" to SlotTextSpec("headlineSmall"),
26
- "overlinecontent" to SlotTextSpec("labelMedium"),
27
-
28
- "title" to SlotTextSpec("bodyLarge", 17f, 22f, 600, "secondaryLabel"),
29
- "header" to SlotTextSpec("bodyLarge", 17f, 22f, 600, "secondaryLabel"),
30
- "footer" to SlotTextSpec("bodySmall", 13f, 16f, 400, "secondaryLabel"),
31
- "footercount" to SlotTextSpec("bodyLarge", 17f, 22f, 500, "label", textAlign = "center"),
32
-
33
- "icontitle" to SlotTextSpec("bodyLarge", 28f, 34f, 700, "label"),
34
- "iconsubtitle" to SlotTextSpec("bodyLarge", 17f, 22f, 400, "secondaryLabel"),
35
- "iconbutton" to SlotTextSpec("bodyLarge", 17f, 22f, 500, "label"),
36
-
37
- "menuitemheadline" to SlotTextSpec("bodyLarge", 17f, 20f, 400),
38
- "menuitemsupporting" to SlotTextSpec("bodyMedium", 13f, 18f, 400, "secondaryLabel"),
39
- "menuitemtrailing" to SlotTextSpec("bodyMedium", 15f, 20f, 500, "secondaryLabel"),
40
-
41
- "modalheader" to SlotTextSpec("bodyLarge", 17f, 22f, 600),
42
-
43
- "titlealert" to SlotTextSpec("bodyLarge", 17f, 22f, 600),
44
- "messagetalert" to SlotTextSpec("bodyLarge", 17f, 22f, 400),
45
-
46
- )
47
- }
1
+ package expo.modules.pytechui.TypographySlot
2
+
3
+ internal data class SlotTextSpec(
4
+ val typography: String,
5
+ val fontSize: Float? = null,
6
+ val lineHeight: Float? = null,
7
+ val fontWeight: Int? = null,
8
+ val color: String? = null,
9
+ /** Valores de `@expo/ui` Text: `clip`, `ellipsis`, `visible`. */
10
+ val overflow: String? = null,
11
+ val maxLines: Int? = null,
12
+ /** Valores de `@expo/ui` Text: `left`, `right`, `center`, `justify`, `start`, `end`. */
13
+ val textAlign: String? = null,
14
+ )
15
+
16
+ /**
17
+ * Estilos por slot (minúsculas). Compartidos por [TypographySlotBridge] (Compose + JS).
18
+ */
19
+ internal object Typographies {
20
+
21
+ val specs: Map<String, SlotTextSpec> = mapOf(
22
+ "headlinecontent" to SlotTextSpec("bodyLarge", 17f, 22f, 400 /*, maxLines = 1*/, textAlign = "left"),
23
+ "trailingcontent" to SlotTextSpec("bodyLarge", 17f, 22f, 400 /*, , maxLines = 1*/, textAlign = "end", overflow = "ellipsis"),
24
+ "supportingcontent" to SlotTextSpec("bodyMedium", 15f, 20f, 400),
25
+ "leadingcontent" to SlotTextSpec("headlineSmall"),
26
+ "overlinecontent" to SlotTextSpec("labelMedium"),
27
+
28
+ "title" to SlotTextSpec("bodyLarge", 17f, 22f, 600, "secondaryLabel"),
29
+ "header" to SlotTextSpec("bodyLarge", 17f, 22f, 600, "secondaryLabel"),
30
+ "footer" to SlotTextSpec("bodySmall", 13f, 16f, 400, "secondaryLabel"),
31
+ "footercount" to SlotTextSpec("bodyLarge", 17f, 22f, 500, "label", textAlign = "center"),
32
+
33
+ "icontitle" to SlotTextSpec("bodyLarge", 28f, 34f, 700, "label"),
34
+ "iconsubtitle" to SlotTextSpec("bodyLarge", 17f, 22f, 400, "secondaryLabel"),
35
+ "iconbutton" to SlotTextSpec("bodyLarge", 17f, 22f, 500, "label"),
36
+
37
+ "menuitemheadline" to SlotTextSpec("bodyLarge", 17f, 20f, 400),
38
+ "menuitemsupporting" to SlotTextSpec("bodyMedium", 13f, 18f, 400, "secondaryLabel"),
39
+ "menuitemtrailing" to SlotTextSpec("bodyMedium", 15f, 20f, 500, "secondaryLabel"),
40
+
41
+ "modalheader" to SlotTextSpec("bodyLarge", 17f, 22f, 600),
42
+
43
+ "titlealert" to SlotTextSpec("bodyLarge", 17f, 22f, 600),
44
+ "messagetalert" to SlotTextSpec("bodyLarge", 17f, 22f, 400),
45
+
46
+ )
47
+ }
@@ -1,19 +1,19 @@
1
- package expo.modules.pytechui
2
-
3
- import androidx.compose.runtime.Composable
4
- import expo.modules.kotlin.views.ComposeProps
5
- import expo.modules.kotlin.views.FunctionalComposableScope
6
-
7
- import expo.modules.pytechui.theme.ExtendedTheme
8
-
9
- /** Props para `View("ExtendedTheme")` — constructor con defaults (Expo Modules). */
10
- data class ExtendedThemeProps(
11
- private val unused: Boolean = false,
12
- ) : ComposeProps
13
-
14
- @Composable
15
- internal fun FunctionalComposableScope.ExtendedThemeViewContent(props: ExtendedThemeProps) {
16
- ExtendedTheme {
17
- Children()
18
- }
19
- }
1
+ package expo.modules.pytechui
2
+
3
+ import androidx.compose.runtime.Composable
4
+ import expo.modules.kotlin.views.ComposeProps
5
+ import expo.modules.kotlin.views.FunctionalComposableScope
6
+
7
+ import expo.modules.pytechui.theme.ExtendedTheme
8
+
9
+ /** Props para `View("ExtendedTheme")` — constructor con defaults (Expo Modules). */
10
+ data class ExtendedThemeProps(
11
+ private val unused: Boolean = false,
12
+ ) : ComposeProps
13
+
14
+ @Composable
15
+ internal fun FunctionalComposableScope.ExtendedThemeViewContent(props: ExtendedThemeProps) {
16
+ ExtendedTheme {
17
+ Children()
18
+ }
19
+ }
@@ -1,77 +1,77 @@
1
- package expo.modules.pytechui.theme.colors
2
-
3
-
4
- // Agregar esto al PytechUiModule.kt
5
-
6
- /**
7
- Function("getExtendedColor") { name: String, scheme: String ->
8
- val context =
9
- appContext.reactContext
10
- ?: throw IllegalStateException("React context is not available")
11
- ExtendedColorBridge.extendedColorHex(name, scheme, context)
12
- }
13
- */
14
-
15
-
16
-
17
- import android.content.Context
18
- import android.content.res.Configuration
19
- import androidx.compose.ui.graphics.Color
20
- import androidx.compose.ui.graphics.toArgb
21
- import java.util.Locale
22
- import kotlin.reflect.KProperty1
23
- import kotlin.reflect.full.memberProperties
24
-
25
- import expo.modules.pytechui.theme.colors.ExtendedColorScheme
26
- import expo.modules.pytechui.theme.colors.extendedDark
27
- import expo.modules.pytechui.theme.colors.extendedLight
28
-
29
-
30
- /**
31
- * Resuelve light/dark como Expo Router: si [scheme] no es "light" ni "dark",
32
- * usa el UI mode del [context] (p. ej. cuando JS manda "unspecified").
33
- *
34
- * Los tokens de color se derivan de [ExtendedColorScheme]: cada propiedad `Color`
35
- * queda expuesta como clave en minúsculas (`BLUE` → `"blue"`, `SECONDARY_LABEL` → `"secondary_label"`).
36
- */
37
- internal object ExtendedColorBridge {
38
-
39
- private val colorAccessors: Map<String, (ExtendedColorScheme) -> Color> by lazy {
40
- ExtendedColorScheme::class.memberProperties.mapNotNull { prop ->
41
- val getter = prop as? KProperty1<ExtendedColorScheme, *> ?: return@mapNotNull null
42
- if (getter.returnType.classifier != Color::class) return@mapNotNull null
43
- prop.name.lowercase(Locale.US) to { scheme: ExtendedColorScheme ->
44
- getter.get(scheme) as Color
45
- }
46
- }.toMap()
47
- }
48
-
49
- fun resolveScheme(scheme: String, context: Context): String {
50
- if (scheme == "dark" || scheme == "light") {
51
- return scheme
52
- }
53
- val flags = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
54
- return when (flags) {
55
- Configuration.UI_MODE_NIGHT_YES -> "dark"
56
- else -> "light"
57
- }
58
- }
59
-
60
- /**
61
- * HEX #RRGGBB para un token de [ExtendedColorScheme].
62
- * [name]: case-insensitive; debe coincidir con el nombre de la propiedad en minúsculas.
63
- * Devuelve null si el token no existe.
64
- */
65
- fun extendedColorHex(name: String, scheme: String, context: Context): String? {
66
- val resolved = resolveScheme(scheme, context)
67
- val palette: ExtendedColorScheme =
68
- if (resolved == "dark") extendedDark else extendedLight
69
- val color = pickColor(palette, name.lowercase(Locale.US)) ?: return null
70
- return String.format(Locale.US, "#%06X", 0xFFFFFF and color.toArgb())
71
- }
72
-
73
- private fun pickColor(scheme: ExtendedColorScheme, key: String): Color? {
74
- val accessor = colorAccessors[key.lowercase(Locale.US)] ?: return null
75
- return accessor(scheme)
76
- }
1
+ package expo.modules.pytechui.theme.colors
2
+
3
+
4
+ // Agregar esto al PytechUiModule.kt
5
+
6
+ /**
7
+ Function("getExtendedColor") { name: String, scheme: String ->
8
+ val context =
9
+ appContext.reactContext
10
+ ?: throw IllegalStateException("React context is not available")
11
+ ExtendedColorBridge.extendedColorHex(name, scheme, context)
12
+ }
13
+ */
14
+
15
+
16
+
17
+ import android.content.Context
18
+ import android.content.res.Configuration
19
+ import androidx.compose.ui.graphics.Color
20
+ import androidx.compose.ui.graphics.toArgb
21
+ import java.util.Locale
22
+ import kotlin.reflect.KProperty1
23
+ import kotlin.reflect.full.memberProperties
24
+
25
+ import expo.modules.pytechui.theme.colors.ExtendedColorScheme
26
+ import expo.modules.pytechui.theme.colors.extendedDark
27
+ import expo.modules.pytechui.theme.colors.extendedLight
28
+
29
+
30
+ /**
31
+ * Resuelve light/dark como Expo Router: si [scheme] no es "light" ni "dark",
32
+ * usa el UI mode del [context] (p. ej. cuando JS manda "unspecified").
33
+ *
34
+ * Los tokens de color se derivan de [ExtendedColorScheme]: cada propiedad `Color`
35
+ * queda expuesta como clave en minúsculas (`BLUE` → `"blue"`, `SECONDARY_LABEL` → `"secondary_label"`).
36
+ */
37
+ internal object ExtendedColorBridge {
38
+
39
+ private val colorAccessors: Map<String, (ExtendedColorScheme) -> Color> by lazy {
40
+ ExtendedColorScheme::class.memberProperties.mapNotNull { prop ->
41
+ val getter = prop as? KProperty1<ExtendedColorScheme, *> ?: return@mapNotNull null
42
+ if (getter.returnType.classifier != Color::class) return@mapNotNull null
43
+ prop.name.lowercase(Locale.US) to { scheme: ExtendedColorScheme ->
44
+ getter.get(scheme) as Color
45
+ }
46
+ }.toMap()
47
+ }
48
+
49
+ fun resolveScheme(scheme: String, context: Context): String {
50
+ if (scheme == "dark" || scheme == "light") {
51
+ return scheme
52
+ }
53
+ val flags = context.resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
54
+ return when (flags) {
55
+ Configuration.UI_MODE_NIGHT_YES -> "dark"
56
+ else -> "light"
57
+ }
58
+ }
59
+
60
+ /**
61
+ * HEX #RRGGBB para un token de [ExtendedColorScheme].
62
+ * [name]: case-insensitive; debe coincidir con el nombre de la propiedad en minúsculas.
63
+ * Devuelve null si el token no existe.
64
+ */
65
+ fun extendedColorHex(name: String, scheme: String, context: Context): String? {
66
+ val resolved = resolveScheme(scheme, context)
67
+ val palette: ExtendedColorScheme =
68
+ if (resolved == "dark") extendedDark else extendedLight
69
+ val color = pickColor(palette, name.lowercase(Locale.US)) ?: return null
70
+ return String.format(Locale.US, "#%06X", 0xFFFFFF and color.toArgb())
71
+ }
72
+
73
+ private fun pickColor(scheme: ExtendedColorScheme, key: String): Color? {
74
+ val accessor = colorAccessors[key.lowercase(Locale.US)] ?: return null
75
+ return accessor(scheme)
76
+ }
77
77
  }
@@ -1,11 +1,11 @@
1
- package expo.modules.pytechui.theme.constants
2
-
3
- object Constants {
4
-
5
- object leadingSizes {
6
- const val small = 40f
7
- const val medium = 45f
8
- const val large = 50f
9
- const val icon = 24f
10
- }
1
+ package expo.modules.pytechui.theme.constants
2
+
3
+ object Constants {
4
+
5
+ object leadingSizes {
6
+ const val small = 40f
7
+ const val medium = 45f
8
+ const val large = 50f
9
+ const val icon = 24f
10
+ }
11
11
  }
@@ -1,20 +1,20 @@
1
-
2
-
3
- /**
4
- * Auto generated by the script extendedTheme/Colors/index.ts
5
- * Do not edit manually.
6
- */
7
-
8
-
9
- package expo.modules.pytechui.theme.tokens
10
-
11
-
12
- // VERSION: 14_0_0
13
- // GENERATED CODE - DO NOT MODIFY BY HAND
14
-
15
- import androidx.compose.ui.unit.dp
16
-
17
- object AppBarLargeFlexibleTokens {
18
- val ContainerHeight = 120.0.dp
19
- val LargeContainerHeight = 152.0.dp
20
- }
1
+
2
+
3
+ /**
4
+ * Auto generated by the script extendedTheme/Colors/index.ts
5
+ * Do not edit manually.
6
+ */
7
+
8
+
9
+ package expo.modules.pytechui.theme.tokens
10
+
11
+
12
+ // VERSION: 14_0_0
13
+ // GENERATED CODE - DO NOT MODIFY BY HAND
14
+
15
+ import androidx.compose.ui.unit.dp
16
+
17
+ object AppBarLargeFlexibleTokens {
18
+ val ContainerHeight = 120.0.dp
19
+ val LargeContainerHeight = 152.0.dp
20
+ }
@@ -1,19 +1,19 @@
1
-
2
-
3
- /**
4
- * Auto generated by the script extendedTheme/Colors/index.ts
5
- * Do not edit manually.
6
- */
7
-
8
-
9
- package expo.modules.pytechui.theme.tokens
10
-
11
-
12
- // VERSION: 14_0_0
13
- // GENERATED CODE - DO NOT MODIFY BY HAND
14
-
15
- import androidx.compose.ui.unit.dp
16
-
17
- object AppBarLargeTokens {
18
- val ContainerHeight = 152.0.dp
19
- }
1
+
2
+
3
+ /**
4
+ * Auto generated by the script extendedTheme/Colors/index.ts
5
+ * Do not edit manually.
6
+ */
7
+
8
+
9
+ package expo.modules.pytechui.theme.tokens
10
+
11
+
12
+ // VERSION: 14_0_0
13
+ // GENERATED CODE - DO NOT MODIFY BY HAND
14
+
15
+ import androidx.compose.ui.unit.dp
16
+
17
+ object AppBarLargeTokens {
18
+ val ContainerHeight = 152.0.dp
19
+ }