@fluentui/react-button 9.3.9 → 9.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +105 -1
- package/CHANGELOG.md +31 -2
- package/lib/components/Button/Button.js +3 -6
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/index.js +1 -1
- package/lib/components/Button/index.js.map +1 -1
- package/lib/components/Button/renderButton.js +4 -4
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/{useButtonStyles.js → useButtonStyles.styles.js} +2 -14
- package/lib/components/Button/useButtonStyles.styles.js.map +1 -0
- package/lib/components/CompoundButton/CompoundButton.js +3 -6
- package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/index.js +1 -1
- package/lib/components/CompoundButton/index.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +4 -4
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/{useCompoundButtonStyles.js → useCompoundButtonStyles.styles.js} +2 -2
- package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -0
- package/lib/components/MenuButton/MenuButton.js +3 -6
- package/lib/components/MenuButton/MenuButton.js.map +1 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/MenuButton/index.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +4 -4
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/{useMenuButtonStyles.js → useMenuButtonStyles.styles.js} +2 -2
- package/lib/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -0
- package/lib/components/SplitButton/SplitButton.js +3 -6
- package/lib/components/SplitButton/SplitButton.js.map +1 -1
- package/lib/components/SplitButton/index.js +1 -1
- package/lib/components/SplitButton/index.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +4 -4
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/{useSplitButtonStyles.js → useSplitButtonStyles.styles.js} +1 -7
- package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -0
- package/lib/components/ToggleButton/ToggleButton.js +3 -6
- package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib/components/ToggleButton/index.js +1 -1
- package/lib/components/ToggleButton/index.js.map +1 -1
- package/lib/components/ToggleButton/{useToggleButtonStyles.js → useToggleButtonStyles.styles.js} +3 -7
- package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Button/Button.js +3 -4
- package/lib-commonjs/components/Button/Button.js.map +1 -1
- package/lib-commonjs/components/Button/index.js +3 -3
- package/lib-commonjs/components/Button/index.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +4 -5
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/{useButtonStyles.js → useButtonStyles.styles.js} +23 -43
- package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/CompoundButton/CompoundButton.js +3 -4
- package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/index.js +3 -3
- package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +4 -5
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/{useCompoundButtonStyles.js → useCompoundButtonStyles.styles.js} +4 -4
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/MenuButton/MenuButton.js +3 -4
- package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/index.js +3 -3
- package/lib-commonjs/components/MenuButton/index.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +4 -5
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/{useMenuButtonStyles.js → useMenuButtonStyles.styles.js} +4 -4
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SplitButton/SplitButton.js +3 -4
- package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/index.js +3 -3
- package/lib-commonjs/components/SplitButton/index.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +4 -5
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/{useSplitButtonStyles.js → useSplitButtonStyles.styles.js} +2 -12
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ToggleButton/ToggleButton.js +3 -4
- package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/index.js +3 -3
- package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToggleButton/{useToggleButtonStyles.js → useToggleButtonStyles.styles.js} +4 -12
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -0
- package/package.json +9 -8
- package/.swcrc +0 -30
- package/lib/components/Button/useButtonStyles.js.map +0 -1
- package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +0 -1
- package/lib/components/MenuButton/useMenuButtonStyles.js.map +0 -1
- package/lib/components/SplitButton/useSplitButtonStyles.js.map +0 -1
- package/lib/components/ToggleButton/useToggleButtonStyles.js.map +0 -1
- package/lib-commonjs/components/Button/useButtonStyles.js.map +0 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +0 -1
- package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +0 -1
- package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +0 -1
- package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +0 -1
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Renders a MenuButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
@@ -7,11 +7,11 @@ export const renderMenuButton_unstable = state => {
|
|
7
7
|
const {
|
8
8
|
slots,
|
9
9
|
slotProps
|
10
|
-
} =
|
10
|
+
} = getSlotsNext(state);
|
11
11
|
const {
|
12
12
|
icon,
|
13
13
|
iconOnly
|
14
14
|
} = state;
|
15
|
-
return /*#__PURE__*/
|
15
|
+
return /*#__PURE__*/createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/createElement(slots.icon, slotProps.icon), !iconOnly && slotProps.root.children, (!iconOnly || !(icon === null || icon === void 0 ? void 0 : icon.children)) && slots.menuIcon && /*#__PURE__*/createElement(slots.menuIcon, slotProps.menuIcon));
|
16
16
|
};
|
17
17
|
//# sourceMappingURL=renderMenuButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["createElement","getSlotsNext","renderMenuButton_unstable","state","slots","slotProps","icon","iconOnly","root","children","menuIcon"],"sources":["../../../src/components/MenuButton/renderMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } 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 } = getSlotsNext<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"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAG7B;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAA2B;EACnE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAA8BE,KAAA;EAC3D,MAAM;IAAEG,IAAA;IAAMC;EAAQ,CAAE,GAAGJ,KAAA;EAE3B,oBACEH,aAfJ,CAeKI,KAAA,CAAMI,IAAI,EAAKH,SAAA,CAAUG,IAAI,EAC3BJ,KAAA,CAAME,IAAI,iBAAIN,aAhBrB,CAgBsBI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,GAC5C,CAACC,QAAA,IAAYF,SAAA,CAAUG,IAAI,CAACC,QAAQ,EACpC,CAAC,CAACF,QAAA,IAAY,EAACD,IAAA,aAAAA,IAAA,uBAAAA,IAAA,CAAMG,QAAQ,CAAD,KAAML,KAAA,CAAMM,QAAQ,iBAAIV,aAlB3D,CAkB4DI,KAAA,CAAMM,QAAQ,EAAKL,SAAA,CAAUK,QAAQ;AAGjG"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
3
3
|
import { mergeClasses, __styles, shorthands } from '@griffel/react';
|
4
|
-
import { useButtonStyles_unstable } from '../Button/useButtonStyles';
|
4
|
+
import { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';
|
5
5
|
export const menuButtonClassNames = {
|
6
6
|
root: 'fui-MenuButton',
|
7
7
|
icon: 'fui-MenuButton__icon',
|
@@ -107,4 +107,4 @@ export const useMenuButtonStyles_unstable = state => {
|
|
107
107
|
});
|
108
108
|
return state;
|
109
109
|
};
|
110
|
-
//# sourceMappingURL=useMenuButtonStyles.js.map
|
110
|
+
//# sourceMappingURL=useMenuButtonStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["iconFilledClassName","iconRegularClassName","tokens","mergeClasses","__styles","shorthands","useButtonStyles_unstable","menuButtonClassNames","root","icon","menuIcon","useRootExpandedStyles","base","D0sxk3","t6yez3","outline","g2u3we","h3c5rm","B9xav0g","zhjwy3","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","sj55zd","primary","De3pzq","secondary","subtle","transparent","d","useIconExpandedStyles","useMenuIconStyles","Bg96gwp","small","Be2twd7","Bqenvij","a9b677","medium","large","notIconOnly","Frg6f3","useMenuButtonStyles_unstable","state","rootExpandedStyles","iconExpandedStyles","menuIconStyles","className","appearance","size","iconOnly","iconPosition"],"sources":["../../../src/components/MenuButton/useMenuButtonStyles.styles.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.styles';\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"],"mapp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* as React from 'react';
|
2
2
|
import { renderSplitButton_unstable } from './renderSplitButton';
|
3
3
|
import { useSplitButton_unstable } from './useSplitButton';
|
4
|
-
import { useSplitButtonStyles_unstable } from './useSplitButtonStyles';
|
5
|
-
import {
|
4
|
+
import { useSplitButtonStyles_unstable } from './useSplitButtonStyles.styles';
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* SplitButtons are a grouping of two interactive surfaces where interacting with the first one triggers a primary
|
8
8
|
* action, while interacting with the second one opens a menu with secondary actions.
|
@@ -10,10 +10,7 @@ import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
|
10
10
|
export const SplitButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
11
11
|
const state = useSplitButton_unstable(props, ref);
|
12
12
|
useSplitButtonStyles_unstable(state);
|
13
|
-
|
14
|
-
useSplitButtonStyles_unstable: useCustomStyles
|
15
|
-
} = useCustomStyleHooks_unstable();
|
16
|
-
useCustomStyles(state);
|
13
|
+
useCustomStyleHook_unstable('useSplitButtonStyles_unstable')(state);
|
17
14
|
return renderSplitButton_unstable(state);
|
18
15
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
19
16
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","renderSplitButton_unstable","useSplitButton_unstable","useSplitButtonStyles_unstable","
|
1
|
+
{"version":3,"names":["React","renderSplitButton_unstable","useSplitButton_unstable","useSplitButtonStyles_unstable","useCustomStyleHook_unstable","SplitButton","forwardRef","props","ref","state","displayName"],"sources":["../../../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.styles';\nimport type { SplitButtonProps } from './SplitButton.types';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\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 useCustomStyleHook_unstable('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"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,uBAAuB,QAAQ;AACxC,SAASC,6BAA6B,QAAQ;AAG9C,SAASC,2BAA2B,QAAQ;AAE5C;;;;AAIA,OAAO,MAAMC,WAAA,gBAAqDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACjG,MAAMC,KAAA,GAAQP,uBAAA,CAAwBK,KAAA,EAAOC,GAAA;EAE7CL,6BAAA,CAA8BM,KAAA;EAE9BL,2BAAA,CAA4B,iCAAiCK,KAAA;EAE7D,OAAOR,0BAAA,CAA2BQ,KAAA;EAClC;AACF;;AAEAJ,WAAA,CAAYK,WAAW,GAAG"}
|
@@ -2,5 +2,5 @@ export * from './SplitButton';
|
|
2
2
|
export * from './SplitButton.types';
|
3
3
|
export * from './renderSplitButton';
|
4
4
|
export * from './useSplitButton';
|
5
|
-
export { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles';
|
5
|
+
export { splitButtonClassNames, useSplitButtonStyles_unstable } from './useSplitButtonStyles.styles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["splitButtonClassNames","useSplitButtonStyles_unstable"],"sources":["../../../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"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,qBAAqB,EAAEC,6BAA6B,QAAQ"}
|
1
|
+
{"version":3,"names":["splitButtonClassNames","useSplitButtonStyles_unstable"],"sources":["../../../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.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,qBAAqB,EAAEC,6BAA6B,QAAQ"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Renders a SplitButton component by passing the state defined props to the appropriate slots.
|
5
5
|
*/
|
@@ -7,7 +7,7 @@ export const renderSplitButton_unstable = state => {
|
|
7
7
|
const {
|
8
8
|
slots,
|
9
9
|
slotProps
|
10
|
-
} =
|
11
|
-
return /*#__PURE__*/
|
10
|
+
} = getSlotsNext(state);
|
11
|
+
return /*#__PURE__*/createElement(slots.root, slotProps.root, slots.primaryActionButton && /*#__PURE__*/createElement(slots.primaryActionButton, slotProps.primaryActionButton), slots.menuButton && /*#__PURE__*/createElement(slots.menuButton, slotProps.menuButton));
|
12
12
|
};
|
13
13
|
//# sourceMappingURL=renderSplitButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["createElement","getSlotsNext","renderSplitButton_unstable","state","slots","slotProps","root","primaryActionButton","menuButton"],"sources":["../../../src/components/SplitButton/renderSplitButton.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\n\nimport { getSlotsNext } 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 } = getSlotsNext<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"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAE9B,SAASC,YAAY,QAAQ;AAG7B;;;AAGA,OAAO,MAAMC,0BAAA,GAA8BC,KAAA,IAA4B;EACrE,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGJ,YAAA,CAA+BE,KAAA;EAE5D,oBACEH,aAdJ,CAcKI,KAAA,CAAME,IAAI,EAAKD,SAAA,CAAUC,IAAI,EAC3BF,KAAA,CAAMG,mBAAmB,iBAAIP,aAfpC,CAeqCI,KAAA,CAAMG,mBAAmB,EAAKF,SAAA,CAAUE,mBAAmB,GACzFH,KAAA,CAAMI,UAAU,iBAAIR,aAhB3B,CAgB4BI,KAAA,CAAMI,UAAU,EAAKH,SAAA,CAAUG,UAAU;AAGrE"}
|
package/lib/components/SplitButton/{useSplitButtonStyles.js → useSplitButtonStyles.styles.js}
RENAMED
@@ -8,21 +8,15 @@ export const splitButtonClassNames = {
|
|
8
8
|
};
|
9
9
|
const useFocusStyles = /*#__PURE__*/__styles({
|
10
10
|
primaryActionButton: {
|
11
|
-
Brovlpu: "ftqa4ok",
|
12
|
-
B486eqv: "f2hkw1w",
|
13
11
|
B6xbmo0: ["f1x37qnr", "f1um7c6d"],
|
14
12
|
kdpuga: ["fn4c73s", "f6pwzcr"]
|
15
13
|
},
|
16
14
|
menuButton: {
|
17
|
-
Brovlpu: "ftqa4ok",
|
18
|
-
B486eqv: "f2hkw1w",
|
19
15
|
lbo84a: ["frrbwxo", "f1rgcpbv"],
|
20
16
|
dm238s: ["f1um7c6d", "f1x37qnr"],
|
21
17
|
Bw81rd7: ["f6pwzcr", "fn4c73s"]
|
22
18
|
}
|
23
19
|
}, {
|
24
|
-
f: [".ftqa4ok:focus{outline-style:none;}"],
|
25
|
-
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
26
20
|
d: [".f1x37qnr[data-fui-focus-visible]{border-top-right-radius:0;}", ".f1um7c6d[data-fui-focus-visible]{border-top-left-radius:0;}", ".fn4c73s[data-fui-focus-visible]{border-bottom-right-radius:0;}", ".f6pwzcr[data-fui-focus-visible]{border-bottom-left-radius:0;}", ".frrbwxo[data-fui-focus-visible]{border-left-width:0;}", ".f1rgcpbv[data-fui-focus-visible]{border-right-width:0;}"]
|
27
21
|
});
|
28
22
|
const useRootStyles = /*#__PURE__*/__styles({
|
@@ -105,4 +99,4 @@ export const useSplitButtonStyles_unstable = state => {
|
|
105
99
|
}
|
106
100
|
return state;
|
107
101
|
};
|
108
|
-
//# sourceMappingURL=useSplitButtonStyles.js.map
|
102
|
+
//# sourceMappingURL=useSplitButtonStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","createCustomFocusIndicatorStyle","tokens","splitButtonClassNames","root","menuButton","primaryActionButton","useFocusStyles","B6xbmo0","kdpuga","lbo84a","dm238s","Bw81rd7","d","useRootStyles","base","mc9l5x","Brf1p80","qhf8xq","ha4doy","kn2xc0","Bs76p8a","cuxpm9","Biffepf","Defnvf","z0pv9t","outline","primary","B1l9wao","lcnrd8","Brbpp8k","Bcsxniv","tl7e51","mba178","secondary","subtle","transparent","circular","rounded","square","disabled","disabledHighContrast","h","m","useSplitButtonStyles_unstable","state","rootStyles","focusStyles","appearance","disabledFocusable","className"],"sources":["../../../src/components/SplitButton/useSplitButtonStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SplitButtonSlots, SplitButtonState } from './SplitButton.types';\n\nexport const splitButtonClassNames: SlotClassNames<SplitButtonSlots> = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton',\n};\n\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n }),\n\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n }),\n});\n\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralForegroundOnBrand,\n },\n },\n\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'HighlightText',\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight',\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight',\n },\n },\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n },\n transparent: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n },\n\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled,\n },\n },\n },\n\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText',\n },\n },\n },\n },\n});\n\nexport const useSplitButtonStyles_unstable = (state: SplitButtonState): SplitButtonState => {\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n\n const { appearance, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n splitButtonClassNames.root,\n rootStyles.base,\n appearance && rootStyles[appearance],\n (disabled || disabledFocusable) && rootStyles.disabled,\n (disabled || disabledFocusable) && rootStyles.disabledHighContrast,\n state.root.className,\n );\n\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(\n splitButtonClassNames.menuButton,\n focusStyles.menuButton,\n state.menuButton.className,\n );\n }\n\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(\n splitButtonClassNames.primaryActionButton,\n focusStyles.primaryActionButton,\n state.primaryActionButton.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AACzC,SAASC,+BAA+B,QAAQ;AAChD,SAASC,MAAM,QAAQ;AAIvB,OAAO,MAAMC,qBAAA,GAA0D;EACrEC,IAAA,EAAM;EACNC,UAAA,EAAY;EACZC,mBAAA,EAAqB;AACvB;AAEA,MAAMC,cAAA,gBAAiBR,QAAA;EAAAO,mBAAA;IAAAE,OAAA;IAAAC,MAAA;EAAA;EAAAJ,UAAA;IAAAK,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,EAWvB;AAEA,MAAMC,aAAA,gBAAgBf,QAAA;EAAAgB,IAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,OAAA;EAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,SAAA;EAAAC,MAAA;IAAAP,OAAA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CAAC4C,SAAS,GAAGlD,YAAA,CACpCG,qBAAA,CAAsBG,mBAAmB,EACzCyC,WAAA,CAAYzC,mBAAmB,EAC/BuC,KAAA,CAAMvC,mBAAmB,CAAC4C,SAAS;EAEvC;EAEA,OAAOL,KAAA;AACT"}
|
@@ -1,18 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { renderToggleButton_unstable } from './renderToggleButton';
|
3
3
|
import { useToggleButton_unstable } from './useToggleButton';
|
4
|
-
import { useToggleButtonStyles_unstable } from './useToggleButtonStyles';
|
5
|
-
import {
|
4
|
+
import { useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
6
6
|
/**
|
7
7
|
* ToggleButtons are buttons that toggle between two defined states when triggered.
|
8
8
|
*/
|
9
9
|
export const ToggleButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
10
|
const state = useToggleButton_unstable(props, ref);
|
11
11
|
useToggleButtonStyles_unstable(state);
|
12
|
-
|
13
|
-
useToggleButtonStyles_unstable: useCustomStyles
|
14
|
-
} = useCustomStyleHooks_unstable();
|
15
|
-
useCustomStyles(state);
|
12
|
+
useCustomStyleHook_unstable('useToggleButtonStyles_unstable')(state);
|
16
13
|
return renderToggleButton_unstable(state);
|
17
14
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
18
15
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonStyles_unstable","
|
1
|
+
{"version":3,"names":["React","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonStyles_unstable","useCustomStyleHook_unstable","ToggleButton","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/ToggleButton/ToggleButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { renderToggleButton_unstable } from './renderToggleButton';\nimport { useToggleButton_unstable } from './useToggleButton';\nimport { useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';\nimport type { ToggleButtonProps } from './ToggleButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToggleButtons are buttons that toggle between two defined states when triggered.\n */\nexport const ToggleButton: ForwardRefComponent<ToggleButtonProps> = React.forwardRef((props, ref) => {\n const state = useToggleButton_unstable(props, ref);\n\n useToggleButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToggleButtonStyles_unstable')(state);\n\n return renderToggleButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToggleButtonProps>;\n\nToggleButton.displayName = 'ToggleButton';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,wBAAwB,QAAQ;AACzC,SAASC,8BAA8B,QAAQ;AAG/C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,YAAA,gBAAuDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACnG,MAAMC,KAAA,GAAQP,wBAAA,CAAyBK,KAAA,EAAOC,GAAA;EAE9CL,8BAAA,CAA+BM,KAAA;EAE/BL,2BAAA,CAA4B,kCAAkCK,KAAA;EAE9D,OAAOR,2BAAA,CAA4BQ,KAAA;EACnC;AACF;;AAEAJ,YAAA,CAAaK,WAAW,GAAG"}
|
@@ -2,5 +2,5 @@ export * from './ToggleButton';
|
|
2
2
|
export * from './ToggleButton.types';
|
3
3
|
export * from './renderToggleButton';
|
4
4
|
export * from './useToggleButton';
|
5
|
-
export { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles';
|
5
|
+
export { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';
|
6
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["toggleButtonClassNames","useToggleButtonStyles_unstable"],"sources":["../../../src/components/ToggleButton/index.ts"],"sourcesContent":["export * from './ToggleButton';\nexport * from './ToggleButton.types';\nexport * from './renderToggleButton';\nexport * from './useToggleButton';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,sBAAsB,EAAEC,8BAA8B,QAAQ"}
|
1
|
+
{"version":3,"names":["toggleButtonClassNames","useToggleButtonStyles_unstable"],"sources":["../../../src/components/ToggleButton/index.ts"],"sourcesContent":["export * from './ToggleButton';\nexport * from './ToggleButton.types';\nexport * from './renderToggleButton';\nexport * from './useToggleButton';\nexport { toggleButtonClassNames, useToggleButtonStyles_unstable } from './useToggleButtonStyles.styles';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,SAASA,sBAAsB,EAAEC,8BAA8B,QAAQ"}
|
package/lib/components/ToggleButton/{useToggleButtonStyles.js → useToggleButtonStyles.styles.js}
RENAMED
@@ -2,7 +2,7 @@ import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons
|
|
2
2
|
import { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';
|
3
3
|
import { tokens } from '@fluentui/react-theme';
|
4
4
|
import { shorthands, mergeClasses, __styles } from '@griffel/react';
|
5
|
-
import { useButtonStyles_unstable } from '../Button/useButtonStyles';
|
5
|
+
import { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';
|
6
6
|
export const toggleButtonClassNames = {
|
7
7
|
root: 'fui-ToggleButton',
|
8
8
|
icon: 'fui-ToggleButton__icon'
|
@@ -80,8 +80,6 @@ const useRootCheckedStyles = /*#__PURE__*/__styles({
|
|
80
80
|
ibv6hh: ["f1efpmoh", "f130t4y6"],
|
81
81
|
Jwef8y: "fjxutwb",
|
82
82
|
iro3zm: "fwiml72",
|
83
|
-
Brovlpu: "ftqa4ok",
|
84
|
-
B486eqv: "f2hkw1w",
|
85
83
|
B8q5s1w: "fcaw57c",
|
86
84
|
Bci5o5g: ["fpwd27e", "f1999bjr"],
|
87
85
|
n8qw10: "f1hi52o4",
|
@@ -215,9 +213,7 @@ const useRootCheckedStyles = /*#__PURE__*/__styles({
|
|
215
213
|
m: "(forced-colors: active)"
|
216
214
|
}], ["@media (forced-colors: active){.fkom8lu:focus{outline-color:Highlight;}}", {
|
217
215
|
m: "(forced-colors: active)"
|
218
|
-
}]]
|
219
|
-
f: [".ftqa4ok:focus{outline-style:none;}"],
|
220
|
-
i: [".f2hkw1w:focus-visible{outline-style:none;}"]
|
216
|
+
}]]
|
221
217
|
});
|
222
218
|
const useRootDisabledStyles = /*#__PURE__*/__styles({
|
223
219
|
base: {
|
@@ -383,4 +379,4 @@ export const useToggleButtonStyles_unstable = state => {
|
|
383
379
|
useButtonStyles_unstable(state);
|
384
380
|
return state;
|
385
381
|
};
|
386
|
-
//# sourceMappingURL=useToggleButtonStyles.js.map
|
382
|
+
//# sourceMappingURL=useToggleButtonStyles.styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["iconFilledClassName","iconRegularClassName","createCustomFocusIndicatorStyle","tokens","shorthands","mergeClasses","__styles","useButtonStyles_unstable","toggleButtonClassNames","root","icon","useRootCheckedStyles","base","De3pzq","g2u3we","h3c5rm","B9xav0g","zhjwy3","sj55zd","B4j52fo","Bekrc4i","Bn0qgzm","ibv6hh","D0sxk3","t6yez3","Jwef8y","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Bi91k9c","iro3zm","b661bw","Bk6r4ia","B9zn80p","Bpld233","B2d53fq","highContrast","Bsw6fvg","Bjwas2f","Bn1d65q","Bxeuatn","n51gp8","Bbusuzp","ycbfsm","Bqrx1nm","pgvf35","Bh7lczh","dpv3f4","Bpnjhaq","ze5xyy","g2kj27","Bf756sw","Bow2dr7","Bvhedfk","Gye4lf","pc6evw","Btyszwp","B8jyv7h","l9kbep","By5cl00","abbn9y","Bw5jppy","B0tp99d","B55dcl7","G867l3","gdbnj","mxns5l","o3nasb","B7d2ofm","outline","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","primary","secondary","subtle","transparent","d","h","m","useRootDisabledStyles","useIconCheckedStyles","subtleOrTransparent","usePrimaryHighContrastStyles","disabled","useToggleButtonStyles_unstable","state","rootCheckedStyles","rootDisabledStyles","iconCheckedStyles","primaryHighContrastStyles","appearance","checked","disabledFocusable","className"],"sources":["../../../src/components/ToggleButton/useToggleButtonStyles.styles.ts"],"sourcesContent":["import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useButtonStyles_unstable } from '../Button/useButtonStyles.styles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ButtonSlots } from '../Button/Button.types';\nimport type { ToggleButtonState } from './ToggleButton.types';\n\nexport const toggleButtonClassNames: SlotClassNames<ButtonSlots> = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon',\n};\n\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n\n [`& .${iconFilledClassName}`]: {\n display: 'inline',\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none',\n },\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n backgroundColor: 'Highlight',\n ...shorthands.borderColor('Highlight'),\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n\n ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':hover:active': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight',\n },\n\n ':focus': {\n ...shorthands.border('1px', 'solid', 'HighlightText'),\n outlineColor: 'Highlight',\n },\n },\n },\n\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n },\n\n ...createCustomFocusIndicatorStyle({\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n }),\n },\n primary: {\n backgroundColor: tokens.colorBrandBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n\n ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand,\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorSubtleBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Pressed,\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandSelected,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed,\n },\n },\n});\n\nconst useRootDisabledStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n\n // Appearance variations\n outline: {\n /* No styles */\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n ...shorthands.borderColor('transparent'),\n },\n },\n secondary: {\n /* The secondary styles are exactly the same as the base styles. */\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n transparent: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n },\n },\n});\n\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\nconst usePrimaryHighContrastStyles = makeStyles({\n // Do not use primary variant high contrast styles for toggle buttons\n // otherwise there isn't enough difference between on/off states\n base: {\n '@media (forced-colors: active)': {\n backgroundColor: 'ButtonFace',\n ...shorthands.borderColor('ButtonBorder'),\n color: 'ButtonText',\n forcedColorAdjust: 'auto',\n },\n },\n\n disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n\n ':focus': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n },\n});\n\nexport const useToggleButtonStyles_unstable = (state: ToggleButtonState): ToggleButtonState => {\n const rootCheckedStyles = useRootCheckedStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n\n const { appearance, checked, disabled, disabledFocusable } = state;\n\n state.root.className = mergeClasses(\n toggleButtonClassNames.root,\n\n // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base,\n appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled,\n\n // Checked styles\n checked && rootCheckedStyles.base,\n checked && rootCheckedStyles.highContrast,\n appearance && checked && rootCheckedStyles[appearance],\n\n // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base,\n appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance],\n\n // User provided class name\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(\n toggleButtonClassNames.icon,\n (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent,\n state.icon.className,\n );\n }\n\n useButtonStyles_unstable(state);\n\n return state;\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,oBAAoB,QAAQ;AA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MH,yBAAA,CAA0BN,QAAQ;EAEjG;EACAQ,OAAA,IAAWL,iBAAA,CAAkB7E,IAAI,EACjCkF,OAAA,IAAWL,iBAAA,CAAkBpD,YAAY,EACzCwD,UAAA,IAAcC,OAAA,IAAWL,iBAAiB,CAACI,UAAA,CAAW;EAGtD;EAAC,CAAAP,QAAA,IAAYS,iBAAgB,KAAML,kBAAA,CAAmB9E,IAAI,EAC1DiF,UAAA,KAAeP,QAAA,IAAYS,iBAAgB,KAAML,kBAAkB,CAACG,UAAA,CAAW;EAE/E;EACAL,KAAA,CAAM/E,IAAI,CAACuF,SAAS;EAGtB,IAAIR,KAAA,CAAM9E,IAAI,EAAE;IACd8E,KAAA,CAAM9E,IAAI,CAACsF,SAAS,GAAG3F,YAAA,CACrBG,sBAAA,CAAuBE,IAAI,EAC3B,CAACmF,UAAA,KAAe,YAAYA,UAAA,KAAe,aAAY,KAAMF,iBAAA,CAAkBP,mBAAmB,EAClGI,KAAA,CAAM9E,IAAI,CAACsF,SAAS;EAExB;EAEAzF,wBAAA,CAAyBiF,KAAA;EAEzB,OAAOA,KAAA;AACT"}
|
@@ -10,13 +10,12 @@ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildc
|
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
11
|
const _renderButton = require("./renderButton");
|
12
12
|
const _useButton = require("./useButton");
|
13
|
-
const
|
13
|
+
const _useButtonStylesStyles = require("./useButtonStyles.styles");
|
14
14
|
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
15
15
|
const Button = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
16
16
|
const state = (0, _useButton.useButton_unstable)(props, ref);
|
17
|
-
(0,
|
18
|
-
|
19
|
-
useCustomStyles(state);
|
17
|
+
(0, _useButtonStylesStyles.useButtonStyles_unstable)(state);
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useButtonStyles_unstable')(state);
|
20
19
|
return (0, _renderButton.renderButton_unstable)(state);
|
21
20
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
22
21
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Button/Button.js"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles';\nimport {
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/Button.js"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from './renderButton';\nimport { useButton_unstable } from './useButton';\nimport { useButtonStyles_unstable } from './useButtonStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Buttons give people a way to trigger an action.\n */\nexport const Button = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useButton_unstable(props, ref);\n useButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useButtonStyles_unstable')(state);\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n});\n\nButton.displayName = 'Button';\n//# sourceMappingURL=Button.js.map"],"names":["Button","React","forwardRef","props","ref","state","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","renderButton_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;8BACe;2BACH;uCACM;qCACG;AAIrC,MAAMA,SAAS,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAClE,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,+CAAwB,EAACF;IACzBG,IAAAA,gDAA2B,EAAC,4BAA4BH;IACxD,OAAOI,IAAAA,mCAAqB,EAACJ;AAC7B,0FAA0F;AAC5F;AAEAL,OAAOU,WAAW,GAAG,UACrB,kCAAkC"}
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
buttonClassNames: ()=>
|
13
|
-
useButtonStyles_unstable: ()=>
|
12
|
+
buttonClassNames: ()=>_useButtonStylesStyles.buttonClassNames,
|
13
|
+
useButtonStyles_unstable: ()=>_useButtonStylesStyles.useButtonStyles_unstable
|
14
14
|
});
|
15
15
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
16
16
|
_exportStar(require("./Button"), exports);
|
17
17
|
_exportStar(require("./renderButton"), exports);
|
18
18
|
_exportStar(require("./useButton"), exports);
|
19
|
-
const
|
19
|
+
const _useButtonStylesStyles = require("./useButtonStyles.styles");
|
20
20
|
//# sourceMappingURL=index.js.map
|
21
21
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Button/index.js"],"sourcesContent":["export * from './Button';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":["buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAGSA,gBAAgB,MAAhBA,
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/index.js"],"sourcesContent":["export * from './Button';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n//# sourceMappingURL=index.js.map"],"names":["buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAGSA,gBAAgB,MAAhBA,uCAAgB;IAAEC,wBAAwB,MAAxBA,+CAAwB;;;oBAHrC;oBACA;oBACA;uCAC6C;CAC3D,iCAAiC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
@@ -6,13 +6,12 @@ Object.defineProperty(exports, "renderButton_unstable", {
|
|
6
6
|
enumerable: true,
|
7
7
|
get: ()=>renderButton_unstable
|
8
8
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
11
10
|
const _reactUtilities = require("@fluentui/react-utilities");
|
12
11
|
const renderButton_unstable = (state)=>{
|
13
|
-
const { slots , slotProps } = (0, _reactUtilities.
|
12
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
14
13
|
const { iconOnly , iconPosition } = state;
|
15
|
-
return /*#__PURE__*/
|
14
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.icon, slotProps.icon), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.icon, slotProps.icon));
|
16
15
|
}; //# sourceMappingURL=renderButton.js.map
|
17
16
|
|
18
17
|
//# sourceMappingURL=renderButton.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Button/renderButton.js"],"sourcesContent":["import
|
1
|
+
{"version":3,"sources":["../../../lib/components/Button/renderButton.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */\nexport const renderButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlotsNext(state);\n const {\n iconOnly,\n iconPosition\n } = state;\n return /*#__PURE__*/createElement(slots.root, slotProps.root, iconPosition !== 'after' && slots.icon && /*#__PURE__*/createElement(slots.icon, slotProps.icon), !iconOnly && state.root.children, iconPosition === 'after' && slots.icon && /*#__PURE__*/createElement(slots.icon, slotProps.icon));\n};\n//# sourceMappingURL=renderButton.js.map"],"names":["renderButton_unstable","state","slots","slotProps","getSlotsNext","iconOnly","iconPosition","createElement","root","icon","children"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKrCA;;aAAAA;;iCALqE;gCACrD;AAItB,MAAMA,wBAAwBC,CAAAA,QAAS;IAC5C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACH;IACjB,MAAM,EACJI,SAAQ,EACRC,aAAY,EACb,GAAGL;IACJ,OAAO,WAAW,GAAEM,IAAAA,8BAAa,EAACL,MAAMM,IAAI,EAAEL,UAAUK,IAAI,EAAEF,iBAAiB,WAAWJ,MAAMO,IAAI,IAAI,WAAW,GAAEF,IAAAA,8BAAa,EAACL,MAAMO,IAAI,EAAEN,UAAUM,IAAI,GAAG,CAACJ,YAAYJ,MAAMO,IAAI,CAACE,QAAQ,EAAEJ,iBAAiB,WAAWJ,MAAMO,IAAI,IAAI,WAAW,GAAEF,IAAAA,8BAAa,EAACL,MAAMO,IAAI,EAAEN,UAAUM,IAAI;AACnS,GACA,wCAAwC"}
|
@@ -23,31 +23,27 @@ const buttonSpacingSmallWithIcon = '1px';
|
|
23
23
|
const buttonSpacingMedium = '5px';
|
24
24
|
const buttonSpacingLarge = '8px';
|
25
25
|
const buttonSpacingLargeWithIcon = '7px';
|
26
|
-
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("
|
27
|
-
".
|
28
|
-
".
|
29
|
-
".
|
30
|
-
".
|
31
|
-
".
|
32
|
-
".
|
33
|
-
".
|
34
|
-
"@media screen and (prefers-reduced-motion: reduce){.
|
35
|
-
"@media (forced-colors: active){.
|
36
|
-
".
|
37
|
-
".
|
38
|
-
".
|
39
|
-
".
|
40
|
-
".
|
41
|
-
".
|
42
|
-
".
|
43
|
-
".
|
44
|
-
"
|
45
|
-
".
|
46
|
-
"
|
47
|
-
"@media (forced-colors: active){.r1eny37h:focus{border-color:ButtonText;}.r1eny37h:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.r1eny37h:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}",
|
48
|
-
".r1eny37h:focus{outline-style:none;}",
|
49
|
-
".r1eny37h:focus-visible{outline-style:none;}",
|
50
|
-
".r1eny37h[data-fui-focus-visible]{border-color:var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);z-index:1;}"
|
26
|
+
const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("ri7kuyr", "rto22aj", [
|
27
|
+
".ri7kuyr{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;text-decoration-line:none;vertical-align:middle;margin:0;overflow:hidden;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);font-family:var(--fontFamilyBase);outline-style:none;padding:5px var(--spacingHorizontalM);min-width:96px;border-radius:var(--borderRadiusMedium);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase300);transition-duration:var(--durationFaster);transition-property:background,border,color;transition-timing-function:var(--curveEasyEase);}",
|
28
|
+
".ri7kuyr:hover{background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground1Hover);cursor:pointer;}",
|
29
|
+
".ri7kuyr:hover .fui-Icon-filled{display:inline;}",
|
30
|
+
".ri7kuyr:hover .fui-Icon-regular{display:none;}",
|
31
|
+
".ri7kuyr:hover:active{background-color:var(--colorNeutralBackground1Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground1Pressed);outline-style:none;}",
|
32
|
+
".ri7kuyr:hover:active .fui-Icon-filled{display:inline;}",
|
33
|
+
".ri7kuyr:hover:active .fui-Icon-regular{display:none;}",
|
34
|
+
"@media screen and (prefers-reduced-motion: reduce){.ri7kuyr{transition-duration:0.01ms;}}",
|
35
|
+
"@media (forced-colors: active){.ri7kuyr:focus{border-color:ButtonText;}.ri7kuyr:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.ri7kuyr:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}",
|
36
|
+
".ri7kuyr[data-fui-focus-visible]{border-color:var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);z-index:1;}",
|
37
|
+
".rto22aj{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;box-sizing:border-box;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;text-decoration-line:none;vertical-align:middle;margin:0;overflow:hidden;background-color:var(--colorNeutralBackground1);color:var(--colorNeutralForeground1);border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);font-family:var(--fontFamilyBase);outline-style:none;padding:5px var(--spacingHorizontalM);min-width:96px;border-radius:var(--borderRadiusMedium);font-size:var(--fontSizeBase300);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase300);transition-duration:var(--durationFaster);transition-property:background,border,color;transition-timing-function:var(--curveEasyEase);}",
|
38
|
+
".rto22aj:hover{background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground1Hover);cursor:pointer;}",
|
39
|
+
".rto22aj:hover .fui-Icon-filled{display:inline;}",
|
40
|
+
".rto22aj:hover .fui-Icon-regular{display:none;}",
|
41
|
+
".rto22aj:hover:active{background-color:var(--colorNeutralBackground1Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground1Pressed);outline-style:none;}",
|
42
|
+
".rto22aj:hover:active .fui-Icon-filled{display:inline;}",
|
43
|
+
".rto22aj:hover:active .fui-Icon-regular{display:none;}",
|
44
|
+
"@media screen and (prefers-reduced-motion: reduce){.rto22aj{transition-duration:0.01ms;}}",
|
45
|
+
"@media (forced-colors: active){.rto22aj:focus{border-color:ButtonText;}.rto22aj:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.rto22aj:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}",
|
46
|
+
".rto22aj[data-fui-focus-visible]{border-color:var(--colorTransparentStroke);border-radius:var(--borderRadiusMedium);outline:var(--strokeWidthThick) solid var(--colorTransparentStroke);box-shadow:var(--shadow4),0 0 0 2px var(--colorStrokeFocus2);z-index:1;}"
|
51
47
|
]);
|
52
48
|
const useIconBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rywnvv2", null, [
|
53
49
|
".rywnvv2{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;font-size:20px;height:20px;width:20px;--fui-Button__icon--spacing:var(--spacingHorizontalSNudge);}"
|
@@ -895,8 +891,6 @@ const useRootDisabledStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
895
891
|
});
|
896
892
|
const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
897
893
|
circular: {
|
898
|
-
Brovlpu: "ftqa4ok",
|
899
|
-
B486eqv: "f2hkw1w",
|
900
894
|
kdpuga: [
|
901
895
|
"fanj13w",
|
902
896
|
"f1gou5sz"
|
@@ -916,8 +910,6 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
916
910
|
},
|
917
911
|
rounded: {},
|
918
912
|
square: {
|
919
|
-
Brovlpu: "ftqa4ok",
|
920
|
-
B486eqv: "f2hkw1w",
|
921
913
|
kdpuga: [
|
922
914
|
"f1ndz5i7",
|
923
915
|
"f1co4qro"
|
@@ -936,8 +928,6 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
936
928
|
]
|
937
929
|
},
|
938
930
|
primary: {
|
939
|
-
Brovlpu: "ftqa4ok",
|
940
|
-
B486eqv: "f2hkw1w",
|
941
931
|
B8q5s1w: "f15my96h",
|
942
932
|
Bci5o5g: [
|
943
933
|
"f8yq1e5",
|
@@ -951,8 +941,6 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
951
941
|
j6ew2k: "ftbnf46"
|
952
942
|
},
|
953
943
|
small: {
|
954
|
-
Brovlpu: "ftqa4ok",
|
955
|
-
B486eqv: "f2hkw1w",
|
956
944
|
kdpuga: [
|
957
945
|
"fg3gtdo",
|
958
946
|
"fwii5mg"
|
@@ -972,8 +960,6 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
972
960
|
},
|
973
961
|
medium: {},
|
974
962
|
large: {
|
975
|
-
Brovlpu: "ftqa4ok",
|
976
|
-
B486eqv: "f2hkw1w",
|
977
963
|
kdpuga: [
|
978
964
|
"ft3lys4",
|
979
965
|
"f1la4x2g"
|
@@ -992,12 +978,6 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
992
978
|
]
|
993
979
|
}
|
994
980
|
}, {
|
995
|
-
f: [
|
996
|
-
".ftqa4ok:focus{outline-style:none;}"
|
997
|
-
],
|
998
|
-
i: [
|
999
|
-
".f2hkw1w:focus-visible{outline-style:none;}"
|
1000
|
-
],
|
1001
981
|
d: [
|
1002
982
|
".fanj13w[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusCircular);}",
|
1003
983
|
".f1gou5sz[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusCircular);}",
|
@@ -1145,6 +1125,6 @@ const useButtonStyles_unstable = (state)=>{
|
|
1145
1125
|
state.icon.className = (0, _react.mergeClasses)(buttonClassNames.icon, iconBaseClassName, state.root.children !== undefined && state.root.children !== null && iconStyles[iconPosition], iconStyles[size], state.icon.className);
|
1146
1126
|
}
|
1147
1127
|
return state;
|
1148
|
-
}; //# sourceMappingURL=useButtonStyles.js.map
|
1128
|
+
}; //# sourceMappingURL=useButtonStyles.styles.js.map
|
1149
1129
|
|
1150
|
-
//# sourceMappingURL=useButtonStyles.js.map
|
1130
|
+
//# sourceMappingURL=useButtonStyles.styles.js.map
|