@fluentui/react-button 9.0.0-alpha.87 → 9.0.0-alpha.88

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. package/CHANGELOG.json +30 -1
  2. package/CHANGELOG.md +12 -2
  3. package/dist/react-button.d.ts +52 -0
  4. package/lib/SplitButton.d.ts +1 -0
  5. package/lib/SplitButton.js +2 -0
  6. package/lib/SplitButton.js.map +1 -0
  7. package/lib/components/Button/renderButton.js.map +1 -1
  8. package/lib/components/Button/useButtonStyles.js.map +1 -1
  9. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  10. package/lib/components/CompoundButton/useCompoundButtonStyles.js +1 -1
  11. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  12. package/lib/components/MenuButton/renderMenuButton.js +2 -1
  13. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  14. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  15. package/lib/components/MenuButton/useMenuButtonState.js +3 -1
  16. package/lib/components/MenuButton/useMenuButtonState.js.map +1 -1
  17. package/lib/components/MenuButton/useMenuButtonStyles.js +1 -1
  18. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  19. package/lib/components/SplitButton/SplitButton.d.ts +7 -0
  20. package/lib/components/SplitButton/SplitButton.js +25 -0
  21. package/lib/components/SplitButton/SplitButton.js.map +1 -0
  22. package/lib/components/SplitButton/SplitButton.types.d.ts +30 -0
  23. package/lib/components/SplitButton/SplitButton.types.js +2 -0
  24. package/lib/components/SplitButton/SplitButton.types.js.map +1 -0
  25. package/lib/components/SplitButton/index.d.ts +5 -0
  26. package/lib/components/SplitButton/index.js +6 -0
  27. package/lib/components/SplitButton/index.js.map +1 -0
  28. package/lib/components/SplitButton/renderSplitButton.d.ts +5 -0
  29. package/lib/components/SplitButton/renderSplitButton.js +16 -0
  30. package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
  31. package/lib/components/SplitButton/useSplitButton.d.ts +9 -0
  32. package/lib/components/SplitButton/useSplitButton.js +72 -0
  33. package/lib/components/SplitButton/useSplitButton.js.map +1 -0
  34. package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  35. package/lib/components/SplitButton/useSplitButtonStyles.js +61 -0
  36. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  37. package/lib/components/ToggleButton/useToggleButtonStyles.js +1 -1
  38. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  39. package/lib/index.d.ts +1 -0
  40. package/lib/index.js +1 -0
  41. package/lib/index.js.map +1 -1
  42. package/lib-amd/SplitButton.d.ts +1 -0
  43. package/lib-amd/SplitButton.js +6 -0
  44. package/lib-amd/SplitButton.js.map +1 -0
  45. package/lib-amd/components/Button/renderButton.js.map +1 -1
  46. package/lib-amd/components/Button/useButtonStyles.js +1 -0
  47. package/lib-amd/components/Button/useButtonStyles.js.map +1 -1
  48. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +1 -1
  49. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  50. package/lib-amd/components/MenuButton/renderMenuButton.js +2 -2
  51. package/lib-amd/components/MenuButton/renderMenuButton.js.map +1 -1
  52. package/lib-amd/components/MenuButton/useMenuButton.js.map +1 -1
  53. package/lib-amd/components/MenuButton/useMenuButtonState.js +2 -1
  54. package/lib-amd/components/MenuButton/useMenuButtonState.js.map +1 -1
  55. package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  56. package/lib-amd/components/SplitButton/SplitButton.d.ts +7 -0
  57. package/lib-amd/components/SplitButton/SplitButton.js +19 -0
  58. package/lib-amd/components/SplitButton/SplitButton.js.map +1 -0
  59. package/lib-amd/components/SplitButton/SplitButton.types.d.ts +30 -0
  60. package/lib-amd/components/SplitButton/SplitButton.types.js +5 -0
  61. package/lib-amd/components/SplitButton/SplitButton.types.js.map +1 -0
  62. package/lib-amd/components/SplitButton/index.d.ts +5 -0
  63. package/lib-amd/components/SplitButton/index.js +11 -0
  64. package/lib-amd/components/SplitButton/index.js.map +1 -0
  65. package/lib-amd/components/SplitButton/renderSplitButton.d.ts +5 -0
  66. package/lib-amd/components/SplitButton/renderSplitButton.js +16 -0
  67. package/lib-amd/components/SplitButton/renderSplitButton.js.map +1 -0
  68. package/lib-amd/components/SplitButton/useSplitButton.d.ts +9 -0
  69. package/lib-amd/components/SplitButton/useSplitButton.js +55 -0
  70. package/lib-amd/components/SplitButton/useSplitButton.js.map +1 -0
  71. package/lib-amd/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  72. package/lib-amd/components/SplitButton/useSplitButtonStyles.js +123 -0
  73. package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  74. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  75. package/lib-amd/index.d.ts +1 -0
  76. package/lib-amd/index.js +2 -1
  77. package/lib-amd/index.js.map +1 -1
  78. package/lib-commonjs/SplitButton.d.ts +1 -0
  79. package/lib-commonjs/SplitButton.js +10 -0
  80. package/lib-commonjs/SplitButton.js.map +1 -0
  81. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  82. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  83. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  84. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  85. package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -1
  86. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  87. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  88. package/lib-commonjs/components/MenuButton/useMenuButtonState.js +3 -1
  89. package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +1 -1
  90. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  91. package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
  92. package/lib-commonjs/components/SplitButton/SplitButton.js +38 -0
  93. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
  94. package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +30 -0
  95. package/lib-commonjs/components/SplitButton/SplitButton.types.js +6 -0
  96. package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -0
  97. package/lib-commonjs/components/SplitButton/index.d.ts +5 -0
  98. package/lib-commonjs/components/SplitButton/index.js +26 -0
  99. package/lib-commonjs/components/SplitButton/index.js.map +1 -0
  100. package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +5 -0
  101. package/lib-commonjs/components/SplitButton/renderSplitButton.js +29 -0
  102. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
  103. package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +9 -0
  104. package/lib-commonjs/components/SplitButton/useSplitButton.js +83 -0
  105. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -0
  106. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
  107. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +71 -0
  108. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  109. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  110. package/lib-commonjs/index.d.ts +1 -0
  111. package/lib-commonjs/index.js +2 -0
  112. package/lib-commonjs/index.js.map +1 -1
  113. package/package.json +9 -9
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
3
+ import type { ButtonProps, ButtonShorthandPropsCompat } from '../Button/Button.types';
4
+ import type { MenuButtonProps } from '../MenuButton/MenuButton.types';
5
+ export interface SplitButtonProps extends Omit<ButtonProps, ButtonShorthandPropsCompat>, MenuButtonProps {
6
+ /**
7
+ * Button to perform primary action in SplitButton.
8
+ */
9
+ button?: ShorthandPropsCompat<ButtonProps>;
10
+ /**
11
+ * Button that opens menu with secondary actions in SplitButton.
12
+ */
13
+ menuButton?: ShorthandPropsCompat<MenuButtonProps>;
14
+ /**
15
+ * Ref to the Button element.
16
+ */
17
+ buttonRef?: React.Ref<HTMLElement>;
18
+ /**
19
+ * Ref to the MenuButton element.
20
+ */
21
+ menuButtonRef?: React.Ref<HTMLElement>;
22
+ }
23
+ export declare type SplitButtonShorthandPropsCompat = 'button' | 'menuButton';
24
+ export declare type SplitButtonDefaultedProps = 'size';
25
+ export interface SplitButtonState extends ComponentStateCompat<SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonDefaultedProps> {
26
+ /**
27
+ * Ref to the root element
28
+ */
29
+ ref: React.Ref<HTMLElement>;
30
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=SplitButton.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ export * from './SplitButton';
2
+ export * from './SplitButton.types';
3
+ export * from './renderSplitButton';
4
+ export * from './useSplitButton';
5
+ export { useSplitButtonStyles } from './useSplitButtonStyles';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSplitButtonStyles = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ tslib_1.__exportStar(require("./SplitButton"), exports);
11
+
12
+ tslib_1.__exportStar(require("./SplitButton.types"), exports);
13
+
14
+ tslib_1.__exportStar(require("./renderSplitButton"), exports);
15
+
16
+ tslib_1.__exportStar(require("./useSplitButton"), exports);
17
+
18
+ var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
19
+
20
+ Object.defineProperty(exports, "useSplitButtonStyles", {
21
+ enumerable: true,
22
+ get: function () {
23
+ return useSplitButtonStyles_1.useSplitButtonStyles;
24
+ }
25
+ });
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,qBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,IAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AAAS,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,sBAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA","sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { useSplitButtonStyles } from './useSplitButtonStyles';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,5 @@
1
+ import type { SplitButtonState } from './SplitButton.types';
2
+ /**
3
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
4
+ */
5
+ export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.renderSplitButton = 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");
13
+
14
+ var useSplitButton_1 = /*#__PURE__*/require("./useSplitButton");
15
+ /**
16
+ * Renders a SplitButton component by passing the state defined props to the appropriate slots.
17
+ */
18
+
19
+
20
+ var renderSplitButton = function (state) {
21
+ var _a = react_utilities_1.getSlotsCompat(state, useSplitButton_1.splitButtonShorthandProps),
22
+ slots = _a.slots,
23
+ slotProps = _a.slotProps;
24
+
25
+ return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)), React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton)));
26
+ };
27
+
28
+ exports.renderSplitButton = renderSplitButton;
29
+ //# sourceMappingURL=renderSplitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACjD,MAAA,EAAA,GAAuB,iBAAA,CAAA,cAAA,CAAe,KAAf,EAAsB,gBAAA,CAAA,yBAAtB,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,MAAf,CAAb,CADF,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CAFF,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { splitButtonShorthandProps } from './useSplitButton';\nimport type { SplitButtonState } from './SplitButton.types';\n\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, splitButtonShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button} />\n <slots.menuButton {...slotProps.menuButton} />\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,9 @@
1
+ import * as React from 'react';
2
+ import type { SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonState } from './SplitButton.types';
3
+ export declare const splitButtonShorthandProps: SplitButtonShorthandPropsCompat[];
4
+ /**
5
+ * Given user props, defines default props for the SplitButton and returns processed state.
6
+ * @param props - User provided props to the SplitButton component.
7
+ * @param ref - User provided ref to be passed to the SplitButton component.
8
+ */
9
+ export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => SplitButtonState;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSplitButton = exports.splitButtonShorthandProps = void 0;
7
+
8
+ var tslib_1 = /*#__PURE__*/require("tslib");
9
+
10
+ var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
+
12
+ exports.splitButtonShorthandProps = ['button', 'menuButton'];
13
+ var mergeProps = /*#__PURE__*/react_utilities_1.makeMergeProps({
14
+ deepMerge: exports.splitButtonShorthandProps
15
+ });
16
+ /**
17
+ * Given user props, defines default props for the SplitButton and returns processed state.
18
+ * @param props - User provided props to the SplitButton component.
19
+ * @param ref - User provided ref to be passed to the SplitButton component.
20
+ */
21
+
22
+ var useSplitButton = function (props, ref, defaultProps) {
23
+ var resolvedShorthandProps = react_utilities_1.resolveShorthandProps(props, exports.splitButtonShorthandProps);
24
+ var className = props.className;
25
+
26
+ var button = resolvedShorthandProps.button,
27
+ buttonRef = resolvedShorthandProps.buttonRef,
28
+ circular = resolvedShorthandProps.circular,
29
+ disabled = resolvedShorthandProps.disabled,
30
+ disabledFocusable = resolvedShorthandProps.disabledFocusable,
31
+ menuButton = resolvedShorthandProps.menuButton,
32
+ menuButtonRef = resolvedShorthandProps.menuButtonRef,
33
+ outline = resolvedShorthandProps.outline,
34
+ primary = resolvedShorthandProps.primary,
35
+ _a = resolvedShorthandProps.size,
36
+ size = _a === void 0 ? 'medium' : _a,
37
+ subtle = resolvedShorthandProps.subtle,
38
+ transparent = resolvedShorthandProps.transparent,
39
+ userProps = tslib_1.__rest(resolvedShorthandProps, ["button", "buttonRef", "circular", "disabled", "disabledFocusable", "menuButton", "menuButtonRef", "outline", "primary", "size", "subtle", "transparent"]); // TODO: To be resolved when moving to simplified prop merging
40
+ // const buttonInternalRef = React.useRef<HTMLElement | null>(null);
41
+ // const menuButtonInternalRef = React.useRef<HTMLElement | null>(null);
42
+
43
+
44
+ var state = mergeProps({
45
+ 'aria-disabled': disabled,
46
+ as: 'div',
47
+ className: className,
48
+ ref: ref,
49
+ size: size,
50
+ button: tslib_1.__assign(tslib_1.__assign({
51
+ as: 'button',
52
+ // TODO: To be resolved when moving to simplified prop merging
53
+ // ref: useMergedRefs(buttonRef, buttonInternalRef),
54
+ circular: circular,
55
+ disabled: disabled,
56
+ disabledFocusable: disabledFocusable,
57
+ outline: outline,
58
+ primary: primary,
59
+ size: size,
60
+ subtle: subtle,
61
+ transparent: transparent
62
+ }, userProps), button),
63
+ menuButton: tslib_1.__assign({
64
+ as: 'button',
65
+ // TODO: To be resolved when moving to simplified prop merging
66
+ // ref: useMergedRefs(menuButtonRef, menuButtonInternalRef),
67
+ circular: circular,
68
+ disabled: disabled,
69
+ disabledFocusable: disabledFocusable,
70
+ outline: outline,
71
+ primary: primary,
72
+ size: size,
73
+ subtle: subtle,
74
+ transparent: transparent
75
+ }, menuButton)
76
+ }, // TODO: To be resolved when moving to simplified prop merging
77
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
78
+ defaultProps, resolvedShorthandProps);
79
+ return state;
80
+ };
81
+
82
+ exports.useSplitButton = useSplitButton;
83
+ //# sourceMappingURL=useSplitButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGa,OAAA,CAAA,yBAAA,GAA+D,CAAC,QAAD,EAAW,YAAX,CAA/D;AAEb,IAAM,UAAU,gBAAG,iBAAA,CAAA,cAAA,CAAiC;AAAE,EAAA,SAAS,EAAE,OAAA,CAAA;AAAb,CAAjC,CAAnB;AAEA;;;;AAIG;;AACI,IAAM,cAAc,GAAG,UAC5B,KAD4B,EAE5B,GAF4B,EAG5B,YAH4B,EAGG;AAE/B,MAAM,sBAAsB,GAAG,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B,OAAA,CAAA,yBAA7B,CAA/B;AACQ,MAAA,SAAS,GAAK,KAAK,CAAV,SAAT;;AAEN,MAAA,MAAM,GAaJ,sBAAsB,CAblB,MAAN;AAAA,MACA,SAAS,GAYP,sBAAsB,CAZf,SADT;AAAA,MAEA,QAAQ,GAWN,sBAAsB,CAXhB,QAFR;AAAA,MAGA,QAAQ,GAUN,sBAAsB,CAVhB,QAHR;AAAA,MAIA,iBAAiB,GASf,sBAAsB,CATP,iBAJjB;AAAA,MAKA,UAAU,GAQR,sBAAsB,CARd,UALV;AAAA,MAMA,aAAa,GAOX,sBAAsB,CAPX,aANb;AAAA,MAOA,OAAO,GAML,sBAAsB,CANjB,OAPP;AAAA,MAQA,OAAO,GAKL,sBAAsB,CALjB,OARP;AAAA,MASA,EAAA,GAIE,sBAAsB,CAJT,IATf;AAAA,MASA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EATf;AAAA,MAUA,MAAM,GAGJ,sBAAsB,CAHlB,MAVN;AAAA,MAWA,WAAW,GAET,sBAAsB,CAFb,WAXX;AAAA,MAYG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AA6CA,SAAO,KAAP;AACD,CAzEM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport type { SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonState } from './SplitButton.types';\n\nexport const splitButtonShorthandProps: SplitButtonShorthandPropsCompat[] = ['button', 'menuButton'];\n\nconst mergeProps = makeMergeProps<SplitButtonState>({ deepMerge: splitButtonShorthandProps });\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButton = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: SplitButtonProps,\n): SplitButtonState => {\n const resolvedShorthandProps = resolveShorthandProps(props, splitButtonShorthandProps);\n const { className } = props;\n const {\n button,\n buttonRef,\n circular,\n disabled,\n disabledFocusable,\n menuButton,\n menuButtonRef,\n outline,\n primary,\n size = 'medium',\n subtle,\n transparent,\n ...userProps\n } = resolvedShorthandProps;\n\n // TODO: To be resolved when moving to simplified prop merging\n // const buttonInternalRef = React.useRef<HTMLElement | null>(null);\n // const menuButtonInternalRef = React.useRef<HTMLElement | null>(null);\n\n const state = mergeProps(\n {\n 'aria-disabled': disabled,\n as: 'div',\n className,\n ref,\n size,\n\n button: {\n as: 'button',\n // TODO: To be resolved when moving to simplified prop merging\n // ref: useMergedRefs(buttonRef, buttonInternalRef),\n circular,\n disabled,\n disabledFocusable,\n outline,\n primary,\n size,\n subtle,\n transparent,\n ...userProps,\n ...button,\n },\n\n menuButton: {\n as: 'button',\n // TODO: To be resolved when moving to simplified prop merging\n // ref: useMergedRefs(menuButtonRef, menuButtonInternalRef),\n circular,\n disabled,\n disabledFocusable,\n outline,\n primary,\n size,\n subtle,\n transparent,\n ...menuButton,\n },\n },\n // TODO: To be resolved when moving to simplified prop merging\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n defaultProps as any,\n resolvedShorthandProps,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,2 @@
1
+ import type { SplitButtonState } from './SplitButton.types';
2
+ export declare const useSplitButtonStyles: (state: SplitButtonState) => SplitButtonState;
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useSplitButtonStyles = void 0;
7
+
8
+ var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
9
+
10
+ var SplitButtonClassNames = {
11
+ button: 'SplitButton-button',
12
+ menuButton: 'SplitButton-menuButton'
13
+ };
14
+
15
+ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
16
+ "root": {
17
+ "mc9l5x": "ftuwxu6",
18
+ "Brf1p80": "fsxf2b5",
19
+ "qhf8xq": "f10pi13n",
20
+ "x85veo": ["f1ne4dir", "f1ybi2by"],
21
+ "Btvcf1s": ["f1breevy", "f1tvski9"],
22
+ "bajz6s": ["fnux5s6", "f5nfhee"],
23
+ "Bzqncq": ["f19wc9x7", "f5bevrs"],
24
+ "Flt4rd": ["f1wefiyg", "f1leuqsa"]
25
+ },
26
+ "rootBlock": {
27
+ "a9b677": "fly5x3f"
28
+ },
29
+ "rootPrimary": {
30
+ "hr16oo": ["f1l8fiow", "f1lkg7w5"],
31
+ "B5d1tlv": ["f1pm7n2k", "f1xkm9yf"],
32
+ "Bqs20fh": ["f1lzlrrr", "fhewniv"]
33
+ },
34
+ "rootSubtle": {
35
+ "hr16oo": ["ffnz80u", "fubjfjv"],
36
+ "B5d1tlv": ["f1ev4hyt", "fgg37q7"],
37
+ "Bqs20fh": ["f12yns5v", "fo742o6"]
38
+ },
39
+ "rootTransparent": {
40
+ "hr16oo": ["ffnz80u", "fubjfjv"],
41
+ "B5d1tlv": ["f1ev4hyt", "fgg37q7"],
42
+ "Bqs20fh": ["f12yns5v", "fo742o6"]
43
+ },
44
+ "rootDisabled": {
45
+ "hr16oo": ["f11d5dl6", "fdl3b3o"],
46
+ "B5d1tlv": ["f2uuk1a", "f13ik0bv"],
47
+ "Bqs20fh": ["f47hzam", "f1ui3wts"]
48
+ }
49
+ }, {
50
+ "d": [".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".fsxf2b5{-webkit-box-pack:stretch;-ms-flex-pack:stretch;-webkit-justify-content:stretch;justify-content:stretch;}", ".f10pi13n{position:relative;}", ".f1ne4dir .SplitButton-button{border-top-right-radius:0;}", ".f1ybi2by .SplitButton-button{border-top-left-radius:0;}", ".f1breevy .SplitButton-button{border-bottom-right-radius:0;}", ".f1tvski9 .SplitButton-button{border-bottom-left-radius:0;}", ".fnux5s6 .SplitButton-menuButton{border-left-width:0;}", ".f5nfhee .SplitButton-menuButton{border-right-width:0;}", ".f19wc9x7 .SplitButton-menuButton{border-top-left-radius:0;}", ".f5bevrs .SplitButton-menuButton{border-top-right-radius:0;}", ".f1wefiyg .SplitButton-menuButton{border-bottom-left-radius:0;}", ".f1leuqsa .SplitButton-menuButton{border-bottom-right-radius:0;}", ".fly5x3f{width:100%;}", ".f1l8fiow .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".f1lkg7w5 .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".ffnz80u .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".fubjfjv .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".f11d5dl6 .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStrokeDisabled);}", ".fdl3b3o .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStrokeDisabled);}"],
51
+ "h": [".f1pm7n2k:hover .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".f1xkm9yf:hover .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".f1ev4hyt:hover .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".fgg37q7:hover .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".f2uuk1a:hover .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStrokeDisabled);}", ".f13ik0bv:hover .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStrokeDisabled);}"],
52
+ "a": [".f1lzlrrr:active .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".fhewniv:active .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralForegroundInverted);}", ".f12yns5v:active .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".fo742o6:active .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStroke1Hover);}", ".f47hzam:active .SplitButton-button{border-right-color:var(--alias-color-neutral-neutralStrokeDisabled);}", ".f1ui3wts:active .SplitButton-button{border-left-color:var(--alias-color-neutral-neutralStrokeDisabled);}"]
53
+ });
54
+
55
+ var useSplitButtonStyles = function (state) {
56
+ var styles = useStyles();
57
+ state.className = react_make_styles_1.mergeClasses(styles.root, state.block && styles.rootBlock, state.primary && styles.rootPrimary, state.subtle && styles.rootSubtle, state.transparent && styles.rootTransparent, state.disabled && styles.rootDisabled, state.className);
58
+
59
+ if (state.button) {
60
+ state.button.className = react_make_styles_1.mergeClasses(SplitButtonClassNames.button, state.button.className);
61
+ }
62
+
63
+ if (state.menuButton) {
64
+ state.menuButton.className = react_make_styles_1.mergeClasses(SplitButtonClassNames.menuButton, state.menuButton.className);
65
+ }
66
+
67
+ return state;
68
+ };
69
+
70
+ exports.useSplitButtonStyles = useSplitButtonStyles;
71
+ //# sourceMappingURL=useSplitButtonStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGA,IAAM,qBA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AAA,GAAoB,oBAApB","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport type { SplitButtonState } from './SplitButton.types';\n\nconst SplitButtonClassNames = {\n button: 'SplitButton-button',\n menuButton: 'SplitButton-menuButton',\n};\n\nconst useStyles = makeStyles({\n root: theme => ({\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n }),\n rootBlock: {\n width: '100%',\n },\n rootPrimary: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralForegroundInverted,\n },\n },\n }),\n rootSubtle: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n }),\n rootTransparent: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStroke1Hover,\n },\n },\n }),\n rootDisabled: theme => ({\n // Use classnames to increase specificy of styles and avoid collisions.\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n },\n\n ':active': {\n [`& .${SplitButtonClassNames.button}`]: {\n borderRightColor: theme.alias.color.neutral.neutralStrokeDisabled,\n },\n },\n }),\n});\n\nexport const useSplitButtonStyles = (state: SplitButtonState): SplitButtonState => {\n const styles = useStyles();\n\n state.className = mergeClasses(\n styles.root,\n state.block && styles.rootBlock,\n state.primary && styles.rootPrimary,\n state.subtle && styles.rootSubtle,\n state.transparent && styles.rootTransparent,\n state.disabled && styles.rootDisabled,\n state.className,\n );\n\n if (state.button) {\n state.button.className = mergeClasses(SplitButtonClassNames.button, state.button.className);\n }\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, state.menuButton.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,IAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AN,IAAiB,KAAK,CAAC,WAAvB,IAAsC,UAAU,CAAC,kBALjC,EAMhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,UAAU,CAAC,QAN1C,EAOhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,OAArD,IAAgE,UAAU,CAAC,eAP3D,EAQhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,MAArD,IAA+D,UAAU,CAAC,cAR1D,EAShB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,WAArD,IAAoE,UAAU,CAAC,mBAT/D,EAUhB,KAAK,CAAC,SAVU,CAAlB;AAaA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nconst useRootStyles = makeStyles({\n checked: theme => ({\n background: theme.alias.color.neutral.neutralBackground1Selected,\n borderColor: theme.alias.color.neutral.neutralStroke1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderWidth: theme.global.strokeWidth.thin,\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackground1Hover,\n borderColor: theme.alias.color.neutral.neutralStroke1Hover,\n color: theme.alias.color.neutral.neutralForeground1,\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackground1Pressed,\n borderColor: theme.alias.color.neutral.neutralStroke1Pressed,\n color: theme.alias.color.neutral.neutralForeground1,\n },\n }),\n checkedOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n checkedPrimary: theme => ({\n background: theme.alias.color.neutral.brandBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n\n ':hover': {\n background: theme.alias.color.neutral.brandBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':active': {\n background: theme.alias.color.neutral.brandBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n }),\n checkedSubtle: theme => ({\n background: theme.alias.color.neutral.subtleBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.subtleBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.subtleBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n checkedTransparent: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n disabled: theme => ({\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n }),\n disabledPrimary: {\n borderColor: 'transparent',\n\n ':hover': {\n borderColor: 'transparent',\n },\n\n ':active': {\n borderColor: 'transparent',\n },\n },\n disabledSubtle: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n disabledTransparent: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n});\n\nexport const useToggleButtonStyles = (state: ToggleButtonState): ToggleButtonState => {\n const rootStyles = useRootStyles();\n\n state.className = mergeClasses(\n state.checked && rootStyles.checked,\n state.checked && state.outline && rootStyles.checkedOutline,\n state.checked && state.primary && rootStyles.checkedPrimary,\n state.checked && state.subtle && rootStyles.checkedSubtle,\n state.checked && state.transparent && rootStyles.checkedTransparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.primary && rootStyles.disabledPrimary,\n (state.disabled || state.disabledFocusable) && state.subtle && rootStyles.disabledSubtle,\n (state.disabled || state.disabledFocusable) && state.transparent && rootStyles.disabledTransparent,\n state.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/ToggleButton/useToggleButtonStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGA,IAAM,aAAa,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AC,OAAN,IAAiB,KAAK,CAAC,MAAvB,IAAiC,UAAU,CAAC,aAJ5B,EAKhB,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,WAAvB,IAAsC,UAAU,CAAC,kBALjC,EAMhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,UAAU,CAAC,QAN1C,EAOhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,OAArD,IAAgE,UAAU,CAAC,eAP3D,EAQhB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,MAArD,IAA+D,UAAU,CAAC,cAR1D,EAShB,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,WAArD,IAAoE,UAAU,CAAC,mBAT/D,EAUhB,KAAK,CAAC,SAVU,CAAlB;AAaA,EAAA,iBAAA,CAAA,eAAA,CAAgB,KAAhB;AAEA,SAAO,KAAP;AACD,CAnBM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nconst useRootStyles = makeStyles({\n checked: theme => ({\n background: theme.alias.color.neutral.neutralBackground1Selected,\n borderColor: theme.alias.color.neutral.neutralStroke1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderWidth: theme.global.strokeWidth.thin,\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackground1Hover,\n borderColor: theme.alias.color.neutral.neutralStroke1Hover,\n color: theme.alias.color.neutral.neutralForeground1,\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackground1Pressed,\n borderColor: theme.alias.color.neutral.neutralStroke1Pressed,\n color: theme.alias.color.neutral.neutralForeground1,\n },\n }),\n checkedOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n checkedPrimary: theme => ({\n background: theme.alias.color.neutral.brandBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n\n ':hover': {\n background: theme.alias.color.neutral.brandBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':active': {\n background: theme.alias.color.neutral.brandBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n }),\n checkedSubtle: theme => ({\n background: theme.alias.color.neutral.subtleBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.subtleBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.subtleBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n checkedTransparent: theme => ({\n background: theme.alias.color.neutral.transparentBackgroundSelected,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandSelected,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n }),\n disabled: theme => ({\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n\n ':hover': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':active': {\n background: theme.alias.color.neutral.neutralBackgroundDisabled,\n borderColor: theme.alias.color.neutral.neutralStrokeDisabled,\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n }),\n disabledPrimary: {\n borderColor: 'transparent',\n\n ':hover': {\n borderColor: 'transparent',\n },\n\n ':active': {\n borderColor: 'transparent',\n },\n },\n disabledSubtle: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n disabledTransparent: {\n background: 'none',\n borderColor: 'transparent',\n\n ':hover': {\n background: 'none',\n borderColor: 'transparent',\n },\n\n ':active': {\n background: 'none',\n borderColor: 'transparent',\n },\n },\n});\n\nexport const useToggleButtonStyles = (state: ToggleButtonState): ToggleButtonState => {\n const rootStyles = useRootStyles();\n\n state.className = mergeClasses(\n state.checked && rootStyles.checked,\n state.checked && state.outline && rootStyles.checkedOutline,\n state.checked && state.primary && rootStyles.checkedPrimary,\n state.checked && state.subtle && rootStyles.checkedSubtle,\n state.checked && state.transparent && rootStyles.checkedTransparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.primary && rootStyles.disabledPrimary,\n (state.disabled || state.disabledFocusable) && state.subtle && rootStyles.disabledSubtle,\n (state.disabled || state.disabledFocusable) && state.transparent && rootStyles.disabledTransparent,\n state.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -1,4 +1,5 @@
1
1
  export * from './Button';
