@fluentui/react-button 1.0.0-beta.8 → 9.0.0-alpha.100
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +3258 -1
- package/CHANGELOG.md +1247 -2
- package/README.md +19 -108
- package/dist/demo/index.html +71 -0
- package/dist/demo/react-dom.development.js +21413 -0
- package/dist/demo/react.development.js +3155 -0
- package/dist/react-button.d.ts +130 -355
- package/lib/Button.js.map +1 -1
- package/lib/CompoundButton.js.map +1 -1
- package/lib/MenuButton.js.map +1 -1
- package/lib/SplitButton.js.map +1 -1
- package/lib/ToggleButton.js.map +1 -1
- package/lib/common/isConformant.d.ts +4 -2
- package/lib/common/isConformant.js +9 -5
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Button/Button.d.ts +4 -5
- package/lib/components/Button/Button.js +8 -9
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.types.d.ts +46 -114
- package/lib/components/Button/Button.types.js +1 -0
- package/lib/components/Button/Button.types.js.map +1 -1
- package/lib/components/Button/index.d.ts +3 -3
- package/lib/components/Button/index.js +4 -3
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.d.ts +2 -2
- package/lib/components/Button/renderButton.js +10 -10
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.d.ts +5 -10
- package/lib/components/Button/useButton.js +49 -24
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.d.ts +10 -0
- package/lib/components/Button/useButtonStyles.js +354 -0
- package/lib/components/Button/useButtonStyles.js.map +1 -0
- package/lib/components/CompoundButton/CompoundButton.d.ts +4 -5
- package/lib/components/CompoundButton/CompoundButton.js +8 -11
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.types.d.ts +8 -27
- package/lib/components/CompoundButton/CompoundButton.types.js +1 -0
- package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib/components/CompoundButton/index.d.ts +2 -1
- package/lib/components/CompoundButton/index.js +3 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.d.ts +2 -2
- package/lib/components/CompoundButton/renderCompoundButton.js +10 -12
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.d.ts +5 -10
- package/lib/components/CompoundButton/useCompoundButton.js +25 -28
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +164 -0
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.d.ts +4 -5
- package/lib/components/MenuButton/MenuButton.js +8 -21
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.types.d.ts +7 -50
- package/lib/components/MenuButton/MenuButton.types.js +1 -0
- package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib/components/MenuButton/index.d.ts +2 -3
- package/lib/components/MenuButton/index.js +3 -3
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.d.ts +2 -4
- package/lib/components/MenuButton/renderMenuButton.js +10 -14
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.d.ts +3 -7
- package/lib/components/MenuButton/useMenuButton.js +28 -22
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js +34 -0
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.d.ts +5 -5
- package/lib/components/SplitButton/SplitButton.js +9 -22
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.types.d.ts +12 -28
- package/lib/components/SplitButton/SplitButton.types.js +1 -0
- package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib/components/SplitButton/index.d.ts +3 -2
- package/lib/components/SplitButton/index.js +3 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.d.ts +2 -4
- package/lib/components/SplitButton/renderSplitButton.js +8 -10
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.d.ts +5 -7
- package/lib/components/SplitButton/useSplitButton.js +69 -47
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js +77 -0
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.d.ts +4 -5
- package/lib/components/ToggleButton/ToggleButton.js +8 -11
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.types.d.ts +11 -17
- package/lib/components/ToggleButton/ToggleButton.types.js +1 -0
- package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib/components/ToggleButton/index.d.ts +3 -3
- package/lib/components/ToggleButton/index.js +4 -3
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib/components/ToggleButton/renderToggleButton.js +2 -0
- package/lib/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib/components/ToggleButton/useToggleButton.d.ts +8 -5
- package/lib/components/ToggleButton/useToggleButton.js +47 -5
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js +190 -0
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Button.js +7 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +7 -2
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +7 -2
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +7 -2
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +7 -2
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/common/isConformant.d.ts +4 -2
- package/lib-commonjs/common/isConformant.js +19 -7
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Button/Button.d.ts +4 -5
- package/lib-commonjs/components/Button/Button.js +20 -12
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.d.ts +46 -114
- package/lib-commonjs/components/Button/Button.types.js +4 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.d.ts +3 -3
- package/lib-commonjs/components/Button/index.js +23 -5
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.d.ts +2 -2
- package/lib-commonjs/components/Button/renderButton.js +24 -14
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.d.ts +5 -10
- package/lib-commonjs/components/Button/useButton.js +59 -25
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.d.ts +10 -0
- package/lib-commonjs/components/Button/useButtonStyles.js +365 -0
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.d.ts +4 -5
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +20 -14
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.d.ts +8 -27
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js +4 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.d.ts +2 -1
- package/lib-commonjs/components/CompoundButton/index.js +22 -3
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.d.ts +2 -2
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +24 -16
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.d.ts +5 -10
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +35 -28
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +175 -0
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.d.ts +4 -5
- package/lib-commonjs/components/MenuButton/MenuButton.js +20 -24
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.d.ts +7 -50
- package/lib-commonjs/components/MenuButton/MenuButton.types.js +4 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.d.ts +2 -3
- package/lib-commonjs/components/MenuButton/index.js +22 -5
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.d.ts +2 -4
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +24 -18
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.d.ts +3 -7
- package/lib-commonjs/components/MenuButton/useMenuButton.js +41 -23
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +44 -0
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.d.ts +5 -5
- package/lib-commonjs/components/SplitButton/SplitButton.js +21 -25
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.d.ts +12 -28
- package/lib-commonjs/components/SplitButton/SplitButton.types.js +4 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.d.ts +3 -2
- package/lib-commonjs/components/SplitButton/index.js +22 -3
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.d.ts +2 -4
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +22 -14
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.d.ts +5 -7
- package/lib-commonjs/components/SplitButton/useSplitButton.js +81 -48
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +88 -0
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.d.ts +4 -5
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +20 -14
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.d.ts +11 -17
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js +4 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.d.ts +3 -3
- package/lib-commonjs/components/ToggleButton/index.js +23 -5
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.d.ts +1 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +16 -0
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/useToggleButton.d.ts +8 -5
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +60 -7
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.d.ts +2 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +200 -0
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
- package/lib-commonjs/index.d.ts +0 -1
- package/lib-commonjs/index.js +11 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +37 -35
- package/config/api-extractor.json +0 -3
- package/config/pre-copy.json +0 -9
- package/config/tests.js +0 -11
- package/etc/react-button.api.md +0 -335
- package/just.config.ts +0 -3
- package/lib/components/Button/useButtonClasses.d.ts +0 -29
- package/lib/components/Button/useButtonClasses.js +0 -417
- package/lib/components/Button/useButtonClasses.js.map +0 -1
- package/lib/components/Button/useButtonState.d.ts +0 -6
- package/lib/components/Button/useButtonState.js +0 -28
- package/lib/components/Button/useButtonState.js.map +0 -1
- package/lib/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
- package/lib/components/CompoundButton/useCompoundButtonClasses.js +0 -180
- package/lib/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
- package/lib/components/MenuButton/useExpanded.d.ts +0 -18
- package/lib/components/MenuButton/useExpanded.js +0 -61
- package/lib/components/MenuButton/useExpanded.js.map +0 -1
- package/lib/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
- package/lib/components/MenuButton/useMenuButtonClasses.js +0 -78
- package/lib/components/MenuButton/useMenuButtonClasses.js.map +0 -1
- package/lib/components/MenuButton/useMenuButtonState.d.ts +0 -2
- package/lib/components/MenuButton/useMenuButtonState.js +0 -9
- package/lib/components/MenuButton/useMenuButtonState.js.map +0 -1
- package/lib/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
- package/lib/components/SplitButton/useSplitButtonClasses.js +0 -123
- package/lib/components/SplitButton/useSplitButtonClasses.js.map +0 -1
- package/lib/components/ToggleButton/useChecked.d.ts +0 -14
- package/lib/components/ToggleButton/useChecked.js +0 -25
- package/lib/components/ToggleButton/useChecked.js.map +0 -1
- package/lib/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
- package/lib/components/ToggleButton/useToggleButtonClasses.js +0 -130
- package/lib/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
- package/lib/utils/tempTypes.d.ts +0 -33
- package/lib/utils/tempTypes.js +0 -4
- package/lib/utils/tempTypes.js.map +0 -1
- package/lib/version.d.ts +0 -1
- package/lib/version.js +0 -5
- package/lib/version.js.map +0 -1
- package/lib-amd/Button.d.ts +0 -1
- package/lib-amd/Button.js +0 -6
- package/lib-amd/Button.js.map +0 -1
- package/lib-amd/CompoundButton.d.ts +0 -1
- package/lib-amd/CompoundButton.js +0 -6
- package/lib-amd/CompoundButton.js.map +0 -1
- package/lib-amd/MenuButton.d.ts +0 -1
- package/lib-amd/MenuButton.js +0 -6
- package/lib-amd/MenuButton.js.map +0 -1
- package/lib-amd/SplitButton.d.ts +0 -1
- package/lib-amd/SplitButton.js +0 -6
- package/lib-amd/SplitButton.js.map +0 -1
- package/lib-amd/ToggleButton.d.ts +0 -1
- package/lib-amd/ToggleButton.js +0 -6
- package/lib-amd/ToggleButton.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -2
- package/lib-amd/common/isConformant.js +0 -13
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Button/Button.d.ts +0 -7
- package/lib-amd/components/Button/Button.js +0 -16
- package/lib-amd/components/Button/Button.js.map +0 -1
- package/lib-amd/components/Button/Button.types.d.ts +0 -130
- package/lib-amd/components/Button/Button.types.js +0 -5
- package/lib-amd/components/Button/Button.types.js.map +0 -1
- package/lib-amd/components/Button/index.d.ts +0 -5
- package/lib-amd/components/Button/index.js +0 -9
- package/lib-amd/components/Button/index.js.map +0 -1
- package/lib-amd/components/Button/renderButton.d.ts +0 -5
- package/lib-amd/components/Button/renderButton.js +0 -17
- package/lib-amd/components/Button/renderButton.js.map +0 -1
- package/lib-amd/components/Button/useButton.d.ts +0 -13
- package/lib-amd/components/Button/useButton.js +0 -28
- package/lib-amd/components/Button/useButton.js.map +0 -1
- package/lib-amd/components/Button/useButtonClasses.d.ts +0 -29
- package/lib-amd/components/Button/useButtonClasses.js +0 -417
- package/lib-amd/components/Button/useButtonClasses.js.map +0 -1
- package/lib-amd/components/Button/useButtonState.d.ts +0 -6
- package/lib-amd/components/Button/useButtonState.js +0 -32
- package/lib-amd/components/Button/useButtonState.js.map +0 -1
- package/lib-amd/components/CompoundButton/CompoundButton.d.ts +0 -7
- package/lib-amd/components/CompoundButton/CompoundButton.js +0 -17
- package/lib-amd/components/CompoundButton/CompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/CompoundButton.types.d.ts +0 -33
- package/lib-amd/components/CompoundButton/CompoundButton.types.js +0 -5
- package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +0 -1
- package/lib-amd/components/CompoundButton/index.d.ts +0 -4
- package/lib-amd/components/CompoundButton/index.js +0 -8
- package/lib-amd/components/CompoundButton/index.js.map +0 -1
- package/lib-amd/components/CompoundButton/renderCompoundButton.d.ts +0 -5
- package/lib-amd/components/CompoundButton/renderCompoundButton.js +0 -19
- package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/useCompoundButton.d.ts +0 -13
- package/lib-amd/components/CompoundButton/useCompoundButton.js +0 -32
- package/lib-amd/components/CompoundButton/useCompoundButton.js.map +0 -1
- package/lib-amd/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
- package/lib-amd/components/CompoundButton/useCompoundButtonClasses.js +0 -182
- package/lib-amd/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
- package/lib-amd/components/MenuButton/MenuButton.d.ts +0 -7
- package/lib-amd/components/MenuButton/MenuButton.js +0 -26
- package/lib-amd/components/MenuButton/MenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/MenuButton.types.d.ts +0 -54
- package/lib-amd/components/MenuButton/MenuButton.types.js +0 -5
- package/lib-amd/components/MenuButton/MenuButton.types.js.map +0 -1
- package/lib-amd/components/MenuButton/index.d.ts +0 -6
- package/lib-amd/components/MenuButton/index.js +0 -10
- package/lib-amd/components/MenuButton/index.js.map +0 -1
- package/lib-amd/components/MenuButton/renderMenuButton.d.ts +0 -7
- package/lib-amd/components/MenuButton/renderMenuButton.js +0 -21
- package/lib-amd/components/MenuButton/renderMenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/useExpanded.d.ts +0 -18
- package/lib-amd/components/MenuButton/useExpanded.js +0 -62
- package/lib-amd/components/MenuButton/useExpanded.js.map +0 -1
- package/lib-amd/components/MenuButton/useMenuButton.d.ts +0 -10
- package/lib-amd/components/MenuButton/useMenuButton.js +0 -27
- package/lib-amd/components/MenuButton/useMenuButton.js.map +0 -1
- package/lib-amd/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
- package/lib-amd/components/MenuButton/useMenuButtonClasses.js +0 -81
- package/lib-amd/components/MenuButton/useMenuButtonClasses.js.map +0 -1
- package/lib-amd/components/MenuButton/useMenuButtonState.d.ts +0 -2
- package/lib-amd/components/MenuButton/useMenuButtonState.js +0 -11
- package/lib-amd/components/MenuButton/useMenuButtonState.js.map +0 -1
- package/lib-amd/components/SplitButton/SplitButton.d.ts +0 -7
- package/lib-amd/components/SplitButton/SplitButton.js +0 -26
- package/lib-amd/components/SplitButton/SplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/SplitButton.types.d.ts +0 -35
- package/lib-amd/components/SplitButton/SplitButton.types.js +0 -5
- package/lib-amd/components/SplitButton/SplitButton.types.js.map +0 -1
- package/lib-amd/components/SplitButton/index.d.ts +0 -4
- package/lib-amd/components/SplitButton/index.js +0 -8
- package/lib-amd/components/SplitButton/index.js.map +0 -1
- package/lib-amd/components/SplitButton/renderSplitButton.d.ts +0 -7
- package/lib-amd/components/SplitButton/renderSplitButton.js +0 -17
- package/lib-amd/components/SplitButton/renderSplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/useSplitButton.d.ts +0 -10
- package/lib-amd/components/SplitButton/useSplitButton.js +0 -50
- package/lib-amd/components/SplitButton/useSplitButton.js.map +0 -1
- package/lib-amd/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
- package/lib-amd/components/SplitButton/useSplitButtonClasses.js +0 -123
- package/lib-amd/components/SplitButton/useSplitButtonClasses.js.map +0 -1
- package/lib-amd/components/ToggleButton/ToggleButton.d.ts +0 -7
- package/lib-amd/components/ToggleButton/ToggleButton.js +0 -17
- package/lib-amd/components/ToggleButton/ToggleButton.js.map +0 -1
- package/lib-amd/components/ToggleButton/ToggleButton.types.d.ts +0 -25
- package/lib-amd/components/ToggleButton/ToggleButton.types.js +0 -5
- package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +0 -1
- package/lib-amd/components/ToggleButton/index.d.ts +0 -5
- package/lib-amd/components/ToggleButton/index.js +0 -9
- package/lib-amd/components/ToggleButton/index.js.map +0 -1
- package/lib-amd/components/ToggleButton/useChecked.d.ts +0 -14
- package/lib-amd/components/ToggleButton/useChecked.js +0 -27
- package/lib-amd/components/ToggleButton/useChecked.js.map +0 -1
- package/lib-amd/components/ToggleButton/useToggleButton.d.ts +0 -6
- package/lib-amd/components/ToggleButton/useToggleButton.js +0 -10
- package/lib-amd/components/ToggleButton/useToggleButton.js.map +0 -1
- package/lib-amd/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
- package/lib-amd/components/ToggleButton/useToggleButtonClasses.js +0 -132
- package/lib-amd/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
- package/lib-amd/index.d.ts +0 -6
- package/lib-amd/index.js +0 -10
- package/lib-amd/index.js.map +0 -1
- package/lib-amd/utils/tempTypes.d.ts +0 -33
- package/lib-amd/utils/tempTypes.js +0 -8
- package/lib-amd/utils/tempTypes.js.map +0 -1
- package/lib-amd/version.d.ts +0 -1
- package/lib-amd/version.js +0 -6
- package/lib-amd/version.js.map +0 -1
- package/lib-commonjs/components/Button/useButtonClasses.d.ts +0 -29
- package/lib-commonjs/components/Button/useButtonClasses.js +0 -419
- package/lib-commonjs/components/Button/useButtonClasses.js.map +0 -1
- package/lib-commonjs/components/Button/useButtonState.d.ts +0 -6
- package/lib-commonjs/components/Button/useButtonState.js +0 -30
- package/lib-commonjs/components/Button/useButtonState.js.map +0 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.d.ts +0 -4
- package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.js +0 -182
- package/lib-commonjs/components/CompoundButton/useCompoundButtonClasses.js.map +0 -1
- package/lib-commonjs/components/MenuButton/useExpanded.d.ts +0 -18
- package/lib-commonjs/components/MenuButton/useExpanded.js +0 -63
- package/lib-commonjs/components/MenuButton/useExpanded.js.map +0 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonClasses.d.ts +0 -3
- package/lib-commonjs/components/MenuButton/useMenuButtonClasses.js +0 -80
- package/lib-commonjs/components/MenuButton/useMenuButtonClasses.js.map +0 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonState.d.ts +0 -2
- package/lib-commonjs/components/MenuButton/useMenuButtonState.js +0 -11
- package/lib-commonjs/components/MenuButton/useMenuButtonState.js.map +0 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonClasses.d.ts +0 -3
- package/lib-commonjs/components/SplitButton/useSplitButtonClasses.js +0 -125
- package/lib-commonjs/components/SplitButton/useSplitButtonClasses.js.map +0 -1
- package/lib-commonjs/components/ToggleButton/useChecked.d.ts +0 -14
- package/lib-commonjs/components/ToggleButton/useChecked.js +0 -27
- package/lib-commonjs/components/ToggleButton/useChecked.js.map +0 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.d.ts +0 -3
- package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.js +0 -132
- package/lib-commonjs/components/ToggleButton/useToggleButtonClasses.js.map +0 -1
- package/lib-commonjs/utils/tempTypes.d.ts +0 -33
- package/lib-commonjs/utils/tempTypes.js +0 -6
- package/lib-commonjs/utils/tempTypes.js.map +0 -1
- package/lib-commonjs/version.d.ts +0 -1
- package/lib-commonjs/version.js +0 -7
- package/lib-commonjs/version.js.map +0 -1
- package/src/components/Button/Button.types.ts +0 -166
- package/src/components/CompoundButton/CompoundButton.types.ts +0 -37
- package/src/components/MenuButton/MenuButton.types.ts +0 -63
- package/src/components/SplitButton/SplitButton.types.ts +0 -41
- package/src/components/ToggleButton/ToggleButton.types.ts +0 -29
@@ -1,81 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@fluentui/react-theme-provider"], function (require, exports, react_theme_provider_1) {
|
2
|
-
"use strict";
|
3
|
-
var _a, _b;
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
var GlobalClassNames = {
|
6
|
-
root: 'ms-Button-root',
|
7
|
-
menuIcon: 'ms-Button-menuIcon',
|
8
|
-
_disabled: 'ms-Button--disabled',
|
9
|
-
_iconOnly: 'ms-Button--iconOnly',
|
10
|
-
_ghost: 'ms-Button--ghost',
|
11
|
-
_expanded: 'ms-Button--expanded',
|
12
|
-
};
|
13
|
-
exports.useMenuButtonClasses = react_theme_provider_1.makeVariantClasses({
|
14
|
-
name: 'MenuButton',
|
15
|
-
prefix: '--button',
|
16
|
-
styles: {
|
17
|
-
root: [
|
18
|
-
GlobalClassNames.root,
|
19
|
-
(_a = {
|
20
|
-
// This seems like a bad selector.
|
21
|
-
'& > .ms-Button-menuIcon + *': {
|
22
|
-
marginLeft: 0,
|
23
|
-
},
|
24
|
-
'& .ms-layer': {
|
25
|
-
position: 'absolute',
|
26
|
-
}
|
27
|
-
},
|
28
|
-
_a["&:hover ." + GlobalClassNames.menuIcon] = {
|
29
|
-
color: 'var(--button-hovered-menuIconColor, var(--button-menuIconColor))',
|
30
|
-
},
|
31
|
-
_a["&:active ." + GlobalClassNames.menuIcon] = {
|
32
|
-
color: 'var(--button-pressed-menuIconColor, var(--button-hovered-menuIconColor, var(--button-menuIconColor)))',
|
33
|
-
},
|
34
|
-
_a),
|
35
|
-
],
|
36
|
-
menuIcon: [
|
37
|
-
GlobalClassNames.menuIcon,
|
38
|
-
(_b = {
|
39
|
-
color: 'var(--button-menuIconColor)',
|
40
|
-
fontSize: 'var(--button-menuIconSize)'
|
41
|
-
},
|
42
|
-
_b["." + GlobalClassNames._disabled + " &"] = {
|
43
|
-
color: 'var(--button-disabled-menuIconColor)',
|
44
|
-
},
|
45
|
-
_b),
|
46
|
-
],
|
47
|
-
_disabled: [GlobalClassNames._disabled],
|
48
|
-
_iconOnly: [
|
49
|
-
GlobalClassNames._iconOnly,
|
50
|
-
{
|
51
|
-
'& > .ms-Button-icon + *': {
|
52
|
-
marginLeft: 0,
|
53
|
-
},
|
54
|
-
},
|
55
|
-
],
|
56
|
-
},
|
57
|
-
variants: function (theme) {
|
58
|
-
var _a, _b, _c, _d;
|
59
|
-
var palette = theme.palette;
|
60
|
-
return {
|
61
|
-
root: {
|
62
|
-
menuIconSize: '12px',
|
63
|
-
menuIconColor: 'var(--body-menuIconColor)',
|
64
|
-
},
|
65
|
-
ghost: {
|
66
|
-
menuIconColor: (_a = palette) === null || _a === void 0 ? void 0 : _a.neutralSecondary,
|
67
|
-
hovered: {
|
68
|
-
menuIconColor: (_b = palette) === null || _b === void 0 ? void 0 : _b.themePrimary,
|
69
|
-
},
|
70
|
-
pressed: {
|
71
|
-
menuIconColor: (_c = palette) === null || _c === void 0 ? void 0 : _c.black,
|
72
|
-
},
|
73
|
-
},
|
74
|
-
transparent: {
|
75
|
-
menuIconColor: (_d = palette) === null || _d === void 0 ? void 0 : _d.neutralSecondary,
|
76
|
-
},
|
77
|
-
};
|
78
|
-
},
|
79
|
-
});
|
80
|
-
});
|
81
|
-
//# sourceMappingURL=useMenuButtonClasses.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useMenuButtonClasses.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonClasses.ts"],"names":[],"mappings":";;;;IAGA,IAAM,gBAAgB,GAAG;QACvB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,oBAAoB;QAC9B,SAAS,EAAE,qBAAqB;QAChC,SAAS,EAAE,qBAAqB;QAChC,MAAM,EAAE,kBAAkB;QAC1B,SAAS,EAAE,qBAAqB;KACjC,CAAC;IAEW,QAAA,oBAAoB,GAAG,yCAAkB,CAAsC;QAC1F,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,gBAAgB,CAAC,IAAI;;wBAEnB,kCAAkC;wBAClC,6BAA6B,EAAE;4BAC7B,UAAU,EAAE,CAAC;yBACd;wBAED,aAAa,EAAE;4BACb,QAAQ,EAAE,UAAU;yBACrB;;oBAED,GAAC,cAAY,gBAAgB,CAAC,QAAU,IAAG;wBACzC,KAAK,EAAE,kEAAkE;qBAC1E;oBAED,GAAC,eAAa,gBAAgB,CAAC,QAAU,IAAG;wBAC1C,KAAK,EACH,uGAAuG;qBAC1G;;aAEJ;YAED,QAAQ,EAAE;gBACR,gBAAgB,CAAC,QAAQ;;wBAEvB,KAAK,EAAE,6BAA6B;wBACpC,QAAQ,EAAE,4BAA4B;;oBAEtC,GAAC,MAAI,gBAAgB,CAAC,SAAS,OAAI,IAAG;wBACpC,KAAK,EAAE,sCAAsC;qBAC9C;;aAEJ;YAED,SAAS,EAAE,CAAC,gBAAgB,CAAC,SAAS,CAAC;YAEvC,SAAS,EAAE;gBACT,gBAAgB,CAAC,SAAS;gBAC1B;oBACE,yBAAyB,EAAE;wBACzB,UAAU,EAAE,CAAC;qBACd;iBACF;aACF;SACF;QAED,QAAQ,EAAE,UAAC,KAAY;;YACb,IAAA,uBAAO,CAAW;YAE1B,OAAO;gBACL,IAAI,EAAE;oBACJ,YAAY,EAAE,MAAM;oBACpB,aAAa,EAAE,2BAA2B;iBAC3C;gBAED,KAAK,EAAE;oBACL,aAAa,QAAE,OAAO,0CAAE,gBAAgB;oBACxC,OAAO,EAAE;wBACP,aAAa,QAAE,OAAO,0CAAE,YAAY;qBACrC;oBACD,OAAO,EAAE;wBACP,aAAa,QAAE,OAAO,0CAAE,KAAK;qBAC9B;iBACF;gBAED,WAAW,EAAE;oBACX,aAAa,QAAE,OAAO,0CAAE,gBAAgB;iBACzC;aACF,CAAC;QACJ,CAAC;KACF,CAAC,CAAC","sourcesContent":["import { makeVariantClasses, Theme } from '@fluentui/react-theme-provider';\nimport { MenuButtonState, MenuButtonVariants } from './MenuButton.types';\n\nconst GlobalClassNames = {\n root: 'ms-Button-root',\n menuIcon: 'ms-Button-menuIcon',\n _disabled: 'ms-Button--disabled',\n _iconOnly: 'ms-Button--iconOnly',\n _ghost: 'ms-Button--ghost',\n _expanded: 'ms-Button--expanded',\n};\n\nexport const useMenuButtonClasses = makeVariantClasses<MenuButtonState, MenuButtonVariants>({\n name: 'MenuButton',\n prefix: '--button',\n styles: {\n root: [\n GlobalClassNames.root,\n {\n // This seems like a bad selector.\n '& > .ms-Button-menuIcon + *': {\n marginLeft: 0,\n },\n\n '& .ms-layer': {\n position: 'absolute',\n },\n\n [`&:hover .${GlobalClassNames.menuIcon}`]: {\n color: 'var(--button-hovered-menuIconColor, var(--button-menuIconColor))',\n },\n\n [`&:active .${GlobalClassNames.menuIcon}`]: {\n color:\n 'var(--button-pressed-menuIconColor, var(--button-hovered-menuIconColor, var(--button-menuIconColor)))',\n },\n },\n ],\n\n menuIcon: [\n GlobalClassNames.menuIcon,\n {\n color: 'var(--button-menuIconColor)',\n fontSize: 'var(--button-menuIconSize)',\n\n [`.${GlobalClassNames._disabled} &`]: {\n color: 'var(--button-disabled-menuIconColor)',\n },\n },\n ],\n\n _disabled: [GlobalClassNames._disabled],\n\n _iconOnly: [\n GlobalClassNames._iconOnly,\n {\n '& > .ms-Button-icon + *': {\n marginLeft: 0,\n },\n },\n ],\n },\n\n variants: (theme: Theme): MenuButtonVariants => {\n const { palette } = theme;\n\n return {\n root: {\n menuIconSize: '12px',\n menuIconColor: 'var(--body-menuIconColor)',\n },\n\n ghost: {\n menuIconColor: palette?.neutralSecondary,\n hovered: {\n menuIconColor: palette?.themePrimary,\n },\n pressed: {\n menuIconColor: palette?.black,\n },\n },\n\n transparent: {\n menuIconColor: palette?.neutralSecondary,\n },\n };\n },\n});\n"]}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
define(["require", "exports", "../Button/useButtonState", "./useExpanded"], function (require, exports, useButtonState_1, useExpanded_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.useMenuButtonState = function (state) {
|
5
|
-
// It behaves like a button.
|
6
|
-
useButtonState_1.useButtonState(state);
|
7
|
-
// It can be expanded.
|
8
|
-
useExpanded_1.useExpanded(state);
|
9
|
-
};
|
10
|
-
});
|
11
|
-
//# sourceMappingURL=useMenuButtonState.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useMenuButtonState.js","sourceRoot":"../src/","sources":["components/MenuButton/useMenuButtonState.ts"],"names":[],"mappings":";;;IAIa,QAAA,kBAAkB,GAAG,UAAC,KAAsB;QACvD,4BAA4B;QAC5B,+BAAc,CAAC,KAAK,CAAC,CAAC;QAEtB,sBAAsB;QACtB,yBAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,CAAC","sourcesContent":["import { MenuButtonState } from './MenuButton.types';\nimport { useButtonState } from '../Button/useButtonState';\nimport { useExpanded } from './useExpanded';\n\nexport const useMenuButtonState = (state: MenuButtonState) => {\n // It behaves like a button.\n useButtonState(state);\n\n // It can be expanded.\n useExpanded(state);\n};\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { SplitButtonProps } from './SplitButton.types';
|
3
|
-
/**
|
4
|
-
* Define a styled SplitButton, using the `useSplitButton` hook.
|
5
|
-
* {@docCategory Button}
|
6
|
-
*/
|
7
|
-
export declare const SplitButton: React.ForwardRefExoticComponent<Pick<SplitButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
|
@@ -1,26 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "@fluentui/react-icons-mdl2", "@fluentui/react-theme-provider", "./useSplitButton", "./useSplitButtonClasses", "../Button/index", "../MenuButton/index"], function (require, exports, React, react_icons_mdl2_1, react_theme_provider_1, useSplitButton_1, useSplitButtonClasses_1, index_1, index_2) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
/**
|
5
|
-
* Define a styled SplitButton, using the `useSplitButton` hook.
|
6
|
-
* {@docCategory Button}
|
7
|
-
*/
|
8
|
-
exports.SplitButton = React.forwardRef(function (props, ref) {
|
9
|
-
var _a = useSplitButton_1.useSplitButton(props, ref, {
|
10
|
-
button: { as: index_1.Button },
|
11
|
-
menuButton: { as: index_2.MenuButton, iconOnly: true, icon: React.createElement(react_icons_mdl2_1.ChevronDownIcon, null) },
|
12
|
-
}), state = _a.state, render = _a.render;
|
13
|
-
useSplitButtonClasses_1.useSplitButtonClasses(state);
|
14
|
-
// TODO remove any
|
15
|
-
/**
|
16
|
-
* Type 'SplitButtonState' has no properties in common with type '{
|
17
|
-
* style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
|
18
|
-
* | undefined; }
|
19
|
-
*/
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
21
|
-
react_theme_provider_1.useInlineTokens(state, '--button');
|
22
|
-
return render(state);
|
23
|
-
});
|
24
|
-
exports.SplitButton.displayName = 'SplitButton';
|
25
|
-
});
|
26
|
-
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.tsx"],"names":[],"mappings":";;;IASA;;;OAGG;IACU,QAAA,WAAW,GAAG,KAAK,CAAC,UAAU,CAAgC,UAAC,KAAK,EAAE,GAAG;QAC9E,IAAA;;;UAGJ,EAHM,gBAAK,EAAE,kBAGb,CAAC;QAEH,6CAAqB,CAAC,KAAK,CAAC,CAAC;QAE7B,kBAAkB;QAClB;;;;WAIG;QACH,8DAA8D;QAC9D,sCAAe,CAAC,KAAY,EAAE,UAAU,CAAC,CAAC;QAE1C,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import * as React from 'react';\nimport { ChevronDownIcon } from '@fluentui/react-icons-mdl2';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { SplitButtonProps } from './SplitButton.types';\nimport { useSplitButton } from './useSplitButton';\nimport { useSplitButtonClasses } from './useSplitButtonClasses';\nimport { Button } from '../Button/index';\nimport { MenuButton } from '../MenuButton/index';\n\n/**\n * Define a styled SplitButton, using the `useSplitButton` hook.\n * {@docCategory Button}\n */\nexport const SplitButton = React.forwardRef<HTMLElement, SplitButtonProps>((props, ref) => {\n const { state, render } = useSplitButton(props, ref, {\n button: { as: Button },\n menuButton: { as: MenuButton, iconOnly: true, icon: <ChevronDownIcon /> },\n });\n\n useSplitButtonClasses(state);\n\n // TODO remove any\n /**\n * Type 'SplitButtonState' has no properties in common with type '{\n * style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }\n * | undefined; }\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n useInlineTokens(state as any, '--button');\n\n return render(state);\n});\n\nSplitButton.displayName = 'SplitButton';\n"]}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { ShorthandProps } from '@fluentui/react-compose/lib/next/index';
|
3
|
-
import { ButtonProps, ButtonVariants } from '../Button/Button.types';
|
4
|
-
import { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';
|
5
|
-
/**
|
6
|
-
* {@docCategory Button}
|
7
|
-
*/
|
8
|
-
export interface SplitButtonProps extends ButtonProps, MenuButtonProps {
|
9
|
-
/**
|
10
|
-
* Button to perform primary action in SplitButton.
|
11
|
-
*/
|
12
|
-
button?: ShorthandProps;
|
13
|
-
/**
|
14
|
-
* Divider that separates the primary action button and the menu button parts of the SplitButton
|
15
|
-
*/
|
16
|
-
divider?: ShorthandProps;
|
17
|
-
/**
|
18
|
-
* Button that opens menu with secondary actions in SplitButton.
|
19
|
-
*/
|
20
|
-
menuButton?: ShorthandProps;
|
21
|
-
}
|
22
|
-
export interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {
|
23
|
-
menuButtonRef?: React.RefObject<HTMLButtonElement>;
|
24
|
-
}
|
25
|
-
/**
|
26
|
-
* {@docCategory Button}
|
27
|
-
*/
|
28
|
-
export declare type SplitButtonTokens = MenuButtonTokens & {
|
29
|
-
dividerColor?: string;
|
30
|
-
dividerThickness?: string;
|
31
|
-
};
|
32
|
-
/**
|
33
|
-
* {@docCategory Button}
|
34
|
-
*/
|
35
|
-
export declare type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SplitButton.types.js","sourceRoot":"../src/","sources":["components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ShorthandProps } from '@fluentui/react-compose/lib/next/index';\nimport { ButtonProps, ButtonVariants } from '../Button/Button.types';\nimport { MenuButtonProps, MenuButtonState, MenuButtonTokens } from '../MenuButton/MenuButton.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface SplitButtonProps extends ButtonProps, MenuButtonProps {\n /**\n * Button to perform primary action in SplitButton.\n */\n button?: ShorthandProps;\n\n /**\n * Divider that separates the primary action button and the menu button parts of the SplitButton\n */\n divider?: ShorthandProps;\n\n /**\n * Button that opens menu with secondary actions in SplitButton.\n */\n menuButton?: ShorthandProps;\n}\n\nexport interface SplitButtonState extends Omit<SplitButtonProps, 'menu'>, MenuButtonState {\n menuButtonRef?: React.RefObject<HTMLButtonElement>;\n}\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonTokens = MenuButtonTokens & {\n dividerColor?: string;\n dividerThickness?: string;\n};\n\n/**\n * {@docCategory Button}\n */\nexport type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;\n"]}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./SplitButton", "./useSplitButton", "./useSplitButtonClasses"], function (require, exports, tslib_1, SplitButton_1, useSplitButton_1, useSplitButtonClasses_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(SplitButton_1, exports);
|
5
|
-
tslib_1.__exportStar(useSplitButton_1, exports);
|
6
|
-
tslib_1.__exportStar(useSplitButtonClasses_1, exports);
|
7
|
-
});
|
8
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/SplitButton/index.ts"],"names":[],"mappings":";;;IACA,6CAA8B;IAC9B,gDAAiC;IACjC,uDAAwC","sourcesContent":["export * from './SplitButton.types';\nexport * from './SplitButton';\nexport * from './useSplitButton';\nexport * from './useSplitButtonClasses';\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { SplitButtonState } from './SplitButton.types';
|
2
|
-
/**
|
3
|
-
* Redefine the render function to add slots. Reuse the button structure but add
|
4
|
-
* slots to children.
|
5
|
-
* @param state
|
6
|
-
*/
|
7
|
-
export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./useSplitButton"], function (require, exports, tslib_1, React, index_1, useSplitButton_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
/**
|
5
|
-
* Redefine the render function to add slots. Reuse the button structure but add
|
6
|
-
* slots to children.
|
7
|
-
* @param state
|
8
|
-
*/
|
9
|
-
exports.renderSplitButton = function (state) {
|
10
|
-
var _a = index_1.getSlots(state, useSplitButton_1.splitButtonShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
|
11
|
-
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
12
|
-
React.createElement(slots.button, tslib_1.__assign({}, slotProps.button)),
|
13
|
-
React.createElement(slots.divider, tslib_1.__assign({}, slotProps.divider)),
|
14
|
-
React.createElement(slots.menuButton, tslib_1.__assign({}, slotProps.menuButton))));
|
15
|
-
};
|
16
|
-
});
|
17
|
-
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"renderSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";;;IAKA;;;;OAIG;IACU,QAAA,iBAAiB,GAAG,UAAC,KAAuB;QACjD,IAAA,wEAAiE,EAA/D,gBAAK,EAAE,wBAAwD,CAAC;QAExE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC5B,oBAAC,KAAK,CAAC,MAAM,uBAAK,SAAS,CAAC,MAAM,EAAI;YACtC,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;YACxC,oBAAC,KAAK,CAAC,UAAU,uBAAK,SAAS,CAAC,UAAU,EAAI,CACnC,CACd,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonState } from './SplitButton.types';\nimport { splitButtonShorthandProps } from './useSplitButton';\n\n/**\n * Redefine the render function to add slots. Reuse the button structure but add\n * slots to children.\n * @param state\n */\nexport const renderSplitButton = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots(state, splitButtonShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n <slots.button {...slotProps.button} />\n <slots.divider {...slotProps.divider} />\n <slots.menuButton {...slotProps.menuButton} />\n </slots.root>\n );\n};\n"]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { SplitButtonProps, SplitButtonState } from './SplitButton.types';
|
3
|
-
export declare const splitButtonShorthandProps: string[];
|
4
|
-
/**
|
5
|
-
* Redefine the component factory, reusing button factory.
|
6
|
-
*/
|
7
|
-
export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLElement>, defaultProps?: SplitButtonProps | undefined) => {
|
8
|
-
state: SplitButtonState;
|
9
|
-
render: (state: SplitButtonState) => JSX.Element;
|
10
|
-
};
|
@@ -1,50 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "react", "@fluentui/react-compose/lib/next/index", "./renderSplitButton", "@fluentui/react-hooks"], function (require, exports, tslib_1, React, index_1, renderSplitButton_1, react_hooks_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];
|
5
|
-
var mergeProps = index_1.makeMergeProps({ deepMerge: exports.splitButtonShorthandProps });
|
6
|
-
/**
|
7
|
-
* Redefine the component factory, reusing button factory.
|
8
|
-
*/
|
9
|
-
exports.useSplitButton = function (props, ref, defaultProps) {
|
10
|
-
var _a = index_1.resolveShorthandProps(props, exports.splitButtonShorthandProps), _b = _a.as, as = _b === void 0 ? 'span' : _b, className = _a.className, style = _a.style, primary = _a.primary, ghost = _a.ghost, disabled = _a.disabled, loading = _a.loading, circular = _a.circular, block = _a.block, menu = _a.menu, size = _a.size, transparent = _a.transparent, userProps = tslib_1.__rest(_a, ["as", "className", "style", "primary", "ghost", "disabled", "loading", "circular", "block", "menu", "size", "transparent"]);
|
11
|
-
ref = react_hooks_1.useMergedRefs(ref, React.useRef(null));
|
12
|
-
// A split button should be disabled when disabled or loading.
|
13
|
-
var disabledOrLoading = disabled || loading;
|
14
|
-
var state = mergeProps({
|
15
|
-
as: 'span',
|
16
|
-
className: className,
|
17
|
-
style: style,
|
18
|
-
disabled: disabled,
|
19
|
-
block: block,
|
20
|
-
primary: primary,
|
21
|
-
size: size,
|
22
|
-
transparent: transparent,
|
23
|
-
'aria-disabled': disabledOrLoading,
|
24
|
-
button: tslib_1.__assign({ as: 'span', ref: ref,
|
25
|
-
primary: primary,
|
26
|
-
ghost: ghost,
|
27
|
-
circular: circular, disabled: disabledOrLoading, loading: loading,
|
28
|
-
size: size,
|
29
|
-
transparent: transparent }, userProps),
|
30
|
-
divider: { as: 'span', children: null },
|
31
|
-
menuButton: {
|
32
|
-
as: 'span',
|
33
|
-
primary: primary,
|
34
|
-
ghost: ghost,
|
35
|
-
circular: circular,
|
36
|
-
size: size,
|
37
|
-
disabled: disabledOrLoading,
|
38
|
-
loading: loading,
|
39
|
-
transparent: transparent,
|
40
|
-
menu: menu,
|
41
|
-
children: null,
|
42
|
-
},
|
43
|
-
}, defaultProps);
|
44
|
-
return {
|
45
|
-
state: state,
|
46
|
-
render: renderSplitButton_1.renderSplitButton,
|
47
|
-
};
|
48
|
-
};
|
49
|
-
});
|
50
|
-
//# sourceMappingURL=useSplitButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useSplitButton.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";;;IAMa,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAErF,IAAM,UAAU,GAAG,sBAAc,CAAC,EAAE,SAAS,EAAE,iCAAyB,EAAE,CAAC,CAAC;IAE5E;;OAEG;IACU,QAAA,cAAc,GAAG,UAC5B,KAAuB,EACvB,GAA2B,EAC3B,YAA+B;QAE/B,IAAM,4EAcqD,EAbzD,UAAW,EAAX,gCAAW,EACX,wBAAS,EACT,gBAAK,EACL,oBAAO,EACP,gBAAK,EACL,sBAAQ,EACR,oBAAO,EACP,sBAAQ,EACR,gBAAK,EACL,cAAI,EACJ,cAAI,EACJ,4BAAW,EACX,2JACyD,CAAC;QAE5D,GAAG,GAAG,2BAAa,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAc,IAAI,CAAC,CAAC,CAAC;QAE1D,8DAA8D;QAC9D,IAAM,iBAAiB,GAAG,QAAQ,IAAI,OAAO,CAAC;QAE9C,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,EAAE,EAAE,MAAM;YACV,SAAS,WAAA;YACT,KAAK,OAAA;YACL,QAAQ,UAAA;YACR,KAAK,OAAA;YACL,OAAO,SAAA;YACP,IAAI,MAAA;YACJ,WAAW,aAAA;YACX,eAAe,EAAE,iBAAiB;YAElC,MAAM,qBACJ,EAAE,EAAE,MAAM,EACV,GAAG,KAAA;gBACH,OAAO,SAAA;gBACP,KAAK,OAAA;gBACL,QAAQ,UAAA,EACR,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,SAAA;gBACP,IAAI,MAAA;gBACJ,WAAW,aAAA,IACR,SAAS,CACb;YAED,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;YAEvC,UAAU,EAAE;gBACV,EAAE,EAAE,MAAM;gBACV,OAAO,SAAA;gBACP,KAAK,OAAA;gBACL,QAAQ,UAAA;gBACR,IAAI,MAAA;gBACJ,QAAQ,EAAE,iBAAiB;gBAC3B,OAAO,SAAA;gBACP,WAAW,aAAA;gBACX,IAAI,MAAA;gBACJ,QAAQ,EAAE,IAAI;aACf;SACF,EACD,YAAY,CACO,CAAC;QAEtB,OAAO;YACL,KAAK,OAAA;YACL,MAAM,EAAE,qCAAiB;SAC1B,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { resolveShorthandProps, makeMergeProps } from '@fluentui/react-compose/lib/next/index';\nimport { SplitButtonProps, SplitButtonState } from './SplitButton.types';\nimport { renderSplitButton } from './renderSplitButton';\nimport { useMergedRefs } from '@fluentui/react-hooks';\n\nexport const splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];\n\nconst mergeProps = makeMergeProps({ deepMerge: splitButtonShorthandProps });\n\n/**\n * Redefine the component factory, reusing button factory.\n */\nexport const useSplitButton = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: SplitButtonProps,\n) => {\n const {\n as = 'span',\n className,\n style,\n primary,\n ghost,\n disabled,\n loading,\n circular,\n block,\n menu,\n size,\n transparent,\n ...userProps\n } = resolveShorthandProps(props, splitButtonShorthandProps);\n\n ref = useMergedRefs(ref, React.useRef<HTMLElement>(null));\n\n // A split button should be disabled when disabled or loading.\n const disabledOrLoading = disabled || loading;\n\n const state = mergeProps(\n {\n as: 'span',\n className,\n style,\n disabled,\n block,\n primary,\n size,\n transparent,\n 'aria-disabled': disabledOrLoading,\n\n button: {\n as: 'span',\n ref,\n primary,\n ghost,\n circular,\n disabled: disabledOrLoading,\n loading,\n size,\n transparent,\n ...userProps,\n },\n\n divider: { as: 'span', children: null },\n\n menuButton: {\n as: 'span',\n primary,\n ghost,\n circular,\n size,\n disabled: disabledOrLoading,\n loading,\n transparent,\n menu,\n children: null,\n },\n },\n defaultProps,\n ) as SplitButtonState;\n\n return {\n state,\n render: renderSplitButton,\n };\n};\n"]}
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { Theme } from '@fluentui/react-theme-provider';
|
2
|
-
import { SplitButtonState } from './SplitButton.types';
|
3
|
-
export declare const useSplitButtonClasses: (state: SplitButtonState, theme?: Theme | undefined, renderer?: import("@fluentui/react-theme-provider").StyleRenderer | undefined) => void;
|
@@ -1,123 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-theme-provider", "@fluentui/style-utilities", "../Button/index"], function (require, exports, tslib_1, react_theme_provider_1, style_utilities_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
var _a, _b, _c, _d;
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
5
|
-
var GlobalClassNames = {
|
6
|
-
root: 'ms-SplitButton',
|
7
|
-
button: 'ms-SplitButton-button',
|
8
|
-
menuButton: 'ms-SplitButton-menuButton',
|
9
|
-
};
|
10
|
-
var menuButtonWidth = '32px';
|
11
|
-
exports.useSplitButtonClasses = react_theme_provider_1.makeVariantClasses({
|
12
|
-
name: 'SplitButton',
|
13
|
-
prefix: '--button',
|
14
|
-
styles: {
|
15
|
-
root: [
|
16
|
-
GlobalClassNames.root,
|
17
|
-
{
|
18
|
-
display: 'inline-flex',
|
19
|
-
justifyContent: 'stretch',
|
20
|
-
position: 'relative',
|
21
|
-
// Forward the menuIconSize to a variable which can be consumed by the child menu button.
|
22
|
-
'--button-splitMenuIconSize': 'var(--button-menuIconSize)',
|
23
|
-
},
|
24
|
-
],
|
25
|
-
button: [
|
26
|
-
GlobalClassNames.button,
|
27
|
-
{
|
28
|
-
'--button-borderRightWidth': 0,
|
29
|
-
'--button-borderTopRightRadius': 0,
|
30
|
-
'--button-borderBottomRightRadius': 0,
|
31
|
-
},
|
32
|
-
],
|
33
|
-
menuButton: [
|
34
|
-
GlobalClassNames.menuButton,
|
35
|
-
(_a = {},
|
36
|
-
// Scope the override to a child component, increase specificity.
|
37
|
-
_a["." + GlobalClassNames.root + " &"] = {
|
38
|
-
width: menuButtonWidth,
|
39
|
-
minWidth: menuButtonWidth,
|
40
|
-
'--button-borderLeftWidth': 0,
|
41
|
-
'--button-borderTopLeftRadius': 0,
|
42
|
-
'--button-borderBottomLeftRadius': 0,
|
43
|
-
'--button-iconColor': 'var(--button-menuIconColor)',
|
44
|
-
'--button-iconSize': 'var(--button-splitMenuIconSize)',
|
45
|
-
},
|
46
|
-
_a),
|
47
|
-
],
|
48
|
-
divider: (_b = {
|
49
|
-
width: 'var(--button-dividerThickness)',
|
50
|
-
backgroundColor: 'var(--button-dividerColor)',
|
51
|
-
position: 'absolute',
|
52
|
-
right: menuButtonWidth,
|
53
|
-
top: 'calc(100% - var(--button-dividerLength, 100% + 8px))',
|
54
|
-
bottom: 'calc(100% - var(--button-dividerLength, 100% + 8px))'
|
55
|
-
},
|
56
|
-
_b[style_utilities_1.EdgeChromiumHighContrastSelector] = {
|
57
|
-
backgroundColor: 'var(--button-highContrast-dividerColor)',
|
58
|
-
},
|
59
|
-
_b["." + GlobalClassNames.root + "[aria-disabled=\"true\"] &"] = (_c = {
|
60
|
-
backgroundColor: 'var(--button-disabled-dividerColor)'
|
61
|
-
},
|
62
|
-
_c[style_utilities_1.EdgeChromiumHighContrastSelector] = {
|
63
|
-
backgroundColor: 'var(--button-highContrast-disabled-dividerColor, var(--button-highContrast-dividerColor))',
|
64
|
-
},
|
65
|
-
_c),
|
66
|
-
_b),
|
67
|
-
_block: (_d = {
|
68
|
-
width: '100%',
|
69
|
-
maxWidth: '100%'
|
70
|
-
},
|
71
|
-
_d["." + GlobalClassNames.button] = {
|
72
|
-
flexGrow: 1,
|
73
|
-
maxWidth: '100%',
|
74
|
-
},
|
75
|
-
_d["." + GlobalClassNames.menuButton] = {
|
76
|
-
width: menuButtonWidth,
|
77
|
-
},
|
78
|
-
_d),
|
79
|
-
},
|
80
|
-
variants: function (theme) {
|
81
|
-
var _a;
|
82
|
-
var palette = theme.palette, semanticColors = theme.semanticColors;
|
83
|
-
return tslib_1.__assign({ root: {
|
84
|
-
size: {
|
85
|
-
smallest: '24px',
|
86
|
-
smaller: '24px',
|
87
|
-
small: '24px',
|
88
|
-
regular: '32px',
|
89
|
-
large: '40px',
|
90
|
-
larger: '48px',
|
91
|
-
largest: '64px',
|
92
|
-
},
|
93
|
-
dividerThickness: '1px',
|
94
|
-
dividerColor: (_a = palette) === null || _a === void 0 ? void 0 : _a.neutralTertiaryAlt,
|
95
|
-
disabled: {
|
96
|
-
dividerColor: semanticColors.disabledText,
|
97
|
-
},
|
98
|
-
menuIconColor: 'var(--body-menuIconColor)',
|
99
|
-
menuIconSize: '12px',
|
100
|
-
highContrast: {
|
101
|
-
dividerColor: 'WindowText',
|
102
|
-
disabled: {
|
103
|
-
dividerColor: 'GrayText',
|
104
|
-
},
|
105
|
-
},
|
106
|
-
}, primary: {
|
107
|
-
dividerColor: palette.white,
|
108
|
-
disabled: {
|
109
|
-
dividerColor: semanticColors.disabledText,
|
110
|
-
},
|
111
|
-
highContrast: {
|
112
|
-
dividerColor: 'Window',
|
113
|
-
disabled: {
|
114
|
-
dividerColor: 'GrayText',
|
115
|
-
},
|
116
|
-
},
|
117
|
-
}, transparent: {
|
118
|
-
menuIconColor: palette.neutralSecondary,
|
119
|
-
} }, index_1.ButtonSizeVariants);
|
120
|
-
},
|
121
|
-
});
|
122
|
-
});
|
123
|
-
//# sourceMappingURL=useSplitButtonClasses.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useSplitButtonClasses.js","sourceRoot":"../src/","sources":["components/SplitButton/useSplitButtonClasses.tsx"],"names":[],"mappings":";;;;IAKA,IAAM,gBAAgB,GAAG;QACvB,IAAI,EAAE,gBAAgB;QACtB,MAAM,EAAE,uBAAuB;QAC/B,UAAU,EAAE,2BAA2B;KACxC,CAAC;IAEF,IAAM,eAAe,GAAG,MAAM,CAAC;IAElB,QAAA,qBAAqB,GAAG,yCAAkB,CAAwC;QAC7F,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE,UAAU;QAElB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,gBAAgB,CAAC,IAAI;gBACrB;oBACE,OAAO,EAAE,aAAa;oBACtB,cAAc,EAAE,SAAS;oBACzB,QAAQ,EAAE,UAAU;oBAEpB,yFAAyF;oBACzF,4BAA4B,EAAE,4BAA4B;iBAC3D;aACF;YAED,MAAM,EAAE;gBACN,gBAAgB,CAAC,MAAM;gBACvB;oBACE,2BAA2B,EAAE,CAAC;oBAC9B,+BAA+B,EAAE,CAAC;oBAClC,kCAAkC,EAAE,CAAC;iBACtC;aACF;YAED,UAAU,EAAE;gBACV,gBAAgB,CAAC,UAAU;;oBAEzB,iEAAiE;oBACjE,GAAC,MAAI,gBAAgB,CAAC,IAAI,OAAI,IAAG;wBAC/B,KAAK,EAAE,eAAe;wBACtB,QAAQ,EAAE,eAAe;wBACzB,0BAA0B,EAAE,CAAC;wBAC7B,8BAA8B,EAAE,CAAC;wBACjC,iCAAiC,EAAE,CAAC;wBACpC,oBAAoB,EAAE,6BAA6B;wBACnD,mBAAmB,EAAE,iCAAiC;qBACvD;;aAEJ;YAED,OAAO;oBACL,KAAK,EAAE,gCAAgC;oBACvC,eAAe,EAAE,4BAA4B;oBAC7C,QAAQ,EAAE,UAAU;oBACpB,KAAK,EAAE,eAAe;oBACtB,GAAG,EAAE,sDAAsD;oBAC3D,MAAM,EAAE,sDAAsD;;gBAE9D,GAAC,kDAAgC,IAAG;oBAClC,eAAe,EAAE,yCAAyC;iBAC3D;gBAED,GAAC,MAAI,gBAAgB,CAAC,IAAI,+BAA0B;wBAClD,eAAe,EAAE,qCAAqC;;oBAEtD,GAAC,kDAAgC,IAAG;wBAClC,eAAe,EAAE,2FAA2F;qBAC7G;uBACF;mBACF;YAED,MAAM;oBACJ,KAAK,EAAE,MAAM;oBACb,QAAQ,EAAE,MAAM;;gBAEhB,GAAC,MAAI,gBAAgB,CAAC,MAAQ,IAAG;oBAC/B,QAAQ,EAAE,CAAC;oBACX,QAAQ,EAAE,MAAM;iBACjB;gBAED,GAAC,MAAI,gBAAgB,CAAC,UAAY,IAAG;oBACnC,KAAK,EAAE,eAAe;iBACvB;mBACF;SACF;QACD,QAAQ,EAAE,UAAC,KAAY;;YACb,IAAA,uBAAO,EAAE,qCAAc,CAAW;YAE1C,0BACE,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,QAAQ,EAAE,MAAM;wBAChB,OAAO,EAAE,MAAM;wBACf,KAAK,EAAE,MAAM;wBACb,OAAO,EAAE,MAAM;wBACf,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,MAAM;wBACd,OAAO,EAAE,MAAM;qBAChB;oBACD,gBAAgB,EAAE,KAAK;oBACvB,YAAY,QAAE,OAAO,0CAAE,kBAAkB;oBACzC,QAAQ,EAAE;wBACR,YAAY,EAAE,cAAc,CAAC,YAAY;qBAC1C;oBACD,aAAa,EAAE,2BAA2B;oBAC1C,YAAY,EAAE,MAAM;oBAEpB,YAAY,EAAE;wBACZ,YAAY,EAAE,YAAY;wBAE1B,QAAQ,EAAE;4BACR,YAAY,EAAE,UAAU;yBACzB;qBACF;iBACF,EAED,OAAO,EAAE;oBACP,YAAY,EAAE,OAAO,CAAC,KAAK;oBAE3B,QAAQ,EAAE;wBACR,YAAY,EAAE,cAAc,CAAC,YAAY;qBAC1C;oBAED,YAAY,EAAE;wBACZ,YAAY,EAAE,QAAQ;wBAEtB,QAAQ,EAAE;4BACR,YAAY,EAAE,UAAU;yBACzB;qBACF;iBACF,EAED,WAAW,EAAE;oBACX,aAAa,EAAE,OAAO,CAAC,gBAAgB;iBACxC,IAEE,0BAAkB,EACrB;QACJ,CAAC;KACF,CAAC,CAAC","sourcesContent":["import { makeVariantClasses, Theme } from '@fluentui/react-theme-provider';\nimport { EdgeChromiumHighContrastSelector } from '@fluentui/style-utilities';\nimport { ButtonSizeVariants } from '../Button/index';\nimport { SplitButtonState, SplitButtonVariants } from './SplitButton.types';\n\nconst GlobalClassNames = {\n root: 'ms-SplitButton',\n button: 'ms-SplitButton-button',\n menuButton: 'ms-SplitButton-menuButton',\n};\n\nconst menuButtonWidth = '32px';\n\nexport const useSplitButtonClasses = makeVariantClasses<SplitButtonState, SplitButtonVariants>({\n name: 'SplitButton',\n prefix: '--button',\n\n styles: {\n root: [\n GlobalClassNames.root,\n {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n\n // Forward the menuIconSize to a variable which can be consumed by the child menu button.\n '--button-splitMenuIconSize': 'var(--button-menuIconSize)',\n },\n ],\n\n button: [\n GlobalClassNames.button,\n {\n '--button-borderRightWidth': 0,\n '--button-borderTopRightRadius': 0,\n '--button-borderBottomRightRadius': 0,\n },\n ],\n\n menuButton: [\n GlobalClassNames.menuButton,\n {\n // Scope the override to a child component, increase specificity.\n [`.${GlobalClassNames.root} &`]: {\n width: menuButtonWidth,\n minWidth: menuButtonWidth,\n '--button-borderLeftWidth': 0,\n '--button-borderTopLeftRadius': 0,\n '--button-borderBottomLeftRadius': 0,\n '--button-iconColor': 'var(--button-menuIconColor)',\n '--button-iconSize': 'var(--button-splitMenuIconSize)',\n },\n },\n ],\n\n divider: {\n width: 'var(--button-dividerThickness)',\n backgroundColor: 'var(--button-dividerColor)',\n position: 'absolute',\n right: menuButtonWidth,\n top: 'calc(100% - var(--button-dividerLength, 100% + 8px))',\n bottom: 'calc(100% - var(--button-dividerLength, 100% + 8px))',\n\n [EdgeChromiumHighContrastSelector]: {\n backgroundColor: 'var(--button-highContrast-dividerColor)',\n },\n\n [`.${GlobalClassNames.root}[aria-disabled=\"true\"] &`]: {\n backgroundColor: 'var(--button-disabled-dividerColor)',\n\n [EdgeChromiumHighContrastSelector]: {\n backgroundColor: 'var(--button-highContrast-disabled-dividerColor, var(--button-highContrast-dividerColor))',\n },\n },\n },\n\n _block: {\n width: '100%',\n maxWidth: '100%',\n\n [`.${GlobalClassNames.button}`]: {\n flexGrow: 1,\n maxWidth: '100%',\n },\n\n [`.${GlobalClassNames.menuButton}`]: {\n width: menuButtonWidth,\n },\n },\n },\n variants: (theme: Theme): SplitButtonVariants => {\n const { palette, semanticColors } = theme;\n\n return {\n root: {\n size: {\n smallest: '24px',\n smaller: '24px',\n small: '24px',\n regular: '32px',\n large: '40px',\n larger: '48px',\n largest: '64px',\n },\n dividerThickness: '1px',\n dividerColor: palette?.neutralTertiaryAlt,\n disabled: {\n dividerColor: semanticColors.disabledText,\n },\n menuIconColor: 'var(--body-menuIconColor)',\n menuIconSize: '12px',\n\n highContrast: {\n dividerColor: 'WindowText',\n\n disabled: {\n dividerColor: 'GrayText',\n },\n },\n },\n\n primary: {\n dividerColor: palette.white,\n\n disabled: {\n dividerColor: semanticColors.disabledText,\n },\n\n highContrast: {\n dividerColor: 'Window',\n\n disabled: {\n dividerColor: 'GrayText',\n },\n },\n },\n\n transparent: {\n menuIconColor: palette.neutralSecondary,\n },\n\n ...ButtonSizeVariants,\n };\n },\n});\n"]}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import { ToggleButtonProps } from './ToggleButton.types';
|
3
|
-
/**
|
4
|
-
* Define a styled ToggleButton, using the `useToggleButton` hook.
|
5
|
-
* {@docCategory Button}
|
6
|
-
*/
|
7
|
-
export declare const ToggleButton: React.ForwardRefExoticComponent<Pick<ToggleButtonProps, string | number> & React.RefAttributes<HTMLElement>>;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./useToggleButton", "@fluentui/react-theme-provider", "../Button/useButtonClasses", "./useToggleButtonClasses"], function (require, exports, React, useToggleButton_1, react_theme_provider_1, useButtonClasses_1, useToggleButtonClasses_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
/**
|
5
|
-
* Define a styled ToggleButton, using the `useToggleButton` hook.
|
6
|
-
* {@docCategory Button}
|
7
|
-
*/
|
8
|
-
exports.ToggleButton = React.forwardRef(function (props, ref) {
|
9
|
-
var _a = useToggleButton_1.useToggleButton(props, ref), render = _a.render, state = _a.state;
|
10
|
-
useButtonClasses_1.useButtonClasses(state);
|
11
|
-
useToggleButtonClasses_1.useToggleButtonClasses(state);
|
12
|
-
react_theme_provider_1.useInlineTokens(state, '--button');
|
13
|
-
return render(state);
|
14
|
-
});
|
15
|
-
exports.ToggleButton.displayName = 'ToggleButton';
|
16
|
-
});
|
17
|
-
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ToggleButton.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":";;;IAOA;;;OAGG;IACU,QAAA,YAAY,GAAG,KAAK,CAAC,UAAU,CAAiC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAA,kDAA+C,EAA7C,kBAAM,EAAE,gBAAqC,CAAC;QAEtD,mCAAgB,CAAC,KAAK,CAAC,CAAC;QACxB,+CAAsB,CAAC,KAAK,CAAC,CAAC;QAC9B,sCAAe,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAEnC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { ToggleButtonProps } from './ToggleButton.types';\nimport { useToggleButton } from './useToggleButton';\nimport { useInlineTokens } from '@fluentui/react-theme-provider';\nimport { useButtonClasses } from '../Button/useButtonClasses';\nimport { useToggleButtonClasses } from './useToggleButtonClasses';\n\n/**\n * Define a styled ToggleButton, using the `useToggleButton` hook.\n * {@docCategory Button}\n */\nexport const ToggleButton = React.forwardRef<HTMLElement, ToggleButtonProps>((props, ref) => {\n const { render, state } = useToggleButton(props, ref);\n\n useButtonClasses(state);\n useToggleButtonClasses(state);\n useInlineTokens(state, '--button');\n\n return render(state);\n});\n\nToggleButton.displayName = 'ToggleButton';\n"]}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';
|
2
|
-
/**
|
3
|
-
* {@docCategory Button}
|
4
|
-
*/
|
5
|
-
export interface ToggleButtonProps extends ButtonProps {
|
6
|
-
/**
|
7
|
-
* Defines the controlled checked state of the `ToggleButton`.
|
8
|
-
* Mutually exclusive to `defaultChecked`.
|
9
|
-
* This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the
|
10
|
-
* correct value based on handling `onClick` events and re-rendering.
|
11
|
-
*/
|
12
|
-
checked?: boolean;
|
13
|
-
/**
|
14
|
-
* Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.
|
15
|
-
* Mutually exclusive to `checked`.
|
16
|
-
*/
|
17
|
-
defaultChecked?: boolean;
|
18
|
-
}
|
19
|
-
/**
|
20
|
-
* {@docCategory Button}
|
21
|
-
*/
|
22
|
-
export interface ToggleButtonState extends ToggleButtonProps {
|
23
|
-
}
|
24
|
-
export declare type ToggleButtonTokens = ButtonTokens;
|
25
|
-
export declare type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"ToggleButton.types.js","sourceRoot":"../src/","sources":["components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ButtonProps, ButtonTokens, ButtonVariants } from '../Button/Button.types';\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonProps extends ButtonProps {\n /**\n * Defines the controlled checked state of the `ToggleButton`.\n * Mutually exclusive to `defaultChecked`.\n * This should only be used if the checked state is to be controlled at a higher level and there is a plan to pass the\n * correct value based on handling `onClick` events and re-rendering.\n */\n checked?: boolean;\n\n /**\n * Defines whether the `ToggleButton` is inititally in a checked state or not when rendered.\n * Mutually exclusive to `checked`.\n */\n defaultChecked?: boolean;\n}\n\n/**\n * {@docCategory Button}\n */\nexport interface ToggleButtonState extends ToggleButtonProps {}\n\nexport type ToggleButtonTokens = ButtonTokens;\n\nexport type ToggleButtonVariants = ButtonVariants<ToggleButtonTokens>;\n"]}
|
@@ -1,9 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./useToggleButton", "./useToggleButtonClasses", "./ToggleButton", "./useChecked"], function (require, exports, tslib_1, useToggleButton_1, useToggleButtonClasses_1, ToggleButton_1, useChecked_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(useToggleButton_1, exports);
|
5
|
-
tslib_1.__exportStar(useToggleButtonClasses_1, exports);
|
6
|
-
tslib_1.__exportStar(ToggleButton_1, exports);
|
7
|
-
tslib_1.__exportStar(useChecked_1, exports);
|
8
|
-
});
|
9
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/ToggleButton/index.ts"],"names":[],"mappings":";;;IACA,iDAAkC;IAClC,wDAAyC;IACzC,8CAA+B;IAC/B,4CAA6B","sourcesContent":["export * from './ToggleButton.types';\nexport * from './useToggleButton';\nexport * from './useToggleButtonClasses';\nexport * from './ToggleButton';\nexport * from './useChecked';\n"]}
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
export interface CheckedState {
|
3
|
-
checked?: boolean;
|
4
|
-
defaultChecked?: boolean;
|
5
|
-
onClick?: React.DOMAttributes<HTMLElement>['onClick'];
|
6
|
-
role?: string;
|
7
|
-
'aria-checked'?: React.AriaAttributes['aria-pressed'];
|
8
|
-
'aria-pressed'?: React.AriaAttributes['aria-pressed'];
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* The useToggle hook processes adds the correct toggled state and acccessibility as needed.
|
12
|
-
* @param draftState - state to read and augment.
|
13
|
-
*/
|
14
|
-
export declare const useChecked: <TDraftState extends CheckedState>(draftState: TDraftState) => void;
|
@@ -1,27 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "@fluentui/react-hooks"], function (require, exports, React, react_hooks_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
/**
|
5
|
-
* The useToggle hook processes adds the correct toggled state and acccessibility as needed.
|
6
|
-
* @param draftState - state to read and augment.
|
7
|
-
*/
|
8
|
-
exports.useChecked = function (draftState) {
|
9
|
-
var onClick = draftState.onClick, checked = draftState.checked, defaultChecked = draftState.defaultChecked, role = draftState.role;
|
10
|
-
var _a = react_hooks_1.useControllableValue(checked, defaultChecked), checkedValue = _a[0], setCheckedValue = _a[1];
|
11
|
-
// Ensure the state is the correct controlled/uncontrolled value.
|
12
|
-
draftState.checked = checkedValue;
|
13
|
-
// Ensure the right aria value is set to represent the checked state.
|
14
|
-
var isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';
|
15
|
-
draftState[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = checkedValue;
|
16
|
-
draftState.onClick = React.useCallback(function (ev) {
|
17
|
-
if (onClick) {
|
18
|
-
onClick(ev);
|
19
|
-
if (ev.defaultPrevented) {
|
20
|
-
return;
|
21
|
-
}
|
22
|
-
}
|
23
|
-
setCheckedValue(!checkedValue);
|
24
|
-
}, [checkedValue, setCheckedValue, onClick]);
|
25
|
-
};
|
26
|
-
});
|
27
|
-
//# sourceMappingURL=useChecked.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"useChecked.js","sourceRoot":"../src/","sources":["components/ToggleButton/useChecked.ts"],"names":[],"mappings":";;;IAaA;;;OAGG;IACU,QAAA,UAAU,GAAG,UAAmC,UAAuB;QAC1E,IAAA,4BAAO,EAAE,4BAAO,EAAE,0CAAc,EAAE,sBAAI,CAAgB;QACxD,IAAA,gEAA+E,EAA9E,oBAAY,EAAE,uBAAgE,CAAC;QAEtF,iEAAiE;QACjE,UAAU,CAAC,OAAO,GAAG,YAAY,CAAC;QAElC,qEAAqE;QACrE,IAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAkB,IAAI,IAAI,KAAK,UAAU,CAAC;QAE9E,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;QAEhF,UAAU,CAAC,OAAO,GAAG,KAAK,CAAC,WAAW,CACpC,UAAC,EAAmD;YAClD,IAAI,OAAO,EAAE;gBACX,OAAO,CAAC,EAAE,CAAC,CAAC;gBAEZ,IAAI,EAAE,CAAC,gBAAgB,EAAE;oBACvB,OAAO;iBACR;aACF;YAED,eAAe,CAAC,CAAC,YAAY,CAAC,CAAC;QACjC,CAAC,EACD,CAAC,YAAY,EAAE,eAAe,EAAE,OAAO,CAAC,CACzC,CAAC;IACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { useControllableValue } from '@fluentui/react-hooks';\n\nexport interface CheckedState {\n checked?: boolean;\n defaultChecked?: boolean;\n onClick?: React.DOMAttributes<HTMLElement>['onClick'];\n\n role?: string;\n 'aria-checked'?: React.AriaAttributes['aria-pressed'];\n 'aria-pressed'?: React.AriaAttributes['aria-pressed'];\n}\n\n/**\n * The useToggle hook processes adds the correct toggled state and acccessibility as needed.\n * @param draftState - state to read and augment.\n */\nexport const useChecked = <TDraftState extends CheckedState>(draftState: TDraftState) => {\n const { onClick, checked, defaultChecked, role } = draftState;\n const [checkedValue, setCheckedValue] = useControllableValue(checked, defaultChecked);\n\n // Ensure the state is the correct controlled/uncontrolled value.\n draftState.checked = checkedValue;\n\n // Ensure the right aria value is set to represent the checked state.\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n draftState[isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed'] = checkedValue;\n\n draftState.onClick = React.useCallback(\n (ev: React.MouseEvent<HTMLButtonElement, MouseEvent>) => {\n if (onClick) {\n onClick(ev);\n\n if (ev.defaultPrevented) {\n return;\n }\n }\n\n setCheckedValue(!checkedValue);\n },\n [checkedValue, setCheckedValue, onClick],\n );\n};\n"]}
|