react-native-terra-ui 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +1 -1
  3. package/lib/module/components/avatar/Avatar.js +20 -20
  4. package/lib/module/components/avatar/Avatar.js.map +1 -1
  5. package/lib/module/components/button/Button.js +11 -11
  6. package/lib/module/components/button/Button.js.map +1 -1
  7. package/lib/module/components/chip/Chip.js +32 -32
  8. package/lib/module/components/chip/Chip.js.map +1 -1
  9. package/lib/module/components/empty-state/EmptyState.js +3 -3
  10. package/lib/module/components/empty-state/EmptyState.js.map +1 -1
  11. package/lib/module/components/header/variants/LargeTitleHeader/index.js +30 -32
  12. package/lib/module/components/header/variants/LargeTitleHeader/index.js.map +1 -1
  13. package/lib/module/components/header/variants/TitleHeader/index.js +26 -18
  14. package/lib/module/components/header/variants/TitleHeader/index.js.map +1 -1
  15. package/lib/module/components/icon/Icon.js +3 -3
  16. package/lib/module/components/page-indicator/hooks/use-page-indicator-colors.js +2 -2
  17. package/lib/module/components/screen/Screen.js +63 -34
  18. package/lib/module/components/screen/Screen.js.map +1 -1
  19. package/lib/module/components/screen/ScreenContext.js +28 -9
  20. package/lib/module/components/screen/ScreenContext.js.map +1 -1
  21. package/lib/module/components/screen/ScreenFlatList.js +4 -162
  22. package/lib/module/components/screen/ScreenFlatList.js.map +1 -1
  23. package/lib/module/components/screen/ScreenList.js +81 -97
  24. package/lib/module/components/screen/ScreenList.js.map +1 -1
  25. package/lib/module/components/screen/ScreenScrollView.js +64 -115
  26. package/lib/module/components/screen/ScreenScrollView.js.map +1 -1
  27. package/lib/module/components/screen/hooks/use-screen-ref.js +18 -0
  28. package/lib/module/components/screen/hooks/use-screen-ref.js.map +1 -0
  29. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js +19 -0
  30. package/lib/module/components/screen/hooks/use-screen-scroll-handler.js.map +1 -0
  31. package/lib/module/components/screen/index.js.map +1 -1
  32. package/lib/module/components/screen/parts/ScreenFrame.js +47 -0
  33. package/lib/module/components/screen/parts/ScreenFrame.js.map +1 -0
  34. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js +43 -0
  35. package/lib/module/components/screen/parts/ScreenHeaderAppearance.js.map +1 -0
  36. package/lib/module/components/screen/parts/ScreenPlaceholder.js +11 -13
  37. package/lib/module/components/screen/parts/ScreenPlaceholder.js.map +1 -1
  38. package/lib/module/components/screen/parts/ScreenSafeArea.android.js +27 -0
  39. package/lib/module/components/screen/parts/ScreenSafeArea.android.js.map +1 -0
  40. package/lib/module/components/screen/parts/ScreenSafeArea.js +26 -0
  41. package/lib/module/components/screen/parts/ScreenSafeArea.js.map +1 -0
  42. package/lib/module/components/screen/utils.js +18 -9
  43. package/lib/module/components/screen/utils.js.map +1 -1
  44. package/lib/module/components/spinner/Spinner.js +2 -2
  45. package/lib/module/components/text/Text.js +1 -1
  46. package/lib/module/components/toast/Toast.js +13 -13
  47. package/lib/module/components/toast/Toast.js.map +1 -1
  48. package/lib/module/components/toolbar/Toolbar.js +2 -2
  49. package/lib/module/context/ThemeProvider.js +22 -39
  50. package/lib/module/context/ThemeProvider.js.map +1 -1
  51. package/lib/module/context/index.js +1 -1
  52. package/lib/module/context/index.js.map +1 -1
  53. package/lib/module/theme/breakpoints.js +1 -1
  54. package/lib/module/theme/define-config.js +21 -0
  55. package/lib/module/theme/define-config.js.map +1 -0
  56. package/lib/module/theme/diagnostics.js +13 -0
  57. package/lib/module/theme/diagnostics.js.map +1 -0
  58. package/lib/module/theme/errors.js +15 -0
  59. package/lib/module/theme/errors.js.map +1 -0
  60. package/lib/module/theme/index.js +7 -1
  61. package/lib/module/theme/index.js.map +1 -1
  62. package/lib/module/theme/legacy-tokens.js +119 -0
  63. package/lib/module/theme/legacy-tokens.js.map +1 -0
  64. package/lib/module/theme/registry.js +122 -130
  65. package/lib/module/theme/registry.js.map +1 -1
  66. package/lib/module/theme/resolve-config.js +346 -0
  67. package/lib/module/theme/resolve-config.js.map +1 -0
  68. package/lib/module/theme/runtime.js +57 -12
  69. package/lib/module/theme/runtime.js.map +1 -1
  70. package/lib/module/theme/screen-margin.js +6 -14
  71. package/lib/module/theme/screen-margin.js.map +1 -1
  72. package/lib/module/theme/screen-padding.js +17 -0
  73. package/lib/module/theme/screen-padding.js.map +1 -0
  74. package/lib/module/theme/selection-store.js +75 -0
  75. package/lib/module/theme/selection-store.js.map +1 -0
  76. package/lib/module/theme/theme.js +81 -36
  77. package/lib/module/theme/theme.js.map +1 -1
  78. package/lib/module/theme/tokens/canonical-color-keys.js +102 -0
  79. package/lib/module/theme/tokens/canonical-color-keys.js.map +1 -0
  80. package/lib/module/theme/tokens/dark.js +72 -88
  81. package/lib/module/theme/tokens/dark.js.map +1 -1
  82. package/lib/module/theme/tokens/light.js +69 -83
  83. package/lib/module/theme/tokens/light.js.map +1 -1
  84. package/lib/module/theme/tokens/primitives.js +14 -14
  85. package/lib/module/theme/tokens/primitives.js.map +1 -1
  86. package/lib/module/theme/tokens/validate.js +238 -0
  87. package/lib/module/theme/tokens/validate.js.map +1 -0
  88. package/lib/module/theme/unistyles-adapter.js +77 -0
  89. package/lib/module/theme/unistyles-adapter.js.map +1 -0
  90. package/lib/module/utils/accent-generator.js +476 -0
  91. package/lib/module/utils/accent-generator.js.map +1 -0
  92. package/lib/module/utils/accent-utils.js +52 -35
  93. package/lib/module/utils/accent-utils.js.map +1 -1
  94. package/lib/module/utils/color-utils.js +224 -7
  95. package/lib/module/utils/color-utils.js.map +1 -1
  96. package/lib/module/utils/deep-merge.js +1 -1
  97. package/lib/module/utils/deep-merge.js.map +1 -1
  98. package/lib/module/utils/resolve-theme-color.js +2 -2
  99. package/lib/typescript/src/components/chip/types.d.ts +1 -1
  100. package/lib/typescript/src/components/empty-state/EmptyState.d.ts +1 -1
  101. package/lib/typescript/src/components/empty-state/EmptyState.d.ts.map +1 -1
  102. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts +6 -5
  103. package/lib/typescript/src/components/header/variants/LargeTitleHeader/index.d.ts.map +1 -1
  104. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts +11 -5
  105. package/lib/typescript/src/components/header/variants/TitleHeader/index.d.ts.map +1 -1
  106. package/lib/typescript/src/components/icon/Icon.d.ts +2 -2
  107. package/lib/typescript/src/components/screen/Screen.d.ts +45 -16
  108. package/lib/typescript/src/components/screen/Screen.d.ts.map +1 -1
  109. package/lib/typescript/src/components/screen/ScreenContext.d.ts +42 -26
  110. package/lib/typescript/src/components/screen/ScreenContext.d.ts.map +1 -1
  111. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts +5 -46
  112. package/lib/typescript/src/components/screen/ScreenFlatList.d.ts.map +1 -1
  113. package/lib/typescript/src/components/screen/ScreenList.d.ts +62 -50
  114. package/lib/typescript/src/components/screen/ScreenList.d.ts.map +1 -1
  115. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts +18 -58
  116. package/lib/typescript/src/components/screen/ScreenScrollView.d.ts.map +1 -1
  117. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts +5 -0
  118. package/lib/typescript/src/components/screen/hooks/use-screen-ref.d.ts.map +1 -0
  119. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts +53 -0
  120. package/lib/typescript/src/components/screen/hooks/use-screen-scroll-handler.d.ts.map +1 -0
  121. package/lib/typescript/src/components/screen/index.d.ts +2 -2
  122. package/lib/typescript/src/components/screen/index.d.ts.map +1 -1
  123. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts +6 -0
  124. package/lib/typescript/src/components/screen/parts/ScreenFrame.d.ts.map +1 -0
  125. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts +21 -0
  126. package/lib/typescript/src/components/screen/parts/ScreenHeaderAppearance.d.ts.map +1 -0
  127. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts +6 -8
  128. package/lib/typescript/src/components/screen/parts/ScreenPlaceholder.d.ts.map +1 -1
  129. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts +7 -0
  130. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.android.d.ts.map +1 -0
  131. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts +6 -0
  132. package/lib/typescript/src/components/screen/parts/ScreenSafeArea.d.ts.map +1 -0
  133. package/lib/typescript/src/components/screen/types.d.ts +27 -32
  134. package/lib/typescript/src/components/screen/types.d.ts.map +1 -1
  135. package/lib/typescript/src/components/screen/utils.d.ts +9 -8
  136. package/lib/typescript/src/components/screen/utils.d.ts.map +1 -1
  137. package/lib/typescript/src/components/text/Text.d.ts +1 -1
  138. package/lib/typescript/src/components/text/Text.d.ts.map +1 -1
  139. package/lib/typescript/src/components/toolbar/Toolbar.d.ts +2 -2
  140. package/lib/typescript/src/context/ThemeProvider.d.ts +29 -12
  141. package/lib/typescript/src/context/ThemeProvider.d.ts.map +1 -1
  142. package/lib/typescript/src/context/index.d.ts +1 -1
  143. package/lib/typescript/src/context/index.d.ts.map +1 -1
  144. package/lib/typescript/src/theme/breakpoints.d.ts +1 -1
  145. package/lib/typescript/src/theme/define-config.d.ts +23 -0
  146. package/lib/typescript/src/theme/define-config.d.ts.map +1 -0
  147. package/lib/typescript/src/theme/diagnostics.d.ts +4 -0
  148. package/lib/typescript/src/theme/diagnostics.d.ts.map +1 -0
  149. package/lib/typescript/src/theme/errors.d.ts +10 -0
  150. package/lib/typescript/src/theme/errors.d.ts.map +1 -0
  151. package/lib/typescript/src/theme/index.d.ts +10 -2
  152. package/lib/typescript/src/theme/index.d.ts.map +1 -1
  153. package/lib/typescript/src/theme/legacy-tokens.d.ts +187 -0
  154. package/lib/typescript/src/theme/legacy-tokens.d.ts.map +1 -0
  155. package/lib/typescript/src/theme/registry.d.ts +12 -17
  156. package/lib/typescript/src/theme/registry.d.ts.map +1 -1
  157. package/lib/typescript/src/theme/resolve-config.d.ts +99 -0
  158. package/lib/typescript/src/theme/resolve-config.d.ts.map +1 -0
  159. package/lib/typescript/src/theme/runtime.d.ts +25 -4
  160. package/lib/typescript/src/theme/runtime.d.ts.map +1 -1
  161. package/lib/typescript/src/theme/screen-margin.d.ts +6 -14
  162. package/lib/typescript/src/theme/screen-margin.d.ts.map +1 -1
  163. package/lib/typescript/src/theme/screen-padding.d.ts +15 -0
  164. package/lib/typescript/src/theme/screen-padding.d.ts.map +1 -0
  165. package/lib/typescript/src/theme/selection-store.d.ts +41 -0
  166. package/lib/typescript/src/theme/selection-store.d.ts.map +1 -0
  167. package/lib/typescript/src/theme/theme.d.ts +54 -1
  168. package/lib/typescript/src/theme/theme.d.ts.map +1 -1
  169. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts +95 -0
  170. package/lib/typescript/src/theme/tokens/canonical-color-keys.d.ts.map +1 -0
  171. package/lib/typescript/src/theme/tokens/dark.d.ts +56 -63
  172. package/lib/typescript/src/theme/tokens/dark.d.ts.map +1 -1
  173. package/lib/typescript/src/theme/tokens/light.d.ts +56 -71
  174. package/lib/typescript/src/theme/tokens/light.d.ts.map +1 -1
  175. package/lib/typescript/src/theme/tokens/primitives.d.ts +11 -10
  176. package/lib/typescript/src/theme/tokens/primitives.d.ts.map +1 -1
  177. package/lib/typescript/src/theme/tokens/validate.d.ts +34 -0
  178. package/lib/typescript/src/theme/tokens/validate.d.ts.map +1 -0
  179. package/lib/typescript/src/theme/types.d.ts +166 -86
  180. package/lib/typescript/src/theme/types.d.ts.map +1 -1
  181. package/lib/typescript/src/theme/unistyles-adapter.d.ts +33 -0
  182. package/lib/typescript/src/theme/unistyles-adapter.d.ts.map +1 -0
  183. package/lib/typescript/src/utils/accent-generator.d.ts +103 -0
  184. package/lib/typescript/src/utils/accent-generator.d.ts.map +1 -0
  185. package/lib/typescript/src/utils/accent-utils.d.ts +15 -2
  186. package/lib/typescript/src/utils/accent-utils.d.ts.map +1 -1
  187. package/lib/typescript/src/utils/color-utils.d.ts +59 -2
  188. package/lib/typescript/src/utils/color-utils.d.ts.map +1 -1
  189. package/lib/typescript/src/utils/deep-merge.d.ts +1 -0
  190. package/lib/typescript/src/utils/deep-merge.d.ts.map +1 -1
  191. package/lib/typescript/src/utils/resolve-theme-color.d.ts +2 -2
  192. package/package.json +1 -1
  193. package/src/components/avatar/Avatar.tsx +20 -20
  194. package/src/components/button/Button.tsx +11 -11
  195. package/src/components/chip/Chip.tsx +32 -32
  196. package/src/components/chip/types.ts +1 -1
  197. package/src/components/empty-state/EmptyState.tsx +4 -4
  198. package/src/components/header/variants/LargeTitleHeader/index.tsx +31 -30
  199. package/src/components/header/variants/TitleHeader/index.tsx +33 -22
  200. package/src/components/icon/Icon.tsx +4 -4
  201. package/src/components/page-indicator/hooks/use-page-indicator-colors.ts +2 -2
  202. package/src/components/screen/Screen.tsx +89 -43
  203. package/src/components/screen/ScreenContext.tsx +48 -28
  204. package/src/components/screen/ScreenFlatList.tsx +5 -191
  205. package/src/components/screen/ScreenList.tsx +197 -175
  206. package/src/components/screen/ScreenScrollView.tsx +92 -167
  207. package/src/components/screen/hooks/use-screen-ref.ts +24 -0
  208. package/src/components/screen/hooks/use-screen-scroll-handler.ts +31 -0
  209. package/src/components/screen/index.ts +8 -2
  210. package/src/components/screen/parts/ScreenFrame.tsx +49 -0
  211. package/src/components/screen/parts/ScreenHeaderAppearance.tsx +52 -0
  212. package/src/components/screen/parts/ScreenPlaceholder.tsx +16 -16
  213. package/src/components/screen/parts/ScreenSafeArea.android.tsx +22 -0
  214. package/src/components/screen/parts/ScreenSafeArea.tsx +20 -0
  215. package/src/components/screen/types.ts +29 -32
  216. package/src/components/screen/utils.ts +24 -11
  217. package/src/components/spinner/Spinner.tsx +2 -2
  218. package/src/components/text/Text.tsx +2 -2
  219. package/src/components/toast/Toast.tsx +13 -13
  220. package/src/components/toolbar/Toolbar.tsx +4 -4
  221. package/src/context/ThemeProvider.tsx +47 -51
  222. package/src/context/index.ts +1 -1
  223. package/src/theme/breakpoints.ts +1 -1
  224. package/src/theme/define-config.ts +27 -0
  225. package/src/theme/diagnostics.ts +11 -0
  226. package/src/theme/errors.ts +14 -0
  227. package/src/theme/index.ts +40 -1
  228. package/src/theme/legacy-tokens.ts +227 -0
  229. package/src/theme/registry.ts +119 -137
  230. package/src/theme/resolve-config.ts +406 -0
  231. package/src/theme/runtime.ts +52 -14
  232. package/src/theme/screen-margin.ts +6 -25
  233. package/src/theme/screen-padding.ts +26 -0
  234. package/src/theme/selection-store.ts +76 -0
  235. package/src/theme/theme.ts +104 -39
  236. package/src/theme/tokens/canonical-color-keys.ts +107 -0
  237. package/src/theme/tokens/dark.ts +91 -98
  238. package/src/theme/tokens/light.ts +88 -93
  239. package/src/theme/tokens/primitives.ts +14 -14
  240. package/src/theme/tokens/validate.ts +271 -0
  241. package/src/theme/types.ts +184 -95
  242. package/src/theme/unistyles-adapter.ts +75 -0
  243. package/src/utils/accent-generator.ts +530 -0
  244. package/src/utils/accent-utils.ts +66 -39
  245. package/src/utils/color-utils.ts +225 -8
  246. package/src/utils/deep-merge.ts +1 -1
  247. package/src/utils/resolve-theme-color.ts +2 -2
  248. package/lib/module/components/screen/parts/BottomSafeArea.js +0 -62
  249. package/lib/module/components/screen/parts/BottomSafeArea.js.map +0 -1
  250. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts +0 -30
  251. package/lib/typescript/src/components/screen/parts/BottomSafeArea.d.ts.map +0 -1
  252. package/src/components/screen/parts/BottomSafeArea.tsx +0 -59
