{"version":3,"file":"FormLabel.mjs","sources":["../../../../../../../../node_modules/@mui/material/FormLabel/FormLabel.js"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport formControlState from \"../FormControl/formControlState.js\";\nimport useFormControl from \"../FormControl/useFormControl.js\";\nimport capitalize from \"../utils/capitalize.js\";\nimport { styled } from \"../zero-styled/index.js\";\nimport memoTheme from \"../utils/memoTheme.js\";\nimport createSimplePaletteValueFilter from \"../utils/createSimplePaletteValueFilter.js\";\nimport { useDefaultProps } from \"../DefaultPropsProvider/index.js\";\nimport formLabelClasses, { getFormLabelUtilityClasses } from \"./formLabelClasses.js\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n  const {\n    classes,\n    color,\n    focused,\n    disabled,\n    error,\n    filled,\n    required\n  } = ownerState;\n  const slots = {\n    root: ['root', `color${capitalize(color)}`, disabled && 'disabled', error && 'error', filled && 'filled', focused && 'focused', required && 'required'],\n    asterisk: ['asterisk', error && 'error']\n  };\n  return composeClasses(slots, getFormLabelUtilityClasses, classes);\n};\nexport const FormLabelRoot = styled('label', {\n  name: 'MuiFormLabel',\n  slot: 'Root',\n  overridesResolver: (props, styles) => {\n    const {\n      ownerState\n    } = props;\n    return [styles.root, ownerState.color === 'secondary' && styles.colorSecondary, ownerState.filled && styles.filled];\n  }\n})(memoTheme(({\n  theme\n}) => ({\n  color: (theme.vars || theme).palette.text.secondary,\n  ...theme.typography.body1,\n  lineHeight: '1.4375em',\n  padding: 0,\n  position: 'relative',\n  variants: [...Object.entries(theme.palette).filter(createSimplePaletteValueFilter()).map(([color]) => ({\n    props: {\n      color\n    },\n    style: {\n      [`&.${formLabelClasses.focused}`]: {\n        color: (theme.vars || theme).palette[color].main\n      }\n    }\n  })), {\n    props: {},\n    style: {\n      [`&.${formLabelClasses.disabled}`]: {\n        color: (theme.vars || theme).palette.text.disabled\n      },\n      [`&.${formLabelClasses.error}`]: {\n        color: (theme.vars || theme).palette.error.main\n      }\n    }\n  }]\n})));\nconst AsteriskComponent = styled('span', {\n  name: 'MuiFormLabel',\n  slot: 'Asterisk',\n  overridesResolver: (props, styles) => styles.asterisk\n})(memoTheme(({\n  theme\n}) => ({\n  [`&.${formLabelClasses.error}`]: {\n    color: (theme.vars || theme).palette.error.main\n  }\n})));\nconst FormLabel = /*#__PURE__*/React.forwardRef(function FormLabel(inProps, ref) {\n  const props = useDefaultProps({\n    props: inProps,\n    name: 'MuiFormLabel'\n  });\n  const {\n    children,\n    className,\n    color,\n    component = 'label',\n    disabled,\n    error,\n    filled,\n    focused,\n    required,\n    ...other\n  } = props;\n  const muiFormControl = useFormControl();\n  const fcs = formControlState({\n    props,\n    muiFormControl,\n    states: ['color', 'required', 'focused', 'disabled', 'error', 'filled']\n  });\n  const ownerState = {\n    ...props,\n    color: fcs.color || 'primary',\n    component,\n    disabled: fcs.disabled,\n    error: fcs.error,\n    filled: fcs.filled,\n    focused: fcs.focused,\n    required: fcs.required\n  };\n  const classes = useUtilityClasses(ownerState);\n  return /*#__PURE__*/_jsxs(FormLabelRoot, {\n    as: component,\n    ownerState: ownerState,\n    className: clsx(classes.root, className),\n    ref: ref,\n    ...other,\n    children: [children, fcs.required && /*#__PURE__*/_jsxs(AsteriskComponent, {\n      ownerState: ownerState,\n      \"aria-hidden\": true,\n      className: classes.asterisk,\n      children: [\"\\u2009\", '*']\n    })]\n  });\n});\nprocess.env.NODE_ENV !== \"production\" ? FormLabel.propTypes /* remove-proptypes */ = {\n  // ┌────────────────────────────── Warning ──────────────────────────────┐\n  // │ These PropTypes are generated from the TypeScript type definitions. │\n  // │    To update them, edit the d.ts file and run `pnpm proptypes`.     │\n  // └─────────────────────────────────────────────────────────────────────┘\n  /**\n   * The content of the component.\n   */\n  children: PropTypes.node,\n  /**\n   * Override or extend the styles applied to the component.\n   */\n  classes: PropTypes.object,\n  /**\n   * @ignore\n   */\n  className: PropTypes.string,\n  /**\n   * The color of the component.\n   * It supports both default and custom theme colors, which can be added as shown in the\n   * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n   */\n  color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['error', 'info', 'primary', 'secondary', 'success', 'warning']), PropTypes.string]),\n  /**\n   * The component used for the root node.\n   * Either a string to use a HTML element or a component.\n   */\n  component: PropTypes.elementType,\n  /**\n   * If `true`, the label should be displayed in a disabled state.\n   */\n  disabled: PropTypes.bool,\n  /**\n   * If `true`, the label is displayed in an error state.\n   */\n  error: PropTypes.bool,\n  /**\n   * If `true`, the label should use filled classes key.\n   */\n  filled: PropTypes.bool,\n  /**\n   * If `true`, the input of this label is focused (used by `FormGroup` components).\n   */\n  focused: PropTypes.bool,\n  /**\n   * If `true`, the label will indicate that the `input` is required.\n   */\n  required: PropTypes.bool,\n  /**\n   * The system prop that allows defining system overrides as well as additional CSS styles.\n   */\n  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default FormLabel;"],"names":["useUtilityClasses","React.forwardRef","_jsxs"],"mappings":";;;;;;;;;;;;;AAeA,MAAMA,mBAAiB,GAAG,UAAU,IAAI;AACxC,EAAE,MAAM;AACR,IAAI,OAAO;AACX,IAAI,KAAK;AACT,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,KAAK;AACT,IAAI,MAAM;AACV,IAAI;AACJ,GAAG,GAAG,UAAU;AAChB,EAAE,MAAM,KAAK,GAAG;AAChB,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,UAAU,EAAE,KAAK,IAAI,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,OAAO,IAAI,SAAS,EAAE,QAAQ,IAAI,UAAU,C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