From 6666e836cb4b812c49634752fc43ddc05bdf8560 Mon Sep 17 00:00:00 2001 From: gschrag Date: Mon, 15 Jun 2020 17:17:04 -0600 Subject: [PATCH 1/6] feat: create new component segmented button create segmented button component to let user manipulate toggle values of a group of related buttons closes #6069 --- packages/mdc-segmented-button/README.md | 3 +++ packages/mdc-segmented-button/_index.scss | 0 .../mdc-segmented-button.scss | 0 packages/mdc-segmented-button/package.json | 18 ++++++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 packages/mdc-segmented-button/README.md create mode 100644 packages/mdc-segmented-button/_index.scss create mode 100644 packages/mdc-segmented-button/mdc-segmented-button.scss create mode 100644 packages/mdc-segmented-button/package.json diff --git a/packages/mdc-segmented-button/README.md b/packages/mdc-segmented-button/README.md new file mode 100644 index 00000000000..286a0f7ccf4 --- /dev/null +++ b/packages/mdc-segmented-button/README.md @@ -0,0 +1,3 @@ +# Segmented Buttons + +Segmented buttons allow users to toggle the values of grouped buttons. \ No newline at end of file diff --git a/packages/mdc-segmented-button/_index.scss b/packages/mdc-segmented-button/_index.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/mdc-segmented-button/mdc-segmented-button.scss b/packages/mdc-segmented-button/mdc-segmented-button.scss new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/mdc-segmented-button/package.json b/packages/mdc-segmented-button/package.json new file mode 100644 index 00000000000..b583aa4d8dd --- /dev/null +++ b/packages/mdc-segmented-button/package.json @@ -0,0 +1,18 @@ +{ + "name": "@material/segmented-button", + "version": "0.0.0", + "description": "The Material Components for the web segmented button component", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/material-components/material-components-web.git" + }, + "keywords": [ + "material components", + "material design", + "segmented button" + ], + "publishConfig": { + "access": "public" + } +} \ No newline at end of file From dca0b0b9e30465f4d94dc880a8c19c3d5086d61e Mon Sep 17 00:00:00 2001 From: gschrag Date: Mon, 22 Jun 2020 17:03:25 -0600 Subject: [PATCH 2/6] chore: fix package.json and change styles.scss file name add directory field to package.json and rename scss file --- packages/mdc-segmented-button/package.json | 3 ++- .../{mdc-segmented-button.scss => styles.scss} | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename packages/mdc-segmented-button/{mdc-segmented-button.scss => styles.scss} (100%) diff --git a/packages/mdc-segmented-button/package.json b/packages/mdc-segmented-button/package.json index b583aa4d8dd..e5ef0cc1ed9 100644 --- a/packages/mdc-segmented-button/package.json +++ b/packages/mdc-segmented-button/package.json @@ -5,7 +5,8 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/material-components/material-components-web.git" + "url": "https://github.com/material-components/material-components-web.git", + "directory": "packages/mdc-segmented-button" }, "keywords": [ "material components", diff --git a/packages/mdc-segmented-button/mdc-segmented-button.scss b/packages/mdc-segmented-button/styles.scss similarity index 100% rename from packages/mdc-segmented-button/mdc-segmented-button.scss rename to packages/mdc-segmented-button/styles.scss From fb81b8df233c589837bf31a92b8571d2a3cd4c8e Mon Sep 17 00:00:00 2001 From: gschrag Date: Tue, 23 Jun 2020 14:56:03 -0600 Subject: [PATCH 3/6] chore: add MIT license to Sass files include license in all source files --- packages/mdc-segmented-button/_index.scss | 23 +++++++++++++++++++++++ packages/mdc-segmented-button/styles.scss | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/packages/mdc-segmented-button/_index.scss b/packages/mdc-segmented-button/_index.scss index e69de29bb2d..cb71d3ee240 100644 --- a/packages/mdc-segmented-button/_index.scss +++ b/packages/mdc-segmented-button/_index.scss @@ -0,0 +1,23 @@ +// +// Copyright 2020 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. +// + +// TODO: Add styles. \ No newline at end of file diff --git a/packages/mdc-segmented-button/styles.scss b/packages/mdc-segmented-button/styles.scss index e69de29bb2d..cb71d3ee240 100644 --- a/packages/mdc-segmented-button/styles.scss +++ b/packages/mdc-segmented-button/styles.scss @@ -0,0 +1,23 @@ +// +// Copyright 2020 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. +// + +// TODO: Add styles. \ No newline at end of file From d2d73bc39a18807bb73c6a29cc9d4931dcf70276 Mon Sep 17 00:00:00 2001 From: gschrag Date: Thu, 25 Jun 2020 12:29:39 -0600 Subject: [PATCH 4/6] chore: add segmented-button to css bundle factory include new segmented styles and add newlines to files --- packages/mdc-segmented-button/_index.scss | 2 +- packages/mdc-segmented-button/package.json | 2 +- packages/mdc-segmented-button/styles.scss | 2 +- scripts/webpack/css-bundle-factory.js | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/mdc-segmented-button/_index.scss b/packages/mdc-segmented-button/_index.scss index cb71d3ee240..f5cb1158bd4 100644 --- a/packages/mdc-segmented-button/_index.scss +++ b/packages/mdc-segmented-button/_index.scss @@ -20,4 +20,4 @@ // THE SOFTWARE. // -// TODO: Add styles. \ No newline at end of file +// TODO: Add styles. diff --git a/packages/mdc-segmented-button/package.json b/packages/mdc-segmented-button/package.json index e5ef0cc1ed9..8ae17e91ba5 100644 --- a/packages/mdc-segmented-button/package.json +++ b/packages/mdc-segmented-button/package.json @@ -16,4 +16,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/packages/mdc-segmented-button/styles.scss b/packages/mdc-segmented-button/styles.scss index cb71d3ee240..f5cb1158bd4 100644 --- a/packages/mdc-segmented-button/styles.scss +++ b/packages/mdc-segmented-button/styles.scss @@ -20,4 +20,4 @@ // THE SOFTWARE. // -// TODO: Add styles. \ No newline at end of file +// TODO: Add styles. diff --git a/scripts/webpack/css-bundle-factory.js b/scripts/webpack/css-bundle-factory.js index ce9fe2727d1..0bc58960a39 100644 --- a/scripts/webpack/css-bundle-factory.js +++ b/scripts/webpack/css-bundle-factory.js @@ -169,6 +169,7 @@ class CssBundleFactory { 'mdc.notched-outline': getAbsolutePath('/packages/mdc-notched-outline/mdc-notched-outline.scss'), 'mdc.radio': getAbsolutePath('/packages/mdc-radio/mdc-radio.scss'), 'mdc.ripple': getAbsolutePath('/packages/mdc-ripple/mdc-ripple.scss'), + 'mdc.segmented-button': getAbsolutePath('/packages/mdc-segmented-button/styles.scss'), 'mdc.select': getAbsolutePath('/packages/mdc-select/mdc-select.scss'), 'mdc.slider': getAbsolutePath('/packages/mdc-slider/mdc-slider.scss'), 'mdc.snackbar': getAbsolutePath('/packages/mdc-snackbar/mdc-snackbar.scss'), From dcccc253f0332962f16fca428850c5a25ac0e436 Mon Sep 17 00:00:00 2001 From: gschrag Date: Thu, 25 Jun 2020 12:55:09 -0600 Subject: [PATCH 5/6] chore: add segmented-button dependency to material-components-web add dependency to fix tests --- packages/material-components-web/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/material-components-web/package.json b/packages/material-components-web/package.json index 59b585c2c6c..c3806251d3f 100644 --- a/packages/material-components-web/package.json +++ b/packages/material-components-web/package.json @@ -47,6 +47,7 @@ "@material/radio": "^7.0.0", "@material/ripple": "^7.0.0", "@material/rtl": "^7.0.0", + "@material/segmented-button": "^0.0.0", "@material/select": "^7.0.0", "@material/shape": "^7.0.0", "@material/slider": "^7.0.0", From b471197988fc2e64008abd4e13576af65127ee64 Mon Sep 17 00:00:00 2001 From: gschrag Date: Thu, 25 Jun 2020 13:06:41 -0600 Subject: [PATCH 6/6] chore: import segmented-button sass into material-components-web use segmented-button sass in material-components-web --- packages/material-components-web/material-components-web.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/material-components-web/material-components-web.scss b/packages/material-components-web/material-components-web.scss index 758c060b019..5f5fae54b46 100644 --- a/packages/material-components-web/material-components-web.scss +++ b/packages/material-components-web/material-components-web.scss @@ -43,6 +43,7 @@ @use "@material/notched-outline/mdc-notched-outline"; @use "@material/radio/mdc-radio"; @use "@material/ripple/mdc-ripple"; +@use "@material/segmented-button/styles"; @use "@material/select/mdc-select"; @use "@material/slider/mdc-slider"; @use "@material/snackbar/mdc-snackbar";