Skip to content

Commit

Permalink
[FX-5649] Migrate Autocomplete to TailwindCSS (#4491)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianContiu authored Aug 21, 2024
1 parent 1a3de3d commit b9aee47
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 54 deletions.
7 changes: 7 additions & 0 deletions .changeset/angry-worms-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@toptal/picasso-autocomplete': major
'@toptal/picasso': patch
---

- migrate to TailwindCSS, material-ui@4 is no longer required for this package
- make @toptal/picasso-tailwind-merge a peer dependency
3 changes: 1 addition & 2 deletions packages/base/Autocomplete/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@
"@toptal/picasso-typography": "3.0.0",
"@toptal/picasso-utils": "1.0.3",
"ap-style-title-case": "^1.1.2",
"classnames": "^2.5.1",
"debounce": "^1.2.1"
},
"sideEffects": [
"**/styles.ts",
"**/styles.js"
],
"peerDependencies": {
"@material-ui/core": "4.12.4",
"@toptal/picasso-tailwind": ">=2.5.0",
"@toptal/picasso-tailwind-merge": "^1.0.1",
"@toptal/picasso-provider": "*",
"react": ">=16.12.0 < 19.0.0"
},
Expand Down
27 changes: 7 additions & 20 deletions packages/base/Autocomplete/src/Autocomplete/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import type {
Ref,
} from 'react'
import React, { forwardRef, useRef } from 'react'
import type { Theme } from '@material-ui/core/styles'
import { makeStyles } from '@material-ui/core/styles'
import capitalize from '@material-ui/core/utils/capitalize'
import cx from 'classnames'
import type { BaseProps } from '@toptal/picasso-shared'
import { isForwardRef } from '@toptal/picasso-shared'
import type { PopperOptions } from 'popper.js'
Expand All @@ -32,13 +28,14 @@ import type { InputProps } from '@toptal/picasso-input'
import { MenuItem } from '@toptal/picasso-menu'
import type { BaseInputProps, Status } from '@toptal/picasso-outlined-input'
import { useFieldsLayoutContext } from '@toptal/picasso-form'
import { twMerge } from '@toptal/picasso-tailwind-merge'

import PoweredByGoogle from './PoweredByGoogle'
import NoOptionsMenuItem from './NoOptionsMenuItem'
import OtherOptionMenuItem from './OtherOptionMenuItem'
import type { Item, ChangedOptions } from './types'
import { useAutocomplete, EMPTY_INPUT_VALUE } from './use-autocomplete'
import styles from './styles'
import { rootClassByWidth } from './styles'

export interface Props
extends BaseProps,
Expand Down Expand Up @@ -136,10 +133,6 @@ export interface Props
highlight?: 'autofill'
}

const useStyles = makeStyles<Theme>(styles, {
name: 'PicassoAutocomplete',
})

const getItemText = (item: Item | null) =>
(item && item.text) || EMPTY_INPUT_VALUE

Expand Down Expand Up @@ -206,8 +199,6 @@ export const Autocomplete = forwardRef<HTMLInputElement, Props>(
'Use the `status` prop instead. `error` is deprecated and will be removed in the next major release.',
})

const classes = useStyles()

