From 3802e1146c95fa3536a11c5c4aa73735efbd17c6 Mon Sep 17 00:00:00 2001 From: Levi Thomason Date: Sat, 20 Oct 2018 09:08:25 -0700 Subject: [PATCH 01/38] docs(changelog): update changelog [ci skip] --- CHANGELOG.md | 68 +++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd2d3bdc63..3b21b90a2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # Change Log +## [v0.83.0](https://github.com/Semantic-Org/Semantic-UI-React/tree/v0.83.0) (2018-10-20) +[Full Changelog](https://github.com/Semantic-Org/Semantic-UI-React/compare/v0.82.5...v0.83.0) + +**Merged pull requests:** + +- fix\(Input\): fix typings for onChange [\#3230](https://github.com/Semantic-Org/Semantic-UI-React/pull/3230) ([layershifter](https://github.com/layershifter)) +- docs\(Layouts\): fix examples with incorrect props [\#3227](https://github.com/Semantic-Org/Semantic-UI-React/pull/3227) ([AlanFoster](https://github.com/AlanFoster)) +- docs\(Ads\): fix rendering in SSR [\#3218](https://github.com/Semantic-Org/Semantic-UI-React/pull/3218) ([layershifter](https://github.com/layershifter)) +- docs\(Ads\): fix multiple ads [\#3215](https://github.com/Semantic-Org/Semantic-UI-React/pull/3215) ([layershifter](https://github.com/layershifter)) +- chore\(build\): update babel deps, fix production build of docs and build on Windows [\#3214](https://github.com/Semantic-Org/Semantic-UI-React/pull/3214) ([layershifter](https://github.com/layershifter)) +- docs\(Search\): fix resolver imports [\#3213](https://github.com/Semantic-Org/Semantic-UI-React/pull/3213) ([layershifter](https://github.com/layershifter)) +- docs\(README\): fix link to CSS Usage page [\#3212](https://github.com/Semantic-Org/Semantic-UI-React/pull/3212) ([jahvi](https://github.com/jahvi)) +- fix\(typings\): fix definition for SemanticShorthandItemFunc [\#3204](https://github.com/Semantic-Org/Semantic-UI-React/pull/3204) ([layershifter](https://github.com/layershifter)) +- docs\(Prototypes\): add example integration with redux-form [\#3203](https://github.com/Semantic-Org/Semantic-UI-React/pull/3203) ([layershifter](https://github.com/layershifter)) +- docs\(mixed\): add MDX support, update pages, styling updates [\#3196](https://github.com/Semantic-Org/Semantic-UI-React/pull/3196) ([layershifter](https://github.com/layershifter)) +- feat\(Sidebar\): add `target` prop [\#3191](https://github.com/Semantic-Org/Semantic-UI-React/pull/3191) ([layershifter](https://github.com/layershifter)) +- BREAKING\(eventStack\): fix issues with event subscriptions [\#3189](https://github.com/Semantic-Org/Semantic-UI-React/pull/3189) ([layershifter](https://github.com/layershifter)) +- fix\(Input\): pass `title` down to an input element [\#3187](https://github.com/Semantic-Org/Semantic-UI-React/pull/3187) ([layershifter](https://github.com/layershifter)) +- docs\(props\): improve parsing of customPropTypes.every\(\) [\#3185](https://github.com/Semantic-Org/Semantic-UI-React/pull/3185) ([layershifter](https://github.com/layershifter)) +- fix\(Grid\): improve propTypes check for width props [\#3184](https://github.com/Semantic-Org/Semantic-UI-React/pull/3184) ([layershifter](https://github.com/layershifter)) +- fix\(customPropTypes|typings\): allow to pass a function to itemShorthand, update typings [\#3183](https://github.com/Semantic-Org/Semantic-UI-React/pull/3183) ([layershifter](https://github.com/layershifter)) +- docs\(Advertisement\): update a base Advertisement example [\#3179](https://github.com/Semantic-Org/Semantic-UI-React/pull/3179) ([layershifter](https://github.com/layershifter)) +- docs\(Document\): use only https sources [\#3178](https://github.com/Semantic-Org/Semantic-UI-React/pull/3178) ([layershifter](https://github.com/layershifter)) +- docs\(Grid\): fix typo in GridExampleStretched example description [\#3167](https://github.com/Semantic-Org/Semantic-UI-React/pull/3167) ([sgarrity](https://github.com/sgarrity)) +- chore\(package\): update to SUI 2.4.0 [\#3162](https://github.com/Semantic-Org/Semantic-UI-React/pull/3162) ([layershifter](https://github.com/layershifter)) +- docs\(Form\): add an example of accessible Form.Select [\#3157](https://github.com/Semantic-Org/Semantic-UI-React/pull/3157) ([arthurdenner](https://github.com/arthurdenner)) +- chore\(typings\): add strict props [\#3107](https://github.com/Semantic-Org/Semantic-UI-React/pull/3107) ([evollu](https://github.com/evollu)) +- chore\(Sidebar\): use EventStack component [\#2990](https://github.com/Semantic-Org/Semantic-UI-React/pull/2990) ([layershifter](https://github.com/layershifter)) + ## [v0.82.5](https://github.com/Semantic-Org/Semantic-UI-React/tree/v0.82.5) (2018-09-12) [Full Changelog](https://github.com/Semantic-Org/Semantic-UI-React/compare/v0.82.4...v0.82.5) @@ -223,7 +252,7 @@ - fix\(Checkbox\): only add "fitted" class if label is nil [\#2660](https://github.com/Semantic-Org/Semantic-UI-React/pull/2660) ([SimonKinds](https://github.com/SimonKinds)) - docs\(changelog\): capture all PRs [\#2659](https://github.com/Semantic-Org/Semantic-UI-React/pull/2659) ([levithomason](https://github.com/levithomason)) - docs\(readme\): add Distense to the built with list [\#2655](https://github.com/Semantic-Org/Semantic-UI-React/pull/2655) ([JohnAllen](https://github.com/JohnAllen)) -- docs\(Responsive\): fix spelling [\#2653](https://github.com/Semantic-Org/Semantic-UI-React/pull/2653) ([cptbrkfst](https://github.com/cptbrkfst)) +- docs\(Responsive\): fix spelling [\#2653](https://github.com/Semantic-Org/Semantic-UI-React/pull/2653) ([dyyyl](https://github.com/dyyyl)) - docs\(Search\): debounce search change handler [\#2650](https://github.com/Semantic-Org/Semantic-UI-React/pull/2650) ([ryanflowers](https://github.com/ryanflowers)) - fix\(Input\): add missing accept prop [\#2647](https://github.com/Semantic-Org/Semantic-UI-React/pull/2647) ([fastman](https://github.com/fastman)) - fix\(factories\): fix typo in exception [\#2645](https://github.com/Semantic-Org/Semantic-UI-React/pull/2645) ([eightnoteight](https://github.com/eightnoteight)) @@ -348,43 +377,6 @@ - docs\(ComponentSidebar\): add sidebar navigation [\#2070](https://github.com/Semantic-Org/Semantic-UI-React/pull/2070) ([layershifter](https://github.com/layershifter)) - docs\(DropdownExamplePointing\): Fix nested Dropdown [\#1644](https://github.com/Semantic-Org/Semantic-UI-React/pull/1644) ([Jimeno0](https://github.com/Jimeno0)) -## [v0.76.0](https://github.com/Semantic-Org/Semantic-UI-React/tree/v0.76.0) (2017-11-04) -[Full Changelog](https://github.com/Semantic-Org/Semantic-UI-React/compare/v0.75.1...v0.76.0) - -**Merged pull requests:** - -- docs\(readme\): update link and desc of `react-semantic.ui-starter` [\#2288](https://github.com/Semantic-Org/Semantic-UI-React/pull/2288) ([Metnew](https://github.com/Metnew)) -- docs\(readme\): add Bandwidth Hero to built with [\#2284](https://github.com/Semantic-Org/Semantic-UI-React/pull/2284) ([ayastreb](https://github.com/ayastreb)) -- docs\(Advertisement\): fix AdvertisementExampleBannerTop example [\#2275](https://github.com/Semantic-Org/Semantic-UI-React/pull/2275) ([tuzhu008](https://github.com/tuzhu008)) -- docs\(HOC\): remove reexport to avoid warning in test [\#2270](https://github.com/Semantic-Org/Semantic-UI-React/pull/2270) ([layershifter](https://github.com/layershifter)) -- chore\(test\): fix browser config [\#2269](https://github.com/Semantic-Org/Semantic-UI-React/pull/2269) ([layershifter](https://github.com/layershifter)) -- Update README.md [\#2268](https://github.com/Semantic-Org/Semantic-UI-React/pull/2268) ([garysieling](https://github.com/garysieling)) -- fix\(Modal\): fix errors with SSR [\#2260](https://github.com/Semantic-Org/Semantic-UI-React/pull/2260) ([adam-26](https://github.com/adam-26)) -- docs\(README\): fix URL collision [\#2258](https://github.com/Semantic-Org/Semantic-UI-React/pull/2258) ([neslinesli93](https://github.com/neslinesli93)) -- docs\(README\): add ForecastCycles to built-with list [\#2257](https://github.com/Semantic-Org/Semantic-UI-React/pull/2257) ([neslinesli93](https://github.com/neslinesli93)) -- fix\(Modal\): fix state update after close [\#2254](https://github.com/Semantic-Org/Semantic-UI-React/pull/2254) ([layershifter](https://github.com/layershifter)) -- fix\(Dropdown\): isEqual over shallowEqual for props [\#2252](https://github.com/Semantic-Org/Semantic-UI-React/pull/2252) ([chrisjbrown](https://github.com/chrisjbrown)) -- docs\(Dropdown\): add dedicated example for controlled Dropdown [\#2251](https://github.com/Semantic-Org/Semantic-UI-React/pull/2251) ([layershifter](https://github.com/layershifter)) -- fix\(docs\): fix propTypes warnings [\#2244](https://github.com/Semantic-Org/Semantic-UI-React/pull/2244) ([layershifter](https://github.com/layershifter)) -- docs\(Accordion\): fix typo in AccordionExampleForm [\#2239](https://github.com/Semantic-Org/Semantic-UI-React/pull/2239) ([rabbl](https://github.com/rabbl)) -- docs\(README\): add gitconnected to built-with list [\#2238](https://github.com/Semantic-Org/Semantic-UI-React/pull/2238) ([treyhuffine](https://github.com/treyhuffine)) -- feat\(Grid\): allow multiple values for `reversed` prop [\#2235](https://github.com/Semantic-Org/Semantic-UI-React/pull/2235) ([layershifter](https://github.com/layershifter)) -- fix\(Portal\): pass additional agruments to trigger handlers [\#2234](https://github.com/Semantic-Org/Semantic-UI-React/pull/2234) ([layershifter](https://github.com/layershifter)) -- docs\(Usage\): switch from NPM to yarn [\#2232](https://github.com/Semantic-Org/Semantic-UI-React/pull/2232) ([lielfr](https://github.com/lielfr)) -- docs\(Views\): add \ tags to docs [\#2231](https://github.com/Semantic-Org/Semantic-UI-React/pull/2231) ([RetroCraft](https://github.com/RetroCraft)) -- docs\(Ref\): add a basic example [\#2226](https://github.com/Semantic-Org/Semantic-UI-React/pull/2226) ([layershifter](https://github.com/layershifter)) -- breaking\(Image\): Inconsistent prop usage between Image and Icon for circular shape [\#2225](https://github.com/Semantic-Org/Semantic-UI-React/pull/2225) ([RetroCraft](https://github.com/RetroCraft)) -- feat\(Dropdown\): make deburr opt-in, and deburr input [\#2223](https://github.com/Semantic-Org/Semantic-UI-React/pull/2223) ([patrikmolsson](https://github.com/patrikmolsson)) -- docs\(Icon\): fix similar icon search [\#2220](https://github.com/Semantic-Org/Semantic-UI-React/pull/2220) ([patrikmolsson](https://github.com/patrikmolsson)) -- feat\(Portal\): use Ref for handling trigger refs [\#2219](https://github.com/Semantic-Org/Semantic-UI-React/pull/2219) ([layershifter](https://github.com/layershifter)) -- docs\(index\): don't use prod libs in dev [\#2216](https://github.com/Semantic-Org/Semantic-UI-React/pull/2216) ([levithomason](https://github.com/levithomason)) -- docs\(Props\): make large code blocks more legible [\#2215](https://github.com/Semantic-Org/Semantic-UI-React/pull/2215) ([redbmk](https://github.com/redbmk)) -- fix\(Popup\): execute `onClose` when Popup closes on scroll [\#2182](https://github.com/Semantic-Org/Semantic-UI-React/pull/2182) ([mkarajohn](https://github.com/mkarajohn)) -- feat\(TransitionablePortal\): add component [\#2155](https://github.com/Semantic-Org/Semantic-UI-React/pull/2155) ([layershifter](https://github.com/layershifter)) -- perf\(customPropTypes\): Memoize `suggest` [\#2149](https://github.com/Semantic-Org/Semantic-UI-React/pull/2149) ([ayastreb](https://github.com/ayastreb)) -- feat\(Responsive\): add `fireOnMount` prop [\#2137](https://github.com/Semantic-Org/Semantic-UI-React/pull/2137) ([layershifter](https://github.com/layershifter)) -- docs\(ComponentDoc\): refactor and optimize [\#2123](https://github.com/Semantic-Org/Semantic-UI-React/pull/2123) ([layershifter](https://github.com/layershifter)) - \* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file From adc342791d0b3400ec4c2db4949f131b6f0fe224 Mon Sep 17 00:00:00 2001 From: Xiao Hanyu Date: Tue, 23 Oct 2018 21:34:05 +0800 Subject: [PATCH 02/38] fix(Layouts): fix typo in FixedMenuLayout fix(Layouts): fix typo in FixedMenuLayout --- docs/src/layouts/FixedMenuLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/layouts/FixedMenuLayout.js b/docs/src/layouts/FixedMenuLayout.js index 8ad516740f..642869b322 100644 --- a/docs/src/layouts/FixedMenuLayout.js +++ b/docs/src/layouts/FixedMenuLayout.js @@ -88,7 +88,7 @@ const FixedMenuLayout = () => ( Link Four - +

