@react-spectrum/buttongroup 3.6.12-nightly.4555 → 3.6.12-nightly.4560

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.
@@ -0,0 +1,109 @@
1
+ require("./vars.5ab31a3b.css");
2
+ var $2e9803b3bbead7d0$exports = require("./buttongroup_vars_css.main.js");
3
+ var $6iGPs$reactspectrumutils = require("@react-spectrum/utils");
4
+ var $6iGPs$reactariautils = require("@react-aria/utils");
5
+ var $6iGPs$reactspectrumprovider = require("@react-spectrum/provider");
6
+ var $6iGPs$react = require("react");
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+
17
+ $parcel$export(module.exports, "ButtonGroup", () => $d384d3249418a107$export$69b1032f2ecdf404);
18
+ /*
19
+ * Copyright 2020 Adobe. All rights reserved.
20
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
21
+ * you may not use this file except in compliance with the License. You may obtain a copy
22
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software distributed under
25
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
26
+ * OF ANY KIND, either express or implied. See the License for the specific language
27
+ * governing permissions and limitations under the License.
28
+ */
29
+
30
+
31
+
32
+
33
+ function $d384d3249418a107$var$ButtonGroup(props, ref) {
34
+ let { scale: scale } = (0, $6iGPs$reactspectrumprovider.useProvider)();
35
+ props = (0, $6iGPs$reactspectrumprovider.useProviderProps)(props);
36
+ props = (0, $6iGPs$reactspectrumutils.useSlotProps)(props, "buttonGroup");
37
+ let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
38
+ let { styleProps: styleProps } = (0, $6iGPs$reactspectrumutils.useStyleProps)(otherProps);
39
+ let domRef = (0, $6iGPs$reactspectrumutils.useDOMRef)(ref);
40
+ let [hasOverflow, setHasOverflow] = (0, $6iGPs$reactariautils.useValueEffect)(false);
41
+ let checkForOverflow = (0, $6iGPs$react.useCallback)(()=>{
42
+ let computeHasOverflow = ()=>{
43
+ if (domRef.current && orientation === "horizontal") {
44
+ let buttonGroupChildren = Array.from(domRef.current.children);
45
+ let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
46
+ // If any buttons have negative X positions (align="end") or extend beyond
47
+ // the width of the button group (align="start"), then switch to vertical.
48
+ if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
49
+ return false;
50
+ }
51
+ };
52
+ if (orientation === "horizontal") setHasOverflow(function*() {
53
+ // Force to horizontal for measurement.
54
+ yield false;
55
+ // Measure, and update if there is overflow.
56
+ yield computeHasOverflow();
57
+ });
58
+ // eslint-disable-next-line react-hooks/exhaustive-deps
59
+ }, [
60
+ domRef,
61
+ orientation,
62
+ scale,
63
+ setHasOverflow,
64
+ children
65
+ ]);
66
+ // There are two main reasons we need to remeasure:
67
+ // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
68
+ (0, $6iGPs$reactariautils.useLayoutEffect)(()=>{
69
+ checkForOverflow();
70
+ }, [
71
+ checkForOverflow
72
+ ]);
73
+ // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
74
+ let parent = (0, $6iGPs$react.useRef)();
75
+ (0, $6iGPs$reactariautils.useLayoutEffect)(()=>{
76
+ if (domRef.current) parent.current = domRef.current.parentElement;
77
+ // eslint-disable-next-line react-hooks/exhaustive-deps
78
+ }, [
79
+ domRef.current
80
+ ]);
81
+ (0, $6iGPs$reactspectrumutils.useResizeObserver)({
82
+ ref: parent,
83
+ onResize: checkForOverflow
84
+ });
85
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($6iGPs$react))).createElement("div", {
86
+ ...(0, $6iGPs$reactariautils.filterDOMProps)(otherProps),
87
+ ...styleProps,
88
+ ref: domRef,
89
+ className: (0, $6iGPs$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2e9803b3bbead7d0$exports))), "spectrum-ButtonGroup", {
90
+ "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
91
+ "spectrum-ButtonGroup--alignEnd": align === "end",
92
+ "spectrum-ButtonGroup--alignCenter": align === "center"
93
+ }, styleProps.className)
94
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($6iGPs$react))).createElement((0, $6iGPs$reactspectrumutils.SlotProvider), {
95
+ slots: {
96
+ button: {
97
+ UNSAFE_className: (0, $6iGPs$reactspectrumutils.classNames)((0, ($parcel$interopDefault($2e9803b3bbead7d0$exports))), "spectrum-ButtonGroup-Button")
98
+ }
99
+ }
100
+ }, /*#__PURE__*/ (0, ($parcel$interopDefault($6iGPs$react))).createElement((0, $6iGPs$reactspectrumprovider.Provider), {
101
+ isDisabled: isDisabled
102
+ }, children)));
103
+ }
104
+ /**
105
+ * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
106
+ */ let $d384d3249418a107$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, ($parcel$interopDefault($6iGPs$react))).forwardRef($d384d3249418a107$var$ButtonGroup);
107
+
108
+
109
+ //# sourceMappingURL=ButtonGroup.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBD,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,wCAAU;IACxB,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,YACF,QAAQ,eACR,cAAc,0BACd,UAAU,SACV,QAAQ,SACR,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,oCAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,wBAAU,EAAE;QACjC,IAAI,qBAAqB;YACvB,IAAI,OAAO,OAAO,IAAI,gBAAgB,cAAc;gBAClD,IAAI,sBAAsB,MAAM,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ;gBAC5D,IAAI,OAAO,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,qCAAqC;gBAChF,0EAA0E;gBAC1E,0EAA0E;gBAC1E,IAAI,oBAAoB,IAAI,CAAC,CAAA,QAAS,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,MAAM,WAAW,GAAG,OACnG,OAAO;gBAET,OAAO;YACT;QACF;QACA,IAAI,gBAAgB,cAClB,eAAe;YACb,uCAAuC;YACvC,MAAM;YAEN,4CAA4C;YAC5C,MAAM;QACR;IAEJ,uDAAuD;IACvD,GAAG;QAAC;QAAQ;QAAa;QAAO;QAAgB;KAAS;IAEzD,mDAAmD;IACnD,8HAA8H;IAC9H,CAAA,GAAA,qCAAc,EAAE;QACd;IACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,mBAAK;IAClB,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,wBACA;YACE,kCAAkC,gBAAgB,cAAc;YAChE,kCAAkC,UAAU;YAC5C,qCAAqC,UAAU;QACjD,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,QAAQ;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;YACvC;QACF;qBACA,0DAAC,CAAA,GAAA,qCAAO;QAAE,YAAY;OACnB;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n classNames,\n SlotProvider,\n useDOMRef,\n useResizeObserver,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useRef} from 'react';\nimport {SpectrumButtonGroupProps} from '@react-types/buttongroup';\nimport styles from '@adobe/spectrum-css-temp/components/buttongroup/vars.css';\n\nfunction ButtonGroup(props: SpectrumButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n props = useProviderProps(props);\n props = useSlotProps(props, 'buttonGroup');\n\n let {\n children,\n orientation = 'horizontal',\n isDisabled,\n align = 'start',\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, scale, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement>();\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ButtonGroup',\n {\n 'spectrum-ButtonGroup--vertical': orientation === 'vertical' || hasOverflow,\n 'spectrum-ButtonGroup--alignEnd': align === 'end',\n 'spectrum-ButtonGroup--alignCenter': align === 'center'\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n button: {\n UNSAFE_className: classNames(styles, 'spectrum-ButtonGroup-Button')\n }\n }}>\n <Provider isDisabled={isDisabled}>\n {children}\n </Provider>\n </SlotProvider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nlet _ButtonGroup = React.forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n"],"names":[],"version":3,"file":"ButtonGroup.main.js.map"}
@@ -0,0 +1,104 @@
1
+ import "./vars.5ab31a3b.css";
2
+ import $i2wAT$buttongroup_vars_cssmodulejs from "./buttongroup_vars_css.mjs";
3
+ import {useSlotProps as $i2wAT$useSlotProps, useStyleProps as $i2wAT$useStyleProps, useDOMRef as $i2wAT$useDOMRef, useResizeObserver as $i2wAT$useResizeObserver, classNames as $i2wAT$classNames, SlotProvider as $i2wAT$SlotProvider} from "@react-spectrum/utils";
4
+ import {useValueEffect as $i2wAT$useValueEffect, useLayoutEffect as $i2wAT$useLayoutEffect, filterDOMProps as $i2wAT$filterDOMProps} from "@react-aria/utils";
5
+ import {useProvider as $i2wAT$useProvider, useProviderProps as $i2wAT$useProviderProps, Provider as $i2wAT$Provider} from "@react-spectrum/provider";
6
+ import $i2wAT$react, {useCallback as $i2wAT$useCallback, useRef as $i2wAT$useRef} from "react";
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+ /*
13
+ * Copyright 2020 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+
27
+ function $bd4bfa55854eb3bf$var$ButtonGroup(props, ref) {
28
+ let { scale: scale } = (0, $i2wAT$useProvider)();
29
+ props = (0, $i2wAT$useProviderProps)(props);
30
+ props = (0, $i2wAT$useSlotProps)(props, "buttonGroup");
31
+ let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
32
+ let { styleProps: styleProps } = (0, $i2wAT$useStyleProps)(otherProps);
33
+ let domRef = (0, $i2wAT$useDOMRef)(ref);
34
+ let [hasOverflow, setHasOverflow] = (0, $i2wAT$useValueEffect)(false);
35
+ let checkForOverflow = (0, $i2wAT$useCallback)(()=>{
36
+ let computeHasOverflow = ()=>{
37
+ if (domRef.current && orientation === "horizontal") {
38
+ let buttonGroupChildren = Array.from(domRef.current.children);
39
+ let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
40
+ // If any buttons have negative X positions (align="end") or extend beyond
41
+ // the width of the button group (align="start"), then switch to vertical.
42
+ if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
43
+ return false;
44
+ }
45
+ };
46
+ if (orientation === "horizontal") setHasOverflow(function*() {
47
+ // Force to horizontal for measurement.
48
+ yield false;
49
+ // Measure, and update if there is overflow.
50
+ yield computeHasOverflow();
51
+ });
52
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53
+ }, [
54
+ domRef,
55
+ orientation,
56
+ scale,
57
+ setHasOverflow,
58
+ children
59
+ ]);
60
+ // There are two main reasons we need to remeasure:
61
+ // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
62
+ (0, $i2wAT$useLayoutEffect)(()=>{
63
+ checkForOverflow();
64
+ }, [
65
+ checkForOverflow
66
+ ]);
67
+ // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
68
+ let parent = (0, $i2wAT$useRef)();
69
+ (0, $i2wAT$useLayoutEffect)(()=>{
70
+ if (domRef.current) parent.current = domRef.current.parentElement;
71
+ // eslint-disable-next-line react-hooks/exhaustive-deps
72
+ }, [
73
+ domRef.current
74
+ ]);
75
+ (0, $i2wAT$useResizeObserver)({
76
+ ref: parent,
77
+ onResize: checkForOverflow
78
+ });
79
+ return /*#__PURE__*/ (0, $i2wAT$react).createElement("div", {
80
+ ...(0, $i2wAT$filterDOMProps)(otherProps),
81
+ ...styleProps,
82
+ ref: domRef,
83
+ className: (0, $i2wAT$classNames)((0, ($parcel$interopDefault($i2wAT$buttongroup_vars_cssmodulejs))), "spectrum-ButtonGroup", {
84
+ "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
85
+ "spectrum-ButtonGroup--alignEnd": align === "end",
86
+ "spectrum-ButtonGroup--alignCenter": align === "center"
87
+ }, styleProps.className)
88
+ }, /*#__PURE__*/ (0, $i2wAT$react).createElement((0, $i2wAT$SlotProvider), {
89
+ slots: {
90
+ button: {
91
+ UNSAFE_className: (0, $i2wAT$classNames)((0, ($parcel$interopDefault($i2wAT$buttongroup_vars_cssmodulejs))), "spectrum-ButtonGroup-Button")
92
+ }
93
+ }
94
+ }, /*#__PURE__*/ (0, $i2wAT$react).createElement((0, $i2wAT$Provider), {
95
+ isDisabled: isDisabled
96
+ }, children)));
97
+ }
98
+ /**
99
+ * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
100
+ */ let $bd4bfa55854eb3bf$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $i2wAT$react).forwardRef($bd4bfa55854eb3bf$var$ButtonGroup);
101
+
102
+
103
+ export {$bd4bfa55854eb3bf$export$69b1032f2ecdf404 as ButtonGroup};
104
+ //# sourceMappingURL=ButtonGroup.mjs.map
@@ -0,0 +1,104 @@
1
+ import "./vars.5ab31a3b.css";
2
+ import $i2wAT$buttongroup_vars_cssmodulejs from "./buttongroup_vars_css.module.js";
3
+ import {useSlotProps as $i2wAT$useSlotProps, useStyleProps as $i2wAT$useStyleProps, useDOMRef as $i2wAT$useDOMRef, useResizeObserver as $i2wAT$useResizeObserver, classNames as $i2wAT$classNames, SlotProvider as $i2wAT$SlotProvider} from "@react-spectrum/utils";
4
+ import {useValueEffect as $i2wAT$useValueEffect, useLayoutEffect as $i2wAT$useLayoutEffect, filterDOMProps as $i2wAT$filterDOMProps} from "@react-aria/utils";
5
+ import {useProvider as $i2wAT$useProvider, useProviderProps as $i2wAT$useProviderProps, Provider as $i2wAT$Provider} from "@react-spectrum/provider";
6
+ import $i2wAT$react, {useCallback as $i2wAT$useCallback, useRef as $i2wAT$useRef} from "react";
7
+
8
+
9
+ function $parcel$interopDefault(a) {
10
+ return a && a.__esModule ? a.default : a;
11
+ }
12
+ /*
13
+ * Copyright 2020 Adobe. All rights reserved.
14
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
15
+ * you may not use this file except in compliance with the License. You may obtain a copy
16
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software distributed under
19
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
20
+ * OF ANY KIND, either express or implied. See the License for the specific language
21
+ * governing permissions and limitations under the License.
22
+ */
23
+
24
+
25
+
26
+
27
+ function $bd4bfa55854eb3bf$var$ButtonGroup(props, ref) {
28
+ let { scale: scale } = (0, $i2wAT$useProvider)();
29
+ props = (0, $i2wAT$useProviderProps)(props);
30
+ props = (0, $i2wAT$useSlotProps)(props, "buttonGroup");
31
+ let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
32
+ let { styleProps: styleProps } = (0, $i2wAT$useStyleProps)(otherProps);
33
+ let domRef = (0, $i2wAT$useDOMRef)(ref);
34
+ let [hasOverflow, setHasOverflow] = (0, $i2wAT$useValueEffect)(false);
35
+ let checkForOverflow = (0, $i2wAT$useCallback)(()=>{
36
+ let computeHasOverflow = ()=>{
37
+ if (domRef.current && orientation === "horizontal") {
38
+ let buttonGroupChildren = Array.from(domRef.current.children);
39
+ let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
40
+ // If any buttons have negative X positions (align="end") or extend beyond
41
+ // the width of the button group (align="start"), then switch to vertical.
42
+ if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
43
+ return false;
44
+ }
45
+ };
46
+ if (orientation === "horizontal") setHasOverflow(function*() {
47
+ // Force to horizontal for measurement.
48
+ yield false;
49
+ // Measure, and update if there is overflow.
50
+ yield computeHasOverflow();
51
+ });
52
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53
+ }, [
54
+ domRef,
55
+ orientation,
56
+ scale,
57
+ setHasOverflow,
58
+ children
59
+ ]);
60
+ // There are two main reasons we need to remeasure:
61
+ // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
62
+ (0, $i2wAT$useLayoutEffect)(()=>{
63
+ checkForOverflow();
64
+ }, [
65
+ checkForOverflow
66
+ ]);
67
+ // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
68
+ let parent = (0, $i2wAT$useRef)();
69
+ (0, $i2wAT$useLayoutEffect)(()=>{
70
+ if (domRef.current) parent.current = domRef.current.parentElement;
71
+ // eslint-disable-next-line react-hooks/exhaustive-deps
72
+ }, [
73
+ domRef.current
74
+ ]);
75
+ (0, $i2wAT$useResizeObserver)({
76
+ ref: parent,
77
+ onResize: checkForOverflow
78
+ });
79
+ return /*#__PURE__*/ (0, $i2wAT$react).createElement("div", {
80
+ ...(0, $i2wAT$filterDOMProps)(otherProps),
81
+ ...styleProps,
82
+ ref: domRef,
83
+ className: (0, $i2wAT$classNames)((0, ($parcel$interopDefault($i2wAT$buttongroup_vars_cssmodulejs))), "spectrum-ButtonGroup", {
84
+ "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
85
+ "spectrum-ButtonGroup--alignEnd": align === "end",
86
+ "spectrum-ButtonGroup--alignCenter": align === "center"
87
+ }, styleProps.className)
88
+ }, /*#__PURE__*/ (0, $i2wAT$react).createElement((0, $i2wAT$SlotProvider), {
89
+ slots: {
90
+ button: {
91
+ UNSAFE_className: (0, $i2wAT$classNames)((0, ($parcel$interopDefault($i2wAT$buttongroup_vars_cssmodulejs))), "spectrum-ButtonGroup-Button")
92
+ }
93
+ }
94
+ }, /*#__PURE__*/ (0, $i2wAT$react).createElement((0, $i2wAT$Provider), {
95
+ isDisabled: isDisabled
96
+ }, children)));
97
+ }
98
+ /**
99
+ * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
100
+ */ let $bd4bfa55854eb3bf$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $i2wAT$react).forwardRef($bd4bfa55854eb3bf$var$ButtonGroup);
101
+
102
+
103
+ export {$bd4bfa55854eb3bf$export$69b1032f2ecdf404 as ButtonGroup};
104
+ //# sourceMappingURL=ButtonGroup.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAiBD,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAE5B,IAAI,YACF,QAAQ,eACR,cAAc,0BACd,UAAU,SACV,QAAQ,SACR,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,kBAAU,EAAE;QACjC,IAAI,qBAAqB;YACvB,IAAI,OAAO,OAAO,IAAI,gBAAgB,cAAc;gBAClD,IAAI,sBAAsB,MAAM,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ;gBAC5D,IAAI,OAAO,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,qCAAqC;gBAChF,0EAA0E;gBAC1E,0EAA0E;gBAC1E,IAAI,oBAAoB,IAAI,CAAC,CAAA,QAAS,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,MAAM,WAAW,GAAG,OACnG,OAAO;gBAET,OAAO;YACT;QACF;QACA,IAAI,gBAAgB,cAClB,eAAe;YACb,uCAAuC;YACvC,MAAM;YAEN,4CAA4C;YAC5C,MAAM;QACR;IAEJ,uDAAuD;IACvD,GAAG;QAAC;QAAQ;QAAa;QAAO;QAAgB;KAAS;IAEzD,mDAAmD;IACnD,8HAA8H;IAC9H,CAAA,GAAA,sBAAc,EAAE;QACd;IACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,aAAK;IAClB,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,wBAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,6DAAK,GACL,wBACA;YACE,kCAAkC,gBAAgB,cAAc;YAChE,kCAAkC,UAAU;YAC5C,qCAAqC,UAAU;QACjD,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,QAAQ;gBACN,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,6DAAK,GAAG;YACvC;QACF;qBACA,gCAAC,CAAA,GAAA,eAAO;QAAE,YAAY;OACnB;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n classNames,\n SlotProvider,\n useDOMRef,\n useResizeObserver,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useRef} from 'react';\nimport {SpectrumButtonGroupProps} from '@react-types/buttongroup';\nimport styles from '@adobe/spectrum-css-temp/components/buttongroup/vars.css';\n\nfunction ButtonGroup(props: SpectrumButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n props = useProviderProps(props);\n props = useSlotProps(props, 'buttonGroup');\n\n let {\n children,\n orientation = 'horizontal',\n isDisabled,\n align = 'start',\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, scale, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement>();\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ButtonGroup',\n {\n 'spectrum-ButtonGroup--vertical': orientation === 'vertical' || hasOverflow,\n 'spectrum-ButtonGroup--alignEnd': align === 'end',\n 'spectrum-ButtonGroup--alignCenter': align === 'center'\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n button: {\n UNSAFE_className: classNames(styles, 'spectrum-ButtonGroup-Button')\n }\n }}>\n <Provider isDisabled={isDisabled}>\n {children}\n </Provider>\n </SlotProvider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nlet _ButtonGroup = React.forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n"],"names":[],"version":3,"file":"ButtonGroup.module.js.map"}
@@ -0,0 +1,23 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+
6
+ $parcel$export(module.exports, "spectrum-ButtonGroup", () => $2e9803b3bbead7d0$export$a92faf51352ac608, (v) => $2e9803b3bbead7d0$export$a92faf51352ac608 = v);
7
+ $parcel$export(module.exports, "spectrum-ButtonGroup--alignCenter", () => $2e9803b3bbead7d0$export$252bc7c4ae05757, (v) => $2e9803b3bbead7d0$export$252bc7c4ae05757 = v);
8
+ $parcel$export(module.exports, "spectrum-ButtonGroup--alignEnd", () => $2e9803b3bbead7d0$export$30e96c53d7beca11, (v) => $2e9803b3bbead7d0$export$30e96c53d7beca11 = v);
9
+ $parcel$export(module.exports, "spectrum-ButtonGroup--vertical", () => $2e9803b3bbead7d0$export$84d9c0e1917a4eaf, (v) => $2e9803b3bbead7d0$export$84d9c0e1917a4eaf = v);
10
+ $parcel$export(module.exports, "spectrum-ButtonGroup-Button", () => $2e9803b3bbead7d0$export$7184de2337c1927f, (v) => $2e9803b3bbead7d0$export$7184de2337c1927f = v);
11
+ var $2e9803b3bbead7d0$export$a92faf51352ac608;
12
+ var $2e9803b3bbead7d0$export$252bc7c4ae05757;
13
+ var $2e9803b3bbead7d0$export$30e96c53d7beca11;
14
+ var $2e9803b3bbead7d0$export$84d9c0e1917a4eaf;
15
+ var $2e9803b3bbead7d0$export$7184de2337c1927f;
16
+ $2e9803b3bbead7d0$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
17
+ $2e9803b3bbead7d0$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
18
+ $2e9803b3bbead7d0$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
19
+ $2e9803b3bbead7d0$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
20
+ $2e9803b3bbead7d0$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
21
+
22
+
23
+ //# sourceMappingURL=buttongroup_vars_css.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAJA,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,2CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAgD,CAAC,kCAAkC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"buttongroup_vars_css.main.js.map"}
@@ -0,0 +1,25 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+ var $fddc5368d2db28a6$exports = {};
6
+
7
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup", () => $fddc5368d2db28a6$export$a92faf51352ac608, (v) => $fddc5368d2db28a6$export$a92faf51352ac608 = v);
8
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignCenter", () => $fddc5368d2db28a6$export$252bc7c4ae05757, (v) => $fddc5368d2db28a6$export$252bc7c4ae05757 = v);
9
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignEnd", () => $fddc5368d2db28a6$export$30e96c53d7beca11, (v) => $fddc5368d2db28a6$export$30e96c53d7beca11 = v);
10
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--vertical", () => $fddc5368d2db28a6$export$84d9c0e1917a4eaf, (v) => $fddc5368d2db28a6$export$84d9c0e1917a4eaf = v);
11
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup-Button", () => $fddc5368d2db28a6$export$7184de2337c1927f, (v) => $fddc5368d2db28a6$export$7184de2337c1927f = v);
12
+ var $fddc5368d2db28a6$export$a92faf51352ac608;
13
+ var $fddc5368d2db28a6$export$252bc7c4ae05757;
14
+ var $fddc5368d2db28a6$export$30e96c53d7beca11;
15
+ var $fddc5368d2db28a6$export$84d9c0e1917a4eaf;
16
+ var $fddc5368d2db28a6$export$7184de2337c1927f;
17
+ $fddc5368d2db28a6$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
18
+ $fddc5368d2db28a6$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
19
+ $fddc5368d2db28a6$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
20
+ $fddc5368d2db28a6$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
21
+ $fddc5368d2db28a6$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
22
+
23
+
24
+ export {$fddc5368d2db28a6$exports as default};
25
+ //# sourceMappingURL=buttongroup_vars_css.mjs.map
@@ -0,0 +1,25 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+ var $fddc5368d2db28a6$exports = {};
6
+
7
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup", () => $fddc5368d2db28a6$export$a92faf51352ac608, (v) => $fddc5368d2db28a6$export$a92faf51352ac608 = v);
8
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignCenter", () => $fddc5368d2db28a6$export$252bc7c4ae05757, (v) => $fddc5368d2db28a6$export$252bc7c4ae05757 = v);
9
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignEnd", () => $fddc5368d2db28a6$export$30e96c53d7beca11, (v) => $fddc5368d2db28a6$export$30e96c53d7beca11 = v);
10
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--vertical", () => $fddc5368d2db28a6$export$84d9c0e1917a4eaf, (v) => $fddc5368d2db28a6$export$84d9c0e1917a4eaf = v);
11
+ $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup-Button", () => $fddc5368d2db28a6$export$7184de2337c1927f, (v) => $fddc5368d2db28a6$export$7184de2337c1927f = v);
12
+ var $fddc5368d2db28a6$export$a92faf51352ac608;
13
+ var $fddc5368d2db28a6$export$252bc7c4ae05757;
14
+ var $fddc5368d2db28a6$export$30e96c53d7beca11;
15
+ var $fddc5368d2db28a6$export$84d9c0e1917a4eaf;
16
+ var $fddc5368d2db28a6$export$7184de2337c1927f;
17
+ $fddc5368d2db28a6$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
18
+ $fddc5368d2db28a6$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
19
+ $fddc5368d2db28a6$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
20
+ $fddc5368d2db28a6$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
21
+ $fddc5368d2db28a6$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
22
+
23
+
24
+ export {$fddc5368d2db28a6$exports as default};
25
+ //# sourceMappingURL=buttongroup_vars_css.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAJA,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,2CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAgD,CAAC,kCAAkC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"buttongroup_vars_css.module.js.map"}
package/dist/import.mjs CHANGED
@@ -1,17 +1,5 @@
1
- import "./module.css";
2
- import {useSlotProps as $3Yfv0$useSlotProps, useStyleProps as $3Yfv0$useStyleProps, useDOMRef as $3Yfv0$useDOMRef, useResizeObserver as $3Yfv0$useResizeObserver, classNames as $3Yfv0$classNames, SlotProvider as $3Yfv0$SlotProvider} from "@react-spectrum/utils";
3
- import {useValueEffect as $3Yfv0$useValueEffect, useLayoutEffect as $3Yfv0$useLayoutEffect, filterDOMProps as $3Yfv0$filterDOMProps} from "@react-aria/utils";
4
- import {useProvider as $3Yfv0$useProvider, useProviderProps as $3Yfv0$useProviderProps, Provider as $3Yfv0$Provider} from "@react-spectrum/provider";
5
- import $3Yfv0$react, {useCallback as $3Yfv0$useCallback, useRef as $3Yfv0$useRef} from "react";
1
+ import {ButtonGroup as $bd4bfa55854eb3bf$export$69b1032f2ecdf404} from "./ButtonGroup.mjs";
6
2
 