const getKey = (item: Item) => {
if (customGetKey) {
return customGetKey(item)
Expand Down Expand Up @@ -256,8 +247,7 @@ export const Autocomplete = forwardRef<HTMLInputElement, Props>(
data-testid={testIds?.scrollMenu}
selectedIndex={highlightedIndex}
fixedFooter={
optionsLength > 0 &&
poweredByGoogle && <PoweredByGoogle classes={classes} />
optionsLength > 0 && poweredByGoogle && <PoweredByGoogle />
}
>
{options?.map((option, index) => (
Expand Down Expand Up @@ -310,13 +300,10 @@ export const Autocomplete = forwardRef<HTMLInputElement, Props>(

return (
<div
className={cx(
classes.root,
className,
classes[`root${capitalize(width)}` as 'rootAuto'],
{
[classes.horizontalLayout]: layout === 'horizontal',
}
className={twMerge(
'relative',
layout === 'horizontal' ? 'w-full' : rootClassByWidth[width],
className
)}
style={style}
role='combobox'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import type { JssProps } from '@toptal/picasso-shared'
import React from 'react'
import { Container } from '@toptal/picasso-container'

/**
* "You may not resize or modify these logos in any way." by the Google Policies
* https://developers.google.com/places/web-service/policies
*/
const PoweredByGoogle = ({ classes }: JssProps) => (
<Container flex justifyContent='flex-end' className={classes.poweredByGoogle}>
const PoweredByGoogle = () => (
<Container
flex
justifyContent='flex-end'
className='py-3 px-4 border-0 border-t border-solid border-t-gray-300'
>
<img
src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASAAAAAkCAYAAAApZeciAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABIKADAAQAAAABAAAAJAAAAAC2VHLSAAAaH0lEQVR4Ae1dC3RVxbnes08C1PAQgaBQH7AExRZBCA9tqeQErM9e8VW9Xh+LakWw9hZ7excCrRXQtkit7WoLtypo9RbFii4VbSEJFV9ICCAXpeCDh+gl4SEksUJy9tzv22f/+8zZ7HNyTiCReve/1p95/fPY/8x888/s2SfKiijSwBdQA+ffo485aDWcq7X1VTzely2tO1tKfWZp60O4G1SiaUXFj7vs/gI++j/VI6l/qtZGjY000IwGymbUfd2x1CRLOeOUsttnEne04yhLLcEE+GXFtE6VmeSi+NbVQARAravfqPQ20kDZPZ/2dpzEXKXUxflWqbV+3rZjE8rvPGZHvnm/qPIlC6+4Gvp8zH8+6Kf66qce9MNHyGMfoXKiYiINfG4aiM+sK3Uc562WgA8bzXzMT+vpc3uIo7BiG6gs3FrNiwCotTQbldsmGiid1XCptvSLSlnHmRXi7GePtqxfa0uNs7TTD9sxnAM5/SxlXQiL5z7wdlOe+R1bnW3GRf7W10BB61cR1dDGGhiM+q7x6qyA+5c8658M+Z5enqlwm/LM32bi7nmPTiw0z3q0dg5Ylj2jvV10/0t3qk9DGvMu4l6Mz9JTLF1/G8DrZ8wPwJpWOa3j7BD5KKoVNRABUCsqNyq69TQwesbeLjhF/u908IHVo2LnL59atKq5miumKgLrr+Iz6pZalh5bOa3Tr5rLE6UfeQ1EAHTkdRqV2AYaUHbh3XiDcqJUBQumTmn9DVgxGyQuF7dieifK55Unl3Ijmdw0EJ0B5aanSOoo0gDfeOE85xazSTjDmeSBiRkd+Y9yDUQAdJR3UNS8QzWAN1Y3pm29LF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FD3ibc9I1LOrZza8dZQ4VaMLGjFsqOiIw2IBr4Gj2zbXpHIyD2yGuCPkRWoY65FqZO01VAJ9/uZaig4+On5Aj6UgSVCa7bNKXgG1OYNiCr8wmuA28SR3lPuxFaUW/mIWkEDAB/caXKvFgzEIfNtvHIQVo376wFa/0LS3ANpnfc/sJTsh+VGFtBhqS/KnIMGhkNGDvZfzvccI4fyI5GUBubAO5fB5CVDvRifrMzFGdLDdqLpfUR2xcXLMpwrTU27hqDs+fivIod1HpZqQn6+yALKT1+RdH4aIPDwPhWJB/rrXF/0p1U0gF88nIfD5AVm4dhaTXDvQcViu5J3gGghpe5AQX67SiSmmXna0h8BUFtq+/9fXbzEyS0YaSWYr+0jakUN4GXfzTxQzqUKvo7Hxcx4RQ4/6p9LeS2Rid6CtURrUZ5cNdAFgrL92gd/BEC5au4w5fhRLoBoCrZbZcFvvmj14Nh5Xnu76P7Abx4dZq35ZxcAKvWyroeb6a5N/qVHOSINRBr4XDXAH1rD264B+IHo7vhBZiwCenvYt26fVyP/D6pKYxO86572AAAAAElFTkSuQmCC'
alt='Powered by Google'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ exports[`Autocomplete static behavior renders 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="PicassoAutocomplete-root PicassoAutocomplete-rootAuto"
class="relative w-[18.75rem]"
role="combobox"
>
<div
Expand Down
29 changes: 5 additions & 24 deletions packages/base/Autocomplete/src/Autocomplete/styles.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
import type { Theme } from '@material-ui/core/styles'
import { createStyles } from '@material-ui/core/styles'

export default ({ sizes: { input, borderWidth }, palette }: Theme) =>
createStyles({
root: {
position: 'relative',
width: input.width,
},
rootFull: {
width: '100%',
},
rootShrink: {
width: 'auto',
},
rootAuto: {},
poweredByGoogle: {
padding: '0.75rem 1rem',
borderTop: `${borderWidth} solid ${palette.grey.light}`,
},
horizontalLayout: {
width: '100%',
},
})
export const rootClassByWidth: Record<'full' | 'shrink' | 'auto', string> = {
full: 'w-full',
shrink: 'w-auto',
auto: 'w-[18.75rem]',
}
1 change: 1 addition & 0 deletions packages/base/Autocomplete/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"references": [
{ "path": "../../picasso-provider" },
{ "path": "../../picasso-tailwind" },
{ "path": "../../picasso-tailwind-merge" },
{ "path": "../../shared" },
{ "path": "../Container" },
{ "path": "../Form" },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`PageAutocomplete renders 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="PicassoAutocomplete-root PicassoAutocomplete-rootAuto"
class="relative w-[18.75rem]"
role="combobox"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`TagSelector disabled render 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="PicassoAutocomplete-root PicassoAutocomplete-rootAuto"
class="relative w-[18.75rem]"
role="combobox"
>
<div
Expand Down Expand Up @@ -76,7 +76,7 @@ exports[`TagSelector preselected value 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="PicassoAutocomplete-root PicassoAutocomplete-rootAuto"
class="relative w-[18.75rem]"
role="combobox"
>
<div
Expand Down Expand Up @@ -142,7 +142,7 @@ exports[`TagSelector renders 1`] = `
<div
aria-expanded="false"
aria-haspopup="listbox"
class="PicassoAutocomplete-root PicassoAutocomplete-rootAuto"
class="relative w-[18.75rem]"
role="combobox"
>
<div
Expand Down

0 comments on commit b9aee47

Please sign in to comment.