@ankhorage/zora 28.5.2 → 28.6.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +5 -1
  3. package/dist/capabilities/index.js +73 -3
  4. package/dist/capabilities/index.js.map +3 -3
  5. package/dist/features/carousel/Carousel.d.ts.map +1 -1
  6. package/dist/features/carousel/Carousel.js +85 -8
  7. package/dist/features/carousel/Carousel.js.map +1 -1
  8. package/dist/features/form/select/adapters/inbound/Select.native.d.ts.map +1 -1
  9. package/dist/features/form/select/adapters/inbound/Select.native.js +71 -8
  10. package/dist/features/form/select/adapters/inbound/Select.native.js.map +1 -1
  11. package/dist/features/form/select/adapters/inbound/Select.web.d.ts.map +1 -1
  12. package/dist/features/form/select/adapters/inbound/Select.web.js +5 -3
  13. package/dist/features/form/select/adapters/inbound/Select.web.js.map +1 -1
  14. package/dist/features/form/select/composition/SelectSearchInput.d.ts +10 -0
  15. package/dist/features/form/select/composition/SelectSearchInput.d.ts.map +1 -0
  16. package/dist/features/form/select/composition/SelectSearchInput.js +11 -0
  17. package/dist/features/form/select/composition/SelectSearchInput.js.map +1 -0
  18. package/dist/features/form/select/composition/getVisibleSelectOptions.d.ts +4 -0
  19. package/dist/features/form/select/composition/getVisibleSelectOptions.d.ts.map +1 -0
  20. package/dist/features/form/select/composition/getVisibleSelectOptions.js +8 -0
  21. package/dist/features/form/select/composition/getVisibleSelectOptions.js.map +1 -0
  22. package/dist/features/form/select/composition/useSelectController.d.ts +3 -0
  23. package/dist/features/form/select/composition/useSelectController.d.ts.map +1 -1
  24. package/dist/features/form/select/composition/useSelectController.js +11 -2
  25. package/dist/features/form/select/composition/useSelectController.js.map +1 -1
  26. package/dist/features/form/select/selectMeta.d.ts +99 -1
  27. package/dist/features/form/select/selectMeta.d.ts.map +1 -1
  28. package/dist/features/form/select/selectMeta.js +71 -1
  29. package/dist/features/form/select/selectMeta.js.map +1 -1
  30. package/dist/features/registry/bindableComponentMeta.d.ts +79 -1
  31. package/dist/features/registry/bindableComponentMeta.d.ts.map +1 -1
  32. package/dist/features/registry/bindableComponentMeta.js +59 -1
  33. package/dist/features/registry/bindableComponentMeta.js.map +1 -1
  34. package/dist/types/select.d.ts +10 -0
  35. package/dist/types/select.d.ts.map +1 -1
  36. package/dist/types/select.js.map +1 -1
  37. package/package.json +29 -3
  38. package/src/features/carousel/Carousel.test.ts +243 -7
  39. package/src/features/carousel/Carousel.tsx +135 -26
  40. package/src/features/form/select/adapters/inbound/Select.native.test.tsx +322 -0
  41. package/src/features/form/select/adapters/inbound/Select.native.tsx +135 -13
  42. package/src/features/form/select/adapters/inbound/Select.web.tsx +6 -3
  43. package/src/features/form/select/composition/SelectSearchInput.tsx +33 -0
  44. package/src/features/form/select/composition/getVisibleSelectOptions.test.ts +22 -0
  45. package/src/features/form/select/composition/getVisibleSelectOptions.ts +13 -0
  46. package/src/features/form/select/composition/useSelectController.ts +25 -2
  47. package/src/features/form/select/public.test.ts +31 -1
  48. package/src/features/form/select/selectMeta.ts +71 -1
  49. package/src/features/registry/bindableComponentMeta.test.ts +6 -0
  50. package/src/features/registry/bindableComponentMeta.ts +59 -1
  51. package/src/features/registry/featureManifest.test.ts +10 -0
  52. package/src/types/select.ts +10 -0
  53. package/web-dist/chunks/{Accordion-sj1n06dw.js → Accordion-9dk62zn9.js} +84 -24
  54. package/web-dist/chunks/Accordion-ar8qe05j.js +53 -0
  55. package/web-dist/chunks/{Accordion-ge7cjtwy.js → Accordion-mpb070cf.js} +3 -3
  56. package/web-dist/chunks/{Accordion-554f42yj.js → Accordion-sj30964p.js} +4 -4
  57. package/web-dist/chunks/{Accordion-2bygfpwg.js → Accordion-xhxv2v0g.js} +62 -2
  58. package/web-dist/chunks/{RichTextClient-70qt7037.js → RichTextClient-7qqj2dpw.js} +3 -4
  59. package/web-dist/components/auth-screen/AuthScreen.js +2 -3
  60. package/web-dist/components/carousel/Carousel.js +97 -24
  61. package/web-dist/components/color-hue-scale/ColorHueScale.js +4 -3
  62. package/web-dist/components/color-picker/ColorPicker.js +4 -3
  63. package/web-dist/components/color-tone/ColorTone.js +4 -3
  64. package/web-dist/components/color-wheel/ColorWheel.js +4 -3
  65. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +2 -3
  66. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +2 -3
  67. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +2 -3
  68. package/web-dist/components/otp-form/OtpForm.js +2 -3
  69. package/web-dist/components/rich-text/RichText.js +2 -2
  70. package/web-dist/components/search-input/SearchInput.js +5 -52
  71. package/web-dist/components/select/Select.js +3 -1
  72. package/web-dist/components/select/Select.types-0.d.ts +10 -0
  73. package/web-dist/components/sign-in-form/SignInForm.js +2 -3
  74. package/web-dist/components/sign-up-form/SignUpForm.js +2 -3
  75. package/web-dist/components/text-input/TextInput.js +4 -5
  76. package/web-dist/manifest.json +39 -41
  77. package/web-dist/chunks/Accordion-49d0frg7.js +0 -66
