@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,7 +1,7 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import type { SplitButtonProps } from './SplitButton.types';
|
2
|
+
import { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
|
-
*
|
5
|
-
*
|
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
6
|
*/
|
7
|
-
export declare const SplitButton:
|
7
|
+
export declare const SplitButton: ForwardRefComponent<SplitButtonProps>;
|
@@ -1,29 +1,16 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import { useInlineTokens } from '@fluentui/react-theme-provider';
|
2
|
+
import { renderSplitButton } from './renderSplitButton';
|
4
3
|
import { useSplitButton } from './useSplitButton';
|
5
|
-
import {
|
6
|
-
import { Button } from '../Button/index';
|
7
|
-
import { MenuButton } from '../MenuButton/index';
|
4
|
+
import { useSplitButtonStyles } from './useSplitButtonStyles';
|
8
5
|
/**
|
9
|
-
*
|
10
|
-
*
|
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.
|
11
8
|
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
useSplitButtonClasses(state);
|
18
|
-
// TODO remove any
|
19
|
-
/**
|
20
|
-
* Type 'SplitButtonState' has no properties in common with type '{
|
21
|
-
* style?: CSSProperties | undefined; tokens?: string | { [key: string]: any; }
|
22
|
-
* | undefined; }
|
23
|
-
*/
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
25
|
-
useInlineTokens(state, '--button');
|
26
|
-
return render(state);
|
9
|
+
|
10
|
+
export var SplitButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
11
|
+
var state = useSplitButton(props, ref);
|
12
|
+
useSplitButtonStyles(state);
|
13
|
+
return renderSplitButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
27
14
|
});
|
28
15
|
SplitButton.displayName = 'SplitButton';
|
29
16
|
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/SplitButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,qBAAlC;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,oBAAT,QAAqC,wBAArC;AAIA;;;AAGG;;AACH,OAAO,IAAM,WAAW,gBAA0C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC5F,MAAM,KAAK,GAAG,cAAc,CAAC,KAAD,EAAQ,GAAR,CAA5B;AAEA,EAAA,oBAAoB,CAAC,KAAD,CAApB;AAEA,SAAO,iBAAiB,CAAC,KAAD,CAAxB,CAL4F,CAM5F;AACD,CAPiE,CAA3D;AASP,WAAW,CAAC,WAAZ,GAA0B,aAA1B","sourceRoot":""}
|
@@ -1,35 +1,19 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
|
5
|
-
/**
|
6
|
-
* {@docCategory Button}
|
7
|
-
*/
|
8
|
-
export interface SplitButtonProps extends ButtonProps, MenuButtonProps {
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ButtonProps, ButtonState } from '../Button/Button.types';
|
3
|
+
import type { MenuButtonProps, MenuButtonState } from '../MenuButton/MenuButton.types';
|
4
|
+
export declare type SplitButtonSlots = {
|
9
5
|
/**
|
10
|
-
*
|
6
|
+
* Root of the component that wraps the primary action button and menu button.
|
11
7
|
*/
|
12
|
-
|
8
|
+
root: IntrinsicShorthandProps<'div'>;
|
13
9
|
/**
|
14
|
-
*
|
10
|
+
* Button that opens menu with secondary actions in SplitButton.
|
15
11
|
*/
|
16
|
-
|
12
|
+
menuButton?: ObjectShorthandProps<MenuButtonProps>;
|
17
13
|
/**
|
18
|
-
* Button
|
14
|
+
* Button to perform primary action in SplitButton.
|
19
15
|
*/
|
20
|
-
|
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;
|
16
|
+
primaryActionButton?: ObjectShorthandProps<ButtonProps>;
|
31
17
|
};
|
32
|
-
|
33
|
-
|
34
|
-
*/
|
35
|
-
export declare type SplitButtonVariants = ButtonVariants<SplitButtonTokens>;
|
18
|
+
export declare type SplitButtonProps = ComponentProps<SplitButtonSlots> & Omit<ButtonProps, 'root'> & Omit<MenuButtonProps, 'root'>;
|
19
|
+
export declare type SplitButtonState = ComponentState<SplitButtonSlots> & Omit<ButtonState, 'components' | 'iconOnly' | 'root'> & Omit<MenuButtonState, 'components' | 'iconOnly' | 'root'>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SplitButton.types.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"SplitButton.types.js","sourceRoot":"","sources":["../../../src/components/SplitButton/SplitButton.types.ts"],"names":[],"mappings":""}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
export * from './SplitButton.types';
|
2
1
|
export * from './SplitButton';
|
2
|
+
export * from './SplitButton.types';
|
3
|
+
export * from './renderSplitButton';
|
3
4
|
export * from './useSplitButton';
|
4
|
-
export
|
5
|
+
export { useSplitButtonStyles } from './useSplitButtonStyles';
|
@@ -1,4 +1,6 @@
|
|
1
1
|
export * from './SplitButton';
|
2
|
+
export * from './SplitButton.types';
|
3
|
+
export * from './renderSplitButton';
|
2
4
|
export * from './useSplitButton';
|
3
|
-
export
|
5
|
+
export { useSplitButtonStyles } from './useSplitButtonStyles';
|
4
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/SplitButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import { SplitButtonState } from './SplitButton.types';
|
1
|
+
import type { SplitButtonState } from './SplitButton.types';
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
* slots to children.
|
5
|
-
* @param state
|
3
|
+
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
6
4
|
*/
|
7
5
|
export declare const renderSplitButton: (state: SplitButtonState) => JSX.Element;
|
@@ -1,17 +1,15 @@
|
|
1
1
|
import { __assign } from "tslib";
|
2
2
|
import * as React from 'react';
|
3
|
-
import { getSlots } from '@fluentui/react-
|
4
|
-
import { splitButtonShorthandProps } from './useSplitButton';
|
3
|
+
import { getSlots } from '@fluentui/react-utilities';
|
5
4
|
/**
|
6
|
-
*
|
7
|
-
* slots to children.
|
8
|
-
* @param state
|
5
|
+
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
9
6
|
*/
|
7
|
+
|
10
8
|
export var renderSplitButton = function (state) {
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
var _a = getSlots(state, ['root', 'menuButton', 'primaryActionButton']),
|
10
|
+
slots = _a.slots,
|
11
|
+
slotProps = _a.slotProps;
|
12
|
+
|
13
|
+
return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), /*#__PURE__*/React.createElement(slots.primaryActionButton, __assign({}, slotProps.primaryActionButton)), /*#__PURE__*/React.createElement(slots.menuButton, __assign({}, slotProps.menuButton)));
|
16
14
|
};
|
17
15
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,iBAAiB,GAAG,UAAC,KAAD,EAAwB;AACjD,MAAA,EAAA,GAAuB,QAAQ,CAAmB,KAAnB,EAA0B,CAAC,MAAD,EAAS,YAAT,EAAuB,qBAAvB,CAA1B,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,mBAAP,EAA0B,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,mBAAf,CAA1B,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,UAAP,EAAiB,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,UAAf,CAAjB,CAFF,CADF;AAMD,CATM","sourceRoot":""}
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { SplitButtonProps, SplitButtonState } from './SplitButton.types';
|
3
|
-
export declare const splitButtonShorthandProps: string[];
|
2
|
+
import type { SplitButtonProps, SplitButtonState } from './SplitButton.types';
|
4
3
|
/**
|
5
|
-
*
|
4
|
+
* Given user props, defines default props for the SplitButton and returns processed state.
|
5
|
+
* @param props - User provided props to the SplitButton component.
|
6
|
+
* @param ref - User provided ref to be passed to the SplitButton component.
|
6
7
|
*/
|
7
|
-
export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<
|
8
|
-
state: SplitButtonState;
|
9
|
-
render: (state: SplitButtonState) => JSX.Element;
|
10
|
-
};
|
8
|
+
export declare const useSplitButton: (props: SplitButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => SplitButtonState;
|
@@ -1,51 +1,73 @@
|
|
1
|
-
import { __assign
|
2
|
-
import
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import { useMergedRefs } from '@fluentui/react-hooks';
|
6
|
-
export var splitButtonShorthandProps = ['icon', 'button', 'divider', 'menuButton'];
|
7
|
-
var mergeProps = makeMergeProps({ deepMerge: splitButtonShorthandProps });
|
1
|
+
import { __assign } from "tslib";
|
2
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
3
|
+
import { Button } from '../Button/Button';
|
4
|
+
import { MenuButton } from '../MenuButton/MenuButton';
|
8
5
|
/**
|
9
|
-
*
|
6
|
+
* Given user props, defines default props for the SplitButton and returns processed state.
|
7
|
+
* @param props - User provided props to the SplitButton component.
|
8
|
+
* @param ref - User provided ref to be passed to the SplitButton component.
|
10
9
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
10
|
+
|
11
|
+
export var useSplitButton = function (props, ref) {
|
12
|
+
var appearance = props.appearance,
|
13
|
+
_a = props.block,
|
14
|
+
block = _a === void 0 ? false : _a,
|
15
|
+
children = props.children,
|
16
|
+
_b = props.disabled,
|
17
|
+
disabled = _b === void 0 ? false : _b,
|
18
|
+
_c = props.disabledFocusable,
|
19
|
+
disabledFocusable = _c === void 0 ? false : _c,
|
20
|
+
icon = props.icon,
|
21
|
+
_d = props.iconPosition,
|
22
|
+
iconPosition = _d === void 0 ? 'before' : _d,
|
23
|
+
menuButton = props.menuButton,
|
24
|
+
primaryActionButton = props.primaryActionButton,
|
25
|
+
_e = props.shape,
|
26
|
+
shape = _e === void 0 ? 'rounded' : _e,
|
27
|
+
_f = props.size,
|
28
|
+
size = _f === void 0 ? 'medium' : _f;
|
29
|
+
var menuButtonShorthand = resolveShorthand(menuButton, {
|
30
|
+
defaultProps: {
|
31
|
+
appearance: appearance,
|
32
|
+
disabled: disabled,
|
33
|
+
disabledFocusable: disabledFocusable,
|
34
|
+
shape: shape,
|
35
|
+
size: size
|
36
|
+
}
|
37
|
+
});
|
38
|
+
var primaryActionButtonShorthand = resolveShorthand(primaryActionButton, {
|
39
|
+
defaultProps: {
|
40
|
+
appearance: appearance,
|
41
|
+
block: block,
|
42
|
+
children: children,
|
43
|
+
disabled: disabled,
|
44
|
+
disabledFocusable: disabledFocusable,
|
45
|
+
icon: icon,
|
46
|
+
iconPosition: iconPosition,
|
47
|
+
shape: shape,
|
48
|
+
size: size
|
49
|
+
}
|
50
|
+
});
|
51
|
+
return {
|
52
|
+
// Props passed at the top-level
|
53
|
+
appearance: appearance,
|
54
|
+
block: block,
|
55
|
+
disabled: disabled,
|
56
|
+
disabledFocusable: disabledFocusable,
|
57
|
+
iconPosition: iconPosition,
|
58
|
+
shape: shape,
|
59
|
+
size: size,
|
60
|
+
// Slots definition
|
61
|
+
components: {
|
62
|
+
root: 'div',
|
63
|
+
menuButton: MenuButton,
|
64
|
+
primaryActionButton: Button
|
65
|
+
},
|
66
|
+
root: getNativeElementProps('div', __assign({
|
67
|
+
ref: ref
|
68
|
+
}, props)),
|
69
|
+
menuButton: menuButtonShorthand,
|
70
|
+
primaryActionButton: primaryActionButtonShorthand
|
71
|
+
};
|
50
72
|
};
|
51
73
|
//# sourceMappingURL=useSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButton.ts"],"names":[],"mappings":";AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AACA,SAAS,MAAT,QAAuB,kBAAvB;AACA,SAAS,UAAT,QAA2B,0BAA3B;AAGA;;;;AAIG;;AACH,OAAO,IAAM,cAAc,GAAG,UAC5B,KAD4B,EAE5B,GAF4B,EAEyB;AAGnD,MAAA,UAAU,GAWR,KAAK,CAXG,UAAV;AAAA,MACA,EAAA,GAUE,KAAK,CAVM,KADb;AAAA,MACA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EADb;AAAA,MAEA,QAAQ,GASN,KAAK,CATC,QAFR;AAAA,MAGA,EAAA,GAQE,KAAK,CARS,QAHhB;AAAA,MAGA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAHhB;AAAA,MAIA,EAAA,GAOE,KAAK,CAPkB,iBAJzB;AAAA,MAIA,iBAAiB,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAJzB;AAAA,MAKA,IAAI,GAMF,KAAK,CANH,IALJ;AAAA,MAMA,EAAA,GAKE,KAAK,CALgB,YANvB;AAAA,MAMA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EANvB;AAAA,MAOA,UAAU,GAIR,KAAK,CAJG,UAPV;AAAA,MAQA,mBAAmB,GAGjB,KAAK,CAHY,mBARnB;AAAA,MASA,EAAA,GAEE,KAAK,CAFU,KATjB;AAAA,MASA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,SAAH,GAAY,EATjB;AAAA,MAUA,EAAA,GACE,KAAK,CADQ,IAVf;AAAA,MAUA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAVf;AAYF,MAAM,mBAAmB,GAAG,gBAAgB,CAAC,UAAD,EAAa;AACvD,IAAA,YAAY,EAAE;AACZ,MAAA,UAAU,EAAA,UADE;AAEZ,MAAA,QAAQ,EAAA,QAFI;AAGZ,MAAA,iBAAiB,EAAA,iBAHL;AAIZ,MAAA,KAAK,EAAA,KAJO;AAKZ,MAAA,IAAI,EAAA;AALQ;AADyC,GAAb,CAA5C;AASA,MAAM,4BAA4B,GAAG,gBAAgB,CAAC,mBAAD,EAAsB;AACzE,IAAA,YAAY,EAAE;AACZ,MAAA,UAAU,EAAA,UADE;AAEZ,MAAA,KAAK,EAAA,KAFO;AAGZ,MAAA,QAAQ,EAAA,QAHI;AAIZ,MAAA,QAAQ,EAAA,QAJI;AAKZ,MAAA,iBAAiB,EAAA,iBALL;AAMZ,MAAA,IAAI,EAAA,IANQ;AAOZ,MAAA,YAAY,EAAA,YAPA;AAQZ,MAAA,KAAK,EAAA,KARO;AASZ,MAAA,IAAI,EAAA;AATQ;AAD2D,GAAtB,CAArD;AAcA,SAAO;AACL;AACA,IAAA,UAAU,EAAA,UAFL;AAGL,IAAA,KAAK,EAAA,KAHA;AAIL,IAAA,QAAQ,EAAA,QAJH;AAKL,IAAA,iBAAiB,EAAA,iBALZ;AAML,IAAA,YAAY,EAAA,YANP;AAOL,IAAA,KAAK,EAAA,KAPA;AAQL,IAAA,IAAI,EAAA,IARC;AAUL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,UAAU,EAAE,UAFF;AAGV,MAAA,mBAAmB,EAAE;AAHX,KAXP;AAiBL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAM,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAAN,CAjBtB;AAkBL,IAAA,UAAU,EAAE,mBAlBP;AAmBL,IAAA,mBAAmB,EAAE;AAnBhB,GAAP;AAqBD,CA7DM","sourceRoot":""}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import { __styles, mergeClasses } from '@fluentui/react-make-styles';
|
2
|
+
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
3
|
+
var SplitButtonClassNames = {
|
4
|
+
primaryActionButton: 'SplitButton-primaryActionButton',
|
5
|
+
menuButton: 'SplitButton-menuButton'
|
6
|
+
};
|
7
|
+
|
8
|
+
var useFocusStyles = /*#__PURE__*/__styles({
|
9
|
+
"primaryActionButton": {},
|
10
|
+
"menuButton": {}
|
11
|
+
}, {});
|
12
|
+
|
13
|
+
var useRootStyles = /*#__PURE__*/__styles({
|
14
|
+
"base": {
|
15
|
+
"mc9l5x": "ftuwxu6",
|
16
|
+
"Brf1p80": "fsxf2b5",
|
17
|
+
"qhf8xq": "f10pi13n",
|
18
|
+
"ha4doy": "fmrv4ls",
|
19
|
+
"ipgm0c": ["f178uykt", "f90yzzo"],
|
20
|
+
"B6cuk21": ["f1bxd3c5", "f1ekv84t"],
|
21
|
+
"bajz6s": ["fnux5s6", "f5nfhee"],
|
22
|
+
"Bzqncq": ["f19wc9x7", "f5bevrs"],
|
23
|
+
"Flt4rd": ["f1wefiyg", "f1leuqsa"]
|
24
|
+
},
|
25
|
+
"block": {
|
26
|
+
"a9b677": "fly5x3f"
|
27
|
+
},
|
28
|
+
"outline": {},
|
29
|
+
"primary": {
|
30
|
+
"Bxrr62k": ["f8z1slf", "f1qj10op"],
|
31
|
+
"wqijrc": ["fmrqvvu", "fu0z9tm"],
|
32
|
+
"Bsk9mq6": ["f1naws84", "f1ry7auu"]
|
33
|
+
},
|
34
|
+
"subtle": {
|
35
|
+
"Bxrr62k": ["f1xobncs", "f1xirlzn"],
|
36
|
+
"wqijrc": ["f1hmsn3f", "fi0rm9z"],
|
37
|
+
"Bsk9mq6": ["fam4u78", "f1hqq1j6"]
|
38
|
+
},
|
39
|
+
"transparent": {
|
40
|
+
"Bxrr62k": ["f1xobncs", "f1xirlzn"],
|
41
|
+
"wqijrc": ["f1hmsn3f", "fi0rm9z"],
|
42
|
+
"Bsk9mq6": ["fam4u78", "f1hqq1j6"]
|
43
|
+
},
|
44
|
+
"circular": {},
|
45
|
+
"rounded": {},
|
46
|
+
"square": {},
|
47
|
+
"disabled": {
|
48
|
+
"Bxrr62k": ["f11wzqjl", "f1a5dzic"],
|
49
|
+
"wqijrc": ["fhk4lgh", "f1r7ztp2"],
|
50
|
+
"Bsk9mq6": ["f1ot7jx6", "f1qvd61g"]
|
51
|
+
}
|
52
|
+
}, {
|
53
|
+
"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;}", ".fmrv4ls{vertical-align:middle;}", ".f178uykt .SplitButton-primaryActionButton{border-top-right-radius:0;}", ".f90yzzo .SplitButton-primaryActionButton{border-top-left-radius:0;}", ".f1bxd3c5 .SplitButton-primaryActionButton{border-bottom-right-radius:0;}", ".f1ekv84t .SplitButton-primaryActionButton{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%;}", ".f8z1slf .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1qj10op .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1xobncs .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1xirlzn .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f11wzqjl .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1a5dzic .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
54
|
+
"h": [".fmrqvvu:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".fu0z9tm:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".f1hmsn3f:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".fi0rm9z:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".fhk4lgh:hover .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1r7ztp2:hover .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"],
|
55
|
+
"a": [".f1naws84:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralForegroundInverted);}", ".f1ry7auu:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralForegroundInverted);}", ".fam4u78:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStroke1Hover);}", ".f1hqq1j6:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStroke1Hover);}", ".f1ot7jx6:active .SplitButton-primaryActionButton{border-right-color:var(--colorNeutralStrokeDisabled);}", ".f1qvd61g:active .SplitButton-primaryActionButton{border-left-color:var(--colorNeutralStrokeDisabled);}"]
|
56
|
+
});
|
57
|
+
|
58
|
+
export var useSplitButtonStyles = function (state) {
|
59
|
+
var rootStyles = useRootStyles();
|
60
|
+
var focusStyles = useFocusStyles();
|
61
|
+
var appearance = state.appearance,
|
62
|
+
block = state.block,
|
63
|
+
disabled = state.disabled,
|
64
|
+
disabledFocusable = state.disabledFocusable;
|
65
|
+
state.root.className = mergeClasses(rootStyles.base, block && rootStyles.block, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, state.root.className);
|
66
|
+
|
67
|
+
if (state.menuButton) {
|
68
|
+
state.menuButton.className = mergeClasses(SplitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);
|
69
|
+
}
|
70
|
+
|
71
|
+
if (state.primaryActionButton) {
|
72
|
+
state.primaryActionButton.className = mergeClasses(SplitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);
|
73
|
+
}
|
74
|
+
|
75
|
+
return state;
|
76
|
+
};
|
77
|
+
//# sourceMappingURL=useSplitButtonStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/SplitButton/useSplitButtonStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AACA,SAAS,+BAAT,QAAgD,yBAAhD;AAGA,IAAM,qBAAqB,GAAG;AAC5B,EAAA,mBAAmB,EAAE,iCADO;AAE5B,EAAA,UAAU,EAAE;AAFgB,CAA9B;;AAKA,IAAM,cAAc,gBAAG;AAAA;AAAA;AAAA,MAAvB;;AAaA,IAAM,aAAa,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;AAAA;AAAA;AAAA;AAAA;AAAA,EAAtB;;AAgHA,OAAO,IAAM,oBAAoB,GAAG,UAAC,KAAD,EAAwB;AAC1D,MAAM,UAAU,GAAG,aAAa,EAAhC;AACA,MAAM,WAAW,GAAG,cAAc,EAAlC;AAEQ,MAAA,UAAU,GAAyC,KAAK,CAA9C,UAAV;AAAA,MAAY,KAAK,GAAkC,KAAK,CAAvC,KAAjB;AAAA,MAAmB,QAAQ,GAAwB,KAAK,CAA7B,QAA3B;AAAA,MAA6B,iBAAiB,GAAK,KAAK,CAAV,iBAA9C;AAER,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,UAAU,CAAC,IADsB,EAEjC,KAAK,IAAI,UAAU,CAAC,KAFa,EAGjC,UAAU,IAAI,UAAU,CAAC,UAAD,CAHS,EAIjC,CAAC,QAAQ,IAAI,iBAAb,KAAmC,UAAU,CAAC,QAJb,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;;AAQA,MAAI,KAAK,CAAC,UAAV,EAAsB;AACpB,IAAA,KAAK,CAAC,UAAN,CAAiB,SAAjB,GAA6B,YAAY,CACvC,qBAAqB,CAAC,UADiB,EAEvC,WAAW,CAAC,UAF2B,EAGvC,KAAK,CAAC,UAAN,CAAiB,SAHsB,CAAzC;AAKD;;AAED,MAAI,KAAK,CAAC,mBAAV,EAA+B;AAC7B,IAAA,KAAK,CAAC,mBAAN,CAA0B,SAA1B,GAAsC,YAAY,CAChD,qBAAqB,CAAC,mBAD0B,EAEhD,WAAW,CAAC,mBAFoC,EAGhD,KAAK,CAAC,mBAAN,CAA0B,SAHsB,CAAlD;AAKD;;AAED,SAAO,KAAP;AACD,CA/BM","sourceRoot":""}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import type { ToggleButtonProps } from './ToggleButton.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
|
-
*
|
5
|
-
* {@docCategory Button}
|
4
|
+
* ToggleButtons are buttons that toggle between two defined states when triggered.
|
6
5
|
*/
|
7
|
-
export declare const ToggleButton:
|
6
|
+
export declare const ToggleButton: ForwardRefComponent<ToggleButtonProps>;
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import { renderToggleButton } from './renderToggleButton';
|
2
3
|
import { useToggleButton } from './useToggleButton';
|
3
|
-
import {
|
4
|
-
import { useButtonClasses } from '../Button/useButtonClasses';
|
5
|
-
import { useToggleButtonClasses } from './useToggleButtonClasses';
|
4
|
+
import { useToggleButtonStyles } from './useToggleButtonStyles';
|
6
5
|
/**
|
7
|
-
*
|
8
|
-
* {@docCategory Button}
|
6
|
+
* ToggleButtons are buttons that toggle between two defined states when triggered.
|
9
7
|
*/
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
return render(state);
|
8
|
+
|
9
|
+
export var ToggleButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
10
|
+
var state = useToggleButton(props, ref);
|
11
|
+
useToggleButtonStyles(state);
|
12
|
+
return renderToggleButton(state); // Casting is required due to lack of distributive union to support unions on @types/react
|
16
13
|
});
|
17
14
|
ToggleButton.displayName = 'ToggleButton';
|
18
15
|
//# sourceMappingURL=ToggleButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,kBAAT,QAAmC,sBAAnC;AACA,SAAS,eAAT,QAAgC,mBAAhC;AACA,SAAS,qBAAT,QAAsC,yBAAtC;AAIA;;AAEG;;AACH,OAAO,IAAM,YAAY,gBAA2C,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAC9F,MAAM,KAAK,GAAG,eAAe,CAAC,KAAD,EAAQ,GAAR,CAA7B;AAEA,EAAA,qBAAqB,CAAC,KAAD,CAArB;AAEA,SAAO,kBAAkB,CAAC,KAAD,CAAzB,CAL8F,CAM9F;AACD,CAPmE,CAA7D;AASP,YAAY,CAAC,WAAb,GAA2B,cAA3B","sourceRoot":""}
|
@@ -1,25 +1,19 @@
|
|
1
|
-
import { ButtonProps,
|
2
|
-
|
3
|
-
* {@docCategory Button}
|
4
|
-
*/
|
5
|
-
export interface ToggleButtonProps extends ButtonProps {
|
1
|
+
import type { ButtonProps, ButtonState } from '../Button/Button.types';
|
2
|
+
export declare type ToggleButtonCommons = {
|
6
3
|
/**
|
7
4
|
* Defines the controlled checked state of the `ToggleButton`.
|
8
|
-
*
|
5
|
+
* If passed, `ToggleButton` ignores the `defaultChecked` property.
|
9
6
|
* 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
7
|
* correct value based on handling `onClick` events and re-rendering.
|
8
|
+
* @default false
|
11
9
|
*/
|
12
|
-
checked
|
10
|
+
checked: boolean;
|
11
|
+
};
|
12
|
+
export declare type ToggleButtonProps = ButtonProps & Partial<ToggleButtonCommons> & {
|
13
13
|
/**
|
14
|
-
* Defines whether the `ToggleButton` is
|
15
|
-
*
|
14
|
+
* Defines whether the `ToggleButton` is initially in a checked state or not when rendered.
|
15
|
+
* @default false
|
16
16
|
*/
|
17
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>;
|
18
|
+
};
|
19
|
+
export declare type ToggleButtonState = ButtonState & ToggleButtonCommons;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ToggleButton.types.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"ToggleButton.types.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/ToggleButton.types.ts"],"names":[],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
|
+
export * from './ToggleButton';
|
1
2
|
export * from './ToggleButton.types';
|
3
|
+
export * from './renderToggleButton';
|
2
4
|
export * from './useToggleButton';
|
3
|
-
export
|
4
|
-
export * from './ToggleButton';
|
5
|
-
export * from './useChecked';
|
5
|
+
export { useToggleButtonStyles } from './useToggleButtonStyles';
|
@@ -1,5 +1,6 @@
|
|
1
|
-
export * from './useToggleButton';
|
2
|
-
export * from './useToggleButtonClasses';
|
3
1
|
export * from './ToggleButton';
|
4
|
-
export * from './
|
2
|
+
export * from './ToggleButton.types';
|
3
|
+
export * from './renderToggleButton';
|
4
|
+
export * from './useToggleButton';
|
5
|
+
export { useToggleButtonStyles } from './useToggleButtonStyles';
|
5
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { renderButton as renderToggleButton } from '../Button/renderButton';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderToggleButton.js","sourceRoot":"","sources":["../../../src/components/ToggleButton/renderToggleButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC"}
|