From 306fd7f71bc44080c992939ba43d6a8c3de2159a Mon Sep 17 00:00:00 2001 From: Patty RoDee Date: Tue, 3 Apr 2018 11:14:06 -0700 Subject: [PATCH] fix(infrastructure): Unexpose private tab (#2499) Unexpose the private Tab component. Add a brief check inside of the check-deps script that ignores private packages. Fixes #2498 --- demos/tab.html | 148 ------------------ demos/tab.scss | 60 ------- packages/material-components-web/index.js | 3 - .../material-components-web.scss | 1 - packages/material-components-web/package.json | 1 - scripts/check-pkg-for-release.js | 4 + scripts/webpack/css-bundle-factory.js | 1 - scripts/webpack/js-bundle-factory.js | 1 - 8 files changed, 4 insertions(+), 215 deletions(-) delete mode 100644 demos/tab.html delete mode 100644 demos/tab.scss diff --git a/demos/tab.html b/demos/tab.html deleted file mode 100644 index 4703500cee9..00000000000 --- a/demos/tab.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Tab - Material Components Catalog - - - - - - - - - - -
-
-
- - - - Tab -
-
-
- -
-
- - -
- -
-

RTL

-
- - -
-
- -
-

Basic Tabs

-
- -
- - -
-
-
- -
- - -
-
-
- -
-

Basic Tabs with Custom Colors

-
- -
- - -
-
-
- -
- - -
-
-
-
- - - - - - diff --git a/demos/tab.scss b/demos/tab.scss deleted file mode 100644 index 4f29421084b..00000000000 --- a/demos/tab.scss +++ /dev/null @@ -1,60 +0,0 @@ -// -// Copyright 2018 Google Inc. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -@import "./common"; -@import "../packages/mdc-tab/mixins"; -@import "../packages/mdc-tab/mdc-tab"; -@import "../packages/mdc-elevation/mixins"; -@import "../packages/mdc-ripple/mixins"; -@import "../packages/mdc-theme/color-palette"; - -.demo { - display: flex; - align-items: center; -} - -.demo-tab { - flex: 0 1 auto; -} - -.demo-controls { - padding: 0 16px; -} - -.rtl-container { - margin: 24px; - padding: 24px; -} - -.custom-tab1 { - @include mdc-states($material-color-yellow-a700); - @include mdc-tab-text-label-color($material-color-pink-600); - - &.mdc-tab--active { - @include mdc-tab-text-label-color($material-color-cyan-600); - } -} - -.custom-tab2 { - @include mdc-states($material-color-amber-a700); - @include mdc-tab-text-label-color($material-color-red-300); - @include mdc-tab-icon-color($material-color-orange-300); - - &.mdc-tab--active { - @include mdc-tab-text-label-color($material-color-red-900); - @include mdc-tab-icon-color($material-color-orange-900); - } -} diff --git a/packages/material-components-web/index.js b/packages/material-components-web/index.js index f1f5a091361..524178b4571 100644 --- a/packages/material-components-web/index.js +++ b/packages/material-components-web/index.js @@ -34,7 +34,6 @@ import * as select from '@material/select/index'; import * as selectionControl from '@material/selection-control/index'; import * as slider from '@material/slider/index'; import * as snackbar from '@material/snackbar/index'; -import * as tab from '@material/tab/index'; import * as tabs from '@material/tabs/index'; import * as textField from '@material/textfield/index'; import * as toolbar from '@material/toolbar/index'; @@ -57,7 +56,6 @@ autoInit.register('MDCLinearProgress', linearProgress.MDCLinearProgress); autoInit.register('MDCNotchedOutline', notchedOutline.MDCNotchedOutline); autoInit.register('MDCRadio', radio.MDCRadio); autoInit.register('MDCSnackbar', snackbar.MDCSnackbar); -autoInit.register('MDCTab_', tab.MDCTab); autoInit.register('MDCTab', tabs.MDCTab); autoInit.register('MDCTabBar', tabs.MDCTabBar); autoInit.register('MDCTextField', textField.MDCTextField); @@ -89,7 +87,6 @@ export { selectionControl, slider, snackbar, - tab, tabs, textField, toolbar, diff --git a/packages/material-components-web/material-components-web.scss b/packages/material-components-web/material-components-web.scss index 62189d4c9af..8702de8d51c 100644 --- a/packages/material-components-web/material-components-web.scss +++ b/packages/material-components-web/material-components-web.scss @@ -39,7 +39,6 @@ @import "@material/slider/mdc-slider"; @import "@material/snackbar/mdc-snackbar"; @import "@material/switch/mdc-switch"; -@import "@material/tab/mdc-tab"; @import "@material/tabs/mdc-tabs"; @import "@material/textfield/mdc-text-field"; @import "@material/theme/mdc-theme"; diff --git a/packages/material-components-web/package.json b/packages/material-components-web/package.json index 8324679d0ef..0fd1e41c79b 100644 --- a/packages/material-components-web/package.json +++ b/packages/material-components-web/package.json @@ -43,7 +43,6 @@ "@material/slider": "^0.34.0", "@material/snackbar": "^0.34.0", "@material/switch": "^0.34.0", - "@material/tab": "^0.34.0", "@material/tabs": "^0.34.0", "@material/textfield": "^0.34.0", "@material/theme": "^0.34.0", diff --git a/scripts/check-pkg-for-release.js b/scripts/check-pkg-for-release.js index d50ec961d68..ca8ffe361c6 100644 --- a/scripts/check-pkg-for-release.js +++ b/scripts/check-pkg-for-release.js @@ -112,6 +112,10 @@ function checkCSSDependencyAddedInWebpackConfig() { } function checkDependencyAddedInMDCPackage() { + if (pkg.private) { + console.log('Skipping private component', pkg.name); + return; + } // Package is added to package.json checkPkgDependencyAddedInMDCPackage(); diff --git a/scripts/webpack/css-bundle-factory.js b/scripts/webpack/css-bundle-factory.js index 6c4c72aa2c1..4a211566e55 100644 --- a/scripts/webpack/css-bundle-factory.js +++ b/scripts/webpack/css-bundle-factory.js @@ -160,7 +160,6 @@ class CssBundleFactory { 'mdc.slider': getAbsolutePath('/packages/mdc-slider/mdc-slider.scss'), 'mdc.snackbar': getAbsolutePath('/packages/mdc-snackbar/mdc-snackbar.scss'), 'mdc.switch': getAbsolutePath('/packages/mdc-switch/mdc-switch.scss'), - 'mdc.tab': getAbsolutePath('/packages/mdc-tab/mdc-tab.scss'), 'mdc.tabs': getAbsolutePath('/packages/mdc-tabs/mdc-tabs.scss'), 'mdc.textfield': getAbsolutePath('/packages/mdc-textfield/mdc-text-field.scss'), 'mdc.theme': getAbsolutePath('/packages/mdc-theme/mdc-theme.scss'), diff --git a/scripts/webpack/js-bundle-factory.js b/scripts/webpack/js-bundle-factory.js index f20d6e1d3b6..c7047096a75 100644 --- a/scripts/webpack/js-bundle-factory.js +++ b/scripts/webpack/js-bundle-factory.js @@ -145,7 +145,6 @@ class JsBundleFactory { selectionControl: getAbsolutePath('/packages/mdc-selection-control/index.js'), slider: getAbsolutePath('/packages/mdc-slider/index.js'), snackbar: getAbsolutePath('/packages/mdc-snackbar/index.js'), - tab: getAbsolutePath('/packages/mdc-tab/index.js'), tabs: getAbsolutePath('/packages/mdc-tabs/index.js'), textfield: getAbsolutePath('/packages/mdc-textfield/index.js'), toolbar: getAbsolutePath('/packages/mdc-toolbar/index.js'),