From a48ab5c249238070669a728b3bd5a3927e588ef4 Mon Sep 17 00:00:00 2001 From: jeovazero Date: Mon, 9 Nov 2020 14:35:25 -0300 Subject: [PATCH 1/3] chore: remove unused component --- src/docz/lab/AutocompleteNew.mdx | 45 ------------- src/lab/AutocompleteNew.tsx | 109 ------------------------------- 2 files changed, 154 deletions(-) delete mode 100644 src/docz/lab/AutocompleteNew.mdx delete mode 100644 src/lab/AutocompleteNew.tsx diff --git a/src/docz/lab/AutocompleteNew.mdx b/src/docz/lab/AutocompleteNew.mdx deleted file mode 100644 index 92f403ab..00000000 --- a/src/docz/lab/AutocompleteNew.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -name: AutoComplete -route: /autocompletenew@lab ---- - -import { AutocompleteNew } from '../../lab' -import ListItem from '../../core/ListItem' -import TextField from '../../core/TextField' -import Typography from '../../core/Typography' -import { Playground, Props } from 'docz' - -# AutoComplete@lab - -## Properties - - -## Simple - - opt.label } - suggestions={[ - { id: 0, label: "White", value: "White" }, - { id: 1, label: "Yellow", value: "Yellow" }, - { id: 2, label: "Green", value: "Green" }, - { id: 3, label: "Blue", value: "Blue" }, - { id: 4, label: "Red", value: "Red" }, - { id: 5, label: "Black", value: "Black" }, - { id: 6, label: "White", value: "White" }, - { id: 7, label: "Yellow", value: "Yellow" }, - { id: 8, label: "Green", value: "Green" }, - { id: 9, label: "Blue", value: "Blue" } - ]} - renderInput={ params => - - } - /> - - diff --git a/src/lab/AutocompleteNew.tsx b/src/lab/AutocompleteNew.tsx deleted file mode 100644 index 2f0ee672..00000000 --- a/src/lab/AutocompleteNew.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import React, { ReactNode } from 'react' -import { - Autocomplete as MuiAutocomplete, - AutocompleteClassKey, - AutocompleteRenderInputParams -} from '@material-ui/lab' -import { makeStyles } from '@material-ui/core/styles' -import styled from 'styled-components' - -interface IProps { - value?: string | TSelected - defaultValue?: string - clearText?: string - closeText?: string - noOptionsText?: string - classes?: Partial> - openOnFocus?: boolean - selectTextOnFocus?: boolean - suggestions: TSelected[] - actions?: React.ReactNode | JSX.Element - onChange?(event: React.ChangeEvent<{}>, value?: TSelected): void - onInputChange?(event: React.ChangeEvent<{}>, value?: string): void - renderInput(params: AutocompleteRenderInputParams): ReactNode - onBlur?(event: React.ChangeEvent<{}>): void -} - -type TSelected = { - label: string - value?: string -} - -const Wrapper = styled.div` - position: relative; -` - -const useStyles = makeStyles({ - root: { - '& .MuiInputLabel-outlined:not(.MuiInputLabel-shrink)': { - transform: 'translate(14px, 12px) scale(1)', - fontSize: '14px' - }, - '& .MuiOutlinedInput-input': { - paddingTop: '10px', - paddingBottom: '10px' - }, - '& .MuiAutocomplete-clearIndicator': { - color: '#152849' - } - }, - - inputRoot: (actions: React.ReactNode | JSX.Element) => ({ - '&.MuiOutlinedInput-root': { - padding: actions - ? '0 150px 0 8px !important' - : '0 39px 0 8px !important' - } - }), - - focused: { - '& .MuiFormLabel-root': { - color: '#152849' - }, - '& .MuiOutlinedInput-root .MuiOutlinedInput-notchedOutline': { - borderColor: '#152849' - } - } -}) - -const getOptionLabel = (props: TSelected) => props.label - -const AutocompleteNew = ({ - suggestions, - selectTextOnFocus, - openOnFocus, - classes, - actions, - renderInput: renderInputProp, - ...otherProps -}: IProps) => { - - const styles = useStyles(actions) - - const renderInput = (params: AutocompleteRenderInputParams) => - - { renderInputProp(params) } - { actions } - - - return ( - - ) -} - -export default AutocompleteNew From 63dd432d9ac0a2eebb3f56fdd9aa55be86714c0b Mon Sep 17 00:00:00 2001 From: jeovazero Date: Mon, 9 Nov 2020 14:36:20 -0300 Subject: [PATCH 2/3] feat(autocomplete): export types --- src/docz/lab/AutoCompleteLab.mdx | 2 +- src/lab/Autocomplete.tsx | 9 +++++++-- src/lab/index.ts | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/docz/lab/AutoCompleteLab.mdx b/src/docz/lab/AutoCompleteLab.mdx index b6ee1d5c..53d4539b 100644 --- a/src/docz/lab/AutoCompleteLab.mdx +++ b/src/docz/lab/AutoCompleteLab.mdx @@ -1,5 +1,5 @@ --- -name: AutoComplete +name: AutoComplete Lab route: /autocomplete@lab --- diff --git a/src/lab/Autocomplete.tsx b/src/lab/Autocomplete.tsx index bcc53a04..72ab117c 100644 --- a/src/lab/Autocomplete.tsx +++ b/src/lab/Autocomplete.tsx @@ -2,8 +2,13 @@ import React from 'react' import { default as MuiAutocomplete } from '@material-ui/lab/Autocomplete' -export { AutocompleteRenderInputParams } from '@material-ui/lab/Autocomplete' -export { AutocompleteProps } from '@material-ui/lab/Autocomplete' +export { + AutocompleteRenderInputParams, + AutocompleteProps, + AutocompleteCloseReason, + AutocompleteChangeReason, + AutocompleteInputChangeReason +} from '@material-ui/lab/Autocomplete' import { makeStyles } from '@material-ui/core/styles' const useStyles = makeStyles({ diff --git a/src/lab/index.ts b/src/lab/index.ts index a5008e3c..00ae0cef 100644 --- a/src/lab/index.ts +++ b/src/lab/index.ts @@ -1,2 +1 @@ export { default as Autocomplete } from './Autocomplete' -export { default as AutocompleteNew } from './AutocompleteNew' From 2dc3e1205fdfa3bf6e5314c08f132b1ecf6546a7 Mon Sep 17 00:00:00 2001 From: jeovazero Date: Mon, 9 Nov 2020 14:38:39 -0300 Subject: [PATCH 3/3] chore: bump version --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 73593341..58f6d91f 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "flipper-ui", - "version": "0.22.21", + "version": "0.23.0", "description": "", "main": "dist/index.js", - "homepage": "https://nginformatica.github.io/flipper-ui/", + "homepage": "https://flipper-ui.vercel.app", "repository": { "type": "git", "url": "https://github.com/nginformatica/flipper-ui.git"