@@ -0,0 +1,6 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import type { ScreenSafeAreaEdges } from "../types.js";
3
+ export declare function ScreenSafeArea({ children, edges }: PropsWithChildren<{
4
+ edges: ScreenSafeAreaEdges;
5
+ }>): import("react").JSX.Element;
6
+ //# sourceMappingURL=ScreenSafeArea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScreenSafeArea.d.ts","sourceRoot":"","sources":["../../../../../../src/components/screen/parts/ScreenSafeArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAU,CAAC;AAEpD,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,iBAAiB,CAAC;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC,+BAUpG"}
@@ -1,41 +1,36 @@
1
1
  import type { ReactNode } from "react";
2
- /**
3
- * Which axes of the `layout.screen.margin` token a scroll container pads its
4
- * content with.
5
- *
6
- * `'y'` pads the top and bottom of the content area. It stacks on top of the
7
- * structural insets the header height and the safe area which apply
8
- * whether or not margins are on.
9
- */
10
- export type ScreenMargins = "all" | "x" | "y" | "none";
11
- /**
12
- * Props shared by `Screen.ScrollView`, `Screen.FlatList` and `Screen.List`, so
13
- * a screen can swap one container for another without relearning its API.
14
- */
2
+ import type { ScrollHandlerProcessed } from "react-native-reanimated";
3
+ /** Axes that receive the theme's screen content padding. */
4
+ export type ScreenContentPadding = "all" | "x" | "y" | "none";
5
+ /** @deprecated Use ScreenContentPadding. */
6
+ export type ScreenMargins = ScreenContentPadding;
7
+ /** Edges protected by the Screen root. An empty array is equivalent to `"none"`. */
8
+ export type ScreenSafeArea = "auto" | "none" | readonly ("top" | "bottom" | "left" | "right")[];
9
+ /** Shared content layout and placeholders. Native props retain React Native names. */
15
10
  export interface ScreenScrollableProps {
16
- /** Lay content out along the x axis. Defaults to `false`. */
11
+ /** Scroll horizontally. @defaultValue false */
17
12
  horizontal?: boolean;
18
- /**
19
- * Renders a centred placeholder in the content area instead of the content —
20
- * spares every screen from hand-rolling a loading branch while its data
21
- * arrives. The `Screen.Header` still renders, so the chrome stays put.
22
- */
13
+ /** Replace content with a loading placeholder; `refreshing` keeps list rows visible. */
14
+ isLoading?: boolean;
15
+ /** Loading element. Undefined uses a Spinner; null renders a blank placeholder. */
16
+ loadingContent?: ReactNode;
17
+ /** Empty-state element. Lists otherwise use their native ListEmptyComponent. */
18
+ emptyContent?: ReactNode;
19
+ /** Override the root's themed content-padding axes. */
20
+ contentPadding?: ScreenContentPadding;
21
+ /** Additional bottom padding in layout points, added to themed padding. @defaultValue 0 */
22
+ extraBottomPadding?: number;
23
+ /** UI-thread worklet composed with Screen tracking. Native onScroll runs on the JS thread. */
24
+ scrollHandler?: ScrollHandlerProcessed<Record<string, unknown>>;
25
+ /** @deprecated Use isLoading. Ignored when isLoading is supplied. */
23
26
  loading?: boolean;
24
- /**
25
- * Node shown while `loading`. Defaults to a `Spinner`; it is centred in the
26
- * content area either way.
27
- */
27
+ /** @deprecated Pass an element through loadingContent. */
28
28
  LoadingComponent?: ReactNode;
29
- /**
30
- * Node shown, centred, when there is nothing to render and `loading` is
31
- * false — an empty `data` array on the list containers, no children on
32
- * `Screen.ScrollView`. Omit it to render nothing.
33
- */
29
+ /** @deprecated Pass an element through emptyContent. */
34
30
  EmptyComponent?: ReactNode;
35
- /**
36
- * Which axes get `layout.screen.margin` padding. Defaults to the enclosing
37
- * `Screen`'s `margins`.
38
- */
31
+ /** @deprecated Use contentPadding. */
39
32
  margins?: ScreenMargins;
40
33
  }
