From 32ba5de81c61b9d3531a2acb05a07af81299efe9 Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 10:02:34 -0700 Subject: [PATCH 1/7] fix: esmoduleinterop --- docs/best-practices.md | 5 - package-lock.json | 508 ++++++++++-------- packages/button/index.tsx | 4 +- packages/card/ActionButtons.tsx | 2 +- packages/card/ActionIcons.tsx | 2 +- packages/card/Actions.tsx | 2 +- packages/card/Media.tsx | 2 +- packages/card/PrimaryContent.tsx | 4 +- packages/card/index.tsx | 2 +- packages/checkbox/NativeControl.tsx | 2 +- packages/checkbox/index.tsx | 4 +- packages/chips/Chip.tsx | 4 +- packages/chips/ChipCheckmark.tsx | 2 +- packages/chips/ChipSet.tsx | 2 +- packages/dialog/DialogButton.tsx | 2 +- packages/dialog/DialogContent.tsx | 2 +- packages/dialog/DialogFooter.tsx | 2 +- packages/dialog/DialogTitle.tsx | 2 +- packages/dialog/index.tsx | 2 +- packages/drawer/AppContent.tsx | 2 +- packages/drawer/Content.tsx | 2 +- packages/drawer/Header.tsx | 2 +- packages/drawer/Subtitle.tsx | 2 +- packages/drawer/Title.tsx | 2 +- packages/drawer/index.tsx | 2 +- packages/fab/index.tsx | 4 +- packages/floating-label/index.tsx | 2 +- packages/icon-button/IconToggle.tsx | 2 +- packages/icon-button/index.tsx | 4 +- packages/layout-grid/Cell.tsx | 2 +- packages/layout-grid/Grid.tsx | 2 +- packages/layout-grid/Row.tsx | 2 +- packages/line-ripple/index.tsx | 2 +- packages/linear-progress/index.tsx | 2 +- packages/list/ListDivider.tsx | 2 +- packages/list/ListGroup.tsx | 2 +- packages/list/ListGroupSubheader.tsx | 2 +- packages/list/ListItem.tsx | 2 +- packages/list/ListItemGraphic.tsx | 2 +- packages/list/ListItemMeta.tsx | 2 +- packages/list/ListItemText.tsx | 2 +- packages/list/index.tsx | 2 +- packages/material-icon/index.tsx | 4 +- packages/menu-surface/index.tsx | 4 +- packages/menu/MenuList.tsx | 104 ++++ packages/menu/MenuListItem.tsx | 49 ++ packages/menu/index.tsx | 202 +++++++ packages/notched-outline/index.tsx | 2 +- packages/radio/NativeControl.tsx | 2 +- packages/radio/index.tsx | 4 +- packages/ripple/index.tsx | 4 +- packages/select/NativeControl.tsx | 2 +- packages/select/index.tsx | 2 +- packages/snackbar/index.tsx | 2 +- packages/switch/NativeControl.tsx | 2 +- packages/switch/ThumbUnderlay.tsx | 4 +- packages/switch/index.tsx | 2 +- packages/tab-bar/index.tsx | 2 +- packages/tab-indicator/index.tsx | 2 +- packages/tab-scroller/index.tsx | 4 +- packages/tab/TabRipple.tsx | 4 +- packages/tab/index.tsx | 2 +- packages/text-field/Input.tsx | 2 +- packages/text-field/helper-text/index.tsx | 2 +- packages/text-field/icon/index.tsx | 2 +- packages/text-field/index.tsx | 2 +- packages/top-app-bar/FixedAdjust.tsx | 2 +- packages/top-app-bar/Icon.tsx | 2 +- packages/top-app-bar/Row.tsx | 2 +- packages/top-app-bar/Section.tsx | 2 +- packages/top-app-bar/Title.tsx | 2 +- packages/top-app-bar/index.tsx | 2 +- packages/typography/typography.tsx | 2 +- test/screenshot/App.tsx | 2 +- test/screenshot/button/index.tsx | 2 +- test/screenshot/card/index.tsx | 2 +- test/screenshot/checkbox/index.tsx | 2 +- test/screenshot/chips/index.tsx | 4 +- test/screenshot/dialog/alert.tsx | 2 +- test/screenshot/dialog/confirmation.tsx | 2 +- test/screenshot/dialog/index.tsx | 2 +- test/screenshot/dialog/scrollable.tsx | 2 +- test/screenshot/dialog/simple.tsx | 2 +- .../drawer/DrawerAboveTopAppBar.tsx | 2 +- .../drawer/DrawerBelowTopAppBar.tsx | 2 +- test/screenshot/drawer/DrawerTest.tsx | 2 +- test/screenshot/drawer/dismissible.tsx | 2 +- .../drawer/dismissibleBelowTopAppBar.tsx | 2 +- test/screenshot/drawer/index.tsx | 2 +- test/screenshot/drawer/modal.tsx | 2 +- test/screenshot/drawer/permanent.tsx | 2 +- .../drawer/permanentBelowTopAppBar.tsx | 2 +- test/screenshot/drawer/permanentToModal.tsx | 2 +- test/screenshot/fab/index.tsx | 2 +- test/screenshot/floating-label/index.tsx | 2 +- test/screenshot/icon-button/index.tsx | 2 +- test/screenshot/index.tsx | 4 +- test/screenshot/layout-grid/index.tsx | 2 +- test/screenshot/line-ripple/index.tsx | 2 +- test/screenshot/linear-progress/index.tsx | 2 +- test/screenshot/list/index.tsx | 2 +- test/screenshot/material-icon/index.tsx | 2 +- test/screenshot/menu-surface/index.tsx | 2 +- test/screenshot/menu/index.tsx | 66 +++ test/screenshot/notched-outline/index.tsx | 2 +- test/screenshot/radio/index.tsx | 2 +- test/screenshot/ripple/index.tsx | 2 +- test/screenshot/screenshot.tsx | 10 +- test/screenshot/select/index.tsx | 2 +- test/screenshot/snackbar/index.tsx | 2 +- test/screenshot/switch/index.tsx | 2 +- test/screenshot/tab-bar/index.tsx | 2 +- test/screenshot/tab-indicator/index.tsx | 2 +- test/screenshot/tab-scroller/index.tsx | 2 +- test/screenshot/tab/index.tsx | 2 +- test/screenshot/text-field/TestTextField.tsx | 2 +- .../text-field/TextFieldPermutations.tsx | 2 +- test/screenshot/text-field/attributesMap.tsx | 2 +- test/screenshot/text-field/fullWidth.tsx | 2 +- .../text-field/helper-text/index.tsx | 2 +- test/screenshot/text-field/icon/index.tsx | 2 +- test/screenshot/text-field/index.tsx | 2 +- test/screenshot/text-field/outlined.tsx | 2 +- test/screenshot/text-field/refTest.tsx | 2 +- test/screenshot/text-field/standard.tsx | 2 +- test/screenshot/text-field/textArea.tsx | 2 +- test/screenshot/top-app-bar/dense.tsx | 2 +- test/screenshot/top-app-bar/fixed.tsx | 2 +- test/screenshot/top-app-bar/index.tsx | 2 +- test/screenshot/top-app-bar/mainContent.tsx | 2 +- test/screenshot/top-app-bar/prominent.tsx | 2 +- .../screenshot/top-app-bar/prominentDense.tsx | 2 +- .../top-app-bar/prominentToShortCollapsed.tsx | 2 +- test/screenshot/top-app-bar/short.tsx | 2 +- .../screenshot/top-app-bar/shortCollapsed.tsx | 2 +- test/screenshot/top-app-bar/standard.tsx | 2 +- .../top-app-bar/standardNoActionItems.tsx | 2 +- .../standardWithNavigationIconElement.tsx | 2 +- test/screenshot/top-app-bar/twoRows.tsx | 2 +- test/screenshot/typography/index.tsx | 2 +- test/unit/button/index.test.tsx | 4 +- test/unit/card/ActionButton.test.tsx | 2 +- test/unit/card/ActionIcons.test.tsx | 2 +- test/unit/card/Actions.test.tsx | 2 +- test/unit/card/Content.test.tsx | 2 +- test/unit/card/Media.test.tsx | 2 +- test/unit/card/index.test.tsx | 2 +- test/unit/checkbox/NativeControl.test.tsx | 2 +- test/unit/checkbox/index.test.tsx | 4 +- test/unit/chips/Chip.test.tsx | 4 +- test/unit/chips/ChipCheckmark.test.tsx | 2 +- test/unit/chips/ChipSet.test.tsx | 4 +- test/unit/dialog/DialogButton.test.tsx | 2 +- test/unit/dialog/DialogContent.test.tsx | 2 +- test/unit/dialog/DialogFooter.test.tsx | 2 +- test/unit/dialog/DialogTitle.test.tsx | 2 +- test/unit/dialog/index.test.tsx | 6 +- test/unit/drawer/index.test.tsx | 4 +- test/unit/fab/index.test.tsx | 2 +- test/unit/floating-label/index.test.tsx | 4 +- test/unit/icon-button/IconToggle.test.tsx | 2 +- test/unit/icon-button/index.test.tsx | 4 +- test/unit/index.tsx | 4 +- test/unit/layout-grid/Cell.test.tsx | 2 +- test/unit/layout-grid/Grid.test.tsx | 2 +- test/unit/layout-grid/Row.test.tsx | 2 +- test/unit/line-ripple/index.test.tsx | 4 +- test/unit/linear-progress/index.test.tsx | 4 +- test/unit/list/ListDivider.test.tsx | 2 +- test/unit/list/ListGroup.test.tsx | 2 +- test/unit/list/ListGroupSubheader.test.tsx | 2 +- test/unit/list/ListItem.test.tsx | 4 +- test/unit/list/ListItemGraphic.test.tsx | 2 +- test/unit/list/ListItemMeta.test.tsx | 2 +- test/unit/list/ListItemText.test.tsx | 2 +- test/unit/list/index.test.tsx | 4 +- test/unit/material-icon/index.test.tsx | 2 +- test/unit/menu-surface/index.test.tsx | 4 +- test/unit/menu/MenuList.test.tsx | 68 +++ test/unit/menu/MenuListItem.test.tsx | 22 + test/unit/menu/index.test.tsx | 248 +++++++++ test/unit/notched-outline/index.test.tsx | 4 +- test/unit/radio/NativeControl.test.tsx | 2 +- test/unit/radio/index.test.tsx | 4 +- test/unit/ripple/index.test.tsx | 4 +- test/unit/select/NativeControl.test.tsx | 4 +- test/unit/select/index.test.tsx | 4 +- test/unit/snackbar/index.test.tsx | 4 +- test/unit/switch/NativeControl.test.tsx | 2 +- test/unit/switch/ThumbUnderlay.test.tsx | 2 +- test/unit/switch/index.test.tsx | 4 +- test/unit/tab-bar/index.test.tsx | 4 +- test/unit/tab-indicator/index.test.tsx | 4 +- test/unit/tab-scroller/index.test.tsx | 4 +- test/unit/tab/TabRipple.test.tsx | 2 +- test/unit/tab/index.test.tsx | 4 +- test/unit/text-field/Input.test.tsx | 4 +- .../text-field/helper-text/index.test.tsx | 4 +- test/unit/text-field/icon/index.test.tsx | 4 +- test/unit/text-field/index.test.tsx | 4 +- test/unit/top-app-bar/FixedAdjust.test.tsx | 2 +- test/unit/top-app-bar/Icon.test.tsx | 2 +- test/unit/top-app-bar/Row.test.tsx | 2 +- test/unit/top-app-bar/Section.test.tsx | 2 +- test/unit/top-app-bar/Title.test.tsx | 2 +- test/unit/top-app-bar/index.test.tsx | 4 +- test/unit/typography/Body1.test.tsx | 2 +- test/unit/typography/Body2.test.tsx | 2 +- test/unit/typography/Button.test.tsx | 2 +- test/unit/typography/Caption.test.tsx | 2 +- test/unit/typography/Headline1.test.tsx | 2 +- test/unit/typography/Headline2.test.tsx | 2 +- test/unit/typography/Headline3.test.tsx | 2 +- test/unit/typography/Headline4.test.tsx | 2 +- test/unit/typography/Headline5.test.tsx | 2 +- test/unit/typography/Headline6.test.tsx | 2 +- test/unit/typography/Overline.test.tsx | 2 +- test/unit/typography/Subtitle1.test.tsx | 2 +- test/unit/typography/Subtitle2.test.tsx | 2 +- tsconfig.json | 1 + 220 files changed, 1301 insertions(+), 492 deletions(-) create mode 100644 packages/menu/MenuList.tsx create mode 100644 packages/menu/MenuListItem.tsx create mode 100644 packages/menu/index.tsx create mode 100644 test/screenshot/menu/index.tsx create mode 100644 test/unit/menu/MenuList.test.tsx create mode 100644 test/unit/menu/MenuListItem.test.tsx create mode 100644 test/unit/menu/index.test.tsx diff --git a/docs/best-practices.md b/docs/best-practices.md index 93316de65..86c1bf0cd 100644 --- a/docs/best-practices.md +++ b/docs/best-practices.md @@ -27,9 +27,4 @@ Since `classnames@2.2.6` is exporting `default`, we should be importing as such: ```ts // referenced in https://github.com/basarat/typescript-book/blob/master/docs/project/external-modules.md#default-exportsimports import classnames from 'classnames'; -``` - -In other cases where we import modules that do not use `default`, we should import like: -```ts -import * as classnames from 'classnames'; ``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 305404b12..52419cd16 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2414,6 +2414,7 @@ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, + "optional": true, "requires": { "es6-promisify": "^5.0.0" } @@ -4543,7 +4544,8 @@ "version": "0.0.2", "resolved": "https://registry.npmjs.org/buffer-more-ints/-/buffer-more-ints-0.0.2.tgz", "integrity": "sha1-JrOIXRD6E9t/wBquOquHAZngEkw=", - "dev": true + "dev": true, + "optional": true }, "buffer-xor": { "version": "1.0.3", @@ -4868,27 +4870,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": false, + "resolved": "", "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, @@ -4899,15 +4902,17 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -4915,39 +4920,42 @@ }, "chownr": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "resolved": false, + "resolved": "", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, @@ -4957,28 +4965,28 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -4988,14 +4996,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -5012,7 +5020,7 @@ }, "glob": { "version": "7.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, @@ -5027,14 +5035,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": false, + "resolved": "", "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, @@ -5044,7 +5052,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -5054,7 +5062,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -5065,53 +5073,58 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -5119,7 +5132,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, @@ -5129,23 +5142,24 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, @@ -5157,7 +5171,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": false, + "resolved": "", "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, @@ -5176,7 +5190,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -5187,14 +5201,14 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": false, + "resolved": "", "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, @@ -5205,7 +5219,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -5218,43 +5232,45 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -5265,21 +5281,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "resolved": false, + "resolved": "", "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, @@ -5292,7 +5308,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -5301,7 +5317,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -5317,7 +5333,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": false, + "resolved": "", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, @@ -5327,50 +5343,52 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5379,7 +5397,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -5389,23 +5407,24 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": false, + "resolved": "", "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, @@ -5421,14 +5440,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, @@ -5438,15 +5457,17 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", - "dev": true + "dev": true, + "optional": true } } }, @@ -10126,6 +10147,7 @@ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz", "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "dev": true, + "optional": true, "requires": { "agent-base": "4", "debug": "3.1.0" @@ -10136,6 +10158,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, + "optional": true, "requires": { "ms": "2.0.0" } @@ -10187,6 +10210,7 @@ "resolved": "https://registry.npmjs.org/httpntlm/-/httpntlm-1.6.1.tgz", "integrity": "sha1-rQFScUOi6Hc8+uapb1hla7UqNLI=", "dev": true, + "optional": true, "requires": { "httpreq": ">=0.4.22", "underscore": "~1.7.0" @@ -10196,7 +10220,8 @@ "version": "0.4.24", "resolved": "https://registry.npmjs.org/httpreq/-/httpreq-0.4.24.tgz", "integrity": "sha1-QzX/2CzZaWaKOUZckprGHWOTYn8=", - "dev": true + "dev": true, + "optional": true }, "https-browserify": { "version": "1.0.0", @@ -10209,6 +10234,7 @@ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, + "optional": true, "requires": { "agent-base": "^4.1.0", "debug": "^3.1.0" @@ -10219,6 +10245,7 @@ "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, + "optional": true, "requires": { "ms": "2.0.0" } @@ -10565,7 +10592,8 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", - "dev": true + "dev": true, + "optional": true }, "ipaddr.js": { "version": "1.6.0", @@ -12172,13 +12200,15 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/libbase64/-/libbase64-0.1.0.tgz", "integrity": "sha1-YjUag5VjrF/1vSbxL2Dpgwu3UeY=", - "dev": true + "dev": true, + "optional": true }, "libmime": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/libmime/-/libmime-3.0.0.tgz", "integrity": "sha1-UaGp50SOy9Ms2lRCFnW7IbwJPaY=", "dev": true, + "optional": true, "requires": { "iconv-lite": "0.4.15", "libbase64": "0.1.0", @@ -12189,7 +12219,8 @@ "version": "0.4.15", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=", - "dev": true + "dev": true, + "optional": true } } }, @@ -12197,7 +12228,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/libqp/-/libqp-1.1.0.tgz", "integrity": "sha1-9ebgatdLeU+1tbZpiL9yjvHe2+g=", - "dev": true + "dev": true, + "optional": true }, "load-json-file": { "version": "1.1.0", @@ -12460,6 +12492,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -12523,7 +12556,8 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "http-signature": { "version": "1.1.1", @@ -13627,13 +13661,15 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/nodemailer-fetch/-/nodemailer-fetch-1.6.0.tgz", "integrity": "sha1-ecSQihwPXzdbc/6IjamCj23JY6Q=", - "dev": true + "dev": true, + "optional": true }, "nodemailer-shared": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/nodemailer-shared/-/nodemailer-shared-1.1.0.tgz", "integrity": "sha1-z1mU4v0mjQD1zw+nZ6CBae2wfsA=", "dev": true, + "optional": true, "requires": { "nodemailer-fetch": "1.6.0" } @@ -13666,7 +13702,8 @@ "version": "0.1.10", "resolved": "https://registry.npmjs.org/nodemailer-wellknown/-/nodemailer-wellknown-0.1.10.tgz", "integrity": "sha1-WG24EB2zDLRDjrVGc3pBqtDPE9U=", - "dev": true + "dev": true, + "optional": true }, "nomnom": { "version": "1.6.2", @@ -16698,6 +16735,7 @@ "resolved": "https://registry.npmjs.org/smtp-connection/-/smtp-connection-2.12.0.tgz", "integrity": "sha1-1275EnyyPCJZ7bHoNJwujV4tdME=", "dev": true, + "optional": true, "requires": { "httpntlm": "1.6.1", "nodemailer-shared": "1.1.0" @@ -18578,7 +18616,8 @@ "version": "1.7.0", "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", - "dev": true + "dev": true, + "optional": true }, "union-value": { "version": "1.0.0", @@ -19070,28 +19109,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "dev": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": false, + "resolved": "", "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, @@ -19102,14 +19141,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -19120,42 +19159,42 @@ }, "chownr": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "dev": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", "dev": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "resolved": false, + "resolved": "", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, @@ -19165,28 +19204,28 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -19196,14 +19235,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -19220,7 +19259,7 @@ }, "glob": { "version": "7.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, @@ -19235,14 +19274,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": false, + "resolved": "", "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, @@ -19252,7 +19291,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -19262,7 +19301,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -19273,21 +19312,21 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "optional": true, @@ -19297,14 +19336,14 @@ }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, @@ -19314,14 +19353,14 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, "optional": true, @@ -19332,7 +19371,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, @@ -19342,23 +19381,24 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, @@ -19370,7 +19410,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": false, + "resolved": "", "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, @@ -19389,7 +19429,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -19400,14 +19440,14 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": false, + "resolved": "", "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, @@ -19418,7 +19458,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -19431,21 +19471,21 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", "dev": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "optional": true, @@ -19455,21 +19495,21 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -19480,21 +19520,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "resolved": false, + "resolved": "", "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, @@ -19507,7 +19547,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -19516,7 +19556,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -19532,7 +19572,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": false, + "resolved": "", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, @@ -19542,49 +19582,49 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "optional": true, @@ -19596,7 +19636,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -19606,7 +19646,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "optional": true, @@ -19616,14 +19656,14 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": false, + "resolved": "", "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, @@ -19639,14 +19679,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, @@ -19656,14 +19696,14 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true, "optional": true }, "yallist": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", "dev": true, "optional": true @@ -20126,27 +20166,28 @@ "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true + "dev": true, + "optional": true }, "aproba": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", "dev": true, "optional": true }, "are-we-there-yet": { "version": "1.1.4", - "resolved": false, + "resolved": "", "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", "dev": true, "optional": true, @@ -20157,14 +20198,14 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": false, + "resolved": "", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "optional": true, @@ -20175,40 +20216,42 @@ }, "chownr": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", "dev": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", "dev": true, "optional": true }, "debug": { "version": "2.6.9", - "resolved": false, + "resolved": "", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "optional": true, @@ -20218,28 +20261,28 @@ }, "deep-extend": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", "dev": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", "dev": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", "dev": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": false, + "resolved": "", "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", "dev": true, "optional": true, @@ -20249,14 +20292,14 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": false, + "resolved": "", "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", "dev": true, "optional": true, @@ -20273,7 +20316,7 @@ }, "glob": { "version": "7.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "optional": true, @@ -20288,14 +20331,14 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", "dev": true, "optional": true }, "iconv-lite": { "version": "0.4.21", - "resolved": false, + "resolved": "", "integrity": "sha512-En5V9za5mBt2oUA03WGD3TwDv0MKAruqsuxstbMUZaj9W9k/m1CV/9py3l0L5kw9Bln8fdHQmzHSYtvpvTLpKw==", "dev": true, "optional": true, @@ -20305,7 +20348,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "optional": true, @@ -20315,7 +20358,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": false, + "resolved": "", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "optional": true, @@ -20326,36 +20369,38 @@ }, "inherits": { "version": "2.0.3", - "resolved": false, + "resolved": "", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", - "resolved": false, + "resolved": "", "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } }, "isarray": { "version": "1.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": false, + "resolved": "", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "optional": true, @@ -20365,16 +20410,17 @@ }, "minimist": { "version": "0.0.8", - "resolved": false, + "resolved": "", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true, "optional": true }, "minipass": { "version": "2.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -20382,7 +20428,7 @@ }, "minizlib": { "version": "1.1.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", "dev": true, "optional": true, @@ -20392,23 +20438,24 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": false, + "resolved": "", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true, "optional": true }, "needle": { "version": "2.2.0", - "resolved": false, + "resolved": "", "integrity": "sha512-eFagy6c+TYayorXw/qtAdSvaUpEbBsDwDyxYFgLZ0lTojfH7K+OdBqAF7TAFwDokJaGpubpSGG0wO3iC0XPi8w==", "dev": true, "optional": true, @@ -20420,7 +20467,7 @@ }, "node-pre-gyp": { "version": "0.10.0", - "resolved": false, + "resolved": "", "integrity": "sha512-G7kEonQLRbcA/mOoFoxvlMrw6Q6dPf92+t/l0DFSMuSlDoWaI9JWIyPwK0jyE1bph//CUEL65/Fz1m2vJbmjQQ==", "dev": true, "optional": true, @@ -20439,7 +20486,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", "dev": true, "optional": true, @@ -20450,14 +20497,14 @@ }, "npm-bundled": { "version": "1.0.3", - "resolved": false, + "resolved": "", "integrity": "sha512-ByQ3oJ/5ETLyglU2+8dBObvhfWXX8dtPZDMePCahptliFX2iIuhyEszyFk401PZUNQH20vvdW5MLjJxkwU80Ow==", "dev": true, "optional": true }, "npm-packlist": { "version": "1.1.10", - "resolved": false, + "resolved": "", "integrity": "sha512-AQC0Dyhzn4EiYEfIUjCdMl0JJ61I2ER9ukf/sLxJUcZHfo+VyEfz2rMJgLZSS1v30OxPQe1cN0LZA1xbcaVfWA==", "dev": true, "optional": true, @@ -20468,7 +20515,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", "dev": true, "optional": true, @@ -20481,43 +20528,45 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": false, + "resolved": "", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, + "optional": true, "requires": { "wrappy": "1" } }, "os-homedir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": false, + "resolved": "", "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", "dev": true, "optional": true, @@ -20528,21 +20577,21 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", "dev": true, "optional": true }, "rc": { "version": "1.2.7", - "resolved": false, + "resolved": "", "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", "dev": true, "optional": true, @@ -20555,7 +20604,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": false, + "resolved": "", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true, "optional": true @@ -20564,7 +20613,7 @@ }, "readable-stream": { "version": "2.3.6", - "resolved": false, + "resolved": "", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "optional": true, @@ -20580,7 +20629,7 @@ }, "rimraf": { "version": "2.6.2", - "resolved": false, + "resolved": "", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "optional": true, @@ -20590,50 +20639,52 @@ }, "safe-buffer": { "version": "5.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", - "dev": true + "dev": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": false, + "resolved": "", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true, "optional": true }, "semver": { "version": "5.5.0", - "resolved": false, + "resolved": "", "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", "dev": true, "optional": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true, "optional": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -20642,7 +20693,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": false, + "resolved": "", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "optional": true, @@ -20652,23 +20703,24 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } }, "strip-json-comments": { "version": "2.0.1", - "resolved": false, + "resolved": "", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", "dev": true, "optional": true }, "tar": { "version": "4.4.1", - "resolved": false, + "resolved": "", "integrity": "sha512-O+v1r9yN4tOsvl90p5HAP4AEqbYhx4036AGMm075fH9F8Qwi3oJ+v4u50FkT/KkvywNGtwkk0zRI+8eYm1X/xg==", "dev": true, "optional": true, @@ -20684,14 +20736,14 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", "dev": true, "optional": true }, "wide-align": { "version": "1.1.2", - "resolved": false, + "resolved": "", "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", "dev": true, "optional": true, @@ -20701,15 +20753,17 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "dev": true, + "optional": true }, "yallist": { "version": "3.0.2", - "resolved": false, + "resolved": "", "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", - "dev": true + "dev": true, + "optional": true } } }, diff --git a/packages/button/index.tsx b/packages/button/index.tsx index bade96ce9..ce4cf9e16 100644 --- a/packages/button/index.tsx +++ b/packages/button/index.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; const BUTTON_CLASS_NAME = 'mdc-button__icon'; diff --git a/packages/card/ActionButtons.tsx b/packages/card/ActionButtons.tsx index f658639c3..b459c5bb8 100644 --- a/packages/card/ActionButtons.tsx +++ b/packages/card/ActionButtons.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; type ChildType = React.ReactElement>; diff --git a/packages/card/ActionIcons.tsx b/packages/card/ActionIcons.tsx index fe6dddc57..eb32a6eff 100644 --- a/packages/card/ActionIcons.tsx +++ b/packages/card/ActionIcons.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; type ChildType = React.ReactElement>; diff --git a/packages/card/Actions.tsx b/packages/card/Actions.tsx index e0678524a..211206ac9 100644 --- a/packages/card/Actions.tsx +++ b/packages/card/Actions.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ActionsProps extends React.HTMLProps { diff --git a/packages/card/Media.tsx b/packages/card/Media.tsx index 23280e687..b3b7fb302 100644 --- a/packages/card/Media.tsx +++ b/packages/card/Media.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface MediaProps extends React.HTMLProps { diff --git a/packages/card/PrimaryContent.tsx b/packages/card/PrimaryContent.tsx index e7b46c0ee..32ee3e0cd 100644 --- a/packages/card/PrimaryContent.tsx +++ b/packages/card/PrimaryContent.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; export interface PrimaryContentBaseProps extends React.HTMLProps, Ripple.InjectedProps{ className: string; diff --git a/packages/card/index.tsx b/packages/card/index.tsx index 6bb9d4235..df7e5e67c 100644 --- a/packages/card/index.tsx +++ b/packages/card/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import ActionButtons from './ActionButtons'; import ActionIcons from './ActionIcons'; diff --git a/packages/checkbox/NativeControl.tsx b/packages/checkbox/NativeControl.tsx index eb14b7ef5..9a22351a6 100644 --- a/packages/checkbox/NativeControl.tsx +++ b/packages/checkbox/NativeControl.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; export interface NativeControlProps extends React.HTMLProps{ checked: boolean; diff --git a/packages/checkbox/index.tsx b/packages/checkbox/index.tsx index 9a0666e64..880db1b6c 100644 --- a/packages/checkbox/index.tsx +++ b/packages/checkbox/index.tsx @@ -20,12 +20,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCCheckboxFoundation} from '@material/checkbox/foundation'; import {MDCCheckboxAdapter} from '@material/checkbox/adapter'; import {cssClasses} from '@material/checkbox/constants'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; import NativeControl from './NativeControl'; diff --git a/packages/chips/Chip.tsx b/packages/chips/Chip.tsx index 3e3efbb4a..eff3fba59 100644 --- a/packages/chips/Chip.tsx +++ b/packages/chips/Chip.tsx @@ -19,9 +19,9 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; import {MDCChipFoundation} from '@material/chips/chip/foundation'; import {MDCChipAdapter} from '@material/chips/chip/adapter'; diff --git a/packages/chips/ChipCheckmark.tsx b/packages/chips/ChipCheckmark.tsx index 0a4e4bc17..ecceb6f96 100644 --- a/packages/chips/ChipCheckmark.tsx +++ b/packages/chips/ChipCheckmark.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; export default class ChipCheckmark extends React.Component<{}, {}> { width: number = 0; diff --git a/packages/chips/ChipSet.tsx b/packages/chips/ChipSet.tsx index 8ff6f3a7a..d15fdd883 100644 --- a/packages/chips/ChipSet.tsx +++ b/packages/chips/ChipSet.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCChipSetFoundation} from '@material/chips/chip-set/foundation'; import ChipCheckmark from './ChipCheckmark'; diff --git a/packages/dialog/DialogButton.tsx b/packages/dialog/DialogButton.tsx index 85c1346ec..65e930aeb 100644 --- a/packages/dialog/DialogButton.tsx +++ b/packages/dialog/DialogButton.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; import Button, {ButtonProps} from '@material/react-button'; diff --git a/packages/dialog/DialogContent.tsx b/packages/dialog/DialogContent.tsx index f417bb79e..b229c9d32 100644 --- a/packages/dialog/DialogContent.tsx +++ b/packages/dialog/DialogContent.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/dialog/DialogFooter.tsx b/packages/dialog/DialogFooter.tsx index 6ce9af8fc..9561e7244 100644 --- a/packages/dialog/DialogFooter.tsx +++ b/packages/dialog/DialogFooter.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/dialog/DialogTitle.tsx b/packages/dialog/DialogTitle.tsx index d78d2cd77..507fffae5 100644 --- a/packages/dialog/DialogTitle.tsx +++ b/packages/dialog/DialogTitle.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/dialog/index.tsx b/packages/dialog/index.tsx index 9845c5249..5be86db2e 100644 --- a/packages/dialog/index.tsx +++ b/packages/dialog/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCDialogFoundation} from '@material/dialog/foundation'; diff --git a/packages/drawer/AppContent.tsx b/packages/drawer/AppContent.tsx index f3a83294f..a404a712e 100644 --- a/packages/drawer/AppContent.tsx +++ b/packages/drawer/AppContent.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface DrawerAppContentProps { diff --git a/packages/drawer/Content.tsx b/packages/drawer/Content.tsx index 3a044de3d..4f0550c82 100644 --- a/packages/drawer/Content.tsx +++ b/packages/drawer/Content.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface DrawerContentProps { diff --git a/packages/drawer/Header.tsx b/packages/drawer/Header.tsx index 4d4f6fe5f..371579433 100644 --- a/packages/drawer/Header.tsx +++ b/packages/drawer/Header.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface DrawerHeaderProps { diff --git a/packages/drawer/Subtitle.tsx b/packages/drawer/Subtitle.tsx index 6cc9eca1a..4847bb3e2 100644 --- a/packages/drawer/Subtitle.tsx +++ b/packages/drawer/Subtitle.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface DrawerSubTitleProps { diff --git a/packages/drawer/Title.tsx b/packages/drawer/Title.tsx index 256c12d2b..01235962c 100644 --- a/packages/drawer/Title.tsx +++ b/packages/drawer/Title.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface DrawerTitleProps { diff --git a/packages/drawer/index.tsx b/packages/drawer/index.tsx index 6c5cad6c2..5ea9ce4fb 100644 --- a/packages/drawer/index.tsx +++ b/packages/drawer/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import { MDCDismissibleDrawerFoundation, diff --git a/packages/fab/index.tsx b/packages/fab/index.tsx index 42ecd5551..da3f34f85 100644 --- a/packages/fab/index.tsx +++ b/packages/fab/index.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; export interface FabProps extends Ripple.InjectedProps, React.ButtonHTMLAttributes { diff --git a/packages/floating-label/index.tsx b/packages/floating-label/index.tsx index 923d45194..0b2e5103c 100644 --- a/packages/floating-label/index.tsx +++ b/packages/floating-label/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCFloatingLabelFoundation} from '@material/floating-label/foundation'; import {MDCFloatingLabelAdapter} from '@material/floating-label/adapter'; diff --git a/packages/icon-button/IconToggle.tsx b/packages/icon-button/IconToggle.tsx index eb34cc345..26a9dabaa 100644 --- a/packages/icon-button/IconToggle.tsx +++ b/packages/icon-button/IconToggle.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface IconToggleProps { diff --git a/packages/icon-button/index.tsx b/packages/icon-button/index.tsx index 16de96fa0..9e717c6cb 100644 --- a/packages/icon-button/index.tsx +++ b/packages/icon-button/index.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; import {MDCIconButtonToggleAdapter} from '@material/icon-button/adapter'; import {MDCIconButtonToggleFoundation} from '@material/icon-button/foundation'; import {MDCIconButtonToggleEventDetail} from '@material/icon-button/types'; diff --git a/packages/layout-grid/Cell.tsx b/packages/layout-grid/Cell.tsx index d73a612e1..fc9ffd09b 100644 --- a/packages/layout-grid/Cell.tsx +++ b/packages/layout-grid/Cell.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export type TwelveColumn = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12; diff --git a/packages/layout-grid/Grid.tsx b/packages/layout-grid/Grid.tsx index 92019c2c9..91a9f84c1 100644 --- a/packages/layout-grid/Grid.tsx +++ b/packages/layout-grid/Grid.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export type Alignment = 'left' | 'right'; diff --git a/packages/layout-grid/Row.tsx b/packages/layout-grid/Row.tsx index 0f1d9c95b..175652538 100644 --- a/packages/layout-grid/Row.tsx +++ b/packages/layout-grid/Row.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface RowProps extends React.HTMLProps { diff --git a/packages/line-ripple/index.tsx b/packages/line-ripple/index.tsx index ba12b547e..26c10292c 100644 --- a/packages/line-ripple/index.tsx +++ b/packages/line-ripple/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCLineRippleFoundation} from '@material/line-ripple/foundation'; import {MDCLineRippleAdapter} from '@material/line-ripple/adapter'; diff --git a/packages/linear-progress/index.tsx b/packages/linear-progress/index.tsx index cb5207497..9724fc810 100644 --- a/packages/linear-progress/index.tsx +++ b/packages/linear-progress/index.tsx @@ -21,7 +21,7 @@ // THE SOFTWARE. import classnames from 'classnames'; -import * as React from 'react'; +import React from 'react'; import {MDCLinearProgressFoundation} from '@material/linear-progress/foundation'; import {MDCLinearProgressAdapter} from '@material/linear-progress/adapter'; diff --git a/packages/list/ListDivider.tsx b/packages/list/ListDivider.tsx index 7a9b02dd2..79577fd69 100644 --- a/packages/list/ListDivider.tsx +++ b/packages/list/ListDivider.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListDividerProps extends React.HTMLProps{ diff --git a/packages/list/ListGroup.tsx b/packages/list/ListGroup.tsx index dc88c4a56..bf4198c24 100644 --- a/packages/list/ListGroup.tsx +++ b/packages/list/ListGroup.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListGroupProps extends React.HTMLProps{ diff --git a/packages/list/ListGroupSubheader.tsx b/packages/list/ListGroupSubheader.tsx index 480345996..79766d6f9 100644 --- a/packages/list/ListGroupSubheader.tsx +++ b/packages/list/ListGroupSubheader.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListGroupSubheaderProps extends React.HTMLProps { className?: string, diff --git a/packages/list/ListItem.tsx b/packages/list/ListItem.tsx index 4c52a3cd4..63cdc6fcf 100644 --- a/packages/list/ListItem.tsx +++ b/packages/list/ListItem.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCListFoundation} from '@material/list/foundation'; diff --git a/packages/list/ListItemGraphic.tsx b/packages/list/ListItemGraphic.tsx index cdbf2bae5..90a5c041e 100644 --- a/packages/list/ListItemGraphic.tsx +++ b/packages/list/ListItemGraphic.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListItemGraphicProps { diff --git a/packages/list/ListItemMeta.tsx b/packages/list/ListItemMeta.tsx index 6f137b1ab..8fc065bdc 100644 --- a/packages/list/ListItemMeta.tsx +++ b/packages/list/ListItemMeta.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListItemMetaProps { diff --git a/packages/list/ListItemText.tsx b/packages/list/ListItemText.tsx index a811bc29b..fc5ab8345 100644 --- a/packages/list/ListItemText.tsx +++ b/packages/list/ListItemText.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface ListItemTextProps { diff --git a/packages/list/index.tsx b/packages/list/index.tsx index 8ea2ee7a8..89ba971a0 100644 --- a/packages/list/index.tsx +++ b/packages/list/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCListFoundation} from '@material/list/foundation'; import {MDCListIndex} from '@material/list/types'; diff --git a/packages/material-icon/index.tsx b/packages/material-icon/index.tsx index 6a0292528..0a4f53477 100644 --- a/packages/material-icon/index.tsx +++ b/packages/material-icon/index.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; export interface MaterialIconDefaultProps extends React.HTMLAttributes { icon?: string; diff --git a/packages/menu-surface/index.tsx b/packages/menu-surface/index.tsx index fcd1e6ec5..e45ec6980 100644 --- a/packages/menu-surface/index.tsx +++ b/packages/menu-surface/index.tsx @@ -20,8 +20,8 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import React from 'react'; +import ReactDOM from 'react-dom'; import classnames from 'classnames'; import {MDCMenuSurfaceFoundation} from '@material/menu-surface/foundation'; import {MDCMenuSurfaceAdapter} from '@material/menu-surface/adapter'; diff --git a/packages/menu/MenuList.tsx b/packages/menu/MenuList.tsx new file mode 100644 index 000000000..d41c69080 --- /dev/null +++ b/packages/menu/MenuList.tsx @@ -0,0 +1,104 @@ +// The MIT License +// +// Copyright (c) 2019 Google, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import React from 'react'; +import List, {ListProps} from '@material/react-list'; +// eslint-disable-next-line no-unused-vars +import {MDCMenuFoundation} from '@material/menu/foundation'; + +type RefCallback = (node: T | null) => void; + +export interface MenuListProps extends Exclude { + innerRef?: RefCallback | React.RefObject; + handleItemAction?: MDCMenuFoundation['handleItemAction']; +}; + +class MenuList extends React.Component { + private listInstance = React.createRef(); + + static defaultProps: Partial = { + className: '', + handleSelect: () => {}, + handleItemAction: () => {}, + }; + + get listElements(): Element[] { + if (!this.listInstance.current) { + return []; + } + return this.listInstance.current.listElements; + } + + handleSelect: ListProps['handleSelect'] = (activatedItemIndex, selected) => { + this.props.handleSelect!(activatedItemIndex, selected); + this.props.handleItemAction!(this.listElements[activatedItemIndex]); + } + + + attachRef = (node: List | null) => { + const {innerRef} = this.props; + + // https://github.com/facebook/react/issues/13029#issuecomment-410002316 + // @ts-ignore this is acceptable according to the comment above + this.listInstance.current = node; + + if (!innerRef) { + return; + } + + if (typeof innerRef !== 'function') { + // @ts-ignore same as above + innerRef.current = node; + } else { + innerRef(node); + } + } + + render() { + const { + 'aria-hidden': ariaHidden, + /* eslint-disable no-unused-vars */ + handleSelect, + handleItemAction, + role, + innerRef, + children, + ref, + /* eslint-enable no-unused-vars */ + ...otherProps + } = this.props; + + return ( + + {children} + + ); + } +} + +export default MenuList; diff --git a/packages/menu/MenuListItem.tsx b/packages/menu/MenuListItem.tsx new file mode 100644 index 000000000..1c5879b75 --- /dev/null +++ b/packages/menu/MenuListItem.tsx @@ -0,0 +1,49 @@ +// The MIT License +// +// Copyright (c) 2019 Google, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import React from 'react'; +import {ListItem, ListItemProps} from '@material/react-list'; + +export interface MenuListItemProps extends ListItemProps { + children?: React.ReactNode; +} + +class MenuListItem extends React.Component, {}> { + render() { + const { + role = 'menuitem', + children, + ...otherProps + } = this.props; + + return ( + + {children} + + ); + } +} + +export default MenuListItem; diff --git a/packages/menu/index.tsx b/packages/menu/index.tsx new file mode 100644 index 000000000..a5ca13384 --- /dev/null +++ b/packages/menu/index.tsx @@ -0,0 +1,202 @@ +// The MIT License +// +// Copyright (c) 2019 Google, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +import React from 'react'; +import classnames from 'classnames'; +import {MDCMenuFoundation} from '@material/menu/foundation'; +import {MDCMenuAdapter} from '@material/menu/adapter'; +import MenuSurface, {MenuSurfaceProps} from '@material/react-menu-surface'; +import MenuList, {MenuListProps} from './MenuList'; +import MenuListItem from './MenuListItem'; + +const {cssClasses} = MDCMenuFoundation; + +export interface MenuProps extends MenuSurfaceProps { + children: React.ReactElement; + onSelected?: (index: number, item: Element) => void; +}; + +export interface MenuState { + open: boolean; + foundation?: MDCMenuFoundation; +}; + +class Menu extends React.Component { + menuListElement = React.createRef(); + + // need foundation on state so that it initializes MenuList with + // foundation.handleItemAction + state: MenuState = { + foundation: undefined, + open: this.props.open || false, + }; + + static defaultProps: Partial = { + className: '', + open: false, + onKeyDown: () => {}, + onSelected: () => {}, + }; + + componentDidMount() { + const foundation = new MDCMenuFoundation(this.adapter); + foundation.init(); + this.setState({foundation}); + } + + componentDidUpdate(prevProps: MenuProps) { + if (this.props.open !== prevProps.open) { + this.setState({open: this.props.open!}); + } + } + + componentWillUnmount() { + if (this.state.foundation) { + this.state.foundation.destroy(); + } + } + + get listElements(): Element[] { + if (!(this.menuListElement.current + && this.menuListElement.current.listElements + && this.menuListElement.current.listElements.length >= 0 )) { + return []; + } + return this.menuListElement.current.listElements; + } + + get adapter(): MDCMenuAdapter { + return { + // TODO: update to new class management system from + // https://github.com/material-components/material-components-web-react/pull/776/files + // https://github.com/material-components/material-components-web-react/issues/796 + addClassToElementAtIndex: (index, className) => { + const list = this.listElements; + list[index].classList.add(className); + }, + removeClassFromElementAtIndex: (index, className) => { + const list = this.listElements; + list[index].classList.remove(className); + }, + addAttributeToElementAtIndex: (index, attr, value) => { + const list = this.listElements; + list[index].setAttribute(attr, value); + }, + removeAttributeFromElementAtIndex: (index, attr) => { + const list = this.listElements; + list[index].removeAttribute(attr); + }, + elementContainsClass: (element, className) => element.classList.contains(className), + closeSurface: () => this.setState({open: false}), + getElementIndex: (element) => this.listElements.indexOf(element), + getParentElement: (element) => element.parentElement, + getSelectedElementIndex: (selectionGroup) => { + const selectedListItem = selectionGroup.querySelector(`.${cssClasses.MENU_SELECTED_LIST_ITEM}`); + return selectedListItem ? this.listElements.indexOf(selectedListItem) : -1; + }, + notifySelected: (evtData) => this.props.onSelected!( + evtData.index, + this.listElements[evtData.index], + ), + }; + } + + handleKeyDown: React.KeyboardEventHandler = (evt) => { + const {onKeyDown} = this.props; + if (onKeyDown) { + onKeyDown(evt); + } + this.state.foundation && this.state.foundation.handleKeydown(evt.nativeEvent); + } + + handleOpen: MenuSurfaceProps['onOpen'] = () => { + const {onOpen} = this.props; + if (onOpen) { + onOpen(); + } + if (this.listElements.length > 0) { + (this.listElements[0] as HTMLElement).focus(); + } + } + + render() { + const { + className, + /* eslint-disable no-unused-vars */ + open, + onKeyDown, + onOpen, + children, + onSelected, + ref, + /* eslint-enable no-unused-vars */ + ...otherProps + } = this.props; + + return ( + + {this.renderChild()} + + ); + } + + + renderChild() { + const {children} = this.props; + const {foundation} = this.state; + if (!children) return; + + let handleItemAction: MDCMenuFoundation['handleItemAction'] = () => {}; + if (foundation) { + // this is to avoid a `handleItemAction` of undefined error + handleItemAction = foundation.handleItemAction.bind(foundation); + } + const updatedProps: MenuListProps = { + // children.props must appear first + ...children.props, + handleItemAction, + ref: this.menuListElement, + wrapFocus: true, + }; + return React.cloneElement(children, updatedProps); + } +} + +export default Menu; +export {MenuList, MenuListItem}; +export { + ListDivider as MenuListDivider, + ListGroup as MenuListGroup, + ListGroupSubheader as MenuListGroupSubheader, + ListItemGraphic as MenuListGraphic, + ListItemMeta as MenuListMeta, + ListItemText as MenuListItemText, +} from '@material/react-list'; +export {MenuListProps} from './MenuList'; +export {MenuListItemProps} from './MenuListItem'; diff --git a/packages/notched-outline/index.tsx b/packages/notched-outline/index.tsx index f1aa67a62..155240746 100644 --- a/packages/notched-outline/index.tsx +++ b/packages/notched-outline/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCNotchedOutlineFoundation} from '@material/notched-outline/foundation'; import {MDCNotchedOutlineAdapter} from '@material/notched-outline/adapter'; diff --git a/packages/radio/NativeControl.tsx b/packages/radio/NativeControl.tsx index 5c9302110..4b323763a 100644 --- a/packages/radio/NativeControl.tsx +++ b/packages/radio/NativeControl.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface NativeControlProps extends React.HTMLProps { diff --git a/packages/radio/index.tsx b/packages/radio/index.tsx index f6e10614c..caf3f1091 100644 --- a/packages/radio/index.tsx +++ b/packages/radio/index.tsx @@ -20,11 +20,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCRadioFoundation} from '@material/radio/foundation'; import {MDCRadioAdapter} from '@material/radio/adapter'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; import NativeControl, {NativeControlProps} from './NativeControl'; // eslint-disable-line no-unused-vars export interface RadioProps diff --git a/packages/ripple/index.tsx b/packages/ripple/index.tsx index ea6d67495..caaa63ba0 100644 --- a/packages/ripple/index.tsx +++ b/packages/ripple/index.tsx @@ -19,13 +19,13 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {Subtract} from 'utility-types'; // eslint-disable-line no-unused-vars import {MDCRippleFoundation} from '@material/ripple/foundation'; import {MDCRippleAdapter} from '@material/ripple/adapter'; -import * as util from '@material/ripple/util'; +import util from '@material/ripple/util'; import {SpecificEventListener} from '@material/base/types'; import {matches} from '@material/dom/ponyfill'; diff --git a/packages/select/NativeControl.tsx b/packages/select/NativeControl.tsx index 70b4b6177..bb78c40b6 100644 --- a/packages/select/NativeControl.tsx +++ b/packages/select/NativeControl.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no .d.ts file import {MDCSelectFoundation} from '@material/select/dist/mdc.select'; diff --git a/packages/select/index.tsx b/packages/select/index.tsx index 1631918e9..4f3c4a3d3 100644 --- a/packages/select/index.tsx +++ b/packages/select/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no mdc .d.ts file import {MDCSelectFoundation, MDCSelectAdapter} from '@material/select/dist/mdc.select'; diff --git a/packages/snackbar/index.tsx b/packages/snackbar/index.tsx index af35732d1..666817256 100644 --- a/packages/snackbar/index.tsx +++ b/packages/snackbar/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCSnackbarFoundation} from '@material/snackbar/foundation'; diff --git a/packages/switch/NativeControl.tsx b/packages/switch/NativeControl.tsx index dd9721475..a4e6a77b9 100644 --- a/packages/switch/NativeControl.tsx +++ b/packages/switch/NativeControl.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; export interface NativeControlProps extends React.HTMLProps { rippleActivatorRef?: React.RefObject; } diff --git a/packages/switch/ThumbUnderlay.tsx b/packages/switch/ThumbUnderlay.tsx index 9850002d0..20768bcb7 100644 --- a/packages/switch/ThumbUnderlay.tsx +++ b/packages/switch/ThumbUnderlay.tsx @@ -20,9 +20,9 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; export interface ThumbUnderlayProps extends Ripple.InjectedProps, React.HTMLProps { diff --git a/packages/switch/index.tsx b/packages/switch/index.tsx index b840c5cae..f2398811e 100644 --- a/packages/switch/index.tsx +++ b/packages/switch/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCSwitchAdapter} from '@material/switch/adapter'; import {MDCSwitchFoundation} from '@material/switch/foundation'; diff --git a/packages/tab-bar/index.tsx b/packages/tab-bar/index.tsx index 232fd9167..6d714e417 100644 --- a/packages/tab-bar/index.tsx +++ b/packages/tab-bar/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import TabScroller from '@material/react-tab-scroller'; import Tab, {TabProps} from '@material/react-tab'; // eslint-disable-line no-unused-vars diff --git a/packages/tab-indicator/index.tsx b/packages/tab-indicator/index.tsx index b62b52007..6fe0b2031 100644 --- a/packages/tab-indicator/index.tsx +++ b/packages/tab-indicator/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCSlidingTabIndicatorFoundation} from '@material/tab-indicator/sliding-foundation'; import {MDCFadingTabIndicatorFoundation} from '@material/tab-indicator/fading-foundation'; diff --git a/packages/tab-scroller/index.tsx b/packages/tab-scroller/index.tsx index dd44f0200..3eb5a13e2 100644 --- a/packages/tab-scroller/index.tsx +++ b/packages/tab-scroller/index.tsx @@ -20,11 +20,11 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {MDCTabScrollerFoundation} from '@material/tab-scroller/foundation'; import {MDCTabScrollerAdapter} from '@material/tab-scroller/adapter'; -import * as util from '@material/tab-scroller/util'; +import util from '@material/tab-scroller/util'; import {matches} from '@material/dom/ponyfill'; const convertDashToCamelCase = (propName: string) => diff --git a/packages/tab/TabRipple.tsx b/packages/tab/TabRipple.tsx index 8f3d498bf..3c92b7579 100644 --- a/packages/tab/TabRipple.tsx +++ b/packages/tab/TabRipple.tsx @@ -20,10 +20,10 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; -import * as Ripple from '@material/react-ripple'; +import Ripple from '@material/react-ripple'; import { RippledComponentInterface, RippledComponentState, // eslint-disable-line no-unused-vars } from '@material/react-ripple'; diff --git a/packages/tab/index.tsx b/packages/tab/index.tsx index 72bb08f5b..6159cef3c 100644 --- a/packages/tab/index.tsx +++ b/packages/tab/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import TabIndicator from '@material/react-tab-indicator'; diff --git a/packages/text-field/Input.tsx b/packages/text-field/Input.tsx index 5fb37e092..ab0836466 100644 --- a/packages/text-field/Input.tsx +++ b/packages/text-field/Input.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no .d.ts file import {MDCTextFieldFoundation} from '@material/textfield/dist/mdc.textfield'; diff --git a/packages/text-field/helper-text/index.tsx b/packages/text-field/helper-text/index.tsx index 1678fcb2a..99577768a 100644 --- a/packages/text-field/helper-text/index.tsx +++ b/packages/text-field/helper-text/index.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no .d.ts file import {MDCTextFieldHelperTextFoundation} from '@material/textfield/dist/mdc.textfield'; diff --git a/packages/text-field/icon/index.tsx b/packages/text-field/icon/index.tsx index f02a32428..07c705d1d 100644 --- a/packages/text-field/icon/index.tsx +++ b/packages/text-field/icon/index.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no .d.ts file import {MDCTextFieldIconFoundation} from '@material/textfield/dist/mdc.textfield'; diff --git a/packages/text-field/index.tsx b/packages/text-field/index.tsx index 46ab0b51e..985344e54 100644 --- a/packages/text-field/index.tsx +++ b/packages/text-field/index.tsx @@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; // @ts-ignore no .d.ts file import {MDCTextFieldFoundation, MDCTextFieldAdapter} from '@material/textfield/dist/mdc.textfield'; diff --git a/packages/top-app-bar/FixedAdjust.tsx b/packages/top-app-bar/FixedAdjust.tsx index a731c2028..76a4e6fd6 100644 --- a/packages/top-app-bar/FixedAdjust.tsx +++ b/packages/top-app-bar/FixedAdjust.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; export interface TopAppbarFixedAdjustProps { diff --git a/packages/top-app-bar/Icon.tsx b/packages/top-app-bar/Icon.tsx index c930a126e..515b09e3c 100644 --- a/packages/top-app-bar/Icon.tsx +++ b/packages/top-app-bar/Icon.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/top-app-bar/Row.tsx b/packages/top-app-bar/Row.tsx index 6ec3f97c3..fe690420d 100644 --- a/packages/top-app-bar/Row.tsx +++ b/packages/top-app-bar/Row.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/top-app-bar/Section.tsx b/packages/top-app-bar/Section.tsx index f4e06c175..de3312baa 100644 --- a/packages/top-app-bar/Section.tsx +++ b/packages/top-app-bar/Section.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/top-app-bar/Title.tsx b/packages/top-app-bar/Title.tsx index dd8f4916d..a9ff5a21c 100644 --- a/packages/top-app-bar/Title.tsx +++ b/packages/top-app-bar/Title.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import {cssClasses} from './constants'; diff --git a/packages/top-app-bar/index.tsx b/packages/top-app-bar/index.tsx index d108d857c..1ca969832 100644 --- a/packages/top-app-bar/index.tsx +++ b/packages/top-app-bar/index.tsx @@ -20,7 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import * as React from 'react'; +import React from 'react'; import classnames from 'classnames'; import TopAppBarFixedAdjust, {TopAppbarFixedAdjustProps} from './FixedAdjust'; import TopAppBarSection from './Section'; diff --git a/packages/typography/typography.tsx b/packages/typography/typography.tsx index 7c1e8a6f2..37a96c0e5 100644 --- a/packages/typography/typography.tsx +++ b/packages/typography/typography.tsx @@ -21,7 +21,7 @@ // THE SOFTWARE. import classnames from 'classnames'; -import * as React from 'react'; +import React from 'react'; export interface TypographyProps extends React.HTMLProps { children?: React.ReactNode; diff --git a/test/screenshot/App.tsx b/test/screenshot/App.tsx index da65edcd6..927e5ecd5 100644 --- a/test/screenshot/App.tsx +++ b/test/screenshot/App.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Link} from 'react-router-dom'; import {COMPONENTS} from './constants'; diff --git a/test/screenshot/button/index.tsx b/test/screenshot/button/index.tsx index 3a6ceac2c..c2c1a3b6c 100644 --- a/test/screenshot/button/index.tsx +++ b/test/screenshot/button/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import MaterialIcon from '../../../packages/material-icon/index'; import '../../../packages/button/index.scss'; import './index.scss'; diff --git a/test/screenshot/card/index.tsx b/test/screenshot/card/index.tsx index 4716ad6cb..1c2ed7637 100644 --- a/test/screenshot/card/index.tsx +++ b/test/screenshot/card/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '@material/button/mdc-button.scss'; import '@material/list/mdc-list.scss'; import '../../../packages/card/index.scss'; diff --git a/test/screenshot/checkbox/index.tsx b/test/screenshot/checkbox/index.tsx index 9185441fc..b9b4a13d4 100644 --- a/test/screenshot/checkbox/index.tsx +++ b/test/screenshot/checkbox/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import Checkbox from '../../../packages/checkbox/index'; diff --git a/test/screenshot/chips/index.tsx b/test/screenshot/chips/index.tsx index 7c5c3df95..b9c6f2dbe 100644 --- a/test/screenshot/chips/index.tsx +++ b/test/screenshot/chips/index.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import '../../../packages/chips/index.scss'; import MaterialIcon from '../../../packages/material-icon'; import {ChipProps, Chip, ChipSet} from '../../../packages/chips/index'; // eslint-disable-line no-unused-vars // no .d.ts file // @ts-ignore -import * as uuidv1 from 'uuid/v1'; +import uuidv1 from 'uuid/v1'; interface ChipsTestProps { selectedChipIds: string[]; diff --git a/test/screenshot/dialog/alert.tsx b/test/screenshot/dialog/alert.tsx index 11f0fa244..1bbabfe68 100644 --- a/test/screenshot/dialog/alert.tsx +++ b/test/screenshot/dialog/alert.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Dialog, { DialogContent, DialogFooter, diff --git a/test/screenshot/dialog/confirmation.tsx b/test/screenshot/dialog/confirmation.tsx index 032a7c152..c537b3b7b 100644 --- a/test/screenshot/dialog/confirmation.tsx +++ b/test/screenshot/dialog/confirmation.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Dialog, { DialogTitle, DialogContent, diff --git a/test/screenshot/dialog/index.tsx b/test/screenshot/dialog/index.tsx index 94113b67d..4915c2f10 100644 --- a/test/screenshot/dialog/index.tsx +++ b/test/screenshot/dialog/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Link} from 'react-router-dom'; import {dialogVariants} from './variants'; diff --git a/test/screenshot/dialog/scrollable.tsx b/test/screenshot/dialog/scrollable.tsx index 31d693d37..5c11309fb 100644 --- a/test/screenshot/dialog/scrollable.tsx +++ b/test/screenshot/dialog/scrollable.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Dialog, { DialogTitle, DialogContent, diff --git a/test/screenshot/dialog/simple.tsx b/test/screenshot/dialog/simple.tsx index 5b50c50e3..20fd5ceaa 100644 --- a/test/screenshot/dialog/simple.tsx +++ b/test/screenshot/dialog/simple.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Dialog, { DialogContent, DialogTitle, diff --git a/test/screenshot/drawer/DrawerAboveTopAppBar.tsx b/test/screenshot/drawer/DrawerAboveTopAppBar.tsx index 7d6601805..e2ad2b9b6 100644 --- a/test/screenshot/drawer/DrawerAboveTopAppBar.tsx +++ b/test/screenshot/drawer/DrawerAboveTopAppBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/drawer/index.scss'; import './index.scss'; import TopAppBar, { diff --git a/test/screenshot/drawer/DrawerBelowTopAppBar.tsx b/test/screenshot/drawer/DrawerBelowTopAppBar.tsx index 5146fb4e7..3840a10c2 100644 --- a/test/screenshot/drawer/DrawerBelowTopAppBar.tsx +++ b/test/screenshot/drawer/DrawerBelowTopAppBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/drawer/index.scss'; import './index.scss'; import TopAppBar, { diff --git a/test/screenshot/drawer/DrawerTest.tsx b/test/screenshot/drawer/DrawerTest.tsx index 2b2085528..c08e0f071 100644 --- a/test/screenshot/drawer/DrawerTest.tsx +++ b/test/screenshot/drawer/DrawerTest.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/drawer/index.scss'; import './index.scss'; import MaterialIcon from '../../../packages/material-icon/index'; diff --git a/test/screenshot/drawer/dismissible.tsx b/test/screenshot/drawer/dismissible.tsx index 8e280824a..45f1e08a7 100644 --- a/test/screenshot/drawer/dismissible.tsx +++ b/test/screenshot/drawer/dismissible.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; const DismissibleDrawerScreenshotTest: React.FunctionComponent<{}> = () => { diff --git a/test/screenshot/drawer/dismissibleBelowTopAppBar.tsx b/test/screenshot/drawer/dismissibleBelowTopAppBar.tsx index 512a011b6..c16bdc309 100644 --- a/test/screenshot/drawer/dismissibleBelowTopAppBar.tsx +++ b/test/screenshot/drawer/dismissibleBelowTopAppBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; const DismissibleDrawerScreenshotTest: React.FunctionComponent = () => { diff --git a/test/screenshot/drawer/index.tsx b/test/screenshot/drawer/index.tsx index 5f59a2295..79d8b22fd 100644 --- a/test/screenshot/drawer/index.tsx +++ b/test/screenshot/drawer/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Link} from 'react-router-dom'; import drawerVariants from './variants'; import '../../../packages/drawer/index.scss'; diff --git a/test/screenshot/drawer/modal.tsx b/test/screenshot/drawer/modal.tsx index 94d0837f1..48b2e3f12 100644 --- a/test/screenshot/drawer/modal.tsx +++ b/test/screenshot/drawer/modal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; const ModalDrawerScreenshotTest: React.FunctionComponent = () => { diff --git a/test/screenshot/drawer/permanent.tsx b/test/screenshot/drawer/permanent.tsx index 85c2a2c6d..5e81ac236 100644 --- a/test/screenshot/drawer/permanent.tsx +++ b/test/screenshot/drawer/permanent.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; const PermanentDrawerScreenshotTest: React.FunctionComponent = () => { diff --git a/test/screenshot/drawer/permanentBelowTopAppBar.tsx b/test/screenshot/drawer/permanentBelowTopAppBar.tsx index 5d2f79a66..8730d6e80 100644 --- a/test/screenshot/drawer/permanentBelowTopAppBar.tsx +++ b/test/screenshot/drawer/permanentBelowTopAppBar.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; const DismissibleDrawerScreenshotTest: React.FunctionComponent = () => { diff --git a/test/screenshot/drawer/permanentToModal.tsx b/test/screenshot/drawer/permanentToModal.tsx index 348ba9283..05f540a8a 100644 --- a/test/screenshot/drawer/permanentToModal.tsx +++ b/test/screenshot/drawer/permanentToModal.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import DrawerTest from './DrawerTest'; interface PermanentToModalDrawerScreenshotTestState { diff --git a/test/screenshot/fab/index.tsx b/test/screenshot/fab/index.tsx index 5586fce18..7726d0601 100644 --- a/test/screenshot/fab/index.tsx +++ b/test/screenshot/fab/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Fab from '../../../packages/fab/index'; import '../../../packages/fab/index.scss'; import './index.scss'; diff --git a/test/screenshot/floating-label/index.tsx b/test/screenshot/floating-label/index.tsx index 7741d3eb6..ab02843da 100644 --- a/test/screenshot/floating-label/index.tsx +++ b/test/screenshot/floating-label/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import FloatingLabel from '../../../packages/floating-label/index'; import '../../../packages/floating-label/index.scss'; import './index.scss'; diff --git a/test/screenshot/icon-button/index.tsx b/test/screenshot/icon-button/index.tsx index 97e6a51ee..3f0d32fb4 100644 --- a/test/screenshot/icon-button/index.tsx +++ b/test/screenshot/icon-button/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import MaterialIcon from '../../../packages/material-icon/index'; import '../../../packages/icon-button/index.scss'; import './index.scss'; diff --git a/test/screenshot/index.tsx b/test/screenshot/index.tsx index 33e4b639d..20934cf6f 100644 --- a/test/screenshot/index.tsx +++ b/test/screenshot/index.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; +import React from 'react'; +import ReactDOM from 'react-dom'; import {HashRouter, Route} from 'react-router-dom'; import App from './App'; import topAppBarVariants from './top-app-bar/variants'; diff --git a/test/screenshot/layout-grid/index.tsx b/test/screenshot/layout-grid/index.tsx index a0b77e05c..da897ac03 100644 --- a/test/screenshot/layout-grid/index.tsx +++ b/test/screenshot/layout-grid/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import {Cell, Grid, Row} from '../../../packages/layout-grid/index'; import '../../../packages/layout-grid/index.scss'; diff --git a/test/screenshot/line-ripple/index.tsx b/test/screenshot/line-ripple/index.tsx index bd1f1edf5..8591516e0 100644 --- a/test/screenshot/line-ripple/index.tsx +++ b/test/screenshot/line-ripple/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/line-ripple/index.scss'; import './index.scss'; import LineRipple from '../../../packages/line-ripple/index'; diff --git a/test/screenshot/linear-progress/index.tsx b/test/screenshot/linear-progress/index.tsx index d0f76655f..ea2e1133a 100644 --- a/test/screenshot/linear-progress/index.tsx +++ b/test/screenshot/linear-progress/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import LinearProgress from '../../../packages/linear-progress/index'; import '../../../packages/linear-progress/index.scss'; diff --git a/test/screenshot/list/index.tsx b/test/screenshot/list/index.tsx index 908c52618..2bd413a4f 100644 --- a/test/screenshot/list/index.tsx +++ b/test/screenshot/list/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import '../../../packages/list/index.scss'; import MaterialIcon from '../../../packages/material-icon/index'; diff --git a/test/screenshot/material-icon/index.tsx b/test/screenshot/material-icon/index.tsx index ff4f4d701..50af63356 100644 --- a/test/screenshot/material-icon/index.tsx +++ b/test/screenshot/material-icon/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import MaterialIcon from '../../../packages/material-icon'; import '../../../packages/material-icon/index.scss'; diff --git a/test/screenshot/menu-surface/index.tsx b/test/screenshot/menu-surface/index.tsx index 8d6e8729d..73526f697 100644 --- a/test/screenshot/menu-surface/index.tsx +++ b/test/screenshot/menu-surface/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/menu-surface/index.scss'; import '@material/list/mdc-list.scss'; import './index.scss'; diff --git a/test/screenshot/menu/index.tsx b/test/screenshot/menu/index.tsx new file mode 100644 index 000000000..0269bf71c --- /dev/null +++ b/test/screenshot/menu/index.tsx @@ -0,0 +1,66 @@ +import React from 'react'; +import '../../../packages/menu/index.scss'; +import './index.scss'; +import Menu, {MenuList, MenuListItem, MenuListItemText} from '../../../packages/menu/index'; + +interface MenuState { + coordinates?: {x: number, y: number}; + open: boolean; +}; + +class MenuScreenshotTest extends React.Component<{}, MenuState> { + state = { + open: true, + coordinates: undefined, + }; + + componentDidMount() { + // @ts-ignore + window.addEventListener('contextmenu', this.rightClickCallback); + } + + componentWillUnmount() { + // @ts-ignore + window.removeEventListener('contextmenu', this.rightClickCallback); + } + + private rightClickCallback: React.MouseEventHandler = (event: React.MouseEvent) => { + this.setState({ + open: !this.state.open, + coordinates: {x: event.clientX, y: event.clientY}, + }); + event.preventDefault(); + } + private onClose = () => { + this.setState({open: false}); + } + + render() { + const menuOptions = [ + 'Save', + 'Edit', + 'Cut', + 'Copy', + 'Paste', + ]; + + return ( + console.log(index, item)} + > + + {menuOptions.map((option, index) => ( + + + + ))} + + + ); + } +} + +export default MenuScreenshotTest; diff --git a/test/screenshot/notched-outline/index.tsx b/test/screenshot/notched-outline/index.tsx index f479617ca..fcb25b929 100644 --- a/test/screenshot/notched-outline/index.tsx +++ b/test/screenshot/notched-outline/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import NotchedOutline from '../../../packages/notched-outline/index'; import FloatingLabel from '../../../packages/floating-label/index'; import '../../../packages/notched-outline/index.scss'; diff --git a/test/screenshot/radio/index.tsx b/test/screenshot/radio/index.tsx index d096e007d..b28e81acd 100644 --- a/test/screenshot/radio/index.tsx +++ b/test/screenshot/radio/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import '../../../packages/list/index.scss'; import Radio, {NativeRadioControl} from '../../../packages/radio/index'; diff --git a/test/screenshot/ripple/index.tsx b/test/screenshot/ripple/index.tsx index 0354b0ca3..c3a98ac15 100644 --- a/test/screenshot/ripple/index.tsx +++ b/test/screenshot/ripple/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {withRipple, InjectedProps} from '../../../packages/ripple'; import './index.scss'; diff --git a/test/screenshot/screenshot.tsx b/test/screenshot/screenshot.tsx index 9c6d98eb0..0971ca796 100644 --- a/test/screenshot/screenshot.tsx +++ b/test/screenshot/screenshot.tsx @@ -2,16 +2,16 @@ import {Readable} from 'stream'; import {createHash} from 'crypto'; import {readFile, writeFile} from 'fs'; import {promisify} from 'util'; -import * as puppeteer from 'puppeteer'; +import puppeteer from 'puppeteer'; // @ts-ignore -import * as compareImages from 'resemblejs/compareImages'; +import compareImages from 'resemblejs/compareImages'; import {test} from 'mocha'; import {assert} from 'chai'; -import * as Storage from '@google-cloud/storage'; +import Storage from '@google-cloud/storage'; import comparisonOptions from './screenshot-comparison-options'; import axios from 'axios'; -import * as path from 'path'; -import * as mkdirp from 'mkdirp'; +import path from 'path'; +import mkdirp from 'mkdirp'; const readFilePromise = promisify(readFile); const writeFilePromise = promisify(writeFile); diff --git a/test/screenshot/select/index.tsx b/test/screenshot/select/index.tsx index aa121bf5f..998903be2 100644 --- a/test/screenshot/select/index.tsx +++ b/test/screenshot/select/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Select, {SelectProps} from '../../../packages/select/index'; interface SelectTestState { diff --git a/test/screenshot/snackbar/index.tsx b/test/screenshot/snackbar/index.tsx index 13fcb892b..bc4c25c64 100644 --- a/test/screenshot/snackbar/index.tsx +++ b/test/screenshot/snackbar/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import '../../../packages/snackbar/index.scss'; import './index.scss'; import {Snackbar} from '../../../packages/snackbar/index'; diff --git a/test/screenshot/switch/index.tsx b/test/screenshot/switch/index.tsx index d3062a52e..6eba01124 100644 --- a/test/screenshot/switch/index.tsx +++ b/test/screenshot/switch/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import './index.scss'; import Switch from '../../../packages/switch'; diff --git a/test/screenshot/tab-bar/index.tsx b/test/screenshot/tab-bar/index.tsx index 2847de664..1a30c9752 100644 --- a/test/screenshot/tab-bar/index.tsx +++ b/test/screenshot/tab-bar/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Tab, {TabProps} from '../../../packages/tab/index'; // eslint-disable-line no-unused-vars import TabBar from '../../../packages/tab-bar/index'; import './index.scss'; diff --git a/test/screenshot/tab-indicator/index.tsx b/test/screenshot/tab-indicator/index.tsx index a6ddb3c22..a159bff0a 100644 --- a/test/screenshot/tab-indicator/index.tsx +++ b/test/screenshot/tab-indicator/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TabIndicator from '../../../packages/tab-indicator/index'; import MaterialIcon from '../../../packages/material-icon'; import '../../../packages/tab-indicator/index.scss'; diff --git a/test/screenshot/tab-scroller/index.tsx b/test/screenshot/tab-scroller/index.tsx index 77f2084fd..12193bc28 100644 --- a/test/screenshot/tab-scroller/index.tsx +++ b/test/screenshot/tab-scroller/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TabScroller from '../../../packages/tab-scroller'; import '../../../packages/tab-scroller/index.scss'; import './index.scss'; diff --git a/test/screenshot/tab/index.tsx b/test/screenshot/tab/index.tsx index f2025ca00..6578951e5 100644 --- a/test/screenshot/tab/index.tsx +++ b/test/screenshot/tab/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Tab, {TabProps} from '../../../packages/tab'; import MaterialIcon from '../../../packages/material-icon/index'; import '../../../packages/tab-indicator/index.scss'; diff --git a/test/screenshot/text-field/TestTextField.tsx b/test/screenshot/text-field/TestTextField.tsx index c368b0647..34839b1e0 100644 --- a/test/screenshot/text-field/TestTextField.tsx +++ b/test/screenshot/text-field/TestTextField.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TextField, {Input} from '../../../packages/text-field'; type TestFieldProps = { disabled?: boolean, diff --git a/test/screenshot/text-field/TextFieldPermutations.tsx b/test/screenshot/text-field/TextFieldPermutations.tsx index c0f4c1720..1735cca43 100644 --- a/test/screenshot/text-field/TextFieldPermutations.tsx +++ b/test/screenshot/text-field/TextFieldPermutations.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { iconsMap, denseMap, diff --git a/test/screenshot/text-field/attributesMap.tsx b/test/screenshot/text-field/attributesMap.tsx index d5a4de844..c542196f0 100644 --- a/test/screenshot/text-field/attributesMap.tsx +++ b/test/screenshot/text-field/attributesMap.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {HelperText} from '../../../packages/text-field'; import MaterialIcon from '../../../packages/material-icon/index'; diff --git a/test/screenshot/text-field/fullWidth.tsx b/test/screenshot/text-field/fullWidth.tsx index 3f8f757cb..413449927 100644 --- a/test/screenshot/text-field/fullWidth.tsx +++ b/test/screenshot/text-field/fullWidth.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TextFieldPermutations from './TextFieldPermutations'; const FullWidthTextField = () => { diff --git a/test/screenshot/text-field/helper-text/index.tsx b/test/screenshot/text-field/helper-text/index.tsx index 1e640608f..a4e96c92a 100644 --- a/test/screenshot/text-field/helper-text/index.tsx +++ b/test/screenshot/text-field/helper-text/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import HelperText from '../../../../packages/text-field/helper-text/index'; import '../../../../packages/text-field/helper-text/index.scss'; diff --git a/test/screenshot/text-field/icon/index.tsx b/test/screenshot/text-field/icon/index.tsx index b48859192..227188676 100644 --- a/test/screenshot/text-field/icon/index.tsx +++ b/test/screenshot/text-field/icon/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import Icon from '../../../../packages/text-field/icon/index'; import MaterialIcon from '../../../../packages/material-icon/index'; import '../../../../packages/text-field/icon/index.scss'; diff --git a/test/screenshot/text-field/index.tsx b/test/screenshot/text-field/index.tsx index 367cbc3fe..f44fb1448 100644 --- a/test/screenshot/text-field/index.tsx +++ b/test/screenshot/text-field/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Link} from 'react-router-dom'; import textFieldVariants from './variants'; diff --git a/test/screenshot/text-field/outlined.tsx b/test/screenshot/text-field/outlined.tsx index c85de9ee0..9f303ea4f 100644 --- a/test/screenshot/text-field/outlined.tsx +++ b/test/screenshot/text-field/outlined.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TextFieldPermutations from './TextFieldPermutations'; const OutlinedTextField = () => { diff --git a/test/screenshot/text-field/refTest.tsx b/test/screenshot/text-field/refTest.tsx index d263476be..3a14ae3f4 100644 --- a/test/screenshot/text-field/refTest.tsx +++ b/test/screenshot/text-field/refTest.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TextField, {Input} from '../../../packages/text-field'; import Button from '../../../packages/button/index'; diff --git a/test/screenshot/text-field/standard.tsx b/test/screenshot/text-field/standard.tsx index 699bb4b6d..415d0ed25 100644 --- a/test/screenshot/text-field/standard.tsx +++ b/test/screenshot/text-field/standard.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TextFieldPermutations from './TextFieldPermutations'; const StandardTextField = () => { diff --git a/test/screenshot/text-field/textArea.tsx b/test/screenshot/text-field/textArea.tsx index a6a5d8168..a74b3677b 100644 --- a/test/screenshot/text-field/textArea.tsx +++ b/test/screenshot/text-field/textArea.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { denseMap, requiredMap, diff --git a/test/screenshot/top-app-bar/dense.tsx b/test/screenshot/top-app-bar/dense.tsx index 7f39935d0..2cef6f624 100644 --- a/test/screenshot/top-app-bar/dense.tsx +++ b/test/screenshot/top-app-bar/dense.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/fixed.tsx b/test/screenshot/top-app-bar/fixed.tsx index 2d0f87b98..4d07e7cd8 100644 --- a/test/screenshot/top-app-bar/fixed.tsx +++ b/test/screenshot/top-app-bar/fixed.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/index.tsx b/test/screenshot/top-app-bar/index.tsx index a15e3d35f..a99989c2a 100644 --- a/test/screenshot/top-app-bar/index.tsx +++ b/test/screenshot/top-app-bar/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {Link} from 'react-router-dom'; import topAppBarVariants from './variants'; import {TopAppBarIcon} from '../../../packages/top-app-bar'; diff --git a/test/screenshot/top-app-bar/mainContent.tsx b/test/screenshot/top-app-bar/mainContent.tsx index 47bec24e2..1e0d636d8 100644 --- a/test/screenshot/top-app-bar/mainContent.tsx +++ b/test/screenshot/top-app-bar/mainContent.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { TopAppBarFixedAdjust, TopAppbarFixedAdjustProps, // eslint-disable-line no-unused-vars diff --git a/test/screenshot/top-app-bar/prominent.tsx b/test/screenshot/top-app-bar/prominent.tsx index fd171caad..c2cd752e2 100644 --- a/test/screenshot/top-app-bar/prominent.tsx +++ b/test/screenshot/top-app-bar/prominent.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/prominentDense.tsx b/test/screenshot/top-app-bar/prominentDense.tsx index 80f2e244a..8fd047054 100644 --- a/test/screenshot/top-app-bar/prominentDense.tsx +++ b/test/screenshot/top-app-bar/prominentDense.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/prominentToShortCollapsed.tsx b/test/screenshot/top-app-bar/prominentToShortCollapsed.tsx index 3865cf3b9..82289eb4f 100644 --- a/test/screenshot/top-app-bar/prominentToShortCollapsed.tsx +++ b/test/screenshot/top-app-bar/prominentToShortCollapsed.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/short.tsx b/test/screenshot/top-app-bar/short.tsx index 670a8ac75..6804e7834 100644 --- a/test/screenshot/top-app-bar/short.tsx +++ b/test/screenshot/top-app-bar/short.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/shortCollapsed.tsx b/test/screenshot/top-app-bar/shortCollapsed.tsx index 43192c5fe..d27ba2d46 100644 --- a/test/screenshot/top-app-bar/shortCollapsed.tsx +++ b/test/screenshot/top-app-bar/shortCollapsed.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/standard.tsx b/test/screenshot/top-app-bar/standard.tsx index 83869fb1e..96c7e7361 100644 --- a/test/screenshot/top-app-bar/standard.tsx +++ b/test/screenshot/top-app-bar/standard.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/standardNoActionItems.tsx b/test/screenshot/top-app-bar/standardNoActionItems.tsx index 0396aa172..31f13c4ac 100644 --- a/test/screenshot/top-app-bar/standardNoActionItems.tsx +++ b/test/screenshot/top-app-bar/standardNoActionItems.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/standardWithNavigationIconElement.tsx b/test/screenshot/top-app-bar/standardWithNavigationIconElement.tsx index 55c01d33f..541364976 100644 --- a/test/screenshot/top-app-bar/standardWithNavigationIconElement.tsx +++ b/test/screenshot/top-app-bar/standardWithNavigationIconElement.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/top-app-bar/twoRows.tsx b/test/screenshot/top-app-bar/twoRows.tsx index e63355410..c5e13eec9 100644 --- a/test/screenshot/top-app-bar/twoRows.tsx +++ b/test/screenshot/top-app-bar/twoRows.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/screenshot/typography/index.tsx b/test/screenshot/typography/index.tsx index 0ba302797..34891bc07 100644 --- a/test/screenshot/typography/index.tsx +++ b/test/screenshot/typography/index.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import { Body1, Body2, diff --git a/test/unit/button/index.test.tsx b/test/unit/button/index.test.tsx index 3471bb8e7..6195adcea 100644 --- a/test/unit/button/index.test.tsx +++ b/test/unit/button/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import {Button} from '../../../packages/button/index'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/card/ActionButton.test.tsx b/test/unit/card/ActionButton.test.tsx index 887721b48..e6a463a21 100644 --- a/test/unit/card/ActionButton.test.tsx +++ b/test/unit/card/ActionButton.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {CardActionButtons} from '../../../packages/card/index'; diff --git a/test/unit/card/ActionIcons.test.tsx b/test/unit/card/ActionIcons.test.tsx index e19df903c..7bb7330fa 100644 --- a/test/unit/card/ActionIcons.test.tsx +++ b/test/unit/card/ActionIcons.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {CardActionIcons} from '../../../packages/card/index'; diff --git a/test/unit/card/Actions.test.tsx b/test/unit/card/Actions.test.tsx index 72f438c45..b6587b130 100644 --- a/test/unit/card/Actions.test.tsx +++ b/test/unit/card/Actions.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {CardActions} from '../../../packages/card/index'; diff --git a/test/unit/card/Content.test.tsx b/test/unit/card/Content.test.tsx index baee38227..740c6f4e2 100644 --- a/test/unit/card/Content.test.tsx +++ b/test/unit/card/Content.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; import {CardPrimaryContent} from '../../../packages/card/index'; diff --git a/test/unit/card/Media.test.tsx b/test/unit/card/Media.test.tsx index 652a7025a..b19e16abf 100644 --- a/test/unit/card/Media.test.tsx +++ b/test/unit/card/Media.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {CardMedia} from '../../../packages/card/index'; diff --git a/test/unit/card/index.test.tsx b/test/unit/card/index.test.tsx index 0169ef708..1917a4cb0 100644 --- a/test/unit/card/index.test.tsx +++ b/test/unit/card/index.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import Card from '../../../packages/card/index'; diff --git a/test/unit/checkbox/NativeControl.test.tsx b/test/unit/checkbox/NativeControl.test.tsx index b5887707b..7ccf2b892 100644 --- a/test/unit/checkbox/NativeControl.test.tsx +++ b/test/unit/checkbox/NativeControl.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import NativeControl from '../../../packages/checkbox/NativeControl'; diff --git a/test/unit/checkbox/index.test.tsx b/test/unit/checkbox/index.test.tsx index 2094fa62b..68cf8df0d 100644 --- a/test/unit/checkbox/index.test.tsx +++ b/test/unit/checkbox/index.test.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {Checkbox} from '../../../packages/checkbox/index'; import {MDCCheckboxAdapter} from '@material/checkbox/adapter'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/chips/Chip.test.tsx b/test/unit/chips/Chip.test.tsx index 49545696d..541868328 100644 --- a/test/unit/chips/Chip.test.tsx +++ b/test/unit/chips/Chip.test.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {Chip} from '../../../packages/chips/Chip'; import ChipCheckmark from '../../../packages/chips/ChipCheckmark'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/chips/ChipCheckmark.test.tsx b/test/unit/chips/ChipCheckmark.test.tsx index 9521dce38..4c212fc02 100644 --- a/test/unit/chips/ChipCheckmark.test.tsx +++ b/test/unit/chips/ChipCheckmark.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; import ChipCheckmark from '../../../packages/chips/ChipCheckmark'; diff --git a/test/unit/chips/ChipSet.test.tsx b/test/unit/chips/ChipSet.test.tsx index 2409b1364..19d8ad579 100644 --- a/test/unit/chips/ChipSet.test.tsx +++ b/test/unit/chips/ChipSet.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {shallow, mount} from 'enzyme'; import ChipSet from '../../../packages/chips/ChipSet'; import {Chip, ChipProps} from '../../../packages/chips/index'; // eslint-disable-line no-unused-vars diff --git a/test/unit/dialog/DialogButton.test.tsx b/test/unit/dialog/DialogButton.test.tsx index 2c803ea2d..f83582a51 100644 --- a/test/unit/dialog/DialogButton.test.tsx +++ b/test/unit/dialog/DialogButton.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {DialogButton} from '../../../packages/dialog'; diff --git a/test/unit/dialog/DialogContent.test.tsx b/test/unit/dialog/DialogContent.test.tsx index 1940933f1..0a170ccd5 100644 --- a/test/unit/dialog/DialogContent.test.tsx +++ b/test/unit/dialog/DialogContent.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {DialogContent} from '../../../packages/dialog'; diff --git a/test/unit/dialog/DialogFooter.test.tsx b/test/unit/dialog/DialogFooter.test.tsx index b1f65cadf..838f685f6 100644 --- a/test/unit/dialog/DialogFooter.test.tsx +++ b/test/unit/dialog/DialogFooter.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {DialogFooter, DialogButton} from '../../../packages/dialog'; diff --git a/test/unit/dialog/DialogTitle.test.tsx b/test/unit/dialog/DialogTitle.test.tsx index 658be8f39..0567e9800 100644 --- a/test/unit/dialog/DialogTitle.test.tsx +++ b/test/unit/dialog/DialogTitle.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {DialogTitle} from '../../../packages/dialog'; diff --git a/test/unit/dialog/index.test.tsx b/test/unit/dialog/index.test.tsx index 934580d23..8ed9d2d37 100644 --- a/test/unit/dialog/index.test.tsx +++ b/test/unit/dialog/index.test.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {shallow, mount} from 'enzyme'; import Dialog, { ChildTypes, DialogTitle, DialogContent, DialogFooter, DialogButton, } from '../../../packages/dialog'; -import * as util from '@material/dialog/util'; +import util from '@material/dialog/util'; import {cssClasses, LAYOUT_EVENTS} from '../../../packages/dialog/constants'; import {coerceForTesting} from '../helpers/types'; import {FocusTrap} from 'focus-trap'; diff --git a/test/unit/drawer/index.test.tsx b/test/unit/drawer/index.test.tsx index b029a673b..d28c62cf5 100644 --- a/test/unit/drawer/index.test.tsx +++ b/test/unit/drawer/index.test.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow, mount} from 'enzyme'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {MDCModalDrawerFoundation, MDCDismissibleDrawerFoundation, MDCDrawerAdapter} from '@material/drawer'; import Drawer from '../../../packages/drawer/index'; import {Options, DeactivateOptions, FocusTrap} from 'focus-trap'; // eslint-disable-line no-unused-vars diff --git a/test/unit/fab/index.test.tsx b/test/unit/fab/index.test.tsx index 290d9d757..9e2edf2b3 100644 --- a/test/unit/fab/index.test.tsx +++ b/test/unit/fab/index.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; // need mount for ripple ref call import Fab from '../../../packages/fab/index'; diff --git a/test/unit/floating-label/index.test.tsx b/test/unit/floating-label/index.test.tsx index 2ef6c9fed..d0a1e2307 100644 --- a/test/unit/floating-label/index.test.tsx +++ b/test/unit/floating-label/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {suite, test} from 'mocha'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; diff --git a/test/unit/icon-button/IconToggle.test.tsx b/test/unit/icon-button/IconToggle.test.tsx index 87f39a61f..0396e6abb 100644 --- a/test/unit/icon-button/IconToggle.test.tsx +++ b/test/unit/icon-button/IconToggle.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {IconToggle} from '../../../packages/icon-button/index'; diff --git a/test/unit/icon-button/index.test.tsx b/test/unit/icon-button/index.test.tsx index 78c6e66ce..bdc465180 100644 --- a/test/unit/icon-button/index.test.tsx +++ b/test/unit/icon-button/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {shallow} from 'enzyme'; import {IconButtonBase as IconButton} from '../../../packages/icon-button/index'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/index.tsx b/test/unit/index.tsx index 033748dab..c9122d458 100644 --- a/test/unit/index.tsx +++ b/test/unit/index.tsx @@ -1,5 +1,5 @@ -import * as Enzyme from 'enzyme'; -import * as Adapter from 'enzyme-adapter-react-16'; +import Enzyme from 'enzyme'; +import Adapter from 'enzyme-adapter-react-16'; Enzyme.configure({adapter: new Adapter()}); const context = require.context('.', true, /\.test\.(j|t)sx?$/); context.keys().forEach(context); diff --git a/test/unit/layout-grid/Cell.test.tsx b/test/unit/layout-grid/Cell.test.tsx index 20515b235..716584df4 100644 --- a/test/unit/layout-grid/Cell.test.tsx +++ b/test/unit/layout-grid/Cell.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Cell} from '../../../packages/layout-grid/index'; suite('LayoutGridCell'); diff --git a/test/unit/layout-grid/Grid.test.tsx b/test/unit/layout-grid/Grid.test.tsx index f3c7407ae..a31a071e9 100644 --- a/test/unit/layout-grid/Grid.test.tsx +++ b/test/unit/layout-grid/Grid.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Grid} from '../../../packages/layout-grid/index'; suite('LayoutGridGrid'); diff --git a/test/unit/layout-grid/Row.test.tsx b/test/unit/layout-grid/Row.test.tsx index 4a85f90ed..86d66f3da 100644 --- a/test/unit/layout-grid/Row.test.tsx +++ b/test/unit/layout-grid/Row.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Row} from '../../../packages/layout-grid/index'; suite('LayoutGridRow'); diff --git a/test/unit/line-ripple/index.test.tsx b/test/unit/line-ripple/index.test.tsx index f89c90daa..a531f4459 100644 --- a/test/unit/line-ripple/index.test.tsx +++ b/test/unit/line-ripple/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import LineRipple from '../../../packages/line-ripple/index'; diff --git a/test/unit/linear-progress/index.test.tsx b/test/unit/linear-progress/index.test.tsx index 26ab17f06..c00980222 100644 --- a/test/unit/linear-progress/index.test.tsx +++ b/test/unit/linear-progress/index.test.tsx @@ -1,7 +1,7 @@ import {assert} from 'chai'; import {shallow, mount} from 'enzyme'; -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import LinearProgress from '../../../packages/linear-progress/index'; suite('LinearProgress'); diff --git a/test/unit/list/ListDivider.test.tsx b/test/unit/list/ListDivider.test.tsx index e7e2b3143..71f430542 100644 --- a/test/unit/list/ListDivider.test.tsx +++ b/test/unit/list/ListDivider.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListDivider} from '../../../packages/list/index'; diff --git a/test/unit/list/ListGroup.test.tsx b/test/unit/list/ListGroup.test.tsx index e19f33ffb..1a1c2eb71 100644 --- a/test/unit/list/ListGroup.test.tsx +++ b/test/unit/list/ListGroup.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListGroup} from '../../../packages/list/index'; diff --git a/test/unit/list/ListGroupSubheader.test.tsx b/test/unit/list/ListGroupSubheader.test.tsx index b87d2db9d..615c60748 100644 --- a/test/unit/list/ListGroupSubheader.test.tsx +++ b/test/unit/list/ListGroupSubheader.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListGroupSubheader} from '../../../packages/list/index'; diff --git a/test/unit/list/ListItem.test.tsx b/test/unit/list/ListItem.test.tsx index becb70a2f..6b673d14a 100644 --- a/test/unit/list/ListItem.test.tsx +++ b/test/unit/list/ListItem.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import {ListItem} from '../../../packages/list/index'; diff --git a/test/unit/list/ListItemGraphic.test.tsx b/test/unit/list/ListItemGraphic.test.tsx index 748e51b64..3ac344f6b 100644 --- a/test/unit/list/ListItemGraphic.test.tsx +++ b/test/unit/list/ListItemGraphic.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListItemGraphic} from '../../../packages/list/index'; diff --git a/test/unit/list/ListItemMeta.test.tsx b/test/unit/list/ListItemMeta.test.tsx index b67b3533f..682d4fc42 100644 --- a/test/unit/list/ListItemMeta.test.tsx +++ b/test/unit/list/ListItemMeta.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListItemMeta} from '../../../packages/list/index'; diff --git a/test/unit/list/ListItemText.test.tsx b/test/unit/list/ListItemText.test.tsx index dde391581..3fa986e50 100644 --- a/test/unit/list/ListItemText.test.tsx +++ b/test/unit/list/ListItemText.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {ListItemText} from '../../../packages/list/index'; diff --git a/test/unit/list/index.test.tsx b/test/unit/list/index.test.tsx index 9bb2b06bd..8c294d03a 100644 --- a/test/unit/list/index.test.tsx +++ b/test/unit/list/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {shallow, mount} from 'enzyme'; import List, { ListItem, ListItemProps, // eslint-disable-line no-unused-vars diff --git a/test/unit/material-icon/index.test.tsx b/test/unit/material-icon/index.test.tsx index ddd99c695..292fb254d 100644 --- a/test/unit/material-icon/index.test.tsx +++ b/test/unit/material-icon/index.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; diff --git a/test/unit/menu-surface/index.test.tsx b/test/unit/menu-surface/index.test.tsx index 376b39a21..c78d5bb12 100644 --- a/test/unit/menu-surface/index.test.tsx +++ b/test/unit/menu-surface/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {shallow, mount} from 'enzyme'; import MenuSurface, {Corner} from '../../../packages/menu-surface/index'; import {MDCMenuDistance} from '@material/menu-surface'; diff --git a/test/unit/menu/MenuList.test.tsx b/test/unit/menu/MenuList.test.tsx new file mode 100644 index 000000000..7881ef58b --- /dev/null +++ b/test/unit/menu/MenuList.test.tsx @@ -0,0 +1,68 @@ +import React from 'react'; +import {assert} from 'chai'; +import td from 'testdouble'; +import {shallow, mount} from 'enzyme'; +import {MenuList} from '../../../packages/menu/index'; +import List from '../../../packages/list/index'; +import {MDCListIndex} from '@material/list/types'; +import {coerceForTesting} from '../helpers/types'; + +suite('MenuList'); + +test('classNames adds classes', () => { + const wrapper = mount(); + assert.isTrue(wrapper.getDOMNode().classList.contains('mdc-list')); + assert.isTrue(wrapper.getDOMNode().classList.contains('test-class-name')); +}); + +test('role is defaulted to menu', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menu'); +}); + +test('role is set to props.role', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menuitem'); +}); + +test('aria-hidden is defaulted to true', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('aria-hidden'), 'true'); +}); + +test('aria-hidden is set to props.ariaHidden', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('aria-hidden'), 'false'); +}); + +test('#handleSelect calls props.handleSelect', () => { + const handleSelect = td.func<(activatedItemIndex: number, selected: MDCListIndex) => void>(); + const wrapper = shallow(); + coerceForTesting(wrapper.instance()).handleSelect!(0, 0); + td.verify(handleSelect(0, 0), {times: 1}); +}); + +test('#handleSelect calls props.handleItemAction', () => { + const handleItemAction = td.func<(listItem: Element) => void>(); + const wrapper = mount( + + ); + coerceForTesting(wrapper.instance()).handleSelect!(0, 0); + td.verify(handleItemAction(wrapper.find('.mdc-list-item').getDOMNode()), {times: 1}); +}); + +// These tests with innerRef could be a global set of tests for an HOC +test('innerRef as function as function gets called with List', () => { + const innerRef = td.func<(list: List | null) => void>(); + const wrapper = mount(); + const list = coerceForTesting(wrapper.childAt(0).instance()); + td.verify(innerRef(list), {times: 1}); +}); + + +test('innerRef as refObject gets called with List', () => { + const innerRef = React.createRef(); + const wrapper = mount(); + const list = coerceForTesting(wrapper.childAt(0).instance()); + assert.equal(innerRef.current, list); +}); diff --git a/test/unit/menu/MenuListItem.test.tsx b/test/unit/menu/MenuListItem.test.tsx new file mode 100644 index 000000000..a9080843a --- /dev/null +++ b/test/unit/menu/MenuListItem.test.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import {assert} from 'chai'; +import {mount} from 'enzyme'; +import {MenuListItem} from '../../../packages/menu/index'; + +suite('MenuListItem'); + +test('classNames adds classes', () => { + const wrapper = mount(); + assert.isTrue(wrapper.getDOMNode().classList.contains('mdc-list-item')); + assert.isTrue(wrapper.getDOMNode().classList.contains('test-class-name')); +}); + +test('role is defaulted to menuitem', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menuitem'); +}); + +test('role is set to props.role', () => { + const wrapper = mount(); + assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menu'); +}); diff --git a/test/unit/menu/index.test.tsx b/test/unit/menu/index.test.tsx new file mode 100644 index 000000000..e352b79ee --- /dev/null +++ b/test/unit/menu/index.test.tsx @@ -0,0 +1,248 @@ +import React from 'react'; +import {assert} from 'chai'; +import td from 'testdouble'; +import {shallow, mount, ShallowWrapper, ReactWrapper} from 'enzyme'; +import Menu, {MenuState, MenuList, MenuListItem} from '../../../packages/menu/index'; +import {coerceForTesting} from '../helpers/types'; + +suite('Menu'); + +function getFoundation(wrapper: ReactWrapper | ShallowWrapper) { + return coerceForTesting(wrapper.state()).foundation!; +} + +function getAdapter(wrapper: ReactWrapper | ShallowWrapper) { + // @ts-ignore adapter_ property is protected and we need to override this + return getFoundation(wrapper).adapter_; +} + +test('classNames adds classes', () => { + const wrapper = shallow(); + assert.isTrue(wrapper.hasClass('test-class-name')); + assert.isTrue(wrapper.hasClass('mdc-menu')); +}); + +test('has state.foundation', () => { + const wrapper = shallow(); + const foundation = coerceForTesting(wrapper.state()).foundation; + assert.exists(foundation); +}); + +test('calls foundation.destroy on unmount', () => { + const wrapper = shallow(); + const destroy = getFoundation(wrapper).destroy = td.func<() => void>(); + wrapper.unmount(); + td.verify(destroy(), {times: 1}); +}); + +test('props.open updates from true to false, will set state.open to false', () => { + const wrapper = shallow(); + wrapper.setProps({open: false}); + assert.isFalse(coerceForTesting(wrapper.state()).open); +}); + +test('props.open updates from false to true, will set state.open to true', () => { + const wrapper = shallow(); + wrapper.setProps({open: true}); + assert.isTrue(coerceForTesting(wrapper.state()).open); +}); + +// TODO: implement with https://github.com/material-components/material-components-web-react/issues/796 +// test('adapter.addClassToElementAtIndex adds a class to a listItem', () => { +// }); +// test('adapter.removeClassToElementAtIndex adds a class to a listItem', () => { +// }); + +test('adapter.addAttributeToElementAtIndex adds a class to a listItem', () => { + const wrapper = mount( + + + + ); + getAdapter(wrapper).addAttributeToElementAtIndex(0, 'tabindex', '12'); + const listItem = wrapper.find('.mdc-list-item').getDOMNode(); + assert.equal(coerceForTesting(listItem).tabIndex, 12); + wrapper.unmount(); +}); + +test('adapter.removeAttributeToElementAtIndex adds a class to a listItem', () => { + const wrapper = mount( + + + + ); + getAdapter(wrapper).removeAttributeFromElementAtIndex(0, 'tabindex'); + const listItem = wrapper.find('.mdc-list-item').getDOMNode(); + assert.notEqual(coerceForTesting(listItem).tabIndex, 12); + wrapper.unmount(); +}); + +test('adapter.elementContainsClass returns true if element contains class', () => { + class Div extends React.Component { + render() { + return (
Meow
); + } + } + const wrapper = mount(
); + const contains = getAdapter(wrapper).elementContainsClass( + wrapper.find('div').last().getDOMNode(), 'test-class-name-1'); + assert.isTrue(contains); + wrapper.unmount(); +}); + +test('adapter.elementContainsClass returns FALSE if element does not contains class', () => { + class Div extends React.Component { + render() { + return (
Meow
); + } + } + const wrapper = mount(
); + const contains = getAdapter(wrapper).elementContainsClass( + wrapper.find('div').first().getDOMNode(), 'test-class-name-1'); + assert.isFalse(contains); + wrapper.unmount(); +}); + +test('adapter.closeSurface sets state.open to false', () => { + const wrapper = shallow(); + assert.isTrue(coerceForTesting(wrapper.state()).open); + getAdapter(wrapper).closeSurface(); + assert.isFalse(coerceForTesting(wrapper.state()).open); +}); + +test('adapter.getElementIndex returns index of list item', () => { + const wrapper = mount( + + + + + ); + const lastListItem = wrapper.find('.mdc-list-item').last().getDOMNode(); + const index = getAdapter(wrapper).getElementIndex(lastListItem); + assert.equal(index, 1); + wrapper.unmount(); +}); + +test('adapter.getParentElement returns MenuList if called on list item', () => { + const wrapper = mount( + + + + + ); + const lastListItem = wrapper.find('.mdc-list-item').last().getDOMNode(); + const menuList = getAdapter(wrapper).getParentElement(lastListItem); + assert.equal(menuList, wrapper.find('.mdc-list').getDOMNode()); + wrapper.unmount(); +}); + +test('adapter.getSelectedElementIndex returns selected list item\'s index', () => { + const wrapper = mount( + + + + + ); + const menuList = wrapper.find('.mdc-list').getDOMNode(); + const selectedListItem = getAdapter(wrapper).getSelectedElementIndex(menuList); + assert.equal(selectedListItem, 0); + wrapper.unmount(); +}); + +test('adapter.getSelectedElementIndex returns -1 if no list item is selected', () => { + const wrapper = mount( + + + + + ); + const menuList = wrapper.find('.mdc-list').getDOMNode(); + const selectedListItem = getAdapter(wrapper).getSelectedElementIndex(menuList); + assert.equal(selectedListItem, -1); + wrapper.unmount(); +}); + +test('adapter.notifySelected calls props.onSelected with the selectedindex and listElement DOM node', () => { + const onSelected = td.func<(index: number, element: Element) => void>(); + const wrapper = mount( + + + + + ); + const evtData = {index: 0}; + getAdapter(wrapper).notifySelected(evtData); + td.verify(onSelected(0, wrapper.find('.mdc-list-item').first().getDOMNode()), {times: 1}); + wrapper.unmount(); +}); + +test('onKeyDown calls foundation.handleKeydown', () => { + const wrapper = shallow(); + getFoundation(wrapper).handleKeydown = td.func<(evt: Event) => void>(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); + wrapper.simulate('keydown', evt); + td.verify(getFoundation(wrapper).handleKeydown(evt.nativeEvent), {times: 1}); +}); + +test('onKeyDown calls props.onKeyDown', () => { + const onKeyDown = td.func<(evt: React.KeyboardEvent) => void>(); + const wrapper = shallow(); + const evt = coerceForTesting({ + nativeEvent: {}, + }); + wrapper.simulate('keydown', evt); + td.verify(onKeyDown(evt), {times: 1}); +}); + +test('handleOpen calls props.onOpen', () => { + const onOpen = td.func<() => void>(); + const wrapper = mount(); + coerceForTesting(wrapper.instance()).handleOpen!(); + td.verify(onOpen(), {times: 1}); +}); + +test('handleOpen calls focuses on first list element', () => { + const div = document.createElement('div'); + document.body.append(div); + const options = {attachTo: div}; + const wrapper = mount( + + + + + , options); + coerceForTesting(wrapper.instance()).handleOpen!(); + assert.equal(document.activeElement, wrapper.find('.mdc-list-item').first().getDOMNode()); + wrapper.unmount(); + div.remove(); +}); + +test('menu renders with tabindex=-1', () => { + const wrapper = shallow(); + assert.equal(wrapper.props().tabIndex, -1); +}); + +test('menu renders child with handleItemAction', () => { + class Div extends React.Component { + render() { + return (
Meow
); + } + } + const wrapper = mount(
); + assert.equal( + typeof coerceForTesting(wrapper.instance()).menuListElement.current!.props.handleItemAction, 'function'); + wrapper.unmount(); +}); + +test('menu renders child with wrapFocus', () => { + class Div extends React.Component { + render() { + return (
Meow
); + } + } + const wrapper = mount(
); + assert.isTrue(coerceForTesting(wrapper.instance()).menuListElement.current!.props.wrapFocus); + wrapper.unmount(); +}); diff --git a/test/unit/notched-outline/index.test.tsx b/test/unit/notched-outline/index.test.tsx index cb4ada240..16f5e92e8 100644 --- a/test/unit/notched-outline/index.test.tsx +++ b/test/unit/notched-outline/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import NotchedOutline from '../../../packages/notched-outline/index'; import {MDCNotchedOutlineFoundation} from '@material/notched-outline/foundation'; diff --git a/test/unit/radio/NativeControl.test.tsx b/test/unit/radio/NativeControl.test.tsx index 945be5aa2..a849636a0 100644 --- a/test/unit/radio/NativeControl.test.tsx +++ b/test/unit/radio/NativeControl.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {NativeRadioControl} from '../../../packages/radio/index'; diff --git a/test/unit/radio/index.test.tsx b/test/unit/radio/index.test.tsx index 94b1c0703..71ee29503 100644 --- a/test/unit/radio/index.test.tsx +++ b/test/unit/radio/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow, ReactWrapper} from 'enzyme'; import {Radio, NativeRadioControl, RadioProps} from '../../../packages/radio/index'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/ripple/index.test.tsx b/test/unit/ripple/index.test.tsx index 284b9c445..c2aa9337c 100644 --- a/test/unit/ripple/index.test.tsx +++ b/test/unit/ripple/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {MDCRippleFoundation} from '@material/ripple/foundation'; import {MDCRippleAdapter} from '@material/ripple/adapter'; import {SpecificEventListener} from '@material/base/types'; diff --git a/test/unit/select/NativeControl.test.tsx b/test/unit/select/NativeControl.test.tsx index def9168be..93d535b01 100644 --- a/test/unit/select/NativeControl.test.tsx +++ b/test/unit/select/NativeControl.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {shallow, mount} from 'enzyme'; import NativeControl from '../../../packages/select/NativeControl'; diff --git a/test/unit/select/index.test.tsx b/test/unit/select/index.test.tsx index 689be5c78..ad6332ed1 100644 --- a/test/unit/select/index.test.tsx +++ b/test/unit/select/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; import Select from '../../../packages/select/index'; diff --git a/test/unit/snackbar/index.test.tsx b/test/unit/snackbar/index.test.tsx index 884e0ed2c..9bb3e5451 100644 --- a/test/unit/snackbar/index.test.tsx +++ b/test/unit/snackbar/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {Snackbar} from '../../../packages/snackbar/index'; diff --git a/test/unit/switch/NativeControl.test.tsx b/test/unit/switch/NativeControl.test.tsx index 3e4c42d2a..df8ffcd70 100644 --- a/test/unit/switch/NativeControl.test.tsx +++ b/test/unit/switch/NativeControl.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import NativeControl from '../../../packages/switch/NativeControl'; diff --git a/test/unit/switch/ThumbUnderlay.test.tsx b/test/unit/switch/ThumbUnderlay.test.tsx index f6826b465..ed9938aed 100644 --- a/test/unit/switch/ThumbUnderlay.test.tsx +++ b/test/unit/switch/ThumbUnderlay.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; import ThumbUnderlay from '../../../packages/switch/ThumbUnderlay'; diff --git a/test/unit/switch/index.test.tsx b/test/unit/switch/index.test.tsx index bf846ab3b..0557aa68a 100644 --- a/test/unit/switch/index.test.tsx +++ b/test/unit/switch/index.test.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow, mount} from 'enzyme'; -import * as td from 'testdouble'; +import td from 'testdouble'; import Switch from '../../../packages/switch/index'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/tab-bar/index.test.tsx b/test/unit/tab-bar/index.test.tsx index 3f5e1c07f..c6ef52ae6 100644 --- a/test/unit/tab-bar/index.test.tsx +++ b/test/unit/tab-bar/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import TabBar from '../../../packages/tab-bar/index'; import Tab from '../../../packages/tab/index'; diff --git a/test/unit/tab-indicator/index.test.tsx b/test/unit/tab-indicator/index.test.tsx index 0b9385dc3..d3e699934 100644 --- a/test/unit/tab-indicator/index.test.tsx +++ b/test/unit/tab-indicator/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import TabIndicator from '../../../packages/tab-indicator/index'; import MaterialIcon from '../../../packages/material-icon/index'; diff --git a/test/unit/tab-scroller/index.test.tsx b/test/unit/tab-scroller/index.test.tsx index 46ac1527b..7b32ed1e1 100644 --- a/test/unit/tab-scroller/index.test.tsx +++ b/test/unit/tab-scroller/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import TabScroller from '../../../packages/tab-scroller/index'; import {coerceForTesting} from '../helpers/types'; diff --git a/test/unit/tab/TabRipple.test.tsx b/test/unit/tab/TabRipple.test.tsx index 9fe4288bc..908151cfc 100644 --- a/test/unit/tab/TabRipple.test.tsx +++ b/test/unit/tab/TabRipple.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount} from 'enzyme'; import TabRipple from '../../../packages/tab/TabRipple'; diff --git a/test/unit/tab/index.test.tsx b/test/unit/tab/index.test.tsx index 0493bdd18..acd08f364 100644 --- a/test/unit/tab/index.test.tsx +++ b/test/unit/tab/index.test.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; -import * as td from 'testdouble'; +import td from 'testdouble'; import {mount, shallow} from 'enzyme'; import Tab from '../../../packages/tab/index'; import TabIndicatorRef from '../../../packages/tab-indicator/index'; diff --git a/test/unit/text-field/Input.test.tsx b/test/unit/text-field/Input.test.tsx index 36f344d29..bee3af164 100644 --- a/test/unit/text-field/Input.test.tsx +++ b/test/unit/text-field/Input.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; import {Input} from '../../../packages/text-field/index'; diff --git a/test/unit/text-field/helper-text/index.test.tsx b/test/unit/text-field/helper-text/index.test.tsx index 8dee1a9a9..44e404799 100644 --- a/test/unit/text-field/helper-text/index.test.tsx +++ b/test/unit/text-field/helper-text/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import HelperText from '../../../../packages/text-field/helper-text/index'; diff --git a/test/unit/text-field/icon/index.test.tsx b/test/unit/text-field/icon/index.test.tsx index c8bb5bd59..05596f026 100644 --- a/test/unit/text-field/icon/index.test.tsx +++ b/test/unit/text-field/icon/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import Icon from '../../../../packages/text-field/icon/index'; diff --git a/test/unit/text-field/index.test.tsx b/test/unit/text-field/index.test.tsx index f6aeedeb5..6e61371b6 100644 --- a/test/unit/text-field/index.test.tsx +++ b/test/unit/text-field/index.test.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; -import * as td from 'testdouble'; +import React from 'react'; +import td from 'testdouble'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; import TextField, { diff --git a/test/unit/top-app-bar/FixedAdjust.test.tsx b/test/unit/top-app-bar/FixedAdjust.test.tsx index 212a235ad..0b9961c46 100644 --- a/test/unit/top-app-bar/FixedAdjust.test.tsx +++ b/test/unit/top-app-bar/FixedAdjust.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {TopAppBarFixedAdjust} from '../../../packages/top-app-bar/index'; diff --git a/test/unit/top-app-bar/Icon.test.tsx b/test/unit/top-app-bar/Icon.test.tsx index 9e276bb5b..6c6f00cc6 100644 --- a/test/unit/top-app-bar/Icon.test.tsx +++ b/test/unit/top-app-bar/Icon.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {TopAppBarIcon} from '../../../packages/top-app-bar/index'; diff --git a/test/unit/top-app-bar/Row.test.tsx b/test/unit/top-app-bar/Row.test.tsx index 90297fc75..85928ae99 100644 --- a/test/unit/top-app-bar/Row.test.tsx +++ b/test/unit/top-app-bar/Row.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {TopAppBarRow} from '../../../packages/top-app-bar/index'; diff --git a/test/unit/top-app-bar/Section.test.tsx b/test/unit/top-app-bar/Section.test.tsx index 474a5a278..129e1e941 100644 --- a/test/unit/top-app-bar/Section.test.tsx +++ b/test/unit/top-app-bar/Section.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {TopAppBarSection} from '../../../packages/top-app-bar/index'; diff --git a/test/unit/top-app-bar/Title.test.tsx b/test/unit/top-app-bar/Title.test.tsx index dad754a66..edab9ad26 100644 --- a/test/unit/top-app-bar/Title.test.tsx +++ b/test/unit/top-app-bar/Title.test.tsx @@ -1,4 +1,4 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {shallow} from 'enzyme'; import {TopAppBarTitle} from '../../../packages/top-app-bar/index'; diff --git a/test/unit/top-app-bar/index.test.tsx b/test/unit/top-app-bar/index.test.tsx index c80475f32..39326ad6c 100644 --- a/test/unit/top-app-bar/index.test.tsx +++ b/test/unit/top-app-bar/index.test.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; +import React from 'react'; import {assert} from 'chai'; import {mount, shallow} from 'enzyme'; -import * as td from 'testdouble'; +import td from 'testdouble'; import TopAppBar, { TopAppBarIcon, TopAppBarRow, diff --git a/test/unit/typography/Body1.test.tsx b/test/unit/typography/Body1.test.tsx index dbdfa4b61..2e231e737 100644 --- a/test/unit/typography/Body1.test.tsx +++ b/test/unit/typography/Body1.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Body1} from '../../../packages/typography/index'; suite('TypographyBody1'); diff --git a/test/unit/typography/Body2.test.tsx b/test/unit/typography/Body2.test.tsx index b48a4d07e..6278c2784 100644 --- a/test/unit/typography/Body2.test.tsx +++ b/test/unit/typography/Body2.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Body2} from '../../../packages/typography/index'; suite('TypographyBody2'); diff --git a/test/unit/typography/Button.test.tsx b/test/unit/typography/Button.test.tsx index 11fe17730..c21a8606d 100644 --- a/test/unit/typography/Button.test.tsx +++ b/test/unit/typography/Button.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Button} from '../../../packages/typography/index'; suite('TypographyButton'); diff --git a/test/unit/typography/Caption.test.tsx b/test/unit/typography/Caption.test.tsx index ff0232caf..c7a409fae 100644 --- a/test/unit/typography/Caption.test.tsx +++ b/test/unit/typography/Caption.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Caption} from '../../../packages/typography/index'; suite('TypographyCaption'); diff --git a/test/unit/typography/Headline1.test.tsx b/test/unit/typography/Headline1.test.tsx index 2ffb568b2..29baf14e1 100644 --- a/test/unit/typography/Headline1.test.tsx +++ b/test/unit/typography/Headline1.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline1} from '../../../packages/typography/index'; suite('TypographyHeadline1'); diff --git a/test/unit/typography/Headline2.test.tsx b/test/unit/typography/Headline2.test.tsx index 88e2ebc9b..a0f44da2c 100644 --- a/test/unit/typography/Headline2.test.tsx +++ b/test/unit/typography/Headline2.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline2} from '../../../packages/typography/index'; suite('TypographyHeadline2'); diff --git a/test/unit/typography/Headline3.test.tsx b/test/unit/typography/Headline3.test.tsx index d08006116..995374bd9 100644 --- a/test/unit/typography/Headline3.test.tsx +++ b/test/unit/typography/Headline3.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline3} from '../../../packages/typography/index'; suite('TypographyHeadline3'); diff --git a/test/unit/typography/Headline4.test.tsx b/test/unit/typography/Headline4.test.tsx index 07608847d..773df6c22 100644 --- a/test/unit/typography/Headline4.test.tsx +++ b/test/unit/typography/Headline4.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline4} from '../../../packages/typography/index'; suite('TypographyHeadline4'); diff --git a/test/unit/typography/Headline5.test.tsx b/test/unit/typography/Headline5.test.tsx index 2b65ceec4..2af8cd71f 100644 --- a/test/unit/typography/Headline5.test.tsx +++ b/test/unit/typography/Headline5.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline5} from '../../../packages/typography/index'; suite('TypographyHeadline5'); diff --git a/test/unit/typography/Headline6.test.tsx b/test/unit/typography/Headline6.test.tsx index 426fe033e..982d40ace 100644 --- a/test/unit/typography/Headline6.test.tsx +++ b/test/unit/typography/Headline6.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Headline6} from '../../../packages/typography/index'; suite('TypographyHeadline6'); diff --git a/test/unit/typography/Overline.test.tsx b/test/unit/typography/Overline.test.tsx index fad9a99ea..5231457b7 100644 --- a/test/unit/typography/Overline.test.tsx +++ b/test/unit/typography/Overline.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Overline} from '../../../packages/typography/index'; suite('TypographyOverline'); diff --git a/test/unit/typography/Subtitle1.test.tsx b/test/unit/typography/Subtitle1.test.tsx index 4aeb85986..ccbd9299e 100644 --- a/test/unit/typography/Subtitle1.test.tsx +++ b/test/unit/typography/Subtitle1.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Subtitle1} from '../../../packages/typography/index'; suite('TypographySubtitle1'); diff --git a/test/unit/typography/Subtitle2.test.tsx b/test/unit/typography/Subtitle2.test.tsx index 6e299f6eb..9e546d271 100644 --- a/test/unit/typography/Subtitle2.test.tsx +++ b/test/unit/typography/Subtitle2.test.tsx @@ -1,6 +1,6 @@ import {assert} from 'chai'; import {shallow} from 'enzyme'; -import * as React from 'react'; +import React from 'react'; import {Subtitle2} from '../../../packages/typography/index'; suite('TypographySubtitle2'); diff --git a/tsconfig.json b/tsconfig.json index 7cb7824dc..59f75ef5a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,7 @@ "target": "es5", "noUnusedLocals": true, "noUnusedParameters": true, + "esModuleInterop": true, }, "compileOnSave": true, "exclude": [ From e1a2e2a124862481ef63e6b6fa538a52a4002b7b Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 13:35:57 -0700 Subject: [PATCH 2/7] WIP: remove menu stuff --- packages/button/index.tsx | 6 +- packages/card/PrimaryContent.tsx | 6 +- packages/checkbox/index.tsx | 6 +- packages/chips/Chip.tsx | 6 +- packages/fab/index.tsx | 6 +- packages/icon-button/index.tsx | 6 +- packages/list/ListItem.tsx | 1 + packages/list/index.tsx | 3 +- packages/material-icon/index.tsx | 6 +- packages/menu/MenuList.tsx | 104 ----------- packages/menu/MenuListItem.tsx | 49 ------ packages/menu/index.tsx | 202 ---------------------- packages/radio/index.tsx | 6 +- packages/switch/ThumbUnderlay.tsx | 6 +- packages/tab/TabRipple.tsx | 6 +- test/screenshot/menu/index.tsx | 66 ------- test/unit/menu/MenuList.test.tsx | 68 -------- test/unit/menu/MenuListItem.test.tsx | 22 --- test/unit/menu/index.test.tsx | 248 --------------------------- 19 files changed, 33 insertions(+), 790 deletions(-) delete mode 100644 packages/menu/MenuList.tsx delete mode 100644 packages/menu/MenuListItem.tsx delete mode 100644 packages/menu/index.tsx delete mode 100644 test/screenshot/menu/index.tsx delete mode 100644 test/unit/menu/MenuList.test.tsx delete mode 100644 test/unit/menu/MenuListItem.test.tsx delete mode 100644 test/unit/menu/index.test.tsx diff --git a/packages/button/index.tsx b/packages/button/index.tsx index ce4cf9e16..48d650e82 100644 --- a/packages/button/index.tsx +++ b/packages/button/index.tsx @@ -22,14 +22,14 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; const BUTTON_CLASS_NAME = 'mdc-button__icon'; type ButtonTypes = HTMLAnchorElement | HTMLButtonElement; export interface ButtonProps - extends Ripple.InjectedProps, React.AnchorHTMLAttributes, React.ButtonHTMLAttributes { + extends InjectedProps, React.AnchorHTMLAttributes, React.ButtonHTMLAttributes { raised?: boolean; unelevated?: boolean; outlined?: boolean; @@ -109,5 +109,5 @@ Button.defaultProps = { initRipple: () => {}, }; -export default Ripple.withRipple, ButtonTypes>(Button); +export default withRipple, ButtonTypes>(Button); diff --git a/packages/card/PrimaryContent.tsx b/packages/card/PrimaryContent.tsx index 32ee3e0cd..3d2c137cd 100644 --- a/packages/card/PrimaryContent.tsx +++ b/packages/card/PrimaryContent.tsx @@ -22,9 +22,9 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; -export interface PrimaryContentBaseProps extends React.HTMLProps, Ripple.InjectedProps{ +export interface PrimaryContentBaseProps extends React.HTMLProps, InjectedProps{ className: string; unbounded?: boolean; }; @@ -47,4 +47,4 @@ export const PrimaryContentBase: React.FunctionComponent(PrimaryContentBase); +export default withRipple(PrimaryContentBase); diff --git a/packages/checkbox/index.tsx b/packages/checkbox/index.tsx index 880db1b6c..c6da27f8b 100644 --- a/packages/checkbox/index.tsx +++ b/packages/checkbox/index.tsx @@ -25,11 +25,11 @@ import classnames from 'classnames'; import {MDCCheckboxFoundation} from '@material/checkbox/foundation'; import {MDCCheckboxAdapter} from '@material/checkbox/adapter'; import {cssClasses} from '@material/checkbox/constants'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; import NativeControl from './NativeControl'; -export interface CheckboxProps extends Ripple.InjectedProps { +export interface CheckboxProps extends InjectedProps { checked?: boolean; className?: string; disabled?: boolean; @@ -220,4 +220,4 @@ export class Checkbox extends React.Component { } } -export default Ripple.withRipple(Checkbox); +export default withRipple(Checkbox); diff --git a/packages/chips/Chip.tsx b/packages/chips/Chip.tsx index eff3fba59..1d6bf4378 100644 --- a/packages/chips/Chip.tsx +++ b/packages/chips/Chip.tsx @@ -21,11 +21,11 @@ // THE SOFTWARE. import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; import {MDCChipFoundation} from '@material/chips/chip/foundation'; import {MDCChipAdapter} from '@material/chips/chip/adapter'; -export interface ChipProps extends Ripple.InjectedProps { +export interface ChipProps extends InjectedProps { id?: string; label?: string; className?: string; @@ -256,4 +256,4 @@ export class Chip extends React.Component { } } -export default Ripple.withRipple(Chip); +export default withRipple(Chip); diff --git a/packages/fab/index.tsx b/packages/fab/index.tsx index da3f34f85..03fc57a16 100644 --- a/packages/fab/index.tsx +++ b/packages/fab/index.tsx @@ -22,9 +22,9 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; -export interface FabProps extends Ripple.InjectedProps, +export interface FabProps extends InjectedProps, React.ButtonHTMLAttributes { exited?: boolean; mini?: boolean; @@ -81,4 +81,4 @@ export const Fab: React.FunctionComponent(Fab); +export default withRipple(Fab); diff --git a/packages/icon-button/index.tsx b/packages/icon-button/index.tsx index 9e717c6cb..d53cbbcb5 100644 --- a/packages/icon-button/index.tsx +++ b/packages/icon-button/index.tsx @@ -22,7 +22,7 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; import {MDCIconButtonToggleAdapter} from '@material/icon-button/adapter'; import {MDCIconButtonToggleFoundation} from '@material/icon-button/foundation'; import {MDCIconButtonToggleEventDetail} from '@material/icon-button/types'; @@ -45,7 +45,7 @@ interface IconButtonBaseState extends ElementAttributes { }; export interface IconButtonProps - extends Ripple.InjectedProps, IconButtonBaseProps, React.HTMLProps {}; + extends InjectedProps, IconButtonBaseProps, React.HTMLProps {}; class IconButtonBase extends React.Component< IconButtonProps, @@ -137,7 +137,7 @@ class IconButtonBase extends React.Component< } } -const IconButton = Ripple.withRipple, IconButtonTypes>(IconButtonBase); +const IconButton = withRipple, IconButtonTypes>(IconButtonBase); export default IconButton; export {IconToggle, IconButtonBase}; diff --git a/packages/list/ListItem.tsx b/packages/list/ListItem.tsx index 63cdc6fcf..4617d1b57 100644 --- a/packages/list/ListItem.tsx +++ b/packages/list/ListItem.tsx @@ -35,6 +35,7 @@ export interface ListItemProps extends React.HTMLProps { activated?: boolean; selected?: boolean; onDestroy?: () => void; + ref?: React.Ref; } export default class ListItem extends React.Component< diff --git a/packages/list/index.tsx b/packages/list/index.tsx index 89ba971a0..785f31588 100644 --- a/packages/list/index.tsx +++ b/packages/list/index.tsx @@ -35,7 +35,7 @@ import ListGroupSubheader from './ListGroupSubheader'; const ARIA_ORIENTATION = 'aria-orientation'; const VERTICAL = 'vertical'; -export interface ListProps extends React.HTMLProps { +export interface ListProps extends React.HTMLProps { className?: string; checkboxList?: boolean; radioList?: boolean; @@ -49,6 +49,7 @@ export interface ListProps extends React.HTMLProps | ListItem[] | React.ReactNode; + ref?: React.Ref; }; diff --git a/packages/material-icon/index.tsx b/packages/material-icon/index.tsx index 0a4f53477..cfab0806a 100644 --- a/packages/material-icon/index.tsx +++ b/packages/material-icon/index.tsx @@ -22,7 +22,7 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; export interface MaterialIconDefaultProps extends React.HTMLAttributes { icon?: string; @@ -31,7 +31,7 @@ export interface MaterialIconDefaultProps extends React.HTMLAttributes {}; +export interface MaterialIconProps extends MaterialIconDefaultProps, InjectedProps {}; const MaterialIconDefault: React.FunctionComponent = ({ className, icon, initRipple, hasRipple, unbounded, ...otherProps // eslint-disable-line react/prop-types @@ -50,7 +50,7 @@ const MaterialIconDefault: React.FunctionComponent = ({ ); }; -export const RippleMaterialIcon = Ripple.withRipple(MaterialIconDefault); +export const RippleMaterialIcon = withRipple(MaterialIconDefault); export default class MaterialIcon extends React.Component< MaterialIconProps, {} diff --git a/packages/menu/MenuList.tsx b/packages/menu/MenuList.tsx deleted file mode 100644 index d41c69080..000000000 --- a/packages/menu/MenuList.tsx +++ /dev/null @@ -1,104 +0,0 @@ -// The MIT License -// -// Copyright (c) 2019 Google, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import React from 'react'; -import List, {ListProps} from '@material/react-list'; -// eslint-disable-next-line no-unused-vars -import {MDCMenuFoundation} from '@material/menu/foundation'; - -type RefCallback = (node: T | null) => void; - -export interface MenuListProps extends Exclude { - innerRef?: RefCallback | React.RefObject; - handleItemAction?: MDCMenuFoundation['handleItemAction']; -}; - -class MenuList extends React.Component { - private listInstance = React.createRef(); - - static defaultProps: Partial = { - className: '', - handleSelect: () => {}, - handleItemAction: () => {}, - }; - - get listElements(): Element[] { - if (!this.listInstance.current) { - return []; - } - return this.listInstance.current.listElements; - } - - handleSelect: ListProps['handleSelect'] = (activatedItemIndex, selected) => { - this.props.handleSelect!(activatedItemIndex, selected); - this.props.handleItemAction!(this.listElements[activatedItemIndex]); - } - - - attachRef = (node: List | null) => { - const {innerRef} = this.props; - - // https://github.com/facebook/react/issues/13029#issuecomment-410002316 - // @ts-ignore this is acceptable according to the comment above - this.listInstance.current = node; - - if (!innerRef) { - return; - } - - if (typeof innerRef !== 'function') { - // @ts-ignore same as above - innerRef.current = node; - } else { - innerRef(node); - } - } - - render() { - const { - 'aria-hidden': ariaHidden, - /* eslint-disable no-unused-vars */ - handleSelect, - handleItemAction, - role, - innerRef, - children, - ref, - /* eslint-enable no-unused-vars */ - ...otherProps - } = this.props; - - return ( - - {children} - - ); - } -} - -export default MenuList; diff --git a/packages/menu/MenuListItem.tsx b/packages/menu/MenuListItem.tsx deleted file mode 100644 index 1c5879b75..000000000 --- a/packages/menu/MenuListItem.tsx +++ /dev/null @@ -1,49 +0,0 @@ -// The MIT License -// -// Copyright (c) 2019 Google, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import React from 'react'; -import {ListItem, ListItemProps} from '@material/react-list'; - -export interface MenuListItemProps extends ListItemProps { - children?: React.ReactNode; -} - -class MenuListItem extends React.Component, {}> { - render() { - const { - role = 'menuitem', - children, - ...otherProps - } = this.props; - - return ( - - {children} - - ); - } -} - -export default MenuListItem; diff --git a/packages/menu/index.tsx b/packages/menu/index.tsx deleted file mode 100644 index a5ca13384..000000000 --- a/packages/menu/index.tsx +++ /dev/null @@ -1,202 +0,0 @@ -// The MIT License -// -// Copyright (c) 2019 Google, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import React from 'react'; -import classnames from 'classnames'; -import {MDCMenuFoundation} from '@material/menu/foundation'; -import {MDCMenuAdapter} from '@material/menu/adapter'; -import MenuSurface, {MenuSurfaceProps} from '@material/react-menu-surface'; -import MenuList, {MenuListProps} from './MenuList'; -import MenuListItem from './MenuListItem'; - -const {cssClasses} = MDCMenuFoundation; - -export interface MenuProps extends MenuSurfaceProps { - children: React.ReactElement; - onSelected?: (index: number, item: Element) => void; -}; - -export interface MenuState { - open: boolean; - foundation?: MDCMenuFoundation; -}; - -class Menu extends React.Component { - menuListElement = React.createRef(); - - // need foundation on state so that it initializes MenuList with - // foundation.handleItemAction - state: MenuState = { - foundation: undefined, - open: this.props.open || false, - }; - - static defaultProps: Partial = { - className: '', - open: false, - onKeyDown: () => {}, - onSelected: () => {}, - }; - - componentDidMount() { - const foundation = new MDCMenuFoundation(this.adapter); - foundation.init(); - this.setState({foundation}); - } - - componentDidUpdate(prevProps: MenuProps) { - if (this.props.open !== prevProps.open) { - this.setState({open: this.props.open!}); - } - } - - componentWillUnmount() { - if (this.state.foundation) { - this.state.foundation.destroy(); - } - } - - get listElements(): Element[] { - if (!(this.menuListElement.current - && this.menuListElement.current.listElements - && this.menuListElement.current.listElements.length >= 0 )) { - return []; - } - return this.menuListElement.current.listElements; - } - - get adapter(): MDCMenuAdapter { - return { - // TODO: update to new class management system from - // https://github.com/material-components/material-components-web-react/pull/776/files - // https://github.com/material-components/material-components-web-react/issues/796 - addClassToElementAtIndex: (index, className) => { - const list = this.listElements; - list[index].classList.add(className); - }, - removeClassFromElementAtIndex: (index, className) => { - const list = this.listElements; - list[index].classList.remove(className); - }, - addAttributeToElementAtIndex: (index, attr, value) => { - const list = this.listElements; - list[index].setAttribute(attr, value); - }, - removeAttributeFromElementAtIndex: (index, attr) => { - const list = this.listElements; - list[index].removeAttribute(attr); - }, - elementContainsClass: (element, className) => element.classList.contains(className), - closeSurface: () => this.setState({open: false}), - getElementIndex: (element) => this.listElements.indexOf(element), - getParentElement: (element) => element.parentElement, - getSelectedElementIndex: (selectionGroup) => { - const selectedListItem = selectionGroup.querySelector(`.${cssClasses.MENU_SELECTED_LIST_ITEM}`); - return selectedListItem ? this.listElements.indexOf(selectedListItem) : -1; - }, - notifySelected: (evtData) => this.props.onSelected!( - evtData.index, - this.listElements[evtData.index], - ), - }; - } - - handleKeyDown: React.KeyboardEventHandler = (evt) => { - const {onKeyDown} = this.props; - if (onKeyDown) { - onKeyDown(evt); - } - this.state.foundation && this.state.foundation.handleKeydown(evt.nativeEvent); - } - - handleOpen: MenuSurfaceProps['onOpen'] = () => { - const {onOpen} = this.props; - if (onOpen) { - onOpen(); - } - if (this.listElements.length > 0) { - (this.listElements[0] as HTMLElement).focus(); - } - } - - render() { - const { - className, - /* eslint-disable no-unused-vars */ - open, - onKeyDown, - onOpen, - children, - onSelected, - ref, - /* eslint-enable no-unused-vars */ - ...otherProps - } = this.props; - - return ( - - {this.renderChild()} - - ); - } - - - renderChild() { - const {children} = this.props; - const {foundation} = this.state; - if (!children) return; - - let handleItemAction: MDCMenuFoundation['handleItemAction'] = () => {}; - if (foundation) { - // this is to avoid a `handleItemAction` of undefined error - handleItemAction = foundation.handleItemAction.bind(foundation); - } - const updatedProps: MenuListProps = { - // children.props must appear first - ...children.props, - handleItemAction, - ref: this.menuListElement, - wrapFocus: true, - }; - return React.cloneElement(children, updatedProps); - } -} - -export default Menu; -export {MenuList, MenuListItem}; -export { - ListDivider as MenuListDivider, - ListGroup as MenuListGroup, - ListGroupSubheader as MenuListGroupSubheader, - ListItemGraphic as MenuListGraphic, - ListItemMeta as MenuListMeta, - ListItemText as MenuListItemText, -} from '@material/react-list'; -export {MenuListProps} from './MenuList'; -export {MenuListItemProps} from './MenuListItem'; diff --git a/packages/radio/index.tsx b/packages/radio/index.tsx index caf3f1091..c9c34c3f0 100644 --- a/packages/radio/index.tsx +++ b/packages/radio/index.tsx @@ -24,11 +24,11 @@ import React from 'react'; import classnames from 'classnames'; import {MDCRadioFoundation} from '@material/radio/foundation'; import {MDCRadioAdapter} from '@material/radio/adapter'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; import NativeControl, {NativeControlProps} from './NativeControl'; // eslint-disable-line no-unused-vars export interface RadioProps - extends Ripple.InjectedProps, React.HTMLProps { + extends InjectedProps, React.HTMLProps { label?: string; initRipple: (surface: HTMLDivElement, rippleActivatorRef?: HTMLInputElement) => void; wrapperClasses?: string; @@ -161,5 +161,5 @@ class Radio extends React.Component { } } -export default Ripple.withRipple(Radio); +export default withRipple(Radio); export {Radio, NativeControl as NativeRadioControl}; diff --git a/packages/switch/ThumbUnderlay.tsx b/packages/switch/ThumbUnderlay.tsx index 20768bcb7..312026a9b 100644 --- a/packages/switch/ThumbUnderlay.tsx +++ b/packages/switch/ThumbUnderlay.tsx @@ -22,10 +22,10 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; +import {withRipple, InjectedProps} from '@material/react-ripple'; export interface ThumbUnderlayProps - extends Ripple.InjectedProps, React.HTMLProps { + extends InjectedProps, React.HTMLProps { rippleActivator: React.RefObject; initRipple: (surface: HTMLDivElement, activator?: HTMLInputElement) => void; } @@ -66,4 +66,4 @@ export class ThumbUnderlay extends React.Component { } } -export default Ripple.withRipple(ThumbUnderlay); +export default withRipple(ThumbUnderlay); diff --git a/packages/tab/TabRipple.tsx b/packages/tab/TabRipple.tsx index 3c92b7579..de513dd20 100644 --- a/packages/tab/TabRipple.tsx +++ b/packages/tab/TabRipple.tsx @@ -23,13 +23,13 @@ import React from 'react'; import classnames from 'classnames'; -import Ripple from '@material/react-ripple'; import { + withRipple, InjectedProps, RippledComponentInterface, RippledComponentState, // eslint-disable-line no-unused-vars } from '@material/react-ripple'; export interface TabRippleProps extends React.HTMLAttributes, - Ripple.InjectedProps { + InjectedProps { className: string; ref?: React.RefObject; } @@ -59,6 +59,6 @@ class TabRippleBase extends React.Component { } } -const TabRipple = Ripple.withRipple(TabRippleBase); +const TabRipple = withRipple(TabRippleBase); type TabRipple = React.Component & RippledComponentInterface; export default TabRipple; diff --git a/test/screenshot/menu/index.tsx b/test/screenshot/menu/index.tsx deleted file mode 100644 index 0269bf71c..000000000 --- a/test/screenshot/menu/index.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react'; -import '../../../packages/menu/index.scss'; -import './index.scss'; -import Menu, {MenuList, MenuListItem, MenuListItemText} from '../../../packages/menu/index'; - -interface MenuState { - coordinates?: {x: number, y: number}; - open: boolean; -}; - -class MenuScreenshotTest extends React.Component<{}, MenuState> { - state = { - open: true, - coordinates: undefined, - }; - - componentDidMount() { - // @ts-ignore - window.addEventListener('contextmenu', this.rightClickCallback); - } - - componentWillUnmount() { - // @ts-ignore - window.removeEventListener('contextmenu', this.rightClickCallback); - } - - private rightClickCallback: React.MouseEventHandler = (event: React.MouseEvent) => { - this.setState({ - open: !this.state.open, - coordinates: {x: event.clientX, y: event.clientY}, - }); - event.preventDefault(); - } - private onClose = () => { - this.setState({open: false}); - } - - render() { - const menuOptions = [ - 'Save', - 'Edit', - 'Cut', - 'Copy', - 'Paste', - ]; - - return ( - console.log(index, item)} - > - - {menuOptions.map((option, index) => ( - - - - ))} - - - ); - } -} - -export default MenuScreenshotTest; diff --git a/test/unit/menu/MenuList.test.tsx b/test/unit/menu/MenuList.test.tsx deleted file mode 100644 index 7881ef58b..000000000 --- a/test/unit/menu/MenuList.test.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import React from 'react'; -import {assert} from 'chai'; -import td from 'testdouble'; -import {shallow, mount} from 'enzyme'; -import {MenuList} from '../../../packages/menu/index'; -import List from '../../../packages/list/index'; -import {MDCListIndex} from '@material/list/types'; -import {coerceForTesting} from '../helpers/types'; - -suite('MenuList'); - -test('classNames adds classes', () => { - const wrapper = mount(); - assert.isTrue(wrapper.getDOMNode().classList.contains('mdc-list')); - assert.isTrue(wrapper.getDOMNode().classList.contains('test-class-name')); -}); - -test('role is defaulted to menu', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menu'); -}); - -test('role is set to props.role', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menuitem'); -}); - -test('aria-hidden is defaulted to true', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('aria-hidden'), 'true'); -}); - -test('aria-hidden is set to props.ariaHidden', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('aria-hidden'), 'false'); -}); - -test('#handleSelect calls props.handleSelect', () => { - const handleSelect = td.func<(activatedItemIndex: number, selected: MDCListIndex) => void>(); - const wrapper = shallow(); - coerceForTesting(wrapper.instance()).handleSelect!(0, 0); - td.verify(handleSelect(0, 0), {times: 1}); -}); - -test('#handleSelect calls props.handleItemAction', () => { - const handleItemAction = td.func<(listItem: Element) => void>(); - const wrapper = mount( - - ); - coerceForTesting(wrapper.instance()).handleSelect!(0, 0); - td.verify(handleItemAction(wrapper.find('.mdc-list-item').getDOMNode()), {times: 1}); -}); - -// These tests with innerRef could be a global set of tests for an HOC -test('innerRef as function as function gets called with List', () => { - const innerRef = td.func<(list: List | null) => void>(); - const wrapper = mount(); - const list = coerceForTesting(wrapper.childAt(0).instance()); - td.verify(innerRef(list), {times: 1}); -}); - - -test('innerRef as refObject gets called with List', () => { - const innerRef = React.createRef(); - const wrapper = mount(); - const list = coerceForTesting(wrapper.childAt(0).instance()); - assert.equal(innerRef.current, list); -}); diff --git a/test/unit/menu/MenuListItem.test.tsx b/test/unit/menu/MenuListItem.test.tsx deleted file mode 100644 index a9080843a..000000000 --- a/test/unit/menu/MenuListItem.test.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import {assert} from 'chai'; -import {mount} from 'enzyme'; -import {MenuListItem} from '../../../packages/menu/index'; - -suite('MenuListItem'); - -test('classNames adds classes', () => { - const wrapper = mount(); - assert.isTrue(wrapper.getDOMNode().classList.contains('mdc-list-item')); - assert.isTrue(wrapper.getDOMNode().classList.contains('test-class-name')); -}); - -test('role is defaulted to menuitem', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menuitem'); -}); - -test('role is set to props.role', () => { - const wrapper = mount(); - assert.equal(wrapper.getDOMNode().getAttribute('role'), 'menu'); -}); diff --git a/test/unit/menu/index.test.tsx b/test/unit/menu/index.test.tsx deleted file mode 100644 index e352b79ee..000000000 --- a/test/unit/menu/index.test.tsx +++ /dev/null @@ -1,248 +0,0 @@ -import React from 'react'; -import {assert} from 'chai'; -import td from 'testdouble'; -import {shallow, mount, ShallowWrapper, ReactWrapper} from 'enzyme'; -import Menu, {MenuState, MenuList, MenuListItem} from '../../../packages/menu/index'; -import {coerceForTesting} from '../helpers/types'; - -suite('Menu'); - -function getFoundation(wrapper: ReactWrapper | ShallowWrapper) { - return coerceForTesting(wrapper.state()).foundation!; -} - -function getAdapter(wrapper: ReactWrapper | ShallowWrapper) { - // @ts-ignore adapter_ property is protected and we need to override this - return getFoundation(wrapper).adapter_; -} - -test('classNames adds classes', () => { - const wrapper = shallow(); - assert.isTrue(wrapper.hasClass('test-class-name')); - assert.isTrue(wrapper.hasClass('mdc-menu')); -}); - -test('has state.foundation', () => { - const wrapper = shallow(); - const foundation = coerceForTesting(wrapper.state()).foundation; - assert.exists(foundation); -}); - -test('calls foundation.destroy on unmount', () => { - const wrapper = shallow(); - const destroy = getFoundation(wrapper).destroy = td.func<() => void>(); - wrapper.unmount(); - td.verify(destroy(), {times: 1}); -}); - -test('props.open updates from true to false, will set state.open to false', () => { - const wrapper = shallow(); - wrapper.setProps({open: false}); - assert.isFalse(coerceForTesting(wrapper.state()).open); -}); - -test('props.open updates from false to true, will set state.open to true', () => { - const wrapper = shallow(); - wrapper.setProps({open: true}); - assert.isTrue(coerceForTesting(wrapper.state()).open); -}); - -// TODO: implement with https://github.com/material-components/material-components-web-react/issues/796 -// test('adapter.addClassToElementAtIndex adds a class to a listItem', () => { -// }); -// test('adapter.removeClassToElementAtIndex adds a class to a listItem', () => { -// }); - -test('adapter.addAttributeToElementAtIndex adds a class to a listItem', () => { - const wrapper = mount( - - - - ); - getAdapter(wrapper).addAttributeToElementAtIndex(0, 'tabindex', '12'); - const listItem = wrapper.find('.mdc-list-item').getDOMNode(); - assert.equal(coerceForTesting(listItem).tabIndex, 12); - wrapper.unmount(); -}); - -test('adapter.removeAttributeToElementAtIndex adds a class to a listItem', () => { - const wrapper = mount( - - - - ); - getAdapter(wrapper).removeAttributeFromElementAtIndex(0, 'tabindex'); - const listItem = wrapper.find('.mdc-list-item').getDOMNode(); - assert.notEqual(coerceForTesting(listItem).tabIndex, 12); - wrapper.unmount(); -}); - -test('adapter.elementContainsClass returns true if element contains class', () => { - class Div extends React.Component { - render() { - return (
Meow
); - } - } - const wrapper = mount(
); - const contains = getAdapter(wrapper).elementContainsClass( - wrapper.find('div').last().getDOMNode(), 'test-class-name-1'); - assert.isTrue(contains); - wrapper.unmount(); -}); - -test('adapter.elementContainsClass returns FALSE if element does not contains class', () => { - class Div extends React.Component { - render() { - return (
Meow
); - } - } - const wrapper = mount(
); - const contains = getAdapter(wrapper).elementContainsClass( - wrapper.find('div').first().getDOMNode(), 'test-class-name-1'); - assert.isFalse(contains); - wrapper.unmount(); -}); - -test('adapter.closeSurface sets state.open to false', () => { - const wrapper = shallow(); - assert.isTrue(coerceForTesting(wrapper.state()).open); - getAdapter(wrapper).closeSurface(); - assert.isFalse(coerceForTesting(wrapper.state()).open); -}); - -test('adapter.getElementIndex returns index of list item', () => { - const wrapper = mount( - - - - - ); - const lastListItem = wrapper.find('.mdc-list-item').last().getDOMNode(); - const index = getAdapter(wrapper).getElementIndex(lastListItem); - assert.equal(index, 1); - wrapper.unmount(); -}); - -test('adapter.getParentElement returns MenuList if called on list item', () => { - const wrapper = mount( - - - - - ); - const lastListItem = wrapper.find('.mdc-list-item').last().getDOMNode(); - const menuList = getAdapter(wrapper).getParentElement(lastListItem); - assert.equal(menuList, wrapper.find('.mdc-list').getDOMNode()); - wrapper.unmount(); -}); - -test('adapter.getSelectedElementIndex returns selected list item\'s index', () => { - const wrapper = mount( - - - - - ); - const menuList = wrapper.find('.mdc-list').getDOMNode(); - const selectedListItem = getAdapter(wrapper).getSelectedElementIndex(menuList); - assert.equal(selectedListItem, 0); - wrapper.unmount(); -}); - -test('adapter.getSelectedElementIndex returns -1 if no list item is selected', () => { - const wrapper = mount( - - - - - ); - const menuList = wrapper.find('.mdc-list').getDOMNode(); - const selectedListItem = getAdapter(wrapper).getSelectedElementIndex(menuList); - assert.equal(selectedListItem, -1); - wrapper.unmount(); -}); - -test('adapter.notifySelected calls props.onSelected with the selectedindex and listElement DOM node', () => { - const onSelected = td.func<(index: number, element: Element) => void>(); - const wrapper = mount( - - - - - ); - const evtData = {index: 0}; - getAdapter(wrapper).notifySelected(evtData); - td.verify(onSelected(0, wrapper.find('.mdc-list-item').first().getDOMNode()), {times: 1}); - wrapper.unmount(); -}); - -test('onKeyDown calls foundation.handleKeydown', () => { - const wrapper = shallow(); - getFoundation(wrapper).handleKeydown = td.func<(evt: Event) => void>(); - const evt = coerceForTesting({ - nativeEvent: {}, - }); - wrapper.simulate('keydown', evt); - td.verify(getFoundation(wrapper).handleKeydown(evt.nativeEvent), {times: 1}); -}); - -test('onKeyDown calls props.onKeyDown', () => { - const onKeyDown = td.func<(evt: React.KeyboardEvent) => void>(); - const wrapper = shallow(); - const evt = coerceForTesting({ - nativeEvent: {}, - }); - wrapper.simulate('keydown', evt); - td.verify(onKeyDown(evt), {times: 1}); -}); - -test('handleOpen calls props.onOpen', () => { - const onOpen = td.func<() => void>(); - const wrapper = mount(); - coerceForTesting(wrapper.instance()).handleOpen!(); - td.verify(onOpen(), {times: 1}); -}); - -test('handleOpen calls focuses on first list element', () => { - const div = document.createElement('div'); - document.body.append(div); - const options = {attachTo: div}; - const wrapper = mount( - - - - - , options); - coerceForTesting(wrapper.instance()).handleOpen!(); - assert.equal(document.activeElement, wrapper.find('.mdc-list-item').first().getDOMNode()); - wrapper.unmount(); - div.remove(); -}); - -test('menu renders with tabindex=-1', () => { - const wrapper = shallow(); - assert.equal(wrapper.props().tabIndex, -1); -}); - -test('menu renders child with handleItemAction', () => { - class Div extends React.Component { - render() { - return (
Meow
); - } - } - const wrapper = mount(
); - assert.equal( - typeof coerceForTesting(wrapper.instance()).menuListElement.current!.props.handleItemAction, 'function'); - wrapper.unmount(); -}); - -test('menu renders child with wrapFocus', () => { - class Div extends React.Component { - render() { - return (
Meow
); - } - } - const wrapper = mount(
); - assert.isTrue(coerceForTesting(wrapper.instance()).menuListElement.current!.props.wrapFocus); - wrapper.unmount(); -}); From b863b7989c07066f5721fc42fa9c8671dd7d625f Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 15:55:50 -0700 Subject: [PATCH 3/7] fix: desctructure --- packages/ripple/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ripple/index.tsx b/packages/ripple/index.tsx index caaa63ba0..881457378 100644 --- a/packages/ripple/index.tsx +++ b/packages/ripple/index.tsx @@ -25,7 +25,7 @@ import {Subtract} from 'utility-types'; // eslint-disable-line no-unused-vars import {MDCRippleFoundation} from '@material/ripple/foundation'; import {MDCRippleAdapter} from '@material/ripple/adapter'; -import util from '@material/ripple/util'; +import {supportsCssVariables} from '@material/ripple/util'; import {SpecificEventListener} from '@material/base/types'; import {matches} from '@material/dom/ponyfill'; @@ -152,7 +152,7 @@ export function withRipple < createAdapter = (surface: Surface, activator?: Activator): MDCRippleAdapter => { return { - browserSupportsCssVars: () => util.supportsCssVariables(window), + browserSupportsCssVars: () => supportsCssVariables(window), isUnbounded: () => this.props.unbounded! as boolean, isSurfaceActive: () => { if (activator) { From 29c0de3e509118989ac01fb356b4573497271125 Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 16:02:03 -0700 Subject: [PATCH 4/7] fix: add applypassive --- packages/ripple/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ripple/index.tsx b/packages/ripple/index.tsx index 881457378..fa7df7bec 100644 --- a/packages/ripple/index.tsx +++ b/packages/ripple/index.tsx @@ -25,7 +25,7 @@ import {Subtract} from 'utility-types'; // eslint-disable-line no-unused-vars import {MDCRippleFoundation} from '@material/ripple/foundation'; import {MDCRippleAdapter} from '@material/ripple/adapter'; -import {supportsCssVariables} from '@material/ripple/util'; +import {supportsCssVariables, applyPassive} from '@material/ripple/util'; import {SpecificEventListener} from '@material/base/types'; import {matches} from '@material/dom/ponyfill'; @@ -180,13 +180,13 @@ export function withRipple < document.documentElement.addEventListener( evtType, handler, - util.applyPassive() + applyPassive() ), deregisterDocumentInteractionHandler: (evtType: string, handler: EventListener) => document.documentElement.removeEventListener( evtType, handler, - util.applyPassive() + applyPassive() ), registerResizeHandler: (handler: SpecificEventListener<'resize'>) => window.addEventListener('resize', handler), From 17f2c4cbe4553d8625153e8d58e1c28a8f128ff5 Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 16:31:44 -0700 Subject: [PATCH 5/7] fix: add util method --- packages/tab-scroller/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/tab-scroller/index.tsx b/packages/tab-scroller/index.tsx index 3eb5a13e2..c623bc15b 100644 --- a/packages/tab-scroller/index.tsx +++ b/packages/tab-scroller/index.tsx @@ -24,7 +24,7 @@ import React from 'react'; import classnames from 'classnames'; import {MDCTabScrollerFoundation} from '@material/tab-scroller/foundation'; import {MDCTabScrollerAdapter} from '@material/tab-scroller/adapter'; -import util from '@material/tab-scroller/util'; +import {computeHorizontalScrollbarHeight} from '@material/tab-scroller/util'; import {matches} from '@material/dom/ponyfill'; const convertDashToCamelCase = (propName: string) => @@ -160,7 +160,7 @@ export default class TabScroller extends React.Component< this.contentElement.current.getBoundingClientRect() : new ClientRect(), computeHorizontalScrollbarHeight: () => - util.computeHorizontalScrollbarHeight(document), + computeHorizontalScrollbarHeight(document), }; } From c9c1766cc2364cc09a325d02321eeefbd02f9881 Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 16:55:26 -0700 Subject: [PATCH 6/7] fix: utils test --- test/unit/dialog/index.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/dialog/index.test.tsx b/test/unit/dialog/index.test.tsx index 8ed9d2d37..d39593b43 100644 --- a/test/unit/dialog/index.test.tsx +++ b/test/unit/dialog/index.test.tsx @@ -6,7 +6,7 @@ import {shallow, mount} from 'enzyme'; import Dialog, { ChildTypes, DialogTitle, DialogContent, DialogFooter, DialogButton, } from '../../../packages/dialog'; -import util from '@material/dialog/util'; +import {isScrollable, areTopsMisaligned} from '@material/dialog/util'; import {cssClasses, LAYOUT_EVENTS} from '../../../packages/dialog/constants'; import {coerceForTesting} from '../helpers/types'; import {FocusTrap} from 'focus-trap'; @@ -235,7 +235,7 @@ test('#adapter.isContentScrollable returns the value of util.isScrollable', () = ); const content = wrapper.instance().content; assert.strictEqual( - wrapper.instance().adapter.isContentScrollable(), util.isScrollable(content) + wrapper.instance().adapter.isContentScrollable(), isScrollable(content) ); }); @@ -244,7 +244,7 @@ test('#adapter.areButtonsStacked returns result of util.areTopsMisaligned', () = const buttons = wrapper.instance().buttons; assert.strictEqual( wrapper.instance().adapter.areButtonsStacked(), - util.areTopsMisaligned(buttons) + areTopsMisaligned(buttons) ); }); From 48bc8e03d2996142782ad9c7269df6f0bd11683d Mon Sep 17 00:00:00 2001 From: Matt Goo Date: Tue, 23 Apr 2019 17:21:38 -0700 Subject: [PATCH 7/7] fix: remove refs --- packages/list/ListItem.tsx | 1 - packages/list/index.tsx | 1 - 2 files changed, 2 deletions(-) diff --git a/packages/list/ListItem.tsx b/packages/list/ListItem.tsx index 4617d1b57..63cdc6fcf 100644 --- a/packages/list/ListItem.tsx +++ b/packages/list/ListItem.tsx @@ -35,7 +35,6 @@ export interface ListItemProps extends React.HTMLProps { activated?: boolean; selected?: boolean; onDestroy?: () => void; - ref?: React.Ref; } export default class ListItem extends React.Component< diff --git a/packages/list/index.tsx b/packages/list/index.tsx index 785f31588..30b742fd4 100644 --- a/packages/list/index.tsx +++ b/packages/list/index.tsx @@ -49,7 +49,6 @@ export interface ListProps extends React.HT wrapFocus?: boolean; tag?: string; children: ListItem | ListItem[] | React.ReactNode; - ref?: React.Ref; };