@react-spectrum/actionbar 3.6.2 → 3.6.4
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/ActionBar.main.js +3 -6
- package/dist/ActionBar.main.js.map +1 -1
- package/dist/ActionBar.mjs +3 -6
- package/dist/ActionBar.module.js +3 -6
- package/dist/ActionBar.module.js.map +1 -1
- package/dist/ActionBarContainer.main.js +3 -7
- package/dist/ActionBarContainer.main.js.map +1 -1
- package/dist/ActionBarContainer.mjs +3 -7
- package/dist/ActionBarContainer.module.js +3 -7
- package/dist/ActionBarContainer.module.js.map +1 -1
- package/dist/{actionbar.27a01ec3.css → actionbar.bdfe7eee.css} +2 -2
- package/dist/{actionbar.27a01ec3.css.map → actionbar.bdfe7eee.css.map} +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/ActionBar.tsx +5 -8
- package/src/ActionBarContainer.tsx +6 -9
package/dist/ActionBar.main.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var $b1ba52ca91e22687$exports = require("./intlStrings.main.js");
|
|
2
|
-
require("./actionbar.
|
|
2
|
+
require("./actionbar.bdfe7eee.css");
|
|
3
3
|
var $ff24c7bbe0c168db$exports = require("./actionbar_css.main.js");
|
|
4
4
|
var $643e7$reactspectrumbutton = require("@react-spectrum/button");
|
|
5
5
|
var $643e7$reactspectrumactiongroup = require("@react-spectrum/actiongroup");
|
|
@@ -50,7 +50,7 @@ $parcel$export(module.exports, "ActionBar", () => $7b5467653feb1153$export$e213c
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const $7b5467653feb1153$export$e213cebad6250b4a = /*#__PURE__*/ (0, ($parcel$interopDefault($643e7$react))).forwardRef(function ActionBar(props, ref) {
|
|
54
54
|
let isOpen = props.selectedItemCount !== 0;
|
|
55
55
|
let domRef = (0, $643e7$reactspectrumutils.useDOMRef)(ref);
|
|
56
56
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($643e7$react))).createElement((0, $643e7$reactspectrumoverlays.OpenTransition), {
|
|
@@ -62,7 +62,7 @@ function $7b5467653feb1153$var$ActionBar(props, ref) {
|
|
|
62
62
|
...props,
|
|
63
63
|
ref: domRef
|
|
64
64
|
}));
|
|
65
|
-
}
|
|
65
|
+
});
|
|
66
66
|
function $7b5467653feb1153$var$ActionBarInner(props, ref) {
|
|
67
67
|
props = (0, $643e7$reactspectrumprovider.useProviderProps)(props);
|
|
68
68
|
let { children: children, isEmphasized: isEmphasized, onAction: onAction, onClearSelection: onClearSelection, selectedItemCount: selectedItemCount, isOpen: isOpen, buttonLabelBehavior: buttonLabelBehavior = 'collapse', items: items, disabledKeys: disabledKeys } = props;
|
|
@@ -125,9 +125,6 @@ function $7b5467653feb1153$var$ActionBarInner(props, ref) {
|
|
|
125
125
|
})))));
|
|
126
126
|
}
|
|
127
127
|
const $7b5467653feb1153$var$ActionBarInnerWithRef = /*#__PURE__*/ (0, ($parcel$interopDefault($643e7$react))).forwardRef($7b5467653feb1153$var$ActionBarInner);
|
|
128
|
-
/**
|
|
129
|
-
* Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.
|
|
130
|
-
*/ const $7b5467653feb1153$export$e213cebad6250b4a = /*#__PURE__*/ (0, ($parcel$interopDefault($643e7$react))).forwardRef($7b5467653feb1153$var$ActionBar);
|
|
131
128
|
|
|
132
129
|
|
|
133
130
|
//# sourceMappingURL=ActionBar.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAwBM,MAAM,0DAAY,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,UAA4B,KAAgC,EAAE,GAA2B;IAC1I,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC,CAAA,GAAA,2CAAa;QACZ,SAAS;QACT,IAAI;QACJ,cAAA;QACA,eAAA;qBACA,0DAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SAAS,qCAAkB,KAA6B,EAAE,GAAwB;IAChF,QAAQ,CAAA,GAAA,6CAAe,EAAE;IAEzB,IAAI,YACF,QAAQ,gBACR,YAAY,YACZ,QAAQ,oBACR,gBAAgB,qBAChB,iBAAiB,UACjB,MAAM,uBACN,sBAAsB,mBACtB,KAAK,gBACL,YAAY,EACb,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,mHAAmH;IACnH,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,qBAAO,EAAE;IACzC,IAAI,AAAC,CAAA,sBAAsB,SAAS,oBAAoB,CAAA,KAAM,sBAAsB,WAClF,aAAa;IAGf,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,wCAAU,EAAE;QAChC,WAAU,CAAC;YACT,IAAI,EAAE,GAAG,KAAK,UAAU;gBACtB,EAAE,cAAc;gBAChB;YACF;QACF;IACF;IAEA,yCAAyC;IACzC,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAE;IACvB,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,UAAU,OAAO,EAAE;YACrB,UAAU,OAAO,GAAG;YACpB,CAAA,GAAA,sCAAO,EAAE,gBAAgB,MAAM,CAAC;QAClC;IACF,GAAG;QAAC;KAAgB;IAEpB,qBACE,0DAAC,CAAA,GAAA,gCAAS;QAAE,cAAA;qBACV,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACb,GAAG,aAAa;QACjB,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,4BAA4B;YAC1B,wCAAwC;YACxC,WAAW;QACb,GACA,WAAW,SAAS;qBAEtB,0DAAC;QAAI,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;qBACjC,0DAAC,CAAA,GAAA,2CAAU;QACT,OAAO;QACP,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAA;QACA,aAAa,eAAe,UAAU;QACtC,cAAa;QACb,qBAAqB;QACrB,UAAU;QACV,cAAc;QACd,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACpC,yBAEH,0DAAC,CAAA,GAAA,uCAAW;QACV,UAAU,CAAA,GAAA,mDAAK,EAAE,KAAK;QACtB,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS,IAAM;QACf,SAAA;QACA,aAAa,eAAe,UAAU;qBACtC,0DAAC,CAAA,GAAA,0DAAS,yBAEZ,0DAAC,CAAA,GAAA,6BAAG;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/actionbar/src/ActionBar.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 {ActionButton} from '@react-spectrum/button';\nimport {ActionGroup} from '@react-spectrum/actiongroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {OpenTransition} from '@react-spectrum/overlays';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport {SpectrumActionBarProps} from '@react-types/actionbar';\nimport styles from './actionbar.css';\nimport {Text} from '@react-spectrum/text';\nimport {useKeyboard} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(props: SpectrumActionBarProps<T>, ref: DOMRef<HTMLDivElement>) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition\n nodeRef={domRef}\n in={isOpen}\n mountOnEnter\n unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar', {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.main.js.map"}
|
package/dist/ActionBar.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import $c4Nes$intlStringsmodulejs from "./intlStrings.mjs";
|
|
2
|
-
import "./actionbar.
|
|
2
|
+
import "./actionbar.bdfe7eee.css";
|
|
3
3
|
import $c4Nes$actionbar_cssmodulejs from "./actionbar_css.mjs";
|
|
4
4
|
import {ActionButton as $c4Nes$ActionButton} from "@react-spectrum/button";
|
|
5
5
|
import {ActionGroup as $c4Nes$ActionGroup} from "@react-spectrum/actiongroup";
|
|
@@ -44,7 +44,7 @@ function $parcel$interopDefault(a) {
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
const $a4e665fbd087d71e$export$e213cebad6250b4a = /*#__PURE__*/ (0, $c4Nes$react).forwardRef(function ActionBar(props, ref) {
|
|
48
48
|
let isOpen = props.selectedItemCount !== 0;
|
|
49
49
|
let domRef = (0, $c4Nes$useDOMRef)(ref);
|
|
50
50
|
return /*#__PURE__*/ (0, $c4Nes$react).createElement((0, $c4Nes$OpenTransition), {
|
|
@@ -56,7 +56,7 @@ function $a4e665fbd087d71e$var$ActionBar(props, ref) {
|
|
|
56
56
|
...props,
|
|
57
57
|
ref: domRef
|
|
58
58
|
}));
|
|
59
|
-
}
|
|
59
|
+
});
|
|
60
60
|
function $a4e665fbd087d71e$var$ActionBarInner(props, ref) {
|
|
61
61
|
props = (0, $c4Nes$useProviderProps)(props);
|
|
62
62
|
let { children: children, isEmphasized: isEmphasized, onAction: onAction, onClearSelection: onClearSelection, selectedItemCount: selectedItemCount, isOpen: isOpen, buttonLabelBehavior: buttonLabelBehavior = 'collapse', items: items, disabledKeys: disabledKeys } = props;
|
|
@@ -119,9 +119,6 @@ function $a4e665fbd087d71e$var$ActionBarInner(props, ref) {
|
|
|
119
119
|
})))));
|
|
120
120
|
}
|
|
121
121
|
const $a4e665fbd087d71e$var$ActionBarInnerWithRef = /*#__PURE__*/ (0, $c4Nes$react).forwardRef($a4e665fbd087d71e$var$ActionBarInner);
|
|
122
|
-
/**
|
|
123
|
-
* Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.
|
|
124
|
-
*/ const $a4e665fbd087d71e$export$e213cebad6250b4a = /*#__PURE__*/ (0, $c4Nes$react).forwardRef($a4e665fbd087d71e$var$ActionBar);
|
|
125
122
|
|
|
126
123
|
|
|
127
124
|
export {$a4e665fbd087d71e$export$e213cebad6250b4a as ActionBar};
|
package/dist/ActionBar.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import $c4Nes$intlStringsmodulejs from "./intlStrings.module.js";
|
|
2
|
-
import "./actionbar.
|
|
2
|
+
import "./actionbar.bdfe7eee.css";
|
|
3
3
|
import $c4Nes$actionbar_cssmodulejs from "./actionbar_css.module.js";
|
|
4
4
|
import {ActionButton as $c4Nes$ActionButton} from "@react-spectrum/button";
|
|
5
5
|
import {ActionGroup as $c4Nes$ActionGroup} from "@react-spectrum/actiongroup";
|
|
@@ -44,7 +44,7 @@ function $parcel$interopDefault(a) {
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
const $a4e665fbd087d71e$export$e213cebad6250b4a = /*#__PURE__*/ (0, $c4Nes$react).forwardRef(function ActionBar(props, ref) {
|
|
48
48
|
let isOpen = props.selectedItemCount !== 0;
|
|
49
49
|
let domRef = (0, $c4Nes$useDOMRef)(ref);
|
|
50
50
|
return /*#__PURE__*/ (0, $c4Nes$react).createElement((0, $c4Nes$OpenTransition), {
|
|
@@ -56,7 +56,7 @@ function $a4e665fbd087d71e$var$ActionBar(props, ref) {
|
|
|
56
56
|
...props,
|
|
57
57
|
ref: domRef
|
|
58
58
|
}));
|
|
59
|
-
}
|
|
59
|
+
});
|
|
60
60
|
function $a4e665fbd087d71e$var$ActionBarInner(props, ref) {
|
|
61
61
|
props = (0, $c4Nes$useProviderProps)(props);
|
|
62
62
|
let { children: children, isEmphasized: isEmphasized, onAction: onAction, onClearSelection: onClearSelection, selectedItemCount: selectedItemCount, isOpen: isOpen, buttonLabelBehavior: buttonLabelBehavior = 'collapse', items: items, disabledKeys: disabledKeys } = props;
|
|
@@ -119,9 +119,6 @@ function $a4e665fbd087d71e$var$ActionBarInner(props, ref) {
|
|
|
119
119
|
})))));
|
|
120
120
|
}
|
|
121
121
|
const $a4e665fbd087d71e$var$ActionBarInnerWithRef = /*#__PURE__*/ (0, $c4Nes$react).forwardRef($a4e665fbd087d71e$var$ActionBarInner);
|
|
122
|
-
/**
|
|
123
|
-
* Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.
|
|
124
|
-
*/ const $a4e665fbd087d71e$export$e213cebad6250b4a = /*#__PURE__*/ (0, $c4Nes$react).forwardRef($a4e665fbd087d71e$var$ActionBar);
|
|
125
122
|
|
|
126
123
|
|
|
127
124
|
export {$a4e665fbd087d71e$export$e213cebad6250b4a as ActionBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;AAwBM,MAAM,0DAAY,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,UAA4B,KAAgC,EAAE,GAA2B;IAC1I,IAAI,SAAS,MAAM,iBAAiB,KAAK;IACzC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gCAAC,CAAA,GAAA,qBAAa;QACZ,SAAS;QACT,IAAI;QACJ,cAAA;QACA,eAAA;qBACA,gCAAC;QAAuB,GAAG,KAAK;QAAE,KAAK;;AAG7C;AAMA,SAAS,qCAAkB,KAA6B,EAAE,GAAwB;IAChF,QAAQ,CAAA,GAAA,uBAAe,EAAE;IAEzB,IAAI,YACF,QAAQ,gBACR,YAAY,YACZ,QAAQ,oBACR,gBAAgB,qBAChB,iBAAiB,UACjB,MAAM,uBACN,sBAAsB,mBACtB,KAAK,gBACL,YAAY,EACb,GAAG;IAEJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,mHAAmH;IACnH,IAAI,CAAC,WAAW,aAAa,GAAG,CAAA,GAAA,eAAO,EAAE;IACzC,IAAI,AAAC,CAAA,sBAAsB,SAAS,oBAAoB,CAAA,KAAM,sBAAsB,WAClF,aAAa;IAGf,IAAI,iBAAC,aAAa,EAAC,GAAG,CAAA,GAAA,kBAAU,EAAE;QAChC,WAAU,CAAC;YACT,IAAI,EAAE,GAAG,KAAK,UAAU;gBACtB,EAAE,cAAc;gBAChB;YACF;QACF;IACF;IAEA,yCAAyC;IACzC,IAAI,YAAY,CAAA,GAAA,aAAK,EAAE;IACvB,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,UAAU,OAAO,EAAE;YACrB,UAAU,OAAO,GAAG;YACpB,CAAA,GAAA,eAAO,EAAE,gBAAgB,MAAM,CAAC;QAClC;IACF,GAAG;QAAC;KAAgB;IAEpB,qBACE,gCAAC,CAAA,GAAA,iBAAS;QAAE,cAAA;qBACV,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACb,GAAG,aAAa;QACjB,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,sDAAK,GACL,4BAA4B;YAC1B,wCAAwC;YACxC,WAAW;QACb,GACA,WAAW,SAAS;qBAEtB,gCAAC;QAAI,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;qBACjC,gCAAC,CAAA,GAAA,kBAAU;QACT,OAAO;QACP,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAA;QACA,aAAa,eAAe,UAAU;QACtC,cAAa;QACb,qBAAqB;QACrB,UAAU;QACV,cAAc;QACd,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;OACpC,yBAEH,gCAAC,CAAA,GAAA,mBAAW;QACV,UAAU,CAAA,GAAA,sDAAK,EAAE,KAAK;QACtB,cAAY,gBAAgB,MAAM,CAAC;QACnC,SAAS,IAAM;QACf,SAAA;QACA,aAAa,eAAe,UAAU;qBACtC,gCAAC,CAAA,GAAA,gCAAS,yBAEZ,gCAAC,CAAA,GAAA,WAAG;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;OACxC,cAAc,QACX,gBAAgB,MAAM,CAAC,iBACvB,gBAAgB,MAAM,CAAC,YAAY;QAAC,OAAO;IAAS;AAMpE;AAEA,MAAM,4DAAwB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/actionbar/src/ActionBar.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 {ActionButton} from '@react-spectrum/button';\nimport {ActionGroup} from '@react-spectrum/actiongroup';\nimport {announce} from '@react-aria/live-announcer';\nimport {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossLarge from '@spectrum-icons/ui/CrossLarge';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FocusScope} from '@react-aria/focus';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {OpenTransition} from '@react-spectrum/overlays';\nimport React, {ReactElement, Ref, useEffect, useRef, useState} from 'react';\nimport {SpectrumActionBarProps} from '@react-types/actionbar';\nimport styles from './actionbar.css';\nimport {Text} from '@react-spectrum/text';\nimport {useKeyboard} from '@react-aria/interactions';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.\n */\nexport const ActionBar = React.forwardRef(function ActionBar<T extends object>(props: SpectrumActionBarProps<T>, ref: DOMRef<HTMLDivElement>) {\n let isOpen = props.selectedItemCount !== 0;\n let domRef = useDOMRef(ref);\n\n return (\n <OpenTransition\n nodeRef={domRef}\n in={isOpen}\n mountOnEnter\n unmountOnExit>\n <ActionBarInnerWithRef {...props} ref={domRef} />\n </OpenTransition>\n );\n}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;\n\ninterface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {\n isOpen?: boolean\n}\n\nfunction ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElement>) {\n props = useProviderProps(props);\n\n let {\n children,\n isEmphasized,\n onAction,\n onClearSelection,\n selectedItemCount,\n isOpen,\n buttonLabelBehavior = 'collapse',\n items,\n disabledKeys\n } = props;\n\n let {styleProps} = useStyleProps(props);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/actionbar');\n\n // Store the last count greater than zero in a ref so that we can retain it while rendering the fade-out animation.\n let [lastCount, setLastCount] = useState(selectedItemCount);\n if ((selectedItemCount === 'all' || selectedItemCount > 0) && selectedItemCount !== lastCount) {\n setLastCount(selectedItemCount);\n }\n\n let {keyboardProps} = useKeyboard({\n onKeyDown(e) {\n if (e.key === 'Escape') {\n e.preventDefault();\n onClearSelection();\n }\n }\n });\n\n // Announce \"actions available\" on mount.\n let isInitial = useRef(true);\n useEffect(() => {\n if (isInitial.current) {\n isInitial.current = false;\n announce(stringFormatter.format('actionsAvailable'));\n }\n }, [stringFormatter]);\n\n return (\n <FocusScope restoreFocus>\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n {...keyboardProps}\n ref={ref}\n className={classNames(\n styles,\n 'react-spectrum-ActionBar', {\n 'react-spectrum-ActionBar--emphasized': isEmphasized,\n 'is-open': isOpen\n },\n styleProps.className\n )}>\n <div className={classNames(styles, 'react-spectrum-ActionBar-bar')}>\n <ActionGroup\n items={items}\n aria-label={stringFormatter.format('actions')}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}\n overflowMode=\"collapse\"\n buttonLabelBehavior={buttonLabelBehavior}\n onAction={onAction}\n disabledKeys={disabledKeys}\n UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-actionGroup')}>\n {children}\n </ActionGroup>\n <ActionButton\n gridArea={styles.clear}\n aria-label={stringFormatter.format('clearSelection')}\n onPress={() => onClearSelection()}\n isQuiet\n staticColor={isEmphasized ? 'white' : undefined}>\n <CrossLarge />\n </ActionButton>\n <Text UNSAFE_className={classNames(styles, 'react-spectrum-ActionBar-selectedCount')}>\n {lastCount === 'all'\n ? stringFormatter.format('selectedAll')\n : stringFormatter.format('selected', {count: lastCount})}\n </Text>\n </div>\n </div>\n </FocusScope>\n );\n}\n\nconst ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}) => ReactElement;\n"],"names":[],"version":3,"file":"ActionBar.module.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require("./actionbar.
|
|
1
|
+
require("./actionbar.bdfe7eee.css");
|
|
2
2
|
var $ff24c7bbe0c168db$exports = require("./actionbar_css.main.js");
|
|
3
3
|
var $hZJeg$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
4
|
var $hZJeg$reactariautils = require("@react-aria/utils");
|
|
@@ -30,7 +30,7 @@ $parcel$export(module.exports, "ActionBarContainer", () => $961b22d2b8bd2da1$exp
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const $961b22d2b8bd2da1$export$ac2eb07f267e434c = /*#__PURE__*/ (0, ($parcel$interopDefault($hZJeg$react))).forwardRef(function ActionBarContainer(props, ref) {
|
|
34
34
|
// Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.
|
|
35
35
|
props = (0, $hZJeg$reactspectrumprovider.useProviderProps)(props);
|
|
36
36
|
let { children: children } = props;
|
|
@@ -42,11 +42,7 @@ function $961b22d2b8bd2da1$var$ActionBarContainer(props, ref) {
|
|
|
42
42
|
ref: domRef,
|
|
43
43
|
className: (0, $hZJeg$reactspectrumutils.classNames)((0, ($parcel$interopDefault($ff24c7bbe0c168db$exports))), 'ActionBarContainer', styleProps.className)
|
|
44
44
|
}, children);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles
|
|
48
|
-
* the ActionBar's position with respect to its linked component.
|
|
49
|
-
*/ const $961b22d2b8bd2da1$export$ac2eb07f267e434c = /*#__PURE__*/ (0, ($parcel$interopDefault($hZJeg$react))).forwardRef($961b22d2b8bd2da1$var$ActionBarContainer);
|
|
45
|
+
});
|
|
50
46
|
|
|
51
47
|
|
|
52
48
|
//# sourceMappingURL=ActionBarContainer.main.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAqB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,mBAAmB,KAAsC,EAAE,GAA2B;IAChJ,wMAAwM;IACxM,QAAQ,CAAA,GAAA,6CAAe,EAAE;IAEzB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IAEvB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,oCAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,sBAAsB,WAAW,SAAS;OACvE;AAGP","sources":["packages/@react-spectrum/actionbar/src/ActionBarContainer.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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumActionBarContainerProps} from '@react-types/actionbar';\nimport styles from './actionbar.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles\n * the ActionBar's position with respect to its linked component.\n */\nexport const ActionBarContainer = React.forwardRef(function ActionBarContainer(props: SpectrumActionBarContainerProps, ref: DOMRef<HTMLDivElement>) {\n // Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.\n props = useProviderProps(props);\n\n let {children} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'ActionBarContainer', styleProps.className)}>\n {children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ActionBarContainer.main.js.map"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./actionbar.
|
|
1
|
+
import "./actionbar.bdfe7eee.css";
|
|
2
2
|
import $cNmre$actionbar_cssmodulejs from "./actionbar_css.mjs";
|
|
3
3
|
import {useStyleProps as $cNmre$useStyleProps, useDOMRef as $cNmre$useDOMRef, classNames as $cNmre$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $cNmre$filterDOMProps} from "@react-aria/utils";
|
|
@@ -24,7 +24,7 @@ function $parcel$interopDefault(a) {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const $2f6c8b20aa071c6d$export$ac2eb07f267e434c = /*#__PURE__*/ (0, $cNmre$react).forwardRef(function ActionBarContainer(props, ref) {
|
|
28
28
|
// Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.
|
|
29
29
|
props = (0, $cNmre$useProviderProps)(props);
|
|
30
30
|
let { children: children } = props;
|
|
@@ -36,11 +36,7 @@ function $2f6c8b20aa071c6d$var$ActionBarContainer(props, ref) {
|
|
|
36
36
|
ref: domRef,
|
|
37
37
|
className: (0, $cNmre$classNames)((0, ($parcel$interopDefault($cNmre$actionbar_cssmodulejs))), 'ActionBarContainer', styleProps.className)
|
|
38
38
|
}, children);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles
|
|
42
|
-
* the ActionBar's position with respect to its linked component.
|
|
43
|
-
*/ const $2f6c8b20aa071c6d$export$ac2eb07f267e434c = /*#__PURE__*/ (0, $cNmre$react).forwardRef($2f6c8b20aa071c6d$var$ActionBarContainer);
|
|
39
|
+
});
|
|
44
40
|
|
|
45
41
|
|
|
46
42
|
export {$2f6c8b20aa071c6d$export$ac2eb07f267e434c as ActionBarContainer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./actionbar.
|
|
1
|
+
import "./actionbar.bdfe7eee.css";
|
|
2
2
|
import $cNmre$actionbar_cssmodulejs from "./actionbar_css.module.js";
|
|
3
3
|
import {useStyleProps as $cNmre$useStyleProps, useDOMRef as $cNmre$useDOMRef, classNames as $cNmre$classNames} from "@react-spectrum/utils";
|
|
4
4
|
import {filterDOMProps as $cNmre$filterDOMProps} from "@react-aria/utils";
|
|
@@ -24,7 +24,7 @@ function $parcel$interopDefault(a) {
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
const $2f6c8b20aa071c6d$export$ac2eb07f267e434c = /*#__PURE__*/ (0, $cNmre$react).forwardRef(function ActionBarContainer(props, ref) {
|
|
28
28
|
// Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.
|
|
29
29
|
props = (0, $cNmre$useProviderProps)(props);
|
|
30
30
|
let { children: children } = props;
|
|
@@ -36,11 +36,7 @@ function $2f6c8b20aa071c6d$var$ActionBarContainer(props, ref) {
|
|
|
36
36
|
ref: domRef,
|
|
37
37
|
className: (0, $cNmre$classNames)((0, ($parcel$interopDefault($cNmre$actionbar_cssmodulejs))), 'ActionBarContainer', styleProps.className)
|
|
38
38
|
}, children);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles
|
|
42
|
-
* the ActionBar's position with respect to its linked component.
|
|
43
|
-
*/ const $2f6c8b20aa071c6d$export$ac2eb07f267e434c = /*#__PURE__*/ (0, $cNmre$react).forwardRef($2f6c8b20aa071c6d$var$ActionBarContainer);
|
|
39
|
+
});
|
|
44
40
|
|
|
45
41
|
|
|
46
42
|
export {$2f6c8b20aa071c6d$export$ac2eb07f267e434c as ActionBarContainer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;
|
|
1
|
+
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAcM,MAAM,0DAAqB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,mBAAmB,KAAsC,EAAE,GAA2B;IAChJ,wMAAwM;IACxM,QAAQ,CAAA,GAAA,uBAAe,EAAE;IAEzB,IAAI,YAAC,QAAQ,EAAC,GAAG;IACjB,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IAEvB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,qBAAa,EAAE,MAAM;QACxB,GAAG,UAAU;QACd,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG,sBAAsB,WAAW,SAAS;OACvE;AAGP","sources":["packages/@react-spectrum/actionbar/src/ActionBarContainer.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 {classNames, useDOMRef, useStyleProps} from '@react-spectrum/utils';\nimport {DOMRef} from '@react-types/shared';\nimport {filterDOMProps} from '@react-aria/utils';\nimport React from 'react';\nimport {SpectrumActionBarContainerProps} from '@react-types/actionbar';\nimport styles from './actionbar.css';\nimport {useProviderProps} from '@react-spectrum/provider';\n\n/**\n * ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles\n * the ActionBar's position with respect to its linked component.\n */\nexport const ActionBarContainer = React.forwardRef(function ActionBarContainer(props: SpectrumActionBarContainerProps, ref: DOMRef<HTMLDivElement>) {\n // Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.\n props = useProviderProps(props);\n\n let {children} = props;\n let {styleProps} = useStyleProps(props);\n let domRef = useDOMRef(ref);\n\n return (\n <div\n {...filterDOMProps(props)}\n {...styleProps}\n ref={domRef}\n className={classNames(styles, 'ActionBarContainer', styleProps.className)}>\n {children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ActionBarContainer.module.js.map"}
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
border-style: solid;
|
|
41
41
|
border-width: var(--spectrum-popover-border-size, var(--spectrum-alias-border-size-thin));
|
|
42
42
|
border-color: var(--spectrum-popover-border-color, var(--spectrum-alias-border-color-dark));
|
|
43
|
+
max-width: 960px;
|
|
43
44
|
box-shadow: 0 2px 8px var(--spectrum-alias-dropshadow-color);
|
|
44
45
|
transform: translateY(var(--spectrum-overlay-positive-transform-distance));
|
|
45
46
|
transition: transform var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
|
|
46
47
|
justify-content: space-between;
|
|
47
48
|
align-items: center;
|
|
48
|
-
max-width: 960px;
|
|
49
49
|
margin: 0 auto;
|
|
50
50
|
display: grid;
|
|
51
51
|
position: absolute;
|
|
@@ -80,4 +80,4 @@
|
|
|
80
80
|
border: 1px solid #0000;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
/*# sourceMappingURL=actionbar.
|
|
83
|
+
/*# sourceMappingURL=actionbar.bdfe7eee.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AAAA;;;;;;AAKE;;;;;AAKA;;;;AAKF;;;;;;;;AAYE;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;AAIA;;;;;;;AAOA;;;;;;;;AAOA;;;;;AAMF;EAEI","sources":["packages/@react-spectrum/actionbar/src/actionbar.css"],"sourcesContent":[".ActionBarContainer {\n display: flex;\n flex-direction: column;\n position: relative;\n\n & > :not(.react-spectrum-ActionBar) {\n flex: 1;\n min-height: 0;\n }\n\n & > .react-spectrum-ActionBar {\n flex: 0 0 auto;\n }\n}\n\n.react-spectrum-ActionBar {\n transition: height var(--spectrum-global-animation-duration-100) ease-in-out,\n opacity var(--spectrum-global-animation-duration-100) ease-in-out;\n\n /* Take up no space when not open */\n block-size: 0;\n opacity: 0;\n width: 100%;\n\n /* Clip anything outside of us, whether we're open or not. This makes the animation smooth */\n overflow: hidden;\n\n &.is-open {\n height: calc(var(--spectrum-global-dimension-size-600) + var(--spectrum-global-dimension-size-100) * 2);\n opacity: 1;\n transition-delay: 0ms;\n }\n\n .react-spectrum-ActionBar-bar {\n display: grid;\n grid-template-areas: \"clear selected . actiongroup\";\n grid-template-columns: auto max-content minmax(var(--spectrum-global-dimension-size-300), 1fr) auto;\n align-items: center;\n isolation: isolate;\n justify-content: space-between;\n padding: var(--spectrum-global-dimension-size-100);\n\n position: absolute;\n bottom: var(--spectrum-global-dimension-size-100);\n left: var(--spectrum-global-dimension-size-100);\n right: var(--spectrum-global-dimension-size-100);\n max-width: 960px;\n margin: 0 auto;\n\n background: var(--spectrum-global-color-gray-50);\n border-radius: var(--spectrum-popover-border-radius);\n border-style: solid;\n border-width: var(--spectrum-popover-border-size);\n border-color: var(--spectrum-popover-border-color);\n box-shadow: 0 2px 8px var(--spectrum-alias-dropshadow-color);\n\n transform: translateY(var(--spectrum-overlay-positive-transform-distance));\n transition: transform var(--spectrum-global-animation-duration-100) ease-in-out;\n }\n\n &.is-open .react-spectrum-ActionBar-bar {\n transform: translateY(0);\n }\n\n &.react-spectrum-ActionBar--emphasized .react-spectrum-ActionBar-bar {\n background: var(--spectrum-global-color-static-blue-700);\n color: white;\n box-shadow: 0 2px 6px var(--spectrum-alias-dropshadow-color);\n border: none;\n }\n\n .react-spectrum-ActionBar-selectedCount {\n grid-area: selected;\n padding: 0 var(--spectrum-global-dimension-size-50);\n user-select: none;\n cursor: default;\n }\n\n .react-spectrum-ActionBar-actionGroup {\n grid-area: actiongroup;\n min-width: 0;\n }\n}\n@media (forced-colors: active) {\n .react-spectrum-ActionBar {\n &.react-spectrum-ActionBar--emphasized .react-spectrum-ActionBar-bar {\n\n border: 1px solid transparent;\n }\n }\n}\n"],"names":[],"version":3,"file":"actionbar.
|
|
1
|
+
{"mappings":"AAAA;;;;;;AAKE;;;;;AAKA;;;;AAKF;;;;;;;;AAYE;;;;;;AAMA;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;;;;AAIA;;;;;;;AAOA;;;;;;;;AAOA;;;;;AAMF;EAEI","sources":["packages/@react-spectrum/actionbar/src/actionbar.css"],"sourcesContent":[".ActionBarContainer {\n display: flex;\n flex-direction: column;\n position: relative;\n\n & > :not(.react-spectrum-ActionBar) {\n flex: 1;\n min-height: 0;\n }\n\n & > .react-spectrum-ActionBar {\n flex: 0 0 auto;\n }\n}\n\n.react-spectrum-ActionBar {\n transition: height var(--spectrum-global-animation-duration-100) ease-in-out,\n opacity var(--spectrum-global-animation-duration-100) ease-in-out;\n\n /* Take up no space when not open */\n block-size: 0;\n opacity: 0;\n width: 100%;\n\n /* Clip anything outside of us, whether we're open or not. This makes the animation smooth */\n overflow: hidden;\n\n &.is-open {\n height: calc(var(--spectrum-global-dimension-size-600) + var(--spectrum-global-dimension-size-100) * 2);\n opacity: 1;\n transition-delay: 0ms;\n }\n\n .react-spectrum-ActionBar-bar {\n display: grid;\n grid-template-areas: \"clear selected . actiongroup\";\n grid-template-columns: auto max-content minmax(var(--spectrum-global-dimension-size-300), 1fr) auto;\n align-items: center;\n isolation: isolate;\n justify-content: space-between;\n padding: var(--spectrum-global-dimension-size-100);\n\n position: absolute;\n bottom: var(--spectrum-global-dimension-size-100);\n left: var(--spectrum-global-dimension-size-100);\n right: var(--spectrum-global-dimension-size-100);\n max-width: 960px;\n margin: 0 auto;\n\n background: var(--spectrum-global-color-gray-50);\n border-radius: var(--spectrum-popover-border-radius);\n border-style: solid;\n border-width: var(--spectrum-popover-border-size);\n border-color: var(--spectrum-popover-border-color);\n box-shadow: 0 2px 8px var(--spectrum-alias-dropshadow-color);\n\n transform: translateY(var(--spectrum-overlay-positive-transform-distance));\n transition: transform var(--spectrum-global-animation-duration-100) ease-in-out;\n }\n\n &.is-open .react-spectrum-ActionBar-bar {\n transform: translateY(0);\n }\n\n &.react-spectrum-ActionBar--emphasized .react-spectrum-ActionBar-bar {\n background: var(--spectrum-global-color-static-blue-700);\n color: white;\n box-shadow: 0 2px 6px var(--spectrum-alias-dropshadow-color);\n border: none;\n }\n\n .react-spectrum-ActionBar-selectedCount {\n grid-area: selected;\n padding: 0 var(--spectrum-global-dimension-size-50);\n user-select: none;\n cursor: default;\n }\n\n .react-spectrum-ActionBar-actionGroup {\n grid-area: actiongroup;\n min-width: 0;\n }\n}\n@media (forced-colors: active) {\n .react-spectrum-ActionBar {\n &.react-spectrum-ActionBar--emphasized .react-spectrum-ActionBar-bar {\n\n border: 1px solid transparent;\n }\n }\n}\n"],"names":[],"version":3,"file":"actionbar.bdfe7eee.css.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;
|
|
1
|
+
{"mappings":";;;AA+BA;;GAEG;AACH,OAAO,MAAM,WAaP,CAAC,CAAC,EAAE,KAAK,EAAE,uBAAuB,CAAC,CAAC,GAAG;IAAC,GAAG,CAAC,EAAE,OAAO,cAAc,CAAC,CAAA;CAAC,KAAK,YAAY,CAAC;AC3B7F;;;GAGG;AACH,OAAO,MAAM,uIAiBX,CAAC;AC3BH,OAAO,EAAC,IAAI,EAAC,MAAM,4BAA4B,CAAC;AAChD,YAAY,EAAC,+BAA+B,EAAC,MAAM,wBAAwB,CAAC;AAC5E,YAAY,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,CAAC","sources":["packages/@react-spectrum/actionbar/src/packages/@react-spectrum/actionbar/src/ActionBar.tsx","packages/@react-spectrum/actionbar/src/packages/@react-spectrum/actionbar/src/ActionBarContainer.tsx","packages/@react-spectrum/actionbar/src/packages/@react-spectrum/actionbar/src/index.ts","packages/@react-spectrum/actionbar/src/index.ts"],"sourcesContent":[null,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 {ActionBar} from './ActionBar';\nexport {ActionBarContainer} from './ActionBarContainer';\nexport {Item} from '@react-stately/collections';\nexport type {SpectrumActionBarContainerProps} from '@react-types/actionbar';\nexport type {SpectrumActionBarProps} from '@react-types/actionbar';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/actionbar",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "^3.
|
|
40
|
-
"@react-aria/i18n": "^3.12.
|
|
41
|
-
"@react-aria/interactions": "^3.
|
|
39
|
+
"@react-aria/focus": "^3.20.0",
|
|
40
|
+
"@react-aria/i18n": "^3.12.6",
|
|
41
|
+
"@react-aria/interactions": "^3.24.0",
|
|
42
42
|
"@react-aria/live-announcer": "^3.4.1",
|
|
43
|
-
"@react-aria/utils": "^3.
|
|
44
|
-
"@react-spectrum/actiongroup": "^3.10.
|
|
45
|
-
"@react-spectrum/button": "^3.16.
|
|
46
|
-
"@react-spectrum/overlays": "^5.7.
|
|
47
|
-
"@react-spectrum/text": "^3.5.
|
|
48
|
-
"@react-spectrum/utils": "^3.12.
|
|
49
|
-
"@react-stately/collections": "^3.12.
|
|
50
|
-
"@react-types/actionbar": "^3.1.
|
|
51
|
-
"@react-types/shared": "^3.
|
|
52
|
-
"@spectrum-icons/ui": "^3.6.
|
|
43
|
+
"@react-aria/utils": "^3.28.0",
|
|
44
|
+
"@react-spectrum/actiongroup": "^3.10.12",
|
|
45
|
+
"@react-spectrum/button": "^3.16.11",
|
|
46
|
+
"@react-spectrum/overlays": "^5.7.2",
|
|
47
|
+
"@react-spectrum/text": "^3.5.12",
|
|
48
|
+
"@react-spectrum/utils": "^3.12.2",
|
|
49
|
+
"@react-stately/collections": "^3.12.2",
|
|
50
|
+
"@react-types/actionbar": "^3.1.13",
|
|
51
|
+
"@react-types/shared": "^3.28.0",
|
|
52
|
+
"@spectrum-icons/ui": "^3.6.13",
|
|
53
53
|
"@swc/helpers": "^0.5.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "4d3c72c94eea2d72eb3a0e7d56000c6ef7e39726"
|
|
67
67
|
}
|
package/src/ActionBar.tsx
CHANGED
|
@@ -29,7 +29,10 @@ import {useKeyboard} from '@react-aria/interactions';
|
|
|
29
29
|
import {useLocalizedStringFormatter} from '@react-aria/i18n';
|
|
30
30
|
import {useProviderProps} from '@react-spectrum/provider';
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.
|
|
34
|
+
*/
|
|
35
|
+
export const ActionBar = React.forwardRef(function ActionBar<T extends object>(props: SpectrumActionBarProps<T>, ref: DOMRef<HTMLDivElement>) {
|
|
33
36
|
let isOpen = props.selectedItemCount !== 0;
|
|
34
37
|
let domRef = useDOMRef(ref);
|
|
35
38
|
|
|
@@ -42,7 +45,7 @@ function ActionBar<T extends object>(props: SpectrumActionBarProps<T>, ref: DOMR
|
|
|
42
45
|
<ActionBarInnerWithRef {...props} ref={domRef} />
|
|
43
46
|
</OpenTransition>
|
|
44
47
|
);
|
|
45
|
-
}
|
|
48
|
+
}) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;
|
|
46
49
|
|
|
47
50
|
interface ActionBarInnerProps<T> extends SpectrumActionBarProps<T> {
|
|
48
51
|
isOpen?: boolean
|
|
@@ -138,9 +141,3 @@ function ActionBarInner<T>(props: ActionBarInnerProps<T>, ref: Ref<HTMLDivElemen
|
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
const ActionBarInnerWithRef = React.forwardRef(ActionBarInner) as <T>(props: ActionBarInnerProps<T> & {ref?: Ref<HTMLDivElement>}) => ReactElement;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Action bars are used for single and bulk selection patterns when a user needs to perform actions on one or more items at the same time.
|
|
144
|
-
*/
|
|
145
|
-
const _ActionBar = React.forwardRef(ActionBar) as <T>(props: SpectrumActionBarProps<T> & {ref?: DOMRef<HTMLDivElement>}) => ReactElement;
|
|
146
|
-
export {_ActionBar as ActionBar};
|
|
@@ -18,7 +18,11 @@ import {SpectrumActionBarContainerProps} from '@react-types/actionbar';
|
|
|
18
18
|
import styles from './actionbar.css';
|
|
19
19
|
import {useProviderProps} from '@react-spectrum/provider';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
/**
|
|
22
|
+
* ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles
|
|
23
|
+
* the ActionBar's position with respect to its linked component.
|
|
24
|
+
*/
|
|
25
|
+
export const ActionBarContainer = React.forwardRef(function ActionBarContainer(props: SpectrumActionBarContainerProps, ref: DOMRef<HTMLDivElement>) {
|
|
22
26
|
// Grabs specific props from the closest Provider (see https://react-spectrum.adobe.com/react-spectrum/Provider.html#property-groups). Remove if your component doesn't support any of the listed props.
|
|
23
27
|
props = useProviderProps(props);
|
|
24
28
|
|
|
@@ -35,11 +39,4 @@ function ActionBarContainer(props: SpectrumActionBarContainerProps, ref: DOMRef<
|
|
|
35
39
|
{children}
|
|
36
40
|
</div>
|
|
37
41
|
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* ActionBarContainer wraps around an ActionBar and a component that supports selection. It handles
|
|
42
|
-
* the ActionBar's position with respect to its linked component.
|
|
43
|
-
*/
|
|
44
|
-
const _ActionBarContainer = React.forwardRef(ActionBarContainer);
|
|
45
|
-
export {_ActionBarContainer as ActionBarContainer};
|
|
42
|
+
});
|