34
+ /** Internal edge flags shared by the platform safe-area wrappers. */
35
+ export type ScreenSafeAreaEdges = Record<"top" | "bottom" | "left" | "right", boolean>;
41
36
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,GAAG,GAAG,GAAG,GAAG,MAAM,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,6DAA6D;IAC7D,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IA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D,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,sCAAsC;IACtC,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,qEAAqE;AACrE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { type ComponentType, type ReactElement } from "react";
2
- import type { ScreenMargins } from "./types.js";
3
- export type ListHeaderComponent = ComponentType | ReactElement | null | undefined;
4
- /** Renders a `ListHeaderComponent`-shaped prop (element, component, or nullish) into an element. */
5
- export declare function renderListHeader(ListHeaderComponent: ListHeaderComponent): ReactElement | null;
6
- /** Whether `margins` pads the horizontal axis. */
7
- export declare const hasXMargin: (margins: ScreenMargins) => boolean;
8
- /** Whether `margins` pads the vertical axis (the bottom of the content area). */
9
- export declare const hasYMargin: (margins: ScreenMargins) => boolean;
2
+ import type { ScreenContentPadding, ScreenSafeArea, ScreenSafeAreaEdges } from "./types.js";
3
+ export type ListComponent = ComponentType | ReactElement | null | undefined;
4
+ /** Resolves a list header, footer, or empty component to an element. */
5
+ export declare function renderListComponent(ListComponent: ListComponent): ReactElement | null;
6
+ /** Whether `padding` pads the horizontal axis. */
7
+ export declare const hasHorizontalPadding: (padding: ScreenContentPadding) => boolean;
8
+ /** Whether `padding` pads the vertical axis (top and bottom). */
9
+ export declare const hasVerticalPadding: (padding: ScreenContentPadding) => boolean;
10
+ export declare function resolveSafeAreaEdges(safeArea: ScreenSafeArea): ScreenSafeAreaEdges;
10
11
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAS,CAAC;AAE7C,MAAM,MAAM,mBAAmB,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;AAElF,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,mBAAmB,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAI9F;AAED,kDAAkD;AAClD,eAAO,MAAM,UAAU,GAAI,SAAS,aAAa,KAAG,OAA+C,CAAC;AAEpG,iFAAiF;AACjF,eAAO,MAAM,UAAU,GAAI,SAAS,aAAa,KAAG,OAA+C,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/screen/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAiC,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAE7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAS,CAAC;AAEzF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;AAE5E,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAIrF;AAED,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,GAAI,SAAS,oBAAoB,KAAG,OAC/B,CAAC;AAEvC,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,GAAI,SAAS,oBAAoB,KAAG,OAC7B,CAAC;AAEvC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,GAAG,mBAAmB,CASlF"}
@@ -4,7 +4,7 @@ export type TextAlign = "left" | "center" | "right" | "justify";
4
4
  export interface TextProps extends RNTextProps {
5
5
  /** Typographic role. Defaults to `body-md`. */
6
6
  variant?: TextVariant;
7
- /** Semantic color token (e.g. `content.secondary`, `status.danger.solid`). */
7
+ /** Semantic color token (e.g. `text.secondary`, `danger.soft.fg`). */
8
8
  color?: ColorToken;
9
9
  /** Override the variant's default weight. */
10
10
  weight?: FontWeightToken;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,SAAS,IAAI,WAAW,EAAkB,MAAM,cAAc,CAAC;AAI7F,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EAGf,WAAW,EACZ,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAiBhE,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,+CAA+C;IAC/C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uLA6Df,CAAC"}
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/Text.tsx"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,SAAS,IAAI,WAAW,EAAkB,MAAM,cAAc,CAAC;AAI7F,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EAGf,WAAW,EACZ,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAiBhE,MAAM,WAAW,SAAU,SAAQ,WAAW;IAC5C,+CAA+C;IAC/C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,sEAAsE;IACtE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,WAAW,GAAG,WAAW,GAAG,YAAY,CAAC;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,uLA6Df,CAAC"}
@@ -8,7 +8,7 @@ interface ToolbarButtonBaseProps extends Omit<PressableProps, "children" | "styl
8
8
  iconSize?: number;
