@ankhorage/zora 1.0.0 → 1.0.2
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.
- package/CHANGELOG.md +34 -0
- package/README.md +16 -9
- package/dist/components/card/Card.d.ts.map +1 -1
- package/dist/components/card/Card.js +2 -1
- package/dist/components/card/Card.js.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.d.ts.map +1 -1
- package/dist/components/checkbox/CheckboxGroup.js +2 -1
- package/dist/components/checkbox/CheckboxGroup.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts.map +1 -1
- package/dist/components/drawer/Drawer.js +2 -1
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/Form.js +1 -1
- package/dist/components/form/Form.js.map +1 -1
- package/dist/components/form/FormActions.d.ts.map +1 -1
- package/dist/components/form/FormActions.js +1 -1
- package/dist/components/form/FormActions.js.map +1 -1
- package/dist/components/form/FormError.d.ts.map +1 -1
- package/dist/components/form/FormError.js +1 -1
- package/dist/components/form/FormError.js.map +1 -1
- package/dist/components/form/FormField.d.ts.map +1 -1
- package/dist/components/form/FormField.js +2 -1
- package/dist/components/form/FormField.js.map +1 -1
- package/dist/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/modal/Modal.js +2 -1
- package/dist/components/modal/Modal.js.map +1 -1
- package/dist/components/radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/radio/RadioGroup.js +2 -1
- package/dist/components/radio/RadioGroup.js.map +1 -1
- package/dist/components/select/Select.d.ts.map +1 -1
- package/dist/components/select/Select.js +1 -1
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/tabs/Tabs.d.ts.map +1 -1
- package/dist/components/tabs/Tabs.js +1 -1
- package/dist/components/tabs/Tabs.js.map +1 -1
- package/dist/components/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/components/toolbar/Toolbar.js +1 -1
- package/dist/components/toolbar/Toolbar.js.map +1 -1
- package/dist/layout/app-shell/AppShell.d.ts.map +1 -1
- package/dist/layout/app-shell/AppShell.js +1 -1
- package/dist/layout/app-shell/AppShell.js.map +1 -1
- package/dist/layout/auth-layout/AuthLayout.d.ts.map +1 -1
- package/dist/layout/auth-layout/AuthLayout.js +1 -1
- package/dist/layout/auth-layout/AuthLayout.js.map +1 -1
- package/dist/layout/page/Page.d.ts.map +1 -1
- package/dist/layout/page/Page.js +1 -1
- package/dist/layout/page/Page.js.map +1 -1
- package/dist/layout/page-header/PageHeader.d.ts.map +1 -1
- package/dist/layout/page-header/PageHeader.js +1 -1
- package/dist/layout/page-header/PageHeader.js.map +1 -1
- package/dist/layout/page-section/PageSection.d.ts.map +1 -1
- package/dist/layout/page-section/PageSection.js +1 -1
- package/dist/layout/page-section/PageSection.js.map +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.d.ts.map +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.js +1 -1
- package/dist/layout/sidebar-layout/SidebarLayout.js.map +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.d.ts.map +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.js +1 -1
- package/dist/layout/topbar-layout/TopbarLayout.js.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.d.ts.map +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.js +1 -1
- package/dist/patterns/auth/ForgotPasswordForm.js.map +1 -1
- package/dist/patterns/auth/OtpForm.d.ts.map +1 -1
- package/dist/patterns/auth/OtpForm.js +1 -1
- package/dist/patterns/auth/OtpForm.js.map +1 -1
- package/dist/patterns/auth/SignInForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignInForm.js +1 -1
- package/dist/patterns/auth/SignInForm.js.map +1 -1
- package/dist/patterns/auth/SignUpForm.d.ts.map +1 -1
- package/dist/patterns/auth/SignUpForm.js +1 -1
- package/dist/patterns/auth/SignUpForm.js.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.d.ts.map +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.js +1 -1
- package/dist/patterns/collection-editor/CollectionEditor.js.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.d.ts.map +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js +1 -1
- package/dist/patterns/confirm-dialog/ConfirmDialog.js.map +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.d.ts.map +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js +1 -1
- package/dist/patterns/disclosure-section/DisclosureSection.js.map +1 -1
- package/dist/patterns/empty-state/EmptyState.d.ts.map +1 -1
- package/dist/patterns/empty-state/EmptyState.js +1 -1
- package/dist/patterns/empty-state/EmptyState.js.map +1 -1
- package/dist/patterns/form-field/FormField.d.ts.map +1 -1
- package/dist/patterns/form-field/FormField.js +2 -1
- package/dist/patterns/form-field/FormField.js.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.d.ts.map +1 -1
- package/dist/patterns/inspector-field/InspectorField.js +1 -1
- package/dist/patterns/inspector-field/InspectorField.js.map +1 -1
- package/dist/patterns/notice/Notice.d.ts.map +1 -1
- package/dist/patterns/notice/Notice.js +1 -1
- package/dist/patterns/notice/Notice.js.map +1 -1
- package/dist/patterns/section-header/SectionHeader.d.ts.map +1 -1
- package/dist/patterns/section-header/SectionHeader.js +1 -1
- package/dist/patterns/section-header/SectionHeader.js.map +1 -1
- package/dist/patterns/settings-row/SettingsRow.d.ts.map +1 -1
- package/dist/patterns/settings-row/SettingsRow.js +1 -1
- package/dist/patterns/settings-row/SettingsRow.js.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.d.ts.map +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js +98 -6
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/patterns/theme-composer/types.d.ts +2 -0
- package/dist/patterns/theme-composer/types.d.ts.map +1 -1
- package/dist/patterns/theme-composer/types.js.map +1 -1
- package/dist/patterns/tile-grid/PaletteItem.d.ts.map +1 -1
- package/dist/patterns/tile-grid/PaletteItem.js +1 -1
- package/dist/patterns/tile-grid/PaletteItem.js.map +1 -1
- package/dist/patterns/tile-grid/TileGrid.d.ts.map +1 -1
- package/dist/patterns/tile-grid/TileGrid.js +1 -1
- package/dist/patterns/tile-grid/TileGrid.js.map +1 -1
- package/dist/patterns/tree-view/TreeItem.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeItem.js +1 -1
- package/dist/patterns/tree-view/TreeItem.js.map +1 -1
- package/dist/patterns/tree-view/TreeView.d.ts.map +1 -1
- package/dist/patterns/tree-view/TreeView.js +1 -1
- package/dist/patterns/tree-view/TreeView.js.map +1 -1
- package/package.json +1 -1
- package/src/audit.test.ts +242 -0
- package/src/components/card/Card.tsx +2 -1
- package/src/components/checkbox/CheckboxGroup.tsx +2 -1
- package/src/components/drawer/Drawer.tsx +2 -1
- package/src/components/form/Form.tsx +1 -1
- package/src/components/form/FormActions.tsx +1 -1
- package/src/components/form/FormError.tsx +1 -1
- package/src/components/form/FormField.tsx +2 -1
- package/src/components/modal/Modal.tsx +2 -1
- package/src/components/radio/RadioGroup.tsx +2 -1
- package/src/components/select/Select.tsx +1 -1
- package/src/components/tabs/Tabs.tsx +1 -1
- package/src/components/toolbar/Toolbar.tsx +1 -1
- package/src/layout/app-shell/AppShell.tsx +1 -1
- package/src/layout/auth-layout/AuthLayout.tsx +1 -1
- package/src/layout/page/Page.tsx +1 -1
- package/src/layout/page-header/PageHeader.tsx +1 -1
- package/src/layout/page-section/PageSection.tsx +1 -1
- package/src/layout/sidebar-layout/SidebarLayout.tsx +1 -1
- package/src/layout/topbar-layout/TopbarLayout.tsx +1 -1
- package/src/patterns/auth/ForgotPasswordForm.tsx +1 -1
- package/src/patterns/auth/OtpForm.tsx +1 -1
- package/src/patterns/auth/SignInForm.tsx +1 -1
- package/src/patterns/auth/SignUpForm.tsx +1 -1
- package/src/patterns/collection-editor/CollectionEditor.tsx +1 -1
- package/src/patterns/confirm-dialog/ConfirmDialog.tsx +1 -1
- package/src/patterns/disclosure-section/DisclosureSection.tsx +1 -1
- package/src/patterns/empty-state/EmptyState.tsx +1 -1
- package/src/patterns/form-field/FormField.tsx +2 -1
- package/src/patterns/inspector-field/InspectorField.tsx +1 -1
- package/src/patterns/notice/Notice.tsx +1 -1
- package/src/patterns/section-header/SectionHeader.tsx +1 -1
- package/src/patterns/settings-row/SettingsRow.tsx +1 -1
- package/src/patterns/theme-composer/ThemeComposer.test.ts +148 -2
- package/src/patterns/theme-composer/ThemeComposer.tsx +129 -5
- package/src/patterns/theme-composer/types.ts +3 -0
- package/src/patterns/tile-grid/PaletteItem.tsx +1 -1
- package/src/patterns/tile-grid/TileGrid.tsx +1 -1
- package/src/patterns/tree-view/TreeItem.tsx +1 -1
- package/src/patterns/tree-view/TreeView.tsx +1 -1
|
@@ -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 {
|
|
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
|
|
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';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Drawer as SurfaceDrawer } from '@ankhorage/surface';
|
|
2
2
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
+
import { Box, Stack } from '../../foundation';
|
|
4
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { Heading } from '../heading';
|
|
6
7
|
import { Text } from '../text';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box, Stack } from '../../foundation';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { FormActions } from './FormActions';
|
|
6
6
|
import { FormError } from './FormError';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box, Stack } from '../../foundation';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { Button } from '../button';
|
|
6
6
|
import type { FormActionsProps } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box } from '../../foundation';
|
|
4
4
|
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import { Text } from '../text';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Field
|
|
1
|
+
import { Field } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
+
import { Stack } from '../../foundation';
|
|
4
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
6
|
import { Input } from '../input';
|
|
6
7
|
import { Text } from '../text';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Modal as SurfaceModal } from '@ankhorage/surface';
|
|
2
2
|
import React, { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
|
+
import { Box, Stack } from '../../foundation';
|
|
4
5
|
import { resolveDialogWidth } from '../../internal/recipes';
|
|
5
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
7
|
import { Heading } from '../heading';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Radio
|
|
1
|
+
import { Radio } 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 { RadioGroupOption, RadioGroupProps } from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Box } from '@ankhorage/surface';
|
|
2
1
|
import { Picker } from '@react-native-picker/picker';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
|
|
4
|
+
import { Box } from '../../foundation';
|
|
5
5
|
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { SelectProps } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box, Stack } from '../../foundation';
|
|
4
4
|
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import { Button } from '../button';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Stack } from '../../foundation';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { Card } from '../card';
|
|
6
6
|
import type { ToolbarProps } from './types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Box } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { StyleSheet, View } from 'react-native';
|
|
4
3
|
|
|
4
|
+
import { Box } from '../../foundation';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import type { AppShellProps } from './types';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Center, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Card } from '../../components/card';
|
|
4
|
+
import { Center, Stack } from '../../foundation';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import type { AuthLayoutProps } from './types';
|
|
7
7
|
|
package/src/layout/page/Page.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Container, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Container, Stack } from '../../foundation';
|
|
4
4
|
import { resolvePageMaxWidth } from '../../internal/recipes';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import type { PageProps } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Heading } from '../../components/heading';
|
|
5
4
|
import { Text } from '../../components/text';
|
|
5
|
+
import { Box, Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { PageHeaderProps } from './types';
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Stack } from '../../foundation';
|
|
4
4
|
import { SectionHeader } from '../../patterns/section-header';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import type { PageSectionProps } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box, Stack } from '../../foundation';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { SidebarLayout } from '../sidebar-layout';
|
|
6
6
|
import type { TopbarLayoutProps } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Form, type FormFieldConfig, type FormValues } from '../../components/form';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { ForgotPasswordFormProps } from './types';
|
|
8
8
|
import {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Form, type FormFieldConfig, type FormValues } from '../../components/form';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { OtpFormProps } from './types';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Form, type FormFieldConfig, type FormValues } from '../../components/form';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { SignInFormProps } from './types';
|
|
8
8
|
import {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Form, type FormFieldConfig, type FormValues } from '../../components/form';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { SignUpFormProps } from './types';
|
|
8
8
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { IconButton } from '../../components/icon-button';
|
|
6
5
|
import { Text } from '../../components/text';
|
|
6
|
+
import { Box, Stack } from '../../foundation';
|
|
7
7
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
8
|
import { Panel } from '../panel';
|
|
9
9
|
import type { CollectionEditorProps } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Modal } from '../../components/modal';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { ConfirmDialogProps } from './types';
|
|
8
8
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { IconButton } from '../../components/icon-button';
|
|
4
|
+
import { Box, Stack } from '../../foundation';
|
|
5
5
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
6
|
import { Panel } from '../panel';
|
|
7
7
|
import type { DisclosureSectionProps } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Button } from '../../components/button';
|
|
5
4
|
import { Card } from '../../components/card';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { EmptyStateProps } from './types';
|
|
8
8
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Field
|
|
1
|
+
import { Field } from '@ankhorage/surface';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
4
|
import { Text } from '../../components/text';
|
|
5
|
+
import { Stack } from '../../foundation';
|
|
5
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
7
|
import type { FormFieldProps } from './types';
|
|
7
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
3
|
+
import { Box, Stack } from '../../foundation';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { FormField } from '../form-field';
|
|
6
6
|
import type { InspectorFieldProps } from './types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Badge } from '../../components/badge';
|
|
5
4
|
import { Card } from '../../components/card';
|
|
5
|
+
import { Box, Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { NoticeProps } from './types';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box, Stack } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Heading } from '../../components/heading';
|
|
5
4
|
import { Text } from '../../components/text';
|
|
5
|
+
import { Box, Stack } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { SectionHeaderProps } from './types';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Box } from '@ankhorage/surface';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
|
|
4
3
|
import { Card } from '../../components/card';
|
|
5
4
|
import { Text } from '../../components/text';
|
|
5
|
+
import { Box } from '../../foundation';
|
|
6
6
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
7
|
import type { SettingsRowProps } from './types';
|
|
8
8
|
|