@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
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-button",
|
3
|
-
"version": "9.3.
|
3
|
+
"version": "9.3.5",
|
4
4
|
"description": "Fluent UI React Button component.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -22,26 +22,26 @@
|
|
22
22
|
"test": "jest --passWithNoTests",
|
23
23
|
"storybook": "start-storybook",
|
24
24
|
"type-check": "tsc -b tsconfig.json",
|
25
|
-
"generate-api": "
|
25
|
+
"generate-api": "just-scripts generate-api"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/a11y-testing": "^0.1.0",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
30
|
"@fluentui/react-conformance": "*",
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.20",
|
32
32
|
"@fluentui/scripts-api-extractor": "*",
|
33
33
|
"@fluentui/scripts-tasks": "*"
|
34
34
|
},
|
35
35
|
"dependencies": {
|
36
|
-
"@fluentui/keyboard-keys": "^9.0.
|
37
|
-
"@fluentui/react-aria": "^9.3.
|
38
|
-
"@fluentui/react-icons": "^2.0.
|
39
|
-
"@fluentui/react-shared-contexts": "^9.3.
|
40
|
-
"@fluentui/react-tabster": "^9.6.
|
41
|
-
"@fluentui/react-theme": "^9.1.
|
42
|
-
"@fluentui/react-utilities": "^9.7.
|
36
|
+
"@fluentui/keyboard-keys": "^9.0.2",
|
37
|
+
"@fluentui/react-aria": "^9.3.15",
|
38
|
+
"@fluentui/react-icons": "^2.0.196",
|
39
|
+
"@fluentui/react-shared-contexts": "^9.3.2",
|
40
|
+
"@fluentui/react-tabster": "^9.6.1",
|
41
|
+
"@fluentui/react-theme": "^9.1.7",
|
42
|
+
"@fluentui/react-utilities": "^9.7.2",
|
43
43
|
"@griffel/react": "^1.5.2",
|
44
|
-
"
|
44
|
+
"@swc/helpers": "^0.4.14"
|
45
45
|
},
|
46
46
|
"peerDependencies": {
|
47
47
|
"@types/react": ">=16.8.0 <19.0.0",
|
@@ -58,6 +58,7 @@
|
|
58
58
|
"exports": {
|
59
59
|
".": {
|
60
60
|
"types": "./dist/index.d.ts",
|
61
|
+
"node": "./lib-commonjs/index.js",
|
61
62
|
"import": "./lib/index.js",
|
62
63
|
"require": "./lib-commonjs/index.js"
|
63
64
|
},
|
package/lib-amd/Button.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/Button/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=Button.js.map
|
package/lib-amd/Button.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-button/src/Button.tsx"],"names":[],"mappings":";;;IAAA,uCAA0C","sourcesContent":["export * from './components/Button/index';\n"]}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/CompoundButton/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=CompoundButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CompoundButton.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-button/src/CompoundButton.ts"],"names":[],"mappings":";;;IAAA,uCAAkD","sourcesContent":["export * from './components/CompoundButton/index';\n"]}
|
package/lib-amd/MenuButton.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/MenuButton/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=MenuButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"MenuButton.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-button/src/MenuButton.ts"],"names":[],"mappings":";;;IAAA,uCAA8C","sourcesContent":["export * from './components/MenuButton/index';\n"]}
|
package/lib-amd/SplitButton.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/SplitButton/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-button/src/SplitButton.ts"],"names":[],"mappings":";;;IAAA,uCAA+C","sourcesContent":["export * from './components/SplitButton/index';\n"]}
|
package/lib-amd/ToggleButton.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/ToggleButton/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ToggleButton.js","sourceRoot":"","sources":["../../../../../../../packages/react-components/react-button/src/ToggleButton.ts"],"names":[],"mappings":";;;IAAA,uCAAgD","sourcesContent":["export * from './components/ToggleButton/index';\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./renderButton", "./useButton", "./useButtonStyles", "@fluentui/react-shared-contexts"], function (require, exports, React, renderButton_1, useButton_1, useButtonStyles_1, react_shared_contexts_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.Button = void 0;
|
5
|
-
/**
|
6
|
-
* Buttons give people a way to trigger an action.
|
7
|
-
*/
|
8
|
-
exports.Button = React.forwardRef(function (props, ref) {
|
9
|
-
var state = useButton_1.useButton_unstable(props, ref);
|
10
|
-
useButtonStyles_1.useButtonStyles_unstable(state);
|
11
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useButtonStyles_unstable;
|
12
|
-
useCustomStyles(state);
|
13
|
-
return renderButton_1.renderButton_unstable(state);
|
14
|
-
// Casting is required due to lack of distributive union to support unions on @types/react
|
15
|
-
});
|
16
|
-
exports.Button.displayName = 'Button';
|
17
|
-
});
|
18
|
-
//# sourceMappingURL=Button.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Button.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/Button.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,MAAM,GAAqC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAClF,IAAM,KAAK,GAAG,8BAAkB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE7C,0CAAwB,CAAC,KAAK,CAAC,CAAC;QAExB,IAA0B,eAAe,GAAK,oDAA4B,EAAE,yBAAnC,CAAoC;QACrF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,oCAAqB,CAAC,KAAK,CAAC,CAAC;QACpC,0FAA0F;IAC5F,CAAC,CAAqC,CAAC;IAEvC,cAAM,CAAC,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport type { ButtonProps } from './Button.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button: ForwardRefComponent<ButtonProps> = React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n\n useButtonStyles_unstable(state);\n\n const { useButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ButtonProps>;\n\nButton.displayName = 'Button';\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Button.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/Button.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ButtonSlots = {\n /**\n * Root of the component that renders as either a `<button>` tag or an `<a>` tag.\n */\n root: NonNullable<Slot<ARIAButtonSlotProps<'a'>>>;\n\n /**\n * Icon that renders either before or after the `children` as specified by the `iconPosition` prop.\n */\n icon?: Slot<'span'>;\n};\n\n/**\n * A button supports different sizes.\n */\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport type ButtonProps = ComponentProps<ButtonSlots> & {\n /**\n * A button can have its content and borders styled for greater emphasis or to be subtle.\n * - 'secondary' (default): Gives emphasis to the button in such a way that it indicates a secondary action.\n * - 'primary': Emphasizes the button as a primary action.\n * - 'outline': Removes background styling.\n * - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.\n * - 'transparent': Removes background and border styling.\n *\n * @default 'secondary'\n */\n appearance?: 'secondary' | 'primary' | 'outline' | 'subtle' | 'transparent';\n\n /**\n * When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it\n * is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this\n * pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.\n *\n * @default false\n */\n disabledFocusable?: boolean;\n\n /**\n * A button can show that it cannot be interacted with.\n *\n * @default false\n */\n disabled?: boolean;\n\n /**\n * A button can format its icon to appear before or after its content.\n *\n * @default 'before'\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A button can be rounded, circular, or square.\n *\n * @default 'rounded'\n */\n shape?: 'rounded' | 'circular' | 'square';\n\n /**\n * A button supports different sizes.\n *\n * @default 'medium'\n */\n size?: ButtonSize;\n};\n\nexport type ButtonState = ComponentState<ButtonSlots> &\n Required<Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>> & {\n /**\n * A button can contain only an icon.\n *\n * @default false\n */\n iconOnly: boolean;\n };\n"]}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./Button", "./renderButton", "./useButton", "./useButtonStyles"], function (require, exports, tslib_1, Button_1, renderButton_1, useButton_1, useButtonStyles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useButtonStyles_unstable = exports.buttonClassNames = void 0;
|
5
|
-
tslib_1.__exportStar(Button_1, exports);
|
6
|
-
tslib_1.__exportStar(renderButton_1, exports);
|
7
|
-
tslib_1.__exportStar(useButton_1, exports);
|
8
|
-
Object.defineProperty(exports, "buttonClassNames", { enumerable: true, get: function () { return useButtonStyles_1.buttonClassNames; } });
|
9
|
-
Object.defineProperty(exports, "useButtonStyles_unstable", { enumerable: true, get: function () { return useButtonStyles_1.useButtonStyles_unstable; } });
|
10
|
-
});
|
11
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/index.ts"],"names":[],"mappings":";;;;IAAA,wCAAyB;IAGzB,8CAA+B;IAC/B,2CAA4B;IACnB,mHAAA,gBAAgB,OAAA;IAAE,2HAAA,wBAAwB,OAAA","sourcesContent":["export * from './Button';\n// Explicit exports to omit ButtonCommons\nexport type { ButtonProps, ButtonSlots, ButtonState } from './Button.types';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.renderButton_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Renders a Button component by passing the state defined props to the appropriate slots.
|
7
|
-
*/
|
8
|
-
var renderButton_unstable = function (state) {
|
9
|
-
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
-
var iconOnly = state.iconOnly, iconPosition = state.iconPosition;
|
11
|
-
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
12
|
-
iconPosition !== 'after' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
|
13
|
-
!iconOnly && state.root.children,
|
14
|
-
iconPosition === 'after' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon))));
|
15
|
-
};
|
16
|
-
exports.renderButton_unstable = renderButton_unstable;
|
17
|
-
});
|
18
|
-
//# sourceMappingURL=renderButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"renderButton.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/renderButton.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,qBAAqB,GAAG,UAAC,KAAkB;QAChD,IAAA,KAAuB,0BAAQ,CAAc,KAAK,CAAC,EAAjD,KAAK,WAAA,EAAE,SAAS,eAAiC,CAAC;QAClD,IAAA,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEzC,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,YAAY,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC5E,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ;YAChC,YAAY,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAClE,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,qBAAqB,yBAWhC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = (state: ButtonState) => {\n const { slots, slotProps } = getSlots<ButtonSlots>(state);\n const { iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && state.root.children}\n {iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@fluentui/react-aria", "@fluentui/react-utilities", "../../contexts/ButtonContext"], function (require, exports, react_aria_1, react_utilities_1, ButtonContext_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useButton_unstable = void 0;
|
5
|
-
/**
|
6
|
-
* Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
|
7
|
-
* @param props - User provided props to the Button component.
|
8
|
-
* @param ref - User provided ref to be passed to the Button component.
|
9
|
-
*/
|
10
|
-
var useButton_unstable = function (props, ref) {
|
11
|
-
var contextSize = ButtonContext_1.useButtonContext().size;
|
12
|
-
var _a = props.appearance, appearance = _a === void 0 ? 'secondary' : _a, _b = props.as, as = _b === void 0 ? 'button' : _b, _c = props.disabled, disabled = _c === void 0 ? false : _c, _d = props.disabledFocusable, disabledFocusable = _d === void 0 ? false : _d, icon = props.icon, _e = props.iconPosition, iconPosition = _e === void 0 ? 'before' : _e, _f = props.shape, shape = _f === void 0 ? 'rounded' : _f, _g = props.size, size = _g === void 0 ? contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' : _g;
|
13
|
-
var iconShorthand = react_utilities_1.resolveShorthand(icon);
|
14
|
-
return {
|
15
|
-
// Props passed at the top-level
|
16
|
-
appearance: appearance,
|
17
|
-
disabled: disabled,
|
18
|
-
disabledFocusable: disabledFocusable,
|
19
|
-
iconPosition: iconPosition,
|
20
|
-
shape: shape,
|
21
|
-
size: size,
|
22
|
-
// State calculated from a set of props
|
23
|
-
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
|
24
|
-
// Slots definition
|
25
|
-
components: {
|
26
|
-
root: 'button',
|
27
|
-
icon: 'span',
|
28
|
-
},
|
29
|
-
root: react_utilities_1.getNativeElementProps(as, react_aria_1.useARIAButtonShorthand(props, {
|
30
|
-
required: true,
|
31
|
-
defaultProps: {
|
32
|
-
ref: ref,
|
33
|
-
type: 'button',
|
34
|
-
},
|
35
|
-
})),
|
36
|
-
icon: iconShorthand,
|
37
|
-
};
|
38
|
-
};
|
39
|
-
exports.useButton_unstable = useButton_unstable;
|
40
|
-
});
|
41
|
-
//# sourceMappingURL=useButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useButton.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/useButton.ts"],"names":[],"mappings":";;;;IAMA;;;;OAIG;IACI,IAAM,kBAAkB,GAAG,UAChC,KAAkB,EAClB,GAAqD;QAE7C,IAAM,WAAW,GAAK,gCAAgB,EAAE,KAAvB,CAAwB;QAE/C,IAAA,KAQE,KAAK,WARiB,EAAxB,UAAU,mBAAG,WAAW,KAAA,EACxB,KAOE,KAAK,GAPM,EAAb,EAAE,mBAAG,QAAQ,KAAA,EACb,KAME,KAAK,SANS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,KAKE,KAAK,kBALkB,EAAzB,iBAAiB,mBAAG,KAAK,KAAA,EACzB,IAAI,GAIF,KAAK,KAJH,EACJ,KAGE,KAAK,aAHgB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,KAEE,KAAK,MAFU,EAAjB,KAAK,mBAAG,SAAS,KAAA,EACjB,KACE,KAAK,KADuB,EAA9B,IAAI,mBAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,KAAA,CACtB;QACV,IAAM,aAAa,GAAG,kCAAgB,CAAC,IAAI,CAAC,CAAC;QAE7C,OAAO;YACL,gCAAgC;YAChC,UAAU,YAAA;YACV,QAAQ,UAAA;YACR,iBAAiB,mBAAA;YACjB,YAAY,cAAA;YACZ,KAAK,OAAA;YACL,IAAI,MAAA;YAEJ,uCAAuC;YACvC,QAAQ,EAAE,OAAO,CAAC,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,KAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAE7D,mBAAmB;YACnB,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,MAAM;aACb;YAED,IAAI,EAAE,uCAAqB,CACzB,EAAE,EACF,mCAAsB,CAA2B,KAAK,EAAE;gBACtD,QAAQ,EAAE,IAAI;gBACd,YAAY,EAAE;oBACZ,GAAG,EAAE,GAAuD;oBAC5D,IAAI,EAAE,QAAQ;iBACf;aACF,CAAC,CACH;YACD,IAAI,EAAE,aAAa;SACpB,CAAC;IACJ,CAAC,CAAC;IA/CW,QAAA,kBAAkB,sBA+C7B","sourcesContent":["import * as React from 'react';\nimport { ARIAButtonSlotProps, useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\nimport type { ButtonProps, ButtonState } from './Button.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useButton_unstable = (\n props: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ButtonState => {\n const { size: contextSize } = useButtonContext();\n const {\n appearance = 'secondary',\n as = 'button',\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n shape = 'rounded',\n size = contextSize ?? 'medium',\n } = props;\n const iconShorthand = resolveShorthand(icon);\n\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n\n // State calculated from a set of props\n iconOnly: Boolean(iconShorthand?.children && !props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n },\n\n root: getNativeElementProps(\n as,\n useARIAButtonShorthand<ARIAButtonSlotProps<'a'>>(props, {\n required: true,\n defaultProps: {\n ref: ref as React.Ref<HTMLButtonElement & HTMLAnchorElement>,\n type: 'button',\n },\n }),\n ),\n icon: iconShorthand,\n };\n};\n"]}
|
@@ -1,227 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-icons", "@fluentui/react-tabster", "@fluentui/react-theme", "@griffel/react"], function (require, exports, tslib_1, react_icons_1, react_tabster_1, react_theme_1, react_1) {
|
2
|
-
"use strict";
|
3
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
exports.useButtonStyles_unstable = exports.buttonClassNames = void 0;
|
6
|
-
exports.buttonClassNames = {
|
7
|
-
root: 'fui-Button',
|
8
|
-
icon: 'fui-Button__icon',
|
9
|
-
};
|
10
|
-
var iconSpacingVar = '--fui-Button__icon--spacing';
|
11
|
-
var buttonSpacingSmall = '3px';
|
12
|
-
var buttonSpacingSmallWithIcon = '1px';
|
13
|
-
var buttonSpacingMedium = '5px';
|
14
|
-
var buttonSpacingLarge = '8px';
|
15
|
-
var buttonSpacingLargeWithIcon = '7px';
|
16
|
-
var useRootBaseClassName = react_1.makeResetStyles(tslib_1.__assign({ alignItems: 'center', boxSizing: 'border-box', display: 'inline-flex', justifyContent: 'center', textDecorationLine: 'none', verticalAlign: 'middle', margin: 0, overflow: 'hidden', backgroundColor: react_theme_1.tokens.colorNeutralBackground1, color: react_theme_1.tokens.colorNeutralForeground1, border: react_theme_1.tokens.strokeWidthThin + " solid " + react_theme_1.tokens.colorNeutralStroke1, fontFamily: react_theme_1.tokens.fontFamilyBase, outlineStyle: 'none', ':hover': (_a = {
|
17
|
-
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Hover,
|
18
|
-
borderColor: react_theme_1.tokens.colorNeutralStroke1Hover,
|
19
|
-
color: react_theme_1.tokens.colorNeutralForeground1Hover,
|
20
|
-
cursor: 'pointer'
|
21
|
-
},
|
22
|
-
_a["& ." + react_icons_1.iconFilledClassName] = {
|
23
|
-
display: 'inline',
|
24
|
-
},
|
25
|
-
_a["& ." + react_icons_1.iconRegularClassName] = {
|
26
|
-
display: 'none',
|
27
|
-
},
|
28
|
-
_a), ':hover:active': (_b = {
|
29
|
-
backgroundColor: react_theme_1.tokens.colorNeutralBackground1Pressed,
|
30
|
-
borderColor: react_theme_1.tokens.colorNeutralStroke1Pressed,
|
31
|
-
color: react_theme_1.tokens.colorNeutralForeground1Pressed,
|
32
|
-
outlineStyle: 'none'
|
33
|
-
},
|
34
|
-
_b["& ." + react_icons_1.iconFilledClassName] = {
|
35
|
-
display: 'inline',
|
36
|
-
},
|
37
|
-
_b["& ." + react_icons_1.iconRegularClassName] = {
|
38
|
-
display: 'none',
|
39
|
-
},
|
40
|
-
_b), padding: buttonSpacingMedium + " " + react_theme_1.tokens.spacingHorizontalM, minWidth: '96px', borderRadius: react_theme_1.tokens.borderRadiusMedium, fontSize: react_theme_1.tokens.fontSizeBase300, fontWeight: react_theme_1.tokens.fontWeightSemibold, lineHeight: react_theme_1.tokens.lineHeightBase300,
|
41
|
-
// Transition styles
|
42
|
-
transitionDuration: react_theme_1.tokens.durationFaster, transitionProperty: 'background, border, color', transitionTimingFunction: react_theme_1.tokens.curveEasyEase, '@media screen and (prefers-reduced-motion: reduce)': {
|
43
|
-
transitionDuration: '0.01ms',
|
44
|
-
},
|
45
|
-
// High contrast styles
|
46
|
-
'@media (forced-colors: active)': {
|
47
|
-
':focus': {
|
48
|
-
borderColor: 'ButtonText',
|
49
|
-
},
|
50
|
-
':hover': {
|
51
|
-
backgroundColor: 'HighlightText',
|
52
|
-
borderColor: 'Highlight',
|
53
|
-
color: 'Highlight',
|
54
|
-
forcedColorAdjust: 'none',
|
55
|
-
},
|
56
|
-
':hover:active': {
|
57
|
-
backgroundColor: 'HighlightText',
|
58
|
-
borderColor: 'Highlight',
|
59
|
-
color: 'Highlight',
|
60
|
-
forcedColorAdjust: 'none',
|
61
|
-
},
|
62
|
-
} }, react_tabster_1.createCustomFocusIndicatorStyle({
|
63
|
-
borderColor: react_theme_1.tokens.colorTransparentStroke,
|
64
|
-
borderRadius: react_theme_1.tokens.borderRadiusMedium,
|
65
|
-
outline: react_theme_1.tokens.strokeWidthThick + " solid " + react_theme_1.tokens.colorTransparentStroke,
|
66
|
-
boxShadow: "\n " + react_theme_1.tokens.shadow4 + ",\n 0 0 0 2px " + react_theme_1.tokens.colorStrokeFocus2 + "\n ",
|
67
|
-
zIndex: 1,
|
68
|
-
})));
|
69
|
-
var useIconBaseClassName = react_1.makeResetStyles((_c = {
|
70
|
-
alignItems: 'center',
|
71
|
-
display: 'inline-flex',
|
72
|
-
justifyContent: 'center',
|
73
|
-
fontSize: '20px',
|
74
|
-
height: '20px',
|
75
|
-
width: '20px'
|
76
|
-
},
|
77
|
-
_c[iconSpacingVar] = react_theme_1.tokens.spacingHorizontalSNudge,
|
78
|
-
_c));
|
79
|
-
var useRootStyles = react_1.makeStyles({
|
80
|
-
// Appearance variations
|
81
|
-
outline: {
|
82
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
83
|
-
':hover': {
|
84
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundHover,
|
85
|
-
},
|
86
|
-
':hover:active': {
|
87
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackgroundPressed,
|
88
|
-
},
|
89
|
-
},
|
90
|
-
primary: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorBrandBackground }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForegroundOnBrand, ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorBrandBackgroundHover }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForegroundOnBrand }), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorBrandBackgroundPressed }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForegroundOnBrand }), '@media (forced-colors: active)': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'Highlight' }, react_1.shorthands.borderColor('HighlightText')), { color: 'HighlightText', forcedColorAdjust: 'none', ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'HighlightText' }, react_1.shorthands.borderColor('Highlight')), { color: 'Highlight' }), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'HighlightText' }, react_1.shorthands.borderColor('Highlight')), { color: 'Highlight' }) }) }),
|
91
|
-
secondary: {
|
92
|
-
/* The secondary styles are exactly the same as the base styles. */
|
93
|
-
},
|
94
|
-
subtle: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorSubtleBackground }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForeground2, ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundHover }, react_1.shorthands.borderColor('transparent')), (_d = { color: react_theme_1.tokens.colorNeutralForeground2Hover }, _d["& ." + exports.buttonClassNames.icon] = {
|
95
|
-
color: react_theme_1.tokens.colorNeutralForeground2BrandHover,
|
96
|
-
}, _d)), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorSubtleBackgroundPressed }, react_1.shorthands.borderColor('transparent')), (_e = { color: react_theme_1.tokens.colorNeutralForeground2Pressed }, _e["& ." + exports.buttonClassNames.icon] = {
|
97
|
-
color: react_theme_1.tokens.colorNeutralForeground2BrandPressed,
|
98
|
-
}, _e)) }),
|
99
|
-
transparent: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForeground2, ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundHover }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForeground2BrandHover }), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackgroundPressed }, react_1.shorthands.borderColor('transparent')), { color: react_theme_1.tokens.colorNeutralForeground2BrandPressed }) }),
|
100
|
-
// Shape variations
|
101
|
-
circular: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)),
|
102
|
-
rounded: {
|
103
|
-
/* The borderRadius rounded styles are handled in the size variations */
|
104
|
-
},
|
105
|
-
square: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone)),
|
106
|
-
// Size variations
|
107
|
-
small: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ minWidth: '64px' }, react_1.shorthands.padding(buttonSpacingSmall, react_theme_1.tokens.spacingHorizontalS)), react_1.shorthands.borderRadius(buttonSpacingSmall)), { fontSize: react_theme_1.tokens.fontSizeBase200, fontWeight: react_theme_1.tokens.fontWeightRegular, lineHeight: react_theme_1.tokens.lineHeightBase200 }),
|
108
|
-
smallWithIcon: {
|
109
|
-
paddingBottom: buttonSpacingSmallWithIcon,
|
110
|
-
paddingTop: buttonSpacingSmallWithIcon,
|
111
|
-
},
|
112
|
-
medium: {
|
113
|
-
/* defined in base styles */
|
114
|
-
},
|
115
|
-
large: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ minWidth: '96px' }, react_1.shorthands.padding(buttonSpacingLarge, react_theme_1.tokens.spacingHorizontalL)), react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)), { fontSize: react_theme_1.tokens.fontSizeBase400, fontWeight: react_theme_1.tokens.fontWeightSemibold, lineHeight: react_theme_1.tokens.lineHeightBase400 }),
|
116
|
-
largeWithIcon: {
|
117
|
-
paddingBottom: buttonSpacingLargeWithIcon,
|
118
|
-
paddingTop: buttonSpacingLargeWithIcon,
|
119
|
-
},
|
120
|
-
});
|
121
|
-
var useRootDisabledStyles = react_1.makeStyles({
|
122
|
-
// Base styles
|
123
|
-
base: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackgroundDisabled }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), { color: react_theme_1.tokens.colorNeutralForegroundDisabled, cursor: 'not-allowed', ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackgroundDisabled }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), (_f = { color: react_theme_1.tokens.colorNeutralForegroundDisabled, cursor: 'not-allowed' }, _f["& ." + react_icons_1.iconFilledClassName] = {
|
124
|
-
display: 'none',
|
125
|
-
}, _f["& ." + react_icons_1.iconRegularClassName] = {
|
126
|
-
display: 'inline',
|
127
|
-
}, _f)), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackgroundDisabled }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeDisabled)), (_g = { color: react_theme_1.tokens.colorNeutralForegroundDisabled, cursor: 'not-allowed' }, _g["& ." + react_icons_1.iconFilledClassName] = {
|
128
|
-
display: 'none',
|
129
|
-
}, _g["& ." + react_icons_1.iconRegularClassName] = {
|
130
|
-
display: 'inline',
|
131
|
-
}, _g)) }),
|
132
|
-
// High contrast styles
|
133
|
-
highContrast: {
|
134
|
-
'@media (forced-colors: active)': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'ButtonFace' }, react_1.shorthands.borderColor('GrayText')), { color: 'GrayText', ':focus': tslib_1.__assign({}, react_1.shorthands.borderColor('GrayText')), ':hover': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'ButtonFace' }, react_1.shorthands.borderColor('GrayText')), { color: 'GrayText' }), ':hover:active': tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'ButtonFace' }, react_1.shorthands.borderColor('GrayText')), { color: 'GrayText' }) }),
|
135
|
-
},
|
136
|
-
// Appearance variations
|
137
|
-
outline: {
|
138
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
139
|
-
':hover': {
|
140
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
141
|
-
},
|
142
|
-
':hover:active': {
|
143
|
-
backgroundColor: react_theme_1.tokens.colorTransparentBackground,
|
144
|
-
},
|
145
|
-
},
|
146
|
-
primary: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor('transparent')), { ':hover': tslib_1.__assign({}, react_1.shorthands.borderColor('transparent')), ':hover:active': tslib_1.__assign({}, react_1.shorthands.borderColor('transparent')) }),
|
147
|
-
secondary: {
|
148
|
-
/* The secondary styles are exactly the same as the base styles. */
|
149
|
-
},
|
150
|
-
subtle: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')), { ':hover': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')), ':hover:active': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')) }),
|
151
|
-
transparent: tslib_1.__assign(tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')), { ':hover': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')), ':hover:active': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorTransparentBackground }, react_1.shorthands.borderColor('transparent')) }),
|
152
|
-
});
|
153
|
-
var useRootFocusStyles = react_1.makeStyles({
|
154
|
-
// Shape variations
|
155
|
-
circular: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular))),
|
156
|
-
rounded: {
|
157
|
-
/* The rounded styles are exactly the same as the base styles. */
|
158
|
-
},
|
159
|
-
square: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone))),
|
160
|
-
// Primary styles
|
161
|
-
primary: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralForegroundOnBrand)), { boxShadow: react_theme_1.tokens.shadow2 + ", 0 0 0 2px " + react_theme_1.tokens.colorStrokeFocus2 })),
|
162
|
-
// Size variations
|
163
|
-
small: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusSmall))),
|
164
|
-
medium: {
|
165
|
-
/* defined in base styles */
|
166
|
-
},
|
167
|
-
large: react_tabster_1.createCustomFocusIndicatorStyle(tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusLarge))),
|
168
|
-
});
|
169
|
-
var useRootIconOnlyStyles = react_1.makeStyles({
|
170
|
-
// Size variations
|
171
|
-
small: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.padding(buttonSpacingSmallWithIcon)), { minWidth: '24px', maxWidth: '24px' }),
|
172
|
-
medium: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.padding(buttonSpacingMedium)), { minWidth: '32px', maxWidth: '32px' }),
|
173
|
-
large: tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.padding(buttonSpacingLargeWithIcon)), { minWidth: '40px', maxWidth: '40px' }),
|
174
|
-
});
|
175
|
-
var useIconStyles = react_1.makeStyles({
|
176
|
-
// Size variations
|
177
|
-
small: (_h = {
|
178
|
-
fontSize: '20px',
|
179
|
-
height: '20px',
|
180
|
-
width: '20px'
|
181
|
-
},
|
182
|
-
_h[iconSpacingVar] = react_theme_1.tokens.spacingHorizontalXS,
|
183
|
-
_h),
|
184
|
-
medium: {
|
185
|
-
/* defined in base styles */
|
186
|
-
},
|
187
|
-
large: (_j = {
|
188
|
-
fontSize: '24px',
|
189
|
-
height: '24px',
|
190
|
-
width: '24px'
|
191
|
-
},
|
192
|
-
_j[iconSpacingVar] = react_theme_1.tokens.spacingHorizontalSNudge,
|
193
|
-
_j),
|
194
|
-
// Icon position variations
|
195
|
-
before: {
|
196
|
-
marginRight: "var(" + iconSpacingVar + ")",
|
197
|
-
},
|
198
|
-
after: {
|
199
|
-
marginLeft: "var(" + iconSpacingVar + ")",
|
200
|
-
},
|
201
|
-
});
|
202
|
-
var useButtonStyles_unstable = function (state) {
|
203
|
-
var rootBaseClassName = useRootBaseClassName();
|
204
|
-
var iconBaseClassName = useIconBaseClassName();
|
205
|
-
var rootStyles = useRootStyles();
|
206
|
-
var rootDisabledStyles = useRootDisabledStyles();
|
207
|
-
var rootFocusStyles = useRootFocusStyles();
|
208
|
-
var rootIconOnlyStyles = useRootIconOnlyStyles();
|
209
|
-
var iconStyles = useIconStyles();
|
210
|
-
var appearance = state.appearance, disabled = state.disabled, disabledFocusable = state.disabledFocusable, icon = state.icon, iconOnly = state.iconOnly, iconPosition = state.iconPosition, shape = state.shape, size = state.size;
|
211
|
-
state.root.className = react_1.mergeClasses(exports.buttonClassNames.root, rootBaseClassName, appearance && rootStyles[appearance], rootStyles[size], icon && size === 'small' && rootStyles.smallWithIcon, icon && size === 'large' && rootStyles.largeWithIcon, rootStyles[shape],
|
212
|
-
// Disabled styles
|
213
|
-
(disabled || disabledFocusable) && rootDisabledStyles.base, (disabled || disabledFocusable) && rootDisabledStyles.highContrast, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],
|
214
|
-
// Focus styles
|
215
|
-
appearance === 'primary' && rootFocusStyles.primary, rootFocusStyles[size], rootFocusStyles[shape],
|
216
|
-
// Icon-only styles
|
217
|
-
iconOnly && rootIconOnlyStyles[size],
|
218
|
-
// User provided class name
|
219
|
-
state.root.className);
|
220
|
-
if (state.icon) {
|
221
|
-
state.icon.className = react_1.mergeClasses(exports.buttonClassNames.icon, iconBaseClassName, state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition], iconStyles[size], state.icon.className);
|
222
|
-
}
|
223
|
-
return state;
|
224
|
-
};
|
225
|
-
exports.useButtonStyles_unstable = useButtonStyles_unstable;
|
226
|
-
});
|
227
|
-
//# sourceMappingURL=useButtonStyles.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useButtonStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/Button/useButtonStyles.ts"],"names":[],"mappings":";;;;;IAOa,QAAA,gBAAgB,GAAgC;QAC3D,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,kBAAkB;KACzB,C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AK,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,UAAU,CAAC,YAAY,CAAC,EAC7F,UAAU,CAAC,IAAI,CAAC,EAChB,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAnDW,QAAA,wBAAwB,4BAmDnC","sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots, ButtonState } from './Button.types';\n\nexport const buttonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-Button',\n icon: 'fui-Button__icon',\n};\n\nconst iconSpacingVar = '--fui-Button__icon--spacing';\n\nconst buttonSpacingSmall = '3px';\nconst buttonSpacingSmallWithIcon = '1px';\nconst buttonSpacingMedium = '5px';\nconst buttonSpacingLarge = '8px';\nconst buttonSpacingLargeWithIcon = '7px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'inline-flex',\n justifyContent: 'center',\n textDecorationLine: 'none',\n verticalAlign: 'middle',\n\n margin: 0,\n overflow: 'hidden',\n\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n\n fontFamily: tokens.fontFamilyBase,\n outlineStyle: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground1Hover,\n\n cursor: 'pointer',\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground1Pressed,\n\n outlineStyle: 'none',\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n\n padding: `${buttonSpacingMedium} ${tokens.spacingHorizontalM}`,\n minWidth: '96px',\n borderRadius: tokens.borderRadiusMedium,\n\n fontSize: tokens.fontSizeBase300,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase300,\n\n // Transition styles\n\n transitionDuration: tokens.durationFaster,\n transitionProperty: 'background, border, color',\n transitionTimingFunction: tokens.curveEasyEase,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n },\n\n // High contrast styles\n\n '@media (forced-colors: active)': {\n ':focus': {\n borderColor: 'ButtonText',\n },\n\n ':hover': {\n backgroundColor: 'HighlightText',\n borderColor: 'Highlight',\n color: 'Highlight',\n forcedColorAdjust: 'none',\n },\n\n ':hover:active': {\n backgroundColor: 'HighlightText',\n borderColor: 'Highlight',\n color: 'Highlight',\n forcedColorAdjust: 'none',\n },\n },\n\n // Focus styles\n\n ...createCustomFocusIndicatorStyle({\n borderColor: tokens.colorTransparentStroke,\n borderRadius: tokens.borderRadiusMedium,\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorTransparentStroke}`,\n boxShadow: `\n ${tokens.shadow4},\n 0 0 0 2px ${tokens.colorStrokeFocus2}\n `,\n zIndex: 1,\n }),\n});\n\nconst useIconBaseClassName = makeResetStyles({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n\n fontSize: '20px',\n height: '20px',\n width: '20px',\n\n [iconSpacingVar]: tokens.spacingHorizontalSNudge,\n});\n\nconst useRootStyles = makeStyles({\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n },\n primary: {\n backgroundColor: tokens.colorBrandBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('HighlightText'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n\n ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':hover:active': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Pressed,\n\n [`& .${buttonClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n\n // Shape variations\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n rounded: {\n /* The borderRadius rounded styles are handled in the size variations */\n },\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n\n // Size variations\n small: {\n minWidth: '64px',\n ...shorthands.padding(buttonSpacingSmall, tokens.spacingHorizontalS),\n\n ...shorthands.borderRadius(buttonSpacingSmall),\n\n fontSize: tokens.fontSizeBase200,\n fontWeight: tokens.fontWeightRegular,\n lineHeight: tokens.lineHeightBase200,\n },\n smallWithIcon: {\n paddingBottom: buttonSpacingSmallWithIcon,\n paddingTop: buttonSpacingSmallWithIcon,\n },\n medium: {\n /* defined in base styles */\n },\n large: {\n minWidth: '96px',\n ...shorthands.padding(buttonSpacingLarge, tokens.spacingHorizontalL),\n\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n fontSize: tokens.fontSizeBase400,\n fontWeight: tokens.fontWeightSemibold,\n lineHeight: tokens.lineHeightBase400,\n },\n largeWithIcon: {\n paddingBottom: buttonSpacingLargeWithIcon,\n paddingTop: buttonSpacingLargeWithIcon,\n },\n});\n\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline',\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n cursor: 'not-allowed',\n\n [`& .${iconFilledClassName}`]: {\n display: 'none',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline',\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n\n ':focus': {\n ...shorthands.borderColor('GrayText'),\n },\n\n ':hover': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n },\n\n ':hover:active': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackground,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackground,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackground,\n },\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n ...shorthands.borderColor('transparent'),\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nconst useRootFocusStyles = makeStyles({\n // Shape variations\n circular: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n }),\n rounded: {\n /* The rounded styles are exactly the same as the base styles. */\n },\n square: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n }),\n\n // Primary styles\n primary: createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralForegroundOnBrand),\n boxShadow: `${tokens.shadow2}, 0 0 0 2px ${tokens.colorStrokeFocus2}`,\n }),\n\n // Size variations\n small: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n }),\n medium: {\n /* defined in base styles */\n },\n large: createCustomFocusIndicatorStyle({\n ...shorthands.borderRadius(tokens.borderRadiusLarge),\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding(buttonSpacingSmallWithIcon),\n\n minWidth: '24px',\n maxWidth: '24px',\n },\n medium: {\n ...shorthands.padding(buttonSpacingMedium),\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n ...shorthands.padding(buttonSpacingLargeWithIcon),\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Size variations\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n\n [iconSpacingVar]: tokens.spacingHorizontalXS,\n },\n medium: {\n /* defined in base styles */\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n\n [iconSpacingVar]: tokens.spacingHorizontalSNudge,\n },\n\n // Icon position variations\n before: {\n marginRight: `var(${iconSpacingVar})`,\n },\n after: {\n marginLeft: `var(${iconSpacingVar})`,\n },\n});\n\nexport const useButtonStyles_unstable = (state: ButtonState): ButtonState => {\n const rootBaseClassName = useRootBaseClassName();\n const iconBaseClassName = useIconBaseClassName();\n\n const rootStyles = useRootStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;\n\n state.root.className = mergeClasses(\n buttonClassNames.root,\n rootBaseClassName,\n\n appearance && rootStyles[appearance],\n\n rootStyles[size],\n icon && size === 'small' && rootStyles.smallWithIcon,\n icon && size === 'large' && rootStyles.largeWithIcon,\n rootStyles[shape],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base,\n (disabled || disabledFocusable) && rootDisabledStyles.highContrast,\n appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],\n\n // Focus styles\n appearance === 'primary' && rootFocusStyles.primary,\n rootFocusStyles[size],\n rootFocusStyles[shape],\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n buttonClassNames.icon,\n iconBaseClassName,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n iconStyles[size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"]}
|
@@ -1,18 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./renderCompoundButton", "./useCompoundButton", "./useCompoundButtonStyles", "@fluentui/react-shared-contexts"], function (require, exports, React, renderCompoundButton_1, useCompoundButton_1, useCompoundButtonStyles_1, react_shared_contexts_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.CompoundButton = void 0;
|
5
|
-
/**
|
6
|
-
* CompoundButtons are buttons that can have secondary content that adds extra information to the user.
|
7
|
-
*/
|
8
|
-
exports.CompoundButton = React.forwardRef(function (props, ref) {
|
9
|
-
var state = useCompoundButton_1.useCompoundButton_unstable(props, ref);
|
10
|
-
useCompoundButtonStyles_1.useCompoundButtonStyles_unstable(state);
|
11
|
-
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useCompoundButtonStyles_unstable;
|
12
|
-
useCustomStyles(state);
|
13
|
-
return renderCompoundButton_1.renderCompoundButton_unstable(state);
|
14
|
-
// Casting is required due to lack of distributive union to support unions on @types/react
|
15
|
-
});
|
16
|
-
exports.CompoundButton.displayName = 'CompoundButton';
|
17
|
-
});
|
18
|
-
//# sourceMappingURL=CompoundButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CompoundButton.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/CompoundButton/CompoundButton.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,cAAc,GAA6C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAClG,IAAM,KAAK,GAAG,8CAA0B,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAErD,0DAAgC,CAAC,KAAK,CAAC,CAAC;QAEhC,IAAkC,eAAe,GAAK,oDAA4B,EAAE,iCAAnC,CAAoC;QAC7F,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,oDAA6B,CAAC,KAAK,CAAC,CAAC;QAC5C,0FAA0F;IAC5F,CAAC,CAA6C,CAAC;IAE/C,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import * as React from 'react';\nimport { renderCompoundButton_unstable } from './renderCompoundButton';\nimport { useCompoundButton_unstable } from './useCompoundButton';\nimport { useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { CompoundButtonProps } from './CompoundButton.types';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * CompoundButtons are buttons that can have secondary content that adds extra information to the user.\n */\nexport const CompoundButton: ForwardRefComponent<CompoundButtonProps> = React.forwardRef((props, ref) => {\n const state = useCompoundButton_unstable(props, ref);\n\n useCompoundButtonStyles_unstable(state);\n\n const { useCompoundButtonStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderCompoundButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<CompoundButtonProps>;\n\nCompoundButton.displayName = 'CompoundButton';\n"]}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CompoundButton.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/CompoundButton/CompoundButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { ButtonProps, ButtonSlots, ButtonState } from '../Button/Button.types';\n\nexport type CompoundButtonSlots = ButtonSlots & {\n /**\n * Second line of text that describes the action this button takes.\n */\n secondaryContent?: Slot<'span'>;\n\n /**\n * Container that wraps the children and the secondaryContent slot.\n */\n contentContainer: NonNullable<Slot<'span'>>;\n};\n\nexport type CompoundButtonProps = ComponentProps<Partial<CompoundButtonSlots>> &\n Pick<ButtonProps, 'appearance' | 'disabledFocusable' | 'disabled' | 'iconPosition' | 'shape' | 'size'>;\n\nexport type CompoundButtonState = ComponentState<CompoundButtonSlots> &\n Omit<ButtonState, keyof ButtonSlots | 'components'>;\n"]}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./CompoundButton", "./CompoundButton.types", "./renderCompoundButton", "./useCompoundButton", "./useCompoundButtonStyles"], function (require, exports, tslib_1, CompoundButton_1, CompoundButton_types_1, renderCompoundButton_1, useCompoundButton_1, useCompoundButtonStyles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useCompoundButtonStyles_unstable = exports.compoundButtonClassNames = void 0;
|
5
|
-
tslib_1.__exportStar(CompoundButton_1, exports);
|
6
|
-
tslib_1.__exportStar(CompoundButton_types_1, exports);
|
7
|
-
tslib_1.__exportStar(renderCompoundButton_1, exports);
|
8
|
-
tslib_1.__exportStar(useCompoundButton_1, exports);
|
9
|
-
Object.defineProperty(exports, "compoundButtonClassNames", { enumerable: true, get: function () { return useCompoundButtonStyles_1.compoundButtonClassNames; } });
|
10
|
-
Object.defineProperty(exports, "useCompoundButtonStyles_unstable", { enumerable: true, get: function () { return useCompoundButtonStyles_1.useCompoundButtonStyles_unstable; } });
|
11
|
-
});
|
12
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-button/src/components/CompoundButton/index.ts"],"names":[],"mappings":";;;;IAAA,gDAAiC;IACjC,sDAAuC;IACvC,sDAAuC;IACvC,mDAAoC;IAC3B,mIAAA,wBAAwB,OAAA;IAAE,2IAAA,gCAAgC,OAAA","sourcesContent":["export * from './CompoundButton';\nexport * from './CompoundButton.types';\nexport * from './renderCompoundButton';\nexport * from './useCompoundButton';\nexport { compoundButtonClassNames, useCompoundButtonStyles_unstable } from './useCompoundButtonStyles';\n"]}
|