@spectrum-web-components/button-group 1.1.0-beta.9 → 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 +5 -5
- package/src/ButtonGroup.d.ts +4 -1
- package/src/ButtonGroup.dev.js +16 -1
- package/src/ButtonGroup.dev.js.map +2 -2
- package/src/ButtonGroup.js +2 -2
- package/src/ButtonGroup.js.map +3 -3
- package/src/button-group-overrides.css.dev.js.map +1 -1
- package/src/button-group-overrides.css.js.map +1 -1
- package/src/button-group.css.dev.js.map +1 -1
- package/src/button-group.css.js.map +1 -1
- package/src/spectrum-button-group.css.dev.js.map +1 -1
- package/src/spectrum-button-group.css.js.map +1 -1
- package/test/button-group.test.js +14 -0
- package/test/button-group.test.js.map +2 -2
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,11 +58,11 @@
|
|
|
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
|
-
"@spectrum-css/buttongroup": "
|
|
65
|
+
"@spectrum-css/buttongroup": "8.0.0-s2-foundations.15"
|
|
66
66
|
},
|
|
67
67
|
"types": "./src/index.d.ts",
|
|
68
68
|
"customElements": "custom-elements.json",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"./sp-*.js",
|
|
71
71
|
"./**/*.dev.js"
|
|
72
72
|
],
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "44870aa95001c1b995456d994ae31bbe7277fac9"
|
|
74
74
|
}
|
package/src/ButtonGroup.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
1
|
+
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base';
|
|
2
2
|
declare const ButtonGroup_base: typeof SpectrumElement & {
|
|
3
3
|
new (...args: any[]): import("@spectrum-web-components/base").SizedElementInterface;
|
|
4
4
|
prototype: import("@spectrum-web-components/base").SizedElementInterface;
|
|
@@ -10,9 +10,12 @@ declare const ButtonGroup_base: typeof SpectrumElement & {
|
|
|
10
10
|
export declare class ButtonGroup extends ButtonGroup_base {
|
|
11
11
|
static get styles(): CSSResultArray;
|
|
12
12
|
vertical: boolean;
|
|
13
|
+
slotElement: HTMLSlotElement;
|
|
14
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
13
15
|
protected handleSlotchange({ target: slot, }: Event & {
|
|
14
16
|
target: HTMLSlotElement;
|
|
15
17
|
}): void;
|
|
18
|
+
private manageChildrenSize;
|
|
16
19
|
protected render(): TemplateResult;
|
|
17
20
|
}
|
|
18
21
|
export {};
|
package/src/ButtonGroup.dev.js
CHANGED
|
@@ -14,7 +14,10 @@ import {
|
|
|
14
14
|
SizedMixin,
|
|
15
15
|
SpectrumElement
|
|
16
16
|
} from "@spectrum-web-components/base";
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
property,
|
|
19
|
+
query
|
|
20
|
+
} from "@spectrum-web-components/base/src/decorators.js";
|
|
18
21
|
import styles from "./button-group.css.js";
|
|
19
22
|
export class ButtonGroup extends SizedMixin(SpectrumElement, {
|
|
20
23
|
noDefaultSize: true
|
|
@@ -26,9 +29,18 @@ export class ButtonGroup extends SizedMixin(SpectrumElement, {
|
|
|
26
29
|
static get styles() {
|
|
27
30
|
return [styles];
|
|
28
31
|
}
|
|
32
|
+
updated(changedProperties) {
|
|
33
|
+
super.updated(changedProperties);
|
|
34
|
+
if (changedProperties.has("size")) {
|
|
35
|
+
this.manageChildrenSize(this.slotElement);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
29
38
|
handleSlotchange({
|
|
30
39
|
target: slot
|
|
31
40
|
}) {
|
|
41
|
+
this.manageChildrenSize(slot);
|
|
42
|
+
}
|
|
43
|
+
manageChildrenSize(slot) {
|
|
32
44
|
const assignedElements = slot.assignedElements();
|
|
33
45
|
assignedElements.forEach((button) => {
|
|
34
46
|
button.size = this.size;
|
|
@@ -43,4 +55,7 @@ export class ButtonGroup extends SizedMixin(SpectrumElement, {
|
|
|
43
55
|
__decorateClass([
|
|
44
56
|
property({ type: Boolean, reflect: true })
|
|
45
57
|
], ButtonGroup.prototype, "vertical", 2);
|
|
58
|
+
__decorateClass([
|
|
59
|
+
query("slot")
|
|
60
|
+
], ButtonGroup.prototype, "slotElement", 2);
|
|
46
61
|
//# sourceMappingURL=ButtonGroup.dev.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,
|
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\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
6
|
"names": []
|
|
7
7
|
}
|
package/src/ButtonGroup.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
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
2
|
<slot @slotchange=${this.handleSlotchange}></slot>
|
|
3
|
-
`}}
|
|
3
|
+
`}}n([c({type:Boolean,reflect:!0})],ButtonGroup.prototype,"vertical",2),n([h("slot")],ButtonGroup.prototype,"slotElement",2);
|
|
4
4
|
//# sourceMappingURL=ButtonGroup.js.map
|
package/src/ButtonGroup.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {
|
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,
|
|
6
|
-
"names": ["html", "SizedMixin", "SpectrumElement", "property", "styles", "slot", "button", "__decorateClass"]
|
|
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
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-group-overrides.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-group-overrides.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["button-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-button-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": ";AAWA,SAAS,WAAW;AACpB,MAAM,SAAS;AAAA;AAAA;AAGf,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["spectrum-button-group.css.ts"],
|
|
4
|
-
"sourcesContent": ["/*\nCopyright
|
|
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
5
|
"mappings": "aAWA,OAAS,OAAAA,MAAW,gCACpB,MAAMC,EAASD;AAAA;AAAA,EAGf,eAAeC",
|
|
6
6
|
"names": ["css", "styles"]
|
|
7
7
|
}
|
|
@@ -19,5 +19,19 @@ describe("Buttongroup", () => {
|
|
|
19
19
|
await elementUpdated(el);
|
|
20
20
|
await expect(el).to.be.accessible();
|
|
21
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
|
+
});
|
|
22
36
|
});
|
|
23
37
|
//# sourceMappingURL=button-group.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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});\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;AACL,CAAC;",
|
|
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
6
|
"names": []
|
|
7
7
|
}
|