@fluentui/react-button 9.1.8 → 9.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. package/CHANGELOG.json +36 -1
  2. package/CHANGELOG.md +13 -2
  3. package/lib/Button.js.map +1 -1
  4. package/lib/CompoundButton.js.map +1 -1
  5. package/lib/MenuButton.js.map +1 -1
  6. package/lib/SplitButton.js.map +1 -1
  7. package/lib/ToggleButton.js.map +1 -1
  8. package/lib/components/Button/Button.js.map +1 -1
  9. package/lib/components/Button/Button.types.js.map +1 -1
  10. package/lib/components/Button/index.js.map +1 -1
  11. package/lib/components/Button/renderButton.js.map +1 -1
  12. package/lib/components/Button/useButton.js.map +1 -1
  13. package/lib/components/Button/useButtonStyles.js.map +1 -1
  14. package/lib/components/CompoundButton/CompoundButton.js.map +1 -1
  15. package/lib/components/CompoundButton/CompoundButton.types.js.map +1 -1
  16. package/lib/components/CompoundButton/index.js.map +1 -1
  17. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  18. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  19. package/lib/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  20. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  21. package/lib/components/MenuButton/MenuButton.types.js.map +1 -1
  22. package/lib/components/MenuButton/index.js.map +1 -1
  23. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  24. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  25. package/lib/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  26. package/lib/components/SplitButton/SplitButton.js.map +1 -1
  27. package/lib/components/SplitButton/SplitButton.types.js.map +1 -1
  28. package/lib/components/SplitButton/index.js.map +1 -1
  29. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  30. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  31. package/lib/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  32. package/lib/components/ToggleButton/ToggleButton.js.map +1 -1
  33. package/lib/components/ToggleButton/ToggleButton.types.js.map +1 -1
  34. package/lib/components/ToggleButton/index.js.map +1 -1
  35. package/lib/components/ToggleButton/renderToggleButton.js.map +1 -1
  36. package/lib/components/ToggleButton/useToggleButton.js.map +1 -1
  37. package/lib/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  38. package/lib/index.js.map +1 -1
  39. package/lib/utils/index.js.map +1 -1
  40. package/lib/utils/useToggleState.js.map +1 -1
  41. package/lib-amd/Button.js +6 -0
  42. package/lib-amd/Button.js.map +1 -0
  43. package/lib-amd/CompoundButton.js +6 -0
  44. package/lib-amd/CompoundButton.js.map +1 -0
  45. package/lib-amd/MenuButton.js +6 -0
  46. package/lib-amd/MenuButton.js.map +1 -0
  47. package/lib-amd/SplitButton.js +6 -0
  48. package/lib-amd/SplitButton.js.map +1 -0
  49. package/lib-amd/ToggleButton.js +6 -0
  50. package/lib-amd/ToggleButton.js.map +1 -0
  51. package/lib-amd/components/Button/Button.js +16 -0
  52. package/lib-amd/components/Button/Button.js.map +1 -0
  53. package/lib-amd/components/Button/Button.types.js +5 -0
  54. package/lib-amd/components/Button/Button.types.js.map +1 -0
  55. package/lib-amd/components/Button/index.js +11 -0
  56. package/lib-amd/components/Button/index.js.map +1 -0
  57. package/lib-amd/components/Button/renderButton.js +18 -0
  58. package/lib-amd/components/Button/renderButton.js.map +1 -0
  59. package/lib-amd/components/Button/useButton.js +40 -0
  60. package/lib-amd/components/Button/useButton.js.map +1 -0
  61. package/lib-amd/components/Button/useButtonStyles.js +187 -0
  62. package/lib-amd/components/Button/useButtonStyles.js.map +1 -0
  63. package/lib-amd/components/CompoundButton/CompoundButton.js +16 -0
  64. package/lib-amd/components/CompoundButton/CompoundButton.js.map +1 -0
  65. package/lib-amd/components/CompoundButton/CompoundButton.types.js +5 -0
  66. package/lib-amd/components/CompoundButton/CompoundButton.types.js.map +1 -0
  67. package/lib-amd/components/CompoundButton/index.js +12 -0
  68. package/lib-amd/components/CompoundButton/index.js.map +1 -0
  69. package/lib-amd/components/CompoundButton/renderCompoundButton.js +20 -0
  70. package/lib-amd/components/CompoundButton/renderCompoundButton.js.map +1 -0
  71. package/lib-amd/components/CompoundButton/useCompoundButton.js +27 -0
  72. package/lib-amd/components/CompoundButton/useCompoundButton.js.map +1 -0
  73. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js +211 -0
  74. package/lib-amd/components/CompoundButton/useCompoundButtonStyles.js.map +1 -0
  75. package/lib-amd/components/MenuButton/MenuButton.js +17 -0
  76. package/lib-amd/components/MenuButton/MenuButton.js.map +1 -0
  77. package/lib-amd/components/MenuButton/MenuButton.types.js +5 -0
  78. package/lib-amd/components/MenuButton/MenuButton.types.js.map +1 -0
  79. package/lib-amd/components/MenuButton/index.js +12 -0
  80. package/lib-amd/components/MenuButton/index.js.map +1 -0
  81. package/lib-amd/components/MenuButton/renderMenuButton.js +18 -0
  82. package/lib-amd/components/MenuButton/renderMenuButton.js.map +1 -0
  83. package/lib-amd/components/MenuButton/useMenuButton.js +30 -0
  84. package/lib-amd/components/MenuButton/useMenuButton.js.map +1 -0
  85. package/lib-amd/components/MenuButton/useMenuButtonStyles.js +97 -0
  86. package/lib-amd/components/MenuButton/useMenuButtonStyles.js.map +1 -0
  87. package/lib-amd/components/SplitButton/SplitButton.js +17 -0
  88. package/lib-amd/components/SplitButton/SplitButton.js.map +1 -0
  89. package/lib-amd/components/SplitButton/SplitButton.types.js +5 -0
  90. package/lib-amd/components/SplitButton/SplitButton.types.js.map +1 -0
  91. package/lib-amd/components/SplitButton/index.js +12 -0
  92. package/lib-amd/components/SplitButton/index.js.map +1 -0
  93. package/lib-amd/components/SplitButton/renderSplitButton.js +16 -0
  94. package/lib-amd/components/SplitButton/renderSplitButton.js.map +1 -0
  95. package/lib-amd/components/SplitButton/useSplitButton.js +67 -0
  96. package/lib-amd/components/SplitButton/useSplitButton.js.map +1 -0
  97. package/lib-amd/components/SplitButton/useSplitButtonStyles.js +147 -0
  98. package/lib-amd/components/SplitButton/useSplitButtonStyles.js.map +1 -0
  99. package/lib-amd/components/ToggleButton/ToggleButton.js +16 -0
  100. package/lib-amd/components/ToggleButton/ToggleButton.js.map +1 -0
  101. package/lib-amd/components/ToggleButton/ToggleButton.types.js +5 -0
  102. package/lib-amd/components/ToggleButton/ToggleButton.types.js.map +1 -0
  103. package/lib-amd/components/ToggleButton/index.js +12 -0
  104. package/lib-amd/components/ToggleButton/index.js.map +1 -0
  105. package/lib-amd/components/ToggleButton/renderToggleButton.js +7 -0
  106. package/lib-amd/components/ToggleButton/renderToggleButton.js.map +1 -0
  107. package/lib-amd/components/ToggleButton/useToggleButton.js +17 -0
  108. package/lib-amd/components/ToggleButton/useToggleButton.js.map +1 -0
  109. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js +75 -0
  110. package/lib-amd/components/ToggleButton/useToggleButtonStyles.js.map +1 -0
  111. package/lib-amd/index.js +32 -0
  112. package/lib-amd/index.js.map +1 -0
  113. package/lib-amd/utils/index.js +6 -0
  114. package/lib-amd/utils/index.js.map +1 -0
  115. package/lib-amd/utils/useToggleState.js +27 -0
  116. package/lib-amd/utils/useToggleState.js.map +1 -0
  117. package/lib-commonjs/Button.js.map +1 -1
  118. package/lib-commonjs/CompoundButton.js.map +1 -1
  119. package/lib-commonjs/MenuButton.js.map +1 -1
  120. package/lib-commonjs/SplitButton.js.map +1 -1
  121. package/lib-commonjs/ToggleButton.js.map +1 -1
  122. package/lib-commonjs/components/Button/Button.js.map +1 -1
  123. package/lib-commonjs/components/Button/index.js.map +1 -1
  124. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  125. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  126. package/lib-commonjs/components/Button/useButtonStyles.js.map +1 -1
  127. package/lib-commonjs/components/CompoundButton/CompoundButton.js.map +1 -1
  128. package/lib-commonjs/components/CompoundButton/index.js.map +1 -1
  129. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  130. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  131. package/lib-commonjs/components/CompoundButton/useCompoundButtonStyles.js.map +1 -1
  132. package/lib-commonjs/components/MenuButton/MenuButton.js.map +1 -1
  133. package/lib-commonjs/components/MenuButton/index.js.map +1 -1
  134. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  135. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  136. package/lib-commonjs/components/MenuButton/useMenuButtonStyles.js.map +1 -1
  137. package/lib-commonjs/components/SplitButton/SplitButton.js.map +1 -1
  138. package/lib-commonjs/components/SplitButton/index.js.map +1 -1
  139. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  140. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  141. package/lib-commonjs/components/SplitButton/useSplitButtonStyles.js.map +1 -1
  142. package/lib-commonjs/components/ToggleButton/ToggleButton.js.map +1 -1
  143. package/lib-commonjs/components/ToggleButton/index.js.map +1 -1
  144. package/lib-commonjs/components/ToggleButton/renderToggleButton.js.map +1 -1
  145. package/lib-commonjs/components/ToggleButton/useToggleButton.js.map +1 -1
  146. package/lib-commonjs/components/ToggleButton/useToggleButtonStyles.js.map +1 -1
  147. package/lib-commonjs/index.js.map +1 -1
  148. package/lib-commonjs/utils/index.js.map +1 -1
  149. package/lib-commonjs/utils/useToggleState.js.map +1 -1
  150. package/package.json +6 -7