9
9
  /**
10
10
  * Foreground token for the icon and label. Defaults to the group's `tint`,
11
- * or `text.default` outside a group.
11
+ * or `text.primary` outside a group.
12
12
  */
13
13
  tint?: ColorToken;
14
14
  /**
@@ -58,7 +58,7 @@ export interface ToolbarGroupProps extends ViewProps {
58
58
  background?: ColorToken;
59
59
  /**
60
60
  * Foreground token inherited by every item's icon and label. Defaults to
61
- * `text.default`; a per-item `tint` still wins.
61
+ * `text.primary`; a per-item `tint` still wins.
62
62
  */
63
63
  tint?: ColorToken;
64
64
  children?: ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { type PropsWithChildren } from "react";
2
- import { type ResolvedScreenMargin } from "../theme/screen-margin.js";
3
- import type { Scheme, TerraTheme } from "../theme/types.js";
2
+ import { type ResolvedScreenPadding } from "../theme/screen-padding.js";
3
+ import type { Scheme, TerraTheme, ThemeMode } from "../theme/types.js";
4
4
  /**
5
5
  * Root provider for Terra UI. Wrap your app once near the root.
6
6
  *
@@ -13,25 +13,42 @@ export declare const TerraUIProvider: ({ children }: PropsWithChildren) => impor
13
13
  export interface UseThemeResult {
14
14
  /** The active resolved theme. */
