From 29f4a65ce19f033afd85c7ffd8e0333e101def65 Mon Sep 17 00:00:00 2001 From: Iva Date: Wed, 25 Oct 2023 13:33:46 +0300 Subject: [PATCH 1/3] Delete location input from component library --- cl2-component-library/package-lock.json | 61 +--------- cl2-component-library/package.json | 4 +- .../LocationInput/LocationInput.stories.mdx | 25 ---- .../src/components/LocationInput/index.tsx | 110 ------------------ cl2-component-library/src/index.tsx | 5 - 5 files changed, 5 insertions(+), 200 deletions(-) delete mode 100644 cl2-component-library/src/components/LocationInput/LocationInput.stories.mdx delete mode 100644 cl2-component-library/src/components/LocationInput/index.tsx diff --git a/cl2-component-library/package-lock.json b/cl2-component-library/package-lock.json index 27a5617bc88c..e0ee18e37939 100644 --- a/cl2-component-library/package-lock.json +++ b/cl2-component-library/package-lock.json @@ -15,7 +15,6 @@ "lodash-es": "4.17.21", "polished": "^4.2.2", "react-color": "2.19.3", - "react-places-autocomplete": "6.x", "react-transition-group": "4.4.5", "styled-components": "^5.3.6", "tippy.js": "6.3.7" @@ -46,7 +45,6 @@ "@types/react": "^17.0.2", "@types/react-color": "3.0.9", "@types/react-dom": "^17.0.13", - "@types/react-places-autocomplete": "6.x", "@types/react-transition-group": "4.4.8", "@types/styled-components": "^5.1.26", "@typescript-eslint/eslint-plugin": "^6.7.3", @@ -10749,12 +10747,6 @@ "@types/node": "*" } }, - "node_modules/@types/google.maps": { - "version": "3.45.6", - "resolved": "https://registry.npmjs.org/@types/google.maps/-/google.maps-3.45.6.tgz", - "integrity": "sha512-BzGzxs8UXFxeP8uN/0nRgGbsbpYQxSCKsv/7S8OitU7wwhfFcqQSm5aAcL1nbwueMiJ/VVmIZKPq69s0kX5W+Q==", - "dev": true - }, "node_modules/@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -11018,16 +11010,6 @@ "@types/react": "*" } }, - "node_modules/@types/react-places-autocomplete": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@types/react-places-autocomplete/-/react-places-autocomplete-6.1.6.tgz", - "integrity": "sha512-SfLAapaSip6fXvpiIgMMnwS/J+q2TM83qt3z8UGe9T6+46vboFfH7+bgNCwVaqt0OqDUSY2k0x/K+h+SLiDXSQ==", - "dev": true, - "dependencies": { - "@types/google.maps": "*", - "@types/react": "*" - } - }, "node_modules/@types/react-transition-group": { "version": "4.4.8", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.8.tgz", @@ -24859,7 +24841,8 @@ "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -27333,18 +27316,6 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", "dev": true }, - "node_modules/react-places-autocomplete": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/react-places-autocomplete/-/react-places-autocomplete-6.1.3.tgz", - "integrity": "sha512-Ld8Ny1GnWa20yxrjw4IwTe2XfB1FFUZt1gMHukh/dQU61kzjdS0/rd3SycyWe34MKIPfQUHM33lcbLu2mZ7AyA==", - "dependencies": { - "lodash.debounce": "^4.0.8", - "prop-types": "^15.5.8" - }, - "peerDependencies": { - "react": ">=0.14.7" - } - }, "node_modules/react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", @@ -39099,12 +39070,6 @@ "@types/node": "*" } }, - "@types/google.maps": { - "version": "3.45.6", - "resolved": "https://registry.npmjs.org/@types/google.maps/-/google.maps-3.45.6.tgz", - "integrity": "sha512-BzGzxs8UXFxeP8uN/0nRgGbsbpYQxSCKsv/7S8OitU7wwhfFcqQSm5aAcL1nbwueMiJ/VVmIZKPq69s0kX5W+Q==", - "dev": true - }, "@types/graceful-fs": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz", @@ -39354,16 +39319,6 @@ "@types/react": "*" } }, - "@types/react-places-autocomplete": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/@types/react-places-autocomplete/-/react-places-autocomplete-6.1.6.tgz", - "integrity": "sha512-SfLAapaSip6fXvpiIgMMnwS/J+q2TM83qt3z8UGe9T6+46vboFfH7+bgNCwVaqt0OqDUSY2k0x/K+h+SLiDXSQ==", - "dev": true, - "requires": { - "@types/google.maps": "*", - "@types/react": "*" - } - }, "@types/react-transition-group": { "version": "4.4.8", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.8.tgz", @@ -49779,7 +49734,8 @@ "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", - "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", + "dev": true }, "lodash.memoize": { "version": "4.1.2", @@ -51593,15 +51549,6 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", "dev": true }, - "react-places-autocomplete": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/react-places-autocomplete/-/react-places-autocomplete-6.1.3.tgz", - "integrity": "sha512-Ld8Ny1GnWa20yxrjw4IwTe2XfB1FFUZt1gMHukh/dQU61kzjdS0/rd3SycyWe34MKIPfQUHM33lcbLu2mZ7AyA==", - "requires": { - "lodash.debounce": "^4.0.8", - "prop-types": "^15.5.8" - } - }, "react-refresh": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", diff --git a/cl2-component-library/package.json b/cl2-component-library/package.json index 3b203623198b..6cb59726bdc4 100644 --- a/cl2-component-library/package.json +++ b/cl2-component-library/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.20", + "version": "0.11.21", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", @@ -61,7 +61,6 @@ "@types/react": "^17.0.2", "@types/react-color": "3.0.9", "@types/react-dom": "^17.0.13", - "@types/react-places-autocomplete": "6.x", "@types/react-transition-group": "4.4.8", "@types/styled-components": "^5.1.26", "@typescript-eslint/eslint-plugin": "^6.7.3", @@ -109,7 +108,6 @@ "lodash-es": "4.17.21", "polished": "^4.2.2", "react-color": "2.19.3", - "react-places-autocomplete": "6.x", "react-transition-group": "4.4.5", "styled-components": "^5.3.6", "tippy.js": "6.3.7" diff --git a/cl2-component-library/src/components/LocationInput/LocationInput.stories.mdx b/cl2-component-library/src/components/LocationInput/LocationInput.stories.mdx deleted file mode 100644 index 5811b9637152..000000000000 --- a/cl2-component-library/src/components/LocationInput/LocationInput.stories.mdx +++ /dev/null @@ -1,25 +0,0 @@ -import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; -import { ArgsTable } from '@storybook/addon-docs'; -import { text, number, boolean } from '@storybook/addon-knobs'; -import { action } from '@storybook/addon-actions'; -import LocationInput from './'; - - - -# LocationInput - - - - - - -
- -
-
-
diff --git a/cl2-component-library/src/components/LocationInput/index.tsx b/cl2-component-library/src/components/LocationInput/index.tsx deleted file mode 100644 index 7bd60ff85e92..000000000000 --- a/cl2-component-library/src/components/LocationInput/index.tsx +++ /dev/null @@ -1,110 +0,0 @@ -import React, { PureComponent } from 'react'; -import PlacesAutocomplete, { - formattedSuggestionType, -} from 'react-places-autocomplete'; -import styled from 'styled-components'; -import { - fontSizes, - defaultStyles, - defaultInputStyle, - colors, -} from '../../utils/styleUtils'; -import { InputSize } from '../../utils/typings'; - -const Container = styled.div` - width: 100%; - input { - width: 100%; - padding: ${defaultStyles.inputPadding} !important; - ${defaultInputStyle}; - } -`; - -const StyledAutocompleteItem = styled.div` - width: 100%; - color: ${colors.textPrimary}; - font-size: ${fontSizes.base}px; - line-height: normal; - font-weight: 400; - padding: 12px; - - strong { - font-weight: 600; - color: #000; - } - - &:hover { - background: #eee; - } -`; - -export interface Props { - value: string; - placeholder: string; - className?: string; - onBlur?: () => void; - onChange: (arg: string) => void; - size?: InputSize; - id?: string; -} - -class LocationInput extends PureComponent { - handleSelect = (adress: string) => { - const { onBlur, onChange } = this.props; - onChange(adress); - onBlur?.(); - }; - - render() { - const { className, onChange, size, id } = this.props; - const value = this.props.value || ''; - const placeholder = this.props.placeholder || ''; - - const AutocompleteItem = ({ - formattedSuggestion, - }: { - formattedSuggestion: formattedSuggestionType; - }) => ( - - {formattedSuggestion.mainText}{' '} - {formattedSuggestion.secondaryText} - - ); - - return ( - - - - ); - } -} - -export default LocationInput; diff --git a/cl2-component-library/src/index.tsx b/cl2-component-library/src/index.tsx index eee3dea1dfd9..ddb6c808f99a 100644 --- a/cl2-component-library/src/index.tsx +++ b/cl2-component-library/src/index.tsx @@ -13,9 +13,6 @@ import InputMultiloc, { import InputMultilocWithLocaleSwitcher, { Props as InputMultilocWithLocaleSwitcherProps, } from './components/Input/InputMultilocWithLocaleSwitcher'; -import LocationInput, { - Props as LocationInputProps, -} from './components/LocationInput'; import SearchInput, { Props as SearchInputProps, } from './components/SearchInput'; @@ -117,8 +114,6 @@ export { InputProps, Select, SelectProps, - LocationInput, - LocationInputProps, SearchInput, SearchInputProps, LocaleSwitcher, From 4cec4bc8313a3091192b35b7ed42da51d520dc0e Mon Sep 17 00:00:00 2001 From: Iva Date: Wed, 25 Oct 2023 13:37:29 +0300 Subject: [PATCH 2/3] Restore component library version --- cl2-component-library/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl2-component-library/package.json b/cl2-component-library/package.json index 6cb59726bdc4..497093d9b6d8 100644 --- a/cl2-component-library/package.json +++ b/cl2-component-library/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.21", + "version": "0.11.20", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", From 15bb4a64a221ff9f1dcb0164df9a3afa29395fad Mon Sep 17 00:00:00 2001 From: Iva Date: Wed, 25 Oct 2023 16:22:08 +0300 Subject: [PATCH 3/3] Bump version --- cl2-component-library/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cl2-component-library/package.json b/cl2-component-library/package.json index 497093d9b6d8..6cb59726bdc4 100644 --- a/cl2-component-library/package.json +++ b/cl2-component-library/package.json @@ -1,5 +1,5 @@ { - "version": "0.11.20", + "version": "0.11.21", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts",