Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c33a720
breaking(Portal): use createPortal() API (#2755)
layershifter May 13, 2018
88c94d4
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
layershifter May 26, 2018
762618a
feat(Flag|Icon): use PureComponent instead of shallowEqual() (#2842)
layershifter May 26, 2018
1c0aecf
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
Jun 6, 2018
8cf6884
fix(IconSearch): remove prop
Jun 6, 2018
ae7f413
fix(PortalInner): remove meta
Jun 6, 2018
1d46672
fix(Portal): fix broken test
Jun 6, 2018
a895a28
fix(Modal): go away from rootNode
Jun 6, 2018
1db2802
fix(Flag|Icon): remove unused import
Jun 6, 2018
1b9ed77
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
Jun 12, 2018
f6e4d8f
feat(Portal): add `triggerRef` prop (#2902)
layershifter Jun 12, 2018
738e8db
fix(Popup): fix test
Jun 12, 2018
492cd90
BREAKING(Accordion): refactor shorthand API to use AccordionPanel (#2…
layershifter Jun 15, 2018
795f8be
Merge branch 'master' into react-16
layershifter Jun 15, 2018
fd2cb59
style(Accordion): add description
Jun 18, 2018
f039af3
fix(tests): reenable throw on console.log()
Jun 18, 2018
6c96faf
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
Jun 25, 2018
cf5f86f
style(mixed): lint issues in typings
Jun 25, 2018
88a18c1
merge master
levithomason Jun 26, 2018
08f6c15
fix yarn.lock
levithomason Jun 26, 2018
68cbdd0
fix(ComponentDocLinks): add rel="noopener noreferrer"
levithomason Jun 26, 2018
051ca32
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
Jun 27, 2018
2b4e22f
Merge branch 'react-16' of https://github.com/Semantic-Org/Semantic-U…
Jun 27, 2018
dbe6e78
revert styling changes
Jun 27, 2018
671e923
restore yarn.lock from master
Jun 27, 2018
e2361e6
Merge branch 'master' into react-16
layershifter Jun 27, 2018
2cf45b3
Merge branch 'master' of https://github.com/Semantic-Org/Semantic-UI-…
layershifter Jun 29, 2018
89c1b96
style(Portal): remove render method
layershifter Jun 29, 2018
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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"semi": [2, "never"],
"jsx-a11y/alt-text": 1,
"jsx-a11y/label-has-for": 1,
"jsx-a11y/no-static-element-interactions": 1,
"jsx-a11y/role-has-required-aria-props": 1,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
Expand Down
4 changes: 2 additions & 2 deletions docs/src/components/ComponentDoc/ComponentDocLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default class ComponentDocLinks extends PureComponent {
<List.Item
content={
<code>
<a href={ghLink} target='_blank'>
<a href={ghLink} target='_blank' rel='noopener noreferrer'>
{repoPath}
</a>
</code>
Expand All @@ -43,7 +43,7 @@ export default class ComponentDocLinks extends PureComponent {
{suiLink && (
<List.Item
content={
<a href={suiLink} target='_blank'>
<a href={suiLink} target='_blank' rel='noopener noreferrer'>
Semantic UI {displayName} Docs
</a>
}
Expand Down
1 change: 0 additions & 1 deletion docs/src/components/IconSearch/IconSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ export default class IconSearch extends Component {
mouseEnterDelay={1000}
inverted
closeOnTriggerClick={false}
closeOnRootNodeClick={false}
closeOnDocumentClick={false}
style={{ width: '8em', textAlign: 'center' }}
size='mini'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { Accordion, Button, Form, Segment } from 'semantic-ui-react'

const panels = [
{
key: 'details',
title: 'Optional Details',
content: {
as: Form.Input,
key: 'content',
label: 'Maiden Name',
placeholder: 'Maiden Name',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react'
import { Accordion } from 'semantic-ui-react'

const level1Panels = [
{ title: 'Level 1A', content: 'Level 1A Contents' },
{ title: 'Level 1B', content: 'Level 1B Contents' },
{ key: 'panel-1a', title: 'Level 1A', content: 'Level 1A Contents' },
{ key: 'panel-ba', title: 'Level 1B', content: 'Level 1B Contents' },
]

const Level1Content = (
Expand All @@ -14,8 +14,8 @@ const Level1Content = (
)

const level2Panels = [
{ title: 'Level 2A', content: 'Level 2A Contents' },
{ title: 'Level 2B', content: 'Level 2B Contents' },
{ key: 'panel-2a', title: 'Level 2A', content: 'Level 2A Contents' },
{ key: 'panel-2b', title: 'Level 2B', content: 'Level 2B Contents' },
]

const Level2Content = (
Expand All @@ -26,8 +26,8 @@ const Level2Content = (
)

const rootPanels = [
{ title: 'Level 1', content: { content: Level1Content, key: 'content-1' } },
{ title: 'Level 2', content: { content: Level2Content, key: 'content-2' } },
{ key: 'panel-1', title: 'Level 1', content: { content: Level1Content } },
{ key: 'panel-2', title: 'Level 2', content: { content: Level2Content } },
]

const AccordionExampleNested = () => <Accordion defaultActiveIndex={0} panels={rootPanels} styled />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import React from 'react'
import { Accordion, Label, Message } from 'semantic-ui-react'

const panels = _.times(3, i => ({
key: `panel-${i}`,
title: {
content: <Label color='blue' content={faker.lorem.sentence()} />,
key: `title-${i}`,
},
content: {
content: <Message info header={faker.lorem.sentence()} content={faker.lorem.paragraph()} />,
key: `content-${i}`,
},
}))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,23 @@ import { Accordion } from 'semantic-ui-react'

const panels = [
{
key: 'what-is-dog',
title: 'What is a dog?',
content: [
'A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome',
'guest in many households across the world.',
].join(' '),
},
{
key: 'kinds-of-dogs',
title: 'What kinds of dogs are there?',
content: [
'There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog',
'that they find to be compatible with their own lifestyle and desires from a companion.',
].join(' '),
},
{
key: 'acquire-dog',
title: 'How do you acquire a dog?',
content: {
content: (
Expand All @@ -33,7 +36,6 @@ const panels = [
</p>
</div>
),
key: 'content-dog',
},
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import _ from 'lodash'
import React, { Component } from 'react'
import { Accordion, Segment } from 'semantic-ui-react'

const panels = _.times(3, () => ({
const panels = _.times(3, i => ({
key: `panel-${i}`,
title: faker.lorem.sentence(),
content: faker.lorem.paragraphs(),
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import _ from 'lodash'
import React from 'react'
import { Accordion } from 'semantic-ui-react'

const panels = _.times(3, () => ({
const panels = _.times(3, i => ({
key: `panel-${i}`,
title: faker.lorem.sentence(),
content: faker.lorem.paragraphs(),
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { Button, Modal } from 'semantic-ui-react'
class ModalExampleCloseConfig extends Component {
state = { open: false }

closeConfigShow = (closeOnEscape, closeOnRootNodeClick) => () => {
this.setState({ closeOnEscape, closeOnRootNodeClick, open: true })
closeConfigShow = (closeOnEscape, closeOnDimmerClick) => () => {
this.setState({ closeOnEscape, closeOnDimmerClick, open: true })
}

close = () => this.setState({ open: false })

render() {
const { open, closeOnEscape, closeOnRootNodeClick } = this.state
const { open, closeOnEscape, closeOnDimmerClick } = this.state

return (
<div>
Expand All @@ -21,7 +21,8 @@ class ModalExampleCloseConfig extends Component {
<Modal
open={open}
closeOnEscape={closeOnEscape}
closeOnRootNodeClick={closeOnRootNodeClick}
closeOnDimmerClick={closeOnDimmerClick}
onClose={this.close}
>
<Modal.Header>Delete Your Account</Modal.Header>
<Modal.Content>
Expand Down
9 changes: 8 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ export {
PaginationItemProps,
} from './dist/commonjs/addons/Pagination/PaginationItem'
export { default as Portal, PortalProps } from './dist/commonjs/addons/Portal'
export {
default as PortalInner,
PortalInnerProps,
} from './dist/commonjs/addons/Portal/PortalInner'
export { default as Radio, RadioProps } from './dist/commonjs/addons/Radio'
export { default as Ref, RefProps } from './dist/commonjs/addons/Ref'
export {
Expand Down Expand Up @@ -212,12 +216,15 @@ export { default as Accordion, AccordionProps } from './dist/commonjs/modules/Ac
export {
default as AccordionAccordion,
AccordionAccordionProps,
AccordionPanelProps,
} from './dist/commonjs/modules/Accordion/AccordionAccordion'
export {
default as AccordionContent,
AccordionContentProps,
} from './dist/commonjs/modules/Accordion/AccordionContent'
export {
default as AccordionPanel,
AccordionPanelProps,
} from './dist/commonjs/modules/Accordion/AccordionPanel'
export {
default as AccordionTitle,
AccordionTitleProps,
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"webpack-hot-middleware": "^2.18.2"
},
"peerDependencies": {
"react": ">=0.14.0 <= 16",
"react-dom": ">=0.14.0 <= 16"
"react": "^16.0.0",
"react-dom": "^16.0.0"
}
}
26 changes: 11 additions & 15 deletions src/addons/Portal/Portal.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as React from 'react'
import { default as PortalInner } from './PortalInner'

export interface PortalProps {
[key: string]: any

/** Primary content. */
children?: React.ReactNode

/** Additional classes. */
className?: string

/** Controls whether or not the portal should close on a click outside. */
closeOnDocumentClick?: boolean

Expand All @@ -22,14 +20,6 @@ export interface PortalProps {
*/
closeOnPortalMouseLeave?: boolean

/**
* Controls whether or not the portal should close on a click on the portal background.
* NOTE: This differs from closeOnDocumentClick:
* - DocumentClick - any click not within the portal
* - RootNodeClick - a click not within the portal but within the portal's wrapper
*/
closeOnRootNodeClick?: boolean

/** Controls whether or not the portal should close on blur of the trigger. */
closeOnTriggerBlur?: boolean

Expand Down Expand Up @@ -98,13 +88,19 @@ export interface PortalProps {
/** Controls whether or not the portal should open when mousing over the trigger. */
openOnTriggerMouseEnter?: boolean

/** Controls whether the portal should be prepended to the mountNode instead of appended. */
prepend?: boolean

/** Element to be rendered in-place where the portal is defined. */
trigger?: React.ReactNode

/**
* Called when componentDidMount.
*
* @param {HTMLElement} node - Referred node.
*/
triggerRef?: (node: HTMLElement) => void
}

declare const Portal: React.ComponentClass<PortalProps>
declare class Portal extends React.Component<PortalProps, {}> {
static Inner: typeof PortalInner
}

export default Portal
Loading