@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.
- package/CHANGELOG.json +66 -21
- package/CHANGELOG.md +27 -13
- package/lib/components/Button/renderButton.js +3 -3
- package/lib/components/Button/renderButton.js.map +1 -1
- package/lib/components/Button/useButton.js +8 -6
- package/lib/components/Button/useButton.js.map +1 -1
- package/lib/components/Button/useButtonStyles.styles.js +1 -1
- package/lib/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib/components/CompoundButton/renderCompoundButton.js +3 -3
- package/lib/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib/components/CompoundButton/useCompoundButton.js +6 -4
- package/lib/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib/components/MenuButton/renderMenuButton.js +3 -3
- package/lib/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib/components/MenuButton/useMenuButton.js +4 -3
- package/lib/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib/components/SplitButton/renderSplitButton.js +3 -3
- package/lib/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib/components/SplitButton/useSplitButton.js +11 -9
- package/lib/components/SplitButton/useSplitButton.js.map +1 -1
- package/lib-commonjs/components/Button/renderButton.js +2 -2
- package/lib-commonjs/components/Button/renderButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButton.js +7 -5
- package/lib-commonjs/components/Button/useButton.js.map +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.js +1 -1
- package/lib-commonjs/components/Button/useButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js +2 -2
- package/lib-commonjs/components/CompoundButton/renderCompoundButton.js.map +1 -1
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js +5 -3
- package/lib-commonjs/components/CompoundButton/useCompoundButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/renderMenuButton.js +2 -2
- package/lib-commonjs/components/MenuButton/renderMenuButton.js.map +1 -1
- package/lib-commonjs/components/MenuButton/useMenuButton.js +3 -2
- package/lib-commonjs/components/MenuButton/useMenuButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/renderSplitButton.js +2 -2
- package/lib-commonjs/components/SplitButton/renderSplitButton.js.map +1 -1
- package/lib-commonjs/components/SplitButton/useSplitButton.js +10 -8
- package/lib-commonjs/components/SplitButton/useSplitButton.js.map +1 -1
- 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 =
|
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
|
-
|
26
|
+
renderByDefault: true,
|
27
|
+
elementType: _menuButton.MenuButton
|
27
28
|
});
|
28
|
-
const primaryActionButtonShorthand =
|
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
|
-
|
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,
|
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-
|
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-
|
32
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
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-
|
38
|
-
"@fluentui/react-aria": "0.0.0-nightly-
|
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-
|
41
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
42
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
43
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
44
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
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
|
},
|