@fluentui/react-button 9.3.34 → 9.3.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/CHANGELOG.json +64 -1
  2. package/CHANGELOG.md +19 -2
  3. package/lib/components/Button/Button.js.map +1 -1
  4. package/lib/components/Button/renderButton.js +9 -3
  5. package/lib/components/Button/renderButton.js.map +1 -1
  6. package/lib/components/Button/useButton.js +4 -3
  7. package/lib/components/Button/useButton.js.map +1 -1
  8. package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
  9. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  10. package/lib/components/CompoundButton/renderCompoundButton.js +14 -3
  11. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  12. package/lib/components/CompoundButton/useCompoundButton.js +1 -1
  13. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  14. package/lib/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  15. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  16. package/lib/components/MenuButton/renderMenuButton.js +10 -3
  17. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  18. package/lib/components/MenuButton/useMenuButton.js +1 -1
  19. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  20. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  21. package/lib/components/SplitButton/renderSplitButton.js +7 -2
  22. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  23. package/lib/components/SplitButton/useSplitButton.js +1 -1
  24. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  25. package/lib/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  26. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  27. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  28. package/lib/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  29. package/lib/contexts/ButtonContext.js.map +1 -1
  30. package/lib/utils/useToggleState.js +2 -2
  31. package/lib/utils/useToggleState.js.map +1 -1
  32. package/lib-commonjs/Button.js +2 -2
  33. package/lib-commonjs/Button.js.map +1 -1
  34. package/lib-commonjs/CompoundButton.js +2 -2
  35. package/lib-commonjs/CompoundButton.js.map +1 -1
  36. package/lib-commonjs/MenuButton.js +2 -2
  37. package/lib-commonjs/MenuButton.js.map +1 -1
  38. package/lib-commonjs/SplitButton.js +2 -2
  39. package/lib-commonjs/SplitButton.js.map +1 -1
  40. package/lib-commonjs/ToggleButton.js +2 -2
  41. package/lib-commonjs/ToggleButton.js.map +1 -1
  42. package/lib-commonjs/components/Button/Button.js +9 -7
  43. package/lib-commonjs/components/Button/Button.js.map +1 -1
  44. package/lib-commonjs/components/Button/index.js +11 -7
  45. package/lib-commonjs/components/Button/index.js.map +1 -1
  46. package/lib-commonjs/components/Button/renderButton.js +15 -7
  47. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  48. package/lib-commonjs/components/Button/useButton.js +14 -11
  49. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  50. package/lib-commonjs/components/Button/useButtonStyles.styles.js +14 -10
  51. package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
  52. package/lib-commonjs/components/CompoundButton/CompoundButton.js +9 -7
  53. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  54. package/lib-commonjs/components/CompoundButton/index.js +12 -8
  55. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  56. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +20 -7
  57. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  58. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +9 -7
  59. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  60. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js +14 -10
  61. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.styles.js.map +1 -1
  62. package/lib-commonjs/components/MenuButton/MenuButton.js +9 -7
  63. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  64. package/lib-commonjs/components/MenuButton/index.js +12 -8
  65. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  66. package/lib-commonjs/components/MenuButton/renderMenuButton.js +16 -7
  67. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  68. package/lib-commonjs/components/MenuButton/useMenuButton.js +10 -8
  69. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  70. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js +11 -7
  71. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.styles.js.map +1 -1
  72. package/lib-commonjs/components/SplitButton/SplitButton.js +9 -7
  73. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  74. package/lib-commonjs/components/SplitButton/index.js +12 -8
  75. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  76. package/lib-commonjs/components/SplitButton/renderSplitButton.js +13 -6
  77. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  78. package/lib-commonjs/components/SplitButton/useSplitButton.js +17 -15
  79. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  80. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js +9 -5
  81. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.styles.js.map +1 -1
  82. package/lib-commonjs/components/ToggleButton/ToggleButton.js +9 -7
  83. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  84. package/lib-commonjs/components/ToggleButton/index.js +12 -8
  85. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  86. package/lib-commonjs/components/ToggleButton/renderToggleButton.js +3 -1
  87. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  88. package/lib-commonjs/components/ToggleButton/useToggleButton.js +5 -3
  89. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  90. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js +13 -9
  91. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.styles.js.map +1 -1
  92. package/lib-commonjs/contexts/ButtonContext.js +8 -4
  93. package/lib-commonjs/contexts/ButtonContext.js.map +1 -1
  94. package/lib-commonjs/contexts/index.js +2 -2
  95. package/lib-commonjs/contexts/index.js.map +1 -1
  96. package/lib-commonjs/index.js +89 -33
  97. package/lib-commonjs/index.js.map +1 -1
  98. package/lib-commonjs/utils/index.js +2 -2
  99. package/lib-commonjs/utils/index.js.map +1 -1
  100. package/lib-commonjs/utils/useToggleState.js +10 -8
  101. package/lib-commonjs/utils/useToggleState.js.map +1 -1
  102. package/package.json +13 -13
@@ -7,7 +7,7 @@ import { MenuButton } from '../MenuButton/MenuButton';
7
7
  * @param props - User provided props to the SplitButton component.
8
8
  * @param ref - User provided ref to be passed to the SplitButton component.
