@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.
- package/CHANGELOG.json +30 -1
- package/CHANGELOG.md +12 -2
- package/dist/react-button.d.ts +52 -0
- package/lib/SplitButton.d.ts +1 -0
- package/lib/SplitButton.js +2 -0
- package/lib/SplitButton.js.map +1 -0
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +2 -1
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonState.js +3 -1
- package/lib/components/MenuButton/useMenuButtonState.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib/components/SplitButton/SplitButton.js +25 -0
- package/lib/components/SplitButton/SplitButton.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.types.d.ts +30 -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 +16 -0
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib/components/SplitButton/useSplitButton.d.ts +9 -0
- package/lib/components/SplitButton/useSplitButton.js +72 -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 +61 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib-amd/SplitButton.d.ts +1 -0
- package/lib-amd/SplitButton.js +6 -0
- package/lib-amd/SplitButton.js.map +1 -0
- package/lib-amd/components/Button/renderButton.js.map +1 -1
- package/lib-amd/components/Button/useButtonStyles.js +1 -0
- package/lib-amd/components/Button/useButtonStyles.js.map +1 -1
- package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-amd/components/MenuButton/renderMenuButton.js +2 -2
- package/lib-amd/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-amd/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-amd/components/MenuButton/useMenuButtonState.js +2 -1
- package/lib-amd/components/MenuButton/useMenuButtonState.js.map +1 -1
- package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-amd/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib-amd/components/SplitButton/SplitButton.js +19 -0
- package/lib-amd/components/SplitButton/SplitButton.js.map +1 -0
- package/lib-amd/components/SplitButton/SplitButton.types.d.ts +30 -0
- package/lib-amd/components/SplitButton/SplitButton.types.js +5 -0
- package/lib-amd/components/SplitButton/SplitButton.types.js.map +1 -0
- package/lib-amd/components/SplitButton/index.d.ts +5 -0
- package/lib-amd/components/SplitButton/index.js +11 -0
- package/lib-amd/components/SplitButton/index.js.map +1 -0
- package/lib-amd/components/SplitButton/renderSplitButton.d.ts +5 -0
- package/lib-amd/components/SplitButton/renderSplitButton.js +16 -0
- package/lib-amd/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib-amd/components/SplitButton/useSplitButton.d.ts +9 -0
- package/lib-amd/components/SplitButton/useSplitButton.js +55 -0
- package/lib-amd/components/SplitButton/useSplitButton.js.map +1 -0
- package/lib-amd/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib-amd/components/SplitButton/useSplitButtonStyles.js +123 -0
- package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-amd/index.d.ts +1 -0
- package/lib-amd/index.js +2 -1
- package/lib-amd/index.js.map +1 -1
- 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/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonState.js +3 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +7 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js +38 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +30 -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 +29 -0
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +9 -0
- package/lib-commonjs/components/SplitButton/useSplitButton.js +83 -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 +71 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +1 -0
- package/lib-commonjs/index.js +2 -0
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
@@ -0,0 +1,61 @@
|
|
1
|
+
import { __styles, mergeClasses } from '@fluentui/react-make-styles';
|
2
|
+
var SplitButtonClassNames = {
|
3
|
+
button: 'SplitButton-button',
|
4
|
+
menuButton: 'SplitButton-menuButton'
|
5
|
+
};
|
6
|
+
|
7
|
+
var useStyles = /*#__PURE__*/__styles({
|
8
|
+
"root": {
|
9
|
+
"mc9l5x": "ftuwxu6",
|
10
|
+
"Brf1p80": "fsxf2b5",
|
11
|
+
"qhf8xq": "f10pi13n",
|
12
|
+
"x85veo": ["f1ne4dir", "f1ybi2by"],
|
13
|
+
"Btvcf1s": ["f1breevy", "f1tvski9"],
|
14
|
+
"bajz6s": ["fnux5s6", "f5nfhee"],
|
15
|
+
"Bzqncq": ["f19wc9x7", "f5bevrs"],
|
16
|
+
"Flt4rd": ["f1wefiyg", "f1leuqsa"]
|
17
|
+
},
|
18
|
+
"rootBlock": {
|
19
|
+
"a9b677": "fly5x3f"
|
20
|
+
},
|
21
|
+
"rootPrimary": {
|
22
|
+
"hr16oo": ["f1l8fiow", "f1lkg7w5"],
|
23
|
+
"B5d1tlv": ["f1pm7n2k", "f1xkm9yf"],
|
24
|
+
"Bqs20fh": ["f1lzlrrr", "fhewniv"]
|
25
|
+
},
|
26
|
+
"rootSubtle": {
|
27
|
+
"hr16oo": ["ffnz80u", "fubjfjv"],
|
28
|
+
"B5d1tlv": ["f1ev4hyt", "fgg37q7"],
|
29
|
+
"Bqs20fh": ["f12yns5v", "fo742o6"]
|
30
|
+
},
|
31
|
+
"rootTransparent": {
|
32
|
+
"hr16oo": ["ffnz80u", "fubjfjv"],
|
33
|
+
"B5d1tlv": ["f1ev4hyt", "fgg37q7"],
|
34
|
+
"Bqs20fh": ["f12yns5v", "fo742o6"]
|
35
|
+
},
|
36
|
+
"rootDisabled": {
|
37
|
+
"hr16oo": ["f11d5dl6", "fdl3b3o"],
|
38
|
+
"B5d1tlv": ["f2uuk1a", "f13ik0bv"],
|
39
|
+
"Bqs20fh": ["f47hzam", "f1ui3wts"]
|
40
|
+
}
|
41
|
+
}, {
|
42
|
+
"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);}"],
|
43
|
+
"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);}"],
|
44
|
+
"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);}"]
|
45
|
+
});
|
46
|
+
|
47
|
+
export var useSplitButtonStyles = function (state) {
|
48
|
+
var styles = useStyles();
|
49
|
+
state.className = 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);
|
50
|
+
|
51
|
+
if (state.button) {
|
52
|
+
state.button.className = mergeClasses(SplitButtonClassNames.button, state.button.className);
|
53
|
+
}
|
54
|
+
|
55
|
+
if (state.menuButton) {
|
56
|
+
state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, state.menuButton.className);
|
57
|
+
}
|
58
|
+
|
59
|
+
return state;
|
60
|
+
};
|
61
|
+
//# sourceMappingURL=useSplitButtonStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,MAAM,EAAE,oBADoB;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,SAAS,gBAAG;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;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;;AAgGA,OAAO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,MAAM,GAAG,SAAS,EAAxB;AAEA,EAAA,KAAK,CAAC,SAAN,GAAkB,YAAY,CAC5B,MAAM,CAAC,IADqB,EAE5B,KAAK,CAAC,KAAN,IAAe,MAAM,CAAC,SAFM,EAG5B,KAAK,CAAC,OAAN,IAAiB,MAAM,CAAC,WAHI,EAI5B,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,UAJK,EAK5B,KAAK,CAAC,WAAN,IAAqB,MAAM,CAAC,eALA,EAM5B,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,YANG,EAO5B,KAAK,CAAC,SAPsB,CAA9B;;AAUA,MAAI,KAAK,CAAC,MAAV,EAAkB;AAChB,IAAA,KAAK,CAAC,MAAN,CAAa,SAAb,GAAyB,YAAY,CAAC,qBAAqB,CAAC,MAAvB,EAA+B,KAAK,CAAC,MAAN,CAAa,SAA5C,CAArC;AACD;;AAED,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,YAAY,CAAC,qBAAqB,CAAC,UAAvB,EAAmC,KAAK,CAAC,UAAN,CAAiB,SAApD,CAAzC;AACD;;AAED,SAAO,KAAP;AACD,CAtBM","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":[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AAG,aAAa,EAAhC;AAEA,EAAA,KAAK,CAAC,SAAN,GAAkB,YAAY,CAC5B,KAAK,CAAC,OAAN,IAAiB,UAAU,CAAC,OADA,EAE5B,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAFjB,EAG5B,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,OAAvB,IAAkC,UAAU,CAAC,cAHjB,EAI5B,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,MAAvB,IAAiC,UAAU,CAAC,aAJhB,EAK5B,KAAK,CAAC,OAAN,IAAiB,KAAK,CAAC,WAAvB,IAAsC,UAAU,CAAC,kBALrB,EAM5B,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,UAAU,CAAC,QAN9B,EAO5B,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,OAArD,IAAgE,UAAU,CAAC,eAP/C,EAQ5B,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,MAArD,IAA+D,UAAU,CAAC,cAR9C,EAS5B,CAAC,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,iBAAzB,KAA+C,KAAK,CAAC,WAArD,IAAoE,UAAU,CAAC,mBATnD,EAU5B,KAAK,CAAC,SAVsB,CAA9B;AAaA,EAAA,eAAe,CAAC,KAAD,CAAf;AAEA,SAAO,KAAP;AACD,CAnBM","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/"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './ToggleButton';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC","sourcesContent":["export * from './Button';\nexport * from './CompoundButton';\nexport * from './MenuButton';\nexport * from './SplitButton';\nexport * from './ToggleButton';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './components/SplitButton/index';
|
@@ -0,0 +1,6 @@
|
|
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
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["SplitButton.ts"],"names":[],"mappings":";;;IAAA,uCAA+C","sourcesContent":["export * from './components/SplitButton/index';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderButton.js","sourceRoot":"../src/","sources":["components/Button/renderButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,YAAY,GAAG,UAAC,KAAkB;QACvC,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sCAA0B,CAAC,EAAtE,KAAK,WAAA,EAAE,SAAS,eAAsD,CAAC;QACvE,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;
|
1
|
+
{"version":3,"file":"renderButton.js","sourceRoot":"../src/","sources":["components/Button/renderButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,YAAY,GAAG,UAAC,KAAkB;QACvC,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sCAA0B,CAAC,EAAtE,KAAK,WAAA,EAAE,SAAS,eAAsD,CAAC;QACvE,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC9D,CAAC,QAAQ,IAAI,QAAQ;YACrB,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,YAAY,gBAWvB","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { buttonShorthandPropsCompat } from './useButton';\nimport type { 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 = (state: ButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, buttonShorthandPropsCompat);\n const { children, iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && <slots.icon {...slotProps.icon} />}\n {!iconOnly && children}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -202,6 +202,7 @@ define(["require", "exports", "@fluentui/react-make-styles", "@fluentui/react-ta
|
|
202
202
|
base: react_tabster_1.createFocusIndicatorStyleRule(function (theme) { return ({
|
203
203
|
borderColor: 'transparent',
|
204
204
|
boxShadow: "\n " + theme.alias.shadow.shadow4 + ",\n 0 0 0 2px " + theme.alias.color.neutral.strokeFocus2 + "\n ",
|
205
|
+
zIndex: 1,
|
205
206
|
}); }),
|
206
207
|
circular: react_tabster_1.createFocusIndicatorStyleRule(function (theme) { return ({
|
207
208
|
borderRadius: theme.global.borderRadius.circular,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useButtonStyles.js","sourceRoot":"../src/","sources":["components/Button/useButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,6EAA6E;IAC7E,sEAAsE;IACzD,QAAA,aAAa,GAAG;QAC3B,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,aAAa;YACtB,cAAc,EAAE,QAAQ;YACxB,aAAa,EAAE,QAAQ;YAEvB,MAAM,EAAE,CAAC;YAET,QAAQ,EAAE,OAAO;YAEjB,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;YAEpB,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YACxD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YAEnD,WAAW,EAAE,KAAK,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AC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEnG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA9BW,QAAA,eAAe,mBA8B1B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { createFocusIndicatorStyleRule } from '@fluentui/react-tabster';\nimport type { ButtonState } from './Button.types';\n\n// TODO: These are named in design specs but not hoisted to global/alias yet.\n// We're tracking these here to determine how we can hoist them.\nexport const buttonSpacing = {\n smallest: '2px',\n smaller: '4px',\n small: '6px',\n medium: '8px',\n large: '12px',\n larger: '16px',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n verticalAlign: 'middle',\n\n margin: 0,\n\n maxWidth: '280px',\n\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n\n background: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderColor: theme.alias.color.neutral.neutralStroke1,\n borderStyle: 'solid',\n borderWidth: theme.global.strokeWidth.thin,\n\n fontFamily: theme.global.type.fontFamilies.base,\n\n outline: 'none',\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 cursor: 'pointer',\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 outline: 'none',\n },\n }),\n small: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.smaller,\n padding: `0 ${buttonSpacing.medium}`,\n\n height: '24px',\n minWidth: '64px',\n\n borderRadius: theme.global.borderRadius.small,\n\n fontSize: theme.global.type.fontSizes.base[200],\n fontWeight: theme.global.type.fontWeights.regular,\n lineHeight: theme.global.type.lineHeights.base[200],\n }),\n medium: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.large}`,\n\n height: '32px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.larger}`,\n\n height: '40px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[400],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n block: {\n maxWidth: '100%',\n width: '100%',\n },\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n outline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n primary: theme => ({\n background: theme.alias.color.neutral.brandBackground,\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 subtle: theme => ({\n background: theme.alias.color.neutral.subtleBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\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 transparent: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\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 cursor: 'not-allowed',\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 cursor: 'not-allowed',\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 cursor: 'not-allowed',\n },\n }),\n disabledOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\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\nconst useRootFocusStyles = makeStyles({\n base: createFocusIndicatorStyleRule(theme => ({\n borderColor: 'transparent',\n boxShadow: `\n ${theme.alias.shadow.shadow4},\n 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}\n `,\n })),\n circular: createFocusIndicatorStyleRule(theme => ({\n borderRadius: theme.global.borderRadius.circular,\n })),\n primary: createFocusIndicatorStyleRule(theme => ({\n borderColor: theme.alias.color.neutral.neutralForegroundOnBrand,\n boxShadow: `${theme.alias.shadow.shadow2}, 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}`,\n })),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n minWidth: '28px',\n maxWidth: '28px',\n },\n medium: {\n padding: buttonSpacing.smaller,\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n padding: buttonSpacing.small,\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n});\n\nexport const useButtonStyles = (state: ButtonState): ButtonState => {\n const rootStyles = useRootStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootFocusStyles.base,\n rootStyles[state.size],\n state.block && rootStyles.block,\n state.circular && rootStyles.circular,\n state.circular && rootFocusStyles.circular,\n state.outline && rootStyles.outline,\n state.primary && rootStyles.primary,\n state.primary && rootFocusStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.outline && rootStyles.disabledOutline,\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.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n\n return state;\n};\n"]}
|
1
|
+
{"version":3,"file":"useButtonStyles.js","sourceRoot":"../src/","sources":["components/Button/useButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,6EAA6E;IAC7E,sEAAsE;IACzD,QAAA,aAAa,GAAG;QAC3B,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,KAAK;QACd,KAAK,EAAE,KAAK;QACZ,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,MAAM;QACb,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,aAAa;YACtB,cAAc,EAAE,QAAQ;YACxB,aAAa,EAAE,QAAQ;YAEvB,MAAM,EAAE,CAAC;YAET,QAAQ,EAAE,OAAO;YAEjB,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,QAAQ;YAEpB,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YACxD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;YAEnD,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc;YACrD,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI;YAE1C,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,YAA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yleRule } from '@fluentui/react-tabster';\nimport type { ButtonState } from './Button.types';\n\n// TODO: These are named in design specs but not hoisted to global/alias yet.\n// We're tracking these here to determine how we can hoist them.\nexport const buttonSpacing = {\n smallest: '2px',\n smaller: '4px',\n small: '6px',\n medium: '8px',\n large: '12px',\n larger: '16px',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n verticalAlign: 'middle',\n\n margin: 0,\n\n maxWidth: '280px',\n\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n\n background: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.neutral.neutralForeground1,\n\n borderColor: theme.alias.color.neutral.neutralStroke1,\n borderStyle: 'solid',\n borderWidth: theme.global.strokeWidth.thin,\n\n fontFamily: theme.global.type.fontFamilies.base,\n\n outline: 'none',\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 cursor: 'pointer',\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 outline: 'none',\n },\n }),\n small: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.smaller,\n padding: `0 ${buttonSpacing.medium}`,\n\n height: '24px',\n minWidth: '64px',\n\n borderRadius: theme.global.borderRadius.small,\n\n fontSize: theme.global.type.fontSizes.base[200],\n fontWeight: theme.global.type.fontWeights.regular,\n lineHeight: theme.global.type.lineHeights.base[200],\n }),\n medium: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.large}`,\n\n height: '32px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.small,\n padding: `0 ${buttonSpacing.larger}`,\n\n height: '40px',\n minWidth: '96px',\n\n borderRadius: theme.global.borderRadius.medium,\n\n fontSize: theme.global.type.fontSizes.base[400],\n fontWeight: theme.global.type.fontWeights.semibold,\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n block: {\n maxWidth: '100%',\n width: '100%',\n },\n circular: theme => ({\n borderRadius: theme.global.borderRadius.circular,\n }),\n outline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\n },\n }),\n primary: theme => ({\n background: theme.alias.color.neutral.brandBackground,\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 subtle: theme => ({\n background: theme.alias.color.neutral.subtleBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\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 transparent: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n borderColor: 'transparent',\n color: theme.alias.color.neutral.neutralForeground2,\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 cursor: 'not-allowed',\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 cursor: 'not-allowed',\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 cursor: 'not-allowed',\n },\n }),\n disabledOutline: theme => ({\n background: theme.alias.color.neutral.transparentBackground,\n\n ':hover': {\n background: theme.alias.color.neutral.transparentBackgroundHover,\n },\n\n ':active': {\n background: theme.alias.color.neutral.transparentBackgroundPressed,\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\nconst useRootFocusStyles = makeStyles({\n base: createFocusIndicatorStyleRule(theme => ({\n borderColor: 'transparent',\n boxShadow: `\n ${theme.alias.shadow.shadow4},\n 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}\n `,\n zIndex: 1,\n })),\n circular: createFocusIndicatorStyleRule(theme => ({\n borderRadius: theme.global.borderRadius.circular,\n })),\n primary: createFocusIndicatorStyleRule(theme => ({\n borderColor: theme.alias.color.neutral.neutralForegroundOnBrand,\n boxShadow: `${theme.alias.shadow.shadow2}, 0 0 0 2px ${theme.alias.color.neutral.strokeFocus2}`,\n })),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n minWidth: '28px',\n maxWidth: '28px',\n },\n medium: {\n padding: buttonSpacing.smaller,\n\n minWidth: '32px',\n maxWidth: '32px',\n },\n large: {\n padding: buttonSpacing.small,\n\n minWidth: '40px',\n maxWidth: '40px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center',\n },\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n});\n\nexport const useButtonStyles = (state: ButtonState): ButtonState => {\n const rootStyles = useRootStyles();\n const rootFocusStyles = useRootFocusStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootFocusStyles.base,\n rootStyles[state.size],\n state.block && rootStyles.block,\n state.circular && rootStyles.circular,\n state.circular && rootFocusStyles.circular,\n state.outline && rootStyles.outline,\n state.primary && rootStyles.primary,\n state.primary && rootFocusStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n (state.disabled || state.disabledFocusable) && state.outline && rootStyles.disabledOutline,\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.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, iconStyles[state.size], state.icon.className);\n\n return state;\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAA0B;QACvD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sDAAkC,CAAC,EAA9E,KAAK,WAAA,EAAE,SAAS,eAA8D,CAAC;QAC/E,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;
|
1
|
+
{"version":3,"file":"renderCompoundButton.js","sourceRoot":"../src/","sources":["components/CompoundButton/renderCompoundButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,oBAAoB,GAAG,UAAC,KAA0B;QACvD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,sDAAkC,CAAC,EAA9E,KAAK,WAAA,EAAE,SAAS,eAA8D,CAAC;QAC/E,IAAA,QAAQ,GAA6B,KAAK,SAAlC,EAAE,QAAQ,GAAmB,KAAK,SAAxB,EAAE,YAAY,GAAK,KAAK,aAAV,CAAW;QAEnD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAC9D,CAAC,QAAQ,IAAI,CACZ,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB;gBACnD,QAAQ;gBACT,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI,CACnC,CAC1B;YACA,YAAY,KAAK,OAAO,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACpD,CACd,CAAC;IACJ,CAAC,CAAC;IAhBW,QAAA,oBAAoB,wBAgB/B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { compoundButtonShorthandPropsCompat } from './useCompoundButton';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\n/**\n * Renders a CompoundButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderCompoundButton = (state: CompoundButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, compoundButtonShorthandPropsCompat);\n const { children, iconOnly, iconPosition } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {iconPosition !== 'after' && <slots.icon {...slotProps.icon} />}\n {!iconOnly && (\n <slots.contentContainer {...slotProps.contentContainer}>\n {children}\n <slots.secondaryContent {...slotProps.secondaryContent} />\n </slots.contentContainer>\n )}\n {iconPosition === 'after' && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useCompoundButtonStyles.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,wBAAwB,GAAG;QAC/B,gBAAgB,EAAE,iCAAiC;KACpD,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK;;YAAI,OAAA;oBACb,gEAAgE;oBAChE,GAAG,EAAE,+BAAa,CAAC,KAAK;oBAExB,MAAM,EAAE,MAAM;;gBAEd,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;oBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;iBACpD;gBAED,YAAQ;oBACN,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG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tB,KAAK,CAAC,OAAO,IAAI,UAAU,CAAC,OAAO,EACnC,KAAK,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,EACjC,KAAK,CAAC,WAAW,IAAI,UAAU,CAAC,WAAW,EAC3C,CAAC,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,iBAAiB,CAAC,IAAI,UAAU,CAAC,QAAQ,EAClE,KAAK,CAAC,QAAQ,IAAI,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAChD,KAAK,CAAC,SAAS,CAChB,CAAC;QAEF,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,gCAAY,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3E,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAE/G,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAC7C,wBAAwB,CAAC,gBAAgB,EACzC,sBAAsB,CAAC,IAAI,EAC3B,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,EAClC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CACjC,CAAC;QAEF,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAhCW,QAAA,uBAAuB,2BAgClC","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\nconst CompoundButtonClassNames = {\n secondaryContent: 'CompoundButton-secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.large,\n\n height: 'auto',\n\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Hover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Pressed,\n },\n },\n }),\n small: theme => ({\n padding: buttonSpacing.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n medium: theme => ({\n padding: buttonSpacing.large,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n padding: buttonSpacing.larger,\n\n fontSize: theme.global.type.fontSizes.base[400],\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n primary: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n }),\n subtle: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n transparent: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n disabled: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: buttonSpacing.small,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: buttonSpacing.medium,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n base: theme => ({\n lineHeight: '100%',\n marginTop: '4px',\n fontWeight: theme.global.type.fontWeights.regular,\n }),\n small: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n medium: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n large: theme => ({\n fontSize: theme.global.type.fontSizes.base[300],\n }),\n});\n\nexport const useCompoundButtonStyles = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootStyles[state.size],\n state.primary && rootStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, state.icon.className);\n\n state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);\n\n state.secondaryContent.className = mergeClasses(\n CompoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[state.size],\n state.secondaryContent.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
|
1
|
+
{"version":3,"file":"useCompoundButtonStyles.js","sourceRoot":"../src/","sources":["components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,wBAAwB,GAAG;QAC/B,gBAAgB,EAAE,iCAAiC;KACpD,CAAC;IAEF,IAAM,aAAa,GAAG,8BAAU,CAAC;QAC/B,IAAI,EAAE,UAAA,KAAK;;YAAI,OAAA;oBACb,gEAAgE;oBAChE,GAAG,EAAE,+BAAa,CAAC,KAAK;oBAExB,MAAM,EAAE,MAAM;;gBAEd,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;oBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;iBACpD;gBAED,YAAQ;oBACN,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,uBAAuB;qBACzD;uBACF;gBAED,aAAS;oBACP,GAAC,QAAM,wBAAwB,CAAC,gBAAkB,IAAG;wBACnD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;qBAC3D;uBACF;mBACD;QArBa,CAqBb;QACF,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACf,OAAO,EAAE,+BAAa,CAAC,MAAM;YAE7B,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,I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EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3E,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAAC,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAE/G,KAAK,CAAC,gBAAgB,CAAC,SAAS,GAAG,gCAAY,CAC7C,wBAAwB,CAAC,gBAAgB,EACzC,sBAAsB,CAAC,IAAI,EAC3B,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,EAClC,KAAK,CAAC,gBAAgB,CAAC,SAAS,CACjC,CAAC;QAEF,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAhCW,QAAA,uBAAuB,2BAgClC","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { buttonSpacing, useButtonStyles } from '../Button/useButtonStyles';\nimport type { CompoundButtonState } from './CompoundButton.types';\n\nconst CompoundButtonClassNames = {\n secondaryContent: 'CompoundButton-secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n base: theme => ({\n // TODO: remove unsafe property: https://caniuse.com/?search=gap\n gap: buttonSpacing.large,\n\n height: 'auto',\n\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Hover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2Pressed,\n },\n },\n }),\n small: theme => ({\n padding: buttonSpacing.medium,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n medium: theme => ({\n padding: buttonSpacing.large,\n\n fontSize: theme.global.type.fontSizes.base[300],\n lineHeight: theme.global.type.lineHeights.base[300],\n }),\n large: theme => ({\n padding: buttonSpacing.larger,\n\n fontSize: theme.global.type.fontSizes.base[400],\n lineHeight: theme.global.type.lineHeights.base[400],\n }),\n primary: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundOnBrand,\n },\n },\n }),\n subtle: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n transparent: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandHover,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForeground2BrandPressed,\n },\n },\n }),\n disabled: theme => ({\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n\n ':active': {\n [`& .${CompoundButtonClassNames.secondaryContent}`]: {\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n },\n },\n }),\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n small: {\n padding: buttonSpacing.smaller,\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n padding: buttonSpacing.small,\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n padding: buttonSpacing.medium,\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n base: theme => ({\n lineHeight: '100%',\n marginTop: '4px',\n fontWeight: theme.global.type.fontWeights.regular,\n }),\n small: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n medium: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n large: theme => ({\n fontSize: theme.global.type.fontSizes.base[300],\n }),\n});\n\nexport const useCompoundButtonStyles = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n state.className = mergeClasses(\n rootStyles.base,\n rootStyles[state.size],\n state.primary && rootStyles.primary,\n state.subtle && rootStyles.subtle,\n state.transparent && rootStyles.transparent,\n (state.disabled || state.disabledFocusable) && rootStyles.disabled,\n state.iconOnly && rootIconOnlyStyles[state.size],\n state.className,\n );\n\n state.icon.className = mergeClasses(iconStyles.base, state.icon.className);\n\n state.contentContainer.className = mergeClasses(contentContainerStyles.base, state.contentContainer.className);\n\n state.secondaryContent.className = mergeClasses(\n CompoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[state.size],\n state.secondaryContent.className,\n );\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
|
@@ -7,11 +7,11 @@ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./
|
|
7
7
|
*/
|
8
8
|
var renderMenuButton = function (state) {
|
9
9
|
var _a = react_utilities_1.getSlotsCompat(state, useMenuButton_1.menuButtonShorthandPropsCompat), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
-
var children = state.children, iconOnly = state.iconOnly;
|
10
|
+
var children = state.children, icon = state.icon, iconOnly = state.iconOnly;
|
11
11
|
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
12
12
|
React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
|
13
13
|
!iconOnly && children,
|
14
|
-
!iconOnly && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon))));
|
14
|
+
(!iconOnly || !icon.children) && React.createElement(slots.menuIcon, tslib_1.__assign({}, slotProps.menuIcon))));
|
15
15
|
};
|
16
16
|
exports.renderMenuButton = renderMenuButton;
|
17
17
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,gBAAgB,GAAG,UAAC,KAAsB;QAC/C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,8CAA8B,CAAC,EAA1E,KAAK,WAAA,EAAE,SAAS,eAA0D,CAAC;QAC3E,IAAA,QAAQ,GAAe,KAAK,
|
1
|
+
{"version":3,"file":"renderMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/renderMenuButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,gBAAgB,GAAG,UAAC,KAAsB;QAC/C,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,8CAA8B,CAAC,EAA1E,KAAK,WAAA,EAAE,SAAS,eAA0D,CAAC;QAC3E,IAAA,QAAQ,GAAqB,KAAK,SAA1B,EAAE,IAAI,GAAe,KAAK,KAApB,EAAE,QAAQ,GAAK,KAAK,SAAV,CAAW;QAE3C,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACjC,CAAC,QAAQ,IAAI,QAAQ;YACrB,CAAC,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,oBAAC,KAAK,CAAC,QAAQ,uBAAK,SAAS,CAAC,QAAQ,EAAI,CACjE,CACd,CAAC;IACJ,CAAC,CAAC;IAXW,QAAA,gBAAgB,oBAW3B","sourcesContent":["import * as React from 'react';\nimport { getSlotsCompat } from '@fluentui/react-utilities';\nimport { menuButtonShorthandPropsCompat } from './useMenuButton';\nimport type { MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlotsCompat(state, menuButtonShorthandPropsCompat);\n const { children, icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n <slots.icon {...slotProps.icon} />\n {!iconOnly && children}\n {(!iconOnly || !icon.children) && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACU,QAAA,8BAA8B,GAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAErG,IAAM,UAAU,GAAG,gCAAc,CAAkB,EAAE,SAAS,EAAE,sCAA8B,EAAE,CAAC,CAAC;IAElG;;;;OAIG;IACI,IAAM,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;QAC/G,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,eAAe;YACf,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,mBAAmB;YACnB,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACxB,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,sCAA8B,CAAC,EACnF,uCAAqB,CAAC,KAAK,EAAE,sCAA8B,CAAC,
|
1
|
+
{"version":3,"file":"useMenuButton.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButton.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACU,QAAA,8BAA8B,GAAqC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAErG,IAAM,UAAU,GAAG,gCAAc,CAAkB,EAAE,SAAS,EAAE,sCAA8B,EAAE,CAAC,CAAC;IAElG;;;;OAIG;IACI,IAAM,aAAa,GAAG,UAAC,KAAsB,EAAE,GAA2B,EAAE,YAA8B;QAC/G,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;YACH,EAAE,EAAE,QAAQ;YACZ,eAAe;YACf,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACpB,mBAAmB;YACnB,QAAQ,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACxB,iBAAiB;YACjB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;SACf,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,sCAA8B,CAAC,EACnF,uCAAqB,CAAC,KAAK,EAAE,sCAA8B,CAAC,CAC7D,CAAC;QAEF,uCAAkB,CAAC,KAAK,CAAC,CAAC;QAE1B,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IApBW,QAAA,aAAa,iBAoBxB","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { useMenuButtonState } from './useMenuButtonState';\nimport type { MenuButtonProps, MenuButtonShorthandPropsCompat, MenuButtonState } from './MenuButton.types';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const menuButtonShorthandPropsCompat: MenuButtonShorthandPropsCompat[] = ['icon', 'menuIcon'];\n\nconst mergeProps = makeMergeProps<MenuButtonState>({ deepMerge: menuButtonShorthandPropsCompat });\n\n/**\n * Given user props, defines default props for the MenuButton, calls useButtonState, and returns processed state.\n * @param props - User provided props to the MenuButton component.\n * @param ref - User provided ref to be passed to the MenuButton component.\n */\nexport const useMenuButton = (props: MenuButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: MenuButtonProps) => {\n const state = mergeProps(\n {\n ref,\n as: 'button',\n // Button slots\n icon: { as: 'span' },\n // MenuButton slots\n menuIcon: { as: 'span' },\n // Non-slot props\n size: 'medium',\n type: 'button', // This is added because the default for type is 'submit'\n },\n defaultProps && resolveShorthandProps(defaultProps, menuButtonShorthandPropsCompat),\n resolveShorthandProps(props, menuButtonShorthandPropsCompat),\n );\n\n useMenuButtonState(state);\n\n return state;\n};\n"]}
|
@@ -10,7 +10,8 @@ define(["require", "exports", "react", "@fluentui/react-icons", "../Button/useBu
|
|
10
10
|
var useMenuButtonState = function (state) {
|
11
11
|
// It behaves like a button.
|
12
12
|
useButtonState_1.useButtonState(state);
|
13
|
-
var menuIcon = state.menuIcon, size = state.size;
|
13
|
+
var children = state.children, menuIcon = state.menuIcon, size = state.size;
|
14
|
+
state.iconOnly = !children;
|
14
15
|
if (!menuIcon.children) {
|
15
16
|
if (size === 'large') {
|
16
17
|
menuIcon.children = React.createElement(react_icons_1.ChevronDown24Regular, null);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.tsx"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEd,IAAA,QAAQ,GAAW,KAAK,SAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;
|
1
|
+
{"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.tsx"],"names":[],"mappings":";;;;IAKA;;;;OAIG;IACI,IAAM,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEd,IAAA,QAAQ,GAAqB,KAAK,SAA1B,EAAE,QAAQ,GAAW,KAAK,SAAhB,EAAE,IAAI,GAAK,KAAK,KAAV,CAAW;QAC3C,KAAK,CAAC,QAAQ,GAAG,CAAC,QAAQ,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACtB,IAAI,IAAI,KAAK,OAAO,EAAE;gBACpB,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;iBAAM;gBACL,QAAQ,CAAC,QAAQ,GAAG,oBAAC,kCAAoB,OAAG,CAAC;aAC9C;SACF;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAfW,QAAA,kBAAkB,sBAe7B","sourcesContent":["import * as React from 'react';\nimport { ChevronDown20Regular, ChevronDown24Regular } from '@fluentui/react-icons';\nimport { useButtonState } from '../Button/useButtonState';\nimport type { MenuButtonState } from './MenuButton.types';\n\n/**\n * The useMenuButtonState hook processes the MenuButton state, first calling useButtonState, and then adding any\n * additional MenuButton specific processing.\n * @param state - MenuButtonButton state to mutate.\n */\nexport const useMenuButtonState = (state: MenuButtonState): MenuButtonState => {\n // It behaves like a button.\n useButtonState(state);\n\n const { children, menuIcon, size } = state;\n state.iconOnly = !children;\n if (!menuIcon.children) {\n if (size === 'large') {\n menuIcon.children = <ChevronDown24Regular />;\n } else {\n menuIcon.children = <ChevronDown20Regular />;\n }\n }\n\n return state;\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useMenuButtonStyles.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,iBAAiB,GAAG,8BAAU,CAAC;QACnC,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAC;IAEI,IAAM,mBAAmB,GAAG,UAAC,KAAsB;QACxD,IAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;QAE3C,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,gCAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9F,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["import {
|
1
|
+
{"version":3,"file":"useMenuButtonStyles.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,iBAAiB,GAAG,8BAAU,CAAC;QACnC,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,MAAM,EAAE;YACN,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;QACD,KAAK,EAAE;YACL,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,MAAM;SACd;KACF,CAAC,CAAC;IAEI,IAAM,mBAAmB,GAAG,UAAC,KAAsB;QACxD,IAAM,cAAc,GAAG,iBAAiB,EAAE,CAAC;QAE3C,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,gCAAY,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QAE9F,iCAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,mBAAmB,uBAQ9B","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { useButtonStyles } from '../Button/useButtonStyles';\nimport type { MenuButtonState } from './MenuButton.types';\n\nconst useMenuIconStyles = makeStyles({\n small: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n medium: {\n fontSize: '20px',\n height: '20px',\n width: '20px',\n },\n large: {\n fontSize: '24px',\n height: '24px',\n width: '24px',\n },\n});\n\nexport const useMenuButtonStyles = (state: MenuButtonState): MenuButtonState => {\n const menuIconStyles = useMenuIconStyles();\n\n state.menuIcon.className = mergeClasses(menuIconStyles[state.size], state.menuIcon.className);\n\n useButtonStyles(state);\n\n return state;\n};\n"]}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import type { SplitButtonProps } from './SplitButton.types';
|
3
|
+
/**
|
4
|
+
* SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
|
5
|
+
* action, while interacting with the second one opens a menu with secondary actions.
|
6
|
+
*/
|
7
|
+
export declare const SplitButton: React.ForwardRefExoticComponent<SplitButtonProps & React.RefAttributes<HTMLElement>>;
|
@@ -0,0 +1,19 @@
|
|
1
|
+
define(["require", "exports", "react", "../Button/index", "../MenuButton/index", "./renderSplitButton", "./useSplitButton", "./useSplitButtonStyles"], function (require, exports, React, index_1, index_2, renderSplitButton_1, useSplitButton_1, useSplitButtonStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.SplitButton = void 0;
|
5
|
+
/**
|
6
|
+
* SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary
|
7
|
+
* action, while interacting with the second one opens a menu with secondary actions.
|
8
|
+
*/
|
9
|
+
exports.SplitButton = React.forwardRef(function (props, ref) {
|
10
|
+
var state = useSplitButton_1.useSplitButton(props, ref, {
|
11
|
+
button: { as: index_1.Button },
|
12
|
+
menuButton: { as: index_2.MenuButton },
|
13
|
+
});
|
14
|
+
useSplitButtonStyles_1.useSplitButtonStyles(state);
|
15
|
+
return renderSplitButton_1.renderSplitButton(state);
|
16
|
+
});
|
17
|
+
exports.SplitButton.displayName = 'SplitButton';
|
18
|
+
});
|
19
|
+
//# sourceMappingURL=SplitButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;;IAQA;;;OAGG;IACU,QAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;QACpF,IAAM,KAAK,GAAG,+BAAc,CAAC,KAAK,EAAE,GAAG,EAAE;YACvC,MAAM,EAAE,EAAE,EAAE,EAAE,cAAM,EAAE;YACtB,UAAU,EAAE,EAAE,EAAE,EAAE,kBAAU,EAAE;SAC/B,CAAC,CAAC;QAEH,2CAAoB,CAAC,KAAK,CAAC,CAAC;QAE5B,OAAO,qCAAiB,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { Button } from '../Button/index';\nimport { MenuButton } from '../MenuButton/index';\nimport { renderSplitButton } from './renderSplitButton';\nimport { useSplitButton } from './useSplitButton';\nimport { useSplitButtonStyles } from './useSplitButtonStyles';\nimport type { SplitButtonProps } from './SplitButton.types';\n\n/**\n * SplitButtons are a grouping of two interactive surfaces where the interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>((props, ref) => {\n const state = useSplitButton(props, ref, {\n button: { as: Button },\n menuButton: { as: MenuButton },\n });\n\n useSplitButtonStyles(state);\n\n return renderSplitButton(state);\n});\n\nSplitButton.displayName = 'SplitButton';\n"]}
|
@@ -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 @@
|
|
1
|
+
{"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport type { ComponentStateCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';\nimport type { ButtonProps, ButtonShorthandPropsCompat } from '../Button/Button.types';\nimport type { MenuButtonProps } from '../MenuButton/MenuButton.types';\n\nexport interface SplitButtonProps extends Omit<ButtonProps, ButtonShorthandPropsCompat>, MenuButtonProps {\n /**\n * Button to perform primary action in SplitButton.\n */\n button?: ShorthandPropsCompat<ButtonProps>;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: ShorthandPropsCompat<MenuButtonProps>;\n\n /**\n * Ref to the Button element.\n */\n buttonRef?: React.Ref<HTMLElement>;\n\n /**\n * Ref to the MenuButton element.\n */\n menuButtonRef?: React.Ref<HTMLElement>;\n}\n\nexport type SplitButtonShorthandPropsCompat = 'button' | 'menuButton';\n\nexport type SplitButtonDefaultedProps = 'size';\n\nexport interface SplitButtonState\n extends ComponentStateCompat<SplitButtonProps, SplitButtonShorthandPropsCompat, SplitButtonDefaultedProps> {\n /**\n * Ref to the root element\n */\n ref: React.Ref<HTMLElement>;\n}\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./SplitButton", "./SplitButton.types", "./renderSplitButton", "./useSplitButton", "./useSplitButtonStyles"], function (require, exports, tslib_1, SplitButton_1, SplitButton_types_1, renderSplitButton_1, useSplitButton_1, useSplitButtonStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useSplitButtonStyles = void 0;
|
5
|
+
tslib_1.__exportStar(SplitButton_1, exports);
|
6
|
+
tslib_1.__exportStar(SplitButton_types_1, exports);
|
7
|
+
tslib_1.__exportStar(renderSplitButton_1, exports);
|
8
|
+
tslib_1.__exportStar(useSplitButton_1, exports);
|
9
|
+
Object.defineProperty(exports, "useSplitButtonStyles", { enumerable: true, get: function () { return useSplitButtonStyles_1.useSplitButtonStyles; } });
|
10
|
+
});
|
11
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;;IAAA,6CAA8B;IAC9B,mDAAoC;IACpC,mDAAoC;IACpC,gDAAiC;IACxB,4HAAA,oBAAoB,OAAA","sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { useSplitButtonStyles } from './useSplitButtonStyles';\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./useSplitButton"], function (require, exports, tslib_1, React, react_utilities_1, useSplitButton_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderSplitButton = void 0;
|
5
|
+
/**
|
6
|
+
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
7
|
+
*/
|
8
|
+
var renderSplitButton = function (state) {
|
9
|
+
var _a = react_utilities_1.getSlotsCompat(state, useSplitButton_1.splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
+
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
11
|
+
React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)),
|
12
|
+
React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton))));
|
13
|
+
};
|
14
|
+
exports.renderSplitButton = renderSplitButton;
|
15
|
+
});
|
16
|
+
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAuB;QACjD,IAAA,KAAuB,gCAAc,CAAC,KAAK,EAAE,0CAAyB,CAAC,EAArE,KAAK,WAAA,EAAE,SAAS,eAAqD,CAAC;QAE9E,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACtC,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACnC,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,iBAAiB,qBAS5B","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"]}
|
@@ -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;
|