15
15
  theme: TerraTheme;
16
- /** Active color scheme. */
16
+ /**
17
+ * The currently resolved color scheme — what Unistyles is rendering right
18
+ * now. Under `mode: "system"` this follows the OS appearance.
19
+ */
17
20
  scheme: Scheme;
18
- /** Switch scheme (disables system-adaptive theming). */
21
+ /** Pin a scheme (stops following the system). Same as `setMode(scheme)`. */
19
22
  setScheme: (scheme: Scheme) => void;
20
- /** Active accent name, if any. */
23
+ /** Applied accent name, or `undefined` for the base themes. */
21
24
  accent: string | undefined;
22
- /** Switch to a registered accent. */
23
- setAccent: (name: string) => void;
25
+ /**
26
+ * Apply a registered accent; `null` restores the base themes. An unknown
27
+ * name warns in development and leaves the accent unchanged.
28
+ */
29
+ setAccent: (name: string | null) => void;
30
+ /**
31
+ * How the active scheme is chosen: `system` follows the OS appearance,
32
+ * `light` / `dark` pin a scheme. A system appearance change updates
33
+ * `scheme`, never `mode`.
34
+ */
35
+ mode: ThemeMode;
36
+ /** Change the theme mode; `setMode("system")` returns to the OS preference. */
37
+ setMode: (mode: ThemeMode) => void;
24
38
  }
25
39
  /**
26
- * Access the active theme and switch scheme / accent / radius.
27
- * Must be used under {@link TerraUIProvider}.
40
+ * Access the active theme and switch scheme / mode / accent. Selection state
41
+ * comes from the runtime store, so changes made imperatively (`applyAccent`,
42
+ * `setThemeMode`) and through this hook are observed by every consumer.
28
43
  */
29
44
  export declare function useTheme(): UseThemeResult;
30
45
  /**
31
- * Resolves `theme.layout.screen.margin` for the current runtime breakpoint.
46
+ * Resolves `theme.layout.screen.padding` for the current runtime breakpoint.
32
47
  * For use outside a `StyleSheet.create` factory (e.g. plain-JS layout maths);
33
- * inside one, call `resolveScreenMargin(theme, rt.breakpoint)` directly so
48
+ * inside one, call `resolveScreenPadding(theme, rt.breakpoint)` directly so
34
49
  * the value stays reactive without a React re-render.
35
50
  */
36
- export declare function useScreenMargin(): ResolvedScreenMargin;
51
+ export declare function useScreenPadding(): ResolvedScreenPadding;
52
+ /** @deprecated Use useScreenPadding. */
53
+ export declare const useScreenMargin: typeof useScreenPadding;
37
54
  //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAO1G,OAAO,EAAE,KAAK,oBAAoB,EAAuB,MAAM,2BAAwB,CAAC;AACxF,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,mBAAgB,CAAC;AAczD;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,gCAe9D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB,2BAA2B;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,kCAAkC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,qCAAqC;IACrC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAezC;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,IAAI,oBAAoB,CAGtD"}
1
+ {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../../../src/context/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAarE,OAAO,EAAE,KAAK,qBAAqB,EAAwB,MAAM,4BAAyB,CAAC;AAC3F,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,mBAAgB,CAAC;AAOpE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,cAAc,iBAAiB,gCAE9D,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC;IAClB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,+DAA+D;IAC/D,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B;;;OAGG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACzC;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,cAAc,CAazC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAGxD;AAED,wCAAwC;AACxC,eAAO,MAAM,eAAe,yBAAmB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export type { UseThemeResult } from "./ThemeProvider.js";
2
- export { TerraUIProvider, useScreenMargin, useTheme } from "./ThemeProvider.js";
2
+ export { TerraUIProvider, useScreenMargin, useScreenPadding, useTheme } from "./ThemeProvider.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/context/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/context/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,oBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,oBAAiB,CAAC"}
@@ -18,7 +18,7 @@ declare module "react-native-unistyles" {
18
18
  }
19
19
  }
20
20
  /**
21
- * Resolves a per-breakpoint record (e.g. `theme.layout.screen.margin.x`) to
21
+ * Resolves a per-breakpoint record (e.g. `theme.layout.screen.padding.x`) to
22
22
  * the value for the current runtime breakpoint (`rt.breakpoint`). A
23
23
  * `StyleSheet.create` factory re-runs on breakpoint change, so calling this
24
24
  * inside one keeps the resolved value reactive.
@@ -0,0 +1,23 @@
1
+ import type { TerraConfig } from "./types.js";
2
+ /** The literal accent names declared in `T.accents`, or `never` when none are declared. */
3
+ type DeclaredAccentNames<T> = T extends {
4
+ accents: infer A;
5
+ } ? A extends Record<string, unknown> ? keyof A & string : never : never;
6
+ /**
7
+ * Identity helper for authoring a {@link TerraConfig} with contextual typing.
8
+ * Has no side effects. With literal `accents`, `defaultAccent` must name one of
9
+ * them; a dynamic `Record<string, Accent>` keeps `defaultAccent` as `string`
10
+ * and defers to runtime validation.
11
+ *
12
+ * @example
13
+ * const config = defineTerraConfig({
14
+ * accents: { indigo: { light: "#4f46e5", dark: "#818cf8" } },
15
+ * defaultAccent: "indigo",
16
+ * });
17
+ * configureTerraUI(config);
18
+ */
19
+ export declare function defineTerraConfig<const T extends TerraConfig>(config: T & {
20
+ defaultAccent?: DeclaredAccentNames<T>;
21
+ }): T;
22
+ export {};
23
+ //# sourceMappingURL=define-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../../../../src/theme/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAS,CAAC;AAE3C,2FAA2F;AAC3F,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,OAAO,EAAE,MAAM,CAAC,CAAA;CAAE,GACxD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,MAAM,CAAC,GAAG,MAAM,GAChB,KAAK,GACP,KAAK,CAAC;AAEV;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,CAAC,SAAS,WAAW,EAC3D,MAAM,EAAE,CAAC,GAAG;IAAE,aAAa,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAA;CAAE,GACrD,CAAC,CAEH"}
@@ -0,0 +1,4 @@
1
+ import type { ContrastDiagnostic } from "../utils/accent-generator";
2
+ /** Reports each distinct contrast diagnostic once per resolution. */
3
+ export declare function warnContrastDiagnostics(diagnostics: readonly ContrastDiagnostic[]): void;
4
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../../../src/theme/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,qEAAqE;AACrE,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,SAAS,kBAAkB,EAAE,GAAG,IAAI,CAOxF"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Thrown for invalid pure configuration input — before any registry, selection,
3
+ * or native state is touched. `path` points at the offending config entry, e.g.
4
+ * `accents.indigo.dark.seed` or `defaultAccent`.
5
+ */
6
+ export declare class TerraConfigError extends Error {
7
+ readonly path: string;
8
+ constructor(path: string, message: string);
9
+ }
10
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/theme/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAK1C"}
@@ -1,3 +1,5 @@
1
+ export type { AccentGenerationContext, AccentGenerationResult, AccentSurfaceRole, ContrastDiagnostic, ContrastDiagnosticKind, GeneratedAccentRole, } from "../utils/accent-generator";
2
+ export { checkAccentContrast, generateAccentColors, isSupportedAccentSeed, } from "../utils/accent-generator";
1
3
  export { normalizeAccent } from "../utils/accent-utils";
