myoperator-mcp 0.2.166 → 0.2.167
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/dist/index.js +176 -1
- 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
|
-
(
|
|
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,142 @@ 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<React.HTMLAttributes<HTMLDivElement>, "onChange" | "children"> {
|
|
3459
|
+
value: number;
|
|
3460
|
+
onValueChange: (value: number) => void;
|
|
3461
|
+
min?: number;
|
|
3462
|
+
max?: number;
|
|
3463
|
+
step?: number;
|
|
3464
|
+
/** Trailing label inside the field (e.g. \`hour\`, \`minutes\`). */
|
|
3465
|
+
suffix: string;
|
|
3466
|
+
disabled?: boolean;
|
|
3467
|
+
"aria-label"?: string;
|
|
3468
|
+
incrementAriaLabel?: string;
|
|
3469
|
+
decrementAriaLabel?: string;
|
|
3470
|
+
}
|
|
3471
|
+
|
|
3472
|
+
const NumberStepField = React.forwardRef<HTMLDivElement, NumberStepFieldProps>(
|
|
3473
|
+
(
|
|
3474
|
+
{
|
|
3475
|
+
className,
|
|
3476
|
+
value,
|
|
3477
|
+
onValueChange,
|
|
3478
|
+
min = 0,
|
|
3479
|
+
max = Number.MAX_SAFE_INTEGER,
|
|
3480
|
+
step = 1,
|
|
3481
|
+
suffix,
|
|
3482
|
+
disabled,
|
|
3483
|
+
"aria-label": ariaLabel,
|
|
3484
|
+
incrementAriaLabel,
|
|
3485
|
+
decrementAriaLabel,
|
|
3486
|
+
...props
|
|
3487
|
+
},
|
|
3488
|
+
ref
|
|
3489
|
+
) => {
|
|
3490
|
+
const handleChange = (raw: string) => {
|
|
3491
|
+
const parsed = parseOptionalInt(raw);
|
|
3492
|
+
if (parsed === null) return;
|
|
3493
|
+
onValueChange(clampInt(parsed, min, max));
|
|
3494
|
+
};
|
|
3495
|
+
|
|
3496
|
+
const stepUp = () => {
|
|
3497
|
+
onValueChange(clampInt(value + step, min, max));
|
|
3498
|
+
};
|
|
3499
|
+
|
|
3500
|
+
const stepDown = () => {
|
|
3501
|
+
onValueChange(clampInt(value - step, min, max));
|
|
3502
|
+
};
|
|
3503
|
+
|
|
3504
|
+
const atMax = value >= max;
|
|
3505
|
+
const atMin = value <= min;
|
|
3506
|
+
|
|
3507
|
+
return (
|
|
3508
|
+
<div
|
|
3509
|
+
ref={ref}
|
|
3510
|
+
className={cn(numberStepFieldVariants({ layout: "default" }), className)}
|
|
3511
|
+
{...props}
|
|
3512
|
+
>
|
|
3513
|
+
<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)]">
|
|
3514
|
+
<Input
|
|
3515
|
+
type="number"
|
|
3516
|
+
min={min}
|
|
3517
|
+
max={max}
|
|
3518
|
+
step={step}
|
|
3519
|
+
value={value}
|
|
3520
|
+
onChange={(e) => handleChange(e.target.value)}
|
|
3521
|
+
disabled={disabled}
|
|
3522
|
+
aria-label={ariaLabel}
|
|
3523
|
+
hideNumberSpinners
|
|
3524
|
+
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"
|
|
3525
|
+
/>
|
|
3526
|
+
{/* Inline steppers on the right inside the white field (before unit suffix) */}
|
|
3527
|
+
<div className="flex h-10 w-7 shrink-0 flex-col bg-semantic-bg-primary pr-0.5">
|
|
3528
|
+
<button
|
|
3529
|
+
type="button"
|
|
3530
|
+
disabled={disabled || atMax}
|
|
3531
|
+
onClick={stepUp}
|
|
3532
|
+
aria-label={incrementAriaLabel ?? "Increase value"}
|
|
3533
|
+
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"
|
|
3534
|
+
>
|
|
3535
|
+
<ChevronUp className="size-3.5" strokeWidth={2} />
|
|
3536
|
+
</button>
|
|
3537
|
+
<button
|
|
3538
|
+
type="button"
|
|
3539
|
+
disabled={disabled || atMin}
|
|
3540
|
+
onClick={stepDown}
|
|
3541
|
+
aria-label={decrementAriaLabel ?? "Decrease value"}
|
|
3542
|
+
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"
|
|
3543
|
+
>
|
|
3544
|
+
<ChevronDown className="size-3.5" strokeWidth={2} />
|
|
3545
|
+
</button>
|
|
3546
|
+
</div>
|
|
3547
|
+
<span
|
|
3548
|
+
className="inline-flex items-center px-2.5 shrink-0 bg-semantic-bg-ui text-sm text-semantic-text-secondary"
|
|
3549
|
+
aria-hidden
|
|
3550
|
+
>
|
|
3551
|
+
{suffix}
|
|
3552
|
+
</span>
|
|
3553
|
+
</div>
|
|
3554
|
+
</div>
|
|
3555
|
+
);
|
|
3556
|
+
}
|
|
3557
|
+
);
|
|
3558
|
+
NumberStepField.displayName = "NumberStepField";
|
|
3559
|
+
|
|
3560
|
+
export { NumberStepField, numberStepFieldVariants };
|
|
3405
3561
|
`,
|
|
3406
3562
|
"page-header": `import * as React from "react";
|
|
3407
3563
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -8016,6 +8172,25 @@ var componentMetadata = {
|
|
|
8016
8172
|
}
|
|
8017
8173
|
]
|
|
8018
8174
|
},
|
|
8175
|
+
"number-step-field": {
|
|
8176
|
+
"name": "NumberStepField",
|
|
8177
|
+
"description": "A number step field component.",
|
|
8178
|
+
"dependencies": [
|
|
8179
|
+
"class-variance-authority",
|
|
8180
|
+
"clsx",
|
|
8181
|
+
"tailwind-merge",
|
|
8182
|
+
"lucide-react"
|
|
8183
|
+
],
|
|
8184
|
+
"props": [],
|
|
8185
|
+
"variants": [],
|
|
8186
|
+
"examples": [
|
|
8187
|
+
{
|
|
8188
|
+
"title": "Basic NumberStepField",
|
|
8189
|
+
"code": "<NumberStepField>Content</NumberStepField>",
|
|
8190
|
+
"description": "Simple number step field usage"
|
|
8191
|
+
}
|
|
8192
|
+
]
|
|
8193
|
+
},
|
|
8019
8194
|
"page-header": {
|
|
8020
8195
|
"name": "PageHeader",
|
|
8021
8196
|
"description": "A page header component.",
|
package/package.json
CHANGED