myoperator-mcp 0.2.85 → 0.2.86

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 (2) hide show
  1. package/dist/index.js +18 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3207,6 +3207,8 @@ export interface SelectFieldProps {
3207
3207
  defaultValue?: string;
3208
3208
  /** Callback when value changes */
3209
3209
  onValueChange?: (value: string) => void;
3210
+ /** Callback when an option is selected, provides the full option object */
3211
+ onSelect?: (option: SelectOption) => void;
3210
3212
  /** Options to display */
3211
3213
  options: SelectOption[];
3212
3214
  /** Enable search/filter functionality */
@@ -3255,6 +3257,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3255
3257
  value,
3256
3258
  defaultValue,
3257
3259
  onValueChange,
3260
+ onSelect,
3258
3261
  options,
3259
3262
  searchable,
3260
3263
  searchPlaceholder = "Search...",
@@ -3269,6 +3272,20 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3269
3272
  // Internal state for search
3270
3273
  const [searchQuery, setSearchQuery] = React.useState("");
3271
3274
 
3275
+ // Handle value change and call both onValueChange and onSelect
3276
+ const handleValueChange = React.useCallback(
3277
+ (newValue: string) => {
3278
+ onValueChange?.(newValue);
3279
+ if (onSelect) {
3280
+ const selectedOption = options.find((o) => o.value === newValue);
3281
+ if (selectedOption) {
3282
+ onSelect(selectedOption);
3283
+ }
3284
+ }
3285
+ },
3286
+ [onValueChange, onSelect, options]
3287
+ );
3288
+
3272
3289
  // Derive state from props
3273
3290
  const derivedState = error ? "error" : "default";
3274
3291
 
@@ -3343,7 +3360,7 @@ const SelectField = React.forwardRef<HTMLButtonElement, SelectFieldProps>(
3343
3360
  <Select
3344
3361
  value={value}
3345
3362
  defaultValue={defaultValue}
3346
- onValueChange={onValueChange}
3363
+ onValueChange={handleValueChange}
3347
3364
  disabled={disabled || loading}
3348
3365
  name={name}
3349
3366
  onOpenChange={handleOpenChange}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.85",
3
+ "version": "0.2.86",
4
4
  "description": "MCP server for myOperator UI components - enables AI assistants to access component metadata, examples, and design tokens",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",