7
-
8
- function $parcel$interopDefault(a) {
9
- return a && a.__esModule ? a.default : a;
10
- }
11
-
12
- function $parcel$export(e, n, v, s) {
13
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
- }
15
3
  /*
16
4
  * Copyright 2020 Adobe. All rights reserved.
17
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -23,114 +11,6 @@ function $parcel$export(e, n, v, s) {
23
11
  * OF ANY KIND, either express or implied. See the License for the specific language
24
12
  * governing permissions and limitations under the License.
25
13
  */ /// <reference types="css-module-types" />
26
- /*
27
- * Copyright 2020 Adobe. All rights reserved.
28
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License. You may obtain a copy
30
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software distributed under
33
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
- * OF ANY KIND, either express or implied. See the License for the specific language
35
- * governing permissions and limitations under the License.
36
- */
37
-
38
-
39
-
40
- var $fddc5368d2db28a6$exports = {};
41
-
42
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup", () => $fddc5368d2db28a6$export$a92faf51352ac608, (v) => $fddc5368d2db28a6$export$a92faf51352ac608 = v);
43
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignCenter", () => $fddc5368d2db28a6$export$252bc7c4ae05757, (v) => $fddc5368d2db28a6$export$252bc7c4ae05757 = v);
44
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignEnd", () => $fddc5368d2db28a6$export$30e96c53d7beca11, (v) => $fddc5368d2db28a6$export$30e96c53d7beca11 = v);
45
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--vertical", () => $fddc5368d2db28a6$export$84d9c0e1917a4eaf, (v) => $fddc5368d2db28a6$export$84d9c0e1917a4eaf = v);
46
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup-Button", () => $fddc5368d2db28a6$export$7184de2337c1927f, (v) => $fddc5368d2db28a6$export$7184de2337c1927f = v);
47
- var $fddc5368d2db28a6$export$a92faf51352ac608;
48
- var $fddc5368d2db28a6$export$252bc7c4ae05757;
49
- var $fddc5368d2db28a6$export$30e96c53d7beca11;
50
- var $fddc5368d2db28a6$export$84d9c0e1917a4eaf;
51
- var $fddc5368d2db28a6$export$7184de2337c1927f;
52
- $fddc5368d2db28a6$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
53
- $fddc5368d2db28a6$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
54
- $fddc5368d2db28a6$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
55
- $fddc5368d2db28a6$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
56
- $fddc5368d2db28a6$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
57
-
58
-
59
- function $bd4bfa55854eb3bf$var$ButtonGroup(props, ref) {
60
- let { scale: scale } = (0, $3Yfv0$useProvider)();
61
- props = (0, $3Yfv0$useProviderProps)(props);
62
- props = (0, $3Yfv0$useSlotProps)(props, "buttonGroup");
63
- let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
64
- let { styleProps: styleProps } = (0, $3Yfv0$useStyleProps)(otherProps);
65
- let domRef = (0, $3Yfv0$useDOMRef)(ref);
66
- let [hasOverflow, setHasOverflow] = (0, $3Yfv0$useValueEffect)(false);
67
- let checkForOverflow = (0, $3Yfv0$useCallback)(()=>{
68
- let computeHasOverflow = ()=>{
69
- if (domRef.current && orientation === "horizontal") {
70
- let buttonGroupChildren = Array.from(domRef.current.children);
71
- let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
72
- // If any buttons have negative X positions (align="end") or extend beyond
73
- // the width of the button group (align="start"), then switch to vertical.
74
- if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
75
- return false;
76
- }
77
- };
78
- if (orientation === "horizontal") setHasOverflow(function*() {
79
- // Force to horizontal for measurement.
80
- yield false;
81
- // Measure, and update if there is overflow.
82
- yield computeHasOverflow();
83
- });
84
- // eslint-disable-next-line react-hooks/exhaustive-deps
85
- }, [
86
- domRef,
87
- orientation,
88
- scale,
89
- setHasOverflow,
90
- children
91
- ]);
92
- // There are two main reasons we need to remeasure:
93
- // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
94
- (0, $3Yfv0$useLayoutEffect)(()=>{
95
- checkForOverflow();
96
- }, [
97
- checkForOverflow
98
- ]);
99
- // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
100
- let parent = (0, $3Yfv0$useRef)();
101
- (0, $3Yfv0$useLayoutEffect)(()=>{
102
- if (domRef.current) parent.current = domRef.current.parentElement;
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
- }, [
105
- domRef.current
106
- ]);
107
- (0, $3Yfv0$useResizeObserver)({
108
- ref: parent,
109
- onResize: checkForOverflow
110
- });
111
- return /*#__PURE__*/ (0, $3Yfv0$react).createElement("div", {
112
- ...(0, $3Yfv0$filterDOMProps)(otherProps),
113
- ...styleProps,
114
- ref: domRef,
115
- className: (0, $3Yfv0$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fddc5368d2db28a6$exports))), "spectrum-ButtonGroup", {
116
- "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
117
- "spectrum-ButtonGroup--alignEnd": align === "end",
118
- "spectrum-ButtonGroup--alignCenter": align === "center"
119
- }, styleProps.className)
120
- }, /*#__PURE__*/ (0, $3Yfv0$react).createElement((0, $3Yfv0$SlotProvider), {
121
- slots: {
122
- button: {
123
- UNSAFE_className: (0, $3Yfv0$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fddc5368d2db28a6$exports))), "spectrum-ButtonGroup-Button")
124
- }
125
- }
126
- }, /*#__PURE__*/ (0, $3Yfv0$react).createElement((0, $3Yfv0$Provider), {
127
- isDisabled: isDisabled
128
- }, children)));
129
- }
130
- /**
131
- * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
132
- */ let $bd4bfa55854eb3bf$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $3Yfv0$react).forwardRef($bd4bfa55854eb3bf$var$ButtonGroup);
133
-
134
14
 
