@ankhorage/zora 0.10.0 → 0.12.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 (469) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +39 -2
  3. package/dist/components/badge/Badge.d.ts +1 -1
  4. package/dist/components/badge/Badge.d.ts.map +1 -1
  5. package/dist/components/badge/Badge.js +3 -1
  6. package/dist/components/badge/Badge.js.map +1 -1
  7. package/dist/components/badge/types.d.ts +2 -1
  8. package/dist/components/badge/types.d.ts.map +1 -1
  9. package/dist/components/badge/types.js.map +1 -1
  10. package/dist/components/button/Button.d.ts +1 -1
  11. package/dist/components/button/Button.d.ts.map +1 -1
  12. package/dist/components/card/Card.d.ts +1 -1
  13. package/dist/components/card/Card.d.ts.map +1 -1
  14. package/dist/components/checkbox/Checkbox.d.ts +4 -0
  15. package/dist/components/checkbox/Checkbox.d.ts.map +1 -0
  16. package/dist/components/checkbox/Checkbox.js +8 -0
  17. package/dist/components/checkbox/Checkbox.js.map +1 -0
  18. package/dist/components/checkbox/CheckboxGroup.d.ts +1 -1
  19. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
  20. package/dist/components/checkbox/CheckboxGroup.js +3 -1
  21. package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
  22. package/dist/components/checkbox/index.d.ts +2 -3
  23. package/dist/components/checkbox/index.d.ts.map +1 -1
  24. package/dist/components/checkbox/index.js +1 -1
  25. package/dist/components/checkbox/index.js.map +1 -1
  26. package/dist/components/checkbox/types.d.ts +5 -2
  27. package/dist/components/checkbox/types.d.ts.map +1 -1
  28. package/dist/components/checkbox/types.js.map +1 -1
  29. package/dist/components/drawer/Drawer.d.ts +1 -1
  30. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  31. package/dist/components/drawer/Drawer.js +3 -1
  32. package/dist/components/drawer/Drawer.js.map +1 -1
  33. package/dist/components/drawer/types.d.ts +2 -1
  34. package/dist/components/drawer/types.d.ts.map +1 -1
  35. package/dist/components/drawer/types.js.map +1 -1
  36. package/dist/components/form/Form.d.ts +1 -1
  37. package/dist/components/form/Form.d.ts.map +1 -1
  38. package/dist/components/form/Form.js +3 -1
  39. package/dist/components/form/Form.js.map +1 -1
  40. package/dist/components/form/FormActions.d.ts +1 -1
  41. package/dist/components/form/FormActions.d.ts.map +1 -1
  42. package/dist/components/form/FormActions.js +3 -1
  43. package/dist/components/form/FormActions.js.map +1 -1
  44. package/dist/components/form/FormError.d.ts +1 -1
  45. package/dist/components/form/FormError.d.ts.map +1 -1
  46. package/dist/components/form/FormError.js +6 -3
  47. package/dist/components/form/FormError.js.map +1 -1
  48. package/dist/components/form/FormField.d.ts +1 -1
  49. package/dist/components/form/FormField.d.ts.map +1 -1
  50. package/dist/components/form/FormField.js +5 -3
  51. package/dist/components/form/FormField.js.map +1 -1
  52. package/dist/components/form/types.d.ts +6 -9
  53. package/dist/components/form/types.d.ts.map +1 -1
  54. package/dist/components/form/types.js.map +1 -1
  55. package/dist/components/heading/Heading.d.ts +1 -1
  56. package/dist/components/heading/Heading.d.ts.map +1 -1
  57. package/dist/components/icon/Icon.d.ts +2 -2
  58. package/dist/components/icon/Icon.d.ts.map +1 -1
  59. package/dist/components/icon/Icon.js.map +1 -1
  60. package/dist/components/icon-button/IconButton.d.ts +1 -1
  61. package/dist/components/icon-button/IconButton.d.ts.map +1 -1
  62. package/dist/components/input/Input.d.ts +1 -1
  63. package/dist/components/input/Input.d.ts.map +1 -1
  64. package/dist/components/input/Input.js +5 -2
  65. package/dist/components/input/Input.js.map +1 -1
  66. package/dist/components/input/types.d.ts +2 -1
  67. package/dist/components/input/types.d.ts.map +1 -1
  68. package/dist/components/input/types.js.map +1 -1
  69. package/dist/components/modal/Modal.d.ts +1 -1
  70. package/dist/components/modal/Modal.d.ts.map +1 -1
  71. package/dist/components/modal/Modal.js +3 -1
  72. package/dist/components/modal/Modal.js.map +1 -1
  73. package/dist/components/modal/types.d.ts +2 -1
  74. package/dist/components/modal/types.d.ts.map +1 -1
  75. package/dist/components/modal/types.js.map +1 -1
  76. package/dist/components/radio/Radio.d.ts +4 -0
  77. package/dist/components/radio/Radio.d.ts.map +1 -0
  78. package/dist/components/radio/Radio.js +8 -0
  79. package/dist/components/radio/Radio.js.map +1 -0
  80. package/dist/components/radio/RadioGroup.d.ts +1 -1
  81. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  82. package/dist/components/radio/RadioGroup.js +3 -1
  83. package/dist/components/radio/RadioGroup.js.map +1 -1
  84. package/dist/components/radio/index.d.ts +2 -3
  85. package/dist/components/radio/index.d.ts.map +1 -1
  86. package/dist/components/radio/index.js +1 -1
  87. package/dist/components/radio/index.js.map +1 -1
  88. package/dist/components/radio/types.d.ts +5 -2
  89. package/dist/components/radio/types.d.ts.map +1 -1
  90. package/dist/components/radio/types.js.map +1 -1
  91. package/dist/components/select/Select.d.ts +1 -1
  92. package/dist/components/select/Select.d.ts.map +1 -1
  93. package/dist/components/select/Select.js +6 -3
  94. package/dist/components/select/Select.js.map +1 -1
  95. package/dist/components/select/types.d.ts +2 -2
  96. package/dist/components/select/types.d.ts.map +1 -1
  97. package/dist/components/select/types.js.map +1 -1
  98. package/dist/components/tabs/Tabs.d.ts +1 -1
  99. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  100. package/dist/components/tabs/Tabs.js +6 -3
  101. package/dist/components/tabs/Tabs.js.map +1 -1
  102. package/dist/components/tabs/types.d.ts +2 -2
  103. package/dist/components/tabs/types.d.ts.map +1 -1
  104. package/dist/components/tabs/types.js.map +1 -1
  105. package/dist/components/text/Text.d.ts +1 -1
  106. package/dist/components/text/Text.d.ts.map +1 -1
  107. package/dist/components/textarea/Textarea.d.ts +1 -1
  108. package/dist/components/textarea/Textarea.d.ts.map +1 -1
  109. package/dist/components/textarea/Textarea.js +5 -2
  110. package/dist/components/textarea/Textarea.js.map +1 -1
  111. package/dist/components/textarea/types.d.ts +2 -1
  112. package/dist/components/textarea/types.d.ts.map +1 -1
  113. package/dist/components/textarea/types.js.map +1 -1
  114. package/dist/components/toolbar/Toolbar.d.ts +1 -1
  115. package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
  116. package/dist/components/toolbar/Toolbar.js +3 -1
  117. package/dist/components/toolbar/Toolbar.js.map +1 -1
  118. package/dist/components/toolbar/ToolbarAction.d.ts +1 -1
  119. package/dist/components/toolbar/ToolbarAction.d.ts.map +1 -1
  120. package/dist/components/toolbar/ToolbarAction.js +3 -1
  121. package/dist/components/toolbar/ToolbarAction.js.map +1 -1
  122. package/dist/components/toolbar/types.d.ts +3 -4
  123. package/dist/components/toolbar/types.d.ts.map +1 -1
  124. package/dist/components/toolbar/types.js.map +1 -1
  125. package/dist/foundation/Box.d.ts +7 -0
  126. package/dist/foundation/Box.d.ts.map +1 -0
  127. package/dist/foundation/Box.js +8 -0
  128. package/dist/foundation/Box.js.map +1 -0
  129. package/dist/foundation/Center.d.ts +7 -0
  130. package/dist/foundation/Center.d.ts.map +1 -0
  131. package/dist/foundation/Center.js +8 -0
  132. package/dist/foundation/Center.js.map +1 -0
  133. package/dist/foundation/Container.d.ts +7 -0
  134. package/dist/foundation/Container.d.ts.map +1 -0
  135. package/dist/foundation/Container.js +8 -0
  136. package/dist/foundation/Container.js.map +1 -0
  137. package/dist/foundation/Divider.d.ts +7 -0
  138. package/dist/foundation/Divider.d.ts.map +1 -0
  139. package/dist/foundation/Divider.js +8 -0
  140. package/dist/foundation/Divider.js.map +1 -0
  141. package/dist/foundation/Grid.d.ts +7 -0
  142. package/dist/foundation/Grid.d.ts.map +1 -0
  143. package/dist/foundation/Grid.js +8 -0
  144. package/dist/foundation/Grid.js.map +1 -0
  145. package/dist/foundation/Inline.d.ts +7 -0
  146. package/dist/foundation/Inline.d.ts.map +1 -0
  147. package/dist/foundation/Inline.js +8 -0
  148. package/dist/foundation/Inline.js.map +1 -0
  149. package/dist/foundation/Show.d.ts +7 -0
  150. package/dist/foundation/Show.d.ts.map +1 -0
  151. package/dist/foundation/Show.js +8 -0
  152. package/dist/foundation/Show.js.map +1 -0
  153. package/dist/foundation/Spacer.d.ts +7 -0
  154. package/dist/foundation/Spacer.d.ts.map +1 -0
  155. package/dist/foundation/Spacer.js +8 -0
  156. package/dist/foundation/Spacer.js.map +1 -0
  157. package/dist/foundation/Stack.d.ts +7 -0
  158. package/dist/foundation/Stack.d.ts.map +1 -0
  159. package/dist/foundation/Stack.js +8 -0
  160. package/dist/foundation/Stack.js.map +1 -0
  161. package/dist/foundation/Surface.d.ts +8 -0
  162. package/dist/foundation/Surface.d.ts.map +1 -0
  163. package/dist/foundation/Surface.js +8 -0
  164. package/dist/foundation/Surface.js.map +1 -0
  165. package/dist/foundation/index.d.ts +20 -2
  166. package/dist/foundation/index.d.ts.map +1 -1
  167. package/dist/foundation/index.js +10 -1
  168. package/dist/foundation/index.js.map +1 -1
  169. package/dist/internal/color/index.d.ts +3 -0
  170. package/dist/internal/color/index.d.ts.map +1 -0
  171. package/dist/internal/color/index.js +3 -0
  172. package/dist/internal/color/index.js.map +1 -0
  173. package/dist/internal/color/oklch.d.ts +6 -0
  174. package/dist/internal/color/oklch.d.ts.map +1 -0
  175. package/dist/internal/color/oklch.js +53 -0
  176. package/dist/internal/color/oklch.js.map +1 -0
  177. package/dist/internal/color/primary.d.ts +3 -0
  178. package/dist/internal/color/primary.d.ts.map +1 -0
  179. package/dist/internal/color/primary.js +44 -0
  180. package/dist/internal/color/primary.js.map +1 -0
  181. package/dist/internal/color/types.d.ts +6 -0
  182. package/dist/internal/color/types.d.ts.map +1 -0
  183. package/dist/internal/color/types.js +2 -0
  184. package/dist/internal/color/types.js.map +1 -0
  185. package/dist/layout/app-shell/AppShell.d.ts +1 -1
  186. package/dist/layout/app-shell/AppShell.d.ts.map +1 -1
  187. package/dist/layout/app-shell/AppShell.js +3 -1
  188. package/dist/layout/app-shell/AppShell.js.map +1 -1
  189. package/dist/layout/app-shell/types.d.ts +2 -2
  190. package/dist/layout/app-shell/types.d.ts.map +1 -1
  191. package/dist/layout/app-shell/types.js.map +1 -1
  192. package/dist/layout/auth-layout/AuthLayout.d.ts +1 -1
  193. package/dist/layout/auth-layout/AuthLayout.d.ts.map +1 -1
  194. package/dist/layout/auth-layout/AuthLayout.js +3 -1
  195. package/dist/layout/auth-layout/AuthLayout.js.map +1 -1
  196. package/dist/layout/auth-layout/types.d.ts +2 -2
  197. package/dist/layout/auth-layout/types.d.ts.map +1 -1
  198. package/dist/layout/auth-layout/types.js.map +1 -1
  199. package/dist/layout/page/Page.d.ts +1 -1
  200. package/dist/layout/page/Page.d.ts.map +1 -1
  201. package/dist/layout/page/Page.js +3 -1
  202. package/dist/layout/page/Page.js.map +1 -1
  203. package/dist/layout/page/types.d.ts +2 -2
  204. package/dist/layout/page/types.d.ts.map +1 -1
  205. package/dist/layout/page/types.js.map +1 -1
  206. package/dist/layout/page-header/PageHeader.d.ts +1 -1
  207. package/dist/layout/page-header/PageHeader.d.ts.map +1 -1
  208. package/dist/layout/page-header/PageHeader.js +3 -1
  209. package/dist/layout/page-header/PageHeader.js.map +1 -1
  210. package/dist/layout/page-header/types.d.ts +2 -2
  211. package/dist/layout/page-header/types.d.ts.map +1 -1
  212. package/dist/layout/page-header/types.js.map +1 -1
  213. package/dist/layout/page-section/PageSection.d.ts +1 -1
  214. package/dist/layout/page-section/PageSection.d.ts.map +1 -1
  215. package/dist/layout/page-section/PageSection.js +3 -1
  216. package/dist/layout/page-section/PageSection.js.map +1 -1
  217. package/dist/layout/page-section/types.d.ts +2 -2
  218. package/dist/layout/page-section/types.d.ts.map +1 -1
  219. package/dist/layout/page-section/types.js.map +1 -1
  220. package/dist/layout/settings-layout/SettingsLayout.d.ts +1 -1
  221. package/dist/layout/settings-layout/SettingsLayout.d.ts.map +1 -1
  222. package/dist/layout/settings-layout/SettingsLayout.js +3 -1
  223. package/dist/layout/settings-layout/SettingsLayout.js.map +1 -1
  224. package/dist/layout/settings-layout/types.d.ts +2 -2
  225. package/dist/layout/settings-layout/types.d.ts.map +1 -1
  226. package/dist/layout/settings-layout/types.js.map +1 -1
  227. package/dist/layout/sidebar-layout/SidebarLayout.d.ts +1 -1
  228. package/dist/layout/sidebar-layout/SidebarLayout.d.ts.map +1 -1
  229. package/dist/layout/sidebar-layout/SidebarLayout.js +3 -1
  230. package/dist/layout/sidebar-layout/SidebarLayout.js.map +1 -1
  231. package/dist/layout/sidebar-layout/types.d.ts +2 -2
  232. package/dist/layout/sidebar-layout/types.d.ts.map +1 -1
  233. package/dist/layout/sidebar-layout/types.js.map +1 -1
  234. package/dist/layout/topbar-layout/TopbarLayout.d.ts +1 -1
  235. package/dist/layout/topbar-layout/TopbarLayout.d.ts.map +1 -1
  236. package/dist/layout/topbar-layout/TopbarLayout.js +3 -1
  237. package/dist/layout/topbar-layout/TopbarLayout.js.map +1 -1
  238. package/dist/layout/topbar-layout/types.d.ts +2 -2
  239. package/dist/layout/topbar-layout/types.d.ts.map +1 -1
  240. package/dist/layout/topbar-layout/types.js.map +1 -1
  241. package/dist/patterns/auth/ForgotPasswordForm.d.ts +1 -1
  242. package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
  243. package/dist/patterns/auth/ForgotPasswordForm.js +3 -1
  244. package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
  245. package/dist/patterns/auth/OtpForm.d.ts +1 -1
  246. package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
  247. package/dist/patterns/auth/OtpForm.js +3 -1
  248. package/dist/patterns/auth/OtpForm.js.map +1 -1
  249. package/dist/patterns/auth/SignInForm.d.ts +1 -1
  250. package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
  251. package/dist/patterns/auth/SignInForm.js +3 -1
  252. package/dist/patterns/auth/SignInForm.js.map +1 -1
  253. package/dist/patterns/auth/SignUpForm.d.ts +1 -1
  254. package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
  255. package/dist/patterns/auth/SignUpForm.js +3 -1
  256. package/dist/patterns/auth/SignUpForm.js.map +1 -1
  257. package/dist/patterns/auth/types.d.ts +2 -2
  258. package/dist/patterns/auth/types.d.ts.map +1 -1
  259. package/dist/patterns/auth/types.js.map +1 -1
  260. package/dist/patterns/collection-editor/CollectionEditor.d.ts +1 -1
  261. package/dist/patterns/collection-editor/CollectionEditor.d.ts.map +1 -1
  262. package/dist/patterns/collection-editor/CollectionEditor.js +3 -1
  263. package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
  264. package/dist/patterns/collection-editor/types.d.ts +2 -2
  265. package/dist/patterns/collection-editor/types.d.ts.map +1 -1
  266. package/dist/patterns/collection-editor/types.js.map +1 -1
  267. package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts +1 -1
  268. package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts.map +1 -1
  269. package/dist/patterns/confirm-dialog/ConfirmDialog.js +3 -1
  270. package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
  271. package/dist/patterns/confirm-dialog/types.d.ts +2 -2
  272. package/dist/patterns/confirm-dialog/types.d.ts.map +1 -1
  273. package/dist/patterns/confirm-dialog/types.js.map +1 -1
  274. package/dist/patterns/disclosure-section/DisclosureSection.d.ts +1 -1
  275. package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +1 -1
  276. package/dist/patterns/disclosure-section/DisclosureSection.js +3 -1
  277. package/dist/patterns/disclosure-section/DisclosureSection.js.map +1 -1
  278. package/dist/patterns/disclosure-section/types.d.ts +2 -2
  279. package/dist/patterns/disclosure-section/types.d.ts.map +1 -1
  280. package/dist/patterns/disclosure-section/types.js.map +1 -1
  281. package/dist/patterns/empty-state/EmptyState.d.ts +1 -1
  282. package/dist/patterns/empty-state/EmptyState.d.ts.map +1 -1
  283. package/dist/patterns/empty-state/EmptyState.js +3 -1
  284. package/dist/patterns/empty-state/EmptyState.js.map +1 -1
  285. package/dist/patterns/empty-state/types.d.ts +2 -2
  286. package/dist/patterns/empty-state/types.d.ts.map +1 -1
  287. package/dist/patterns/empty-state/types.js.map +1 -1
  288. package/dist/patterns/form-field/FormField.d.ts +1 -1
  289. package/dist/patterns/form-field/FormField.d.ts.map +1 -1
  290. package/dist/patterns/form-field/FormField.js +3 -1
  291. package/dist/patterns/form-field/FormField.js.map +1 -1
  292. package/dist/patterns/form-field/types.d.ts +2 -1
  293. package/dist/patterns/form-field/types.d.ts.map +1 -1
  294. package/dist/patterns/form-field/types.js.map +1 -1
  295. package/dist/patterns/inspector-field/InspectorField.d.ts +1 -1
  296. package/dist/patterns/inspector-field/InspectorField.d.ts.map +1 -1
  297. package/dist/patterns/inspector-field/InspectorField.js +3 -1
  298. package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
  299. package/dist/patterns/inspector-field/types.d.ts +2 -2
  300. package/dist/patterns/inspector-field/types.d.ts.map +1 -1
  301. package/dist/patterns/inspector-field/types.js.map +1 -1
  302. package/dist/patterns/notice/Notice.d.ts +1 -1
  303. package/dist/patterns/notice/Notice.d.ts.map +1 -1
  304. package/dist/patterns/notice/Notice.js +3 -1
  305. package/dist/patterns/notice/Notice.js.map +1 -1
  306. package/dist/patterns/notice/types.d.ts +2 -2
  307. package/dist/patterns/notice/types.d.ts.map +1 -1
  308. package/dist/patterns/notice/types.js.map +1 -1
  309. package/dist/patterns/panel/Panel.d.ts +1 -1
  310. package/dist/patterns/panel/Panel.d.ts.map +1 -1
  311. package/dist/patterns/responsive-panel/ResponsivePanel.d.ts +1 -1
  312. package/dist/patterns/responsive-panel/ResponsivePanel.d.ts.map +1 -1
  313. package/dist/patterns/responsive-panel/ResponsivePanel.js +3 -1
  314. package/dist/patterns/responsive-panel/ResponsivePanel.js.map +1 -1
  315. package/dist/patterns/responsive-panel/types.d.ts +2 -2
  316. package/dist/patterns/responsive-panel/types.d.ts.map +1 -1
  317. package/dist/patterns/responsive-panel/types.js.map +1 -1
  318. package/dist/patterns/section-header/SectionHeader.d.ts +1 -1
  319. package/dist/patterns/section-header/SectionHeader.d.ts.map +1 -1
  320. package/dist/patterns/section-header/SectionHeader.js +3 -1
  321. package/dist/patterns/section-header/SectionHeader.js.map +1 -1
  322. package/dist/patterns/section-header/types.d.ts +2 -2
  323. package/dist/patterns/section-header/types.d.ts.map +1 -1
  324. package/dist/patterns/section-header/types.js.map +1 -1
  325. package/dist/patterns/settings-row/SettingsRow.d.ts +1 -1
  326. package/dist/patterns/settings-row/SettingsRow.d.ts.map +1 -1
  327. package/dist/patterns/settings-row/SettingsRow.js +3 -1
  328. package/dist/patterns/settings-row/SettingsRow.js.map +1 -1
  329. package/dist/patterns/settings-row/types.d.ts +2 -2
  330. package/dist/patterns/settings-row/types.d.ts.map +1 -1
  331. package/dist/patterns/settings-row/types.js.map +1 -1
  332. package/dist/patterns/switch-field/SwitchField.d.ts +1 -1
  333. package/dist/patterns/switch-field/SwitchField.d.ts.map +1 -1
  334. package/dist/patterns/switch-field/SwitchField.js +3 -1
  335. package/dist/patterns/switch-field/SwitchField.js.map +1 -1
  336. package/dist/patterns/switch-field/types.d.ts +2 -2
  337. package/dist/patterns/switch-field/types.d.ts.map +1 -1
  338. package/dist/patterns/switch-field/types.js.map +1 -1
  339. package/dist/patterns/tile-grid/PaletteItem.d.ts +1 -1
  340. package/dist/patterns/tile-grid/PaletteItem.d.ts.map +1 -1
  341. package/dist/patterns/tile-grid/PaletteItem.js +6 -3
  342. package/dist/patterns/tile-grid/PaletteItem.js.map +1 -1
  343. package/dist/patterns/tile-grid/TileGrid.d.ts +1 -1
  344. package/dist/patterns/tile-grid/TileGrid.d.ts.map +1 -1
  345. package/dist/patterns/tile-grid/TileGrid.js +3 -1
  346. package/dist/patterns/tile-grid/TileGrid.js.map +1 -1
  347. package/dist/patterns/tile-grid/types.d.ts +3 -4
  348. package/dist/patterns/tile-grid/types.d.ts.map +1 -1
  349. package/dist/patterns/tile-grid/types.js.map +1 -1
  350. package/dist/patterns/tree-view/TreeItem.d.ts +3 -2
  351. package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
  352. package/dist/patterns/tree-view/TreeItem.js +4 -2
  353. package/dist/patterns/tree-view/TreeItem.js.map +1 -1
  354. package/dist/patterns/tree-view/TreeView.d.ts +1 -1
  355. package/dist/patterns/tree-view/TreeView.d.ts.map +1 -1
  356. package/dist/patterns/tree-view/TreeView.js +3 -1
  357. package/dist/patterns/tree-view/TreeView.js.map +1 -1
  358. package/dist/patterns/tree-view/types.d.ts +2 -2
  359. package/dist/patterns/tree-view/types.d.ts.map +1 -1
  360. package/dist/patterns/tree-view/types.js.map +1 -1
  361. package/dist/theme/createZoraThemeConfig.d.ts.map +1 -1
  362. package/dist/theme/createZoraThemeConfig.js +1 -5
  363. package/dist/theme/createZoraThemeConfig.js.map +1 -1
  364. package/dist/theme/withZoraThemeScope.d.ts +1 -1
  365. package/dist/theme/withZoraThemeScope.d.ts.map +1 -1
  366. package/dist/theme/withZoraThemeScope.js +2 -2
  367. package/dist/theme/withZoraThemeScope.js.map +1 -1
  368. package/package.json +4 -2
  369. package/src/components/badge/Badge.tsx +12 -1
  370. package/src/components/badge/types.ts +5 -4
  371. package/src/components/checkbox/Checkbox.tsx +11 -0
  372. package/src/components/checkbox/CheckboxGroup.tsx +6 -1
  373. package/src/components/checkbox/index.ts +2 -3
  374. package/src/components/checkbox/types.ts +13 -5
  375. package/src/components/drawer/Drawer.tsx +13 -1
  376. package/src/components/drawer/types.ts +9 -4
  377. package/src/components/form/Form.tsx +6 -1
  378. package/src/components/form/FormActions.tsx +6 -1
  379. package/src/components/form/FormError.tsx +7 -3
  380. package/src/components/form/FormField.tsx +24 -3
  381. package/src/components/form/types.ts +12 -12
  382. package/src/components/icon/Icon.tsx +1 -1
  383. package/src/components/input/Input.tsx +13 -2
  384. package/src/components/input/types.ts +8 -4
  385. package/src/components/modal/Modal.tsx +6 -1
  386. package/src/components/modal/types.ts +5 -4
  387. package/src/components/radio/Radio.tsx +11 -0
  388. package/src/components/radio/RadioGroup.tsx +6 -1
  389. package/src/components/radio/index.ts +2 -3
  390. package/src/components/radio/types.ts +12 -5
  391. package/src/components/select/Select.tsx +9 -3
  392. package/src/components/select/types.ts +3 -2
  393. package/src/components/tabs/Tabs.tsx +9 -3
  394. package/src/components/tabs/types.ts +2 -2
  395. package/src/components/textarea/Textarea.tsx +13 -2
  396. package/src/components/textarea/types.ts +8 -4
  397. package/src/components/toolbar/Toolbar.tsx +6 -1
  398. package/src/components/toolbar/ToolbarAction.tsx +9 -1
  399. package/src/components/toolbar/types.ts +4 -4
  400. package/src/foundation/Box.tsx +13 -0
  401. package/src/foundation/Center.tsx +16 -0
  402. package/src/foundation/Container.tsx +17 -0
  403. package/src/foundation/Divider.tsx +17 -0
  404. package/src/foundation/Grid.tsx +13 -0
  405. package/src/foundation/Inline.tsx +16 -0
  406. package/src/foundation/Show.tsx +13 -0
  407. package/src/foundation/Spacer.tsx +16 -0
  408. package/src/foundation/Stack.tsx +13 -0
  409. package/src/foundation/Surface.tsx +20 -0
  410. package/src/foundation/index.test.ts +2 -2
  411. package/src/foundation/index.ts +20 -25
  412. package/src/internal/color/index.ts +2 -0
  413. package/src/internal/color/oklch.ts +69 -0
  414. package/src/internal/color/primary.test.ts +105 -0
  415. package/src/internal/color/primary.ts +64 -0
  416. package/src/internal/color/types.ts +5 -0
  417. package/src/layout/app-shell/AppShell.tsx +6 -1
  418. package/src/layout/app-shell/types.ts +3 -2
  419. package/src/layout/auth-layout/AuthLayout.tsx +6 -1
  420. package/src/layout/auth-layout/types.ts +3 -2
  421. package/src/layout/page/Page.tsx +12 -1
  422. package/src/layout/page/types.ts +2 -2
  423. package/src/layout/page-header/PageHeader.tsx +6 -1
  424. package/src/layout/page-header/types.ts +3 -2
  425. package/src/layout/page-section/PageSection.tsx +12 -1
  426. package/src/layout/page-section/types.ts +3 -2
  427. package/src/layout/settings-layout/SettingsLayout.tsx +6 -1
  428. package/src/layout/settings-layout/types.ts +3 -2
  429. package/src/layout/sidebar-layout/SidebarLayout.tsx +6 -1
  430. package/src/layout/sidebar-layout/types.ts +3 -2
  431. package/src/layout/topbar-layout/TopbarLayout.tsx +11 -1
  432. package/src/layout/topbar-layout/types.ts +3 -2
  433. package/src/patterns/auth/ForgotPasswordForm.tsx +6 -1
  434. package/src/patterns/auth/OtpForm.tsx +6 -1
  435. package/src/patterns/auth/SignInForm.tsx +6 -1
  436. package/src/patterns/auth/SignUpForm.tsx +6 -1
  437. package/src/patterns/auth/types.ts +2 -2
  438. package/src/patterns/collection-editor/CollectionEditor.tsx +6 -1
  439. package/src/patterns/collection-editor/types.ts +3 -2
  440. package/src/patterns/confirm-dialog/ConfirmDialog.tsx +6 -1
  441. package/src/patterns/confirm-dialog/types.ts +2 -2
  442. package/src/patterns/disclosure-section/DisclosureSection.tsx +6 -1
  443. package/src/patterns/disclosure-section/types.ts +3 -2
  444. package/src/patterns/empty-state/EmptyState.tsx +6 -1
  445. package/src/patterns/empty-state/types.ts +2 -2
  446. package/src/patterns/form-field/FormField.tsx +12 -1
  447. package/src/patterns/form-field/types.ts +9 -4
  448. package/src/patterns/inspector-field/InspectorField.tsx +11 -1
  449. package/src/patterns/inspector-field/types.ts +3 -2
  450. package/src/patterns/notice/Notice.tsx +6 -1
  451. package/src/patterns/notice/types.ts +2 -2
  452. package/src/patterns/responsive-panel/ResponsivePanel.tsx +6 -1
  453. package/src/patterns/responsive-panel/types.ts +3 -2
  454. package/src/patterns/section-header/SectionHeader.tsx +6 -1
  455. package/src/patterns/section-header/types.ts +3 -2
  456. package/src/patterns/settings-row/SettingsRow.tsx +6 -1
  457. package/src/patterns/settings-row/types.ts +3 -2
  458. package/src/patterns/switch-field/SwitchField.tsx +6 -1
  459. package/src/patterns/switch-field/types.ts +3 -2
  460. package/src/patterns/tile-grid/PaletteItem.tsx +9 -3
  461. package/src/patterns/tile-grid/TileGrid.tsx +6 -1
  462. package/src/patterns/tile-grid/types.ts +4 -4
  463. package/src/patterns/tree-view/TreeItem.tsx +10 -3
  464. package/src/patterns/tree-view/TreeView.tsx +6 -1
  465. package/src/patterns/tree-view/types.ts +3 -2
  466. package/src/theme/createZoraThemeConfig.test.ts +18 -4
  467. package/src/theme/createZoraThemeConfig.ts +2 -7
  468. package/src/theme/themeScopeStructure.test.ts +186 -65
  469. package/src/theme/withZoraThemeScope.tsx +8 -7
