@prioticket/design-system-web 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/COMPONENT-DOCUMENTATION.md +608 -0
- package/README.md +229 -0
- package/component-documentation.json +1681 -0
- package/dist/components/pd-button.cjs.js +99 -0
- package/dist/components/pd-button.es.js +156 -0
- package/dist/components/pd-card.cjs.js +59 -0
- package/dist/components/pd-card.es.js +93 -0
- package/dist/components/pd-checkbox.cjs.js +85 -0
- package/dist/components/pd-checkbox.es.js +154 -0
- package/dist/components/pd-chip.cjs.js +118 -0
- package/dist/components/pd-chip.es.js +220 -0
- package/dist/components/pd-dialog.cjs.js +195 -0
- package/dist/components/pd-dialog.es.js +285 -0
- package/dist/components/pd-expandable-card.cjs.js +134 -0
- package/dist/components/pd-expandable-card.es.js +205 -0
- package/dist/components/pd-fab.cjs.js +119 -0
- package/dist/components/pd-fab.es.js +179 -0
- package/dist/components/pd-icon-button.cjs.js +159 -0
- package/dist/components/pd-icon-button.es.js +268 -0
- package/dist/components/pd-icon.cjs.js +71 -0
- package/dist/components/pd-icon.es.js +102 -0
- package/dist/components/pd-list.cjs.js +108 -0
- package/dist/components/pd-list.es.js +229 -0
- package/dist/components/pd-menu-item.cjs.js +85 -0
- package/dist/components/pd-menu-item.es.js +156 -0
- package/dist/components/pd-menu.cjs.js +42 -0
- package/dist/components/pd-menu.es.js +122 -0
- package/dist/components/pd-progress.cjs.js +72 -0
- package/dist/components/pd-progress.es.js +119 -0
- package/dist/components/pd-radio.cjs.js +38 -0
- package/dist/components/pd-radio.es.js +153 -0
- package/dist/components/pd-segmented-button.cjs.js +135 -0
- package/dist/components/pd-segmented-button.es.js +234 -0
- package/dist/components/pd-segmented-stepper.cjs.js +191 -0
- package/dist/components/pd-segmented-stepper.es.js +333 -0
- package/dist/components/pd-select.cjs.js +59 -0
- package/dist/components/pd-select.es.js +136 -0
- package/dist/components/pd-slider.cjs.js +42 -0
- package/dist/components/pd-slider.es.js +123 -0
- package/dist/components/pd-stepper.cjs.js +279 -0
- package/dist/components/pd-stepper.es.js +375 -0
- package/dist/components/pd-switch.cjs.js +57 -0
- package/dist/components/pd-switch.es.js +126 -0
- package/dist/components/pd-tabs.cjs.js +32 -0
- package/dist/components/pd-tabs.es.js +139 -0
- package/dist/components/pd-text-field.cjs.js +86 -0
- package/dist/components/pd-text-field.es.js +202 -0
- package/dist/design-system-web.css +1 -0
- package/dist/fonts/ProximaNova-Bold.woff2 +0 -0
- package/dist/fonts/ProximaNova-Extrabld.woff2 +0 -0
- package/dist/fonts/ProximaNova-Light.woff2 +0 -0
- package/dist/fonts/ProximaNova-Medium.woff2 +0 -0
- package/dist/fonts/ProximaNova-Regular.woff2 +0 -0
- package/dist/fonts/ProximaNova-Semibold.woff2 +0 -0
- package/dist/fonts/ProximaNovaCond-Semibold.woff2 +0 -0
- package/dist/fonts-only.css +59 -0
- package/dist/fonts.cjs.js +1 -0
- package/dist/fonts.es.js +1 -0
- package/dist/prioticket-design-system-web.cjs.js +1 -0
- package/dist/prioticket-design-system-web.es.js +52 -0
- package/dist/theme-only.css +311 -0
- package/dist/theme-with-fonts.cjs.js +1 -0
- package/dist/theme-with-fonts.css +372 -0
- package/dist/theme-with-fonts.es.js +2 -0
- package/dist/theme.cjs.js +1 -0
- package/dist/theme.es.js +1 -0
- package/dist/types/components/pd-button.d.ts +30 -0
- package/dist/types/components/pd-card.d.ts +8 -0
- package/dist/types/components/pd-checkbox.d.ts +16 -0
- package/dist/types/components/pd-chip.d.ts +26 -0
- package/dist/types/components/pd-dialog.d.ts +49 -0
- package/dist/types/components/pd-expandable-card.d.ts +39 -0
- package/dist/types/components/pd-fab.d.ts +17 -0
- package/dist/types/components/pd-icon-button.d.ts +24 -0
- package/dist/types/components/pd-icon.d.ts +9 -0
- package/dist/types/components/pd-list.d.ts +36 -0
- package/dist/types/components/pd-menu-item.d.ts +38 -0
- package/dist/types/components/pd-menu.d.ts +58 -0
- package/dist/types/components/pd-progress.d.ts +30 -0
- package/dist/types/components/pd-radio.d.ts +54 -0
- package/dist/types/components/pd-segmented-button.d.ts +53 -0
- package/dist/types/components/pd-segmented-stepper.d.ts +65 -0
- package/dist/types/components/pd-select.d.ts +46 -0
- package/dist/types/components/pd-slider.d.ts +43 -0
- package/dist/types/components/pd-stepper.d.ts +47 -0
- package/dist/types/components/pd-switch.d.ts +37 -0
- package/dist/types/components/pd-tabs.d.ts +54 -0
- package/dist/types/components/pd-text-field.d.ts +30 -0
- package/dist/types/fonts.d.ts +1 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/theme-with-fonts.d.ts +2 -0
- package/dist/types/theme.d.ts +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("lit"),e=require("lit/decorators.js");require("@material/web/fab/fab.js");require("@material/web/fab/branded-fab.js");require("@material/web/icon/icon.js");var c=Object.defineProperty,m=Object.getOwnPropertyDescriptor,o=(n,r,s,i)=>{for(var t=i>1?void 0:i?m(r,s):r,d=n.length-1,l;d>=0;d--)(l=n[d])&&(t=(i?l(r,s,t):l(t))||t);return i&&t&&c(r,s,t),t};exports.PdFab=class extends a.LitElement{constructor(){super(...arguments),this.variant="primary",this.size="medium",this.icon="",this.label="",this.lowered=!1,this.disabled=!1,this.ariaLabel=""}getFabTemplate(){const r=this.icon?a.html`<md-icon slot="icon">${this.icon}</md-icon>`:a.html`<slot name="icon" slot="icon"></slot>`,s=!!this.label;return this.variant==="branded"?a.html`
|
|
2
|
+
<md-branded-fab
|
|
3
|
+
?lowered=${this.lowered}
|
|
4
|
+
?disabled=${this.disabled}
|
|
5
|
+
.size=${this.size}
|
|
6
|
+
.label=${this.label||a.nothing}
|
|
7
|
+
aria-label=${this.ariaLabel||this.label||a.nothing}
|
|
8
|
+
@click=${this._handleClick}
|
|
9
|
+
>
|
|
10
|
+
${r}
|
|
11
|
+
</md-branded-fab>
|
|
12
|
+
`:a.html`
|
|
13
|
+
<md-fab
|
|
14
|
+
.variant=${this.variant}
|
|
15
|
+
.size=${this.size}
|
|
16
|
+
?lowered=${this.lowered}
|
|
17
|
+
?disabled=${this.disabled}
|
|
18
|
+
.label=${this.label||a.nothing}
|
|
19
|
+
aria-label=${this.ariaLabel||(s?a.nothing:this.label)||a.nothing}
|
|
20
|
+
@click=${this._handleClick}
|
|
21
|
+
>
|
|
22
|
+
${r}
|
|
23
|
+
</md-fab>
|
|
24
|
+
`}render(){return this.getFabTemplate()}_handleClick(r){this.disabled||this.dispatchEvent(new CustomEvent("fab-click",{detail:{variant:this.variant,size:this.size,label:this.label,icon:this.icon},bubbles:!0}))}};exports.PdFab.styles=a.css`
|
|
25
|
+
:host {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
--md-fab-container-shape: var(--md-sys-shape-corner-large);
|
|
28
|
+
--md-branded-fab-container-shape: var(--md-sys-shape-corner-large);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
:host([size="small"]) {
|
|
32
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-small, 2.5rem);
|
|
33
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-small, 2.5rem);
|
|
34
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-small, 1.5rem);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host([size="medium"]) {
|
|
38
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-medium, 3.5rem);
|
|
39
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-medium, 3.5rem);
|
|
40
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-medium, 1.5rem);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
:host([size="large"]) {
|
|
44
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-large, 6rem);
|
|
45
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-large, 6rem);
|
|
46
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-large, 2.25rem);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host([variant="surface"]) {
|
|
50
|
+
--md-fab-container-color: var(--md-sys-color-surface-container-high);
|
|
51
|
+
--md-fab-icon-color: var(--md-sys-color-primary);
|
|
52
|
+
--md-fab-label-text-color: var(--md-sys-color-primary);
|
|
53
|
+
--md-fab-hover-icon-color: var(--md-sys-color-primary-hover);
|
|
54
|
+
--md-fab-focus-icon-color: var(--md-sys-color-primary-focus);
|
|
55
|
+
--md-fab-pressed-icon-color: var(--md-sys-color-primary-pressed);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
:host([variant="primary"]) {
|
|
59
|
+
--md-fab-container-color: var(--md-sys-color-primary-container);
|
|
60
|
+
--md-fab-icon-color: var(--md-sys-color-on-primary-container);
|
|
61
|
+
--md-fab-label-text-color: var(--md-sys-color-on-primary-container);
|
|
62
|
+
--md-fab-hover-container-color: var(--md-sys-color-primary-container-hover);
|
|
63
|
+
--md-fab-focus-container-color: var(--md-sys-color-primary-container-focus);
|
|
64
|
+
--md-fab-pressed-container-color: var(--md-sys-color-primary-container-pressed);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([variant="secondary"]) {
|
|
68
|
+
--md-fab-container-color: var(--md-sys-color-secondary-container);
|
|
69
|
+
--md-fab-icon-color: var(--md-sys-color-on-secondary-container);
|
|
70
|
+
--md-fab-label-text-color: var(--md-sys-color-on-secondary-container);
|
|
71
|
+
--md-fab-hover-container-color: var(--md-sys-color-secondary-container-hover);
|
|
72
|
+
--md-fab-focus-container-color: var(--md-sys-color-secondary-container-focus);
|
|
73
|
+
--md-fab-pressed-container-color: var(--md-sys-color-secondary-container-pressed);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([variant="tertiary"]) {
|
|
77
|
+
--md-fab-container-color: var(--md-sys-color-tertiary-container);
|
|
78
|
+
--md-fab-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
79
|
+
--md-fab-label-text-color: var(--md-sys-color-on-tertiary-container);
|
|
80
|
+
--md-fab-hover-container-color: var(--md-sys-color-tertiary-container-hover);
|
|
81
|
+
--md-fab-focus-container-color: var(--md-sys-color-tertiary-container-focus);
|
|
82
|
+
--md-fab-pressed-container-color: var(--md-sys-color-tertiary-container-pressed);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
md-fab,
|
|
86
|
+
md-branded-fab {
|
|
87
|
+
transition: all var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0));
|
|
88
|
+
--md-fab-label-text-font: var(--md-sys-typescale-label-large-font);
|
|
89
|
+
--md-fab-label-text-size: var(--md-sys-typescale-label-large-size);
|
|
90
|
+
--md-fab-label-text-weight: var(--md-sys-typescale-label-large-weight);
|
|
91
|
+
--md-branded-fab-label-text-font: var(--md-sys-typescale-label-large-font);
|
|
92
|
+
--md-branded-fab-label-text-size: var(--md-sys-typescale-label-large-size);
|
|
93
|
+
--md-branded-fab-label-text-weight: var(--md-sys-typescale-label-large-weight);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
md-fab:hover,
|
|
97
|
+
md-branded-fab:hover {
|
|
98
|
+
transform: scale(1.05);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
md-fab:active,
|
|
102
|
+
md-branded-fab:active {
|
|
103
|
+
transform: scale(0.95);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
:host([disabled]) md-fab,
|
|
107
|
+
:host([disabled]) md-branded-fab {
|
|
108
|
+
--md-fab-container-color: var(--md-sys-color-on-surface);
|
|
109
|
+
--md-fab-icon-color: var(--md-sys-color-surface);
|
|
110
|
+
--md-fab-label-text-color: var(--md-sys-color-surface);
|
|
111
|
+
opacity: var(--md-sys-state-disabled-container-opacity, 0.12);
|
|
112
|
+
cursor: not-allowed;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
:host([disabled]) md-fab:hover,
|
|
116
|
+
:host([disabled]) md-branded-fab:hover {
|
|
117
|
+
transform: none;
|
|
118
|
+
}
|
|
119
|
+
`;o([e.property({type:String})],exports.PdFab.prototype,"variant",2);o([e.property({type:String})],exports.PdFab.prototype,"size",2);o([e.property({type:String})],exports.PdFab.prototype,"icon",2);o([e.property({type:String})],exports.PdFab.prototype,"label",2);o([e.property({type:Boolean})],exports.PdFab.prototype,"lowered",2);o([e.property({type:Boolean})],exports.PdFab.prototype,"disabled",2);o([e.property({type:String,attribute:"aria-label"})],exports.PdFab.prototype,"ariaLabel",2);exports.PdFab=o([e.customElement("pd-fab")],exports.PdFab);
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { css as b, LitElement as f, html as l, nothing as i } from "lit";
|
|
2
|
+
import { property as o, customElement as y } from "lit/decorators.js";
|
|
3
|
+
import "@material/web/fab/fab.js";
|
|
4
|
+
import "@material/web/fab/branded-fab.js";
|
|
5
|
+
import "@material/web/icon/icon.js";
|
|
6
|
+
var h = Object.defineProperty, v = Object.getOwnPropertyDescriptor, r = (s, t, n, d) => {
|
|
7
|
+
for (var e = d > 1 ? void 0 : d ? v(t, n) : t, c = s.length - 1, m; c >= 0; c--)
|
|
8
|
+
(m = s[c]) && (e = (d ? m(t, n, e) : m(e)) || e);
|
|
9
|
+
return d && e && h(t, n, e), e;
|
|
10
|
+
};
|
|
11
|
+
let a = class extends f {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.variant = "primary", this.size = "medium", this.icon = "", this.label = "", this.lowered = !1, this.disabled = !1, this.ariaLabel = "";
|
|
14
|
+
}
|
|
15
|
+
getFabTemplate() {
|
|
16
|
+
const s = this.icon ? l`<md-icon slot="icon">${this.icon}</md-icon>` : l`<slot name="icon" slot="icon"></slot>`, t = !!this.label;
|
|
17
|
+
return this.variant === "branded" ? l`
|
|
18
|
+
<md-branded-fab
|
|
19
|
+
?lowered=${this.lowered}
|
|
20
|
+
?disabled=${this.disabled}
|
|
21
|
+
.size=${this.size}
|
|
22
|
+
.label=${this.label || i}
|
|
23
|
+
aria-label=${this.ariaLabel || this.label || i}
|
|
24
|
+
@click=${this._handleClick}
|
|
25
|
+
>
|
|
26
|
+
${s}
|
|
27
|
+
</md-branded-fab>
|
|
28
|
+
` : l`
|
|
29
|
+
<md-fab
|
|
30
|
+
.variant=${this.variant}
|
|
31
|
+
.size=${this.size}
|
|
32
|
+
?lowered=${this.lowered}
|
|
33
|
+
?disabled=${this.disabled}
|
|
34
|
+
.label=${this.label || i}
|
|
35
|
+
aria-label=${this.ariaLabel || (t ? i : this.label) || i}
|
|
36
|
+
@click=${this._handleClick}
|
|
37
|
+
>
|
|
38
|
+
${s}
|
|
39
|
+
</md-fab>
|
|
40
|
+
`;
|
|
41
|
+
}
|
|
42
|
+
render() {
|
|
43
|
+
return this.getFabTemplate();
|
|
44
|
+
}
|
|
45
|
+
_handleClick(s) {
|
|
46
|
+
this.disabled || this.dispatchEvent(new CustomEvent("fab-click", {
|
|
47
|
+
detail: {
|
|
48
|
+
variant: this.variant,
|
|
49
|
+
size: this.size,
|
|
50
|
+
label: this.label,
|
|
51
|
+
icon: this.icon
|
|
52
|
+
},
|
|
53
|
+
bubbles: !0
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
a.styles = b`
|
|
58
|
+
:host {
|
|
59
|
+
display: inline-block;
|
|
60
|
+
--md-fab-container-shape: var(--md-sys-shape-corner-large);
|
|
61
|
+
--md-branded-fab-container-shape: var(--md-sys-shape-corner-large);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
:host([size="small"]) {
|
|
65
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-small, 2.5rem);
|
|
66
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-small, 2.5rem);
|
|
67
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-small, 1.5rem);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
:host([size="medium"]) {
|
|
71
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-medium, 3.5rem);
|
|
72
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-medium, 3.5rem);
|
|
73
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-medium, 1.5rem);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([size="large"]) {
|
|
77
|
+
--md-fab-container-width: var(--md-sys-fab-container-width-large, 6rem);
|
|
78
|
+
--md-fab-container-height: var(--md-sys-fab-container-height-large, 6rem);
|
|
79
|
+
--md-fab-icon-size: var(--md-sys-fab-icon-size-large, 2.25rem);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:host([variant="surface"]) {
|
|
83
|
+
--md-fab-container-color: var(--md-sys-color-surface-container-high);
|
|
84
|
+
--md-fab-icon-color: var(--md-sys-color-primary);
|
|
85
|
+
--md-fab-label-text-color: var(--md-sys-color-primary);
|
|
86
|
+
--md-fab-hover-icon-color: var(--md-sys-color-primary-hover);
|
|
87
|
+
--md-fab-focus-icon-color: var(--md-sys-color-primary-focus);
|
|
88
|
+
--md-fab-pressed-icon-color: var(--md-sys-color-primary-pressed);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
:host([variant="primary"]) {
|
|
92
|
+
--md-fab-container-color: var(--md-sys-color-primary-container);
|
|
93
|
+
--md-fab-icon-color: var(--md-sys-color-on-primary-container);
|
|
94
|
+
--md-fab-label-text-color: var(--md-sys-color-on-primary-container);
|
|
95
|
+
--md-fab-hover-container-color: var(--md-sys-color-primary-container-hover);
|
|
96
|
+
--md-fab-focus-container-color: var(--md-sys-color-primary-container-focus);
|
|
97
|
+
--md-fab-pressed-container-color: var(--md-sys-color-primary-container-pressed);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:host([variant="secondary"]) {
|
|
101
|
+
--md-fab-container-color: var(--md-sys-color-secondary-container);
|
|
102
|
+
--md-fab-icon-color: var(--md-sys-color-on-secondary-container);
|
|
103
|
+
--md-fab-label-text-color: var(--md-sys-color-on-secondary-container);
|
|
104
|
+
--md-fab-hover-container-color: var(--md-sys-color-secondary-container-hover);
|
|
105
|
+
--md-fab-focus-container-color: var(--md-sys-color-secondary-container-focus);
|
|
106
|
+
--md-fab-pressed-container-color: var(--md-sys-color-secondary-container-pressed);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([variant="tertiary"]) {
|
|
110
|
+
--md-fab-container-color: var(--md-sys-color-tertiary-container);
|
|
111
|
+
--md-fab-icon-color: var(--md-sys-color-on-tertiary-container);
|
|
112
|
+
--md-fab-label-text-color: var(--md-sys-color-on-tertiary-container);
|
|
113
|
+
--md-fab-hover-container-color: var(--md-sys-color-tertiary-container-hover);
|
|
114
|
+
--md-fab-focus-container-color: var(--md-sys-color-tertiary-container-focus);
|
|
115
|
+
--md-fab-pressed-container-color: var(--md-sys-color-tertiary-container-pressed);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
md-fab,
|
|
119
|
+
md-branded-fab {
|
|
120
|
+
transition: all var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0));
|
|
121
|
+
--md-fab-label-text-font: var(--md-sys-typescale-label-large-font);
|
|
122
|
+
--md-fab-label-text-size: var(--md-sys-typescale-label-large-size);
|
|
123
|
+
--md-fab-label-text-weight: var(--md-sys-typescale-label-large-weight);
|
|
124
|
+
--md-branded-fab-label-text-font: var(--md-sys-typescale-label-large-font);
|
|
125
|
+
--md-branded-fab-label-text-size: var(--md-sys-typescale-label-large-size);
|
|
126
|
+
--md-branded-fab-label-text-weight: var(--md-sys-typescale-label-large-weight);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
md-fab:hover,
|
|
130
|
+
md-branded-fab:hover {
|
|
131
|
+
transform: scale(1.05);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
md-fab:active,
|
|
135
|
+
md-branded-fab:active {
|
|
136
|
+
transform: scale(0.95);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
:host([disabled]) md-fab,
|
|
140
|
+
:host([disabled]) md-branded-fab {
|
|
141
|
+
--md-fab-container-color: var(--md-sys-color-on-surface);
|
|
142
|
+
--md-fab-icon-color: var(--md-sys-color-surface);
|
|
143
|
+
--md-fab-label-text-color: var(--md-sys-color-surface);
|
|
144
|
+
opacity: var(--md-sys-state-disabled-container-opacity, 0.12);
|
|
145
|
+
cursor: not-allowed;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
:host([disabled]) md-fab:hover,
|
|
149
|
+
:host([disabled]) md-branded-fab:hover {
|
|
150
|
+
transform: none;
|
|
151
|
+
}
|
|
152
|
+
`;
|
|
153
|
+
r([
|
|
154
|
+
o({ type: String })
|
|
155
|
+
], a.prototype, "variant", 2);
|
|
156
|
+
r([
|
|
157
|
+
o({ type: String })
|
|
158
|
+
], a.prototype, "size", 2);
|
|
159
|
+
r([
|
|
160
|
+
o({ type: String })
|
|
161
|
+
], a.prototype, "icon", 2);
|
|
162
|
+
r([
|
|
163
|
+
o({ type: String })
|
|
164
|
+
], a.prototype, "label", 2);
|
|
165
|
+
r([
|
|
166
|
+
o({ type: Boolean })
|
|
167
|
+
], a.prototype, "lowered", 2);
|
|
168
|
+
r([
|
|
169
|
+
o({ type: Boolean })
|
|
170
|
+
], a.prototype, "disabled", 2);
|
|
171
|
+
r([
|
|
172
|
+
o({ type: String, attribute: "aria-label" })
|
|
173
|
+
], a.prototype, "ariaLabel", 2);
|
|
174
|
+
a = r([
|
|
175
|
+
y("pd-fab")
|
|
176
|
+
], a);
|
|
177
|
+
export {
|
|
178
|
+
a as PdFab
|
|
179
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("lit"),l=require("lit/decorators.js");require("@material/web/iconbutton/icon-button.js");require("@material/web/iconbutton/filled-icon-button.js");require("@material/web/iconbutton/filled-tonal-icon-button.js");require("@material/web/iconbutton/outlined-icon-button.js");require("@material/web/icon/icon.js");var d=Object.defineProperty,u=Object.getOwnPropertyDescriptor,r=(a,t,o,e)=>{for(var i=e>1?void 0:e?u(t,o):t,c=a.length-1,s;c>=0;c--)(s=a[c])&&(i=(e?s(t,o,i):s(i))||i);return e&&i&&d(t,o,i),i};exports.PdIconButton=class extends n.LitElement{constructor(){super(...arguments),this.variant="standard",this.icon="",this.selectedIcon="",this.disabled=!1,this.toggle=!1,this.selected=!1,this.href="",this.target="",this.ariaLabel="",this.ariaLabelSelected=""}getIconButtonTemplate(){const t=this.icon?n.html`<md-icon>${this.icon}</md-icon>`:n.html`<slot></slot>`,o=this.selectedIcon?n.html`<md-icon slot="selected">${this.selectedIcon}</md-icon>`:n.nothing,e={disabled:this.disabled,toggle:this.toggle,selected:this.selected,href:this.href||n.nothing,target:this.target||n.nothing,"aria-label":this.ariaLabel||n.nothing,"aria-label-selected":this.ariaLabelSelected||n.nothing};switch(this.variant){case"filled":return n.html`
|
|
2
|
+
<md-filled-icon-button
|
|
3
|
+
?disabled=${e.disabled}
|
|
4
|
+
?toggle=${e.toggle}
|
|
5
|
+
?selected=${e.selected}
|
|
6
|
+
.href=${e.href}
|
|
7
|
+
.target=${e.target}
|
|
8
|
+
aria-label=${e["aria-label"]}
|
|
9
|
+
aria-label-selected=${e["aria-label-selected"]}
|
|
10
|
+
@input=${this._handleInput}
|
|
11
|
+
@change=${this._handleChange}
|
|
12
|
+
@click=${this._handleClick}
|
|
13
|
+
>
|
|
14
|
+
${t}
|
|
15
|
+
${o}
|
|
16
|
+
</md-filled-icon-button>
|
|
17
|
+
`;case"tonal":return n.html`
|
|
18
|
+
<md-filled-tonal-icon-button
|
|
19
|
+
?disabled=${e.disabled}
|
|
20
|
+
?toggle=${e.toggle}
|
|
21
|
+
?selected=${e.selected}
|
|
22
|
+
.href=${e.href}
|
|
23
|
+
.target=${e.target}
|
|
24
|
+
aria-label=${e["aria-label"]}
|
|
25
|
+
aria-label-selected=${e["aria-label-selected"]}
|
|
26
|
+
@input=${this._handleInput}
|
|
27
|
+
@change=${this._handleChange}
|
|
28
|
+
@click=${this._handleClick}
|
|
29
|
+
>
|
|
30
|
+
${t}
|
|
31
|
+
${o}
|
|
32
|
+
</md-filled-tonal-icon-button>
|
|
33
|
+
`;case"outlined":return n.html`
|
|
34
|
+
<md-outlined-icon-button
|
|
35
|
+
?disabled=${e.disabled}
|
|
36
|
+
?toggle=${e.toggle}
|
|
37
|
+
?selected=${e.selected}
|
|
38
|
+
.href=${e.href}
|
|
39
|
+
.target=${e.target}
|
|
40
|
+
aria-label=${e["aria-label"]}
|
|
41
|
+
aria-label-selected=${e["aria-label-selected"]}
|
|
42
|
+
@input=${this._handleInput}
|
|
43
|
+
@change=${this._handleChange}
|
|
44
|
+
@click=${this._handleClick}
|
|
45
|
+
>
|
|
46
|
+
${t}
|
|
47
|
+
${o}
|
|
48
|
+
</md-outlined-icon-button>
|
|
49
|
+
`;default:return n.html`
|
|
50
|
+
<md-icon-button
|
|
51
|
+
?disabled=${e.disabled}
|
|
52
|
+
?toggle=${e.toggle}
|
|
53
|
+
?selected=${e.selected}
|
|
54
|
+
.href=${e.href}
|
|
55
|
+
.target=${e.target}
|
|
56
|
+
aria-label=${e["aria-label"]}
|
|
57
|
+
aria-label-selected=${e["aria-label-selected"]}
|
|
58
|
+
@input=${this._handleInput}
|
|
59
|
+
@change=${this._handleChange}
|
|
60
|
+
@click=${this._handleClick}
|
|
61
|
+
>
|
|
62
|
+
${t}
|
|
63
|
+
${o}
|
|
64
|
+
</md-icon-button>
|
|
65
|
+
`}}render(){return this.getIconButtonTemplate()}_handleClick(t){this.disabled||this.dispatchEvent(new CustomEvent("icon-button-click",{detail:{variant:this.variant,selected:this.selected,toggle:this.toggle},bubbles:!0}))}_handleInput(t){if(this.disabled)return;const o=t.target;this.selected=o.selected,this.dispatchEvent(new CustomEvent("input",{detail:{selected:o.selected,variant:this.variant},bubbles:!0}))}_handleChange(t){if(this.disabled)return;const o=t.target;this.selected=o.selected,this.dispatchEvent(new CustomEvent("change",{detail:{selected:o.selected,variant:this.variant},bubbles:!0}))}};exports.PdIconButton.styles=n.css`
|
|
66
|
+
:host {
|
|
67
|
+
display: inline-block;
|
|
68
|
+
--md-icon-button-icon-size: var(--md-sys-icon-size, 1.5rem);
|
|
69
|
+
--md-filled-icon-button-icon-size: var(--md-sys-icon-size, 1.5rem);
|
|
70
|
+
--md-filled-tonal-icon-button-icon-size: var(--md-sys-icon-size, 1.5rem);
|
|
71
|
+
--md-outlined-icon-button-icon-size: var(--md-sys-icon-size, 1.5rem);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
:host([variant="standard"]) {
|
|
75
|
+
--md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);
|
|
76
|
+
--md-icon-button-hover-icon-color: var(--md-sys-color-on-surface-variant-hover);
|
|
77
|
+
--md-icon-button-focus-icon-color: var(--md-sys-color-on-surface-variant-focus);
|
|
78
|
+
--md-icon-button-pressed-icon-color: var(--md-sys-color-on-surface-variant-pressed);
|
|
79
|
+
--md-icon-button-selected-icon-color: var(--md-sys-color-primary);
|
|
80
|
+
--md-icon-button-selected-hover-icon-color: var(--md-sys-color-primary-hover);
|
|
81
|
+
--md-icon-button-selected-focus-icon-color: var(--md-sys-color-primary-focus);
|
|
82
|
+
--md-icon-button-selected-pressed-icon-color: var(--md-sys-color-primary-pressed);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
:host([variant="filled"]) {
|
|
86
|
+
--md-filled-icon-button-container-color: var(--md-sys-color-primary);
|
|
87
|
+
--md-filled-icon-button-icon-color: var(--md-sys-color-on-primary);
|
|
88
|
+
--md-filled-icon-button-hover-container-color: var(--md-sys-color-primary-hover);
|
|
89
|
+
--md-filled-icon-button-focus-container-color: var(--md-sys-color-primary-focus);
|
|
90
|
+
--md-filled-icon-button-pressed-container-color: var(--md-sys-color-primary-pressed);
|
|
91
|
+
--md-filled-icon-button-selected-container-color: var(--md-sys-color-primary);
|
|
92
|
+
--md-filled-icon-button-toggle-selected-container-color: var(--md-sys-color-primary);
|
|
93
|
+
--md-filled-icon-button-toggle-unselected-container-color: var(--md-sys-color-surface-container-highest);
|
|
94
|
+
--md-filled-icon-button-toggle-unselected-icon-color: var(--md-sys-color-primary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host([variant="tonal"]) {
|
|
98
|
+
--md-filled-tonal-icon-button-container-color: var(--md-sys-color-secondary-container);
|
|
99
|
+
--md-filled-tonal-icon-button-icon-color: var(--md-sys-color-on-secondary-container);
|
|
100
|
+
--md-filled-tonal-icon-button-hover-container-color: var(--md-sys-color-secondary-container-hover);
|
|
101
|
+
--md-filled-tonal-icon-button-focus-container-color: var(--md-sys-color-secondary-container-focus);
|
|
102
|
+
--md-filled-tonal-icon-button-pressed-container-color: var(--md-sys-color-secondary-container-pressed);
|
|
103
|
+
--md-filled-tonal-icon-button-selected-container-color: var(--md-sys-color-secondary-container);
|
|
104
|
+
--md-filled-tonal-icon-button-toggle-selected-container-color: var(--md-sys-color-secondary-container);
|
|
105
|
+
--md-filled-tonal-icon-button-toggle-unselected-container-color: var(--md-sys-color-surface-container-highest);
|
|
106
|
+
--md-filled-tonal-icon-button-toggle-unselected-icon-color: var(--md-sys-color-on-surface-variant);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:host([variant="outlined"]) {
|
|
110
|
+
--md-outlined-icon-button-outline-color: var(--md-sys-color-outline);
|
|
111
|
+
--md-outlined-icon-button-icon-color: var(--md-sys-color-on-surface-variant);
|
|
112
|
+
--md-outlined-icon-button-hover-icon-color: var(--md-sys-color-on-surface-variant-hover);
|
|
113
|
+
--md-outlined-icon-button-focus-icon-color: var(--md-sys-color-on-surface-variant-focus);
|
|
114
|
+
--md-outlined-icon-button-pressed-icon-color: var(--md-sys-color-on-surface-variant-pressed);
|
|
115
|
+
--md-outlined-icon-button-selected-container-color: var(--md-sys-color-inverse-surface);
|
|
116
|
+
--md-outlined-icon-button-selected-icon-color: var(--md-sys-color-inverse-on-surface);
|
|
117
|
+
--md-outlined-icon-button-selected-outline-color: var(--md-sys-color-outline);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
md-icon-button,
|
|
121
|
+
md-filled-icon-button,
|
|
122
|
+
md-filled-tonal-icon-button,
|
|
123
|
+
md-outlined-icon-button {
|
|
124
|
+
transition: all var(--md-sys-motion-duration-short2, 200ms) var(--md-sys-motion-easing-standard, cubic-bezier(0.2, 0.0, 0, 1.0));
|
|
125
|
+
--md-icon-button-state-layer-shape: var(--md-sys-shape-corner-full);
|
|
126
|
+
--md-filled-icon-button-container-shape: var(--md-sys-shape-corner-full);
|
|
127
|
+
--md-filled-tonal-icon-button-container-shape: var(--md-sys-shape-corner-full);
|
|
128
|
+
--md-outlined-icon-button-container-shape: var(--md-sys-shape-corner-full);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
md-icon-button:hover,
|
|
132
|
+
md-filled-icon-button:hover,
|
|
133
|
+
md-filled-tonal-icon-button:hover,
|
|
134
|
+
md-outlined-icon-button:hover {
|
|
135
|
+
transform: scale(1.05);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
md-icon-button:active,
|
|
139
|
+
md-filled-icon-button:active,
|
|
140
|
+
md-filled-tonal-icon-button:active,
|
|
141
|
+
md-outlined-icon-button:active {
|
|
142
|
+
transform: scale(0.95);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
:host([disabled]) md-icon-button,
|
|
146
|
+
:host([disabled]) md-filled-icon-button,
|
|
147
|
+
:host([disabled]) md-filled-tonal-icon-button,
|
|
148
|
+
:host([disabled]) md-outlined-icon-button {
|
|
149
|
+
opacity: var(--md-sys-state-disabled-container-opacity, 0.38);
|
|
150
|
+
cursor: not-allowed;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
:host([disabled]) md-icon-button:hover,
|
|
154
|
+
:host([disabled]) md-filled-icon-button:hover,
|
|
155
|
+
:host([disabled]) md-filled-tonal-icon-button:hover,
|
|
156
|
+
:host([disabled]) md-outlined-icon-button:hover {
|
|
157
|
+
transform: none;
|
|
158
|
+
}
|
|
159
|
+
`;r([l.property({type:String})],exports.PdIconButton.prototype,"variant",2);r([l.property({type:String})],exports.PdIconButton.prototype,"icon",2);r([l.property({type:String,attribute:"selected-icon"})],exports.PdIconButton.prototype,"selectedIcon",2);r([l.property({type:Boolean})],exports.PdIconButton.prototype,"disabled",2);r([l.property({type:Boolean})],exports.PdIconButton.prototype,"toggle",2);r([l.property({type:Boolean})],exports.PdIconButton.prototype,"selected",2);r([l.property({type:String})],exports.PdIconButton.prototype,"href",2);r([l.property({type:String})],exports.PdIconButton.prototype,"target",2);r([l.property({type:String,attribute:"aria-label"})],exports.PdIconButton.prototype,"ariaLabel",2);r([l.property({type:String,attribute:"aria-label-selected"})],exports.PdIconButton.prototype,"ariaLabelSelected",2);exports.PdIconButton=r([l.customElement("pd-icon-button")],exports.PdIconButton);
|