This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MyComponent() { | |
return null; | |
} | |
function MySettingsList() { | |
return ( | |
<SettingsList action={{ content: 'Click me' }}> | |
<MyComponent /> | |
</SettingsList> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dropdown } from '@invisionapp/helios' | |
import { useState } from 'react' | |
function Component(props) { | |
const [isOpen, setIsOpen] = useState(false) | |
const handleToggleVisibility = () => { | |
setIsOpen(!isOpen) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function C() { | |
const [open, setOpen] = useState(false) | |
return ( | |
<> | |
<Tooltip {..props} open={open} onChangeVisibility={setOpen} /> | |
<button onClick={() => setOpen(!open)}>I will toggle the Tooltip</button> | |
</> | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function C() { | |
return ( | |
<> | |
<Tooltip {...props } /> | |
<button>I am an entirely different element that when clicked will open the Tooltip</button> | |
</> | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper { | |
height: 36px; | |
width: 100%; | |
position: relative; | |
} | |
.inner { | |
position: absolute; | |
right: 0; | |
top: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyComponent extends Component { | |
componentDidMount() { | |
this.doSideEffect(this.props.foo) | |
} | |
componentDidUpdate(prev) { | |
if (prev.foo !== this.props.foo) { | |
this.doSideEffect(this.props.foo) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ReactNode, ElementType } from 'react' | |
import cx from 'classnames' | |
import getTag from '../../helpers/getTag' | |
import { Omit, HTMLProps } from '../../helpers/omitType' | |
export const colors = [ | |
'constants-white', | |
'constants-black', | |
'text-0', | |
'text-20', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styled from 'styled-components' | |
import { Text } from '@invisionapp/helios' | |
export const Root = styled(({ forceRender, ...props } => <Text {...props />)` | |
background: ${({ forceRender }) => forceRender ? 'red' : 'white'} | |
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--hds-spacing-1: 4px; | |
--hds-spacing-2: 8px; | |
/* etc */ | |
} | |
.hds-theme-light { | |
--hds-palette-primary-100: #ff3366; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react' | |
import { Textarea } from '@invisionapp/helios' | |
function MyComponent() { | |
const [value, setValue] = useState('') | |
function handleChange(evt) { | |
setValue(evt.target.value) | |
} | |
NewerOlder