@ankhorage/zora 1.0.1 → 1.0.3

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 (151) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/components/card/Card.d.ts.map +1 -1
  3. package/dist/components/card/Card.js +2 -1
  4. package/dist/components/card/Card.js.map +1 -1
  5. package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
  6. package/dist/components/checkbox/CheckboxGroup.js +2 -1
  7. package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
  8. package/dist/components/drawer/Drawer.d.ts.map +1 -1
  9. package/dist/components/drawer/Drawer.js +2 -1
  10. package/dist/components/drawer/Drawer.js.map +1 -1
  11. package/dist/components/form/Form.d.ts.map +1 -1
  12. package/dist/components/form/Form.js +1 -1
  13. package/dist/components/form/Form.js.map +1 -1
  14. package/dist/components/form/FormActions.d.ts.map +1 -1
  15. package/dist/components/form/FormActions.js +1 -1
  16. package/dist/components/form/FormActions.js.map +1 -1
  17. package/dist/components/form/FormError.d.ts.map +1 -1
  18. package/dist/components/form/FormError.js +1 -1
  19. package/dist/components/form/FormError.js.map +1 -1
  20. package/dist/components/form/FormField.d.ts.map +1 -1
  21. package/dist/components/form/FormField.js +2 -1
  22. package/dist/components/form/FormField.js.map +1 -1
  23. package/dist/components/modal/Modal.d.ts.map +1 -1
  24. package/dist/components/modal/Modal.js +2 -1
  25. package/dist/components/modal/Modal.js.map +1 -1
  26. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  27. package/dist/components/radio/RadioGroup.js +2 -1
  28. package/dist/components/radio/RadioGroup.js.map +1 -1
  29. package/dist/components/select/Select.d.ts.map +1 -1
  30. package/dist/components/select/Select.js +1 -1
  31. package/dist/components/select/Select.js.map +1 -1
  32. package/dist/components/tabs/Tabs.d.ts.map +1 -1
  33. package/dist/components/tabs/Tabs.js +1 -1
  34. package/dist/components/tabs/Tabs.js.map +1 -1
  35. package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
  36. package/dist/components/toolbar/Toolbar.js +1 -1
  37. package/dist/components/toolbar/Toolbar.js.map +1 -1
  38. package/dist/layout/app-shell/AppShell.d.ts.map +1 -1
  39. package/dist/layout/app-shell/AppShell.js +1 -1
  40. package/dist/layout/app-shell/AppShell.js.map +1 -1
  41. package/dist/layout/auth-layout/AuthLayout.d.ts.map +1 -1
  42. package/dist/layout/auth-layout/AuthLayout.js +1 -1
  43. package/dist/layout/auth-layout/AuthLayout.js.map +1 -1
  44. package/dist/layout/page/Page.d.ts.map +1 -1
  45. package/dist/layout/page/Page.js +1 -1
  46. package/dist/layout/page/Page.js.map +1 -1
  47. package/dist/layout/page-header/PageHeader.d.ts.map +1 -1
  48. package/dist/layout/page-header/PageHeader.js +1 -1
  49. package/dist/layout/page-header/PageHeader.js.map +1 -1
  50. package/dist/layout/page-section/PageSection.d.ts.map +1 -1
  51. package/dist/layout/page-section/PageSection.js +1 -1
  52. package/dist/layout/page-section/PageSection.js.map +1 -1
  53. package/dist/layout/sidebar-layout/SidebarLayout.d.ts.map +1 -1
  54. package/dist/layout/sidebar-layout/SidebarLayout.js +1 -1
  55. package/dist/layout/sidebar-layout/SidebarLayout.js.map +1 -1
  56. package/dist/layout/topbar-layout/TopbarLayout.d.ts.map +1 -1
  57. package/dist/layout/topbar-layout/TopbarLayout.js +1 -1
  58. package/dist/layout/topbar-layout/TopbarLayout.js.map +1 -1
  59. package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
  60. package/dist/patterns/auth/ForgotPasswordForm.js +1 -1
  61. package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
  62. package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
  63. package/dist/patterns/auth/OtpForm.js +1 -1
  64. package/dist/patterns/auth/OtpForm.js.map +1 -1
  65. package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
  66. package/dist/patterns/auth/SignInForm.js +1 -1
  67. package/dist/patterns/auth/SignInForm.js.map +1 -1
  68. package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
  69. package/dist/patterns/auth/SignUpForm.js +1 -1
  70. package/dist/patterns/auth/SignUpForm.js.map +1 -1
  71. package/dist/patterns/collection-editor/CollectionEditor.d.ts.map +1 -1
  72. package/dist/patterns/collection-editor/CollectionEditor.js +1 -1
  73. package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
  74. package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts.map +1 -1
  75. package/dist/patterns/confirm-dialog/ConfirmDialog.js +1 -1
  76. package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
  77. package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +1 -1
  78. package/dist/patterns/disclosure-section/DisclosureSection.js +1 -1
  79. package/dist/patterns/disclosure-section/DisclosureSection.js.map +1 -1
  80. package/dist/patterns/empty-state/EmptyState.d.ts.map +1 -1
  81. package/dist/patterns/empty-state/EmptyState.js +1 -1
  82. package/dist/patterns/empty-state/EmptyState.js.map +1 -1
  83. package/dist/patterns/form-field/FormField.d.ts.map +1 -1
  84. package/dist/patterns/form-field/FormField.js +2 -1
  85. package/dist/patterns/form-field/FormField.js.map +1 -1
  86. package/dist/patterns/inspector-field/InspectorField.d.ts.map +1 -1
  87. package/dist/patterns/inspector-field/InspectorField.js +1 -1
  88. package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
  89. package/dist/patterns/notice/Notice.d.ts.map +1 -1
  90. package/dist/patterns/notice/Notice.js +1 -1
  91. package/dist/patterns/notice/Notice.js.map +1 -1
  92. package/dist/patterns/section-header/SectionHeader.d.ts.map +1 -1
  93. package/dist/patterns/section-header/SectionHeader.js +1 -1
  94. package/dist/patterns/section-header/SectionHeader.js.map +1 -1
  95. package/dist/patterns/settings-row/SettingsRow.d.ts.map +1 -1
  96. package/dist/patterns/settings-row/SettingsRow.js +1 -1
  97. package/dist/patterns/settings-row/SettingsRow.js.map +1 -1
  98. package/dist/patterns/theme-composer/ThemeComposer.d.ts.map +1 -1
  99. package/dist/patterns/theme-composer/ThemeComposer.js +4 -3
  100. package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
  101. package/dist/patterns/tile-grid/PaletteItem.d.ts.map +1 -1
  102. package/dist/patterns/tile-grid/PaletteItem.js +1 -1
  103. package/dist/patterns/tile-grid/PaletteItem.js.map +1 -1
  104. package/dist/patterns/tile-grid/TileGrid.d.ts.map +1 -1
  105. package/dist/patterns/tile-grid/TileGrid.js +1 -1
  106. package/dist/patterns/tile-grid/TileGrid.js.map +1 -1
  107. package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
  108. package/dist/patterns/tree-view/TreeItem.js +1 -1
  109. package/dist/patterns/tree-view/TreeItem.js.map +1 -1
  110. package/dist/patterns/tree-view/TreeView.d.ts.map +1 -1
  111. package/dist/patterns/tree-view/TreeView.js +1 -1
  112. package/dist/patterns/tree-view/TreeView.js.map +1 -1
  113. package/package.json +2 -2
  114. package/src/audit.test.ts +242 -0
  115. package/src/components/card/Card.tsx +2 -1
  116. package/src/components/checkbox/CheckboxGroup.tsx +2 -1
  117. package/src/components/drawer/Drawer.tsx +2 -1
  118. package/src/components/form/Form.tsx +1 -1
  119. package/src/components/form/FormActions.tsx +1 -1
  120. package/src/components/form/FormError.tsx +1 -1
  121. package/src/components/form/FormField.tsx +2 -1
  122. package/src/components/modal/Modal.tsx +2 -1
  123. package/src/components/radio/RadioGroup.tsx +2 -1
  124. package/src/components/select/Select.tsx +1 -1
  125. package/src/components/tabs/Tabs.tsx +1 -1
  126. package/src/components/toolbar/Toolbar.tsx +1 -1
  127. package/src/layout/app-shell/AppShell.tsx +1 -1
  128. package/src/layout/auth-layout/AuthLayout.tsx +1 -1
  129. package/src/layout/page/Page.tsx +1 -1
  130. package/src/layout/page-header/PageHeader.tsx +1 -1
  131. package/src/layout/page-section/PageSection.tsx +1 -1
  132. package/src/layout/sidebar-layout/SidebarLayout.tsx +1 -1
  133. package/src/layout/topbar-layout/TopbarLayout.tsx +1 -1
  134. package/src/patterns/auth/ForgotPasswordForm.tsx +1 -1
  135. package/src/patterns/auth/OtpForm.tsx +1 -1
  136. package/src/patterns/auth/SignInForm.tsx +1 -1
  137. package/src/patterns/auth/SignUpForm.tsx +1 -1
  138. package/src/patterns/collection-editor/CollectionEditor.tsx +1 -1
  139. package/src/patterns/confirm-dialog/ConfirmDialog.tsx +1 -1
  140. package/src/patterns/disclosure-section/DisclosureSection.tsx +1 -1
  141. package/src/patterns/empty-state/EmptyState.tsx +1 -1
  142. package/src/patterns/form-field/FormField.tsx +2 -1
  143. package/src/patterns/inspector-field/InspectorField.tsx +1 -1
  144. package/src/patterns/notice/Notice.tsx +1 -1
  145. package/src/patterns/section-header/SectionHeader.tsx +1 -1
  146. package/src/patterns/settings-row/SettingsRow.tsx +1 -1
  147. package/src/patterns/theme-composer/ThemeComposer.tsx +4 -3
  148. package/src/patterns/tile-grid/PaletteItem.tsx +1 -1
  149. package/src/patterns/tile-grid/TileGrid.tsx +1 -1
  150. package/src/patterns/tree-view/TreeItem.tsx +1 -1
  151. package/src/patterns/tree-view/TreeView.tsx +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SectionHeader.js","sourceRoot":"","sources":["../../../src/patterns/section-header/SectionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,MAAM,GACa;IACnB,OAAO,CACL,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAC5C,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CACzC,GAAG,CAAC,GAAG,CACP,OAAO,CAAC,eAAe,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACX;QAAA,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CACpD;cAAA,CAAC,OAAO,CACV;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CACnC;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACpC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,KAAK,CACT;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACxC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SectionHeaderProps } from './types';\n\nfunction SectionHeaderInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n eyebrow,\n actions,\n testID,\n}: SectionHeaderProps) {\n return (\n <Stack\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"m\"\n justify=\"space-between\"\n testID={testID}\n >\n <Box flex={1}>\n <Stack gap=\"xs\">\n {eyebrow ? (\n <Text tone=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n <Heading level={3}>{title}</Heading>\n {description ? (\n <Text tone=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n {actions ? <Box>{actions}</Box> : null}\n </Stack>\n );\n}\n\nexport const SectionHeader = withZoraThemeScope(SectionHeaderInner);\n"]}
