@fluentui/react-infobutton 9.0.0-beta.22 → 9.0.0-beta.23
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/.swcrc +30 -0
- package/CHANGELOG.json +64 -1
- package/CHANGELOG.md +19 -2
- package/lib/InfoButton.js.map +1 -1
- package/lib/InfoLabel.js.map +1 -1
- package/lib/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.js.map +1 -1
- package/lib/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib/components/InfoButton/index.js.map +1 -1
- package/lib/components/InfoButton/renderInfoButton.js +1 -7
- package/lib/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/InfoLabel.types.js.map +1 -1
- package/lib/components/InfoLabel/index.js.map +1 -1
- package/lib/components/InfoLabel/renderInfoLabel.js +1 -7
- package/lib/components/InfoLabel/renderInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabel.js +4 -2
- package/lib/components/InfoLabel/useInfoLabel.js.map +1 -1
- package/lib/components/InfoLabel/useInfoLabelStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/InfoButton.js +5 -4
- package/lib-commonjs/InfoButton.js.map +1 -1
- package/lib-commonjs/InfoLabel.js +5 -4
- package/lib-commonjs/InfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js +17 -7
- package/lib-commonjs/components/InfoButton/DefaultInfoButtonIcons.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.js +16 -15
- package/lib-commonjs/components/InfoButton/InfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/InfoButton.types.js +3 -2
- package/lib-commonjs/components/InfoButton/InfoButton.types.js.map +1 -1
- package/lib-commonjs/components/InfoButton/index.js +9 -8
- package/lib-commonjs/components/InfoButton/index.js.map +1 -1
- package/lib-commonjs/components/InfoButton/renderInfoButton.js +14 -23
- package/lib-commonjs/components/InfoButton/renderInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButton.js +58 -67
- package/lib-commonjs/components/InfoButton/useInfoButton.js.map +1 -1
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js +331 -149
- package/lib-commonjs/components/InfoButton/useInfoButtonStyles.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/InfoLabel.js +16 -15
- package/lib-commonjs/components/InfoLabel/InfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js +3 -2
- package/lib-commonjs/components/InfoLabel/InfoLabel.types.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/index.js +9 -8
- package/lib-commonjs/components/InfoLabel/index.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js +13 -22
- package/lib-commonjs/components/InfoLabel/renderInfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js +53 -66
- package/lib-commonjs/components/InfoLabel/useInfoLabel.js.map +1 -1
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js +55 -41
- package/lib-commonjs/components/InfoLabel/useInfoLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js +24 -66
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +11 -10
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./InfoButton"), exports);
|
|
7
|
+
_exportStar(require("./InfoButton.types"), exports);
|
|
8
|
+
_exportStar(require("./renderInfoButton"), exports);
|
|
9
|
+
_exportStar(require("./useInfoButton"), exports);
|
|
10
|
+
_exportStar(require("./useInfoButtonStyles"), exports);
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
|
|
12
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/index.js"],"sourcesContent":["export * from './InfoButton';\nexport * from './InfoButton.types';\nexport * from './renderInfoButton';\nexport * from './useInfoButton';\nexport * from './useInfoButtonStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderInfoButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderInfoButton_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
slots,
|
|
16
|
-
slotProps
|
|
17
|
-
} = react_utilities_1.getSlots(state);
|
|
18
|
-
return React.createElement(slots.popover, {
|
|
19
|
-
...slotProps.popover
|
|
20
|
-
}, React.createElement(react_popover_1.PopoverTrigger, null, React.createElement(slots.root, {
|
|
21
|
-
...slotProps.root
|
|
22
|
-
})), React.createElement(slots.content, {
|
|
23
|
-
...slotProps.content
|
|
24
|
-
}));
|
|
25
|
-
};
|
|
26
|
-
exports.renderInfoButton_unstable = renderInfoButton_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _reactPopover = require("@fluentui/react-popover");
|
|
13
|
+
const renderInfoButton_unstable = (state)=>{
|
|
14
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
15
|
+
return /*#__PURE__*/ _react.createElement(slots.popover, slotProps.popover, /*#__PURE__*/ _react.createElement(_reactPopover.PopoverTrigger, null, /*#__PURE__*/ _react.createElement(slots.root, slotProps.root)), /*#__PURE__*/ _react.createElement(slots.content, slotProps.content));
|
|
16
|
+
}; //# sourceMappingURL=renderInfoButton.js.map
|
|
17
|
+
|
|
27
18
|
//# sourceMappingURL=renderInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/renderInfoButton.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { PopoverTrigger } from '@fluentui/react-popover';\n/**\n * Render the final JSX of InfoButton\n */\nexport const renderInfoButton_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.popover, slotProps.popover, /*#__PURE__*/React.createElement(PopoverTrigger, null, /*#__PURE__*/React.createElement(slots.root, slotProps.root)), /*#__PURE__*/React.createElement(slots.content, slotProps.content));\n};\n//# sourceMappingURL=renderInfoButton.js.map"],"names":["renderInfoButton_unstable","state","slots","slotProps","getSlots","React","createElement","popover","PopoverTrigger","root","content"],"mappings":";;;;+BAMaA;;aAAAA;;;6DANU;gCACE;8BACM;AAIxB,MAAMA,4BAA4BC,CAAAA,QAAS;IAChD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,OAAO,EAAEJ,UAAUI,OAAO,EAAE,WAAW,GAAEF,OAAMC,aAAa,CAACE,4BAAc,EAAE,IAAI,EAAE,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMO,IAAI,EAAEN,UAAUM,IAAI,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMQ,OAAO,EAAEP,UAAUO,OAAO;AACnQ,GACA,4CAA4C"}
|
|
@@ -1,75 +1,66 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useInfoButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useInfoButton_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _defaultInfoButtonIcons = require("./DefaultInfoButtonIcons");
|
|
12
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
13
|
+
const _reactPopover = require("@fluentui/react-popover");
|
|
12
14
|
const infoButtonIconMap = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
small: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon12, null),
|
|
16
|
+
medium: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon16, null),
|
|
17
|
+
large: /*#__PURE__*/ _react.createElement(_defaultInfoButtonIcons.DefaultInfoButtonIcon20, null)
|
|
16
18
|
};
|
|
17
19
|
const popoverSizeMap = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
small: 'small',
|
|
21
|
+
medium: 'small',
|
|
22
|
+
large: 'medium'
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
};
|
|
65
|
-
const [popoverOpen, setPopoverOpen] = react_utilities_2.useControllableState({
|
|
66
|
-
state: state.popover.open,
|
|
67
|
-
defaultState: state.popover.defaultOpen,
|
|
68
|
-
initialState: false
|
|
69
|
-
});
|
|
70
|
-
state.popover.open = popoverOpen;
|
|
71
|
-
state.popover.onOpenChange = react_utilities_1.mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));
|
|
72
|
-
return state;
|
|
73
|
-
};
|
|
74
|
-
exports.useInfoButton_unstable = useInfoButton_unstable;
|
|
24
|
+
const useInfoButton_unstable = (props, ref)=>{
|
|
25
|
+
const { size ='medium' } = props;
|
|
26
|
+
const state = {
|
|
27
|
+
size,
|
|
28
|
+
components: {
|
|
29
|
+
root: 'button',
|
|
30
|
+
popover: _reactPopover.Popover,
|
|
31
|
+
content: _reactPopover.PopoverSurface
|
|
32
|
+
},
|
|
33
|
+
root: (0, _reactUtilities.getNativeElementProps)('button', {
|
|
34
|
+
children: infoButtonIconMap[size],
|
|
35
|
+
type: 'button',
|
|
36
|
+
'aria-label': 'information',
|
|
37
|
+
...props,
|
|
38
|
+
ref
|
|
39
|
+
}),
|
|
40
|
+
popover: (0, _reactUtilities.resolveShorthand)(props.popover, {
|
|
41
|
+
required: true,
|
|
42
|
+
defaultProps: {
|
|
43
|
+
positioning: 'above-start',
|
|
44
|
+
size: popoverSizeMap[size],
|
|
45
|
+
withArrow: true
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
48
|
+
content: (0, _reactUtilities.resolveShorthand)(props.content, {
|
|
49
|
+
required: true,
|
|
50
|
+
defaultProps: {
|
|
51
|
+
role: 'note',
|
|
52
|
+
tabIndex: -1
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
const [popoverOpen, setPopoverOpen] = (0, _reactUtilities.useControllableState)({
|
|
57
|
+
state: state.popover.open,
|
|
58
|
+
defaultState: state.popover.defaultOpen,
|
|
59
|
+
initialState: false
|
|
60
|
+
});
|
|
61
|
+
state.popover.open = popoverOpen;
|
|
62
|
+
state.popover.onOpenChange = (0, _reactUtilities.mergeCallbacks)(state.popover.onOpenChange, (e, data)=>setPopoverOpen(data.open));
|
|
63
|
+
return state;
|
|
64
|
+
}; //# sourceMappingURL=useInfoButton.js.map
|
|
65
|
+
|
|
75
66
|
//# sourceMappingURL=useInfoButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/InfoButton/useInfoButton.js"],"sourcesContent":["import * as React from 'react';\nimport { DefaultInfoButtonIcon12, DefaultInfoButtonIcon16, DefaultInfoButtonIcon20 } from './DefaultInfoButtonIcons';\nimport { getNativeElementProps, mergeCallbacks, resolveShorthand } from '@fluentui/react-utilities';\nimport { Popover, PopoverSurface } from '@fluentui/react-popover';\nimport { useControllableState } from '@fluentui/react-utilities';\nconst infoButtonIconMap = {\n small: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon12, null),\n medium: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon16, null),\n large: /*#__PURE__*/React.createElement(DefaultInfoButtonIcon20, null)\n};\nconst popoverSizeMap = {\n small: 'small',\n medium: 'small',\n large: 'medium'\n};\n/**\n * Create the state required to render InfoButton.\n *\n * The returned state can be modified with hooks such as useInfoButtonStyles_unstable,\n * before being passed to renderInfoButton_unstable.\n *\n * @param props - props from this instance of InfoButton\n * @param ref - reference to root HTMLElement of InfoButton\n */\nexport const useInfoButton_unstable = (props, ref) => {\n const {\n size = 'medium'\n } = props;\n const state = {\n size,\n components: {\n root: 'button',\n popover: Popover,\n content: PopoverSurface\n },\n root: getNativeElementProps('button', {\n children: infoButtonIconMap[size],\n type: 'button',\n 'aria-label': 'information',\n ...props,\n ref\n }),\n popover: resolveShorthand(props.popover, {\n required: true,\n defaultProps: {\n positioning: 'above-start',\n size: popoverSizeMap[size],\n withArrow: true\n }\n }),\n content: resolveShorthand(props.content, {\n required: true,\n defaultProps: {\n role: 'note',\n tabIndex: -1\n }\n })\n };\n const [popoverOpen, setPopoverOpen] = useControllableState({\n state: state.popover.open,\n defaultState: state.popover.defaultOpen,\n initialState: false\n });\n state.popover.open = popoverOpen;\n state.popover.onOpenChange = mergeCallbacks(state.popover.onOpenChange, (e, data) => setPopoverOpen(data.open));\n return state;\n};\n//# sourceMappingURL=useInfoButton.js.map"],"names":["useInfoButton_unstable","infoButtonIconMap","small","React","createElement","DefaultInfoButtonIcon12","medium","DefaultInfoButtonIcon16","large","DefaultInfoButtonIcon20","popoverSizeMap","props","ref","size","state","components","root","popover","Popover","content","PopoverSurface","getNativeElementProps","children","type","resolveShorthand","required","defaultProps","positioning","withArrow","role","tabIndex","popoverOpen","setPopoverOpen","useControllableState","open","defaultState","defaultOpen","initialState","onOpenChange","mergeCallbacks","e","data"],"mappings":";;;;+BAwBaA;;aAAAA;;;6DAxBU;wCACmE;gCAClB;8BAChC;AAExC,MAAMC,oBAAoB;IACxBC,OAAO,WAAW,GAAEC,OAAMC,aAAa,CAACC,+CAAuB,EAAE,I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