@proprioo/salatim 18.5.0 → 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 +21 -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 +17 -15
- package/lib/ui/src/tag/Tag.js.map +1 -1
- package/lib/ui/src/tag/Tag.stories.js +30 -40
- package/lib/ui/src/tag/Tag.stories.js.map +1 -1
- package/lib/ui/src/tag/Tag.styles.d.ts +2 -1
- package/lib/ui/src/tag/Tag.styles.js +141 -37
- package/lib/ui/src/tag/Tag.styles.js.map +1 -1
- package/lib/ui/src/tag/Tag.test.js +41 -72
- 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/tag/interfaces.d.ts +2 -1
- package/lib/ui/src/tag/interfaces.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
package/lib/energy/src/Energy.js
CHANGED
|
@@ -3,47 +3,46 @@ 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var ARROW_SIZE = 25;
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const Energy_styles_1 = require("./Energy.styles");
|
|
8
|
+
const Energy_utils_1 = require("./Energy.utils");
|
|
9
|
+
const interfaces_1 = require("./interfaces");
|
|
10
|
+
const Energy = ({ carbonFootprint, consumption }) => {
|
|
11
|
+
const consumptionLevel = (0, Energy_utils_1.getConsumptionLevel)(consumption);
|
|
12
|
+
const carbonFootprintLevel = (0, Energy_utils_1.getCarbonFootprintLevel)(carbonFootprint);
|
|
13
|
+
const EPC = (0, Energy_utils_1.getEPCLevel)(consumptionLevel, carbonFootprintLevel);
|
|
14
|
+
const ARROW_SIZE = 25;
|
|
16
15
|
// position of the EPC letter on the background gradient :
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const EPC_LETTER_POS = EPC === 1 ? 0 : (EPC - 1) * ARROW_SIZE + (EPC - 2) * 10;
|
|
17
|
+
const TEXT_CONTENT = {
|
|
19
18
|
blankEPC: 'Diagnostic de performance énergétique vierge',
|
|
20
19
|
EPCTitle: 'Diagnostic de performance énergétique',
|
|
21
|
-
EPCLegend:
|
|
20
|
+
EPCLegend: `Diagnostic de performance énergétique : niveau ${interfaces_1.EnergyLevel[EPC]}`,
|
|
22
21
|
consumptionTitle: 'Consommation',
|
|
23
22
|
consumptionUnit: 'kWhEP/m²/an',
|
|
24
|
-
consumptionLegend:
|
|
23
|
+
consumptionLegend: `Consommation d'électricité : ${consumption} kWhEP/m²/an, niveau : ${interfaces_1.EnergyLevel[consumptionLevel]}`,
|
|
25
24
|
carbonFootprintTitle: 'Émission',
|
|
26
25
|
carbonFootprintUnit: 'kgeqCO2/m²/an',
|
|
27
|
-
carbonFootprintLegend:
|
|
26
|
+
carbonFootprintLegend: `Émission de gaz à effet de serre : ${carbonFootprint} kgeqCO2/m²/an, niveau: ${interfaces_1.EnergyLevel[carbonFootprintLevel]}`
|
|
28
27
|
};
|
|
29
28
|
return carbonFootprint && consumption ? (react_1.default.createElement("div", null,
|
|
30
29
|
react_1.default.createElement(Energy_styles_1.Title, null, TEXT_CONTENT.EPCTitle),
|
|
31
30
|
react_1.default.createElement(Energy_styles_1.Layout, { role: "document", "aria-label": TEXT_CONTENT.EPCTitle },
|
|
32
31
|
react_1.default.createElement("div", { role: "group", tabIndex: 0, "aria-label": TEXT_CONTENT.EPCLegend },
|
|
33
32
|
react_1.default.createElement(Energy_styles_1.EPCBackground, { arrowSize: ARROW_SIZE },
|
|
34
|
-
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: Energy_utils_1.translateEnergyLevelToColor(EPC), pos: EPC_LETTER_POS, isMainScore: true, letterSize: ARROW_SIZE }, interfaces_1.EnergyLevel[EPC]))),
|
|
33
|
+
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: (0, Energy_utils_1.translateEnergyLevelToColor)(EPC), pos: EPC_LETTER_POS, isMainScore: true, letterSize: ARROW_SIZE }, interfaces_1.EnergyLevel[EPC]))),
|
|
35
34
|
react_1.default.createElement(Energy_styles_1.DetailsWrapper, null,
|
|
36
35
|
react_1.default.createElement(Energy_styles_1.Detail, { role: "group", tabIndex: 0, "aria-label": TEXT_CONTENT.consumptionLegend },
|
|
37
36
|
react_1.default.createElement(Energy_styles_1.DetailTitle, null, TEXT_CONTENT.consumptionTitle),
|
|
38
37
|
react_1.default.createElement(Energy_styles_1.ValueWrapper, null,
|
|
39
38
|
react_1.default.createElement(Energy_styles_1.DetailsValue, null, consumption),
|
|
40
|
-
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: Energy_utils_1.translateEnergyLevelToColor(consumptionLevel) }, interfaces_1.EnergyLevel[consumptionLevel])),
|
|
39
|
+
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: (0, Energy_utils_1.translateEnergyLevelToColor)(consumptionLevel) }, interfaces_1.EnergyLevel[consumptionLevel])),
|
|
41
40
|
react_1.default.createElement(Energy_styles_1.Unit, null, TEXT_CONTENT.consumptionUnit)),
|
|
42
41
|
react_1.default.createElement(Energy_styles_1.Detail, { role: "group", tabIndex: 0, "aria-label": TEXT_CONTENT.carbonFootprintLegend },
|
|
43
42
|
react_1.default.createElement(Energy_styles_1.DetailTitle, null, TEXT_CONTENT.carbonFootprintTitle),
|
|
44
43
|
react_1.default.createElement(Energy_styles_1.ValueWrapper, null,
|
|
45
44
|
react_1.default.createElement(Energy_styles_1.DetailsValue, null, carbonFootprint),
|
|
46
|
-
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: Energy_utils_1.translateEnergyLevelToCarbonFootprintColor(carbonFootprintLevel) }, interfaces_1.EnergyLevel[carbonFootprintLevel])),
|
|
45
|
+
react_1.default.createElement(Energy_styles_1.LetterWrapper, { background: (0, Energy_utils_1.translateEnergyLevelToCarbonFootprintColor)(carbonFootprintLevel) }, interfaces_1.EnergyLevel[carbonFootprintLevel])),
|
|
47
46
|
react_1.default.createElement(Energy_styles_1.Unit, null, TEXT_CONTENT.carbonFootprintUnit)))))) : (react_1.default.createElement(Energy_styles_1.BlankEPC, null, TEXT_CONTENT.blankEPC));
|
|
48
47
|
};
|
|
49
48
|
exports.default = Energy;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.tsx"],"names":[],"mappings":";;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Energy.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAkC;AAElC,mDAYyB;AACzB,iDAMwB;AACxB,6CAA2C;AAO3C,MAAM,MAAM,GAAiB,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,EAAE,EAAE;IAChE,MAAM,gBAAgB,GAAG,IAAA,kCAAmB,EAAC,WAAW,CAAC,CAAC;IAC1D,MAAM,oBAAoB,GAAG,IAAA,sCAAuB,EAAC,eAAe,CAAC,CAAC;IACtE,MAAM,GAAG,GAAG,IAAA,0BAAW,EAAC,gBAAgB,EAAE,oBAAoB,CAAC,CAAC;IAEhE,MAAM,UAAU,GAAG,EAAE,CAAC;IACtB,0DAA0D;IAC1D,MAAM,cAAc,GAClB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,GA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IAAA,0CAA2B,EAAC,gBAAgB,CAAC,IAExD,wBAAW,CAAC,gBAAgB,CAAC,CAChB,CACH;oBACf,8BAAC,oBAAI,QAAE,YAAY,CAAC,eAAe,CAAQ,CACpC;gBACT,8BAAC,sBAAM,IACL,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,CAAC,gBACC,YAAY,CAAC,qBAAqB;oBAE9C,8BAAC,2BAAW,QAAE,YAAY,CAAC,oBAAoB,CAAe;oBAC9D,8BAAC,4BAAY;wBACX,8BAAC,4BAAY,QAAE,eAAe,CAAgB;wBAC9C,8BAAC,6BAAa,IACZ,UAAU,EAAE,IAAA,yDAA0C,EACpD,oBAAoB,CACrB,IAEA,wBAAW,CAAC,oBAAoB,CAAC,CACpB,CACH;oBACf,8BAAC,oBAAI,QAAE,YAAY,CAAC,mBAAmB,CAAQ,CACxC,CACM,CACV,CACL,CACP,CAAC,CAAC,CAAC,CACF,8BAAC,wBAAQ,QAAE,YAAY,CAAC,QAAQ,CAAY,CAC7C,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"}
|
|
@@ -1,26 +1,15 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
carbonFootprint: addon_knobs_1.number('Carbon footprint', 6),
|
|
23
|
-
consumption: addon_knobs_1.number('Consumption', 120)
|
|
24
|
-
});
|
|
25
|
-
react_2.storiesOf('Energy', module).add('Energy',
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const addon_knobs_1 = require("@storybook/addon-knobs");
|
|
8
|
+
const react_2 = require("@storybook/react");
|
|
9
|
+
const Energy_1 = __importDefault(require("./Energy"));
|
|
10
|
+
const knobs = () => ({
|
|
11
|
+
carbonFootprint: (0, addon_knobs_1.number)('Carbon footprint', 6),
|
|
12
|
+
consumption: (0, addon_knobs_1.number)('Consumption', 120)
|
|
13
|
+
});
|
|
14
|
+
(0, react_2.storiesOf)('Energy', module).add('Energy', () => react_1.default.createElement(Energy_1.default, Object.assign({}, knobs())));
|
|
26
15
|
//# sourceMappingURL=Energy.stories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.stories.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.stories.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Energy.stories.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.stories.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,wDAAgD;AAChD,4CAA6C;AAE7C,sDAA8B;AAE9B,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,CAAC;IACnB,eAAe,EAAE,IAAA,oBAAM,EAAC,kBAAkB,EAAE,CAAC,CAAC;IAC9C,WAAW,EAAE,IAAA,oBAAM,EAAC,aAAa,EAAE,GAAG,CAAC;CACxC,CAAC,CAAC;AAEH,IAAA,iBAAS,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,8BAAC,gBAAM,oBAAK,KAAK,EAAE,EAAI,CAAC,CAAC"}
|
|
@@ -1,8 +1,4 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
3
|
if (k2 === undefined) k2 = k;
|
|
8
4
|
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
@@ -24,45 +20,165 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
20
|
};
|
|
25
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
22
|
exports.Unit = exports.DetailsValue = exports.DetailsWrapper = exports.Detail = exports.ValueWrapper = exports.DetailTitle = exports.LetterWrapper = exports.EPCBackground = exports.BlankEPC = exports.Title = exports.Layout = void 0;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
exports.Layout = styled_components_1.default.div
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
exports.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
23
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
24
|
+
const utils_1 = require("../../utils");
|
|
25
|
+
const Energy_utils_1 = require("./Energy.utils");
|
|
26
|
+
const interfaces_1 = require("./interfaces");
|
|
27
|
+
const EPC_BACKGROUND_WIDTH = 250;
|
|
28
|
+
const DETAILS_MARGIN = 24;
|
|
29
|
+
const PDF_DETAILS_MARGIN = 86;
|
|
30
|
+
exports.Layout = styled_components_1.default.div `
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: column;
|
|
33
|
+
width: 100%;
|
|
34
|
+
background-color: white;
|
|
35
|
+
|
|
36
|
+
@media print, (min-width: ${utils_1.breakpoints.base}px) {
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
exports.Title = styled_components_1.default.span `
|
|
41
|
+
${utils_1.paragraphs.tab};
|
|
42
|
+
|
|
43
|
+
font-size: ${utils_1.fonts.small};
|
|
44
|
+
`;
|
|
45
|
+
exports.BlankEPC = (0, styled_components_1.default)(exports.Title) `
|
|
46
|
+
display: block;
|
|
47
|
+
text-align: center;
|
|
48
|
+
`;
|
|
49
|
+
exports.EPCBackground = styled_components_1.default.div `
|
|
50
|
+
position: relative;
|
|
51
|
+
margin: ${(0, utils_1.convertPxToRem)(24)} 0;
|
|
52
|
+
width: ${(0, utils_1.convertPxToRem)(EPC_BACKGROUND_WIDTH)};
|
|
53
|
+
height: ${(0, utils_1.convertPxToRem)(25)};
|
|
54
|
+
background: ${({ arrowSize }) => (0, Energy_utils_1.generateEPCBackground)(interfaces_1.EnergyLevelColor, arrowSize)};
|
|
55
|
+
|
|
56
|
+
@media print, (min-width: ${utils_1.breakpoints.base}px) {
|
|
57
|
+
margin: ${(0, utils_1.convertPxToRem)(52)} 0 0 0;
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
exports.LetterWrapper = styled_components_1.default.span `
|
|
61
|
+
padding: ${(0, utils_1.convertPxToRem)(6)} ${(0, utils_1.convertPxToRem)(8)};
|
|
62
|
+
border: ${(0, utils_1.convertPxToRem)(2)} solid white;
|
|
63
|
+
border-radius: ${utils_1.radius.normal};
|
|
64
|
+
background-color: ${({ background }) => background};
|
|
65
|
+
color: white;
|
|
66
|
+
font-size: ${utils_1.fonts.smaller};
|
|
67
|
+
|
|
68
|
+
${({ isMainScore, pos, letterSize }) => isMainScore &&
|
|
69
|
+
letterSize &&
|
|
70
|
+
(0, styled_components_1.css) `
|
|
71
|
+
position: absolute;
|
|
72
|
+
top: ${(0, utils_1.convertPxToRem)(-Math.floor(letterSize * 0.5))};
|
|
73
|
+
left: ${(0, utils_1.convertPxToRem)(pos || 0)};
|
|
74
|
+
padding: ${(0, utils_1.convertPxToRem)(Math.floor(letterSize * 0.4))}
|
|
75
|
+
${(0, utils_1.convertPxToRem)(Math.floor(letterSize * 0.6))};
|
|
76
|
+
text-align: center;
|
|
77
|
+
border-radius: ${utils_1.radius.bigger};
|
|
78
|
+
font-size: ${utils_1.fonts.big};
|
|
79
|
+
`};
|
|
80
|
+
|
|
81
|
+
//dashed line
|
|
82
|
+
@media print, (min-width: ${utils_1.breakpoints.base}px) {
|
|
83
|
+
${({ pos = 0, isMainScore }) => isMainScore &&
|
|
84
|
+
(0, styled_components_1.css) `
|
|
85
|
+
::before {
|
|
86
|
+
content: '';
|
|
87
|
+
position: absolute;
|
|
88
|
+
left: ${(0, utils_1.convertPxToRem)(24)};
|
|
89
|
+
top: ${(0, utils_1.convertPxToRem)(-12)};
|
|
90
|
+
height: ${(0, utils_1.convertPxToRem)(12)};
|
|
91
|
+
width: ${(0, utils_1.convertPxToRem)(EPC_BACKGROUND_WIDTH - pos + DETAILS_MARGIN - 24)};
|
|
92
|
+
border-left: ${(0, utils_1.convertPxToRem)(1)} dashed ${utils_1.colors.dark.base20};
|
|
93
|
+
border-top: ${(0, utils_1.convertPxToRem)(1)} dashed ${utils_1.colors.dark.base20};
|
|
94
|
+
}
|
|
95
|
+
`}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media print {
|
|
99
|
+
${({ pos = 0, isMainScore }) => isMainScore &&
|
|
100
|
+
(0, styled_components_1.css) `
|
|
101
|
+
::before {
|
|
102
|
+
width: ${(0, utils_1.convertPxToRem)(EPC_BACKGROUND_WIDTH - pos + PDF_DETAILS_MARGIN - 24)};
|
|
103
|
+
}
|
|
104
|
+
`}
|
|
105
|
+
}
|
|
106
|
+
`;
|
|
107
|
+
exports.DetailTitle = styled_components_1.default.span `
|
|
108
|
+
${utils_1.paragraphs.tab};
|
|
109
|
+
|
|
110
|
+
display: block;
|
|
111
|
+
font-size: ${utils_1.fonts.smallest};
|
|
112
|
+
color: ${utils_1.colors.grey.base};
|
|
113
|
+
text-transform: uppercase;
|
|
114
|
+
`;
|
|
115
|
+
exports.ValueWrapper = styled_components_1.default.span `
|
|
116
|
+
display: flex;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
align-items: center;
|
|
119
|
+
padding: ${(0, utils_1.convertPxToRem)(16)} 0;
|
|
120
|
+
`;
|
|
121
|
+
exports.Detail = styled_components_1.default.div `
|
|
122
|
+
min-width: ${(0, utils_1.convertPxToRem)(128)};
|
|
123
|
+
width: 50%;
|
|
124
|
+
padding: 0 ${(0, utils_1.convertPxToRem)(16)} ${(0, utils_1.convertPxToRem)(18)};
|
|
125
|
+
`;
|
|
126
|
+
exports.DetailsWrapper = styled_components_1.default.div `
|
|
127
|
+
display: flex;
|
|
128
|
+
position: relative;
|
|
129
|
+
width: 40%;
|
|
130
|
+
max-width: ${(0, utils_1.convertPxToRem)(300)};
|
|
131
|
+
|
|
132
|
+
${exports.Detail} + ${exports.Detail} {
|
|
133
|
+
position: relative;
|
|
134
|
+
|
|
135
|
+
::before {
|
|
136
|
+
content: '';
|
|
137
|
+
position: absolute;
|
|
138
|
+
left: 0;
|
|
139
|
+
top: ${(0, utils_1.convertPxToRem)(33)};
|
|
140
|
+
height: ${(0, utils_1.convertPxToRem)(68)};
|
|
141
|
+
border-left: ${(0, utils_1.convertPxToRem)(1)} solid ${utils_1.colors.dark.base20};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//card borders
|
|
146
|
+
::before {
|
|
147
|
+
content: '';
|
|
148
|
+
position: absolute;
|
|
149
|
+
left: 0;
|
|
150
|
+
top: ${(0, utils_1.convertPxToRem)(18)};
|
|
151
|
+
min-width: ${(0, utils_1.convertPxToRem)(256)};
|
|
152
|
+
width: 100%;
|
|
153
|
+
max-width: ${(0, utils_1.convertPxToRem)(300)};
|
|
154
|
+
min-height: ${(0, utils_1.convertPxToRem)(100)};
|
|
155
|
+
height: 75%;
|
|
156
|
+
border: ${(0, utils_1.convertPxToRem)(1)} solid ${utils_1.colors.dark.base20};
|
|
157
|
+
border-radius: ${utils_1.radius.biggest};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media (min-width: ${utils_1.breakpoints.base}px) {
|
|
161
|
+
margin-left: ${(0, utils_1.convertPxToRem)(DETAILS_MARGIN)};
|
|
162
|
+
min-width: ${(0, utils_1.convertPxToRem)(256)};
|
|
163
|
+
width: 50%;
|
|
164
|
+
max-width: ${(0, utils_1.convertPxToRem)(300)};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
@media print {
|
|
168
|
+
margin-left: ${(0, utils_1.convertPxToRem)(PDF_DETAILS_MARGIN)};
|
|
169
|
+
width: ${(0, utils_1.convertPxToRem)(316)};
|
|
170
|
+
|
|
171
|
+
::before {
|
|
172
|
+
max-width: unset;
|
|
173
|
+
width: ${(0, utils_1.convertPxToRem)(316)};
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
exports.DetailsValue = styled_components_1.default.span `
|
|
178
|
+
font-size: ${(0, utils_1.convertPxToRem)(30)};
|
|
179
|
+
font-weight: bold;
|
|
180
|
+
`;
|
|
181
|
+
exports.Unit = styled_components_1.default.span `
|
|
182
|
+
font-size: ${utils_1.fonts.smaller};
|
|
183
|
+
`;
|
|
68
184
|
//# sourceMappingURL=Energy.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.styles.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":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hC,CAAC;AAEW,QAAA,IAAI,GAAG,2BAAM,CAAC,IAAI,CAAA;eAChB,aAAK,CAAC,OAAO;CAC3B,CAAC"}
|
|
@@ -1,39 +1,28 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const react_test_renderer_1 = __importDefault(require("react-test-renderer"));
|
|
8
|
+
const test_utils_1 = require("../../utils/src/test-utils");
|
|
9
|
+
const Energy_1 = __importDefault(require("./Energy"));
|
|
10
|
+
const DEFAULT_PROPS = {
|
|
22
11
|
carbonFootprint: 6,
|
|
23
12
|
consumption: 185
|
|
24
13
|
};
|
|
25
|
-
describe('<Energy/>',
|
|
26
|
-
it('should pass A11y test',
|
|
27
|
-
it('should render component',
|
|
28
|
-
|
|
14
|
+
describe('<Energy/>', () => {
|
|
15
|
+
it('should pass A11y test', () => (0, test_utils_1.testA11y)(react_1.default.createElement(Energy_1.default, Object.assign({}, DEFAULT_PROPS))));
|
|
16
|
+
it('should render component', () => {
|
|
17
|
+
const tree = react_test_renderer_1.default.create(react_1.default.createElement(Energy_1.default, Object.assign({}, DEFAULT_PROPS)));
|
|
29
18
|
expect(tree).toMatchSnapshot();
|
|
30
19
|
});
|
|
31
|
-
it('should render blank EPC - no carbon footprint',
|
|
32
|
-
|
|
20
|
+
it('should render blank EPC - no carbon footprint', () => {
|
|
21
|
+
const tree = react_test_renderer_1.default.create(react_1.default.createElement(Energy_1.default, { carbonFootprint: 0, consumption: 185 }));
|
|
33
22
|
expect(tree).toMatchSnapshot();
|
|
34
23
|
});
|
|
35
|
-
it('should render blank EPC - no consumption',
|
|
36
|
-
|
|
24
|
+
it('should render blank EPC - no consumption', () => {
|
|
25
|
+
const tree = react_test_renderer_1.default.create(react_1.default.createElement(Energy_1.default, { carbonFootprint: 30, consumption: 0 }));
|
|
37
26
|
expect(tree).toMatchSnapshot();
|
|
38
27
|
});
|
|
39
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.test.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.test.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Energy.test.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,8EAA2C;AAE3C,2DAAsD;AACtD,sDAA4C;AAE5C,MAAM,aAAa,GAAa;IAC9B,eAAe,EAAE,CAAC;IAClB,WAAW,EAAE,GAAG;CACjB,CAAC;AAEF,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,IAAA,qBAAQ,EAAC,8BAAC,gBAAM,oBAAK,aAAa,EAAI,CAAC,CAAC,CAAC;IAE3E,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;QACjC,MAAM,IAAI,GAAG,6BAAQ,CAAC,MAAM,CAAC,8BAAC,gBAAM,oBAAK,aAAa,EAAI,CAAC,CAAC;QAE5D,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,IAAI,GAAG,6BAAQ,CAAC,MAAM,CAC1B,8BAAC,gBAAM,IAAC,eAAe,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,GAAI,CACjD,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAClD,MAAM,IAAI,GAAG,6BAAQ,CAAC,MAAM,CAC1B,8BAAC,gBAAM,IAAC,eAAe,EAAE,EAAE,EAAE,WAAW,EAAE,CAAC,GAAI,CAChD,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC;IACjC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateEPCBackground = exports.generateLinearGradient = exports.getEPCLevel = exports.getCarbonFootprintLevel = exports.getConsumptionLevel = exports.translateEnergyLevelToCarbonFootprintColor = exports.translateEnergyLevelToColor = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const interfaces_1 = require("./interfaces");
|
|
5
|
+
const translateEnergyLevelToColor = (level) => {
|
|
6
6
|
switch (level) {
|
|
7
7
|
case interfaces_1.EnergyLevel.A:
|
|
8
8
|
return interfaces_1.EnergyLevelColor.A;
|
|
@@ -21,7 +21,7 @@ var translateEnergyLevelToColor = function (level) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
exports.translateEnergyLevelToColor = translateEnergyLevelToColor;
|
|
24
|
-
|
|
24
|
+
const translateEnergyLevelToCarbonFootprintColor = (level) => {
|
|
25
25
|
switch (level) {
|
|
26
26
|
case interfaces_1.EnergyLevel.A:
|
|
27
27
|
return interfaces_1.CarbonFootprintLevelColor.A;
|
|
@@ -40,7 +40,7 @@ var translateEnergyLevelToCarbonFootprintColor = function (level) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
exports.translateEnergyLevelToCarbonFootprintColor = translateEnergyLevelToCarbonFootprintColor;
|
|
43
|
-
|
|
43
|
+
const getConsumptionLevel = (consumption) => {
|
|
44
44
|
if (consumption < 70) {
|
|
45
45
|
return interfaces_1.EnergyLevel.A;
|
|
46
46
|
}
|
|
@@ -62,7 +62,7 @@ var getConsumptionLevel = function (consumption) {
|
|
|
62
62
|
return interfaces_1.EnergyLevel.G;
|
|
63
63
|
};
|
|
64
64
|
exports.getConsumptionLevel = getConsumptionLevel;
|
|
65
|
-
|
|
65
|
+
const getCarbonFootprintLevel = (carbonFootprint) => {
|
|
66
66
|
if (carbonFootprint < 6) {
|
|
67
67
|
return interfaces_1.EnergyLevel.A;
|
|
68
68
|
}
|
|
@@ -84,43 +84,38 @@ var getCarbonFootprintLevel = function (carbonFootprint) {
|
|
|
84
84
|
return interfaces_1.EnergyLevel.G;
|
|
85
85
|
};
|
|
86
86
|
exports.getCarbonFootprintLevel = getCarbonFootprintLevel;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
: carbonFootprintLevel;
|
|
91
|
-
};
|
|
87
|
+
const getEPCLevel = (consumptionLevel, carbonFootprintLevel) => consumptionLevel > carbonFootprintLevel
|
|
88
|
+
? consumptionLevel
|
|
89
|
+
: carbonFootprintLevel;
|
|
92
90
|
exports.getEPCLevel = getEPCLevel;
|
|
93
|
-
|
|
94
|
-
if (isArrow === void 0) { isArrow = false; }
|
|
95
|
-
return "linear-gradient(" + (isArrow ? 45 : 135) + "deg, transparent 0px, transparent " + start + "px, " + color + " " + start + "px, " + color + " " + end + "px, transparent " + end + "px)";
|
|
96
|
-
};
|
|
91
|
+
const generateLinearGradient = (color, start, end, isArrow = false) => `linear-gradient(${isArrow ? 45 : 135}deg, transparent 0px, transparent ${start}px, ${color} ${start}px, ${color} ${end}px, transparent ${end}px)`;
|
|
97
92
|
exports.generateLinearGradient = generateLinearGradient;
|
|
98
|
-
|
|
93
|
+
const generateEPCBackground = (colorList, colorSize) => {
|
|
99
94
|
/*
|
|
100
95
|
CodePen example with generated EPC background :
|
|
101
96
|
https://codepen.io/mema17/pen/QWMjyqm?editors=1100
|
|
102
97
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
98
|
+
const colors = Object.values(colorList);
|
|
99
|
+
const gradientList = colors.reduce((gradients, color) => {
|
|
100
|
+
const colorNumber = colors.indexOf(color);
|
|
101
|
+
const firstColorSize = Math.floor(colorSize * 1.4);
|
|
102
|
+
const colorStart = firstColorSize + (colorNumber - 1) * colorSize;
|
|
103
|
+
const colorEnd = colorStart + colorSize;
|
|
104
|
+
const defautlColorGradient = (0, exports.generateLinearGradient)(color, colorStart, colorEnd);
|
|
110
105
|
if (colorNumber === 0) {
|
|
111
|
-
|
|
106
|
+
const colorGradient = (0, exports.generateLinearGradient)(color, 0, firstColorSize);
|
|
112
107
|
gradients.unshift(colorGradient);
|
|
113
108
|
}
|
|
114
109
|
if (colorNumber === colors.length - 1) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
const lastStart = firstColorSize + colorNumber * colorSize;
|
|
111
|
+
const lastStop = lastStart + colorSize;
|
|
112
|
+
const arrowGradient = (0, exports.generateLinearGradient)(color, colorStart, firstColorSize + (colorNumber - 1) * colorSize + colorSize, true);
|
|
113
|
+
const lastArrow = (0, exports.generateLinearGradient)('white', lastStart, lastStop, true);
|
|
114
|
+
const lastColor = (0, exports.generateLinearGradient)('white', lastStart, lastStop);
|
|
120
115
|
gradients.unshift(lastArrow, lastColor, arrowGradient, defautlColorGradient);
|
|
121
116
|
}
|
|
122
117
|
else {
|
|
123
|
-
|
|
118
|
+
const arrowGradient = (0, exports.generateLinearGradient)(color, colorStart, colorEnd, true);
|
|
124
119
|
gradients.unshift(arrowGradient, defautlColorGradient);
|
|
125
120
|
}
|
|
126
121
|
return gradients;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Energy.utils.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.utils.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"Energy.utils.js","sourceRoot":"","sources":["../../../packages/energy/src/Energy.utils.ts"],"names":[],"mappings":";;;AAEA,6CAIsB;AAEf,MAAM,2BAA2B,GAAG,CAAC,KAAkB,EAAU,EAAE;IACxE,QAAQ,KAAK,EAAE;QACb,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,6BAAgB,CAAC,CAAC,CAAC;QAC5B;YACE,OAAO,6BAAgB,CAAC,CAAC,CAAC;KAC7B;AACH,CAAC,CAAC;AAjBW,QAAA,2BAA2B,+BAiBtC;AAEK,MAAM,0CAA0C,GAAG,CACxD,KAAkB,EACV,EAAE;IACV,QAAQ,KAAK,EAAE;QACb,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,sCAAyB,CAAC,CAAC,CAAC;QACrC,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,sCAAyB,CAAC,CAAC,CAAC;QACrC,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,sCAAyB,CAAC,CAAC,CAAC;QACrC,KAAK,wBAAW,CAAC,CAAC;YAChB,OAAO,sCAAyB,CAAC,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