@react-spectrum/buttongroup 3.2.9-nightly.3271 → 3.3.0

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/dist/main.js CHANGED
@@ -87,14 +87,14 @@ function $d384d3249418a107$var$ButtonGroup(props, ref) {
87
87
  ]);
88
88
  // There are two main reasons we need to remeasure:
89
89
  // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
90
- $fJaYF$react.useEffect(()=>{
90
+ $fJaYF$reactariautils.useLayoutEffect(()=>{
91
91
  checkForOverflow();
92
92
  }, [
93
93
  checkForOverflow
94
94
  ]);
95
95
  // 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
96
96
  let parent = $fJaYF$react.useRef();
97
- $fJaYF$react.useEffect(()=>{
97
+ $fJaYF$reactariautils.useLayoutEffect(()=>{
98
98
  parent.current = domRef.current.parentElement;
99
99
  }, [
100
100
  domRef.current
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAsC;AACtC,GAA6C;AAC7C,GAAgD;AAChD,GAAmD;AACnD,GAAgD;AAJhD,yCAAsC,GAAG,CAA6B;AACtE,yCAA6C,GAAG,CAAoC;AACpF,yCAAgD,GAAG,CAAuC;AAC1F,wCAAmD,GAAG,CAA0C;AAChG,yCAAgD,GAAG,CAAuC;;;SDuBjF,iCAAW,CAAC,KAA+B,EAAE,GAA2B,EAAE,CAAC;IAClF,GAAG,CAAC,CAAC,QAAA,KAAK,EAAA,CAAC,GAAG,wCAAW;IACzB,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAC9B,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAa;IAEzC,GAAG,CAAC,CAAC,WACH,QAAQ,gBACR,WAAW,GAAG,CAAY,0BAC1B,UAAU,UACV,KAAK,GAAG,CAAO,YACZ,UAA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IAClB,CAAC,EAAE,CAAC;QAAA,gBAAgB;IAAA,CAAC;IAErB,EAAwK,AAAxK,sKAAwK;IACxK,GAAG,CAAC,MAAM,GAAG,mBAAM;IACnB,sBAAS,KAAO,CAAC;QACf,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa;IAC/C,CAAC,EAAE,CAAC;QAAA,MAAM,CAAC,OAAO;IAAA,CAAC;IACnB,2CAAiB,CAAC,CAAC;QAAA,GAAG,EAAE,MAAM;QAAE,QAAQ,EAAE,gBAAgB;IAAA,CAAC;IAE3D,MAAM,oEACH,CAAG;WACE,oCAAc,CAAC,UAAU;WACzB,UAAU;QACd,GAAG,EAAE,MAAM;QACX,SAAS,EACP,oCAAU,CACR,gEAAM,EACN,CAAsB,uBACtB,CAAC;YACC,CAAgC,iCAAE,WAAW,KAAK,CAAU,aAAI,WAAW;YAC3E,CAAgC,iCAAE,KAAK,KAAK,CAAK;YACjD,CAAmC,oCAAE,KAAK,KAAK,CAAQ;QACzD,CAAC,EACD,UAAU,CAAC,SAAS;0EAGvB,sCAAY;QACX,KAAK,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;gBACP,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAA6B;YACpE,CAAC;QACH,CAAC;0EACA,qCAAQ;QAAC,UAAU,EAAE,UAAU;OAC7B,QAAQ;AAKnB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,sCAAK,CAAC,UAAU,CAAC,iCAAW","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './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, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useEffect, 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 }, [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 useEffect(() => {\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 useEffect(() => {\n parent.current = domRef.current.parentElement;\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAsC;AACtC,GAA6C;AAC7C,GAAgD;AAChD,GAAmD;AACnD,GAAgD;AAJhD,yCAAsC,GAAG,CAA6B;AACtE,yCAA6C,GAAG,CAAoC;AACpF,yCAAgD,GAAG,CAAuC;AAC1F,wCAAmD,GAAG,CAA0C;AAChG,yCAAgD,GAAG,CAAuC;;;SDuBjF,iCAAW,CAAC,KAA+B,EAAE,GAA2B,EAAE,CAAC;IAClF,GAAG,CAAC,CAAC,QAAA,KAAK,EAAA,CAAC,GAAG,wCAAW;IACzB,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAC9B,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAa;IAEzC,GAAG,CAAC,CAAC,WACH,QAAQ,gBACR,WAAW,GAAG,CAAY,0BAC1B,UAAU,UACV,KAAK,GAAG,CAAO,YACZ,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,uCAAa,CAAC,UAAU;IAC3C,GAAG,CAAC,MAAM,GAAG,mCAAS,CAAC,GAAG;IAC1B,GAAG,EAAE,WAAW,EAAE,cAAc,IAAI,oCAAc,CAAC,KAAK;IAExD,GAAG,CAAC,gBAAgB,GAAG,wBAAW,KAAO,CAAC;QACxC,GAAG,CAAC,kBAAkB,OAAS,CAAC;YAC9B,EAAE,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW,KAAK,CAAY,aAAE,CAAC;gBACnD,GAAG,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ;gBAC5D,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,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AAW,KAAK,CAAU,aAAI,WAAW;YAC3E,CAAgC,iCAAE,KAAK,KAAK,CAAK;YACjD,CAAmC,oCAAE,KAAK,KAAK,CAAQ;QACzD,CAAC,EACD,UAAU,CAAC,SAAS;0EAGvB,sCAAY;QACX,KAAK,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;gBACP,gBAAgB,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAA6B;YACpE,CAAC;QACH,CAAC;0EACA,qCAAQ;QAAC,UAAU,EAAE,UAAU;OAC7B,QAAQ;AAKnB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,sCAAK,CAAC,UAAU,CAAC,iCAAW","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './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 }, [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 parent.current = domRef.current.parentElement;\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"}
package/dist/module.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import "./main.css";
2
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, filterDOMProps as $3Yfv0$filterDOMProps} from "@react-aria/utils";
3
+ import {useValueEffect as $3Yfv0$useValueEffect, useLayoutEffect as $3Yfv0$useLayoutEffect, filterDOMProps as $3Yfv0$filterDOMProps} from "@react-aria/utils";
4
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, useEffect as $3Yfv0$useEffect, useRef as $3Yfv0$useRef} from "react";
5
+ import $3Yfv0$react, {useCallback as $3Yfv0$useCallback, useRef as $3Yfv0$useRef} from "react";
6
6
 
7
7
  function $parcel$interopDefault(a) {
8
8
  return a && a.__esModule ? a.default : a;
@@ -71,14 +71,14 @@ function $bd4bfa55854eb3bf$var$ButtonGroup(props, ref) {
71
71
  ]);
72
72
  // There are two main reasons we need to remeasure:
73
73
  // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
74
- $3Yfv0$useEffect(()=>{
74
+ $3Yfv0$useLayoutEffect(()=>{
75
75
  checkForOverflow();
76
76
  }, [
77
77
  checkForOverflow
78
78
  ]);
79
79
  // 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
80
80
  let parent = $3Yfv0$useRef();
81
- $3Yfv0$useEffect(()=>{
81
+ $3Yfv0$useLayoutEffect(()=>{
82
82
  parent.current = domRef.current.parentElement;
83
83
  }, [
84
84
  domRef.current
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAsC;AACtC,GAA6C;AAC7C,GAAgD;AAChD,GAAmD;AACnD,GAAgD;AAJhD,yCAAsC,GAAG,CAA6B;AACtE,yCAA6C,GAAG,CAAoC;AACpF,yCAAgD,GAAG,CAAuC;AAC1F,wCAAmD,GAAG,CAA0C;AAChG,yCAAgD,GAAG,CAAuC;;;SDuBjF,iCAAW,CAAC,KAA+B,EAAE,GAA2B,EAAE,CAAC;IAClF,GAAG,CAAC,CAAC,QAAA,KAAK,EAAA,CAAC,GAAG,kBAAW;IACzB,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAC9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WAAW;QAAE,KAAK;QAAE,cAAc;QAAE,QAAQ;IAAA,CAAC;IAEzD,EAAmD,AAAnD,iDAAmD;IACnD,EAA8H,AAA9H,4HAA8H;IAC9H,gBAAS,KAAO,CAAC;QACf,gBAAgB;IAClB,CAAC,EAAE,CAAC;QAAA,gBAAgB;IAAA,CAAC;IAErB,EAAwK,AAAxK,sKAAwK;IACxK,GAAG,CAAC,MAAM,GAAG,aAAM;IACnB,gBAAS,KAAO,CAAC;QACf,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa;IAC/C,CAAC,EAAE,CAAC;QAAA,MAAM,CAAC,OAAO;IAAA,CAAC;IACnB,wBAAiB,CAAC,CAAC;QAAA,GAAG,EAAE,MAAM;QAAE,QAAQ,EAAE,gBAAgB;IAAA,CAAC;IAE3D,MAAM,0CACH,CAAG;WACE,qBAAc,CAAC,UAAU;WACzB,UAAU;QACd,GAAG,EAAE,MAAM;QACX,SAAS,EACP,iBAAU,CACR,gEAAM,EACN,CAAsB,uBACtB,CAAC;YACC,CAAgC,iCAAE,WAAW,KAAK,CAAU,aAAI,WAAW;YAC3E,CAAgC,iCAAE,KAAK,KAAK,CAAK;YACjD,CAAmC,oCAAE,KAAK,KAAK,CAAQ;QACzD,CAAC,EACD,UAAU,CAAC,SAAS;gDAGvB,mBAAY;QACX,KAAK,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;gBACP,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAA6B;YACpE,CAAC;QACH,CAAC;gDACA,eAAQ;QAAC,UAAU,EAAE,UAAU;OAC7B,QAAQ;AAKnB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,YAAK,CAAC,UAAU,CAAC,iCAAW","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './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, useValueEffect} from '@react-aria/utils';\nimport {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';\nimport React, {useCallback, useEffect, 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 }, [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 useEffect(() => {\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 useEffect(() => {\n parent.current = domRef.current.parentElement;\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":";;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAAsC;AACtC,GAA6C;AAC7C,GAAgD;AAChD,GAAmD;AACnD,GAAgD;AAJhD,yCAAsC,GAAG,CAA6B;AACtE,yCAA6C,GAAG,CAAoC;AACpF,yCAAgD,GAAG,CAAuC;AAC1F,wCAAmD,GAAG,CAA0C;AAChG,yCAAgD,GAAG,CAAuC;;;SDuBjF,iCAAW,CAAC,KAA+B,EAAE,GAA2B,EAAE,CAAC;IAClF,GAAG,CAAC,CAAC,QAAA,KAAK,EAAA,CAAC,GAAG,kBAAW;IACzB,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAC9B,KAAK,GAAG,mBAAY,CAAC,KAAK,EAAE,CAAa;IAEzC,GAAG,CAAC,CAAC,WACH,QAAQ,gBACR,WAAW,GAAG,CAAY,0BAC1B,UAAU,UACV,KAAK,GAAG,CAAO,YACZ,UAAU,CACf,CAAC,GAAG,KAAK;IAET,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,oBAAa,CAAC,UAAU;IAC3C,GAAG,CAAC,MAAM,GAAG,gBAAS,CAAC,GAAG;IAC1B,GAAG,EAAE,WAAW,EAAE,cAAc,IAAI,qBAAc,CAAC,KAAK;IAExD,GAAG,CAAC,gBAAgB,GAAG,kBAAW,KAAO,CAAC;QACxC,GAAG,CAAC,kBAAkB,OAAS,CAAC;YAC9B,EAAE,EAAE,MAAM,CAAC,OAAO,IAAI,WAAW,KAAK,CAAY,aAAE,CAAC;gBACnD,GAAG,C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c,CAAC,UAAU;WACzB,UAAU;QACd,GAAG,EAAE,MAAM;QACX,SAAS,EACP,iBAAU,CACR,gEAAM,EACN,CAAsB,uBACtB,CAAC;YACC,CAAgC,iCAAE,WAAW,KAAK,CAAU,aAAI,WAAW;YAC3E,CAAgC,iCAAE,KAAK,KAAK,CAAK;YACjD,CAAmC,oCAAE,KAAK,KAAK,CAAQ;QACzD,CAAC,EACD,UAAU,CAAC,SAAS;gDAGvB,mBAAY;QACX,KAAK,EAAE,CAAC;YACN,MAAM,EAAE,CAAC;gBACP,gBAAgB,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAA6B;YACpE,CAAC;QACH,CAAC;gDACA,eAAQ;QAAC,UAAU,EAAE,UAAU;OAC7B,QAAQ;AAKnB,CAAC;AAED,EAEG,AAFH;;CAEG,AAFH,EAEG,CACH,GAAG,CAAC,yCAAY,iBAAG,YAAK,CAAC,UAAU,CAAC,iCAAW","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\n/// <reference types=\"css-module-types\" />\n\nexport * from './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 }, [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 parent.current = domRef.current.parentElement;\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-spectrum/buttongroup",
3
- "version": "3.2.9-nightly.3271+27e4e6825",
3
+ "version": "3.3.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,16 +32,16 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/utils": "3.0.0-nightly.1572+27e4e6825",
36
- "@react-spectrum/button": "3.0.0-nightly.1572+27e4e6825",
37
- "@react-spectrum/text": "3.1.9-nightly.3271+27e4e6825",
38
- "@react-spectrum/utils": "3.0.0-nightly.1572+27e4e6825",
39
- "@react-types/buttongroup": "3.1.7-nightly.3271+27e4e6825",
40
- "@react-types/shared": "3.0.0-nightly.1572+27e4e6825"
35
+ "@react-aria/utils": "^3.13.0",
36
+ "@react-spectrum/button": "^3.8.0",
37
+ "@react-spectrum/text": "^3.2.0",
38
+ "@react-spectrum/utils": "^3.7.0",
39
+ "@react-types/buttongroup": "^3.2.0",
40
+ "@react-types/shared": "^3.13.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1572+27e4e6825",
44
- "@spectrum-icons/workflow": "3.0.0-nightly.1572+27e4e6825"
43
+ "@adobe/spectrum-css-temp": "3.0.0-alpha.1",
44
+ "@spectrum-icons/workflow": "^3.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@react-spectrum/provider": "^3.0.0",
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "27e4e682528fc182fd0b45d5033a87844d255888"
53
+ "gitHead": "8f921ec5094e7c2b3c301bcb6133372e35a2052b"
54
54
  }
@@ -19,9 +19,9 @@ import {
19
19
  useStyleProps
20
20
  } from '@react-spectrum/utils';
21
21
  import {DOMRef} from '@react-types/shared';
22
- import {filterDOMProps, useValueEffect} from '@react-aria/utils';
22
+ import {filterDOMProps, useLayoutEffect, useValueEffect} from '@react-aria/utils';
23
23
  import {Provider, useProvider, useProviderProps} from '@react-spectrum/provider';
24
- import React, {useCallback, useEffect, useRef} from 'react';
24
+ import React, {useCallback, useRef} from 'react';
25
25
  import {SpectrumButtonGroupProps} from '@react-types/buttongroup';
26
26
  import styles from '@adobe/spectrum-css-temp/components/buttongroup/vars.css';
27
27
 
@@ -68,13 +68,13 @@ function ButtonGroup(props: SpectrumButtonGroupProps, ref: DOMRef<HTMLDivElement
68
68
 
69
69
  // There are two main reasons we need to remeasure:
70
70
  // 1. Internal changes: Check for initial overflow or when orientation/scale/children change (from checkForOverflow dep array)
71
- useEffect(() => {
71
+ useLayoutEffect(() => {
72
72
  checkForOverflow();
73
73
  }, [checkForOverflow]);
74
74
 
75
75
  // 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
76
76
  let parent = useRef<HTMLElement>();
77
- useEffect(() => {
77
+ useLayoutEffect(() => {
78
78
  parent.current = domRef.current.parentElement;
79
79
  }, [domRef.current]);
80
80
  useResizeObserver({ref: parent, onResize: checkForOverflow});