@proprioo/salatim 18.6.2 → 19.3.1
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 +22 -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 +2636 -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.d.ts +4 -13
- package/lib/ui/src/gmapsAutoComplete/GmapsAutocomplete.js +33 -73
- 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 +5 -7
- package/lib/ui/src/gmapsGeocode/GmapsGeocode.js +23 -66
- 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 +238 -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 +11 -0
- package/lib/utils/src/gmaps.js +30 -18
- package/lib/utils/src/gmaps.js.map +1 -1
- package/lib/utils/src/gmaps.test.js +70 -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.d.ts +2 -0
- package/lib/utils/src/paragraphs.js +92 -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 +29 -27
- package/lib/utils/src/utils.stories.js.map +1 -1
- package/lib/utils/src/utils.styles.d.ts +2 -0
- package/lib/utils/src/utils.styles.js +192 -56
- package/lib/utils/src/utils.styles.js.map +1 -1
- package/package.json +50 -56
|
@@ -8,83 +8,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
13
|
};
|
|
41
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
describe('Tooltip',
|
|
47
|
-
it('should render component',
|
|
48
|
-
react_2.render(react_1.default.createElement(Tooltip_1.default, { tooltip: "tooltip content" }, "Hover me"));
|
|
15
|
+
const react_1 = __importDefault(require("react"));
|
|
16
|
+
const react_2 = require("@testing-library/react");
|
|
17
|
+
const user_event_1 = __importDefault(require("@testing-library/user-event"));
|
|
18
|
+
const Tooltip_1 = __importDefault(require("./Tooltip"));
|
|
19
|
+
describe('Tooltip', () => {
|
|
20
|
+
it('should render component', () => {
|
|
21
|
+
(0, react_2.render)(react_1.default.createElement(Tooltip_1.default, { tooltip: "tooltip content" }, "Hover me"));
|
|
49
22
|
expect(react_2.screen.getByTestId('tooltip-wrapped-component')).toBeInTheDocument();
|
|
50
23
|
expect(react_2.screen.getByTestId('tooltip-wrapped-component')).toHaveTextContent('Hover me');
|
|
51
24
|
});
|
|
52
|
-
it('should trigger tooltip',
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
}); });
|
|
70
|
-
it('should render disabled component', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
71
|
-
var MockComponent;
|
|
72
|
-
return __generator(this, function (_a) {
|
|
73
|
-
switch (_a.label) {
|
|
74
|
-
case 0:
|
|
75
|
-
MockComponent = function () { return (react_1.default.createElement("div", { "data-test": "mock-component" }, "mock me, i'm serious")); };
|
|
76
|
-
react_2.render(react_1.default.createElement(Tooltip_1.default, { tooltip: react_1.default.createElement(MockComponent, null), trigger: 'click', isVisible: false }, "Hover me"));
|
|
77
|
-
expect(react_2.screen.getByTestId('tooltip-wrapped-component')).toBeInTheDocument();
|
|
78
|
-
expect(react_2.screen.queryByTestId('mock-component')).not.toBeInTheDocument();
|
|
79
|
-
user_event_1.default.click(react_2.screen.getByTestId('tooltip-wrapped-component'));
|
|
80
|
-
return [4 /*yield*/, react_2.waitFor(function () {
|
|
81
|
-
return expect(react_2.screen.queryByTestId('mock-component')).not.toBeInTheDocument();
|
|
82
|
-
})];
|
|
83
|
-
case 1:
|
|
84
|
-
_a.sent();
|
|
85
|
-
return [2 /*return*/];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}); });
|
|
25
|
+
it('should trigger tooltip', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
+
const MockComponent = () => (react_1.default.createElement("div", { "data-test": "mock-component" }, "mock me, i'm serious"));
|
|
27
|
+
(0, react_2.render)(react_1.default.createElement(Tooltip_1.default, { tooltip: react_1.default.createElement(MockComponent, null), trigger: 'click' }, "Hover me"));
|
|
28
|
+
expect(react_2.screen.getByTestId('tooltip-wrapped-component')).toBeInTheDocument();
|
|
29
|
+
user_event_1.default.click(react_2.screen.getByTestId('tooltip-wrapped-component'));
|
|
30
|
+
yield (0, react_2.waitFor)(() => expect(react_2.screen.getByTestId('mock-component')).toBeInTheDocument());
|
|
31
|
+
}));
|
|
32
|
+
it('should render disabled component', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
33
|
+
const MockComponent = () => (react_1.default.createElement("div", { "data-test": "mock-component" }, "mock me, i'm serious"));
|
|
34
|
+
(0, react_2.render)(react_1.default.createElement(Tooltip_1.default, { tooltip: react_1.default.createElement(MockComponent, null), trigger: 'click', isVisible: false }, "Hover me"));
|
|
35
|
+
expect(react_2.screen.getByTestId('tooltip-wrapped-component')).toBeInTheDocument();
|
|
36
|
+
expect(react_2.screen.queryByTestId('mock-component')).not.toBeInTheDocument();
|
|
37
|
+
user_event_1.default.click(react_2.screen.getByTestId('tooltip-wrapped-component'));
|
|
38
|
+
yield (0, react_2.waitFor)(() => expect(react_2.screen.queryByTestId('mock-component')).not.toBeInTheDocument());
|
|
39
|
+
}));
|
|
89
40
|
});
|
|
90
41
|
//# sourceMappingURL=Tooltip.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../../../packages/ui/src/tooltip/Tooltip.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.test.js","sourceRoot":"","sources":["../../../../packages/ui/src/tooltip/Tooltip.test.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAE1B,kDAAiE;AACjE,6EAAoD;AAEpD,wDAAgC;AAEhC,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,IAAA,cAAM,EAAC,8BAAC,iBAAO,IAAC,OAAO,EAAC,iBAAiB,eAAmB,CAAC,CAAC;QAE9D,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC5E,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,CACvE,UAAU,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAS,EAAE;QACtC,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC1B,oDAAe,gBAAgB,2BAA2B,CAC3D,CAAC;QAEF,IAAA,cAAM,EACJ,8BAAC,iBAAO,IAAC,OAAO,EAAE,8BAAC,aAAa,OAAG,EAAE,OAAO,EAAE,OAAO,eAE3C,CACX,CAAC;QAEF,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAE5E,oBAAS,CAAC,KAAK,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACjE,MAAM,IAAA,eAAO,EAAC,GAAG,EAAE,CACjB,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,EAAE,CACjE,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,kCAAkC,EAAE,GAAS,EAAE;QAChD,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,CAC1B,oDAAe,gBAAgB,2BAA2B,CAC3D,CAAC;QAEF,IAAA,cAAM,EACJ,8BAAC,iBAAO,IAAC,OAAO,EAAE,8BAAC,aAAa,OAAG,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,eAE7D,CACX,CAAC;QAEF,MAAM,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAC;QAC5E,MAAM,CAAC,cAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC;QAEvE,oBAAS,CAAC,KAAK,CAAC,cAAM,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,CAAC;QACjE,MAAM,IAAA,eAAO,EAAC,GAAG,EAAE,CACjB,MAAM,CAAC,cAAM,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,iBAAiB,EAAE,CACvE,CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/utils/src/actions.js
CHANGED
|
@@ -5,9 +5,9 @@ exports.createAction = void 0;
|
|
|
5
5
|
* Create an action with no payload
|
|
6
6
|
*/
|
|
7
7
|
function createAction(actionType) {
|
|
8
|
-
return
|
|
8
|
+
return () => ({
|
|
9
9
|
type: actionType
|
|
10
|
-
});
|
|
10
|
+
});
|
|
11
11
|
}
|
|
12
12
|
exports.createAction = createAction;
|
|
13
13
|
//# sourceMappingURL=actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../packages/utils/src/actions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,YAAY,CAC1B,UAAsB;IAEtB,OAAO,
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../packages/utils/src/actions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,SAAgB,YAAY,CAC1B,UAAsB;IAEtB,OAAO,GAAsC,EAAE,CAAC,CAAC;QAC/C,IAAI,EAAE,UAAU;KACjB,CAAC,CAAC;AACL,CAAC;AAND,oCAMC"}
|
package/lib/utils/src/colors.js
CHANGED
|
@@ -1,40 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateColorRange = exports.transparentize = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
var _a = polished_1.parseToRgb(polished_1.rgba(hexa, alpha)), red = _a.red, green = _a.green, blue = _a.blue;
|
|
10
|
-
return polished_1.toColorString({
|
|
4
|
+
const polished_1 = require("polished");
|
|
5
|
+
const getCorrectedColor = (colorValue, alpha) => Math.round((1 - alpha) * 255 + alpha * colorValue);
|
|
6
|
+
const transparentize = (hexa, alpha) => {
|
|
7
|
+
const { red, green, blue } = (0, polished_1.parseToRgb)((0, polished_1.rgba)(hexa, alpha));
|
|
8
|
+
return (0, polished_1.toColorString)({
|
|
11
9
|
red: getCorrectedColor(red, alpha),
|
|
12
10
|
green: getCorrectedColor(green, alpha),
|
|
13
11
|
blue: getCorrectedColor(blue, alpha)
|
|
14
12
|
});
|
|
15
13
|
};
|
|
16
14
|
exports.transparentize = transparentize;
|
|
17
|
-
|
|
15
|
+
const generateColorRange = (hexa) => ({
|
|
18
16
|
base: hexa,
|
|
19
|
-
base80: exports.transparentize(hexa, 0.8),
|
|
20
|
-
base60: exports.transparentize(hexa, 0.6),
|
|
21
|
-
base40: exports.transparentize(hexa, 0.4),
|
|
22
|
-
base20: exports.transparentize(hexa, 0.2),
|
|
23
|
-
base10: exports.transparentize(hexa, 0.1),
|
|
24
|
-
base5: exports.transparentize(hexa, 0.05)
|
|
25
|
-
});
|
|
17
|
+
base80: (0, exports.transparentize)(hexa, 0.8),
|
|
18
|
+
base60: (0, exports.transparentize)(hexa, 0.6),
|
|
19
|
+
base40: (0, exports.transparentize)(hexa, 0.4),
|
|
20
|
+
base20: (0, exports.transparentize)(hexa, 0.2),
|
|
21
|
+
base10: (0, exports.transparentize)(hexa, 0.1),
|
|
22
|
+
base5: (0, exports.transparentize)(hexa, 0.05)
|
|
23
|
+
});
|
|
26
24
|
exports.generateColorRange = generateColorRange;
|
|
27
25
|
exports.default = {
|
|
28
|
-
dark: exports.generateColorRange('#1B1B1B'),
|
|
29
|
-
grey: exports.generateColorRange('#8C8C8C'),
|
|
30
|
-
green: exports.generateColorRange('#003824'),
|
|
31
|
-
greenAlt: exports.generateColorRange('#06422C'),
|
|
32
|
-
greenLight: exports.generateColorRange('#2AECBD'),
|
|
33
|
-
orange: exports.generateColorRange('#EC5E2A'),
|
|
34
|
-
pink: exports.generateColorRange('#FFCDC2'),
|
|
35
|
-
yellow: exports.generateColorRange('#DAA73C'),
|
|
36
|
-
red: exports.generateColorRange('#E82929'),
|
|
37
|
-
blue: exports.generateColorRange('#C5E3F9'),
|
|
26
|
+
dark: (0, exports.generateColorRange)('#1B1B1B'),
|
|
27
|
+
grey: (0, exports.generateColorRange)('#8C8C8C'),
|
|
28
|
+
green: (0, exports.generateColorRange)('#003824'),
|
|
29
|
+
greenAlt: (0, exports.generateColorRange)('#06422C'),
|
|
30
|
+
greenLight: (0, exports.generateColorRange)('#2AECBD'),
|
|
31
|
+
orange: (0, exports.generateColorRange)('#EC5E2A'),
|
|
32
|
+
pink: (0, exports.generateColorRange)('#FFCDC2'),
|
|
33
|
+
yellow: (0, exports.generateColorRange)('#DAA73C'),
|
|
34
|
+
red: (0, exports.generateColorRange)('#E82929'),
|
|
35
|
+
blue: (0, exports.generateColorRange)('#C5E3F9'),
|
|
38
36
|
background: '#FFFFFF'
|
|
39
37
|
};
|
|
40
38
|
//# sourceMappingURL=colors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../packages/utils/src/colors.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../../../packages/utils/src/colors.ts"],"names":[],"mappings":";;;AAAA,uCAA2D;AAE3D,MAAM,iBAAiB,GAAG,CAAC,UAAkB,EAAE,KAAa,EAAE,EAAE,CAC9D,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,UAAU,CAAC,CAAC;AAE9C,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE;IAC5D,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAA,qBAAU,EAAC,IAAA,eAAI,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IAC3D,OAAO,IAAA,wBAAa,EAAC;QACnB,GAAG,EAAE,iBAAiB,CAAC,GAAG,EAAE,KAAK,CAAC;QAClC,KAAK,EAAE,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC;QACtC,IAAI,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,CAAC;KACrC,CAAC,CAAC;AACL,CAAC,CAAC;AAPW,QAAA,cAAc,kBAOzB;AAEK,MAAM,kBAAkB,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC;IACnD,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,GAAG,CAAC;IACjC,MAAM,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,GAAG,CAAC;IACjC,MAAM,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,GAAG,CAAC;IACjC,MAAM,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,GAAG,CAAC;IACjC,MAAM,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,GAAG,CAAC;IACjC,KAAK,EAAE,IAAA,sBAAc,EAAC,IAAI,EAAE,IAAI,CAAC;CAClC,CAAC,CAAC;AARU,QAAA,kBAAkB,sBAQ5B;AAEH,kBAAe;IACb,IAAI,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACnC,IAAI,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACnC,KAAK,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACpC,QAAQ,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACvC,UAAU,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACzC,MAAM,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACrC,IAAI,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACnC,MAAM,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACrC,GAAG,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IAClC,IAAI,EAAE,IAAA,0BAAkB,EAAC,SAAS,CAAC;IACnC,UAAU,EAAE,SAAS;CACtB,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
describe('transparentize',
|
|
5
|
-
it('should return hexa color',
|
|
6
|
-
expect(colors_1.transparentize('#2e4053', 0.8)).toEqual('#586675');
|
|
7
|
-
expect(colors_1.transparentize('#2e4053', 0.6)).toEqual('#828c98');
|
|
8
|
-
expect(colors_1.transparentize('#2e4053', 0.4)).toEqual('#abb3ba');
|
|
9
|
-
expect(colors_1.transparentize('#2e4053', 0.2)).toEqual('#d5d9dd');
|
|
3
|
+
const colors_1 = require("./colors");
|
|
4
|
+
describe('transparentize', () => {
|
|
5
|
+
it('should return hexa color', () => {
|
|
6
|
+
expect((0, colors_1.transparentize)('#2e4053', 0.8)).toEqual('#586675');
|
|
7
|
+
expect((0, colors_1.transparentize)('#2e4053', 0.6)).toEqual('#828c98');
|
|
8
|
+
expect((0, colors_1.transparentize)('#2e4053', 0.4)).toEqual('#abb3ba');
|
|
9
|
+
expect((0, colors_1.transparentize)('#2e4053', 0.2)).toEqual('#d5d9dd');
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=colors.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.test.js","sourceRoot":"","sources":["../../../packages/utils/src/colors.test.tsx"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"colors.test.js","sourceRoot":"","sources":["../../../packages/utils/src/colors.test.tsx"],"names":[],"mappings":";;AAAA,qCAA0C;AAE1C,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE;QAClC,MAAM,CAAC,IAAA,uBAAc,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAA,uBAAc,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAA,uBAAc,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAC1D,MAAM,CAAC,IAAA,uBAAc,EAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,17 +1,29 @@
|
|
|
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.Container = void 0;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
exports.Container = styled_components_1.default.div
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const breakpoints_1 = __importDefault(require("./breakpoints"));
|
|
9
|
+
const spacing_1 = require("./spacing");
|
|
10
|
+
exports.Container = styled_components_1.default.div `
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
padding: 0 ${(0, spacing_1.convertPxToRem)(16)};
|
|
14
|
+
max-width: ${(0, spacing_1.convertPxToRem)(breakpoints_1.default.large)};
|
|
15
|
+
|
|
16
|
+
@media (min-width: ${breakpoints_1.default.xsmall}px) {
|
|
17
|
+
padding: 0 ${(0, spacing_1.convertPxToRem)(24)};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: ${breakpoints_1.default.small}px) {
|
|
21
|
+
padding: 0 ${(0, spacing_1.convertPxToRem)(40)};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (min-width: ${breakpoints_1.default.normal}px) {
|
|
25
|
+
padding: 0 ${(0, spacing_1.convertPxToRem)(80)};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
15
28
|
exports.default = exports.Container;
|
|
16
|
-
var templateObject_1;
|
|
17
29
|
//# sourceMappingURL=container.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../packages/utils/src/container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../../../packages/utils/src/container.ts"],"names":[],"mappings":";;;;;;AAAA,0EAAuC;AAEvC,gEAAwC;AACxC,uCAA2C;AAE9B,QAAA,SAAS,GAAG,2BAAM,CAAC,GAAG,CAAA;;;eAGpB,IAAA,wBAAc,EAAC,EAAE,CAAC;eAClB,IAAA,wBAAc,EAAC,qBAAW,CAAC,KAAK,CAAC;;uBAEzB,qBAAW,CAAC,MAAM;iBACxB,IAAA,wBAAc,EAAC,EAAE,CAAC;;;uBAGZ,qBAAW,CAAC,KAAK;iBACvB,IAAA,wBAAc,EAAC,EAAE,CAAC;;;uBAGZ,qBAAW,CAAC,MAAM;iBACxB,IAAA,wBAAc,EAAC,EAAE,CAAC;;CAElC,CAAC;AAEF,kBAAe,iBAAS,CAAC"}
|
package/lib/utils/src/fonts.js
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
3
|
exports.IntegralCFFont = exports.ArchivoFont = void 0;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.ArchivoFont = styled_components_1.css
|
|
11
|
-
|
|
4
|
+
const styled_components_1 = require("styled-components");
|
|
5
|
+
const spacing_1 = require("./spacing");
|
|
6
|
+
exports.ArchivoFont = (0, styled_components_1.css) `
|
|
7
|
+
font-family: Archivo, sans-serif;
|
|
8
|
+
`;
|
|
9
|
+
exports.IntegralCFFont = (0, styled_components_1.css) `
|
|
10
|
+
font-family: 'Integral CF', sans-serif;
|
|
11
|
+
`;
|
|
12
12
|
exports.default = {
|
|
13
|
-
important: spacing_1.convertPxToRem(48),
|
|
14
|
-
xbiggest: spacing_1.convertPxToRem(42),
|
|
15
|
-
biggest: spacing_1.convertPxToRem(40),
|
|
16
|
-
bigger: spacing_1.convertPxToRem(32),
|
|
17
|
-
big: spacing_1.convertPxToRem(24),
|
|
18
|
-
medium: spacing_1.convertPxToRem(18),
|
|
19
|
-
base: spacing_1.convertPxToRem(16),
|
|
20
|
-
small: spacing_1.convertPxToRem(14),
|
|
21
|
-
smaller: spacing_1.convertPxToRem(13),
|
|
22
|
-
smallest: spacing_1.convertPxToRem(12)
|
|
13
|
+
important: (0, spacing_1.convertPxToRem)(48),
|
|
14
|
+
xbiggest: (0, spacing_1.convertPxToRem)(42),
|
|
15
|
+
biggest: (0, spacing_1.convertPxToRem)(40),
|
|
16
|
+
bigger: (0, spacing_1.convertPxToRem)(32),
|
|
17
|
+
big: (0, spacing_1.convertPxToRem)(24),
|
|
18
|
+
medium: (0, spacing_1.convertPxToRem)(18),
|
|
19
|
+
base: (0, spacing_1.convertPxToRem)(16),
|
|
20
|
+
small: (0, spacing_1.convertPxToRem)(14),
|
|
21
|
+
smaller: (0, spacing_1.convertPxToRem)(13),
|
|
22
|
+
smallest: (0, spacing_1.convertPxToRem)(12)
|
|
23
23
|
};
|
|
24
|
-
var templateObject_1, templateObject_2;
|
|
25
24
|
//# sourceMappingURL=fonts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../packages/utils/src/fonts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fonts.js","sourceRoot":"","sources":["../../../packages/utils/src/fonts.ts"],"names":[],"mappings":";;;AAAA,yDAAwC;AAExC,uCAA2C;AAE9B,QAAA,WAAW,GAAG,IAAA,uBAAG,EAAA;;CAE7B,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,uBAAG,EAAA;;CAEhC,CAAC;AAEF,kBAAe;IACb,SAAS,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC7B,QAAQ,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC5B,OAAO,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC3B,MAAM,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC1B,GAAG,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IACvB,MAAM,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC1B,IAAI,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IACxB,KAAK,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IACzB,OAAO,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;IAC3B,QAAQ,EAAE,IAAA,wBAAc,EAAC,EAAE,CAAC;CAC7B,CAAC"}
|
package/lib/utils/src/gmaps.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="googlemaps" />
|
|
2
|
+
/// <reference types="google.maps" />
|
|
3
|
+
import { Suggestion } from 'react-places-autocomplete';
|
|
2
4
|
export declare const POSTAL_CODE: string;
|
|
3
5
|
export declare const LOCALITY: string;
|
|
4
6
|
export declare const STREET_NUMBER: string;
|
|
@@ -19,5 +21,14 @@ export interface GeocoderResultFormatted {
|
|
|
19
21
|
street: GeocoderType;
|
|
20
22
|
streetNumber: GeocoderType;
|
|
21
23
|
}
|
|
24
|
+
export declare enum GoogleSearchType {
|
|
25
|
+
ADMINISTRATIVE_AREA_LEVEL_1 = "administrative_area_level_1",
|
|
26
|
+
ADMINISTRATIVE_AREA_LEVEL_2 = "administrative_area_level_2",
|
|
27
|
+
LOCALITY = "locality",
|
|
28
|
+
NEIGHBORHOOD = "neighborhood",
|
|
29
|
+
POSTAL_CODE = "postal_code",
|
|
30
|
+
SUBLOCALITY = "sublocality"
|
|
31
|
+
}
|
|
22
32
|
export declare const getAddressComponent: (addressComponents: GeocoderAddressComponent[], componentType: string) => GeocoderType;
|
|
23
33
|
export declare const getFormattedAddressComponent: ({ address_components, formatted_address, geometry }: GeocoderResult) => GeocoderResultFormatted;
|
|
34
|
+
export declare const getGeoSearchSuggestions: (suggestions: Suggestion[]) => Suggestion[];
|
package/lib/utils/src/gmaps.js
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFormattedAddressComponent = exports.getAddressComponent = exports.POSTAL_TOWN = exports.STREET = exports.STREET_NUMBER = exports.LOCALITY = exports.POSTAL_CODE = void 0;
|
|
3
|
+
exports.getGeoSearchSuggestions = exports.getFormattedAddressComponent = exports.getAddressComponent = exports.GoogleSearchType = exports.POSTAL_TOWN = exports.STREET = exports.STREET_NUMBER = exports.LOCALITY = exports.POSTAL_CODE = void 0;
|
|
4
4
|
exports.POSTAL_CODE = 'postal_code';
|
|
5
5
|
exports.LOCALITY = 'locality';
|
|
6
6
|
exports.STREET_NUMBER = 'street_number';
|
|
7
7
|
exports.STREET = 'route';
|
|
8
8
|
exports.POSTAL_TOWN = 'postal_town';
|
|
9
|
-
var
|
|
9
|
+
var GoogleSearchType;
|
|
10
|
+
(function (GoogleSearchType) {
|
|
11
|
+
GoogleSearchType["ADMINISTRATIVE_AREA_LEVEL_1"] = "administrative_area_level_1";
|
|
12
|
+
GoogleSearchType["ADMINISTRATIVE_AREA_LEVEL_2"] = "administrative_area_level_2";
|
|
13
|
+
GoogleSearchType["LOCALITY"] = "locality";
|
|
14
|
+
GoogleSearchType["NEIGHBORHOOD"] = "neighborhood";
|
|
15
|
+
GoogleSearchType["POSTAL_CODE"] = "postal_code";
|
|
16
|
+
GoogleSearchType["SUBLOCALITY"] = "sublocality"; // submunicipality
|
|
17
|
+
})(GoogleSearchType = exports.GoogleSearchType || (exports.GoogleSearchType = {}));
|
|
18
|
+
const getAddressComponent = (addressComponents, componentType) => {
|
|
10
19
|
if (addressComponents.length > 0) {
|
|
11
|
-
|
|
12
|
-
var types = _a.types;
|
|
13
|
-
return types[0] === componentType;
|
|
14
|
-
});
|
|
20
|
+
const addressComponent = addressComponents.filter(({ types }) => types[0] === componentType);
|
|
15
21
|
if (addressComponent.length === 0) {
|
|
16
22
|
return null;
|
|
17
23
|
}
|
|
@@ -20,17 +26,23 @@ var getAddressComponent = function (addressComponents, componentType) {
|
|
|
20
26
|
return null;
|
|
21
27
|
};
|
|
22
28
|
exports.getAddressComponent = getAddressComponent;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.getAddressComponent(address_components, exports.POSTAL_TOWN)
|
|
33
|
-
});
|
|
34
|
-
};
|
|
29
|
+
const getFormattedAddressComponent = ({ address_components, formatted_address, geometry }) => ({
|
|
30
|
+
address: formatted_address,
|
|
31
|
+
location: geometry.location.toJSON(),
|
|
32
|
+
postalCode: (0, exports.getAddressComponent)(address_components, exports.POSTAL_CODE),
|
|
33
|
+
street: (0, exports.getAddressComponent)(address_components, exports.STREET),
|
|
34
|
+
streetNumber: (0, exports.getAddressComponent)(address_components, exports.STREET_NUMBER),
|
|
35
|
+
city: (0, exports.getAddressComponent)(address_components, exports.LOCALITY) ||
|
|
36
|
+
(0, exports.getAddressComponent)(address_components, exports.POSTAL_TOWN)
|
|
37
|
+
});
|
|
35
38
|
exports.getFormattedAddressComponent = getFormattedAddressComponent;
|
|
39
|
+
const getGeoSearchSuggestions = (suggestions) => suggestions.filter(({ types }) => types.some(type => [
|
|
40
|
+
GoogleSearchType.ADMINISTRATIVE_AREA_LEVEL_1,
|
|
41
|
+
GoogleSearchType.ADMINISTRATIVE_AREA_LEVEL_2,
|
|
42
|
+
GoogleSearchType.LOCALITY,
|
|
43
|
+
GoogleSearchType.NEIGHBORHOOD,
|
|
44
|
+
GoogleSearchType.POSTAL_CODE,
|
|
45
|
+
GoogleSearchType.SUBLOCALITY
|
|
46
|
+
].includes(type)));
|
|
47
|
+
exports.getGeoSearchSuggestions = getGeoSearchSuggestions;
|
|
36
48
|
//# sourceMappingURL=gmaps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmaps.js","sourceRoot":"","sources":["../../../packages/utils/src/gmaps.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"gmaps.js","sourceRoot":"","sources":["../../../packages/utils/src/gmaps.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAW,aAAa,CAAC;AACpC,QAAA,QAAQ,GAAW,UAAU,CAAC;AAC9B,QAAA,aAAa,GAAW,eAAe,CAAC;AACxC,QAAA,MAAM,GAAW,OAAO,CAAC;AACzB,QAAA,WAAW,GAAW,aAAa,CAAC;AAoBjD,IAAY,gBAOX;AAPD,WAAY,gBAAgB;IAC1B,+EAA2D,CAAA;IAC3D,+EAA2D,CAAA;IAC3D,yCAAqB,CAAA;IACrB,iDAA6B,CAAA;IAC7B,+CAA2B,CAAA;IAC3B,+CAA2B,CAAA,CAAC,kBAAkB;AAChD,CAAC,EAPW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAO3B;AAEM,MAAM,mBAAmB,GAAG,CACjC,iBAA6C,EAC7C,aAAqB,EACP,EAAE;IAChB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;QAChC,MAAM,gBAAgB,GACpB,iBAAiB,CAAC,MAAM,CACtB,CAAC,EAAE,KAAK,EAA4B,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,aAAa,CACpE,CAAC;QAEJ,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE;YACjC,OAAO,IAAI,CAAC;SACb;QACD,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC;KAC5B;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAhBW,QAAA,mBAAmB,uBAgB9B;AAEK,MAAM,4BAA4B,GAAG,CAAC,EAC3C,kBAAkB,EAClB,iBAAiB,EACjB,QAAQ,EACO,EAA2B,EAAE,CAAC,CAAC;IAC9C,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE;IACpC,UAAU,EAAE,IAAA,2BAAmB,EAAC,kBAAkB,EAAE,mBAAW,CAAC;IAChE,MAAM,EAAE,IAAA,2BAAmB,EAAC,kBAAkB,EAAE,cAAM,CAAC;IACvD,YAAY,EAAE,IAAA,2BAAmB,EAAC,kBAAkB,EAAE,qBAAa,CAAC;IACpE,IAAI,EACF,IAAA,2BAAmB,EAAC,kBAAkB,EAAE,gBAAQ,CAAC;QACjD,IAAA,2BAAmB,EAAC,kBAAkB,EAAE,mBAAW,CAAC;CACvD,CAAC,CAAC;AAbU,QAAA,4BAA4B,gCAatC;AAEI,MAAM,uBAAuB,GAAG,CACrC,WAAyB,EACX,EAAE,CAChB,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAC/B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB;IACE,gBAAgB,CAAC,2BAA2B;IAC5C,gBAAgB,CAAC,2BAA2B;IAC5C,gBAAgB,CAAC,QAAQ;IACzB,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,WAAW;IAC5B,gBAAgB,CAAC,WAAW;CAC7B,CAAC,QAAQ,CAAC,IAAwB,CAAC,CACrC,CACF,CAAC;AAdS,QAAA,uBAAuB,2BAchC"}
|
|
@@ -1,25 +1,7 @@
|
|
|
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
|
-
var __spreadArrays = (this && this.__spreadArrays) || function () {
|
|
14
|
-
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
15
|
-
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
16
|
-
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
17
|
-
r[k] = a[j];
|
|
18
|
-
return r;
|
|
19
|
-
};
|
|
20
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
const gmaps_1 = require("./gmaps");
|
|
4
|
+
const defaultPlace = {
|
|
23
5
|
address_components: [
|
|
24
6
|
{ long_name: '16', short_name: '16', types: ['street_number'] },
|
|
25
7
|
{
|
|
@@ -53,24 +35,65 @@ var defaultPlace = {
|
|
|
53
35
|
viewport: new google.maps.LatLngBounds()
|
|
54
36
|
}
|
|
55
37
|
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
38
|
+
const MOCK_SUGGESTIONS = [
|
|
39
|
+
{
|
|
40
|
+
description: '3ème Arrondissement, Paris, France',
|
|
41
|
+
placeId: 'ChIJw0-tXgRu5kcRcBqUaMOCCwU',
|
|
42
|
+
active: true,
|
|
43
|
+
index: 0,
|
|
44
|
+
formattedSuggestion: {
|
|
45
|
+
mainText: '3ème Arrondissement',
|
|
46
|
+
secondaryText: 'Paris, France'
|
|
47
|
+
},
|
|
48
|
+
matchedSubstrings: [
|
|
49
|
+
{ length: 4, offset: 0 },
|
|
50
|
+
{ length: 5, offset: 21 }
|
|
51
|
+
],
|
|
52
|
+
terms: [
|
|
53
|
+
{ offset: 0, value: '3ème Arrondissement' },
|
|
54
|
+
{ offset: 21, value: 'Paris' },
|
|
55
|
+
{ offset: 28, value: 'France' }
|
|
56
|
+
],
|
|
57
|
+
types: ['sublocality_level_1', 'sublocality', 'political', 'geocode'],
|
|
58
|
+
id: '1'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
description: 'Boulevard de Paris, Marseille, France',
|
|
62
|
+
placeId: 'EiVCb3VsZXZhcmQgZGUgUGFyaXMsIE1hcnNlaWxsZSwgRnJhbmNlIi4qLAoUChIJWeqhb_LAyRIR4ujo6puCeXoSFAoSCTNT2kRDv8kSESACl_2lGQgE',
|
|
63
|
+
active: false,
|
|
64
|
+
index: 1,
|
|
65
|
+
formattedSuggestion: {
|
|
66
|
+
mainText: 'Boulevard de Paris',
|
|
67
|
+
secondaryText: 'Marseille, France'
|
|
68
|
+
},
|
|
69
|
+
matchedSubstrings: [{ length: 5, offset: 13 }],
|
|
70
|
+
terms: [
|
|
71
|
+
{ offset: 0, value: 'Boulevard de Paris' },
|
|
72
|
+
{ offset: 20, value: 'Marseille' },
|
|
73
|
+
{ offset: 31, value: 'France' }
|
|
74
|
+
],
|
|
75
|
+
types: ['route', 'geocode'],
|
|
76
|
+
id: '1'
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
describe('getAddressComponent', () => {
|
|
80
|
+
it('should return null on empty address components', () => {
|
|
81
|
+
expect((0, gmaps_1.getAddressComponent)([], gmaps_1.STREET)).toEqual(null);
|
|
59
82
|
});
|
|
60
|
-
it('should return null with not found component',
|
|
61
|
-
expect(gmaps_1.getAddressComponent(defaultPlace.address_components, 'appartement')).toEqual(null);
|
|
83
|
+
it('should return null with not found component', () => {
|
|
84
|
+
expect((0, gmaps_1.getAddressComponent)(defaultPlace.address_components, 'appartement')).toEqual(null);
|
|
62
85
|
});
|
|
63
|
-
it('should return component type',
|
|
64
|
-
expect(gmaps_1.getAddressComponent(defaultPlace.address_components, gmaps_1.STREET)).toEqual({
|
|
86
|
+
it('should return component type', () => {
|
|
87
|
+
expect((0, gmaps_1.getAddressComponent)(defaultPlace.address_components, gmaps_1.STREET)).toEqual({
|
|
65
88
|
long_name: 'Rue de la Banque',
|
|
66
89
|
short_name: 'Rue de la Banque',
|
|
67
90
|
types: ['route']
|
|
68
91
|
});
|
|
69
92
|
});
|
|
70
93
|
});
|
|
71
|
-
describe('getFormattedAddressComponent',
|
|
72
|
-
it('should return object',
|
|
73
|
-
expect(gmaps_1.getFormattedAddressComponent(defaultPlace)).toEqual({
|
|
94
|
+
describe('getFormattedAddressComponent', () => {
|
|
95
|
+
it('should return object', () => {
|
|
96
|
+
expect((0, gmaps_1.getFormattedAddressComponent)(defaultPlace)).toEqual({
|
|
74
97
|
address: '16 Rue de la Banque, 75002 Paris, France',
|
|
75
98
|
city: {
|
|
76
99
|
long_name: 'Paris',
|
|
@@ -95,10 +118,10 @@ describe('getFormattedAddressComponent', function () {
|
|
|
95
118
|
}
|
|
96
119
|
});
|
|
97
120
|
});
|
|
98
|
-
it('should return null street_number',
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
expect(gmaps_1.getFormattedAddressComponent(place)).toEqual({
|
|
121
|
+
it('should return null street_number', () => {
|
|
122
|
+
const [, ...rest] = defaultPlace.address_components;
|
|
123
|
+
const place = Object.assign(Object.assign({}, defaultPlace), { address_components: rest });
|
|
124
|
+
expect((0, gmaps_1.getFormattedAddressComponent)(place)).toEqual({
|
|
102
125
|
address: '16 Rue de la Banque, 75002 Paris, France',
|
|
103
126
|
city: {
|
|
104
127
|
long_name: 'Paris',
|
|
@@ -119,19 +142,17 @@ describe('getFormattedAddressComponent', function () {
|
|
|
119
142
|
streetNumber: null
|
|
120
143
|
});
|
|
121
144
|
});
|
|
122
|
-
it('should fallback to postal_town when no locality is returned',
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
});
|
|
127
|
-
var place = __assign(__assign({}, defaultPlace), { address_components: __spreadArrays(components, [
|
|
145
|
+
it('should fallback to postal_town when no locality is returned', () => {
|
|
146
|
+
const components = defaultPlace.address_components.filter(({ types }) => !types.includes(gmaps_1.LOCALITY));
|
|
147
|
+
const place = Object.assign(Object.assign({}, defaultPlace), { address_components: [
|
|
148
|
+
...components,
|
|
128
149
|
{
|
|
129
150
|
long_name: 'Paris',
|
|
130
151
|
short_name: 'Paris',
|
|
131
152
|
types: [gmaps_1.POSTAL_TOWN]
|
|
132
153
|
}
|
|
133
|
-
]
|
|
134
|
-
expect(gmaps_1.getFormattedAddressComponent(place)).toEqual({
|
|
154
|
+
] });
|
|
155
|
+
expect((0, gmaps_1.getFormattedAddressComponent)(place)).toEqual({
|
|
135
156
|
address: '16 Rue de la Banque, 75002 Paris, France',
|
|
136
157
|
city: {
|
|
137
158
|
long_name: 'Paris',
|
|
@@ -157,4 +178,11 @@ describe('getFormattedAddressComponent', function () {
|
|
|
157
178
|
});
|
|
158
179
|
});
|
|
159
180
|
});
|
|
181
|
+
describe('getGeoSearchSuggestions', () => {
|
|
182
|
+
it('should return only accepted types', () => {
|
|
183
|
+
expect((0, gmaps_1.getGeoSearchSuggestions)(MOCK_SUGGESTIONS)).toEqual([
|
|
184
|
+
MOCK_SUGGESTIONS[0]
|
|
185
|
+
]);
|
|
186
|
+
});
|
|
187
|
+
});
|
|
160
188
|
//# sourceMappingURL=gmaps.test.js.map
|