{"version":3,"sources":["webpack:///./src/Avensia.Common/Features/Shared/Fields/Text.tsx","webpack:///./src/Avensia.Common/Features/Shared/Icon/Alert.tsx","webpack:///./src/Avensia.Common/Features/Shared/Icon/glyphs/ion-alert.svg"],"names":["Appearance","Alert","Object","icon","ion_alert_default","a","Label","props","_a","variant","Style","Default","react_default","createElement","mjs","Span","css","tslib_es6","position","top","left","fontWeight","pointerEvents","transformOrigin","color","type","horizontalPadding","property","timingFunction","lifted","padding","xy","transform","required","invalid","BareInput","_super","class_1","_this","apply","this","arguments","inputStyle","width","marginBottom","height","bottom","border","style",":invalid","boxShadow","prototype","render","compose","elementRef","restProps","Input","innerRef","Component","isFilled","value","Array","isArray","length","test","Text","call","onFocus","e","setState","focused","onBlur","setValidity","currentTarget","onChange","el","filled","state","ref","labelStyle","validity","valid","getStatusColor","readOnly","size","appearance","placeholder","children","styleProp","className","realPlaceholder","Invalid","__webpack_exports__","GUTTER","div","display","flexWrap","justifyContent","Small","margin","React","__webpack_require__","IonAlert","d","displayName","defaultProps","viewBox","module","exports","default"],"mappings":"8FAsBYA,gECnBGC,EAAAC,OAAAC,EAAA,GAAQC,EAAAC,IDmBvB,SAAYL,GACVA,IAAA,eADF,CAAYA,WASZ,IAAMM,EAAuD,SAAAC,GACnD,IAAAC,EAAAD,EAAAE,eAAA,IAAAD,EAAAE,EAAA,EAAAC,QAAAH,EACR,OACEI,EAAAP,EAAAQ,cAACC,EAAA,EAAOC,MACNC,IAAGC,EAAA,GACDC,SAAU,WACVC,IAAK,EACLC,KAAM,EACNC,WAAY,IACZC,cAAe,OACfC,gBAAiB,WACjBC,MAAO,WACJtB,OAAAQ,EAAA,EAAAR,EAAUuB,KAAMhB,EAASiB,kBAAmB,IAC5CxB,OAAAQ,EAAA,GAAAR,EAAayB,UAAW,QAAS,UAAW,aAAcC,eAAgB,gBAC1E1B,OAAAQ,EAAA,GAAAR,GACCK,EAAMsB,SACRL,MAAOd,EAAA,EACPoB,SAAWC,GAAI,GACfC,U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AQW,KAAKjC,MAAM4E,UAAY3C,KAAKqC,MAAMP,SAAW9B,KAAKqC,MAAMD,OAChE1C,QAASM,KAAKqC,MAAM3C,QACpBD,SAAUO,KAAKjC,MAAM0B,UAEpByD,EACAlD,KAAKqC,MAAM3C,SAAWtB,EAAAP,EAAAQ,cAAC8E,EAAO,OAGnC/E,EAAAP,EAAAQ,cAACsB,EAASlB,EAAA,KAAKsC,GAAW+B,YAAa9C,KAAKjC,MAAM+E,iBAK1D9B,EAjGiB,CACG5C,EAAAP,EAAMqD,YAqGtBiC,GAFNC,EAAA,IAEgB1F,OAAAY,EAAA,EAAAZ,CAAOD,OAYjB4F,GAVgB/E,EAAA,EAAOgF,KAC3BC,QAAS,OACTC,SAAU,OACVC,eAAgB,kBAGM/F,OAAAY,EAAA,EAAAZ,CAAO+D,GAC7BtB,MAAO,SAGMjC,EAAA,EAAOwF,OAEEhG,OAAAY,EAAA,EAAAZ,CAAO+D,EAAMhD,EAAA,KAChCf,OAAAQ,EAAA,GAAAR,CAAiB,SAAAiG,GAAU,OAC5BxD,MAAO,cAAczC,OAAAQ,EAAA,EAAAR,CAAaiG,EAAON,IAAQ,kCEzPrD,IAAAO,EAAYC,EAAQ,GAEpB,SAAAC,EAAA/F,GACA,OAAA6F,EAAAvF,cAAA,MAAAN,EAAA6F,EAAAvF,cAAA,QAAuE0F,EAAA,wIAGvED,EAAAE,YAAA,WAEAF,EAAAG,cAAyBC,QAAA,eAEzBC,EAAAC,QAAAN,EAEAA,EAAAO,QAAAP","file":"assets/account~contact.chunk.f51701ba43e40f1ec96b.js","sourcesContent":["import React from 'react';\r\nimport { Style } from '@glitz/type';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { AppearanceType } from '../appearance';\r\nimport * as style from 'Shared/Style';\r\nimport Alert from 'Shared/Icon/Alert';\r\nimport {\r\n responsiveMargin,\r\n pixelsToUnit,\r\n Margin,\r\n General,\r\n general,\r\n transition,\r\n truncate,\r\n negativeLight,\r\n monochromeDark,\r\n monochromeLight,\r\n negative,\r\n baseTextColor,\r\n} from '../Style';\r\n\r\nexport { General as Variant } from '../Style';\r\nexport enum Appearance {\r\n Bare,\r\n}\r\ntype PlaceholderPropType = {\r\n variant?: General;\r\n lifted?: boolean;\r\n invalid?: boolean;\r\n required?: boolean;\r\n};\r\nconst Label: React.StatelessComponent = props => {\r\n const { variant = General.Default } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\ntype BareInputPropType = StyledProps &\r\n React.InputHTMLAttributes & {\r\n elementRef?: React.Ref;\r\n };\r\nexport const BareInput = styled(\r\n class extends React.Component {\r\n inputStyle: Style = {\r\n width: '100%',\r\n marginBottom: 0,\r\n height: 39,\r\n padding: {\r\n top: 10,\r\n bottom: 10,\r\n left: 12,\r\n },\r\n border: {\r\n xy: {\r\n style: 'solid',\r\n color: style.tertiaryLightest,\r\n width: 1,\r\n },\r\n },\r\n ':invalid': {\r\n boxShadow: 'none',\r\n },\r\n };\r\n render() {\r\n const { compose, elementRef, ...restProps } = this.props;\r\n return ;\r\n }\r\n },\r\n);\r\n\r\ntype InputTextType =\r\n | 'date'\r\n | 'datetime'\r\n | 'datetime-local'\r\n | 'email'\r\n | 'month'\r\n | 'number'\r\n | 'password'\r\n | 'range'\r\n | 'search'\r\n | 'tel'\r\n | 'text'\r\n | 'time'\r\n | 'url'\r\n | 'week';\r\n\r\ntype PropType = StyledProps &\r\n React.InputHTMLAttributes & {\r\n type?: InputTextType;\r\n variant?: General;\r\n appearance?: AppearanceType;\r\n elementRef?: (el: HTMLInputElement) => void;\r\n };\r\n\r\ntype Value = string | number | string[];\r\n\r\ntype StateType = {\r\n focused?: boolean;\r\n filled?: boolean;\r\n invalid?: boolean;\r\n};\r\n\r\nfunction isFilled(value: Value) {\r\n return !!value && (Array.isArray(value) ? value.length > 0 : /[\\S]/.test(`${value}`));\r\n}\r\n\r\nconst Text = styled(\r\n class Input extends React.Component {\r\n el: HTMLInputElement;\r\n constructor(props: PropType) {\r\n super(props);\r\n this.state = {\r\n focused: false,\r\n filled: isFilled(props.value),\r\n invalid: false,\r\n };\r\n }\r\n setValidity(el: HTMLInputElement) {\r\n const invalid = !el.validity.valid;\r\n if (invalid !== this.state.invalid) {\r\n this.setState({ invalid });\r\n }\r\n }\r\n onFocus = (e: React.FocusEvent) => {\r\n if (this.props.onFocus) {\r\n this.props.onFocus(e);\r\n }\r\n\r\n this.setState({ focused: true });\r\n };\r\n onBlur = (e: React.FocusEvent) => {\r\n if (this.props.onBlur) {\r\n this.props.onBlur(e);\r\n }\r\n\r\n this.setValidity(e.currentTarget);\r\n this.setState({ focused: false });\r\n };\r\n onChange = (e: React.ChangeEvent) => {\r\n if (this.props.onChange) {\r\n this.props.onChange(e);\r\n }\r\n\r\n const el = e.currentTarget;\r\n this.setValidity(el);\r\n\r\n const filled = isFilled(el.value);\r\n if (filled !== this.state.filled) {\r\n this.setState({ filled });\r\n }\r\n };\r\n getStatusColor() {\r\n if (this.state.invalid) {\r\n return negative;\r\n }\r\n if (this.props.readOnly) {\r\n return 'transparent';\r\n }\r\n if (this.state.focused || this.state.filled) {\r\n return monochromeDark;\r\n }\r\n return monochromeLight;\r\n }\r\n ref = (el: HTMLInputElement) => {\r\n if (this.props.elementRef) {\r\n this.props.elementRef(el);\r\n }\r\n\r\n this.el = el;\r\n };\r\n render() {\r\n const {\r\n compose,\r\n size,\r\n appearance,\r\n variant,\r\n placeholder,\r\n children,\r\n className,\r\n style: styleProp,\r\n ...restProps\r\n } = this.props;\r\n\r\n const realPlaceholder = placeholder || children;\r\n\r\n return (\r\n \r\n {realPlaceholder && (\r\n \r\n {realPlaceholder}\r\n {this.state.invalid && }\r\n \r\n )}\r\n \r\n \r\n );\r\n }\r\n labelStyle = (): Style => ({});\r\n },\r\n);\r\n\r\nexport default Text;\r\n\r\nconst Invalid = styled(Alert, {});\r\n\r\nexport const Fields = styled.div({\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n justifyContent: 'space-between',\r\n});\r\n\r\nexport const FullText = styled(Text, {\r\n width: '100%',\r\n});\r\n\r\nconst GUTTER = Margin.Small;\r\n\r\nexport const HalfText = styled(Text, {\r\n ...responsiveMargin(margin => ({\r\n width: `calc(50% - ${pixelsToUnit(margin(GUTTER))} / 2)`,\r\n })),\r\n});\r\n","import factory from './icon';\r\nimport Svg from './glyphs/ion-alert.svg';\r\n\r\nexport default factory(Svg);\r\n","var React = require('react');\n\nfunction IonAlert (props) {\n return React.createElement(\"svg\",props,React.createElement(\"path\",{\"d\":\"M256 48C141.6 48 48 141.601 48 256s93.6 208 208 208 208-93.601 208-208S370.4 48 256 48zm24 312h-48v-40h48v40zm0-88h-48V144h48v128z\"}));\n}\n\nIonAlert.displayName = \"IonAlert\";\n\nIonAlert.defaultProps = {\"viewBox\":\"0 0 512 512\"};\n\nmodule.exports = IonAlert;\n\nIonAlert.default = IonAlert;\n"],"sourceRoot":""}