135
15
 
136
16
 
package/dist/main.js CHANGED
@@ -1,19 +1,11 @@
1
- require("./main.css");
2
- var $fJaYF$reactspectrumutils = require("@react-spectrum/utils");
3
- var $fJaYF$reactariautils = require("@react-aria/utils");
4
- var $fJaYF$reactspectrumprovider = require("@react-spectrum/provider");
5
- var $fJaYF$react = require("react");
1
+ var $d384d3249418a107$exports = require("./ButtonGroup.main.js");
6
2
 
7
3
 
8
4
  function $parcel$export(e, n, v, s) {
9
5
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
10
6
  }
11
7
 
12
- function $parcel$interopDefault(a) {
13
- return a && a.__esModule ? a.default : a;
14
- }
15
-
16
- $parcel$export(module.exports, "ButtonGroup", () => $d384d3249418a107$export$69b1032f2ecdf404);
8
+ $parcel$export(module.exports, "ButtonGroup", () => $d384d3249418a107$exports.ButtonGroup);
17
9
  /*
18
10
  * Copyright 2020 Adobe. All rights reserved.
19
11
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -25,114 +17,6 @@ $parcel$export(module.exports, "ButtonGroup", () => $d384d3249418a107$export$69b
25
17
  * OF ANY KIND, either express or implied. See the License for the specific language
26
18
  * governing permissions and limitations under the License.
27
19
  */ /// <reference types="css-module-types" />