@@ -1 +1 @@
1
- {"version":3,"sources":["utils/useToggleState.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAIA,SAAgB,cAAhB,CAIE,KAJF,EAI6B,KAJ7B,EAIgD;EAC9C,MAAM;IAAE,OAAF;IAAW,cAAX;IAA2B,QAA3B;IAAqC;EAArC,IAA2D,KAAjE;EACA,MAAM;IAAE,OAAF;IAAW;EAAX,IAAoB,KAAK,CAAC,IAAhC;EAEA,MAAM,CAAC,YAAD,EAAe,eAAf,IAAkC,iBAAA,CAAA,oBAAA,CAAqB;IAC3D,KAAK,EAAE,OADoD;IAE3D,YAAY,EAAE,cAF6C;IAG3D,YAAY,EAAE;EAH6C,CAArB,CAAxC;EAMA,MAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;EAEA,MAAM,aAAa,GAAG,KAAK,CAAC,WAAN,CACpB,EAAE,IAAG;IACH,IAAI,CAAC,QAAD,IAAa,CAAC,iBAAlB,EAAqC;MACnC,IAAI,EAAE,CAAC,gBAAP,EAAyB;QACvB;MACD;;MAED,eAAe,CAAC,CAAC,YAAF,CAAf;IACD;EACF,CATmB,EAUpB,CAAC,YAAD,EAAe,QAAf,EAAyB,iBAAzB,EAA4C,eAA5C,CAVoB,CAAtB;EAaA,OAAO,EACL,GAAG,KADE;IAGL,OAAO,EAAE,YAHJ;IAKL,IAAI,EAAE,EACJ,GAAG,KAAK,CAAC,IADL;MAEJ,CAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,GAAwD,YAFpD;MAGJ,OAAO,EAAE,iBAAA,CAAA,gBAAA,CACP,iBAAA,CAAA,cAAA,CAAe,OAAf,EAA0F,aAA1F,CADO;IAHL;EALD,CAAP;AAaD;;AA1CD,OAAA,CAAA,cAAA,GAAA,cAAA","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-button/src/utils/useToggleState.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAIA,SAAgB,cAAhB,CAIE,KAJF,EAI6B,KAJ7B,EAIgD;EAC9C,MAAM;IAAE,OAAF;IAAW,cAAX;IAA2B,QAA3B;IAAqC;EAArC,IAA2D,KAAjE;EACA,MAAM;IAAE,OAAF;IAAW;EAAX,IAAoB,KAAK,CAAC,IAAhC;EAEA,MAAM,CAAC,YAAD,EAAe,eAAf,IAAkC,iBAAA,CAAA,oBAAA,CAAqB;IAC3D,KAAK,EAAE,OADoD;IAE3D,YAAY,EAAE,cAF6C;IAG3D,YAAY,EAAE;EAH6C,CAArB,CAAxC;EAMA,MAAM,kBAAkB,GAAG,IAAI,KAAK,kBAAT,IAA+B,IAAI,KAAK,UAAnE;EAEA,MAAM,aAAa,GAAG,KAAK,CAAC,WAAN,CACpB,EAAE,IAAG;IACH,IAAI,CAAC,QAAD,IAAa,CAAC,iBAAlB,EAAqC;MACnC,IAAI,EAAE,CAAC,gBAAP,EAAyB;QACvB;MACD;;MAED,eAAe,CAAC,CAAC,YAAF,CAAf;IACD;EACF,CATmB,EAUpB,CAAC,YAAD,EAAe,QAAf,EAAyB,iBAAzB,EAA4C,eAA5C,CAVoB,CAAtB;EAaA,OAAO,EACL,GAAG,KADE;IAGL,OAAO,EAAE,YAHJ;IAKL,IAAI,EAAE,EACJ,GAAG,KAAK,CAAC,IADL;MAEJ,CAAC,kBAAkB,GAAG,cAAH,GAAoB,cAAvC,GAAwD,YAFpD;MAGJ,OAAO,EAAE,iBAAA,CAAA,gBAAA,CACP,iBAAA,CAAA,cAAA,CAAe,OAAf,EAA0F,aAA1F,CADO;IAHL;EALD,CAAP;AAaD;;AA1CD,OAAA,CAAA,cAAA,GAAA,cAAA","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"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "9.1.8",
3
+ "version": "9.1.9",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -20,10 +20,9 @@
20
20
  "lint": "just-scripts lint",
21
21
  "start": "yarn storybook",
22
22
  "test": "jest --passWithNoTests",
23
- "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-button/src && yarn docs",
25
23
  "storybook": "start-storybook",
26
- "type-check": "tsc -b tsconfig.json"
24
+ "type-check": "tsc -b tsconfig.json",
25
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
27
26
  },
28
27
  "devDependencies": {
29
28
  "@fluentui/a11y-testing": "^0.1.0",
@@ -34,11 +33,11 @@
34
33
  },
35
34
  "dependencies": {
36
35
  "@fluentui/keyboard-keys": "^9.0.1",
37
- "@fluentui/react-aria": "^9.3.1",
36
+ "@fluentui/react-aria": "^9.3.2",
38
37
  "@fluentui/react-icons": "^2.0.175",
39
- "@fluentui/react-tabster": "^9.3.0",
38
+ "@fluentui/react-tabster": "^9.3.1",
40
39
  "@fluentui/react-theme": "^9.1.2",
41
- "@fluentui/react-utilities": "^9.2.1",
40
+ "@fluentui/react-utilities": "^9.2.2",
42
41
  "@griffel/react": "^1.4.2",
43
42
  "tslib": "^2.1.0"
44
43
  },