@fluentui/react-button 0.0.0-nightly-20230804-0415.1 → 0.0.0-nightly-20230808-0415.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/CHANGELOG.json +66 -21
  2. package/CHANGELOG.md +27 -13
  3. package/lib/components/Button/renderButton.js +3 -3
  4. package/lib/components/Button/renderButton.js.map +1 -1
  5. package/lib/components/Button/useButton.js +8 -6
  6. package/lib/components/Button/useButton.js.map +1 -1
  7. package/lib/components/Button/useButtonStyles.styles.js +1 -1
  8. package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
  9. package/lib/components/CompoundButton/renderCompoundButton.js +3 -3
  10. package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
  11. package/lib/components/CompoundButton/useCompoundButton.js +6 -4
  12. package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
  13. package/lib/components/MenuButton/renderMenuButton.js +3 -3
  14. package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
  15. package/lib/components/MenuButton/useMenuButton.js +4 -3
  16. package/lib/components/MenuButton/useMenuButton.js.map +1 -1
  17. package/lib/components/SplitButton/renderSplitButton.js +3 -3
  18. package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
  19. package/lib/components/SplitButton/useSplitButton.js +11 -9
  20. package/lib/components/SplitButton/useSplitButton.js.map +1 -1
  21. package/lib-commonjs/components/Button/renderButton.js +2 -2
  22. package/lib-commonjs/components/Button/renderButton.js.map +1 -1
  23. package/lib-commonjs/components/Button/useButton.js +7 -5
  24. package/lib-commonjs/components/Button/useButton.js.map +1 -1
  25. package/lib-commonjs/components/Button/useButtonStyles.styles.js +1 -1
  26. package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
  27. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +2 -2
  28. package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
  29. package/lib-commonjs/components/CompoundButton/useCompoundButton.js +5 -3
  30. package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
  31. package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -2
  32. package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
  33. package/lib-commonjs/components/MenuButton/useMenuButton.js +3 -2
  34. package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
  35. package/lib-commonjs/components/SplitButton/renderSplitButton.js +2 -2
  36. package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
  37. package/lib-commonjs/components/SplitButton/useSplitButton.js +10 -8
  38. package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
  39. package/package.json +10 -10