Extra space for a call to action inside the footer that could help re-engage users. From 2388aa87d55a4a86fa9fddeaab89ab667536c01c Mon Sep 17 00:00:00 2001 From: Xiao Hanyu Date: Tue, 23 Oct 2018 21:50:24 +0800 Subject: [PATCH 03/38] fix(Layouts): fix typo in StickyLayout (#3235) fix(Layouts): fix typo in StickyLayout --- docs/src/layouts/StickyLayout.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/layouts/StickyLayout.js b/docs/src/layouts/StickyLayout.js index 9a138d7b19..61c1421c26 100644 --- a/docs/src/layouts/StickyLayout.js +++ b/docs/src/layouts/StickyLayout.js @@ -270,7 +270,7 @@ export default class StickyLayout extends Component { - + Site Map From f140550d096d129965e44d0faeffcdfdb8a42b6e Mon Sep 17 00:00:00 2001 From: Alexander Fedyashov Date: Tue, 23 Oct 2018 17:00:41 +0300 Subject: [PATCH 04/38] docs(Usage): fix link to Semantic UI CSS (#3236) --- docs/src/pages/Usage.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/pages/Usage.mdx b/docs/src/pages/Usage.mdx index 3a619ea4f9..c98bb5fd67 100644 --- a/docs/src/pages/Usage.mdx +++ b/docs/src/pages/Usage.mdx @@ -59,7 +59,7 @@ custom themes with this method. `} + value={``} /> ### Semantic UI CSS package From 79d5da8ebfd6c8fa0fd9318aac914758943506f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Kindstr=C3=B6m?= Date: Tue, 23 Oct 2018 16:25:06 +0200 Subject: [PATCH 05/38] fix(Accordion): log error if incorrect activeIndex type (#3199) fix(Accordion): log error if incorrect activeIndex type --- src/modules/Accordion/AccordionAccordion.js | 25 +++++++++++++++++++ .../Accordion/AccordionAccordion-test.js | 20 ++++++++++++++- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/modules/Accordion/AccordionAccordion.js b/src/modules/Accordion/AccordionAccordion.js index be3aec0326..ac90e4169f 100644 --- a/src/modules/Accordion/AccordionAccordion.js +++ b/src/modules/Accordion/AccordionAccordion.js @@ -13,6 +13,19 @@ import { } from '../../lib' import AccordionPanel from './AccordionPanel' +const warnIfPropsAreInvalid = (props, state) => { + const { exclusive } = props + const { activeIndex } = state + + /* eslint-disable no-console */ + if (exclusive && typeof activeIndex !== 'number') { + console.error('`activeIndex` must be a number if `exclusive` is true') + } else if (!exclusive && !_.isArray(activeIndex)) { + console.error('`activeIndex` must be an array if `exclusive` is false') + } + /* eslint-enable no-console */ +} + /** * An Accordion can contain sub-accordions. */ @@ -72,6 +85,18 @@ export default class AccordionAccordion extends Component { return { activeIndex: exclusive ? -1 : [] } } + componentDidMount() { + if (process.env.NODE_ENV !== 'production') { + warnIfPropsAreInvalid(this.props, this.state) + } + } + + componentDidUpdate() { + if (process.env.NODE_ENV !== 'production') { + warnIfPropsAreInvalid(this.props, this.state) + } + } + computeNewIndex = (index) => { const { exclusive } = this.props const { activeIndex } = this.state diff --git a/test/specs/modules/Accordion/AccordionAccordion-test.js b/test/specs/modules/Accordion/AccordionAccordion-test.js index df84b9544f..5c1ceef0af 100644 --- a/test/specs/modules/Accordion/AccordionAccordion-test.js +++ b/test/specs/modules/Accordion/AccordionAccordion-test.js @@ -4,7 +4,7 @@ import AccordionAccordion from 'src/modules/Accordion/AccordionAccordion' import AccordionContent from 'src/modules/Accordion/AccordionContent' import AccordionTitle from 'src/modules/Accordion/AccordionTitle' import * as common from 'test/specs/commonTests' -import { sandbox } from 'test/utils' +import { consoleUtil, sandbox } from 'test/utils' describe('AccordionAccordion', () => { common.isConformant(AccordionAccordion) @@ -135,6 +135,24 @@ describe('AccordionAccordion', () => { .simulate('click') wrapper.should.have.state('activeIndex').that.is.empty() }) + + it('warns if is `exclusive` and is given an array', () => { + consoleUtil.disableOnce() + + const consoleError = sandbox.spy(console, 'error') + mount() + + consoleError.should.have.been.calledOnce() + }) + + it('warns if not `exclusive` and is given a number', () => { + consoleUtil.disableOnce() + + const consoleError = sandbox.spy(console, 'error') + mount() + + consoleError.should.have.been.calledOnce() + }) }) describe('defaultActiveIndex', () => { From 73f7d05af653900c24ba44f94958b3cb5ba9b7b0 Mon Sep 17 00:00:00 2001 From: Amelia Wattenberger Date: Tue, 23 Oct 2018 10:35:43 -0400 Subject: [PATCH 06/38] feat(Sticky): add `styleElement` prop (#3202) feat(Sticky): add `styleElement` prop --- src/modules/Sticky/Sticky.d.ts | 3 +++ src/modules/Sticky/Sticky.js | 7 ++++++- test/specs/modules/Sticky/Sticky-test.js | 9 +++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/modules/Sticky/Sticky.d.ts b/src/modules/Sticky/Sticky.d.ts index 395df8e913..f20c8c46c1 100644 --- a/src/modules/Sticky/Sticky.d.ts +++ b/src/modules/Sticky/Sticky.d.ts @@ -63,6 +63,9 @@ export interface StrictStickyProps { /** Context which sticky should attach onscroll events. */ scrollContext?: object + + /** Custom style for sticky element. */ + styleElement?: object } declare const Sticky: React.ComponentClass diff --git a/src/modules/Sticky/Sticky.js b/src/modules/Sticky/Sticky.js index 5cd1ea0556..6e9a8c4cc2 100644 --- a/src/modules/Sticky/Sticky.js +++ b/src/modules/Sticky/Sticky.js @@ -74,6 +74,9 @@ export default class Sticky extends Component { /** Context which sticky should attach onscroll events. */ scrollContext: PropTypes.object, + + /** Custom style for sticky element. */ + styleElement: PropTypes.object, } static defaultProps = { @@ -200,13 +203,15 @@ export default class Sticky extends Component { } computeStyle() { + const { styleElement } = this.props const { bottom, bound, sticky, top } = this.state - if (!sticky) return {} + if (!sticky) return styleElement return { bottom: bound ? 0 : bottom, top: bound ? undefined : top, width: this.triggerRect.width, + ...styleElement, } } diff --git a/test/specs/modules/Sticky/Sticky-test.js b/test/specs/modules/Sticky/Sticky-test.js index 7f4981eda9..eafddbc20a 100644 --- a/test/specs/modules/Sticky/Sticky-test.js +++ b/test/specs/modules/Sticky/Sticky-test.js @@ -401,6 +401,15 @@ describe('Sticky', () => { }) }) + describe('styleElement', () => { + it('is passed to macthing element', () => { + wrapperMount() + const element = wrapper.childAt(0).childAt(1) + + element.should.have.style('z-index', '10') + }) + }) + describe('update', () => { it('is called on scroll', () => { const instance = mount().instance() From 6e83af24dae695b457e5c53bf70c6957eb31fbea Mon Sep 17 00:00:00 2001 From: Alexander Fedyashov Date: Wed, 24 Oct 2018 16:03:39 +0300 Subject: [PATCH 07/38] BREAKING(package): require React 16.3 (#3032) BREAKING(package): require React 16.3 --- docs/src/components/Document.js | 6 +- package.json | 28 +-- src/addons/Portal/Portal.js | 49 +++--- src/modules/Accordion/AccordionPanel.js | 26 +-- src/modules/Transition/TransitionGroup.js | 3 +- test/specs/commonTests/isConformant.js | 25 ++- .../modules/Accordion/AccordionPanel-test.js | 11 +- .../Transition/TransitionGroup-test.js | 35 +++- yarn.lock | 166 ++++++++++-------- 9 files changed, 198 insertions(+), 151 deletions(-) diff --git a/docs/src/components/Document.js b/docs/src/components/Document.js index f309152289..09ce9e397f 100644 --- a/docs/src/components/Document.js +++ b/docs/src/components/Document.js @@ -45,17 +45,17 @@ const Document = ({ Body, children, Head, Html, siteData: { dev, versions } }) = }.js`} />