@spectrum-web-components/action-button 0.5.8 → 0.5.9-lit-next.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/action-button",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.9-lit-next.0+297042cb5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"lit-html"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@spectrum-web-components/base": "^0.4.
|
|
48
|
-
"@spectrum-web-components/button": "^0.14.
|
|
49
|
-
"@spectrum-web-components/icon": "^0.9.
|
|
50
|
-
"@spectrum-web-components/icons-ui": "^0.6.
|
|
47
|
+
"@spectrum-web-components/base": "^0.4.6-lit-next.137+297042cb5",
|
|
48
|
+
"@spectrum-web-components/button": "^0.14.9-lit-next.0+297042cb5",
|
|
49
|
+
"@spectrum-web-components/icon": "^0.9.12-lit-next.0+297042cb5",
|
|
50
|
+
"@spectrum-web-components/icons-ui": "^0.6.12-lit-next.0+297042cb5",
|
|
51
51
|
"tslib": "^2.0.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"sideEffects": [
|
|
59
59
|
"./sp-*.js"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "297042cb5770314e9a5181c1fd97d722622f091c"
|
|
62
62
|
}
|
|
@@ -10,7 +10,7 @@ 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 { html } from '@spectrum-web-components/base';
|
|
13
|
-
import { spreadProps } from '
|
|
13
|
+
import { spreadProps } from '../../../test/lit-helpers.js';
|
|
14
14
|
import '@spectrum-web-components/action-group';
|
|
15
15
|
import '@spectrum-web-components/icon/sp-icon.js';
|
|
16
16
|
import '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';
|
|
@@ -65,7 +65,7 @@ toggles.args = {
|
|
|
65
65
|
};
|
|
66
66
|
export const wIconButton = (args) => {
|
|
67
67
|
return html `
|
|
68
|
-
<sp-action-button
|
|
68
|
+
<sp-action-button ${spreadProps(args)}>
|
|
69
69
|
<sp-icon-edit slot="icon"></sp-icon-edit>
|
|
70
70
|
This is an action button
|
|
71
71
|
</sp-action-button>
|
|
@@ -76,7 +76,7 @@ wIconButton.story = {
|
|
|
76
76
|
};
|
|
77
77
|
export const iconOnlyButton = (args) => {
|
|
78
78
|
return html `
|
|
79
|
-
<sp-action-button label="Edit"
|
|
79
|
+
<sp-action-button label="Edit" ${spreadProps(args)}>
|
|
80
80
|
<sp-icon-edit slot="icon"></sp-icon-edit>
|
|
81
81
|
</sp-action-button>
|
|
82
82
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action-button.stories.js","sourceRoot":"","sources":["action-button.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"action-button.stories.js","sourceRoot":"","sources":["action-button.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,uCAAuC,CAAC;AAC/C,OAAO,0CAA0C,CAAC;AAClD,OAAO,+DAA+D,CAAC;AACvE,OAAO,+DAA+D,CAAC;AACvE,OAAO,mEAAmE,CAAC;AAE3E,OAAO,QAAQ,CAAC;AAChB,OAAO,wBAAwB,CAAC;AAgBhC,S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IAAI,CAAC,CAAC;AAChC,KAAK,CAAC,IAAI,GAAG;IACT,KAAK,EAAE,IAAI;CACd,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAgB,EAAkB,EAAE,CACxD,qBAAqB,CAAC,IAAI,CAAC,CAAC;AAChC,OAAO,CAAC,IAAI,GAAG;IACX,OAAO,EAAE,IAAI;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAgB,EAAkB,EAAE;IAC5D,OAAO,IAAI,CAAA;4BACa,WAAW,CAAC,IAAI,CAAC;;;;KAIxC,CAAC;AACN,CAAC,CAAC;AAEF,WAAW,CAAC,KAAK,GAAG;IAChB,IAAI,EAAE,gBAAgB;CACzB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAgB,EAAkB,EAAE;IAC/D,OAAO,IAAI,CAAA;yCAC0B,WAAW,CAAC,IAAI,CAAC;;;KAGrD,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAmB,EAAE;IACnD,OAAO,IAAI,CAAA;;;;;;;;;;KAUV,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC3B,cAAc,GACL,EAAkB,EAAE;IAC7B,OAAO,IAAI,CAAA;;8DAE+C,cAAc;;;;iDAI3B,cAAc;;;;iDAId,cAAc;;;;KAI1D,CAAC;AACN,CAAC,CAAC;AACF,cAAc,CAAC,IAAI,GAAG;IAClB,cAAc,EAAE,IAAI;CACvB,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 { html, TemplateResult } from '@spectrum-web-components/base';\nimport { spreadProps } from '../../../test/lit-helpers.js';\nimport '@spectrum-web-components/action-group';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-more.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-settings.js';\n\nimport '../src';\nimport '../sp-action-button.js';\n\ninterface Properties {\n active?: boolean;\n quiet?: boolean;\n disabled?: boolean;\n selected?: boolean;\n toggles?: boolean;\n emphasized?: boolean;\n size?: 's' | 'm' | 'l' | 'xl';\n holdAffordance?: boolean;\n icon?: TemplateResult;\n label?: string;\n [prop: string]: any;\n}\n\nfunction renderButton(args: Properties): TemplateResult {\n return html`\n <sp-action-button\n ?quiet=\"${!!args.quiet}\"\n ?emphasized=\"${!!args.emphasized}\"\n ?disabled=${!!args.disabled}\n ?selected=${!!args.selected}\n ?toggles=${!!args.toggles}\n size=${args.size || 'm'}\n >\n Action\n </sp-action-button>\n `;\n}\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button',\n};\n\nfunction renderButtonsSelected(args: Properties): TemplateResult {\n const disabled = Object.assign({}, args, { disabled: true });\n const selected = Object.assign({}, args, { selected: true });\n return html`\n <sp-action-group>\n ${renderButton(args)} ${renderButton(selected)}\n ${renderButton(disabled)}\n </sp-action-group>\n `;\n}\n\nexport const emphasized = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\nemphasized.args = {\n emphasized: true,\n};\n\nexport const emphasizedAndQuiet = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\nemphasizedAndQuiet.args = {\n emphasized: true,\n quiet: true,\n};\n\nexport const quiet = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\nquiet.args = {\n quiet: true,\n};\n\nexport const toggles = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\ntoggles.args = {\n toggles: true,\n};\n\nexport const wIconButton = (args: Properties): TemplateResult => {\n return html`\n <sp-action-button ${spreadProps(args)}>\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n This is an action button\n </sp-action-button>\n `;\n};\n\nwIconButton.story = {\n name: 'w/ Icon button',\n};\n\nexport const iconOnlyButton = (args: Properties): TemplateResult => {\n return html`\n <sp-action-button label=\"Edit\" ${spreadProps(args)}>\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n </sp-action-button>\n `;\n};\n\nexport const iconSizeOverridden = (): TemplateResult => {\n return html`\n <sp-action-button label=\"Edit\" size=\"xl\">\n <sp-icon-edit slot=\"icon\" size=\"s\"></sp-icon-edit>\n </sp-action-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 holdAffordance = ({\n holdAffordance,\n}: Properties): TemplateResult => {\n return html`\n <sp-action-group>\n <sp-action-button label=\"Edit\" ?hold-affordance=${holdAffordance}>\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n </sp-action-button>\n\n <sp-action-button ?hold-affordance=${holdAffordance} quiet>\n <sp-icon-settings slot=\"icon\"></sp-icon-settings>\n </sp-action-button>\n\n <sp-action-button ?hold-affordance=${holdAffordance} selected>\n <sp-icon-more slot=\"icon\"></sp-icon-more>\n </sp-action-button>\n </sp-action-group>\n `;\n};\nholdAffordance.args = {\n holdAffordance: true,\n};\n"]}
|