@spectrum-web-components/button 0.16.4-express.12 → 0.16.4

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.
Files changed (88) hide show
  1. package/custom-elements.json +66 -38
  2. package/package.json +7 -8
  3. package/src/Button.d.ts +6 -13
  4. package/src/Button.js +15 -57
  5. package/src/Button.js.map +1 -1
  6. package/src/ClearButton.js +1 -1
  7. package/src/ClearButton.js.map +1 -1
  8. package/src/button.css.js +469 -588
  9. package/src/button.css.js.map +1 -1
  10. package/src/clear-button.css.d.ts +2 -0
  11. package/src/clear-button.css.js +229 -0
  12. package/src/clear-button.css.js.map +1 -0
  13. package/src/spectrum-button.css.js +469 -588
  14. package/src/spectrum-button.css.js.map +1 -1
  15. package/src/spectrum-clear-button.css.d.ts +2 -0
  16. package/src/spectrum-clear-button.css.js +229 -0
  17. package/src/spectrum-clear-button.css.js.map +1 -0
  18. package/src/spectrum-config.js +76 -20
  19. package/stories/button-cta-sizes.stories.js +11 -0
  20. package/stories/button-cta-sizes.stories.js.map +1 -0
  21. package/stories/button-cta.stories.js +115 -0
  22. package/stories/button-cta.stories.js.map +1 -0
  23. package/stories/button-overBackground-sizes.stories.js +12 -0
  24. package/stories/button-overBackground-sizes.stories.js.map +1 -0
  25. package/stories/button-overBackground.stories.js +132 -0
  26. package/stories/button-overBackground.stories.js.map +1 -0
  27. package/stories/button-primary-sizes.stories.js +11 -0
  28. package/stories/button-primary-sizes.stories.js.map +1 -0
  29. package/stories/button-primary.stories.js +129 -0
  30. package/stories/button-primary.stories.js.map +1 -0
  31. package/stories/button-secondary-sizes.stories.js +11 -0
  32. package/stories/button-secondary-sizes.stories.js.map +1 -0
  33. package/stories/button-secondary.stories.js +129 -0
  34. package/stories/button-secondary.stories.js.map +1 -0
  35. package/stories/button-warning-sizes.stories.js +11 -0
  36. package/stories/button-warning-sizes.stories.js.map +1 -0
  37. package/stories/button-warning.stories.js +129 -0
  38. package/stories/button-warning.stories.js.map +1 -0
  39. package/stories/index.js +7 -112
  40. package/stories/index.js.map +1 -1
  41. package/stories/button-accent-fill-sizes.stories.js +0 -28
  42. package/stories/button-accent-fill-sizes.stories.js.map +0 -1
  43. package/stories/button-accent-fill.stories.js +0 -28
  44. package/stories/button-accent-fill.stories.js.map +0 -1
  45. package/stories/button-accent-outline-sizes.stories.js +0 -28
  46. package/stories/button-accent-outline-sizes.stories.js.map +0 -1
  47. package/stories/button-accent-outline.stories.js +0 -28
  48. package/stories/button-accent-outline.stories.js.map +0 -1
  49. package/stories/button-black-fill-sizes.stories.js +0 -29
  50. package/stories/button-black-fill-sizes.stories.js.map +0 -1
  51. package/stories/button-black-fill.stories.js +0 -29
  52. package/stories/button-black-fill.stories.js.map +0 -1
  53. package/stories/button-black-outline-sizes.stories.js +0 -29
  54. package/stories/button-black-outline-sizes.stories.js.map +0 -1
  55. package/stories/button-black-outline.stories.js +0 -29
  56. package/stories/button-black-outline.stories.js.map +0 -1
  57. package/stories/button-negative-fill-sizes.stories.js +0 -28
  58. package/stories/button-negative-fill-sizes.stories.js.map +0 -1
  59. package/stories/button-negative-fill.stories.js +0 -28
  60. package/stories/button-negative-fill.stories.js.map +0 -1
  61. package/stories/button-negative-outline-sizes.stories.js +0 -28
  62. package/stories/button-negative-outline-sizes.stories.js.map +0 -1
  63. package/stories/button-negative-outline.stories.js +0 -28
  64. package/stories/button-negative-outline.stories.js.map +0 -1
  65. package/stories/button-primary-fill-sizes.stories.js +0 -28
  66. package/stories/button-primary-fill-sizes.stories.js.map +0 -1
  67. package/stories/button-primary-fill.stories.js +0 -28
  68. package/stories/button-primary-fill.stories.js.map +0 -1
  69. package/stories/button-primary-outline-sizes.stories.js +0 -28
  70. package/stories/button-primary-outline-sizes.stories.js.map +0 -1
  71. package/stories/button-primary-outline.stories.js +0 -28
  72. package/stories/button-primary-outline.stories.js.map +0 -1
  73. package/stories/button-secondary-fill-sizes.stories.js +0 -28
  74. package/stories/button-secondary-fill-sizes.stories.js.map +0 -1
  75. package/stories/button-secondary-fill.stories.js +0 -28
  76. package/stories/button-secondary-fill.stories.js.map +0 -1
  77. package/stories/button-secondary-outline-sizes.stories.js +0 -28
  78. package/stories/button-secondary-outline-sizes.stories.js.map +0 -1
  79. package/stories/button-secondary-outline.stories.js +0 -28
  80. package/stories/button-secondary-outline.stories.js.map +0 -1
  81. package/stories/button-white-fill-sizes.stories.js +0 -29
  82. package/stories/button-white-fill-sizes.stories.js.map +0 -1
  83. package/stories/button-white-fill.stories.js +0 -29
  84. package/stories/button-white-fill.stories.js.map +0 -1
  85. package/stories/button-white-outline-sizes.stories.js +0 -29
  86. package/stories/button-white-outline-sizes.stories.js.map +0 -1
  87. package/stories/button-white-outline.stories.js +0 -29
  88. package/stories/button-white-outline.stories.js.map +0 -1