28
- /*
29
- * Copyright 2020 Adobe. All rights reserved.
30
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
31
- * you may not use this file except in compliance with the License. You may obtain a copy
32
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
33
- *
34
- * Unless required by applicable law or agreed to in writing, software distributed under
35
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
36
- * OF ANY KIND, either express or implied. See the License for the specific language
37
- * governing permissions and limitations under the License.
38
- */
39
-
40
-
41
-
42
- var $2e9803b3bbead7d0$exports = {};
43
-
44
- $parcel$export($2e9803b3bbead7d0$exports, "spectrum-ButtonGroup", () => $2e9803b3bbead7d0$export$a92faf51352ac608, (v) => $2e9803b3bbead7d0$export$a92faf51352ac608 = v);
45
- $parcel$export($2e9803b3bbead7d0$exports, "spectrum-ButtonGroup--alignCenter", () => $2e9803b3bbead7d0$export$252bc7c4ae05757, (v) => $2e9803b3bbead7d0$export$252bc7c4ae05757 = v);
46
- $parcel$export($2e9803b3bbead7d0$exports, "spectrum-ButtonGroup--alignEnd", () => $2e9803b3bbead7d0$export$30e96c53d7beca11, (v) => $2e9803b3bbead7d0$export$30e96c53d7beca11 = v);
47
- $parcel$export($2e9803b3bbead7d0$exports, "spectrum-ButtonGroup--vertical", () => $2e9803b3bbead7d0$export$84d9c0e1917a4eaf, (v) => $2e9803b3bbead7d0$export$84d9c0e1917a4eaf = v);
48
- $parcel$export($2e9803b3bbead7d0$exports, "spectrum-ButtonGroup-Button", () => $2e9803b3bbead7d0$export$7184de2337c1927f, (v) => $2e9803b3bbead7d0$export$7184de2337c1927f = v);
49
- var $2e9803b3bbead7d0$export$a92faf51352ac608;
50
- var $2e9803b3bbead7d0$export$252bc7c4ae05757;
51
- var $2e9803b3bbead7d0$export$30e96c53d7beca11;
52
- var $2e9803b3bbead7d0$export$84d9c0e1917a4eaf;
53
- var $2e9803b3bbead7d0$export$7184de2337c1927f;
54
- $2e9803b3bbead7d0$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
55
- $2e9803b3bbead7d0$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
56
- $2e9803b3bbead7d0$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
57
- $2e9803b3bbead7d0$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
58
- $2e9803b3bbead7d0$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
59
-
60
-
61
- function $d384d3249418a107$var$ButtonGroup(props, ref) {
62
- let { scale: scale } = (0, $fJaYF$reactspectrumprovider.useProvider)();
63
- props = (0, $fJaYF$reactspectrumprovider.useProviderProps)(props);
64
- props = (0, $fJaYF$reactspectrumutils.useSlotProps)(props, "buttonGroup");
65
- let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
66
- let { styleProps: styleProps } = (0, $fJaYF$reactspectrumutils.useStyleProps)(otherProps);
67
- let domRef = (0, $fJaYF$reactspectrumutils.useDOMRef)(ref);
68
- let [hasOverflow, setHasOverflow] = (0, $fJaYF$reactariautils.useValueEffect)(false);
69
- let checkForOverflow = (0, $fJaYF$react.useCallback)(()=>{
70
- let computeHasOverflow = ()=>{
71
- if (domRef.current && orientation === "horizontal") {
72
- let buttonGroupChildren = Array.from(domRef.current.children);
73
- let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
74
- // If any buttons have negative X positions (align="end") or extend beyond
75
- // the width of the button group (align="start"), then switch to vertical.
76
- if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
77
- return false;
78
- }
79
- };
80
- if (orientation === "horizontal") setHasOverflow(function*() {
81
- // Force to horizontal for measurement.
82
- yield false;
83
- // Measure, and update if there is overflow.
84
- yield computeHasOverflow();
85
- });
86
- // eslint-disable-next-line react-hooks/exhaustive-deps
87
- }, [
88
- domRef,
89
- orientation,
90
- scale,
91
- setHasOverflow,
92
- children
93
- ]);
94
- // There are two main reasons we need to remeasure:
95
- // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
96
- (0, $fJaYF$reactariautils.useLayoutEffect)(()=>{
97
- checkForOverflow();
98
- }, [
99
- checkForOverflow
100
- ]);
101
- // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
102
- let parent = (0, $fJaYF$react.useRef)();
103
- (0, $fJaYF$reactariautils.useLayoutEffect)(()=>{
104
- if (domRef.current) parent.current = domRef.current.parentElement;
105
- // eslint-disable-next-line react-hooks/exhaustive-deps
106
- }, [
107
- domRef.current
108
- ]);
109
- (0, $fJaYF$reactspectrumutils.useResizeObserver)({
110
- ref: parent,
111
- onResize: checkForOverflow
112
- });
113
- return /*#__PURE__*/ (0, ($parcel$interopDefault($fJaYF$react))).createElement("div", {
114
- ...(0, $fJaYF$reactariautils.filterDOMProps)(otherProps),
115
- ...styleProps,
116
- ref: domRef,
117
- className: (0, $fJaYF$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2e9803b3bbead7d0$exports))), "spectrum-ButtonGroup", {
118
- "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
119
- "spectrum-ButtonGroup--alignEnd": align === "end",
120
- "spectrum-ButtonGroup--alignCenter": align === "center"
121
- }, styleProps.className)
122
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($fJaYF$react))).createElement((0, $fJaYF$reactspectrumutils.SlotProvider), {
123
- slots: {
124
- button: {
125
- UNSAFE_className: (0, $fJaYF$reactspectrumutils.classNames)((0, (/*@__PURE__*/$parcel$interopDefault($2e9803b3bbead7d0$exports))), "spectrum-ButtonGroup-Button")
126
- }
127
- }
128
- }, /*#__PURE__*/ (0, ($parcel$interopDefault($fJaYF$react))).createElement((0, $fJaYF$reactspectrumprovider.Provider), {
129
- isDisabled: isDisabled
130
- }, children)));
131
- }
132
- /**
133
- * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
134
- */ let $d384d3249418a107$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, ($parcel$interopDefault($fJaYF$react))).forwardRef($d384d3249418a107$var$ButtonGroup);
135
-
136
20
 
