myoperator-mcp 0.2.388 → 0.2.390

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 +56 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2576,7 +2576,7 @@ import {
2576
2576
  type Strategy,
2577
2577
  } from "@floating-ui/react-dom";
2578
2578
  import { cva, type VariantProps } from "class-variance-authority";
2579
- import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
2579
+ import { ChevronDown, ChevronLeft, ChevronRight, X } from "lucide-react";
2580
2580
 
2581
2581
  import { cn } from "@/lib/utils";
2582
2582
  import {
@@ -2682,6 +2682,12 @@ export interface DateRangePickerProps
2682
2682
  triggerClassName?: string;
2683
2683
  /** Additional className merged onto the trigger's label span \u2014 e.g. \`"hidden sm:inline"\` to collapse to an icon-only button below a breakpoint */
2684
2684
  triggerLabelClassName?: string;
2685
+ /** Show a clear (x) button in the trigger once a range is selected. */
2686
+ clearable?: boolean;
2687
+ /** Called after the range is cleared. Fires alongside \`onValueChange({})\`. */
2688
+ onClear?: () => void;
2689
+ /** Accessible label for the clear button. Defaults to "Clear date range". */
2690
+ clearLabel?: string;
2685
2691
  }
2686
2692
 
2687
2693
  function normalizeValue(value?: DateRangeValue): DateRangeValue {
@@ -2895,6 +2901,9 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
2895
2901
  formatRange,
2896
2902
  triggerClassName,
2897
2903
  triggerLabelClassName,
2904
+ clearable = false,
2905
+ onClear,
2906
+ clearLabel = "Clear date range",
2898
2907
  id,
2899
2908
  ...props
2900
2909
  },
@@ -2974,6 +2983,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
2974
2983
  [visibleMonth]
2975
2984
  );
2976
2985
  const displayValue = (formatRange ?? defaultFormatRange)(currentValue);
2986
+ const showClear = clearable && !disabled && Boolean(displayValue);
2977
2987
  const effectiveMinDate = React.useMemo(() => {
2978
2988
  if (!disablePastDates) return minDate;
2979
2989
 
@@ -3109,6 +3119,20 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
3109
3119
  triggerRef.current?.focus();
3110
3120
  };
3111
3121
 
3122
+ const handleClear = (event: React.MouseEvent<HTMLButtonElement>) => {
3123
+ // The clear button sits on top of the trigger; without this the click
3124
+ // bubbles to the wrapper and the calendar pops open on clear.
3125
+ event.stopPropagation();
3126
+
3127
+ const cleared: DateRangeValue = { start: undefined, end: undefined };
3128
+ setDraftValue(cleared);
3129
+ setPendingEnd(false);
3130
+ commitValue(cleared);
3131
+ onClear?.();
3132
+ setOpen(false);
3133
+ triggerRef.current?.focus();
3134
+ };
3135
+
3112
3136
  const handleDayClick = (day: Date) => {
3113
3137
  if (!pendingEnd) {
3114
3138
  setDraftValue({ start: day, end: day });
@@ -3435,6 +3459,7 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
3435
3459
  state !== "error" &&
3436
3460
  "border-semantic-border-input-focus/50 shadow-[0_0_0_1px_rgba(43,188,202,0.15)]",
3437
3461
  !displayValue && "text-semantic-text-placeholder",
3462
+ showClear && "pr-9",
3438
3463
  triggerClassName
3439
3464
  )}
3440
3465
  onClick={() => setOpen(!open)}
@@ -3451,6 +3476,17 @@ const DateRangePicker = React.forwardRef<HTMLDivElement, DateRangePickerProps>(
3451
3476
  </span>
3452
3477
  </button>
3453
3478
 
3479
+ {showClear && (
3480
+ <button
3481
+ type="button"
3482
+ aria-label={clearLabel}
3483
+ className="absolute right-3 top-1/2 flex size-4 -translate-y-1/2 items-center justify-center rounded-sm text-semantic-text-secondary outline-none transition-colors hover:text-semantic-text-primary focus-visible:ring-2 focus-visible:ring-semantic-border-focus"
3484
+ onClick={handleClear}
3485
+ >
3486
+ <X className="size-4" />
3487
+ </button>
3488
+ )}
3489
+
3454
3490
  {popover}
3455
3491
  </div>
3456
3492
  );
@@ -10356,6 +10392,14 @@ export interface SelectFieldProps {
10356
10392
  * presentation only.
10357
10393
  */
10358
10394
  truncateOptionText?: boolean;
10395
+ /**
10396
+ * Content shown inside the open dropdown when \`options\` is empty (and no
10397
+ * search query is active \u2014 that case shows "No results found"). Use it to
10398
+ * tell the user why the list is empty and what to do next, e.g.
10399
+ * "No AI Agents yet. Build one in AI Agents first."
10400
+ * Default: "No options available".
10401
+ */
10402
+ emptyMessage?: React.ReactNode;
10359
10403
  }
10360
10404
 
10361
10405
  /**
@@ -10434,6 +10478,7 @@ const SelectField = React.forwardRef(
10434
10478
  loadingMore,
10435
10479
  hasMore,
10436
10480
  truncateOptionText,
10481
+ emptyMessage = "No options available",
10437
10482
  }: SelectFieldProps,
10438
10483
  ref: React.Ref<HTMLButtonElement>
10439
10484
  ) => {
@@ -10716,6 +10761,16 @@ const SelectField = React.forwardRef(
10716
10761
  </div>
10717
10762
  )}
10718
10763
 
10764
+ {/* Empty state \u2014 no options at all and nothing being searched/loaded. */}
10765
+ {options.length === 0 && !effectiveSearchQuery && !loadingMore && (
10766
+ <div
10767
+ role="status"
10768
+ className="px-3 py-6 text-center text-sm text-semantic-text-muted"
10769
+ >
10770
+ {emptyMessage}
10771
+ </div>
10772
+ )}
10773
+
10719
10774
  {/* Loading-more row (lazy-load) */}
10720
10775
  {loadingMore && (
10721
10776
  <div
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.388",
3
+ "version": "0.2.390",
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",