-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathbutton.ts
More file actions
56 lines (50 loc) · 1.7 KB
/
button.ts
File metadata and controls
56 lines (50 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { themes } from '../../theming/theming-decorator.js';
import { registerComponent } from '../common/definitions/register.js';
import type { ButtonVariant } from '../types.js';
import { IgcButtonBaseComponent } from './button-base.js';
import { styles } from './themes/button/button.base.css.js';
import { styles as shared } from './themes/button/shared/button.common.css.js';
import { all } from './themes/button/themes.js';
/**
* Represents a clickable button, used to submit forms or anywhere in a
* document for accessible, standard button functionality.
*
* @element igc-button
*
* @slot - Renders the label of the button.
* @slot prefix - Renders content before the label of the button.
* @slot suffix - Renders content after the label of the button.
*
* @csspart base - The native button element of the igc-button component.
* @csspart prefix - The prefix container of the igc-button component.
* @csspart suffix - The suffix container of the igc-button component.
*/
@themes(all)
export default class IgcButtonComponent extends IgcButtonBaseComponent {
public static readonly tagName = 'igc-button';
protected static styles = [styles, shared];
/* blazorSuppress */
public static register() {
registerComponent(IgcButtonComponent);
}
/**
* Sets the variant of the button.
* @attr
*/
@property({ reflect: true })
public variant: ButtonVariant = 'contained';
protected renderContent() {
return html`
<slot name="prefix"></slot>
<slot></slot>
<slot name="suffix"></slot>
`;
}
}
declare global {
interface HTMLElementTagNameMap {
'igc-button': IgcButtonComponent;
}
}