@flipdish/portal-library 5.0.1 → 5.0.4

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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/Button"),r=require("@mui/material/styles"),n=require("./getButtonStyles.cjs.js");const i=r.styled(t,{shouldForwardProp:e=>!["casingOverride","customVariant","tone"].includes(e)})((({theme:e,customVariant:t="primary",tone:r="brand",casingOverride:i="none",fullWidth:a=!1})=>{const o=n(e,t,r);return{...o.default,width:a?"100%":"fit-content",maxWidth:a?"100%":"fit-content",textTransform:i,transition:"all 0.2s ease-in-out",padding:"12px 24px","&:hover":{...o.hover},"&:focus":{outline:"none"},"&:focus-visible":{...o.focus},"&:active":{...o.press},"&:disabled":{...o.disabled,cursor:"not-allowed"}}})),a={primary:"contained",secondary:"outlined",tertiary:"text"},o=({children:t,className:r,disabled:n=!1,fdKey:o,form:s,fullWidth:d=!1,href:l,casingOverride:c="none",type:u="button",variant:f="primary",tone:m,target:p,startIcon:y,endIcon:h,onClick:v,onKeyDown:x,...b})=>e.jsx(i,{disableRipple:!0,casingOverride:c,className:r,customVariant:f,"data-fd":o,disabled:n,endIcon:h,form:s,fullWidth:d,href:l,startIcon:y,target:p,tone:m,type:u,variant:a[f],...b,onClick:v,onKeyDown:x,children:t});exports.Button=o,exports.default=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("@mui/material/Button"),r=require("@mui/material/styles"),a=require("./getButtonStyles.cjs.js");const i=r.styled(t,{shouldForwardProp:e=>!["casingOverride","customVariant","tone"].includes(e)})((({theme:e,customVariant:t="primary",tone:r="brand",casingOverride:i="none",fullWidth:n=!1})=>{const o=a(e,t,r);return{...o.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:i,transition:"all 0.2s ease-in-out",padding:"12px 24px","&:hover":{...o.hover},"&:focus":{outline:"none"},"&:focus-visible":{...o.focus},"&:active":{...o.press},"&:disabled":{...o.disabled,cursor:"not-allowed"}}})),n={primary:"contained",secondary:"outlined",tertiary:"text"},o=({children:t,className:r,disabled:a=!1,fdKey:o,form:s,fullWidth:d=!1,href:l,casingOverride:u="none",type:c="button",variant:f="primary",tone:m,target:p,startIcon:h,endIcon:v,onKeyDown:y,...x})=>e.jsx(i,{disableRipple:!0,casingOverride:u,className:r,customVariant:f,"data-fd":o,disabled:a,endIcon:v,form:s,fullWidth:d,href:l,startIcon:h,target:p,tone:m,type:c,variant:n[f],...x,children:t});exports.Button=o,exports.default=o;
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n onClick?: () => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n padding: '12px 24px',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onClick,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n {...rest}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onClick","onKeyDown","rest","_jsx","disableRipple"],"mappings":"sOA2BA,MAAMA,EAAeC,EAAAA,OAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAEnD,MAAO,IACJG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,UACAC,eACGC,KAGDC,MAAC3C,GACC4C,eAAa,EACbnC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBM,EACJF,QAASA,EACTC,UAAWA,EAASX,SAEnBA"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n padding: '12px 24px',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n {...rest}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onKeyDown","rest","_jsx","disableRipple"],"mappings":"sOAyBA,MAAMA,EAAeC,EAAAA,OAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,eACGC,KAGDC,MAAC1C,GACC2C,eAAa,EACblC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBK,EAAIX,SAEPA"}
@@ -17,10 +17,8 @@ interface ButtonProps extends Omit<ButtonProps$1, 'variant'> {
17
17
  target?: '_blank';
18
18
  startIcon?: react__default.ReactNode;
19
19
  endIcon?: react__default.ReactNode;
20
- onClick?: () => void;
21
- onKeyDown?: (e: react__default.KeyboardEvent) => void;
22
20
  }
23
- declare const Button: ({ children, className, disabled, fdKey, form, fullWidth, href, casingOverride, type, variant, tone, target, startIcon, endIcon, onClick, onKeyDown, ...rest }: ButtonProps) => JSX.Element;
21
+ declare const Button: ({ children, className, disabled, fdKey, form, fullWidth, href, casingOverride, type, variant, tone, target, startIcon, endIcon, onKeyDown, ...rest }: ButtonProps) => JSX.Element;
24
22
 
25
23
  export { Button, Button as default };