137
21
 
138
22
 
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C;ACX1C;;;;;;;;;;CAUC;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAJA,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,2CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAgD,CAAC,kCAAkC,CAAC;;;ADuBpF,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,wCAAU;IACxB,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAE5B,IAAI,YACF,QAAQ,eACR,cAAc,0BACd,UAAU,SACV,QAAQ,SACR,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,oCAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,wBAAU,EAAE;QACjC,IAAI,qBAAqB;YACvB,IAAI,OAAO,OAAO,IAAI,gBAAgB,cAAc;gBAClD,IAAI,sBAAsB,MAAM,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ;gBAC5D,IAAI,OAAO,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,qCAAqC;gBAChF,0EAA0E;gBAC1E,0EAA0E;gBAC1E,IAAI,oBAAoB,IAAI,CAAC,CAAA,QAAS,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,MAAM,WAAW,GAAG,OACnG,OAAO;gBAET,OAAO;YACT;QACF;QACA,IAAI,gBAAgB,cAClB,eAAe;YACb,uCAAuC;YACvC,MAAM;YAEN,4CAA4C;YAC5C,MAAM;QACR;IAEJ,uDAAuD;IACvD,GAAG;QAAC;QAAQ;QAAa;QAAO;QAAgB;KAAS;IAEzD,mDAAmD;IACnD,8HAA8H;IAC9H,CAAA,GAAA,qCAAc,EAAE;QACd;IACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,mBAAK;IAClB,CAAA,GAAA,qCAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,2CAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,gEAAK,GACL,wBACA;YACE,kCAAkC,gBAAgB,cAAc;YAChE,kCAAkC,UAAU;YAC5C,qCAAqC,UAAU;QACjD,GACA,WAAW,SAAS;qBAGxB,0DAAC,CAAA,GAAA,sCAAW;QACV,OAAO;YACL,QAAQ;gBACN,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;YACvC;QACF;qBACA,0DAAC,CAAA,GAAA,qCAAO;QAAE,YAAY;OACnB;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/buttongroup/src/index.ts","packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx","packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n classNames,\n SlotProvider,\n useDOMRef,\n useResizeObserver,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useRef} from 'react';\nimport {SpectrumButtonGroupProps} from '@react-types/buttongroup';\nimport styles from '@adobe/spectrum-css-temp/components/buttongroup/vars.css';\n\nfunction ButtonGroup(props: SpectrumButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n props = useProviderProps(props);\n props = useSlotProps(props, 'buttonGroup');\n\n let {\n children,\n orientation = 'horizontal',\n isDisabled,\n align = 'start',\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, scale, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement>();\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ButtonGroup',\n {\n 'spectrum-ButtonGroup--vertical': orientation === 'vertical' || hasOverflow,\n 'spectrum-ButtonGroup--alignEnd': align === 'end',\n 'spectrum-ButtonGroup--alignCenter': align === 'center'\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n button: {\n UNSAFE_className: classNames(styles, 'spectrum-ButtonGroup-Button')\n }\n }}>\n <Provider isDisabled={isDisabled}>\n {children}\n </Provider>\n </SlotProvider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nlet _ButtonGroup = React.forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/buttongroup/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n"],"names":[],"version":3,"file":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,17 +1,5 @@
1
- import "./module.css";
2
- import {useSlotProps as $3Yfv0$useSlotProps, useStyleProps as $3Yfv0$useStyleProps, useDOMRef as $3Yfv0$useDOMRef, useResizeObserver as $3Yfv0$useResizeObserver, classNames as $3Yfv0$classNames, SlotProvider as $3Yfv0$SlotProvider} from "@react-spectrum/utils";
3
- import {useValueEffect as $3Yfv0$useValueEffect, useLayoutEffect as $3Yfv0$useLayoutEffect, filterDOMProps as $3Yfv0$filterDOMProps} from "@react-aria/utils";
4
- import {useProvider as $3Yfv0$useProvider, useProviderProps as $3Yfv0$useProviderProps, Provider as $3Yfv0$Provider} from "@react-spectrum/provider";
5
- import $3Yfv0$react, {useCallback as $3Yfv0$useCallback, useRef as $3Yfv0$useRef} from "react";
1
+ import {ButtonGroup as $bd4bfa55854eb3bf$export$69b1032f2ecdf404} from "./ButtonGroup.module.js";
6
2
 
7
-
8
- function $parcel$interopDefault(a) {
9
- return a && a.__esModule ? a.default : a;
10
- }
11
-
12
- function $parcel$export(e, n, v, s) {
13
- Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
14
- }
15
3
  /*
16
4
  * Copyright 2020 Adobe. All rights reserved.
17
5
  * This file is licensed to you under the Apache License, Version 2.0 (the "License");
@@ -23,114 +11,6 @@ function $parcel$export(e, n, v, s) {
23
11
  * OF ANY KIND, either express or implied. See the License for the specific language
24
12
  * governing permissions and limitations under the License.
25
13
  */ /// <reference types="css-module-types" />
26
- /*
27
- * Copyright 2020 Adobe. All rights reserved.
28
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
29
- * you may not use this file except in compliance with the License. You may obtain a copy
30
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing, software distributed under
33
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
34
- * OF ANY KIND, either express or implied. See the License for the specific language
35
- * governing permissions and limitations under the License.
36
- */
37
-
38
-
39
-
40
- var $fddc5368d2db28a6$exports = {};
41
-
42
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup", () => $fddc5368d2db28a6$export$a92faf51352ac608, (v) => $fddc5368d2db28a6$export$a92faf51352ac608 = v);
43
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignCenter", () => $fddc5368d2db28a6$export$252bc7c4ae05757, (v) => $fddc5368d2db28a6$export$252bc7c4ae05757 = v);
44
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--alignEnd", () => $fddc5368d2db28a6$export$30e96c53d7beca11, (v) => $fddc5368d2db28a6$export$30e96c53d7beca11 = v);
45
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup--vertical", () => $fddc5368d2db28a6$export$84d9c0e1917a4eaf, (v) => $fddc5368d2db28a6$export$84d9c0e1917a4eaf = v);
46
- $parcel$export($fddc5368d2db28a6$exports, "spectrum-ButtonGroup-Button", () => $fddc5368d2db28a6$export$7184de2337c1927f, (v) => $fddc5368d2db28a6$export$7184de2337c1927f = v);
47
- var $fddc5368d2db28a6$export$a92faf51352ac608;
48
- var $fddc5368d2db28a6$export$252bc7c4ae05757;
49
- var $fddc5368d2db28a6$export$30e96c53d7beca11;
50
- var $fddc5368d2db28a6$export$84d9c0e1917a4eaf;
51
- var $fddc5368d2db28a6$export$7184de2337c1927f;
52
- $fddc5368d2db28a6$export$a92faf51352ac608 = `aaz5ma_spectrum-ButtonGroup`;
53
- $fddc5368d2db28a6$export$252bc7c4ae05757 = `aaz5ma_spectrum-ButtonGroup--alignCenter`;
54
- $fddc5368d2db28a6$export$30e96c53d7beca11 = `aaz5ma_spectrum-ButtonGroup--alignEnd`;
55
- $fddc5368d2db28a6$export$84d9c0e1917a4eaf = `aaz5ma_spectrum-ButtonGroup--vertical`;
56
- $fddc5368d2db28a6$export$7184de2337c1927f = `aaz5ma_spectrum-ButtonGroup-Button`;
57
-
58
-
59
- function $bd4bfa55854eb3bf$var$ButtonGroup(props, ref) {
60
- let { scale: scale } = (0, $3Yfv0$useProvider)();
61
- props = (0, $3Yfv0$useProviderProps)(props);
62
- props = (0, $3Yfv0$useSlotProps)(props, "buttonGroup");
63
- let { children: children, orientation: orientation = "horizontal", isDisabled: isDisabled, align: align = "start", ...otherProps } = props;
64
- let { styleProps: styleProps } = (0, $3Yfv0$useStyleProps)(otherProps);
65
- let domRef = (0, $3Yfv0$useDOMRef)(ref);
66
- let [hasOverflow, setHasOverflow] = (0, $3Yfv0$useValueEffect)(false);
67
- let checkForOverflow = (0, $3Yfv0$useCallback)(()=>{
68
- let computeHasOverflow = ()=>{
69
- if (domRef.current && orientation === "horizontal") {
70
- let buttonGroupChildren = Array.from(domRef.current.children);
71
- let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors
72
- // If any buttons have negative X positions (align="end") or extend beyond
73
- // the width of the button group (align="start"), then switch to vertical.
74
- if (buttonGroupChildren.some((child)=>child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) return true;
75
- return false;
76
- }
77
- };
78
- if (orientation === "horizontal") setHasOverflow(function*() {
79
- // Force to horizontal for measurement.
80
- yield false;
81
- // Measure, and update if there is overflow.
82
- yield computeHasOverflow();
83
- });
84
- // eslint-disable-next-line react-hooks/exhaustive-deps
85
- }, [
86
- domRef,
87
- orientation,
88
- scale,
89
- setHasOverflow,
90
- children
91
- ]);
92
- // There are two main reasons we need to remeasure:
93
- // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
94
- (0, $3Yfv0$useLayoutEffect)(()=>{
95
- checkForOverflow();
96
- }, [
97
- checkForOverflow
98
- ]);
99
- // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure
100
- let parent = (0, $3Yfv0$useRef)();
101
- (0, $3Yfv0$useLayoutEffect)(()=>{
102
- if (domRef.current) parent.current = domRef.current.parentElement;
103
- // eslint-disable-next-line react-hooks/exhaustive-deps
104
- }, [
105
- domRef.current
106
- ]);
107
- (0, $3Yfv0$useResizeObserver)({
108
- ref: parent,
109
- onResize: checkForOverflow
110
- });
111
- return /*#__PURE__*/ (0, $3Yfv0$react).createElement("div", {
112
- ...(0, $3Yfv0$filterDOMProps)(otherProps),
113
- ...styleProps,
114
- ref: domRef,
115
- className: (0, $3Yfv0$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fddc5368d2db28a6$exports))), "spectrum-ButtonGroup", {
116
- "spectrum-ButtonGroup--vertical": orientation === "vertical" || hasOverflow,
117
- "spectrum-ButtonGroup--alignEnd": align === "end",
118
- "spectrum-ButtonGroup--alignCenter": align === "center"
119
- }, styleProps.className)
120
- }, /*#__PURE__*/ (0, $3Yfv0$react).createElement((0, $3Yfv0$SlotProvider), {
121
- slots: {
122
- button: {
123
- UNSAFE_className: (0, $3Yfv0$classNames)((0, (/*@__PURE__*/$parcel$interopDefault($fddc5368d2db28a6$exports))), "spectrum-ButtonGroup-Button")
124
- }
125
- }
126
- }, /*#__PURE__*/ (0, $3Yfv0$react).createElement((0, $3Yfv0$Provider), {
127
- isDisabled: isDisabled
128
- }, children)));
129
- }
130
- /**
131
- * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
132
- */ let $bd4bfa55854eb3bf$export$69b1032f2ecdf404 = /*#__PURE__*/ (0, $3Yfv0$react).forwardRef($bd4bfa55854eb3bf$var$ButtonGroup);
133
-
134
14
 
