@fluentui/react-button 9.3.4 → 9.3.5
Sign up to get free protection for your applications and to get access to all the features.
- package/.swcrc +30 -0
- package/CHANGELOG.json +70 -1
- package/CHANGELOG.md +20 -2
- package/lib/Button.js.map +1 -1
- package/lib/CompoundButton.js.map +1 -1
- package/lib/MenuButton.js.map +1 -1
- package/lib/SplitButton.js.map +1 -1
- package/lib/ToggleButton.js.map +1 -1
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.js +1 -7
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +1 -0
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +1 -11
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +3 -2
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +1 -7
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +2 -2
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +1 -7
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +1 -0
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +1 -0
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/contexts/ButtonContext.js +2 -4
- package/lib/contexts/ButtonContext.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.js +5 -4
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +5 -4
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +5 -4
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +5 -4
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +5 -4
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +19 -21
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.js +3 -2
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +17 -19
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +14 -26
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +40 -52
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +1129 -471
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +19 -21
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +3 -2
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +18 -20
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +14 -30
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +31 -36
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +315 -184
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +19 -22
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.js +3 -2
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +18 -20
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +14 -26
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +34 -37
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +166 -106
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +19 -22
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.js +3 -2
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +18 -20
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -22
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +66 -79
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +263 -106
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +19 -21
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +3 -2
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +18 -20
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +6 -8
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +14 -16
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +897 -380
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/contexts/ButtonContext.js +18 -19
- package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
- package/lib-commonjs/contexts/index.js +5 -4
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/index.js +47 -179
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +5 -4
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +40 -40
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +12 -11
- package/lib-amd/Button.js +0 -6
- package/lib-amd/Button.js.map +0 -1
- package/lib-amd/CompoundButton.js +0 -6
- package/lib-amd/CompoundButton.js.map +0 -1
- package/lib-amd/MenuButton.js +0 -6
- package/lib-amd/MenuButton.js.map +0 -1
- package/lib-amd/SplitButton.js +0 -6
- package/lib-amd/SplitButton.js.map +0 -1
- package/lib-amd/ToggleButton.js +0 -6
- package/lib-amd/ToggleButton.js.map +0 -1
- package/lib-amd/components/Button/Button.js +0 -18
- package/lib-amd/components/Button/Button.js.map +0 -1
- package/lib-amd/components/Button/Button.types.js +0 -5
- package/lib-amd/components/Button/Button.types.js.map +0 -1
- package/lib-amd/components/Button/index.js +0 -11
- package/lib-amd/components/Button/index.js.map +0 -1
- package/lib-amd/components/Button/renderButton.js +0 -18
- package/lib-amd/components/Button/renderButton.js.map +0 -1
- package/lib-amd/components/Button/useButton.js +0 -41
- package/lib-amd/components/Button/useButton.js.map +0 -1
- package/lib-amd/components/Button/useButtonStyles.js +0 -227
- package/lib-amd/components/Button/useButtonStyles.js.map +0 -1
- package/lib-amd/components/CompoundButton/CompoundButton.js +0 -18
- package/lib-amd/components/CompoundButton/CompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/CompoundButton.types.js +0 -5
- package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +0 -1
- package/lib-amd/components/CompoundButton/index.js +0 -12
- package/lib-amd/components/CompoundButton/index.js.map +0 -1
- package/lib-amd/components/CompoundButton/renderCompoundButton.js +0 -20
- package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/useCompoundButton.js +0 -27
- package/lib-amd/components/CompoundButton/useCompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js +0 -216
- package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +0 -1
- package/lib-amd/components/MenuButton/MenuButton.js +0 -19
- package/lib-amd/components/MenuButton/MenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/MenuButton.types.js +0 -5
- package/lib-amd/components/MenuButton/MenuButton.types.js.map +0 -1
- package/lib-amd/components/MenuButton/index.js +0 -12
- package/lib-amd/components/MenuButton/index.js.map +0 -1
- package/lib-amd/components/MenuButton/renderMenuButton.js +0 -18
- package/lib-amd/components/MenuButton/renderMenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/useMenuButton.js +0 -30
- package/lib-amd/components/MenuButton/useMenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/useMenuButtonStyles.js +0 -97
- package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +0 -1
- package/lib-amd/components/SplitButton/SplitButton.js +0 -19
- package/lib-amd/components/SplitButton/SplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/SplitButton.types.js +0 -5
- package/lib-amd/components/SplitButton/SplitButton.types.js.map +0 -1
- package/lib-amd/components/SplitButton/index.js +0 -12
- package/lib-amd/components/SplitButton/index.js.map +0 -1
- package/lib-amd/components/SplitButton/renderSplitButton.js +0 -16
- package/lib-amd/components/SplitButton/renderSplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/useSplitButton.js +0 -67
- package/lib-amd/components/SplitButton/useSplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/useSplitButtonStyles.js +0 -162
- package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +0 -1
- package/lib-amd/components/ToggleButton/ToggleButton.js +0 -18
- package/lib-amd/components/ToggleButton/ToggleButton.js.map +0 -1
- package/lib-amd/components/ToggleButton/ToggleButton.types.js +0 -5
- package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +0 -1
- package/lib-amd/components/ToggleButton/index.js +0 -12
- package/lib-amd/components/ToggleButton/index.js.map +0 -1
- package/lib-amd/components/ToggleButton/renderToggleButton.js +0 -7
- package/lib-amd/components/ToggleButton/renderToggleButton.js.map +0 -1
- package/lib-amd/components/ToggleButton/useToggleButton.js +0 -17
- package/lib-amd/components/ToggleButton/useToggleButton.js.map +0 -1
- package/lib-amd/components/ToggleButton/useToggleButtonStyles.js +0 -87
- package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +0 -1
- package/lib-amd/contexts/ButtonContext.js +0 -19
- package/lib-amd/contexts/ButtonContext.js.map +0 -1
- package/lib-amd/contexts/index.js +0 -6
- package/lib-amd/contexts/index.js.map +0 -1
- package/lib-amd/index.js +0 -34
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/utils/index.js +0 -6
- package/lib-amd/utils/index.js.map +0 -1
- package/lib-amd/utils/useToggleState.js +0 -27
- package/lib-amd/utils/useToggleState.js.map +0 -1
@@ -1,28 +1,25 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "SplitButton", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>SplitButton
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const
|
11
|
-
const
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
const {
|
20
|
-
useSplitButtonStyles_unstable: useCustomStyles
|
21
|
-
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
22
|
-
useCustomStyles(state);
|
23
|
-
return renderSplitButton_1.renderSplitButton_unstable(state);
|
24
|
-
// Casting is required due to lack of distributive union to support unions on @types/react
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _renderSplitButton = require("./renderSplitButton");
|
12
|
+
const _useSplitButton = require("./useSplitButton");
|
13
|
+
const _useSplitButtonStyles = require("./useSplitButtonStyles");
|
14
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
15
|
+
const SplitButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
16
|
+
const state = (0, _useSplitButton.useSplitButton_unstable)(props, ref);
|
17
|
+
(0, _useSplitButtonStyles.useSplitButtonStyles_unstable)(state);
|
18
|
+
const { useSplitButtonStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
|
19
|
+
useCustomStyles(state);
|
20
|
+
return (0, _renderSplitButton.renderSplitButton_unstable)(state);
|
21
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
25
22
|
});
|
23
|
+
SplitButton.displayName = 'SplitButton'; //# sourceMappingURL=SplitButton.js.map
|
26
24
|
|
27
|
-
exports.SplitButton.displayName = 'SplitButton';
|
28
25
|
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/SplitButton/SplitButton.js"],"sourcesContent":["import * as React from 'react';\nimport { renderSplitButton_unstable } from './renderSplitButton';\nimport { useSplitButton_unstable } from './useSplitButton';\nimport { useSplitButtonStyles_unstable } from './useSplitButtonStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useSplitButton_unstable(props, ref);\n useSplitButtonStyles_unstable(state);\n const {\n useSplitButtonStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderSplitButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n});\n\nSplitButton.displayName = 'SplitButton';\n//# sourceMappingURL=SplitButton.js.map"],"names":["SplitButton","React","forwardRef","props","ref","state","useSplitButton_unstable","useSplitButtonStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderSplitButton_unstable","displayName"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;mCACoB;gCACH;sCACM;qCACD;AAKtC,MAAMA,cAAc,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,mDAA6B,EAACF;IAC9B,MAAM,EACJE,+BAA+BC,gBAAe,EAC/C,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,6CAA0B,EAACL;AAClC,0FAA0F;AAC5F;AAEAL,YAAYW,WAAW,GAAG,eAC1B,uCAAuC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/SplitButton/SplitButton.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=SplitButton.types.js.map"],"names":[],"mappings":";;;;CACA,6CAA6C"}
|
@@ -1,25 +1,23 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
5
|
-
});
|
6
|
-
exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = void 0;
|
7
|
-
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
tslib_1.__exportStar(require("./SplitButton"), exports);
|
9
|
-
tslib_1.__exportStar(require("./SplitButton.types"), exports);
|
10
|
-
tslib_1.__exportStar(require("./renderSplitButton"), exports);
|
11
|
-
tslib_1.__exportStar(require("./useSplitButton"), exports);
|
12
|
-
var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
|
13
|
-
Object.defineProperty(exports, "splitButtonClassNames", {
|
14
|
-
enumerable: true,
|
15
|
-
get: function () {
|
16
|
-
return useSplitButtonStyles_1.splitButtonClassNames;
|
17
|
-
}
|
3
|
+
value: true
|
18
4
|
});
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
5
|
+
function _export(target, all) {
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
7
|
+
enumerable: true,
|
8
|
+
get: all[name]
|
9
|
+
});
|
10
|
+
}
|
11
|
+
_export(exports, {
|
12
|
+
splitButtonClassNames: ()=>_useSplitButtonStyles.splitButtonClassNames,
|
13
|
+
useSplitButtonStyles_unstable: ()=>_useSplitButtonStyles.useSplitButtonStyles_unstable
|
24
14
|
});
|
15
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
16
|
+
_exportStar(require("./SplitButton"), exports);
|
17
|
+
_exportStar(require("./SplitButton.types"), exports);
|
18
|
+
_exportStar(require("./renderSplitButton"), exports);
|
19
|
+
_exportStar(require("./useSplitButton"), exports);
|
20
|
+
const _useSplitButtonStyles = require("./useSplitButtonStyles");
|
21
|
+
//# sourceMappingURL=index.js.map
|
22
|
+
|
25
23
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/SplitButton/index.js"],"sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":["splitButtonClassNames","useSplitButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAISA,qBAAqB,MAArBA,2CAAqB;IAAEC,6BAA6B,MAA7BA,mDAA6B;;;oBAJ/C;oBACA;oBACA;oBACA;sCACuD;CACrE,iCAAiC"}
|
@@ -1,26 +1,17 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "renderSplitButton_unstable", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>renderSplitButton_unstable
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
|
10
|
-
|
11
|
-
*/
|
12
|
-
|
13
|
-
|
14
|
-
slots,
|
15
|
-
slotProps
|
16
|
-
} = react_utilities_1.getSlots(state);
|
17
|
-
return React.createElement(slots.root, {
|
18
|
-
...slotProps.root
|
19
|
-
}, slots.primaryActionButton && React.createElement(slots.primaryActionButton, {
|
20
|
-
...slotProps.primaryActionButton
|
21
|
-
}), slots.menuButton && React.createElement(slots.menuButton, {
|
22
|
-
...slotProps.menuButton
|
23
|
-
}));
|
24
|
-
};
|
25
|
-
exports.renderSplitButton_unstable = renderSplitButton_unstable;
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
12
|
+
const renderSplitButton_unstable = (state)=>{
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
14
|
+
return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, slots.primaryActionButton && /*#__PURE__*/ _react.createElement(slots.primaryActionButton, slotProps.primaryActionButton), slots.menuButton && /*#__PURE__*/ _react.createElement(slots.menuButton, slotProps.menuButton));
|
15
|
+
}; //# sourceMappingURL=renderSplitButton.js.map
|
16
|
+
|
26
17
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/SplitButton/renderSplitButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.primaryActionButton && /*#__PURE__*/React.createElement(slots.primaryActionButton, slotProps.primaryActionButton), slots.menuButton && /*#__PURE__*/React.createElement(slots.menuButton, slotProps.menuButton));\n};\n//# sourceMappingURL=renderSplitButton.js.map"],"names":["renderSplitButton_unstable","state","slots","slotProps","getSlots","React","createElement","root","primaryActionButton","menuButton"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,6BAA6BC,CAAAA,QAAS;IACjD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEL,MAAMM,mBAAmB,IAAI,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMM,mBAAmB,EAAEL,UAAUK,mBAAmB,GAAGN,MAAMO,UAAU,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMO,UAAU,EAAEN,UAAUM,UAAU;AAC1R,GACA,6CAA6C"}
|
@@ -1,83 +1,70 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
4
|
-
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "useSplitButton_unstable", {
|
6
|
+
enumerable: true,
|
7
|
+
get: ()=>useSplitButton_unstable
|
5
8
|
});
|
6
|
-
|
7
|
-
const
|
8
|
-
const
|
9
|
-
const
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
primaryActionButton,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
size,
|
68
|
-
// Slots definition
|
69
|
-
components: {
|
70
|
-
root: 'div',
|
71
|
-
menuButton: MenuButton_1.MenuButton,
|
72
|
-
primaryActionButton: Button_1.Button
|
73
|
-
},
|
74
|
-
root: react_utilities_1.getNativeElementProps('div', {
|
75
|
-
ref,
|
76
|
-
...props
|
77
|
-
}),
|
78
|
-
menuButton: menuButtonShorthand,
|
79
|
-
primaryActionButton: primaryActionButtonShorthand
|
80
|
-
};
|
81
|
-
};
|
82
|
-
exports.useSplitButton_unstable = useSplitButton_unstable;
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
12
|
+
const _button = require("../Button/Button");
|
13
|
+
const _menuButton = require("../MenuButton/MenuButton");
|
14
|
+
const useSplitButton_unstable = (props, ref)=>{
|
15
|
+
const { appearance ='secondary' , children , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , menuButton , menuIcon , primaryActionButton , shape ='rounded' , size ='medium' } = props;
|
16
|
+
const baseId = (0, _reactUtilities.useId)('splitButton-');
|
17
|
+
const menuButtonShorthand = (0, _reactUtilities.resolveShorthand)(menuButton, {
|
18
|
+
defaultProps: {
|
19
|
+
appearance,
|
20
|
+
disabled,
|
21
|
+
disabledFocusable,
|
22
|
+
menuIcon,
|
23
|
+
shape,
|
24
|
+
size
|
25
|
+
},
|
26
|
+
required: true
|
27
|
+
});
|
28
|
+
const primaryActionButtonShorthand = (0, _reactUtilities.resolveShorthand)(primaryActionButton, {
|
29
|
+
defaultProps: {
|
30
|
+
appearance,
|
31
|
+
children,
|
32
|
+
disabled,
|
33
|
+
disabledFocusable,
|
34
|
+
icon,
|
35
|
+
iconPosition,
|
36
|
+
id: baseId + '__primaryActionButton',
|
37
|
+
shape,
|
38
|
+
size
|
39
|
+
},
|
40
|
+
required: true
|
41
|
+
});
|
42
|
+
// Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
|
43
|
+
// by the user.
|
44
|
+
if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
|
45
|
+
menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
|
46
|
+
}
|
47
|
+
return {
|
48
|
+
// Props passed at the top-level
|
49
|
+
appearance,
|
50
|
+
disabled,
|
51
|
+
disabledFocusable,
|
52
|
+
iconPosition,
|
53
|
+
shape,
|
54
|
+
size,
|
55
|
+
// Slots definition
|
56
|
+
components: {
|
57
|
+
root: 'div',
|
58
|
+
menuButton: _menuButton.MenuButton,
|
59
|
+
primaryActionButton: _button.Button
|
60
|
+
},
|
61
|
+
root: (0, _reactUtilities.getNativeElementProps)('div', {
|
62
|
+
ref,
|
63
|
+
...props
|
64
|
+
}),
|
65
|
+
menuButton: menuButtonShorthand,
|
66
|
+
primaryActionButton: primaryActionButtonShorthand
|
67
|
+
};
|
68
|
+
}; //# sourceMappingURL=useSplitButton.js.map
|
69
|
+
|
83
70
|
//# sourceMappingURL=useSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../lib/components/SplitButton/useSplitButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButton_unstable = (props, ref) => {\n const {\n appearance = 'secondary',\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n shape = 'rounded',\n size = 'medium'\n } = props;\n const baseId = useId('splitButton-');\n const menuButtonShorthand = resolveShorthand(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size\n },\n required: true\n });\n const primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {\n defaultProps: {\n appearance,\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n shape,\n size\n },\n required: true\n });\n // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided\n // by the user.\n if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n // Slots definition\n components: {\n root: 'div',\n menuButton: MenuButton,\n primaryActionButton: Button\n },\n root: getNativeElementProps('div', {\n ref,\n ...props\n }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand\n };\n};\n//# sourceMappingURL=useSplitButton.js.map"],"names":["useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","useId","menuButtonShorthand","resolveShorthand","defaultProps","required","primaryActionButtonShorthand","id","components","root","MenuButton","Button","getNativeElementProps"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;gCACwC;wBACxC;4BACI;AAMpB,MAAMA,0BAA0B,CAACC,OAAOC,MAAQ;IACrD,MAAM,EACJC,YAAa,YAAW,EACxBC,SAAQ,EACRC,UAAW,KAAK,CAAA,EAChBC,mBAAoB,KAAK,CAAA,EACzBC,KAAI,EACJC,cAAe,SAAQ,EACvBC,WAAU,EACVC,SAAQ,EACRC,oBAAmB,EACnBC,OAAQ,UAAS,EACjBC,MAAO,SAAQ,EAChB,GAAGZ;IACJ,MAAMa,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMC,sBAAsBC,IAAAA,gCAAgB,EAACR,YAAY;QACvDS,cAAc;YACZf;YACAE;YACAC;YACAI;YACAE;YACAC;QACF;QACAM,UAAU,IAAI;IAChB;IACA,MAAMC,+BAA+BH,IAAAA,gCAAgB,EAACN,qBAAqB;QACzEO,cAAc;YACZf;YACAC;YACAC;YACAC;YACAC;YACAC;YACAa,IAAIP,SAAS;YACbF;YACAC;QACF;QACAM,UAAU,IAAI;IAChB;IACA,oHAAoH;IACpH,eAAe;IACf,IAAIH,uBAAuBI,gCAAgC,CAACJ,mBAAmB,CAAC,aAAa,IAAI,CAACA,mBAAmB,CAAC,kBAAkB,EAAE;QACxIA,mBAAmB,CAAC,kBAAkB,GAAGI,6BAA6BC,EAAE;IAC1E,CAAC;IACD,OAAO;QACL,gCAAgC;QAChClB;QACAE;QACAC;QACAE;QACAI;QACAC;QACA,mBAAmB;QACnBS,YAAY;YACVC,MAAM;YACNd,YAAYe,sBAAU;YACtBb,qBAAqBc,cAAM;QAC7B;QACAF,MAAMG,IAAAA,qCAAqB,EAAC,OAAO;YACjCxB;YACA,GAAGD,KAAK;QACV;QACAQ,YAAYO;QACZL,qBAAqBS;IACvB;AACF,GACA,0CAA0C"}
|