26
24
  export type { ButtonProps };
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import"react";import e from"@mui/material/Button";import{styled as r}from"@mui/material/styles";import n from"./getButtonStyles.js";const o=r(e,{shouldForwardProp:t=>!["casingOverride","customVariant","tone"].includes(t)})((({theme:t,customVariant:e="primary",tone:r="brand",casingOverride:o="none",fullWidth:i=!1})=>{const a=n(t,e,r);return{...a.default,width:i?"100%":"fit-content",maxWidth:i?"100%":"fit-content",textTransform:o,transition:"all 0.2s ease-in-out",padding:"12px 24px","&:hover":{...a.hover},"&:focus":{outline:"none"},"&:focus-visible":{...a.focus},"&:active":{...a.press},"&:disabled":{...a.disabled,cursor:"not-allowed"}}})),i={primary:"contained",secondary:"outlined",tertiary:"text"},a=({children:e,className:r,disabled:n=!1,fdKey:a,form:s,fullWidth:d=!1,href:l,casingOverride:c="none",type:m="button",variant:u="primary",tone:f,target:p,startIcon:h,endIcon:y,onClick:v,onKeyDown:b,...g})=>t(o,{disableRipple:!0,casingOverride:c,className:r,customVariant:u,"data-fd":a,disabled:n,endIcon:y,form:s,fullWidth:d,href:l,startIcon:h,target:p,tone:f,type:m,variant:i[u],...g,onClick:v,onKeyDown:b,children:e});export{a as Button,a as default};
1
+ import{jsx as t}from"react/jsx-runtime";import"react";import e from"@mui/material/Button";import{styled as r}from"@mui/material/styles";import a from"./getButtonStyles.js";const i=r(e,{shouldForwardProp:t=>!["casingOverride","customVariant","tone"].includes(t)})((({theme:t,customVariant:e="primary",tone:r="brand",casingOverride:i="none",fullWidth:n=!1})=>{const o=a(t,e,r);return{...o.default,width:n?"100%":"fit-content",maxWidth:n?"100%":"fit-content",textTransform:i,transition:"all 0.2s ease-in-out",padding:"12px 24px","&:hover":{...o.hover},"&:focus":{outline:"none"},"&:focus-visible":{...o.focus},"&:active":{...o.press},"&:disabled":{...o.disabled,cursor:"not-allowed"}}})),n={primary:"contained",secondary:"outlined",tertiary:"text"},o=({children:e,className:r,disabled:a=!1,fdKey:o,form:s,fullWidth:d=!1,href:l,casingOverride:c="none",type:m="button",variant:u="primary",tone:f,target:p,startIcon:h,endIcon:y,onKeyDown:v,...b})=>t(i,{disableRipple:!0,casingOverride:c,className:r,customVariant:u,"data-fd":o,disabled:a,endIcon:y,form:s,fullWidth:d,href:l,startIcon:h,target:p,tone:f,type:m,variant:n[u],...b,children:e});export{o as Button,o as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n onClick?: () => void;\n onKeyDown?: (e: React.KeyboardEvent) => void;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n padding: '12px 24px',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onClick,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n {...rest}\n onClick={onClick}\n onKeyDown={onKeyDown}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onClick","onKeyDown","rest","_jsx","disableRipple"],"mappings":"4KA2BA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAEnD,MAAO,IACJG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,UACAC,eACGC,KAGDC,EAAC3C,GACC4C,eAAa,EACbnC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBM,EACJF,QAASA,EACTC,UAAWA,EAASX,SAEnBA"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/Button/index.tsx"],"sourcesContent":["import React from 'react';\n\nimport MuiButton, { type ButtonProps as MuiButtonProps } from '@mui/material/Button';\nimport { styled } from '@mui/material/styles';\n\nimport getButtonStyles, { type ButtonTone, type ButtonType } from './getButtonStyles';\n\ntype CasingOverride = 'capitalize' | 'lowercase' | 'none' | 'uppercase';\n\nexport interface ButtonProps extends Omit<MuiButtonProps, 'variant'> {\n className?: string;\n children: React.ReactNode;\n disabled?: boolean;\n form?: string;\n fullWidth?: boolean;\n casingOverride?: CasingOverride;\n type?: 'button' | 'reset' | 'submit';\n fdKey: string;\n variant?: ButtonType;\n tone?: ButtonTone;\n target?: '_blank';\n startIcon?: React.ReactNode;\n endIcon?: React.ReactNode;\n}\n\nconst StyledButton = styled(MuiButton, {\n shouldForwardProp: (prop) => !['casingOverride', 'customVariant', 'tone'].includes(prop as string),\n})<{ casingOverride?: CasingOverride; customVariant?: ButtonType; tone?: ButtonTone }>(({\n theme,\n customVariant = 'primary',\n tone = 'brand',\n casingOverride = 'none',\n fullWidth = false,\n}) => {\n const styles = getButtonStyles(theme, customVariant, tone);\n\n return {\n ...styles.default,\n width: fullWidth ? '100%' : 'fit-content',\n maxWidth: fullWidth ? '100%' : 'fit-content',\n textTransform: casingOverride,\n transition: 'all 0.2s ease-in-out',\n padding: '12px 24px',\n\n '&:hover': { ...styles.hover },\n '&:focus': {\n outline: 'none', // Removes the focus ring on click\n },\n // focus visible so that the focus ring only shows for keyboard users\n '&:focus-visible': { ...styles.focus },\n '&:active': { ...styles.press },\n '&:disabled': { ...styles.disabled, cursor: 'not-allowed' },\n };\n});\n\nconst MUI_VARIANT_MAP = {\n primary: 'contained',\n secondary: 'outlined',\n tertiary: 'text',\n};\n\nexport const Button = ({\n children,\n className,\n disabled = false,\n fdKey,\n form,\n fullWidth = false,\n href,\n casingOverride = 'none',\n type = 'button',\n variant = 'primary',\n tone,\n target,\n startIcon,\n endIcon,\n onKeyDown,\n ...rest\n}: ButtonProps): JSX.Element => {\n return (\n <StyledButton\n disableRipple\n casingOverride={casingOverride}\n className={className}\n customVariant={variant}\n data-fd={fdKey}\n disabled={disabled}\n endIcon={endIcon}\n form={form}\n fullWidth={fullWidth}\n href={href}\n startIcon={startIcon}\n // @ts-expect-error - target is not a valid prop for MuiButton\n target={target}\n tone={tone}\n type={type}\n variant={MUI_VARIANT_MAP[variant] as MuiButtonProps['variant']}\n {...rest}\n >\n {children}\n </StyledButton>\n );\n};\n\nexport default Button;\n"],"names":["StyledButton","styled","MuiButton","shouldForwardProp","prop","includes","theme","customVariant","tone","casingOverride","fullWidth","styles","getButtonStyles","default","width","maxWidth","textTransform","transition","padding","hover","outline","focus","press","disabled","cursor","MUI_VARIANT_MAP","primary","secondary","tertiary","Button","children","className","fdKey","form","href","type","variant","target","startIcon","endIcon","onKeyDown","rest","_jsx","disableRipple"],"mappings":"4KAyBA,MAAMA,EAAeC,EAAOC,EAAW,CACrCC,kBAAoBC,IAAU,CAAC,iBAAkB,gBAAiB,QAAQC,SAASD,IADhEH,EAEkE,EACrFK,QACAC,gBAAgB,UAChBC,OAAO,QACPC,iBAAiB,OACjBC,aAAY,MAEZ,MAAMC,EAASC,EAAgBN,EAAOC,EAAeC,GAErD,MAAO,IACFG,EAAOE,QACVC,MAAOJ,EAAY,OAAS,cAC5BK,SAAUL,EAAY,OAAS,cAC/BM,cAAeP,EACfQ,WAAY,uBACZC,QAAS,YAET,UAAW,IAAKP,EAAOQ,OACvB,UAAW,CACTC,QAAS,QAGX,kBAAmB,IAAKT,EAAOU,OAC/B,WAAY,IAAKV,EAAOW,OACxB,aAAc,IAAKX,EAAOY,SAAUC,OAAQ,mBAI1CC,EAAkB,CACtBC,QAAS,YACTC,UAAW,WACXC,SAAU,QAGCC,EAAS,EACpBC,WACAC,YACAR,YAAW,EACXS,QACAC,OACAvB,aAAY,EACZwB,OACAzB,iBAAiB,OACjB0B,OAAO,SACPC,UAAU,UACV5B,OACA6B,SACAC,YACAC,UACAC,eACGC,KAGDC,EAAC1C,GACC2C,eAAa,EACblC,eAAgBA,EAChBsB,UAAWA,EACXxB,cAAe6B,EAAO,UACbJ,EACTT,SAAUA,EACVgB,QAASA,EACTN,KAAMA,EACNvB,UAAWA,EACXwB,KAAMA,EACNI,UAAWA,EAEXD,OAAQA,EACR7B,KAAMA,EACN2B,KAAMA,EACNC,QAASX,EAAgBW,MACrBK,EAAIX,SAEPA"}
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("@mui/material/Popover");module.exports=e;
2
+ //# sourceMappingURL=index.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import Popover from '@mui/material/Popover';
2
+ export { default } from '@mui/material/Popover';
@@ -0,0 +1,2 @@
1
+ import o from"@mui/material/Popover";export{default}from"@mui/material/Popover";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material/Box"),l=require("@mui/material/FormHelperText"),t=require("@mui/material/InputAdornment"),d=require("@mui/material/InputLabel"),s=require("@mui/material/styles"),a=require("@mui/material/TextField"),n=require("../../../icons/CancelCircle/index.cjs.js"),u=require("../../../icons/View/index.cjs.js"),o=require("../../../icons/ViewOff/index.cjs.js"),x=require("../IconButton/index.cjs.js");const c=s.styled(i,{shouldForwardProp:e=>"fullWidth"!==e})((({theme:e,fullWidth:r=!1})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),width:r?"100%":"min(364px, 100%)"}))),m=s.styled(a,{shouldForwardProp:e=>"fullWidth"!==e})((({fullWidth:e=!1})=>({display:"flex",width:e?"100%":"auto"})));module.exports=({disabled:i=!1,errorText:s,fdKey:a,fullWidth:h=!1,helperText:p,hidePasswordAriaLabel:j,label:f,multiline:q=!1,required:b=!1,showPasswordAriaLabel:w,type:y="text",...W})=>{const[v,F]=r.useState(!1),I=p?`${a}-helper-text`:void 0,P=s?`${a}-error-message`:void 0,A=[I,P].filter(Boolean).join(" ")||void 0,B=!!s&&!i,T="password"===y,g=()=>F((e=>!e));return e.jsxs(c,{fullWidth:h,children:[f&&e.jsx(d,{disabled:i,htmlFor:a,required:b,children:f}),p&&e.jsx(l,{disabled:i,id:I,children:p}),B&&e.jsxs(l,{error:!0,id:P,children:[e.jsx(n,{}),s]}),e.jsx(m,{"data-fd":a,disabled:i,error:B,fullWidth:h,id:a,label:"",multiline:q,required:b,slotProps:{input:{endAdornment:(()=>{if(T){if(!w||!j)return;return e.jsx(t,{position:"end",children:e.jsx(x.IconButton,{"aria-label":v?j:w,disabled:i,onClick:g,size:"small",tone:"neutral",variant:"tertiary",children:v?e.jsx(o,{}):e.jsx(u,{})})})}})()},htmlInput:{"aria-describedby":A}},type:T?v?"text":"password":y,variant:"outlined",...W})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("@mui/material/Box"),t=require("@mui/material/FormHelperText"),l=require("@mui/material/InputAdornment"),d=require("@mui/material/InputLabel"),s=require("@mui/material/styles"),n=require("@mui/material/TextField"),a=require("../../../icons/CancelCircle/index.cjs.js"),o=require("../../../icons/View/index.cjs.js"),u=require("../../../icons/ViewOff/index.cjs.js"),x=require("../IconButton/index.cjs.js");const c=s.styled(i,{shouldForwardProp:e=>"fullWidth"!==e})((({theme:e,fullWidth:r=!1})=>({display:"flex",flexDirection:"column",gap:e.spacing(.5),width:r?"100%":"min(364px, 100%)"}))),m=s.styled(n,{shouldForwardProp:e=>"fullWidth"!==e})((({fullWidth:e=!1})=>({display:"flex",width:e?"100%":"auto"})));module.exports=({disabled:i=!1,errorText:s,fdKey:n,fullWidth:h=!1,helperText:p,hidePasswordAriaLabel:j,label:f,multiline:q=!1,required:b=!1,showPasswordAriaLabel:w,type:y="text",startAdornment:A="",endAdornment:W="",...v})=>{const[F,I]=r.useState(!1),P=p?`${n}-helper-text`:void 0,B=s?`${n}-error-message`:void 0,T=[P,B].filter(Boolean).join(" ")||void 0,g=!!s&&!i,C="password"===y,L=()=>I((e=>!e));return e.jsxs(c,{fullWidth:h,children:[f&&e.jsx(d,{disabled:i,htmlFor:n,required:b,children:f}),p&&e.jsx(t,{disabled:i,id:P,children:p}),g&&e.jsxs(t,{error:!0,id:B,children:[e.jsx(a,{}),s]}),e.jsx(m,{"data-fd":n,disabled:i,error:g,fullWidth:h,id:n,label:"",multiline:q,required:b,slotProps:{input:{endAdornment:(()=>{if(C){if(!w||!j)return;return e.jsx(l,{position:"end",children:e.jsx(x.IconButton,{"aria-label":F?j:w,disabled:i,onClick:L,size:"small",tone:"neutral",variant:"tertiary",children:F?e.jsx(u,{}):e.jsx(o,{})})})}if(W)return e.jsx(l,{position:"end",children:W})})(),startAdornment:(()=>{if(A)return e.jsx(l,{position:"start",children:A})})()},htmlInput:{"aria-describedby":T}},type:C?F?"text":"password":y,variant:"outlined",...v})]})};
2
2
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain width to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n\n return undefined;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","endAdornment","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","htmlInput"],"mappings":"geAqCA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAAA,OAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,0BAGZ,EAChBQ,YAAW,EACXC,YACAC,QACAV,aAAY,EACZW,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,UACJC,MAEH,MAAOC,EAAcC,GAAmBC,EAAAA,UAAkB,GAEpDC,EAAeX,EAAa,GAAGD,qBAAsBa,EACrDC,EAAiBf,EAAY,GAAGC,uBAAwBa,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYpB,IAAcD,EAC1BsB,EAAsB,aAATb,EAEbc,EAA0B,IAAYX,GAAiBY,IAAUA,IAmCvE,OACEC,EAAAA,KAACvC,EAAe,CAACM,UAAWA,YACzBa,GACCqB,EAAAA,IAACC,GAAc3B,SAAUA,EAAU4B,QAAS1B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCuB,EAAAA,IAACG,EAAiB,CAAC7B,SAAUA,EAAU8B,GAAIhB,WACxCX,IAIJkB,GACCI,EAAAA,KAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAAAA,IAACO,EAAgB,CAAA,GAEhBhC,KAILyB,EAAAA,IAAC5B,aACUI,EACTF,SAAUA,EACV+B,MAAOV,EACP7B,UAAWA,EACXsC,GAAI5B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV2B,UAAW,CACTC,MAAO,CACLC,aA1DiB,MACzB,GAAId,EAAY,CACd,IAAKd,IAA0BJ,EAC7B,OAGF,OACEsB,EAAAA,IAACW,EAAiB,CAACC,SAAS,MAAKN,SAC/BN,MAACa,EAAAA,WAAU,CAAA,aACG5B,EAAeP,EAAwBI,EACnDR,SAAUA,EACVwC,QAASjB,EACTkB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUX,SAEjBrB,EAAee,EAAAA,IAACkB,EAAW,CAAA,GAAMlB,EAAAA,IAACmB,EAAQ,CAAA,MAInD,GAsCsBC,IAEhBC,UAAW,CACT,mBAAoB9B,IAGxBR,KAvEAa,EACKX,EAAe,OAAS,WAG1BF,EAoEHkC,QAAQ,cACJjC"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n startAdornment?: string;\n endAdornment?: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n startAdornment?: string;\n endAdornment?: string;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain width to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n startAdornment = '',\n endAdornment = '',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n if (endAdornment) {\n return (\n <MuiInputAdornment position=\"end\">\n {endAdornment}\n </MuiInputAdornment>\n )\n }\n\n return undefined;\n };\n\n const renderStartAdornment = (): React.ReactNode => {\n if(startAdornment) {\n return (\n <MuiInputAdornment position=\"start\" >\n {startAdornment}\n </MuiInputAdornment>\n )\n }\n return undefined;\n }\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n startAdornment: renderStartAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","startAdornment","endAdornment","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","renderStartAdornment","htmlInput"],"mappings":"geAyCA,MAAMA,EAAkBC,EAAAA,OAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAAA,OAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,0BAGZ,EAChBQ,YAAW,EACXC,YACAC,QACAV,aAAY,EACZW,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,OACPC,iBAAiB,GACjBC,eAAe,MACZC,MAEH,MAAOC,EAAcC,GAAmBC,EAAAA,UAAkB,GAEpDC,EAAeb,EAAa,GAAGD,qBAAsBe,EACrDC,EAAiBjB,EAAY,GAAGC,uBAAwBe,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYtB,IAAcD,EAC1BwB,EAAsB,aAATf,EAEbgB,EAA0B,IAAYX,GAAiBY,IAAUA,IAqDvE,OACEC,EAAAA,KAACzC,EAAe,CAACM,UAAWA,YACzBa,GACCuB,EAAAA,IAACC,GAAc7B,SAAUA,EAAU8B,QAAS5B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCyB,EAAAA,IAACG,EAAiB,CAAC/B,SAAUA,EAAUgC,GAAIhB,WACxCb,IAIJoB,GACCI,EAAAA,KAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAAAA,IAACO,EAAgB,CAAA,GAEhBlC,KAIL2B,EAAAA,IAAC9B,aACUI,EACTF,SAAUA,EACViC,MAAOV,EACP/B,UAAWA,EACXwC,GAAI9B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV6B,UAAW,CACTC,MAAO,CACL1B,aA5EiB,MACzB,GAAIa,EAAY,CACd,IAAKhB,IAA0BJ,EAC7B,OAGF,OACEwB,EAAAA,IAACU,EAAiB,CAACC,SAAS,MAAKL,SAC/BN,MAACY,EAAAA,WAAU,CAAA,aACG3B,EAAeT,EAAwBI,EACnDR,SAAUA,EACVyC,QAAShB,EACTiB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUV,SAEjBrB,EAAee,EAAAA,IAACiB,EAAW,CAAA,GAAMjB,EAAAA,IAACkB,EAAQ,CAAA,MAInD,CACA,GAAInC,EACF,OACEiB,EAAAA,IAACU,EAAiB,CAACC,SAAS,MAAKL,SAC9BvB,KAoDeoC,GACdrC,eA7CmB,MAC3B,GAAGA,EACD,OACEkB,EAAAA,IAACU,EAAiB,CAACC,SAAS,QAAOL,SAChCxB,KAyCiBsC,IAElBC,UAAW,CACT,mBAAoB9B,IAGxBV,KA1FAe,EACKX,EAAe,OAAS,WAG1BJ,EAuFHmC,QAAQ,cACJhC"}
@@ -8,14 +8,18 @@ type PasswordTextFieldProps = BaseTextFieldProps & {
8
8
  type: 'password';
9
9
  showPasswordAriaLabel: string;
10
10
  hidePasswordAriaLabel: string;
11
+ startAdornment?: string;
12
+ endAdornment?: string;
11
13
  };
