@yamada-ui/form-control
Version:
Yamada UI form control component
1 lines • 20.1 kB
Source Map (JSON)
{"version":3,"sources":["../src/form-control.tsx"],"sourcesContent":["import type { CSSUIObject, HTMLUIProps, ThemeProps } from \"@yamada-ui/core\"\nimport type { Dict } from \"@yamada-ui/utils\"\nimport type { FocusEventHandler, ReactNode } from \"react\"\nimport {\n forwardRef,\n omitThemeProps,\n ui,\n useComponentMultiStyle,\n} from \"@yamada-ui/core\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n findChild,\n getValidChildren,\n handlerAll,\n} from \"@yamada-ui/utils\"\nimport { isValidElement, useId, useState } from \"react\"\n\nexport interface FormControlOptions {\n /**\n * If `true`, the form control will be disabled.\n *\n * @default false\n */\n disabled?: boolean\n /**\n * If `true`, the form control will be invalid.\n *\n * @default false\n */\n invalid?: boolean\n /**\n * If `true`, the form control will be disabled.\n *\n * @default false\n *\n * @deprecated Use `disabled` instead.\n */\n isDisabled?: boolean\n /**\n * If `true`, the form control will be invalid.\n *\n * @default false\n *\n * @deprecated Use `invalid` instead.\n */\n isInvalid?: boolean\n /**\n * If `true`, the form control will be readonly.\n *\n * @default false\n *\n * @deprecated Use `readOnly` instead.\n */\n isReadOnly?: boolean\n /**\n * If `true`, the form control will be required.\n *\n * @default false\n *\n * @deprecated Use `required` instead.\n */\n isRequired?: boolean\n /**\n * If `true`, the form control will be readonly.\n *\n * @default false\n */\n readOnly?: boolean\n /**\n * If `true`, the form control will be required.\n *\n * @default false\n */\n required?: boolean\n}\n\ninterface FormControlAdditionalOptions extends LabelOptions {\n /**\n * The form control error message to use.\n */\n errorMessage?: ReactNode\n /**\n * The form control helper message to use.\n */\n helperMessage?: ReactNode\n /**\n * If `true`, switch between helper message and error message using isInvalid.\n *\n * @default true\n *\n * @deprecated Use `replace` instead.\n */\n isReplace?: boolean\n /**\n * The form control label to use.\n */\n label?: ReactNode\n /**\n * If `true`, switch between helper message and error message using isInvalid.\n *\n * @default true\n */\n replace?: boolean\n /**\n * Props the error message component.\n */\n errorMessageProps?: ErrorMessageProps\n /**\n * Props the label component.\n */\n helperMessageProps?: HelperMessageProps\n /**\n * Props the label component.\n */\n labelProps?: LabelProps\n}\n\nexport interface FormControlProps\n extends HTMLUIProps,\n ThemeProps<\"FormControl\">,\n FormControlOptions,\n FormControlAdditionalOptions {}\n\ninterface FormControlContext {\n disabled: boolean\n focused: boolean\n invalid: boolean\n readOnly: boolean\n replace: boolean\n required: boolean\n onBlur: () => void\n onFocus: () => void\n id?: string\n labelId?: string\n}\n\nexport const [FormControlContextProvider, useFormControlContext] =\n createContext<FormControlContext | undefined>({\n name: \"FormControlContext\",\n strict: false,\n })\n\ninterface FormControlStylesContext {\n [key: string]: CSSUIObject | undefined\n}\n\nexport const [FormControlStylesProvider, useFormControlStyles] = createContext<\n FormControlStylesContext | undefined\n>({\n name: \"FormControlStyleContext\",\n strict: false,\n})\n\n/**\n * `FormControl` is a component used to group form elements with label, helper message, error message, etc.\n *\n * @see Docs https://yamada-ui.com/components/forms/form-control\n */\nexport const FormControl = forwardRef<FormControlProps, \"div\">(\n ({ id, ...props }, ref) => {\n const [styles, mergedProps] = useComponentMultiStyle(\"FormControl\", props)\n const uuid = useId()\n const labelId = useId()\n const {\n className,\n children,\n isDisabled = false,\n disabled = isDisabled,\n errorMessage,\n helperMessage,\n isInvalid = false,\n invalid = isInvalid,\n isReadOnly = false,\n isReplace = true,\n isRequired = false,\n label,\n optionalIndicator,\n readOnly = isReadOnly,\n replace = isReplace,\n required = isRequired,\n requiredIndicator,\n errorMessageProps,\n helperMessageProps,\n labelProps,\n ...rest\n } = omitThemeProps(mergedProps)\n const [focused, setFocused] = useState<boolean>(false)\n const validChildren = getValidChildren(children)\n const customLabel = findChild(validChildren, Label)\n const customHelperMessage = findChild(validChildren, HelperMessage)\n const customErrorMessage = findChild(validChildren, ErrorMessage)\n const isCustomLabel = !!customLabel\n const isCustomHelperMessage = !!customHelperMessage\n const isCustomErrorMessage = !!customErrorMessage\n const css: CSSUIObject = { ...styles.container }\n\n id ??= uuid\n\n return (\n <FormControlContextProvider\n value={{\n id,\n disabled,\n focused,\n invalid,\n labelId,\n readOnly,\n replace,\n required,\n onBlur: () => setFocused(false),\n onFocus: () => setFocused(true),\n }}\n >\n <FormControlStylesProvider value={styles}>\n <ui.div\n ref={ref}\n className={cx(\"ui-form__control\", className)}\n data-disabled={dataAttr(disabled)}\n data-focus={dataAttr(focused)}\n data-invalid={dataAttr(invalid)}\n data-readonly={dataAttr(readOnly)}\n __css={css}\n {...rest}\n >\n {!isCustomLabel && label ? (\n <Label\n optionalIndicator={optionalIndicator}\n requiredIndicator={requiredIndicator}\n {...labelProps}\n >\n {label}\n </Label>\n ) : null}\n {children}\n {!isCustomHelperMessage && helperMessage ? (\n <HelperMessage {...helperMessageProps}>\n {helperMessage}\n </HelperMessage>\n ) : null}\n {!isCustomErrorMessage && errorMessage ? (\n <ErrorMessage {...errorMessageProps}>{errorMessage}</ErrorMessage>\n ) : null}\n </ui.div>\n </FormControlStylesProvider>\n </FormControlContextProvider>\n )\n },\n)\n\nFormControl.displayName = \"FormControl\"\nFormControl.__ui__ = \"FormControl\"\n\ninterface UseFormControlOptions extends FormControlOptions {\n id?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n}\n\nexport const useFormControl = <Y extends Dict = Dict>({\n id: idProp,\n disabled: disabledProp,\n invalid: invalidProp,\n isDisabled: isDisabledProp,\n isInvalid: isInvalidProp,\n isReadOnly: isReadOnlyProp,\n isRequired: isRequiredProp,\n readOnly: readOnlyProp,\n required: requiredProp,\n ...rest\n}: UseFormControlOptions & Y) => {\n const control = useFormControlContext()\n\n const id = idProp ?? control?.id\n const labelId = control?.labelId\n const disabled = disabledProp ?? isDisabledProp ?? control?.disabled\n const readOnly = readOnlyProp ?? isReadOnlyProp ?? control?.readOnly\n const required = requiredProp ?? isRequiredProp ?? control?.required\n const invalid = invalidProp ?? isInvalidProp ?? control?.invalid\n\n return {\n id,\n disabled,\n invalid,\n /**\n * @deprecated Use `disabled` instead.\n */\n isDisabled: disabled,\n /**\n * @deprecated Use `invalid` instead.\n */\n isInvalid: invalid,\n /**\n * @deprecated Use `readOnly` instead.\n */\n isReadOnly: readOnly,\n /**\n * @deprecated Use `required` instead.\n */\n isRequired: required,\n labelId,\n readOnly,\n required,\n ...rest,\n }\n}\n\nexport interface UseFormControlProps<Y extends HTMLElement>\n extends FormControlOptions {\n id?: string\n disabled?: boolean\n readOnly?: boolean\n required?: boolean\n onBlur?: FocusEventHandler<Y>\n onFocus?: FocusEventHandler<Y>\n}\n\nexport const useFormControlProps = <Y extends HTMLElement, M extends Dict>({\n id,\n disabled,\n invalid,\n isDisabled,\n isInvalid,\n isReadOnly,\n isRequired,\n readOnly,\n required,\n onBlur,\n onFocus,\n ...rest\n}: M & UseFormControlProps<Y>) => {\n const control = useFormControlContext()\n\n disabled ??= isDisabled ?? control?.disabled\n required ??= isRequired ?? control?.required\n readOnly ??= isReadOnly ?? control?.readOnly\n invalid ??= isInvalid ?? control?.invalid\n\n return {\n id: id ?? control?.id,\n \"aria-disabled\": ariaAttr(disabled),\n \"aria-invalid\": ariaAttr(invalid),\n \"aria-readonly\": ariaAttr(readOnly),\n \"aria-required\": ariaAttr(required),\n \"data-readonly\": dataAttr(readOnly),\n disabled,\n readOnly,\n required,\n onBlur: handlerAll(control?.onBlur, onBlur),\n onFocus: handlerAll(control?.onFocus, onFocus),\n ...(disabled || readOnly\n ? {\n _active: {},\n _focus: {},\n _focusVisible: {},\n _hover: {},\n _invalid: {},\n }\n : {}),\n ...rest,\n }\n}\n\nexport type FormControlProperty = (typeof formControlProperties)[number]\n\nexport const formControlProperties = [\n \"disabled\",\n \"required\",\n \"readOnly\",\n \"aria-disabled\",\n \"aria-readonly\",\n \"aria-required\",\n \"aria-invalid\",\n \"data-readonly\",\n \"onFocus\",\n \"onBlur\",\n \"_hover\",\n \"_active\",\n \"_focus\",\n \"_invalid\",\n \"_focusVisible\",\n] as const\n\nexport const getFormControlProperties = ({\n omit = [],\n pick = [],\n}: {\n omit?: FormControlProperty[]\n pick?: FormControlProperty[]\n} = {}) => {\n let result = [...formControlProperties]\n\n if (pick.length) {\n result = result.filter((property) => pick.includes(property))\n }\n\n if (omit.length) {\n result = result.filter((property) => !omit.includes(property))\n }\n\n return result\n}\n\ninterface LabelOptions {\n /**\n * @deprecated Use `required` instead.\n */\n isRequired?: boolean\n optionalIndicator?: ReactNode\n required?: boolean\n requiredIndicator?: ReactNode\n}\n\nexport interface LabelProps extends HTMLUIProps<\"label\">, LabelOptions {}\n\nexport const Label = forwardRef<LabelProps, \"label\">(\n (\n {\n id,\n htmlFor,\n className,\n children,\n isRequired,\n optionalIndicator = null,\n required: requiredProp = isRequired,\n requiredIndicator = null,\n ...rest\n },\n ref,\n ) => {\n const {\n id: formControlId,\n disabled,\n focused,\n invalid,\n labelId,\n readOnly,\n required,\n } = useFormControlContext() ?? {}\n const styles = useFormControlStyles() ?? {}\n const css: CSSUIObject = {\n display: \"block\",\n pointerEvents: readOnly ? \"none\" : undefined,\n ...styles.label,\n }\n\n id ??= labelId\n requiredProp ??= required\n\n return (\n <ui.label\n id={id}\n ref={ref}\n htmlFor={htmlFor ?? formControlId}\n className={cx(\"ui-form__label\", className)}\n style={{ cursor: disabled ? \"not-allowed\" : undefined }}\n data-disabled={dataAttr(disabled)}\n data-focus={dataAttr(focused)}\n data-invalid={dataAttr(invalid)}\n data-readonly={dataAttr(readOnly)}\n __css={css}\n {...rest}\n >\n {children}\n {requiredProp ? (\n requiredIndicator ? (\n <RequiredIndicator>{requiredIndicator}</RequiredIndicator>\n ) : (\n <RequiredIndicator />\n )\n ) : (\n optionalIndicator\n )}\n </ui.label>\n )\n },\n)\n\nLabel.displayName = \"Label\"\nLabel.__ui__ = \"Label\"\n\nexport interface RequiredIndicatorProps extends HTMLUIProps<\"span\"> {}\n\nexport const RequiredIndicator = forwardRef<RequiredIndicatorProps, \"span\">(\n ({ className, children, ...rest }, ref) => {\n const styles = useFormControlStyles() ?? {}\n const css: CSSUIObject = { ...styles.requiredIndicator }\n\n return !isValidElement(children) ? (\n <ui.span\n ref={ref}\n className={cx(\"ui-form__required-indicator\", className)}\n aria-hidden\n role=\"presentation\"\n __css={css}\n {...rest}\n >\n {children ?? <>*</>}\n </ui.span>\n ) : (\n children\n )\n },\n)\n\nRequiredIndicator.displayName = \"RequiredIndicator\"\nRequiredIndicator.__ui__ = \"RequiredIndicator\"\n\nexport interface HelperMessageProps extends HTMLUIProps<\"span\"> {}\n\nexport const HelperMessage = forwardRef<HelperMessageProps, \"span\">(\n ({ className, ...rest }, ref) => {\n const { id, invalid, replace } = useFormControlContext() ?? {}\n const styles = useFormControlStyles() ?? {}\n const css: CSSUIObject = { ...styles.helperMessage }\n\n if (replace && invalid) return null\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-form__helper-message\", className)}\n aria-describedby={id}\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nHelperMessage.displayName = \"HelperMessage\"\nHelperMessage.__ui__ = \"HelperMessage\"\n\nexport interface ErrorMessageProps extends HTMLUIProps<\"span\"> {}\n\nexport const ErrorMessage = forwardRef<ErrorMessageProps, \"span\">(\n ({ className, ...rest }, ref) => {\n const { invalid } = useFormControlContext() ?? {}\n const styles = useFormControlStyles() ?? {}\n const css: CSSUIObject = { ...styles.errorMessage }\n\n if (!invalid) return null\n\n return (\n <ui.span\n ref={ref}\n className={cx(\"ui-form__error-message\", className)}\n aria-live=\"polite\"\n __css={css}\n {...rest}\n />\n )\n },\n)\n\nErrorMessage.displayName = \"ErrorMessage\"\nErrorMessage.__ui__ = \"ErrorMessage\"\n"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB,OAAO,gBAAgB;AAuMtC,SA2RW,UAhRP,KAXJ;AA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