@spectrum-web-components/button 0.17.0 → 0.17.3
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 +2 -2
- package/package.json +9 -9
- package/sp-button.d.ts +6 -0
- package/sp-button.js +14 -0
- package/sp-button.js.map +1 -0
- package/sp-clear-button.d.ts +6 -0
- package/sp-clear-button.js +14 -0
- package/sp-clear-button.js.map +1 -0
- package/sp-close-button.d.ts +6 -0
- package/sp-close-button.js +14 -0
- package/sp-close-button.js.map +1 -0
- package/src/Button.d.ts +36 -0
- package/src/Button.js +94 -0
- package/src/Button.js.map +1 -0
- package/src/ButtonBase.d.ts +42 -0
- package/src/ButtonBase.js +218 -0
- package/src/ButtonBase.js.map +1 -0
- package/src/ClearButton.d.ts +26 -0
- package/src/ClearButton.js +77 -0
- package/src/ClearButton.js.map +1 -0
- package/src/CloseButton.d.ts +26 -0
- package/src/CloseButton.js +72 -0
- package/src/CloseButton.js.map +1 -0
- package/src/StyledButton.d.ts +5 -0
- package/src/StyledButton.js +19 -0
- package/src/StyledButton.js.map +1 -0
- package/src/button-base.css.d.ts +2 -0
- package/src/button-base.css.js +21 -0
- package/src/button-base.css.js.map +1 -0
- package/src/button.css.d.ts +2 -0
- package/src/button.css.js +630 -0
- package/src/button.css.js.map +1 -0
- package/src/index.d.ts +5 -0
- package/src/index.js +17 -0
- package/src/index.js.map +1 -0
- package/src/spectrum-button-base.css.d.ts +2 -0
- package/src/spectrum-button-base.css.js +17 -0
- package/src/spectrum-button-base.css.js.map +1 -0
- package/src/spectrum-button.css.d.ts +2 -0
- package/src/spectrum-button.css.js +598 -0
- package/src/spectrum-button.css.js.map +1 -0
- 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 +182 -0
- package/stories/index.js.map +1 -0
- package/test/benchmark/test-basic.js +18 -0
- package/test/benchmark/test-basic.js.map +1 -0
- package/test/button-accent-fill-sizes.test-vrt.js +15 -0
- package/test/button-accent-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-accent-fill.test-vrt.js +15 -0
- package/test/button-accent-fill.test-vrt.js.map +1 -0
- package/test/button-accent-outline-sizes.test-vrt.js +15 -0
- package/test/button-accent-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-accent-outline.test-vrt.js +15 -0
- package/test/button-accent-outline.test-vrt.js.map +1 -0
- package/test/button-black-fill-sizes.test-vrt.js +15 -0
- package/test/button-black-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-black-fill.test-vrt.js +15 -0
- package/test/button-black-fill.test-vrt.js.map +1 -0
- package/test/button-black-outline-sizes.test-vrt.js +15 -0
- package/test/button-black-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-black-outline.test-vrt.js +15 -0
- package/test/button-black-outline.test-vrt.js.map +1 -0
- package/test/button-negative-fill-sizes.test-vrt.js +15 -0
- package/test/button-negative-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-negative-fill.test-vrt.js +15 -0
- package/test/button-negative-fill.test-vrt.js.map +1 -0
- package/test/button-negative-outline-sizes.test-vrt.js +15 -0
- package/test/button-negative-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-negative-outline.test-vrt.js +15 -0
- package/test/button-negative-outline.test-vrt.js.map +1 -0
- package/test/button-primary-fill-sizes.test-vrt.js +15 -0
- package/test/button-primary-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-primary-fill.test-vrt.js +15 -0
- package/test/button-primary-fill.test-vrt.js.map +1 -0
- package/test/button-primary-outline-sizes.test-vrt.js +15 -0
- package/test/button-primary-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-primary-outline.test-vrt.js +15 -0
- package/test/button-primary-outline.test-vrt.js.map +1 -0
- package/test/button-secondary-fill-sizes.test-vrt.js +15 -0
- package/test/button-secondary-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-secondary-fill.test-vrt.js +15 -0
- package/test/button-secondary-fill.test-vrt.js.map +1 -0
- package/test/button-secondary-outline-sizes.test-vrt.js +15 -0
- package/test/button-secondary-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-secondary-outline.test-vrt.js +15 -0
- package/test/button-secondary-outline.test-vrt.js.map +1 -0
- package/test/button-white-fill-sizes.test-vrt.js +15 -0
- package/test/button-white-fill-sizes.test-vrt.js.map +1 -0
- package/test/button-white-fill.test-vrt.js +15 -0
- package/test/button-white-fill.test-vrt.js.map +1 -0
- package/test/button-white-outline-sizes.test-vrt.js +15 -0
- package/test/button-white-outline-sizes.test-vrt.js.map +1 -0
- package/test/button-white-outline.test-vrt.js +15 -0
- package/test/button-white-outline.test-vrt.js.map +1 -0
- package/test/button.test.js +390 -0
- package/test/button.test.js.map +1 -0
- package/test/clear-button.test.js +27 -0
- package/test/clear-button.test.js.map +1 -0
- package/test/close-button.test.js +27 -0
- package/test/close-button.test.js.map +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { __decorate } from "tslib";
|
|
13
|
+
import { html, SizedMixin, } from '@spectrum-web-components/base';
|
|
14
|
+
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
15
|
+
import { StyledButton } from './StyledButton.js';
|
|
16
|
+
import buttonStyles from '@spectrum-web-components/clear-button/src/clear-button.css.js';
|
|
17
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';
|
|
18
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';
|
|
19
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';
|
|
20
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';
|
|
21
|
+
import crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';
|
|
22
|
+
const crossIcon = {
|
|
23
|
+
s: () => html `
|
|
24
|
+
<sp-icon-cross75
|
|
25
|
+
slot="icon"
|
|
26
|
+
class="icon spectrum-UIIcon-Cross75"
|
|
27
|
+
></sp-icon-cross75>
|
|
28
|
+
`,
|
|
29
|
+
m: () => html `
|
|
30
|
+
<sp-icon-cross100
|
|
31
|
+
slot="icon"
|
|
32
|
+
class="icon spectrum-UIIcon-Cross100"
|
|
33
|
+
></sp-icon-cross100>
|
|
34
|
+
`,
|
|
35
|
+
l: () => html `
|
|
36
|
+
<sp-icon-cross200
|
|
37
|
+
slot="icon"
|
|
38
|
+
class="icon spectrum-UIIcon-Cross200"
|
|
39
|
+
></sp-icon-cross200>
|
|
40
|
+
`,
|
|
41
|
+
xl: () => html `
|
|
42
|
+
<sp-icon-cross300
|
|
43
|
+
slot="icon"
|
|
44
|
+
class="icon spectrum-UIIcon-Cross300"
|
|
45
|
+
></sp-icon-cross300>
|
|
46
|
+
`,
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @element sp-clear-button
|
|
50
|
+
*
|
|
51
|
+
* @slot - text label of the Clear Button
|
|
52
|
+
* @slot icon - The icon to use for Clear Button
|
|
53
|
+
*/
|
|
54
|
+
export class ClearButton extends SizedMixin(StyledButton) {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
/**
|
|
58
|
+
* The visual variant to apply to this button.
|
|
59
|
+
*/
|
|
60
|
+
this.variant = '';
|
|
61
|
+
}
|
|
62
|
+
static get styles() {
|
|
63
|
+
return [...super.styles, buttonStyles, crossMediumStyles];
|
|
64
|
+
}
|
|
65
|
+
get buttonContent() {
|
|
66
|
+
return [crossIcon[this.size]()];
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return html `
|
|
70
|
+
<div class="fill">${super.render()}</div>
|
|
71
|
+
`;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
__decorate([
|
|
75
|
+
property({ reflect: true })
|
|
76
|
+
], ClearButton.prototype, "variant", void 0);
|
|
77
|
+
//# sourceMappingURL=ClearButton.js.map
|
|
@@ -0,0 +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,+DAA+D,CAAC;AACzF,OAAO,4DAA4D,CAAC;AACpE,OAAO,6DAA6D,CAAC;AACrE,OAAO,6DAA6D,CAAC;AACrE,OAAO,6DAA6D,CAAC;AACrE,OAAO,iBAAiB,MAAM,8DAA8D,CAAC;AAE7F,MAAM,SAAS,GAAyC;IACpD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKb;CACJ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU,CAAC,YAAY,CAAC;IAAzD;;QAKI;;WAEG;QAEI,YAAO,GAA0B,EAAE,CAAC;IAW/C,CAAC;IAnBU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;IAQD,IAAc,aAAa;QACvB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;IAES,MAAM;QACZ,OAAO,IAAI,CAAA;gCACa,KAAK,CAAC,MAAM,EAAE;SACrC,CAAC;IACN,CAAC;CACJ;AAXG;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 '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\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 [crossIcon[this.size]()];\n }\n\n protected render(): TemplateResult {\n return html`\n <div class=\"fill\">${super.render()}</div>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CSSResultArray, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
import { StyledButton } from './StyledButton.js';
|
|
3
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';
|
|
4
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';
|
|
5
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';
|
|
6
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';
|
|
7
|
+
import type { ButtonStatics } from './Button.js';
|
|
8
|
+
declare const CloseButton_base: typeof StyledButton & {
|
|
9
|
+
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
10
|
+
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @element sp-close-button
|
|
14
|
+
*
|
|
15
|
+
* @slot - text label of the Close Button
|
|
16
|
+
* @slot icon - The icon to use for Close Button
|
|
17
|
+
*/
|
|
18
|
+
export declare class CloseButton extends CloseButton_base {
|
|
19
|
+
static get styles(): CSSResultArray;
|
|
20
|
+
/**
|
|
21
|
+
* The visual variant to apply to this button.
|
|
22
|
+
*/
|
|
23
|
+
variant: ButtonStatics | '';
|
|
24
|
+
protected get buttonContent(): TemplateResult[];
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { __decorate } from "tslib";
|
|
13
|
+
import { html, SizedMixin, } from '@spectrum-web-components/base';
|
|
14
|
+
import { property } from '@spectrum-web-components/base/src/decorators.js';
|
|
15
|
+
import { StyledButton } from './StyledButton.js';
|
|
16
|
+
import buttonStyles from '@spectrum-web-components/close-button/src/close-button.css.js';
|
|
17
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';
|
|
18
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';
|
|
19
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';
|
|
20
|
+
import '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';
|
|
21
|
+
import crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';
|
|
22
|
+
const crossIcon = {
|
|
23
|
+
s: () => html `
|
|
24
|
+
<sp-icon-cross75
|
|
25
|
+
slot="icon"
|
|
26
|
+
class="icon spectrum-UIIcon-Cross75"
|
|
27
|
+
></sp-icon-cross75>
|
|
28
|
+
`,
|
|
29
|
+
m: () => html `
|
|
30
|
+
<sp-icon-cross100
|
|
31
|
+
slot="icon"
|
|
32
|
+
class="icon spectrum-UIIcon-Cross100"
|
|
33
|
+
></sp-icon-cross100>
|
|
34
|
+
`,
|
|
35
|
+
l: () => html `
|
|
36
|
+
<sp-icon-cross200
|
|
37
|
+
slot="icon"
|
|
38
|
+
class="icon spectrum-UIIcon-Cross200"
|
|
39
|
+
></sp-icon-cross200>
|
|
40
|
+
`,
|
|
41
|
+
xl: () => html `
|
|
42
|
+
<sp-icon-cross300
|
|
43
|
+
slot="icon"
|
|
44
|
+
class="icon spectrum-UIIcon-Cross300"
|
|
45
|
+
></sp-icon-cross300>
|
|
46
|
+
`,
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* @element sp-close-button
|
|
50
|
+
*
|
|
51
|
+
* @slot - text label of the Close Button
|
|
52
|
+
* @slot icon - The icon to use for Close Button
|
|
53
|
+
*/
|
|
54
|
+
export class CloseButton extends SizedMixin(StyledButton) {
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
/**
|
|
58
|
+
* The visual variant to apply to this button.
|
|
59
|
+
*/
|
|
60
|
+
this.variant = '';
|
|
61
|
+
}
|
|
62
|
+
static get styles() {
|
|
63
|
+
return [...super.styles, buttonStyles, crossMediumStyles];
|
|
64
|
+
}
|
|
65
|
+
get buttonContent() {
|
|
66
|
+
return [crossIcon[this.size]()];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
__decorate([
|
|
70
|
+
property({ reflect: true })
|
|
71
|
+
], CloseButton.prototype, "variant", void 0);
|
|
72
|
+
//# sourceMappingURL=CloseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CloseButton.js","sourceRoot":"","sources":["CloseButton.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,6DAA6D,CAAC;AACrE,OAAO,6DAA6D,CAAC;AACrE,OAAO,6DAA6D,CAAC;AACrE,OAAO,iBAAiB,MAAM,8DAA8D,CAAC;AAG7F,MAAM,SAAS,GAAyC;IACpD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKZ;IACD,EAAE,EAAE,GAAG,EAAE,CAAC,IAAI,CAAA;;;;;KAKb;CACJ,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,WAAY,SAAQ,UAAU,CAAC,YAAY,CAAC;IAAzD;;QAKI;;WAEG;QAEI,YAAO,GAAuB,EAAE,CAAC;IAK5C,CAAC;IAbU,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,iBAAiB,CAAC,CAAC;IAC9D,CAAC;IAQD,IAAc,aAAa;QACvB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACJ;AALG;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CACY","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/close-button/src/close-button.css.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross75.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross100.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross200.js';\nimport '@spectrum-web-components/icons-ui/icons/sp-icon-cross300.js';\nimport crossMediumStyles from '@spectrum-web-components/icon/src/spectrum-icon-cross.css.js';\nimport type { ButtonStatics } from './Button.js';\n\nconst crossIcon: Record<string, () => TemplateResult> = {\n s: () => html`\n <sp-icon-cross75\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross75\"\n ></sp-icon-cross75>\n `,\n m: () => html`\n <sp-icon-cross100\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross100\"\n ></sp-icon-cross100>\n `,\n l: () => html`\n <sp-icon-cross200\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross200\"\n ></sp-icon-cross200>\n `,\n xl: () => html`\n <sp-icon-cross300\n slot=\"icon\"\n class=\"icon spectrum-UIIcon-Cross300\"\n ></sp-icon-cross300>\n `,\n};\n\n/**\n * @element sp-close-button\n *\n * @slot - text label of the Close Button\n * @slot icon - The icon to use for Close Button\n */\nexport class CloseButton 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: ButtonStatics | '' = '';\n\n protected get buttonContent(): TemplateResult[] {\n return [crossIcon[this.size]()];\n }\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { ButtonBase } from './ButtonBase.js';
|
|
13
|
+
import buttonStyles from './button-base.css.js';
|
|
14
|
+
export class StyledButton extends ButtonBase {
|
|
15
|
+
static get styles() {
|
|
16
|
+
return [buttonStyles];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=StyledButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledButton.js","sourceRoot":"","sources":["StyledButton.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AAGF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAEhD,MAAM,OAAO,YAAa,SAAQ,UAAU;IACjC,MAAM,KAAK,MAAM;QACpB,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;CACJ","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 { CSSResultArray } from '@spectrum-web-components/base';\nimport { ButtonBase } from './ButtonBase.js';\nimport buttonStyles from './button-base.css.js';\n\nexport class StyledButton extends ButtonBase {\n public static get styles(): CSSResultArray {\n return [buttonStyles];\n }\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2022 Adobe. All rights reserved.
|
|
3
|
+
This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { css } from '@spectrum-web-components/base';
|
|
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{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
|
+
--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)
|
|
16
|
+
);width:var(
|
|
17
|
+
--spectrum-alias-workflow-icon-size-m,var(--spectrum-global-dimension-size-225)
|
|
18
|
+
)}
|
|
19
|
+
`;
|
|
20
|
+
export default styles;
|
|
21
|
+
//# sourceMappingURL=button-base.css.js.map
|
|
@@ -0,0 +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 2022 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;"]}
|