@ankhorage/zora 13.0.0 → 14.0.1
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 +14 -0
- package/README.md +182 -6
- package/dist/features/accordion/adapters/inbound/Accordion.js +4 -4
- package/dist/features/accordion/adapters/inbound/Accordion.js.map +1 -1
- package/dist/features/accordion/adapters/inbound/AccordionItem.js +1 -1
- package/dist/features/accordion/adapters/inbound/AccordionItem.js.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts +5 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.js +91 -0
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -0
- package/dist/{components/app-bar/meta.d.ts → features/app-bar/appBarMeta.d.ts} +1 -1
- package/dist/features/app-bar/appBarMeta.d.ts.map +1 -0
- package/dist/{components/app-bar/meta.js → features/app-bar/appBarMeta.js} +1 -1
- package/dist/features/app-bar/appBarMeta.js.map +1 -0
- package/dist/features/app-bar/public.d.ts +3 -0
- package/dist/features/app-bar/public.d.ts.map +1 -0
- package/dist/features/app-bar/public.js +2 -0
- package/dist/features/app-bar/public.js.map +1 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.d.ts +1 -6
- package/dist/features/date-picker/adapters/inbound/DatePicker.d.ts.map +1 -1
- package/dist/features/date-picker/adapters/inbound/DatePicker.js +1 -175
- package/dist/features/date-picker/adapters/inbound/DatePicker.js.map +1 -1
- package/dist/features/date-picker/adapters/inbound/DatePicker.native.d.ts +5 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.native.d.ts.map +1 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.native.js +27 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.native.js.map +1 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.web.d.ts +5 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.web.d.ts.map +1 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.web.js +25 -0
- package/dist/features/date-picker/adapters/inbound/DatePicker.web.js.map +1 -0
- package/dist/features/date-picker/composition/DatePickerContent.d.ts +10 -0
- package/dist/features/date-picker/composition/DatePickerContent.d.ts.map +1 -0
- package/dist/features/date-picker/composition/DatePickerContent.js +129 -0
- package/dist/features/date-picker/composition/DatePickerContent.js.map +1 -0
- package/dist/features/date-picker/composition/DatePickerField.d.ts +9 -0
- package/dist/features/date-picker/composition/DatePickerField.d.ts.map +1 -0
- package/dist/features/date-picker/composition/DatePickerField.js +21 -0
- package/dist/features/date-picker/composition/DatePickerField.js.map +1 -0
- package/dist/features/date-picker/composition/DatePickerTrigger.d.ts +9 -0
- package/dist/features/date-picker/composition/DatePickerTrigger.d.ts.map +1 -0
- package/dist/features/date-picker/composition/DatePickerTrigger.js +18 -0
- package/dist/features/date-picker/composition/DatePickerTrigger.js.map +1 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.d.ts +1 -6
- package/dist/features/time-picker/adapters/inbound/TimePicker.d.ts.map +1 -1
- package/dist/features/time-picker/adapters/inbound/TimePicker.js +1 -116
- package/dist/features/time-picker/adapters/inbound/TimePicker.js.map +1 -1
- package/dist/features/time-picker/adapters/inbound/TimePicker.native.d.ts +5 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.native.d.ts.map +1 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.native.js +26 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.native.js.map +1 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.web.d.ts +5 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.web.d.ts.map +1 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.web.js +24 -0
- package/dist/features/time-picker/adapters/inbound/TimePicker.web.js.map +1 -0
- package/dist/features/time-picker/composition/TimePickerContent.d.ts +10 -0
- package/dist/features/time-picker/composition/TimePickerContent.d.ts.map +1 -0
- package/dist/features/time-picker/composition/TimePickerContent.js +78 -0
- package/dist/features/time-picker/composition/TimePickerContent.js.map +1 -0
- package/dist/features/time-picker/composition/TimePickerField.d.ts +9 -0
- package/dist/features/time-picker/composition/TimePickerField.d.ts.map +1 -0
- package/dist/features/time-picker/composition/TimePickerField.js +21 -0
- package/dist/features/time-picker/composition/TimePickerField.js.map +1 -0
- package/dist/features/time-picker/composition/TimePickerTrigger.d.ts +8 -0
- package/dist/features/time-picker/composition/TimePickerTrigger.d.ts.map +1 -0
- package/dist/features/time-picker/composition/TimePickerTrigger.js +9 -0
- package/dist/features/time-picker/composition/TimePickerTrigger.js.map +1 -0
- package/dist/features/toast/adapters/inbound/Toast.d.ts +5 -0
- package/dist/features/toast/adapters/inbound/Toast.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/Toast.js +10 -0
- package/dist/features/toast/adapters/inbound/Toast.js.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts +5 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.d.ts.map +1 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js +7 -0
- package/dist/features/toast/adapters/inbound/ToastProvider.js.map +1 -0
- package/dist/features/toast/public.d.ts +5 -0
- package/dist/features/toast/public.d.ts.map +1 -0
- package/dist/features/toast/public.js +4 -0
- package/dist/features/toast/public.js.map +1 -0
- package/dist/features/toast/toastMeta.d.ts +9 -0
- package/dist/features/toast/toastMeta.d.ts.map +1 -0
- package/dist/features/toast/toastMeta.js +9 -0
- package/dist/features/toast/toastMeta.js.map +1 -0
- package/dist/features/toast/toastProviderMeta.d.ts +9 -0
- package/dist/features/toast/toastProviderMeta.d.ts.map +1 -0
- package/dist/features/toast/toastProviderMeta.js +9 -0
- package/dist/features/toast/toastProviderMeta.js.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/layout/settings-layout/SettingsLayout.d.ts +0 -2
- package/dist/layout/settings-layout/SettingsLayout.d.ts.map +1 -1
- package/dist/layout/settings-layout/SettingsLayout.js +1 -3
- package/dist/layout/settings-layout/SettingsLayout.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +3 -2
- package/dist/metadata/componentMeta.js.map +1 -1
- package/dist/patterns/reader/ReaderSurface.js +1 -1
- package/dist/patterns/reader/ReaderSurface.js.map +1 -1
- package/dist/patterns/selection/SelectionProvider.d.ts +0 -4
- package/dist/patterns/selection/SelectionProvider.d.ts.map +1 -1
- package/dist/patterns/selection/SelectionProvider.js +4 -6
- package/dist/patterns/selection/SelectionProvider.js.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/registry.js.map +1 -1
- package/dist/theme/ZoraProvider.d.ts +4 -10
- package/dist/theme/ZoraProvider.d.ts.map +1 -1
- package/dist/theme/ZoraProvider.js +8 -6
- package/dist/theme/ZoraProvider.js.map +1 -1
- package/dist/theme/ZoraRuntimeCapabilities.d.ts +2 -0
- package/dist/theme/ZoraRuntimeCapabilities.d.ts.map +1 -0
- package/dist/theme/ZoraRuntimeCapabilities.js +2 -0
- package/dist/theme/ZoraRuntimeCapabilities.js.map +1 -0
- package/dist/theme/ZoraRuntimeCapabilities.native.d.ts +4 -0
- package/dist/theme/ZoraRuntimeCapabilities.native.d.ts.map +1 -0
- package/dist/theme/ZoraRuntimeCapabilities.native.js +8 -0
- package/dist/theme/ZoraRuntimeCapabilities.native.js.map +1 -0
- package/dist/theme/ZoraRuntimeCapabilities.web.d.ts +4 -0
- package/dist/theme/ZoraRuntimeCapabilities.web.d.ts.map +1 -0
- package/dist/theme/ZoraRuntimeCapabilities.web.js +8 -0
- package/dist/theme/ZoraRuntimeCapabilities.web.js.map +1 -0
- package/dist/theme/ZoraThemeRuntimeContext.d.ts +1 -0
- package/dist/theme/ZoraThemeRuntimeContext.d.ts.map +1 -1
- package/dist/theme/ZoraThemeRuntimeContext.js +3 -2
- package/dist/theme/ZoraThemeRuntimeContext.js.map +1 -1
- package/dist/theme/ZoraThemeScope.d.ts +1 -0
- package/dist/theme/ZoraThemeScope.d.ts.map +1 -1
- package/dist/theme/ZoraThemeScope.js +12 -10
- package/dist/theme/ZoraThemeScope.js.map +1 -1
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js.map +1 -1
- package/dist/{components/app-bar/types.d.ts → types/app-bar.d.ts} +2 -2
- package/dist/types/app-bar.d.ts.map +1 -0
- package/dist/types/app-bar.js +2 -0
- package/dist/types/app-bar.js.map +1 -0
- package/dist/types/provider.d.ts +19 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/provider.js +2 -0
- package/dist/types/provider.js.map +1 -0
- package/dist/types/toast.d.ts +9 -0
- package/dist/types/toast.d.ts.map +1 -0
- package/dist/types/toast.js +2 -0
- package/dist/types/toast.js.map +1 -0
- package/package.json +2 -2
- package/src/features/accordion/adapters/inbound/Accordion.tsx +4 -4
- package/src/features/accordion/adapters/inbound/AccordionItem.tsx +1 -1
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +176 -0
- package/src/features/app-bar/public.ts +2 -0
- package/src/features/bottom-sheet/public.test.ts +15 -12
- package/src/features/date-picker/adapters/inbound/DatePicker.native.tsx +46 -0
- package/src/features/date-picker/adapters/inbound/DatePicker.tsx +1 -356
- package/src/features/date-picker/adapters/inbound/DatePicker.web.tsx +48 -0
- package/src/features/date-picker/composition/DatePickerContent.tsx +256 -0
- package/src/features/date-picker/composition/DatePickerField.tsx +53 -0
- package/src/features/date-picker/composition/DatePickerTrigger.tsx +47 -0
- package/src/features/date-picker/public.test.ts +14 -4
- package/src/features/time-picker/adapters/inbound/TimePicker.native.tsx +47 -0
- package/src/features/time-picker/adapters/inbound/TimePicker.tsx +1 -258
- package/src/features/time-picker/adapters/inbound/TimePicker.web.tsx +49 -0
- package/src/features/time-picker/composition/TimePickerContent.tsx +164 -0
- package/src/features/time-picker/composition/TimePickerField.tsx +53 -0
- package/src/features/time-picker/composition/TimePickerTrigger.tsx +35 -0
- package/src/features/time-picker/public.test.ts +14 -3
- package/src/features/toast/adapters/inbound/Toast.tsx +13 -0
- package/src/features/toast/adapters/inbound/ToastProvider.tsx +9 -0
- package/src/features/toast/public.test.ts +19 -0
- package/src/features/toast/public.ts +10 -0
- package/src/features/toast/toastMeta.ts +10 -0
- package/src/features/toast/toastProviderMeta.ts +10 -0
- package/src/index.ts +10 -4
- package/src/interactionPolicy.test.ts +7 -3
- package/src/layout/settings-layout/SettingsLayout.tsx +1 -3
- package/src/metadata/componentMeta.ts +3 -2
- package/src/patterns/reader/ReaderSurface.tsx +1 -1
- package/src/patterns/selection/SelectionProvider.tsx +4 -6
- package/src/registry.ts +2 -2
- package/src/theme/ZoraProvider.tsx +11 -13
- package/src/theme/ZoraRuntimeCapabilities.native.tsx +19 -0
- package/src/theme/ZoraRuntimeCapabilities.tsx +1 -0
- package/src/theme/ZoraRuntimeCapabilities.web.tsx +10 -0
- package/src/theme/ZoraThemeRuntimeContext.tsx +3 -2
- package/src/theme/ZoraThemeScope.tsx +14 -12
- package/src/theme/index.ts +1 -1
- package/src/theme/themeConfigScope.test.ts +4 -1
- package/src/theme/themeScopeStructure.test.ts +26 -18
- package/src/{components/app-bar/types.ts → types/app-bar.ts} +1 -1
- package/src/types/provider.ts +22 -0
- package/src/{components/toast/types.ts → types/toast.ts} +5 -7
- package/dist/components/app-bar/AppBar.d.ts +0 -7
- package/dist/components/app-bar/AppBar.d.ts.map +0 -1
- package/dist/components/app-bar/AppBar.js +0 -67
- package/dist/components/app-bar/AppBar.js.map +0 -1
- package/dist/components/app-bar/index.d.ts +0 -3
- package/dist/components/app-bar/index.d.ts.map +0 -1
- package/dist/components/app-bar/index.js +0 -3
- package/dist/components/app-bar/index.js.map +0 -1
- package/dist/components/app-bar/meta.d.ts.map +0 -1
- package/dist/components/app-bar/meta.js.map +0 -1
- package/dist/components/app-bar/types.d.ts.map +0 -1
- package/dist/components/app-bar/types.js +0 -2
- package/dist/components/app-bar/types.js.map +0 -1
- package/dist/components/toast/Toast.d.ts +0 -9
- package/dist/components/toast/Toast.d.ts.map +0 -1
- package/dist/components/toast/Toast.js +0 -13
- package/dist/components/toast/Toast.js.map +0 -1
- package/dist/components/toast/ToastProvider.d.ts +0 -9
- package/dist/components/toast/ToastProvider.d.ts.map +0 -1
- package/dist/components/toast/ToastProvider.js +0 -14
- package/dist/components/toast/ToastProvider.js.map +0 -1
- package/dist/components/toast/index.d.ts +0 -5
- package/dist/components/toast/index.d.ts.map +0 -1
- package/dist/components/toast/index.js +0 -4
- package/dist/components/toast/index.js.map +0 -1
- package/dist/components/toast/meta.d.ts +0 -17
- package/dist/components/toast/meta.d.ts.map +0 -1
- package/dist/components/toast/meta.js +0 -17
- package/dist/components/toast/meta.js.map +0 -1
- package/dist/components/toast/types.d.ts +0 -12
- package/dist/components/toast/types.d.ts.map +0 -1
- package/dist/components/toast/types.js +0 -2
- package/dist/components/toast/types.js.map +0 -1
- package/src/components/app-bar/AppBar.tsx +0 -140
- package/src/components/app-bar/index.ts +0 -2
- package/src/components/toast/Toast.tsx +0 -16
- package/src/components/toast/ToastProvider.tsx +0 -17
- package/src/components/toast/index.ts +0 -4
- package/src/components/toast/meta.ts +0 -19
- /package/src/{components/app-bar/meta.ts → features/app-bar/appBarMeta.ts} +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ToastProvider as SurfaceToastProvider } from '@ankhorage/surface';
|
|
2
|
+
import { BottomSheetProvider } from '@ankhorage/surface/bottom-sheet';
|
|
3
|
+
|
|
4
|
+
import type { ZoraRuntimeCapabilitiesProps } from '../types/provider';
|
|
5
|
+
|
|
6
|
+
/*** Installs optional native runtime capabilities without forcing unused hosts. */
|
|
7
|
+
export function ZoraRuntimeCapabilities({
|
|
8
|
+
bottomSheet,
|
|
9
|
+
children,
|
|
10
|
+
toast,
|
|
11
|
+
}: ZoraRuntimeCapabilitiesProps) {
|
|
12
|
+
const toastContent = toast ? (
|
|
13
|
+
<SurfaceToastProvider {...(toast === true ? {} : toast)}>{children}</SurfaceToastProvider>
|
|
14
|
+
) : (
|
|
15
|
+
children
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
return bottomSheet ? <BottomSheetProvider>{toastContent}</BottomSheetProvider> : toastContent;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ZoraRuntimeCapabilities } from './ZoraRuntimeCapabilities.web';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ToastProvider as SurfaceToastProvider } from '@ankhorage/surface';
|
|
2
|
+
|
|
3
|
+
import type { ZoraRuntimeCapabilitiesProps } from '../types/provider';
|
|
4
|
+
|
|
5
|
+
/*** Installs only web-relevant optional runtime capabilities. */
|
|
6
|
+
export function ZoraRuntimeCapabilities({ children, toast }: ZoraRuntimeCapabilitiesProps) {
|
|
7
|
+
if (!toast) return children;
|
|
8
|
+
|
|
9
|
+
return <SurfaceToastProvider {...(toast === true ? {} : toast)}>{children}</SurfaceToastProvider>;
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext,
|
|
1
|
+
import { createContext, use } from 'react';
|
|
2
2
|
|
|
3
3
|
import type { ZoraThemeId } from './types';
|
|
4
4
|
import { zoraDefaultTheme } from './zoraDefaultTheme';
|
|
@@ -11,6 +11,7 @@ export const ZoraThemeRuntimeContext = createContext<ZoraThemeRuntime>({
|
|
|
11
11
|
themeId: zoraDefaultTheme.id,
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
+
/*** Returns the active ZORA theme runtime. */
|
|
14
15
|
export function useZoraThemeRuntime(): ZoraThemeRuntime {
|
|
15
|
-
return
|
|
16
|
+
return use(ZoraThemeRuntimeContext);
|
|
16
17
|
}
|
|
@@ -11,6 +11,17 @@ export interface ZoraThemeScopeProps {
|
|
|
11
11
|
mode?: ZoraThemeMode;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/*** Applies nested ZORA theme overrides without installing another Surface theme runtime. */
|
|
15
|
+
export function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
16
|
+
if (mode === undefined && themeId === undefined) return children;
|
|
17
|
+
return (
|
|
18
|
+
<ZoraThemeScopeInner mode={mode} themeId={themeId}>
|
|
19
|
+
{children}
|
|
20
|
+
</ZoraThemeScopeInner>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/*** Resolves and provides the scoped Surface and ZORA theme runtime values. */
|
|
14
25
|
function ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
15
26
|
const parentSurface = useTheme();
|
|
16
27
|
const parentRuntime = useZoraThemeRuntime();
|
|
@@ -38,17 +49,8 @@ function ZoraThemeScopeInner({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
|
38
49
|
const scopedRuntimeValue = useMemo(() => ({ themeId: scopedThemeId }), [scopedThemeId]);
|
|
39
50
|
|
|
40
51
|
return (
|
|
41
|
-
<ZoraThemeRuntimeContext
|
|
42
|
-
<ThemeContext
|
|
43
|
-
</ZoraThemeRuntimeContext
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export function ZoraThemeScope({ children, themeId, mode }: ZoraThemeScopeProps) {
|
|
48
|
-
if (mode === undefined && themeId === undefined) return children;
|
|
49
|
-
return (
|
|
50
|
-
<ZoraThemeScopeInner mode={mode} themeId={themeId}>
|
|
51
|
-
{children}
|
|
52
|
-
</ZoraThemeScopeInner>
|
|
52
|
+
<ZoraThemeRuntimeContext value={scopedRuntimeValue}>
|
|
53
|
+
<ThemeContext value={scopedSurfaceValue}>{children}</ThemeContext>
|
|
54
|
+
</ZoraThemeRuntimeContext>
|
|
53
55
|
);
|
|
54
56
|
}
|
package/src/theme/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type { ThemeModeToggleProps } from './ThemeModeToggleProps';
|
|
|
4
4
|
export { useZoraTheme } from './useZoraTheme';
|
|
5
5
|
export { withZoraThemeScope } from './withZoraThemeScope';
|
|
6
6
|
export type { ZoraBaseProps } from './ZoraBaseProps';
|
|
7
|
-
export type { ZoraProviderProps } from './ZoraProvider';
|
|
7
|
+
export type { ZoraProviderProps, ZoraToastCapability } from './ZoraProvider';
|
|
8
8
|
export { ZoraProvider } from './ZoraProvider';
|
|
9
9
|
export type { ZoraThemeScopeProps } from './ZoraThemeScope';
|
|
10
10
|
export { ZoraThemeScope } from './ZoraThemeScope';
|
|
@@ -4,12 +4,15 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { describe, expect, test } from 'bun:test';
|
|
5
5
|
|
|
6
6
|
const themeDir = import.meta.dir;
|
|
7
|
+
const srcDir = join(themeDir, '..');
|
|
7
8
|
|
|
8
9
|
describe('canonical ThemeConfig scope propagation', () => {
|
|
9
10
|
test('provider accepts the canonical ThemeConfig without duplicating live config state', () => {
|
|
10
11
|
const provider = readFileSync(join(themeDir, 'ZoraProvider.tsx'), 'utf8');
|
|
12
|
+
const providerTypes = readFileSync(join(srcDir, 'types', 'provider.ts'), 'utf8');
|
|
11
13
|
const context = readFileSync(join(themeDir, 'ZoraThemeRuntimeContext.tsx'), 'utf8');
|
|
12
|
-
|
|
14
|
+
|
|
15
|
+
expect(providerTypes).toContain('themeConfig?: ThemeConfig');
|
|
13
16
|
expect(provider).toContain('themeConfig ?? createZoraThemeConfig(theme)');
|
|
14
17
|
expect(context).not.toContain('ThemeConfig');
|
|
15
18
|
expect(context).not.toContain('sourceTheme');
|
|
@@ -56,7 +56,7 @@ const scopedComponentFiles = [
|
|
|
56
56
|
join(srcDir, 'features', 'list', 'adapters', 'inbound', 'FlatList.tsx'),
|
|
57
57
|
join(srcDir, 'features', 'list', 'adapters', 'inbound', 'SectionList.tsx'),
|
|
58
58
|
join(srcDir, 'features', 'bottom-sheet', 'adapters', 'inbound', 'BottomSheet.tsx'),
|
|
59
|
-
join(srcDir, '
|
|
59
|
+
join(srcDir, 'features', 'app-bar', 'adapters', 'inbound', 'AppBar.tsx'),
|
|
60
60
|
join(srcDir, 'features', 'accordion', 'adapters', 'inbound', 'Accordion.tsx'),
|
|
61
61
|
join(srcDir, 'features', 'accordion', 'adapters', 'inbound', 'AccordionItem.tsx'),
|
|
62
62
|
join(srcDir, 'features', 'badge', 'adapters', 'inbound', 'Badge.tsx'),
|
|
@@ -65,6 +65,8 @@ const scopedComponentFiles = [
|
|
|
65
65
|
join(srcDir, 'features', 'card', 'adapters', 'inbound', 'Card.tsx'),
|
|
66
66
|
join(srcDir, 'features', 'card', 'adapters', 'inbound', 'MediaCard.tsx'),
|
|
67
67
|
join(srcDir, 'features', 'card', 'adapters', 'inbound', 'MetricCard.tsx'),
|
|
68
|
+
join(srcDir, 'features', 'date-picker', 'adapters', 'inbound', 'DatePicker.native.tsx'),
|
|
69
|
+
join(srcDir, 'features', 'date-picker', 'adapters', 'inbound', 'DatePicker.web.tsx'),
|
|
68
70
|
join(srcDir, 'features', 'form', 'checkbox', 'adapters', 'inbound', 'Checkbox.tsx'),
|
|
69
71
|
join(srcDir, 'features', 'form', 'checkbox', 'adapters', 'inbound', 'CheckboxGroup.tsx'),
|
|
70
72
|
join(srcDir, 'features', 'form', 'adapters', 'inbound', 'Form.tsx'),
|
|
@@ -82,6 +84,9 @@ const scopedComponentFiles = [
|
|
|
82
84
|
join(srcDir, 'components', 'rating', 'Rating.tsx'),
|
|
83
85
|
join(srcDir, 'components', 'select', 'Select.tsx'),
|
|
84
86
|
join(srcDir, 'components', 'tabs', 'Tabs.tsx'),
|
|
87
|
+
join(srcDir, 'features', 'time-picker', 'adapters', 'inbound', 'TimePicker.native.tsx'),
|
|
88
|
+
join(srcDir, 'features', 'time-picker', 'adapters', 'inbound', 'TimePicker.web.tsx'),
|
|
89
|
+
join(srcDir, 'features', 'toast', 'adapters', 'inbound', 'Toast.tsx'),
|
|
85
90
|
join(srcDir, 'features', 'typography', 'adapters', 'inbound', 'Text.tsx'),
|
|
86
91
|
join(srcDir, 'components', 'toolbar', 'Toolbar.tsx'),
|
|
87
92
|
join(srcDir, 'components', 'toolbar', 'ToolbarAction.tsx'),
|
|
@@ -129,7 +134,7 @@ const scopedComponentFiles = [
|
|
|
129
134
|
] as const;
|
|
130
135
|
|
|
131
136
|
const scopedPropTypeFiles = [
|
|
132
|
-
join(srcDir, '
|
|
137
|
+
join(srcDir, 'types', 'app-bar.ts'),
|
|
133
138
|
join(srcDir, 'types', 'accordion.ts'),
|
|
134
139
|
join(srcDir, 'types', 'badge.ts'),
|
|
135
140
|
join(srcDir, 'types', 'button.ts'),
|
|
@@ -138,6 +143,7 @@ const scopedPropTypeFiles = [
|
|
|
138
143
|
join(srcDir, 'types', 'media-card.ts'),
|
|
139
144
|
join(srcDir, 'types', 'metric-card.ts'),
|
|
140
145
|
join(srcDir, 'types', 'checkbox.ts'),
|
|
146
|
+
join(srcDir, 'types', 'date-picker.ts'),
|
|
141
147
|
join(srcDir, 'types', 'form.ts'),
|
|
142
148
|
join(srcDir, 'types', 'heading.ts'),
|
|
143
149
|
join(srcDir, 'types', 'icon.ts'),
|
|
@@ -150,6 +156,8 @@ const scopedPropTypeFiles = [
|
|
|
150
156
|
join(srcDir, 'components', 'select', 'types.ts'),
|
|
151
157
|
join(srcDir, 'components', 'tabs', 'types.ts'),
|
|
152
158
|
join(srcDir, 'types', 'text.ts'),
|
|
159
|
+
join(srcDir, 'types', 'time-picker.ts'),
|
|
160
|
+
join(srcDir, 'types', 'toast.ts'),
|
|
153
161
|
join(srcDir, 'components', 'toolbar', 'types.ts'),
|
|
154
162
|
|
|
155
163
|
join(srcDir, 'layout', 'app-shell', 'types.ts'),
|
|
@@ -179,46 +187,46 @@ const scopedPropTypeFiles = [
|
|
|
179
187
|
describe('theme scope structure', () => {
|
|
180
188
|
it('keeps ZoraProvider lightweight (no extra ResponsiveProvider nesting)', () => {
|
|
181
189
|
expect(zoraProviderSource).toMatch(/ThemeProvider/);
|
|
182
|
-
expect(zoraProviderSource).toMatch(
|
|
190
|
+
expect(zoraProviderSource).toMatch(/<ZoraThemeRuntimeContext\s+value=/u);
|
|
183
191
|
expect(zoraProviderSource).not.toMatch(/ResponsiveProvider/);
|
|
184
192
|
});
|
|
185
193
|
|
|
186
194
|
it('implements nested scopes without nesting Surface ThemeProvider', () => {
|
|
187
|
-
expect(themeScopeSource).toMatch(
|
|
188
|
-
expect(themeScopeSource).toMatch(/createTheme\(/);
|
|
195
|
+
expect(themeScopeSource).toMatch(/<ThemeContext\s+value=/u);
|
|
196
|
+
expect(themeScopeSource).toMatch(/createTheme\(/u);
|
|
189
197
|
expect(themeScopeSource).not.toMatch(/ThemeProvider/);
|
|
190
198
|
});
|
|
191
199
|
|
|
192
200
|
it('wraps components only when mode/themeId overrides are present', () => {
|
|
193
|
-
expect(hocSource).toMatch(/props\.mode === undefined/);
|
|
194
|
-
expect(hocSource).toMatch(/props\.themeId === undefined/);
|
|
195
|
-
expect(hocSource).toMatch(/<ZoraThemeScope/);
|
|
201
|
+
expect(hocSource).toMatch(/props\.mode === undefined/u);
|
|
202
|
+
expect(hocSource).toMatch(/props\.themeId === undefined/u);
|
|
203
|
+
expect(hocSource).toMatch(/<ZoraThemeScope/u);
|
|
196
204
|
});
|
|
197
205
|
|
|
198
206
|
it('adopts the inner + HOC pattern across the public surface', () => {
|
|
199
207
|
for (const filePath of scopedComponentFiles) {
|
|
200
208
|
const source = readFileSync(filePath, 'utf8');
|
|
201
|
-
expect(source).toMatch(/themeId: _themeId/);
|
|
202
|
-
expect(source).toMatch(/mode: _mode/);
|
|
203
|
-
expect(source).toMatch(/withZoraThemeScope/);
|
|
209
|
+
expect(source).toMatch(/themeId: _themeId/u);
|
|
210
|
+
expect(source).toMatch(/mode: _mode/u);
|
|
211
|
+
expect(source).toMatch(/withZoraThemeScope/u);
|
|
204
212
|
}
|
|
205
213
|
});
|
|
206
214
|
|
|
207
215
|
it('adds ZoraBaseProps to public component prop types', () => {
|
|
208
216
|
for (const filePath of scopedPropTypeFiles) {
|
|
209
217
|
const source = readFileSync(filePath, 'utf8');
|
|
210
|
-
expect(source).toMatch(/ZoraBaseProps/);
|
|
211
|
-
expect(source).toMatch(/extends\s+ZoraBaseProps|ZoraBaseProps\s*&|&\s*ZoraBaseProps/);
|
|
218
|
+
expect(source).toMatch(/ZoraBaseProps/u);
|
|
219
|
+
expect(source).toMatch(/extends\s+ZoraBaseProps|ZoraBaseProps\s*&|&\s*ZoraBaseProps/u);
|
|
212
220
|
}
|
|
213
221
|
});
|
|
214
222
|
|
|
215
223
|
it('does not implement theme scoping outside the theme module', () => {
|
|
216
224
|
for (const filePath of scopeGuardFiles) {
|
|
217
225
|
const source = readFileSync(filePath, 'utf8');
|
|
218
|
-
expect(source).not.toMatch(
|
|
219
|
-
expect(source).not.toMatch(/ThemeProvider/);
|
|
220
|
-
expect(source).not.toMatch(/<ZoraThemeScope/);
|
|
221
|
-
expect(source).not.toMatch(/createTheme\(/);
|
|
226
|
+
expect(source).not.toMatch(/<ThemeContext(?:\.Provider)?\b/u);
|
|
227
|
+
expect(source).not.toMatch(/ThemeProvider/u);
|
|
228
|
+
expect(source).not.toMatch(/<ZoraThemeScope/u);
|
|
229
|
+
expect(source).not.toMatch(/createTheme\(/u);
|
|
222
230
|
}
|
|
223
231
|
});
|
|
224
232
|
|
|
@@ -226,7 +234,7 @@ describe('theme scope structure', () => {
|
|
|
226
234
|
const srcFiles = collectSourceFiles(srcDir);
|
|
227
235
|
for (const filePath of srcFiles) {
|
|
228
236
|
const source = readFileSync(filePath, 'utf8');
|
|
229
|
-
expect(source).not.toMatch(/useZoraTheme\(\s*\{/);
|
|
237
|
+
expect(source).not.toMatch(/useZoraTheme\(\s*\{/u);
|
|
230
238
|
}
|
|
231
239
|
});
|
|
232
240
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ThemeConfig } from '@ankhorage/contracts';
|
|
2
|
+
import type { ToastProviderProps as SurfaceToastProviderProps } from '@ankhorage/surface';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
|
|
5
|
+
import type { ZoraTheme, ZoraThemeMode } from '../theme/types';
|
|
6
|
+
|
|
7
|
+
export type ZoraToastCapability = boolean | Omit<SurfaceToastProviderProps, 'children'>;
|
|
8
|
+
|
|
9
|
+
export interface ZoraProviderProps {
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
theme?: ZoraTheme;
|
|
12
|
+
themeConfig?: ThemeConfig;
|
|
13
|
+
initialMode?: ZoraThemeMode;
|
|
14
|
+
toast?: ZoraToastCapability;
|
|
15
|
+
bottomSheet?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ZoraRuntimeCapabilitiesProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
toast?: ZoraToastCapability;
|
|
21
|
+
bottomSheet?: boolean;
|
|
22
|
+
}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
ToastController as SurfaceToastController,
|
|
2
3
|
ToastOptions as SurfaceToastOptions,
|
|
3
4
|
ToastProps as SurfaceToastProps,
|
|
5
|
+
ToastProviderProps as SurfaceToastProviderProps,
|
|
4
6
|
ToastStatus as SurfaceToastStatus,
|
|
5
7
|
} from '@ankhorage/surface';
|
|
6
|
-
import type React from 'react';
|
|
7
8
|
|
|
8
|
-
import type { ZoraBaseProps } from '
|
|
9
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
9
10
|
|
|
10
11
|
export type ToastStatus = SurfaceToastStatus;
|
|
11
12
|
export type ToastOptions = SurfaceToastOptions;
|
|
13
|
+
export type ToastController = SurfaceToastController;
|
|
14
|
+
export type ToastProviderProps = SurfaceToastProviderProps;
|
|
12
15
|
|
|
13
16
|
export interface ToastProps extends ZoraBaseProps, Omit<SurfaceToastProps, 'testID'> {}
|
|
14
|
-
|
|
15
|
-
export interface ToastProviderProps {
|
|
16
|
-
children: React.ReactNode;
|
|
17
|
-
defaultDuration?: number;
|
|
18
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { AppBarProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Renders a top app bar with title/subtitle and optional leading/trailing actions.
|
|
5
|
-
*/
|
|
6
|
-
export declare const AppBar: (props: AppBarProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=AppBar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.d.ts","sourceRoot":"","sources":["../../../src/components/app-bar/AppBar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAoC,WAAW,EAAE,MAAM,SAAS,CAAC;AA8H7E;;GAEG;AACH,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { AppBar as SurfaceAppBar } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { IconButton } from '../../features/button/public';
|
|
4
|
-
import { Box, Stack } from '../../features/layout/public';
|
|
5
|
-
import { Heading } from '../../features/typography/public';
|
|
6
|
-
import { Text } from '../../features/typography/public';
|
|
7
|
-
import { Inline } from '../../foundation';
|
|
8
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
9
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
10
|
-
const DEFAULT_CANCEL_ICON = { name: 'close-outline' };
|
|
11
|
-
const DEFAULT_OVERFLOW_ICON = { name: 'ellipsis-vertical' };
|
|
12
|
-
function resolveMode(mode) {
|
|
13
|
-
return mode ?? { type: 'default' };
|
|
14
|
-
}
|
|
15
|
-
function resolveSelectionLabel({ count, label }) {
|
|
16
|
-
if (count === undefined) {
|
|
17
|
-
return label;
|
|
18
|
-
}
|
|
19
|
-
return `${label} (${count})`;
|
|
20
|
-
}
|
|
21
|
-
function resolveOverflowLabel(overflow) {
|
|
22
|
-
return overflow.label ?? 'More options';
|
|
23
|
-
}
|
|
24
|
-
function resolveCancelLabel(mode) {
|
|
25
|
-
return mode.cancelLabel ?? 'Cancel selection';
|
|
26
|
-
}
|
|
27
|
-
function AppBarInner({ themeId: _themeId, mode: _mode, title, subtitle, leading, actions, overflow, appMode, children, safeAreaTop = true, divider = true, testID, interactionPolicy, }) {
|
|
28
|
-
const { theme } = useZoraTheme();
|
|
29
|
-
const resolvedMode = resolveMode(appMode);
|
|
30
|
-
const isSelectionMode = resolvedMode.type === 'selection';
|
|
31
|
-
const resolvedLeading = leading ??
|
|
32
|
-
(isSelectionMode ? (<IconButton icon={resolvedMode.cancelIcon ?? DEFAULT_CANCEL_ICON} interactionPolicy={interactionPolicy} label={resolveCancelLabel(resolvedMode)} variant="ghost" size="m" color="neutral" onPress={resolvedMode.onCancel}/>) : undefined);
|
|
33
|
-
const overflowButton = overflow?.onPress ? (<IconButton disabled={overflow.disabled} icon={overflow.icon ?? DEFAULT_OVERFLOW_ICON} interactionPolicy={interactionPolicy} label={resolveOverflowLabel(overflow)} variant="ghost" size="m" color="neutral" onPress={overflow.onPress}/>) : null;
|
|
34
|
-
const resolvedTrailing = actions || overflowButton ? (<Inline align="center" gap="s" wrap="nowrap">
|
|
35
|
-
{actions}
|
|
36
|
-
{overflowButton}
|
|
37
|
-
</Inline>) : undefined;
|
|
38
|
-
const resolvedCenter = (() => {
|
|
39
|
-
if (children !== undefined) {
|
|
40
|
-
return children;
|
|
41
|
-
}
|
|
42
|
-
if (isSelectionMode) {
|
|
43
|
-
return (<Text numberOfLines={1} emphasis="default" variant="label" weight="semiBold">
|
|
44
|
-
{resolveSelectionLabel(resolvedMode)}
|
|
45
|
-
</Text>);
|
|
46
|
-
}
|
|
47
|
-
if (title == null && subtitle == null) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
return (<Stack gap="xs">
|
|
51
|
-
{title != null ? (<Heading ellipsizeMode="tail" level={3} numberOfLines={1} size="h5">
|
|
52
|
-
{title}
|
|
53
|
-
</Heading>) : null}
|
|
54
|
-
{subtitle != null ? (<Text ellipsizeMode="tail" numberOfLines={1} emphasis="muted" variant="bodySmall">
|
|
55
|
-
{subtitle}
|
|
56
|
-
</Text>) : null}
|
|
57
|
-
</Stack>);
|
|
58
|
-
})();
|
|
59
|
-
return (<SurfaceAppBar bg={isSelectionMode ? theme.semantics.action.primary.softBg : undefined} divider={divider} leading={resolvedLeading} safeAreaTop={safeAreaTop} testID={testID} trailing={resolvedTrailing}>
|
|
60
|
-
{resolvedCenter ? <Box style={{ minWidth: 0 }}>{resolvedCenter}</Box> : null}
|
|
61
|
-
</SurfaceAppBar>);
|
|
62
|
-
}
|
|
63
|
-
/***
|
|
64
|
-
* Renders a top app bar with title/subtitle and optional leading/trailing actions.
|
|
65
|
-
*/
|
|
66
|
-
export const AppBar = withZoraThemeScope(AppBarInner);
|
|
67
|
-
//# sourceMappingURL=AppBar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AppBar.js","sourceRoot":"","sources":["../../../src/components/app-bar/AppBar.tsx"],"names":[],"mappings":"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","sourcesContent":["import { AppBar as SurfaceAppBar, type ButtonIconSpec } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { IconButton } from '../../features/button/public';\nimport { Box, Stack } from '../../features/layout/public';\nimport { Heading } from '../../features/typography/public';\nimport { Text } from '../../features/typography/public';\nimport { Inline } from '../../foundation';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { AppBarMode, AppBarOverflowAction, AppBarProps } from './types';\n\nconst DEFAULT_CANCEL_ICON = { name: 'close-outline' } satisfies ButtonIconSpec;\nconst DEFAULT_OVERFLOW_ICON = { name: 'ellipsis-vertical' } satisfies ButtonIconSpec;\n\nfunction resolveMode(mode: AppBarMode | undefined): AppBarMode {\n return mode ?? { type: 'default' };\n}\n\nfunction resolveSelectionLabel({ count, label }: { count?: number; label: string }): string {\n if (count === undefined) {\n return label;\n }\n\n return `${label} (${count})`;\n}\n\nfunction resolveOverflowLabel(overflow: AppBarOverflowAction): string {\n return overflow.label ?? 'More options';\n}\n\nfunction resolveCancelLabel(mode: Extract<AppBarMode, { type: 'selection' }>): string {\n return mode.cancelLabel ?? 'Cancel selection';\n}\n\nfunction AppBarInner({\n themeId: _themeId,\n mode: _mode,\n title,\n subtitle,\n leading,\n actions,\n overflow,\n appMode,\n children,\n safeAreaTop = true,\n divider = true,\n testID,\n interactionPolicy,\n}: AppBarProps) {\n const { theme } = useZoraTheme();\n const resolvedMode = resolveMode(appMode);\n const isSelectionMode = resolvedMode.type === 'selection';\n\n const resolvedLeading =\n leading ??\n (isSelectionMode ? (\n <IconButton\n icon={resolvedMode.cancelIcon ?? DEFAULT_CANCEL_ICON}\n interactionPolicy={interactionPolicy}\n label={resolveCancelLabel(resolvedMode)}\n variant=\"ghost\"\n size=\"m\"\n color=\"neutral\"\n onPress={resolvedMode.onCancel}\n />\n ) : undefined);\n\n const overflowButton = overflow?.onPress ? (\n <IconButton\n disabled={overflow.disabled}\n icon={overflow.icon ?? DEFAULT_OVERFLOW_ICON}\n interactionPolicy={interactionPolicy}\n label={resolveOverflowLabel(overflow)}\n variant=\"ghost\"\n size=\"m\"\n color=\"neutral\"\n onPress={overflow.onPress}\n />\n ) : null;\n\n const resolvedTrailing =\n actions || overflowButton ? (\n <Inline align=\"center\" gap=\"s\" wrap=\"nowrap\">\n {actions}\n {overflowButton}\n </Inline>\n ) : undefined;\n\n const resolvedCenter = (() => {\n if (children !== undefined) {\n return children;\n }\n\n if (isSelectionMode) {\n return (\n <Text numberOfLines={1} emphasis=\"default\" variant=\"label\" weight=\"semiBold\">\n {resolveSelectionLabel(resolvedMode)}\n </Text>\n );\n }\n\n if (title == null && subtitle == null) {\n return null;\n }\n\n return (\n <Stack gap=\"xs\">\n {title != null ? (\n <Heading ellipsizeMode=\"tail\" level={3} numberOfLines={1} size=\"h5\">\n {title}\n </Heading>\n ) : null}\n {subtitle != null ? (\n <Text ellipsizeMode=\"tail\" numberOfLines={1} emphasis=\"muted\" variant=\"bodySmall\">\n {subtitle}\n </Text>\n ) : null}\n </Stack>\n );\n })();\n\n return (\n <SurfaceAppBar\n bg={isSelectionMode ? theme.semantics.action.primary.softBg : undefined}\n divider={divider}\n leading={resolvedLeading}\n safeAreaTop={safeAreaTop}\n testID={testID}\n trailing={resolvedTrailing}\n >\n {resolvedCenter ? <Box style={{ minWidth: 0 }}>{resolvedCenter}</Box> : null}\n </SurfaceAppBar>\n );\n}\n\n/***\n * Renders a top app bar with title/subtitle and optional leading/trailing actions.\n */\nexport const AppBar = withZoraThemeScope(AppBarInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/app-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/app-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC","sourcesContent":["export * from './AppBar';\nexport * from './types';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/app-bar/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU;;;;;;;CAOe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/app-bar/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,yEAAyE;IAC/E,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const appBarMeta = {\n name: 'AppBar',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Application chrome component; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/app-bar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEN,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/app-bar/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type AppBarMode =\n | {\n type: 'default';\n }\n | {\n type: 'selection';\n label: string;\n count?: number;\n onCancel: () => void;\n cancelLabel?: string;\n cancelIcon?: ButtonIconSpec;\n };\n\nexport interface AppBarOverflowAction {\n onPress: () => void;\n label?: string;\n icon?: ButtonIconSpec;\n disabled?: boolean;\n}\n\nexport interface AppBarProps extends ZoraBaseProps {\n title?: React.ReactNode;\n subtitle?: React.ReactNode;\n leading?: React.ReactNode;\n actions?: React.ReactNode;\n overflow?: AppBarOverflowAction;\n appMode?: AppBarMode;\n children?: React.ReactNode;\n safeAreaTop?: boolean;\n divider?: boolean;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C;;;;GAIG;AACH,eAAO,MAAM,KAAK,kDAAiC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Toast as SurfaceToast } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
4
|
-
function ToastInner({ mode: _mode, themeId: _themeId, ...props }) {
|
|
5
|
-
return <SurfaceToast {...props}/>;
|
|
6
|
-
}
|
|
7
|
-
/***
|
|
8
|
-
* Renders a toast notification message.
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
export const Toast = withZoraThemeScope(ToastInner);
|
|
13
|
-
//# sourceMappingURL=Toast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.js","sourceRoot":"","sources":["../../../src/components/toast/Toast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAc;IAC1E,OAAO,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACrC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import { Toast as SurfaceToast } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { ToastProps } from './types';\n\nfunction ToastInner({ mode: _mode, themeId: _themeId, ...props }: ToastProps) {\n return <SurfaceToast {...props} />;\n}\n\n/***\n * Renders a toast notification message.\n *\n \n */\nexport const Toast = withZoraThemeScope(ToastInner);\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ToastProviderProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Provides toast state and rendering context for `useToast` and `Toast`.
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export declare function ToastProvider({ children, defaultDuration }: ToastProviderProps): React.JSX.Element;
|
|
9
|
-
//# sourceMappingURL=ToastProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.d.ts","sourceRoot":"","sources":["../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,EAAE,kBAAkB,qBAM9E"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ToastProvider as SurfaceToastProvider } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
/***
|
|
4
|
-
* Provides toast state and rendering context for `useToast` and `Toast`.
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
export function ToastProvider({ children, defaultDuration }) {
|
|
9
|
-
if (defaultDuration === undefined) {
|
|
10
|
-
return <SurfaceToastProvider>{children}</SurfaceToastProvider>;
|
|
11
|
-
}
|
|
12
|
-
return <SurfaceToastProvider defaultDuration={defaultDuration}>{children}</SurfaceToastProvider>;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=ToastProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ToastProvider.js","sourceRoot":"","sources":["../../../src/components/toast/ToastProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAsB;IAC7E,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAClC,OAAO,CAAC,oBAAoB,CAAC,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,oBAAoB,CAAC,CAAC;AACnG,CAAC","sourcesContent":["import { ToastProvider as SurfaceToastProvider } from '@ankhorage/surface';\nimport React from 'react';\n\nimport type { ToastProviderProps } from './types';\n\n/***\n * Provides toast state and rendering context for `useToast` and `Toast`.\n *\n \n */\nexport function ToastProvider({ children, defaultDuration }: ToastProviderProps) {\n if (defaultDuration === undefined) {\n return <SurfaceToastProvider>{children}</SurfaceToastProvider>;\n }\n\n return <SurfaceToastProvider defaultDuration={defaultDuration}>{children}</SurfaceToastProvider>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["export { Toast } from './Toast';\nexport { ToastProvider } from './ToastProvider';\nexport type { ToastOptions, ToastProps, ToastProviderProps, ToastStatus } from './types';\nexport { useToast } from '@ankhorage/surface';\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const toastMeta: {
|
|
2
|
-
readonly name: "Toast";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Transient feedback component; exposed as an imperative provider/hook workflow, not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
export declare const toastProviderMeta: {
|
|
10
|
-
readonly name: "ToastProvider";
|
|
11
|
-
readonly category: "component";
|
|
12
|
-
readonly directManifestNode: false;
|
|
13
|
-
readonly allowedChildren: readonly [];
|
|
14
|
-
readonly note: "Provider for imperative toast feedback; 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/toast/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;CAOgB,CAAC;AAEvC,eAAO,MAAM,iBAAiB;;;;;;;CAOQ,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const toastMeta = {
|
|
2
|
-
name: 'Toast',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Transient feedback component; exposed as an imperative provider/hook workflow, not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
export const toastProviderMeta = {
|
|
10
|
-
name: 'ToastProvider',
|
|
11
|
-
category: 'component',
|
|
12
|
-
directManifestNode: false,
|
|
13
|
-
allowedChildren: [],
|
|
14
|
-
note: 'Provider for imperative toast feedback; 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/toast/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,0HAA0H;IAChI,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,mFAAmF;IACzF,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const toastMeta = {\n name: 'Toast',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Transient feedback component; exposed as an imperative provider/hook workflow, not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const toastProviderMeta = {\n name: 'ToastProvider',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Provider for imperative toast feedback; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ToastOptions as SurfaceToastOptions, ToastProps as SurfaceToastProps, ToastStatus as SurfaceToastStatus } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
-
export type ToastStatus = SurfaceToastStatus;
|
|
5
|
-
export type ToastOptions = SurfaceToastOptions;
|
|
6
|
-
export interface ToastProps extends ZoraBaseProps, Omit<SurfaceToastProps, 'testID'> {
|
|
7
|
-
}
|
|
8
|
-
export interface ToastProviderProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
defaultDuration?: number;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,mBAAmB,EACnC,UAAU,IAAI,iBAAiB,EAC/B,WAAW,IAAI,kBAAkB,EAClC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAC;AAC7C,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,aAAa,EAAE,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC;CAAG;AAEvF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/toast/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ToastOptions as SurfaceToastOptions,\n ToastProps as SurfaceToastProps,\n ToastStatus as SurfaceToastStatus,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type ToastStatus = SurfaceToastStatus;\nexport type ToastOptions = SurfaceToastOptions;\n\nexport interface ToastProps extends ZoraBaseProps, Omit<SurfaceToastProps, 'testID'> {}\n\nexport interface ToastProviderProps {\n children: React.ReactNode;\n defaultDuration?: number;\n}\n"]}
|