@@ -6,6 +6,7 @@ import { BottomSheetFlatList, useBottomSheet } from '../../../../bottom-sheet/pu
6
6
  import { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';
7
7
  import { SelectField } from '../../composition/SelectField';
8
8
  import { SelectOptionRow } from '../../composition/SelectOptionRow';
9
+ import { SelectSearchInput } from '../../composition/SelectSearchInput';
9
10
  import { SelectTrigger } from '../../composition/SelectTrigger';
10
11
  import { useSelectController } from '../../composition/useSelectController';
11
12
 
@@ -21,17 +22,47 @@ function SelectInner<TValue extends string = string>({
21
22
  ...props
22
23
  }: SelectProps<TValue>) {
23
24
  const { dismiss, present } = useBottomSheet();
24
- const { select, selectedOption, value } = useSelectController(props);
25
+ const [open, setOpen] = React.useState(false);
26
+ const ownsSheet = React.useRef(false);
27
+ const sheetRequestId = React.useRef(0);
28
+ const sheetId = React.useId();
29
+ const { search, searchValue, select, selectedOption, value, visibleOptions } =
30
+ useSelectController(props);
25
31
  const passive = props.interactionPolicy === 'passive';
26
- const { disabled, interactionPolicy, options, readOnly, testID } = props;
27
- const listData = React.useMemo(() => [...options], [options]);
32
+ const { disabled, interactionPolicy, readOnly, testID } = props;
33
+ const listData = React.useMemo(() => [...visibleOptions], [visibleOptions]);
34
+
35
+ const releaseSheet = React.useCallback(() => {
36
+ ownsSheet.current = false;
37
+ setOpen(false);
38
+ }, []);
39
+
40
+ const isCurrentSheetRequest = React.useCallback(
41
+ (requestId: number) => sheetRequestId.current === requestId,
42
+ [],
43
+ );
44
+
45
+ const claimSheet = React.useCallback(
46
+ (requestId: number) => {
47
+ if (isCurrentSheetRequest(requestId)) ownsSheet.current = true;
48
+ },
49
+ [isCurrentSheetRequest],
50
+ );
51
+
52
+ const releaseSheetOwnership = React.useCallback(
53
+ (requestId: number) => {
54
+ if (isCurrentSheetRequest(requestId)) ownsSheet.current = false;
55
+ },
56
+ [isCurrentSheetRequest],
57
+ );
28
58
 
29
59
  const handleSelect = React.useCallback(
30
60
  (nextValue: TValue) => {
31
61
  select(nextValue);
62
+ releaseSheet();
32
63
  dismiss();
33
64
  },
34
- [dismiss, select],
65
+ [dismiss, releaseSheet, select],
35
66
  );
36
67
 
37
68
  const renderOption = React.useCallback(
@@ -47,22 +78,59 @@ function SelectInner<TValue extends string = string>({
47
78
  [handleSelect, interactionPolicy, testID, value],
48
79
  );
49
80
 
50
- const openSelect = React.useCallback(() => {
51
- if (disabled || readOnly || passive) return;
52
-
81
+ React.useEffect(() => {
82
+ if (!open || !ownsSheet.current) return;
83
+ ownsSheet.current = true;
84
+ const requestId = sheetRequestId.current + 1;
85
+ sheetRequestId.current = requestId;
53
86
  present({
54
87
  contentMode: 'direct',
55
88
  maxDynamicContentSize: SELECT_SHEET_MAX_HEIGHT,
56
89
  content: (
57
- <BottomSheetFlatList
58
- contentContainerStyle={styles.listContent}
59
- data={listData}
60
- keyExtractor={(item: SelectOption<TValue>) => item.value}
61
- renderItem={renderOption}
90
+ <SelectSheetContent
91
+ key={sheetId}
92
+ onClaim={claimSheet}
93
+ listData={listData}
94
+ isCurrentRequest={isCurrentSheetRequest}
95
+ onRelease={releaseSheet}
96
+ onReleaseOwnership={releaseSheetOwnership}
97
+ props={props}
98
+ renderOption={renderOption}
99
+ requestId={requestId}
100
+ search={search}
101
+ searchValue={searchValue}
62
102
  />
63
103
  ),
104
+ onDismiss: releaseSheet,
64
105
  });
65
- }, [disabled, listData, passive, present, readOnly, renderOption]);
106
+ }, [
107
+ claimSheet,
108
+ isCurrentSheetRequest,
109
+ listData,
110
+ open,
111
+ present,
112
+ props,
113
+ releaseSheet,
114
+ releaseSheetOwnership,
115
+ renderOption,
116
+ search,
117
+ searchValue,
118
+ sheetId,
119
+ ]);
120
+
121
+ React.useEffect(
122
+ () => () => {
123
+ if (ownsSheet.current) dismiss();
124
+ },
125
+ [dismiss],
126
+ );
127
+
128
+ const openSelect = React.useCallback(() => {
129
+ if (disabled || readOnly || passive) return;
130
+
131
+ ownsSheet.current = true;
132
+ setOpen(true);
133
+ }, [disabled, passive, readOnly]);
66
134
 
67
135
  return (
68
136
  <SelectField props={props}>
@@ -76,6 +144,60 @@ function SelectInner<TValue extends string = string>({
76
144
  );
77
145
  }
78
146
 
147
+ /*** Renders and releases the Select-owned sheet content when another request replaces it. */
148
+ function SelectSheetContent<TValue extends string>({
149
+ isCurrentRequest,
150
+ listData,
151
+ onClaim,
152
+ onRelease,
153
+ onReleaseOwnership,
154
+ props,
155
+ renderOption,
156
+ requestId,
157
+ search,
158
+ searchValue,
159
+ }: SelectSheetContentProps<TValue>) {
160
+ const mounted = React.useRef(false);
161
+
162
+ React.useEffect(() => {
163
+ mounted.current = true;
164
+ onClaim(requestId);
165
+
166
+ return () => {
167
+ mounted.current = false;
168
+ onReleaseOwnership(requestId);
169
+ void Promise.resolve().then(() => {
170
+ if (!mounted.current && isCurrentRequest(requestId)) onRelease();
171
+ });
172
+ };
173
+ }, [isCurrentRequest, onClaim, onRelease, onReleaseOwnership, requestId]);
174
+
175
+ return (
176
+ <BottomSheetFlatList
177
+ contentContainerStyle={styles.listContent}
178
+ data={listData}
179
+ keyExtractor={(item: SelectOption<TValue>) => item.value}
180
+ ListHeaderComponent={
181
+ <SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue} />
182
+ }
183
+ renderItem={renderOption}
184
+ />
185
+ );
186
+ }
187
+
188
+ interface SelectSheetContentProps<TValue extends string> {
189
+ readonly isCurrentRequest: (requestId: number) => boolean;
190
+ readonly listData: readonly SelectOption<TValue>[];
191
+ readonly onClaim: (requestId: number) => void;
192
+ readonly onRelease: () => void;
193
+ readonly onReleaseOwnership: (requestId: number) => void;
194
+ readonly props: SelectProps<TValue>;
195
+ readonly renderOption: (info: ListRenderItemInfo<SelectOption<TValue>>) => React.ReactElement;
196
+ readonly requestId: number;
197
+ readonly search: (value: string) => void;
198
+ readonly searchValue: string;
199
+ }
200
+
79
201
  const styles = StyleSheet.create({
80
202
  listContent: {
81
203
  padding: 16,
@@ -7,6 +7,7 @@ import { Surface } from '../../../../surface/public';
7
7
  import { withZoraThemeScope } from '../../../../theme/adapters/inbound/withZoraThemeScope';
8
8
  import { SelectField } from '../../composition/SelectField';
9
9
  import { SelectOptionRow } from '../../composition/SelectOptionRow';
10
+ import { SelectSearchInput } from '../../composition/SelectSearchInput';
10
11
  import { SelectTrigger } from '../../composition/SelectTrigger';
11
12
  import { useSelectController } from '../../composition/useSelectController';
12
13
 
@@ -20,8 +21,9 @@ function SelectInner<TValue extends string = string>({
20
21
  ...props
21
22
  }: SelectProps<TValue>) {
22
23
  const [open, setOpen] = React.useState(false);
23
- const { select, selectedOption, value } = useSelectController(props);
24
- const { interactionPolicy, options, testID } = props;
24
+ const { search, searchValue, select, selectedOption, value, visibleOptions } =
25
+ useSelectController(props);
26
+ const { interactionPolicy, testID } = props;
25
27
 
26
28
  const selectAndClose = React.useCallback(
27
29
  (nextValue: TValue) => {
@@ -50,7 +52,8 @@ function SelectInner<TValue extends string = string>({
50
52
  >
51
53
  <Surface variant="raised">
52
54
  <View gap="xs" p="xs">
53
- {options.map((option) => (
55
+ <SelectSearchInput onSearchChange={search} props={props} searchValue={searchValue} />
56
+ {visibleOptions.map((option) => (
54
57
  <SelectOptionRow
55
58
  interactionPolicy={interactionPolicy}
56
59
  key={option.value}
@@ -0,0 +1,33 @@
1
+ import type { SelectProps } from '../../../../types/select';
2
+ import { View } from '../../../layout/public';
3
+ import { SearchInput } from '../../search-input/public';
4
+
5
+ /*** Renders the optional controlled search input shared by Select presentations. */
6
+ export function SelectSearchInput<TValue extends string>({
7
+ onSearchChange,
8
+ props,
9
+ searchValue,
10
+ }: SelectSearchInputProps<TValue>) {
11
+ if (!props.searchable) return null;
12
+
13
+ return (
14
+ <View pb="xs">
15
+ <SearchInput
16
+ disabled={props.disabled}
17
+ interactionPolicy={props.interactionPolicy}
18
+ onValueChange={onSearchChange}
19
+ placeholder={props.searchPlaceholder ?? 'Search options'}
20
+ readOnly={props.readOnly}
21
+ size="m"
22
+ testID={props.testID ? `${props.testID}-search` : undefined}
23
+ value={searchValue}
24
+ />
25
+ </View>
26
+ );
27
+ }
28
+
29
+ interface SelectSearchInputProps<TValue extends string> {
30
+ readonly onSearchChange: (value: string) => void;
31
+ readonly props: SelectProps<TValue>;
32
+ readonly searchValue: string;
33
+ }
@@ -0,0 +1,22 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import { getVisibleSelectOptions } from './getVisibleSelectOptions';
4
+
5
+ const options = [
6
+ { value: 'atlas', label: 'Atlas' },
7
+ { value: 'zora', label: 'ZORA' },
8
+ ] as const;
9
+
10
+ describe('getVisibleSelectOptions', () => {
11
+ test('preserves the original options and identity when search is disabled or empty', () => {
12
+ expect(getVisibleSelectOptions(options, false, 'atlas')).toBe(options);
13
+ expect(getVisibleSelectOptions(options, true, ' ')).toBe(options);
14
+ });
15
+
16
+ test('filters searchable options case-insensitively without changing option identity', () => {
17
+ const visible = getVisibleSelectOptions(options, true, 'Zo');
18
+
19
+ expect(visible).toEqual([options[1]]);
20
+ expect(visible[0]).toBe(options[1]);
21
+ });
22
+ });
@@ -0,0 +1,13 @@
1
+ import type { SelectOption } from '../../../../types/select';
2
+
3
+ /*** Preserves option identity while limiting a searchable Select to labels matching its query. */
4
+ export function getVisibleSelectOptions<TValue extends string>(
5
+ options: readonly SelectOption<TValue>[],
6
+ searchable: boolean | undefined,
7
+ searchValue: string,
8
+ ): readonly SelectOption<TValue>[] {
9
+ const query = searchValue.trim().toLocaleLowerCase();
10
+ if (!searchable || query.length === 0) return options;
11
+
12
+ return options.filter((option) => option.label.toLocaleLowerCase().includes(query));
13
+ }
@@ -1,13 +1,28 @@
1
1
  import React from 'react';
2
2
 
3
3
  import type { SelectProps } from '../../../../types/select';
4
+ import { getVisibleSelectOptions } from './getVisibleSelectOptions';
4
5
 
5
6
  /*** Resolves controlled or uncontrolled Select value state and the selected option. */
6
7
  export function useSelectController<TValue extends string>(props: SelectProps<TValue>) {
7
- const { defaultValue, onValueChange, options, value: controlledValue } = props;
8
+ const {
9
+ defaultSearchValue,
10
+ defaultValue,
11
+ onSearchChange,
12
+ onValueChange,
13
+ options,
14
+ searchValue: controlledSearchValue,
15
+ value: controlledValue,
16
+ } = props;
8
17
  const [localValue, setLocalValue] = React.useState<TValue | undefined>(defaultValue);
18
+ const [localSearchValue, setLocalSearchValue] = React.useState(defaultSearchValue ?? '');
9
19
  const value = controlledValue ?? localValue;
20
+ const searchValue = controlledSearchValue ?? localSearchValue;
10
21
  const selectedOption = options.find((option) => option.value === value);
22
+ const visibleOptions = React.useMemo(
23
+ () => getVisibleSelectOptions(options, props.searchable, searchValue),
24
+ [options, props.searchable, searchValue],
25
+ );
11
26
 
12
27
  const select = React.useCallback(
13
28
  (nextValue: TValue) => {
@@ -17,5 +32,13 @@ export function useSelectController<TValue extends string>(props: SelectProps<TV
17
32
  [controlledValue, onValueChange],
18
33
  );
19
34
 
20
- return { select, selectedOption, value } as const;
35
+ const search = React.useCallback(
36
+ (nextValue: string) => {
37
+ if (controlledSearchValue === undefined) setLocalSearchValue(nextValue);
38
+ onSearchChange?.(nextValue);
39
+ },
40
+ [controlledSearchValue, onSearchChange],
41
+ );
42
+
43
+ return { search, searchValue, select, selectedOption, value, visibleOptions } as const;
21
44
  }
@@ -3,12 +3,29 @@ import { expect, test } from 'bun:test';
3
3
  import type { SelectProps } from '../../../types/select';
4
4
  import { selectMeta } from './selectMeta';
5
5
 
6
- test('Select is a direct manifest node with valueChange payload', () => {
6
+ test('Select is a direct manifest node with controlled selection and search payloads', () => {
7
7
  expect(selectMeta.directManifestNode).toBe(true);
8
8
  expect(selectMeta.events.valueChange.eventType).toBe('select.valueChange');
9
9
  expect(selectMeta.events.valueChange.payloadFields).toEqual([
10
10
  { path: 'value', type: 'string', label: 'Value' },
11
11
  ]);
12
+ expect(selectMeta.events.searchChange).toEqual({
13
+ label: 'Search change',
14
+ eventType: 'select.searchChange',
15
+ description: 'Emitted when the searchable option query changes.',
16
+ payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
17
+ });
18
+ expect(selectMeta.bindings.props.options.value).toEqual({
19
+ type: 'array',
20
+ itemType: 'object',
21
+ fields: [
22
+ { path: '[].value', type: 'string', label: 'Value' },
23
+ { path: '[].label', type: 'string', label: 'Label' },
24
+ { path: '[].disabled', type: 'boolean', label: 'Disabled' },
25
+ ],
26
+ });
27
+ expect(selectMeta.bindings.props.searchValue.value.type).toBe('string');
28
+ expect(selectMeta.bindings.events.searchChange.payload.eventType).toBe('select.searchChange');
12
29
  });
13
30
 
14
31
  test('Select registers the optional leading icon as instance-owned media metadata', () => {
@@ -109,3 +126,16 @@ test('Select supports label emphasis, SVG icons, and leading images', async () =
109
126
  expect(selectTrigger).toContain('source={media}');
110
127
  expect(selectOptionRow).toContain('source={option.leadingMedia}');
111
128
  });
129
+
130
+ test('Select exposes searchable controlled props through its public contract', () => {
131
+ const props: SelectProps = {
132
+ options: [{ label: 'Repository', value: 'repository' }],
133
+ searchable: true,
134
+ searchValue: 'repo',
135
+ onSearchChange: () => undefined,
136
+ };
137
+
138
+ expect(props.searchable).toBe(true);
139
+ expect(props.searchValue).toBe('repo');
140
+ expect(props.onSearchChange).toBeDefined();
141
+ });
@@ -4,7 +4,7 @@ export const selectMeta = {
4
4
  name: 'Select',
5
5
  category: 'component',
6
6
  description:
7
- 'Single-value form selection with Popover presentation on web and BottomSheet presentation on native.',
7
+ 'Single-value form selection with optional searchable options, Popover presentation on web, and BottomSheet presentation on native.',
8
8
  directManifestNode: true,
9
9
  allowedChildren: [],
10
10
  blueprint: {
@@ -21,6 +21,7 @@ export const selectMeta = {
21
21
  disabled: false,
22
22
  readOnly: false,
23
23
  invalid: false,
24
+ searchable: false,
24
25
  },
25
26
  },
26
27
  bindings: {
@@ -39,6 +40,35 @@ export const selectMeta = {
39
40
  acceptsFallback: true,
40
41
  acceptsTransforms: true,
41
42
  },
43
+ options: {
44
+ label: 'Options',
45
+ description: 'Reactive serializable options rendered by the select.',
46
+ value: {
47
+ type: 'array',
48
+ itemType: 'object',
49
+ fields: [
50
+ { path: '[].value', type: 'string', label: 'Value' },
51
+ { path: '[].label', type: 'string', label: 'Label' },
52
+ { path: '[].disabled', type: 'boolean', label: 'Disabled' },
53
+ ],
54
+ },
55
+ acceptsFallback: true,
56
+ acceptsTransforms: true,
57
+ },
58
+ searchValue: {
59
+ label: 'Search value',
60
+ description: 'Current query for the searchable option list.',
61
+ value: { type: 'string' },
62
+ acceptsFallback: true,
63
+ acceptsTransforms: true,
64
+ },
65
+ searchable: {
66
+ label: 'Searchable',
67
+ description: 'Whether the option list exposes a search control.',
68
+ value: { type: 'boolean' },
69
+ acceptsFallback: true,
70
+ acceptsTransforms: true,
71
+ },
42
72
  },
43
73
  events: {
44
74
  valueChange: {
@@ -49,6 +79,14 @@ export const selectMeta = {
49
79
  fields: [{ path: 'value', type: 'string', label: 'Value' }],
50
80
  },
51
81
  },
82
+ searchChange: {
83
+ label: 'Search change',
84
+ description: 'Runs when the searchable option query changes.',
85
+ payload: {
86
+ eventType: 'select.searchChange',
87
+ fields: [{ path: 'value', type: 'string', label: 'Value' }],
88
+ },
89
+ },
52
90
  },
53
91
  },
54
92
  events: {
@@ -58,6 +96,12 @@ export const selectMeta = {
58
96
  description: 'Emitted when the selected option value changes.',
59
97
  payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
60
98
  },
99
+ searchChange: {
100
+ label: 'Search change',
101
+ eventType: 'select.searchChange',
102
+ description: 'Emitted when the searchable option query changes.',
103
+ payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
104
+ },
61
105
  },
62
106
  props: {
63
107
  defaultValue: {
@@ -106,6 +150,32 @@ export const selectMeta = {
106
150
  ],
107
151
  authoring: { authority: 'instance' },
108
152
  },
153
+ searchable: {
154
+ type: 'boolean',
155
+ category: 'Behavior',
156
+ label: 'Searchable',
157
+ default: false,
158
+ authoring: { authority: 'instance' },
159
+ },
160
+ defaultSearchValue: {
161
+ type: 'string',
162
+ category: 'State',
163
+ label: 'Initial search value',
164
+ authoring: { authority: 'instance' },
165
+ },
166
+ searchValue: {
167
+ type: 'string',
168
+ category: 'State',
169
+ label: 'Search value',
170
+ authoring: { authority: 'instance' },
171
+ },
172
+ searchPlaceholder: {
173
+ type: 'string',
174
+ category: 'Content',
175
+ label: 'Search placeholder',
176
+ default: 'Search options',
177
+ authoring: { authority: 'instance' },
178
+ },
109
179
  label: {
110
180
  type: 'string',
111
181
  category: 'Content',
@@ -23,6 +23,12 @@ describe('ZORA bindable component metadata', () => {
23
23
  expect(select.directManifestNode).toBe(true);
24
24
  expect(select.directManifestNode).toBe(ZORA_COMPONENT_META.Select.directManifestNode);
25
25
  expect(select.bindings.events.valueChange.payload.eventType).toBe('select.valueChange');
26
+ expect(select.bindings.props.options.value).toMatchObject({
27
+ type: 'array',
28
+ itemType: 'object',
29
+ });
30
+ expect(select.bindings.props.searchValue.value.type).toBe('string');
31
+ expect(select.bindings.events.searchChange.payload.eventType).toBe('select.searchChange');
26
32
  });
27
33
 
28
34
  it('does not duplicate controlled component event ownership', () => {
@@ -177,7 +177,7 @@ export const ZORA_BINDABLE_COMPONENT_META = {
177
177
  Select: {
178
178
  name: 'Select',
179
179
  category: 'component',
180
- description: 'Captures one selected string value.',
180
+ description: 'Captures one selected string value with optional searchable options.',
181
181
  directManifestNode: true,
182
182
  allowedChildren: [],
183
183
  bindings: {
@@ -196,6 +196,35 @@ export const ZORA_BINDABLE_COMPONENT_META = {
196
196
  acceptsFallback: true,
197
197
  acceptsTransforms: true,
198
198
  },
199
+ options: {
200
+ label: 'Options',
201
+ description: 'Reactive serializable options rendered by the select.',
202
+ value: {
203
+ type: 'array',
204
+ itemType: 'object',
205
+ fields: [
206
+ { path: '[].value', type: 'string', label: 'Value' },
207
+ { path: '[].label', type: 'string', label: 'Label' },
208
+ { path: '[].disabled', type: 'boolean', label: 'Disabled' },
209
+ ],
210
+ },
211
+ acceptsFallback: true,
212
+ acceptsTransforms: true,
213
+ },
214
+ searchValue: {
215
+ label: 'Search value',
216
+ description: 'Current query for the searchable option list.',
217
+ value: { type: 'string' },
218
+ acceptsFallback: true,
219
+ acceptsTransforms: true,
220
+ },
221
+ searchable: {
222
+ label: 'Searchable',
223
+ description: 'Whether the option list exposes a search control.',
224
+ value: { type: 'boolean' },
225
+ acceptsFallback: true,
226
+ acceptsTransforms: true,
227
+ },
199
228
  },
200
229
  events: {
201
230
  valueChange: {
@@ -206,6 +235,14 @@ export const ZORA_BINDABLE_COMPONENT_META = {
206
235
  fields: [{ path: 'value', type: 'string', label: 'Value' }],
207
236
  },
208
237
  },
238
+ searchChange: {
239
+ label: 'Search change',
240
+ description: 'Runs when the searchable option query changes.',
241
+ payload: {
242
+ eventType: 'select.searchChange',
243
+ fields: [{ path: 'value', type: 'string', label: 'Value' }],
244
+ },
245
+ },
209
246
  },
210
247
  },
211
248
  events: {
@@ -215,6 +252,12 @@ export const ZORA_BINDABLE_COMPONENT_META = {
215
252
  description: 'Emitted when the selected value changes.',
216
253
  payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
217
254
  },
255
+ searchChange: {
256
+ label: 'Search change',
257
+ eventType: 'select.searchChange',
258
+ description: 'Emitted when the searchable option query changes.',
259
+ payloadFields: [{ path: 'value', type: 'string', label: 'Value' }],
260
+ },
218
261
  },
219
262
  props: {
220
263
  inverted: INVERTED_POLARITY_PROP,
@@ -228,6 +271,21 @@ export const ZORA_BINDABLE_COMPONENT_META = {
228
271
  category: 'State',
229
272
  label: 'Disabled',
230
273
  },
274
+ options: {
275
+ type: 'array',
276
+ category: 'Content',
277
+ label: 'Options',
278
+ },
279
+ searchable: {
280
+ type: 'boolean',
281
+ category: 'Behavior',
282
+ label: 'Searchable',
283
+ },
284
+ searchValue: {
285
+ type: 'string',
286
+ category: 'State',
287
+ label: 'Search value',
288
+ },
231
289
  },
232
290
  },
233
291
  Checkbox: {
@@ -77,6 +77,16 @@ test('final ownership form and tab components retain bindings in core metadata',
77
77
  expect(meta.Tabs?.bindings?.events?.valueChange?.payload?.eventType).toBe('tabs.valueChange');
78
78
  });
79
79
 
80
+ test('Select retains reactive options and searchable manifest bindings', () => {
81
+ const select = ZORA_COMPONENT_META.Select;
82
+ expect(select?.bindings?.props?.options?.value).toMatchObject({
83
+ type: 'array',
84
+ itemType: 'object',
85
+ });
86
+ expect(select?.bindings?.props?.searchValue?.value.type).toBe('string');
87
+ expect(select?.bindings?.events?.searchChange?.payload?.eventType).toBe('select.searchChange');
88
+ });
89
+
80
90
  test('existing scalar authoring bindings remain available in core metadata', () => {
81
91
  const meta = ZORA_COMPONENT_META;
82
92
  expect(meta.Heading?.bindings?.props?.level?.value.type).toBe('number');
@@ -16,6 +16,16 @@ export interface SelectProps<TValue extends string = string> extends ZoraBasePro
16
16
  defaultValue?: TValue;
17
17
  options: readonly SelectOption<TValue>[];
18
18
  onValueChange?: (value: TValue) => void;
19
+ /** Enables an inline search control that filters the currently supplied options. */
20
+ searchable?: boolean;
21
+ /** Controlled query for the optional inline search control. */
22
+ searchValue?: string;
23
+ /** Initial query when the optional inline search control is uncontrolled. */
24
+ defaultSearchValue?: string;
25
+ /** Proposes an updated search query for local filtering or remote discovery. */
26
+ onSearchChange?: (value: string) => void;
27
+ /** Placeholder rendered by the optional inline search control. */
28
+ searchPlaceholder?: string;
19
29
  label?: string;
20
30
  helperText?: string;
21
31
  errorText?: string;