@frank-auth/react
Version:
Flexible and customizable React UI components for Frank Authentication
1 lines • 18.1 kB
Source Map (JSON)
{"version":3,"file":"input.cjs","sources":["../../../../../src/components/ui/input/input.tsx"],"sourcesContent":["import { useTheme } from \"@/theme/context\";\nimport { type StyledProps, getColorVariant } from \"@/theme/styled\";\nimport { css } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { useState, useRef, useImperativeHandle } from \"react\";\n\nexport interface InputProps\n\textends Omit<React.InputHTMLAttributes<HTMLInputElement>, \"size\"> {\n\t/** Input variant */\n\tvariant?: \"flat\" | \"bordered\" | \"underlined\" | \"faded\";\n\t/** Input color theme */\n\tcolor?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\";\n\t/** Input size */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Input radius */\n\tradius?: \"none\" | \"sm\" | \"md\" | \"lg\" | \"full\";\n\t/** Label text */\n\tlabel?: string;\n\t/** Placeholder text */\n\tplaceholder?: string;\n\t/** Description text */\n\tdescription?: string;\n\t/** Error message */\n\terrorMessage?: string;\n\t/** Invalid state */\n\tisInvalid?: boolean;\n\t/** Disabled state */\n\tisDisabled?: boolean;\n\t/** Required field */\n\tisRequired?: boolean;\n\t/** Full width input */\n\tfullWidth?: boolean;\n\t/** Start content (icon) */\n\tstartContent?: React.ReactNode;\n\t/** End content (icon) */\n\tendContent?: React.ReactNode;\n\t/** Custom class name */\n\tclassName?: string;\n\t/** Custom styles */\n\tcss?: any;\n\t/** Label placement */\n\tlabelPlacement?: \"inside\" | \"outside\" | \"outside-left\";\n}\n\ntype StyledInputProps = StyledProps<InputProps>;\n\nconst getInputVariantStyles = (\n\tprops: StyledInputProps & { isFocused: boolean },\n) => {\n\tconst {\n\t\ttheme,\n\t\tvariant = \"flat\",\n\t\tcolor = \"primary\",\n\t\tisInvalid,\n\t\tisFocused,\n\t\tisDisabled,\n\t} = props;\n\tconst baseColor = getColorVariant(theme, color, 500);\n\tconst errorColor = theme.colors.danger[500];\n\n\tconst focusColor = isInvalid ? errorColor : baseColor;\n\n\tswitch (variant) {\n\t\tcase \"flat\":\n\t\t\treturn css`\n background-color: ${theme.colors.background.secondary};\n border: 2px solid transparent;\n\n &:hover:not(:disabled) {\n background-color: ${theme.colors.background.tertiary};\n }\n\n ${\n\t\t\t\t\tisFocused &&\n\t\t\t\t\tcss`\n background-color: ${theme.colors.background.primary};\n border-color: ${focusColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisInvalid &&\n\t\t\t\t\tcss`\n border-color: ${errorColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisDisabled &&\n\t\t\t\t\tcss`\n opacity: 0.5;\n cursor: not-allowed;\n `\n\t\t\t\t}\n `;\n\n\t\tcase \"bordered\":\n\t\t\treturn css`\n background-color: ${theme.colors.background.primary};\n border: 2px solid ${theme.colors.border.primary};\n\n &:hover:not(:disabled) {\n border-color: ${theme.colors.border.secondary};\n }\n\n ${\n\t\t\t\t\tisFocused &&\n\t\t\t\t\tcss`\n border-color: ${focusColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisInvalid &&\n\t\t\t\t\tcss`\n border-color: ${errorColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisDisabled &&\n\t\t\t\t\tcss`\n opacity: 0.5;\n cursor: not-allowed;\n background-color: ${theme.colors.background.secondary};\n `\n\t\t\t\t}\n `;\n\n\t\tcase \"underlined\":\n\t\t\treturn css`\n background-color: transparent;\n border: none;\n border-bottom: 2px solid ${theme.colors.border.primary};\n /* Fixed: Don't override border-radius here, let the radius function handle it */\n\n &:hover:not(:disabled) {\n border-bottom-color: ${theme.colors.border.secondary};\n }\n\n ${\n\t\t\t\t\tisFocused &&\n\t\t\t\t\tcss`\n border-bottom-color: ${focusColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisInvalid &&\n\t\t\t\t\tcss`\n border-bottom-color: ${errorColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisDisabled &&\n\t\t\t\t\tcss`\n opacity: 0.5;\n cursor: not-allowed;\n `\n\t\t\t\t}\n `;\n\n\t\tcase \"faded\":\n\t\t\treturn css`\n background-color: ${theme.colors.neutral[100]};\n border: 2px solid ${theme.colors.neutral[200]};\n\n &:hover:not(:disabled) {\n background-color: ${theme.colors.neutral[50]};\n border-color: ${theme.colors.neutral[300]};\n }\n\n ${\n\t\t\t\t\tisFocused &&\n\t\t\t\t\tcss`\n background-color: ${theme.colors.background.primary};\n border-color: ${focusColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisInvalid &&\n\t\t\t\t\tcss`\n border-color: ${errorColor};\n `\n\t\t\t\t}\n\n ${\n\t\t\t\t\tisDisabled &&\n\t\t\t\t\tcss`\n opacity: 0.5;\n cursor: not-allowed;\n `\n\t\t\t\t}\n `;\n\n\t\tdefault:\n\t\t\treturn css``;\n\t}\n};\n\n// Fixed: Add !important to size-related properties to ensure they take precedence\nconst getInputSizeStyles = (props: StyledInputProps) => {\n\tconst { theme, size = \"md\" } = props;\n\n\tswitch (size) {\n\t\tcase \"sm\":\n\t\t\treturn css`\n height: ${theme.spacing[8]} !important;\n padding: 0 ${theme.spacing[3]} !important;\n font-size: ${theme.fontSizes.sm} !important;\n `;\n\t\tcase \"md\":\n\t\t\treturn css`\n height: ${theme.spacing[10]} !important;\n padding: 0 ${theme.spacing[4]} !important;\n font-size: ${theme.fontSizes.base} !important;\n `;\n\t\tcase \"lg\":\n\t\t\treturn css`\n height: ${theme.spacing[12]} !important;\n padding: 0 ${theme.spacing[6]} !important;\n font-size: ${theme.fontSizes.lg} !important;\n `;\n\t\tdefault:\n\t\t\treturn css``;\n\t}\n};\n\n// Fixed: Always apply border-radius, even for underlined variant (unless specifically none)\n// and use !important to ensure it overrides other styles\nconst getInputRadiusStyles = (props: StyledInputProps) => {\n\tconst { theme, radius = \"md\", variant } = props;\n\n\t// For underlined variant, only apply radius if it's not the default\n\t// This preserves the underlined look while allowing customization\n\tif (variant === \"underlined\" && radius === \"md\") {\n\t\treturn css`border-radius: 0 !important;`;\n\t}\n\n\tswitch (radius) {\n\t\tcase \"none\":\n\t\t\treturn css`border-radius: ${theme.borderRadius.none} !important;`;\n\t\tcase \"sm\":\n\t\t\treturn css`border-radius: ${theme.borderRadius.sm} !important;`;\n\t\tcase \"md\":\n\t\t\treturn css`border-radius: ${theme.borderRadius.md} !important;`;\n\t\tcase \"lg\":\n\t\t\treturn css`border-radius: ${theme.borderRadius.lg} !important;`;\n\t\tcase \"full\":\n\t\t\treturn css`border-radius: ${theme.borderRadius.full} !important;`;\n\t\tdefault:\n\t\t\treturn css`border-radius: ${theme.borderRadius.md} !important;`;\n\t}\n};\n\nconst InputWrapper = styled.div<StyledInputProps & { isFocused: boolean }>`\n position: relative;\n display: flex;\n align-items: center;\n transition: all ${(props) => props.theme.transitions.normal};\n width: ${(props) => (props.fullWidth ? \"100%\" : \"auto\")};\n\n /* Apply base styles first */\n ${getInputVariantStyles}\n ${getInputSizeStyles}\n\n /* Apply radius styles last to ensure they take precedence */\n ${getInputRadiusStyles}\n\n /* Custom CSS prop - applied last */\n ${(props) => props.css}\n`;\n\nconst StyledInput = styled.input<StyledProps>`\n flex: 1;\n background: transparent;\n border: none;\n outline: none;\n color: ${(props) => props.theme.colors.text.primary};\n font-family: inherit;\n font-size: inherit;\n padding: 0;\n\n &::placeholder {\n color: ${(props) => props.theme.colors.text.tertiary};\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n`;\n\nconst InputContainer = styled.div<StyledInputProps & { fullWidth?: boolean }>`\n display: flex;\n flex-direction: column;\n gap: ${(props) => props.theme.spacing[2]};\n width: ${(props) => (props.fullWidth ? \"100%\" : \"auto\")};\n`;\n\nconst Label = styled.label<\n\tStyledInputProps & {\n\t\tisRequired?: boolean;\n\t\tsize?: \"sm\" | \"md\" | \"lg\";\n\t\tplacement?: \"inside\" | \"outside\" | \"outside-left\";\n\t}\n>`\n color: ${(props) => props.theme.colors.text.primary};\n font-size: ${(props) => {\n\t\tswitch (props.size) {\n\t\t\tcase \"sm\":\n\t\t\t\treturn props.theme.fontSizes.sm;\n\t\t\tcase \"lg\":\n\t\t\t\treturn props.theme.fontSizes.lg;\n\t\t\tdefault:\n\t\t\t\treturn props.theme.fontSizes.base;\n\t\t}\n\t}};\n font-weight: ${(props) => props.theme.fontWeights.medium};\n\n ${(props) =>\n\t\tprops.isRequired &&\n\t\tcss`\n &::after {\n content: ' *';\n color: ${props.theme.colors.danger[500]};\n }\n `}\n`;\n\nexport const HelperText = styled.div<StyledInputProps & { isError?: boolean }>`\n font-size: ${(props) => props.theme.fontSizes.sm};\n color: ${(props) =>\n\t\tprops.isError\n\t\t\t? props.theme.colors.danger[500]\n\t\t\t: props.theme.colors.text.secondary};\n`;\n\nconst ContentWrapper = styled.div<\n\tStyledInputProps & { position: \"start\" | \"end\" }\n>`\n display: flex;\n align-items: center;\n color: ${(props) => props.theme.colors.text.tertiary};\n ${(props) =>\n\t\tprops.position === \"start\"\n\t\t\t? css`margin-right: ${props.theme.spacing[2]};`\n\t\t\t: css`margin-left: ${props.theme.spacing[2]};`}\n`;\n\nexport const Input = React.forwardRef<HTMLInputElement, InputProps>(\n\t(\n\t\t{\n\t\t\tvariant = \"flat\",\n\t\t\tcolor = \"primary\",\n\t\t\tsize = \"md\",\n\t\t\tradius = \"md\",\n\t\t\tlabel,\n\t\t\tplaceholder,\n\t\t\tdescription,\n\t\t\terrorMessage,\n\t\t\tisInvalid = false,\n\t\t\tisDisabled = false,\n\t\t\tisRequired = false,\n\t\t\tfullWidth = false,\n\t\t\tstartContent,\n\t\t\tendContent,\n\t\t\tclassName,\n\t\t\tcss,\n\t\t\tlabelPlacement = \"outside\",\n\t\t\tonFocus,\n\t\t\tonBlur,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst { theme } = useTheme();\n\t\tconst [isFocused, setIsFocused] = useState(false);\n\t\tconst inputRef = useRef<HTMLInputElement>(null);\n\n\t\tuseImperativeHandle(ref, () => inputRef.current!);\n\n\t\tconst handleFocus = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\t\tsetIsFocused(true);\n\t\t\tonFocus?.(e);\n\t\t};\n\n\t\tconst handleBlur = (e: React.FocusEvent<HTMLInputElement>) => {\n\t\t\tsetIsFocused(false);\n\t\t\tonBlur?.(e);\n\t\t};\n\n\t\t// Fixed: Ensure all props including radius are passed correctly\n\t\tconst inputProps = {\n\t\t\tvariant,\n\t\t\tcolor,\n\t\t\tsize,\n\t\t\tradius, // Make sure radius is explicitly passed\n\t\t\tisInvalid: isInvalid || !!errorMessage,\n\t\t\tisDisabled,\n\t\t\tfullWidth,\n\t\t\tisFocused,\n\t\t\tclassName,\n\t\t\tcss,\n\t\t};\n\n\t\tconst inputElement = (\n\t\t\t<InputWrapper theme={theme} {...inputProps}>\n\t\t\t\t{startContent && (\n\t\t\t\t\t<ContentWrapper theme={theme} position=\"start\">\n\t\t\t\t\t\t{startContent}\n\t\t\t\t\t</ContentWrapper>\n\t\t\t\t)}\n\t\t\t\t<StyledInput\n\t\t\t\t\ttheme={theme}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tplaceholder={placeholder}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t\t{endContent && (\n\t\t\t\t\t<ContentWrapper theme={theme} position=\"end\">\n\t\t\t\t\t\t{endContent}\n\t\t\t\t\t</ContentWrapper>\n\t\t\t\t)}\n\t\t\t</InputWrapper>\n\t\t);\n\n\t\tif (!label && !description && !errorMessage) {\n\t\t\treturn inputElement;\n\t\t}\n\n\t\treturn (\n\t\t\t<InputContainer theme={theme} fullWidth={fullWidth}>\n\t\t\t\t{label && labelPlacement === \"outside\" && (\n\t\t\t\t\t<Label theme={theme} isRequired={isRequired} size={size}>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</Label>\n\t\t\t\t)}\n\t\t\t\t{inputElement}\n\t\t\t\t{(description || errorMessage) && (\n\t\t\t\t\t<HelperText theme={theme} isError={!!errorMessage}>\n\t\t\t\t\t\t{errorMessage || description}\n\t\t\t\t\t</HelperText>\n\t\t\t\t)}\n\t\t\t</InputContainer>\n\t\t);\n\t},\n);\n\nInput.displayName = \"Input\";\n"],"names":["getInputVariantStyles","props","theme","variant","color","isInvalid","isFocused","isDisabled","baseColor","getColorVariant","errorColor","focusColor","css","getInputSizeStyles","size","getInputRadiusStyles","radius","InputWrapper","styled","StyledInput","InputContainer","Label","HelperText","ContentWrapper","Input","React","label","placeholder","description","errorMessage","isRequired","fullWidth","startContent","endContent","className","labelPlacement","onFocus","onBlur","ref","useTheme","setIsFocused","useState","inputRef","useRef","useImperativeHandle","handleFocus","e","handleBlur","inputProps","inputElement","jsxs","jsx"],"mappings":"iUA8CMA,EACLC,GACI,CACE,KAAA,CACL,MAAAC,EACA,QAAAC,EAAU,OACV,MAAAC,EAAQ,UACR,UAAAC,EACA,UAAAC,EACA,WAAAC,CAAA,EACGN,EACEO,EAAYC,EAAA,gBAAgBP,EAAOE,EAAO,GAAG,EAC7CM,EAAaR,EAAM,OAAO,OAAO,GAAG,EAEpCS,EAAaN,EAAYK,EAAaF,EAE5C,OAAQL,EAAS,CAChB,IAAK,OACG,OAAAS,EAAA;AAAA,4BACkBV,EAAM,OAAO,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA,8BAI/BA,EAAM,OAAO,WAAW,QAAQ;AAAA;AAAA;AAAA,UAIzDI,GACAM,EAAA;AAAA,gCAC2BV,EAAM,OAAO,WAAW,OAAO;AAAA,4BACnCS,CAAU;AAAA,WAElC;AAAA;AAAA,UAGCN,GACAO,EAAA;AAAA,4BACuBF,CAAU;AAAA,WAElC;AAAA;AAAA,UAGCH,GACAK,EAAA;AAAA;AAAA;AAAA,WAID;AAAA,QAGF,IAAK,WACG,OAAAA,EAAA;AAAA,4BACkBV,EAAM,OAAO,WAAW,OAAO;AA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