myoperator-mcp 0.2.166 → 0.2.168

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 +183 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2910,10 +2910,29 @@ export interface InputProps
2910
2910
  VariantProps<typeof inputVariants> {
2911
2911
  /** Shows a check icon on the right side when the input is focused */
2912
2912
  showCheckIcon?: boolean;
2913
+ /**
2914
+ * When \`type="number"\`, hide native stepper arrows (WebKit/Firefox).
2915
+ * Default \`true\` \u2014 matches existing app-wide number styling.
2916
+ * Set \`false\` to show native increment/decrement controls (e.g. delay fields).
2917
+ */
2918
+ hideNumberSpinners?: boolean;
2913
2919
  }
2914
2920
 
2915
2921
  const Input = React.forwardRef(
2916
- ({ className, state, type, showCheckIcon, onFocus, onBlur, onWheel, ...props }: InputProps, ref: React.Ref<HTMLInputElement>) => {
2922
+ (
2923
+ {
2924
+ className,
2925
+ state,
2926
+ type,
2927
+ showCheckIcon,
2928
+ hideNumberSpinners = true,
2929
+ onFocus,
2930
+ onBlur,
2931
+ onWheel,
2932
+ ...props
2933
+ }: InputProps,
2934
+ ref: React.Ref<HTMLInputElement>
2935
+ ) => {
2917
2936
  const [isFocused, setIsFocused] = React.useState(false);
2918
2937
 
2919
2938
  const inputEl = (
@@ -2923,6 +2942,7 @@ const Input = React.forwardRef(
2923
2942
  inputVariants({ state, className }),
2924
2943
  showCheckIcon && "pr-9",
2925
2944
  type === "number" &&
2945
+ hideNumberSpinners &&
2926
2946
  "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none"
2927
2947
  )}
2928
2948
  ref={ref}
@@ -3402,6 +3422,149 @@ const MultiSelect = React.forwardRef(
3402
3422
  MultiSelect.displayName = "MultiSelect";
3403
3423
 
3404
3424
  export { MultiSelect, multiSelectTriggerVariants };
3425
+ `,
3426
+ "number-step-field": `import * as React from "react";
3427
+ import { cva } from "class-variance-authority";
3428
+ import { ChevronDown, ChevronUp } from "lucide-react";
3429
+
3430
+ import { cn } from "@/lib/utils";
3431
+ import { Input } from "./input";
3432
+
3433
+ const numberStepFieldVariants = cva(
3434
+ "flex min-w-0 w-full flex-1",
3435
+ {
3436
+ variants: {
3437
+ layout: {
3438
+ default: "",
3439
+ },
3440
+ },
3441
+ defaultVariants: {
3442
+ layout: "default",
3443
+ },
3444
+ }
3445
+ );
3446
+
3447
+ function clampInt(n: number, min: number, max: number): number {
3448
+ return Math.max(min, Math.min(max, Math.floor(n)));
3449
+ }
3450
+
3451
+ function parseOptionalInt(raw: string): number | null {
3452
+ if (raw === "") return 0;
3453
+ const n = Number.parseInt(raw, 10);
3454
+ return Number.isNaN(n) ? null : n;
3455
+ }
3456
+
3457
+ export interface NumberStepFieldProps
3458
+ extends Omit<
3459
+ React.HTMLAttributes<HTMLDivElement>,
3460
+ "onChange" | "children" | "onBlur"
3461
+ > {
3462
+ value: number;
3463
+ onValueChange: (value: number) => void;
3464
+ min?: number;
3465
+ max?: number;
3466
+ step?: number;
3467
+ /** Trailing label inside the field (e.g. \`hour\`, \`minutes\`). */
3468
+ suffix: string;
3469
+ disabled?: boolean;
3470
+ "aria-label"?: string;
3471
+ incrementAriaLabel?: string;
3472
+ decrementAriaLabel?: string;
3473
+ /** Called when the number input loses focus (e.g. validation). */
3474
+ onBlur?: React.FocusEventHandler<HTMLInputElement>;
3475
+ }
3476
+
3477
+ const NumberStepField = React.forwardRef<HTMLDivElement, NumberStepFieldProps>(
3478
+ (
3479
+ {
3480
+ className,
3481
+ value,
3482
+ onValueChange,
3483
+ min = 0,
3484
+ max = Number.MAX_SAFE_INTEGER,
3485
+ step = 1,
3486
+ suffix,
3487
+ disabled,
3488
+ "aria-label": ariaLabel,
3489
+ incrementAriaLabel,
3490
+ decrementAriaLabel,
3491
+ onBlur,
3492
+ ...props
3493
+ },
3494
+ ref
3495
+ ) => {
3496
+ const handleChange = (raw: string) => {
3497
+ const parsed = parseOptionalInt(raw);
3498
+ if (parsed === null) return;
3499
+ onValueChange(clampInt(parsed, min, max));
3500
+ };
3501
+
3502
+ const stepUp = () => {
3503
+ onValueChange(clampInt(value + step, min, max));
3504
+ };
3505
+
3506
+ const stepDown = () => {
3507
+ onValueChange(clampInt(value - step, min, max));
3508
+ };
3509
+
3510
+ const atMax = value >= max;
3511
+ const atMin = value <= min;
3512
+
3513
+ return (
3514
+ <div
3515
+ ref={ref}
3516
+ className={cn(numberStepFieldVariants({ layout: "default" }), className)}
3517
+ {...props}
3518
+ >
3519
+ <div className="flex min-w-0 flex-1 items-stretch rounded-md border border-solid border-semantic-border-input overflow-hidden focus-within:border-semantic-border-input-focus focus-within:shadow-[0_0_0_1px_rgba(43,188,202,0.15)]">
3520
+ <Input
3521
+ type="number"
3522
+ min={min}
3523
+ max={max}
3524
+ step={step}
3525
+ value={value}
3526
+ onChange={(e) => handleChange(e.target.value)}
3527
+ onBlur={onBlur}
3528
+ disabled={disabled}
3529
+ aria-label={ariaLabel}
3530
+ hideNumberSpinners
3531
+ className="rounded-none border-0 h-10 min-w-0 flex-1 bg-semantic-bg-primary px-3 py-2 focus-visible:ring-0 focus-visible:ring-offset-0 shadow-none"
3532
+ />
3533
+ {/* Inline steppers on the right inside the white field (before unit suffix) */}
3534
+ <div className="flex h-10 w-7 shrink-0 flex-col bg-semantic-bg-primary pr-0.5">
3535
+ <button
3536
+ type="button"
3537
+ disabled={disabled || atMax}
3538
+ onClick={stepUp}
3539
+ aria-label={incrementAriaLabel ?? "Increase value"}
3540
+ className="flex min-h-0 flex-1 items-center justify-center text-semantic-text-muted hover:bg-semantic-bg-hover hover:text-semantic-text-primary disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-semantic-primary"
3541
+ >
3542
+ <ChevronUp className="size-3.5" strokeWidth={2} />
3543
+ </button>
3544
+ <button
3545
+ type="button"
3546
+ disabled={disabled || atMin}
3547
+ onClick={stepDown}
3548
+ aria-label={decrementAriaLabel ?? "Decrease value"}
3549
+ className="flex min-h-0 flex-1 items-center justify-center text-semantic-text-muted hover:bg-semantic-bg-hover hover:text-semantic-text-primary disabled:pointer-events-none disabled:opacity-40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-semantic-primary"
3550
+ >
3551
+ <ChevronDown className="size-3.5" strokeWidth={2} />
3552
+ </button>
3553
+ </div>
3554
+ <span
3555
+ className="inline-flex items-center px-2.5 shrink-0 bg-semantic-bg-ui text-sm text-semantic-text-secondary"
3556
+ aria-hidden
3557
+ >
3558
+ {suffix}
3559
+ </span>
3560
+ </div>
3561
+ </div>
3562
+ );
3563
+ }
3564
+ );
3565
+ NumberStepField.displayName = "NumberStepField";
3566
+
3567
+ export { NumberStepField, numberStepFieldVariants };
3405
3568
  `,
3406
3569
  "page-header": `import * as React from "react";
3407
3570
  import { cva, type VariantProps } from "class-variance-authority";
@@ -8016,6 +8179,25 @@ var componentMetadata = {
8016
8179
  }
8017
8180
  ]
8018
8181
  },
8182
+ "number-step-field": {
8183
+ "name": "NumberStepField",
8184
+ "description": "A number step field component.",
8185
+ "dependencies": [
8186
+ "class-variance-authority",
8187
+ "clsx",
8188
+ "tailwind-merge",
8189
+ "lucide-react"
8190
+ ],
8191
+ "props": [],
8192
+ "variants": [],
8193
+ "examples": [
8194
+ {
8195
+ "title": "Basic NumberStepField",
8196
+ "code": "<NumberStepField>Content</NumberStepField>",
8197
+ "description": "Simple number step field usage"
8198
+ }
8199
+ ]
8200
+ },
8019
8201
  "page-header": {
8020
8202
  "name": "PageHeader",
8021
8203
  "description": "A page header component.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.166",
3
+ "version": "0.2.168",
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",