2
4
  export { readableOn, shade, withAlpha } from "../utils/color-utils";
3
5
  export type { DeepPartial } from "../utils/deep-merge";
@@ -6,10 +8,16 @@ export { resolveThemeColor } from "../utils/resolve-theme-color";
6
8
  export { FONT_WEIGHT_VALUE, SYSTEM_FONT } from "../utils/typography";
7
9
  export type { AppBreakpoints, BreakpointName } from "./breakpoints.js";
8
10
  export { breakpoints, resolveBreakpointValue } from "./breakpoints.js";
11
+ export { defineTerraConfig } from "./define-config.js";
12
+ export { TerraConfigError } from "./errors.js";
9
13
  export { configureTerraUI, getAccentNames, getDefaultRadius, getIcon, getImageComponent, getIsConfigured, getRequiredIcon, getSurfaceElevation, resolveTheme, } from "./registry.js";
10
- export { applyAccent, applyScheme, getCurrentAccent } from "./runtime.js";
14
+ export { createTerraThemes } from "./resolve-config.js";
15
+ export type { ThemeSelection } from "./runtime.js";
16
+ export { applyAccent, applyScheme, getCurrentAccent, getThemeMode, getThemeSelection, setThemeMode, } from "./runtime.js";
11
17
  export type { ResolvedScreenMargin } from "./screen-margin.js";
12
18
  export { resolveScreenMargin } from "./screen-margin.js";
19
+ export type { ResolvedScreenPadding } from "./screen-padding.js";
20
+ export { resolveScreenPadding } from "./screen-padding.js";
13
21
  export { defaultDarkTheme, defaultLightTheme } from "./theme.js";
