@spectrum-web-components/button 0.16.1 → 0.16.4-express.12
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/custom-elements.json +39 -67
- package/package.json +7 -6
- package/src/Button.d.ts +13 -6
- package/src/Button.js +57 -15
- package/src/Button.js.map +1 -1
- package/src/ClearButton.js +1 -1
- package/src/ClearButton.js.map +1 -1
- package/src/button-base.css.js +1 -1
- package/src/button-base.css.js.map +1 -1
- package/src/button.css.js +588 -469
- package/src/button.css.js.map +1 -1
- package/src/spectrum-button.css.js +588 -469
- package/src/spectrum-button.css.js.map +1 -1
- package/src/spectrum-config.js +20 -76
- package/stories/button-accent-fill-sizes.stories.js +28 -0
- package/stories/button-accent-fill-sizes.stories.js.map +1 -0
- package/stories/button-accent-fill.stories.js +28 -0
- package/stories/button-accent-fill.stories.js.map +1 -0
- package/stories/button-accent-outline-sizes.stories.js +28 -0
- package/stories/button-accent-outline-sizes.stories.js.map +1 -0
- package/stories/button-accent-outline.stories.js +28 -0
- package/stories/button-accent-outline.stories.js.map +1 -0
- package/stories/button-black-fill-sizes.stories.js +29 -0
- package/stories/button-black-fill-sizes.stories.js.map +1 -0
- package/stories/button-black-fill.stories.js +29 -0
- package/stories/button-black-fill.stories.js.map +1 -0
- package/stories/button-black-outline-sizes.stories.js +29 -0
- package/stories/button-black-outline-sizes.stories.js.map +1 -0
- package/stories/button-black-outline.stories.js +29 -0
- package/stories/button-black-outline.stories.js.map +1 -0
- package/stories/button-negative-fill-sizes.stories.js +28 -0
- package/stories/button-negative-fill-sizes.stories.js.map +1 -0
- package/stories/button-negative-fill.stories.js +28 -0
- package/stories/button-negative-fill.stories.js.map +1 -0
- package/stories/button-negative-outline-sizes.stories.js +28 -0
- package/stories/button-negative-outline-sizes.stories.js.map +1 -0
- package/stories/button-negative-outline.stories.js +28 -0
- package/stories/button-negative-outline.stories.js.map +1 -0
- package/stories/button-primary-fill-sizes.stories.js +28 -0
- package/stories/button-primary-fill-sizes.stories.js.map +1 -0
- package/stories/button-primary-fill.stories.js +28 -0
- package/stories/button-primary-fill.stories.js.map +1 -0
- package/stories/button-primary-outline-sizes.stories.js +28 -0
- package/stories/button-primary-outline-sizes.stories.js.map +1 -0
- package/stories/button-primary-outline.stories.js +28 -0
- package/stories/button-primary-outline.stories.js.map +1 -0
- package/stories/button-secondary-fill-sizes.stories.js +28 -0
- package/stories/button-secondary-fill-sizes.stories.js.map +1 -0
- package/stories/button-secondary-fill.stories.js +28 -0
- package/stories/button-secondary-fill.stories.js.map +1 -0
- package/stories/button-secondary-outline-sizes.stories.js +28 -0
- package/stories/button-secondary-outline-sizes.stories.js.map +1 -0
- package/stories/button-secondary-outline.stories.js +28 -0
- package/stories/button-secondary-outline.stories.js.map +1 -0
- package/stories/button-white-fill-sizes.stories.js +29 -0
- package/stories/button-white-fill-sizes.stories.js.map +1 -0
- package/stories/button-white-fill.stories.js +29 -0
- package/stories/button-white-fill.stories.js.map +1 -0
- package/stories/button-white-outline-sizes.stories.js +29 -0
- package/stories/button-white-outline-sizes.stories.js.map +1 -0
- package/stories/button-white-outline.stories.js +29 -0
- package/stories/button-white-outline.stories.js.map +1 -0
- package/stories/index.js +112 -7
- package/stories/index.js.map +1 -1
- package/src/clear-button.css.d.ts +0 -2
- package/src/clear-button.css.js +0 -229
- package/src/clear-button.css.js.map +0 -1
- package/src/spectrum-clear-button.css.d.ts +0 -2
- package/src/spectrum-clear-button.css.js +0 -229
- package/src/spectrum-clear-button.css.js.map +0 -1
- package/stories/button-cta-sizes.stories.js +0 -11
- package/stories/button-cta-sizes.stories.js.map +0 -1
- package/stories/button-cta.stories.js +0 -115
- package/stories/button-cta.stories.js.map +0 -1
- package/stories/button-overBackground-sizes.stories.js +0 -12
- package/stories/button-overBackground-sizes.stories.js.map +0 -1
- package/stories/button-overBackground.stories.js +0 -132
- package/stories/button-overBackground.stories.js.map +0 -1
- package/stories/button-primary-sizes.stories.js +0 -11
- package/stories/button-primary-sizes.stories.js.map +0 -1
- package/stories/button-primary.stories.js +0 -129
- package/stories/button-primary.stories.js.map +0 -1
- package/stories/button-secondary-sizes.stories.js +0 -11
- package/stories/button-secondary-sizes.stories.js.map +0 -1
- package/stories/button-secondary.stories.js +0 -129
- package/stories/button-secondary.stories.js.map +0 -1
- package/stories/button-warning-sizes.stories.js +0 -11
- package/stories/button-warning-sizes.stories.js.map +0 -1
- package/stories/button-warning.stories.js +0 -129
- package/stories/button-warning.stories.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/button",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4-express.12+27420d682",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -47,18 +47,19 @@
|
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@spectrum-web-components/base": "^0.5.1",
|
|
50
|
-
"@spectrum-web-components/
|
|
51
|
-
"@spectrum-web-components/
|
|
52
|
-
"@spectrum-web-components/
|
|
50
|
+
"@spectrum-web-components/clear-button": "^0.0.2-express.2354+27420d682",
|
|
51
|
+
"@spectrum-web-components/icon": "^0.11.3-express.12+27420d682",
|
|
52
|
+
"@spectrum-web-components/icons-ui": "^0.8.3-express.12+27420d682",
|
|
53
|
+
"@spectrum-web-components/shared": "^0.13.3",
|
|
53
54
|
"tslib": "^2.0.0"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
|
-
"@spectrum-css/button": "^
|
|
57
|
+
"@spectrum-css/button": "^6.0.1"
|
|
57
58
|
},
|
|
58
59
|
"types": "./src/index.d.ts",
|
|
59
60
|
"customElements": "custom-elements.json",
|
|
60
61
|
"sideEffects": [
|
|
61
62
|
"./sp-*.js"
|
|
62
63
|
],
|
|
63
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "27420d682bb3b3f679875e1f4148c10df0bd738c"
|
|
64
65
|
}
|
package/src/Button.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { CSSResultArray } from '@spectrum-web-components/base';
|
|
1
|
+
import { CSSResultArray, PropertyValues } from '@spectrum-web-components/base';
|
|
2
2
|
import { StyledButton } from './StyledButton.js';
|
|
3
|
-
export declare type
|
|
3
|
+
export declare type DeprecatedButtonVariants = 'cta' | 'overBackground';
|
|
4
|
+
export declare type ButtonStatics = 'white' | 'black';
|
|
5
|
+
export declare type ButtonVariants = 'accent' | 'primary' | 'secondary' | 'negative' | ButtonStatics | DeprecatedButtonVariants;
|
|
6
|
+
export declare const VALID_VARIANTS: string[];
|
|
7
|
+
export declare type ButtonTreatments = 'fill' | 'outline';
|
|
4
8
|
declare const Button_base: typeof StyledButton & {
|
|
5
9
|
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
6
10
|
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
@@ -16,14 +20,17 @@ export declare class Button extends Button_base {
|
|
|
16
20
|
/**
|
|
17
21
|
* The visual variant to apply to this button.
|
|
18
22
|
*/
|
|
19
|
-
variant: ButtonVariants;
|
|
23
|
+
get variant(): ButtonVariants;
|
|
24
|
+
set variant(variant: ButtonVariants);
|
|
25
|
+
private _variant;
|
|
20
26
|
/**
|
|
21
|
-
*
|
|
27
|
+
* The visual variant to apply to this button.
|
|
22
28
|
*/
|
|
23
|
-
|
|
29
|
+
treatment: ButtonTreatments;
|
|
24
30
|
/**
|
|
25
31
|
* Style this button to be less obvious
|
|
26
32
|
*/
|
|
27
|
-
quiet: boolean;
|
|
33
|
+
set quiet(quiet: boolean);
|
|
34
|
+
protected firstUpdated(changes: PropertyValues<this>): void;
|
|
28
35
|
}
|
|
29
36
|
export {};
|
package/src/Button.js
CHANGED
|
@@ -10,10 +10,18 @@ OF ANY KIND, either express or implied. See the License for the specific languag
|
|
|
10
10
|
governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
import { __decorate } from "tslib";
|
|
13
|
-
import { SizedMixin } from '@spectrum-web-components/base';
|
|
13
|
+
import { SizedMixin, } from '@spectrum-web-components/base';
|
|
14
14
|
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
15
15
|
import { StyledButton } from './StyledButton.js';
|
|
16
16
|
import buttonStyles from './button.css.js';
|
|
17
|
+
export const VALID_VARIANTS = [
|
|
18
|
+
'accent',
|
|
19
|
+
'primary',
|
|
20
|
+
'secondary',
|
|
21
|
+
'negative',
|
|
22
|
+
'white',
|
|
23
|
+
'black',
|
|
24
|
+
];
|
|
17
25
|
/**
|
|
18
26
|
* @element sp-button
|
|
19
27
|
*
|
|
@@ -23,30 +31,64 @@ import buttonStyles from './button.css.js';
|
|
|
23
31
|
export class Button extends SizedMixin(StyledButton) {
|
|
24
32
|
constructor() {
|
|
25
33
|
super(...arguments);
|
|
34
|
+
this._variant = 'accent';
|
|
26
35
|
/**
|
|
27
36
|
* The visual variant to apply to this button.
|
|
28
37
|
*/
|
|
29
|
-
this.
|
|
30
|
-
/**
|
|
31
|
-
* There is a warning in place for this control
|
|
32
|
-
*/
|
|
33
|
-
this.warning = false;
|
|
34
|
-
/**
|
|
35
|
-
* Style this button to be less obvious
|
|
36
|
-
*/
|
|
37
|
-
this.quiet = false;
|
|
38
|
+
this.treatment = 'fill';
|
|
38
39
|
}
|
|
39
40
|
static get styles() {
|
|
40
41
|
return [...super.styles, buttonStyles];
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The visual variant to apply to this button.
|
|
45
|
+
*/
|
|
46
|
+
get variant() {
|
|
47
|
+
return this._variant;
|
|
48
|
+
}
|
|
49
|
+
set variant(variant) {
|
|
50
|
+
if (variant === this.variant)
|
|
51
|
+
return;
|
|
52
|
+
this.requestUpdate('variant', this.variant);
|
|
53
|
+
switch (variant) {
|
|
54
|
+
case 'cta':
|
|
55
|
+
this._variant = 'accent';
|
|
56
|
+
break;
|
|
57
|
+
case 'overBackground':
|
|
58
|
+
this._variant = 'white';
|
|
59
|
+
this.treatment = 'outline';
|
|
60
|
+
break;
|
|
61
|
+
default:
|
|
62
|
+
if (!VALID_VARIANTS.includes(variant)) {
|
|
63
|
+
this._variant = 'accent';
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this._variant = variant;
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
this.setAttribute('variant', this.variant);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Style this button to be less obvious
|
|
74
|
+
*/
|
|
75
|
+
set quiet(quiet) {
|
|
76
|
+
this.treatment = quiet ? 'outline' : 'fill';
|
|
77
|
+
}
|
|
78
|
+
firstUpdated(changes) {
|
|
79
|
+
super.firstUpdated(changes);
|
|
80
|
+
if (!this.hasAttribute('variant')) {
|
|
81
|
+
this.setAttribute('variant', this.variant);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
42
84
|
}
|
|
43
85
|
__decorate([
|
|
44
86
|
property({ reflect: true })
|
|
45
|
-
], Button.prototype, "variant",
|
|
87
|
+
], Button.prototype, "variant", null);
|
|
46
88
|
__decorate([
|
|
47
|
-
property({
|
|
48
|
-
], Button.prototype, "
|
|
89
|
+
property({ reflect: true })
|
|
90
|
+
], Button.prototype, "treatment", void 0);
|
|
49
91
|
__decorate([
|
|
50
|
-
property({ type: Boolean
|
|
51
|
-
], Button.prototype, "quiet",
|
|
92
|
+
property({ type: Boolean })
|
|
93
|
+
], Button.prototype, "quiet", null);
|
|
52
94
|
//# sourceMappingURL=Button.js.map
|
package/src/Button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,
|
|
1
|
+
{"version":3,"file":"Button.js","sourceRoot":"","sources":["Button.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAGH,UAAU,GACb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAW3C,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,OAAO;IACP,OAAO;CACV,CAAC;AAIF;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,UAAU,CAAC,YAAY,CAAC;IAApD;;QAkCY,aAAQ,GAAmB,QAAQ,CAAC;QAE5C;;WAEG;QAEI,cAAS,GAAqB,MAAM,CAAC;IAgBhD,CAAC;IAvDU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IAEH,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IACD,IAAW,OAAO,CAAC,OAAuB;QACtC,IAAI,OAAO,KAAK,IAAI,CAAC,OAAO;YAAE,OAAO;QAErC,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5C,QAAQ,OAAO,EAAE;YACb,KAAK,KAAK;gBACN,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACzB,MAAM;YACV,KAAK,gBAAgB;gBACjB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;gBACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;gBAC3B,MAAM;YACV;gBACI,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;oBACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;iBAC5B;qBAAM;oBACH,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;iBAC3B;gBACD,MAAM;SACb;QACD,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IASD;;OAEG;IAEH,IAAW,KAAK,CAAC,KAAc;QAC3B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,CAAC;IAES,YAAY,CAAC,OAA6B;QAChD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE;YAC/B,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SAC9C;IACL,CAAC;CACJ;AA/CG;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAG3B;AA6BD;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yCACgB;AAM5C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mCAG3B","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n PropertyValues,\n SizedMixin,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from './button.css.js';\n\nexport type DeprecatedButtonVariants = 'cta' | 'overBackground';\nexport type ButtonStatics = 'white' | 'black';\nexport type ButtonVariants =\n | 'accent'\n | 'primary'\n | 'secondary'\n | 'negative'\n | ButtonStatics\n | DeprecatedButtonVariants;\nexport const VALID_VARIANTS = [\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'white',\n 'black',\n];\n\nexport type ButtonTreatments = 'fill' | 'outline';\n\n/**\n * @element sp-button\n *\n * @slot - text label of the Button\n * @slot icon - The icon to use for Button\n */\nexport class Button extends SizedMixin(StyledButton) {\n public static get styles(): CSSResultArray {\n return [...super.styles, buttonStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public get variant(): ButtonVariants {\n return this._variant;\n }\n public set variant(variant: ButtonVariants) {\n if (variant === this.variant) return;\n\n this.requestUpdate('variant', this.variant);\n switch (variant) {\n case 'cta':\n this._variant = 'accent';\n break;\n case 'overBackground':\n this._variant = 'white';\n this.treatment = 'outline';\n break;\n default:\n if (!VALID_VARIANTS.includes(variant)) {\n this._variant = 'accent';\n } else {\n this._variant = variant;\n }\n break;\n }\n this.setAttribute('variant', this.variant);\n }\n private _variant: ButtonVariants = 'accent';\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public treatment: ButtonTreatments = 'fill';\n\n /**\n * Style this button to be less obvious\n */\n @property({ type: Boolean })\n public set quiet(quiet: boolean) {\n this.treatment = quiet ? 'outline' : 'fill';\n }\n\n protected firstUpdated(changes: PropertyValues<this>): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('variant')) {\n this.setAttribute('variant', this.variant);\n }\n }\n}\n"]}
|
package/src/ClearButton.js
CHANGED
|
@@ -13,7 +13,7 @@ import { __decorate } from "tslib";
|
|
|
13
13
|
import { html, SizedMixin, } from '@spectrum-web-components/base';
|
|
14
14
|
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
15
15
|
import { StyledButton } from './StyledButton.js';
|
|
16
|
-
import buttonStyles from '
|
|
16
|
+
import buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';
|
|
17
17
|
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';
|
|
18
18
|
import crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';
|
|
19
19
|
/**
|
package/src/ClearButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearButton.js","sourceRoot":"","sources":["ClearButton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,UAAU,GAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,YAAY,MAAM,
|
|
1
|
+
{"version":3,"file":"ClearButton.js","sourceRoot":"","sources":["ClearButton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EACJ,UAAU,GAEb,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,YAAY,MAAM,+DAA+D,CAAC;AACzF,OAAO,4DAA4D,CAAC;AACpE,OAAO,iBAAiB,MAAM,8DAA8D,CAAC;AAE7F;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU,CAAC,YAAY,CAAC;IAAzD;;QAKI;;WAEG;QAEI,YAAO,GAA0B,EAAE,CAAC;IAkB/C,CAAC;IA1BU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;IAQD,IAAc,aAAa;QACvB,OAAO;YACH,IAAI,CAAA;;;;;aAKH;SACJ,CAAC;IACN,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;gCACa,KAAK,CAAC,MAAM,EAAE;SACrC,CAAC;IACN,CAAC;CACJ;AAlBG;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACe","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n SizedMixin,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\nimport { StyledButton } from './StyledButton.js';\nimport buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\n/**\n * @element sp-clear-button\n *\n * @slot - text label of the Clear Button\n * @slot icon - The icon to use for Clear Button\n */\nexport class ClearButton extends SizedMixin(StyledButton) {\n public static get styles(): CSSResultArray {\n return [...super.styles, buttonStyles, crossMediumStyles];\n }\n\n /**\n * The visual variant to apply to this button.\n */\n @property({ reflect: true })\n public variant: 'overBackground' | '' = '';\n\n protected get buttonContent(): TemplateResult[] {\n return [\n html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n ];\n }\n\n protected render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n}\n"]}
|
package/src/button-base.css.js
CHANGED
|
@@ -11,7 +11,7 @@ governing permissions and limitations under the License.
|
|
|
11
11
|
*/
|
|
12
12
|
import { css } from '@spectrum-web-components/base';
|
|
13
13
|
const styles = css `
|
|
14
|
-
:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{
|
|
14
|
+
:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentColor;stroke:currentColor;height:var(
|
|
15
15
|
--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)
|
|
16
16
|
);width:var(
|
|
17
17
|
--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-base.css.js","sourceRoot":"","sources":["button-base.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;CAMjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{
|
|
1
|
+
{"version":3,"file":"button-base.css.js","sourceRoot":"","sources":["button-base.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;CAMjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host{display:inline-flex;vertical-align:top}:host([dir]){-webkit-appearance:none}:host([disabled]){cursor:auto;pointer-events:none}#button{inset:0;position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(img),slot[name=icon]::slotted(svg){fill:currentColor;stroke:currentColor;height:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n);width:var(\n--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)\n)}\n`;\nexport default styles;"]}
|