@@ -44,11 +44,6 @@ const config = {
44
44
  selector: '.is-disabled',
45
45
  name: 'disabled',
46
46
  },
47
- {
48
- type: 'boolean',
49
- selector: ':disabled',
50
- name: 'disabled',
51
- },
52
47
  {
53
48
  type: 'boolean',
54
49
  selector: '.is-focused',
@@ -63,26 +58,84 @@ const config = {
63
58
  type: 'enum',
64
59
  name: 'variant',
65
60
  values: [
66
- '.spectrum-Button--accent',
61
+ '.spectrum-Button--cta',
67
62
  '.spectrum-Button--primary',
68
63
  '.spectrum-Button--secondary',
69
64
  '.spectrum-Button--negative',
65
+ '.spectrum-Button--overBackground',
66
+ '.spectrum-Button--secondary',
67
+ ],
68
+ },
69
+ {
70
+ type: 'enum',
71
+ name: 'size',
72
+ forceOntoHost: true,
73
+ values: [
70
74
  {
71
- name: 'white',
72
- selector: '.spectrum-Button--staticWhite',
75
+ name: 's',
76
+ selector: '.spectrum-Button--sizeS',
73
77
  },
74
78
  {
75
- name: 'black',
76
- selector: '.spectrum-Button--staticBlack',
79
+ name: 'm',
80
+ selector: '.spectrum-Button--sizeM',
81
+ },
82
+ {
83
+ name: 'l',
84
+ selector: '.spectrum-Button--sizeL',
85
+ },
86
+ {
87
+ name: 'xl',
88
+ selector: '.spectrum-Button--sizeXL',
77
89
  },
78
90
  ],
79
91
  },
92
+ ],
93
+ ids: ['.spectrum-Button-label'],
94
+ slots: [
95
+ {
96
+ name: 'icon',
97
+ selector: '.spectrum-Icon',
98
+ },
99
+ ],
100
+ exclude: [/\.spectrum-ClearButton/],
101
+ excludeSourceSelector: [
102
+ /^(\.spectrum-Button.*),(\.spectrum-ClearButton.*),(\.spectrum-LogicButton.*)$/,
103
+ ],
104
+ },
105
+ {
106
+ name: 'clear-button',
107
+ host: {
108
+ selector: '.spectrum-ClearButton',
109
+ },
110
+ attributes: [
111
+ {
112
+ selector: '.spectrum-ClearButton--small',
113
+ type: 'boolean',
114
+ name: 'small',
115
+ },
116
+ {
117
+ type: 'boolean',
118
+ selector: ':active',
119
+ name: 'active',
120
+ },
121
+ {
122
+ type: 'boolean',
123
+ selector: '.is-disabled',
124
+ name: 'disabled',
125
+ },
80
126
  {
81
127
  type: 'enum',
82
- name: 'treatment',
128
+ name: 'variant',
83
129
  values: [
84
- '.spectrum-Button--fill',
85
- '.spectrum-Button--outline',
130
+ '.spectrum-ClearButton--cta',
131
+ '.spectrum-ClearButton--primary',
132
+ '.spectrum-ClearButton--secondary',
133
+ {
134
+ name: 'negative',
135
+ selector: '.spectrum-ClearButton--warning',
136
+ },
137
+ '.spectrum-ClearButton--overBackground',
138
+ '.spectrum-ClearButton--secondary',
86
139
  ],
87
140
  },
88
141
  {
@@ -92,31 +145,34 @@ const config = {
92
145
  values: [
93
146
  {
94
147
  name: 's',
95
- selector: '.spectrum-Button--sizeS',
148
+ selector: '.spectrum-ClearButton--sizeS',
96
149
  },
97
150
  {
98
151
  name: 'm',
99
- selector: '.spectrum-Button--sizeM',
152
+ selector: '.spectrum-ClearButton--sizeM',
100
153
  },
101
154
  {
102
155
  name: 'l',
103
- selector: '.spectrum-Button--sizeL',
156
+ selector: '.spectrum-ClearButton--sizeL',
104
157
  },
105
158
  {
106
159
  name: 'xl',
107
- selector: '.spectrum-Button--sizeXL',
160
+ selector: '.spectrum-ClearButton--sizeXL',
108
161
  },
109
162
  ],
110
163
  },
111
164
  ],
112
- ids: ['.spectrum-Button-label'],
113
- slots: [
165
+ classes: [
114
166
  {
115
167
  name: 'icon',
116
168
  selector: '.spectrum-Icon',
117
169
  },
170
+ {
171
+ name: 'fill',
172
+ selector: '.spectrum-ClearButton-fill',
173
+ },
118
174
  ],
119
- exclude: [/\.spectrum-ClearButton/],
175
+ exclude: [/\.spectrum-Button/],
120
176
  excludeSourceSelector: [
121
177
  /^(\.spectrum-Button.*),(\.spectrum-ClearButton.*),(\.spectrum-LogicButton.*)$/,
122
178
  ],
@@ -0,0 +1,11 @@
1
+ import { renderButtonSet } from './index.js';
2
+ export default {
3
+ component: 'sp-button',
4
+ title: 'Button/CTA/Sizes',
5
+ };
6
+ const variant = 'cta';
7
+ export const s = () => renderButtonSet({ size: 's', variant });
8
+ export const m = () => renderButtonSet({ size: 'm', variant });
9
+ export const l = () => renderButtonSet({ size: 'l', variant });
10
+ export const XL = () => renderButtonSet({ size: 'xl', variant });
11
+ //# sourceMappingURL=button-cta-sizes.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-cta-sizes.stories.js","sourceRoot":"","sources":["button-cta-sizes.stories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,kBAAkB;CAC5B,CAAC;AAEF,MAAM,OAAO,GAAG,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CACnC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,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 { TemplateResult } from '@spectrum-web-components/base';\nimport { renderButtonSet } from './index.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/CTA/Sizes',\n};\n\nconst variant = 'cta';\n\nexport const s = (): TemplateResult => renderButtonSet({ size: 's', variant });\n\nexport const m = (): TemplateResult => renderButtonSet({ size: 'm', variant });\n\nexport const l = (): TemplateResult => renderButtonSet({ size: 'l', variant });\n\nexport const XL = (): TemplateResult =>\n renderButtonSet({ size: 'xl', variant });\n"]}
@@ -0,0 +1,115 @@
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 { html } from '@spectrum-web-components/base';
13
+ import { bellIcon, renderButtonSet } from './index.js';
14
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';
15
+ export default {
16
+ component: 'sp-button',
17
+ title: 'Button/CTA',
18
+ args: {
19
+ disabled: false,
20
+ variant: 'cta',
21
+ },
22
+ argTypes: {
23
+ disabled: {
24
+ name: 'disabled',
25
+ type: { name: 'boolean', required: false },
26
+ description: 'Disable this control. It will not receive focus or events.',
27
+ table: {
28
+ type: { summary: 'boolean' },
29
+ defaultValue: { summary: false },
30
+ },
31
+ control: {
32
+ type: 'boolean',
33
+ },
34
+ },
35
+ variant: {
36
+ name: 'variant',
37
+ type: { name: 'string', required: false },
38
+ description: 'The visual variant to apply to the button.',
39
+ table: {
40
+ type: { summary: 'string' },
41
+ defaultValue: { summary: 'cta' },
42
+ },
43
+ control: {
44
+ type: 'inline-radio',
45
+ options: [
46
+ 'cta',
47
+ 'primary',
48
+ 'secondary',
49
+ 'negative',
50
+ 'overBackground',
51
+ ],
52
+ },
53
+ },
54
+ },
55
+ };
56
+ export const Default = (props) => renderButtonSet(props);
57
+ Default.args = {
58
+ variant: 'cta',
59
+ };
60
+ export const withIcon = (props) => {
61
+ return html `
62
+ <style>
63
+ .row {
64
+ padding: 10px;
65
+ }
66
+ </style>
67
+ <div class="row">
68
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
69
+ <sp-icon-help slot="icon"></sp-icon-help>
70
+ Help
71
+ ` }))}
72
+ </div>
73
+ <div class="row">
74
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
75
+ ${bellIcon} Custom SVG
76
+ ` }))}
77
+ </div>
78
+ `;
79
+ };
80
+ export const iconSizeOverridden = (props) => {
81
+ return html `
82
+ <sp-button label="Edit" size="xl" variant=${props.variant}>
83
+ <sp-icon-help hidden slot="icon" size="s"></sp-icon-help>
84
+ </sp-button>
85
+ <h1>For testing purposes only</h1>
86
+ <p>
87
+ This is a test to ensure that sizing the icon will still work when
88
+ it's in the scope of a parent element. You shouldn't normally do
89
+ this as it deviates from the Spectrum design specification.
90
+ </p>
91
+ `;
92
+ };
93
+ export const minWidthButton = (props) => {
94
+ return html `
95
+ <style>
96
+ sp-button {
97
+ min-width: 300px;
98
+ }
99
+ </style>
100
+ ${renderButtonSet(props)}
101
+ `;
102
+ };
103
+ minWidthButton.story = {
104
+ name: 'min-width',
105
+ };
106
+ const href = 'https://github.com/adobe/spectrum-web-components';
107
+ export const link = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href }));
108
+ link.story = {
109
+ name: 'href',
110
+ };
111
+ export const linkWithTarget = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href, target: '_blank' }));
112
+ linkWithTarget.story = {
113
+ name: 'href with target="_blank"',
114
+ };
115
+ //# sourceMappingURL=button-cta.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-cta.stories.js","sourceRoot":"","sources":["button-cta.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,+DAA+D,CAAC;AAEvE,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;KACjB;IACD,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EACP,4DAA4D;YAChE,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,OAAO,EAAE;YACL,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE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AE,CACtD,eAAe,iCACR,KAAK,KACR,IAAI,IACN,CAAC;AAEP,IAAI,CAAC,KAAK,GAAG;IACT,IAAI,EAAE,MAAM;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAkB,EAAE,CAChE,eAAe,iCACR,KAAK,KACR,IAAI,EACJ,MAAM,EAAE,QAAQ,IAClB,CAAC;AAEP,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,2BAA2B;CACpC,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 { bellIcon, renderButtonSet } from './index.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/CTA',\n args: {\n disabled: false,\n variant: 'cta',\n },\n 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 'primary',\n 'secondary',\n 'negative',\n 'overBackground',\n ],\n },\n },\n },\n};\n\ninterface Properties {\n content?: TemplateResult;\n disabled?: boolean;\n variant?: 'cta' | 'overBackground' | 'primary' | 'secondary' | 'negative';\n}\n\nexport const Default = (props: Properties): TemplateResult =>\n renderButtonSet(props);\nDefault.args = {\n variant: 'cta',\n};\n\nexport const withIcon = (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 iconSizeOverridden = (props: Properties): TemplateResult => {\n return html`\n <sp-button label=\"Edit\" size=\"xl\" variant=${props.variant}>\n <sp-icon-help hidden slot=\"icon\" size=\"s\"></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 minWidthButton = (props: Properties): TemplateResult => {\n return html`\n <style>\n sp-button {\n min-width: 300px;\n }\n </style>\n ${renderButtonSet(props)}\n `;\n};\n\nminWidthButton.story = {\n name: 'min-width',\n};\n\nconst href = 'https://github.com/adobe/spectrum-web-components';\n\nexport const link = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n });\n\nlink.story = {\n name: 'href',\n};\n\nexport const linkWithTarget = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n target: '_blank',\n });\n\nlinkWithTarget.story = {\n name: 'href with target=\"_blank\"',\n};\n"]}
@@ -0,0 +1,12 @@
1
+ import { makeOverBackground, renderButtonSet } from './index.js';
2
+ export default {
3
+ component: 'sp-button',
4
+ title: 'Button/Over Background/Sizes',
5
+ decorators: [makeOverBackground],
6
+ };
7
+ const variant = 'overBackground';
8
+ export const s = () => renderButtonSet({ size: 's', variant });
9
+ export const m = () => renderButtonSet({ size: 'm', variant });
10
+ export const l = () => renderButtonSet({ size: 'l', variant });
11
+ export const XL = () => renderButtonSet({ size: 'xl', variant });
12
+ //# sourceMappingURL=button-overBackground-sizes.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-overBackground-sizes.stories.js","sourceRoot":"","sources":["button-overBackground-sizes.stories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEjE,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,8BAA8B;IACrC,UAAU,EAAE,CAAC,kBAAkB,CAAC;CACnC,CAAC;AAEF,MAAM,OAAO,GAAG,gBAAgB,CAAC;AAEjC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CACnC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,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 { TemplateResult } from '@spectrum-web-components/base';\nimport { makeOverBackground, renderButtonSet } from './index.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/Over Background/Sizes',\n decorators: [makeOverBackground],\n};\n\nconst variant = 'overBackground';\n\nexport const s = (): TemplateResult => renderButtonSet({ size: 's', variant });\n\nexport const m = (): TemplateResult => renderButtonSet({ size: 'm', variant });\n\nexport const l = (): TemplateResult => renderButtonSet({ size: 'l', variant });\n\nexport const XL = (): TemplateResult =>\n renderButtonSet({ size: 'xl', variant });\n"]}
@@ -0,0 +1,132 @@
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 { html } from '@spectrum-web-components/base';
13
+ import { bellIcon, makeOverBackground, renderButtonSet } from './index.js';
14
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';
15
+ export default {
16
+ component: 'sp-button',
17
+ title: 'Button/Over Background',
18
+ decorators: [makeOverBackground],
19
+ args: {
20
+ disabled: false,
21
+ quiet: false,
22
+ variant: 'overBackground',
23
+ },
24
+ argTypes: {
25
+ disabled: {
26
+ name: 'disabled',
27
+ type: { name: 'boolean', required: false },
28
+ description: 'Disable this control. It will not receive focus or events.',
29
+ table: {
30
+ type: { summary: 'boolean' },
31
+ defaultValue: { summary: false },
32
+ },
33
+ control: {
34
+ type: 'boolean',
35
+ },
36
+ },
37
+ quiet: {
38
+ name: 'quiet',
39
+ type: { name: 'boolean', required: false },
40
+ table: {
41
+ type: { summary: 'boolean' },
42
+ defaultValue: { summary: false },
43
+ },
44
+ control: {
45
+ type: 'boolean',
46
+ },
47
+ },
48
+ variant: {
49
+ name: 'variant',
50
+ type: { name: 'string', required: false },
51
+ description: 'The visual variant to apply to the button.',
52
+ table: {
53
+ type: { summary: 'string' },
54
+ defaultValue: { summary: 'cta' },
55
+ },
56
+ control: {
57
+ type: 'inline-radio',
58
+ options: [
59
+ 'cta',
60
+ 'primary',
61
+ 'secondary',
62
+ 'negative',
63
+ 'overBackground',
64
+ ],
65
+ },
66
+ },
67
+ },
68
+ };
69
+ const variant = 'overBackground';
70
+ export const Default = (props) => renderButtonSet(props);
71
+ export const quiet = (props) => renderButtonSet(props);
72
+ quiet.args = {
73
+ quiet: true,
74
+ };
75
+ export const withIcon = (props) => {
76
+ return html `
77
+ <style>
78
+ .row {
79
+ padding: 10px;
80
+ }
81
+ </style>
82
+ <div class="row">
83
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
84
+ <sp-icon-help slot="icon"></sp-icon-help>
85
+ Help
86
+ ` }))}
87
+ </div>
88
+ <div class="row">
89
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
90
+ ${bellIcon} Custom SVG
91
+ ` }))}
92
+ </div>
93
+ `;
94
+ };
95
+ export const iconSizeOverridden = () => {
96
+ return html `
97
+ <sp-button label="Edit" size="xl" variant=${variant}>
98
+ <sp-icon-help slot="icon" size="s">Testing</sp-icon-help>
99
+ </sp-button>
100
+ <h1 style="color: var(--spectrum-global-color-gray-50)">
101
+ For testing purposes only
102
+ </h1>
103
+ <p style="color: var(--spectrum-global-color-gray-50)">
104
+ This is a test to ensure that sizing the icon will still work when
105
+ it's in the scope of a parent element. You shouldn't normally do
106
+ this as it deviates from the Spectrum design specification.
107
+ </p>
108
+ `;
109
+ };
110
+ export const minWidthButton = (props) => {
111
+ return html `
112
+ <style>
113
+ sp-button {
114
+ min-width: 300px;
115
+ }
116
+ </style>
117
+ ${renderButtonSet(props)}
118
+ `;
119
+ };
120
+ minWidthButton.story = {
121
+ name: 'min-width',
122
+ };
123
+ const href = 'https://github.com/adobe/spectrum-web-components';
124
+ export const link = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href }));
125
+ link.story = {
126
+ name: 'href',
127
+ };
128
+ export const linkWithTarget = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href, target: '_blank' }));
129
+ linkWithTarget.story = {
130
+ name: 'href with target="_blank"',
131
+ };
132
+ //# sourceMappingURL=button-overBackground.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-overBackground.stories.js","sourceRoot":"","sources":["button-overBackground.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,+DAA+D,CAAC;AAEvE,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,wBAAwB;IAC/B,UAAU,EAAE,CAAC,kBAAkB,CAAC;IAChC,IAAI,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,gBAAgB;KAC5B;IACD,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EACP,4DAA4D;YAChE,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,KAAK,EAAE;YACH,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;g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,OAAO,IAAI,CAAA;;;;;;UAML,eAAe,CAAC,KAAK,CAAC;KAC3B,CAAC;AACN,CAAC,CAAC;AACF,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,WAAW;CACpB,CAAC;AAEF,MAAM,IAAI,GAAG,kDAAkD,CAAC;AAEhE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAiB,EAAkB,EAAE,CACtD,eAAe,iCACR,KAAK,KACR,IAAI,IACN,CAAC;AACP,IAAI,CAAC,KAAK,GAAG;IACT,IAAI,EAAE,MAAM;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAkB,EAAE,CAChE,eAAe,iCACR,KAAK,KACR,IAAI,EACJ,MAAM,EAAE,QAAQ,IAClB,CAAC;AACP,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,2BAA2B;CACpC,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 { bellIcon, makeOverBackground, renderButtonSet } from './index.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/Over Background',\n decorators: [makeOverBackground],\n args: {\n disabled: false,\n quiet: false,\n variant: 'overBackground',\n },\n 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 quiet: {\n name: 'quiet',\n type: { name: 'boolean', required: false },\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 'primary',\n 'secondary',\n 'negative',\n 'overBackground',\n ],\n },\n },\n },\n};\n\nconst variant = 'overBackground';\n\ninterface Properties {\n content?: TemplateResult;\n disabled?: boolean;\n quiet?: boolean;\n variant?: 'cta' | 'overBackground' | 'primary' | 'secondary' | 'negative';\n}\n\nexport const Default = (props: Properties): TemplateResult =>\n renderButtonSet(props);\n\nexport const quiet = (props: Properties): TemplateResult =>\n renderButtonSet(props);\nquiet.args = {\n quiet: true,\n};\n\nexport const withIcon = (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 iconSizeOverridden = (): TemplateResult => {\n return html`\n <sp-button label=\"Edit\" size=\"xl\" variant=${variant}>\n <sp-icon-help slot=\"icon\" size=\"s\">Testing</sp-icon-help>\n </sp-button>\n <h1 style=\"color: var(--spectrum-global-color-gray-50)\">\n For testing purposes only\n </h1>\n <p style=\"color: var(--spectrum-global-color-gray-50)\">\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 minWidthButton = (props: Properties): TemplateResult => {\n return html`\n <style>\n sp-button {\n min-width: 300px;\n }\n </style>\n ${renderButtonSet(props)}\n `;\n};\nminWidthButton.story = {\n name: 'min-width',\n};\n\nconst href = 'https://github.com/adobe/spectrum-web-components';\n\nexport const link = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n });\nlink.story = {\n name: 'href',\n};\n\nexport const linkWithTarget = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n target: '_blank',\n });\nlinkWithTarget.story = {\n name: 'href with target=\"_blank\"',\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import { renderButtonSet } from './index.js';
2
+ export default {
3
+ component: 'sp-button',
4
+ title: 'Button/Primary/Sizes',
5
+ };
6
+ const variant = 'primary';
7
+ export const s = () => renderButtonSet({ size: 's', variant });
8
+ export const m = () => renderButtonSet({ size: 'm', variant });
9
+ export const l = () => renderButtonSet({ size: 'l', variant });
10
+ export const XL = () => renderButtonSet({ size: 'xl', variant });
11
+ //# sourceMappingURL=button-primary-sizes.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-primary-sizes.stories.js","sourceRoot":"","sources":["button-primary-sizes.stories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,sBAAsB;CAChC,CAAC;AAEF,MAAM,OAAO,GAAG,SAAS,CAAC;AAE1B,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CACnC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,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 { TemplateResult } from '@spectrum-web-components/base';\nimport { renderButtonSet } from './index.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/Primary/Sizes',\n};\n\nconst variant = 'primary';\n\nexport const s = (): TemplateResult => renderButtonSet({ size: 's', variant });\n\nexport const m = (): TemplateResult => renderButtonSet({ size: 'm', variant });\n\nexport const l = (): TemplateResult => renderButtonSet({ size: 'l', variant });\n\nexport const XL = (): TemplateResult =>\n renderButtonSet({ size: 'xl', variant });\n"]}
@@ -0,0 +1,129 @@
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 { html } from '@spectrum-web-components/base';
13
+ import { bellIcon, renderButtonSet } from './index.js';
14
+ import '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';
15
+ export default {
16
+ component: 'sp-button',
17
+ title: 'Button/Primary',
18
+ args: {
19
+ disabled: false,
20
+ quiet: false,
21
+ variant: 'primary',
22
+ },
23
+ argTypes: {
24
+ disabled: {
25
+ name: 'disabled',
26
+ type: { name: 'boolean', required: false },
27
+ description: 'Disable this control. It will not receive focus or events.',
28
+ table: {
29
+ type: { summary: 'boolean' },
30
+ defaultValue: { summary: false },
31
+ },
32
+ control: {
33
+ type: 'boolean',
34
+ },
35
+ },
36
+ quiet: {
37
+ name: 'quiet',
38
+ type: { name: 'boolean', required: false },
39
+ table: {
40
+ type: { summary: 'boolean' },
41
+ defaultValue: { summary: false },
42
+ },
43
+ control: {
44
+ type: 'boolean',
45
+ },
46
+ },
47
+ variant: {
48
+ name: 'variant',
49
+ type: { name: 'string', required: false },
50
+ description: 'The visual variant to apply to the button.',
51
+ table: {
52
+ type: { summary: 'string' },
53
+ defaultValue: { summary: 'cta' },
54
+ },
55
+ control: {
56
+ type: 'inline-radio',
57
+ options: [
58
+ 'cta',
59
+ 'primary',
60
+ 'secondary',
61
+ 'negative',
62
+ 'overBackground',
63
+ ],
64
+ },
65
+ },
66
+ },
67
+ };
68
+ const variant = 'primary';
69
+ export const Default = (props) => renderButtonSet(props);
70
+ export const quiet = (props) => renderButtonSet(props);
71
+ quiet.args = {
72
+ quiet: true,
73
+ };
74
+ export const withIcon = (props) => {
75
+ return html `
76
+ <style>
77
+ .row {
78
+ padding: 10px;
79
+ }
80
+ </style>
81
+ <div class="row">
82
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
83
+ <sp-icon-help slot="icon"></sp-icon-help>
84
+ Help
85
+ ` }))}
86
+ </div>
87
+ <div class="row">
88
+ ${renderButtonSet(Object.assign(Object.assign({}, props), { content: html `
89
+ ${bellIcon} Custom SVG
90
+ ` }))}
91
+ </div>
92
+ `;
93
+ };
94
+ export const iconSizeOverridden = () => {
95
+ return html `
96
+ <sp-button label="Edit" size="xl" variant=${variant}>
97
+ <sp-icon-help slot="icon" size="s">Testing</sp-icon-help>
98
+ </sp-button>
99
+ <h1>For testing purposes only</h1>
100
+ <p>
101
+ This is a test to ensure that sizing the icon will still work when
102
+ it's in the scope of a parent element. You shouldn't normally do
103
+ this as it deviates from the Spectrum design specification.
104
+ </p>
105
+ `;
106
+ };
107
+ export const minWidthButton = (props) => {
108
+ return html `
109
+ <style>
110
+ sp-button {
111
+ min-width: 300px;
112
+ }
113
+ </style>
114
+ ${renderButtonSet(props)}
115
+ `;
116
+ };
117
+ minWidthButton.story = {
118
+ name: 'min-width',
119
+ };
120
+ const href = 'https://github.com/adobe/spectrum-web-components';
121
+ export const link = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href }));
122
+ link.story = {
123
+ name: 'href',
124
+ };
125
+ export const linkWithTarget = (props) => renderButtonSet(Object.assign(Object.assign({}, props), { href, target: '_blank' }));
126
+ linkWithTarget.story = {
127
+ name: 'href with target="_blank"',
128
+ };
129
+ //# sourceMappingURL=button-primary.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-primary.stories.js","sourceRoot":"","sources":["button-primary.stories.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,IAAI,EAAkB,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,+DAA+D,CAAC;AAEvE,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,gBAAgB;IACvB,IAAI,EAAE;QACF,QAAQ,EAAE,KAAK;QACf,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,SAAS;KACrB;IACD,QAAQ,EAAE;QACN,QAAQ,EAAE;YACN,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;YAC1C,WAAW,EACP,4DAA4D;YAChE,KAAK,EAAE;gBACH,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;gBAC5B,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;aACnC;YACD,OAAO,EAAE;gBACL,IAAI,EAAE,SAAS;aAClB;SACJ;QACD,KAAK,EAAE;YACH,IAAI,E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ET,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAmB,EAAE;IACnD,OAAO,IAAI,CAAA;oDACqC,OAAO;;;;;;;;;KAStD,CAAC;AACN,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAkB,EAAE;IAChE,OAAO,IAAI,CAAA;;;;;;UAML,eAAe,CAAC,KAAK,CAAC;KAC3B,CAAC;AACN,CAAC,CAAC;AACF,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,WAAW;CACpB,CAAC;AAEF,MAAM,IAAI,GAAG,kDAAkD,CAAC;AAEhE,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,KAAiB,EAAkB,EAAE,CACtD,eAAe,iCACR,KAAK,KACR,IAAI,IACN,CAAC;AACP,IAAI,CAAC,KAAK,GAAG;IACT,IAAI,EAAE,MAAM;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAiB,EAAkB,EAAE,CAChE,eAAe,iCACR,KAAK,KACR,IAAI,EACJ,MAAM,EAAE,QAAQ,IAClB,CAAC;AACP,cAAc,CAAC,KAAK,GAAG;IACnB,IAAI,EAAE,2BAA2B;CACpC,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 { bellIcon, renderButtonSet } from './index.js';\nimport '@spectrum-web-components/icons-workflow/icons/sp-icon-help.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/Primary',\n args: {\n disabled: false,\n quiet: false,\n variant: 'primary',\n },\n 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 quiet: {\n name: 'quiet',\n type: { name: 'boolean', required: false },\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 'primary',\n 'secondary',\n 'negative',\n 'overBackground',\n ],\n },\n },\n },\n};\n\nconst variant = 'primary';\n\ninterface Properties {\n content?: TemplateResult;\n disabled?: boolean;\n quiet?: boolean;\n variant?: 'cta' | 'overBackground' | 'primary' | 'secondary' | 'negative';\n}\n\nexport const Default = (props: Properties): TemplateResult =>\n renderButtonSet(props);\n\nexport const quiet = (props: Properties): TemplateResult =>\n renderButtonSet(props);\nquiet.args = {\n quiet: true,\n};\n\nexport const withIcon = (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 iconSizeOverridden = (): TemplateResult => {\n return html`\n <sp-button label=\"Edit\" size=\"xl\" variant=${variant}>\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 minWidthButton = (props: Properties): TemplateResult => {\n return html`\n <style>\n sp-button {\n min-width: 300px;\n }\n </style>\n ${renderButtonSet(props)}\n `;\n};\nminWidthButton.story = {\n name: 'min-width',\n};\n\nconst href = 'https://github.com/adobe/spectrum-web-components';\n\nexport const link = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n });\nlink.story = {\n name: 'href',\n};\n\nexport const linkWithTarget = (props: Properties): TemplateResult =>\n renderButtonSet({\n ...props,\n href,\n target: '_blank',\n });\nlinkWithTarget.story = {\n name: 'href with target=\"_blank\"',\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import { renderButtonSet } from './index.js';
2
+ export default {
3
+ component: 'sp-button',
4
+ title: 'Button/Secondary/Sizes',
5
+ };
6
+ const variant = 'secondary';
7
+ export const s = () => renderButtonSet({ size: 's', variant });
8
+ export const m = () => renderButtonSet({ size: 'm', variant });
9
+ export const l = () => renderButtonSet({ size: 'l', variant });
10
+ export const XL = () => renderButtonSet({ size: 'xl', variant });
11
+ //# sourceMappingURL=button-secondary-sizes.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-secondary-sizes.stories.js","sourceRoot":"","sources":["button-secondary-sizes.stories.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,eAAe;IACX,SAAS,EAAE,WAAW;IACtB,KAAK,EAAE,wBAAwB;CAClC,CAAC;AAEF,MAAM,OAAO,GAAG,WAAW,CAAC;AAE5B,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,CAAC,GAAG,GAAmB,EAAE,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,EAAE,GAAG,GAAmB,EAAE,CACnC,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,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 { TemplateResult } from '@spectrum-web-components/base';\nimport { renderButtonSet } from './index.js';\n\nexport default {\n component: 'sp-button',\n title: 'Button/Secondary/Sizes',\n};\n\nconst variant = 'secondary';\n\nexport const s = (): TemplateResult => renderButtonSet({ size: 's', variant });\n\nexport const m = (): TemplateResult => renderButtonSet({ size: 'm', variant });\n\nexport const l = (): TemplateResult => renderButtonSet({ size: 'l', variant });\n\nexport const XL = (): TemplateResult =>\n renderButtonSet({ size: 'xl', variant });\n"]}