135
15
 
136
16
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C;ACX1C;;;;;;;;;;CAUC;;;;;;;;;;;ACVD,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAJA,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,2CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAgD,CAAC,kCAAkC,CAAC;;;ADuBpF,SAAS,kCAAY,KAA+B,EAAE,GAA2B;IAC/E,IAAI,SAAC,KAAK,EAAC,GAAG,CAAA,GAAA,kBAAU;IACxB,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAE5B,IAAI,YACF,QAAQ,eACR,cAAc,0BACd,UAAU,SACV,QAAQ,SACR,GAAG,YACJ,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,CAAC,aAAa,eAAe,GAAG,CAAA,GAAA,qBAAa,EAAE;IAEnD,IAAI,mBAAmB,CAAA,GAAA,kBAAU,EAAE;QACjC,IAAI,qBAAqB;YACvB,IAAI,OAAO,OAAO,IAAI,gBAAgB,cAAc;gBAClD,IAAI,sBAAsB,MAAM,IAAI,CAAC,OAAO,OAAO,CAAC,QAAQ;gBAC5D,IAAI,OAAO,OAAO,OAAO,CAAC,WAAW,GAAG,GAAG,qCAAqC;gBAChF,0EAA0E;gBAC1E,0EAA0E;gBAC1E,IAAI,oBAAoB,IAAI,CAAC,CAAA,QAAS,MAAM,UAAU,GAAG,KAAK,MAAM,UAAU,GAAG,MAAM,WAAW,GAAG,OACnG,OAAO;gBAET,OAAO;YACT;QACF;QACA,IAAI,gBAAgB,cAClB,eAAe;YACb,uCAAuC;YACvC,MAAM;YAEN,4CAA4C;YAC5C,MAAM;QACR;IAEJ,uDAAuD;IACvD,GAAG;QAAC;QAAQ;QAAa;QAAO;QAAgB;KAAS;IAEzD,mDAAmD;IACnD,8HAA8H;IAC9H,CAAA,GAAA,sBAAc,EAAE;QACd;IACF,GAAG;QAAC;KAAiB;IAErB,wKAAwK;IACxK,IAAI,SAAS,CAAA,GAAA,aAAK;IAClB,CAAA,GAAA,sBAAc,EAAE;QACd,IAAI,OAAO,OAAO,EAChB,OAAO,OAAO,GAAG,OAAO,OAAO,CAAC,aAAa;IAEjD,uDAAuD;IACvD,GAAG;QAAC,OAAO,OAAO;KAAC;IACnB,CAAA,GAAA,wBAAgB,EAAE;QAAC,KAAK;QAAQ,UAAU;IAAgB;IAE1D,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,WAAW;QAC7B,GAAG,UAAU;QACd,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,gEAAK,GACL,wBACA;YACE,kCAAkC,gBAAgB,cAAc;YAChE,kCAAkC,UAAU;YAC5C,qCAAqC,UAAU;QACjD,GACA,WAAW,SAAS;qBAGxB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,QAAQ;gBACN,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;YACvC;QACF;qBACA,gCAAC,CAAA,GAAA,eAAO;QAAE,YAAY;OACnB;AAKX;AAEA;;CAEC,GACD,IAAI,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC;","sources":["packages/@react-spectrum/buttongroup/src/index.ts","packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx","packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n classNames,\n SlotProvider,\n useDOMRef,\n useResizeObserver,\n useSlotProps,\n useStyleProps\n} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useRef} from 'react';\nimport {SpectrumButtonGroupProps} from '@react-types/buttongroup';\nimport styles from '@adobe/spectrum-css-temp/components/buttongroup/vars.css';\n\nfunction ButtonGroup(props: SpectrumButtonGroupProps, ref: DOMRef<HTMLDivElement>) {\n let {scale} = useProvider();\n props = useProviderProps(props);\n props = useSlotProps(props, 'buttonGroup');\n\n let {\n children,\n orientation = 'horizontal',\n isDisabled,\n align = 'start',\n ...otherProps\n } = props;\n\n let {styleProps} = useStyleProps(otherProps);\n let domRef = useDOMRef(ref);\n let [hasOverflow, setHasOverflow] = useValueEffect(false);\n\n let checkForOverflow = useCallback(() => {\n let computeHasOverflow = () => {\n if (domRef.current && orientation === 'horizontal') {\n let buttonGroupChildren = Array.from(domRef.current.children) as HTMLElement[];\n let maxX = domRef.current.offsetWidth + 1; // + 1 to account for rounding errors\n // If any buttons have negative X positions (align=\"end\") or extend beyond\n // the width of the button group (align=\"start\"), then switch to vertical.\n if (buttonGroupChildren.some(child => child.offsetLeft < 0 || child.offsetLeft + child.offsetWidth > maxX)) {\n return true;\n }\n return false;\n }\n };\n if (orientation === 'horizontal') {\n setHasOverflow(function* () {\n // Force to horizontal for measurement.\n yield false;\n\n // Measure, and update if there is overflow.\n yield computeHasOverflow();\n });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef, orientation, scale, setHasOverflow, children]);\n\n // There are two main reasons we need to remeasure:\n // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)\n useLayoutEffect(() => {\n checkForOverflow();\n }, [checkForOverflow]);\n\n // 2. External changes: buttongroup won't change size due to any parents changing size, so listen to its container for size changes to figure out if we should remeasure\n let parent = useRef<HTMLElement>();\n useLayoutEffect(() => {\n if (domRef.current) {\n parent.current = domRef.current.parentElement as HTMLElement;\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [domRef.current]);\n useResizeObserver({ref: parent, onResize: checkForOverflow});\n\n return (\n <div\n {...filterDOMProps(otherProps)}\n {...styleProps}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ButtonGroup',\n {\n 'spectrum-ButtonGroup--vertical': orientation === 'vertical' || hasOverflow,\n 'spectrum-ButtonGroup--alignEnd': align === 'end',\n 'spectrum-ButtonGroup--alignCenter': align === 'center'\n },\n styleProps.className\n )\n }>\n <SlotProvider\n slots={{\n button: {\n UNSAFE_className: classNames(styles, 'spectrum-ButtonGroup-Button')\n }\n }}>\n <Provider isDisabled={isDisabled}>\n {children}\n </Provider>\n </SlotProvider>\n </div>\n );\n}\n\n/**\n * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.\n */\nlet _ButtonGroup = React.forwardRef(ButtonGroup);\nexport {_ButtonGroup as ButtonGroup};\n","/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC,GACD,0CAA0C","sources":["packages/@react-spectrum/buttongroup/src/index.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n"],"names":[],"version":3,"file":"module.js.map"}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { SpectrumButtonGroupProps } from "@react-types/buttongroup";
3
+ import { DOMRefValue } from "@react-types/shared";
3
4
  /**
4
5
  * ButtonGroup handles overflow for a grouping of buttons whose actions are related to each other.
5
6
  */
6
- export let ButtonGroup: React.ForwardRefExoticComponent<SpectrumButtonGroupProps & React.RefAttributes<import("@react-types/shared").DOMRefValue<HTMLDivElement>>>;
7
+ export let ButtonGroup: React.ForwardRefExoticComponent<SpectrumButtonGroupProps & React.RefAttributes<DOMRefValue<HTMLDivElement>>>;
7
8
  export type { SpectrumButtonGroupProps } from '@react-types/buttongroup';
8
9
 
9
10
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"mappings":";;AAoHA;;GAEG;AACH,OAAA,IAAI,uJAA4C,CAAC;AC1GjD,YAAY,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC","sources":["packages/@react-spectrum/buttongroup/src/packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx","packages/@react-spectrum/buttongroup/src/packages/@react-spectrum/buttongroup/src/index.ts","packages/@react-spectrum/buttongroup/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;AAoHA;;GAEG;AACH,OAAA,IAAI,yHAA4C,CAAC;AC1GjD,YAAY,EAAC,wBAAwB,EAAC,MAAM,0BAA0B,CAAC","sources":["packages/@react-spectrum/buttongroup/src/packages/@react-spectrum/buttongroup/src/ButtonGroup.tsx","packages/@react-spectrum/buttongroup/src/packages/@react-spectrum/buttongroup/src/index.ts","packages/@react-spectrum/buttongroup/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n/// <reference types=\"css-module-types\" />\nexport {ButtonGroup} from './ButtonGroup';\nexport type {SpectrumButtonGroupProps} from '@react-types/buttongroup';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -37,4 +37,4 @@
37
37
  .aaz5ma_spectrum-ButtonGroup--vertical.aaz5ma_spectrum-ButtonGroup--alignCenter {
38
38
  align-items: center;
39
39
  }
40
- /*# sourceMappingURL=main.css.map */
40
+ /*# sourceMappingURL=vars.5ab31a3b.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAwBA;;;;;;AAME;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;AAIE;;;;;AAKA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"main.css.map"}
1
+ {"mappings":"AAwBA;;;;;;AAME;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;AAIE;;;;;AAKA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"vars.5ab31a3b.css.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/buttongroup",
3
- "version": "3.6.12-nightly.4555+81162ea39",
3
+ "version": "3.6.12-nightly.4560+72775d272",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -36,15 +36,15 @@
36
36
  "url": "https://github.com/adobe/react-spectrum"
37
37
  },
38
38
  "dependencies": {
39
- "@react-aria/utils": "3.0.0-nightly.2843+81162ea39",
40
- "@react-spectrum/utils": "3.0.0-nightly.2843+81162ea39",
41
- "@react-types/buttongroup": "3.3.8-nightly.4555+81162ea39",
42
- "@react-types/shared": "3.0.0-nightly.2843+81162ea39",
39
+ "@react-aria/utils": "3.0.0-nightly.2848+72775d272",
40
+ "@react-spectrum/utils": "3.0.0-nightly.2848+72775d272",
41
+ "@react-types/buttongroup": "3.3.8-nightly.4560+72775d272",
42
+ "@react-types/shared": "3.0.0-nightly.2848+72775d272",
43
43
  "@swc/helpers": "^0.5.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@adobe/spectrum-css-temp": "3.0.0-nightly.2843+81162ea39",
47
- "@spectrum-icons/workflow": "3.0.0-nightly.2843+81162ea39"
46
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2848+72775d272",
47
+ "@spectrum-icons/workflow": "3.0.0-nightly.2848+72775d272"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@react-spectrum/provider": "^3.0.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "81162ea392926d06ec3d25c228e6f9b6b5479d59"
56
+ "gitHead": "72775d272be04cfa32d26ec821bc68513d92a72b"
57
57
  }
package/dist/module.css DELETED
@@ -1,40 +0,0 @@
1
- .aaz5ma_spectrum-ButtonGroup {
2
- align-items: flex-start;
3
- display: inline-flex;
4
- position: relative;
5
- }
6
-
7
- .aaz5ma_spectrum-ButtonGroup .aaz5ma_spectrum-ButtonGroup-Button {
8
- flex-shrink: 0;
9
- }
10
-
11
- .aaz5ma_spectrum-ButtonGroup .aaz5ma_spectrum-ButtonGroup-Button + .aaz5ma_spectrum-ButtonGroup-Button {
12
- margin-inline-start: var(--spectrum-buttongroup-button-gap-x, var(--spectrum-global-dimension-static-size-200));
13
- }
14
-
15
- .aaz5ma_spectrum-ButtonGroup.aaz5ma_spectrum-ButtonGroup--alignEnd {
16
- justify-content: flex-end;
17
- }
18
-
19
- .aaz5ma_spectrum-ButtonGroup.aaz5ma_spectrum-ButtonGroup--alignCenter {
20
- justify-content: center;
21
- }
22
-
23
- .aaz5ma_spectrum-ButtonGroup--vertical {
24
- flex-direction: column;
25
- display: inline-flex;
26
- }
27
-
28
- .aaz5ma_spectrum-ButtonGroup--vertical .aaz5ma_spectrum-ButtonGroup-Button + .aaz5ma_spectrum-ButtonGroup-Button {
29
- margin-block-start: var(--spectrum-buttongroup-button-gap-y, var(--spectrum-global-dimension-static-size-200));
30
- margin-inline-start: 0;
31
- }
32
-
33
- .aaz5ma_spectrum-ButtonGroup--vertical.aaz5ma_spectrum-ButtonGroup--alignEnd {
34
- align-items: flex-end;
35
- }
36
-
37
- .aaz5ma_spectrum-ButtonGroup--vertical.aaz5ma_spectrum-ButtonGroup--alignCenter {
38
- align-items: center;
39
- }
40
- /*# sourceMappingURL=module.css.map */
@@ -1 +0,0 @@
1
- {"mappings":"AAwBA;;;;;;AAME;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;AAIE;;;;;AAKA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/buttongroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n"],"names":[],"version":3,"file":"module.css.map"}