@ankhorage/zora 14.0.1 → 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 +6 -0
- package/README.md +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.d.ts.map +1 -1
- package/dist/features/app-bar/adapters/inbound/AppBar.js +28 -27
- package/dist/features/app-bar/adapters/inbound/AppBar.js.map +1 -1
- package/dist/features/app-bar/public.d.ts +1 -1
- package/dist/features/app-bar/public.d.ts.map +1 -1
- package/dist/features/app-bar/public.js.map +1 -1
- 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 +4 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.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 +4 -5
- package/dist/metadata/componentMeta.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 +4 -5
- package/dist/registry.js.map +1 -1
- package/dist/types/app-bar.d.ts +6 -3
- package/dist/types/app-bar.d.ts.map +1 -1
- package/dist/types/app-bar.js.map +1 -1
- 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 +50 -42
- package/src/features/app-bar/public.ts +1 -1
- 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 +14 -7
- package/src/interactionPolicy.test.ts +19 -21
- 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 +4 -5
- package/src/nativePeerContract.test.ts +5 -19
- package/src/patterns/theme-composer/ThemeComposer.tsx +1 -1
- package/src/platformAcceptance.test.ts +1 -1
- package/src/registry.ts +4 -5
- package/src/theme/themeScopeStructure.test.ts +8 -3
- package/src/types/app-bar.ts +6 -3
- 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/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/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
|
@@ -60,6 +60,7 @@ const scopedComponentFiles = [
|
|
|
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'),
|
|
@@ -137,6 +140,7 @@ const scopedPropTypeFiles = [
|
|
|
137
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', () => {
|
package/src/types/app-bar.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
|
2
2
|
import type React from 'react';
|
|
3
3
|
|
|
4
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 { BreadcrumbsProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Renders a breadcrumb trail for hierarchical navigation.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Breadcrumbs: (props: BreadcrumbsProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=Breadcrumbs.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAkB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAsIhE;;GAEG;AACH,eAAO,MAAM,WAAW,wDAAuC,CAAC"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button } from '../../features/button/public';
|
|
3
|
-
import { Icon } from '../../features/icon/public';
|
|
4
|
-
import { Text } from '../../features/typography/public';
|
|
5
|
-
import { Inline } from '../../foundation';
|
|
6
|
-
import { resolveIconSize } from '../../internal/recipes';
|
|
7
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
8
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
9
|
-
function normalizeMaxItems(value) {
|
|
10
|
-
if (value === undefined || !Number.isFinite(value)) {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
return Math.max(0, Math.trunc(value));
|
|
14
|
-
}
|
|
15
|
-
function createRenderItems(items, maxItems) {
|
|
16
|
-
if (maxItems === undefined || maxItems === 0 || items.length <= maxItems || maxItems < 3) {
|
|
17
|
-
return items.map((item) => ({ item, type: 'item' }));
|
|
18
|
-
}
|
|
19
|
-
const [firstItem] = items;
|
|
20
|
-
if (firstItem === undefined) {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
const trailingCount = maxItems - 2;
|
|
24
|
-
const trailingItems = items.slice(items.length - trailingCount);
|
|
25
|
-
return [
|
|
26
|
-
{ item: firstItem, type: 'item' },
|
|
27
|
-
{ type: 'ellipsis' },
|
|
28
|
-
...trailingItems.map((item) => ({ item, type: 'item' })),
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
function renderSeparator(separator) {
|
|
32
|
-
return (<Text emphasis="muted" variant="bodySmall">
|
|
33
|
-
{separator}
|
|
34
|
-
</Text>);
|
|
35
|
-
}
|
|
36
|
-
function BreadcrumbLabel({ item, compact }) {
|
|
37
|
-
const { theme } = useZoraTheme();
|
|
38
|
-
return (<Inline align="center" gap="xs" wrap="nowrap">
|
|
39
|
-
{item.icon ? (<Icon {...item.icon} color={theme.semantics.content.muted} size={resolveIconSize(compact ? 's' : 'm')}/>) : null}
|
|
40
|
-
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
41
|
-
{item.label}
|
|
42
|
-
</Text>
|
|
43
|
-
</Inline>);
|
|
44
|
-
}
|
|
45
|
-
function BreadcrumbsInner({ themeId: _themeId, mode: _mode, interactionPolicy, items, separator = '/', maxItems, compact = false, disabled = false, testID, }) {
|
|
46
|
-
const normalizedMaxItems = normalizeMaxItems(maxItems);
|
|
47
|
-
const renderItems = createRenderItems(items, normalizedMaxItems);
|
|
48
|
-
const currentItemId = items.at(-1)?.id;
|
|
49
|
-
if (items.length === 0) {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
return (<Inline align="center" gap={compact ? 'xs' : 's'} testID={testID} wrap="wrap">
|
|
53
|
-
{renderItems.map((renderItem, index) => {
|
|
54
|
-
const isLastRenderedItem = index === renderItems.length - 1;
|
|
55
|
-
const showSeparator = !isLastRenderedItem;
|
|
56
|
-
if (renderItem.type === 'ellipsis') {
|
|
57
|
-
return (<React.Fragment key="ellipsis">
|
|
58
|
-
<Text emphasis="muted" variant={compact ? 'caption' : 'bodySmall'}>
|
|
59
|
-
…
|
|
60
|
-
</Text>
|
|
61
|
-
{showSeparator ? renderSeparator(separator) : null}
|
|
62
|
-
</React.Fragment>);
|
|
63
|
-
}
|
|
64
|
-
const { item } = renderItem;
|
|
65
|
-
const current = item.id === currentItemId;
|
|
66
|
-
const interactive = !current && !disabled && !item.disabled && Boolean(item.onPress);
|
|
67
|
-
return (<React.Fragment key={item.id}>
|
|
68
|
-
{interactive ? (<Button color="neutral" interactionPolicy={interactionPolicy} leadingIcon={item.icon} onPress={item.onPress} size={compact ? 's' : 'm'} testID={testID ? `${testID}-item-${item.id}` : undefined} variant="ghost">
|
|
69
|
-
{item.label}
|
|
70
|
-
</Button>) : (<BreadcrumbLabel item={item} compact={compact}/>)}
|
|
71
|
-
{showSeparator ? renderSeparator(separator) : null}
|
|
72
|
-
</React.Fragment>);
|
|
73
|
-
})}
|
|
74
|
-
</Inline>);
|
|
75
|
-
}
|
|
76
|
-
/***
|
|
77
|
-
* Renders a breadcrumb trail for hierarchical navigation.
|
|
78
|
-
*/
|
|
79
|
-
export const Breadcrumbs = withZoraThemeScope(BreadcrumbsInner);
|
|
80
|
-
//# sourceMappingURL=Breadcrumbs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","sourceRoot":"","sources":["../../../src/components/breadcrumbs/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C,QAAQ,CAAC,CAClB,CAAC;QACJ,CAAC,CAAC,CACJ;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAC,gBAAgB,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Button } from '../../features/button/public';\nimport { Icon } from '../../features/icon/public';\nimport { Text } from '../../features/typography/public';\nimport { Inline } from '../../foundation';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { BreadcrumbItem, BreadcrumbsProps } from './types';\n\ntype BreadcrumbRenderItem =\n | {\n item: BreadcrumbItem;\n type: 'item';\n }\n | {\n type: 'ellipsis';\n };\n\nfunction normalizeMaxItems(value: number | undefined): number | undefined {\n if (value === undefined || !Number.isFinite(value)) {\n return undefined;\n }\n\n return Math.max(0, Math.trunc(value));\n}\n\nfunction createRenderItems(\n items: readonly BreadcrumbItem[],\n maxItems: number | undefined,\n): readonly BreadcrumbRenderItem[] {\n if (maxItems === undefined || maxItems === 0 || items.length <= maxItems || maxItems < 3) {\n return items.map((item) => ({ item, type: 'item' }));\n }\n\n const [firstItem] = items;\n if (firstItem === undefined) {\n return [];\n }\n\n const trailingCount = maxItems - 2;\n const trailingItems = items.slice(items.length - trailingCount);\n\n return [\n { item: firstItem, type: 'item' },\n { type: 'ellipsis' },\n ...trailingItems.map((item) => ({ item, type: 'item' }) satisfies BreadcrumbRenderItem),\n ];\n}\n\nfunction renderSeparator(separator: React.ReactNode) {\n return (\n <Text emphasis=\"muted\" variant=\"bodySmall\">\n {separator}\n </Text>\n );\n}\n\nfunction BreadcrumbLabel({ item, compact }: { item: BreadcrumbItem; compact: boolean }) {\n const { theme } = useZoraTheme();\n\n return (\n <Inline align=\"center\" gap=\"xs\" wrap=\"nowrap\">\n {item.icon ? (\n <Icon\n {...item.icon}\n color={theme.semantics.content.muted}\n size={resolveIconSize(compact ? 's' : 'm')}\n />\n ) : null}\n <Text emphasis=\"muted\" variant={compact ? 'caption' : 'bodySmall'}>\n {item.label}\n </Text>\n </Inline>\n );\n}\n\nfunction BreadcrumbsInner({\n themeId: _themeId,\n mode: _mode,\n interactionPolicy,\n items,\n separator = '/',\n maxItems,\n compact = false,\n disabled = false,\n testID,\n}: BreadcrumbsProps) {\n const normalizedMaxItems = normalizeMaxItems(maxItems);\n const renderItems = createRenderItems(items, normalizedMaxItems);\n const currentItemId = items.at(-1)?.id;\n\n if (items.length === 0) {\n return null;\n }\n\n return (\n <Inline align=\"center\" gap={compact ? 'xs' : 's'} testID={testID} wrap=\"wrap\">\n {renderItems.map((renderItem, index) => {\n const isLastRenderedItem = index === renderItems.length - 1;\n const showSeparator = !isLastRenderedItem;\n\n if (renderItem.type === 'ellipsis') {\n return (\n <React.Fragment key=\"ellipsis\">\n <Text emphasis=\"muted\" variant={compact ? 'caption' : 'bodySmall'}>\n …\n </Text>\n {showSeparator ? renderSeparator(separator) : null}\n </React.Fragment>\n );\n }\n\n const { item } = renderItem;\n const current = item.id === currentItemId;\n const interactive = !current && !disabled && !item.disabled && Boolean(item.onPress);\n\n return (\n <React.Fragment key={item.id}>\n {interactive ? (\n <Button\n color=\"neutral\"\n interactionPolicy={interactionPolicy}\n leadingIcon={item.icon}\n onPress={item.onPress}\n size={compact ? 's' : 'm'}\n testID={testID ? `${testID}-item-${item.id}` : undefined}\n variant=\"ghost\"\n >\n {item.label}\n </Button>\n ) : (\n <BreadcrumbLabel item={item} compact={compact} />\n )}\n {showSeparator ? renderSeparator(separator) : null}\n </React.Fragment>\n );\n })}\n </Inline>\n );\n}\n\n/***\n * Renders a breadcrumb trail for hierarchical navigation.\n */\nexport const Breadcrumbs = withZoraThemeScope(BreadcrumbsInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { Breadcrumbs } from './Breadcrumbs';\nexport type { BreadcrumbItem, BreadcrumbsProps } from './types';\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const breadcrumbsMeta: {
|
|
2
|
-
readonly name: "Breadcrumbs";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Code-facing route hierarchy component; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumbs/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe;;;;;;;CAOU,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export const breadcrumbsMeta = {
|
|
2
|
-
name: 'Breadcrumbs',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Code-facing route hierarchy component; not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=meta.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../src/components/breadcrumbs/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,aAAa;IACnB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,kFAAkF;IACxF,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const breadcrumbsMeta = {\n name: 'Breadcrumbs',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Code-facing route hierarchy 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/breadcrumbs/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,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,KAAK,EAAE,SAAS,cAAc,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/breadcrumbs/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 interface BreadcrumbItem {\n id: string;\n label: React.ReactNode;\n icon?: ButtonIconSpec;\n onPress?: () => void;\n disabled?: boolean;\n}\n\nexport interface BreadcrumbsProps extends ZoraBaseProps {\n items: readonly BreadcrumbItem[];\n separator?: React.ReactNode;\n maxItems?: number;\n compact?: boolean;\n disabled?: boolean;\n testID?: string;\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { DropdownMenuProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Convenience wrapper for rendering a `Menu` as a dropdown.
|
|
5
|
-
*/
|
|
6
|
-
export declare function DropdownMenu(props: DropdownMenuProps): React.JSX.Element;
|
|
7
|
-
//# sourceMappingURL=DropdownMenu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qBAEpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sourceRoot":"","sources":["../../../src/components/menu/DropdownMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB;IACnD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7B,CAAC","sourcesContent":["import React from 'react';\n\nimport { Menu } from './Menu';\nimport type { DropdownMenuProps } from './types';\n\n/***\n * Convenience wrapper for rendering a `Menu` as a dropdown.\n */\nexport function DropdownMenu(props: DropdownMenuProps) {\n return <Menu {...props} />;\n}\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { MenuProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Presents a list of actions as a menu with optional icons and intent styling.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Menu: (props: MenuProps) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=Menu.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,SAAS,CAAC;AA+CrD;;GAEG;AACH,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Menu as SurfaceMenu } from '@ankhorage/surface';
|
|
2
|
-
import React, { useMemo } from 'react';
|
|
3
|
-
import { Icon } from '../../features/icon/public';
|
|
4
|
-
import { Box } from '../../features/layout/public';
|
|
5
|
-
import { resolveIconSize } from '../../internal/recipes';
|
|
6
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
7
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
8
|
-
function renderActionLeading(action, iconColor) {
|
|
9
|
-
if (action.leading) {
|
|
10
|
-
return action.leading;
|
|
11
|
-
}
|
|
12
|
-
if (!action.icon) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return <Icon {...action.icon} color={iconColor} size={resolveIconSize('s')}/>;
|
|
16
|
-
}
|
|
17
|
-
function renderActionTrailing(action) {
|
|
18
|
-
if (!action.trailing) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
return <Box>{action.trailing}</Box>;
|
|
22
|
-
}
|
|
23
|
-
function toSurfaceAction(action, iconColor) {
|
|
24
|
-
return {
|
|
25
|
-
activate: action.onPress,
|
|
26
|
-
description: action.description,
|
|
27
|
-
disabled: action.disabled,
|
|
28
|
-
id: action.id,
|
|
29
|
-
intent: action.intent,
|
|
30
|
-
leading: renderActionLeading(action, iconColor),
|
|
31
|
-
selected: action.selected,
|
|
32
|
-
title: action.title,
|
|
33
|
-
trailing: renderActionTrailing(action),
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function MenuInner({ themeId: _themeId, mode: _mode, actions, onDismiss, ...props }) {
|
|
37
|
-
const { theme } = useZoraTheme();
|
|
38
|
-
const iconColor = theme.semantics.content.muted;
|
|
39
|
-
const surfaceActions = useMemo(() => actions.map((action) => toSurfaceAction(action, iconColor)), [actions, iconColor]);
|
|
40
|
-
return <SurfaceMenu {...props} actions={surfaceActions} dismiss={onDismiss}/>;
|
|
41
|
-
}
|
|
42
|
-
/***
|
|
43
|
-
* Presents a list of actions as a menu with optional icons and intent styling.
|
|
44
|
-
*/
|
|
45
|
-
export const Menu = withZoraThemeScope(MenuInner);
|
|
46
|
-
//# sourceMappingURL=Menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,WAAW,EAAwC,MAAM,oBAAoB,CAAC;AAC/F,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,8BAA8B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EA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,YAAY,EAAE,CAAC;IACjC,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC;IAChD,MAAM,cAAc,GAAG,OAAO,CAC5B,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EACjE,CAAC,OAAO,EAAE,SAAS,CAAC,CACrB,CAAC;IAEF,OAAO,CAAC,WAAW,CAAC,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,EAAG,CAAC;AACjF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import { Menu as SurfaceMenu, type MenuAction as SurfaceMenuAction } from '@ankhorage/surface';\nimport React, { useMemo } from 'react';\n\nimport { Icon } from '../../features/icon/public';\nimport { Box } from '../../features/layout/public';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { MenuAction, MenuProps } from './types';\n\nfunction renderActionLeading(action: MenuAction, iconColor: string) {\n if (action.leading) {\n return action.leading;\n }\n\n if (!action.icon) {\n return undefined;\n }\n\n return <Icon {...action.icon} color={iconColor} size={resolveIconSize('s')} />;\n}\n\nfunction renderActionTrailing(action: MenuAction) {\n if (!action.trailing) {\n return undefined;\n }\n\n return <Box>{action.trailing}</Box>;\n}\n\nfunction toSurfaceAction(action: MenuAction, iconColor: string): SurfaceMenuAction {\n return {\n activate: action.onPress,\n description: action.description,\n disabled: action.disabled,\n id: action.id,\n intent: action.intent,\n leading: renderActionLeading(action, iconColor),\n selected: action.selected,\n title: action.title,\n trailing: renderActionTrailing(action),\n };\n}\n\nfunction MenuInner({ themeId: _themeId, mode: _mode, actions, onDismiss, ...props }: MenuProps) {\n const { theme } = useZoraTheme();\n const iconColor = theme.semantics.content.muted;\n const surfaceActions = useMemo(\n () => actions.map((action) => toSurfaceAction(action, iconColor)),\n [actions, iconColor],\n );\n\n return <SurfaceMenu {...props} actions={surfaceActions} dismiss={onDismiss} />;\n}\n\n/***\n * Presents a list of actions as a menu with optional icons and intent styling.\n */\nexport const Menu = withZoraThemeScope(MenuInner);\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC","sourcesContent":["export { DropdownMenu } from './DropdownMenu';\nexport { Menu } from './Menu';\nexport type { DropdownMenuProps, MenuAction, MenuActionIntent, MenuProps } from './types';\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const menuMeta: {
|
|
2
|
-
readonly name: "Menu";
|
|
3
|
-
readonly category: "component";
|
|
4
|
-
readonly directManifestNode: false;
|
|
5
|
-
readonly allowedChildren: readonly [];
|
|
6
|
-
readonly note: "Surface-backed action menu; not represented as a manifest node in v1.";
|
|
7
|
-
readonly props: {};
|
|
8
|
-
};
|
|
9
|
-
export declare const dropdownMenuMeta: {
|
|
10
|
-
readonly name: "DropdownMenu";
|
|
11
|
-
readonly category: "component";
|
|
12
|
-
readonly directManifestNode: false;
|
|
13
|
-
readonly allowedChildren: readonly [];
|
|
14
|
-
readonly note: "Product-facing alias for Menu trigger/action composition; 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/menu/meta.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ;;;;;;;CAOiB,CAAC;AAEvC,eAAO,MAAM,gBAAgB;;;;;;;CAOS,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const menuMeta = {
|
|
2
|
-
name: 'Menu',
|
|
3
|
-
category: 'component',
|
|
4
|
-
directManifestNode: false,
|
|
5
|
-
allowedChildren: [],
|
|
6
|
-
note: 'Surface-backed action menu; not represented as a manifest node in v1.',
|
|
7
|
-
props: {},
|
|
8
|
-
};
|
|
9
|
-
export const dropdownMenuMeta = {
|
|
10
|
-
name: 'DropdownMenu',
|
|
11
|
-
category: 'component',
|
|
12
|
-
directManifestNode: false,
|
|
13
|
-
allowedChildren: [],
|
|
14
|
-
note: 'Product-facing alias for Menu trigger/action composition; 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/menu/meta.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,uEAAuE;IAC7E,KAAK,EAAE,EAAE;CAC2B,CAAC;AAEvC,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,WAAW;IACrB,kBAAkB,EAAE,KAAK;IACzB,eAAe,EAAE,EAAE;IACnB,IAAI,EAAE,qGAAqG;IAC3G,KAAK,EAAE,EAAE;CAC2B,CAAC","sourcesContent":["import type { ZoraComponentMeta } from '../../metadata';\n\nexport const menuMeta = {\n name: 'Menu',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Surface-backed action menu; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n\nexport const dropdownMenuMeta = {\n name: 'DropdownMenu',\n category: 'component',\n directManifestNode: false,\n allowedChildren: [],\n note: 'Product-facing alias for Menu trigger/action composition; not represented as a manifest node in v1.',\n props: {},\n} as const satisfies ZoraComponentMeta;\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ButtonIconSpec, MenuActionIntent as SurfaceMenuActionIntent, MenuProps as SurfaceMenuProps } from '@ankhorage/surface';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
-
export type MenuActionIntent = SurfaceMenuActionIntent;
|
|
5
|
-
export interface MenuAction {
|
|
6
|
-
id: string;
|
|
7
|
-
title: React.ReactNode;
|
|
8
|
-
description?: React.ReactNode;
|
|
9
|
-
icon?: ButtonIconSpec;
|
|
10
|
-
leading?: React.ReactNode;
|
|
11
|
-
trailing?: React.ReactNode;
|
|
12
|
-
intent?: MenuActionIntent;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
selected?: boolean;
|
|
15
|
-
onPress?: () => void;
|
|
16
|
-
}
|
|
17
|
-
export interface MenuProps extends ZoraBaseProps, Omit<SurfaceMenuProps, 'actions' | 'dismiss' | 'mode' | 'themeId'> {
|
|
18
|
-
actions: readonly MenuAction[];
|
|
19
|
-
onDismiss?: () => void;
|
|
20
|
-
}
|
|
21
|
-
export type DropdownMenuProps = MenuProps;
|
|
22
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,IAAI,uBAAuB,EAC3C,SAAS,IAAI,gBAAgB,EAC9B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,SACf,SAAQ,aAAa,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;IACzF,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/menu/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonIconSpec,\n MenuActionIntent as SurfaceMenuActionIntent,\n MenuProps as SurfaceMenuProps,\n} from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport type MenuActionIntent = SurfaceMenuActionIntent;\n\nexport interface MenuAction {\n id: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n icon?: ButtonIconSpec;\n leading?: React.ReactNode;\n trailing?: React.ReactNode;\n intent?: MenuActionIntent;\n disabled?: boolean;\n selected?: boolean;\n onPress?: () => void;\n}\n\nexport interface MenuProps\n extends ZoraBaseProps, Omit<SurfaceMenuProps, 'actions' | 'dismiss' | 'mode' | 'themeId'> {\n actions: readonly MenuAction[];\n onDismiss?: () => void;\n}\n\nexport type DropdownMenuProps = MenuProps;\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { SelectProps } from './types';
|
|
3
|
-
/***
|
|
4
|
-
* Select control for choosing a value from a list of options.
|
|
5
|
-
*/
|
|
6
|
-
export declare const Select: <TValue extends string = string>(props: SelectProps<TValue>) => React.ReactElement | null;
|
|
7
|
-
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAwD3C;;GAEG;AACH,eAAO,MAAM,MAAM,GAzDE,MAAM,SAAS,MAAM,mEAyDW,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Picker } from '@react-native-picker/picker';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
4
|
-
import { Box } from '../../features/layout/public';
|
|
5
|
-
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
6
|
-
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
|
-
function SelectInner({ themeId: _themeId, mode: _mode, value, options, onValueChange, disabled, invalid, testID, interactionPolicy, }) {
|
|
8
|
-
const { theme } = useZoraTheme();
|
|
9
|
-
const passive = interactionPolicy === 'passive';
|
|
10
|
-
return (<Box bg="surface" borderColor={invalid ? theme.colors.error : theme.colors.border} borderWidth={1} opacity={disabled ? 0.5 : 1} radius="m" testID={testID}>
|
|
11
|
-
<View style={{ pointerEvents: passive ? 'none' : 'auto' }}>
|
|
12
|
-
<Picker enabled={!disabled} onValueChange={(itemValue) => {
|
|
13
|
-
if (!passive) {
|
|
14
|
-
onValueChange(itemValue);
|
|
15
|
-
}
|
|
16
|
-
}} selectedValue={value} style={{
|
|
17
|
-
height: 44,
|
|
18
|
-
width: '100%',
|
|
19
|
-
backgroundColor: 'transparent',
|
|
20
|
-
color: theme.colors.text,
|
|
21
|
-
borderWidth: 0,
|
|
22
|
-
}}>
|
|
23
|
-
{options.map((option) => (<Picker.Item key={option.value} enabled={!option.disabled} label={option.label} value={option.value}/>))}
|
|
24
|
-
</Picker>
|
|
25
|
-
</View>
|
|
26
|
-
</Box>);
|
|
27
|
-
}
|
|
28
|
-
/***
|
|
29
|
-
* Select control for choosing a value from a list of options.
|
|
30
|
-
*/
|
|
31
|
-
export const Select = withZoraThemeScope(SelectInner);
|
|
32
|
-
//# sourceMappingURL=Select.js.map
|