@ankhorage/zora 13.0.0 → 14.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 +8 -0
- package/README.md +11 -5
- 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/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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +2 -1
- package/dist/metadata/componentMeta.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 +1 -1
- 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/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/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 +8 -2
- package/src/metadata/componentMeta.ts +2 -1
- package/src/patterns/selection/SelectionProvider.tsx +4 -6
- package/src/registry.ts +1 -1
- 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 +24 -16
- package/src/types/provider.ts +22 -0
- package/src/{components/toast/types.ts → types/toast.ts} +5 -7
- 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/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
|
@@ -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');
|
|
@@ -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'),
|
|
@@ -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 +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"]}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Toast as SurfaceToast } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
|
-
import type { ToastProps } from './types';
|
|
6
|
-
|
|
7
|
-
function ToastInner({ mode: _mode, themeId: _themeId, ...props }: ToastProps) {
|
|
8
|
-
return <SurfaceToast {...props} />;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/***
|
|
12
|
-
* Renders a toast notification message.
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
*/
|
|
16
|
-
export const Toast = withZoraThemeScope(ToastInner);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ToastProvider as SurfaceToastProvider } from '@ankhorage/surface';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
|
|
4
|
-
import type { ToastProviderProps } from './types';
|
|
5
|
-
|
|
6
|
-
/***
|
|
7
|
-
* Provides toast state and rendering context for `useToast` and `Toast`.
|
|
8
|
-
*
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
export function ToastProvider({ children, defaultDuration }: ToastProviderProps) {
|
|
12
|
-
if (defaultDuration === undefined) {
|
|
13
|
-
return <SurfaceToastProvider>{children}</SurfaceToastProvider>;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return <SurfaceToastProvider defaultDuration={defaultDuration}>{children}</SurfaceToastProvider>;
|
|
17
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ZoraComponentMeta } from '../../metadata';
|
|
2
|
-
|
|
3
|
-
export const toastMeta = {
|
|
4
|
-
name: 'Toast',
|
|
5
|
-
category: 'component',
|
|
6
|
-
directManifestNode: false,
|
|
7
|
-
allowedChildren: [],
|
|
8
|
-
note: 'Transient feedback component; exposed as an imperative provider/hook workflow, not represented as a manifest node in v1.',
|
|
9
|
-
props: {},
|
|
10
|
-
} as const satisfies ZoraComponentMeta;
|
|
11
|
-
|
|
12
|
-
export const toastProviderMeta = {
|
|
13
|
-
name: 'ToastProvider',
|
|
14
|
-
category: 'component',
|
|
15
|
-
directManifestNode: false,
|
|
16
|
-
allowedChildren: [],
|
|
17
|
-
note: 'Provider for imperative toast feedback; not represented as a manifest node in v1.',
|
|
18
|
-
props: {},
|
|
19
|
-
} as const satisfies ZoraComponentMeta;
|