@fluentui/react-button 9.1.11 → 9.1.13
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +75 -1
- package/CHANGELOG.md +25 -2
- package/lib/components/Button/Button.js +3 -2
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/renderButton.js +6 -4
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +0 -1
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.js +309 -315
- package/lib/components/Button/useButtonStyles.js.map +1 -1
- package/lib/components/CompoundButton/CompoundButton.js +3 -2
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +10 -6
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +4 -5
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js +124 -129
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib/components/MenuButton/MenuButton.js +3 -2
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +6 -4
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +2 -3
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js +61 -67
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib/components/SplitButton/SplitButton.js +3 -2
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +6 -4
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +2 -4
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js +56 -62
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib/components/ToggleButton/ToggleButton.js +3 -2
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButton.js +0 -1
- package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js +246 -249
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/useToggleState.js +4 -3
- package/lib/utils/useToggleState.js.map +1 -1
- package/lib-commonjs/Button.js +0 -2
- package/lib-commonjs/Button.js.map +1 -1
- package/lib-commonjs/CompoundButton.js +0 -2
- package/lib-commonjs/CompoundButton.js.map +1 -1
- package/lib-commonjs/MenuButton.js +0 -2
- package/lib-commonjs/MenuButton.js.map +1 -1
- package/lib-commonjs/SplitButton.js +0 -2
- package/lib-commonjs/SplitButton.js.map +1 -1
- package/lib-commonjs/ToggleButton.js +0 -2
- package/lib-commonjs/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/Button/Button.js +3 -7
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/Button.types.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +0 -6
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +6 -8
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +0 -5
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.js +309 -321
- package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -7
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/CompoundButton.types.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +0 -7
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +10 -10
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +4 -9
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js +124 -134
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -7
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/MenuButton.types.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +0 -7
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +6 -8
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +2 -9
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js +61 -73
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -7
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/SplitButton.types.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +0 -7
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +6 -8
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +2 -9
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js +56 -67
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -7
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/ToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +0 -7
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js +0 -2
- package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButton.js +0 -5
- package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js +246 -256
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
- package/lib-commonjs/index.js +0 -12
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useToggleState.js +4 -7
- package/lib-commonjs/utils/useToggleState.js.map +1 -1
- package/package.json +8 -8
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-button/src/components/CompoundButton/useCompoundButtonStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n ...shorthands.padding(\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalMNudge,\n tokens.spacingHorizontalS,\n ),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n ...shorthands.padding('14px', tokens.spacingHorizontalM, tokens.spacingHorizontalL, tokens.spacingHorizontalM),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n ...shorthands.padding('18px', tokens.spacingHorizontalL, tokens.spacingHorizontalXL, tokens.spacingHorizontalL),\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding(tokens.spacingHorizontalXS),\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n ...shorthands.padding(tokens.spacingHorizontalSNudge),\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n ...shorthands.padding(tokens.spacingHorizontalS),\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM,\n },\n after: {\n marginLeft: tokens.spacingHorizontalM,\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n state.contentContainer.className = mergeClasses(\n compoundButtonClassNames.contentContainer,\n contentContainerStyles.base,\n state.contentContainer.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n compoundButtonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n state.icon.className,\n );\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n compoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
1
|
+
{"version":3,"mappings":"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","names":["exports","root","icon","contentContainer","secondaryContent","useRootStyles","react_1","useRootIconOnlyStyles","useIconStyles","useContentContainerStyles","useSecondaryContentStyles","useCompoundButtonStyles_unstable","state","rootStyles","rootIconOnlyStyles","iconStyles","contentContainerStyles","secondaryContentStyles","appearance","disabled","disabledFocusable","iconOnly","iconPosition","size","className","base","highContrast","disabledHighContrast","children","undefined","useButtonStyles_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/CompoundButton/useCompoundButtonStyles.ts"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { CompoundButtonSlots, CompoundButtonState } from './CompoundButton.types';\n\nexport const compoundButtonClassNames: SlotClassNames<CompoundButtonSlots> = {\n root: 'fui-CompoundButton',\n icon: 'fui-CompoundButton__icon',\n contentContainer: 'fui-CompoundButton__contentContainer',\n secondaryContent: 'fui-CompoundButton__secondaryContent',\n};\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n height: 'auto',\n\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'Highlight',\n },\n },\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Hover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n },\n transparent: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandHover,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n },\n\n // Size variations\n small: {\n ...shorthands.padding(\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalS,\n tokens.spacingHorizontalMNudge,\n tokens.spacingHorizontalS,\n ),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n medium: {\n ...shorthands.padding('14px', tokens.spacingHorizontalM, tokens.spacingHorizontalL, tokens.spacingHorizontalM),\n\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n large: {\n ...shorthands.padding('18px', tokens.spacingHorizontalL, tokens.spacingHorizontalXL, tokens.spacingHorizontalL),\n\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n\n // Disabled styles\n disabled: {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n\n ':hover': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${compoundButtonClassNames.secondaryContent}`]: {\n color: 'GrayText',\n },\n },\n },\n },\n});\n\nconst useRootIconOnlyStyles = makeStyles({\n // Size variations\n small: {\n ...shorthands.padding(tokens.spacingHorizontalXS),\n\n maxWidth: '48px',\n minWidth: '48px',\n },\n medium: {\n ...shorthands.padding(tokens.spacingHorizontalSNudge),\n\n maxWidth: '52px',\n minWidth: '52px',\n },\n large: {\n ...shorthands.padding(tokens.spacingHorizontalS),\n\n maxWidth: '56px',\n minWidth: '56px',\n },\n});\n\nconst useIconStyles = makeStyles({\n // Base styles\n base: {\n fontSize: '40px',\n height: '40px',\n width: '40px',\n },\n\n // Icon position variations\n before: {\n marginRight: tokens.spacingHorizontalM,\n },\n after: {\n marginLeft: tokens.spacingHorizontalM,\n },\n});\n\nconst useContentContainerStyles = makeStyles({\n // Base styles\n base: {\n display: 'flex',\n flexDirection: 'column',\n textAlign: 'left',\n },\n});\n\nconst useSecondaryContentStyles = makeStyles({\n // Base styles\n base: {\n lineHeight: '100%',\n fontWeight: tokens.fontWeightRegular,\n },\n\n // Size variations\n small: {\n fontSize: tokens.fontSizeBase200,\n },\n medium: {\n fontSize: tokens.fontSizeBase200,\n },\n large: {\n fontSize: tokens.fontSizeBase300,\n },\n});\n\nexport const useCompoundButtonStyles_unstable = (state: CompoundButtonState): CompoundButtonState => {\n const rootStyles = useRootStyles();\n const rootIconOnlyStyles = useRootIconOnlyStyles();\n const iconStyles = useIconStyles();\n const contentContainerStyles = useContentContainerStyles();\n const secondaryContentStyles = useSecondaryContentStyles();\n\n const { appearance, disabled, disabledFocusable, iconOnly, iconPosition, size } = state;\n\n state.root.className = mergeClasses(\n compoundButtonClassNames.root,\n\n // Root styles\n rootStyles.base,\n rootStyles.highContrast,\n appearance && rootStyles[appearance],\n rootStyles[size],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n\n // Icon-only styles\n iconOnly && rootIconOnlyStyles[size],\n\n // User provided class name\n state.root.className,\n );\n\n state.contentContainer.className = mergeClasses(\n compoundButtonClassNames.contentContainer,\n contentContainerStyles.base,\n state.contentContainer.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n compoundButtonClassNames.icon,\n iconStyles.base,\n state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition],\n state.icon.className,\n );\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n compoundButtonClassNames.secondaryContent,\n secondaryContentStyles.base,\n secondaryContentStyles[size],\n state.secondaryContent.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"]}
|
@@ -4,24 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MenuButton = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const renderMenuButton_1 = /*#__PURE__*/require("./renderMenuButton");
|
11
|
-
|
12
9
|
const useMenuButton_1 = /*#__PURE__*/require("./useMenuButton");
|
13
|
-
|
14
10
|
const useMenuButtonStyles_1 = /*#__PURE__*/require("./useMenuButtonStyles");
|
15
11
|
/**
|
16
12
|
* MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close
|
17
13
|
* menus.
|
18
14
|
*/
|
19
|
-
|
20
|
-
|
21
15
|
exports.MenuButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
22
16
|
const state = useMenuButton_1.useMenuButton_unstable(props, ref);
|
23
17
|
useMenuButtonStyles_1.useMenuButtonStyles_unstable(state);
|
24
|
-
return renderMenuButton_1.renderMenuButton_unstable(state);
|
18
|
+
return renderMenuButton_1.renderMenuButton_unstable(state);
|
19
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
25
20
|
});
|
21
|
+
|
26
22
|
exports.MenuButton.displayName = 'MenuButton';
|
27
23
|
//# sourceMappingURL=MenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;;AAIaA,kBAAU,gBAAyCC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC9F,MAAMC,KAAK,GAAGC,sCAAsB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEhDG,kDAA4B,CAACF,KAAK,CAAC;EAEnC,OAAOG,4CAAyB,CAACH,KAAK,CAAC;EACvC;AACF,CAAC,CAAyC;;AAE1CL,kBAAU,CAACS,WAAW,GAAG,YAAY","names":["exports","React","forwardRef","props","ref","state","useMenuButton_1","useMenuButtonStyles_1","renderMenuButton_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/MenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderMenuButton_unstable } from './renderMenuButton';\nimport { useMenuButton_unstable } from './useMenuButton';\nimport { useMenuButtonStyles_unstable } from './useMenuButtonStyles';\nimport type { MenuButtonProps } from './MenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * MenuButtons are buttons that have a chevron icon after the button contents and are usually clicked to open/close\n * menus.\n */\nexport const MenuButton: ForwardRefComponent<MenuButtonProps> = React.forwardRef((props, ref) => {\n const state = useMenuButton_unstable(props, ref);\n\n useMenuButtonStyles_unstable(state);\n\n return renderMenuButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<MenuButtonProps>;\n\nMenuButton.displayName = 'MenuButton';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuButtonStyles_unstable = exports.menuButtonClassNames = void 0;
|
7
|
-
|
8
7
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
-
|
10
8
|
tslib_1.__exportStar(require("./MenuButton.types"), exports);
|
11
|
-
|
12
9
|
tslib_1.__exportStar(require("./MenuButton"), exports);
|
13
|
-
|
14
10
|
tslib_1.__exportStar(require("./renderMenuButton"), exports);
|
15
|
-
|
16
11
|
tslib_1.__exportStar(require("./useMenuButton"), exports);
|
17
|
-
|
18
12
|
var useMenuButtonStyles_1 = /*#__PURE__*/require("./useMenuButtonStyles");
|
19
|
-
|
20
13
|
Object.defineProperty(exports, "menuButtonClassNames", {
|
21
14
|
enumerable: true,
|
22
15
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-button/src/components/MenuButton/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;;AAAAA;AACAA;AACAA;AACAA;AACA;AAASC;EAAAC;EAAAC;IAAA,iDAAoB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,yDAA4B;EAAA;AAAA","names":["tslib_1","Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/index.ts"],"sourcesContent":["export * from './MenuButton.types';\nexport * from './MenuButton';\nexport * from './renderMenuButton';\nexport * from './useMenuButton';\nexport { menuButtonClassNames, useMenuButtonStyles_unstable } from './useMenuButtonStyles';\n"]}
|
@@ -4,15 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderMenuButton_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/**
|
12
10
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
13
11
|
*/
|
14
|
-
|
15
|
-
|
16
12
|
const renderMenuButton_unstable = state => {
|
17
13
|
const {
|
18
14
|
slots,
|
@@ -22,11 +18,13 @@ const renderMenuButton_unstable = state => {
|
|
22
18
|
icon,
|
23
19
|
iconOnly
|
24
20
|
} = state;
|
25
|
-
return React.createElement(slots.root, {
|
26
|
-
|
27
|
-
}
|
21
|
+
return React.createElement(slots.root, {
|
22
|
+
...slotProps.root
|
23
|
+
}, slots.icon && React.createElement(slots.icon, {
|
24
|
+
...slotProps.icon
|
25
|
+
}), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && React.createElement(slots.menuIcon, {
|
26
|
+
...slotProps.menuIcon
|
28
27
|
}));
|
29
28
|
};
|
30
|
-
|
31
29
|
exports.renderMenuButton_unstable = renderMenuButton_unstable;
|
32
30
|
//# sourceMappingURL=renderMenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,yBAAyB,GAAIC,KAAsB,IAAI;EAClE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAkBH,KAAK,CAAC;EAC7D,MAAM;IAAEI,IAAI;IAAEC;EAAQ,CAAE,GAAGL,KAAK;EAEhC,OACEM,oBAACL,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,GAC3BN,KAAK,CAACG,IAAI,IAAIE,oBAACL,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,EAAI,EAChD,CAACC,QAAQ,IAAIH,SAAS,CAACK,IAAI,CAACC,QAAQ,EACpC,CAAC,CAACH,QAAQ,IAAI,EAACD,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEI,QAAQ,MAAKP,KAAK,CAACQ,QAAQ,IAAIH,oBAACL,KAAK,CAACQ,QAAQ;IAAA,GAAKP,SAAS,CAACO;EAAQ,EAAI,CACpF;AAEjB,CAAC;AAXYC,iCAAyB","names":["renderMenuButton_unstable","state","slots","slotProps","react_utilities_1","icon","iconOnly","React","root","children","menuIcon","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/renderMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\n/**\n * Renders a MenuButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderMenuButton_unstable = (state: MenuButtonState) => {\n const { slots, slotProps } = getSlots<MenuButtonSlots>(state);\n const { icon, iconOnly } = state;\n\n return (\n <slots.root {...slotProps.root}>\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {!iconOnly && slotProps.root.children}\n {(!iconOnly || !icon?.children) && slots.menuIcon && <slots.menuIcon {...slotProps.menuIcon} />}\n </slots.root>\n );\n};\n"]}
|
@@ -4,28 +4,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuButton_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
11
|
-
|
12
9
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
-
|
14
10
|
const index_1 = /*#__PURE__*/require("../Button/index");
|
15
11
|
/**
|
16
12
|
* Given user props, returns the final state for a MenuButton.
|
17
13
|
*/
|
18
|
-
|
19
|
-
|
20
14
|
const useMenuButton_unstable = ({
|
21
15
|
menuIcon,
|
22
16
|
...props
|
23
17
|
}, ref) => {
|
24
18
|
var _a;
|
25
|
-
|
26
19
|
const buttonState = index_1.useButton_unstable(props, ref);
|
27
20
|
buttonState.root['aria-expanded'] = (_a = props['aria-expanded']) !== null && _a !== void 0 ? _a : false;
|
28
|
-
return {
|
21
|
+
return {
|
22
|
+
// Button state
|
29
23
|
...buttonState,
|
30
24
|
// State calculated from a set of props
|
31
25
|
iconOnly: Boolean(!props.children),
|
@@ -43,6 +37,5 @@ const useMenuButton_unstable = ({
|
|
43
37
|
})
|
44
38
|
};
|
45
39
|
};
|
46
|
-
|
47
40
|
exports.useMenuButton_unstable = useMenuButton_unstable;
|
48
41
|
//# sourceMappingURL=useMenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAGA;;;AAGO,MAAMA,sBAAsB,GAAG,CACpC;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAmB,EACvCC,GAAqD,KAClC;;EACnB,MAAMC,WAAW,GAAGC,0BAAkB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAClDC,WAAW,CAACE,IAAI,CAAC,eAAe,CAAC,GAAG,WAAK,CAAC,eAAe,CAAC,mCAAI,KAAK;EAEnE,OAAO;IACL;IACA,GAAGF,WAAW;IAEd;IACAG,QAAQ,EAAEC,OAAO,CAAC,CAACN,KAAK,CAACO,QAAQ,CAAC;IAElC;IACAC,UAAU,EAAE;MACVJ,IAAI,EAAE,QAAQ;MACdK,IAAI,EAAE,MAAM;MACZV,QAAQ,EAAE;KACX;IAEDA,QAAQ,EAAEW,kCAAgB,CAACX,QAAQ,EAAE;MACnCY,YAAY,EAAE;QACZJ,QAAQ,EAAEK,oBAACC,gCAAkB;OAC9B;MACDC,QAAQ,EAAE;KACX;GACF;AACH,CAAC;AA5BYC,8BAAsB","names":["useMenuButton_unstable","menuIcon","props","ref","buttonState","index_1","root","iconOnly","Boolean","children","components","icon","react_utilities_1","defaultProps","React","react_icons_1","required","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/useMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { useButton_unstable } from '../Button/index';\nimport type { MenuButtonProps, MenuButtonState } from './MenuButton.types';\n\n/**\n * Given user props, returns the final state for a MenuButton.\n */\nexport const useMenuButton_unstable = (\n { menuIcon, ...props }: MenuButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): MenuButtonState => {\n const buttonState = useButton_unstable(props, ref);\n buttonState.root['aria-expanded'] = props['aria-expanded'] ?? false;\n\n return {\n // Button state\n ...buttonState,\n\n // State calculated from a set of props\n iconOnly: Boolean(!props.children),\n\n // Slots definition\n components: {\n root: 'button',\n icon: 'span',\n menuIcon: 'span',\n },\n\n menuIcon: resolveShorthand(menuIcon, {\n defaultProps: {\n children: <ChevronDownRegular />,\n },\n required: true,\n }),\n };\n};\n"]}
|
@@ -4,126 +4,114 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuButtonStyles_unstable = exports.menuButtonClassNames = void 0;
|
7
|
-
|
8
7
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
9
|
-
|
10
8
|
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
|
-
|
12
9
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
13
|
-
|
14
10
|
const useButtonStyles_1 = /*#__PURE__*/require("../Button/useButtonStyles");
|
15
|
-
|
16
11
|
exports.menuButtonClassNames = {
|
17
12
|
root: 'fui-MenuButton',
|
18
13
|
icon: 'fui-MenuButton__icon',
|
19
14
|
menuIcon: 'fui-MenuButton__menuIcon'
|
20
15
|
};
|
21
|
-
|
22
16
|
const useRootExpandedStyles = /*#__PURE__*/react_1.__styles({
|
23
|
-
|
24
|
-
|
25
|
-
|
17
|
+
base: {
|
18
|
+
D0sxk3: "fxoiby5",
|
19
|
+
t6yez3: "f15q0o9g"
|
26
20
|
},
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
21
|
+
outline: {
|
22
|
+
g2u3we: "f1ly1fcm",
|
23
|
+
h3c5rm: ["fi8bssc", "fj6btzu"],
|
24
|
+
B9xav0g: "f1s9tnsa",
|
25
|
+
zhjwy3: ["fj6btzu", "fi8bssc"],
|
26
|
+
B4j52fo: "fgx37oo",
|
27
|
+
Bekrc4i: ["f130t4y6", "f1efpmoh"],
|
28
|
+
Bn0qgzm: "fv51ejd",
|
29
|
+
ibv6hh: ["f1efpmoh", "f130t4y6"],
|
30
|
+
sj55zd: "f14nttnl"
|
37
31
|
},
|
38
|
-
|
39
|
-
|
32
|
+
primary: {
|
33
|
+
De3pzq: "f8w4g0q"
|
40
34
|
},
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
35
|
+
secondary: {
|
36
|
+
De3pzq: "f1nfm20t",
|
37
|
+
g2u3we: "f1ly1fcm",
|
38
|
+
h3c5rm: ["fi8bssc", "fj6btzu"],
|
39
|
+
B9xav0g: "f1s9tnsa",
|
40
|
+
zhjwy3: ["fj6btzu", "fi8bssc"],
|
41
|
+
sj55zd: "f14nttnl"
|
48
42
|
},
|
49
|
-
|
50
|
-
|
51
|
-
|
43
|
+
subtle: {
|
44
|
+
De3pzq: "fq5gl1p",
|
45
|
+
sj55zd: "f1eryozh"
|
52
46
|
},
|
53
|
-
|
54
|
-
|
55
|
-
|
47
|
+
transparent: {
|
48
|
+
De3pzq: "f1q9pm1r",
|
49
|
+
sj55zd: "f1qj7y59"
|
56
50
|
}
|
57
51
|
}, {
|
58
|
-
|
52
|
+
d: [".fxoiby5 .fui-Icon-filled{display:inline;}", ".f15q0o9g .fui-Icon-regular{display:none;}", ".f1ly1fcm{border-top-color:var(--colorNeutralStroke1Selected);}", ".fi8bssc{border-right-color:var(--colorNeutralStroke1Selected);}", ".fj6btzu{border-left-color:var(--colorNeutralStroke1Selected);}", ".f1s9tnsa{border-bottom-color:var(--colorNeutralStroke1Selected);}", ".fgx37oo{border-top-width:var(--strokeWidthThicker);}", ".f130t4y6{border-right-width:var(--strokeWidthThicker);}", ".f1efpmoh{border-left-width:var(--strokeWidthThicker);}", ".fv51ejd{border-bottom-width:var(--strokeWidthThicker);}", ".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f8w4g0q{background-color:var(--colorBrandBackgroundSelected);}", ".f1nfm20t{background-color:var(--colorNeutralBackground1Selected);}", ".fq5gl1p{background-color:var(--colorSubtleBackgroundSelected);}", ".f1eryozh{color:var(--colorNeutralForeground2Selected);}", ".f1q9pm1r{background-color:var(--colorTransparentBackgroundSelected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"]
|
59
53
|
});
|
60
|
-
|
61
54
|
const useIconExpandedStyles = /*#__PURE__*/react_1.__styles({
|
62
|
-
|
63
|
-
|
55
|
+
outline: {
|
56
|
+
sj55zd: "f14nttnl"
|
64
57
|
},
|
65
|
-
|
66
|
-
|
67
|
-
|
58
|
+
primary: {},
|
59
|
+
secondary: {
|
60
|
+
sj55zd: "f14nttnl"
|
68
61
|
},
|
69
|
-
|
70
|
-
|
62
|
+
subtle: {
|
63
|
+
sj55zd: "f1qj7y59"
|
71
64
|
},
|
72
|
-
|
73
|
-
|
65
|
+
transparent: {
|
66
|
+
sj55zd: "f1qj7y59"
|
74
67
|
}
|
75
68
|
}, {
|
76
|
-
|
69
|
+
d: [".f14nttnl{color:var(--colorNeutralForeground1Selected);}", ".f1qj7y59{color:var(--colorNeutralForeground2BrandSelected);}"]
|
77
70
|
});
|
78
|
-
|
79
71
|
const useMenuIconStyles = /*#__PURE__*/react_1.__styles({
|
80
|
-
|
81
|
-
|
72
|
+
base: {
|
73
|
+
Bg96gwp: "fez10in"
|
82
74
|
},
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
75
|
+
small: {
|
76
|
+
Be2twd7: "f1ugzwwg",
|
77
|
+
Bqenvij: "fvblgha",
|
78
|
+
Bg96gwp: "fwrc4pm",
|
79
|
+
a9b677: "frx94fk"
|
88
80
|
},
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
81
|
+
medium: {
|
82
|
+
Be2twd7: "f1ugzwwg",
|
83
|
+
Bqenvij: "fvblgha",
|
84
|
+
Bg96gwp: "fwrc4pm",
|
85
|
+
a9b677: "frx94fk"
|
94
86
|
},
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
87
|
+
large: {
|
88
|
+
Be2twd7: "f4ybsrx",
|
89
|
+
Bqenvij: "fd461yt",
|
90
|
+
Bg96gwp: "faaz57k",
|
91
|
+
a9b677: "fjw5fx7"
|
100
92
|
},
|
101
|
-
|
102
|
-
|
93
|
+
notIconOnly: {
|
94
|
+
Frg6f3: ["fbyavb5", "fm0x6gh"]
|
103
95
|
}
|
104
96
|
}, {
|
105
|
-
|
97
|
+
d: [".fez10in{line-height:0;}", ".f1ugzwwg{font-size:12px;}", ".fvblgha{height:12px;}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".frx94fk{width:12px;}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fjw5fx7{width:16px;}", ".fbyavb5{margin-left:var(--spacingHorizontalXS);}", ".fm0x6gh{margin-right:var(--spacingHorizontalXS);}"]
|
106
98
|
});
|
107
|
-
|
108
99
|
const useMenuButtonStyles_unstable = state => {
|
109
100
|
const rootExpandedStyles = useRootExpandedStyles();
|
110
101
|
const iconExpandedStyles = useIconExpandedStyles();
|
111
102
|
const menuIconStyles = useMenuIconStyles();
|
112
103
|
state.root.className = react_1.mergeClasses(exports.menuButtonClassNames.root, state.root['aria-expanded'] && rootExpandedStyles.base, state.root['aria-expanded'] && rootExpandedStyles[state.appearance], state.root.className);
|
113
|
-
|
114
104
|
if (state.icon) {
|
115
105
|
state.icon.className = react_1.mergeClasses(exports.menuButtonClassNames.icon, state.root['aria-expanded'] && iconExpandedStyles[state.appearance], state.icon.className);
|
116
106
|
}
|
117
|
-
|
118
107
|
if (state.menuIcon) {
|
119
108
|
state.menuIcon.className = react_1.mergeClasses(exports.menuButtonClassNames.menuIcon, menuIconStyles.base, menuIconStyles[state.size], !state.iconOnly && menuIconStyles.notIconOnly, state.menuIcon.className);
|
120
109
|
}
|
121
|
-
|
122
|
-
|
110
|
+
useButtonStyles_1.useButtonStyles_unstable({
|
111
|
+
...state,
|
123
112
|
iconPosition: 'before'
|
124
113
|
});
|
125
114
|
return state;
|
126
115
|
};
|
127
|
-
|
128
116
|
exports.useMenuButtonStyles_unstable = useMenuButtonStyles_unstable;
|
129
117
|
//# sourceMappingURL=useMenuButtonStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AAGaA,4BAAoB,GAAoC;EACnEC,IAAI,EAAE,gBAAgB;EACtBC,IAAI,EAAE,sBAAsB;EAC5BC,QAAQ,EAAE;CACX;AAED,MAAMC,qBAAqB,gBAAGC,gBAAU;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAgCtC;AAEF,MAAMC,qBAAqB,gBAAGD,gBAAU;EAAA;IAAA;EAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAiBtC;AAEF,MAAME,iBAAiB,gBAAGF,gBAAU;EAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EA6BlC;AAEK,MAAMG,4BAA4B,GAAIC,KAAsB,IAAqB;EACtF,MAAMC,kBAAkB,GAAGN,qBAAqB,EAAE;EAClD,MAAMO,kBAAkB,GAAGL,qBAAqB,EAAE;EAClD,MAAMM,cAAc,GAAGL,iBAAiB,EAAE;EAE1CE,KAAK,CAACR,IAAI,CAACY,SAAS,GAAGR,oBAAY,CACjCL,4BAAoB,CAACC,IAAI,EACzBQ,KAAK,CAACR,IAAI,CAAC,eAAe,CAAC,IAAIS,kBAAkB,CAACI,IAAI,EACtDL,KAAK,CAACR,IAAI,CAAC,eAAe,CAAC,IAAIS,kBAAkB,CAACD,KAAK,CAACM,UAAU,CAAC,EACnEN,KAAK,CAACR,IAAI,CAACY,SAAS,CACrB;EAED,IAAIJ,KAAK,CAACP,IAAI,EAAE;IACdO,KAAK,CAACP,IAAI,CAACW,SAAS,GAAGR,oBAAY,CACjCL,4BAAoB,CAACE,IAAI,EACzBO,KAAK,CAACR,IAAI,CAAC,eAAe,CAAC,IAAIU,kBAAkB,CAACF,KAAK,CAACM,UAAU,CAAC,EACnEN,KAAK,CAACP,IAAI,CAACW,SAAS,CACrB;;EAGH,IAAIJ,KAAK,CAACN,QAAQ,EAAE;IAClBM,KAAK,CAACN,QAAQ,CAACU,SAAS,GAAGR,oBAAY,CACrCL,4BAAoB,CAACG,QAAQ,EAC7BS,cAAc,CAACE,IAAI,EACnBF,cAAc,CAACH,KAAK,CAACO,IAAI,CAAC,EAC1B,CAACP,KAAK,CAACQ,QAAQ,IAAIL,cAAc,CAACM,WAAW,EAC7CT,KAAK,CAACN,QAAQ,CAACU,SAAS,CACzB;;EAGHM,0CAAwB,CAAC;IAAE,GAAGV,KAAK;IAAEW,YAAY,EAAE;EAAQ,CAAE,CAAC;EAE9D,OAAOX,KAAK;AACd,CAAC;AAjCYT,oCAA4B","names":["exports","root","icon","menuIcon","useRootExpandedStyles","react_1","useIconExpandedStyles","useMenuIconStyles","useMenuButtonStyles_unstable","state","rootExpandedStyles","iconExpandedStyles","menuIconStyles","className","base","appearance","size","iconOnly","notIconOnly","useButtonStyles_1","iconPosition"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/MenuButton/useMenuButtonStyles.ts"],"sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles';\nimport type { MenuButtonSlots, MenuButtonState } from './MenuButton.types';\n\nexport const menuButtonClassNames: SlotClassNames<MenuButtonSlots> = {\n root: 'fui-MenuButton',\n icon: 'fui-MenuButton__icon',\n menuIcon: 'fui-MenuButton__menuIcon',\n};\n\nconst useRootExpandedStyles = makeStyles({\n base: {\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n },\n\n // Appearance variations\n outline: {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n color: tokens.colorNeutralForeground1Selected,\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\n },\n secondary: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Selected),\n color: tokens.colorNeutralForeground1Selected,\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground2Selected,\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\nconst useIconExpandedStyles = makeStyles({\n // Appearance variations\n outline: {\n color: tokens.colorNeutralForeground1Selected,\n },\n primary: {\n /* The primary styles are exactly the same as the base styles. */\n },\n secondary: {\n color: tokens.colorNeutralForeground1Selected,\n },\n subtle: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n transparent: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\nconst useMenuIconStyles = makeStyles({\n base: {\n lineHeight: 0,\n },\n\n // Size appearance\n small: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px',\n },\n medium: {\n fontSize: '12px',\n height: '12px',\n lineHeight: tokens.lineHeightBase200,\n width: '12px',\n },\n large: {\n fontSize: '16px',\n height: '16px',\n lineHeight: tokens.lineHeightBase400,\n width: '16px',\n },\n\n // Not-icon only\n notIconOnly: {\n marginLeft: tokens.spacingHorizontalXS,\n },\n});\n\nexport const useMenuButtonStyles_unstable = (state: MenuButtonState): MenuButtonState => {\n const rootExpandedStyles = useRootExpandedStyles();\n const iconExpandedStyles = useIconExpandedStyles();\n const menuIconStyles = useMenuIconStyles();\n\n state.root.className = mergeClasses(\n menuButtonClassNames.root,\n state.root['aria-expanded'] && rootExpandedStyles.base,\n state.root['aria-expanded'] && rootExpandedStyles[state.appearance],\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n menuButtonClassNames.icon,\n state.root['aria-expanded'] && iconExpandedStyles[state.appearance],\n state.icon.className,\n );\n }\n\n if (state.menuIcon) {\n state.menuIcon.className = mergeClasses(\n menuButtonClassNames.menuIcon,\n menuIconStyles.base,\n menuIconStyles[state.size],\n !state.iconOnly && menuIconStyles.notIconOnly,\n state.menuIcon.className,\n );\n }\n\n useButtonStyles_unstable({ ...state, iconPosition: 'before' });\n\n return state;\n};\n"]}
|
@@ -4,24 +4,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.SplitButton = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const renderSplitButton_1 = /*#__PURE__*/require("./renderSplitButton");
|
11
|
-
|
12
9
|
const useSplitButton_1 = /*#__PURE__*/require("./useSplitButton");
|
13
|
-
|
14
10
|
const useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
|
15
11
|
/**
|
16
12
|
* SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
|
17
13
|
* action, while interacting with the second one opens a menu with secondary actions.
|
18
14
|
*/
|
19
|
-
|
20
|
-
|
21
15
|
exports.SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
22
16
|
const state = useSplitButton_1.useSplitButton_unstable(props, ref);
|
23
17
|
useSplitButtonStyles_1.useSplitButtonStyles_unstable(state);
|
24
|
-
return renderSplitButton_1.renderSplitButton_unstable(state);
|
18
|
+
return renderSplitButton_1.renderSplitButton_unstable(state);
|
19
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
25
20
|
});
|
21
|
+
|
26
22
|
exports.SplitButton.displayName = 'SplitButton';
|
27
23
|
//# sourceMappingURL=SplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;;AAIaA,mBAAW,gBAA0CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAChG,MAAMC,KAAK,GAAGC,wCAAuB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAEjDG,oDAA6B,CAACF,KAAK,CAAC;EAEpC,OAAOG,8CAA0B,CAACH,KAAK,CAAC;EACxC;AACF,CAAC,CAA0C;;AAE3CL,mBAAW,CAACS,WAAW,GAAG,aAAa","names":["exports","React","forwardRef","props","ref","state","useSplitButton_1","useSplitButtonStyles_1","renderSplitButton_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/SplitButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderSplitButton_unstable } from './renderSplitButton';\nimport { useSplitButton_unstable } from './useSplitButton';\nimport { useSplitButtonStyles_unstable } from './useSplitButtonStyles';\nimport type { SplitButtonProps } from './SplitButton.types';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary\n * action, while interacting with the second one opens a menu with secondary actions.\n */\nexport const SplitButton: ForwardRefComponent<SplitButtonProps> = React.forwardRef((props, ref) => {\n const state = useSplitButton_unstable(props, ref);\n\n useSplitButtonStyles_unstable(state);\n\n return renderSplitButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<SplitButtonProps>;\n\nSplitButton.displayName = 'SplitButton';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useSplitButtonStyles_unstable = exports.splitButtonClassNames = void 0;
|
7
|
-
|
8
7
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
-
|
10
8
|
tslib_1.__exportStar(require("./SplitButton"), exports);
|
11
|
-
|
12
9
|
tslib_1.__exportStar(require("./SplitButton.types"), exports);
|
13
|
-
|
14
10
|
tslib_1.__exportStar(require("./renderSplitButton"), exports);
|
15
|
-
|
16
11
|
tslib_1.__exportStar(require("./useSplitButton"), exports);
|
17
|
-
|
18
12
|
var useSplitButtonStyles_1 = /*#__PURE__*/require("./useSplitButtonStyles");
|
19
|
-
|
20
13
|
Object.defineProperty(exports, "splitButtonClassNames", {
|
21
14
|
enumerable: true,
|
22
15
|
get: function () {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-button/src/components/SplitButton/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;;AAAAA;AACAA;AACAA;AACAA;AACA;AAASC;EAAAC;EAAAC;IAAA,mDAAqB;EAAA;AAAA;AAAEF;EAAAC;EAAAC;IAAA,2DAA6B;EAAA;AAAA","names":["tslib_1","Object","enumerable","get"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/index.ts"],"sourcesContent":["export * from './SplitButton';\nexport * from './SplitButton.types';\nexport * from './renderSplitButton';\nexport * from './useSplitButton';\nexport { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';\n"]}
|
@@ -4,25 +4,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderSplitButton_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/**
|
12
10
|
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
13
11
|
*/
|
14
|
-
|
15
|
-
|
16
12
|
const renderSplitButton_unstable = state => {
|
17
13
|
const {
|
18
14
|
slots,
|
19
15
|
slotProps
|
20
16
|
} = react_utilities_1.getSlots(state);
|
21
|
-
return React.createElement(slots.root, {
|
22
|
-
|
23
|
-
}
|
17
|
+
return React.createElement(slots.root, {
|
18
|
+
...slotProps.root
|
19
|
+
}, slots.primaryActionButton && React.createElement(slots.primaryActionButton, {
|
20
|
+
...slotProps.primaryActionButton
|
21
|
+
}), slots.menuButton && React.createElement(slots.menuButton, {
|
22
|
+
...slotProps.menuButton
|
24
23
|
}));
|
25
24
|
};
|
26
|
-
|
27
25
|
exports.renderSplitButton_unstable = renderSplitButton_unstable;
|
28
26
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAGA;;;AAGO,MAAMA,0BAA0B,GAAIC,KAAuB,IAAI;EACpE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAmBH,KAAK,CAAC;EAE9D,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BJ,KAAK,CAACK,mBAAmB,IAAIF,oBAACH,KAAK,CAACK,mBAAmB;IAAA,GAAKJ,SAAS,CAACI;EAAmB,EAAI,EAC7FL,KAAK,CAACM,UAAU,IAAIH,oBAACH,KAAK,CAACM,UAAU;IAAA,GAAKL,SAAS,CAACK;EAAU,EAAI,CACxD;AAEjB,CAAC;AATYC,kCAA0B","names":["renderSplitButton_unstable","state","slots","slotProps","react_utilities_1","React","root","primaryActionButton","menuButton","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-button/src/components/SplitButton/renderSplitButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\n/**\n * Renders a SplitButton component by passing the state defined props to the appropriate slots.\n */\nexport const renderSplitButton_unstable = (state: SplitButtonState) => {\n const { slots, slotProps } = getSlots<SplitButtonSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.primaryActionButton && <slots.primaryActionButton {...slotProps.primaryActionButton} />}\n {slots.menuButton && <slots.menuButton {...slotProps.menuButton} />}\n </slots.root>\n );\n};\n"]}
|