2
2
  export * from './CompoundButton';
3
3
  export * from './MenuButton';
4
+ export * from './SplitButton';
4
5
  export * from './ToggleButton';
@@ -12,5 +12,7 @@ tslib_1.__exportStar(require("./CompoundButton"), exports);
12
12
 
13
13
  tslib_1.__exportStar(require("./MenuButton"), exports);
14
14
 
15
+ tslib_1.__exportStar(require("./SplitButton"), exports);
16
+
15
17
  tslib_1.__exportStar(require("./ToggleButton"), exports);
16
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './ToggleButton';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,cAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './SplitButton';\nexport * from './ToggleButton';\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.0.0-alpha.87",
3
+ "version": "9.0.0-alpha.88",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -26,12 +26,12 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/a11y-testing": "^0.1.0",
29
- "@fluentui/babel-make-styles": "9.0.0-alpha.49",
30
- "@fluentui/eslint-plugin": "^1.4.1",
31
- "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.42",
32
- "@fluentui/react-conformance": "^0.5.0",
33
- "@fluentui/react-conformance-make-styles": "9.0.0-alpha.11",
34
- "@fluentui/react-menu": "9.0.0-alpha.78",
29
+ "@fluentui/babel-make-styles": "9.0.0-alpha.50",
30
+ "@fluentui/eslint-plugin": "*",
31
+ "@fluentui/jest-serializer-make-styles": "9.0.0-alpha.43",
32
+ "@fluentui/react-conformance": "*",
33
+ "@fluentui/react-conformance-make-styles": "9.0.0-alpha.12",
34
+ "@fluentui/react-menu": "9.0.0-alpha.79",
35
35
  "@fluentui/scripts": "^1.0.0",
36
36
  "@types/enzyme": "3.10.3",
37
37
  "@types/enzyme-adapter-react-16": "1.0.3",
@@ -47,8 +47,8 @@
47
47
  "dependencies": {
48
48
  "@fluentui/keyboard-keys": "9.0.0-alpha.3",
49
49
  "@fluentui/react-icons": "^1.1.136",
50
- "@fluentui/react-make-styles": "9.0.0-alpha.67",
51
- "@fluentui/react-tabster": "9.0.0-alpha.61",
50
+ "@fluentui/react-make-styles": "9.0.0-alpha.68",
51
+ "@fluentui/react-tabster": "9.0.0-alpha.62",
52
52
  "@fluentui/react-utilities": "9.0.0-alpha.49",
53
53
  "tslib": "^2.1.0"
54
54
  },