{"version":3,"sources":["../src/pin-input.tsx"],"sourcesContent":["import type {\n  ColorModeToken,\n  CSS,\n  CSSUIObject,\n  HTMLUIProps,\n  ThemeProps,\n} from \"@yamada-ui/core\"\nimport type { FormControlOptions } from \"@yamada-ui/form-control\"\nimport type { ChangeEvent, KeyboardEvent, Ref } from \"react\"\nimport {\n  forwardRef,\n  omitThemeProps,\n  ui,\n  useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport {\n  formControlProperties,\n  useFormControlProps,\n} from \"@yamada-ui/form-control\"\nimport { useControllableState } from \"@yamada-ui/use-controllable-state\"\nimport { createDescendant } from \"@yamada-ui/use-descendant\"\nimport {\n  createContext,\n  cx,\n  filterUndefined,\n  getValidChildren,\n  handlerAll,\n  mergeRefs,\n  splitObject,\n} from \"@yamada-ui/utils\"\nimport { useCallback, useEffect, useId, useState } from \"react\"\n\nconst toArray = (value?: string) => value?.split(\"\")\n\nconst validate = (value: string, type: PinInputProps[\"type\"]) => {\n  const NUMERIC_REGEX = /^[0-9]+$/\n  const ALPHA_NUMERIC_REGEX = /^[a-zA-Z0-9]+$/i\n\n  const regex = type === \"alphanumeric\" ? ALPHA_NUMERIC_REGEX : NUMERIC_REGEX\n\n  return regex.test(value)\n}\n\ninterface PinInputContext {\n  styles: { [key: string]: CSSUIObject | undefined }\n  getInputProps: (\n    props: {\n      index: number\n      ref?: Ref<HTMLInputElement>\n    } & PinInputFieldProps,\n  ) => PinInputFieldProps\n}\n\nconst [PinInputProvider, usePinInputContext] = createContext<PinInputContext>({\n  name: \"PinInputContext\",\n  errorMessage: `PinInputContext returned is 'undefined'. Seems you forgot to wrap the components in \"<PinInput />\"`,\n})\n\nconst { DescendantsContextProvider, useDescendant, useDescendants } =\n  createDescendant<HTMLInputElement>()\n\ninterface PinInputOptions {\n  /**\n   * The top-level id string that will be applied to the input fields.\n   * The index of the input will be appended to this top-level id.\n   */\n  id?: string\n  /**\n   * The type of values the pin-input should allow.\n   *\n   * @default 'number'\n   */\n  type?: \"alphanumeric\" | \"number\"\n  /**\n   * If `true`, the pin input receives focus on mount.\n   *\n   * @default false\n   */\n  autoFocus?: boolean\n  /**\n   * The initial value of the pin input.\n   */\n  defaultValue?: string\n  /**\n   * The border color when the input is invalid.\n   */\n  errorBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n  /**\n   * The border color when the input is focused.\n   */\n  focusBorderColor?: ColorModeToken<CSS.Property.BorderColor, \"colors\">\n  /**\n   * The number of inputs to display.\n   *\n   * @default 4\n   */\n  items?: number\n  /**\n   * If `true`, focus will move automatically to the next input once filled.\n   *\n   * @default true\n   */\n  manageFocus?: boolean\n  /**\n   * If `true`, the input's value will be masked just like `type=password`.\n   */\n  mask?: boolean\n  /**\n   * If `true`, the pin input component signals to its fields that they should.\n   */\n  otp?: boolean\n  /**\n   * The placeholder for the pin input.\n   *\n   * @default '○'\n   */\n  placeholder?: string\n  /**\n   * The value of the pin input.\n   */\n  value?: string\n  /**\n   * Function called on input change.\n   */\n  onChange?: (value: string) => void\n  /**\n   * Function called when all inputs have valid values.\n   */\n  onComplete?: (value: string) => void\n}\n\nexport interface PinInputProps\n  extends Omit<HTMLUIProps, \"defaultValue\" | \"mask\" | \"onChange\">,\n    ThemeProps<\"PinInput\">,\n    FormControlOptions,\n    PinInputOptions {}\n\n/**\n * `PinInput` is a component used to capture pin codes or OTP (One-Time Password) inputs.\n *\n * @see Docs https://yamada-ui.com/components/forms/pin-input\n */\nexport const PinInput = forwardRef<PinInputProps, \"div\">(\n  ({ errorBorderColor, focusBorderColor, ...props }, ref) => {\n    const [styles, mergedProps] = useComponentMultiStyle(\"PinInput\", {\n      errorBorderColor,\n      focusBorderColor,\n      ...props,\n    })\n    const uuid = useId()\n    const {\n      id = uuid,\n      type = \"number\",\n      className,\n      autoFocus,\n      children,\n      defaultValue,\n      items = 4,\n      manageFocus = true,\n      mask,\n      otp = false,\n      placeholder = \"○\",\n      value,\n      onChange: onChangeProp,\n      onComplete,\n      ...rest\n    } = useFormControlProps(omitThemeProps(mergedProps))\n    const [\n      {\n        \"aria-readonly\": _ariaReadonly,\n        disabled,\n        readOnly,\n        ...formControlProps\n      },\n      containerProps,\n    ] = splitObject(rest, formControlProperties)\n    const descendants = useDescendants()\n    const [moveFocus, setMoveFocus] = useState<boolean>(true)\n    const [focusedIndex, setFocusedIndex] = useState<number>(-1)\n    const [values, setValues] = useControllableState<string[]>({\n      defaultValue: toArray(defaultValue) || [],\n      value: toArray(value),\n      onChange: (values) => onChangeProp?.(values.join(\"\")),\n    })\n    const css: CSSUIObject = {\n      alignItems: \"center\",\n      display: \"flex\",\n      ...styles.container,\n    }\n\n    const focusNext = useCallback(\n      (index: number) => {\n        if (!moveFocus || !manageFocus) return\n\n        const next = descendants.nextValue(index, undefined, false)\n\n        if (!next) return\n\n        requestAnimationFrame(() => next.node.focus())\n      },\n      [descendants, moveFocus, manageFocus],\n    )\n\n    const focusInputField = useCallback(\n      (direction: \"next\" | \"prev\", index: number) => {\n        const input =\n          direction === \"next\"\n            ? descendants.nextValue(index, undefined, false)\n            : descendants.prevValue(index, undefined, false)\n\n        if (!input) return\n\n        const valueLength = input.node.value.length\n\n        requestAnimationFrame(() => {\n          input.node.focus()\n          input.node.setSelectionRange(0, valueLength)\n        })\n      },\n      [descendants],\n    )\n\n    const setValue = useCallback(\n      (value: string, index: number, isFocus = true) => {\n        let nextValues = [...values]\n\n        nextValues[index] = value\n\n        setValues(nextValues)\n\n        nextValues = nextValues.filter(Boolean)\n\n        const isComplete =\n          value !== \"\" && nextValues.length === descendants.count()\n\n        if (isComplete) {\n          onComplete?.(nextValues.join(\"\"))\n          descendants.value(index)?.node.blur()\n        } else if (isFocus) {\n          focusNext(index)\n        }\n      },\n      [values, setValues, descendants, onComplete, focusNext],\n    )\n\n    const getNextValue = useCallback(\n      (value: string | undefined, eventValue: string) => {\n        let nextValue = eventValue\n\n        if (!value?.length) return nextValue\n\n        if (value.startsWith(eventValue.charAt(0))) {\n          nextValue = eventValue.charAt(1)\n        } else if (value.startsWith(eventValue.charAt(1))) {\n          nextValue = eventValue.charAt(0)\n        }\n\n        return nextValue\n      },\n      [],\n    )\n\n    const onChange = useCallback(\n      (index: number) =>\n        ({ target }: ChangeEvent<HTMLInputElement>) => {\n          const eventValue = target.value\n          const currentValue = values[index]\n          const nextValue = getNextValue(currentValue, eventValue)\n\n          if (nextValue === \"\") {\n            setValue(\"\", index)\n\n            return\n          }\n\n          if (eventValue.length > 2) {\n            if (!validate(eventValue, type)) return\n\n            const nextValue = eventValue\n              .split(\"\")\n              .filter((_, index) => index < descendants.count())\n\n            setValues(nextValue)\n\n            if (nextValue.length === descendants.count()) {\n              onComplete?.(nextValue.join(\"\"))\n              descendants.value(index)?.node.blur()\n            }\n          } else {\n            if (validate(nextValue, type)) setValue(nextValue, index)\n\n            setMoveFocus(true)\n          }\n        },\n      [\n        descendants,\n        getNextValue,\n        onComplete,\n        setValue,\n        setValues,\n        type,\n        values,\n      ],\n    )\n\n    const onKeyDown = useCallback(\n      (index: number) => (ev: KeyboardEvent<HTMLInputElement>) => {\n        if (!manageFocus) return\n\n        const actions: { [key: string]: Function | undefined } = {\n          ArrowLeft: () => {\n            ev.preventDefault()\n            focusInputField(\"prev\", index)\n          },\n          ArrowRight: () => {\n            ev.preventDefault()\n            focusInputField(\"next\", index)\n          },\n          Backspace: () => {\n            if ((ev.target as HTMLInputElement).value === \"\") {\n              const prevInput = descendants.prevValue(index, undefined, false)\n\n              if (!prevInput) return\n\n              setValue(\"\", index - 1, false)\n              prevInput.node.focus()\n              setMoveFocus(true)\n            } else {\n              setMoveFocus(false)\n            }\n          },\n        }\n\n        const action = actions[ev.key]\n\n        if (!action) return\n\n        action()\n      },\n      [descendants, focusInputField, manageFocus, setValue],\n    )\n\n    const onFocus = useCallback(\n      (index: number) => () => setFocusedIndex(index),\n      [],\n    )\n\n    const onBlur = useCallback(() => setFocusedIndex(-1), [])\n\n    useEffect(() => {\n      if (!autoFocus) return\n\n      const firstValue = descendants.firstValue()\n\n      if (!firstValue) return\n\n      requestAnimationFrame(() => firstValue.node.focus())\n    }, [autoFocus, descendants])\n\n    const getInputProps = useCallback(\n      ({\n        index,\n        ...props\n      }: {\n        index: number\n        ref?: Ref<HTMLInputElement>\n      } & PinInputFieldProps): PinInputFieldProps => ({\n        type: mask ? \"password\" : type === \"number\" ? \"tel\" : \"text\",\n        disabled,\n        inputMode: type === \"number\" ? \"numeric\" : \"text\",\n        readOnly,\n        ...formControlProps,\n        ...filterUndefined(props),\n        id: `${id}-${index}`,\n        autoComplete: otp ? \"one-time-code\" : \"off\",\n        placeholder:\n          focusedIndex === index && !readOnly && !props.readOnly\n            ? \"\"\n            : placeholder,\n        value: values[index] || \"\",\n        onBlur: handlerAll(props.onBlur, onBlur),\n        onChange: handlerAll(props.onChange, onChange(index)),\n        onFocus: handlerAll(props.onFocus, onFocus(index)),\n        onKeyDown: handlerAll(props.onKeyDown, onKeyDown(index)),\n      }),\n      [\n        type,\n        mask,\n        formControlProps,\n        id,\n        values,\n        onChange,\n        onKeyDown,\n        onFocus,\n        onBlur,\n        otp,\n        focusedIndex,\n        disabled,\n        readOnly,\n        placeholder,\n      ],\n    )\n\n    let cloneChildren = getValidChildren(children)\n\n    if (!cloneChildren.length)\n      for (let i = 0; i < items; i++) {\n        cloneChildren.push(<PinInputField key={i} />)\n      }\n\n    return (\n      <DescendantsContextProvider value={descendants}>\n        <PinInputProvider value={{ styles, getInputProps }}>\n          <ui.div\n            ref={ref}\n            className={cx(\"ui-pin-input\", className)}\n            role=\"group\"\n            __css={css}\n            {...formControlProps}\n            {...containerProps}\n          >\n            {cloneChildren}\n          </ui.div>\n        </PinInputProvider>\n      </DescendantsContextProvider>\n    )\n  },\n)\n\nPinInput.displayName = \"PinInput\"\nPinInput.__ui__ = \"PinInput\"\n\nexport interface PinInputFieldProps\n  extends HTMLUIProps<\"input\">,\n    FormControlOptions {}\n\nexport const PinInputField = forwardRef<PinInputFieldProps, \"input\">(\n  ({ className, ...rest }, ref) => {\n    const { styles, getInputProps } = usePinInputContext()\n    const { index, register } = useDescendant()\n    const css: CSSUIObject = { ...styles.field }\n\n    rest = useFormControlProps(rest)\n\n    return (\n      <ui.input\n        className={cx(\"ui-pin-input__field\", className)}\n        {...getInputProps({ ...rest, ref: mergeRefs(register, ref), index })}\n        __css={css}\n      />\n    )\n  },\n)\n\nPinInputField.displayName = \"PinInputField\"\nPinInputField.__ui__ = \"PinInputField\"\n"],"mappings":";;;AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AACjC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,WAAW,OAAO,gBAAgB;AAyX7B;AAvX3B,IAAM,UAAU,CAAC,UAAmB,+BAAO,MAAM;AAEjD,IAAM,WAAW,CAAC,OAAe,SAAgC;AAC/D,QAAM,gBAAgB;AACtB,QAAM,sBAAsB;AAE5B,QAAM,QAAQ,SAAS,iBAAiB,sBAAsB;AAE9D,SAAO,MAAM,KAAK,KAAK;AACzB;AAYA,IAAM,CAAC,kBAAkB,kBAAkB,IAAI,cAA+B;AAAA,EAC5E,MAAM;AAAA,EACN,cAAc;AAChB,CAAC;AAED,IAAM,EAAE,4BAA4B,eAAe,eAAe,IAChE,iBAAmC;AAmF9B,IAAM,WAAW;AAAA,EACtB,CAAC,EAAE,kBAAkB,kBAAkB,GAAG,MAAM,GAAG,QAAQ;AACzD,UAAM,CAAC,QAAQ,WAAW,IAAI,uBAAuB,YAAY;AAAA,MAC/D;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,CAAC;AACD,UAAM,OAAO,MAAM;AACnB,UAAM;AAAA,MACJ,KAAK;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,QA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