@spectrum-web-components/button-group 0.0.0-20241209155954

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/README.md ADDED
@@ -0,0 +1,45 @@
1
+ ## Description
2
+
3
+ `sp-button-group` delivers a set of buttons in horizontal or vertical orientation while ensuring the appropriate spacing between those buttons.
4
+
5
+ ### Usage
6
+
7
+ [![See it on NPM!](https://img.shields.io/npm/v/@spectrum-web-components/button-group?style=for-the-badge)](https://www.npmjs.com/package/@spectrum-web-components/button-group)
8
+ [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/@spectrum-web-components/button-group?style=for-the-badge)](https://bundlephobia.com/result?p=@spectrum-web-components/button-group)
9
+ [![Try it on webcomponents.dev](https://img.shields.io/badge/Try%20it%20on-webcomponents.dev-green?style=for-the-badge)](https://webcomponents.dev/edit/collection/fO75441E1Q5ZlI0e9pgq/Zjc3o94DWuBkT4ve3dny/src/index.ts)
10
+
11
+ ```
12
+ yarn add @spectrum-web-components/button-group
13
+ ```
14
+
15
+ Import the side effectful registration of `<sp-button-group>` via:
16
+
17
+ ```
18
+ import '@spectrum-web-components/button-group/sp-button-group.js';
19
+ ```
20
+
21
+ When looking to leverage the `ButtonGroup` base class as a type and/or for extension purposes, do so via:
22
+
23
+ ```
24
+ import { ButtonGroup } from '@spectrum-web-components/button-group';
25
+ ```
26
+
27
+ ## Horizontal
28
+
29
+ ```html
30
+ <sp-button-group>
31
+ <sp-button>Button 1</sp-button>
32
+ <sp-button>Longer Button 2</sp-button>
33
+ <sp-button>Short 3</sp-button>
34
+ </sp-button-group>
35
+ ```
36
+
37
+ ## Vertical
38
+
39
+ ```html
40
+ <sp-button-group vertical>
41
+ <sp-button>Button 1</sp-button>
42
+ <sp-button>Longer Button 2</sp-button>
43
+ <sp-button>Short 3</sp-button>
44
+ </sp-button-group>
45
+ ```
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@spectrum-web-components/button-group",
3
+ "version": "0.0.0-20241209155954",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "description": "",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/adobe/spectrum-web-components.git",
12
+ "directory": "packages/button-group"
13
+ },
14
+ "author": "",
15
+ "homepage": "https://opensource.adobe.com/spectrum-web-components/components/button-group",
16
+ "bugs": {
17
+ "url": "https://github.com/adobe/spectrum-web-components/issues"
18
+ },
19
+ "main": "./src/index.js",
20
+ "module": "./src/index.js",
21
+ "type": "module",
22
+ "exports": {
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
27
+ "./package.json": "./package.json",
28
+ "./src/ButtonGroup.js": {
29
+ "development": "./src/ButtonGroup.dev.js",
30
+ "default": "./src/ButtonGroup.js"
31
+ },
32
+ "./src/button-group-overrides.css.js": "./src/button-group-overrides.css.js",
33
+ "./src/button-group.css.js": "./src/button-group.css.js",
34
+ "./src/index.js": {
35
+ "development": "./src/index.dev.js",
36
+ "default": "./src/index.js"
37
+ },
38
+ "./sp-button-group.js": {
39
+ "development": "./sp-button-group.dev.js",
40
+ "default": "./sp-button-group.js"
41
+ }
42
+ },
43
+ "scripts": {
44
+ "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
45
+ },
46
+ "files": [
47
+ "**/*.d.ts",
48
+ "**/*.js",
49
+ "**/*.js.map",
50
+ "custom-elements.json",
51
+ "!stories/",
52
+ "!test/"
53
+ ],
54
+ "keywords": [
55
+ "spectrum css",
56
+ "web components",
57
+ "lit-element",
58
+ "lit-html"
59
+ ],
60
+ "dependencies": {
61
+ "@spectrum-web-components/base": "0.0.0-20241209155954",
62
+ "@spectrum-web-components/button": "0.0.0-20241209155954"
63
+ },
64
+ "devDependencies": {
65
+ "@spectrum-css/buttongroup": "^8.0.0-s2-foundations.15"
66
+ },
67
+ "types": "./src/index.d.ts",
68
+ "customElements": "custom-elements.json",
69
+ "sideEffects": [
70
+ "./sp-*.js",
71
+ "./**/*.dev.js"
72
+ ]
73
+ }
@@ -0,0 +1,6 @@
1
+ import { ButtonGroup } from './src/ButtonGroup.js';
2
+ declare global {
3
+ interface HTMLElementTagNameMap {
4
+ 'sp-button-group': ButtonGroup;
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { ButtonGroup } from "./src/ButtonGroup.dev.js";
3
+ import { defineElement } from "@spectrum-web-components/base/src/define-element.js";
4
+ defineElement("sp-button-group", ButtonGroup);
5
+ //# sourceMappingURL=sp-button-group.dev.js.map
@@ -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,2 @@
1
+ "use strict";import{ButtonGroup as o}from"./src/ButtonGroup.js";import{defineElement as t}from"@spectrum-web-components/base/src/define-element.js";t("sp-button-group",o);
2
+ //# sourceMappingURL=sp-button-group.js.map
@@ -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,18 @@
1
+ import { CSSResultArray, 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
+ protected handleSlotchange({ target: slot, }: Event & {
14
+ target: HTMLSlotElement;
15
+ }): void;
16
+ protected render(): TemplateResult;
17
+ }
18
+ export {};
@@ -0,0 +1,46 @@
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 { property } from "@spectrum-web-components/base/src/decorators.js";
18
+ import styles from "./button-group.css.js";
19
+ export class ButtonGroup extends SizedMixin(SpectrumElement, {
20
+ noDefaultSize: true
21
+ }) {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.vertical = false;
25
+ }
26
+ static get styles() {
27
+ return [styles];
28
+ }
29
+ handleSlotchange({
30
+ target: slot
31
+ }) {
32
+ const assignedElements = slot.assignedElements();
33
+ assignedElements.forEach((button) => {
34
+ button.size = this.size;
35
+ });
36
+ }
37
+ render() {
38
+ return html`
39
+ <slot @slotchange=${this.handleSlotchange}></slot>
40
+ `;
41
+ }
42
+ }
43
+ __decorateClass([
44
+ property({ type: Boolean, reflect: true })
45
+ ], ButtonGroup.prototype, "vertical", 2);
46
+ //# 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 SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } 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 protected handleSlotchange({\n target: slot,\n }: Event & { target: 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,EACA;AAAA,EACA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAGzB,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,EAKU,iBAAiB;AAAA,IACvB,QAAQ;AAAA,EACZ,GAA8C;AAC1C,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;AAhBW;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAPjC,YAQF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var a=(o,t,r,s)=>{for(var e=s>1?void 0:s?m(t,r):t,l=o.length-1,n;l>=0;l--)(n=o[l])&&(e=(s?n(t,r,e):n(e))||e);return s&&e&&i(t,r,e),e};import{html as p,SizedMixin as c,SpectrumElement as u}from"@spectrum-web-components/base";import{property as d}from"@spectrum-web-components/base/src/decorators.js";import S from"./button-group.css.js";export class ButtonGroup extends c(u,{noDefaultSize:!0}){constructor(){super(...arguments);this.vertical=!1}static get styles(){return[S]}handleSlotchange({target:r}){r.assignedElements().forEach(e=>{e.size=this.size})}render(){return p`
2
+ <slot @slotchange=${this.handleSlotchange}></slot>
3
+ `}}a([d({type:Boolean,reflect:!0})],ButtonGroup.prototype,"vertical",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 SizedMixin,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } 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 protected handleSlotchange({\n target: slot,\n }: Event & { target: 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,EACA,cAAAC,EACA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAGzB,OAAOC,MAAY,wBAMZ,aAAM,oBAAoBH,EAAWC,EAAiB,CACzD,cAAe,EACnB,CAAC,CAAE,CAFI,kCAQH,KAAO,SAAW,GALlB,WAA2B,QAAyB,CAChD,MAAO,CAACE,CAAM,CAClB,CAKU,iBAAiB,CACvB,OAAQC,CACZ,EAA8C,CACjBA,EAAK,iBAAiB,EAC9B,QAASC,GAAW,CACjCA,EAAO,KAAO,KAAK,IACvB,CAAC,CACL,CAEmB,QAAyB,CACxC,OAAON;AAAA,gCACiB,KAAK,gBAAgB;AAAA,SAEjD,CACJ,CAhBWO,EAAA,CADNJ,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPjC,YAQF",
6
+ "names": ["html", "SizedMixin", "SpectrumElement", "property", "styles", "slot", "button", "__decorateClass"]
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -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 2024 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 2024 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,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -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 2024 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 2024 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';
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ export * from "./ButtonGroup.dev.js";
3
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './ButtonGroup.dev.js'\n"],
5
+ "mappings": ";AAYA,cAAc;",
6
+ "names": []
7
+ }
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";export*from"./ButtonGroup.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nexport * from './ButtonGroup.js';\n"],
5
+ "mappings": "aAYA,WAAc",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ declare const styles: import("@spectrum-web-components/base").CSSResult;
2
+ export default styles;
@@ -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 2024 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 2024 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,46 @@
1
+ // @ts-check
2
+ /*
3
+ Copyright 2023 Adobe. All rights reserved.
4
+ This file is licensed to you under the Apache License, Version 2.0 (the 'License');
5
+ you may not use this file except in compliance with the License. You may obtain a copy
6
+ of the License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ Unless required by applicable law or agreed to in writing, software distributed under
9
+ the License is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
10
+ OF ANY KIND, either express or implied. See the License for the specific language
11
+ governing permissions and limitations under the License.
12
+ */
13
+
14
+ import { converterFor } from '../../../tasks/process-spectrum-utils.js';
15
+
16
+ const converter = converterFor('spectrum-ButtonGroup');
17
+
18
+ /**
19
+ * @type { import('../../../tasks/spectrum-css-converter').SpectrumCSSConverter }
20
+ */
21
+ const config = {
22
+ conversions: [
23
+ {
24
+ inPackage: '@spectrum-css/buttongroup',
25
+ outPackage: 'button-group',
26
+ fileName: 'button-group',
27
+ components: [
28
+ converter.classToHost(),
29
+ converter.classToAttribute('spectrum-ButtonGroup--vertical'),
30
+ // Default to `size='m'` without needing the attribute
31
+ converter.classToHost('spectrum-ButtonGroup--sizeM'),
32
+ ...converter.enumerateAttributes(
33
+ [
34
+ ['spectrum-ButtonGroup--sizeS', 's'],
35
+ ['spectrum-ButtonGroup--sizeL', 'l'],
36
+ ['spectrum-ButtonGroup--sizeXL', 'xl'],
37
+ ],
38
+ 'size'
39
+ ),
40
+ converter.classToSlotted('spectrum-ButtonGroup-item'),
41
+ ],
42
+ },
43
+ ],
44
+ };
45
+
46
+ export default config;