14
- export type { Accent, AccentOverride, AccentShorthand, ActionColorToken, BackgroundColorToken, BorderColorToken, ButtonDefaults, ColorToken, ComponentDefaults, ContentColorToken, DefaultRadiusToken, ElevationKey, ElevationScale, ElevationStyle, FontWeightToken, LayoutTokens, OpacityTokens, RadiusComponent, RadiusKey, Scheme, SpacingKey, StatusColorToken, SurfaceColorToken, SurfaceDefaults, TerraConfig, TerraIconComponent, TerraIconName, TerraIconProps, TerraImageComponent, TerraImageContentFit, TerraImageProps, TerraSemanticIconName, TerraTheme, TerraThemeOverride, TextColorToken, TextVariant, ThemeColor, ThemeRadiusOverride, TypeStyle, Typography, } from "./types.js";
22
+ export type { Accent, AccentColorToken, AccentOverride, AccentSchemeInput, AccentSeed, AccentShorthand, ActionColorToken, BackgroundColorToken, BorderColorToken, ButtonDefaults, CanonicalThemeColor, ColorToken, ComponentDefaults, ContentColorToken, CreateTerraThemesOptions, DefaultRadiusToken, ElevationKey, ElevationScale, ElevationStyle, FontWeightToken, LayoutTokens, NeutralColorToken, OpacityTokens, RadiusComponent, RadiusKey, Scheme, ScreenPaddingTokens, SpacingKey, StatusColorToken, SurfaceColorToken, SurfaceDefaults, TerraColorRegistry, TerraColorRegistryCollision, TerraConfig, TerraCustomColorName, TerraIconComponent, TerraIconName, TerraIconProps, TerraImageComponent, TerraImageContentFit, TerraImageProps, TerraSemanticIconName, TerraTheme, TerraThemeInput, TerraThemeOverride, TextColorToken, TextVariant, ThemeColor, ThemeMode, ThemeRadiusOverride, ThemeSpacingOverride, TypeStyle, Typography, } from "./types.js";
15
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAClE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEnE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAe,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,kBAAe,CAAC;AAEpE,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,YAAY,GACb,MAAM,eAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAW,CAAC;AACvE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAiB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAiB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAE9D,YAAY,EACV,MAAM,EACN,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,aAAa,EACb,eAAe,EACf,SAAS,EACT,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,UAAU,EACV,mBAAmB,EACnB,SAAS,EACT,UAAU,GACX,MAAM,YAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAQA,YAAY,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,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EAChB,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,2BAA2B,EAC3B,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,UAAU,GACX,MAAM,YAAS,CAAC"}
@@ -0,0 +1,187 @@
1
+ import type { CanonicalThemeColor, TerraTheme, TerraThemeOverride } from "./types.js";
2
+ /** Legacy color names. Explicit action/status-property aliases come first to resolve synonyms. */
3
+ export declare const legacyColorAliases: {
4
+ readonly "action.bg.primary": "accent.solid.bg";
5
+ readonly "action.bg.primary.active": "accent.solid.bg.pressed";
6
+ readonly "action.bg.primary.disabled": "accent.solid.bg.disabled";
7
+ readonly "action.bg.primary.hover": "accent.solid.bg.hover";
8
+ readonly "action.bg.primary.subtle": "accent.soft.bg";
9
+ readonly "action.bg.primary.subtle.active": "accent.soft.bg.pressed";
10
+ readonly "action.bg.primary.subtle.disabled": "accent.soft.bg.disabled";
11
+ readonly "action.bg.primary.subtle.hover": "accent.soft.bg.hover";
12
+ readonly "action.bg.secondary": "neutral.solid.bg";
13
+ readonly "action.bg.secondary.subtle": "neutral.soft.bg";
14
+ readonly "action.bg.secondary.subtle.active": "neutral.soft.bg.pressed";
15
+ readonly "action.bg.secondary.subtle.disabled": "neutral.soft.bg.disabled";
16
+ readonly "action.bg.secondary.subtle.hover": "neutral.soft.bg.hover";
17
+ readonly "action.fg.primary": "accent.solid.fg";
18
+ readonly "action.fg.primary.subtle": "accent.soft.fg";
19
+ readonly "action.fg.secondary": "neutral.solid.fg";
20
+ readonly "action.fg.secondary.subtle": "neutral.soft.fg";
21
+ readonly "status.danger.bg": "danger.solid.bg";
22
+ readonly "status.danger.bg.subtle": "danger.soft.bg";
23
+ readonly "status.danger.border": "danger.solid.border";
24
+ readonly "status.danger.border.subtle": "danger.soft.border";
25
+ readonly "status.danger.fg": "danger.solid.fg";
26
+ readonly "status.danger.fg.subtle": "danger.soft.fg";
27
+ readonly "status.info.bg": "info.solid.bg";
28
+ readonly "status.info.bg.subtle": "info.soft.bg";
29
+ readonly "status.info.border": "info.solid.border";
30
+ readonly "status.info.border.subtle": "info.soft.border";
31
+ readonly "status.info.fg": "info.solid.fg";
32
+ readonly "status.info.fg.subtle": "info.soft.fg";
33
+ readonly "status.success.bg": "success.solid.bg";
34
+ readonly "status.success.bg.subtle": "success.soft.bg";
35
+ readonly "status.success.border": "success.solid.border";
36
+ readonly "status.success.border.subtle": "success.soft.border";
37
+ readonly "status.success.fg": "success.solid.fg";
38
+ readonly "status.success.fg.subtle": "success.soft.fg";
39
+ readonly "status.warning.bg": "warning.solid.bg";
40
+ readonly "status.warning.bg.subtle": "warning.soft.bg";
41
+ readonly "status.warning.border": "warning.solid.border";
42
+ readonly "status.warning.border.subtle": "warning.soft.border";
43
+ readonly "status.warning.fg": "warning.solid.fg";
44
+ readonly "status.warning.fg.subtle": "warning.soft.fg";
45
+ readonly background: "surface.canvas";
46
+ readonly "border.accent": "accent.border";
47
+ readonly "border.focus": "focus.ring";
48
+ readonly "status.danger": "danger.solid.bg";
49
+ readonly "status.info": "info.solid.bg";
50
+ readonly "status.success": "success.solid.bg";
51
+ readonly "status.warning": "warning.solid.bg";
52
+ readonly "surface.accent": "accent.solid.bg";
53
+ readonly "surface.accent.subtle": "accent.soft.bg";
54
+ readonly "surface.overlay": "backdrop";
55
+ readonly "text.accent": "accent.text";
56
+ readonly "text.default": "text.primary";
57
+ readonly "text.muted": "text.secondary";
58
+ readonly "text.on-accent": "accent.solid.fg";
59
+ readonly "text.on-accent-subtle": "accent.soft.fg";
60
+ readonly "text.subtle": "text.tertiary";
61
+ };
62
+ export interface LegacyThemeColor {
63
+ /** @deprecated Use `accent.solid.bg`. */
64
+ "action.bg.primary": string;
65
+ /** @deprecated Use `accent.solid.bg.pressed`. */
66
+ "action.bg.primary.active": string;
67
+ /** @deprecated Use `accent.solid.bg.disabled`. */
68
+ "action.bg.primary.disabled": string;
69
+ /** @deprecated Use `accent.solid.bg.hover`. */
70
+ "action.bg.primary.hover": string;
71
+ /** @deprecated Use `accent.soft.bg`. */
72
+ "action.bg.primary.subtle": string;
73
+ /** @deprecated Use `accent.soft.bg.pressed`. */
74
+ "action.bg.primary.subtle.active": string;
75
+ /** @deprecated Use `accent.soft.bg.disabled`. */
76
+ "action.bg.primary.subtle.disabled": string;
77
+ /** @deprecated Use `accent.soft.bg.hover`. */
78
+ "action.bg.primary.subtle.hover": string;
79
+ /** @deprecated Use `neutral.solid.bg`. */
80
+ "action.bg.secondary": string;
81
+ /** @deprecated Use `neutral.soft.bg`. */
82
+ "action.bg.secondary.subtle": string;
83
+ /** @deprecated Use `neutral.soft.bg.pressed`. */
84
+ "action.bg.secondary.subtle.active": string;
85
+ /** @deprecated Use `neutral.soft.bg.disabled`. */
86
+ "action.bg.secondary.subtle.disabled": string;
87
+ /** @deprecated Use `neutral.soft.bg.hover`. */
88
+ "action.bg.secondary.subtle.hover": string;
89
+ /** @deprecated Use `accent.solid.fg`. */
90
+ "action.fg.primary": string;
91
+ /** @deprecated Use `accent.soft.fg`. */
92
+ "action.fg.primary.subtle": string;
93
+ /** @deprecated Use `neutral.solid.fg`. */
94
+ "action.fg.secondary": string;
95
+ /** @deprecated Use `neutral.soft.fg`. */
96
+ "action.fg.secondary.subtle": string;
97
+ /** @deprecated Use `danger.solid.bg`. */
98
+ "status.danger.bg": string;
99
+ /** @deprecated Use `danger.soft.bg`. */
100
+ "status.danger.bg.subtle": string;
101
+ /** @deprecated Use `danger.solid.border`. */
102
+ "status.danger.border": string;
103
+ /** @deprecated Use `danger.soft.border`. */
104
+ "status.danger.border.subtle": string;
105
+ /** @deprecated Use `danger.solid.fg`. */
106
+ "status.danger.fg": string;
107
+ /** @deprecated Use `danger.soft.fg`. */
108
+ "status.danger.fg.subtle": string;
109
+ /** @deprecated Use `info.solid.bg`. */
110
+ "status.info.bg": string;
111
+ /** @deprecated Use `info.soft.bg`. */
112
+ "status.info.bg.subtle": string;
113
+ /** @deprecated Use `info.solid.border`. */
114
+ "status.info.border": string;
115
+ /** @deprecated Use `info.soft.border`. */
116
+ "status.info.border.subtle": string;
117
+ /** @deprecated Use `info.solid.fg`. */
118
+ "status.info.fg": string;
119
+ /** @deprecated Use `info.soft.fg`. */
120
+ "status.info.fg.subtle": string;
121
+ /** @deprecated Use `success.solid.bg`. */
122
+ "status.success.bg": string;
123
+ /** @deprecated Use `success.soft.bg`. */
124
+ "status.success.bg.subtle": string;
125
+ /** @deprecated Use `success.solid.border`. */
126
+ "status.success.border": string;
127
+ /** @deprecated Use `success.soft.border`. */
128
+ "status.success.border.subtle": string;
129
+ /** @deprecated Use `success.solid.fg`. */
130
+ "status.success.fg": string;
131
+ /** @deprecated Use `success.soft.fg`. */
132
+ "status.success.fg.subtle": string;
133
+ /** @deprecated Use `warning.solid.bg`. */
134
+ "status.warning.bg": string;
135
+ /** @deprecated Use `warning.soft.bg`. */
136
+ "status.warning.bg.subtle": string;
137
+ /** @deprecated Use `warning.solid.border`. */
138
+ "status.warning.border": string;
139
+ /** @deprecated Use `warning.soft.border`. */
140
+ "status.warning.border.subtle": string;
141
+ /** @deprecated Use `warning.solid.fg`. */
142
+ "status.warning.fg": string;
143
+ /** @deprecated Use `warning.soft.fg`. */
144
+ "status.warning.fg.subtle": string;
145
+ /** @deprecated Use `surface.canvas`. */
146
+ "background": string;
147
+ /** @deprecated Use `accent.border`. */
148
+ "border.accent": string;
149
+ /** @deprecated Use `focus.ring`. */
150
+ "border.focus": string;
151
+ /** @deprecated Use `danger.solid.bg`. */
152
+ "status.danger": string;
153
+ /** @deprecated Use `info.solid.bg`. */
154
+ "status.info": string;
155
+ /** @deprecated Use `success.solid.bg`. */
156
+ "status.success": string;
157
+ /** @deprecated Use `warning.solid.bg`. */
158
+ "status.warning": string;
159
+ /** @deprecated Use `accent.solid.bg`. */
160
+ "surface.accent": string;
161
+ /** @deprecated Use `accent.soft.bg`. */
162
+ "surface.accent.subtle": string;
163
+ /** @deprecated Use `backdrop`. */
164
+ "surface.overlay": string;
165
+ /** @deprecated Use `accent.text`. */
166
+ "text.accent": string;
167
+ /** @deprecated Use `text.primary`. */
168
+ "text.default": string;
169
+ /** @deprecated Use `text.secondary`. */
170
+ "text.muted": string;
171
+ /** @deprecated Use `accent.solid.fg`. */
172
+ "text.on-accent": string;
173
+ /** @deprecated Use `accent.soft.fg`. */
174
+ "text.on-accent-subtle": string;
175
+ /** @deprecated Use `text.tertiary`. */
176
+ "text.subtle": string;
177
+ }
178
+ /** Normalize each authored layer before merging, so aliases respect layer precedence. */
179
+ export declare function normalizeTokenOverride(override?: TerraThemeOverride): TerraThemeOverride | undefined;
180
+ /** Materialize aliases for direct theme reads as well as component color props. */
181
+ export declare function withLegacyTokens(theme: Omit<TerraTheme, "color" | "layout"> & {
182
+ color: CanonicalThemeColor;
183
+ layout: Omit<TerraTheme["layout"], "screen"> & {
184
+ screen: Pick<TerraTheme["layout"]["screen"], "padding">;
185
+ };
186
+ }): TerraTheme;
187
+ //# sourceMappingURL=legacy-tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-tokens.d.ts","sourceRoot":"","sources":["../../../../src/theme/legacy-tokens.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM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;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wCAAwC;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,kCAAkC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,gBAAgB,EAAE,MAAM,CAAC;IACzB,wCAAwC;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,QAAQ,CAAC,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,SAAS,CAqBpG;AAED,mFAAmF;AACnF,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAC,GAAG;IAC5C,KAAK,EAAE,mBAAmB,CAAC;IAC3B,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,GAAG;QAC7C,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAC;KACzD,CAAC;CACH,GACA,UAAU,CAaZ"}
@@ -1,25 +1,12 @@
1
- import type { DefaultRadiusToken, ElevationKey, NormalizedAccent, RadiusComponent, Scheme, TerraConfig, TerraIconComponent, TerraImageComponent, TerraSemanticIconName, TerraTheme } from "./types.js";
2
- type ResolvedRadius = Record<RadiusComponent, DefaultRadiusToken>;
1
+ import type { DefaultRadiusToken, ElevationKey, RadiusComponent, Scheme, TerraConfig, TerraIconComponent, TerraImageComponent, TerraSemanticIconName, TerraTheme } from "./types.js";
3
2
  declare module "react-native-unistyles" {
4
3
  interface UnistylesThemes {
5
4
  light: TerraTheme;
6
5
  dark: TerraTheme;
7
6
  }
8
7
  }
