Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
},
"plugins": ["react"],
"rules": {
"space-before-function-paren": "off"
"space-before-function-paren": "off",
"no-unused-vars": "error",
"indent": "off",
"react/display-name": "off"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"sideEffects": false,
"scripts": {
"test": "yarn run eslint && ava",
"eslint": "eslint src/**/*.js --fix",
"eslint": "eslint 'src/**/*.js'",
"prepublishOnly": "rm -rf esm commonjs umd && yarn build",
"dev": "start-storybook -p 6006",
"create-package": "./tools/create-package.js",
Expand Down Expand Up @@ -142,7 +142,7 @@
},
"lint-staged": {
"!(codemods)/**/*.js": [
"yarn run eslint",
"yarn run eslint --fix",
"prettier --write"
],
"*.{json,md}": [
Expand Down
2 changes: 1 addition & 1 deletion src/autocomplete/src/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const AutocompleteItems = ({
highlightedIndex,
inputValue,
isFilterDisabled,
itemToString,
itemsFilter = fuzzyFilter(itemToString),
itemSize,
itemToString,
originalItems,
popoverMaxHeight,
renderItem,
Expand Down
3 changes: 2 additions & 1 deletion src/buttons/src/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { IconWrapper } from '../../icons/src/IconWrapper'
import { Spinner } from '../../spinner'
import useButtonAppearance from '../../theme/src/hooks/useButtonAppearance'

/* eslint-disable-next-line react/prop-types */
/* eslint-disable react/prop-types */
const ButtonIcon = memo(function ButtonIcon({ icon, size, spacing, edge }) {
if (!icon) return null

Expand All @@ -25,6 +25,7 @@ const ButtonIcon = memo(function ButtonIcon({ icon, size, spacing, edge }) {
/>
)
})
/* eslint-enable react/prop-types */

export const internalStyles = {
position: 'relative',
Expand Down
4 changes: 2 additions & 2 deletions src/checkbox/stories/index.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const refCallback = el => {
}

function IndeterminateWithRefExample() {
const ref = useRef()

useEffect(() => {
if (ref && ref.current) {
refCallback(ref.current)
}
}, [ref])

const ref = useRef()

return (
<Checkbox
checked
Expand Down
6 changes: 3 additions & 3 deletions src/corner-dialog/src/CornerDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import positions from '../../constants/src/Position'
import { CrossIcon } from '../../icons'

const animationEasing = {
deceleration: `cubic-bezier(0.0, 0.0, 0.2, 1)`,
acceleration: `cubic-bezier(0.4, 0.0, 1, 1)`,
spring: `cubic-bezier(0.175, 0.885, 0.320, 1.175)`
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)',
spring: 'cubic-bezier(0.175, 0.885, 0.320, 1.175)'
}

const ANIMATION_DURATION = 240
Expand Down
4 changes: 2 additions & 2 deletions src/dialog/src/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { Button, IconButton } from '../../buttons'
import { CrossIcon } from '../../icons'

const animationEasing = {
deceleration: `cubic-bezier(0.0, 0.0, 0.2, 1)`,
acceleration: `cubic-bezier(0.4, 0.0, 1, 1)`
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)'
}

const ANIMATION_DURATION = 200
Expand Down
3 changes: 2 additions & 1 deletion src/file-picker/src/FilePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ const FilePicker = memo(
const handleBlur = useCallback(
e => {
// Setting e.target.files to an array fails. It must be a FileList
if (e && e.target)
if (e && e.target) {
e.target.files =
fileInputRef && fileInputRef.current && fileInputRef.current.files
}

safeInvoke(onBlur, e)
},
Expand Down
10 changes: 5 additions & 5 deletions src/overlay/src/Overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const noop = () => {}
const emptyProps = {}

const animationEasing = {
standard: `cubic-bezier(0.4, 0.0, 0.2, 1)`,
deceleration: `cubic-bezier(0.0, 0.0, 0.2, 1)`,
acceleration: `cubic-bezier(0.4, 0.0, 1, 1)`,
sharp: `cubic-bezier(0.4, 0.0, 0.6, 1)`,
spring: `cubic-bezier(0.175, 0.885, 0.320, 1.175)`
standard: 'cubic-bezier(0.4, 0.0, 0.2, 1)',
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)',
sharp: 'cubic-bezier(0.4, 0.0, 0.6, 1)',
spring: 'cubic-bezier(0.175, 0.885, 0.320, 1.175)'
}

const ANIMATION_DURATION = 240
Expand Down
4 changes: 2 additions & 2 deletions src/positioner/src/Positioner.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useMergedRef, usePrevious } from '../../hooks'
import getPosition from './getPosition'

const animationEasing = {
spring: `cubic-bezier(0.175, 0.885, 0.320, 1.175)`
spring: 'cubic-bezier(0.175, 0.885, 0.320, 1.175)'
}

const getCSS = ({ initialScale, animationDuration }) => ({
Expand All @@ -21,7 +21,7 @@ const getCSS = ({ initialScale, animationDuration }) => ({
'&[data-state="entering"], &[data-state="entered"]': {
opacity: 1,
visibility: 'visible',
transform: `scale(1)`
transform: 'scale(1)'
},
'&[data-state="exiting"]': {
opacity: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/radio/src/Radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Radio = memo(
width={size}
height={size}
>
<CircleIcon size={size/2} />
<CircleIcon size={size / 2} />
</Box>
{label && (
<Text
Expand Down
3 changes: 2 additions & 1 deletion src/select-menu/src/OptionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ const OptionsList = memo(function OptionsList(props) {
[optionsFilter, searchValue]
)

const options = search(originalOptions)

const getFilteredOptions = useCallback(() => {
return search(options)
}, [options])
Expand Down Expand Up @@ -210,7 +212,6 @@ const OptionsList = memo(function OptionsList(props) {
}
}, [selected])

const options = search(originalOptions)
const listHeight = height - (hasFilter ? 32 : 0)
const currentIndex = getCurrentIndex()
const scrollToIndex = currentIndex === -1 ? 0 : currentIndex
Expand Down
52 changes: 26 additions & 26 deletions src/side-sheet/src/SheetClose.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { CrossIcon } from '../../icons'
import { Position } from '../../constants'

const animationEasing = {
deceleration: `cubic-bezier(0.0, 0.0, 0.2, 1)`,
acceleration: `cubic-bezier(0.4, 0.0, 1, 1)`
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)'
}

const ANIMATION_DURATION = 240
Expand All @@ -17,13 +17,13 @@ const sharedStyles = {
borderRadius: 9999,
position: 'absolute',
cursor: 'pointer',
backgroundColor: `rgba(255, 255, 255, 0.4)`,
transition: `background-color 120ms`,
backgroundColor: 'rgba(255, 255, 255, 0.4)',
transition: 'background-color 120ms',
'&:hover': {
backgroundColor: `rgba(255, 255, 255, 0.6)`
backgroundColor: 'rgba(255, 255, 255, 0.6)'
},
'&:active': {
backgroundColor: `rgba(255, 255, 255, 0.4)`
backgroundColor: 'rgba(255, 255, 255, 0.4)'
}
}

Expand All @@ -43,31 +43,31 @@ const sheetCloseStyles = {
left: 0,
marginLeft: -12,
marginTop: 12,
transform: `translateX(-100%)`,
transform: 'translateX(-100%)',
...withAnimations(
css.keyframes('rotate360InAnimation', {
from: { transform: `translateX(100%) rotate(0deg)` },
to: { transform: `translateX(-100%) rotate(-360deg)` }
from: { transform: 'translateX(100%) rotate(0deg)' },
to: { transform: 'translateX(-100%) rotate(-360deg)' }
}),
css.keyframes('rotate360OutAnimation', {
from: { transform: `translateX(-100%) rotate(0deg)` },
to: { transform: `translateX(100%) rotate(360deg)` }
from: { transform: 'translateX(-100%) rotate(0deg)' },
to: { transform: 'translateX(100%) rotate(360deg)' }
})
)
},
[Position.LEFT]: {
marginRight: -12,
right: 0,
marginTop: 12,
transform: `translateX(100%)`,
transform: 'translateX(100%)',
...withAnimations(
css.keyframes('leftRotate360InAnimation', {
from: { transform: `translateX(-100%) rotate(0deg)` },
to: { transform: `translateX(100%), rotate(360deg)` }
from: { transform: 'translateX(-100%) rotate(0deg)' },
to: { transform: 'translateX(100%), rotate(360deg)' }
}),
css.keyframes('leftRotate360OutAnimation', {
from: { transform: `translateX(100%) rotate(0deg)` },
to: { transform: `translateX(-100%), rotate(360deg)` }
from: { transform: 'translateX(100%) rotate(0deg)' },
to: { transform: 'translateX(-100%), rotate(360deg)' }
})
)
},
Expand All @@ -76,15 +76,15 @@ const sheetCloseStyles = {
marginRight: 12,
top: '100%',
marginTop: 12,
transform: `translateY(0)`,
transform: 'translateY(0)',
...withAnimations(
css.keyframes('topRotate360InAnimation', {
from: { transform: `translateY(-200%) rotate(0deg)` },
to: { transform: `translateY(0%), rotate(360deg)` }
from: { transform: 'translateY(-200%) rotate(0deg)' },
to: { transform: 'translateY(0%), rotate(360deg)' }
}),
css.keyframes('topRotate360OutAnimation', {
from: { transform: `translateY(0%) rotate(0deg)` },
to: { transform: `translateY(-200%), rotate(360deg)` }
from: { transform: 'translateY(0%) rotate(0deg)' },
to: { transform: 'translateY(-200%), rotate(360deg)' }
})
)
},
Expand All @@ -93,15 +93,15 @@ const sheetCloseStyles = {
marginRight: 12,
bottom: '100%',
marginBottom: 12,
transform: `translateY(0)`,
transform: 'translateY(0)',
...withAnimations(
css.keyframes('bottomRotate360InAnimation', {
from: { transform: `translateY(200%) rotate(0deg)` },
to: { transform: `translateY(0%), rotate(360deg)` }
from: { transform: 'translateY(200%) rotate(0deg)' },
to: { transform: 'translateY(0%), rotate(360deg)' }
}),
css.keyframes('bottomRotate360OutAnimation', {
from: { transform: `translateY(0%) rotate(0deg)` },
to: { transform: `translateY(200%), rotate(360deg)` }
from: { transform: 'translateY(0%) rotate(0deg)' },
to: { transform: 'translateY(200%), rotate(360deg)' }
})
)
}
Expand Down
44 changes: 22 additions & 22 deletions src/side-sheet/src/SideSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const subpaneProps = {
}

const animationEasing = {
deceleration: `cubic-bezier(0.0, 0.0, 0.2, 1)`,
acceleration: `cubic-bezier(0.4, 0.0, 1, 1)`
deceleration: 'cubic-bezier(0.0, 0.0, 0.2, 1)',
acceleration: 'cubic-bezier(0.4, 0.0, 1, 1)'
}

const ANIMATION_DURATION = 240
Expand All @@ -72,54 +72,54 @@ const withAnimations = (animateIn, animateOut) => {

const animationStylesClass = {
[Position.LEFT]: {
transform: `translateX(-100%)`,
transform: 'translateX(-100%)',
...withAnimations(
css.keyframes('anchoredLeftSlideInAnimation', {
from: { transform: `translateX(-100%)` },
to: { transform: `translateX(0)` }
from: { transform: 'translateX(-100%)' },
to: { transform: 'translateX(0)' }
}),
css.keyframes('anchoredLeftSlideOutAnimation', {
from: { transform: `translateX(0)` },
to: { transform: `translateX(-100%)` }
from: { transform: 'translateX(0)' },
to: { transform: 'translateX(-100%)' }
})
)
},
[Position.RIGHT]: {
transform: `translateX(100%)`,
transform: 'translateX(100%)',
...withAnimations(
css.keyframes('anchoredRightSlideInAnimation', {
from: { transform: `translateX(100%)` },
to: { transform: `translateX(0)` }
from: { transform: 'translateX(100%)' },
to: { transform: 'translateX(0)' }
}),
css.keyframes('anchoredRightSlideOutAnimation', {
from: { transform: `translateX(0)` },
to: { transform: `translateX(100%)` }
from: { transform: 'translateX(0)' },
to: { transform: 'translateX(100%)' }
})
)
},
[Position.TOP]: {
transform: `translateY(-100%)`,
transform: 'translateY(-100%)',
...withAnimations(
css.keyframes('anchoredTopSlideInAnimation', {
from: { transform: `translateY(-100%)` },
to: { transform: `translateY(0)` }
from: { transform: 'translateY(-100%)' },
to: { transform: 'translateY(0)' }
}),
css.keyframes('anchoredTopSlideOutAnimation', {
from: { transform: `translateY(0)` },
to: { transform: `translateY(-100%)` }
from: { transform: 'translateY(0)' },
to: { transform: 'translateY(-100%)' }
})
)
},
[Position.BOTTOM]: {
transform: `translateY(100%)`,
transform: 'translateY(100%)',
...withAnimations(
css.keyframes('anchoredBottomSlideInAnimation', {
from: { transform: `translateY(100%)` },
to: { transform: `translateY(0)` }
from: { transform: 'translateY(100%)' },
to: { transform: 'translateY(0)' }
}),
css.keyframes('anchoredBottomSlideOutAnimation', {
from: { transform: `translateY(0)` },
to: { transform: `translateY(100%)` }
from: { transform: 'translateY(0)' },
to: { transform: 'translateY(100%)' }
})
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/switch/src/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Box, { spacing, position, layout } from 'ui-box'
import useSwitchAppearance from '../../theme/src/hooks/useSwitchAppearance'

const animationEasing = {
spring: `cubic-bezier(0.175, 0.885, 0.320, 1.175)`
spring: 'cubic-bezier(0.175, 0.885, 0.320, 1.175)'
}

const handleStyleClass = css({
Expand Down
2 changes: 1 addition & 1 deletion src/table/src/EditableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const EditableCell = memo(function EditableCell(props) {
}}
{...rest}
>
{children ? children : placeholder}
{children || placeholder}
</TextTableCell>
{isEditing && (
<Portal>
Expand Down
2 changes: 1 addition & 1 deletion src/table/src/SearchTableHeaderCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const invisibleInputClass = css({
},

'&::placeholder': {
color: `rgba(67, 90, 111, 0.7)`
color: 'rgba(67, 90, 111, 0.7)'
}
}).toString()

Expand Down
Loading