@@ -1,10 +1,14 @@
1
- import { Box, useTheme } from '@ankhorage/surface';
1
+ import { Box } from '@ankhorage/surface';
2
2
  import { Picker } from '@react-native-picker/picker';
3
3
  import React from 'react';
4
4
 
5
+ import { useZoraTheme } from '../../theme/useZoraTheme';
6
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
7
  import type { SelectProps } from './types';
6
8
 
7
- export function Select<TValue extends string = string>({
9
+ function SelectInner<TValue extends string = string>({
10
+ themeId: _themeId,
11
+ mode: _mode,
8
12
  value,
9
13
  options,
10
14
  onValueChange,
@@ -12,7 +16,7 @@ export function Select<TValue extends string = string>({
12
16
  invalid,
13
17
  testID,
14
18
  }: SelectProps<TValue>) {
15
- const { theme } = useTheme();
19
+ const { theme } = useZoraTheme();
16
20
 
17
21
  return (
18
22
  <Box
@@ -47,3 +51,5 @@ export function Select<TValue extends string = string>({
47
51
  </Box>
48
52
  );
49
53
  }
54
+
55
+ export const Select = withZoraThemeScope(SelectInner);
@@ -1,14 +1,15 @@
1
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
2
+
1
3
  export interface SelectOption<TValue extends string = string> {
2
4
  value: TValue;
3
5
  label: string;
4
6
  disabled?: boolean;
5
7
  }
6
8
 
7
- export interface SelectProps<TValue extends string = string> {
9
+ export interface SelectProps<TValue extends string = string> extends ZoraBaseProps {
8
10
  value: TValue;
9
11
  options: readonly SelectOption<TValue>[];
10
12
  onValueChange: (value: TValue) => void;
11
13
  disabled?: boolean;
12
14
  invalid?: boolean;
13
- testID?: string;
14
15
  }
@@ -1,11 +1,15 @@
1
- import { Box, Stack, useTheme } from '@ankhorage/surface';
1
+ import { Box, Stack } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
 
4
+ import { useZoraTheme } from '../../theme/useZoraTheme';
5
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
4
6
  import { Button } from '../button';
5
7
  import { Text } from '../text';
6
8
  import type { TabItem, TabsProps } from './types';
7
9
 
8
- export function Tabs<TValue extends string = string>({
10
+ function TabsInner<TValue extends string = string>({
11
+ themeId: _themeId,
12
+ mode: _mode,
9
13
  value,
10
14
  items,
11
15
  onValueChange,
@@ -14,7 +18,7 @@ export function Tabs<TValue extends string = string>({
14
18
  disabled: tabsDisabled,
15
19
  testID,
16
20
  }: TabsProps<TValue>) {
17
- const { theme } = useTheme();
21
+ const { theme } = useZoraTheme();
18
22
 
19
23
  const renderTab = (item: TabItem<TValue>) => {
20
24
  const isActive = item.value === value;
@@ -98,3 +102,5 @@ export function Tabs<TValue extends string = string>({
98
102
  </Stack>
99
103
  );
100
104
  }
105
+
106
+ export const Tabs = withZoraThemeScope(TabsInner);
@@ -2,6 +2,7 @@ import type { ButtonIconSpec } from '@ankhorage/surface';
2
2
  import type { ReactNode } from 'react';
3
3
 
4
4
  import type { ZoraControlSize } from '../../internal/recipes';
5
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
5
6
 
6
7
  export interface TabItem<TValue extends string = string> {
7
8
  value: TValue;
@@ -14,12 +15,11 @@ export interface TabItem<TValue extends string = string> {
14
15
 
15
16
  export type TabsVariant = 'underline' | 'pill' | 'segmented';
16
17
 
17
- export interface TabsProps<TValue extends string = string> {
18
+ export interface TabsProps<TValue extends string = string> extends ZoraBaseProps {
18
19
  value: TValue;
19
20
  items: readonly TabItem<TValue>[];
20
21
  onValueChange: (value: TValue) => void;
21
22
  variant?: TabsVariant;
22
23
  size?: ZoraControlSize;
23
24
  disabled?: boolean;
24
- testID?: string;
25
25
  }
@@ -2,10 +2,19 @@ import * as Surface from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
 
4
4
  import { resolveIconSize } from '../../internal/recipes';
5
+ import { useZoraTheme } from '../../theme/useZoraTheme';
6
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
7
  import type { TextareaProps } from './types';
6
8
 
7
- export function Textarea({ size = 'l', leadingIcon, trailingIcon, ...props }: TextareaProps) {
8
- const { theme } = Surface.useTheme();
9
+ function TextareaInner({
10
+ themeId: _themeId,
11
+ mode: _mode,
12
+ size = 'l',
13
+ leadingIcon,
14
+ trailingIcon,
15
+ ...props
16
+ }: TextareaProps) {
17
+ const { theme } = useZoraTheme();
9
18
  const iconSize = resolveIconSize(size);
10
19
  const iconColor = theme.semantics.content.muted;
11
20
 
@@ -36,3 +45,5 @@ export function Textarea({ size = 'l', leadingIcon, trailingIcon, ...props }: Te
36
45
  />
37
46
  );
38
47
  }
48
+
49
+ export const Textarea = withZoraThemeScope(TextareaInner);
@@ -1,11 +1,15 @@
1
1
  import type * as Surface from '@ankhorage/surface';
2
2
 
3
3
  import type { ZoraControlSize } from '../../internal/recipes';
4
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
4
5
 
5
- export interface TextareaProps extends Omit<
6
- Surface.TextareaProps,
7
- 'leadingAccessory' | 'size' | 'trailingAccessory'
8
- > {
6
+ export interface TextareaProps
7
+ extends
8
+ ZoraBaseProps,
9
+ Omit<
10
+ Surface.TextareaProps,
11
+ 'leadingAccessory' | 'size' | 'trailingAccessory' | 'mode' | 'themeId'
12
+ > {
9
13
  size?: ZoraControlSize;
10
14
  leadingIcon?: Surface.ButtonIconSpec;
11
15
  trailingIcon?: Surface.ButtonIconSpec;
@@ -1,10 +1,13 @@
1
1
  import { Stack } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
 
4
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
4
5
  import { Card } from '../card';
5
6
  import type { ToolbarProps } from './types';
6
7
 
7
- export function Toolbar({
8
+ function ToolbarInner({
9
+ themeId: _themeId,
10
+ mode: _mode,
8
11
  children,
9
12
  position = 'inline',
10
13
  floating = false,
@@ -35,3 +38,5 @@ export function Toolbar({
35
38
  </Card>
36
39
  );
37
40
  }
41
+
42
+ export const Toolbar = withZoraThemeScope(ToolbarInner);
@@ -1,9 +1,15 @@
1
1
  import React from 'react';
2
2
 
3
+ import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
3
4
  import { IconButton } from '../icon-button';
4
5
  import type { ToolbarActionProps } from './types';
5
6
 
6
- export function ToolbarAction({ active, ...props }: ToolbarActionProps) {
7
+ function ToolbarActionInner({
8
+ themeId: _themeId,
9
+ mode: _mode,
10
+ active,
11
+ ...props
12
+ }: ToolbarActionProps) {
7
13
  return (
8
14
  <IconButton
9
15
  {...props}
@@ -13,3 +19,5 @@ export function ToolbarAction({ active, ...props }: ToolbarActionProps) {
13
19
  />
14
20
  );
15
21
  }
22
+
23
+ export const ToolbarAction = withZoraThemeScope(ToolbarActionInner);
@@ -3,19 +3,19 @@ import type React from 'react';
3
3
 
4
4
  export type ToolbarPosition = 'top' | 'bottom' | 'inline';
5
5
 
6
- export interface ToolbarProps {
6
+ import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
7
+
8
+ export interface ToolbarProps extends ZoraBaseProps {
7
9
  children?: React.ReactNode;
8
10
  position?: ToolbarPosition;
9
11
  floating?: boolean;
10
12
  compact?: boolean;
11
- testID?: string;
12
13
  }
13
14
 
14
- export interface ToolbarActionProps {
15
+ export interface ToolbarActionProps extends ZoraBaseProps {
15
16
  label: string;
16
17
  icon: ButtonIconSpec;
17
18
  active?: boolean;
18
19
  disabled?: boolean;
19
20
  onPress?: () => void;
20
- testID?: string;
21
21
  }
@@ -0,0 +1,13 @@
1
+ import { Box as SurfaceBox, type BoxProps as SurfaceBoxProps } from '@ankhorage/surface';
2
+ import React from 'react';
3
+
4
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
5
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
6
+
7
+ export interface BoxProps extends ZoraBaseProps, Omit<SurfaceBoxProps, 'mode' | 'themeId'> {}
8
+
9
+ function BoxInner({ themeId: _themeId, mode: _mode, ...props }: BoxProps) {
10
+ return <SurfaceBox {...props} />;
11
+ }
12
+
13
+ export const Box = withZoraThemeScope(BoxInner);
@@ -0,0 +1,16 @@
1
+ import {
2
+ Center as SurfaceCenter,
3
+ type CenterProps as SurfaceCenterProps,
4
+ } from '@ankhorage/surface';
5
+ import React from 'react';
6
+
7
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
8
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
9
+
10
+ export interface CenterProps extends ZoraBaseProps, Omit<SurfaceCenterProps, 'mode' | 'themeId'> {}
11
+
12
+ function CenterInner({ themeId: _themeId, mode: _mode, ...props }: CenterProps) {
13
+ return <SurfaceCenter {...props} />;
14
+ }
15
+
16
+ export const Center = withZoraThemeScope(CenterInner);
@@ -0,0 +1,17 @@
1
+ import {
2
+ Container as SurfaceContainer,
3
+ type ContainerProps as SurfaceContainerProps,
4
+ } from '@ankhorage/surface';
5
+ import React from 'react';
6
+
7
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
8
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
9
+
10
+ export interface ContainerProps
11
+ extends ZoraBaseProps, Omit<SurfaceContainerProps, 'mode' | 'themeId'> {}
12
+
13
+ function ContainerInner({ themeId: _themeId, mode: _mode, ...props }: ContainerProps) {
14
+ return <SurfaceContainer {...props} />;
15
+ }
16
+
17
+ export const Container = withZoraThemeScope(ContainerInner);
@@ -0,0 +1,17 @@
1
+ import {
2
+ Divider as SurfaceDivider,
3
+ type DividerProps as SurfaceDividerProps,
4
+ } from '@ankhorage/surface';
5
+ import React from 'react';
6
+
7
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
8
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
9
+
10
+ export interface DividerProps
11
+ extends ZoraBaseProps, Omit<SurfaceDividerProps, 'mode' | 'themeId'> {}
12
+
13
+ function DividerInner({ themeId: _themeId, mode: _mode, ...props }: DividerProps) {
14
+ return <SurfaceDivider {...props} />;
15
+ }
16
+
17
+ export const Divider = withZoraThemeScope(DividerInner);
@@ -0,0 +1,13 @@
1
+ import { Grid as SurfaceGrid, type GridProps as SurfaceGridProps } from '@ankhorage/surface';
2
+ import React from 'react';
3
+
4
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
5
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
6
+
7
+ export interface GridProps extends ZoraBaseProps, Omit<SurfaceGridProps, 'mode' | 'themeId'> {}
8
+
9
+ function GridInner({ themeId: _themeId, mode: _mode, ...props }: GridProps) {
10
+ return <SurfaceGrid {...props} />;
11
+ }
12
+
13
+ export const Grid = withZoraThemeScope(GridInner);
@@ -0,0 +1,16 @@
1
+ import {
2
+ Inline as SurfaceInline,
3
+ type InlineProps as SurfaceInlineProps,
4
+ } from '@ankhorage/surface';
5
+ import React from 'react';
6
+
7
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
8
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
9
+
10
+ export interface InlineProps extends ZoraBaseProps, Omit<SurfaceInlineProps, 'mode' | 'themeId'> {}
11
+
12
+ function InlineInner({ themeId: _themeId, mode: _mode, ...props }: InlineProps) {
13
+ return <SurfaceInline {...props} />;
14
+ }
15
+
16
+ export const Inline = withZoraThemeScope(InlineInner);
@@ -0,0 +1,13 @@
1
+ import { Show as SurfaceShow, type ShowProps as SurfaceShowProps } from '@ankhorage/surface';
2
+ import React from 'react';
3
+
4
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
5
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
6
+
7
+ export interface ShowProps extends ZoraBaseProps, Omit<SurfaceShowProps, 'mode' | 'themeId'> {}
8
+
9
+ function ShowInner({ themeId: _themeId, mode: _mode, ...props }: ShowProps) {
10
+ return <SurfaceShow {...props} />;
11
+ }
12
+
13
+ export const Show = withZoraThemeScope(ShowInner);
@@ -0,0 +1,16 @@
1
+ import {
2
+ Spacer as SurfaceSpacer,
3
+ type SpacerProps as SurfaceSpacerProps,
4
+ } from '@ankhorage/surface';
5
+ import React from 'react';
6
+
7
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
8
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
9
+
10
+ export interface SpacerProps extends ZoraBaseProps, Omit<SurfaceSpacerProps, 'mode' | 'themeId'> {}
11
+
12
+ function SpacerInner({ themeId: _themeId, mode: _mode, ...props }: SpacerProps) {
13
+ return <SurfaceSpacer {...props} />;
14
+ }
15
+
16
+ export const Spacer = withZoraThemeScope(SpacerInner);
@@ -0,0 +1,13 @@
1
+ import { Stack as SurfaceStack, type StackProps as SurfaceStackProps } from '@ankhorage/surface';
2
+ import React from 'react';
3
+
4
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
5
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
6
+
7
+ export interface StackProps extends ZoraBaseProps, Omit<SurfaceStackProps, 'mode' | 'themeId'> {}
8
+
9
+ function StackInner({ themeId: _themeId, mode: _mode, ...props }: StackProps) {
10
+ return <SurfaceStack {...props} />;
11
+ }
12
+
13
+ export const Stack = withZoraThemeScope(StackInner);
@@ -0,0 +1,20 @@
1
+ import {
2
+ Surface as SurfaceSurface,
3
+ type SurfaceProps as SurfaceSurfaceProps,
4
+ type SurfaceVariant,
5
+ } from '@ankhorage/surface';
6
+ import React from 'react';
7
+
8
+ import { withZoraThemeScope } from '../theme/withZoraThemeScope';
9
+ import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
10
+
11
+ export type { SurfaceVariant };
12
+
13
+ export interface SurfaceProps
14
+ extends ZoraBaseProps, Omit<SurfaceSurfaceProps, 'mode' | 'themeId'> {}
15
+
16
+ function SurfaceInner({ themeId: _themeId, mode: _mode, ...props }: SurfaceProps) {
17
+ return <SurfaceSurface {...props} />;
18
+ }
19
+
20
+ export const Surface = withZoraThemeScope(SurfaceInner);
@@ -7,19 +7,19 @@ const foundationIndex = readFileSync(join(import.meta.dir, 'index.ts'), 'utf8');
7
7
  const rootIndex = readFileSync(join(import.meta.dir, '..', 'index.ts'), 'utf8');
8
8
 
9
9
  describe('foundation exports', () => {
10
- it('defines a narrow Surface foundation export layer', () => {
10
+ it('defines a narrow ZORA foundation export layer', () => {
11
11
  expect(foundationIndex).toMatch(/export type \{/);
12
12
  expect(foundationIndex).toMatch(/BoxProps/);
13
13
  expect(foundationIndex).toMatch(/ContainerProps/);
14
14
  expect(foundationIndex).toMatch(/GridProps/);
15
15
  expect(foundationIndex).toMatch(/StackProps/);
16
16
  expect(foundationIndex).toMatch(/SurfaceProps/);
17
- expect(foundationIndex).toMatch(/export \{/);
18
17
  expect(foundationIndex).toMatch(/Box/);
19
18
  expect(foundationIndex).toMatch(/Container/);
20
19
  expect(foundationIndex).toMatch(/Grid/);
21
20
  expect(foundationIndex).toMatch(/Stack/);
22
21
  expect(foundationIndex).toMatch(/Surface/);
22
+ expect(foundationIndex).not.toMatch(/@ankhorage\/surface/);
23
23
  expect(foundationIndex).not.toMatch(/Heading/);
24
24
  expect(foundationIndex).not.toMatch(/Text/);
25
25
  expect(foundationIndex).not.toMatch(/ThemeProvider/);
@@ -1,25 +1,20 @@
1
- export type {
2
- BoxProps,
3
- CenterProps,
4
- ContainerProps,
5
- DividerProps,
6
- GridProps,
7
- InlineProps,
8
- ShowProps,
9
- SpacerProps,
10
- StackProps,
11
- SurfaceProps,
12
- SurfaceVariant,
13
- } from '@ankhorage/surface';
14
- export {
15
- Box,
16
- Center,
17
- Container,
18
- Divider,
19
- Grid,
20
- Inline,
21
- Show,
22
- Spacer,
23
- Stack,
24
- Surface,
25
- } from '@ankhorage/surface';
1
+ export type { BoxProps } from './Box';
2
+ export { Box } from './Box';
3
+ export type { CenterProps } from './Center';
4
+ export { Center } from './Center';
5
+ export type { ContainerProps } from './Container';
6
+ export { Container } from './Container';
7
+ export type { DividerProps } from './Divider';
8
+ export { Divider } from './Divider';
9
+ export type { GridProps } from './Grid';
10
+ export { Grid } from './Grid';
11
+ export type { InlineProps } from './Inline';
12
+ export { Inline } from './Inline';
13
+ export type { ShowProps } from './Show';
14
+ export { Show } from './Show';
15
+ export type { SpacerProps } from './Spacer';
16
+ export { Spacer } from './Spacer';
17
+ export type { StackProps } from './Stack';
18
+ export { Stack } from './Stack';
19
+ export type { SurfaceProps, SurfaceVariant } from './Surface';
20
+ export { Surface } from './Surface';
@@ -0,0 +1,2 @@
1
+ export { parseHexToOklch } from './oklch';
2
+ export { resolveModePrimaryColor } from './primary';
@@ -0,0 +1,69 @@
1
+ import { converter, formatHex, parse, toGamut } from 'culori';
2
+
3
+ import type { ZoraHexColor } from '../../theme/types';
4
+ import type { ZoraOklchColor } from './types';
5
+
6
+ const toOklch = converter('oklch');
7
+ const gamutMapToSrgb = toGamut('rgb', 'oklch');
8
+
9
+ function normalizeHueDegrees(hue: number): number {
10
+ const normalized = ((hue % 360) + 360) % 360;
11
+ return normalized;
12
+ }
13
+
14
+ function isSixDigitHexColor(value: string): value is ZoraHexColor {
15
+ return /^#[0-9a-fA-F]{6}$/.test(value);
16
+ }
17
+
18
+ export function parseHexToOklch(hex: ZoraHexColor): ZoraOklchColor {
19
+ if (!isSixDigitHexColor(hex)) {
20
+ throw new Error(`Expected a 6-digit hex color like '#0f766e', got '${String(hex)}'.`);
21
+ }
22
+
23
+ const parsed = parse(hex);
24
+ if (!parsed) {
25
+ throw new Error(`Unable to parse hex color '${String(hex)}'.`);
26
+ }
27
+
28
+ const oklch = toOklch(parsed);
29
+ if (typeof oklch.l !== 'number' || typeof oklch.c !== 'number') {
30
+ throw new Error(`Unable to convert hex color '${String(hex)}' to OKLCH.`);
31
+ }
32
+
33
+ return {
34
+ l: oklch.l,
35
+ c: oklch.c,
36
+ h: normalizeHueDegrees(typeof oklch.h === 'number' ? oklch.h : 0),
37
+ };
38
+ }
39
+
40
+ export function formatOklchAsHex(color: ZoraOklchColor): ZoraHexColor {
41
+ const mapped = gamutMapToSrgb({ mode: 'oklch', l: color.l, c: color.c, h: color.h });
42
+ const hex = formatHex(mapped);
43
+
44
+ if (!hex || !isSixDigitHexColor(hex)) {
45
+ throw new Error('Unable to format OKLCH color as a 6-digit hex value.');
46
+ }
47
+
48
+ const normalized = hex.toLowerCase();
49
+ if (!isSixDigitHexColor(normalized)) {
50
+ throw new Error('Unable to format OKLCH color as a 6-digit hex value.');
51
+ }
52
+
53
+ return normalized;
54
+ }
55
+
56
+ export function clampOklchToGamut(color: ZoraOklchColor): ZoraOklchColor {
57
+ const mapped = gamutMapToSrgb({ mode: 'oklch', l: color.l, c: color.c, h: color.h });
58
+ const clamped = toOklch(mapped);
59
+
60
+ if (typeof clamped.l !== 'number' || typeof clamped.c !== 'number') {
61
+ throw new Error('Unable to clamp OKLCH color to sRGB gamut.');
62
+ }
63
+
64
+ return {
65
+ l: clamped.l,
66
+ c: clamped.c,
67
+ h: normalizeHueDegrees(typeof clamped.h === 'number' ? clamped.h : 0),
68
+ };
69
+ }
@@ -0,0 +1,105 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import type { ZoraHexColor } from '../../theme/types';
4
+ import { parseHexToOklch } from './oklch';
5
+ import { resolveModePrimaryColor } from './primary';
6
+
7
+ function isSixDigitHexColor(value: string): value is ZoraHexColor {
8
+ return /^#[0-9a-f]{6}$/.test(value);
9
+ }
10
+
11
+ function hueDeltaDegrees(a: number, b: number): number {
12
+ const raw = Math.abs(a - b) % 360;
13
+ return Math.min(raw, 360 - raw);
14
+ }
15
+
16
+ describe('resolveModePrimaryColor', () => {
17
+ test('returns valid hex for light and dark mode', () => {
18
+ const seed: ZoraHexColor = '#0f766e';
19
+
20
+ const light = resolveModePrimaryColor(seed, 'light');
21
+ const dark = resolveModePrimaryColor(seed, 'dark');
22
+
23
+ expect(isSixDigitHexColor(light)).toBe(true);
24
+ expect(isSixDigitHexColor(dark)).toBe(true);
25
+ });
26
+
27
+ test('derives different colors for light vs dark for a typical saturated seed', () => {
28
+ const seed: ZoraHexColor = '#0f766e';
29
+
30
+ const light = resolveModePrimaryColor(seed, 'light');
31
+ const dark = resolveModePrimaryColor(seed, 'dark');
32
+
33
+ expect(light).not.toBe(dark);
34
+ });
35
+
36
+ test('dark derived primary has higher OKLCH lightness than the light derived primary', () => {
37
+ const seed: ZoraHexColor = '#0f766e';
38
+
39
+ const light = resolveModePrimaryColor(seed, 'light');
40
+ const dark = resolveModePrimaryColor(seed, 'dark');
41
+
42
+ const lightOklch = parseHexToOklch(light);
43
+ const darkOklch = parseHexToOklch(dark);
44
+
45
+ expect(darkOklch.l).toBeGreaterThan(lightOklch.l);
46
+ });
47
+
48
+ test('preserves hue approximately for a non-neutral seed', () => {
49
+ const seed: ZoraHexColor = '#0f766e';
50
+ const seedOklch = parseHexToOklch(seed);
51
+
52
+ const light = resolveModePrimaryColor(seed, 'light');
53
+ const dark = resolveModePrimaryColor(seed, 'dark');
54
+
55
+ const lightOklch = parseHexToOklch(light);
56
+ const darkOklch = parseHexToOklch(dark);
57
+
58
+ expect(hueDeltaDegrees(seedOklch.h, lightOklch.h)).toBeLessThan(20);
59
+ expect(hueDeltaDegrees(seedOklch.h, darkOklch.h)).toBeLessThan(20);
60
+ });
61
+
62
+ test('bounds chroma', () => {
63
+ const seed: ZoraHexColor = '#ff00ff';
64
+
65
+ const light = resolveModePrimaryColor(seed, 'light');
66
+ const dark = resolveModePrimaryColor(seed, 'dark');
67
+
68
+ const lightOklch = parseHexToOklch(light);
69
+ const darkOklch = parseHexToOklch(dark);
70
+
71
+ expect(lightOklch.c).toBeLessThanOrEqual(0.18 + 0.01);
72
+ expect(darkOklch.c).toBeLessThanOrEqual(0.2 + 0.01);
73
+ });
74
+
75
+ test('handles low-chroma colors without crashing', () => {
76
+ const seed: ZoraHexColor = '#808080';
77
+
78
+ const light = resolveModePrimaryColor(seed, 'light');
79
+ const dark = resolveModePrimaryColor(seed, 'dark');
80
+
81
+ expect(isSixDigitHexColor(light)).toBe(true);
82
+ expect(isSixDigitHexColor(dark)).toBe(true);
83
+ });
84
+
85
+ test('throws on invalid hex in test/development', () => {
86
+ const invalid: ZoraHexColor = '#nope';
87
+
88
+ expect(() => resolveModePrimaryColor(invalid, 'light')).toThrow();
89
+ });
90
+
91
+ test('falls back in production when input is invalid', () => {
92
+ const invalid: ZoraHexColor = '#nope';
93
+
94
+ const originalEnv = process.env.NODE_ENV;
95
+ process.env.NODE_ENV = 'production';
96
+
97
+ try {
98
+ const resolved = resolveModePrimaryColor(invalid, 'light');
99
+ expect(resolved).not.toBe('#0f766e');
100
+ expect(resolved).toBe(resolveModePrimaryColor('#0f766e', 'light'));
101
+ } finally {
102
+ process.env.NODE_ENV = originalEnv;
103
+ }
104
+ });
105
+ });