@ankhorage/zora 14.0.0 → 15.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 +12 -0
- package/README.md +176 -6
- 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 +92 -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/bottom-sheet/public.d.ts +2 -2
- package/dist/features/bottom-sheet/public.d.ts.map +1 -1
- package/dist/features/bottom-sheet/public.js +1 -1
- package/dist/features/bottom-sheet/public.js.map +1 -1
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts +5 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.d.ts.map +1 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js +81 -0
- package/dist/features/breadcrumbs/adapters/inbound/Breadcrumbs.js.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts +119 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.d.ts.map +1 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js +94 -0
- package/dist/features/breadcrumbs/breadcrumbsMeta.js.map +1 -0
- package/dist/features/breadcrumbs/public.d.ts +3 -0
- package/dist/features/breadcrumbs/public.d.ts.map +1 -0
- package/dist/features/breadcrumbs/public.js +2 -0
- package/dist/features/breadcrumbs/public.js.map +1 -0
- package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.d.ts.map +1 -1
- package/dist/features/data-table/adapters/inbound/DataTable.js +4 -2
- package/dist/features/data-table/adapters/inbound/DataTable.js.map +1 -1
- package/dist/features/form/formFieldMeta.d.ts +1 -1
- package/dist/features/form/formFieldMeta.js +1 -1
- package/dist/features/form/formFieldMeta.js.map +1 -1
- package/dist/features/form/radio/utils/resolveRadioGroupThemeRecipe.d.ts +1 -1
- package/dist/features/form/select/adapters/inbound/Select.d.ts +2 -0
- package/dist/features/form/select/adapters/inbound/Select.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.js +2 -0
- package/dist/features/form/select/adapters/inbound/Select.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.native.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js +42 -0
- package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts +5 -0
- package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js +31 -0
- package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -0
- package/dist/features/form/select/composition/SelectField.d.ts +10 -0
- package/dist/features/form/select/composition/SelectField.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectField.js +8 -0
- package/dist/features/form/select/composition/SelectField.js.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts +12 -0
- package/dist/features/form/select/composition/SelectOptionRow.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectOptionRow.js +9 -0
- package/dist/features/form/select/composition/SelectOptionRow.js.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts +10 -0
- package/dist/features/form/select/composition/SelectTrigger.d.ts.map +1 -0
- package/dist/features/form/select/composition/SelectTrigger.js +9 -0
- package/dist/features/form/select/composition/SelectTrigger.js.map +1 -0
- package/dist/features/form/select/composition/useSelectController.d.ts +8 -0
- package/dist/features/form/select/composition/useSelectController.d.ts.map +1 -0
- package/dist/features/form/select/composition/useSelectController.js +15 -0
- package/dist/features/form/select/composition/useSelectController.js.map +1 -0
- package/dist/features/form/select/public.d.ts +3 -0
- package/dist/features/form/select/public.d.ts.map +1 -0
- package/dist/features/form/select/public.js +2 -0
- package/dist/features/form/select/public.js.map +1 -0
- package/dist/features/form/select/selectMeta.d.ts +195 -0
- package/dist/features/form/select/selectMeta.d.ts.map +1 -0
- package/dist/features/form/select/selectMeta.js +152 -0
- package/dist/features/form/select/selectMeta.js.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts +5 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.d.ts.map +1 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js +43 -0
- package/dist/features/popover-menu/adapters/inbound/PopoverMenu.js.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.d.ts.map +1 -0
- package/dist/features/popover-menu/popoverMenuMeta.js +9 -0
- package/dist/features/popover-menu/popoverMenuMeta.js.map +1 -0
- package/dist/features/popover-menu/public.d.ts +3 -0
- package/dist/features/popover-menu/public.d.ts.map +1 -0
- package/dist/features/popover-menu/public.js +2 -0
- package/dist/features/popover-menu/public.js.map +1 -0
- package/dist/features/typography/utils/resolveHeadingThemeRecipe.d.ts +1 -1
- package/dist/features/typography/utils/resolveTextThemeRecipe.d.ts +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- 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/bindableComponentMeta.d.ts +1 -2
- package/dist/metadata/bindableComponentMeta.d.ts.map +1 -1
- package/dist/metadata/bindableComponentMeta.js +1 -2
- package/dist/metadata/bindableComponentMeta.js.map +1 -1
- package/dist/metadata/componentMeta.d.ts.map +1 -1
- package/dist/metadata/componentMeta.js +5 -6
- 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/theme-composer/ThemeComposer.js +1 -1
- package/dist/patterns/theme-composer/ThemeComposer.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -6
- package/dist/registry.js.map +1 -1
- package/dist/{components/app-bar/types.d.ts → types/app-bar.d.ts} +8 -5
- 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/{components/breadcrumbs/types.d.ts → types/breadcrumbs.d.ts} +8 -6
- package/dist/types/breadcrumbs.d.ts.map +1 -0
- package/dist/types/breadcrumbs.js +2 -0
- package/dist/types/breadcrumbs.js.map +1 -0
- package/dist/types/data-table.d.ts +2 -2
- package/dist/types/data-table.d.ts.map +1 -1
- package/dist/types/data-table.js.map +1 -1
- package/dist/types/popover-menu.d.ts +24 -0
- package/dist/types/popover-menu.d.ts.map +1 -0
- package/dist/types/popover-menu.js +2 -0
- package/dist/types/popover-menu.js.map +1 -0
- package/dist/types/select.d.ts +22 -0
- package/dist/types/select.d.ts.map +1 -0
- package/dist/types/select.js +2 -0
- package/dist/types/select.js.map +1 -0
- package/package.json +2 -4
- package/src/features/app-bar/adapters/inbound/AppBar.tsx +184 -0
- package/src/features/app-bar/public.ts +2 -0
- package/src/features/bottom-sheet/public.test.ts +10 -1
- package/src/features/bottom-sheet/public.ts +9 -1
- package/src/features/breadcrumbs/adapters/inbound/Breadcrumbs.tsx +179 -0
- package/src/features/breadcrumbs/breadcrumbsMeta.ts +95 -0
- package/src/features/breadcrumbs/public.test.ts +22 -0
- package/src/features/breadcrumbs/public.ts +6 -0
- package/src/features/data-table/adapters/inbound/DataTable.tsx +9 -5
- package/src/features/form/formFieldMeta.ts +1 -1
- package/src/features/form/select/adapters/inbound/Select.native.tsx +78 -0
- package/src/features/form/select/adapters/inbound/Select.tsx +1 -0
- package/src/features/form/select/adapters/inbound/Select.web.tsx +63 -0
- package/src/features/form/select/composition/SelectField.tsx +27 -0
- package/src/features/form/select/composition/SelectOptionRow.tsx +36 -0
- package/src/features/form/select/composition/SelectTrigger.tsx +32 -0
- package/src/features/form/select/composition/useSelectController.ts +21 -0
- package/src/features/form/select/public.test.ts +25 -0
- package/src/features/form/select/public.ts +2 -0
- package/src/features/form/select/selectMeta.ts +154 -0
- package/src/features/popover-menu/adapters/inbound/PopoverMenu.tsx +60 -0
- package/src/{components/breadcrumbs/meta.ts → features/popover-menu/popoverMenuMeta.ts} +3 -3
- package/src/features/popover-menu/public.test.ts +11 -0
- package/src/features/popover-menu/public.ts +6 -0
- package/src/index.ts +15 -8
- package/src/interactionPolicy.test.ts +24 -22
- package/src/layout/settings-layout/SettingsLayout.tsx +1 -3
- package/src/metadata/bindableComponentMeta.test.ts +8 -0
- package/src/metadata/bindableComponentMeta.ts +1 -2
- package/src/metadata/componentMeta.test.ts +3 -0
- package/src/metadata/componentMeta.ts +5 -6
- package/src/nativePeerContract.test.ts +5 -19
- package/src/patterns/reader/ReaderSurface.tsx +1 -1
- package/src/patterns/theme-composer/ThemeComposer.tsx +1 -1
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.ts +5 -6
- package/src/theme/themeScopeStructure.test.ts +10 -5
- package/src/{components/app-bar/types.ts → types/app-bar.ts} +7 -4
- package/src/{components/breadcrumbs/types.ts → types/breadcrumbs.ts} +8 -5
- package/src/types/data-table.ts +2 -2
- package/src/types/popover-menu.ts +31 -0
- package/src/{components/select/types.ts → types/select.ts} +11 -3
- 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/breadcrumbs/Breadcrumbs.d.ts +0 -7
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +0 -80
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +0 -1
- package/dist/components/breadcrumbs/index.d.ts +0 -3
- package/dist/components/breadcrumbs/index.d.ts.map +0 -1
- package/dist/components/breadcrumbs/index.js +0 -2
- package/dist/components/breadcrumbs/index.js.map +0 -1
- package/dist/components/breadcrumbs/meta.d.ts +0 -9
- package/dist/components/breadcrumbs/meta.d.ts.map +0 -1
- package/dist/components/breadcrumbs/meta.js +0 -9
- package/dist/components/breadcrumbs/meta.js.map +0 -1
- package/dist/components/breadcrumbs/types.d.ts.map +0 -1
- package/dist/components/breadcrumbs/types.js +0 -2
- package/dist/components/breadcrumbs/types.js.map +0 -1
- package/dist/components/menu/DropdownMenu.d.ts +0 -7
- package/dist/components/menu/DropdownMenu.d.ts.map +0 -1
- package/dist/components/menu/DropdownMenu.js +0 -9
- package/dist/components/menu/DropdownMenu.js.map +0 -1
- package/dist/components/menu/Menu.d.ts +0 -7
- package/dist/components/menu/Menu.d.ts.map +0 -1
- package/dist/components/menu/Menu.js +0 -46
- package/dist/components/menu/Menu.js.map +0 -1
- package/dist/components/menu/index.d.ts +0 -4
- package/dist/components/menu/index.d.ts.map +0 -1
- package/dist/components/menu/index.js +0 -3
- package/dist/components/menu/index.js.map +0 -1
- package/dist/components/menu/meta.d.ts +0 -17
- package/dist/components/menu/meta.d.ts.map +0 -1
- package/dist/components/menu/meta.js +0 -17
- package/dist/components/menu/meta.js.map +0 -1
- package/dist/components/menu/types.d.ts +0 -22
- package/dist/components/menu/types.d.ts.map +0 -1
- package/dist/components/menu/types.js +0 -2
- package/dist/components/menu/types.js.map +0 -1
- package/dist/components/select/Select.d.ts +0 -7
- package/dist/components/select/Select.d.ts.map +0 -1
- package/dist/components/select/Select.js +0 -32
- package/dist/components/select/Select.js.map +0 -1
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/index.d.ts.map +0 -1
- package/dist/components/select/index.js +0 -3
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/meta.d.ts +0 -9
- package/dist/components/select/meta.d.ts.map +0 -1
- package/dist/components/select/meta.js +0 -9
- package/dist/components/select/meta.js.map +0 -1
- package/dist/components/select/types.d.ts +0 -14
- package/dist/components/select/types.d.ts.map +0 -1
- package/dist/components/select/types.js +0 -2
- package/dist/components/select/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/breadcrumbs/Breadcrumbs.tsx +0 -147
- package/src/components/breadcrumbs/index.ts +0 -2
- package/src/components/menu/DropdownMenu.tsx +0 -11
- package/src/components/menu/Menu.tsx +0 -59
- package/src/components/menu/index.ts +0 -3
- package/src/components/menu/meta.ts +0 -19
- package/src/components/menu/types.ts +0 -31
- package/src/components/select/Select.tsx +0 -67
- package/src/components/select/index.ts +0 -2
- package/src/components/select/meta.ts +0 -10
- /package/src/{components/app-bar/meta.ts → features/app-bar/appBarMeta.ts} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Interaction policy regression guards.
|
|
3
3
|
*
|
|
4
4
|
* These tests verify that internally owned interactions respect the passive
|
|
5
|
-
* policy returned by the canonical Surface type.
|
|
5
|
+
* policy returned by the canonical Surface type. They use static source
|
|
6
6
|
* inspection so they run fast and do not require a renderer.
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -18,8 +18,8 @@ function readSource(relativePath: string): string {
|
|
|
18
18
|
return readFileSync(join(SRC_ROOT, relativePath), 'utf8');
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
function
|
|
22
|
-
return readSource(join('
|
|
21
|
+
function readFeature(...segments: string[]): string {
|
|
22
|
+
return readSource(join('features', ...segments));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
function readPattern(...segments: string[]): string {
|
|
@@ -37,14 +37,14 @@ describe('InteractionPolicy declaration', () => {
|
|
|
37
37
|
test('no duplicate local InteractionPolicy type declarations in ZORA source', () => {
|
|
38
38
|
const files = [
|
|
39
39
|
readSource('theme/ZoraBaseProps.ts'),
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
readSource('types/app-bar.ts'),
|
|
41
|
+
readSource('types/breadcrumbs.ts'),
|
|
42
42
|
readSource('types/empty-state.ts'),
|
|
43
43
|
readSource('types/hero.ts'),
|
|
44
44
|
readSource('types/product-card.ts'),
|
|
45
45
|
readPattern('reader', 'types.ts'),
|
|
46
46
|
readPattern('scanner', 'types.ts'),
|
|
47
|
-
|
|
47
|
+
readSource('types/select.ts'),
|
|
48
48
|
readPattern('tree-view', 'types.ts'),
|
|
49
49
|
];
|
|
50
50
|
|
|
@@ -74,26 +74,27 @@ describe('Surface wrapper propagation', () => {
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
describe('AppBar', () => {
|
|
77
|
-
test('forwards interactionPolicy to
|
|
78
|
-
const source =
|
|
77
|
+
test('forwards interactionPolicy to selection and overflow controls', () => {
|
|
78
|
+
const source = readFeature('app-bar', 'adapters', 'inbound', 'AppBar.tsx');
|
|
79
79
|
|
|
80
80
|
expect(source).not.toMatch(/interactionPolicy:\s*_interactionPolicy/);
|
|
81
81
|
expect(source).toMatch(
|
|
82
|
-
/<IconButton[\s\S]*?interactionPolicy=\{interactionPolicy\}[\s\S]*?onPress=\{
|
|
82
|
+
/<IconButton[\s\S]*?interactionPolicy=\{interactionPolicy\}[\s\S]*?onPress=\{mode\.onCancel\}/,
|
|
83
83
|
);
|
|
84
|
+
expect(source).toMatch(/<PopoverMenu[\s\S]*?interactionPolicy=\{interactionPolicy\}/);
|
|
84
85
|
expect(source).toMatch(
|
|
85
|
-
|
|
86
|
+
/trigger=\{\(\{ toggle \}\) => \([\s\S]*?<IconButton[\s\S]*?interactionPolicy=\{interactionPolicy\}[\s\S]*?onPress=\{toggle\}/,
|
|
86
87
|
);
|
|
87
88
|
});
|
|
88
89
|
});
|
|
89
90
|
|
|
90
91
|
describe('Breadcrumbs', () => {
|
|
91
|
-
test('forwards interactionPolicy
|
|
92
|
-
const source =
|
|
92
|
+
test('forwards interactionPolicy and emits item ids from internal Buttons', () => {
|
|
93
|
+
const source = readFeature('breadcrumbs', 'adapters', 'inbound', 'Breadcrumbs.tsx');
|
|
93
94
|
|
|
94
95
|
expect(source).not.toMatch(/interactionPolicy:\s*_interactionPolicy/);
|
|
95
96
|
expect(source).toMatch(
|
|
96
|
-
/<Button[\s\S]*?interactionPolicy=\{interactionPolicy\}[\s\S]*?onPress=\{item\.
|
|
97
|
+
/<Button[\s\S]*?interactionPolicy=\{interactionPolicy\}[\s\S]*?onPress=\{\(\) => onItemPress\(\{ id: item\.id \}\)\}/,
|
|
97
98
|
);
|
|
98
99
|
});
|
|
99
100
|
});
|
|
@@ -229,19 +230,20 @@ describe('BarcodeScannerView', () => {
|
|
|
229
230
|
});
|
|
230
231
|
|
|
231
232
|
describe('Select', () => {
|
|
232
|
-
test('
|
|
233
|
-
const
|
|
233
|
+
test('web forwards interactionPolicy to Popover and option controls', () => {
|
|
234
|
+
const webSource = readFeature('form', 'select', 'adapters', 'inbound', 'Select.web.tsx');
|
|
235
|
+
const optionSource = readFeature('form', 'select', 'composition', 'SelectOptionRow.tsx');
|
|
234
236
|
|
|
235
|
-
expect(
|
|
237
|
+
expect(webSource).toContain('interactionPolicy={props.interactionPolicy}');
|
|
238
|
+
expect(optionSource).toContain('interactionPolicy={interactionPolicy}');
|
|
236
239
|
});
|
|
237
240
|
|
|
238
|
-
test('
|
|
239
|
-
const
|
|
241
|
+
test('native suppresses opening while passive', () => {
|
|
242
|
+
const nativeSource = readFeature('form', 'select', 'adapters', 'inbound', 'Select.native.tsx');
|
|
240
243
|
|
|
241
|
-
expect(
|
|
242
|
-
expect(
|
|
243
|
-
|
|
244
|
-
);
|
|
244
|
+
expect(nativeSource).toContain("props.interactionPolicy === 'passive'");
|
|
245
|
+
expect(nativeSource).toContain("contentMode: 'direct'");
|
|
246
|
+
expect(nativeSource).toContain('<BottomSheetFlatList');
|
|
245
247
|
});
|
|
246
248
|
});
|
|
247
249
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { AppBar } from '../../
|
|
3
|
+
import { AppBar } from '../../features/app-bar/public';
|
|
4
4
|
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
5
5
|
import { Screen } from '../screen';
|
|
6
6
|
import { SidebarLayout } from '../sidebar-layout';
|
|
@@ -29,7 +29,5 @@ function SettingsLayoutInner({
|
|
|
29
29
|
|
|
30
30
|
/***
|
|
31
31
|
* Settings page layout with app bar, sidebar, and scrollable content area.
|
|
32
|
-
*
|
|
33
|
-
|
|
34
32
|
*/
|
|
35
33
|
export const SettingsLayout = withZoraThemeScope(SettingsLayoutInner);
|
|
@@ -17,6 +17,14 @@ describe('ZORA bindable component metadata', () => {
|
|
|
17
17
|
expect(registry.DataTable?.bindings?.props?.rows?.value.type).toBe('array');
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
it('keeps Select direct-manifest ownership aligned across metadata registries', () => {
|
|
21
|
+
const select = ZORA_BINDABLE_COMPONENT_META.Select;
|
|
22
|
+
|
|
23
|
+
expect(select.directManifestNode).toBe(true);
|
|
24
|
+
expect(select.directManifestNode).toBe(ZORA_COMPONENT_META.Select.directManifestNode);
|
|
25
|
+
expect(select.bindings.events.valueChange.payload.eventType).toBe('select.valueChange');
|
|
26
|
+
});
|
|
27
|
+
|
|
20
28
|
it('shares canonical Image authoring metadata while preserving dynamic image bindings', () => {
|
|
21
29
|
const image = ZORA_BINDABLE_COMPONENT_META.Image;
|
|
22
30
|
|
|
@@ -190,7 +190,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
190
190
|
name: 'Select',
|
|
191
191
|
category: 'component',
|
|
192
192
|
description: 'Captures one selected string value.',
|
|
193
|
-
directManifestNode:
|
|
193
|
+
directManifestNode: true,
|
|
194
194
|
allowedChildren: [],
|
|
195
195
|
bindings: {
|
|
196
196
|
props: {
|
|
@@ -228,7 +228,6 @@ export const ZORA_BINDABLE_COMPONENT_META = {
|
|
|
228
228
|
payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
|
|
229
229
|
},
|
|
230
230
|
},
|
|
231
|
-
note: 'Form control component; not represented as a manifest node in v1.',
|
|
232
231
|
props: {
|
|
233
232
|
value: {
|
|
234
233
|
type: 'string',
|
|
@@ -106,6 +106,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
106
106
|
'Checkbox',
|
|
107
107
|
'CheckboxGroup',
|
|
108
108
|
'RadioGroup',
|
|
109
|
+
'Select',
|
|
109
110
|
'TextInput',
|
|
110
111
|
]);
|
|
111
112
|
for (const [name, meta] of Object.entries(ZORA_COMPONENT_META)) {
|
|
@@ -146,6 +147,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
146
147
|
'Avatar',
|
|
147
148
|
'AvatarGroup',
|
|
148
149
|
'Badge',
|
|
150
|
+
'Breadcrumbs',
|
|
149
151
|
'Chip',
|
|
150
152
|
'ChipGroup',
|
|
151
153
|
'DataTable',
|
|
@@ -167,6 +169,7 @@ describe('ZORA_COMPONENT_META invariants', () => {
|
|
|
167
169
|
'CheckboxGroup',
|
|
168
170
|
'Radio',
|
|
169
171
|
'RadioGroup',
|
|
172
|
+
'Select',
|
|
170
173
|
'ThemeModeToggle',
|
|
171
174
|
'TextInput',
|
|
172
175
|
'Text',
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { appBarMeta } from '../components/app-bar/meta';
|
|
2
|
-
import { breadcrumbsMeta } from '../components/breadcrumbs/meta';
|
|
3
|
-
import { dropdownMenuMeta, menuMeta } from '../components/menu/meta';
|
|
4
1
|
import { modalMeta } from '../components/modal/meta';
|
|
5
2
|
import { paginationMeta } from '../components/pagination/meta';
|
|
6
3
|
import { ratingMeta } from '../components/rating/meta';
|
|
7
4
|
import { searchBarMeta } from '../components/search-bar/meta';
|
|
8
|
-
import { selectMeta } from '../components/select/meta';
|
|
9
5
|
import { tabsMeta } from '../components/tabs/meta';
|
|
10
6
|
import { toolbarActionMeta, toolbarMeta } from '../components/toolbar/meta';
|
|
11
7
|
import { accordionItemMeta } from '../features/accordion/accordionItemMeta';
|
|
12
8
|
import { accordionMeta } from '../features/accordion/accordionMeta';
|
|
13
9
|
import { activityIndicatorMeta } from '../features/activity-indicator/activityIndicatorMeta';
|
|
10
|
+
import { appBarMeta } from '../features/app-bar/appBarMeta';
|
|
14
11
|
import { forgotPasswordFormMeta } from '../features/auth/forgotPasswordFormMeta';
|
|
15
12
|
import { oauthProviderButtonMeta } from '../features/auth/oauthProviderButtonMeta';
|
|
16
13
|
import { oauthProviderListMeta } from '../features/auth/oauthProviderListMeta';
|
|
@@ -21,6 +18,7 @@ import { avatarGroupMeta } from '../features/avatar/avatarGroupMeta';
|
|
|
21
18
|
import { avatarMeta } from '../features/avatar/avatarMeta';
|
|
22
19
|
import { badgeMeta } from '../features/badge/badgeMeta';
|
|
23
20
|
import { bottomSheetMeta } from '../features/bottom-sheet/bottomSheetMeta';
|
|
21
|
+
import { breadcrumbsMeta } from '../features/breadcrumbs/breadcrumbsMeta';
|
|
24
22
|
import { buttonGroupMeta } from '../features/button/buttonGroupMeta';
|
|
25
23
|
import { buttonMeta } from '../features/button/buttonMeta';
|
|
26
24
|
import { iconButtonMeta } from '../features/button/iconButtonMeta';
|
|
@@ -40,6 +38,7 @@ import { formErrorMeta } from '../features/form/formErrorMeta';
|
|
|
40
38
|
import { formFieldMeta } from '../features/form/formFieldMeta';
|
|
41
39
|
import { formMeta } from '../features/form/formMeta';
|
|
42
40
|
import { radioGroupMeta, radioMeta } from '../features/form/radio/radioMeta';
|
|
41
|
+
import { selectMeta } from '../features/form/select/selectMeta';
|
|
43
42
|
import { textInputMeta } from '../features/form/text-input/textInputMeta';
|
|
44
43
|
import { gradientMeta } from '../features/gradient/gradientMeta';
|
|
45
44
|
import { heroMeta } from '../features/hero/heroMeta';
|
|
@@ -55,6 +54,7 @@ import { stackMeta } from '../features/layout/stackMeta';
|
|
|
55
54
|
import { flatListMeta } from '../features/list/flatListMeta';
|
|
56
55
|
import { sectionListMeta } from '../features/list/sectionListMeta';
|
|
57
56
|
import { missingElementMeta } from '../features/missing-element/missingElementMeta';
|
|
57
|
+
import { popoverMenuMeta } from '../features/popover-menu/popoverMenuMeta';
|
|
58
58
|
import { progressMeta, progressRingMeta } from '../features/progress/progressMeta';
|
|
59
59
|
import {
|
|
60
60
|
skeletonCardMeta,
|
|
@@ -128,7 +128,6 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
128
128
|
ChipGroup: chipGroupMeta,
|
|
129
129
|
DataTable: dataTableMeta,
|
|
130
130
|
DatePicker: datePickerMeta,
|
|
131
|
-
DropdownMenu: dropdownMenuMeta,
|
|
132
131
|
Form: formMeta,
|
|
133
132
|
FormActions: formActionsMeta,
|
|
134
133
|
FormError: formErrorMeta,
|
|
@@ -141,10 +140,10 @@ export const ZORA_COMPONENT_META: ZoraComponentMetaRegistry = finalizeFeatureMet
|
|
|
141
140
|
KeyboardAvoidingView: keyboardAvoidingViewMeta,
|
|
142
141
|
TextInput: textInputMeta,
|
|
143
142
|
MediaCard: mediaCardMeta,
|
|
144
|
-
Menu: menuMeta,
|
|
145
143
|
MetricCard: metricCardMeta,
|
|
146
144
|
Modal: modalMeta,
|
|
147
145
|
Pagination: paginationMeta,
|
|
146
|
+
PopoverMenu: popoverMenuMeta,
|
|
148
147
|
Progress: progressMeta,
|
|
149
148
|
ProgressRing: progressRingMeta,
|
|
150
149
|
Radio: radioMeta,
|
|
@@ -6,30 +6,16 @@ function isRecord(value: unknown): value is Record<string, unknown> {
|
|
|
6
6
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
for (const [entryKey, entryValue] of Object.entries(record)) {
|
|
11
|
-
if (entryKey === key) {
|
|
12
|
-
return entryValue;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function isOptionalPeer(metadata: unknown, packageName: string): boolean {
|
|
20
|
-
if (!isRecord(metadata)) return false;
|
|
21
|
-
const peerMetadata = findRecordValue(metadata, packageName);
|
|
22
|
-
return isRecord(peerMetadata) && peerMetadata.optional === true;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
test('root-entry native imports are required portable peers', async () => {
|
|
9
|
+
test('root-entry native imports expose only required portable peers', async () => {
|
|
26
10
|
const packageJson = JSON.parse(
|
|
27
11
|
await readFile(new URL('../package.json', import.meta.url), 'utf8'),
|
|
28
12
|
) as unknown;
|
|
29
13
|
if (!isRecord(packageJson)) throw new Error('Expected package.json to contain an object.');
|
|
30
14
|
|
|
31
|
-
const { peerDependencies
|
|
32
|
-
expect(
|
|
15
|
+
const { peerDependencies } = packageJson;
|
|
16
|
+
expect(
|
|
17
|
+
isRecord(peerDependencies) && peerDependencies['@react-native-picker/picker'],
|
|
18
|
+
).toBeUndefined();
|
|
33
19
|
expect(isRecord(peerDependencies) && peerDependencies['expo-linear-gradient']).toBeUndefined();
|
|
34
20
|
expect(isRecord(peerDependencies) && peerDependencies['expo-font']).toBeUndefined();
|
|
35
21
|
expect(isRecord(peerDependencies) && peerDependencies['@expo/vector-icons']).toBeUndefined();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
import { AppBar } from '../../
|
|
3
|
+
import { AppBar } from '../../features/app-bar/public';
|
|
4
4
|
import { IconButton } from '../../features/button/public';
|
|
5
5
|
import { Box, Stack } from '../../features/layout/public';
|
|
6
6
|
import { Progress } from '../../features/progress/public';
|
|
@@ -3,11 +3,11 @@ import type { AppCategory } from '@ankhorage/contracts';
|
|
|
3
3
|
import { APP_CATEGORIES } from '@ankhorage/contracts';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
|
|
6
|
-
import { Select } from '../../components/select';
|
|
7
6
|
import { Tabs } from '../../components/tabs';
|
|
8
7
|
import { Badge } from '../../features/badge/public';
|
|
9
8
|
import { Button } from '../../features/button/public';
|
|
10
9
|
import { Card } from '../../features/card/public';
|
|
10
|
+
import { Select } from '../../features/form/select/public';
|
|
11
11
|
import { TextInput } from '../../features/form/text-input/public';
|
|
12
12
|
import { Box, Stack } from '../../features/layout/public';
|
|
13
13
|
import { Heading } from '../../features/typography/public';
|
|
@@ -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 5 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.ts
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { InteractionPolicyProps } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import { AppBar } from './components/app-bar';
|
|
5
|
-
import { Breadcrumbs } from './components/breadcrumbs';
|
|
6
|
-
import { DropdownMenu, Menu } from './components/menu';
|
|
7
4
|
import { Modal } from './components/modal';
|
|
8
5
|
import { Pagination } from './components/pagination';
|
|
9
6
|
import { Rating } from './components/rating';
|
|
10
7
|
import { SearchBar } from './components/search-bar';
|
|
11
|
-
import { Select } from './components/select';
|
|
12
8
|
import { Tabs } from './components/tabs';
|
|
13
9
|
import { Toolbar, ToolbarAction } from './components/toolbar';
|
|
14
10
|
import { Accordion, AccordionItem } from './features/accordion/public';
|
|
15
11
|
import { ActivityIndicator } from './features/activity-indicator/public';
|
|
12
|
+
import { AppBar } from './features/app-bar/public';
|
|
16
13
|
import {
|
|
17
14
|
ForgotPasswordForm,
|
|
18
15
|
OAuthProviderButton,
|
|
@@ -25,6 +22,7 @@ import { Avatar } from './features/avatar/public';
|
|
|
25
22
|
import { AvatarGroup } from './features/avatar/public';
|
|
26
23
|
import { Badge } from './features/badge/public';
|
|
27
24
|
import { BottomSheet } from './features/bottom-sheet/public';
|
|
25
|
+
import { Breadcrumbs } from './features/breadcrumbs/public';
|
|
28
26
|
import { Button } from './features/button/public';
|
|
29
27
|
import { ButtonGroup } from './features/button/public';
|
|
30
28
|
import { IconButton } from './features/button/public';
|
|
@@ -41,6 +39,7 @@ import { EmptyState } from './features/empty-state/public';
|
|
|
41
39
|
import { Checkbox, CheckboxGroup } from './features/form/checkbox/public';
|
|
42
40
|
import { Form, FormActions, FormError, FormField } from './features/form/public';
|
|
43
41
|
import { Radio, RadioGroup } from './features/form/radio/public';
|
|
42
|
+
import { Select } from './features/form/select/public';
|
|
44
43
|
import { TextInput } from './features/form/text-input/public';
|
|
45
44
|
import { Gradient } from './features/gradient/public';
|
|
46
45
|
import { Hero } from './features/hero/public';
|
|
@@ -51,6 +50,7 @@ import { Box, Container, Divider, Grid, Stack } from './features/layout/public';
|
|
|
51
50
|
import { ContentRail } from './features/layout/public';
|
|
52
51
|
import { FlatList, SectionList } from './features/list/public';
|
|
53
52
|
import { MissingElement } from './features/missing-element/public';
|
|
53
|
+
import { PopoverMenu } from './features/popover-menu/public';
|
|
54
54
|
import { Progress, ProgressRing } from './features/progress/public';
|
|
55
55
|
import { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from './features/skeleton/public';
|
|
56
56
|
import { Surface } from './features/surface/public';
|
|
@@ -130,7 +130,6 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
130
130
|
ChipGroup,
|
|
131
131
|
DataTable,
|
|
132
132
|
DatePicker,
|
|
133
|
-
DropdownMenu,
|
|
134
133
|
Form,
|
|
135
134
|
FormActions,
|
|
136
135
|
FormError,
|
|
@@ -143,10 +142,10 @@ const _ZORA_COMPONENT_REGISTRY = {
|
|
|
143
142
|
KeyboardAvoidingView,
|
|
144
143
|
TextInput,
|
|
145
144
|
MediaCard,
|
|
146
|
-
Menu,
|
|
147
145
|
MetricCard,
|
|
148
146
|
Modal,
|
|
149
147
|
Pagination,
|
|
148
|
+
PopoverMenu,
|
|
150
149
|
Progress,
|
|
151
150
|
ProgressRing,
|
|
152
151
|
Radio,
|
|
@@ -56,10 +56,11 @@ 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'),
|
|
63
|
+
join(srcDir, 'features', 'breadcrumbs', 'adapters', 'inbound', 'Breadcrumbs.tsx'),
|
|
63
64
|
join(srcDir, 'features', 'button', 'adapters', 'inbound', 'Button.tsx'),
|
|
64
65
|
join(srcDir, 'features', 'button', 'adapters', 'inbound', 'ButtonGroup.tsx'),
|
|
65
66
|
join(srcDir, 'features', 'card', 'adapters', 'inbound', 'Card.tsx'),
|
|
@@ -73,16 +74,18 @@ const scopedComponentFiles = [
|
|
|
73
74
|
join(srcDir, 'features', 'form', 'adapters', 'inbound', 'FormActions.tsx'),
|
|
74
75
|
join(srcDir, 'features', 'form', 'adapters', 'inbound', 'FormError.tsx'),
|
|
75
76
|
join(srcDir, 'features', 'form', 'adapters', 'inbound', 'FormField.tsx'),
|
|
77
|
+
join(srcDir, 'features', 'form', 'select', 'adapters', 'inbound', 'Select.native.tsx'),
|
|
78
|
+
join(srcDir, 'features', 'form', 'select', 'adapters', 'inbound', 'Select.web.tsx'),
|
|
76
79
|
join(srcDir, 'features', 'typography', 'adapters', 'inbound', 'Heading.tsx'),
|
|
77
80
|
join(srcDir, 'features', 'icon', 'adapters', 'inbound', 'Icon.tsx'),
|
|
78
81
|
join(srcDir, 'features', 'button', 'adapters', 'inbound', 'IconButton.tsx'),
|
|
79
82
|
join(srcDir, 'features', 'form', 'text-input', 'adapters', 'inbound', 'TextInput.tsx'),
|
|
80
83
|
join(srcDir, 'components', 'modal', 'Modal.tsx'),
|
|
84
|
+
join(srcDir, 'features', 'popover-menu', 'adapters', 'inbound', 'PopoverMenu.tsx'),
|
|
81
85
|
join(srcDir, 'features', 'progress', 'adapters', 'inbound', 'Progress.tsx'),
|
|
82
86
|
join(srcDir, 'features', 'form', 'radio', 'adapters', 'inbound', 'Radio.tsx'),
|
|
83
87
|
join(srcDir, 'features', 'form', 'radio', 'adapters', 'inbound', 'RadioGroup.tsx'),
|
|
84
88
|
join(srcDir, 'components', 'rating', 'Rating.tsx'),
|
|
85
|
-
join(srcDir, 'components', 'select', 'Select.tsx'),
|
|
86
89
|
join(srcDir, 'components', 'tabs', 'Tabs.tsx'),
|
|
87
90
|
join(srcDir, 'features', 'time-picker', 'adapters', 'inbound', 'TimePicker.native.tsx'),
|
|
88
91
|
join(srcDir, 'features', 'time-picker', 'adapters', 'inbound', 'TimePicker.web.tsx'),
|
|
@@ -134,9 +137,10 @@ const scopedComponentFiles = [
|
|
|
134
137
|
] as const;
|
|
135
138
|
|
|
136
139
|
const scopedPropTypeFiles = [
|
|
137
|
-
join(srcDir, '
|
|
140
|
+
join(srcDir, 'types', 'app-bar.ts'),
|
|
138
141
|
join(srcDir, 'types', 'accordion.ts'),
|
|
139
142
|
join(srcDir, 'types', 'badge.ts'),
|
|
143
|
+
join(srcDir, 'types', 'breadcrumbs.ts'),
|
|
140
144
|
join(srcDir, 'types', 'button.ts'),
|
|
141
145
|
join(srcDir, 'types', 'button-group.ts'),
|
|
142
146
|
join(srcDir, 'types', 'card.ts'),
|
|
@@ -150,10 +154,11 @@ const scopedPropTypeFiles = [
|
|
|
150
154
|
join(srcDir, 'types', 'icon-button.ts'),
|
|
151
155
|
join(srcDir, 'types', 'text-input.ts'),
|
|
152
156
|
join(srcDir, 'components', 'modal', 'types.ts'),
|
|
157
|
+
join(srcDir, 'types', 'popover-menu.ts'),
|
|
153
158
|
join(srcDir, 'types', 'progress.ts'),
|
|
154
159
|
join(srcDir, 'types', 'radio.ts'),
|
|
155
160
|
join(srcDir, 'components', 'rating', 'types.ts'),
|
|
156
|
-
join(srcDir, '
|
|
161
|
+
join(srcDir, 'types', 'select.ts'),
|
|
157
162
|
join(srcDir, 'components', 'tabs', 'types.ts'),
|
|
158
163
|
join(srcDir, 'types', 'text.ts'),
|
|
159
164
|
join(srcDir, 'types', 'time-picker.ts'),
|
|
@@ -194,7 +199,7 @@ describe('theme scope structure', () => {
|
|
|
194
199
|
it('implements nested scopes without nesting Surface ThemeProvider', () => {
|
|
195
200
|
expect(themeScopeSource).toMatch(/<ThemeContext\s+value=/u);
|
|
196
201
|
expect(themeScopeSource).toMatch(/createTheme\(/u);
|
|
197
|
-
expect(themeScopeSource).not.toMatch(
|
|
202
|
+
expect(themeScopeSource).not.toMatch(/<ThemeProvider\b/u);
|
|
198
203
|
});
|
|
199
204
|
|
|
200
205
|
it('wraps components only when mode/themeId overrides are present', () => {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import type { ZoraBaseProps } from '
|
|
4
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
5
|
+
import type { PopoverMenuAction } from './popover-menu';
|
|
5
6
|
|
|
6
7
|
export type AppBarMode =
|
|
7
8
|
| {
|
|
@@ -16,11 +17,13 @@ export type AppBarMode =
|
|
|
16
17
|
cancelIcon?: ButtonIconSpec;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
|
-
export interface
|
|
20
|
-
|
|
20
|
+
export interface AppBarOverflowMenu {
|
|
21
|
+
actions: readonly PopoverMenuAction[];
|
|
21
22
|
label?: string;
|
|
22
23
|
icon?: ButtonIconSpec;
|
|
23
24
|
disabled?: boolean;
|
|
25
|
+
closeOnSelect?: boolean;
|
|
26
|
+
onDismiss?: () => void;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
export interface AppBarProps extends ZoraBaseProps {
|
|
@@ -28,7 +31,7 @@ export interface AppBarProps extends ZoraBaseProps {
|
|
|
28
31
|
subtitle?: React.ReactNode;
|
|
29
32
|
leading?: React.ReactNode;
|
|
30
33
|
actions?: React.ReactNode;
|
|
31
|
-
overflow?:
|
|
34
|
+
overflow?: AppBarOverflowMenu;
|
|
32
35
|
appMode?: AppBarMode;
|
|
33
36
|
children?: React.ReactNode;
|
|
34
37
|
safeAreaTop?: boolean;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
2
|
|
|
4
|
-
import type { ZoraBaseProps } from '
|
|
3
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
5
4
|
|
|
6
5
|
export interface BreadcrumbItem {
|
|
7
6
|
id: string;
|
|
8
|
-
label:
|
|
7
|
+
label: string;
|
|
9
8
|
icon?: ButtonIconSpec;
|
|
10
|
-
onPress?: () => void;
|
|
11
9
|
disabled?: boolean;
|
|
12
10
|
}
|
|
13
11
|
|
|
12
|
+
export interface BreadcrumbPressEvent {
|
|
13
|
+
id: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
14
16
|
export interface BreadcrumbsProps extends ZoraBaseProps {
|
|
15
17
|
items: readonly BreadcrumbItem[];
|
|
16
|
-
separator?:
|
|
18
|
+
separator?: string;
|
|
17
19
|
maxItems?: number;
|
|
18
20
|
compact?: boolean;
|
|
19
21
|
disabled?: boolean;
|
|
22
|
+
onItemPress?: (event: BreadcrumbPressEvent) => void;
|
|
20
23
|
testID?: string;
|
|
21
24
|
}
|
package/src/types/data-table.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
|
-
import type { MenuActionIntent } from '../components/menu';
|
|
5
4
|
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
5
|
+
import type { PopoverMenuActionIntent } from './popover-menu';
|
|
6
6
|
|
|
7
7
|
export type DataTableColumnAlign = 'start' | 'center' | 'end';
|
|
8
8
|
export type DataTableDensity = 'comfortable' | 'compact';
|
|
@@ -36,7 +36,7 @@ export interface DataTableRowAction<TRow extends object> {
|
|
|
36
36
|
title: React.ReactNode;
|
|
37
37
|
description?: React.ReactNode;
|
|
38
38
|
icon?: ButtonIconSpec;
|
|
39
|
-
intent?:
|
|
39
|
+
intent?: PopoverMenuActionIntent;
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
onPress?: (row: TRow) => void;
|
|
42
42
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ButtonIconSpec,
|
|
3
|
+
PopoverAnchorRenderProps,
|
|
4
|
+
PopoverMenuActionIntent as SurfacePopoverMenuActionIntent,
|
|
5
|
+
} from '@ankhorage/surface';
|
|
6
|
+
import type React from 'react';
|
|
7
|
+
|
|
8
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
9
|
+
|
|
10
|
+
export type PopoverMenuActionIntent = SurfacePopoverMenuActionIntent;
|
|
11
|
+
|
|
12
|
+
export interface PopoverMenuAction {
|
|
13
|
+
id: string;
|
|
14
|
+
title: React.ReactNode;
|
|
15
|
+
description?: React.ReactNode;
|
|
16
|
+
icon?: ButtonIconSpec;
|
|
17
|
+
leading?: React.ReactNode;
|
|
18
|
+
trailing?: React.ReactNode;
|
|
19
|
+
intent?: PopoverMenuActionIntent;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
selected?: boolean;
|
|
22
|
+
onPress?: () => void;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PopoverMenuProps extends ZoraBaseProps {
|
|
26
|
+
trigger: (controls: PopoverAnchorRenderProps) => React.ReactNode;
|
|
27
|
+
actions: readonly PopoverMenuAction[];
|
|
28
|
+
onDismiss?: () => void;
|
|
29
|
+
closeOnSelect?: boolean;
|
|
30
|
+
testID?: string;
|
|
31
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ZoraBaseProps } from '
|
|
1
|
+
import type { ZoraBaseProps } from '../theme/ZoraBaseProps';
|
|
2
2
|
|
|
3
3
|
export interface SelectOption<TValue extends string = string> {
|
|
4
4
|
value: TValue;
|
|
@@ -7,9 +7,17 @@ export interface SelectOption<TValue extends string = string> {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export interface SelectProps<TValue extends string = string> extends ZoraBaseProps {
|
|
10
|
-
value
|
|
10
|
+
value?: TValue;
|
|
11
|
+
defaultValue?: TValue;
|
|
11
12
|
options: readonly SelectOption<TValue>[];
|
|
12
|
-
onValueChange
|
|
13
|
+
onValueChange?: (value: TValue) => void;
|
|
14
|
+
label?: string;
|
|
15
|
+
helperText?: string;
|
|
16
|
+
errorText?: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
required?: boolean;
|
|
13
19
|
disabled?: boolean;
|
|
20
|
+
readOnly?: boolean;
|
|
14
21
|
invalid?: boolean;
|
|
22
|
+
testID?: string;
|
|
15
23
|
}
|
|
@@ -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"}
|