9
9
  */ export const useSplitButton_unstable = (props, ref)=>{
10
- const { appearance ='secondary' , children , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , menuButton , menuIcon , primaryActionButton , shape ='rounded' , size ='medium' } = props;
10
+ const { appearance = 'secondary', children, disabled = false, disabledFocusable = false, icon, iconPosition = 'before', menuButton, menuIcon, primaryActionButton, shape = 'rounded', size = 'medium' } = props;
11
11
  const baseId = useId('splitButton-');
12
12
  const menuButtonShorthand = slot.optional(menuButton, {
13
13
  defaultProps: {
@@ -1 +1 @@
1
- {"version":3,"sources":["useSplitButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId, slot } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonProps, SplitButtonState } from './SplitButton.types';\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButton_unstable = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonState => {\n const {\n appearance = 'secondary',\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n shape = 'rounded',\n size = 'medium',\n } = props;\n\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = slot.optional(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size,\n },\n renderByDefault: true,\n elementType: MenuButton,\n });\n const primaryActionButtonShorthand = slot.optional(primaryActionButton, {\n defaultProps: {\n appearance,\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n shape,\n size,\n },\n renderByDefault: true,\n elementType: Button,\n }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided\n // by the user.\n if (\n menuButtonShorthand &&\n primaryActionButtonShorthand &&\n !menuButtonShorthand['aria-label'] &&\n !menuButtonShorthand['aria-labelledby']\n ) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size, // Slots definition\n components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button },\n root: slot.always(getNativeElementProps('div', { ref, ...props }), { elementType: 'div' }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"],"names":["React","getNativeElementProps","useId","slot","Button","MenuButton","useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","menuButtonShorthand","optional","defaultProps","renderByDefault","elementType","primaryActionButtonShorthand","id","components","root","always"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,qBAAqB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAC/E,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,UAAU,QAAQ,2BAA2B;AAGtD;;;;CAIC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC,MACqB;IACrB,MAAM,EACJC,YAAa,YAAW,EACxBC,SAAQ,EACRC,UAAW,KAAK,CAAA,EAChBC,mBAAoB,KAAK,CAAA,EACzBC,KAAI,EACJC,cAAe,SAAQ,EACvBC,WAAU,EACVC,SAAQ,EACRC,oBAAmB,EACnBC,OAAQ,UAAS,EACjBC,MAAO,SAAQ,EAChB,GAAGZ;IAEJ,MAAMa,SAASlB,MAAM;IAErB,MAAMmB,sBAAsBlB,KAAKmB,QAAQ,CAACP,YAAY;QACpDQ,cAAc;YACZd;YACAE;YACAC;YACAI;YACAE;YACAC;QACF;QACAK,iBAAiB,IAAI;QACrBC,aAAapB;IACf;IACA,MAAMqB,+BAA+BvB,KAAKmB,QAAQ,CAACL,qBAAqB;QACtEM,cAAc;YACZd;YACAC;YACAC;YACAC;YACAC;YACAC;YACAa,IAAIP,SAAS;YACbF;YACAC;QACF;QACAK,iBAAiB,IAAI;QACrBC,aAAarB;IACf,IAAI,oHAAoH;IACxH,eAAe;IACf,IACEiB,uBACAK,gCACA,CAACL,mBAAmB,CAAC,aAAa,IAClC,CAACA,mBAAmB,CAAC,kBAAkB,EACvC;QACAA,mBAAmB,CAAC,kBAAkB,GAAGK,6BAA6BC,EAAE;IAC1E,CAAC;IACD,OAAO;QACL,gCAAgC;QAChClB;QACAE;QACAC;QACAE;QACAI;QACAC;QACAS,YAAY;YAAEC,MAAM;YAAOd,YAAYV;YAAYY,qBAAqBb;QAAO;QAC/EyB,MAAM1B,KAAK2B,MAAM,CAAC7B,sBAAsB,OAAO;YAAEO;YAAK,GAAGD,KAAK;QAAC,IAAI;YAAEkB,aAAa;QAAM;QACxFV,YAAYM;QACZJ,qBAAqBS;IACvB;AACF,EAAE"}
1
+ {"version":3,"sources":["useSplitButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId, slot } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\nimport type { SplitButtonProps, SplitButtonState } from './SplitButton.types';\n\n/**\n * Given user props, defines default props for the SplitButton and returns processed state.\n * @param props - User provided props to the SplitButton component.\n * @param ref - User provided ref to be passed to the SplitButton component.\n */\nexport const useSplitButton_unstable = (\n props: SplitButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): SplitButtonState => {\n const {\n appearance = 'secondary',\n children,\n disabled = false,\n disabledFocusable = false,\n icon,\n iconPosition = 'before',\n menuButton,\n menuIcon,\n primaryActionButton,\n shape = 'rounded',\n size = 'medium',\n } = props;\n\n const baseId = useId('splitButton-');\n\n const menuButtonShorthand = slot.optional(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size,\n },\n renderByDefault: true,\n elementType: MenuButton,\n });\n const primaryActionButtonShorthand = slot.optional(primaryActionButton, {\n defaultProps: {\n appearance,\n children,\n disabled,\n disabledFocusable,\n icon,\n iconPosition,\n id: baseId + '__primaryActionButton',\n shape,\n size,\n },\n renderByDefault: true,\n elementType: Button,\n }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided\n // by the user.\n if (\n menuButtonShorthand &&\n primaryActionButtonShorthand &&\n !menuButtonShorthand['aria-label'] &&\n !menuButtonShorthand['aria-labelledby']\n ) {\n menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;\n }\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size, // Slots definition\n components: { root: 'div', menuButton: MenuButton, primaryActionButton: Button },\n root: slot.always(getNativeElementProps('div', { ref, ...props }), { elementType: 'div' }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand,\n };\n};\n"],"names":["React","getNativeElementProps","useId","slot","Button","MenuButton","useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","menuButtonShorthand","optional","defaultProps","renderByDefault","elementType","primaryActionButtonShorthand","id","components","root","always"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/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,"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":["useSplitButtonStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nexport const splitButtonClassNames = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton'\n};\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n }),\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0\n })\n});\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n },\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n }\n },\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'HighlightText'\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight'\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight'\n }\n }\n }\n },\n secondary: {\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover\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 ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed\n }\n }\n },\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n }\n }\n },\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n }\n }\n }\n }\n});\nexport const useSplitButtonStyles_unstable = (state)=>{\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const { appearance , disabled , disabledFocusable } = state;\n state.root.className = mergeClasses(splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);\n }\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,UAAU,EAAE,6BAA6B;EACzCC,mBAAmB,EAAE;AACzB,CAAC;AACD,MAAMC,cAAc,gBAAGR,QAAA;EAAAO,mBAAA;IAAAE,OAAA;IAAAC,MAAA;EAAA;EAAAJ,UAAA;IAAAK,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAUtB,CAAC;AACF,MAAMC,aAAa,gBAAGf,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;EA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AU,EAAE0C,WAAW,CAAC1C,UAAU,EAAEwC,KAAK,CAACxC,UAAU,CAAC6C,SAAS,CAAC;EACnI;EACA,IAAIL,KAAK,CAACvC,mBAAmB,EAAE;IAC3BuC,KAAK,CAACvC,mBAAmB,CAAC4C,SAAS,GAAGlD,YAAY,CAACG,qBAAqB,CAACG,mBAAmB,EAAEyC,WAAW,CAACzC,mBAAmB,EAAEuC,KAAK,CAACvC,mBAAmB,CAAC4C,SAAS,CAAC;EACvK;EACA,OAAOL,KAAK;AAChB,CAAC"}
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":["useSplitButtonStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nexport const splitButtonClassNames = {\n root: 'fui-SplitButton',\n menuButton: 'fui-SplitButton__menuButton',\n primaryActionButton: 'fui-SplitButton__primaryActionButton'\n};\nconst useFocusStyles = makeStyles({\n primaryActionButton: createCustomFocusIndicatorStyle({\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n }),\n menuButton: createCustomFocusIndicatorStyle({\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0\n })\n});\nconst useRootStyles = makeStyles({\n // Base styles\n base: {\n display: 'inline-flex',\n justifyContent: 'stretch',\n position: 'relative',\n verticalAlign: 'middle',\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0\n },\n [`& .${splitButtonClassNames.menuButton}`]: {\n borderLeftWidth: 0,\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n minWidth: 0\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeOnBrand\n }\n },\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'HighlightText'\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight'\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'Highlight'\n }\n }\n }\n },\n secondary: {\n },\n subtle: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover\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 ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Hover\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStroke1Pressed\n }\n }\n },\n // Shape variations\n circular: {},\n rounded: {},\n square: {},\n // Disabled styles\n disabled: {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: tokens.colorNeutralStrokeDisabled\n }\n }\n },\n // Disabled high contrast styles\n disabledHighContrast: {\n '@media (forced-colors: active)': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n },\n ':hover': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n }\n },\n ':hover:active': {\n [`& .${splitButtonClassNames.primaryActionButton}`]: {\n borderRightColor: 'GrayText'\n }\n }\n }\n }\n});\nexport const useSplitButtonStyles_unstable = (state)=>{\n const rootStyles = useRootStyles();\n const focusStyles = useFocusStyles();\n const { appearance, disabled, disabledFocusable } = state;\n state.root.className = mergeClasses(splitButtonClassNames.root, rootStyles.base, appearance && rootStyles[appearance], (disabled || disabledFocusable) && rootStyles.disabled, (disabled || disabledFocusable) && rootStyles.disabledHighContrast, state.root.className);\n if (state.menuButton) {\n state.menuButton.className = mergeClasses(splitButtonClassNames.menuButton, focusStyles.menuButton, state.menuButton.className);\n }\n if (state.primaryActionButton) {\n state.primaryActionButton.className = mergeClasses(splitButtonClassNames.primaryActionButton, focusStyles.primaryActionButton, state.primaryActionButton.className);\n }\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,UAAU,EAAE,6BAA6B;EACzCC,mBAAmB,EAAE;AACzB,CAAC;AACD,MAAMC,cAAc,gBAAGR,QAAA;E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IAAI,EAAEiC,UAAU,IAAIF,UAAU,CAACE,UAAU,CAAC,EAAE,CAACR,QAAQ,IAAIS,iBAAiB,KAAKH,UAAU,CAACN,QAAQ,EAAE,CAACA,QAAQ,IAAIS,iBAAiB,KAAKH,UAAU,CAACL,oBAAoB,EAAEI,KAAK,CAACzC,IAAI,CAAC8C,SAAS,CAAC;EACxQ,IAAIL,KAAK,CAACxC,UAAU,EAAE;IAClBwC,KAAK,CAACxC,UAAU,CAAC6C,SAAS,GAAGlD,YAAY,CAACG,qBAAqB,CAACE,UAAU,EAAE0C,WAAW,CAAC1C,UAAU,EAAEwC,KAAK,CAACxC,UAAU,CAAC6C,SAAS,CAAC;EACnI;EACA,IAAIL,KAAK,CAACvC,mBAAmB,EAAE;IAC3BuC,KAAK,CAACvC,mBAAmB,CAAC4C,SAAS,GAAGlD,YAAY,CAACG,qBAAqB,CAACG,mBAAmB,EAAEyC,WAAW,CAACzC,mBAAmB,EAAEuC,KAAK,CAACvC,mBAAmB,CAAC4C,SAAS,CAAC;EACvK;EACA,OAAOL,KAAK;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["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"],"names":["React","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonStyles_unstable","useCustomStyleHook_unstable","ToggleButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACnG,MAAMC,QAAQP,yBAAyBK,OAAOC;IAE9CL,+BAA+BM;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAOR,4BAA4BQ;AACnC,0FAA0F;AAC5F,GAA6C;AAE7CJ,aAAaK,WAAW,GAAG"}
1
+ {"version":3,"sources":["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"],"names":["React","renderToggleButton_unstable","useToggleButton_unstable","useToggleButtonStyles_unstable","useCustomStyleHook_unstable","ToggleButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,2BAA2B,QAAQ,uBAAuB;AACnE,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,8BAA8B,QAAQ,iCAAiC;AAGhF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQP,yBAAyBK,OAAOC;IAE9CL,+BAA+BM;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAOR,4BAA4BQ;AACnC,0FAA0F;AAC5F,GAA6C;AAE7CJ,aAAaK,WAAW,GAAG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["useToggleButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButton_unstable } from '../Button/useButton';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToggleButton_unstable = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const buttonState = useButton_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"names":["React","useToggleState","useButton_unstable","useToggleButton_unstable","props","ref","buttonState"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAAQ,6BAA6B;AAC5D,SAASC,kBAAkB,QAAQ,sBAAsB;AAGzD;;;;;CAKC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC,MACsB;IACtB,MAAMC,cAAcJ,mBAAmBE,OAAOC;IAE9C,OAAOJ,eAAeG,OAAOE;AAC/B,EAAE"}
1
+ {"version":3,"sources":["useToggleButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { useToggleState } from '../../utils/useToggleState';\nimport { useButton_unstable } from '../Button/useButton';\nimport type { ToggleButtonProps, ToggleButtonState } from './ToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToggleButton_unstable = (\n props: ToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToggleButtonState => {\n const buttonState = useButton_unstable(props, ref);\n\n return useToggleState(props, buttonState);\n};\n"],"names":["React","useToggleState","useButton_unstable","useToggleButton_unstable","props","ref","buttonState"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,QAAQ,6BAA6B;AAC5D,SAASC,kBAAkB,QAAQ,sBAAsB;AAGzD;;;;;CAKC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC;IAEA,MAAMC,cAAcJ,mBAAmBE,OAAOC;IAE9C,OAAOJ,eAAeG,OAAOE;AAC/B,EAAE"}
@@ -1 +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":["useToggleButtonStyles.styles.js"],"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';\nexport const toggleButtonClassNames = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon'\n};\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n [`& .${iconFilledClassName}`]: {\n display: 'inline'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none'\n },\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover\n },\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed\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 ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':hover:active': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':focus': {\n ...shorthands.border('1px', 'solid', 'HighlightText'),\n outlineColor: 'Highlight'\n }\n }\n },\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed\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 ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover\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 ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed\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 ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n },\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n ':hover': {\n ...shorthands.borderColor('transparent')\n },\n ':hover:active': {\n ...shorthands.borderColor('transparent')\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\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 ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent')\n }\n }\n});\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\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 disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n ':focus': {\n ...shorthands.borderColor('GrayText')\n }\n }\n }\n});\nexport const useToggleButtonStyles_unstable = (state)=>{\n const rootCheckedStyles = useRootCheckedStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n const { appearance , checked , disabled , disabledFocusable } = state;\n state.root.className = mergeClasses(toggleButtonClassNames.root, // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, // Checked styles\n checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], // User provided class name\n state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(toggleButtonClassNames.icon, (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent && iconCheckedStyles.highContrast, state.icon.className);\n }\n useButtonStyles_unstable(state);\n return state;\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,YAAY,EAAAC,QAAA,QAAoB,gBAAgB;AACrE,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,o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AI,EAAEiF,UAAU,KAAKP,QAAQ,IAAIS,iBAAiB,CAAC,IAAIL,kBAAkB,CAACG,UAAU,CAAC;EAAE;EAC7IL,KAAK,CAAC/E,IAAI,CAACuF,SAAS,CAAC;EACrB,IAAIR,KAAK,CAAC9E,IAAI,EAAE;IACZ8E,KAAK,CAAC9E,IAAI,CAACsF,SAAS,GAAG3F,YAAY,CAACG,sBAAsB,CAACE,IAAI,EAAE,CAACmF,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,aAAa,KAAKF,iBAAiB,CAACP,mBAAmB,IAAIO,iBAAiB,CAACtD,YAAY,EAAEmD,KAAK,CAAC9E,IAAI,CAACsF,SAAS,CAAC;EAChO;EACAzF,wBAAwB,CAACiF,KAAK,CAAC;EAC/B,OAAOA,KAAK;AAChB,CAAC"}
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":["useToggleButtonStyles.styles.js"],"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';\nexport const toggleButtonClassNames = {\n root: 'fui-ToggleButton',\n icon: 'fui-ToggleButton__icon'\n};\nconst useRootCheckedStyles = makeStyles({\n // Base styles\n base: {\n backgroundColor: tokens.colorNeutralBackground1Selected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n color: tokens.colorNeutralForeground1Selected,\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n [`& .${iconFilledClassName}`]: {\n display: 'inline'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none'\n },\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n color: tokens.colorNeutralForeground1Hover\n },\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n color: tokens.colorNeutralForeground1Pressed\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 ':hover': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':hover:active': {\n backgroundColor: 'HighlightText',\n ...shorthands.borderColor('Highlight'),\n color: 'Highlight'\n },\n ':focus': {\n ...shorthands.border('1px', 'solid', 'HighlightText'),\n outlineColor: 'Highlight'\n }\n }\n },\n // Appearance variations\n outline: {\n backgroundColor: tokens.colorTransparentBackgroundSelected,\n ...shorthands.borderColor(tokens.colorNeutralStroke1),\n ...shorthands.borderWidth(tokens.strokeWidthThicker),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed\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 ':hover': {\n backgroundColor: tokens.colorBrandBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n },\n ':hover:active': {\n backgroundColor: tokens.colorBrandBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForegroundOnBrand\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Selected,\n ':hover': {\n backgroundColor: tokens.colorSubtleBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2Hover\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 ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandHover\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent'),\n color: tokens.colorNeutralForeground2BrandPressed\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 ':hover': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n },\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackgroundDisabled,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n // Appearance variations\n outline: {\n },\n primary: {\n ...shorthands.borderColor('transparent'),\n ':hover': {\n ...shorthands.borderColor('transparent')\n },\n ':hover:active': {\n ...shorthands.borderColor('transparent')\n }\n },\n secondary: {\n },\n subtle: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor('transparent'),\n ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\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 ':hover': {\n backgroundColor: tokens.colorTransparentBackgroundHover,\n ...shorthands.borderColor('transparent')\n },\n ':hover:active': {\n backgroundColor: tokens.colorTransparentBackgroundPressed,\n ...shorthands.borderColor('transparent')\n }\n }\n});\nconst useIconCheckedStyles = makeStyles({\n // Appearance variations\n subtleOrTransparent: {\n color: tokens.colorNeutralForeground2BrandSelected\n },\n // High contrast styles\n highContrast: {\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\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 disabled: {\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n color: 'GrayText',\n ':focus': {\n ...shorthands.borderColor('GrayText')\n }\n }\n }\n});\nexport const useToggleButtonStyles_unstable = (state)=>{\n const rootCheckedStyles = useRootCheckedStyles();\n const rootDisabledStyles = useRootDisabledStyles();\n const iconCheckedStyles = useIconCheckedStyles();\n const primaryHighContrastStyles = usePrimaryHighContrastStyles();\n const { appearance, checked, disabled, disabledFocusable } = state;\n state.root.className = mergeClasses(toggleButtonClassNames.root, // Primary high contrast styles\n appearance === 'primary' && primaryHighContrastStyles.base, appearance === 'primary' && (disabled || disabledFocusable) && primaryHighContrastStyles.disabled, // Checked styles\n checked && rootCheckedStyles.base, checked && rootCheckedStyles.highContrast, appearance && checked && rootCheckedStyles[appearance], // Disabled styles\n (disabled || disabledFocusable) && rootDisabledStyles.base, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], // User provided class name\n state.root.className);\n if (state.icon) {\n state.icon.className = mergeClasses(toggleButtonClassNames.icon, (appearance === 'subtle' || appearance === 'transparent') && iconCheckedStyles.subtleOrTransparent && iconCheckedStyles.highContrast, state.icon.className);\n }\n useButtonStyles_unstable(state);\n return state;\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,UAAU,EAAEC,YAAY,EAAAC,QAAA,QAAoB,gBAAgB;AACrE,SAASC,wBAAwB,QAAQ,kCAAkC;AAC3E,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE,kBAAkB;EACxBC,IAAI,EAAE;AACV,CAAC;AACD,MAAMC,oBAAoB,gBAAGL,QAAA;EAAAM,IAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,M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AAK,CAAC9E,IAAI,CAACsF,SAAS,GAAG3F,YAAY,CAACG,sBAAsB,CAACE,IAAI,EAAE,CAACmF,UAAU,KAAK,QAAQ,IAAIA,UAAU,KAAK,aAAa,KAAKF,iBAAiB,CAACP,mBAAmB,IAAIO,iBAAiB,CAACtD,YAAY,EAAEmD,KAAK,CAAC9E,IAAI,CAACsF,SAAS,CAAC;EAChO;EACAzF,wBAAwB,CAACiF,KAAK,CAAC;EAC/B,OAAOA,KAAK;AAChB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;IAMtBN;AAJtC;;;CAGC,GACD,OAAO,MAAMO,mBAAmB,IAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI,yBAAyB,CAAC"}
1
+ {"version":3,"sources":["ButtonContext.ts"],"sourcesContent":["import * as React from 'react';\nimport { ButtonSize } from '../components/Button/Button.types';\n\nconst buttonContext = React.createContext<ButtonContextValue | undefined>(undefined);\n\n/**\n * @internal\n * Internal context value used to update default values between internal components\n */\nexport interface ButtonContextValue {\n size?: ButtonSize;\n}\n\nconst buttonContextDefaultValue: ButtonContextValue = {};\n\n/**\n * @internal\n * Internal context provider used to update default values between internal components\n */\nexport const ButtonContextProvider = buttonContext.Provider;\n\n/**\n * @internal\n * Internal context hook used to update default values between internal components\n */\nexport const useButtonContext = () => React.useContext(buttonContext) ?? buttonContextDefaultValue;\n"],"names":["React","buttonContext","createContext","undefined","buttonContextDefaultValue","ButtonContextProvider","Provider","useButtonContext","useContext"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAG/B,MAAMC,gBAAgBD,MAAME,aAAa,CAAiCC;AAU1E,MAAMC,4BAAgD,CAAC;AAEvD;;;CAGC,GACD,OAAO,MAAMC,wBAAwBJ,cAAcK,QAAQ,CAAC;IAMtBN;AAJtC;;;CAGC,GACD,OAAO,MAAMO,mBAAmB,IAAMP,CAAAA,oBAAAA,MAAMQ,UAAU,CAACP,4BAAjBD,+BAAAA,oBAAmCI,0BAA0B"}
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react';
2
2
  import { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';
3
3
  export function useToggleState(props, state) {
4
- const { checked , defaultChecked , disabled , disabledFocusable } = props;
5
- const { onClick , role } = state.root;
4
+ const { checked, defaultChecked, disabled, disabledFocusable } = props;
5
+ const { onClick, role } = state.root;
6
6
  const [checkedValue, setCheckedValue] = useControllableState({
7
7
  state: checked,
8
8
  defaultState: defaultChecked,
@@ -1 +1 @@
1
- {"version":3,"sources":["useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n ev => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAInG,OAAO,SAASC,eAIdC,KAAyB,EAAEC,KAAmB,EAAsB;IACpE,MAAM,EAAEC,QAAO,EAAEC,eAAc,EAAEC,SAAQ,EAAEC,kBAAiB,EAAE,GAAGL;IACjE,MAAM,EAAEM,QAAO,EAAEC,KAAI,EAAE,GAAGN,MAAMO,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,GAAGb,qBAAqB;QAC3DI,OAAOC;QACPS,cAAcR;QACdS,cAAc,KAAK;IACrB;IAEA,MAAMC,qBAAqBN,SAAS,sBAAsBA,SAAS;IAEnE,MAAMO,gBAAgBnB,MAAMoB,WAAW,CACrCC,CAAAA,KAAM;QACJ,IAAI,CAACZ,YAAY,CAACC,mBAAmB;YACnC,IAAIW,GAAGC,gBAAgB,EAAE;gBACvB;YACF,CAAC;YAEDP,gBAAgB,CAACD;QACnB,CAAC;IACH,GACA;QAACA;QAAcL;QAAUC;QAAmBK;KAAgB;IAG9D,OAAO;QACL,GAAGT,KAAK;QAERC,SAASO;QAETD,MAAM;YACJ,GAAGP,MAAMO,IAAI;YACb,CAACK,qBAAqB,iBAAiB,cAAc,CAAC,EAAEJ;YACxDH,SAASR,iBACPF,eAAeU,SAA2EQ;QAE9F;IACF;AACF,CAAC"}
1
+ {"version":3,"sources":["useToggleState.ts"],"sourcesContent":["import * as React from 'react';\nimport { mergeCallbacks, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport type { ButtonState } from '../Button';\nimport type { ToggleButtonProps, ToggleButtonState } from '../ToggleButton';\n\nexport function useToggleState<\n TToggleButtonProps extends Pick<ToggleButtonProps, 'checked' | 'defaultChecked' | 'disabled' | 'disabledFocusable'>,\n TButtonState extends Pick<ButtonState, 'root'>,\n TToggleButtonState extends Pick<ToggleButtonState, 'checked' | 'root'>,\n>(props: TToggleButtonProps, state: TButtonState): TToggleButtonState {\n const { checked, defaultChecked, disabled, disabledFocusable } = props;\n const { onClick, role } = state.root;\n\n const [checkedValue, setCheckedValue] = useControllableState({\n state: checked,\n defaultState: defaultChecked,\n initialState: false,\n });\n\n const isCheckboxTypeRole = role === 'menuitemcheckbox' || role === 'checkbox';\n\n const onToggleClick = React.useCallback(\n ev => {\n if (!disabled && !disabledFocusable) {\n if (ev.defaultPrevented) {\n return;\n }\n\n setCheckedValue(!checkedValue);\n }\n },\n [checkedValue, disabled, disabledFocusable, setCheckedValue],\n );\n\n return {\n ...state,\n\n checked: checkedValue,\n\n root: {\n ...state.root,\n [isCheckboxTypeRole ? 'aria-checked' : 'aria-pressed']: checkedValue,\n onClick: useEventCallback(\n mergeCallbacks(onClick as React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>, onToggleClick),\n ),\n },\n } as TToggleButtonState;\n}\n"],"names":["React","mergeCallbacks","useControllableState","useEventCallback","useToggleState","props","state","checked","defaultChecked","disabled","disabledFocusable","onClick","role","root","checkedValue","setCheckedValue","defaultState","initialState","isCheckboxTypeRole","onToggleClick","useCallback","ev","defaultPrevented"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAInG,OAAO,SAASC,eAIdC,KAAyB,EAAEC,KAAmB;IAC9C,MAAM,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,iBAAiB,EAAE,GAAGL;IACjE,MAAM,EAAEM,OAAO,EAAEC,IAAI,EAAE,GAAGN,MAAMO,IAAI;IAEpC,MAAM,CAACC,cAAcC,gBAAgB,GAAGb,qBAAqB;QAC3DI,OAAOC;QACPS,cAAcR;QACdS,cAAc;IAChB;IAEA,MAAMC,qBAAqBN,SAAS,sBAAsBA,SAAS;IAEnE,MAAMO,gBAAgBnB,MAAMoB,WAAW,CACrCC,CAAAA;QACE,IAAI,CAACZ,YAAY,CAACC,mBAAmB;YACnC,IAAIW,GAAGC,gBAAgB,EAAE;gBACvB;YACF;YAEAP,gBAAgB,CAACD;QACnB;IACF,GACA;QAACA;QAAcL;QAAUC;QAAmBK;KAAgB;IAG9D,OAAO;QACL,GAAGT,KAAK;QAERC,SAASO;QAETD,MAAM;YACJ,GAAGP,MAAMO,IAAI;YACb,CAACK,qBAAqB,iBAAiB,eAAe,EAAEJ;YACxDH,SAASR,iBACPF,eAAeU,SAA2EQ;QAE9F;IACF;AACF"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/Button/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/Button/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["Button.js"],"sourcesContent":["export * from './components/Button/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["Button.js"],"sourcesContent":["export * from './components/Button/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/CompoundButton/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/CompoundButton/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["CompoundButton.js"],"sourcesContent":["export * from './components/CompoundButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["CompoundButton.js"],"sourcesContent":["export * from './components/CompoundButton/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/MenuButton/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/MenuButton/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["MenuButton.js"],"sourcesContent":["export * from './components/MenuButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["MenuButton.js"],"sourcesContent":["export * from './components/MenuButton/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/SplitButton/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/SplitButton/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["SplitButton.js"],"sourcesContent":["export * from './components/SplitButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["SplitButton.js"],"sourcesContent":["export * from './components/SplitButton/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./components/ToggleButton/index"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./components/ToggleButton/index"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["ToggleButton.js"],"sourcesContent":["export * from './components/ToggleButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
1
+ {"version":3,"sources":["ToggleButton.js"],"sourcesContent":["export * from './components/ToggleButton/index';\n"],"names":[],"mappings":";;;;;uBAAc"}
@@ -4,18 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "Button", {
6
6
  enumerable: true,
7
- get: ()=>Button
7
+ get: function() {
8
+ return Button;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _renderButton = require("./renderButton");
12
14
  const _useButton = require("./useButton");
13
- const _useButtonStylesStyles = require("./useButtonStyles.styles");
14
- const _reactSharedContexts = require("@fluentui/react-shared-contexts");
15
+ const _useButtonStylesstyles = require("./useButtonStyles.styles");
16
+ const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
15
17
  const Button = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
16
18
  const state = (0, _useButton.useButton_unstable)(props, ref);
17
- (0, _useButtonStylesStyles.useButtonStyles_unstable)(state);
18
- (0, _reactSharedContexts.useCustomStyleHook_unstable)('useButtonStyles_unstable')(state);
19
+ (0, _useButtonStylesstyles.useButtonStyles_unstable)(state);
20
+ (0, _reactsharedcontexts.useCustomStyleHook_unstable)('useButtonStyles_unstable')(state);
19
21
  return (0, _renderButton.renderButton_unstable)(state);
20
22
  // Casting is required due to lack of distributive union to support unions on @types/react
21
23
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["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 */ export 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});\nButton.displayName = 'Button';\n"],"names":["Button","React","forwardRef","props","ref","state","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","renderButton_unstable","displayName"],"mappings":";;;;+BAOiBA;;aAAAA;;;6DAPM;8BACe;2BACH;uCACM;qCACG;AAGjC,MAAMA,SAAS,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACnE,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,+CAAwB,EAACF;IACzBG,IAAAA,gDAA2B,EAAC,4BAA4BH;IACxD,OAAOI,IAAAA,mCAAqB,EAACJ;AACjC,0FAA0F;AAC1F;AACAL,OAAOU,WAAW,GAAG"}
1
+ {"version":3,"sources":["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 */ export 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});\nButton.displayName = 'Button';\n"],"names":["Button","React","forwardRef","props","ref","state","useButton_unstable","useButtonStyles_unstable","useCustomStyleHook_unstable","renderButton_unstable","displayName"],"mappings":";;;;+BAOiBA;;;eAAAA;;;;iEAPM;8BACe;2BACH;uCACM;qCACG;AAGjC,MAAMA,SAAS,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC7D,MAAMC,QAAQC,IAAAA,6BAAkB,EAACH,OAAOC;IACxCG,IAAAA,+CAAwB,EAACF;IACzBG,IAAAA,gDAA2B,EAAC,4BAA4BH;IACxD,OAAOI,IAAAA,mCAAqB,EAACJ;AACjC,0FAA0F;AAC1F;AACAL,OAAOU,WAAW,GAAG"}
@@ -9,11 +9,15 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- buttonClassNames: ()=>_useButtonStylesStyles.buttonClassNames,
13
- useButtonStyles_unstable: ()=>_useButtonStylesStyles.useButtonStyles_unstable
12
+ buttonClassNames: function() {
13
+ return _useButtonStylesstyles.buttonClassNames;
14
+ },
15
+ useButtonStyles_unstable: function() {
16
+ return _useButtonStylesstyles.useButtonStyles_unstable;
17
+ }
14
18
  });
15
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
16
- _exportStar(require("./Button"), exports);
17
- _exportStar(require("./renderButton"), exports);
18
- _exportStar(require("./useButton"), exports);
19
- const _useButtonStylesStyles = require("./useButtonStyles.styles");
19
+ const _export_star = require("@swc/helpers/_/_export_star");
20
+ _export_star._(require("./Button"), exports);
21
+ _export_star._(require("./renderButton"), exports);
22
+ _export_star._(require("./useButton"), exports);
23
+ const _useButtonStylesstyles = require("./useButtonStyles.styles");
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Button';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n"],"names":["buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAGSA,gBAAgB,MAAhBA,uCAAgB;IAAEC,wBAAwB,MAAxBA,+CAAwB;;;oBAHrC;oBACA;oBACA;uCAC6C"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './Button';\nexport * from './renderButton';\nexport * from './useButton';\nexport { buttonClassNames, useButtonStyles_unstable } from './useButtonStyles.styles';\n"],"names":["buttonClassNames","useButtonStyles_unstable"],"mappings":";;;;;;;;;;;IAGSA,gBAAgB;eAAhBA,uCAAgB;;IAAEC,wBAAwB;eAAxBA,+CAAwB;;;;uBAHrC;uBACA;uBACA;uCAC6C"}
@@ -1,15 +1,23 @@
1
- /** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
1
+ /** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ "use strict";
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  Object.defineProperty(exports, "renderButton_unstable", {
6
6
  enumerable: true,
7
- get: ()=>renderButton_unstable
7
+ get: function() {
8
+ return renderButton_unstable;
9
+ }
8
10
  });
9
- const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
10
- const _reactUtilities = require("@fluentui/react-utilities");
11
+ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
+ const _reactutilities = require("@fluentui/react-utilities");
11
13
  const renderButton_unstable = (state)=>{
12
- (0, _reactUtilities.assertSlots)(state);
13
- const { iconOnly , iconPosition } = state;
14
- return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.root, null, iconPosition !== 'after' && state.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.icon, null), !iconOnly && state.root.children, iconPosition === 'after' && state.icon && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(state.icon, null));
14
+ (0, _reactutilities.assertSlots)(state);
15
+ const { iconOnly, iconPosition } = state;
16
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
17
+ children: [
18
+ iconPosition !== 'after' && state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {}),
19
+ !iconOnly && state.root.children,
20
+ iconPosition === 'after' && state.icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.icon, {})
21
+ ]
22
+ });
15
23
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["renderButton.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */ export const renderButton_unstable = (state)=>{\n assertSlots(state);\n const { iconOnly , iconPosition } = state;\n return /*#__PURE__*/ createElement(state.root, null, iconPosition !== 'after' && state.icon && /*#__PURE__*/ createElement(state.icon, null), !iconOnly && state.root.children, iconPosition === 'after' && state.icon && /*#__PURE__*/ createElement(state.icon, null));\n};\n"],"names":["renderButton_unstable","state","assertSlots","iconOnly","iconPosition","createElement","root","icon","children"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAIjCA;;aAAAA;;iCAJkE;gCACvD;AAGjB,MAAMA,wBAAwB,CAACC,QAAQ;IAC9CC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,SAAQ,EAAGC,aAAY,EAAG,GAAGH;IACrC,OAAO,WAAW,GAAGI,IAAAA,8BAAa,EAACJ,MAAMK,IAAI,EAAE,IAAI,EAAEF,iBAAiB,WAAWH,MAAMM,IAAI,IAAI,WAAW,GAAGF,IAAAA,8BAAa,EAACJ,MAAMM,IAAI,EAAE,IAAI,GAAG,CAACJ,YAAYF,MAAMK,IAAI,CAACE,QAAQ,EAAEJ,iBAAiB,WAAWH,MAAMM,IAAI,IAAI,WAAW,GAAGF,IAAAA,8BAAa,EAACJ,MAAMM,IAAI,EAAE,IAAI;AAC1Q"}
1
+ {"version":3,"sources":["renderButton.js"],"sourcesContent":["/** @jsxRuntime automatic */ /** @jsxImportSource @fluentui/react-jsx-runtime */ import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-utilities';\n/**\n * Renders a Button component by passing the state defined props to the appropriate slots.\n */ export const renderButton_unstable = (state)=>{\n assertSlots(state);\n const { iconOnly, iconPosition } = state;\n return /*#__PURE__*/ _jsxs(state.root, {\n children: [\n iconPosition !== 'after' && state.icon && /*#__PURE__*/ _jsx(state.icon, {}),\n !iconOnly && state.root.children,\n iconPosition === 'after' && state.icon && /*#__PURE__*/ _jsx(state.icon, {})\n ]\n });\n};\n"],"names":["renderButton_unstable","state","assertSlots","iconOnly","iconPosition","_jsxs","root","children","icon","_jsx"],"mappings":"AAAA,0BAA0B,GAAG,iDAAiD;;;;+BAI7DA;;;eAAAA;;;4BAJ2G;gCAChG;AAGjB,MAAMA,wBAAwB,CAACC;IACtCC,IAAAA,2BAAW,EAACD;IACZ,MAAM,EAAEE,QAAQ,EAAEC,YAAY,EAAE,GAAGH;IACnC,OAAO,WAAW,GAAGI,IAAAA,gBAAK,EAACJ,MAAMK,IAAI,EAAE;QACnCC,UAAU;YACNH,iBAAiB,WAAWH,MAAMO,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACR,MAAMO,IAAI,EAAE,CAAC;YAC1E,CAACL,YAAYF,MAAMK,IAAI,CAACC,QAAQ;YAChCH,iBAAiB,WAAWH,MAAMO,IAAI,IAAI,WAAW,GAAGC,IAAAA,eAAI,EAACR,MAAMO,IAAI,EAAE,CAAC;SAC7E;IACL;AACJ"}
@@ -4,17 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "useButton_unstable", {
6
6
  enumerable: true,
7
- get: ()=>useButton_unstable
7
+ get: function() {
8
+ return useButton_unstable;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
- const _reactAria = require("@fluentui/react-aria");
12
- const _reactUtilities = require("@fluentui/react-utilities");
13
- const _buttonContext = require("../../contexts/ButtonContext");
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
+ const _reactaria = require("@fluentui/react-aria");
14
+ const _reactutilities = require("@fluentui/react-utilities");
15
+ const _ButtonContext = require("../../contexts/ButtonContext");
14
16
  const useButton_unstable = (props, ref)=>{
15
- const { size: contextSize } = (0, _buttonContext.useButtonContext)();
16
- const { appearance ='secondary' , as ='button' , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , shape ='rounded' , size =contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
17
- const iconShorthand = _reactUtilities.slot.optional(icon, {
17
+ var _iconShorthand;
18
+ const { size: contextSize } = (0, _ButtonContext.useButtonContext)();
19
+ const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;
20
+ const iconShorthand = _reactutilities.slot.optional(icon, {
18
21
  elementType: 'span'
19
22
  });
20
23
  return {
@@ -25,12 +28,12 @@ const useButton_unstable = (props, ref)=>{
25
28
  iconPosition,
26
29
  shape,
27
30
  size,
28
- iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),
31
+ iconOnly: Boolean(((_iconShorthand = iconShorthand) === null || _iconShorthand === void 0 ? void 0 : _iconShorthand.children) && !props.children),
29
32
  components: {
30
33
  root: 'button',
31
34
  icon: 'span'
32
35
  },
33
- root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)(as, (0, _reactAria.useARIAButtonShorthand)(props, {
36
+ root: _reactutilities.slot.always((0, _reactutilities.getNativeElementProps)(as, (0, _reactaria.useARIAButtonShorthand)(props, {
34
37
  required: true,
35
38
  defaultProps: {
36
39
  ref: ref,
@@ -1 +1 @@
1
- {"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */ export const useButton_unstable = (props, ref)=>{\n const { size: contextSize } = useButtonContext();\n const { appearance ='secondary' , as ='button' , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , shape ='rounded' , size =contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;\n const iconShorthand = slot.optional(icon, {\n elementType: 'span'\n });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !props.children),\n components: {\n root: 'button',\n icon: 'span'\n },\n root: slot.always(getNativeElementProps(as, useARIAButtonShorthand(props, {\n required: true,\n defaultProps: {\n ref: ref,\n type: 'button'\n }\n })), {\n elementType: 'button'\n }),\n icon: iconShorthand\n };\n};\n"],"names":["useButton_unstable","props","ref","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","slot","optional","elementType","iconOnly","Boolean","children","components","root","always","getNativeElementProps","useARIAButtonShorthand","required","defaultProps","type"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;2BACgB;gCACK;+BACX;AAKtB,MAAMA,qBAAqB,CAACC,OAAOC,MAAM;IAChD,MAAM,EAAEC,MAAMC,YAAW,EAAG,GAAGC,IAAAA,+BAAgB;IAC/C,MAAM,EAAEC,YAAY,YAAW,EAAGC,IAAI,SAAQ,EAAGC,UAAU,KAAK,CAAA,EAAGC,mBAAmB,KAAK,CAAA,EAAGC,KAAI,EAAGC,cAAc,SAAQ,EAAGC,OAAO,UAAS,EAAGT,MAAMC,gBAAgB,IAAI,IAAIA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,CAAA,EAAG,GAAGH;IACpO,MAAMY,gBAAgBC,oBAAI,CAACC,QAAQ,CAACL,MAAM;QACtCM,aAAa;IACjB;IACA,OAAO;QACH,gCAAgC;QAChCV;QACAE;QACAC;QACAE;QACAC;QACAT;QACAc,UAAUC,QAAQ,AAACL,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,cAAcM,QAAQ,AAAD,KAAM,CAAClB,MAAMkB,QAAQ;QAC3HC,YAAY;YACRC,MAAM;YACNX,MAAM;QACV;QACAW,MAAMP,oBAAI,CAACQ,MAAM,CAACC,IAAAA,qCAAqB,EAAChB,IAAIiB,IAAAA,iCAAsB,EAACvB,OAAO;YACtEwB,UAAU,IAAI;YACdC,cAAc;gBACVxB,KAAKA;gBACLyB,MAAM;YACV;QACJ,KAAK;YACDX,aAAa;QACjB;QACAN,MAAMG;IACV;AACJ"}
1
+ {"version":3,"sources":["useButton.js"],"sourcesContent":["import * as React from 'react';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { getNativeElementProps, slot } from '@fluentui/react-utilities';\nimport { useButtonContext } from '../../contexts/ButtonContext';\n/**\n * Given user props, defines default props for the Button, calls useButtonState, and returns processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */ export const useButton_unstable = (props, ref)=>{\n var _iconShorthand;\n const { size: contextSize } = useButtonContext();\n const { appearance = 'secondary', as = 'button', disabled = false, disabledFocusable = false, icon, iconPosition = 'before', shape = 'rounded', size = contextSize !== null && contextSize !== void 0 ? contextSize : 'medium' } = props;\n const iconShorthand = slot.optional(icon, {\n elementType: 'span'\n });\n return {\n // Props passed at the top-level\n appearance,\n disabled,\n disabledFocusable,\n iconPosition,\n shape,\n size,\n iconOnly: Boolean(((_iconShorthand = iconShorthand) === null || _iconShorthand === void 0 ? void 0 : _iconShorthand.children) && !props.children),\n components: {\n root: 'button',\n icon: 'span'\n },\n root: slot.always(getNativeElementProps(as, useARIAButtonShorthand(props, {\n required: true,\n defaultProps: {\n ref: ref,\n type: 'button'\n }\n })), {\n elementType: 'button'\n }),\n icon: iconShorthand\n };\n};\n"],"names":["useButton_unstable","props","ref","_iconShorthand","size","contextSize","useButtonContext","appearance","as","disabled","disabledFocusable","icon","iconPosition","shape","iconShorthand","slot","optional","elementType","iconOnly","Boolean","children","components","root","always","getNativeElementProps","useARIAButtonShorthand","required","defaultProps","type"],"mappings":";;;;+BAQiBA;;;eAAAA;;;;iEARM;2BACgB;gCACK;+BACX;AAKtB,MAAMA,qBAAqB,CAACC,OAAOC;IAC1C,IAAIC;IACJ,MAAM,EAAEC,MAAMC,WAAW,EAAE,GAAGC,IAAAA,+BAAgB;IAC9C,MAAM,EAAEC,aAAa,WAAW,EAAEC,KAAK,QAAQ,EAAEC,WAAW,KAAK,EAAEC,oBAAoB,KAAK,EAAEC,IAAI,EAAEC,eAAe,QAAQ,EAAEC,QAAQ,SAAS,EAAET,OAAOC,gBAAgB,QAAQA,gBAAgB,KAAK,IAAIA,cAAc,QAAQ,EAAE,GAAGJ;IACnO,MAAMa,gBAAgBC,oBAAI,CAACC,QAAQ,CAACL,MAAM;QACtCM,aAAa;IACjB;IACA,OAAO;QACH,gCAAgC;QAChCV;QACAE;QACAC;QACAE;QACAC;QACAT;QACAc,UAAUC,QAAQ,AAAC,CAAA,AAAChB,CAAAA,iBAAiBW,aAAY,MAAO,QAAQX,mBAAmB,KAAK,IAAI,KAAK,IAAIA,eAAeiB,QAAQ,AAAD,KAAM,CAACnB,MAAMmB,QAAQ;QAChJC,YAAY;YACRC,MAAM;YACNX,MAAM;QACV;QACAW,MAAMP,oBAAI,CAACQ,MAAM,CAACC,IAAAA,qCAAqB,EAAChB,IAAIiB,IAAAA,iCAAsB,EAACxB,OAAO;YACtEyB,UAAU;YACVC,cAAc;gBACVzB,KAAKA;gBACL0B,MAAM;YACV;QACJ,KAAK;YACDX,aAAa;QACjB;QACAN,MAAMG;IACV;AACJ"}
@@ -9,8 +9,12 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- buttonClassNames: ()=>buttonClassNames,
13
- useButtonStyles_unstable: ()=>useButtonStyles_unstable
12
+ buttonClassNames: function() {
13
+ return buttonClassNames;
14
+ },
15
+ useButtonStyles_unstable: function() {
16
+ return useButtonStyles_unstable;
17
+ }
14
18
  });
15
19
  const _react = require("@griffel/react");
16
20
  const buttonClassNames = {
@@ -23,7 +27,7 @@ const buttonSpacingSmallWithIcon = '1px';
23
27
  const buttonSpacingMedium = '5px';
24
28
  const buttonSpacingLarge = '8px';
25
29
  const buttonSpacingLargeWithIcon = '7px';
26
- const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rlr4yyk", "r1hbzg6e", {
30
+ const useRootBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rlr4yyk", "r1hbzg6e", {
27
31
  r: [
28
32
  ".rlr4yyk{align-items:center;box-sizing:border-box;display:inline-flex;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);}",
29
33
  ".rlr4yyk:hover{background-color:var(--colorNeutralBackground1Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground1Hover);cursor:pointer;}",
@@ -41,10 +45,10 @@ const useRootBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rlr4yyk
41
45
  "@media (forced-colors: active){.r1hbzg6e:focus{border-color:ButtonText;}.r1hbzg6e:hover{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}.r1hbzg6e:hover:active{background-color:HighlightText;border-color:Highlight;color:Highlight;forced-color-adjust:none;}}"
42
46
  ]
43
47
  });
44
- const useIconBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("rywnvv2", null, [
48
+ const useIconBaseClassName = /*#__PURE__*/ (0, _react.__resetStyles)("rywnvv2", null, [
45
49
  ".rywnvv2{align-items:center;display:inline-flex;justify-content:center;font-size:20px;height:20px;width:20px;--fui-Button__icon--spacing:var(--spacingHorizontalSNudge);}"
46
50
  ]);
47
- const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
51
+ const useRootStyles = /*#__PURE__*/ (0, _react.__styles)({
48
52
  outline: {
49
53
  De3pzq: "f1c21dwh",
50
54
  Jwef8y: "fjxutwb",
@@ -593,7 +597,7 @@ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
593
597
  ]
594
598
  ]
595
599
  });
596
- const useRootDisabledStyles = /*#__PURE__*/ (0, _react["__styles"])({
600
+ const useRootDisabledStyles = /*#__PURE__*/ (0, _react.__styles)({
597
601
  base: {
598
602
  De3pzq: "f1bg9a2p",
599
603
  g2u3we: "f1jj8ep1",
@@ -951,7 +955,7 @@ const useRootDisabledStyles = /*#__PURE__*/ (0, _react["__styles"])({
951
955
  ]
952
956
  ]
953
957
  });
954
- const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
958
+ const useRootFocusStyles = /*#__PURE__*/ (0, _react.__styles)({
955
959
  circular: {
956
960
  kdpuga: [
957
961
  "fanj13w",
@@ -1064,7 +1068,7 @@ const useRootFocusStyles = /*#__PURE__*/ (0, _react["__styles"])({
1064
1068
  ".fakimq4[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusLarge);}"
1065
1069
  ]
1066
1070
  });
1067
- const useRootIconOnlyStyles = /*#__PURE__*/ (0, _react["__styles"])({
1071
+ const useRootIconOnlyStyles = /*#__PURE__*/ (0, _react.__styles)({
1068
1072
  small: {
1069
1073
  z8tnut: "f1sl3k7w",
1070
1074
  z189sj: [
@@ -1129,7 +1133,7 @@ const useRootIconOnlyStyles = /*#__PURE__*/ (0, _react["__styles"])({
1129
1133
  ".fjy1crr{max-width:40px;}"
1130
1134
  ]
1131
1135
  });
1132
- const useIconStyles = /*#__PURE__*/ (0, _react["__styles"])({
1136
+ const useIconStyles = /*#__PURE__*/ (0, _react.__styles)({
1133
1137
  small: {
1134
1138
  Be2twd7: "fe5j1ua",
1135
1139
  Bqenvij: "fjamq6b",
@@ -1177,7 +1181,7 @@ const useButtonStyles_unstable = (state)=>{
1177
1181
  const rootFocusStyles = useRootFocusStyles();
1178
1182
  const rootIconOnlyStyles = useRootIconOnlyStyles();
1179
1183
  const iconStyles = useIconStyles();
1180
- const { appearance , disabled , disabledFocusable , icon , iconOnly , iconPosition , shape , size } = state;
1184
+ const { appearance, disabled, disabledFocusable, icon, iconOnly, iconPosition, shape, size } = state;
1181
1185
  state.root.className = (0, _react.mergeClasses)(buttonClassNames.root, rootBaseClassName, appearance && rootStyles[appearance], rootStyles[size], icon && size === 'small' && rootStyles.smallWithIcon, icon && size === 'large' && rootStyles.largeWithIcon, rootStyles[shape], // Disabled styles
1182
1186
  (disabled || disabledFocusable) && rootDisabledStyles.base, (disabled || disabledFocusable) && rootDisabledStyles.highContrast, appearance && (disabled || disabledFocusable) && rootDisabledStyles[appearance], // Focus styles
1183
1187
  appearance === 'primary' && rootFocusStyles.primary, rootFocusStyles[size], rootFocusStyles[shape], // Icon-only styles