@spectrum-web-components/button-group 1.1.0 → 1.1.1
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 +4 -4
- package/sp-button-group.d.ts +6 -0
- package/sp-button-group.dev.js +5 -0
- package/sp-button-group.dev.js.map +7 -0
- package/sp-button-group.js +2 -0
- package/sp-button-group.js.map +7 -0
- package/src/ButtonGroup.d.ts +21 -0
- package/src/ButtonGroup.dev.js +61 -0
- package/src/ButtonGroup.dev.js.map +7 -0
- package/src/ButtonGroup.js +4 -0
- package/src/ButtonGroup.js.map +7 -0
- package/src/button-group-overrides.css.d.ts +2 -0
- package/src/button-group-overrides.css.dev.js +7 -0
- package/src/button-group-overrides.css.dev.js.map +7 -0
- package/src/button-group-overrides.css.js +4 -0
- package/src/button-group-overrides.css.js.map +7 -0
- package/src/button-group.css.d.ts +2 -0
- package/src/button-group.css.dev.js +7 -0
- package/src/button-group.css.dev.js.map +7 -0
- package/src/button-group.css.js +4 -0
- package/src/button-group.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-button-group.css.d.ts +2 -0
- package/src/spectrum-button-group.css.dev.js +7 -0
- package/src/spectrum-button-group.css.dev.js.map +7 -0
- package/src/spectrum-button-group.css.js +4 -0
- package/src/spectrum-button-group.css.js.map +7 -0
- package/stories/button-group-sizes.stories.js +26 -0
- package/stories/button-group-sizes.stories.js.map +7 -0
- package/stories/button-group.stories.js +34 -0
- package/stories/button-group.stories.js.map +7 -0
- package/test/benchmark/basic-test.js +13 -0
- package/test/benchmark/basic-test.js.map +7 -0
- package/test/button-group-memory.test.js +5 -0
- package/test/button-group-memory.test.js.map +7 -0
- package/test/button-group-sizes.test-vrt.js +5 -0
- package/test/button-group-sizes.test-vrt.js.map +7 -0
- package/test/button-group.test-vrt.js +5 -0
- package/test/button-group.test-vrt.js.map +7 -0
- package/test/button-group.test.js +37 -0
- package/test/button-group.test.js.map +7 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spectrum-web-components/button-group",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"lit-html"
|
|
59
59
|
],
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@spectrum-web-components/base": "^1.1.
|
|
62
|
-
"@spectrum-web-components/button": "^1.1.
|
|
61
|
+
"@spectrum-web-components/base": "^1.1.1",
|
|
62
|
+
"@spectrum-web-components/button": "^1.1.1"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@spectrum-css/buttongroup": "8.0.0-s2-foundations.15"
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"./sp-*.js",
|
|
71
71
|
"./**/*.dev.js"
|
|
72
72
|
],
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "44870aa95001c1b995456d994ae31bbe7277fac9"
|
|
74
74
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-button-group.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 { ButtonGroup } from './src/ButtonGroup.dev.js'\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-button-group', ButtonGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button-group': ButtonGroup;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,cAAc,mBAAmB,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["sp-button-group.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 { ButtonGroup } from './src/ButtonGroup.js';\nimport { defineElement } from '@spectrum-web-components/base/src/define-element.js';\n\ndefineElement('sp-button-group', ButtonGroup);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-button-group': ButtonGroup;\n }\n}\n"],
|
|
5
|
+
"mappings": "aAWA,OAAS,eAAAA,MAAmB,uBAC5B,OAAS,iBAAAC,MAAqB,sDAE9BA,EAAc,kBAAmBD,CAAW",
|
|
6
|
+
"names": ["ButtonGroup", "defineElement"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
|
+
declare const ButtonGroup_base: typeof SpectrumElement & {
|
|
3
|
+
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
4
|
+
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* @element sp-button-group
|
|
8
|
+
* @slot - the sp-button elements that make up the group
|
|
9
|
+
*/
|
|
10
|
+
export declare class ButtonGroup extends ButtonGroup_base {
|
|
11
|
+
static get styles(): CSSResultArray;
|
|
12
|
+
vertical: boolean;
|
|
13
|
+
slotElement: HTMLSlotElement;
|
|
14
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
15
|
+
protected handleSlotchange({ target: slot, }: Event & {
|
|
16
|
+
target: HTMLSlotElement;
|
|
17
|
+
}): void;
|
|
18
|
+
private manageChildrenSize;
|
|
19
|
+
protected render(): TemplateResult;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
5
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
6
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7
|
+
if (decorator = decorators[i])
|
|
8
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
9
|
+
if (kind && result) __defProp(target, key, result);
|
|
10
|
+
return result;
|
|
11
|
+
};
|
|
12
|
+
import {
|
|
13
|
+
html,
|
|
14
|
+
SizedMixin,
|
|
15
|
+
SpectrumElement
|
|
16
|
+
} from "@spectrum-web-components/base";
|
|
17
|
+
import {
|
|
18
|
+
property,
|
|
19
|
+
query
|
|
20
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
21
|
+
import styles from "./button-group.css.js";
|
|
22
|
+
export class ButtonGroup extends SizedMixin(SpectrumElement, {
|
|
23
|
+
noDefaultSize: true
|
|
24
|
+
}) {
|
|
25
|
+
constructor() {
|
|
26
|
+
super(...arguments);
|
|
27
|
+
this.vertical = false;
|
|
28
|
+
}
|
|
29
|
+
static get styles() {
|
|
30
|
+
return [styles];
|
|
31
|
+
}
|
|
32
|
+
updated(changedProperties) {
|
|
33
|
+
super.updated(changedProperties);
|
|
34
|
+
if (changedProperties.has("size")) {
|
|
35
|
+
this.manageChildrenSize(this.slotElement);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
handleSlotchange({
|
|
39
|
+
target: slot
|
|
40
|
+
}) {
|
|
41
|
+
this.manageChildrenSize(slot);
|
|
42
|
+
}
|
|
43
|
+
manageChildrenSize(slot) {
|
|
44
|
+
const assignedElements = slot.assignedElements();
|
|
45
|
+
assignedElements.forEach((button) => {
|
|
46
|
+
button.size = this.size;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return html`
|
|
51
|
+
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
52
|
+
`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
__decorateClass([
|
|
56
|
+
property({ type: Boolean, reflect: true })
|
|
57
|
+
], ButtonGroup.prototype, "vertical", 2);
|
|
58
|
+
__decorateClass([
|
|
59
|
+
query("slot")
|
|
60
|
+
], ButtonGroup.prototype, "slotElement", 2);
|
|
61
|
+
//# sourceMappingURL=ButtonGroup.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["ButtonGroup.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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport type { Button } from '@spectrum-web-components/button';\n\nimport styles from './button-group.css.js';\n\n/**\n * @element sp-button-group\n * @slot - the sp-button elements that make up the group\n */\nexport class ButtonGroup extends SizedMixin(SpectrumElement, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('size')) {\n this.manageChildrenSize(this.slotElement);\n }\n }\n\n protected handleSlotchange({\n target: slot,\n }: Event & { target: HTMLSlotElement }): void {\n this.manageChildrenSize(slot);\n }\n\n private manageChildrenSize(slot: HTMLSlotElement): void {\n const assignedElements = slot.assignedElements() as Button[];\n assignedElements.forEach((button) => {\n button.size = this.size;\n });\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.handleSlotchange}></slot>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,EACA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAGP,OAAO,YAAY;AAMZ,aAAM,oBAAoB,WAAW,iBAAiB;AAAA,EACzD,eAAe;AACnB,CAAC,EAAE;AAAA,EAFI;AAAA;AAQH,SAAO,WAAW;AAAA;AAAA,EALlB,WAA2B,SAAyB;AAChD,WAAO,CAAC,MAAM;AAAA,EAClB;AAAA,EAQmB,QAAQ,mBAAyC;AAChE,UAAM,QAAQ,iBAAiB;AAE/B,QAAI,kBAAkB,IAAI,MAAM,GAAG;AAC/B,WAAK,mBAAmB,KAAK,WAAW;AAAA,IAC5C;AAAA,EACJ;AAAA,EAEU,iBAAiB;AAAA,IACvB,QAAQ;AAAA,EACZ,GAA8C;AAC1C,SAAK,mBAAmB,IAAI;AAAA,EAChC;AAAA,EAEQ,mBAAmB,MAA6B;AACpD,UAAM,mBAAmB,KAAK,iBAAiB;AAC/C,qBAAiB,QAAQ,CAAC,WAAW;AACjC,aAAO,OAAO,KAAK;AAAA,IACvB,CAAC;AAAA,EACL;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA,gCACiB,KAAK,gBAAgB;AAAA;AAAA,EAEjD;AACJ;AA/BW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAPjC,YAQF;AAGP;AAAA,EADC,MAAM,MAAM;AAAA,GAVJ,YAWT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var n=(s,r,e,l)=>{for(var t=l>1?void 0:l?m(r,e):r,o=s.length-1,i;o>=0;o--)(i=s[o])&&(t=(l?i(r,e,t):i(t))||t);return l&&t&&a(r,e,t),t};import{html as d,SizedMixin as p,SpectrumElement as u}from"@spectrum-web-components/base";import{property as c,query as h}from"@spectrum-web-components/base/src/decorators.js";import S from"./button-group.css.js";export class ButtonGroup extends p(u,{noDefaultSize:!0}){constructor(){super(...arguments);this.vertical=!1}static get styles(){return[S]}updated(e){super.updated(e),e.has("size")&&this.manageChildrenSize(this.slotElement)}handleSlotchange({target:e}){this.manageChildrenSize(e)}manageChildrenSize(e){e.assignedElements().forEach(t=>{t.size=this.size})}render(){return d`
|
|
2
|
+
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
3
|
+
`}}n([c({type:Boolean,reflect:!0})],ButtonGroup.prototype,"vertical",2),n([h("slot")],ButtonGroup.prototype,"slotElement",2);
|
|
4
|
+
//# sourceMappingURL=ButtonGroup.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["ButtonGroup.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 {\n CSSResultArray,\n html,\n PropertyValues,\n SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n property,\n query,\n} from '@spectrum-web-components/base/src/decorators.js';\nimport type { Button } from '@spectrum-web-components/button';\n\nimport styles from './button-group.css.js';\n\n/**\n * @element sp-button-group\n * @slot - the sp-button elements that make up the group\n */\nexport class ButtonGroup extends SizedMixin(SpectrumElement, {\n noDefaultSize: true,\n}) {\n public static override get styles(): CSSResultArray {\n return [styles];\n }\n\n @property({ type: Boolean, reflect: true })\n public vertical = false;\n\n @query('slot')\n slotElement!: HTMLSlotElement;\n\n protected override updated(changedProperties: PropertyValues): void {\n super.updated(changedProperties);\n\n if (changedProperties.has('size')) {\n this.manageChildrenSize(this.slotElement);\n }\n }\n\n protected handleSlotchange({\n target: slot,\n }: Event & { target: HTMLSlotElement }): void {\n this.manageChildrenSize(slot);\n }\n\n private manageChildrenSize(slot: HTMLSlotElement): void {\n const assignedElements = slot.assignedElements() as Button[];\n assignedElements.forEach((button) => {\n button.size = this.size;\n });\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot @slotchange=${this.handleSlotchange}></slot>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,cAAAC,EACA,mBAAAC,MAEG,gCACP,OACI,YAAAC,EACA,SAAAC,MACG,kDAGP,OAAOC,MAAY,wBAMZ,aAAM,oBAAoBJ,EAAWC,EAAiB,CACzD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAQH,KAAO,SAAW,GALlB,WAA2B,QAAyB,CAChD,MAAO,CAACG,CAAM,CAClB,CAQmB,QAAQC,EAAyC,CAChE,MAAM,QAAQA,CAAiB,EAE3BA,EAAkB,IAAI,MAAM,GAC5B,KAAK,mBAAmB,KAAK,WAAW,CAEhD,CAEU,iBAAiB,CACvB,OAAQC,CACZ,EAA8C,CAC1C,KAAK,mBAAmBA,CAAI,CAChC,CAEQ,mBAAmBA,EAA6B,CAC3BA,EAAK,iBAAiB,EAC9B,QAASC,GAAW,CACjCA,EAAO,KAAO,KAAK,IACvB,CAAC,CACL,CAEmB,QAAyB,CACxC,OAAOR;AAAA,gCACiB,KAAK,gBAAgB;AAAA,SAEjD,CACJ,CA/BWS,EAAA,CADNN,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPjC,YAQF,wBAGPM,EAAA,CADCL,EAAM,MAAM,GAVJ,YAWT",
|
|
6
|
+
"names": ["html", "SizedMixin", "SpectrumElement", "property", "query", "styles", "changedProperties", "slot", "button", "__decorateClass"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=button-group-overrides.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group-overrides.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const s=t`
|
|
2
|
+
:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}
|
|
3
|
+
`;export default s;
|
|
4
|
+
//# sourceMappingURL=button-group-overrides.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group-overrides.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}:host([vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-flex-grow:1}:host([dir=ltr][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:left}:host([dir=rtl][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:right}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=button-group.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}:host([vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-flex-grow:1}:host([dir=ltr][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:left}:host([dir=rtl][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:right}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
|
+
:host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}:host([vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-flex-grow:1}:host([dir=ltr][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:left}:host([dir=rtl][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:right}
|
|
3
|
+
`;export default o;
|
|
4
|
+
//# sourceMappingURL=button-group.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-spacing-vertical)}:host([size=s]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-s-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-s-spacing-vertical)}:host{--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-m-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-m-spacing-vertical)}:host([size=l]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-l-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-l-spacing-vertical)}:host([size=xl]){--spectrum-buttongroup-spacing-horizontal:var(--system-button-group-size-xl-spacing-horizontal);--spectrum-buttongroup-spacing-vertical:var(--system-button-group-size-xl-spacing-vertical)}:host([vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-flex-grow:1}:host([dir=ltr][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:left}:host([dir=rtl][vertical]) ::slotted(sp-action-button){--spectrum-actionbutton-label-text-align:right}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ButtonGroup.js';
|
package/src/index.dev.js
ADDED
|
@@ -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\nexport * from './ButtonGroup.dev.js'\n"],
|
|
5
|
+
"mappings": ";AAYA,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -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\nexport * from './ButtonGroup.js';\n"],
|
|
5
|
+
"mappings": "aAYA,WAAc",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { css } from "@spectrum-web-components/base";
|
|
3
|
+
const styles = css`
|
|
4
|
+
:host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}
|
|
5
|
+
`;
|
|
6
|
+
export default styles;
|
|
7
|
+
//# sourceMappingURL=spectrum-button-group.css.dev.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-button-group.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";import{css as t}from"@spectrum-web-components/base";const o=t`
|
|
2
|
+
:host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}
|
|
3
|
+
`;export default o;
|
|
4
|
+
//# sourceMappingURL=spectrum-button-group.css.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["spectrum-button-group.css.ts"],
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2025 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n :host{gap:var(--mod-buttongroup-spacing-horizontal,var(--spectrum-buttongroup-spacing-horizontal));justify-content:normal;justify-content:var(--mod-buttongroup-justify-content,normal);flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}:host([vertical]){gap:var(--mod-buttongroup-spacing-vertical,var(--spectrum-buttongroup-spacing-vertical));flex-direction:column;display:inline-flex}\n`;\nexport default styles;"],
|
|
5
|
+
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
|
+
"names": ["css", "styles"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import {
|
|
3
|
+
buttons,
|
|
4
|
+
buttonsVertical
|
|
5
|
+
} from "./button-group.stories.js";
|
|
6
|
+
export default {
|
|
7
|
+
title: "Button Group/Sizes",
|
|
8
|
+
component: "sp-button-group"
|
|
9
|
+
};
|
|
10
|
+
export const s = (args) => buttons(args);
|
|
11
|
+
s.args = { size: "s" };
|
|
12
|
+
export const m = (args) => buttons(args);
|
|
13
|
+
m.args = { size: "m" };
|
|
14
|
+
export const l = (args) => buttons(args);
|
|
15
|
+
l.args = { size: "l" };
|
|
16
|
+
export const XL = (args) => buttons(args);
|
|
17
|
+
XL.args = { size: "XL" };
|
|
18
|
+
export const verticalS = (args) => buttonsVertical(args);
|
|
19
|
+
verticalS.args = { size: "s" };
|
|
20
|
+
export const verticalM = (args) => buttonsVertical(args);
|
|
21
|
+
verticalM.args = { size: "m" };
|
|
22
|
+
export const verticalL = (args) => buttonsVertical(args);
|
|
23
|
+
verticalL.args = { size: "l" };
|
|
24
|
+
export const verticalXL = (args) => buttonsVertical(args);
|
|
25
|
+
verticalXL.args = { size: "XL" };
|
|
26
|
+
//# sourceMappingURL=button-group-sizes.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group-sizes.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*/\n\nimport { TemplateResult } from '@spectrum-web-components/base';\n\nimport {\n buttons,\n buttonsVertical,\n Properties,\n} from './button-group.stories.js';\n\nexport default {\n title: 'Button Group/Sizes',\n component: 'sp-button-group',\n};\n\nexport const s = (args: Properties): TemplateResult => buttons(args);\ns.args = { size: 's' };\n\nexport const m = (args: Properties): TemplateResult => buttons(args);\nm.args = { size: 'm' };\n\nexport const l = (args: Properties): TemplateResult => buttons(args);\nl.args = { size: 'l' };\n\nexport const XL = (args: Properties): TemplateResult => buttons(args);\nXL.args = { size: 'XL' };\n\nexport const verticalS = (args: Properties): TemplateResult =>\n buttonsVertical(args);\nverticalS.args = { size: 's' };\n\nexport const verticalM = (args: Properties): TemplateResult =>\n buttonsVertical(args);\nverticalM.args = { size: 'm' };\n\nexport const verticalL = (args: Properties): TemplateResult =>\n buttonsVertical(args);\nverticalL.args = { size: 'l' };\n\nexport const verticalXL = (args: Properties): TemplateResult =>\n buttonsVertical(args);\nverticalXL.args = { size: 'XL' };\n"],
|
|
5
|
+
"mappings": ";AAcA;AAAA,EACI;AAAA,EACA;AAAA,OAEG;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAEO,aAAM,IAAI,CAAC,SAAqC,QAAQ,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,IAAI,CAAC,SAAqC,QAAQ,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,IAAI,CAAC,SAAqC,QAAQ,IAAI;AACnE,EAAE,OAAO,EAAE,MAAM,IAAI;AAEd,aAAM,KAAK,CAAC,SAAqC,QAAQ,IAAI;AACpE,GAAG,OAAO,EAAE,MAAM,KAAK;AAEhB,aAAM,YAAY,CAAC,SACtB,gBAAgB,IAAI;AACxB,UAAU,OAAO,EAAE,MAAM,IAAI;AAEtB,aAAM,YAAY,CAAC,SACtB,gBAAgB,IAAI;AACxB,UAAU,OAAO,EAAE,MAAM,IAAI;AAEtB,aAAM,YAAY,CAAC,SACtB,gBAAgB,IAAI;AACxB,UAAU,OAAO,EAAE,MAAM,IAAI;AAEtB,aAAM,aAAa,CAAC,SACvB,gBAAgB,IAAI;AACxB,WAAW,OAAO,EAAE,MAAM,KAAK;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { html } from "@spectrum-web-components/base";
|
|
3
|
+
import "@spectrum-web-components/button-group/sp-button-group.js";
|
|
4
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
5
|
+
import "@spectrum-web-components/icon/sp-icon.js";
|
|
6
|
+
export default {
|
|
7
|
+
title: "Button Group",
|
|
8
|
+
component: "sp-button-group"
|
|
9
|
+
};
|
|
10
|
+
export const buttons = (args) => {
|
|
11
|
+
return html`
|
|
12
|
+
<sp-button-group size=${args.size || "m"}>
|
|
13
|
+
<sp-button>Button 1</sp-button>
|
|
14
|
+
<sp-button>Longer Button 2</sp-button>
|
|
15
|
+
<sp-button>Short 3</sp-button>
|
|
16
|
+
</sp-button-group>
|
|
17
|
+
`;
|
|
18
|
+
};
|
|
19
|
+
buttons.args = {
|
|
20
|
+
size: "m"
|
|
21
|
+
};
|
|
22
|
+
export const buttonsVertical = (args) => {
|
|
23
|
+
return html`
|
|
24
|
+
<sp-button-group vertical size=${args.size || "m"}>
|
|
25
|
+
<sp-button>Button 1</sp-button>
|
|
26
|
+
<sp-button>Longer Button 2</sp-button>
|
|
27
|
+
<sp-button>Short 3</sp-button>
|
|
28
|
+
</sp-button-group>
|
|
29
|
+
`;
|
|
30
|
+
};
|
|
31
|
+
buttonsVertical.args = {
|
|
32
|
+
size: "m"
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=button-group.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group.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*/\n\nimport { html, TemplateResult } from '@spectrum-web-components/base';\n\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport '@spectrum-web-components/icon/sp-icon.js';\n\nexport default {\n title: 'Button Group',\n component: 'sp-button-group',\n};\n\nexport interface Properties {\n size?: 's' | 'm' | 'l' | 'xl';\n}\n\ninterface Story<T> {\n (args: T): TemplateResult;\n args: Partial<T>;\n argTypes?: Record<string, unknown>;\n}\n\nexport const buttons: Story<Properties> = (\n args: Properties\n): TemplateResult => {\n return html`\n <sp-button-group size=${args.size || 'm'}>\n <sp-button>Button 1</sp-button>\n <sp-button>Longer Button 2</sp-button>\n <sp-button>Short 3</sp-button>\n </sp-button-group>\n `;\n};\nbuttons.args = {\n size: 'm',\n};\n\nexport const buttonsVertical: Story<Properties> = (\n args: Properties\n): TemplateResult => {\n return html`\n <sp-button-group vertical size=${args.size || 'm'}>\n <sp-button>Button 1</sp-button>\n <sp-button>Longer Button 2</sp-button>\n <sp-button>Short 3</sp-button>\n </sp-button-group>\n `;\n};\nbuttonsVertical.args = {\n size: 'm',\n};\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,YAA4B;AAErC,OAAO;AACP,OAAO;AACP,OAAO;AAEP,eAAe;AAAA,EACX,OAAO;AAAA,EACP,WAAW;AACf;AAYO,aAAM,UAA6B,CACtC,SACiB;AACjB,SAAO;AAAA,gCACqB,KAAK,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAMhD;AACA,QAAQ,OAAO;AAAA,EACX,MAAM;AACV;AAEO,aAAM,kBAAqC,CAC9C,SACiB;AACjB,SAAO;AAAA,yCAC8B,KAAK,QAAQ,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAMzD;AACA,gBAAgB,OAAO;AAAA,EACnB,MAAM;AACV;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import "@spectrum-web-components/button-group/sp-button-group.js";
|
|
3
|
+
import "@spectrum-web-components/button/sp-button.js";
|
|
4
|
+
import { html } from "lit";
|
|
5
|
+
import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
|
|
6
|
+
measureFixtureCreation(html`
|
|
7
|
+
<sp-button-group>
|
|
8
|
+
<sp-button>Button 1</sp-button>
|
|
9
|
+
<sp-button>Longer Button 2</sp-button>
|
|
10
|
+
<sp-button>Short 3</sp-button>
|
|
11
|
+
</sp-button-group>
|
|
12
|
+
`);
|
|
13
|
+
//# sourceMappingURL=basic-test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["basic-test.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 '@spectrum-web-components/button-group/sp-button-group.js';\nimport '@spectrum-web-components/button/sp-button.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-button-group>\n <sp-button>Button 1</sp-button>\n <sp-button>Longer Button 2</sp-button>\n <sp-button>Short 3</sp-button>\n </sp-button-group>\n`);\n"],
|
|
5
|
+
"mappings": ";AAYA,OAAO;AACP,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAMtB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group-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\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 { buttons } from '../stories/button-group.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(buttons({}));\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAEnC,mBAAmB,QAAQ,CAAC,CAAC,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group-sizes.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/button-group-sizes.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ButtonGroupSizesStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,2BAA2B,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group.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/button-group.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('ButtonGroupStories', stories as unknown as TestsType);\n"],
|
|
5
|
+
"mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,sBAAsB,OAA+B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { elementUpdated, expect, fixture } from "@open-wc/testing";
|
|
3
|
+
import "@spectrum-web-components/button-group/sp-button-group.js";
|
|
4
|
+
import { buttons, buttonsVertical } from "../stories/button-group.stories.js";
|
|
5
|
+
import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
|
|
6
|
+
describe("Buttongroup", () => {
|
|
7
|
+
testForLitDevWarnings(
|
|
8
|
+
async () => await fixture(buttons(buttons.args))
|
|
9
|
+
);
|
|
10
|
+
it("loads default button-group accessibly with sp-button", async () => {
|
|
11
|
+
const el = await fixture(buttons(buttons.args));
|
|
12
|
+
await elementUpdated(el);
|
|
13
|
+
await expect(el).to.be.accessible();
|
|
14
|
+
});
|
|
15
|
+
it("loads default button-group[vertial] accessibly with sp-button", async () => {
|
|
16
|
+
const el = await fixture(
|
|
17
|
+
buttonsVertical(buttonsVertical.args)
|
|
18
|
+
);
|
|
19
|
+
await elementUpdated(el);
|
|
20
|
+
await expect(el).to.be.accessible();
|
|
21
|
+
});
|
|
22
|
+
it(`manages its children's size`, async () => {
|
|
23
|
+
const el = await fixture(buttons(buttons.args));
|
|
24
|
+
await elementUpdated(el);
|
|
25
|
+
let children = el.querySelectorAll("sp-button");
|
|
26
|
+
children.forEach((button) => {
|
|
27
|
+
expect(button.size).to.equal("m");
|
|
28
|
+
});
|
|
29
|
+
el.size = "s";
|
|
30
|
+
await elementUpdated(el);
|
|
31
|
+
children = el.querySelectorAll("sp-button");
|
|
32
|
+
children.forEach((button) => {
|
|
33
|
+
expect(button.size).to.equal("s");
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=button-group.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["button-group.test.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 { elementUpdated, expect, fixture } from '@open-wc/testing';\n\nimport '@spectrum-web-components/button-group/sp-button-group.js';\nimport { ButtonGroup } from '..';\nimport { buttons, buttonsVertical } from '../stories/button-group.stories.js';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('Buttongroup', () => {\n testForLitDevWarnings(\n async () => await fixture<ButtonGroup>(buttons(buttons.args))\n );\n it('loads default button-group accessibly with sp-button', async () => {\n const el = await fixture<ButtonGroup>(buttons(buttons.args));\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it('loads default button-group[vertial] accessibly with sp-button', async () => {\n const el = await fixture<ButtonGroup>(\n buttonsVertical(buttonsVertical.args)\n );\n\n await elementUpdated(el);\n\n await expect(el).to.be.accessible();\n });\n it(`manages its children's size`, async () => {\n const el = await fixture<ButtonGroup>(buttons(buttons.args));\n await elementUpdated(el);\n\n let children = el.querySelectorAll('sp-button');\n children.forEach((button) => {\n expect(button.size).to.equal('m');\n });\n\n el.size = 's';\n await elementUpdated(el);\n\n children = el.querySelectorAll('sp-button');\n children.forEach((button) => {\n expect(button.size).to.equal('s');\n });\n });\n});\n"],
|
|
5
|
+
"mappings": ";AAYA,SAAS,gBAAgB,QAAQ,eAAe;AAEhD,OAAO;AAEP,SAAS,SAAS,uBAAuB;AACzC,SAAS,6BAA6B;AAEtC,SAAS,eAAe,MAAM;AAC1B;AAAA,IACI,YAAY,MAAM,QAAqB,QAAQ,QAAQ,IAAI,CAAC;AAAA,EAChE;AACA,KAAG,wDAAwD,YAAY;AACnE,UAAM,KAAK,MAAM,QAAqB,QAAQ,QAAQ,IAAI,CAAC;AAE3D,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,iEAAiE,YAAY;AAC5E,UAAM,KAAK,MAAM;AAAA,MACb,gBAAgB,gBAAgB,IAAI;AAAA,IACxC;AAEA,UAAM,eAAe,EAAE;AAEvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACD,KAAG,+BAA+B,YAAY;AAC1C,UAAM,KAAK,MAAM,QAAqB,QAAQ,QAAQ,IAAI,CAAC;AAC3D,UAAM,eAAe,EAAE;AAEvB,QAAI,WAAW,GAAG,iBAAiB,WAAW;AAC9C,aAAS,QAAQ,CAAC,WAAW;AACzB,aAAO,OAAO,IAAI,EAAE,GAAG,MAAM,GAAG;AAAA,IACpC,CAAC;AAED,OAAG,OAAO;AACV,UAAM,eAAe,EAAE;AAEvB,eAAW,GAAG,iBAAiB,WAAW;AAC1C,aAAS,QAAQ,CAAC,WAAW;AACzB,aAAO,OAAO,IAAI,EAAE,GAAG,MAAM,GAAG;AAAA,IACpC,CAAC;AAAA,EACL,CAAC;AACL,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|