myoperator-mcp 0.2.306 → 0.2.308

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 +61 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5838,10 +5838,30 @@ Panel.displayName = "Panel";
5838
5838
  export { Panel, panelVariants };
5839
5839
  `,
5840
5840
  "phone-input": `import * as React from "react";
5841
+ import { cva, type VariantProps } from "class-variance-authority";
5841
5842
  import { ChevronDown } from "lucide-react";
5842
5843
 
5843
5844
  import { cn } from "@/lib/utils";
5844
5845
 
5846
+ const phoneInputContainerVariants = cva(
5847
+ "flex items-center border border-solid rounded transition-all",
5848
+ {
5849
+ variants: {
5850
+ state: {
5851
+ default:
5852
+ "border-semantic-border-input focus-within:outline-none focus-within:border-semantic-border-input-focus focus-within:ring-1 focus-within:ring-semantic-border-input-focus/15",
5853
+ empty:
5854
+ "border-semantic-border-input focus-within:outline-none focus-within:border-semantic-border-input-focus focus-within:ring-1 focus-within:ring-semantic-border-input-focus/15",
5855
+ error:
5856
+ "border-semantic-error-primary focus-within:outline-none focus-within:border-semantic-error-primary focus-within:ring-1 focus-within:ring-semantic-error-primary/15",
5857
+ },
5858
+ },
5859
+ defaultVariants: {
5860
+ state: "default",
5861
+ },
5862
+ }
5863
+ );
5864
+
5845
5865
  /**
5846
5866
  * A phone number input with a country code prefix area.
5847
5867
  *
@@ -5850,11 +5870,18 @@ import { cn } from "@/lib/utils";
5850
5870
  * <PhoneInput placeholder="Enter phone number" />
5851
5871
  * <PhoneInput countryFlag="\u{1F1FA}\u{1F1F8}" countryCode="+1" />
5852
5872
  * <PhoneInput phoneMaxNumber={10} />
5873
+ * <PhoneInput state="empty" />
5874
+ * <PhoneInput validation="Enter a valid phone number" />
5853
5875
  * <PhoneInput onCountryClick={() => openCountryPicker()} />
5854
5876
  * \`\`\`
5855
5877
  */
5856
5878
  export interface PhoneInputProps
5857
- extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type"> {
5879
+ extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type">,
5880
+ VariantProps<typeof phoneInputContainerVariants> {
5881
+ /** Visual validation state of the phone input */
5882
+ state?: "default" | "empty" | "error";
5883
+ /** Validation message displayed below the input. Also applies error styling. */
5884
+ validation?: string;
5858
5885
  /** Country flag emoji (e.g., "\u{1F1EE}\u{1F1F3}", "\u{1F1FA}\u{1F1F8}"). Defaults to "\u{1F1EE}\u{1F1F3}" */
5859
5886
  countryFlag?: string;
5860
5887
  /** Country dial code (e.g., "+91", "+1"). Defaults to "+91" */
@@ -5873,6 +5900,8 @@ const PhoneInput = React.forwardRef(
5873
5900
  (
5874
5901
  {
5875
5902
  className,
5903
+ state,
5904
+ validation,
5876
5905
  countryFlag = "\u{1F1EE}\u{1F1F3}",
5877
5906
  countryCode = "+91",
5878
5907
  showChevron = true,
@@ -5886,11 +5915,21 @@ const PhoneInput = React.forwardRef(
5886
5915
  onKeyDown,
5887
5916
  maxLength,
5888
5917
  phoneMaxNumber,
5918
+ id,
5919
+ "aria-describedby": ariaDescribedBy,
5920
+ "aria-invalid": ariaInvalid,
5889
5921
  ...props
5890
5922
  }: PhoneInputProps,
5891
5923
  ref: React.Ref<HTMLInputElement>
5892
5924
  ) => {
5893
5925
  const effectiveMaxLength = phoneMaxNumber ?? maxLength;
5926
+ const generatedId = React.useId();
5927
+ const inputId = id || generatedId;
5928
+ const validationId = \`\${inputId}-validation\`;
5929
+ const derivedState = validation ? "error" : (state ?? "default");
5930
+ const describedBy = [ariaDescribedBy, validation ? validationId : undefined]
5931
+ .filter(Boolean)
5932
+ .join(" ");
5894
5933
 
5895
5934
  const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
5896
5935
  onKeyDown?.(event);
@@ -5935,10 +5974,12 @@ const PhoneInput = React.forwardRef(
5935
5974
  onChange?.(event);
5936
5975
  };
5937
5976
 
5938
- return (
5977
+ const phoneInput = (
5939
5978
  <div
5940
5979
  className={cn(
5941
- "flex items-center border border-solid border-semantic-border-input rounded focus-within:outline-none focus-within:border-semantic-border-input-focus focus-within:shadow-[0_0_0_1px_rgba(43,188,202,0.15)] transition-all",
5980
+ phoneInputContainerVariants({
5981
+ state: derivedState,
5982
+ }),
5942
5983
  disabled && "opacity-60 bg-semantic-bg-ui cursor-not-allowed",
5943
5984
  wrapperClassName
5944
5985
  )}
@@ -5962,11 +6003,14 @@ const PhoneInput = React.forwardRef(
5962
6003
  <div className="w-px h-5 bg-semantic-border-layout shrink-0" />
5963
6004
  <input
5964
6005
  type="tel"
6006
+ id={inputId}
5965
6007
  ref={ref}
5966
6008
  disabled={disabled}
5967
6009
  inputMode={inputMode}
5968
6010
  pattern={pattern}
5969
6011
  maxLength={effectiveMaxLength}
6012
+ aria-invalid={ariaInvalid ?? derivedState === "error"}
6013
+ aria-describedby={describedBy || undefined}
5970
6014
  className={cn(
5971
6015
  "flex-1 h-10 px-3 text-sm text-semantic-text-primary placeholder:text-semantic-text-muted outline-none bg-transparent disabled:cursor-not-allowed",
5972
6016
  className
@@ -5978,11 +6022,24 @@ const PhoneInput = React.forwardRef(
5978
6022
  />
5979
6023
  </div>
5980
6024
  );
6025
+
6026
+ if (!validation) {
6027
+ return phoneInput;
6028
+ }
6029
+
6030
+ return (
6031
+ <div className="flex flex-col gap-1.5">
6032
+ {phoneInput}
6033
+ <p id={validationId} className="m-0 text-sm text-semantic-error-primary">
6034
+ {validation}
6035
+ </p>
6036
+ </div>
6037
+ );
5981
6038
  }
5982
6039
  );
5983
6040
  PhoneInput.displayName = "PhoneInput";
5984
6041
 
5985
- export { PhoneInput };
6042
+ export { PhoneInput, phoneInputContainerVariants };
5986
6043
  `,
5987
6044
  "readable-field": `import * as React from "react";
5988
6045
  import { Copy, Check, Eye, EyeOff } from "lucide-react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-mcp",
3
- "version": "0.2.306",
3
+ "version": "0.2.308",
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",