-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: move button to new package (#2373)
- Loading branch information
Showing
119 changed files
with
233 additions
and
1,241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,54 @@ | ||
# @vaadin/button | ||
|
||
> ⚠️ Work in progress, please do not use this component yet. | ||
An accessible and customizable button that allows users to perform actions. | ||
|
||
The new version of `vaadin-button` component. | ||
[Live Demo ↗](https://vaadin.com/docs/latest/ds/components/button) | ||
|
||
```html | ||
<vaadin-button>Press me</vaadin-button> | ||
``` | ||
|
||
## Installation | ||
|
||
Install the component: | ||
|
||
```sh | ||
npm i @vaadin/button --save | ||
``` | ||
|
||
Once installed, import the component in your application: | ||
|
||
```js | ||
import '@vaadin/button'; | ||
``` | ||
|
||
## Themes | ||
|
||
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), | ||
Lumo and Material. The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/button/vaadin-button.js) | ||
of the package uses the Lumo theme. | ||
|
||
To use the Material theme, import the component from the `theme/material` folder: | ||
|
||
```js | ||
import '@vaadin/button/theme/material/vaadin-button.js'; | ||
``` | ||
|
||
You can also import the Lumo version of the component explicitly: | ||
|
||
```js | ||
import '@vaadin/button/theme/lumo/vaadin-button.js'; | ||
``` | ||
|
||
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point: | ||
|
||
```js | ||
import '@vaadin/button/src/vaadin-button.js'; | ||
``` | ||
|
||
## License | ||
|
||
Apache License 2.0 | ||
|
||
Vaadin collects development time usage statistics to improve this product. | ||
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/button/test/visual/material/vaadin-button-styles.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vaadin-app-layout/theme/lumo/vaadin-drawer-toggle-styles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/vaadin-app-layout/theme/material/vaadin-drawer-toggle-styles.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,6 @@ | ||
import { GestureEventListeners } from '@polymer/polymer/lib/mixins/gesture-event-listeners.js'; | ||
|
||
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js'; | ||
|
||
import { ControlStateMixin } from '@vaadin/vaadin-control-state-mixin/vaadin-control-state-mixin.js'; | ||
|
||
import { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js'; | ||
|
||
/** | ||
* `<vaadin-button>` is a Web Component providing an accessible and customizable button. | ||
* | ||
* ```html | ||
* <vaadin-button> | ||
* </vaadin-button> | ||
* ``` | ||
* | ||
* ```js | ||
* document.querySelector('vaadin-button').addEventListener('click', () => alert('Hello World!')); | ||
* ``` | ||
* | ||
* ### Styling | ||
* | ||
* The following shadow DOM parts are exposed for styling: | ||
* | ||
* Part name | Description | ||
* ----------------|---------------- | ||
* `label` | The label (text) inside the button | ||
* `prefix` | A slot for e.g. an icon before the label | ||
* `suffix` | A slot for e.g. an icon after the label | ||
* | ||
* | ||
* The following attributes are exposed for styling: | ||
* | ||
* Attribute | Description | ||
* --------- | ----------- | ||
* `active` | Set when the button is pressed down, either with mouse, touch or the keyboard. | ||
* `disabled` | Set when the button is disabled. | ||
* `focus-ring` | Set when the button is focused using the keyboard. | ||
* `focused` | Set when the button is focused. | ||
* | ||
* See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation. | ||
* @license | ||
* Copyright (c) 2021 Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/ | ||
declare class ButtonElement extends ElementMixin(ControlStateMixin(ThemableMixin(GestureEventListeners(HTMLElement)))) { | ||
readonly focusElement: Element | null; | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'vaadin-button': ButtonElement; | ||
} | ||
} | ||
|
||
export { ButtonElement }; | ||
export * from '@vaadin/button/src/vaadin-button.js'; |
Oops, something went wrong.