@proprioo/salatim 18.6.2 → 19.1.0
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.
- package/CHANGELOG.md +9 -0
- package/lib/date/src/DayPicker.js +3 -14
- package/lib/date/src/DayPicker.js.map +1 -1
- package/lib/date/src/datePicker/DatePicker.js +18 -51
- package/lib/date/src/datePicker/DatePicker.js.map +1 -1
- package/lib/date/src/datePicker/DatePicker.styles.js +25 -8
- package/lib/date/src/datePicker/DatePicker.styles.js.map +1 -1
- package/lib/date/src/datePicker/DatePicker.test.js +22 -71
- package/lib/date/src/datePicker/DatePicker.test.js.map +1 -1
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.js +22 -36
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.js.map +1 -1
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.stories.js +25 -36
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.stories.js.map +1 -1
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.test.js +55 -132
- package/lib/date/src/datePickerWrapper/DatePickerWrapper.test.js.map +1 -1
- package/lib/date/src/datePickerWrapper/DatepickerWrapper.styles.js +5 -10
- package/lib/date/src/datePickerWrapper/DatepickerWrapper.styles.js.map +1 -1
- package/lib/date/src/singleMonth/SingleMonth.js +9 -12
- package/lib/date/src/singleMonth/SingleMonth.js.map +1 -1
- package/lib/date/src/singleMonth/SingleMonth.stories.js +21 -32
- package/lib/date/src/singleMonth/SingleMonth.stories.js.map +1 -1
- package/lib/date/src/singleMonth/SingleMonth.styles.js +54 -9
- package/lib/date/src/singleMonth/SingleMonth.styles.js.map +1 -1
- package/lib/date/src/singleMonth/SingleMonth.test.js +18 -67
- package/lib/date/src/singleMonth/SingleMonth.test.js.map +1 -1
- package/lib/energy/src/Energy.js +17 -18
- package/lib/energy/src/Energy.js.map +1 -1
- package/lib/energy/src/Energy.stories.js +9 -20
- package/lib/energy/src/Energy.stories.js.map +1 -1
- package/lib/energy/src/Energy.styles.js +161 -45
- package/lib/energy/src/Energy.styles.js.map +1 -1
- package/lib/energy/src/Energy.test.js +13 -24
- package/lib/energy/src/Energy.test.js.map +1 -1
- package/lib/energy/src/Energy.utils.js +24 -29
- package/lib/energy/src/Energy.utils.js.map +1 -1
- package/lib/energy/src/Energy.utils.test.js +51 -51
- package/lib/energy/src/Energy.utils.test.js.map +1 -1
- package/lib/forms/src/userForm/UserForm.js +17 -37
- package/lib/forms/src/userForm/UserForm.js.map +1 -1
- package/lib/forms/src/userForm/UserForm.schema.d.ts +9 -9
- package/lib/forms/src/userForm/UserForm.schema.js +6 -6
- package/lib/forms/src/userForm/UserForm.schema.js.map +1 -1
- package/lib/forms/src/userForm/UserForm.stories.js +15 -15
- package/lib/forms/src/userForm/UserForm.stories.js.map +1 -1
- package/lib/forms/src/userForm/UserForm.styles.js +9 -10
- package/lib/forms/src/userForm/UserForm.styles.js.map +1 -1
- package/lib/forms/src/userForm/UserForm.test.js +56 -130
- package/lib/forms/src/userForm/UserForm.test.js.map +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +3 -1
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useDebounce/useDebounce.js +6 -6
- package/lib/hooks/useDebounce/useDebounce.js.map +1 -1
- package/lib/hooks/useDebounce/useDebounce.test.js +12 -12
- package/lib/hooks/useDebounce/useDebounce.test.js.map +1 -1
- package/lib/hooks/useEmailSuggestion/useEmailSuggestion.js +11 -12
- package/lib/hooks/useEmailSuggestion/useEmailSuggestion.js.map +1 -1
- package/lib/hooks/useEmailSuggestion/useEmailSuggestion.test.js +16 -55
- package/lib/hooks/useEmailSuggestion/useEmailSuggestion.test.js.map +1 -1
- package/lib/hooks/useOnClickOutside/useOnClickOutside.d.ts +2 -0
- package/lib/hooks/useOnClickOutside/useOnClickOutside.js +30 -0
- package/lib/hooks/useOnClickOutside/useOnClickOutside.js.map +1 -0
- package/lib/index.js +2633 -4
- package/lib/index.js.map +1 -1
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.js +11 -12
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.js.map +1 -1
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.stories.js +9 -9
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.stories.js.map +1 -1
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.styles.js +17 -13
- package/lib/phone/src/phoneAndFlag/PhoneAndFlag.styles.js.map +1 -1
- package/lib/phone/src/phoneAndFlag/PhoneAndFlags.test.js +14 -14
- package/lib/phone/src/phoneAndFlag/PhoneAndFlags.test.js.map +1 -1
- package/lib/phone/src/phoneInput/Phone.js +8 -9
- package/lib/phone/src/phoneInput/Phone.js.map +1 -1
- package/lib/phone/src/phoneInput/Phone.stories.js +26 -37
- package/lib/phone/src/phoneInput/Phone.stories.js.map +1 -1
- package/lib/phone/src/phoneInput/Phone.styles.js +60 -13
- package/lib/phone/src/phoneInput/Phone.styles.js.map +1 -1
- package/lib/phone/src/phoneInput/Phone.test.js +57 -131
- package/lib/phone/src/phoneInput/Phone.test.js.map +1 -1
- package/lib/phone/src/phoneInput/PhoneInput.js +5 -8
- package/lib/phone/src/phoneInput/PhoneInput.js.map +1 -1
- package/lib/phone/src/phoneInput/constant.d.ts +3 -2
- package/lib/phone/src/phoneInput/constant.js.map +1 -1
- package/lib/phone/src/utils.d.ts +2 -1
- package/lib/phone/src/utils.js +6 -6
- package/lib/phone/src/utils.js.map +1 -1
- package/lib/phone/src/utils.test.js +6 -6
- package/lib/phone/src/utils.test.js.map +1 -1
- package/lib/setupTests.js +22 -46
- package/lib/setupTests.js.map +1 -1
- package/lib/ui/src/accordion/Accordion.js +3 -6
- package/lib/ui/src/accordion/Accordion.js.map +1 -1
- package/lib/ui/src/accordion/Accordion.stories.js +38 -51
- package/lib/ui/src/accordion/Accordion.stories.js.map +1 -1
- package/lib/ui/src/accordion/Accordion.styles.js +81 -33
- package/lib/ui/src/accordion/Accordion.styles.js.map +1 -1
- package/lib/ui/src/accordion/Accordion.test.js +73 -129
- package/lib/ui/src/accordion/Accordion.test.js.map +1 -1
- package/lib/ui/src/accordion/AccordionContextConsumer.js +3 -6
- package/lib/ui/src/accordion/AccordionContextConsumer.js.map +1 -1
- package/lib/ui/src/accordion/AccordionContextProvider.js +19 -37
- package/lib/ui/src/accordion/AccordionContextProvider.js.map +1 -1
- package/lib/ui/src/accordion/AccordionHeader.js +8 -14
- package/lib/ui/src/accordion/AccordionHeader.js.map +1 -1
- package/lib/ui/src/accordion/AccordionItem.js +7 -13
- package/lib/ui/src/accordion/AccordionItem.js.map +1 -1
- package/lib/ui/src/accordion/AccordionPanel.js +4 -10
- package/lib/ui/src/accordion/AccordionPanel.js.map +1 -1
- package/lib/ui/src/accordion/AccordionStore.js +14 -36
- package/lib/ui/src/accordion/AccordionStore.js.map +1 -1
- package/lib/ui/src/accordion/ItemContextConsumer.js +3 -6
- package/lib/ui/src/accordion/ItemContextConsumer.js.map +1 -1
- package/lib/ui/src/accordion/ItemContextProvider.js +10 -22
- package/lib/ui/src/accordion/ItemContextProvider.js.map +1 -1
- package/lib/ui/src/agentBanner/AgentBanner.js +13 -16
- package/lib/ui/src/agentBanner/AgentBanner.js.map +1 -1
- package/lib/ui/src/agentBanner/AgentBanner.stories.js +8 -8
- package/lib/ui/src/agentBanner/AgentBanner.stories.js.map +1 -1
- package/lib/ui/src/agentBanner/AgentBanner.styles.js +61 -18
- package/lib/ui/src/agentBanner/AgentBanner.styles.js.map +1 -1
- package/lib/ui/src/agentBanner/AgentBanner.test.js +13 -24
- package/lib/ui/src/agentBanner/AgentBanner.test.js.map +1 -1
- package/lib/ui/src/agentCard/AgentCard.js +19 -22
- package/lib/ui/src/agentCard/AgentCard.js.map +1 -1
- package/lib/ui/src/agentCard/AgentCard.stories.js +9 -9
- package/lib/ui/src/agentCard/AgentCard.stories.js.map +1 -1
- package/lib/ui/src/agentCard/AgentCard.styles.js +83 -16
- package/lib/ui/src/agentCard/AgentCard.styles.js.map +1 -1
- package/lib/ui/src/agentCard/AgentCard.test.js +21 -32
- package/lib/ui/src/agentCard/AgentCard.test.js.map +1 -1
- package/lib/ui/src/autocomplete/Autocomplete.js +16 -33
- package/lib/ui/src/autocomplete/Autocomplete.js.map +1 -1
- package/lib/ui/src/autocomplete/Autocomplete.stories.js +30 -41
- package/lib/ui/src/autocomplete/Autocomplete.stories.js.map +1 -1
- package/lib/ui/src/autocomplete/Autocomplete.test.js +67 -167
- package/lib/ui/src/autocomplete/Autocomplete.test.js.map +1 -1
- package/lib/ui/src/background/Background.styles.js +40 -17
- package/lib/ui/src/background/Background.styles.js.map +1 -1
- package/lib/ui/src/block/Block.js +5 -8
- package/lib/ui/src/block/Block.js.map +1 -1
- package/lib/ui/src/block/Block.stories.js +10 -10
- package/lib/ui/src/block/Block.stories.js.map +1 -1
- package/lib/ui/src/block/Block.styles.js +59 -24
- package/lib/ui/src/block/Block.styles.js.map +1 -1
- package/lib/ui/src/block/Block.test.js +11 -11
- package/lib/ui/src/block/Block.test.js.map +1 -1
- package/lib/ui/src/blockIcon/BlockIcon.js +5 -6
- package/lib/ui/src/blockIcon/BlockIcon.js.map +1 -1
- package/lib/ui/src/blockIcon/BlockIcon.stories.js +15 -15
- package/lib/ui/src/blockIcon/BlockIcon.stories.js.map +1 -1
- package/lib/ui/src/blockIcon/BlockIcon.styles.js +53 -14
- package/lib/ui/src/blockIcon/BlockIcon.styles.js.map +1 -1
- package/lib/ui/src/blockIcon/BlockIcon.test.js +21 -67
- package/lib/ui/src/blockIcon/BlockIcon.test.js.map +1 -1
- package/lib/ui/src/burger/Burger.js +6 -9
- package/lib/ui/src/burger/Burger.js.map +1 -1
- package/lib/ui/src/burger/Burger.stories.js +14 -27
- package/lib/ui/src/burger/Burger.stories.js.map +1 -1
- package/lib/ui/src/burger/Burger.styles.js +88 -23
- package/lib/ui/src/burger/Burger.styles.js.map +1 -1
- package/lib/ui/src/burger/Burger.test.js +18 -64
- package/lib/ui/src/burger/Burger.test.js.map +1 -1
- package/lib/ui/src/button/Button.js +6 -17
- package/lib/ui/src/button/Button.js.map +1 -1
- package/lib/ui/src/button/Button.stories.js +34 -45
- package/lib/ui/src/button/Button.stories.js.map +1 -1
- package/lib/ui/src/button/Button.styles.d.ts +4 -2
- package/lib/ui/src/button/Button.styles.js +416 -107
- package/lib/ui/src/button/Button.styles.js.map +1 -1
- package/lib/ui/src/button/Button.test.js +38 -84
- package/lib/ui/src/button/Button.test.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadio.js +7 -8
- package/lib/ui/src/buttonRadioGroup/ButtonRadio.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadio.styles.js +78 -21
- package/lib/ui/src/buttonRadioGroup/ButtonRadio.styles.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.js +4 -7
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.stories.js +8 -11
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.stories.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.styles.js +16 -9
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.styles.js.map +1 -1
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.test.js +18 -68
- package/lib/ui/src/buttonRadioGroup/ButtonRadioGroup.test.js.map +1 -1
- package/lib/ui/src/card/Card.js +18 -19
- package/lib/ui/src/card/Card.js.map +1 -1
- package/lib/ui/src/card/Card.stories.js +21 -32
- package/lib/ui/src/card/Card.stories.js.map +1 -1
- package/lib/ui/src/card/Card.styles.js +81 -33
- package/lib/ui/src/card/Card.styles.js.map +1 -1
- package/lib/ui/src/card/Card.test.js +63 -141
- package/lib/ui/src/card/Card.test.js.map +1 -1
- package/lib/ui/src/card/icons/Dropdown.d.ts +0 -1
- package/lib/ui/src/card/icons/Dropdown.js +3 -3
- package/lib/ui/src/card/icons/Dropdown.js.map +1 -1
- package/lib/ui/src/card/icons/Dropup.d.ts +0 -1
- package/lib/ui/src/card/icons/Dropup.js +3 -3
- package/lib/ui/src/card/icons/Dropup.js.map +1 -1
- package/lib/ui/src/checkbox/Checkbox.d.ts +1 -0
- package/lib/ui/src/checkbox/Checkbox.js +9 -9
- package/lib/ui/src/checkbox/Checkbox.js.map +1 -1
- package/lib/ui/src/checkbox/Checkbox.stories.js +66 -48
- package/lib/ui/src/checkbox/Checkbox.stories.js.map +1 -1
- package/lib/ui/src/checkbox/Checkbox.styles.d.ts +5 -2
- package/lib/ui/src/checkbox/Checkbox.styles.js +149 -18
- package/lib/ui/src/checkbox/Checkbox.styles.js.map +1 -1
- package/lib/ui/src/checkbox/Checkbox.test.js +27 -62
- package/lib/ui/src/checkbox/Checkbox.test.js.map +1 -1
- package/lib/ui/src/dateInput/DateInput.js +20 -33
- package/lib/ui/src/dateInput/DateInput.js.map +1 -1
- package/lib/ui/src/dateInput/DateInput.stories.js +15 -26
- package/lib/ui/src/dateInput/DateInput.stories.js.map +1 -1
- package/lib/ui/src/dateInput/DateInput.test.js +51 -139
- package/lib/ui/src/dateInput/DateInput.test.js.map +1 -1
- package/lib/ui/src/emailInput/EmailInput.d.ts +0 -1
- package/lib/ui/src/emailInput/EmailInput.js +20 -31
- package/lib/ui/src/emailInput/EmailInput.js.map +1 -1
- package/lib/ui/src/emailInput/EmailInput.stories.js +15 -26
- package/lib/ui/src/emailInput/EmailInput.stories.js.map +1 -1
- package/lib/ui/src/emailInput/EmailInput.styles.js +32 -9
- package/lib/ui/src/emailInput/EmailInput.styles.js.map +1 -1
- package/lib/ui/src/emailInput/EmailInput.test.js +71 -149
- package/lib/ui/src/emailInput/EmailInput.test.js.map +1 -1
- package/lib/ui/src/fieldset/Fieldset.js +8 -11
- package/lib/ui/src/fieldset/Fieldset.js.map +1 -1
- package/lib/ui/src/fieldset/Fieldset.stories.js +7 -7
- package/lib/ui/src/fieldset/Fieldset.stories.js.map +1 -1
- package/lib/ui/src/fieldset/Fieldset.styles.js +34 -18
- package/lib/ui/src/fieldset/Fieldset.styles.js.map +1 -1
- package/lib/ui/src/fieldset/Fieldset.test.js +6 -6
- package/lib/ui/src/fieldset/Fieldset.test.js.map +1 -1
- package/lib/ui/src/gmapsAutoComplete/GmapsAutocomplete.js +34 -64
- package/lib/ui/src/gmapsAutoComplete/GmapsAutocomplete.js.map +1 -1
- package/lib/ui/src/gmapsAutoComplete/GmapsAutocomplete.stories.js +26 -26
- package/lib/ui/src/gmapsAutoComplete/GmapsAutocomplete.stories.js.map +1 -1
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.d.ts +1 -0
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.js +18 -46
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.js.map +1 -1
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.stories.js +16 -18
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.stories.js.map +1 -1
- package/lib/ui/src/gmapsSuggestions/GmapsSuggestions.js +11 -25
- package/lib/ui/src/gmapsSuggestions/GmapsSuggestions.js.map +1 -1
- package/lib/ui/src/gmapsSuggestions/GmapsSuggestions.test.js +15 -26
- package/lib/ui/src/gmapsSuggestions/GmapsSuggestions.test.js.map +1 -1
- package/lib/ui/src/icons/Alert.d.ts +0 -1
- package/lib/ui/src/icons/Alert.js +3 -3
- package/lib/ui/src/icons/Alert.js.map +1 -1
- package/lib/ui/src/icons/Arrow.d.ts +0 -1
- package/lib/ui/src/icons/Arrow.js +3 -3
- package/lib/ui/src/icons/Arrow.js.map +1 -1
- package/lib/ui/src/icons/Certificate.js +3 -6
- package/lib/ui/src/icons/Certificate.js.map +1 -1
- package/lib/ui/src/icons/CheckGreen.d.ts +0 -1
- package/lib/ui/src/icons/CheckGreen.js +3 -3
- package/lib/ui/src/icons/CheckGreen.js.map +1 -1
- package/lib/ui/src/icons/ChevronRight.js +3 -6
- package/lib/ui/src/icons/ChevronRight.js.map +1 -1
- package/lib/ui/src/icons/Close.js +3 -6
- package/lib/ui/src/icons/Close.js.map +1 -1
- package/lib/ui/src/icons/CloseBox.d.ts +0 -1
- package/lib/ui/src/icons/CloseBox.js +3 -3
- package/lib/ui/src/icons/CloseBox.js.map +1 -1
- package/lib/ui/src/icons/DropDown.d.ts +0 -1
- package/lib/ui/src/icons/DropDown.js +3 -3
- package/lib/ui/src/icons/DropDown.js.map +1 -1
- package/lib/ui/src/icons/EmoticonCool.js +3 -6
- package/lib/ui/src/icons/EmoticonCool.js.map +1 -1
- package/lib/ui/src/icons/Help.js +3 -6
- package/lib/ui/src/icons/Help.js.map +1 -1
- package/lib/ui/src/icons/Less.js +3 -6
- package/lib/ui/src/icons/Less.js.map +1 -1
- package/lib/ui/src/icons/Plus.js +3 -6
- package/lib/ui/src/icons/Plus.js.map +1 -1
- package/lib/ui/src/icons/Tick.d.ts +0 -1
- package/lib/ui/src/icons/Tick.js +3 -3
- package/lib/ui/src/icons/Tick.js.map +1 -1
- package/lib/ui/src/icons/TrustPilot.d.ts +0 -1
- package/lib/ui/src/icons/TrustPilot.js +3 -3
- package/lib/ui/src/icons/TrustPilot.js.map +1 -1
- package/lib/ui/src/icons/index.d.ts +0 -1
- package/lib/ui/src/icons/index.js +11 -11
- package/lib/ui/src/icons/index.js.map +1 -1
- package/lib/ui/src/input/Input.js +5 -18
- package/lib/ui/src/input/Input.js.map +1 -1
- package/lib/ui/src/input/Input.stories.js +35 -46
- package/lib/ui/src/input/Input.stories.js.map +1 -1
- package/lib/ui/src/input/Input.styles.js +37 -9
- package/lib/ui/src/input/Input.styles.js.map +1 -1
- package/lib/ui/src/input/Input.test.js +17 -28
- package/lib/ui/src/input/Input.test.js.map +1 -1
- package/lib/ui/src/inputBase/InputBase.js +31 -43
- package/lib/ui/src/inputBase/InputBase.js.map +1 -1
- package/lib/ui/src/inputBase/InputBase.styles.js +243 -67
- package/lib/ui/src/inputBase/InputBase.styles.js.map +1 -1
- package/lib/ui/src/inputBase/InputBase.test.js +36 -98
- package/lib/ui/src/inputBase/InputBase.test.js.map +1 -1
- package/lib/ui/src/inputLoader/InputLoader.d.ts +0 -1
- package/lib/ui/src/inputLoader/InputLoader.js +4 -4
- package/lib/ui/src/inputLoader/InputLoader.js.map +1 -1
- package/lib/ui/src/inputLoader/InputLoader.styles.js +20 -10
- package/lib/ui/src/inputLoader/InputLoader.styles.js.map +1 -1
- package/lib/ui/src/inputLoading/InputLoading.js +3 -3
- package/lib/ui/src/inputLoading/InputLoading.js.map +1 -1
- package/lib/ui/src/inputLoading/InputLoading.stories.js +4 -4
- package/lib/ui/src/inputLoading/InputLoading.stories.js.map +1 -1
- package/lib/ui/src/inputLoading/InputLoading.styles.js +10 -8
- package/lib/ui/src/inputLoading/InputLoading.styles.js.map +1 -1
- package/lib/ui/src/inputLoading/InputLoading.test.js +6 -6
- package/lib/ui/src/inputLoading/InputLoading.test.js.map +1 -1
- package/lib/ui/src/loader/Loader.js +8 -11
- package/lib/ui/src/loader/Loader.js.map +1 -1
- package/lib/ui/src/loader/Loader.stories.js +9 -9
- package/lib/ui/src/loader/Loader.stories.js.map +1 -1
- package/lib/ui/src/loader/Loader.styles.js +56 -23
- package/lib/ui/src/loader/Loader.styles.js.map +1 -1
- package/lib/ui/src/loader/Loader.test.js +6 -6
- package/lib/ui/src/loader/Loader.test.js.map +1 -1
- package/lib/ui/src/logo/Logo.d.ts +0 -1
- package/lib/ui/src/logo/Logo.js +3 -3
- package/lib/ui/src/logo/Logo.js.map +1 -1
- package/lib/ui/src/logo/Logo.stories.js +11 -22
- package/lib/ui/src/logo/Logo.stories.js.map +1 -1
- package/lib/ui/src/mockForm/MockForm.js +5 -8
- package/lib/ui/src/mockForm/MockForm.js.map +1 -1
- package/lib/ui/src/mockForm/MockForm.test.js +6 -6
- package/lib/ui/src/mockForm/MockForm.test.js.map +1 -1
- package/lib/ui/src/modal/Modal.js +43 -49
- package/lib/ui/src/modal/Modal.js.map +1 -1
- package/lib/ui/src/modal/Modal.reducer.js +12 -24
- package/lib/ui/src/modal/Modal.reducer.js.map +1 -1
- package/lib/ui/src/modal/Modal.stories.js +25 -27
- package/lib/ui/src/modal/Modal.stories.js.map +1 -1
- package/lib/ui/src/modal/Modal.styles.d.ts +3 -1
- package/lib/ui/src/modal/Modal.styles.js +165 -32
- package/lib/ui/src/modal/Modal.styles.js.map +1 -1
- package/lib/ui/src/modal/Modal.test.js +34 -71
- package/lib/ui/src/modal/Modal.test.js.map +1 -1
- package/lib/ui/src/nativeSelect/NativeSelect.js +5 -11
- package/lib/ui/src/nativeSelect/NativeSelect.js.map +1 -1
- package/lib/ui/src/nativeSelect/NativeSelect.styles.js +9 -7
- package/lib/ui/src/nativeSelect/NativeSelect.styles.js.map +1 -1
- package/lib/ui/src/nativeSelect/NativeSelect.test.js +7 -18
- package/lib/ui/src/nativeSelect/NativeSelect.test.js.map +1 -1
- package/lib/ui/src/numberInput/NumberInput.js +19 -30
- package/lib/ui/src/numberInput/NumberInput.js.map +1 -1
- package/lib/ui/src/numberInput/NumberInput.stories.js +19 -30
- package/lib/ui/src/numberInput/NumberInput.stories.js.map +1 -1
- package/lib/ui/src/numberInput/NumberInput.test.js +107 -254
- package/lib/ui/src/numberInput/NumberInput.test.js.map +1 -1
- package/lib/ui/src/numberInput/NumberInput.utils.js +10 -10
- package/lib/ui/src/numberInput/NumberInput.utils.js.map +1 -1
- package/lib/ui/src/numberInput/NumberInput.utils.test.js +30 -30
- package/lib/ui/src/numberInput/NumberInput.utils.test.js.map +1 -1
- package/lib/ui/src/option/Option.js +8 -11
- package/lib/ui/src/option/Option.js.map +1 -1
- package/lib/ui/src/option/Option.styles.js +59 -19
- package/lib/ui/src/option/Option.styles.js.map +1 -1
- package/lib/ui/src/option/Option.test.js +29 -71
- package/lib/ui/src/option/Option.test.js.map +1 -1
- package/lib/ui/src/panel/Panel.js +4 -7
- package/lib/ui/src/panel/Panel.js.map +1 -1
- package/lib/ui/src/panel/Panel.stories.js +9 -9
- package/lib/ui/src/panel/Panel.stories.js.map +1 -1
- package/lib/ui/src/panel/Panel.styles.js +25 -19
- package/lib/ui/src/panel/Panel.styles.js.map +1 -1
- package/lib/ui/src/panel/PanelColors.js +1 -1
- package/lib/ui/src/panel/PanelColors.js.map +1 -1
- package/lib/ui/src/radio/Radio.js +6 -7
- package/lib/ui/src/radio/Radio.js.map +1 -1
- package/lib/ui/src/radio/Radio.stories.js +12 -27
- package/lib/ui/src/radio/Radio.stories.js.map +1 -1
- package/lib/ui/src/radio/Radio.styles.js +74 -10
- package/lib/ui/src/radio/Radio.styles.js.map +1 -1
- package/lib/ui/src/radio/Radio.test.js +17 -63
- package/lib/ui/src/radio/Radio.test.js.map +1 -1
- package/lib/ui/src/select/Select.js +20 -48
- package/lib/ui/src/select/Select.js.map +1 -1
- package/lib/ui/src/select/Select.styles.js +38 -18
- package/lib/ui/src/select/Select.styles.js.map +1 -1
- package/lib/ui/src/select/Select.test.js +26 -72
- package/lib/ui/src/select/Select.test.js.map +1 -1
- package/lib/ui/src/selectWrapper/SelectWrapper.js +33 -50
- package/lib/ui/src/selectWrapper/SelectWrapper.js.map +1 -1
- package/lib/ui/src/selectWrapper/SelectWrapper.stories.js +64 -82
- package/lib/ui/src/selectWrapper/SelectWrapper.stories.js.map +1 -1
- package/lib/ui/src/selectWrapper/SelectWrapper.styles.js +71 -37
- package/lib/ui/src/selectWrapper/SelectWrapper.styles.js.map +1 -1
- package/lib/ui/src/selectWrapper/SelectWrapper.test.js +53 -107
- package/lib/ui/src/selectWrapper/SelectWrapper.test.js.map +1 -1
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.js +6 -7
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.js.map +1 -1
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.stories.js +7 -18
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.stories.js.map +1 -1
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.test.js +29 -67
- package/lib/ui/src/showMoreTextToggle/ShowMoreTextToggle.test.js.map +1 -1
- package/lib/ui/src/showMoreTextToggle/showMoreTextToggle.styles.js +22 -21
- package/lib/ui/src/showMoreTextToggle/showMoreTextToggle.styles.js.map +1 -1
- package/lib/ui/src/subtitle/Subtitle.js +5 -8
- package/lib/ui/src/subtitle/Subtitle.js.map +1 -1
- package/lib/ui/src/subtitle/Subtitle.stories.js +9 -20
- package/lib/ui/src/subtitle/Subtitle.stories.js.map +1 -1
- package/lib/ui/src/subtitle/Subtitle.styles.js +15 -16
- package/lib/ui/src/subtitle/Subtitle.styles.js.map +1 -1
- package/lib/ui/src/subtitle/Subtitle.test.js +9 -20
- package/lib/ui/src/subtitle/Subtitle.test.js.map +1 -1
- package/lib/ui/src/tag/Tag.js +12 -12
- package/lib/ui/src/tag/Tag.js.map +1 -1
- package/lib/ui/src/tag/Tag.stories.js +29 -40
- package/lib/ui/src/tag/Tag.stories.js.map +1 -1
- package/lib/ui/src/tag/Tag.styles.js +140 -41
- package/lib/ui/src/tag/Tag.styles.js.map +1 -1
- package/lib/ui/src/tag/Tag.test.js +31 -80
- package/lib/ui/src/tag/Tag.test.js.map +1 -1
- package/lib/ui/src/tag/TagColors.js +1 -1
- package/lib/ui/src/tag/TagColors.js.map +1 -1
- package/lib/ui/src/textarea/Textarea.js +50 -77
- package/lib/ui/src/textarea/Textarea.js.map +1 -1
- package/lib/ui/src/textarea/Textarea.stories.js +42 -62
- package/lib/ui/src/textarea/Textarea.stories.js.map +1 -1
- package/lib/ui/src/textarea/Textarea.styles.d.ts +1 -1
- package/lib/ui/src/textarea/Textarea.styles.js +57 -32
- package/lib/ui/src/textarea/Textarea.styles.js.map +1 -1
- package/lib/ui/src/textarea/Textarea.test.js +17 -63
- package/lib/ui/src/textarea/Textarea.test.js.map +1 -1
- package/lib/ui/src/title/H1.js +6 -9
- package/lib/ui/src/title/H1.js.map +1 -1
- package/lib/ui/src/title/H1.styles.d.ts +2 -1
- package/lib/ui/src/title/H1.styles.js +7 -9
- package/lib/ui/src/title/H1.styles.js.map +1 -1
- package/lib/ui/src/title/H1.test.js +6 -6
- package/lib/ui/src/title/H1.test.js.map +1 -1
- package/lib/ui/src/title/H2.js +6 -9
- package/lib/ui/src/title/H2.js.map +1 -1
- package/lib/ui/src/title/H2.styles.d.ts +2 -1
- package/lib/ui/src/title/H2.styles.js +7 -9
- package/lib/ui/src/title/H2.styles.js.map +1 -1
- package/lib/ui/src/title/H2.test.js +6 -6
- package/lib/ui/src/title/H2.test.js.map +1 -1
- package/lib/ui/src/title/H3.js +7 -21
- package/lib/ui/src/title/H3.js.map +1 -1
- package/lib/ui/src/title/H3.styles.d.ts +2 -1
- package/lib/ui/src/title/H3.styles.js +7 -9
- package/lib/ui/src/title/H3.styles.js.map +1 -1
- package/lib/ui/src/title/H3.test.js +6 -6
- package/lib/ui/src/title/H3.test.js.map +1 -1
- package/lib/ui/src/title/H4.js +6 -9
- package/lib/ui/src/title/H4.js.map +1 -1
- package/lib/ui/src/title/H4.styles.d.ts +2 -1
- package/lib/ui/src/title/H4.styles.js +7 -9
- package/lib/ui/src/title/H4.styles.js.map +1 -1
- package/lib/ui/src/title/H4.test.js +6 -6
- package/lib/ui/src/title/H4.test.js.map +1 -1
- package/lib/ui/src/title/H5.js +6 -9
- package/lib/ui/src/title/H5.js.map +1 -1
- package/lib/ui/src/title/H5.styles.d.ts +2 -1
- package/lib/ui/src/title/H5.styles.js +7 -9
- package/lib/ui/src/title/H5.styles.js.map +1 -1
- package/lib/ui/src/title/H5.test.js +6 -6
- package/lib/ui/src/title/H5.test.js.map +1 -1
- package/lib/ui/src/title/H6.js +7 -21
- package/lib/ui/src/title/H6.js.map +1 -1
- package/lib/ui/src/title/H6.styles.d.ts +2 -1
- package/lib/ui/src/title/H6.styles.js +7 -9
- package/lib/ui/src/title/H6.styles.js.map +1 -1
- package/lib/ui/src/title/H6.test.js +6 -6
- package/lib/ui/src/title/H6.test.js.map +1 -1
- package/lib/ui/src/title/Title.js +2 -2
- package/lib/ui/src/title/Title.js.map +1 -1
- package/lib/ui/src/title/Title.stories.js +18 -18
- package/lib/ui/src/title/Title.stories.js.map +1 -1
- package/lib/ui/src/title/Title.styles.js +89 -22
- package/lib/ui/src/title/Title.styles.js.map +1 -1
- package/lib/ui/src/toggle/Toggle.js +8 -11
- package/lib/ui/src/toggle/Toggle.js.map +1 -1
- package/lib/ui/src/toggle/Toggle.stories.js +20 -31
- package/lib/ui/src/toggle/Toggle.stories.js.map +1 -1
- package/lib/ui/src/toggle/Toggle.styles.js +87 -13
- package/lib/ui/src/toggle/Toggle.styles.js.map +1 -1
- package/lib/ui/src/toggle/Toggle.test.js +23 -68
- package/lib/ui/src/toggle/Toggle.test.js.map +1 -1
- package/lib/ui/src/tooltip/Tooltip.js +20 -32
- package/lib/ui/src/tooltip/Tooltip.js.map +1 -1
- package/lib/ui/src/tooltip/Tooltip.stories.js +26 -37
- package/lib/ui/src/tooltip/Tooltip.stories.js.map +1 -1
- package/lib/ui/src/tooltip/Tooltip.styles.js +56 -9
- package/lib/ui/src/tooltip/Tooltip.styles.js.map +1 -1
- package/lib/ui/src/tooltip/Tooltip.test.js +22 -71
- package/lib/ui/src/tooltip/Tooltip.test.js.map +1 -1
- package/lib/utils/src/actions.js +2 -2
- package/lib/utils/src/actions.js.map +1 -1
- package/lib/utils/src/colors.js +23 -25
- package/lib/utils/src/colors.js.map +1 -1
- package/lib/utils/src/colors.test.js +7 -7
- package/lib/utils/src/colors.test.js.map +1 -1
- package/lib/utils/src/container.js +21 -9
- package/lib/utils/src/container.js.map +1 -1
- package/lib/utils/src/fonts.js +18 -19
- package/lib/utils/src/fonts.js.map +1 -1
- package/lib/utils/src/gmaps.d.ts +1 -0
- package/lib/utils/src/gmaps.js +11 -17
- package/lib/utils/src/gmaps.js.map +1 -1
- package/lib/utils/src/gmaps.test.js +22 -42
- package/lib/utils/src/gmaps.test.js.map +1 -1
- package/lib/utils/src/line.js +7 -8
- package/lib/utils/src/line.js.map +1 -1
- package/lib/utils/src/paragraphs.js +80 -31
- package/lib/utils/src/paragraphs.js.map +1 -1
- package/lib/utils/src/radius.js +6 -6
- package/lib/utils/src/radius.js.map +1 -1
- package/lib/utils/src/responsive.js +13 -22
- package/lib/utils/src/responsive.js.map +1 -1
- package/lib/utils/src/row.js +37 -9
- package/lib/utils/src/row.js.map +1 -1
- package/lib/utils/src/scrollbars.js +32 -9
- package/lib/utils/src/scrollbars.js.map +1 -1
- package/lib/utils/src/shadows.js +6 -6
- package/lib/utils/src/shadows.js.map +1 -1
- package/lib/utils/src/spacing.js +1 -1
- package/lib/utils/src/spacing.js.map +1 -1
- package/lib/utils/src/spacing.test.js +10 -10
- package/lib/utils/src/spacing.test.js.map +1 -1
- package/lib/utils/src/test-utils.d.ts +1 -1
- package/lib/utils/src/test-utils.js +21 -69
- package/lib/utils/src/test-utils.js.map +1 -1
- package/lib/utils/src/utils.stories.js +27 -27
- package/lib/utils/src/utils.stories.js.map +1 -1
- package/lib/utils/src/utils.styles.js +185 -55
- package/lib/utils/src/utils.styles.js.map +1 -1
- package/package.json +50 -56
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
describe('getConsumptionLevel()',
|
|
6
|
-
it('should return correct consumption level',
|
|
7
|
-
expect(Energy_utils_1.getConsumptionLevel(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
8
|
-
expect(Energy_utils_1.getConsumptionLevel(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
9
|
-
expect(Energy_utils_1.getConsumptionLevel(70)).toEqual(interfaces_1.EnergyLevel.B);
|
|
10
|
-
expect(Energy_utils_1.getConsumptionLevel(109)).toEqual(interfaces_1.EnergyLevel.B);
|
|
11
|
-
expect(Energy_utils_1.getConsumptionLevel(110)).toEqual(interfaces_1.EnergyLevel.C);
|
|
12
|
-
expect(Energy_utils_1.getConsumptionLevel(179)).toEqual(interfaces_1.EnergyLevel.C);
|
|
13
|
-
expect(Energy_utils_1.getConsumptionLevel(180)).toEqual(interfaces_1.EnergyLevel.D);
|
|
14
|
-
expect(Energy_utils_1.getConsumptionLevel(249)).toEqual(interfaces_1.EnergyLevel.D);
|
|
15
|
-
expect(Energy_utils_1.getConsumptionLevel(250)).toEqual(interfaces_1.EnergyLevel.E);
|
|
16
|
-
expect(Energy_utils_1.getConsumptionLevel(329)).toEqual(interfaces_1.EnergyLevel.E);
|
|
17
|
-
expect(Energy_utils_1.getConsumptionLevel(330)).toEqual(interfaces_1.EnergyLevel.F);
|
|
18
|
-
expect(Energy_utils_1.getConsumptionLevel(419)).toEqual(interfaces_1.EnergyLevel.F);
|
|
19
|
-
expect(Energy_utils_1.getConsumptionLevel(420)).toEqual(interfaces_1.EnergyLevel.G);
|
|
20
|
-
expect(Energy_utils_1.getConsumptionLevel(1000)).toEqual(interfaces_1.EnergyLevel.G);
|
|
3
|
+
const Energy_utils_1 = require("./Energy.utils");
|
|
4
|
+
const interfaces_1 = require("./interfaces");
|
|
5
|
+
describe('getConsumptionLevel()', () => {
|
|
6
|
+
it('should return correct consumption level', () => {
|
|
7
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
8
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
9
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(70)).toEqual(interfaces_1.EnergyLevel.B);
|
|
10
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(109)).toEqual(interfaces_1.EnergyLevel.B);
|
|
11
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(110)).toEqual(interfaces_1.EnergyLevel.C);
|
|
12
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(179)).toEqual(interfaces_1.EnergyLevel.C);
|
|
13
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(180)).toEqual(interfaces_1.EnergyLevel.D);
|
|
14
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(249)).toEqual(interfaces_1.EnergyLevel.D);
|
|
15
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(250)).toEqual(interfaces_1.EnergyLevel.E);
|
|
16
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(329)).toEqual(interfaces_1.EnergyLevel.E);
|
|
17
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(330)).toEqual(interfaces_1.EnergyLevel.F);
|
|
18
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(419)).toEqual(interfaces_1.EnergyLevel.F);
|
|
19
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(420)).toEqual(interfaces_1.EnergyLevel.G);
|
|
20
|
+
expect((0, Energy_utils_1.getConsumptionLevel)(1000)).toEqual(interfaces_1.EnergyLevel.G);
|
|
21
21
|
});
|
|
22
22
|
});
|
|
23
|
-
describe('getCarbonFootprintLevel()',
|
|
24
|
-
it('should return correct carbon footprint level',
|
|
25
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
26
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(5)).toEqual(interfaces_1.EnergyLevel.A);
|
|
27
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(6)).toEqual(interfaces_1.EnergyLevel.B);
|
|
28
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(10)).toEqual(interfaces_1.EnergyLevel.B);
|
|
29
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(11)).toEqual(interfaces_1.EnergyLevel.C);
|
|
30
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(29)).toEqual(interfaces_1.EnergyLevel.C);
|
|
31
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(30)).toEqual(interfaces_1.EnergyLevel.D);
|
|
32
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(49)).toEqual(interfaces_1.EnergyLevel.D);
|
|
33
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(50)).toEqual(interfaces_1.EnergyLevel.E);
|
|
34
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(69)).toEqual(interfaces_1.EnergyLevel.E);
|
|
35
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(70)).toEqual(interfaces_1.EnergyLevel.F);
|
|
36
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(99)).toEqual(interfaces_1.EnergyLevel.F);
|
|
37
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(100)).toEqual(interfaces_1.EnergyLevel.G);
|
|
38
|
-
expect(Energy_utils_1.getCarbonFootprintLevel(1000)).toEqual(interfaces_1.EnergyLevel.G);
|
|
23
|
+
describe('getCarbonFootprintLevel()', () => {
|
|
24
|
+
it('should return correct carbon footprint level', () => {
|
|
25
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(0)).toEqual(interfaces_1.EnergyLevel.A);
|
|
26
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(5)).toEqual(interfaces_1.EnergyLevel.A);
|
|
27
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(6)).toEqual(interfaces_1.EnergyLevel.B);
|
|
28
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(10)).toEqual(interfaces_1.EnergyLevel.B);
|
|
29
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(11)).toEqual(interfaces_1.EnergyLevel.C);
|
|
30
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(29)).toEqual(interfaces_1.EnergyLevel.C);
|
|
31
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(30)).toEqual(interfaces_1.EnergyLevel.D);
|
|
32
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(49)).toEqual(interfaces_1.EnergyLevel.D);
|
|
33
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(50)).toEqual(interfaces_1.EnergyLevel.E);
|
|
34
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(69)).toEqual(interfaces_1.EnergyLevel.E);
|
|
35
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(70)).toEqual(interfaces_1.EnergyLevel.F);
|
|
36
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(99)).toEqual(interfaces_1.EnergyLevel.F);
|
|
37
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(100)).toEqual(interfaces_1.EnergyLevel.G);
|
|
38
|
+
expect((0, Energy_utils_1.getCarbonFootprintLevel)(1000)).toEqual(interfaces_1.EnergyLevel.G);
|
|
39
39
|
});
|
|
40
40
|
});
|
|
41
|
-
describe('getEPCLevel()',
|
|
42
|
-
it('should return the worst value',
|
|
43
|
-
expect(Energy_utils_1.getEPCLevel(interfaces_1.EnergyLevel.A, interfaces_1.EnergyLevel.B)).toEqual(interfaces_1.EnergyLevel.B);
|
|
44
|
-
expect(Energy_utils_1.getEPCLevel(interfaces_1.EnergyLevel.B, interfaces_1.EnergyLevel.A)).toEqual(interfaces_1.EnergyLevel.B);
|
|
45
|
-
expect(Energy_utils_1.getEPCLevel(interfaces_1.EnergyLevel.E, interfaces_1.EnergyLevel.E)).toEqual(interfaces_1.EnergyLevel.E);
|
|
41
|
+
describe('getEPCLevel()', () => {
|
|
42
|
+
it('should return the worst value', () => {
|
|
43
|
+
expect((0, Energy_utils_1.getEPCLevel)(interfaces_1.EnergyLevel.A, interfaces_1.EnergyLevel.B)).toEqual(interfaces_1.EnergyLevel.B);
|
|
44
|
+
expect((0, Energy_utils_1.getEPCLevel)(interfaces_1.EnergyLevel.B, interfaces_1.EnergyLevel.A)).toEqual(interfaces_1.EnergyLevel.B);
|
|
45
|
+
expect((0, Energy_utils_1.getEPCLevel)(interfaces_1.EnergyLevel.E, interfaces_1.EnergyLevel.E)).toEqual(interfaces_1.EnergyLevel.E);
|
|
46
46
|
});
|
|
47
47
|
});
|
|
48
|
-
describe('generateLinearGradient()',
|
|
49
|
-
it('should return color block gradient CSS',
|
|
50
|
-
expect(Energy_utils_1.generateLinearGradient('gold', 50, 100)).toEqual('linear-gradient(135deg, transparent 0px, transparent 50px, gold 50px, gold 100px, transparent 100px)');
|
|
48
|
+
describe('generateLinearGradient()', () => {
|
|
49
|
+
it('should return color block gradient CSS', () => {
|
|
50
|
+
expect((0, Energy_utils_1.generateLinearGradient)('gold', 50, 100)).toEqual('linear-gradient(135deg, transparent 0px, transparent 50px, gold 50px, gold 100px, transparent 100px)');
|
|
51
51
|
});
|
|
52
|
-
it('should return arrow block gradient CSS',
|
|
53
|
-
expect(Energy_utils_1.generateLinearGradient('gold', 50, 100, true)).toEqual('linear-gradient(45deg, transparent 0px, transparent 50px, gold 50px, gold 100px, transparent 100px)');
|
|
52
|
+
it('should return arrow block gradient CSS', () => {
|
|
53
|
+
expect((0, Energy_utils_1.generateLinearGradient)('gold', 50, 100, true)).toEqual('linear-gradient(45deg, transparent 0px, transparent 50px, gold 50px, gold 100px, transparent 100px)');
|
|
54
54
|
});
|
|
55
55
|
});
|
|
56
|
-
describe('generateEPCBgackground()',
|
|
57
|
-
it('should generate only 1 arrow',
|
|
58
|
-
expect(Energy_utils_1.generateEPCBackground({ A: '#32b982' }, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 42px, white 42px, white 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, white 42px, white 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32b982 0px, #32b982 42px, transparent 42px)');
|
|
56
|
+
describe('generateEPCBgackground()', () => {
|
|
57
|
+
it('should generate only 1 arrow', () => {
|
|
58
|
+
expect((0, Energy_utils_1.generateEPCBackground)({ A: '#32b982' }, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 42px, white 42px, white 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, white 42px, white 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32b982 0px, #32b982 42px, transparent 42px)');
|
|
59
59
|
});
|
|
60
|
-
it('should generate 2 arrows',
|
|
61
|
-
expect(Energy_utils_1.generateEPCBackground({ A: '#32b982', B: '#5ed44a' }, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 72px, white 72px, white 102px, transparent 102px),linear-gradient(135deg, transparent 0px, transparent 72px, white 72px, white 102px, transparent 102px),linear-gradient(45deg, transparent 0px, transparent 42px, #5ed44a 42px, #5ed44a 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, #5ed44a 42px, #5ed44a 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32b982 0px, #32b982 42px, transparent 42px)');
|
|
60
|
+
it('should generate 2 arrows', () => {
|
|
61
|
+
expect((0, Energy_utils_1.generateEPCBackground)({ A: '#32b982', B: '#5ed44a' }, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 72px, white 72px, white 102px, transparent 102px),linear-gradient(135deg, transparent 0px, transparent 72px, white 72px, white 102px, transparent 102px),linear-gradient(45deg, transparent 0px, transparent 42px, #5ed44a 42px, #5ed44a 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, #5ed44a 42px, #5ed44a 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32b982 12px, #32b982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32b982 0px, #32b982 42px, transparent 42px)');
|
|
62
62
|
});
|
|
63
|
-
it('should generate full EPC rainbow background arrows',
|
|
64
|
-
expect(Energy_utils_1.generateEPCBackground(interfaces_1.EnergyLevelColor, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 222px, white 222px, white 252px, transparent 252px),linear-gradient(135deg, transparent 0px, transparent 222px, white 222px, white 252px, transparent 252px),linear-gradient(45deg, transparent 0px, transparent 192px, #CF2D25 192px, #CF2D25 222px, transparent 222px),linear-gradient(135deg, transparent 0px, transparent 192px, #CF2D25 192px, #CF2D25 222px, transparent 222px),linear-gradient(45deg, transparent 0px, transparent 162px, #D46B3B 162px, #D46B3B 192px, transparent 192px),linear-gradient(135deg, transparent 0px, transparent 162px, #D46B3B 162px, #D46B3B 192px, transparent 192px),linear-gradient(45deg, transparent 0px, transparent 132px, #DB9C38 132px, #DB9C38 162px, transparent 162px),linear-gradient(135deg, transparent 0px, transparent 132px, #DB9C38 132px, #DB9C38 162px, transparent 162px),linear-gradient(45deg, transparent 0px, transparent 102px, #DCC646 102px, #DCC646 132px, transparent 132px),linear-gradient(135deg, transparent 0px, transparent 102px, #DCC646 102px, #DCC646 132px, transparent 132px),linear-gradient(45deg, transparent 0px, transparent 72px, #B3CA41 72px, #B3CA41 102px, transparent 102px),linear-gradient(135deg, transparent 0px, transparent 72px, #B3CA41 72px, #B3CA41 102px, transparent 102px),linear-gradient(45deg, transparent 0px, transparent 42px, #5ED44A 42px, #5ED44A 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, #5ED44A 42px, #5ED44A 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32B982 12px, #32B982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32B982 12px, #32B982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32B982 0px, #32B982 42px, transparent 42px)');
|
|
63
|
+
it('should generate full EPC rainbow background arrows', () => {
|
|
64
|
+
expect((0, Energy_utils_1.generateEPCBackground)(interfaces_1.EnergyLevelColor, 30)).toEqual('linear-gradient(45deg, transparent 0px, transparent 222px, white 222px, white 252px, transparent 252px),linear-gradient(135deg, transparent 0px, transparent 222px, white 222px, white 252px, transparent 252px),linear-gradient(45deg, transparent 0px, transparent 192px, #CF2D25 192px, #CF2D25 222px, transparent 222px),linear-gradient(135deg, transparent 0px, transparent 192px, #CF2D25 192px, #CF2D25 222px, transparent 222px),linear-gradient(45deg, transparent 0px, transparent 162px, #D46B3B 162px, #D46B3B 192px, transparent 192px),linear-gradient(135deg, transparent 0px, transparent 162px, #D46B3B 162px, #D46B3B 192px, transparent 192px),linear-gradient(45deg, transparent 0px, transparent 132px, #DB9C38 132px, #DB9C38 162px, transparent 162px),linear-gradient(135deg, transparent 0px, transparent 132px, #DB9C38 132px, #DB9C38 162px, transparent 162px),linear-gradient(45deg, transparent 0px, transparent 102px, #DCC646 102px, #DCC646 132px, transparent 132px),linear-gradient(135deg, transparent 0px, transparent 102px, #DCC646 102px, #DCC646 132px, transparent 132px),linear-gradient(45deg, transparent 0px, transparent 72px, #B3CA41 72px, #B3CA41 102px, transparent 102px),linear-gradient(135deg, transparent 0px, transparent 72px, #B3CA41 72px, #B3CA41 102px, transparent 102px),linear-gradient(45deg, transparent 0px, transparent 42px, #5ED44A 42px, #5ED44A 72px, transparent 72px),linear-gradient(135deg, transparent 0px, transparent 42px, #5ED44A 42px, #5ED44A 72px, transparent 72px),linear-gradient(45deg, transparent 0px, transparent 12px, #32B982 12px, #32B982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 12px, #32B982 12px, #32B982 42px, transparent 42px),linear-gradient(135deg, transparent 0px, transparent 0px, #32B982 0px, #32B982 42px, transparent 42px)');
|
|
65
65
|
});
|
|
66
66
|
});
|
|
67
67
|
//# sourceMappingURL=Energy.utils.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.utils.test.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.utils.test.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"Energy.utils.test.js","sourceRoot":"","sources":["../../../packages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AC,CAAC,CAAC,OAAO,CACzD,oxDAAoxD,CACrxD,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,69 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
4
|
};
|
|
16
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
6
|
exports.formatEmail = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Phone_1 = __importDefault(require("../../../phone/src/phoneInput/Phone"));
|
|
9
|
+
const EmailInput_1 = __importDefault(require("../../../ui/src/emailInput/EmailInput"));
|
|
10
|
+
const Input_1 = require("../../../ui/src/input/Input");
|
|
11
|
+
const InputBase_1 = __importDefault(require("../../../ui/src/inputBase/InputBase"));
|
|
12
|
+
const utils_1 = require("../../../utils");
|
|
13
|
+
const UserForm_styles_1 = require("./UserForm.styles");
|
|
14
|
+
const DEFAULT_INPUT_LABELS = {
|
|
26
15
|
firstName: 'Prénom',
|
|
27
16
|
lastName: 'Nom',
|
|
28
17
|
email: 'Email',
|
|
29
18
|
phone: 'Téléphone'
|
|
30
19
|
};
|
|
31
|
-
|
|
20
|
+
const DEFAULT_ERROR_MESSAGES = {
|
|
32
21
|
email: 'Votre email est invalide',
|
|
33
22
|
firstName: 'Votre prénom doit comporter au moins deux lettres, aucun chiffre et caractère spécial',
|
|
34
23
|
lastName: 'Votre nom doit comporter au moins deux lettres, aucun chiffre et caractère spécial',
|
|
35
24
|
phone: 'Numéro de téléphone incorrect'
|
|
36
25
|
};
|
|
37
|
-
|
|
26
|
+
const formatEmail = (email) => email.trim();
|
|
38
27
|
exports.formatEmail = formatEmail;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var mergedErrorMessages = __assign(__assign({}, DEFAULT_ERROR_MESSAGES), errorMessages);
|
|
28
|
+
const UserForm = ({ user, errors, emailSuggestionI18nLabels, isEmailSuggestionEnabled = true, labels = DEFAULT_INPUT_LABELS, errorMessages = {}, updateUser, phoneWithFlags = false }) => {
|
|
29
|
+
const { firstName, lastName, email, phone } = user;
|
|
30
|
+
const mergedErrorMessages = Object.assign(Object.assign({}, DEFAULT_ERROR_MESSAGES), errorMessages);
|
|
43
31
|
return (react_1.default.createElement(UserForm_styles_1.Layout, null,
|
|
44
32
|
react_1.default.createElement(utils_1.Line, null,
|
|
45
33
|
react_1.default.createElement(utils_1.Row, null,
|
|
46
34
|
react_1.default.createElement(UserForm_styles_1.InputWithError, null,
|
|
47
|
-
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-firstName", name: "first-name", type: Input_1.InputType.TEXT, disabled: false, error: !!errors.firstName, label: labels.firstName, value: firstName, onChange:
|
|
48
|
-
return updateUser(__assign(__assign({}, user), { firstName: value }), 'user.firstName');
|
|
49
|
-
} }),
|
|
35
|
+
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-firstName", name: "first-name", type: Input_1.InputType.TEXT, disabled: false, error: !!errors.firstName, label: labels.firstName, value: firstName, onChange: value => updateUser(Object.assign(Object.assign({}, user), { firstName: value }), 'user.firstName') }),
|
|
50
36
|
errors.firstName && (react_1.default.createElement(UserForm_styles_1.ErrorLayout, { "data-test": "invalid-firstName" }, mergedErrorMessages.firstName))),
|
|
51
37
|
react_1.default.createElement(UserForm_styles_1.InputWithError, null,
|
|
52
|
-
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-lastName", name: "last-name", type: Input_1.InputType.TEXT, disabled: false, error: !!errors.lastName, label: labels.lastName, value: lastName, onChange:
|
|
53
|
-
return updateUser(__assign(__assign({}, user), { lastName: value }), 'user.lastName');
|
|
54
|
-
} }),
|
|
38
|
+
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-lastName", name: "last-name", type: Input_1.InputType.TEXT, disabled: false, error: !!errors.lastName, label: labels.lastName, value: lastName, onChange: value => updateUser(Object.assign(Object.assign({}, user), { lastName: value }), 'user.lastName') }),
|
|
55
39
|
errors.lastName && (react_1.default.createElement(UserForm_styles_1.ErrorLayout, { "data-test": "invalid-lastName" }, mergedErrorMessages.lastName))))),
|
|
56
40
|
react_1.default.createElement(utils_1.Line, null,
|
|
57
41
|
react_1.default.createElement(utils_1.Row, null,
|
|
58
42
|
react_1.default.createElement(UserForm_styles_1.InputWithError, null,
|
|
59
|
-
react_1.default.createElement(EmailInput_1.default, { dataTest: "customer-email", name: "email", disabled: false, error: !!errors.email, label: labels.email, isSuggestionEnabled: isEmailSuggestionEnabled, i18nLabels: emailSuggestionI18nLabels, value: email, onChange:
|
|
60
|
-
return updateUser(__assign(__assign({}, user), { email: exports.formatEmail(value) }), 'user.email');
|
|
61
|
-
} }),
|
|
43
|
+
react_1.default.createElement(EmailInput_1.default, { dataTest: "customer-email", name: "email", disabled: false, error: !!errors.email, label: labels.email, isSuggestionEnabled: isEmailSuggestionEnabled, i18nLabels: emailSuggestionI18nLabels, value: email, onChange: value => updateUser(Object.assign(Object.assign({}, user), { email: (0, exports.formatEmail)(value) }), 'user.email') }),
|
|
62
44
|
errors.email && (react_1.default.createElement(UserForm_styles_1.ErrorLayout, { "data-test": "invalid-email" }, mergedErrorMessages.email))),
|
|
63
45
|
react_1.default.createElement(UserForm_styles_1.InputWithError, null,
|
|
64
|
-
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-phone", name: "phone", type: Input_1.InputType.TEL, disabled: false, error: !!errors.phone, label: labels.phone, value: phone, onChange:
|
|
65
|
-
return updateUser(__assign(__assign({}, user), { phone: value || null }), 'user.phone');
|
|
66
|
-
}, inputElement: Phone_1.default, phoneWithFlags: phoneWithFlags }),
|
|
46
|
+
react_1.default.createElement(InputBase_1.default, { dataTest: "customer-phone", name: "phone", type: Input_1.InputType.TEL, disabled: false, error: !!errors.phone, label: labels.phone, value: phone, onChange: value => updateUser(Object.assign(Object.assign({}, user), { phone: value || null }), 'user.phone'), inputElement: Phone_1.default, phoneWithFlags: phoneWithFlags }),
|
|
67
47
|
errors.phone && (react_1.default.createElement(UserForm_styles_1.ErrorLayout, { "data-test": "invalid-phone" }, mergedErrorMessages.phone)))))));
|
|
68
48
|
};
|
|
69
49
|
exports.default = UserForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserForm.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAkC;AAIlC,gFAAwD;AACxD,uFAA+D;AAE/D,uDAAwD;AACxD,oFAA4D;AAC5D,0CAA2C;AAC3C,uDAAwE;AASxE,MAAM,oBAAoB,GAAuB;IAC/C,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,WAAW;CACnB,CAAC;AAEF,MAAM,sBAAsB,GAAe;IACzC,KAAK,EAAE,0BAA0B;IACjC,SAAS,EACP,uFAAuF;IACzF,QAAQ,EACN,oFAAoF;IACtF,KAAK,EAAE,+BAA+B;CACvC,CAAC;AAaK,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC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AAW,eAAe,IACnC,mBAAmB,CAAC,KAAK,CACd,CACf,CACc,CACb,CACD,CACA,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const UserNameRegex: RegExp;
|
|
2
2
|
export declare const UserSchema: import("yup/lib/object").OptionalObjectSchema<{
|
|
3
|
-
firstName: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
4
|
-
lastName: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
5
|
-
email: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
6
|
-
phone: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
7
|
-
},
|
|
8
|
-
firstName: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
9
|
-
lastName: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
10
|
-
email: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
11
|
-
phone: import("yup/lib/string").RequiredStringSchema<string | undefined,
|
|
3
|
+
firstName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
4
|
+
lastName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
5
|
+
email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
6
|
+
phone: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
7
|
+
}, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<{
|
|
8
|
+
firstName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
9
|
+
lastName: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
10
|
+
email: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
11
|
+
phone: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
12
12
|
}>>;
|
|
@@ -20,21 +20,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
20
20
|
};
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
22
|
exports.UserSchema = exports.UserNameRegex = void 0;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
const email_validator_1 = require("email-validator");
|
|
24
|
+
const react_phone_number_input_1 = require("react-phone-number-input");
|
|
25
|
+
const yup = __importStar(require("yup"));
|
|
26
26
|
exports.UserNameRegex = /^[A-z\u00C0-\u00ff\s]*((-|')*[A-z\u00C0-\u00ff\s])*$/;
|
|
27
|
-
|
|
27
|
+
const UserNameSchema = yup.string().required().min(2).matches(exports.UserNameRegex);
|
|
28
28
|
exports.UserSchema = yup.object({
|
|
29
29
|
firstName: UserNameSchema,
|
|
30
30
|
lastName: UserNameSchema,
|
|
31
31
|
email: yup
|
|
32
32
|
.string()
|
|
33
33
|
.required()
|
|
34
|
-
.test('email', 'email error',
|
|
34
|
+
.test('email', 'email error', value => (0, email_validator_1.validate)(value)),
|
|
35
35
|
phone: yup
|
|
36
36
|
.string()
|
|
37
37
|
.required()
|
|
38
|
-
.test('phone', 'phone error',
|
|
38
|
+
.test('phone', 'phone error', value => (0, react_phone_number_input_1.isValidPhoneNumber)(value))
|
|
39
39
|
});
|
|
40
40
|
//# sourceMappingURL=UserForm.schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.schema.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"UserForm.schema.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA2C;AAC3C,uEAA8D;AAC9D,yCAA2B;AAEd,QAAA,aAAa,GAAG,sDAAsD,CAAC;AAEpF,MAAM,cAAc,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,qBAAa,CAAC,CAAC;AAEhE,QAAA,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC;IACnC,SAAS,EAAE,cAAc;IACzB,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE,GAAG;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAA,0BAAQ,EAAC,KAAe,CAAC,CAAC;IACnE,KAAK,EAAE,GAAG;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAA,6CAAkB,EAAC,KAAe,CAAC,CAAC;CAC9E,CAAC,CAAC"}
|
|
@@ -3,32 +3,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const storybook_state_1 = require("@sambego/storybook-state");
|
|
8
|
+
const react_2 = require("@storybook/react");
|
|
9
|
+
const UserForm_1 = __importDefault(require("./UserForm"));
|
|
10
|
+
const defaultUser = {
|
|
11
11
|
firstName: '',
|
|
12
12
|
lastName: '',
|
|
13
13
|
email: '',
|
|
14
14
|
phone: null,
|
|
15
15
|
customerProfile: null
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
const userState = new storybook_state_1.Store({
|
|
18
18
|
user: defaultUser,
|
|
19
19
|
errors: {}
|
|
20
20
|
});
|
|
21
|
-
react_2.storiesOf('UserForm', module)
|
|
22
|
-
.add('UserForm',
|
|
23
|
-
|
|
24
|
-
userState.set({ user
|
|
21
|
+
(0, react_2.storiesOf)('UserForm', module)
|
|
22
|
+
.add('UserForm', () => {
|
|
23
|
+
const updateUser = (user) => {
|
|
24
|
+
userState.set({ user });
|
|
25
25
|
};
|
|
26
|
-
return (react_1.default.createElement(storybook_state_1.State, { store: userState },
|
|
26
|
+
return (react_1.default.createElement(storybook_state_1.State, { store: userState }, state => (react_1.default.createElement(UserForm_1.default, { user: state.user, errors: state.errors, updateUser: updateUser }))));
|
|
27
27
|
})
|
|
28
|
-
.add('UserForm with flags on Phone',
|
|
29
|
-
|
|
30
|
-
userState.set({ user
|
|
28
|
+
.add('UserForm with flags on Phone', () => {
|
|
29
|
+
const updateUser = (user) => {
|
|
30
|
+
userState.set({ user });
|
|
31
31
|
};
|
|
32
|
-
return (react_1.default.createElement(storybook_state_1.State, { store: userState },
|
|
32
|
+
return (react_1.default.createElement(storybook_state_1.State, { store: userState }, state => (react_1.default.createElement(UserForm_1.default, { user: state.user, errors: state.errors, updateUser: updateUser, phoneWithFlags: true }))));
|
|
33
33
|
});
|
|
34
34
|
//# sourceMappingURL=UserForm.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.stories.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.stories.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"UserForm.stories.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.stories.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAG1B,8DAAwD;AACxD,4CAA6C;AAE7C,0DAAkC;AAElC,MAAM,WAAW,GAAc;IAC7B,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,EAAE;IACT,KAAK,EAAE,IAAI;IACX,eAAe,EAAE,IAAI;CACtB,CAAC;AAEF,MAAM,SAAS,GAAG,IAAI,uBAAK,CAAC;IAC1B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,EAAE;CACX,CAAC,CAAC;AAEH,IAAA,iBAAS,EAAC,UAAU,EAAE,MAAM,CAAC;KAC1B,GAAG,CAAC,UAAU,EAAE,GAAG,EAAE;IACpB,MAAM,UAAU,GAAG,CAAC,IAAe,EAAE,EAAE;QACrC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAK,IAAC,KAAK,EAAE,SAAS,IACpB,KAAK,CAAC,EAAE,CAAC,CACR,8BAAC,kBAAQ,IACP,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,UAAU,EAAE,UAAU,GACtB,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC;KACD,GAAG,CAAC,8BAA8B,EAAE,GAAG,EAAE;IACxC,MAAM,UAAU,GAAG,CAAC,IAAe,EAAE,EAAE;QACrC,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACL,8BAAC,uBAAK,IAAC,KAAK,EAAE,SAAS,IACpB,KAAK,CAAC,EAAE,CAAC,CACR,8BAAC,kBAAQ,IACP,IAAI,EAAE,KAAK,CAAC,IAAI,EAChB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,IAAI,GACpB,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
4
|
};
|
|
9
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
6
|
exports.ErrorLayout = exports.InputWithError = exports.Layout = void 0;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.Layout = styled_components_1.default.div
|
|
14
|
-
exports.InputWithError = styled_components_1.default.div
|
|
15
|
-
exports.ErrorLayout = styled_components_1.default.div
|
|
16
|
-
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
exports.Layout = styled_components_1.default.div ``;
|
|
10
|
+
exports.InputWithError = styled_components_1.default.div ``;
|
|
11
|
+
exports.ErrorLayout = styled_components_1.default.div `
|
|
12
|
+
color: ${utils_1.colors.red.base};
|
|
13
|
+
margin-top: ${(0, utils_1.convertPxToRem)(8)};
|
|
14
|
+
font-size: ${utils_1.fonts.small};
|
|
15
|
+
`;
|
|
17
16
|
//# sourceMappingURL=UserForm.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserForm.styles.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserForm.styles.js","sourceRoot":"","sources":["../../../../packages/forms/src/userForm/UserForm.styles.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAuC;AAEvC,0CAA+D;AAElD,QAAA,MAAM,GAAG,2BAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAEtB,QAAA,cAAc,GAAG,2BAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9B,QAAA,WAAW,GAAG,2BAAM,CAAC,GAAG,CAAA;WAC1B,cAAM,CAAC,GAAG,CAAC,IAAI;gBACV,IAAA,sBAAc,EAAC,CAAC,CAAC;eAClB,aAAK,CAAC,KAAK;CACzB,CAAC"}
|