9
- interface Registry {
10
- baseLight: TerraTheme;
11
- baseDark: TerraTheme;
12
- accents: Record<string, NormalizedAccent>;
13
- currentAccent?: string;
14
- defaultRadius: ResolvedRadius;
15
- surfaceElevation: ElevationKey;
16
- icons: Record<string, TerraIconComponent>;
17
- imageComponent: TerraImageComponent;
18
- configured: boolean;
19
- }
20
- /** @internal */
21
- export declare const getRegistry: () => Registry;
22
8
  export declare const getIsConfigured: () => boolean;
9
+ /** Names of the registered accents, in declaration order. Returns a fresh array. */
23
10
  export declare const getAccentNames: () => string[];
24
11
  export declare const getImageComponent: () => TerraImageComponent;
25
12
  export declare const getIcon: (name: string) => TerraIconComponent | undefined;
@@ -34,13 +21,22 @@ export declare const getDefaultRadius: (component: RadiusComponent) => DefaultRa
34
21
  * Set via {@link configureTerraUI}; defaults to `'none'`.
35
22
  */
36
23
  export declare const getSurfaceElevation: () => ElevationKey;
37
- /** Resolves a scheme's theme = base ⊕ the named accent's partial override. */
24
+ /**
25
+ * Resolves one scheme's theme from the installed configuration with the named
26
+ * accent overlaid. Omitting `accentName` selects the base theme (no accent —
27
+ * not the configured `defaultAccent`). An unknown name warns in development
28
+ * and falls back to the base theme. Pure with respect to runtime state: it
29
+ * never changes the applied selection.
30
+ */
38
31
  export declare function resolveTheme(scheme: Scheme, accentName?: string): TerraTheme;
39
32
  /**
40
33
  * Configure Terra UI's themes. Call ONCE, as early as possible — before any
41
34
  * component renders (e.g. top of the app entry, imported from
42
35
  * `react-native-terra-ui/theme`). With no arguments it registers the default
43
36
  * theme; `<TerraUIProvider>` calls it for you if you haven't.
37
+ *
38
+ * Invalid input throws {@link TerraConfigError} before anything is installed,
39
+ * so a corrected retry is still the app's one configure call.
44
40
  */
45
41
  export declare function configureTerraUI(config?: TerraConfig): void;
46
42
  /**
@@ -56,5 +52,4 @@ export declare function configureTerraUI(config?: TerraConfig): void;
56
52
  * @internal
57
53
  */
58
54
  export declare function bootstrapTerraUI(): void;
59
- export {};
60
55
  //# sourceMappingURL=registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/theme/registry.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAEV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,UAAU,EAEX,MAAM,YAAS,CAAC;AASjB,KAAK,cAAc,GAAG,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;AASlE,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAiB,eAAe;QAC9B,KAAK,EAAE,UAAU,CAAC;QAClB,IAAI,EAAE,UAAU,CAAC;KAClB;CACF;AAED,UAAU,QAAQ;IAChB,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,cAAc,CAAC;IAC9B,gBAAgB,EAAE,YAAY,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC1C,cAAc,EAAE,mBAAmB,CAAC;IACpC,UAAU,EAAE,OAAO,CAAC;CACrB;AAcD,gBAAgB;AAChB,eAAO,MAAM,WAAW,QAAO,QAAoB,CAAC;AAEpD,eAAO,MAAM,eAAe,QAAO,OAA8B,CAAC;AAElE,eAAO,MAAM,cAAc,QAAO,MAAM,EAAmC,CAAC;AAE5E,eAAO,MAAM,iBAAiB,QAAO,mBAA8C,CAAC;AAEpF,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,kBAAkB,GAAG,SACS,CAAC;AAEtE,eAAO,MAAM,eAAe,GAAI,MAAM,qBAAqB,KAAG,kBAClB,CAAC;AAE7C;;;GAGG;AACH,eAAO,M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