12
14
  type GenericTextFieldProps = BaseTextFieldProps & {
13
15
  type?: Exclude<TextFieldProps$1['type'], 'password'>;
14
16
  showPasswordAriaLabel?: never;
15
17
  hidePasswordAriaLabel?: never;
18
+ startAdornment?: string;
19
+ endAdornment?: string;
16
20
  };
17
21
  type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;
18
- declare const TextField: ({ disabled, errorText, fdKey, fullWidth, helperText, hidePasswordAriaLabel, label, multiline, required, showPasswordAriaLabel, type, ...props }: TextFieldProps) => JSX.Element;
22
+ declare const TextField: ({ disabled, errorText, fdKey, fullWidth, helperText, hidePasswordAriaLabel, label, multiline, required, showPasswordAriaLabel, type, startAdornment, endAdornment, ...props }: TextFieldProps) => JSX.Element;
19
23
 
20
24
  export { TextField as default };
21
25
  export type { TextFieldProps };
@@ -1,2 +1,2 @@
1
- import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as e}from"react";import t from"@mui/material/Box";import l from"@mui/material/FormHelperText";import o from"@mui/material/InputAdornment";import d from"@mui/material/InputLabel";import{styled as a}from"@mui/material/styles";import m from"@mui/material/TextField";import n from"../../../icons/CancelCircle/index.js";import s from"../../../icons/View/index.js";import u from"../../../icons/ViewOff/index.js";import{IconButton as p}from"../IconButton/index.js";const f=a(t,{shouldForwardProp:r=>"fullWidth"!==r})((({theme:r,fullWidth:i=!1})=>({display:"flex",flexDirection:"column",gap:r.spacing(.5),width:i?"100%":"min(364px, 100%)"}))),h=a(m,{shouldForwardProp:r=>"fullWidth"!==r})((({fullWidth:r=!1})=>({display:"flex",width:r?"100%":"auto"}))),c=({disabled:t=!1,errorText:a,fdKey:m,fullWidth:c=!1,helperText:x,hidePasswordAriaLabel:b,label:w,multiline:y=!1,required:W=!1,showPasswordAriaLabel:j,type:v="text",...F})=>{const[P,A]=e(!1),I=x?`${m}-helper-text`:void 0,T=a?`${m}-error-message`:void 0,g=[I,T].filter(Boolean).join(" ")||void 0,q=!!a&&!t,B="password"===v,C=()=>A((r=>!r));return r(f,{fullWidth:c,children:[w&&i(d,{disabled:t,htmlFor:m,required:W,children:w}),x&&i(l,{disabled:t,id:I,children:x}),q&&r(l,{error:!0,id:T,children:[i(n,{}),a]}),i(h,{"data-fd":m,disabled:t,error:q,fullWidth:c,id:m,label:"",multiline:y,required:W,slotProps:{input:{endAdornment:(()=>{if(B){if(!j||!b)return;return i(o,{position:"end",children:i(p,{"aria-label":P?b:j,disabled:t,onClick:C,size:"small",tone:"neutral",variant:"tertiary",children:i(P?u:s,{})})})}})()},htmlInput:{"aria-describedby":g}},type:B?P?"text":"password":v,variant:"outlined",...F})]})};export{c as default};
1
+ import{jsxs as r,jsx as i}from"react/jsx-runtime";import{useState as e}from"react";import t from"@mui/material/Box";import o from"@mui/material/FormHelperText";import l from"@mui/material/InputAdornment";import d from"@mui/material/InputLabel";import{styled as n}from"@mui/material/styles";import a from"@mui/material/TextField";import m from"../../../icons/CancelCircle/index.js";import s from"../../../icons/View/index.js";import u from"../../../icons/ViewOff/index.js";import{IconButton as p}from"../IconButton/index.js";const f=n(t,{shouldForwardProp:r=>"fullWidth"!==r})((({theme:r,fullWidth:i=!1})=>({display:"flex",flexDirection:"column",gap:r.spacing(.5),width:i?"100%":"min(364px, 100%)"}))),h=n(a,{shouldForwardProp:r=>"fullWidth"!==r})((({fullWidth:r=!1})=>({display:"flex",width:r?"100%":"auto"}))),c=({disabled:t=!1,errorText:n,fdKey:a,fullWidth:c=!1,helperText:x,hidePasswordAriaLabel:b,label:w,multiline:y=!1,required:A=!1,showPasswordAriaLabel:W,type:j="text",startAdornment:v="",endAdornment:F="",...P})=>{const[I,T]=e(!1),g=x?`${a}-helper-text`:void 0,q=n?`${a}-error-message`:void 0,B=[g,q].filter(Boolean).join(" ")||void 0,C=!!n&&!t,L="password"===j,V=()=>T((r=>!r));return r(f,{fullWidth:c,children:[w&&i(d,{disabled:t,htmlFor:a,required:A,children:w}),x&&i(o,{disabled:t,id:g,children:x}),C&&r(o,{error:!0,id:q,children:[i(m,{}),n]}),i(h,{"data-fd":a,disabled:t,error:C,fullWidth:c,id:a,label:"",multiline:y,required:A,slotProps:{input:{endAdornment:(()=>{if(L){if(!W||!b)return;return i(l,{position:"end",children:i(p,{"aria-label":I?b:W,disabled:t,onClick:V,size:"small",tone:"neutral",variant:"tertiary",children:i(I?u:s,{})})})}if(F)return i(l,{position:"end",children:F})})(),startAdornment:(()=>{if(v)return i(l,{position:"start",children:v})})()},htmlInput:{"aria-describedby":B}},type:L?I?"text":"password":j,variant:"outlined",...P})]})};export{c as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain width to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n\n return undefined;\n };\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","TextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","endAdornment","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","htmlInput"],"mappings":"4gBAqCA,MAAMA,EAAkBC,EAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,WAGxBQ,EAAY,EAChBC,YAAW,EACXC,YACAC,QACAX,aAAY,EACZY,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,UACJC,MAEH,MAAOC,EAAcC,GAAmBC,GAAkB,GAEpDC,EAAeX,EAAa,GAAGD,qBAAsBa,EACrDC,EAAiBf,EAAY,GAAGC,uBAAwBa,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYpB,IAAcD,EAC1BsB,EAAsB,aAATb,EAEbc,EAA0B,IAAYX,GAAiBY,IAAUA,IAmCvE,OACEC,EAACxC,EAAe,CAACM,UAAWA,YACzBc,GACCqB,EAACC,GAAc3B,SAAUA,EAAU4B,QAAS1B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCuB,EAACG,EAAiB,CAAC7B,SAAUA,EAAU8B,GAAIhB,WACxCX,IAIJkB,GACCI,EAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAACO,EAAgB,CAAA,GAEhBhC,KAILyB,EAAC7B,aACUK,EACTF,SAAUA,EACV+B,MAAOV,EACP9B,UAAWA,EACXuC,GAAI5B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV2B,UAAW,CACTC,MAAO,CACLC,aA1DiB,MACzB,GAAId,EAAY,CACd,IAAKd,IAA0BJ,EAC7B,OAGF,OACEsB,EAACW,EAAiB,CAACC,SAAS,MAAKN,SAC/BN,EAACa,EAAU,CAAA,aACG5B,EAAeP,EAAwBI,EACnDR,SAAUA,EACVwC,QAASjB,EACTkB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUX,SAEFN,EAAff,EAAgBiC,EAAkBC,EAAP,CAAA,MAIpC,GAsCsBC,IAEhBC,UAAW,CACT,mBAAoB9B,IAGxBR,KAvEAa,EACKX,EAAe,OAAS,WAG1BF,EAoEHkC,QAAQ,cACJjC"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/atoms/TextField/index.tsx"],"sourcesContent":["import { useState } from 'react';\n\nimport Box from '@mui/material/Box';\nimport MuiFormHelperText from '@mui/material/FormHelperText';\nimport MuiInputAdornment from '@mui/material/InputAdornment';\nimport MuiInputLabel from '@mui/material/InputLabel';\nimport { styled } from '@mui/material/styles';\nimport MuiTextField, { type TextFieldProps as MuiTextFieldProps } from '@mui/material/TextField';\n\nimport CancelCircleIcon from '@fd/icons/CancelCircle';\nimport ViewIcon from '@fd/icons/View';\nimport ViewOffIcon from '@fd/icons/ViewOff';\n\nimport IconButton from '../IconButton';\n\n// Common props for all TextField variants\ntype BaseTextFieldProps = Omit<MuiTextFieldProps, 'error' | 'id' | 'type' | 'variant'> & {\n errorText?: string;\n fdKey: string;\n};\n\n// Password TextField variant - requires aria labels\ntype PasswordTextFieldProps = BaseTextFieldProps & {\n type: 'password';\n showPasswordAriaLabel: string;\n hidePasswordAriaLabel: string;\n startAdornment?: string;\n endAdornment?: string;\n};\n\n// Generic TextField variant - for all other input types\ntype GenericTextFieldProps = BaseTextFieldProps & {\n type?: Exclude<MuiTextFieldProps['type'], 'password'>;\n showPasswordAriaLabel?: never;\n hidePasswordAriaLabel?: never;\n startAdornment?: string;\n endAdornment?: string;\n};\n\nexport type TextFieldProps = GenericTextFieldProps | PasswordTextFieldProps;\n\nconst StyledContainer = styled(Box, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ theme, fullWidth = false }) => ({\n display: 'flex',\n flexDirection: 'column',\n gap: theme.spacing(0.5),\n width: fullWidth ? '100%' : 'min(364px, 100%)', // Constrain width to a maximum of 100% of the container width\n}));\n\nconst StyledTextField = styled(MuiTextField, {\n shouldForwardProp: (prop) => prop !== 'fullWidth',\n})<{ fullWidth?: boolean }>(({ fullWidth = false }) => ({\n display: 'flex',\n width: fullWidth ? '100%' : 'auto',\n}));\n\nconst TextField = ({\n disabled = false,\n errorText,\n fdKey,\n fullWidth = false,\n helperText,\n hidePasswordAriaLabel,\n label,\n multiline = false,\n required = false,\n showPasswordAriaLabel,\n type = 'text',\n startAdornment = '',\n endAdornment = '',\n ...props\n}: TextFieldProps): JSX.Element => {\n const [showPassword, setShowPassword] = useState<boolean>(false);\n\n const helperTextId = helperText ? `${fdKey}-helper-text` : undefined;\n const errorMessageId = errorText ? `${fdKey}-error-message` : undefined;\n\n // Combine helper text and error message IDs for aria-describedby\n const ariaDescribedBy = [helperTextId, errorMessageId].filter(Boolean).join(' ') || undefined;\n\n const isError = !!errorText && !disabled;\n const isPassword = type === 'password';\n\n const handleClickShowPassword = (): void => setShowPassword((show) => !show);\n\n const getFieldType = (): MuiTextFieldProps['type'] => {\n if (isPassword) {\n return showPassword ? 'text' : 'password';\n }\n\n return type;\n };\n\n const renderEndAdornment = (): React.ReactNode => {\n if (isPassword) {\n if (!showPasswordAriaLabel || !hidePasswordAriaLabel) {\n return undefined;\n }\n\n return (\n <MuiInputAdornment position=\"end\">\n <IconButton\n aria-label={showPassword ? hidePasswordAriaLabel : showPasswordAriaLabel}\n disabled={disabled}\n onClick={handleClickShowPassword}\n size=\"small\"\n tone=\"neutral\"\n variant=\"tertiary\"\n >\n {showPassword ? <ViewOffIcon /> : <ViewIcon />}\n </IconButton>\n </MuiInputAdornment>\n );\n }\n if (endAdornment) {\n return (\n <MuiInputAdornment position=\"end\">\n {endAdornment}\n </MuiInputAdornment>\n )\n }\n\n return undefined;\n };\n\n const renderStartAdornment = (): React.ReactNode => {\n if(startAdornment) {\n return (\n <MuiInputAdornment position=\"start\" >\n {startAdornment}\n </MuiInputAdornment>\n )\n }\n return undefined;\n }\n\n return (\n <StyledContainer fullWidth={fullWidth}>\n {label && (\n <MuiInputLabel disabled={disabled} htmlFor={fdKey} required={required}>\n {label}\n </MuiInputLabel>\n )}\n\n {helperText && (\n <MuiFormHelperText disabled={disabled} id={helperTextId}>\n {helperText}\n </MuiFormHelperText>\n )}\n\n {isError && (\n <MuiFormHelperText error id={errorMessageId}>\n <CancelCircleIcon />\n\n {errorText}\n </MuiFormHelperText>\n )}\n\n <StyledTextField\n data-fd={fdKey}\n disabled={disabled}\n error={isError}\n fullWidth={fullWidth}\n id={fdKey}\n label=\"\" // Remove label from TextField since we're rendering it separately\n multiline={multiline}\n required={required}\n slotProps={{\n input: {\n endAdornment: renderEndAdornment(),\n startAdornment: renderStartAdornment(),\n },\n htmlInput: {\n 'aria-describedby': ariaDescribedBy,\n },\n }}\n type={getFieldType()}\n variant=\"outlined\"\n {...props}\n />\n </StyledContainer>\n );\n};\n\nexport default TextField;\n"],"names":["StyledContainer","styled","Box","shouldForwardProp","prop","theme","fullWidth","display","flexDirection","gap","spacing","width","StyledTextField","MuiTextField","TextField","disabled","errorText","fdKey","helperText","hidePasswordAriaLabel","label","multiline","required","showPasswordAriaLabel","type","startAdornment","endAdornment","props","showPassword","setShowPassword","useState","helperTextId","undefined","errorMessageId","ariaDescribedBy","filter","Boolean","join","isError","isPassword","handleClickShowPassword","show","_jsxs","_jsx","MuiInputLabel","htmlFor","MuiFormHelperText","id","error","children","CancelCircleIcon","slotProps","input","MuiInputAdornment","position","IconButton","onClick","size","tone","variant","ViewOffIcon","ViewIcon","renderEndAdornment","renderStartAdornment","htmlInput"],"mappings":"4gBAyCA,MAAMA,EAAkBC,EAAOC,EAAK,CAClCC,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGI,QAAOC,aAAY,MAAO,CACvDC,QAAS,OACTC,cAAe,SACfC,IAAKJ,EAAMK,QAAQ,IACnBC,MAAOL,EAAY,OAAS,uBAGxBM,EAAkBX,EAAOY,EAAc,CAC3CV,kBAAoBC,GAAkB,cAATA,GADPH,EAEI,EAAGK,aAAY,MAAO,CAChDC,QAAS,OACTI,MAAOL,EAAY,OAAS,WAGxBQ,EAAY,EAChBC,YAAW,EACXC,YACAC,QACAX,aAAY,EACZY,aACAC,wBACAC,QACAC,aAAY,EACZC,YAAW,EACXC,wBACAC,OAAO,OACPC,iBAAiB,GACjBC,eAAe,MACZC,MAEH,MAAOC,EAAcC,GAAmBC,GAAkB,GAEpDC,EAAeb,EAAa,GAAGD,qBAAsBe,EACrDC,EAAiBjB,EAAY,GAAGC,uBAAwBe,EAGxDE,EAAkB,CAACH,EAAcE,GAAgBE,OAAOC,SAASC,KAAK,WAAQL,EAE9EM,IAAYtB,IAAcD,EAC1BwB,EAAsB,aAATf,EAEbgB,EAA0B,IAAYX,GAAiBY,IAAUA,IAqDvE,OACEC,EAAC1C,EAAe,CAACM,UAAWA,YACzBc,GACCuB,EAACC,GAAc7B,SAAUA,EAAU8B,QAAS5B,EAAOK,SAAUA,WAC1DF,IAIJF,GACCyB,EAACG,EAAiB,CAAC/B,SAAUA,EAAUgC,GAAIhB,WACxCb,IAIJoB,GACCI,EAACI,EAAiB,CAACE,SAAMD,GAAId,EAAcgB,SAAA,CACzCN,EAACO,EAAgB,CAAA,GAEhBlC,KAIL2B,EAAC/B,aACUK,EACTF,SAAUA,EACViC,MAAOV,EACPhC,UAAWA,EACXyC,GAAI9B,EACJG,MAAM,GACNC,UAAWA,EACXC,SAAUA,EACV6B,UAAW,CACTC,MAAO,CACL1B,aA5EiB,MACzB,GAAIa,EAAY,CACd,IAAKhB,IAA0BJ,EAC7B,OAGF,OACEwB,EAACU,EAAiB,CAACC,SAAS,MAAKL,SAC/BN,EAACY,EAAU,CAAA,aACG3B,EAAeT,EAAwBI,EACnDR,SAAUA,EACVyC,QAAShB,EACTiB,KAAK,QACLC,KAAK,UACLC,QAAQ,WAAUV,SAEFN,EAAff,EAAgBgC,EAAkBC,EAAP,CAAA,MAIpC,CACA,GAAInC,EACF,OACEiB,EAACU,EAAiB,CAACC,SAAS,MAAKL,SAC9BvB,KAoDeoC,GACdrC,eA7CmB,MAC3B,GAAGA,EACD,OACEkB,EAACU,EAAiB,CAACC,SAAS,QAAOL,SAChCxB,KAyCiBsC,IAElBC,UAAW,CACT,mBAAoB9B,IAGxBV,KA1FAe,EACKX,EAAe,OAAS,WAG1BJ,EAuFHmC,QAAQ,cACJhC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flipdish/portal-library",
3
- "version": "5.0.1",
3
+ "version": "5.0.4",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -80,10 +80,10 @@
80
80
  "@storybook/test": "^8.6.7",
81
81
  "@svgr/rollup": "^8.1.0",
82
82
  "@tanstack/react-query": "^5.62.0",
83
- "@testing-library/jest-dom": "6.7.0",
83
+ "@testing-library/jest-dom": "6.8.0",
84
84
  "@testing-library/react": "15.0.7",
85
85
  "@types/lodash.debounce": "^4.0.9",
86
- "@types/react": "18.3.23",
86
+ "@types/react": "18.3.24",
87
87
  "@types/react-dom": "18.3.7",
88
88
  "@types/react-imgix": "^9.5.4",
89
89
  "@typescript-eslint/eslint-plugin": "7.18.0",