@ankhorage/zora 5.0.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +14 -10
- package/dist/components/button/resolveButtonThemeRecipe.d.ts +1 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +92 -86
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/meta.d.ts +1 -1
- package/dist/components/date-picker/meta.js +1 -1
- package/dist/components/date-picker/meta.js.map +1 -1
- package/dist/components/heading/resolveHeadingThemeRecipe.d.ts +1 -1
- package/dist/components/image/Image.d.ts +1 -5
- package/dist/components/image/Image.d.ts.map +1 -1
- package/dist/components/image/Image.js +79 -8
- package/dist/components/image/Image.js.map +1 -1
- package/dist/components/image/types.d.ts +4 -2
- package/dist/components/image/types.d.ts.map +1 -1
- package/dist/components/image/types.js.map +1 -1
- package/dist/components/text/resolveTextThemeRecipe.d.ts +1 -1
- package/dist/components/time-picker/TimePicker.d.ts +1 -3
- package/dist/components/time-picker/TimePicker.d.ts.map +1 -1
- package/dist/components/time-picker/TimePicker.js +55 -32
- package/dist/components/time-picker/TimePicker.js.map +1 -1
- package/dist/components/time-picker/meta.d.ts +1 -1
- package/dist/components/time-picker/meta.js +1 -1
- package/dist/components/time-picker/meta.js.map +1 -1
- package/dist/features/bottom-sheet/public.d.ts +3 -0
- package/dist/features/bottom-sheet/public.d.ts.map +1 -0
- package/dist/features/bottom-sheet/public.js +2 -0
- package/dist/features/bottom-sheet/public.js.map +1 -0
- package/dist/features/uploader/adapters/inbound/Uploader.d.ts +5 -0
- package/dist/features/uploader/adapters/inbound/Uploader.d.ts.map +1 -0
- package/dist/features/uploader/adapters/inbound/Uploader.js +274 -0
- package/dist/features/uploader/adapters/inbound/Uploader.js.map +1 -0
- package/dist/features/uploader/adapters/outbound/pickDocumentOrFileAsync.d.ts +5 -0
- package/dist/features/uploader/adapters/outbound/pickDocumentOrFileAsync.d.ts.map +1 -0
- package/dist/features/uploader/adapters/outbound/pickDocumentOrFileAsync.js +38 -0
- package/dist/features/uploader/adapters/outbound/pickDocumentOrFileAsync.js.map +1 -0
- package/dist/features/uploader/adapters/outbound/pickImageOrVideoAsync.d.ts +5 -0
- package/dist/features/uploader/adapters/outbound/pickImageOrVideoAsync.d.ts.map +1 -0
- package/dist/features/uploader/adapters/outbound/pickImageOrVideoAsync.js +24 -0
- package/dist/features/uploader/adapters/outbound/pickImageOrVideoAsync.js.map +1 -0
- package/dist/features/uploader/application/ports/outbound/UploadPickerPort.d.ts +9 -0
- package/dist/features/uploader/application/ports/outbound/UploadPickerPort.d.ts.map +1 -0
- package/dist/features/uploader/application/ports/outbound/UploadPickerPort.js +2 -0
- package/dist/features/uploader/application/ports/outbound/UploadPickerPort.js.map +1 -0
- package/dist/features/uploader/application/use-cases/pickUploadAssetAsync.d.ts +5 -0
- package/dist/features/uploader/application/use-cases/pickUploadAssetAsync.d.ts.map +1 -0
- package/dist/features/uploader/application/use-cases/pickUploadAssetAsync.js +6 -0
- package/dist/features/uploader/application/use-cases/pickUploadAssetAsync.js.map +1 -0
- package/dist/features/uploader/application/use-cases/validateUploadAsset.d.ts +4 -0
- package/dist/features/uploader/application/use-cases/validateUploadAsset.d.ts.map +1 -0
- package/dist/features/uploader/application/use-cases/validateUploadAsset.js +77 -0
- package/dist/features/uploader/application/use-cases/validateUploadAsset.js.map +1 -0
- package/dist/features/uploader/composition/createUploadPicker.d.ts +4 -0
- package/dist/features/uploader/composition/createUploadPicker.d.ts.map +1 -0
- package/dist/features/uploader/composition/createUploadPicker.js +12 -0
- package/dist/features/uploader/composition/createUploadPicker.js.map +1 -0
- package/dist/features/uploader/meta.d.ts +10 -0
- package/dist/features/uploader/meta.d.ts.map +1 -0
- package/dist/features/uploader/meta.js +10 -0
- package/dist/features/uploader/meta.js.map +1 -0
- package/dist/features/uploader/public.d.ts +4 -0
- package/dist/features/uploader/public.d.ts.map +1 -0
- package/dist/features/uploader/public.js +3 -0
- package/dist/features/uploader/public.js.map +1 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -3
- package/dist/index.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +2 -7
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +2 -7
- package/dist/registry.js.map +1 -1
- package/dist/theme/ZoraProvider.d.ts +1 -1
- package/dist/theme/ZoraProvider.d.ts.map +1 -1
- package/dist/theme/ZoraProvider.js +3 -2
- package/dist/theme/ZoraProvider.js.map +1 -1
- package/dist/theme/useZoraTheme.d.ts +1 -1
- package/dist/types/upload.d.ts +53 -0
- package/dist/types/upload.d.ts.map +1 -0
- package/dist/types/upload.js +2 -0
- package/dist/types/upload.js.map +1 -0
- package/package.json +25 -3
- package/src/components/date-picker/DatePicker.tsx +197 -129
- package/src/components/date-picker/meta.ts +1 -1
- package/src/components/image/Image.tsx +136 -8
- package/src/components/image/types.ts +6 -2
- package/src/components/time-picker/TimePicker.tsx +147 -60
- package/src/components/time-picker/meta.ts +1 -1
- package/src/expo57Migration.test.ts +56 -0
- package/src/features/bottom-sheet/public.test.ts +39 -0
- package/src/features/bottom-sheet/public.ts +5 -0
- package/src/features/uploader/adapters/inbound/Uploader.tsx +403 -0
- package/src/features/uploader/adapters/outbound/pickDocumentOrFileAsync.ts +50 -0
- package/src/features/uploader/adapters/outbound/pickImageOrVideoAsync.ts +30 -0
- package/src/features/uploader/application/ports/outbound/UploadPickerPort.ts +10 -0
- package/src/features/uploader/application/use-cases/pickUploadAssetAsync.test.ts +48 -0
- package/src/features/uploader/application/use-cases/pickUploadAssetAsync.ts +14 -0
- package/src/features/uploader/application/use-cases/validateUploadAsset.test.ts +51 -0
- package/src/features/uploader/application/use-cases/validateUploadAsset.ts +111 -0
- package/src/features/uploader/composition/createUploadPicker.ts +14 -0
- package/src/features/uploader/meta.ts +11 -0
- package/src/features/uploader/public.test.ts +34 -0
- package/src/features/uploader/public.ts +10 -0
- package/src/index.ts +9 -14
- package/src/metadata/componentMeta.ts +2 -7
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.test.ts +1 -1
- package/src/registry.ts +2 -7
- package/src/showcaseCoverage.test.ts +1 -2
- package/src/theme/ZoraProvider.tsx +3 -2
- package/src/types/upload.ts +62 -0
- package/dist/components/action-sheet/ActionSheet.d.ts +0 -7
- package/dist/components/action-sheet/ActionSheet.d.ts.map +0 -1
- package/dist/components/action-sheet/ActionSheet.js +0 -11
- package/dist/components/action-sheet/ActionSheet.js.map +0 -1
- package/dist/components/action-sheet/ActionSheetItem.d.ts +0 -7
- package/dist/components/action-sheet/ActionSheetItem.d.ts.map +0 -1
- package/dist/components/action-sheet/ActionSheetItem.js +0 -17
- package/dist/components/action-sheet/ActionSheetItem.js.map +0 -1
- package/dist/components/action-sheet/index.d.ts +0 -4
- package/dist/components/action-sheet/index.d.ts.map +0 -1
- package/dist/components/action-sheet/index.js +0 -3
- package/dist/components/action-sheet/index.js.map +0 -1
- package/dist/components/action-sheet/meta.d.ts +0 -17
- package/dist/components/action-sheet/meta.d.ts.map +0 -1
- package/dist/components/action-sheet/meta.js +0 -17
- package/dist/components/action-sheet/meta.js.map +0 -1
- package/dist/components/action-sheet/types.d.ts +0 -13
- package/dist/components/action-sheet/types.d.ts.map +0 -1
- package/dist/components/action-sheet/types.js +0 -2
- package/dist/components/action-sheet/types.js.map +0 -1
- package/dist/patterns/image-preview/ImagePreview.d.ts +0 -9
- package/dist/patterns/image-preview/ImagePreview.d.ts.map +0 -1
- package/dist/patterns/image-preview/ImagePreview.js +0 -46
- package/dist/patterns/image-preview/ImagePreview.js.map +0 -1
- package/dist/patterns/image-preview/index.d.ts +0 -3
- package/dist/patterns/image-preview/index.d.ts.map +0 -1
- package/dist/patterns/image-preview/index.js +0 -2
- package/dist/patterns/image-preview/index.js.map +0 -1
- package/dist/patterns/image-preview/meta.d.ts +0 -9
- package/dist/patterns/image-preview/meta.d.ts.map +0 -1
- package/dist/patterns/image-preview/meta.js +0 -9
- package/dist/patterns/image-preview/meta.js.map +0 -1
- package/dist/patterns/image-preview/types.d.ts +0 -36
- package/dist/patterns/image-preview/types.d.ts.map +0 -1
- package/dist/patterns/image-preview/types.js +0 -2
- package/dist/patterns/image-preview/types.js.map +0 -1
- package/dist/patterns/image-upload-field/ImageUploadField.d.ts +0 -9
- package/dist/patterns/image-upload-field/ImageUploadField.d.ts.map +0 -1
- package/dist/patterns/image-upload-field/ImageUploadField.js +0 -222
- package/dist/patterns/image-upload-field/ImageUploadField.js.map +0 -1
- package/dist/patterns/image-upload-field/index.d.ts +0 -3
- package/dist/patterns/image-upload-field/index.d.ts.map +0 -1
- package/dist/patterns/image-upload-field/index.js +0 -2
- package/dist/patterns/image-upload-field/index.js.map +0 -1
- package/dist/patterns/image-upload-field/meta.d.ts +0 -9
- package/dist/patterns/image-upload-field/meta.d.ts.map +0 -1
- package/dist/patterns/image-upload-field/meta.js +0 -9
- package/dist/patterns/image-upload-field/meta.js.map +0 -1
- package/dist/patterns/image-upload-field/types.d.ts +0 -35
- package/dist/patterns/image-upload-field/types.d.ts.map +0 -1
- package/dist/patterns/image-upload-field/types.js +0 -2
- package/dist/patterns/image-upload-field/types.js.map +0 -1
- package/dist/patterns/image-upload-field/uploadFlow.d.ts +0 -18
- package/dist/patterns/image-upload-field/uploadFlow.d.ts.map +0 -1
- package/dist/patterns/image-upload-field/uploadFlow.js +0 -106
- package/dist/patterns/image-upload-field/uploadFlow.js.map +0 -1
- package/src/components/action-sheet/ActionSheet.tsx +0 -14
- package/src/components/action-sheet/ActionSheetItem.tsx +0 -30
- package/src/components/action-sheet/index.ts +0 -3
- package/src/components/action-sheet/meta.ts +0 -19
- package/src/components/action-sheet/types.ts +0 -23
- package/src/patterns/image-preview/ImagePreview.tsx +0 -82
- package/src/patterns/image-preview/index.ts +0 -2
- package/src/patterns/image-preview/meta.ts +0 -10
- package/src/patterns/image-preview/types.ts +0 -41
- package/src/patterns/image-upload-field/ImageUploadField.tsx +0 -319
- package/src/patterns/image-upload-field/index.ts +0 -2
- package/src/patterns/image-upload-field/meta.ts +0 -10
- package/src/patterns/image-upload-field/types.ts +0 -41
- package/src/patterns/image-upload-field/uploadFlow.test.ts +0 -117
- package/src/patterns/image-upload-field/uploadFlow.ts +0 -145
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { ValidateUploadAssetInput } from '../../../../types/upload';
|
|
2
|
+
|
|
3
|
+
/*** Validates a picked upload asset against MIME, extension, size, and caller rules. */
|
|
4
|
+
export function validateUploadAsset({
|
|
5
|
+
asset,
|
|
6
|
+
accept,
|
|
7
|
+
maxSizeBytes,
|
|
8
|
+
validate,
|
|
9
|
+
}: ValidateUploadAssetInput): string | undefined {
|
|
10
|
+
if (!isAccepted(asset.contentType, asset.fileName, accept)) {
|
|
11
|
+
return accept ? `File type not accepted. Expected ${accept}.` : 'File type not accepted.';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (
|
|
15
|
+
maxSizeBytes !== undefined &&
|
|
16
|
+
Number.isFinite(maxSizeBytes) &&
|
|
17
|
+
maxSizeBytes > 0 &&
|
|
18
|
+
asset.sizeBytes !== undefined &&
|
|
19
|
+
Number.isFinite(asset.sizeBytes) &&
|
|
20
|
+
asset.sizeBytes > maxSizeBytes
|
|
21
|
+
) {
|
|
22
|
+
return `File is too large (${formatBytes(asset.sizeBytes)}). Max ${formatBytes(maxSizeBytes)}.`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return validate?.(asset);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/*** Returns whether available file metadata satisfies at least one accept token. */
|
|
29
|
+
function isAccepted(
|
|
30
|
+
contentType: string | undefined,
|
|
31
|
+
fileName: string | undefined,
|
|
32
|
+
accept: string | undefined,
|
|
33
|
+
): boolean {
|
|
34
|
+
const tokens = parseAccept(accept);
|
|
35
|
+
if (tokens.length === 0) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let hadSignal = false;
|
|
40
|
+
|
|
41
|
+
for (const token of tokens) {
|
|
42
|
+
const matches = matchesAcceptToken(token, contentType, fileName);
|
|
43
|
+
if (matches === null) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
hadSignal = true;
|
|
48
|
+
if (matches) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return !hadSignal;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/*** Matches one MIME or extension accept token against available file metadata. */
|
|
57
|
+
function matchesAcceptToken(
|
|
58
|
+
token: string,
|
|
59
|
+
contentType: string | undefined,
|
|
60
|
+
fileName: string | undefined,
|
|
61
|
+
): boolean | null {
|
|
62
|
+
const normalizedToken = token.toLowerCase();
|
|
63
|
+
const normalizedContentType = contentType?.toLowerCase();
|
|
64
|
+
const normalizedFileName = fileName?.toLowerCase();
|
|
65
|
+
|
|
66
|
+
if (normalizedToken.startsWith('.')) {
|
|
67
|
+
return normalizedFileName ? normalizedFileName.endsWith(normalizedToken) : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (normalizedToken.endsWith('/*')) {
|
|
71
|
+
if (!normalizedContentType) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return normalizedContentType.startsWith(normalizedToken.slice(0, -1));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return normalizedContentType ? normalizedContentType === normalizedToken : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/*** Parses a browser-style accept string into normalized non-empty tokens. */
|
|
82
|
+
function parseAccept(accept: string | undefined): readonly string[] {
|
|
83
|
+
if (!accept) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return accept
|
|
88
|
+
.split(',')
|
|
89
|
+
.map((token) => token.trim())
|
|
90
|
+
.filter((token) => token.length > 0);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/*** Formats a byte count for concise upload validation feedback. */
|
|
94
|
+
function formatBytes(value: number): string {
|
|
95
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
96
|
+
return '0 B';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const units = ['B', 'KB', 'MB', 'GB'] as const;
|
|
100
|
+
let size = value;
|
|
101
|
+
let unitIndex = 0;
|
|
102
|
+
|
|
103
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
104
|
+
size /= 1024;
|
|
105
|
+
unitIndex += 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const unit = units.at(unitIndex) ?? 'B';
|
|
109
|
+
const rounded = unitIndex === 0 ? Math.round(size) : Math.round(size * 10) / 10;
|
|
110
|
+
return `${rounded} ${unit}`;
|
|
111
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { pickDocumentOrFileAsync } from '../adapters/outbound/pickDocumentOrFileAsync';
|
|
2
|
+
import { pickImageOrVideoAsync } from '../adapters/outbound/pickImageOrVideoAsync';
|
|
3
|
+
import type { UploadPickerPort } from '../application/ports/outbound/UploadPickerPort';
|
|
4
|
+
import { pickUploadAssetAsync } from '../application/use-cases/pickUploadAssetAsync';
|
|
5
|
+
|
|
6
|
+
/*** Wires the Expo picker adapters into the generic upload picker use case. */
|
|
7
|
+
export function createUploadPicker(): UploadPickerPort {
|
|
8
|
+
const imageOrVideoPicker: UploadPickerPort = { pickAsync: pickImageOrVideoAsync };
|
|
9
|
+
const documentOrFilePicker: UploadPickerPort = { pickAsync: pickDocumentOrFileAsync };
|
|
10
|
+
|
|
11
|
+
return {
|
|
12
|
+
pickAsync: (input) => pickUploadAssetAsync(input, imageOrVideoPicker, documentOrFilePicker),
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
+
|
|
3
|
+
export const uploaderMeta = {
|
|
4
|
+
name: 'Uploader',
|
|
5
|
+
category: 'pattern',
|
|
6
|
+
description: 'Picks and manages one image, video, document, or generic file upload.',
|
|
7
|
+
directManifestNode: false,
|
|
8
|
+
allowedChildren: [],
|
|
9
|
+
note: 'Upload transport callbacks remain runtime-owned and are not serialized into AppManifest.',
|
|
10
|
+
props: {},
|
|
11
|
+
} as const satisfies ZoraComponentMeta;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { describe, expect, test } from 'bun:test';
|
|
2
|
+
|
|
3
|
+
describe('ZORA Uploader public contract', () => {
|
|
4
|
+
test('publishes the generic uploader through root and explicit subpath APIs', async () => {
|
|
5
|
+
const packageJson = (await Bun.file('package.json').json()) as {
|
|
6
|
+
dependencies: Readonly<Record<string, string>>;
|
|
7
|
+
exports: Readonly<Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
const [rootSource, publicSource] = await Promise.all([
|
|
10
|
+
Bun.file('src/index.ts').text(),
|
|
11
|
+
Bun.file('src/features/uploader/public.ts').text(),
|
|
12
|
+
]);
|
|
13
|
+
|
|
14
|
+
expect(packageJson.exports['./uploader']).toBeDefined();
|
|
15
|
+
expect(packageJson.dependencies['expo-image-picker']).toMatch(/^~57\./u);
|
|
16
|
+
expect(packageJson.dependencies['expo-document-picker']).toMatch(/^~57\./u);
|
|
17
|
+
expect(rootSource).toContain("from './features/uploader/public'");
|
|
18
|
+
expect(publicSource).toContain('export { Uploader }');
|
|
19
|
+
expect(publicSource).toContain('export { validateUploadAsset }');
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
test('removes the superseded image preview and upload field APIs', async () => {
|
|
23
|
+
const [rootSource, registrySource, metadataSource] = await Promise.all([
|
|
24
|
+
Bun.file('src/index.ts').text(),
|
|
25
|
+
Bun.file('src/registry.ts').text(),
|
|
26
|
+
Bun.file('src/metadata/componentMeta.ts').text(),
|
|
27
|
+
]);
|
|
28
|
+
const publicSurface = `${rootSource}\n${registrySource}\n${metadataSource}`;
|
|
29
|
+
|
|
30
|
+
expect(publicSurface).not.toContain('ImagePreview');
|
|
31
|
+
expect(publicSurface).not.toContain('ImageUploadField');
|
|
32
|
+
expect(publicSurface).toContain('Uploader');
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
UploadAsset,
|
|
3
|
+
UploadAssetBase,
|
|
4
|
+
UploaderProps,
|
|
5
|
+
UploadProgressContext,
|
|
6
|
+
UploadType,
|
|
7
|
+
ValidateUploadAssetInput,
|
|
8
|
+
} from '../../types/upload';
|
|
9
|
+
export { Uploader } from './adapters/inbound/Uploader';
|
|
10
|
+
export { validateUploadAsset } from './application/use-cases/validateUploadAsset';
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export type { ActionSheetItemProps, ActionSheetProps } from './components/action-sheet';
|
|
2
|
-
export { ActionSheet, ActionSheetItem } from './components/action-sheet';
|
|
3
1
|
export type { AppBarMode, AppBarOverflowAction, AppBarProps } from './components/app-bar';
|
|
4
2
|
export { AppBar } from './components/app-bar';
|
|
5
3
|
export type { AvatarProps, AvatarShape, AvatarSize } from './components/avatar';
|
|
@@ -148,6 +146,15 @@ export type { ToolbarActionProps, ToolbarPosition, ToolbarProps } from './compon
|
|
|
148
146
|
export { Toolbar, ToolbarAction } from './components/toolbar';
|
|
149
147
|
export { ZORA_CORE_PLUGIN } from './corePlugin';
|
|
150
148
|
export { ZORA_CORE_PLUGIN_METADATA } from './corePluginMetadata';
|
|
149
|
+
export type {
|
|
150
|
+
UploadAsset,
|
|
151
|
+
UploadAssetBase,
|
|
152
|
+
UploaderProps,
|
|
153
|
+
UploadProgressContext,
|
|
154
|
+
UploadType,
|
|
155
|
+
ValidateUploadAssetInput,
|
|
156
|
+
} from './features/uploader/public';
|
|
157
|
+
export { Uploader, validateUploadAsset } from './features/uploader/public';
|
|
151
158
|
export type {
|
|
152
159
|
BoxProps,
|
|
153
160
|
CenterProps,
|
|
@@ -286,18 +293,6 @@ export type { FilterBarProps } from './patterns/filter-bar';
|
|
|
286
293
|
export { FilterBar } from './patterns/filter-bar';
|
|
287
294
|
export type { HeroAction, HeroAlign, HeroLayout, HeroProps, HeroTone } from './patterns/hero';
|
|
288
295
|
export { Hero } from './patterns/hero';
|
|
289
|
-
export type {
|
|
290
|
-
ImagePreviewProps,
|
|
291
|
-
ZoraImageAsset,
|
|
292
|
-
ZoraImageMetadata,
|
|
293
|
-
} from './patterns/image-preview';
|
|
294
|
-
export { ImagePreview } from './patterns/image-preview';
|
|
295
|
-
export type {
|
|
296
|
-
ImageUploadFieldProps,
|
|
297
|
-
ImageUploadProgressContext,
|
|
298
|
-
ZoraPickedImage,
|
|
299
|
-
} from './patterns/image-upload-field';
|
|
300
|
-
export { ImageUploadField } from './patterns/image-upload-field';
|
|
301
296
|
export type { InspectorFieldProps } from './patterns/inspector-field';
|
|
302
297
|
export { InspectorField } from './patterns/inspector-field';
|
|
303
298
|
export type {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { actionSheetItemMeta, actionSheetMeta } from '../components/action-sheet/meta';
|
|
2
1
|
import { appBarMeta } from '../components/app-bar/meta';
|
|
3
2
|
import { avatarMeta } from '../components/avatar/meta';
|
|
4
3
|
import { avatarGroupMeta } from '../components/avatar-group/meta';
|
|
@@ -42,6 +41,7 @@ import { textareaMeta } from '../components/textarea/meta';
|
|
|
42
41
|
import { timePickerMeta } from '../components/time-picker/meta';
|
|
43
42
|
import { toastMeta, toastProviderMeta } from '../components/toast/meta';
|
|
44
43
|
import { toolbarActionMeta, toolbarMeta } from '../components/toolbar/meta';
|
|
44
|
+
import { uploaderMeta } from '../features/uploader/meta';
|
|
45
45
|
import { foundationMetas } from '../foundation/meta';
|
|
46
46
|
import { appShellMeta } from '../layout/app-shell/meta';
|
|
47
47
|
import { screenMeta } from '../layout/screen/meta';
|
|
@@ -65,8 +65,6 @@ import { disclosureSectionMeta } from '../patterns/disclosure-section/meta';
|
|
|
65
65
|
import { emptyStateMeta } from '../patterns/empty-state/meta';
|
|
66
66
|
import { filterBarMeta } from '../patterns/filter-bar/meta';
|
|
67
67
|
import { heroMeta } from '../patterns/hero/meta';
|
|
68
|
-
import { imagePreviewMeta } from '../patterns/image-preview/meta';
|
|
69
|
-
import { imageUploadFieldMeta } from '../patterns/image-upload-field/meta';
|
|
70
68
|
import { inspectorFieldMeta } from '../patterns/inspector-field/meta';
|
|
71
69
|
import { listMeta, listRowMeta, listSectionMeta } from '../patterns/list/meta';
|
|
72
70
|
import { messageBubbleMeta } from '../patterns/message-bubble/meta';
|
|
@@ -94,8 +92,6 @@ import type { ZoraComponentMetaRegistry } from './types';
|
|
|
94
92
|
|
|
95
93
|
export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = {
|
|
96
94
|
...foundationMetas,
|
|
97
|
-
ActionSheet: actionSheetMeta,
|
|
98
|
-
ActionSheetItem: actionSheetItemMeta,
|
|
99
95
|
AppBar: appBarMeta,
|
|
100
96
|
Avatar: avatarMeta,
|
|
101
97
|
AvatarGroup: avatarGroupMeta,
|
|
@@ -146,6 +142,7 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = {
|
|
|
146
142
|
ToastProvider: toastProviderMeta,
|
|
147
143
|
Toolbar: toolbarMeta,
|
|
148
144
|
ToolbarAction: toolbarActionMeta,
|
|
145
|
+
Uploader: uploaderMeta,
|
|
149
146
|
ThemeModeToggle: themeModeToggleMeta,
|
|
150
147
|
AppShell: appShellMeta,
|
|
151
148
|
Screen: screenMeta,
|
|
@@ -167,8 +164,6 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = {
|
|
|
167
164
|
EmptyState: emptyStateMeta,
|
|
168
165
|
FilterBar: filterBarMeta,
|
|
169
166
|
Hero: heroMeta,
|
|
170
|
-
ImagePreview: imagePreviewMeta,
|
|
171
|
-
ImageUploadField: imageUploadFieldMeta,
|
|
172
167
|
InspectorField: inspectorFieldMeta,
|
|
173
168
|
List: listMeta,
|
|
174
169
|
ListRow: listRowMeta,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
|
-
test('passes the isolated Surface
|
|
3
|
+
test('passes the isolated Surface 4 and RN Web 0.21 acceptance suite', () => {
|
|
4
4
|
const subprocess = Bun.spawnSync({
|
|
5
5
|
cmd: [process.execPath, 'test', 'test-fixtures/platformAcceptance.test.tsx'],
|
|
6
6
|
stderr: 'pipe',
|
package/src/registry.test.ts
CHANGED
|
@@ -55,7 +55,7 @@ async function listPublicConcreteComponentExports(): Promise<readonly string[]>
|
|
|
55
55
|
const source = await Bun.file('src/index.ts').text();
|
|
56
56
|
const componentExports = Array.from(
|
|
57
57
|
source.matchAll(
|
|
58
|
-
/export\s+\{([^}]+)\}\s+from '\.\/(components\/[^']+|foundation|layout\/[^']+|patterns\/[^']+)';/g,
|
|
58
|
+
/export\s+\{([^}]+)\}\s+from '\.\/(components\/[^']+|features\/[^']+|foundation|layout\/[^']+|patterns\/[^']+)';/g,
|
|
59
59
|
),
|
|
60
60
|
)
|
|
61
61
|
.flatMap((match) => match[1].split(',').map((item) => item.trim()))
|
package/src/registry.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { InteractionPolicyProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import { ActionSheet, ActionSheetItem } from './components/action-sheet';
|
|
5
4
|
import { AppBar } from './components/app-bar';
|
|
6
5
|
import { Avatar } from './components/avatar';
|
|
7
6
|
import { AvatarGroup } from './components/avatar-group';
|
|
@@ -40,6 +39,7 @@ import { Textarea } from './components/textarea';
|
|
|
40
39
|
import { TimePicker } from './components/time-picker';
|
|
41
40
|
import { Toast } from './components/toast';
|
|
42
41
|
import { Toolbar, ToolbarAction } from './components/toolbar';
|
|
42
|
+
import { Uploader } from './features/uploader/public';
|
|
43
43
|
import {
|
|
44
44
|
Box,
|
|
45
45
|
Center,
|
|
@@ -74,8 +74,6 @@ import { DisclosureSection } from './patterns/disclosure-section';
|
|
|
74
74
|
import { EmptyState } from './patterns/empty-state';
|
|
75
75
|
import { FilterBar } from './patterns/filter-bar';
|
|
76
76
|
import { Hero } from './patterns/hero';
|
|
77
|
-
import { ImagePreview } from './patterns/image-preview';
|
|
78
|
-
import { ImageUploadField } from './patterns/image-upload-field';
|
|
79
77
|
import { InspectorField } from './patterns/inspector-field';
|
|
80
78
|
import { List, ListRow, ListSection } from './patterns/list';
|
|
81
79
|
import { MessageBubble } from './patterns/message-bubble';
|
|
@@ -122,8 +120,6 @@ type _RegistryInteractionPolicyCheck = _AssertTrue<
|
|
|
122
120
|
>;
|
|
123
121
|
|
|
124
122
|
const _ZORA_COMPONENT_REGISTRY = {
|
|
125
|
-
ActionSheet,
|
|
126
|
-
ActionSheetItem,
|
|
127
123
|
AppBar,
|
|
128
124
|
Avatar,
|
|
129
125
|
AvatarGroup,
|
|
@@ -173,6 +169,7 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
173
169
|
Toast,
|
|
174
170
|
Toolbar,
|
|
175
171
|
ToolbarAction,
|
|
172
|
+
Uploader,
|
|
176
173
|
ThemeModeToggle,
|
|
177
174
|
Box,
|
|
178
175
|
Center,
|
|
@@ -204,8 +201,6 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
204
201
|
EmptyState,
|
|
205
202
|
FilterBar,
|
|
206
203
|
Hero,
|
|
207
|
-
ImagePreview,
|
|
208
|
-
ImageUploadField,
|
|
209
204
|
InspectorField,
|
|
210
205
|
List,
|
|
211
206
|
ListRow,
|
|
@@ -65,6 +65,7 @@ const REQUIRED_SHOWCASE_COVERAGE = {
|
|
|
65
65
|
'Stack',
|
|
66
66
|
'Surface',
|
|
67
67
|
],
|
|
68
|
+
features: ['Uploader'],
|
|
68
69
|
layouts: [
|
|
69
70
|
'AppShell',
|
|
70
71
|
'Screen',
|
|
@@ -90,8 +91,6 @@ const REQUIRED_SHOWCASE_COVERAGE = {
|
|
|
90
91
|
'ListRow',
|
|
91
92
|
'ListSection',
|
|
92
93
|
'InspectorField',
|
|
93
|
-
'ImagePreview',
|
|
94
|
-
'ImageUploadField',
|
|
95
94
|
'Notice',
|
|
96
95
|
'Panel',
|
|
97
96
|
'ReaderSurface',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
2
2
|
import { ThemeProvider } from '@ankhorage/surface';
|
|
3
|
+
import { BottomSheetProvider } from '@ankhorage/surface/bottom-sheet';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
|
|
5
6
|
import { createZoraThemeConfig } from './createZoraThemeConfig';
|
|
@@ -14,7 +15,7 @@ export interface ZoraProviderProps {
|
|
|
14
15
|
initialMode?: ZoraThemeMode;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
/** Installs the ZORA theme runtime and
|
|
18
|
+
/** Installs the ZORA theme runtime, Surface theme, and shared bottom-sheet controller. */
|
|
18
19
|
export function ZoraProvider({
|
|
19
20
|
children,
|
|
20
21
|
theme = zoraDefaultTheme,
|
|
@@ -30,7 +31,7 @@ export function ZoraProvider({
|
|
|
30
31
|
return (
|
|
31
32
|
<ZoraThemeRuntimeContext.Provider value={runtimeValue}>
|
|
32
33
|
<ThemeProvider initialConfig={resolvedConfig} initialMode={initialMode}>
|
|
33
|
-
{children}
|
|
34
|
+
<BottomSheetProvider>{children}</BottomSheetProvider>
|
|
34
35
|
</ThemeProvider>
|
|
35
36
|
</ZoraThemeRuntimeContext.Provider>
|
|
36
37
|
);
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
4
|
+
|
|
5
|
+
export type UploadType = 'image' | 'video' | 'document' | 'file';
|
|
6
|
+
|
|
7
|
+
export interface UploadAssetBase {
|
|
8
|
+
fileName?: string;
|
|
9
|
+
sizeBytes?: number;
|
|
10
|
+
contentType?: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
alt?: string;
|
|
14
|
+
createdAt?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type UploadAsset =
|
|
18
|
+
| (UploadAssetBase & {
|
|
19
|
+
kind: 'local';
|
|
20
|
+
uri: string;
|
|
21
|
+
})
|
|
22
|
+
| (UploadAssetBase & {
|
|
23
|
+
kind: 'url';
|
|
24
|
+
url: string;
|
|
25
|
+
})
|
|
26
|
+
| (UploadAssetBase & {
|
|
27
|
+
kind: 'storage';
|
|
28
|
+
storageId?: string;
|
|
29
|
+
bucket: string;
|
|
30
|
+
path: string;
|
|
31
|
+
publicUrl?: string;
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export interface UploadProgressContext {
|
|
35
|
+
setProgress: (progress: number | null) => void;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ValidateUploadAssetInput {
|
|
39
|
+
asset: UploadAsset;
|
|
40
|
+
accept?: string;
|
|
41
|
+
maxSizeBytes?: number;
|
|
42
|
+
validate?: (asset: UploadAsset) => string | undefined;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface UploaderProps extends ZoraBaseProps {
|
|
46
|
+
value: UploadAsset | null;
|
|
47
|
+
onChange: (next: UploadAsset | null) => void;
|
|
48
|
+
label: React.ReactNode;
|
|
49
|
+
description?: React.ReactNode;
|
|
50
|
+
helperText?: React.ReactNode;
|
|
51
|
+
errorText?: React.ReactNode;
|
|
52
|
+
type?: UploadType;
|
|
53
|
+
accept?: string;
|
|
54
|
+
maxSizeBytes?: number;
|
|
55
|
+
required?: boolean;
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
readOnly?: boolean;
|
|
58
|
+
validatePicked?: (asset: UploadAsset) => string | undefined;
|
|
59
|
+
onUpload?: (asset: UploadAsset, context: UploadProgressContext) => Promise<UploadAsset>;
|
|
60
|
+
onRemove?: (current: UploadAsset) => void | Promise<void>;
|
|
61
|
+
aspectRatio?: number;
|
|
62
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ActionSheetProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Presents a modal bottom sheet with a list of actions.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ActionSheet: (props: ActionSheetProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=ActionSheet.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheet.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD;;GAEG;AACH,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionSheet as SurfaceActionSheet } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
|
-
function ActionSheetInner({ mode: _mode, themeId: _themeId, ...props }) {
|
|
5
|
-
return <SurfaceActionSheet {...props}/>;
|
|
6
|
-
}
|
|
7
|
-
/***
|
|
8
|
-
* Presents a modal bottom sheet with a list of actions.
|
|
9
|
-
*/
|
|
10
|
-
export const ActionSheet = withZoraThemeScope(ActionSheetInner);
|
|
11
|
-
//# sourceMappingURL=ActionSheet.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheet.js","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheet.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,gBAAgB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAoB;IACtF,OAAO,CAAC,kBAAkB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import { ActionSheet as SurfaceActionSheet } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ActionSheetProps } from './types';\n\nfunction ActionSheetInner({ mode: _mode, themeId: _themeId, ...props }: ActionSheetProps) {\n return <SurfaceActionSheet {...props} />;\n}\n\n/***\n * Presents a modal bottom sheet with a list of actions.\n */\nexport const ActionSheet = withZoraThemeScope(ActionSheetInner);\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ActionSheetItemProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Renders a single selectable action row within an `ActionSheet`.
|
|
5
|
-
*/
|
|
6
|
-
export declare const ActionSheetItem: (props: ActionSheetItemProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=ActionSheetItem.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetItem.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheetItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAmBpD;;GAEG;AACH,eAAO,MAAM,eAAe,4DAA2C,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ActionSheetItem as SurfaceActionSheetItem } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { resolveIconSize } from '../../internal/recipes';
|
|
4
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
-
import { Icon } from '../icon';
|
|
7
|
-
function ActionSheetItemInner({ themeId: _themeId, mode: _mode, icon, leading, ...props }) {
|
|
8
|
-
const { theme } = useZoraTheme();
|
|
9
|
-
const resolvedLeading = leading ??
|
|
10
|
-
(icon ? (<Icon {...icon} color={theme.semantics.content.muted} size={resolveIconSize('s')}/>) : undefined);
|
|
11
|
-
return <SurfaceActionSheetItem {...props} leading={resolvedLeading}/>;
|
|
12
|
-
}
|
|
13
|
-
/***
|
|
14
|
-
* Renders a single selectable action row within an `ActionSheet`.
|
|
15
|
-
*/
|
|
16
|
-
export const ActionSheetItem = withZoraThemeScope(ActionSheetItemInner);
|
|
17
|
-
//# sourceMappingURL=ActionSheetItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionSheetItem.js","sourceRoot":"","sources":["../../../src/components/action-sheet/ActionSheetItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAG/B,SAAS,oBAAoB,CAAC,EAC5B,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACa;IACrB,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,eAAe,GACnB,OAAO;QACP,CAAC,IAAI,CAAC,CAAC,CAAC,CACN,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,EAAG,CACrF,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEjB,OAAO,CAAC,sBAAsB,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,EAAG,CAAC;AACzE,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["import { ActionSheetItem as SurfaceActionSheetItem } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { Icon } from '../icon';\nimport type { ActionSheetItemProps } from './types';\n\nfunction ActionSheetItemInner({\n themeId: _themeId,\n mode: _mode,\n icon,\n leading,\n ...props\n}: ActionSheetItemProps) {\n const { theme } = useZoraTheme();\n const resolvedLeading =\n leading ??\n (icon ? (\n <Icon {...icon} color={theme.semantics.content.muted} size={resolveIconSize('s')} />\n ) : undefined);\n\n return <SurfaceActionSheetItem {...props} leading={resolvedLeading} />;\n}\n\n/***\n * Renders a single selectable action row within an `ActionSheet`.\n */\nexport const ActionSheetItem = withZoraThemeScope(ActionSheetItemInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/action-sheet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { ActionSheet } from './ActionSheet';\nexport { ActionSheetItem } from './ActionSheetItem';\nexport type { ActionSheetItemProps, ActionSheetProps } from './types';\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const actionSheetMeta: {
|
|
2
|
-
readonly name: "ActionSheet";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Surface-backed contextual action sheet; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
export declare const actionSheetItemMeta: {
|
|
10
|
-
readonly name: "ActionSheetItem";
|
|
11
|
-
readonly category: "component";
|
|
12
|
-
readonly directManifestNode: false;
|
|
13
|
-
readonly allowedChildren: readonly [];
|
|
14
|
-
readonly note: "Surface-backed contextual action sheet row; not represented as a manifest node in v1.";
|
|
15
|
-
readonly props: {};
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;CAOU,CAAC;AAEvC,eAAO,MAAM,mBAAmB;;;;;;;CAOM,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const actionSheetMeta = {
|
|
2
|
-
name: 'ActionSheet',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Surface-backed contextual action sheet; not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
export const actionSheetItemMeta = {
|
|
10
|
-
name: 'ActionSheetItem',
|
|
11
|
-
category: 'component',
|
|
12
|
-
directManifestNode: false,
|
|
13
|
-
allowedChildren: [],
|
|
14
|
-
note: 'Surface-backed contextual action sheet row; not represented as a manifest node in v1.',
|
|
15
|
-
props: {},
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/action-sheet/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,mFAAmF;IACzF,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,iBAAiB;IACvB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,uFAAuF;IAC7F,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const actionSheetMeta = {\n name: 'ActionSheet',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Surface-backed contextual action sheet; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const actionSheetItemMeta = {\n name: 'ActionSheetItem',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Surface-backed contextual action sheet row; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ActionSheetItemProps as SurfaceActionSheetItemProps, ActionSheetProps as SurfaceActionSheetProps, ButtonIconSpec } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ZoraColor } from '../../internal/recipes';
|
|
4
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
-
export interface ActionSheetProps extends ZoraBaseProps, Omit<SurfaceActionSheetProps, 'children' | 'mode' | 'themeId'> {
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export interface ActionSheetItemProps extends ZoraBaseProps, Omit<SurfaceActionSheetItemProps, 'color' | 'leading' | 'mode' | 'themeId'> {
|
|
9
|
-
color?: ZoraColor;
|
|
10
|
-
icon?: ButtonIconSpec;
|
|
11
|
-
leading?: React.ReactNode;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/action-sheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,IAAI,2BAA2B,EACnD,gBAAgB,IAAI,uBAAuB,EAC3C,cAAc,EACf,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,gBACf,SAAQ,aAAa,EAAE,IAAI,CAAC,uBAAuB,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IACrF,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,MAAM,WAAW,oBACf,SACE,aAAa,EACb,IAAI,CAAC,2BAA2B,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7E,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/action-sheet/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ActionSheetItemProps as SurfaceActionSheetItemProps,\n ActionSheetProps as SurfaceActionSheetProps,\n ButtonIconSpec,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraColor } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface ActionSheetProps\n extends ZoraBaseProps, Omit<SurfaceActionSheetProps, 'children' | 'mode' | 'themeId'> {\n children?: React.ReactNode;\n}\n\nexport interface ActionSheetItemProps\n extends\n ZoraBaseProps,\n Omit<SurfaceActionSheetItemProps, 'color' | 'leading' | 'mode' | 'themeId'> {\n color?: ZoraColor;\n icon?: ButtonIconSpec;\n leading?: React.ReactNode;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ImagePreviewProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Preview pattern for showing an image with optional metadata and actions.
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export declare const ImagePreview: (props: ImagePreviewProps) => React.ReactElement | null;
|
|
9
|
-
//# sourceMappingURL=ImagePreview.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePreview.d.ts","sourceRoot":"","sources":["../../../src/patterns/image-preview/ImagePreview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,KAAK,EAAE,iBAAiB,EAAkB,MAAM,SAAS,CAAC;AAqEjE;;;;GAIG;AACH,eAAO,MAAM,YAAY,yDAAwC,CAAC"}
|