@lumx/core 4.12.0-next.6 → 4.12.1-next.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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, LumxClassName } from '../../types';
|
|
2
|
+
import type { ComboboxCallbacks } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Label display mode for the ComboboxButton.
|
|
4
5
|
* - `'show-selection'`: Show the selected value if available, otherwise the label.
|
|
@@ -9,7 +10,7 @@ export type ComboboxButtonLabelDisplayMode = 'show-selection' | 'show-label' | '
|
|
|
9
10
|
/**
|
|
10
11
|
* Defines the props for the core ComboboxButton template.
|
|
11
12
|
*/
|
|
12
|
-
export interface ComboboxButtonProps extends HasClassName {
|
|
13
|
+
export interface ComboboxButtonProps extends HasClassName, ComboboxCallbacks {
|
|
13
14
|
/** The label for the button (used for ARIA and tooltip). */
|
|
14
15
|
label: string;
|
|
15
16
|
/** The currently selected value to display. */
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CommonRef, HasClassName, HasTheme, LumxClassName } from '../../types';
|
|
2
|
+
import type { ComboboxCallbacks, ComboboxInputOptions } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Defines the props for the core ComboboxInput template.
|
|
4
5
|
*/
|
|
5
|
-
export interface ComboboxInputProps extends HasClassName, HasTheme {
|
|
6
|
+
export interface ComboboxInputProps extends HasClassName, HasTheme, ComboboxCallbacks, ComboboxInputOptions {
|
|
6
7
|
/** The ID of the listbox element (for aria-controls). */
|
|
7
8
|
listboxId?: string;
|
|
8
9
|
/** Whether the combobox is open. */
|
|
@@ -17,12 +18,14 @@ export interface ComboboxInputProps extends HasClassName, HasTheme {
|
|
|
17
18
|
toggleButtonProps?: Record<string, any>;
|
|
18
19
|
/** Toggle callback for the chevron button. */
|
|
19
20
|
handleToggle?(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Controls how the combobox filters options as the user types.
|
|
22
|
-
* When `'off'`, the input is rendered as `readOnly`.
|
|
23
|
-
*/
|
|
24
|
-
filter?: 'auto' | 'manual' | 'off';
|
|
25
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Props from the core `ComboboxInputProps` that framework wrappers (React/Vue)
|
|
24
|
+
* are expected to provide internally or re-type with framework-specific equivalents
|
|
25
|
+
* (e.g. React refs, framework-specific button props). Wrappers should omit these
|
|
26
|
+
* keys when exposing the core props to consumers.
|
|
27
|
+
*/
|
|
28
|
+
export type ComboboxInputPropsToOverride = 'listboxId' | 'isOpen' | 'inputRef' | 'textFieldRef' | 'toggleButtonProps' | 'handleToggle';
|
|
26
29
|
/**
|
|
27
30
|
* Injected framework-specific components for ComboboxInput rendering.
|
|
28
31
|
*/
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
import type { ComboboxCallbacks, ComboboxHandle } from './types';
|
|
1
|
+
import type { ComboboxCallbacks, ComboboxHandle, ComboboxInputOptions } from './types';
|
|
2
2
|
/** Options for configuring the input-mode combobox controller. */
|
|
3
|
-
export interface SetupComboboxInputOptions extends ComboboxCallbacks {
|
|
4
|
-
/**
|
|
5
|
-
* Controls how the combobox filters options as the user types.
|
|
6
|
-
*
|
|
7
|
-
* - `'auto'` (default) — Options are automatically filtered client-side.
|
|
8
|
-
* - `'manual'` — Filtering is the consumer's responsibility.
|
|
9
|
-
* - `'off'` — Like `'manual'`, and `openOnFocus` defaults to `true`.
|
|
10
|
-
* The core template renders the input as `readOnly`.
|
|
11
|
-
*/
|
|
12
|
-
filter?: 'auto' | 'manual' | 'off';
|
|
13
|
-
/**
|
|
14
|
-
* When true, the combobox opens automatically when the input receives focus.
|
|
15
|
-
* When false (default, unless `filter` is `'off'`), the combobox only opens
|
|
16
|
-
* on click, typing, or keyboard navigation.
|
|
17
|
-
*
|
|
18
|
-
* @default false (true when filter is 'off')
|
|
19
|
-
*/
|
|
20
|
-
openOnFocus?: boolean;
|
|
3
|
+
export interface SetupComboboxInputOptions extends ComboboxCallbacks, ComboboxInputOptions {
|
|
21
4
|
}
|
|
22
5
|
/**
|
|
23
6
|
* Set up a combobox with an input trigger (autocomplete/filter pattern).
|
|
@@ -41,10 +41,34 @@ export interface ComboboxEventMap {
|
|
|
41
41
|
}
|
|
42
42
|
/** Callbacks provided by the consumer (React/Vue) to react to combobox state changes. */
|
|
43
43
|
export interface ComboboxCallbacks {
|
|
44
|
-
/** Called when an option is selected (click or keyboard).
|
|
45
|
-
onSelect(option: {
|
|
44
|
+
/** Called when an option is selected (click or keyboard). */
|
|
45
|
+
onSelect?(option: {
|
|
46
46
|
value: string;
|
|
47
|
-
}
|
|
47
|
+
}): void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Behavioral options for input-mode combobox (autocomplete/filter pattern).
|
|
51
|
+
* Shared between the core JSX template props (`ComboboxInputProps`) and the
|
|
52
|
+
* runtime controller options (`SetupComboboxInputOptions`).
|
|
53
|
+
*/
|
|
54
|
+
export interface ComboboxInputOptions {
|
|
55
|
+
/**
|
|
56
|
+
* Controls how the combobox filters options as the user types.
|
|
57
|
+
*
|
|
58
|
+
* - `'auto'` (default) — Options are automatically filtered client-side.
|
|
59
|
+
* - `'manual'` — Filtering is the consumer's responsibility.
|
|
60
|
+
* - `'off'` — Like `'manual'`, but the input is rendered as `readOnly`
|
|
61
|
+
* and `openOnFocus` defaults to `true`.
|
|
62
|
+
*/
|
|
63
|
+
filter?: 'auto' | 'manual' | 'off';
|
|
64
|
+
/**
|
|
65
|
+
* When true, the combobox opens automatically when the input receives focus.
|
|
66
|
+
* When false (default, unless `filter` is `'off'`), the combobox only opens
|
|
67
|
+
* on click, typing, or keyboard navigation.
|
|
68
|
+
*
|
|
69
|
+
* @default false (true when filter is 'off')
|
|
70
|
+
*/
|
|
71
|
+
openOnFocus?: boolean;
|
|
48
72
|
}
|
|
49
73
|
/** Handle returned by `setupCombobox`. Used by framework wrappers and mode controllers. */
|
|
50
74
|
export interface ComboboxHandle {
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.12.
|
|
10
|
+
"@lumx/icons": "^4.12.1-next.0",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
|
-
"version": "4.12.
|
|
72
|
+
"version": "4.12.1-next.0",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
75
75
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"vite-tsconfig-paths": "^5.1.4",
|
|
94
94
|
"vitest": "^4.0.18"
|
|
95
95
|
},
|
|
96
|
-
"stableVersion": "4.
|
|
96
|
+
"stableVersion": "4.12.0"
|
|
97
97
|
}
|