@spectrum-web-components/action-button 1.1.0 → 1.1.2
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 +7 -7
- package/sp-action-button.d.ts +6 -0
- package/sp-action-button.dev.js +5 -0
- package/sp-action-button.dev.js.map +7 -0
- package/sp-action-button.js +2 -0
- package/sp-action-button.js.map +7 -0
- package/src/ActionButton.d.ts +67 -0
- package/src/ActionButton.dev.js +229 -0
- package/src/ActionButton.dev.js.map +7 -0
- package/src/ActionButton.js +6 -0
- package/src/ActionButton.js.map +7 -0
- package/src/action-button-overrides.css.d.ts +2 -0
- package/src/action-button-overrides.css.dev.js +7 -0
- package/src/action-button-overrides.css.dev.js.map +7 -0
- package/src/action-button-overrides.css.js +4 -0
- package/src/action-button-overrides.css.js.map +7 -0
- package/src/action-button.css.d.ts +2 -0
- package/src/action-button.css.dev.js +7 -0
- package/src/action-button.css.dev.js.map +7 -0
- package/src/action-button.css.js +4 -0
- package/src/action-button.css.js.map +7 -0
- package/src/index.d.ts +1 -0
- package/src/index.dev.js +3 -0
- package/src/index.dev.js.map +7 -0
- package/src/index.js +2 -0
- package/src/index.js.map +7 -0
- package/src/spectrum-action-button.css.d.ts +2 -0
- package/src/spectrum-action-button.css.dev.js +7 -0
- package/src/spectrum-action-button.css.dev.js.map +7 -0
- package/src/spectrum-action-button.css.js +4 -0
- package/src/spectrum-action-button.css.js.map +7 -0
- package/stories/action-button-black-quiet.stories.js +41 -0
- package/stories/action-button-black-quiet.stories.js.map +7 -0
- package/stories/action-button-black.stories.js +35 -0
- package/stories/action-button-black.stories.js.map +7 -0
- package/stories/action-button-emphasized-quiet.stories.js +39 -0
- package/stories/action-button-emphasized-quiet.stories.js.map +7 -0
- package/stories/action-button-emphasized.stories.js +33 -0
- package/stories/action-button-emphasized.stories.js.map +7 -0
- package/stories/action-button-quiet.stories.js +33 -0
- package/stories/action-button-quiet.stories.js.map +7 -0
- package/stories/action-button-standard.stories.js +27 -0
- package/stories/action-button-standard.stories.js.map +7 -0
- package/stories/action-button-white-quiet.stories.js +41 -0
- package/stories/action-button-white-quiet.stories.js.map +7 -0
- package/stories/action-button-white.stories.js +35 -0
- package/stories/action-button-white.stories.js.map +7 -0
- package/stories/action-button.stories.js +38 -0
- package/stories/action-button.stories.js.map +7 -0
- package/stories/index.js +86 -0
- package/stories/index.js.map +7 -0
- package/test/action-button-black-quiet.test-vrt.js +5 -0
- package/test/action-button-black-quiet.test-vrt.js.map +7 -0
- package/test/action-button-black.test-vrt.js +5 -0
- package/test/action-button-black.test-vrt.js.map +7 -0
- package/test/action-button-emphasized-quiet.test-vrt.js +5 -0
- package/test/action-button-emphasized-quiet.test-vrt.js.map +7 -0
- package/test/action-button-emphasized.test-vrt.js +5 -0
- package/test/action-button-emphasized.test-vrt.js.map +7 -0
- package/test/action-button-memory.test.js +5 -0
- package/test/action-button-memory.test.js.map +7 -0
- package/test/action-button-quiet.test-vrt.js +5 -0
- package/test/action-button-quiet.test-vrt.js.map +7 -0
- package/test/action-button-standard.test-vrt.js +5 -0
- package/test/action-button-standard.test-vrt.js.map +7 -0
- package/test/action-button-white-quiet.test-vrt.js +5 -0
- package/test/action-button-white-quiet.test-vrt.js.map +7 -0
- package/test/action-button-white.test-vrt.js +5 -0
- package/test/action-button-white.test-vrt.js.map +7 -0
- package/test/action-button.test-vrt.js +5 -0
- package/test/action-button.test-vrt.js.map +7 -0
- package/test/action-button.test.js +273 -0
- package/test/action-button.test.js.map +7 -0
- package/test/benchmark/basic-test.js +19 -0
- package/test/benchmark/basic-test.js.map +7 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-black-quiet.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black Quiet',\n decorators: [makeOverBackground('black')],\n};\n\nconst staticColor = 'black';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n staticColor,\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,cAAc;AACpB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { makeOverBackground } from "../../button/stories/index.js";
|
|
3
|
+
import { renderButtons } from "./index.js";
|
|
4
|
+
export default {
|
|
5
|
+
component: "sp-action-button",
|
|
6
|
+
title: "Action Button/Static Black",
|
|
7
|
+
decorators: [makeOverBackground("black")]
|
|
8
|
+
};
|
|
9
|
+
const staticColor = "black";
|
|
10
|
+
export const XS = (args) => renderButtons(args);
|
|
11
|
+
XS.args = {
|
|
12
|
+
size: "xs",
|
|
13
|
+
staticColor
|
|
14
|
+
};
|
|
15
|
+
export const s = (args) => renderButtons(args);
|
|
16
|
+
s.args = {
|
|
17
|
+
size: "s",
|
|
18
|
+
staticColor
|
|
19
|
+
};
|
|
20
|
+
export const m = (args) => renderButtons(args);
|
|
21
|
+
m.args = {
|
|
22
|
+
size: "m",
|
|
23
|
+
staticColor
|
|
24
|
+
};
|
|
25
|
+
export const l = (args) => renderButtons(args);
|
|
26
|
+
l.args = {
|
|
27
|
+
size: "l",
|
|
28
|
+
staticColor
|
|
29
|
+
};
|
|
30
|
+
export const XL = (args) => renderButtons(args);
|
|
31
|
+
XL.args = {
|
|
32
|
+
size: "xl",
|
|
33
|
+
staticColor
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=action-button-black.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-black.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static Black',\n decorators: [makeOverBackground('black')],\n};\n\nconst staticColor = 'black';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n staticColor,\n} as Properties;\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n staticColor,\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,OAAO,CAAC;AAC5C;AAEA,MAAM,cAAc;AAEb,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderButtons } from "./index.js";
|
|
3
|
+
export default {
|
|
4
|
+
component: "sp-action-button",
|
|
5
|
+
title: "Action Button/Emphasized Quiet"
|
|
6
|
+
};
|
|
7
|
+
const emphasized = true;
|
|
8
|
+
const quiet = true;
|
|
9
|
+
export const XS = (args) => renderButtons(args);
|
|
10
|
+
XS.args = {
|
|
11
|
+
emphasized,
|
|
12
|
+
size: "xs",
|
|
13
|
+
quiet
|
|
14
|
+
};
|
|
15
|
+
export const s = (args) => renderButtons(args);
|
|
16
|
+
s.args = {
|
|
17
|
+
emphasized,
|
|
18
|
+
size: "s",
|
|
19
|
+
quiet
|
|
20
|
+
};
|
|
21
|
+
export const m = (args) => renderButtons(args);
|
|
22
|
+
m.args = {
|
|
23
|
+
emphasized,
|
|
24
|
+
size: "m",
|
|
25
|
+
quiet
|
|
26
|
+
};
|
|
27
|
+
export const l = (args) => renderButtons(args);
|
|
28
|
+
l.args = {
|
|
29
|
+
emphasized,
|
|
30
|
+
size: "l",
|
|
31
|
+
quiet
|
|
32
|
+
};
|
|
33
|
+
export const XL = (args) => renderButtons(args);
|
|
34
|
+
XL.args = {
|
|
35
|
+
emphasized,
|
|
36
|
+
size: "xl",
|
|
37
|
+
quiet
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=action-button-emphasized-quiet.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-emphasized-quiet.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Emphasized Quiet',\n};\n\nconst emphasized = true;\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n emphasized,\n size: 'xs',\n quiet,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n emphasized,\n size: 's',\n quiet,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n emphasized,\n size: 'm',\n quiet,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n emphasized,\n size: 'l',\n quiet,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n emphasized,\n size: 'xl',\n quiet,\n};\n"],
|
|
5
|
+
"mappings": ";AAaA,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,MAAM,aAAa;AACnB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN;AAAA,EACA,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN;AAAA,EACA,MAAM;AAAA,EACN;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderButtons } from "./index.js";
|
|
3
|
+
export default {
|
|
4
|
+
component: "sp-action-button",
|
|
5
|
+
title: "Action Button/Emphasized"
|
|
6
|
+
};
|
|
7
|
+
const emphasized = true;
|
|
8
|
+
export const XS = (args) => renderButtons(args);
|
|
9
|
+
XS.args = {
|
|
10
|
+
emphasized,
|
|
11
|
+
size: "xs"
|
|
12
|
+
};
|
|
13
|
+
export const s = (args) => renderButtons(args);
|
|
14
|
+
s.args = {
|
|
15
|
+
emphasized,
|
|
16
|
+
size: "s"
|
|
17
|
+
};
|
|
18
|
+
export const m = (args) => renderButtons(args);
|
|
19
|
+
m.args = {
|
|
20
|
+
emphasized,
|
|
21
|
+
size: "m"
|
|
22
|
+
};
|
|
23
|
+
export const l = (args) => renderButtons(args);
|
|
24
|
+
l.args = {
|
|
25
|
+
emphasized,
|
|
26
|
+
size: "l"
|
|
27
|
+
};
|
|
28
|
+
export const XL = (args) => renderButtons(args);
|
|
29
|
+
XL.args = {
|
|
30
|
+
emphasized,
|
|
31
|
+
size: "xl"
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=action-button-emphasized.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-emphasized.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Emphasized',\n};\n\nconst emphasized = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n emphasized,\n size: 'xs',\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n emphasized,\n size: 's',\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n emphasized,\n size: 'm',\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n emphasized,\n size: 'l',\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n emphasized,\n size: 'xl',\n};\n"],
|
|
5
|
+
"mappings": ";AAaA,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,MAAM,aAAa;AAEZ,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN;AAAA,EACA,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL;AAAA,EACA,MAAM;AACV;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN;AAAA,EACA,MAAM;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderButtons } from "./index.js";
|
|
3
|
+
export default {
|
|
4
|
+
component: "sp-action-button",
|
|
5
|
+
title: "Action Button/Standard Quiet"
|
|
6
|
+
};
|
|
7
|
+
const quiet = true;
|
|
8
|
+
export const XS = (args) => renderButtons(args);
|
|
9
|
+
XS.args = {
|
|
10
|
+
size: "xs",
|
|
11
|
+
quiet
|
|
12
|
+
};
|
|
13
|
+
export const s = (args) => renderButtons(args);
|
|
14
|
+
s.args = {
|
|
15
|
+
size: "s",
|
|
16
|
+
quiet
|
|
17
|
+
};
|
|
18
|
+
export const m = (args) => renderButtons(args);
|
|
19
|
+
m.args = {
|
|
20
|
+
size: "m",
|
|
21
|
+
quiet
|
|
22
|
+
};
|
|
23
|
+
export const l = (args) => renderButtons(args);
|
|
24
|
+
l.args = {
|
|
25
|
+
size: "l",
|
|
26
|
+
quiet
|
|
27
|
+
};
|
|
28
|
+
export const XL = (args) => renderButtons(args);
|
|
29
|
+
XL.args = {
|
|
30
|
+
size: "xl",
|
|
31
|
+
quiet
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=action-button-quiet.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-quiet.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Standard Quiet',\n};\n\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n};\n"],
|
|
5
|
+
"mappings": ";AAaA,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { renderButtons } from "./index.js";
|
|
3
|
+
export default {
|
|
4
|
+
component: "sp-action-button",
|
|
5
|
+
title: "Action Button/Standard"
|
|
6
|
+
};
|
|
7
|
+
export const XS = (args) => renderButtons(args);
|
|
8
|
+
XS.args = {
|
|
9
|
+
size: "xs"
|
|
10
|
+
};
|
|
11
|
+
export const s = (args) => renderButtons(args);
|
|
12
|
+
s.args = {
|
|
13
|
+
size: "s"
|
|
14
|
+
};
|
|
15
|
+
export const m = (args) => renderButtons(args);
|
|
16
|
+
m.args = {
|
|
17
|
+
size: "m"
|
|
18
|
+
};
|
|
19
|
+
export const l = (args) => renderButtons(args);
|
|
20
|
+
l.args = {
|
|
21
|
+
size: "l"
|
|
22
|
+
};
|
|
23
|
+
export const XL = (args) => renderButtons(args);
|
|
24
|
+
XL.args = {
|
|
25
|
+
size: "xl"
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=action-button-standard.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-standard.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Standard',\n};\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n};\n"],
|
|
5
|
+
"mappings": ";AAaA,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AACV;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AACV;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { makeOverBackground } from "../../button/stories/index.js";
|
|
3
|
+
import { renderButtons } from "./index.js";
|
|
4
|
+
export default {
|
|
5
|
+
component: "sp-action-button",
|
|
6
|
+
title: "Action Button/Static White Quiet",
|
|
7
|
+
decorators: [makeOverBackground()]
|
|
8
|
+
};
|
|
9
|
+
const staticColor = "white";
|
|
10
|
+
const quiet = true;
|
|
11
|
+
export const XS = (args) => renderButtons(args);
|
|
12
|
+
XS.args = {
|
|
13
|
+
size: "xs",
|
|
14
|
+
quiet,
|
|
15
|
+
staticColor
|
|
16
|
+
};
|
|
17
|
+
export const s = (args) => renderButtons(args);
|
|
18
|
+
s.args = {
|
|
19
|
+
size: "s",
|
|
20
|
+
quiet,
|
|
21
|
+
staticColor
|
|
22
|
+
};
|
|
23
|
+
export const m = (args) => renderButtons(args);
|
|
24
|
+
m.args = {
|
|
25
|
+
size: "m",
|
|
26
|
+
quiet,
|
|
27
|
+
staticColor
|
|
28
|
+
};
|
|
29
|
+
export const l = (args) => renderButtons(args);
|
|
30
|
+
l.args = {
|
|
31
|
+
size: "l",
|
|
32
|
+
quiet,
|
|
33
|
+
staticColor
|
|
34
|
+
};
|
|
35
|
+
export const XL = (args) => renderButtons(args);
|
|
36
|
+
XL.args = {
|
|
37
|
+
size: "xl",
|
|
38
|
+
quiet,
|
|
39
|
+
staticColor
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=action-button-white-quiet.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-white-quiet.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White Quiet',\n decorators: [makeOverBackground()],\n};\n\nconst staticColor = 'white';\nconst quiet = true;\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n quiet,\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n quiet,\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n quiet,\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n quiet,\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n quiet,\n staticColor,\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,cAAc;AACpB,MAAM,QAAQ;AAEP,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AAAA,EACA;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AAAA,EACA;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { makeOverBackground } from "../../button/stories/index.js";
|
|
3
|
+
import { renderButtons } from "./index.js";
|
|
4
|
+
export default {
|
|
5
|
+
component: "sp-action-button",
|
|
6
|
+
title: "Action Button/Static White",
|
|
7
|
+
decorators: [makeOverBackground()]
|
|
8
|
+
};
|
|
9
|
+
const staticColor = "white";
|
|
10
|
+
export const XS = (args) => renderButtons(args);
|
|
11
|
+
XS.args = {
|
|
12
|
+
size: "xs",
|
|
13
|
+
staticColor
|
|
14
|
+
};
|
|
15
|
+
export const s = (args) => renderButtons(args);
|
|
16
|
+
s.args = {
|
|
17
|
+
size: "s",
|
|
18
|
+
staticColor
|
|
19
|
+
};
|
|
20
|
+
export const m = (args) => renderButtons(args);
|
|
21
|
+
m.args = {
|
|
22
|
+
size: "m",
|
|
23
|
+
staticColor
|
|
24
|
+
};
|
|
25
|
+
export const l = (args) => renderButtons(args);
|
|
26
|
+
l.args = {
|
|
27
|
+
size: "l",
|
|
28
|
+
staticColor
|
|
29
|
+
};
|
|
30
|
+
export const XL = (args) => renderButtons(args);
|
|
31
|
+
XL.args = {
|
|
32
|
+
size: "xl",
|
|
33
|
+
staticColor
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=action-button-white.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-white.stories.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 { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground } from '../../button/stories/index.js';\nimport type { Properties } from './index.js';\nimport { renderButtons } from './index.js';\n\nexport default {\n component: 'sp-action-button',\n title: 'Action Button/Static White',\n decorators: [makeOverBackground()],\n};\n\nconst staticColor = 'white';\n\nexport const XS = (args: Properties): TemplateResult => renderButtons(args);\nXS.args = {\n size: 'xs',\n staticColor,\n};\n\nexport const s = (args: Properties): TemplateResult => renderButtons(args);\ns.args = {\n size: 's',\n staticColor,\n};\n\nexport const m = (args: Properties): TemplateResult => renderButtons(args);\nm.args = {\n size: 'm',\n staticColor,\n};\n\nexport const l = (args: Properties): TemplateResult => renderButtons(args);\nl.args = {\n size: 'l',\n staticColor,\n};\n\nexport const XL = (args: Properties): TemplateResult => renderButtons(args);\nXL.args = {\n size: 'xl',\n staticColor,\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,0BAA0B;AAEnC,SAAS,qBAAqB;AAE9B,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,YAAY,CAAC,mBAAmB,CAAC;AACrC;AAEA,MAAM,cAAc;AAEb,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,IAAI,CAAC,SAAqC,cAAc,IAAI;AACzE,EAAE,OAAO;AAAA,EACL,MAAM;AAAA,EACN;AACJ;AAEO,aAAM,KAAK,CAAC,SAAqC,cAAc,IAAI;AAC1E,GAAG,OAAO;AAAA,EACN,MAAM;AAAA,EACN;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/action-group/sp-action-group.js";
|
|
4
|
+
import "@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";
|
|
5
|
+
import { renderButton } from "./index.js";
|
|
6
|
+
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
7
|
+
export default {
|
|
8
|
+
component: "sp-action-button",
|
|
9
|
+
title: "Action Button"
|
|
10
|
+
};
|
|
11
|
+
function renderButtonsSelected(args) {
|
|
12
|
+
const disabled = Object.assign({}, args, { disabled: true });
|
|
13
|
+
const selected = Object.assign({}, args, { selected: true });
|
|
14
|
+
return html`
|
|
15
|
+
<sp-action-group
|
|
16
|
+
?emphasized="${!!args.emphasized}"
|
|
17
|
+
?quiet="${!!args.quiet}"
|
|
18
|
+
>
|
|
19
|
+
${renderButton(args)} ${renderButton(selected)}
|
|
20
|
+
${renderButton(disabled)}
|
|
21
|
+
</sp-action-group>
|
|
22
|
+
`;
|
|
23
|
+
}
|
|
24
|
+
export const toggles = (args) => renderButtonsSelected(args);
|
|
25
|
+
toggles.args = {
|
|
26
|
+
toggles: true,
|
|
27
|
+
icon: html`
|
|
28
|
+
<sp-icon-edit hidden slot="icon"></sp-icon-edit>
|
|
29
|
+
`
|
|
30
|
+
};
|
|
31
|
+
export const href = (args) => renderButtonsSelected(args);
|
|
32
|
+
href.args = {
|
|
33
|
+
href: "https://github.com/adobe/spectrum-web-components",
|
|
34
|
+
icon: html`
|
|
35
|
+
<sp-icon-edit hidden slot="icon"></sp-icon-edit>
|
|
36
|
+
`
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=action-button.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button.stories.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 '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\nimport type { Properties } from './index.js';\nimport { renderButton } from './index.js';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\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 ?emphasized=\"${!!args.emphasized}\"\n ?quiet=\"${!!args.quiet}\"\n >\n ${renderButton(args)} ${renderButton(selected)}\n ${renderButton(disabled)}\n </sp-action-group>\n `;\n}\n\nexport const toggles = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\ntoggles.args = {\n toggles: true,\n icon: html`\n <sp-icon-edit hidden slot=\"icon\"></sp-icon-edit>\n `,\n};\n\nexport const href = (args: Properties): TemplateResult =>\n renderButtonsSelected(args);\nhref.args = {\n href: 'https://github.com/adobe/spectrum-web-components',\n icon: html`\n <sp-icon-edit hidden slot=\"icon\"></sp-icon-edit>\n `,\n};\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,YAA4B;AACrC,OAAO;AACP,OAAO;AAEP,SAAS,oBAAoB;AAE7B,OAAO;AAEP,eAAe;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AACX;AAEA,SAAS,sBAAsB,MAAkC;AAC7D,QAAM,WAAW,OAAO,OAAO,CAAC,GAAG,MAAM,EAAE,UAAU,KAAK,CAAC;AAC3D,QAAM,WAAW,OAAO,OAAO,CAAC,GAAG,MAAM,EAAE,UAAU,KAAK,CAAC;AAC3D,SAAO;AAAA;AAAA,2BAEgB,CAAC,CAAC,KAAK,UAAU;AAAA,sBACtB,CAAC,CAAC,KAAK,KAAK;AAAA;AAAA,cAEpB,aAAa,IAAI,CAAC,IAAI,aAAa,QAAQ,CAAC;AAAA,cAC5C,aAAa,QAAQ,CAAC;AAAA;AAAA;AAGpC;AAEO,aAAM,UAAU,CAAC,SACpB,sBAAsB,IAAI;AAC9B,QAAQ,OAAO;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA;AAAA;AAGV;AAEO,aAAM,OAAO,CAAC,SACjB,sBAAsB,IAAI;AAC9B,KAAK,OAAO;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA;AAAA;AAGV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/stories/index.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
|
|
4
|
+
import "@spectrum-web-components/action-group/sp-action-group.js";
|
|
5
|
+
import "@spectrum-web-components/icon/sp-icon.js";
|
|
6
|
+
import "@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js";
|
|
7
|
+
import "@spectrum-web-components/action-button/sp-action-button.js";
|
|
8
|
+
export function renderButton(properties) {
|
|
9
|
+
return html`
|
|
10
|
+
<sp-action-button
|
|
11
|
+
href=${ifDefined(properties.href)}
|
|
12
|
+
?quiet="${!!properties.quiet}"
|
|
13
|
+
?emphasized="${!!properties.emphasized}"
|
|
14
|
+
static-color="${ifDefined(properties.staticColor)}"
|
|
15
|
+
?disabled=${!!properties.disabled}
|
|
16
|
+
?selected=${!!properties.selected}
|
|
17
|
+
?toggles=${!!properties.toggles}
|
|
18
|
+
size=${properties.size || "m"}
|
|
19
|
+
?hold-affordance=${!!properties.holdAffordance}
|
|
20
|
+
?active=${!!properties.active}
|
|
21
|
+
>
|
|
22
|
+
${properties.icon}${properties.label}
|
|
23
|
+
</sp-action-button>
|
|
24
|
+
`;
|
|
25
|
+
}
|
|
26
|
+
function renderGroup(properties) {
|
|
27
|
+
const label = "Edit";
|
|
28
|
+
const holdAffordance = true;
|
|
29
|
+
const icon = html`
|
|
30
|
+
<sp-icon-edit slot="icon"></sp-icon-edit>
|
|
31
|
+
`;
|
|
32
|
+
return html`
|
|
33
|
+
<sp-action-group
|
|
34
|
+
?quiet="${!!properties.quiet}"
|
|
35
|
+
?emphasized="${!!properties.emphasized}"
|
|
36
|
+
size=${properties.size || "m"}
|
|
37
|
+
static-color="${ifDefined(properties.staticColor)}"
|
|
38
|
+
>
|
|
39
|
+
${renderButton({
|
|
40
|
+
...properties,
|
|
41
|
+
label
|
|
42
|
+
})}
|
|
43
|
+
${renderButton({
|
|
44
|
+
...properties,
|
|
45
|
+
label,
|
|
46
|
+
icon
|
|
47
|
+
})}
|
|
48
|
+
${renderButton({
|
|
49
|
+
...properties,
|
|
50
|
+
icon
|
|
51
|
+
})}
|
|
52
|
+
${renderButton({
|
|
53
|
+
...properties,
|
|
54
|
+
icon,
|
|
55
|
+
holdAffordance
|
|
56
|
+
})}
|
|
57
|
+
</sp-action-group>
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
export function renderButtons(properties) {
|
|
61
|
+
const selected = true;
|
|
62
|
+
const disabled = true;
|
|
63
|
+
return html`
|
|
64
|
+
<div
|
|
65
|
+
style="display: flex; flex-direction: column; gap: calc(var(--spectrum-spacing-100) * var(--swc-scale-factor));"
|
|
66
|
+
>
|
|
67
|
+
${renderGroup({
|
|
68
|
+
...properties
|
|
69
|
+
})}
|
|
70
|
+
${renderGroup({
|
|
71
|
+
...properties,
|
|
72
|
+
selected
|
|
73
|
+
})}
|
|
74
|
+
${renderGroup({
|
|
75
|
+
...properties,
|
|
76
|
+
disabled
|
|
77
|
+
})}
|
|
78
|
+
${renderGroup({
|
|
79
|
+
...properties,
|
|
80
|
+
disabled,
|
|
81
|
+
selected
|
|
82
|
+
})}
|
|
83
|
+
</div>
|
|
84
|
+
`;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\nimport '@spectrum-web-components/action-group/sp-action-group.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';\n\nimport '@spectrum-web-components/action-button/sp-action-button.js';\n\nexport interface 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 staticColor?: 'white' | 'black';\n holdAffordance?: boolean;\n icon?: TemplateResult;\n label?: string;\n [prop: string]: unknown;\n href: undefined;\n}\n\nexport function renderButton(properties: Properties): TemplateResult {\n return html`\n <sp-action-button\n href=${ifDefined(properties.href)}\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n static-color=\"${ifDefined(properties.staticColor)}\"\n ?disabled=${!!properties.disabled}\n ?selected=${!!properties.selected}\n ?toggles=${!!properties.toggles}\n size=${properties.size || 'm'}\n ?hold-affordance=${!!properties.holdAffordance}\n ?active=${!!properties.active}\n >\n ${properties.icon}${properties.label}\n </sp-action-button>\n `;\n}\n\nfunction renderGroup(properties: Properties): TemplateResult {\n const label = 'Edit';\n const holdAffordance = true;\n const icon = html`\n <sp-icon-edit slot=\"icon\"></sp-icon-edit>\n `;\n return html`\n <sp-action-group\n ?quiet=\"${!!properties.quiet}\"\n ?emphasized=\"${!!properties.emphasized}\"\n size=${properties.size || 'm'}\n static-color=\"${ifDefined(properties.staticColor)}\"\n >\n ${renderButton({\n ...properties,\n label,\n })}\n ${renderButton({\n ...properties,\n label,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n })}\n ${renderButton({\n ...properties,\n icon,\n holdAffordance,\n })}\n </sp-action-group>\n `;\n}\n\nexport function renderButtons(properties: Properties): TemplateResult {\n const selected = true;\n const disabled = true;\n return html`\n <div\n style=\"display: flex; flex-direction: column; gap: calc(var(--spectrum-spacing-100) * var(--swc-scale-factor));\"\n >\n ${renderGroup({\n ...properties,\n })}\n ${renderGroup({\n ...properties,\n selected,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n })}\n ${renderGroup({\n ...properties,\n disabled,\n selected,\n })}\n </div>\n `;\n}\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AACrC,SAAS,iBAAiB;AAC1B,OAAO;AACP,OAAO;AACP,OAAO;AAEP,OAAO;AAkBA,gBAAS,aAAa,YAAwC;AACjE,SAAO;AAAA;AAAA,mBAEQ,UAAU,WAAW,IAAI,CAAC;AAAA,sBACvB,CAAC,CAAC,WAAW,KAAK;AAAA,2BACb,CAAC,CAAC,WAAW,UAAU;AAAA,4BACtB,UAAU,WAAW,WAAW,CAAC;AAAA,wBACrC,CAAC,CAAC,WAAW,QAAQ;AAAA,wBACrB,CAAC,CAAC,WAAW,QAAQ;AAAA,uBACtB,CAAC,CAAC,WAAW,OAAO;AAAA,mBACxB,WAAW,QAAQ,GAAG;AAAA,+BACV,CAAC,CAAC,WAAW,cAAc;AAAA,sBACpC,CAAC,CAAC,WAAW,MAAM;AAAA;AAAA,cAE3B,WAAW,IAAI,GAAG,WAAW,KAAK;AAAA;AAAA;AAGhD;AAEA,SAAS,YAAY,YAAwC;AACzD,QAAM,QAAQ;AACd,QAAM,iBAAiB;AACvB,QAAM,OAAO;AAAA;AAAA;AAGb,SAAO;AAAA;AAAA,sBAEW,CAAC,CAAC,WAAW,KAAK;AAAA,2BACb,CAAC,CAAC,WAAW,UAAU;AAAA,mBAC/B,WAAW,QAAQ,GAAG;AAAA,4BACb,UAAU,WAAW,WAAW,CAAC;AAAA;AAAA,cAE/C,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,aAAa;AAAA,IACX,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA;AAAA;AAGd;AAEO,gBAAS,cAAc,YAAwC;AAClE,QAAM,WAAW;AACjB,QAAM,WAAW;AACjB,SAAO;AAAA;AAAA;AAAA;AAAA,cAIG,YAAY;AAAA,IACV,GAAG;AAAA,EACP,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,EACJ,CAAC,CAAC;AAAA,cACA,YAAY;AAAA,IACV,GAAG;AAAA,IACH;AAAA,IACA;AAAA,EACJ,CAAC,CAAC;AAAA;AAAA;AAGd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/action-button-black-quiet.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ActionButtonBlackQuietStories", stories);
|
|
5
|
+
//# sourceMappingURL=action-button-black-quiet.test-vrt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-black-quiet.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-black-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackQuietStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,iCAAiC,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-black.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-black.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonBlackStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,4BAA4B,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/action-button-emphasized-quiet.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ActionButtonEmphasizedQuietStories", stories);
|
|
5
|
+
//# sourceMappingURL=action-button-emphasized-quiet.test-vrt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-emphasized-quiet.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-emphasized-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedQuietStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sCAAsC,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/action-button-emphasized.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ActionButtonEmphasizedStories", stories);
|
|
5
|
+
//# sourceMappingURL=action-button-emphasized.test-vrt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-emphasized.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-emphasized.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonEmphasizedStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,iCAAiC,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { m as BlackActionButton } from "../stories/action-button-black.stories.js";
|
|
3
|
+
import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
|
|
4
|
+
testForMemoryLeaks(BlackActionButton(BlackActionButton.args));
|
|
5
|
+
//# sourceMappingURL=action-button-memory.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-memory.test.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2023 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\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 { m as BlackActionButton } from '../stories/action-button-black.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(BlackActionButton(BlackActionButton.args));\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,KAAK,yBAAyB;AACvC,SAAS,0BAA0B;AAEnC,mBAAmB,kBAAkB,kBAAkB,IAAI,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-quiet.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-quiet.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonQuietStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,4BAA4B,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import * as stories from "../stories/action-button-standard.stories.js";
|
|
3
|
+
import { regressVisuals } from "../../../test/visual/test.js";
|
|
4
|
+
regressVisuals("ActionButtonStandardStories", stories);
|
|
5
|
+
//# sourceMappingURL=action-button-standard.test-vrt.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["action-button-standard.test-vrt.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*/\n\nimport * as stories from '../stories/action-button-standard.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ActionButtonStandardStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,+BAA+B,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|