├── .eslintrc.json ├── .gemini.yml ├── .github ├── ISSUE_TEMPLATE │ └── config.yml └── workflows │ ├── unit-tests.yml │ └── visual-tests.yml.disabled ├── .gitignore ├── .stylelintrc ├── LICENSE ├── README.md ├── bower.json ├── demo ├── .eslintrc.json ├── button-a11y-demos.html ├── button-basic-demos.html ├── button-demo.js ├── button-theme-variants-demos.html ├── demos.json └── index.html ├── gen-tsd.json ├── index.html ├── magi-p3-post.js ├── package-lock-p3.json ├── package-lock.json ├── package.json ├── screenshot.png ├── src └── vaadin-button.html ├── test ├── .eslintrc ├── button-in-template.html ├── index.html ├── test-suites.js ├── vaadin-button_test.html └── visual │ ├── colors.html │ ├── default-rtl.html │ ├── default.html │ ├── icons.html │ ├── screens │ └── vaadin-button │ │ ├── colors-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── colors-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── default-rtl-tests-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── default-rtl-tests-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── default-tests-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── default-tests-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── icons-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── icons-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── sizing-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── sizing-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── truncation-expansion-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── truncation-expansion-material │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ ├── types-lumo │ │ └── default │ │ │ ├── chrome.png │ │ │ └── firefox.png │ │ └── types-material │ │ └── default │ │ ├── chrome.png │ │ └── firefox.png │ ├── sizing.html │ ├── test.js │ ├── truncation-expansion.html │ ├── types.html │ └── vaadin-logo.svg ├── theme ├── lumo │ ├── vaadin-button-styles.html │ └── vaadin-button.html └── material │ ├── vaadin-button-styles.html │ └── vaadin-button.html ├── vaadin-button.html ├── vaadin-directory-description.md └── wct.conf.js /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "vaadin", 3 | "env": { 4 | "browser": true, 5 | "node": true, 6 | "es6": true 7 | }, 8 | "plugins": [ 9 | "html" 10 | ], 11 | "globals": { 12 | "Polymer": false, 13 | "Vaadin": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.gemini.yml: -------------------------------------------------------------------------------- 1 | rootUrl: http://localhost:8080/components/vaadin-button/test/visual/ 2 | gridUrl: http://localhost:4444/wd/hub 3 | screenshotsDir: ./test/visual/screens 4 | 5 | system: 6 | plugins: 7 | polyserve: 8 | port: 8080 9 | sauce: true 10 | 11 | browsers: 12 | chrome: 13 | desiredCapabilities: 14 | browserName: "chrome" 15 | version: "67.0" 16 | platform: "Windows 10" 17 | 18 | firefox: 19 | desiredCapabilities: 20 | browserName: "firefox" 21 | version: "47.0" 22 | platform: "Windows 10" 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: "Web Components: Bugs and Feature Requests" 4 | url: https://github.com/vaadin/web-components/issues/new/choose 5 | about: Please report issues related to the TypeScript and HTML API of Vaadin components here. 6 | - name: "Flow Components: Bugs and Feature Requests" 7 | url: https://github.com/vaadin/flow-components/issues/new/choose 8 | about: Please report issues related to the Java API of Vaadin components here. 9 | -------------------------------------------------------------------------------- /.github/workflows/unit-tests.yml: -------------------------------------------------------------------------------- 1 | name: Unit Tests 2 | 3 | # all pull requests 4 | on: pull_request 5 | 6 | jobs: 7 | # Running local tests is disabled due to outdated dependencies 8 | # see https://github.com/vaadin/components-team-tasks/issues/628 9 | # unit-tests-p2: 10 | # name: Polymer 2 on the CI agent 11 | # runs-on: ubuntu-latest 12 | # steps: 13 | # - name: Set up Node 16.x 14 | # uses: actions/setup-node@v4 15 | # with: 16 | # node-version: 16.x 17 | # 18 | # - name: Check out the source code 19 | # uses: actions/checkout@v2 20 | # 21 | # - name: Install global npm dependencies 22 | # # bower is needed to run 'bower install' 23 | # # polymer-cli is needed to run the lint step 24 | # run: "npm install --quiet --no-progress --global bower polymer-cli" 25 | # 26 | # - name: Install project npm dependencies 27 | # run: "npm ci" 28 | # 29 | # - name: Install project Bower dependencies 30 | # run: "bower install --quiet" 31 | # 32 | # - name: Run automated magi-cli checks 33 | # run: "npm run check" 34 | # 35 | # - name: Run a linter 36 | # run: "npm run lint" 37 | # 38 | # # the full set of environments is tested with Polymer 3 below 39 | # - name: Run unit tests locally (in the VM instance running this job) 40 | # run: "xvfb-run -s '-screen 0 1024x768x24' npm test" 41 | 42 | unit-tests-p3: 43 | name: Polymer 3 on SauceLabs 44 | runs-on: ubuntu-latest 45 | steps: 46 | - name: Set up Node 16.x 47 | uses: actions/setup-node@v4 48 | with: 49 | node-version: 16.x 50 | 51 | - name: Check out the (Polymer 2) source code 52 | uses: actions/checkout@v2 53 | 54 | - name: Install global npm dependencies 55 | # bower and polymer-modulizer are needed to run the Polymer 3 conversion step 56 | run: "npm install --quiet --no-progress --global bower magi-cli polymer-modulizer" 57 | 58 | - name: Convert the source code to Polymer 3 59 | run: | 60 | git config --local user.email "github-actions[bot]@users.noreply.github.com" 61 | git config --local user.name "github-actions[bot]" 62 | magi p3-convert --out . --import-style=name 63 | 64 | # workaround for running tests on Android on SauceLabs (see wct.conf.js) 65 | - name: Add 'localhost-for-saucelabs' to /etc/hosts 66 | run: echo "127.0.0.1 localhost-for-saucelabs" | sudo tee -a /etc/hosts 67 | 68 | - name: Run unit tests on SauceLabs 69 | run: "npm test -- --env saucelabs" 70 | env: 71 | SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} 72 | SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} 73 | -------------------------------------------------------------------------------- /.github/workflows/visual-tests.yml.disabled: -------------------------------------------------------------------------------- 1 | name: Visual Tests 2 | 3 | # all pull requests 4 | on: pull_request 5 | 6 | jobs: 7 | visual-tests: 8 | name: Polymer 2 on SauceLabs 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Set up Node 12.x 12 | uses: actions/setup-node@v2 13 | with: 14 | node-version: 12.x 15 | 16 | - name: Check out the source code 17 | uses: actions/checkout@v2 18 | 19 | - name: Install latest npm 20 | # magi-cli 1.0 requires npm 7 or higher 21 | run: "npm install -g npm@8" 22 | 23 | - name: Install global npm dependencies 24 | # bower is needed to run 'bower install' 25 | # gemini is needed to run the visual tests step 26 | run: "npm install --quiet --no-progress --global bower gemini@^4.0.0 gemini-sauce gemini-polyserve" 27 | 28 | - name: Install project npm dependencies 29 | run: "npm ci" 30 | 31 | - name: Install project Bower dependencies 32 | run: "bower install --quiet" 33 | 34 | - name: Run visual tests on SauceLabs 35 | run: "gemini test --reporter html --reporter flat test/visual" 36 | env: 37 | SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }} 38 | SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }} 39 | 40 | - name: Publish the Visual Tests failures report as an Artifact for this Workflow run 41 | if: ${{ failure() }} 42 | uses: actions/upload-artifact@v2 43 | with: 44 | name: Visual tests failures report 45 | path: gemini-report/ 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bower_components 2 | node_modules 3 | yarn.lock 4 | coverage 5 | analysis.json 6 | -------------------------------------------------------------------------------- /.stylelintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "stylelint-config-vaadin" 3 | } 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | Copyright 2017 Vaadin Ltd. 179 | 180 | Licensed under the Apache License, Version 2.0 (the "License"); 181 | you may not use this file except in compliance with the License. 182 | You may obtain a copy of the License at 183 | 184 | http://www.apache.org/licenses/LICENSE-2.0 185 | 186 | Unless required by applicable law or agreed to in writing, software 187 | distributed under the License is distributed on an "AS IS" BASIS, 188 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 189 | See the License for the specific language governing permissions and 190 | limitations under the License. 191 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # <vaadin-button> 2 | 3 | > ⚠️ Starting from Vaadin 20, the source code and issues for this component are migrated to the [`vaadin/web-components`](https://github.com/vaadin/web-components/tree/master/packages/vaadin-button) monorepository. 4 | > This repository contains the source code and releases of `` for the Vaadin versions 10 to 19. 5 | 6 | [<vaadin-button>](https://vaadin.com/components/vaadin-button) is a Web Component providing an accessible and customizable button, part of the [Vaadin components](https://vaadin.com/components). 7 | 8 | [Live Demo ↗](https://vaadin.com/components/vaadin-button/html-examples) 9 | | 10 | [API documentation ↗](https://vaadin.com/components/vaadin-button/html-api) 11 | 12 | [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-button)](https://www.npmjs.com/package/@vaadin/vaadin-button) 13 | [![Bower version](https://badgen.net/github/release/vaadin/vaadin-button)](https://github.com/vaadin/vaadin-button/releases) 14 | [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-button) 15 | [![Build Status](https://travis-ci.org/vaadin/vaadin-button.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-button) 16 | [![Coverage Status](https://coveralls.io/repos/github/vaadin/vaadin-button/badge.svg?branch=master)](https://coveralls.io/github/vaadin/vaadin-button?branch=master) 17 | [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-button) 18 | [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadinvaadin-button.svg)](https://vaadin.com/directory/component/vaadinvaadin-button) 19 | 20 | 31 | ```html 32 | Primary 33 | Secondary 34 | Tertiary 35 | ``` 36 | 37 | [Screenshot of vaadin-button, using the default Lumo theme](https://vaadin.com/components/vaadin-button) 38 | 39 | ## Installation 40 | 41 | The Vaadin components are distributed as Bower and npm packages. 42 | Please note that the version range is the same, as the API has not changed. 43 | You should not mix Bower and npm versions in the same application, though. 44 | 45 | Unlike the official Polymer Elements, the converted Polymer 3 compatible Vaadin components 46 | are only published on npm, not pushed to GitHub repositories. 47 | 48 | ### Polymer 2 and HTML Imports compatible version 49 | 50 | Install `vaadin-button`: 51 | 52 | ```sh 53 | bower i vaadin/vaadin-button --save 54 | ``` 55 | 56 | Once installed, import it in your application: 57 | 58 | ```html 59 | 60 | ``` 61 | ### Polymer 3 and ES Modules compatible version 62 | 63 | Install `vaadin-button`: 64 | 65 | ```sh 66 | npm i @vaadin/vaadin-button --save 67 | ``` 68 | 69 | Once installed, import it in your application: 70 | 71 | ```js 72 | import '@vaadin/vaadin-button/vaadin-button.js'; 73 | ``` 74 | 75 | ## Getting started 76 | 77 | Vaadin components use the Lumo theme by default. 78 | 79 | To use the Material theme, import the correspondent file from the `theme/material` folder. 80 | 81 | ## Entry points 82 | 83 | - The component with the Lumo theme: 84 | 85 | `theme/lumo/vaadin-button.html` 86 | 87 | - The component with the Material theme: 88 | 89 | `theme/material/vaadin-button.html` 90 | 91 | - Alias for `theme/lumo/vaadin-button.html`: 92 | 93 | `vaadin-button.html` 94 | 95 | 96 | ## Running demos and tests in a browser 97 | 98 | 1. Fork the `vaadin-button` repository and clone it locally. 99 | 100 | 1. Make sure you have [npm](https://www.npmjs.com/) and [Bower](https://bower.io) installed. 101 | 102 | 1. When in the `vaadin-button` directory, run `npm install` and then `bower install` to install dependencies. 103 | 104 | 1. Run `npm start`, browser will automatically open the component API documentation. 105 | 106 | 1. You can also open demo or in-browser tests by adding **demo** or **test** to the URL, for example: 107 | 108 | - http://127.0.0.1:3000/components/vaadin-button/demo 109 | - http://127.0.0.1:3000/components/vaadin-button/test 110 | 111 | 112 | ## Running tests from the command line 113 | 114 | > [!WARNING] 115 | > Running tests locally from the CLI does not work due to outdated dependencies. Run tests via SauceLabs or in the browser instead. 116 | 117 | 1. When in the `vaadin-button` directory, run `polymer test` 118 | 119 | 120 | ## Following the coding style 121 | 122 | We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files as well as JavaScript snippets inside `.html` files. 123 | 124 | 125 | ## Big Thanks 126 | 127 | Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs](https://saucelabs.com). 128 | 129 | 130 | ## Contributing 131 | 132 | To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first. 133 | 134 | 135 | ## License 136 | 137 | Apache License 2.0 138 | 139 | Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics. 140 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vaadin-button", 3 | "homepage": "https://vaadin.com/components", 4 | "authors": [ 5 | "Vaadin Ltd" 6 | ], 7 | "description": "vaadin-button", 8 | "main": [ 9 | "vaadin-button.html", 10 | "src/vaadin-button.html", 11 | "theme/material/vaadin-button.html" 12 | ], 13 | "keywords": [ 14 | "Vaadin", 15 | "button", 16 | "web-components", 17 | "web-component", 18 | "polymer" 19 | ], 20 | "license": "Apache-2.0", 21 | "ignore": [ 22 | "**/.*", 23 | "node_modules", 24 | "bower_components", 25 | "package-lock.json", 26 | "wct.conf.js" 27 | ], 28 | "devDependencies": { 29 | "iron-component-page": "^3.0.0", 30 | "iron-icon": "^2.0.1", 31 | "iron-test-helpers": "^2.0.0", 32 | "webcomponentsjs": "^1.0.0", 33 | "web-component-tester": "^6.1.5", 34 | "vaadin-demo-helpers": "vaadin/vaadin-demo-helpers#^3.0.0" 35 | }, 36 | "dependencies": { 37 | "polymer": "^2.0.0", 38 | "vaadin-control-state-mixin": "vaadin/vaadin-control-state-mixin#^2.2.1", 39 | "vaadin-themable-mixin": "vaadin/vaadin-themable-mixin#^1.6.1", 40 | "vaadin-lumo-styles": "vaadin/vaadin-lumo-styles#^1.3.3", 41 | "vaadin-material-styles": "vaadin/vaadin-material-styles#^1.2.0", 42 | "vaadin-element-mixin": "vaadin/vaadin-element-mixin#^2.4.1" 43 | }, 44 | "resolutions": { 45 | "vaadin-element-mixin": "^2.0.0" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /demo/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | }, 4 | "globals": { 5 | "ButtonDemo": false, 6 | "DemoReadyEventEmitter": false 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /demo/button-a11y-demos.html: -------------------------------------------------------------------------------- 1 | 2 | 29 | 37 | 38 | -------------------------------------------------------------------------------- /demo/button-basic-demos.html: -------------------------------------------------------------------------------- 1 | 2 | 54 | 62 | 63 | -------------------------------------------------------------------------------- /demo/button-demo.js: -------------------------------------------------------------------------------- 1 | window.ButtonDemo = superClass => { 2 | return class extends superClass { 3 | static get properties() { 4 | return { 5 | }; 6 | } 7 | }; 8 | }; 9 | 10 | window.addEventListener('WebComponentsReady', () => { 11 | document.body.removeAttribute('unresolved'); 12 | }); 13 | -------------------------------------------------------------------------------- /demo/button-theme-variants-demos.html: -------------------------------------------------------------------------------- 1 | 2 | 73 | 81 | 82 | -------------------------------------------------------------------------------- /demo/demos.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Vaadin Button", 3 | "pages": [ 4 | { 5 | "name": "Basics", 6 | "url": "button-basic-demos", 7 | "src": "button-basic-demos.html", 8 | "meta": { 9 | "title": "Vaadin Button Basic Examples", 10 | "description": "", 11 | "image": "" 12 | } 13 | } 14 | , 15 | { 16 | "name": "Accessibility", 17 | "url": "button-accessibility-demos", 18 | "src": "button-a11y-demos.html", 19 | "meta": { 20 | "title": "Vaadin Button Accessibility", 21 | "description": "", 22 | "image": "" 23 | } 24 | } 25 | , 26 | { 27 | "name": "Theme Variants", 28 | "url": "button-theme-variants-demos", 29 | "src": "button-theme-variants-demos.html", 30 | "meta": { 31 | "title": "Vaadin Button Theme Variants", 32 | "description": "", 33 | "image": "" 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Vaadin Button Examples 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /gen-tsd.json: -------------------------------------------------------------------------------- 1 | { 2 | "excludeFiles": [ 3 | "wct.conf.js", 4 | "index.html", 5 | "demo/**/*", 6 | "test/**/*", 7 | "theme/**/*" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vaadin-button 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /magi-p3-post.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | files: [ 3 | 'vaadin-button.js' 4 | ], 5 | from: [ 6 | /import '\.\/theme\/lumo\/vaadin-(.+)\.js';/ 7 | ], 8 | to: [ 9 | `import './theme/lumo/vaadin-$1.js';\nexport * from './src/vaadin-$1.js';` 10 | ] 11 | }; 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@vaadin/vaadin-button", 3 | "version": "2.4.0", 4 | "description": "vaadin-button", 5 | "main": "vaadin-button.html", 6 | "repository": "vaadin/vaadin-button", 7 | "keywords": [ 8 | "Vaadin", 9 | "button", 10 | "web-components", 11 | "web-component", 12 | "polymer" 13 | ], 14 | "author": "Vaadin Ltd", 15 | "license": "Apache-2.0", 16 | "bugs": { 17 | "url": "https://github.com/vaadin/vaadin-button/issues" 18 | }, 19 | "homepage": "https://vaadin.com/components", 20 | "files": [ 21 | "vaadin-*.d.ts", 22 | "vaadin-*.js", 23 | "src", 24 | "theme" 25 | ], 26 | "husky": { 27 | "hooks": { 28 | "pre-commit": "npm run lint" 29 | } 30 | }, 31 | "scripts": { 32 | "test": "wct", 33 | "check": "npm-run-all --parallel check:*", 34 | "check:bower": "magi check-bower", 35 | "check:version": "magi check-version", 36 | "lint": "npm-run-all --parallel lint:*", 37 | "lint:css": "stylelint *.html src/*.html demo/*.html theme/**/*.html test/*html", 38 | "lint:html": "eslint *.html src demo test --ext .html", 39 | "lint:js": "eslint *.js test", 40 | "lint:polymer": "polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html", 41 | "prestart": "polymer analyze vaadin-* > analysis.json", 42 | "start": "polymer serve --port 3000 --open", 43 | "preversion": "magi update-version" 44 | }, 45 | "devDependencies": { 46 | "@vaadin/vaadin-component-dev-dependencies": "^3.2.0" 47 | }, 48 | "overrides": { 49 | "wct-sauce": { 50 | "sauce-connect-launcher": "vaadin/sauce-connect-launcher#upgrade-sauce-connect-5" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/screenshot.png -------------------------------------------------------------------------------- /src/vaadin-button.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 83 | 195 | 196 | -------------------------------------------------------------------------------- /test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "globals": { 3 | "WCT": false, 4 | "describe": false, 5 | "beforeEach": false, 6 | "fixture": false, 7 | "it": false, 8 | "expect": false, 9 | "gemini": false, 10 | "MockInteractions": false 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/button-in-template.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | vaadin-button tests 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 38 | 39 | -------------------------------------------------------------------------------- /test/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | vaadin-button tests 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /test/test-suites.js: -------------------------------------------------------------------------------- 1 | window.VaadinButtonSuites = [ 2 | 'vaadin-button_test.html', 3 | 'button-in-template.html' 4 | ]; 5 | -------------------------------------------------------------------------------- /test/vaadin-button_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | vaadin-button tests 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 134 | 135 | -------------------------------------------------------------------------------- /test/visual/colors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 18 | 19 | 20 | 21 | 22 | 23 |

Colors

24 | 25 | Contrast: 26 | 27 | 28 | Button 29 | 30 | 31 | 32 | Button 33 | 34 | 35 | 36 | Button 37 | 38 | 39 |
Contrast[disabled]: 40 | 41 | 42 | Button 43 | 44 | 45 | 46 | Button 47 | 48 | 49 | 50 | Button 51 | 52 | 53 | 54 |
Success: 55 | 56 | 57 | Button 58 | 59 | 60 | 61 | Button 62 | 63 | 64 | 65 | Button 66 | 67 | 68 |
Success[disabled]: 69 | 70 | 71 | Button 72 | 73 | 74 | 75 | Button 76 | 77 | 78 | 79 | Button 80 | 81 | 82 | 83 |
Error: 84 | 85 | 86 | Button 87 | 88 | 89 | 90 | Button 91 | 92 | 93 | 94 | Button 95 | 96 | 97 |
Error[disabled]: 98 | 99 | 100 | Button 101 | 102 | 103 | 104 | Button 105 | 106 | 107 | 108 | Button 109 | 110 | 111 |
Material variations: 112 | 113 | 114 | Button 115 | 116 | 117 | 118 | Button 119 | 120 | 121 |
Material variations[disabled]: 122 | 123 | 124 | Button 125 | 126 | 127 | 128 | Button 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /test/visual/default-rtl.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | Disabled 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | Tertiary 31 | 32 | 33 | 34 | Icon suffix 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Icon prefix 45 | 46 | 47 |
48 |
49 | 50 | 51 | -------------------------------------------------------------------------------- /test/visual/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 |
16 |
17 | 18 | 19 | Disabled 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | Autofocused 28 | 29 | 30 |
31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /test/visual/icons.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 |

Icons and size presets

26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | Icon prefix 34 | 35 | 36 | 37 | Icon suffix 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | Icon prefix 48 | 49 | 50 | 51 | Icon suffix 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | Icon prefix 62 | 63 | 64 | 65 | Icon suffix 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/colors-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/colors-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/colors-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/colors-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/colors-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/colors-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/colors-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/colors-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-rtl-tests-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-rtl-tests-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-rtl-tests-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-rtl-tests-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-rtl-tests-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-rtl-tests-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-rtl-tests-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-rtl-tests-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-tests-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-tests-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-tests-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-tests-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-tests-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-tests-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/default-tests-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/default-tests-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/icons-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/icons-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/icons-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/icons-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/icons-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/icons-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/icons-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/icons-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/sizing-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/sizing-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/sizing-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/sizing-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/sizing-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/sizing-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/sizing-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/sizing-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/truncation-expansion-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/truncation-expansion-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/truncation-expansion-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/truncation-expansion-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/truncation-expansion-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/truncation-expansion-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/truncation-expansion-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/truncation-expansion-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/types-lumo/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/types-lumo/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/types-lumo/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/types-lumo/default/firefox.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/types-material/default/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/types-material/default/chrome.png -------------------------------------------------------------------------------- /test/visual/screens/vaadin-button/types-material/default/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vaadin/vaadin-button/0d75399003571e0ab91dd255bbde1092a22abaf2/test/visual/screens/vaadin-button/types-material/default/firefox.png -------------------------------------------------------------------------------- /test/visual/sizing.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 |

Sizing and vertical align

26 | 27 | 28 | 29 | Fixed width 30 | 31 | 32 | 33 | Fixed height 34 | 35 | 36 | 37 | 38 | 39 | Fixed width and height 40 | 41 | 42 | 43 | 44 | Multiple
lines 45 |
46 | 47 | -------------------------------------------------------------------------------- /test/visual/test.js: -------------------------------------------------------------------------------- 1 | gemini.suite('vaadin-button', function(rootSuite) { 2 | function wait(actions, find) { 3 | actions.wait(5000); 4 | } 5 | 6 | function goToAboutBlank(actions, find) { 7 | // Firefox stops responding on socket after a test, workaround: 8 | return actions.executeJS(function(window) { 9 | window.location.href = 'about:blank'; // just go away, please! 10 | }); 11 | } 12 | 13 | rootSuite 14 | .before(wait) 15 | .after(goToAboutBlank); 16 | ['lumo', 'material'].forEach(theme => { 17 | gemini.suite(`default-tests-${theme}`, function(suite) { 18 | suite 19 | .setUrl(`default.html?theme=${theme}`) 20 | .setCaptureElements('body') 21 | .capture('default'); 22 | }); 23 | 24 | gemini.suite(`default-rtl-tests-${theme}`, function(suite) { 25 | suite 26 | .setUrl(`default-rtl.html?theme=${theme}`) 27 | .setCaptureElements('body') 28 | .capture('default'); 29 | }); 30 | 31 | gemini.suite(`colors-${theme}`, function(suite) { 32 | suite 33 | .setUrl(`colors.html?theme=${theme}`) 34 | .setCaptureElements('body') 35 | .capture('default'); 36 | }); 37 | 38 | gemini.suite(`icons-${theme}`, function(suite) { 39 | suite 40 | .setUrl(`icons.html?theme=${theme}`) 41 | .setCaptureElements('body') 42 | .capture('default'); 43 | }); 44 | 45 | gemini.suite(`sizing-${theme}`, function(suite) { 46 | suite 47 | .setUrl(`sizing.html?theme=${theme}`) 48 | .setCaptureElements('body') 49 | .capture('default'); 50 | }); 51 | 52 | gemini.suite(`truncation-expansion-${theme}`, function(suite) { 53 | suite 54 | .setUrl(`truncation-expansion.html?theme=${theme}`) 55 | .setCaptureElements('body') 56 | .capture('default'); 57 | }); 58 | 59 | gemini.suite(`types-${theme}`, function(suite) { 60 | suite 61 | .setUrl(`types.html?theme=${theme}`) 62 | .setCaptureElements('body') 63 | .capture('default'); 64 | }); 65 | }); 66 | 67 | }); 68 | -------------------------------------------------------------------------------- /test/visual/truncation-expansion.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 |

Truncation and expansion

26 | 27 | Longer text for a button 28 | 29 | 30 | 31 | Longer text for a button 32 | 33 | 34 | 35 | Longer text for a button 36 | 37 | 38 | 39 | Longer text for a button 40 | 41 | 42 | 43 | Longer text for a button 44 | 45 | 46 | 47 | Longer text for a button 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /test/visual/types.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | 23 | 24 | 25 |

Types

26 | 27 | Primary: 28 | 29 | 30 | Button 31 | 32 | 33 | 34 | 35 | Icon prefix 36 | 37 | 38 | 39 | Icon suffix 40 | 41 | 42 | 43 | 44 | Disabled 45 | 46 | 47 |
Tertiary: 48 | 49 | 50 | Button 51 | 52 | 53 | 54 | 55 | Icon prefix 56 | 57 | 58 | 59 | Icon suffix 60 | 61 | 62 | 63 | 64 | Disabled 65 | 66 | 67 |
Tertiary inline: 68 | 69 | 70 | Button 71 | 72 | and 73 | 74 | 75 | Icon prefix 76 | 77 | and 78 | 79 | Icon suffix 80 | 81 | 82 | and 83 | 84 | Disabled 85 | 86 | 87 | -------------------------------------------------------------------------------- /test/visual/vaadin-logo.svg: -------------------------------------------------------------------------------- 1 | 3 | vaadinlogo 4 | 6 | 8 | 10 | 12 | 14 | 16 | 17 | 19 | 21 | 22 | -------------------------------------------------------------------------------- /theme/lumo/vaadin-button-styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 290 | 291 | -------------------------------------------------------------------------------- /theme/lumo/vaadin-button.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /theme/material/vaadin-button-styles.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 174 | 175 | -------------------------------------------------------------------------------- /theme/material/vaadin-button.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /vaadin-button.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vaadin-directory-description.md: -------------------------------------------------------------------------------- 1 | 2 | # <vaadin-button> 3 | 4 | [![Available in Vaadin_Directory](https://img.shields.io/vaadin-directory/v/vaadinvaadin-button.svg)](https://vaadin.com/directory/component/vaadinvaadin-button) 5 | 6 | [<vaadin-button>](https://vaadin.com/components/vaadin-button) is a Web Component providing an accessible and customizable button, part of the [Vaadin components](https://vaadin.com/components). 7 | 8 | 9 | [Screenshot of vaadin-button, using the default Lumo theme](https://vaadin.com/components/vaadin-button) 10 | 11 | ## Example Usage 12 | ```html 13 | Primary 14 | Secondary 15 | Tertiary 16 | ``` 17 | -------------------------------------------------------------------------------- /wct.conf.js: -------------------------------------------------------------------------------- 1 | var envIndex = process.argv.indexOf('--env') + 1; 2 | var env = envIndex ? process.argv[envIndex] : undefined; 3 | 4 | // workaround for Android 7+ blocking all HTTP traffic 5 | // see https://wiki.saucelabs.com/display/DOCS/Known+Issues 6 | // add it to your own local `/etc/hosts` to run SauceLabs tests locally 7 | var tunneledLocalhost = 'localhost-for-saucelabs'; 8 | 9 | module.exports = { 10 | testTimeout: 180 * 1000, 11 | verbose: false, 12 | plugins: { 13 | local: { 14 | browserOptions: { 15 | chrome: [ 16 | 'headless', 17 | 'disable-gpu', 18 | 'no-sandbox' 19 | ] 20 | } 21 | }, 22 | }, 23 | 24 | registerHooks: function(context) { 25 | const testBrowsers = [ 26 | { 27 | deviceName: 'Android GoogleAPI Emulator', 28 | platformName: 'Android', 29 | platformVersion: '11.0', 30 | browserName: 'Chrome', 31 | }, 32 | 'iOS Simulator/iphone@10.3', // should be 9.x, but SauceLabs does not provide that 33 | 'macOS 11/safari@latest', 34 | 'Windows 10/microsoftedge@latest', 35 | 'Windows 10/internet explorer@11', 36 | 'Windows 10/chrome@latest', 37 | 'Windows 10/firefox@latest', 38 | ]; 39 | 40 | if (env === 'saucelabs') { 41 | context.options.webserver = context.options.webserver || {}; 42 | context.options.webserver.hostname = tunneledLocalhost; 43 | context.options.plugins.sauce.tunnelOptions = { 44 | tunnelDomains: tunneledLocalhost 45 | }; 46 | 47 | context.options.plugins.sauce.browsers = testBrowsers; 48 | } 49 | 50 | // Map legacy tunnel-identifier option to new tunnel-name option 51 | context.hookLate('prepare', (done) => { 52 | context.options.activeBrowsers.forEach((browser) => { 53 | browser['tunnel-name'] = browser['tunnel-identifier']; 54 | delete browser['tunnel-identifier']; 55 | }); 56 | done(); 57 | }); 58 | } 59 | }; 60 | --------------------------------------------------------------------------------