@spectrum-web-components/button 0.41.2 → 0.42.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/button",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -82,13 +82,13 @@
|
|
|
82
82
|
"lit-html"
|
|
83
83
|
],
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@spectrum-web-components/base": "^0.
|
|
86
|
-
"@spectrum-web-components/clear-button": "^0.
|
|
87
|
-
"@spectrum-web-components/close-button": "^0.
|
|
88
|
-
"@spectrum-web-components/icon": "^0.
|
|
89
|
-
"@spectrum-web-components/icons-ui": "^0.
|
|
90
|
-
"@spectrum-web-components/progress-circle": "^0.
|
|
91
|
-
"@spectrum-web-components/shared": "^0.
|
|
85
|
+
"@spectrum-web-components/base": "^0.42.0",
|
|
86
|
+
"@spectrum-web-components/clear-button": "^0.42.0",
|
|
87
|
+
"@spectrum-web-components/close-button": "^0.42.0",
|
|
88
|
+
"@spectrum-web-components/icon": "^0.42.0",
|
|
89
|
+
"@spectrum-web-components/icons-ui": "^0.42.0",
|
|
90
|
+
"@spectrum-web-components/progress-circle": "^0.42.0",
|
|
91
|
+
"@spectrum-web-components/shared": "^0.42.0"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
94
|
"@spectrum-css/button": "^12.0.1"
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"./sp-*.js",
|
|
100
100
|
"./**/*.dev.js"
|
|
101
101
|
],
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "9b3bd55ff8e8f9438817255976e77fd456b19d72"
|
|
103
103
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
import { css } from "@spectrum-web-components/base";
|
|
3
3
|
const styles = css`
|
|
4
|
-
:host{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}
|
|
4
|
+
:host{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after,::slotted(*){pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}
|
|
5
5
|
`;
|
|
6
6
|
export default styles;
|
|
7
7
|
//# sourceMappingURL=button-base.css.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-base.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after,::slotted(*){pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/src/button-base.css.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";import{css as s}from"@spectrum-web-components/base";const e=s`
|
|
2
|
-
:host{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}
|
|
2
|
+
:host{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after,::slotted(*){pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}
|
|
3
3
|
`;export default e;
|
|
4
4
|
//# sourceMappingURL=button-base.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-base.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright 2024 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{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after{pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}\n`;\nexport default styles;"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2024 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{vertical-align:top;--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-100);--spectrum-icon-size:var(--spectrum-workflow-icon-size-100);display:inline-flex}:host([dir]){-webkit-appearance:none}:host([disabled]){pointer-events:none;cursor:auto}#button{position:absolute;inset:0}::slotted(sp-overlay),::slotted(sp-tooltip){position:absolute}:host:after,::slotted(*){pointer-events:none}slot[name=icon]::slotted(svg),slot[name=icon]::slotted(img){fill:currentColor;stroke:currentColor;block-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100));inline-size:var(--spectrum-icon-size,var(--spectrum-workflow-icon-size-100))}[icon-only]+#label{display:contents}:host([size=xs]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-50);--spectrum-icon-size:var(--spectrum-workflow-icon-size-50)}:host([size=s]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-75);--spectrum-icon-size:var(--spectrum-workflow-icon-size-75)}:host([size=l]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-200);--spectrum-icon-size:var(--spectrum-workflow-icon-size-200)}:host([size=xl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-300);--spectrum-icon-size:var(--spectrum-workflow-icon-size-300)}:host([size=xxl]){--spectrum-progress-circle-size:var(--spectrum-workflow-icon-size-400);--spectrum-icon-size:var(--spectrum-workflow-icon-size-400)}\n`;\nexport default styles;"],
|
|
5
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
package/stories/index.js
CHANGED
|
@@ -71,15 +71,14 @@ export const argTypes = {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
export const makeOverBackground = (variant) => (story) => {
|
|
74
|
-
const color = variant === "black" ? "rgb(181, 209, 211)" : "var(--spectrum-
|
|
74
|
+
const color = variant === "black" ? "rgb(181, 209, 211)" : "var(--spectrum-seafoam-900)";
|
|
75
75
|
return html`
|
|
76
76
|
<div
|
|
77
77
|
style="
|
|
78
78
|
--mod-actionbutton-static-content-color: ${color};
|
|
79
79
|
--mod-button-static-content-color: ${color};
|
|
80
80
|
background-color: ${color};
|
|
81
|
-
|
|
82
|
-
padding: var(--spectrum-global-dimension-size-175) var(--spectrum-global-dimension-size-250);
|
|
81
|
+
padding: calc(var(--swc-scale-factor) * 14px) calc(var(--swc-scale-factor) * 20px);
|
|
83
82
|
display: inline-block;
|
|
84
83
|
"
|
|
85
84
|
>
|
package/stories/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["index.ts"],
|
|
4
|
-
"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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\nimport {\n ButtonTreatments,\n ButtonVariants,\n} from '@spectrum-web-components/button/src/Button.js';\n\nimport type { Properties } from './template.js';\nexport type { Properties };\n\nexport const args = {\n disabled: false,\n variant: 'cta',\n pending: false,\n};\n\nexport const argTypes = {\n disabled: {\n name: 'disabled',\n type: { name: 'boolean', required: false },\n description:\n 'Disable this control. It will not receive focus or events.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n variant: {\n name: 'variant',\n type: { name: 'string', required: false },\n description: 'The visual variant to apply to the button.',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'cta' },\n },\n control: {\n type: 'inline-radio',\n options: [\n 'cta',\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'overBackground',\n 'black',\n 'white',\n ],\n },\n },\n treatment: {\n name: 'treatment',\n type: { name: 'string', required: false },\n description: 'The visual treatment to apply to the button.',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'fill' },\n },\n control: {\n type: 'inline-radio',\n options: ['fill', 'outline'],\n },\n },\n pending: {\n name: 'pending',\n type: { name: 'boolean', required: false },\n description: 'Shows the pending state of the button.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n};\n\nexport const makeOverBackground =\n (variant?: 'white' | 'black') =>\n (story: () => TemplateResult): TemplateResult => {\n const color =\n variant === 'black'\n ? 'rgb(181, 209, 211)'\n : 'var(--spectrum-
|
|
5
|
-
"mappings": ";AAWA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAE1B,OAAO;AACP,OAAO;AACP,OAAO;AASA,aAAM,OAAO;AAAA,EAChB,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AACb;AAEO,aAAM,WAAW;AAAA,EACpB,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ACF,YAAY,UACN,uBACA;AACV,SAAO;AAAA;AAAA;AAAA,+DAGgD,KAAK;AAAA,yDACX,KAAK;AAAA,wCACtB,KAAK;AAAA
|
|
4
|
+
"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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\nimport {\n ButtonTreatments,\n ButtonVariants,\n} from '@spectrum-web-components/button/src/Button.js';\n\nimport type { Properties } from './template.js';\nexport type { Properties };\n\nexport const args = {\n disabled: false,\n variant: 'cta',\n pending: false,\n};\n\nexport const argTypes = {\n disabled: {\n name: 'disabled',\n type: { name: 'boolean', required: false },\n description:\n 'Disable this control. It will not receive focus or events.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n variant: {\n name: 'variant',\n type: { name: 'string', required: false },\n description: 'The visual variant to apply to the button.',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'cta' },\n },\n control: {\n type: 'inline-radio',\n options: [\n 'cta',\n 'accent',\n 'primary',\n 'secondary',\n 'negative',\n 'overBackground',\n 'black',\n 'white',\n ],\n },\n },\n treatment: {\n name: 'treatment',\n type: { name: 'string', required: false },\n description: 'The visual treatment to apply to the button.',\n table: {\n type: { summary: 'string' },\n defaultValue: { summary: 'fill' },\n },\n control: {\n type: 'inline-radio',\n options: ['fill', 'outline'],\n },\n },\n pending: {\n name: 'pending',\n type: { name: 'boolean', required: false },\n description: 'Shows the pending state of the button.',\n table: {\n type: { summary: 'boolean' },\n defaultValue: { summary: false },\n },\n control: {\n type: 'boolean',\n },\n },\n};\n\nexport const makeOverBackground =\n (variant?: 'white' | 'black') =>\n (story: () => TemplateResult): TemplateResult => {\n const color =\n variant === 'black'\n ? 'rgb(181, 209, 211)'\n : 'var(--spectrum-seafoam-900)';\n return html`\n <div\n style=\"\n --mod-actionbutton-static-content-color: ${color};\n --mod-button-static-content-color: ${color};\n background-color: ${color};\n padding: calc(var(--swc-scale-factor) * 14px) calc(var(--swc-scale-factor) * 20px);\n display: inline-block;\n \"\n >\n ${story()}\n </div>\n `;\n };\n\nexport function renderButton(properties: Properties): TemplateResult {\n return html`\n <sp-button\n ?disabled=${!!properties.disabled}\n href=${ifDefined(properties.href)}\n ?icon-only=${properties.iconOnly}\n ?pending=${!!properties.pending}\n ?quiet=\"${!!properties.quiet}\"\n size=${properties.size}\n target=${ifDefined(properties.target)}\n treatment=${ifDefined(properties.treatment)}\n variant=${ifDefined(properties.variant)}\n >\n ${properties.content || 'Click Me'}\n </sp-button>\n `;\n}\n\nexport function renderButtonSet(properties: Properties): TemplateResult {\n const disabled = Object.assign({}, properties, { disabled: true });\n const icon = Object.assign({}, properties, {\n content: html`\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n Click Me\n `,\n });\n return html`\n ${renderButton(properties)} ${renderButton(disabled)}\n ${renderButton(icon)}\n `;\n}\n\nexport function renderIconButtonSet(properties: Properties): TemplateResult {\n const disabled = Object.assign({}, properties, {\n iconOnly: true,\n disabled: true,\n });\n const iconOnly = Object.assign({}, properties, {\n iconOnly: true,\n content: html`\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n `,\n });\n return html`\n ${renderButton(iconOnly)} ${renderButton(disabled)}\n `;\n}\n\nexport const bellIcon = html`\n <svg slot=\"icon\" viewBox=\"0 0 36 36\" focusable=\"false\" aria-hidden=\"true\">\n <path\n d=\"M16 36a4.407 4.407 0 0 0 4-4h-8a4.407 4.407 0 0 0 4 4zm9.143-24.615c0-3.437-3.206-4.891-7.143-5.268V3a1.079 1.079 0 0 0-1.143-1h-1.714A1.079 1.079 0 0 0 14 3v3.117c-3.937.377-7.143 1.831-7.143 5.268C6.857 26.8 2 26.111 2 28.154V30h28v-1.846C30 26 25.143 26.8 25.143 11.385z\"\n ></path>\n </svg>\n`;\n\nexport const renderWithIcon = (props: Properties): TemplateResult => {\n return html`\n <style>\n .row {\n padding: 10px;\n }\n </style>\n <div class=\"row\">\n ${renderButtonSet({\n ...props,\n content: html`\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n Help\n `,\n })}\n </div>\n <div class=\"row\">\n ${renderButtonSet({\n ...props,\n content: html`\n ${bellIcon} Custom SVG\n `,\n })}\n </div>\n `;\n};\n\nexport const renderWithIconOnly = (props: Properties): TemplateResult => {\n return html`\n ${renderIconButtonSet({\n ...props,\n content: html`\n <sp-icon-help slot=\"icon\"></sp-icon-help>\n `,\n })}\n `;\n};\n\nexport const renderIconSizeOverridden = (\n variant: ButtonVariants,\n treatment: ButtonTreatments\n): TemplateResult => {\n return html`\n <sp-button\n label=\"Edit\"\n size=\"xl\"\n variant=${variant}\n treatment=${treatment}\n >\n <sp-icon-help slot=\"icon\" size=\"s\">Testing</sp-icon-help>\n </sp-button>\n <h1>For testing purposes only</h1>\n <p>\n This is a test to ensure that sizing the icon will still work when\n it's in the scope of a parent element. You shouldn't normally do\n this as it deviates from the Spectrum design specification.\n </p>\n `;\n};\n\nexport const renderMinWidthButton = (props: Properties): TemplateResult => {\n return html`\n <style>\n sp-button {\n min-width: 300px;\n }\n </style>\n ${renderButtonSet(props)}\n `;\n};\n\nconst href = 'https://github.com/adobe/spectrum-web-components';\n\nexport const renderLink = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n });\n\nexport const renderLinkWithTarget = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,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