@@ -14,7 +14,7 @@ const _menuButton = require("../MenuButton/MenuButton");
14
14
  const useSplitButton_unstable = (props, ref)=>{
15
15
  const { appearance ='secondary' , children , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , menuButton , menuIcon , primaryActionButton , shape ='rounded' , size ='medium' } = props;
16
16
  const baseId = (0, _reactUtilities.useId)('splitButton-');
17
- const menuButtonShorthand = (0, _reactUtilities.resolveShorthand)(menuButton, {
17
+ const menuButtonShorthand = _reactUtilities.slot.optional(menuButton, {
18
18
  defaultProps: {
19
19
  appearance,
20
20
  disabled,
@@ -23,9 +23,10 @@ const useSplitButton_unstable = (props, ref)=>{
23
23
  shape,
24
24
  size
25
25
  },
26
- required: true
26
+ renderByDefault: true,
27
+ elementType: _menuButton.MenuButton
27
28
  });
28
- const primaryActionButtonShorthand = (0, _reactUtilities.resolveShorthand)(primaryActionButton, {
29
+ const primaryActionButtonShorthand = _reactUtilities.slot.optional(primaryActionButton, {
29
30
  defaultProps: {
30
31
  appearance,
31
32
  children,
@@ -37,9 +38,9 @@ const useSplitButton_unstable = (props, ref)=>{
37
38
  shape,
38
39
  size
39
40
  },
40
- required: true
41
- });
42
- // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
41
+ renderByDefault: true,
42
+ elementType: _button.Button
43
+ }); // Resolve menu button's aria-labelledby to be labelled by the primary action button if not a label was not provided
43
44
  // by the user.
44
45
  if (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {
45
46
  menuButtonShorthand['aria-labelledby'] = primaryActionButtonShorthand.id;
@@ -52,15 +53,16 @@ const useSplitButton_unstable = (props, ref)=>{
52
53
  iconPosition,
53
54
  shape,
54
55
  size,
55
- // Slots definition
56
56
  components: {
57
57
  root: 'div',
58
58
  menuButton: _menuButton.MenuButton,
59
59
  primaryActionButton: _button.Button
60
60
  },
61
- root: (0, _reactUtilities.getNativeElementProps)('div', {
61
+ root: _reactUtilities.slot.always((0, _reactUtilities.getNativeElementProps)('div', {
62
62
  ref,
63
63
  ...props
64
+ }), {
65
+ elementType: 'div'
64
66
  }),
65
67
  menuButton: menuButtonShorthand,
66
68
  primaryActionButton: primaryActionButtonShorthand
@@ -1 +1 @@
1
- {"version":3,"sources":["useSplitButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\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 */ export const useSplitButton_unstable = (props, ref)=>{\n const { appearance ='secondary' , children , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , menuButton , menuIcon , primaryActionButton , shape ='rounded' , size ='medium' } = props;\n const baseId = useId('splitButton-');\n const menuButtonShorthand = resolveShorthand(menuButton, {\n defaultProps: {\n appearance,\n disabled,\n disabledFocusable,\n menuIcon,\n shape,\n size\n },\n required: true\n });\n const primaryActionButtonShorthand = resolveShorthand(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 required: true\n });\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 (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {\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,\n // Slots definition\n components: {\n root: 'div',\n menuButton: MenuButton,\n primaryActionButton: Button\n },\n root: getNativeElementProps('div', {\n ref,\n ...props\n }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand\n };\n};\n"],"names":["useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","useId","menuButtonShorthand","resolveShorthand","defaultProps","required","primaryActionButtonShorthand","id","components","root","MenuButton","Button","getNativeElementProps"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;gCACwC;wBACxC;4BACI;AAKhB,MAAMA,0BAA0B,CAACC,OAAOC,MAAM;IACrD,MAAM,EAAEC,YAAY,YAAW,EAAGC,SAAQ,EAAGC,UAAU,KAAK,CAAA,EAAGC,mBAAmB,KAAK,CAAA,EAAGC,KAAI,EAAGC,cAAc,SAAQ,EAAGC,WAAU,EAAGC,SAAQ,EAAGC,oBAAmB,EAAGC,OAAO,UAAS,EAAGC,MAAM,SAAQ,EAAG,GAAGZ;IAC/M,MAAMa,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMC,sBAAsBC,IAAAA,gCAAgB,EAACR,YAAY;QACrDS,cAAc;YACVf;YACAE;YACAC;YACAI;YACAE;YACAC;QACJ;QACAM,UAAU,IAAI;IAClB;IACA,MAAMC,+BAA+BH,IAAAA,gCAAgB,EAACN,qBAAqB;QACvEO,cAAc;YACVf;YACAC;YACAC;YACAC;YACAC;YACAC;YACAa,IAAIP,SAAS;YACbF;YACAC;QACJ;QACAM,UAAU,IAAI;IAClB;IACA,oHAAoH;IACpH,eAAe;IACf,IAAIH,uBAAuBI,gCAAgC,CAACJ,mBAAmB,CAAC,aAAa,IAAI,CAACA,mBAAmB,CAAC,kBAAkB,EAAE;QACtIA,mBAAmB,CAAC,kBAAkB,GAAGI,6BAA6BC,EAAE;IAC5E,CAAC;IACD,OAAO;QACH,gCAAgC;QAChClB;QACAE;QACAC;QACAE;QACAI;QACAC;QACA,mBAAmB;QACnBS,YAAY;YACRC,MAAM;YACNd,YAAYe,sBAAU;YACtBb,qBAAqBc,cAAM;QAC/B;QACAF,MAAMG,IAAAA,qCAAqB,EAAC,OAAO;YAC/BxB;YACA,GAAGD,KAAK;QACZ;QACAQ,YAAYO;QACZL,qBAAqBS;IACzB;AACJ"}
1
+ {"version":3,"sources":["useSplitButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId, slot } from '@fluentui/react-utilities';\nimport { Button } from '../Button/Button';\nimport { MenuButton } from '../MenuButton/MenuButton';\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 */ export const useSplitButton_unstable = (props, ref)=>{\n const { appearance ='secondary' , children , disabled =false , disabledFocusable =false , icon , iconPosition ='before' , menuButton , menuIcon , primaryActionButton , shape ='rounded' , size ='medium' } = props;\n const baseId = useId('splitButton-');\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 (menuButtonShorthand && primaryActionButtonShorthand && !menuButtonShorthand['aria-label'] && !menuButtonShorthand['aria-labelledby']) {\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,\n components: {\n root: 'div',\n menuButton: MenuButton,\n primaryActionButton: Button\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n ...props\n }), {\n elementType: 'div'\n }),\n menuButton: menuButtonShorthand,\n primaryActionButton: primaryActionButtonShorthand\n };\n};\n"],"names":["useSplitButton_unstable","props","ref","appearance","children","disabled","disabledFocusable","icon","iconPosition","menuButton","menuIcon","primaryActionButton","shape","size","baseId","useId","menuButtonShorthand","slot","optional","defaultProps","renderByDefault","elementType","MenuButton","primaryActionButtonShorthand","id","Button","components","root","always","getNativeElementProps"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;gCAC4B;wBAC5B;4BACI;AAKhB,MAAMA,0BAA0B,CAACC,OAAOC,MAAM;IACrD,MAAM,EAAEC,YAAY,YAAW,EAAGC,SAAQ,EAAGC,UAAU,KAAK,CAAA,EAAGC,mBAAmB,KAAK,CAAA,EAAGC,KAAI,EAAGC,cAAc,SAAQ,EAAGC,WAAU,EAAGC,SAAQ,EAAGC,oBAAmB,EAAGC,OAAO,UAAS,EAAGC,MAAM,SAAQ,EAAG,GAAGZ;IAC/M,MAAMa,SAASC,IAAAA,qBAAK,EAAC;IACrB,MAAMC,sBAAsBC,oBAAI,CAACC,QAAQ,CAACT,YAAY;QAClDU,cAAc;YACVhB;YACAE;YACAC;YACAI;YACAE;YACAC;QACJ;QACAO,iBAAiB,IAAI;QACrBC,aAAaC,sBAAU;IAC3B;IACA,MAAMC,+BAA+BN,oBAAI,CAACC,QAAQ,CAACP,qBAAqB;QACpEQ,cAAc;YACVhB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAgB,IAAIV,SAAS;YACbF;YACAC;QACJ;QACAO,iBAAiB,IAAI;QACrBC,aAAaI,cAAM;IACvB,IAAI,oHAAoH;IACxH,eAAe;IACf,IAAIT,uBAAuBO,gCAAgC,CAACP,mBAAmB,CAAC,aAAa,IAAI,CAACA,mBAAmB,CAAC,kBAAkB,EAAE;QACtIA,mBAAmB,CAAC,kBAAkB,GAAGO,6BAA6BC,EAAE;IAC5E,CAAC;IACD,OAAO;QACH,gCAAgC;QAChCrB;QACAE;QACAC;QACAE;QACAI;QACAC;QACAa,YAAY;YACRC,MAAM;YACNlB,YAAYa,sBAAU;YACtBX,qBAAqBc,cAAM;QAC/B;QACAE,MAAMV,oBAAI,CAACW,MAAM,CAACC,IAAAA,qCAAqB,EAAC,OAAO;YAC3C3B;YACA,GAAGD,KAAK;QACZ,IAAI;YACAoB,aAAa;QACjB;QACAZ,YAAYO;QACZL,qBAAqBY;IACzB;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-button",
3
- "version": "0.0.0-nightly-20230804-0415.1",
3
+ "version": "0.0.0-nightly-20230808-0415.1",
4
4
  "description": "Fluent UI React Button component.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -28,20 +28,20 @@
28
28
  "devDependencies": {
29
29
  "@fluentui/a11y-testing": "*",
30
30
  "@fluentui/eslint-plugin": "*",
31
- "@fluentui/react-conformance": "0.0.0-nightly-20230804-0415.1",
32
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230804-0415.1",
31
+ "@fluentui/react-conformance": "0.0.0-nightly-20230808-0415.1",
32
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230808-0415.1",
33
33
  "@fluentui/scripts-api-extractor": "*",
34
34
  "@fluentui/scripts-tasks": "*"
35
35
  },
36
36
  "dependencies": {
37
- "@fluentui/keyboard-keys": "0.0.0-nightly-20230804-0415.1",
38
- "@fluentui/react-aria": "0.0.0-nightly-20230804-0415.1",
37
+ "@fluentui/keyboard-keys": "0.0.0-nightly-20230808-0415.1",
38
+ "@fluentui/react-aria": "0.0.0-nightly-20230808-0415.1",
39
39
  "@fluentui/react-icons": "^2.0.207",
40
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230804-0415.1",
41
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20230804-0415.1",
42
- "@fluentui/react-tabster": "0.0.0-nightly-20230804-0415.1",
43
- "@fluentui/react-theme": "0.0.0-nightly-20230804-0415.1",
44
- "@fluentui/react-utilities": "0.0.0-nightly-20230804-0415.1",
40
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20230808-0415.1",
41
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20230808-0415.1",
42
+ "@fluentui/react-tabster": "0.0.0-nightly-20230808-0415.1",
43
+ "@fluentui/react-theme": "0.0.0-nightly-20230808-0415.1",
44
+ "@fluentui/react-utilities": "0.0.0-nightly-20230808-0415.1",
45
45
  "@griffel/react": "^1.5.7",
46
46
  "@swc/helpers": "^0.4.14"
47
47
  },