@fluentui/react-button 9.0.0-alpha.10 → 9.0.0-alpha.100
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +2418 -1
- package/CHANGELOG.md +920 -2
- package/README.md +19 -108
- package/dist/demo/index.html +71 -0
- package/dist/demo/react-dom.development.js +21413 -0
- package/dist/demo/react.development.js +3155 -0
- package/dist/react-button.d.ts +204 -82
- package/lib/Button.js.map +1 -1
- package/lib/CompoundButton.d.ts +1 -0
- package/lib/CompoundButton.js +2 -0
- package/lib/CompoundButton.js.map +1 -0
- package/lib/MenuButton.d.ts +1 -0
- package/lib/MenuButton.js +2 -0
- package/lib/MenuButton.js.map +1 -0
- package/lib/SplitButton.d.ts +1 -0
- package/lib/SplitButton.js +2 -0
- package/lib/SplitButton.js.map +1 -0
- package/lib/ToggleButton.d.ts +1 -0
- package/lib/ToggleButton.js +2 -0
- package/lib/ToggleButton.js.map +1 -0
- package/lib/common/isConformant.d.ts +4 -2
- package/lib/common/isConformant.js +9 -6
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Button/Button.d.ts +4 -11
- package/lib/components/Button/Button.js +7 -16
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +57 -60
- package/lib/components/Button/Button.types.js +1 -0
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.d.ts +1 -2
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.d.ts +2 -2
- package/lib/components/Button/renderButton.js +9 -8
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +5 -7
- package/lib/components/Button/useButton.js +49 -23
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +10 -4
- package/lib/components/Button/useButtonStyles.js +350 -378
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.d.ts +6 -0
- package/lib/components/CompoundButton/CompoundButton.js +15 -0
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +14 -0
- package/lib/components/CompoundButton/CompoundButton.types.js +2 -0
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -0
- package/lib/components/CompoundButton/index.d.ts +5 -0
- package/lib/components/CompoundButton/index.js +6 -0
- package/lib/components/CompoundButton/index.js.map +1 -0
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +5 -0
- package/lib/components/CompoundButton/renderCompoundButton.js +17 -0
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButton.d.ts +8 -0
- package/lib/components/CompoundButton/useCompoundButton.js +29 -0
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +164 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.d.ts +6 -0
- package/lib/components/MenuButton/MenuButton.js +15 -0
- package/lib/components/MenuButton/MenuButton.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.types.d.ts +11 -0
- package/lib/components/MenuButton/MenuButton.types.js +2 -0
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -0
- package/lib/components/MenuButton/index.d.ts +5 -0
- package/lib/components/MenuButton/index.js +6 -0
- package/lib/components/MenuButton/index.js.map +1 -0
- package/lib/components/MenuButton/renderMenuButton.d.ts +5 -0
- package/lib/components/MenuButton/renderMenuButton.js +17 -0
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -0
- package/lib/components/MenuButton/useMenuButton.d.ts +6 -0
- package/lib/components/MenuButton/useMenuButton.js +32 -0
- package/lib/components/MenuButton/useMenuButton.js.map +1 -0
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js +34 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib/components/SplitButton/SplitButton.js +16 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.types.d.ts +19 -0
- package/lib/components/SplitButton/SplitButton.types.js +2 -0
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
- package/lib/components/SplitButton/index.d.ts +5 -0
- package/lib/components/SplitButton/index.js +6 -0
- package/lib/components/SplitButton/index.js.map +1 -0
- package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
- package/lib/components/SplitButton/renderSplitButton.js +15 -0
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib/components/SplitButton/useSplitButton.d.ts +8 -0
- package/lib/components/SplitButton/useSplitButton.js +73 -0
- package/lib/components/SplitButton/useSplitButton.js.map +1 -0
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js +77 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.d.ts +6 -0
- package/lib/components/ToggleButton/ToggleButton.js +15 -0
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +19 -0
- package/lib/components/ToggleButton/ToggleButton.types.js +2 -0
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -0
- package/lib/components/ToggleButton/index.d.ts +5 -0
- package/lib/components/ToggleButton/index.js +6 -0
- package/lib/components/ToggleButton/index.js.map +1 -0
- package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib/components/ToggleButton/renderToggleButton.js +2 -0
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButton.d.ts +9 -0
- package/lib/components/ToggleButton/useToggleButton.js +50 -0
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js +190 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Button.js +7 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.d.ts +1 -0
- package/lib-commonjs/CompoundButton.js +10 -0
- package/lib-commonjs/CompoundButton.js.map +1 -0
- package/lib-commonjs/MenuButton.d.ts +1 -0
- package/lib-commonjs/MenuButton.js +10 -0
- package/lib-commonjs/MenuButton.js.map +1 -0
- package/lib-commonjs/SplitButton.d.ts +1 -0
- package/lib-commonjs/SplitButton.js +10 -0
- package/lib-commonjs/SplitButton.js.map +1 -0
- package/lib-commonjs/ToggleButton.d.ts +1 -0
- package/lib-commonjs/ToggleButton.js +10 -0
- package/lib-commonjs/ToggleButton.js.map +1 -0
- package/lib-commonjs/common/isConformant.d.ts +4 -2
- package/lib-commonjs/common/isConformant.js +19 -8
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Button/Button.d.ts +4 -11
- package/lib-commonjs/components/Button/Button.js +20 -20
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +57 -60
- package/lib-commonjs/components/Button/Button.types.js +4 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.d.ts +1 -2
- package/lib-commonjs/components/Button/index.js +21 -5
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.d.ts +2 -2
- package/lib-commonjs/components/Button/renderButton.js +24 -13
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.d.ts +5 -7
- package/lib-commonjs/components/Button/useButton.js +59 -24
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +10 -4
- package/lib-commonjs/components/Button/useButtonStyles.js +360 -379
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +6 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +26 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +14 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +6 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/index.d.ts +5 -0
- package/lib-commonjs/components/CompoundButton/index.js +26 -0
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +5 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +29 -0
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +8 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +41 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +175 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.d.ts +6 -0
- package/lib-commonjs/components/MenuButton/MenuButton.js +26 -0
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +11 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.js +6 -0
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -0
- package/lib-commonjs/components/MenuButton/index.d.ts +5 -0
- package/lib-commonjs/components/MenuButton/index.js +26 -0
- package/lib-commonjs/components/MenuButton/index.js.map +1 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +5 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +29 -0
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +6 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.js +46 -0
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +44 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js +27 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +19 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
- package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
- package/lib-commonjs/components/SplitButton/index.js +26 -0
- package/lib-commonjs/components/SplitButton/index.js.map +1 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +27 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +8 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.js +86 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +88 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +6 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +26 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +19 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +6 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/index.d.ts +5 -0
- package/lib-commonjs/components/ToggleButton/index.js +26 -0
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +16 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +9 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +63 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +200 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib-commonjs/index.d.ts +4 -0
- package/lib-commonjs/index.js +15 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +21 -14
- package/config/api-extractor.json +0 -3
- package/config/pre-copy.json +0 -9
- package/config/tests.js +0 -6
- package/etc/react-button.api.md +0 -104
- package/just.config.ts +0 -3
- package/lib/components/Button/useButtonState.d.ts +0 -6
- package/lib/components/Button/useButtonState.js +0 -45
- package/lib/components/Button/useButtonState.js.map +0 -1
- package/lib-amd/Button.d.ts +0 -1
- package/lib-amd/Button.js +0 -6
- package/lib-amd/Button.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -2
- package/lib-amd/common/isConformant.js +0 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Button/Button.d.ts +0 -13
- package/lib-amd/components/Button/Button.js +0 -24
- package/lib-amd/components/Button/Button.js.map +0 -1
- package/lib-amd/components/Button/Button.types.d.ts +0 -65
- 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.d.ts +0 -6
- package/lib-amd/components/Button/index.js +0 -10
- package/lib-amd/components/Button/index.js.map +0 -1
- package/lib-amd/components/Button/renderButton.d.ts +0 -5
- package/lib-amd/components/Button/renderButton.js +0 -16
- package/lib-amd/components/Button/renderButton.js.map +0 -1
- package/lib-amd/components/Button/useButton.d.ts +0 -10
- package/lib-amd/components/Button/useButton.js +0 -28
- package/lib-amd/components/Button/useButton.js.map +0 -1
- package/lib-amd/components/Button/useButtonState.d.ts +0 -6
- package/lib-amd/components/Button/useButtonState.js +0 -48
- package/lib-amd/components/Button/useButtonState.js.map +0 -1
- package/lib-amd/components/Button/useButtonStyles.d.ts +0 -4
- package/lib-amd/components/Button/useButtonStyles.js +0 -385
- package/lib-amd/components/Button/useButtonStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -1
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/lib-commonjs/components/Button/useButtonState.d.ts +0 -6
- package/lib-commonjs/components/Button/useButtonState.js +0 -47
- package/lib-commonjs/components/Button/useButtonState.js.map +0 -1
- package/src/components/Button/Button.types.ts +0 -120
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
package/lib/tsdoc-metadata.json
CHANGED
package/lib-commonjs/Button.js
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
4
9
|
tslib_1.__exportStar(require("./components/Button/index"), exports);
|
5
10
|
//# sourceMappingURL=Button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../src/Button.tsx"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/CompoundButton/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/CompoundButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/MenuButton/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/MenuButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,+BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/SplitButton/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/SplitButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/ToggleButton/index';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../src/ToggleButton.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,iCAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -1,2 +1,4 @@
|
|
1
|
-
import { IsConformantOptions } from '@fluentui/react-conformance';
|
2
|
-
export declare function isConformant(testInfo: Omit<IsConformantOptions
|
1
|
+
import type { IsConformantOptions } from '@fluentui/react-conformance';
|
2
|
+
export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
|
3
|
+
componentPath?: string;
|
4
|
+
}): void;
|
@@ -1,13 +1,24 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.isConformant = void 0;
|
7
|
+
|
8
|
+
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
+
|
10
|
+
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
+
|
4
12
|
function isConformant(testInfo) {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
var defaultOptions = {
|
14
|
+
asPropHandlesRef: true,
|
15
|
+
componentPath: module.parent.filename.replace('.test', ''),
|
16
|
+
disabledTests: ['has-docblock', 'kebab-aria-attributes'],
|
17
|
+
extraTests: react_conformance_make_styles_1.default,
|
18
|
+
skipAsPropTests: true
|
19
|
+
};
|
20
|
+
react_conformance_1.isConformant(defaultOptions, testInfo);
|
11
21
|
}
|
22
|
+
|
12
23
|
exports.isConformant = isConformant;
|
13
24
|
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,aAAa,EAAE,CAAC,cAAD,EAAiB,uBAAjB,CAH4C;AAI3D,IAAA,UAAU,EAAE,+BAAA,CAAA,OAJ+C;AAK3D,IAAA,eAAe,EAAE;AAL0C,GAA7D;AAQA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAZD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|
@@ -1,13 +1,6 @@
|
|
1
|
-
import
|
1
|
+
import type { ButtonProps } from './Button.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
2
3
|
/**
|
3
|
-
*
|
4
|
-
* {@docCategory Button}
|
4
|
+
* Buttons give people a way to trigger an action.
|
5
5
|
*/
|
6
|
-
export declare const Button:
|
7
|
-
icon?: import("@fluentui/react-utilities").ShorthandProps<React.HTMLAttributes<HTMLSpanElement>>;
|
8
|
-
disabled?: boolean | undefined;
|
9
|
-
iconOnly?: boolean | undefined;
|
10
|
-
iconPosition?: "after" | "before" | undefined;
|
11
|
-
primary?: boolean | undefined;
|
12
|
-
size?: "small" | "large" | undefined;
|
13
|
-
} & React.RefAttributes<HTMLElement>>;
|
6
|
+
export declare const Button: ForwardRefComponent<ButtonProps>;
|
@@ -1,26 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.Button = void 0;
|
7
|
+
|
8
|
+
var React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
var renderButton_1 = /*#__PURE__*/require("./renderButton");
|
11
|
+
|
12
|
+
var useButton_1 = /*#__PURE__*/require("./useButton");
|
13
|
+
|
14
|
+
var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
|
7
15
|
/**
|
8
|
-
*
|
9
|
-
* {@docCategory Button}
|
16
|
+
* Buttons give people a way to trigger an action.
|
10
17
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
disabled: state.disabled,
|
18
|
-
primary: state.primary,
|
19
|
-
iconOnly: receivedIcon && !receivedChildren,
|
20
|
-
size: state.size,
|
21
|
-
};
|
22
|
-
useButtonStyles_1.useButtonStyles(state, styleSelectors);
|
23
|
-
return renderButton_1.renderButton(state);
|
18
|
+
|
19
|
+
|
20
|
+
exports.Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
|
+
var state = useButton_1.useButton(props, ref);
|
22
|
+
useButtonStyles_1.useButtonStyles(state);
|
23
|
+
return renderButton_1.renderButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
24
24
|
});
|
25
25
|
exports.Button.displayName = 'Button';
|
26
26
|
//# sourceMappingURL=Button.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,IAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,MAAA,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAClF,MAAM,KAAK,GAAG,WAAA,CAAA,SAAA,CAAU,KAAV,EAAiB,GAAjB,CAAd;AAEA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,cAAA,CAAA,YAAA,CAAa,KAAb,CAAP,CALkF,CAMlF;AACD,CAPuD,CAA3C;AASb,OAAA,CAAA,MAAA,CAAO,WAAP,GAAqB,QAArB","sourceRoot":""}
|
@@ -1,65 +1,62 @@
|
|
1
|
-
import
|
2
|
-
import { ComponentProps,
|
3
|
-
|
4
|
-
export declare type ButtonProps = ComponentProps & React.ButtonHTMLAttributes<HTMLElement> & {
|
1
|
+
import { ARIAButtonShorthandProps } from '@fluentui/react-aria';
|
2
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
3
|
+
export declare type ButtonSlots = {
|
5
4
|
/**
|
6
|
-
*
|
7
|
-
* JSX. The `children` prop of the object can be a render function,
|
8
|
-
* taking in the original slot component and props.
|
5
|
+
* Root of the component that renders as either a <button> tag.
|
9
6
|
*/
|
10
|
-
|
11
|
-
/**
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
/** An icon button can format its icon to appear before or after its content. */
|
16
|
-
iconPosition?: 'before' | 'after';
|
17
|
-
/** A button can emphasize that it represents the primary action. */
|
18
|
-
primary?: boolean;
|
19
|
-
/** A button can be sized. */
|
20
|
-
size?: 'small' | 'large';
|
21
|
-
};
|
22
|
-
/**
|
23
|
-
* {@docCategory Button}
|
24
|
-
*/
|
25
|
-
export interface ButtonState extends ButtonProps {
|
26
|
-
ref: React.RefObject<HTMLButtonElement>;
|
27
|
-
icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLSpanElement>>;
|
28
|
-
children?: ObjectShorthandProps<React.HTMLAttributes<HTMLSpanElement>>;
|
29
|
-
}
|
30
|
-
export declare type ButtonStyleSelectors = {
|
31
|
-
disabled?: boolean;
|
32
|
-
iconOnly?: boolean;
|
33
|
-
primary?: boolean;
|
34
|
-
size?: string;
|
7
|
+
root: ARIAButtonShorthandProps;
|
8
|
+
/**
|
9
|
+
* Icon that renders either before or after the `children` as specified by the `iconPosition` prop.
|
10
|
+
*/
|
11
|
+
icon?: IntrinsicShorthandProps<'span'>;
|
35
12
|
};
|
36
|
-
export declare type
|
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
|
-
|
13
|
+
export declare type ButtonCommons = {
|
14
|
+
/**
|
15
|
+
* A button can have its content and borders styled for greater emphasis or to be subtle.
|
16
|
+
* - 'primary': Emphasizes the button as a primary action.
|
17
|
+
* - 'outline': Removes background styling.
|
18
|
+
* - 'subtle': Minimizes emphasis to blend into the background until hovered or focused.
|
19
|
+
* - 'transparent': Removes background and border styling.
|
20
|
+
*/
|
21
|
+
appearance?: 'primary' | 'outline' | 'subtle' | 'transparent';
|
22
|
+
/**
|
23
|
+
* A button can fill the width of its container.
|
24
|
+
* @default false
|
25
|
+
*/
|
26
|
+
block: boolean;
|
27
|
+
/**
|
28
|
+
* When set, allows the button to be focusable even when it has been disabled. This is used in scenarios where it
|
29
|
+
* is important to keep a consistent tab order for screen reader and keyboard users. The primary example of this
|
30
|
+
* pattern is when the disabled button is in a menu or a commandbar and is seldom used for standalone buttons.
|
31
|
+
* @default false
|
32
|
+
*/
|
33
|
+
disabledFocusable: boolean;
|
34
|
+
/**
|
35
|
+
* A button can show that it cannot be interacted with.
|
36
|
+
* @default false
|
37
|
+
*/
|
38
|
+
disabled: boolean;
|
39
|
+
/**
|
40
|
+
* A button can format its icon to appear before or after its content.
|
41
|
+
* @default 'before'
|
42
|
+
*/
|
43
|
+
iconPosition: 'before' | 'after';
|
44
|
+
/**
|
45
|
+
* A button can be rounded, circular, or square.
|
46
|
+
* @default 'rounded'
|
47
|
+
*/
|
48
|
+
shape: 'rounded' | 'circular' | 'square';
|
49
|
+
/**
|
50
|
+
* A button supports different sizes.
|
51
|
+
* @default 'medium'
|
52
|
+
*/
|
53
|
+
size: 'small' | 'medium' | 'large';
|
62
54
|
};
|
63
|
-
export declare type
|
64
|
-
|
55
|
+
export declare type ButtonProps = ComponentProps<ButtonSlots> & Partial<ButtonCommons>;
|
56
|
+
export declare type ButtonState = ComponentState<ButtonSlots> & ButtonCommons & {
|
57
|
+
/**
|
58
|
+
* A button can contain only an icon.
|
59
|
+
* @default false
|
60
|
+
*/
|
61
|
+
iconOnly: boolean;
|
65
62
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
@@ -1,10 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useButtonStyles = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
4
10
|
tslib_1.__exportStar(require("./Button"), exports);
|
11
|
+
|
12
|
+
tslib_1.__exportStar(require("./Button.types"), exports);
|
13
|
+
|
5
14
|
tslib_1.__exportStar(require("./renderButton"), exports);
|
15
|
+
|
6
16
|
tslib_1.__exportStar(require("./useButton"), exports);
|
7
|
-
|
8
|
-
|
9
|
-
|
17
|
+
|
18
|
+
var useButtonStyles_1 = /*#__PURE__*/require("./useButtonStyles");
|
19
|
+
|
20
|
+
Object.defineProperty(exports, "useButtonStyles", {
|
21
|
+
enumerable: true,
|
22
|
+
get: function () {
|
23
|
+
return useButtonStyles_1.useButtonStyles;
|
24
|
+
}
|
25
|
+
});
|
10
26
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,iBAAA,CAAA,eAAA;AAAe;AAAf,CAAA","sourceRoot":""}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { ButtonState } from './Button.types';
|
1
|
+
import type { ButtonState } from './Button.types';
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* Renders a Button component by passing the state defined props to the appropriate slots.
|
4
4
|
*/
|
5
5
|
export declare const renderButton: (state: ButtonState) => JSX.Element;
|
@@ -1,18 +1,29 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.renderButton = void 0;
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var React = /*#__PURE__*/require("react");
|
11
|
+
|
12
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
7
13
|
/**
|
8
|
-
*
|
14
|
+
* Renders a Button component by passing the state defined props to the appropriate slots.
|
9
15
|
*/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
|
17
|
+
|
18
|
+
var renderButton = function (state) {
|
19
|
+
var _a = react_utilities_1.getSlots(state, ['root', 'icon']),
|
20
|
+
slots = _a.slots,
|
21
|
+
slotProps = _a.slotProps;
|
22
|
+
|
23
|
+
var iconOnly = state.iconOnly,
|
24
|
+
iconPosition = state.iconPosition;
|
25
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), iconPosition !== 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)), !iconOnly && state.root.children, iconPosition === 'after' && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)));
|
17
26
|
};
|
27
|
+
|
28
|
+
exports.renderButton = renderButton;
|
18
29
|
//# sourceMappingURL=renderButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Button/renderButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,YAAY,GAAG,UAAC,KAAD,EAAmB;AACvC,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAsB,KAAtB,EAA6B,CAAC,MAAD,EAAS,MAAT,CAA7B,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACE,MAAA,QAAQ,GAAmB,KAAK,CAAxB,QAAR;AAAA,MAAU,YAAY,GAAK,KAAK,CAAV,YAAtB;AAER,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,YAAY,KAAK,OAAjB,IAA4B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAD/B,EAEG,CAAC,QAAD,IAAa,KAAK,CAAC,IAAN,CAAW,QAF3B,EAGG,YAAY,KAAK,OAAjB,IAA4B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAH/B,CADF;AAOD,CAXM;;AAAM,OAAA,CAAA,YAAA,GAAY,YAAZ","sourceRoot":""}
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { ButtonProps, ButtonState } from './Button.types';
|
2
|
+
import type { ButtonProps, ButtonState } from './Button.types';
|
3
3
|
/**
|
4
|
-
*
|
4
|
+
* Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
|
5
|
+
* @param props - User provided props to the Button component.
|
6
|
+
* @param ref - User provided ref to be passed to the Button component.
|
5
7
|
*/
|
6
|
-
export declare const
|
7
|
-
/**
|
8
|
-
* Given user props, returns state and render function for a Button.
|
9
|
-
*/
|
10
|
-
export declare const useButton: (props: ButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: ButtonProps | undefined) => ButtonState;
|
8
|
+
export declare const useButton: (props: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => ButtonState;
|
@@ -1,29 +1,64 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useButton = void 0;
|
7
|
+
|
8
|
+
var react_aria_1 = /*#__PURE__*/require("@fluentui/react-aria");
|
9
|
+
|
10
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
6
11
|
/**
|
7
|
-
*
|
12
|
+
* Given user props, defines default props for the Button, calls useButtonState, and returns processed state.
|
13
|
+
* @param props - User provided props to the Button component.
|
14
|
+
* @param ref - User provided ref to be passed to the Button component.
|
8
15
|
*/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
16
|
+
|
17
|
+
|
18
|
+
var useButton = function (props, ref) {
|
19
|
+
var appearance = props.appearance,
|
20
|
+
as = props.as,
|
21
|
+
_a = props.block,
|
22
|
+
block = _a === void 0 ? false : _a,
|
23
|
+
_b = props.disabled,
|
24
|
+
disabled = _b === void 0 ? false : _b,
|
25
|
+
_c = props.disabledFocusable,
|
26
|
+
disabledFocusable = _c === void 0 ? false : _c,
|
27
|
+
icon = props.icon,
|
28
|
+
_d = props.iconPosition,
|
29
|
+
iconPosition = _d === void 0 ? 'before' : _d,
|
30
|
+
_e = props.shape,
|
31
|
+
shape = _e === void 0 ? 'rounded' : _e,
|
32
|
+
_f = props.size,
|
33
|
+
size = _f === void 0 ? 'medium' : _f;
|
34
|
+
var iconShorthand = react_utilities_1.resolveShorthand(icon);
|
35
|
+
return {
|
36
|
+
// Props passed at the top-level
|
37
|
+
appearance: appearance,
|
38
|
+
block: block,
|
39
|
+
disabled: disabled,
|
40
|
+
disabledFocusable: disabledFocusable,
|
41
|
+
iconPosition: iconPosition,
|
42
|
+
shape: shape,
|
43
|
+
size: size,
|
44
|
+
// State calculated from a set of props
|
45
|
+
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
|
46
|
+
// Slots definition
|
47
|
+
components: {
|
48
|
+
root: 'button',
|
49
|
+
icon: 'span'
|
50
|
+
},
|
51
|
+
root: react_utilities_1.getNativeElementProps(as || 'button', react_aria_1.useARIAButton(props, {
|
52
|
+
required: true,
|
53
|
+
defaultProps: {
|
54
|
+
// useARIAButton isn't working with React.Ref<HTMLButtonElement | HTMLAnchorElement>
|
55
|
+
ref: ref,
|
56
|
+
type: 'button'
|
57
|
+
}
|
58
|
+
})),
|
59
|
+
icon: iconShorthand
|
60
|
+
};
|
28
61
|
};
|
62
|
+
|
63
|
+
exports.useButton = useButton;
|
29
64
|
//# sourceMappingURL=useButton.js.map
|