1
+ {"version":3,"file":"SectionHeader.js","sourceRoot":"","sources":["../../../src/patterns/section-header/SectionHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,kBAAkB,CAAC,EAC1B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,OAAO,EACP,OAAO,EACP,MAAM,GACa;IACnB,OAAO,CACL,CAAC,KAAK,CACJ,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAC5C,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CACzC,GAAG,CAAC,GAAG,CACP,OAAO,CAAC,eAAe,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CAEf;MAAA,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACX;QAAA,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CACb;UAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CACT,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CACpD;cAAA,CAAC,OAAO,CACV;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;UAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,OAAO,CACnC;UAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACpC;cAAA,CAAC,WAAW,CACd;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,KAAK,CACT;MAAA,EAAE,GAAG,CACL;MAAA,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CACxC;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { Box, Stack } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SectionHeaderProps } from './types';\n\nfunction SectionHeaderInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n eyebrow,\n actions,\n testID,\n}: SectionHeaderProps) {\n return (\n <Stack\n align={{ base: 'flex-start', md: 'center' }}\n direction={{ base: 'column', md: 'row' }}\n gap=\"m\"\n justify=\"space-between\"\n testID={testID}\n >\n <Box flex={1}>\n <Stack gap=\"xs\">\n {eyebrow ? (\n <Text tone=\"muted\" variant=\"caption\" weight=\"semiBold\">\n {eyebrow}\n </Text>\n ) : null}\n <Heading level={3}>{title}</Heading>\n {description ? (\n <Text tone=\"muted\" variant=\"bodySmall\">\n {description}\n </Text>\n ) : null}\n </Stack>\n </Box>\n {actions ? <Box>{actions}</Box> : null}\n </Stack>\n );\n}\n\nexport const SectionHeader = withZoraThemeScope(SectionHeaderInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsRow.d.ts","sourceRoot":"","sources":["../../../src/patterns/settings-row/SettingsRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAuChD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
1
+ {"version":3,"file":"SettingsRow.d.ts","sourceRoot":"","sources":["../../../src/patterns/settings-row/SettingsRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAuChD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
@@ -1,7 +1,7 @@
1
- import { Box } from '@ankhorage/surface';
2
1
  import React from 'react';
3
2
  import { Card } from '../../components/card';
4
3
  import { Text } from '../../components/text';
4
+ import { Box } from '../../foundation';
5
5
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
6
  function SettingsRowInner({ themeId: _themeId, mode: _mode, title, description, meta, control, onPress, disabled = false, testID, }) {
7
7
  // Prevent nested interactive elements:
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsRow.js","sourceRoot":"","sources":["../../../src/patterns/settings-row/SettingsRow.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAA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orage/surface';\nimport React from 'react';\n\nimport { Card } from '../../components/card';\nimport { Text } from '../../components/text';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SettingsRowProps } from './types';\n\nfunction SettingsRowInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n meta,\n control,\n onPress,\n disabled = false,\n testID,\n}: SettingsRowProps) {\n // Prevent nested interactive elements:\n // If a control is present (likely contains buttons), the row itself must not be clickable\n const isInteractive = Boolean(onPress) && !control;\n\n return (\n <Card\n compact\n actions={control}\n description={description}\n disabled={disabled}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n title={title}\n tone=\"subtle\"\n >\n {meta ? (\n <Box pt=\"xs\">\n <Text tone=\"muted\" variant=\"caption\">\n {meta}\n </Text>\n </Box>\n ) : null}\n </Card>\n );\n}\n\nexport const SettingsRow = withZoraThemeScope(SettingsRowInner);\n"]}
1
+ {"version":3,"file":"SettingsRow.js","sourceRoot":"","sources":["../../../src/patterns/settings-row/SettingsRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EACxB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,GAAG,KAAK,EAChB,MAAM,GACW;IACjB,uCAAuC;IACvC,0FAA0F;IAC1F,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC;IAEnD,OAAO,CACL,CAAC,IAAI,CACH,OAAO,CACP,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAC7C,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,CAAC,QAAQ,CAEb;MAAA,CAAC,IAAI,CAAC,CAAC,CAAC,CACN,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CACV;UAAA,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAClC;YAAA,CAAC,IAAI,CACP;UAAA,EAAE,IAAI,CACR;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Card } from '../../components/card';\nimport { Text } from '../../components/text';\nimport { Box } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { SettingsRowProps } from './types';\n\nfunction SettingsRowInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n meta,\n control,\n onPress,\n disabled = false,\n testID,\n}: SettingsRowProps) {\n // Prevent nested interactive elements:\n // If a control is present (likely contains buttons), the row itself must not be clickable\n const isInteractive = Boolean(onPress) && !control;\n\n return (\n <Card\n compact\n actions={control}\n description={description}\n disabled={disabled}\n onPress={isInteractive ? onPress : undefined}\n testID={testID}\n title={title}\n tone=\"subtle\"\n >\n {meta ? (\n <Box pt=\"xs\">\n <Text tone=\"muted\" variant=\"caption\">\n {meta}\n </Text>\n </Box>\n ) : null}\n </Card>\n );\n}\n\nexport const SettingsRow = withZoraThemeScope(SettingsRowInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeComposer.d.ts","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAa1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAmSlD,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
1
+ {"version":3,"file":"ThemeComposer.d.ts","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAoSlD,eAAO,MAAM,aAAa,0DAAyC,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { COLOR_HARMONIES, parseHexColorOrThrow } from '@ankhorage/color-theory';
2
2
  import { APP_CATEGORIES } from '@ankhorage/contracts';
3
- import { Box, Stack } from '@ankhorage/surface';
4
3
  import React from 'react';
5
4
  import { Badge } from '../../components/badge';
6
5
  import { Button } from '../../components/button';
@@ -10,9 +9,11 @@ import { Input } from '../../components/input';
10
9
  import { Select } from '../../components/select';
11
10
  import { Tabs } from '../../components/tabs';
12
11
  import { Text } from '../../components/text';
12
+ import { Box, Stack } from '../../foundation';
13
13
  import { useZoraTheme } from '../../theme/useZoraTheme';
14
14
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
15
- const HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color (e.g. #0f766e).';
15
+ const HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color.';
16
+ const HEX_INPUT_PLACEHOLDER = 'Enter hex color';
16
17
  const NAME_ERROR_MESSAGE = 'Theme name cannot be empty.';
17
18
  function isValidHex(value) {
18
19
  try {
@@ -124,7 +125,7 @@ function ThemeComposerInner({ themeId: _themeId, value, onChange, mode, onModeCh
124
125
  <Stack gap="m">
125
126
  <Stack direction="row" gap="m" align="center">
126
127
  <Box flex={1}>
127
- <Input value={hexInput} onChangeText={handleHexChange} placeholder="#0f766e" autoCapitalize="none" autoCorrect={false} maxLength={7} invalid={hexError !== undefined} testID={testID ? `${testID}-hex-input` : undefined}/>
128
+ <Input value={hexInput} onChangeText={handleHexChange} placeholder={HEX_INPUT_PLACEHOLDER} autoCapitalize="none" autoCorrect={false} maxLength={7} invalid={hexError !== undefined} testID={testID ? `${testID}-hex-input` : undefined}/>
128
129
  </Box>
129
130
  {/* Color preview chip */}
130
131
  <Box width={36} height={36} radius="m" style={{
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeComposer.js","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,iBAAiB,GAAG,iDAAiD,CAAC;AAC5E,MAAM,kBAAkB,GAAG,6BAA6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AAC,QAAQ,CAAC,CAAC,CAAC,CACV,CAAC,MAAM,CACL,IAAI,CAAC,SAAS,CACd,QAAQ,CAAC,OAAO,CAChB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAEhD;;QACF,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { COLOR_HARMONIES, parseHexColorOrThrow } from '@ankhorage/color-theory';\nimport type { AppCategory } from '@ankhorage/contracts';\nimport { APP_CATEGORIES } from '@ankhorage/contracts';\nimport { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Badge } from '../../components/badge';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { Heading } from '../../components/heading';\nimport { Input } from '../../components/input';\nimport { Select } from '../../components/select';\nimport { Tabs } from '../../components/tabs';\nimport { Text } from '../../components/text';\nimport type { ZoraThemeMode } from '../../theme/types';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ThemeComposerProps } from './types';\n\nconst HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color (e.g. #0f766e).';\nconst NAME_ERROR_MESSAGE = 'Theme name cannot be empty.';\n\nfunction isValidHex(value: string): boolean {\n try {\n parseHexColorOrThrow(value);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction formatAppCategoryLabel(category: AppCategory): string {\n return category\n .split('_')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\nconst HARMONY_OPTIONS = COLOR_HARMONIES.map((h) => ({ value: h, label: h }));\n\nconst MODE_TABS = [\n { value: 'light' as ZoraThemeMode, label: 'Light' },\n { value: 'dark' as ZoraThemeMode, label: 'Dark' },\n];\n\nfunction ThemeComposerInner({\n themeId: _themeId,\n value,\n onChange,\n mode,\n onModeChange,\n onSubmit,\n appCategories,\n testID,\n}: ThemeComposerProps) {\n const { theme } = useZoraTheme();\n\n const [hexInput, setHexInput] = React.useState<string>(value.primaryColor);\n const [hexError, setHexError] = React.useState<string | undefined>(undefined);\n\n const [nameInput, setNameInput] = React.useState<string>(value.name);\n const [nameError, setNameError] = React.useState<string | undefined>(undefined);\n\n // Keep local inputs in sync when value changes externally\n React.useEffect(() => {\n setHexInput(value.primaryColor);\n setHexError(undefined);\n }, [value.primaryColor]);\n\n React.useEffect(() => {\n setNameInput(value.name);\n setNameError(undefined);\n }, [value.name]);\n\n function handleNameChange(text: string) {\n setNameInput(text);\n if (text.trim().length === 0) {\n setNameError(NAME_ERROR_MESSAGE);\n } else {\n setNameError(undefined);\n onChange({ ...value, name: text });\n }\n }\n\n function handleHexChange(text: string) {\n // Ensure leading hash\n const normalized = text.startsWith('#') ? text : `#${text}`;\n setHexInput(normalized);\n\n if (isValidHex(normalized)) {\n setHexError(undefined);\n onChange({ ...value, primaryColor: normalized });\n } else {\n setHexError(HEX_ERROR_MESSAGE);\n }\n }\n\n function handleSubmit() {\n const hasValidName = nameInput.trim().length > 0;\n const hasValidHex = isValidHex(hexInput);\n\n if (!hasValidName) {\n setNameError(NAME_ERROR_MESSAGE);\n }\n\n if (!hasValidHex) {\n setHexError(HEX_ERROR_MESSAGE);\n }\n\n if (!hasValidName || !hasValidHex) {\n return;\n }\n\n onSubmit?.({\n ...value,\n name: nameInput,\n primaryColor: hexInput,\n });\n }\n\n const activeMode = mode ?? 'light';\n const categoryOptions = (appCategories ?? APP_CATEGORIES).map((c) => ({\n value: c,\n label: formatAppCategoryLabel(c),\n }));\n\n return (\n <Stack gap=\"l\" testID={testID}>\n {/* Section: Theme identity */}\n <Card\n title=\"Theme identity\"\n description=\"Name your theme. The ID is assigned automatically and shown for reference.\"\n >\n <Stack gap=\"m\">\n <Stack gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <Input\n value={nameInput}\n onChangeText={handleNameChange}\n placeholder=\"My theme\"\n autoCorrect={false}\n invalid={nameError !== undefined}\n testID={testID ? `${testID}-name-input` : undefined}\n />\n {nameError ? (\n <Text tone=\"danger\" variant=\"bodySmall\">\n {nameError}\n </Text>\n ) : null}\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">ID</Text>\n <Text\n tone=\"muted\"\n variant=\"bodySmall\"\n testID={testID ? `${testID}-id-display` : undefined}\n >\n {value.id}\n </Text>\n </Stack>\n </Stack>\n </Card>\n\n {/* Section: App category */}\n <Card title=\"App category\" description=\"Choose the category that best describes this app.\">\n <Select\n value={value.appCategory}\n options={categoryOptions}\n onValueChange={(c) => onChange({ ...value, appCategory: c })}\n testID={testID ? `${testID}-category-select` : undefined}\n />\n </Card>\n\n {/* Section: Primary Color */}\n <Card title=\"Primary color\" description=\"Set the seed color for your theme palette.\">\n <Stack gap=\"m\">\n <Stack direction=\"row\" gap=\"m\" align=\"center\">\n <Box flex={1}>\n <Input\n value={hexInput}\n onChangeText={handleHexChange}\n placeholder=\"#0f766e\"\n autoCapitalize=\"none\"\n autoCorrect={false}\n maxLength={7}\n invalid={hexError !== undefined}\n testID={testID ? `${testID}-hex-input` : undefined}\n />\n </Box>\n {/* Color preview chip */}\n <Box\n width={36}\n height={36}\n radius=\"m\"\n style={{\n backgroundColor: isValidHex(hexInput) ? hexInput : theme.colors.border,\n borderWidth: 1,\n borderColor: theme.colors.border,\n }}\n />\n </Stack>\n {hexError ? (\n <Text tone=\"danger\" variant=\"bodySmall\">\n {hexError}\n </Text>\n ) : null}\n </Stack>\n </Card>\n\n {/* Section: Harmony */}\n <Card\n title=\"Harmony\"\n description=\"Choose how accent hues are generated from your primary color.\"\n >\n <Select\n value={value.harmony}\n options={HARMONY_OPTIONS}\n onValueChange={(h) => onChange({ ...value, harmony: h })}\n testID={testID ? `${testID}-harmony-select` : undefined}\n />\n </Card>\n\n {/* Section: Mode */}\n <Card title=\"Mode\" description=\"Switch between light and dark presentation.\">\n <Tabs\n value={activeMode}\n items={MODE_TABS}\n onValueChange={(m) => onModeChange?.(m)}\n variant=\"segmented\"\n testID={testID ? `${testID}-mode-tabs` : undefined}\n />\n </Card>\n\n {/* Section: Preview */}\n <Card title=\"Preview\" description=\"A quick look at how your theme renders common controls.\">\n <Stack gap=\"m\">\n <Stack gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <Text>{value.name}</Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Category</Text>\n <Text>{formatAppCategoryLabel(value.appCategory)}</Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Primary color</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n {value.primaryColor}\n </Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Harmony</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n {value.harmony}\n </Text>\n </Stack>\n <Heading level={4}>Heading</Heading>\n <Text>Body text — this shows default text color and weight.</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n Muted caption text.\n </Text>\n <Stack direction=\"row\" gap=\"s\" align=\"center\">\n <Button tone=\"primary\" emphasis=\"solid\" size=\"m\">\n Primary\n </Button>\n <Button tone=\"neutral\" emphasis=\"soft\" size=\"m\">\n Neutral\n </Button>\n <Button tone=\"danger\" emphasis=\"ghost\" size=\"m\">\n Danger\n </Button>\n </Stack>\n <Stack direction=\"row\" gap=\"s\" align=\"center\">\n <Badge tone=\"primary\">Primary</Badge>\n <Badge tone=\"success\" emphasis=\"soft\">\n Success\n </Badge>\n <Badge tone=\"warning\" emphasis=\"soft\">\n Warning\n </Badge>\n <Badge tone=\"danger\" emphasis=\"soft\">\n Danger\n </Badge>\n </Stack>\n <Card\n tone=\"subtle\"\n title=\"Nested card\"\n description=\"Subtle tone inside the preview.\"\n compact\n />\n </Stack>\n </Card>\n\n {/* Submit */}\n {onSubmit ? (\n <Button\n tone=\"primary\"\n emphasis=\"solid\"\n onPress={handleSubmit}\n testID={testID ? `${testID}-submit` : undefined}\n >\n Apply theme\n </Button>\n ) : null}\n </Stack>\n );\n}\n\nexport const ThemeComposer = withZoraThemeScope(ThemeComposerInner);\n"]}
1
+ {"version":3,"file":"ThemeComposer.js","sourceRoot":"","sources":["../../../src/patterns/theme-composer/ThemeComposer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAEhF,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,MAAM,iBAAiB,GAAG,kCAAkC,CAAC;AAC7D,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAChD,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEzD,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,CAAC;QACH,oBAAoB,CAAC,KAAK,CA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d,QAAQ,CAAC,OAAO,CAChB,OAAO,CAAC,CAAC,YAAY,CAAC,CACtB,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAEhD;;QACF,EAAE,MAAM,CAAC,CACV,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { COLOR_HARMONIES, parseHexColorOrThrow } from '@ankhorage/color-theory';\nimport type { AppCategory } from '@ankhorage/contracts';\nimport { APP_CATEGORIES } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { Badge } from '../../components/badge';\nimport { Button } from '../../components/button';\nimport { Card } from '../../components/card';\nimport { Heading } from '../../components/heading';\nimport { Input } from '../../components/input';\nimport { Select } from '../../components/select';\nimport { Tabs } from '../../components/tabs';\nimport { Text } from '../../components/text';\nimport { Box, Stack } from '../../foundation';\nimport type { ZoraThemeMode } from '../../theme/types';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ThemeComposerProps } from './types';\n\nconst HEX_ERROR_MESSAGE = 'Enter a valid 6-digit hex color.';\nconst HEX_INPUT_PLACEHOLDER = 'Enter hex color';\nconst NAME_ERROR_MESSAGE = 'Theme name cannot be empty.';\n\nfunction isValidHex(value: string): boolean {\n try {\n parseHexColorOrThrow(value);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction formatAppCategoryLabel(category: AppCategory): string {\n return category\n .split('_')\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(' ');\n}\n\nconst HARMONY_OPTIONS = COLOR_HARMONIES.map((h) => ({ value: h, label: h }));\n\nconst MODE_TABS = [\n { value: 'light' as ZoraThemeMode, label: 'Light' },\n { value: 'dark' as ZoraThemeMode, label: 'Dark' },\n];\n\nfunction ThemeComposerInner({\n themeId: _themeId,\n value,\n onChange,\n mode,\n onModeChange,\n onSubmit,\n appCategories,\n testID,\n}: ThemeComposerProps) {\n const { theme } = useZoraTheme();\n\n const [hexInput, setHexInput] = React.useState<string>(value.primaryColor);\n const [hexError, setHexError] = React.useState<string | undefined>(undefined);\n\n const [nameInput, setNameInput] = React.useState<string>(value.name);\n const [nameError, setNameError] = React.useState<string | undefined>(undefined);\n\n // Keep local inputs in sync when value changes externally\n React.useEffect(() => {\n setHexInput(value.primaryColor);\n setHexError(undefined);\n }, [value.primaryColor]);\n\n React.useEffect(() => {\n setNameInput(value.name);\n setNameError(undefined);\n }, [value.name]);\n\n function handleNameChange(text: string) {\n setNameInput(text);\n if (text.trim().length === 0) {\n setNameError(NAME_ERROR_MESSAGE);\n } else {\n setNameError(undefined);\n onChange({ ...value, name: text });\n }\n }\n\n function handleHexChange(text: string) {\n // Ensure leading hash\n const normalized = text.startsWith('#') ? text : `#${text}`;\n setHexInput(normalized);\n\n if (isValidHex(normalized)) {\n setHexError(undefined);\n onChange({ ...value, primaryColor: normalized });\n } else {\n setHexError(HEX_ERROR_MESSAGE);\n }\n }\n\n function handleSubmit() {\n const hasValidName = nameInput.trim().length > 0;\n const hasValidHex = isValidHex(hexInput);\n\n if (!hasValidName) {\n setNameError(NAME_ERROR_MESSAGE);\n }\n\n if (!hasValidHex) {\n setHexError(HEX_ERROR_MESSAGE);\n }\n\n if (!hasValidName || !hasValidHex) {\n return;\n }\n\n onSubmit?.({\n ...value,\n name: nameInput,\n primaryColor: hexInput,\n });\n }\n\n const activeMode = mode ?? 'light';\n const categoryOptions = (appCategories ?? APP_CATEGORIES).map((c) => ({\n value: c,\n label: formatAppCategoryLabel(c),\n }));\n\n return (\n <Stack gap=\"l\" testID={testID}>\n {/* Section: Theme identity */}\n <Card\n title=\"Theme identity\"\n description=\"Name your theme. The ID is assigned automatically and shown for reference.\"\n >\n <Stack gap=\"m\">\n <Stack gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <Input\n value={nameInput}\n onChangeText={handleNameChange}\n placeholder=\"My theme\"\n autoCorrect={false}\n invalid={nameError !== undefined}\n testID={testID ? `${testID}-name-input` : undefined}\n />\n {nameError ? (\n <Text tone=\"danger\" variant=\"bodySmall\">\n {nameError}\n </Text>\n ) : null}\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">ID</Text>\n <Text\n tone=\"muted\"\n variant=\"bodySmall\"\n testID={testID ? `${testID}-id-display` : undefined}\n >\n {value.id}\n </Text>\n </Stack>\n </Stack>\n </Card>\n\n {/* Section: App category */}\n <Card title=\"App category\" description=\"Choose the category that best describes this app.\">\n <Select\n value={value.appCategory}\n options={categoryOptions}\n onValueChange={(c) => onChange({ ...value, appCategory: c })}\n testID={testID ? `${testID}-category-select` : undefined}\n />\n </Card>\n\n {/* Section: Primary Color */}\n <Card title=\"Primary color\" description=\"Set the seed color for your theme palette.\">\n <Stack gap=\"m\">\n <Stack direction=\"row\" gap=\"m\" align=\"center\">\n <Box flex={1}>\n <Input\n value={hexInput}\n onChangeText={handleHexChange}\n placeholder={HEX_INPUT_PLACEHOLDER}\n autoCapitalize=\"none\"\n autoCorrect={false}\n maxLength={7}\n invalid={hexError !== undefined}\n testID={testID ? `${testID}-hex-input` : undefined}\n />\n </Box>\n {/* Color preview chip */}\n <Box\n width={36}\n height={36}\n radius=\"m\"\n style={{\n backgroundColor: isValidHex(hexInput) ? hexInput : theme.colors.border,\n borderWidth: 1,\n borderColor: theme.colors.border,\n }}\n />\n </Stack>\n {hexError ? (\n <Text tone=\"danger\" variant=\"bodySmall\">\n {hexError}\n </Text>\n ) : null}\n </Stack>\n </Card>\n\n {/* Section: Harmony */}\n <Card\n title=\"Harmony\"\n description=\"Choose how accent hues are generated from your primary color.\"\n >\n <Select\n value={value.harmony}\n options={HARMONY_OPTIONS}\n onValueChange={(h) => onChange({ ...value, harmony: h })}\n testID={testID ? `${testID}-harmony-select` : undefined}\n />\n </Card>\n\n {/* Section: Mode */}\n <Card title=\"Mode\" description=\"Switch between light and dark presentation.\">\n <Tabs\n value={activeMode}\n items={MODE_TABS}\n onValueChange={(m) => onModeChange?.(m)}\n variant=\"segmented\"\n testID={testID ? `${testID}-mode-tabs` : undefined}\n />\n </Card>\n\n {/* Section: Preview */}\n <Card title=\"Preview\" description=\"A quick look at how your theme renders common controls.\">\n <Stack gap=\"m\">\n <Stack gap=\"xs\">\n <Text variant=\"label\">Name</Text>\n <Text>{value.name}</Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Category</Text>\n <Text>{formatAppCategoryLabel(value.appCategory)}</Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Primary color</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n {value.primaryColor}\n </Text>\n </Stack>\n <Stack gap=\"xs\">\n <Text variant=\"label\">Harmony</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n {value.harmony}\n </Text>\n </Stack>\n <Heading level={4}>Heading</Heading>\n <Text>Body text — this shows default text color and weight.</Text>\n <Text tone=\"muted\" variant=\"bodySmall\">\n Muted caption text.\n </Text>\n <Stack direction=\"row\" gap=\"s\" align=\"center\">\n <Button tone=\"primary\" emphasis=\"solid\" size=\"m\">\n Primary\n </Button>\n <Button tone=\"neutral\" emphasis=\"soft\" size=\"m\">\n Neutral\n </Button>\n <Button tone=\"danger\" emphasis=\"ghost\" size=\"m\">\n Danger\n </Button>\n </Stack>\n <Stack direction=\"row\" gap=\"s\" align=\"center\">\n <Badge tone=\"primary\">Primary</Badge>\n <Badge tone=\"success\" emphasis=\"soft\">\n Success\n </Badge>\n <Badge tone=\"warning\" emphasis=\"soft\">\n Warning\n </Badge>\n <Badge tone=\"danger\" emphasis=\"soft\">\n Danger\n </Badge>\n </Stack>\n <Card\n tone=\"subtle\"\n title=\"Nested card\"\n description=\"Subtle tone inside the preview.\"\n compact\n />\n </Stack>\n </Card>\n\n {/* Submit */}\n {onSubmit ? (\n <Button\n tone=\"primary\"\n emphasis=\"solid\"\n onPress={handleSubmit}\n testID={testID ? `${testID}-submit` : undefined}\n >\n Apply theme\n </Button>\n ) : null}\n </Stack>\n );\n}\n\nexport const ThemeComposer = withZoraThemeScope(ThemeComposerInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PaletteItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgDhD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
1
+ {"version":3,"file":"PaletteItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgDhD,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Box } from '@ankhorage/surface';
2
1
  import React from 'react';
3
2
  import { Card } from '../../components/card';
4
3
  import { Heading } from '../../components/heading';
5
4
  import { Text } from '../../components/text';
5
+ import { Box } from '../../foundation';
6
6
  import { useZoraTheme } from '../../theme/useZoraTheme';
7
7
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
8
8
  function PaletteItemInner({ themeId: _themeId, mode: _mode, title, description, icon, badge, selected, disabled, onPress, testID, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"PaletteItem.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/PaletteItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,C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AK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CACjD;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC5C;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { Box } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Card } from '../../components/card';\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PaletteItemProps } from './types';\n\nfunction PaletteItemInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n icon,\n badge,\n selected,\n disabled,\n onPress,\n testID,\n}: PaletteItemProps) {\n const { theme } = useZoraTheme();\n\n return (\n <Card\n compact\n disabled={disabled}\n onPress={onPress}\n testID={testID}\n tone={selected ? 'default' : 'subtle'}\n style={\n selected\n ? {\n borderColor: theme.colors.primary,\n borderWidth: 2,\n }\n : undefined\n }\n >\n <Box p=\"xs\" style={{ alignItems: 'center' }}>\n {icon ? <Box pb=\"s\">{/* Icon spec here */}</Box> : null}\n <Heading level={5} align=\"center\">\n {title}\n </Heading>\n {description ? (\n <Text align=\"center\" tone=\"muted\" variant=\"caption\">\n {description}\n </Text>\n ) : null}\n {badge ? <Box pt=\"xs\">{badge}</Box> : null}\n </Box>\n </Card>\n );\n}\n\nexport const PaletteItem = withZoraThemeScope(PaletteItemInner);\n"]}
1
+ {"version":3,"file":"PaletteItem.js","sourceRoot":"","sources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AG,CAAC,CAAC,CAAC,CAAC,IAAI,CACvD;QAAA,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAC/B;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,OAAO,CACT;QAAA,CAAC,WAAW,CAAC,CAAC,CAAC,CACb,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CACjD;YAAA,CAAC,WAAW,CACd;UAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACR;QAAA,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAC5C;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Card } from '../../components/card';\nimport { Heading } from '../../components/heading';\nimport { Text } from '../../components/text';\nimport { Box } from '../../foundation';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { PaletteItemProps } from './types';\n\nfunction PaletteItemInner({\n themeId: _themeId,\n mode: _mode,\n title,\n description,\n icon,\n badge,\n selected,\n disabled,\n onPress,\n testID,\n}: PaletteItemProps) {\n const { theme } = useZoraTheme();\n\n return (\n <Card\n compact\n disabled={disabled}\n onPress={onPress}\n testID={testID}\n tone={selected ? 'default' : 'subtle'}\n style={\n selected\n ? {\n borderColor: theme.colors.primary,\n borderWidth: 2,\n }\n : undefined\n }\n >\n <Box p=\"xs\" style={{ alignItems: 'center' }}>\n {icon ? <Box pb=\"s\">{/* Icon spec here */}</Box> : null}\n <Heading level={5} align=\"center\">\n {title}\n </Heading>\n {description ? (\n <Text align=\"center\" tone=\"muted\" variant=\"caption\">\n {description}\n </Text>\n ) : null}\n {badge ? <Box pt=\"xs\">{badge}</Box> : null}\n </Box>\n </Card>\n );\n}\n\nexport const PaletteItem = withZoraThemeScope(PaletteItemInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TileGrid.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA4C7C,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
1
+ {"version":3,"file":"TileGrid.d.ts","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA4C7C,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Box } from '@ankhorage/surface';
2
1
  import React from 'react';
2
+ import { Box } from '../../foundation';
3
3
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
4
4
  function TileGridInner({ themeId: _themeId, mode: _mode, children, columns = 'responsive', compact = false, testID, }) {
5
5
  return (<Box testID={testID} style={{
@@ -1 +1 @@
1
- {"version":3,"file":"TileGrid.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,OAAO,GAAG,YAAY,EACtB,OAAO,GAAG,KAAK,EACf,MAAM,GACQ;IACd,OAAO,CACL,CAAC,GAAG,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SACtB,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YACtC,IAAI,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAC;YAExB,OAAO,CACL,CAAC,GAAG,CACF,KAAK,CAAC,CACJ,OAAO,KAAK,YAAY;oBACtB,CAAC,CAAC;wBACE,SAAS,EAAE,KAAK;wBAChB,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,GAAG;qBACd;oBACH,CAAC,CAAC;wBACE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,GAAG;qBAElC,CAAC,CAED;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Box } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { TileGridProps } from './types';\n\nfunction TileGridInner({\n themeId: _themeId,\n mode: _mode,\n children,\n columns = 'responsive',\n compact = false,\n testID,\n}: TileGridProps) {\n return (\n <Box\n testID={testID}\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: compact ? 8 : 16,\n }}\n >\n {React.Children.map(children, (child) => {\n if (!child) return null;\n\n return (\n <Box\n style={\n columns === 'responsive'\n ? {\n flexBasis: '30%',\n flexGrow: 1,\n minWidth: 120,\n }\n : {\n width: `${100 / columns}%`,\n }\n }\n >\n {child}\n </Box>\n );\n })}\n </Box>\n );\n}\n\nexport const TileGrid = withZoraThemeScope(TileGridInner);\n"]}
1
+ {"version":3,"file":"TileGrid.js","sourceRoot":"","sources":["../../../src/patterns/tile-grid/TileGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,QAAQ,EACR,OAAO,GAAG,YAAY,EACtB,OAAO,GAAG,KAAK,EACf,MAAM,GACQ;IACd,OAAO,CACL,CAAC,GAAG,CACF,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC;YACL,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,MAAM;YAChB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;SACtB,CAAC,CAEF;MAAA,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YACtC,IAAI,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAC;YAExB,OAAO,CACL,CAAC,GAAG,CACF,KAAK,CAAC,CACJ,OAAO,KAAK,YAAY;oBACtB,CAAC,CAAC;wBACE,SAAS,EAAE,KAAK;wBAChB,QAAQ,EAAE,CAAC;wBACX,QAAQ,EAAE,GAAG;qBACd;oBACH,CAAC,CAAC;wBACE,KAAK,EAAE,GAAG,GAAG,GAAG,OAAO,GAAG;qBAElC,CAAC,CAED;YAAA,CAAC,KAAK,CACR;UAAA,EAAE,GAAG,CAAC,CACP,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Box } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { TileGridProps } from './types';\n\nfunction TileGridInner({\n themeId: _themeId,\n mode: _mode,\n children,\n columns = 'responsive',\n compact = false,\n testID,\n}: TileGridProps) {\n return (\n <Box\n testID={testID}\n style={{\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: compact ? 8 : 16,\n }}\n >\n {React.Children.map(children, (child) => {\n if (!child) return null;\n\n return (\n <Box\n style={\n columns === 'responsive'\n ? {\n flexBasis: '30%',\n flexGrow: 1,\n minWidth: 120,\n }\n : {\n width: `${100 / columns}%`,\n }\n }\n >\n {child}\n </Box>\n );\n })}\n </Box>\n );\n}\n\nexport const TileGrid = withZoraThemeScope(TileGridInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,UAAU,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IACxE,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,SAAS,GAAG,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACnE;AA2ED,eAAO,MAAM,QAAQ,GAzEE,GAAG,SAAS,MAAM,kEAyEgB,CAAC"}
1
+ {"version":3,"file":"TreeItem.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEjE,UAAU,aAAa,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,aAAa;IACxE,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,SAAS,GAAG,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC7B,cAAc,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,mBAAmB,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;CACnE;AA2ED,eAAO,MAAM,QAAQ,GAzEE,GAAG,SAAS,MAAM,kEAyEgB,CAAC"}
@@ -1,6 +1,6 @@
1
- import { Box, Stack } from '@ankhorage/surface';
2
1
  import React from 'react';
3
2
  import { IconButton } from '../../components/icon-button';
3
+ import { Box, Stack } from '../../foundation';
4
4
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
5
5
  import { SettingsRow } from '../settings-row';
6
6
  function TreeItemInner({ themeId: _themeId, mode: _mode, node, depth, selectedId, expandedIds, onSelect, onToggleExpand, renderItem, testID, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"TreeItem.js","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CAAC,CACJ;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Box, Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { IconButton } from '../../components/icon-button';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport { SettingsRow } from '../settings-row';\nimport type { TreeItemNode, TreeItemRenderProps } from './types';\n\ninterface TreeItemProps<TId extends string = string> extends ZoraBaseProps {\n node: TreeItemNode<TId>;\n depth: number;\n selectedId?: TId;\n expandedIds: readonly TId[];\n onSelect?: (id: TId) => void;\n onToggleExpand: (id: TId) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n}\n\nfunction TreeItemInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n node,\n depth,\n selectedId,\n expandedIds,\n onSelect,\n onToggleExpand,\n renderItem,\n testID,\n}: TreeItemProps<TId>) {\n const hasChildren = node.children !== undefined && node.children.length > 0;\n const isExpanded = expandedIds.includes(node.id);\n const isSelected = selectedId === node.id;\n\n const renderContent = () => {\n if (renderItem) {\n return renderItem({\n node,\n depth,\n selected: isSelected,\n expanded: isExpanded,\n hasChildren,\n });\n }\n\n return (\n <SettingsRow\n title={node.label}\n control={\n <Stack direction=\"row\" gap=\"xs\" align=\"center\">\n {node.actions}\n {hasChildren ? (\n <IconButton\n icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }}\n label={isExpanded ? 'Collapse' : 'Expand'}\n onPress={() => onToggleExpand(node.id)}\n size=\"s\"\n emphasis=\"ghost\"\n />\n ) : null}\n </Stack>\n }\n meta={node.meta}\n disabled={node.disabled}\n />\n );\n };\n\n return (\n <Box testID={testID}>\n <Box style={{ paddingLeft: depth * 16 }}>{renderContent()}</Box>\n {hasChildren && isExpanded ? (\n <Box>\n {node.children?.map((child) => (\n <TreeItem\n key={child.id}\n depth={depth + 1}\n expandedIds={expandedIds}\n node={child}\n onSelect={onSelect}\n onToggleExpand={onToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Box>\n ) : null}\n </Box>\n );\n}\n\nexport const TreeItem = withZoraThemeScope(TreeItemInner);\n"]}
1
+ {"version":3,"file":"TreeItem.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAa9C,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,KAAK,EACL,UAAU,EACV,WAAW,EACX,QAAQ,EACR,cAAc,EACd,UAAU,EACV,MAAM,GACa;IACnB,MAAM,WAAW,GAAG,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjD,MAAM,UAAU,GAAG,UAAU,KAAK,IAAI,CAAC,EAAE,CAAC;IAE1C,MAAM,aAAa,GAAG,GAAG,EAAE;QACzB,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,UAAU,CAAC;gBAChB,IAAI;gBACJ,KAAK;gBACL,QAAQ,EAAE,UAAU;gBACpB,QAAQ,EAAE,UAAU;gBACpB,WAAW;aACZ,CAAC,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KAAK,CAAC,EAAE,CAAC,CACd,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CACjB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,CAAC,CAAC,KAAK,CAAC,CACZ,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;QAAA,EAAE,GAAG,CAAC,CACP,CAAC,CAAC,CAAC,IAAI,CACV;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { IconButton } from '../../components/icon-button';\nimport { Box, Stack } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\nimport { SettingsRow } from '../settings-row';\nimport type { TreeItemNode, TreeItemRenderProps } from './types';\n\ninterface TreeItemProps<TId extends string = string> extends ZoraBaseProps {\n node: TreeItemNode<TId>;\n depth: number;\n selectedId?: TId;\n expandedIds: readonly TId[];\n onSelect?: (id: TId) => void;\n onToggleExpand: (id: TId) => void;\n renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n}\n\nfunction TreeItemInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n node,\n depth,\n selectedId,\n expandedIds,\n onSelect,\n onToggleExpand,\n renderItem,\n testID,\n}: TreeItemProps<TId>) {\n const hasChildren = node.children !== undefined && node.children.length > 0;\n const isExpanded = expandedIds.includes(node.id);\n const isSelected = selectedId === node.id;\n\n const renderContent = () => {\n if (renderItem) {\n return renderItem({\n node,\n depth,\n selected: isSelected,\n expanded: isExpanded,\n hasChildren,\n });\n }\n\n return (\n <SettingsRow\n title={node.label}\n control={\n <Stack direction=\"row\" gap=\"xs\" align=\"center\">\n {node.actions}\n {hasChildren ? (\n <IconButton\n icon={{ name: isExpanded ? 'chevron-down-outline' : 'chevron-forward-outline' }}\n label={isExpanded ? 'Collapse' : 'Expand'}\n onPress={() => onToggleExpand(node.id)}\n size=\"s\"\n emphasis=\"ghost\"\n />\n ) : null}\n </Stack>\n }\n meta={node.meta}\n disabled={node.disabled}\n />\n );\n };\n\n return (\n <Box testID={testID}>\n <Box style={{ paddingLeft: depth * 16 }}>{renderContent()}</Box>\n {hasChildren && isExpanded ? (\n <Box>\n {node.children?.map((child) => (\n <TreeItem\n key={child.id}\n depth={depth + 1}\n expandedIds={expandedIds}\n node={child}\n onSelect={onSelect}\n onToggleExpand={onToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Box>\n ) : null}\n </Box>\n );\n}\n\nexport const TreeItem = withZoraThemeScope(TreeItemInner);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiD7C,eAAO,MAAM,QAAQ,GA/CE,GAAG,SAAS,MAAM,kEA+CgB,CAAC"}
1
+ {"version":3,"file":"TreeView.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiD7C,eAAO,MAAM,QAAQ,GA/CE,GAAG,SAAS,MAAM,kEA+CgB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { Stack } from '@ankhorage/surface';
2
1
  import React from 'react';
2
+ import { Stack } from '../../foundation';
3
3
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
4
4
  import { TreeItem } from './TreeItem';
5
5
  function TreeViewInner({ themeId: _themeId, mode: _mode, nodes, selectedId, expandedIds: controlledExpandedIds, defaultExpandedIds, onSelect, onExpandedChange, renderItem, testID, }) {
@@ -1 +1 @@
1
- {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,MAAM,GACa;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAE/E,MAAM,kBAAkB,GAAG,CAAC,EAAO,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,CAAC;QAE3F,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC/B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import { Stack } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { TreeItem } from './TreeItem';\nimport type { TreeViewProps } from './types';\n\nfunction TreeViewInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n testID,\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n\n const handleToggleExpand = (id: TId) => {\n const isExpanded = expandedIds.includes(id);\n const newIds = isExpanded ? expandedIds.filter((eid) => eid !== id) : [...expandedIds, id];\n\n if (!isControlled) {\n setInternalExpandedIds(newIds);\n }\n onExpandedChange?.(newIds);\n };\n\n return (\n <Stack gap=\"none\" testID={testID}>\n {nodes.map((node) => (\n <TreeItem\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Stack>\n );\n}\n\nexport const TreeView = withZoraThemeScope(TreeViewInner);\n"]}
1
+ {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../src/patterns/tree-view/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,MAAM,GACa;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAE/E,MAAM,kBAAkB,GAAG,CAAC,EAAO,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,WAAW,EAAE,EAAE,CAAC,CAAC;QAE3F,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,sBAAsB,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC;QACD,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC/B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Stack } from '../../foundation';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { TreeItem } from './TreeItem';\nimport type { TreeViewProps } from './types';\n\nfunction TreeViewInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n testID,\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n\n const handleToggleExpand = (id: TId) => {\n const isExpanded = expandedIds.includes(id);\n const newIds = isExpanded ? expandedIds.filter((eid) => eid !== id) : [...expandedIds, id];\n\n if (!isControlled) {\n setInternalExpandedIds(newIds);\n }\n onExpandedChange?.(newIds);\n };\n\n return (\n <Stack gap=\"none\" testID={testID}>\n {nodes.map((node) => (\n <TreeItem\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </Stack>\n );\n}\n\nexport const TreeView = withZoraThemeScope(TreeViewInner);\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/zora",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
5
5
  "description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
6
6
  "homepage": "https://github.com/ankhorage/zora#readme",
7
7
  "bugs": {
@@ -43,7 +43,7 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@ankhorage/color-theory": "^0.0.2",
46
+ "@ankhorage/color-theory": "^0.0.3",
47
47
  "@ankhorage/contracts": "^1.1.0",
48
48
  "@ankhorage/surface": "^1.0.0"
49
49
  },
@@ -0,0 +1,242 @@
1
+ /**
2
+ * Plan 5 — Semantic theme usage audit regression guards.
3
+ *
4
+ * These tests verify that stale or forbidden APIs from before Plan 3/4 do not
5
+ * re-appear in the ZORA source, examples, or public exports.
6
+ */
7
+
8
+ import { readdirSync, readFileSync } from 'node:fs';
9
+ import { join } from 'node:path';
10
+
11
+ import { describe, expect, test } from 'bun:test';
12
+
13
+ const ROOT = process.cwd();
14
+ const SRC_ROOT = join(ROOT, 'src');
15
+ const EXAMPLES_ROOT = join(ROOT, 'examples');
16
+ const README_PATH = join(ROOT, 'README.md');
17
+ const PACKAGE_JSON_PATH = join(ROOT, 'package.json');
18
+
19
+ const IGNORED_DIRECTORY_NAMES = new Set([
20
+ '.expo',
21
+ '.git',
22
+ '.turbo',
23
+ '.vercel',
24
+ 'coverage',
25
+ 'dist',
26
+ 'node_modules',
27
+ ]);
28
+
29
+ function listFiles(root: string, excludeTests = false): string[] {
30
+ return readdirSync(root, { withFileTypes: true }).flatMap((entry) => {
31
+ if (entry.isDirectory() && IGNORED_DIRECTORY_NAMES.has(entry.name)) {
32
+ return [];
33
+ }
34
+
35
+ const absolutePath = join(root, entry.name);
36
+ if (entry.isDirectory()) {
37
+ return listFiles(absolutePath, excludeTests);
38
+ }
39
+
40
+ if (!entry.isFile() || !/\.[cm]?tsx?$/.test(entry.name)) {
41
+ return [];
42
+ }
43
+
44
+ if (excludeTests && /\.test\.[cm]?tsx?$/.test(entry.name)) {
45
+ return [];
46
+ }
47
+
48
+ return [absolutePath];
49
+ });
50
+ }
51
+
52
+ function readSource(root: string, excludeTests = false): string {
53
+ return listFiles(root, excludeTests)
54
+ .map((filePath) => readFileSync(filePath, 'utf8'))
55
+ .join('\n');
56
+ }
57
+
58
+ function isPathWithin(filePath: string, directoryPath: string): boolean {
59
+ return filePath === directoryPath || filePath.startsWith(`${directoryPath}/`);
60
+ }
61
+
62
+ const srcSource = readSource(SRC_ROOT, true); // exclude test files from stale-API scan
63
+ const examplesSource = readSource(EXAMPLES_ROOT);
64
+ const readmeSource = readFileSync(README_PATH, 'utf8');
65
+ const packageJsonSource = readFileSync(PACKAGE_JSON_PATH, 'utf8');
66
+
67
+ const allSource = [srcSource, examplesSource, readmeSource, packageJsonSource].join('\n');
68
+
69
+ describe('Plan 5 audit — no stale color-tone APIs', () => {
70
+ test('no ColorTone / colorTone / ZORA_COLOR_TONES / ZoraColorTone references', () => {
71
+ expect(allSource).not.toMatch(/ColorTone|colorTone|ZORA_COLOR_TONES|ZoraColorTone/);
72
+ });
73
+
74
+ test('no ZORA_COLOR_HARMONIES / ZoraColorHarmony references', () => {
75
+ expect(allSource).not.toMatch(/ZORA_COLOR_HARMONIES|ZoraColorHarmony/);
76
+ });
77
+
78
+ test('no ZoraHexColor references', () => {
79
+ expect(allSource).not.toMatch(/ZoraHexColor/);
80
+ });
81
+
82
+ test('no AnkhTheme references', () => {
83
+ expect(allSource).not.toMatch(/AnkhTheme/);
84
+ });
85
+
86
+ test('no direct culori imports', () => {
87
+ expect(allSource).not.toMatch(/from 'culori'|from "culori"/);
88
+ // also check package.json does not list culori as a direct dependency
89
+ // (it may appear in the source text via color-theory transitive deps, but
90
+ // ZORA must not import it directly)
91
+ const pkg = JSON.parse(packageJsonSource) as {
92
+ dependencies?: Record<string, string>;
93
+ devDependencies?: Record<string, string>;
94
+ };
95
+ expect(Object.keys(pkg.dependencies ?? {})).not.toContain('culori');
96
+ expect(Object.keys(pkg.devDependencies ?? {})).not.toContain('culori');
97
+ });
98
+
99
+ test('no ThemeComposerRecommendation / suggestedColorTone / hueDegreesToZoraHexColor / generatedColorRoles', () => {
100
+ expect(allSource).not.toMatch(
101
+ /ThemeComposerRecommendation|suggestedColorTone|hueDegreesToZoraHexColor|generatedColorRoles/,
102
+ );
103
+ });
104
+
105
+ test('no ColorMood / AppMood / APP_MOODS references', () => {
106
+ expect(allSource).not.toMatch(/ColorMood|colorMood|AppMood|appMood|APP_MOODS/);
107
+ });
108
+ });
109
+
110
+ describe('Plan 5 audit — no showcase bridge or direct Surface imports in examples', () => {
111
+ test('examples do not use a local zora bridge (./zora, ../zora, ../../zora)', () => {
112
+ expect(examplesSource).not.toMatch(/from ['"]\.\.?\/.*zora['"]/);
113
+ });
114
+
115
+ test('examples do not import from @ankhorage/surface directly', () => {
116
+ expect(examplesSource).not.toContain("from '@ankhorage/surface'");
117
+ expect(examplesSource).not.toContain('from "@ankhorage/surface"');
118
+ });
119
+ });
120
+
121
+ describe('Plan 5 audit — product-facing src imports ZORA foundation, not Surface directly', () => {
122
+ /**
123
+ * Components, layouts, and patterns that compose ZORA primitives should import
124
+ * foundation primitives from the local ZORA foundation layer, not directly
125
+ * from @ankhorage/surface.
126
+ *
127
+ * Foundation wrappers, theme infrastructure, internal recipes, and explicit
128
+ * Surface-wrapping boundary components are exempt.
129
+ */
130
+ const EXEMPT_PATHS = new Set([
131
+ // Foundation wrappers — they ARE the Surface abstraction layer.
132
+ join(SRC_ROOT, 'foundation'),
133
+ // Theme infrastructure legitimately integrates with Surface theme/runtime types.
134
+ join(SRC_ROOT, 'theme'),
135
+ // Internal recipes may consume SurfaceTheme types as the typed recipe boundary.
136
+ join(SRC_ROOT, 'internal'),
137
+ // Explicit Surface primitive wrappers.
138
+ join(SRC_ROOT, 'components', 'checkbox', 'Checkbox.tsx'),
139
+ join(SRC_ROOT, 'components', 'icon', 'Icon.tsx'),
140
+ join(SRC_ROOT, 'components', 'icon-button', 'IconButton.tsx'),
141
+ join(SRC_ROOT, 'components', 'modal', 'Modal.tsx'),
142
+ join(SRC_ROOT, 'components', 'textarea', 'Textarea.tsx'),
143
+ join(SRC_ROOT, 'components', 'text', 'Text.tsx'),
144
+ join(SRC_ROOT, 'components', 'form', 'FormField.tsx'),
145
+ join(SRC_ROOT, 'patterns', 'form-field', 'FormField.tsx'),
146
+ // Type-only imports that intentionally expose Surface-compatible prop specs.
147
+ join(SRC_ROOT, 'components', 'checkbox', 'types.ts'),
148
+ join(SRC_ROOT, 'components', 'form', 'types.ts'),
149
+ join(SRC_ROOT, 'components', 'icon-button', 'types.ts'),
150
+ join(SRC_ROOT, 'components', 'tabs', 'types.ts'),
151
+ join(SRC_ROOT, 'components', 'text', 'types.ts'),
152
+ join(SRC_ROOT, 'components', 'textarea', 'types.ts'),
153
+ join(SRC_ROOT, 'components', 'toolbar', 'types.ts'),
154
+ join(SRC_ROOT, 'patterns', 'form-field', 'types.ts'),
155
+ join(SRC_ROOT, 'patterns', 'tile-grid', 'types.ts'),
156
+ ]);
157
+
158
+ function isExempt(filePath: string): boolean {
159
+ for (const exemptPath of EXEMPT_PATHS) {
160
+ if (isPathWithin(filePath, exemptPath)) {
161
+ return true;
162
+ }
163
+ }
164
+
165
+ return false;
166
+ }
167
+
168
+ const PRODUCT_FACING_DIRS = [
169
+ join(SRC_ROOT, 'components'),
170
+ join(SRC_ROOT, 'layout'),
171
+ join(SRC_ROOT, 'patterns'),
172
+ ];
173
+
174
+ const FOUNDATION_PRIMITIVES_PATTERN =
175
+ /import \{[^}]*\b(Box|Stack|Center|Container|Grid|Inline|Spacer|Divider)\b[^}]*\} from '@ankhorage\/surface'/;
176
+
177
+ test('component, layout, and pattern files do not import foundation primitives directly from @ankhorage/surface', () => {
178
+ for (const dir of PRODUCT_FACING_DIRS) {
179
+ for (const filePath of listFiles(dir)) {
180
+ if (isExempt(filePath)) continue;
181
+
182
+ const source = readFileSync(filePath, 'utf8');
183
+ const match = FOUNDATION_PRIMITIVES_PATTERN.exec(source);
184
+
185
+ expect(
186
+ match,
187
+ `${filePath} imports Surface foundation primitive '${match?.[1]}' directly. ` +
188
+ `Use the ZORA foundation import ('../../foundation') instead.`,
189
+ ).toBeNull();
190
+ }
191
+ }
192
+ });
193
+ });
194
+
195
+ describe('Plan 5 audit — no hard-coded runtime colors', () => {
196
+ const RUNTIME_COLOR_LITERAL_PATTERN = /#[0-9A-Fa-f]{3,8}|rgba?\(|hsla?\(/;
197
+ const EXEMPT_COLOR_LITERAL_FILES = new Set([
198
+ // This is source-theme data, not component chrome. Plan 5 explicitly allows theme seed literals.
199
+ join(SRC_ROOT, 'theme', 'zoraDefaultTheme.ts'),
200
+ ]);
201
+
202
+ test('non-test src files do not contain raw runtime color literals', () => {
203
+ for (const filePath of listFiles(SRC_ROOT, true)) {
204
+ if (EXEMPT_COLOR_LITERAL_FILES.has(filePath)) continue;
205
+
206
+ const source = readFileSync(filePath, 'utf8');
207
+ const match = RUNTIME_COLOR_LITERAL_PATTERN.exec(source);
208
+
209
+ expect(
210
+ match,
211
+ `${filePath} contains raw runtime color literal '${match?.[0]}'. ` +
212
+ 'Use a theme token, recipe, or explicit documented exemption instead.',
213
+ ).toBeNull();
214
+ }
215
+ });
216
+ });
217
+
218
+ describe('Plan 5 audit — public exports carry no legacy types', () => {
219
+ test('src/index.ts does not export ZoraHexColor', () => {
220
+ const indexSource = readFileSync(join(SRC_ROOT, 'index.ts'), 'utf8');
221
+
222
+ expect(indexSource).not.toContain('ZoraHexColor');
223
+ });
224
+
225
+ test('src/index.ts does not export ZoraColorTone or ZORA_COLOR_TONES', () => {
226
+ const indexSource = readFileSync(join(SRC_ROOT, 'index.ts'), 'utf8');
227
+
228
+ expect(indexSource).not.toMatch(/ZoraColorTone|ZORA_COLOR_TONES/);
229
+ });
230
+
231
+ test('src/index.ts does not export ZoraColorHarmony or ZORA_COLOR_HARMONIES', () => {
232
+ const indexSource = readFileSync(join(SRC_ROOT, 'index.ts'), 'utf8');
233
+
234
+ expect(indexSource).not.toMatch(/ZoraColorHarmony|ZORA_COLOR_HARMONIES/);
235
+ });
236
+
237
+ test('src/index.ts does not export AnkhTheme', () => {
238
+ const indexSource = readFileSync(join(SRC_ROOT, 'index.ts'), 'utf8');
239
+
240
+ expect(indexSource).not.toContain('AnkhTheme');
241
+ });
242
+ });
@@ -1,6 +1,7 @@
1
- import { Box, Card as SurfaceCard, Stack } from '@ankhorage/surface';
1
+ import { Card as SurfaceCard } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
 
4
+ import { Box, Stack } from '../../foundation';
4
5
  import { resolveCardVariant } from '../../internal/recipes';
5
6
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
7
  import { Heading } from '../heading';
@@ -1,7 +1,8 @@
1
- import { Checkbox, Stack } from '@ankhorage/surface';
1
+ import { Checkbox } from '@ankhorage/surface';
2
2
  import React from 'react';
3
3
  import { View } from 'react-native';
4
4
 
5
+ import { Stack } from '../../foundation';
5
6
  import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
6
7
  import { Text } from '../text';
7
8
  import type { CheckboxGroupOption, CheckboxGroupProps } from './types';