@fluentui/react-badge 9.0.0-alpha.80 → 9.0.0-alpha.84
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 +137 -1
- package/CHANGELOG.md +48 -2
- package/Spec.md +7 -22
- package/dist/react-badge.d.ts +57 -137
- package/lib/Badge.js.map +1 -1
- package/lib/CounterBadge.js.map +1 -1
- package/lib/PresenceBadge.js.map +1 -1
- package/lib/common/isConformant.js +2 -0
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Badge/Badge.d.ts +1 -2
- package/lib/components/Badge/Badge.js +0 -1
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.d.ts +19 -46
- package/lib/components/Badge/Badge.types.js.map +1 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +3 -4
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.d.ts +1 -5
- package/lib/components/Badge/useBadge.js +29 -18
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js +1 -1
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.d.ts +1 -2
- package/lib/components/CounterBadge/CounterBadge.js +0 -1
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +24 -44
- package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -5
- package/lib/components/CounterBadge/useCounterBadge.js +25 -19
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -2
- package/lib/components/PresenceBadge/PresenceBadge.js +0 -1
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +5 -25
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -5
- package/lib/components/PresenceBadge/usePresenceBadge.js +15 -21
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/common/isConformant.js +2 -0
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.d.ts +1 -2
- package/lib-commonjs/components/Badge/Badge.js +0 -1
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.d.ts +19 -46
- package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +2 -4
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.d.ts +1 -5
- package/lib-commonjs/components/Badge/useBadge.js +30 -19
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -2
- package/lib-commonjs/components/CounterBadge/CounterBadge.js +0 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +24 -44
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -5
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +27 -21
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -2
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +0 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +5 -25
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -5
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +16 -22
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
- package/lib-amd/Badge.d.ts +0 -1
- package/lib-amd/Badge.js +0 -6
- package/lib-amd/Badge.js.map +0 -1
- package/lib-amd/CounterBadge.d.ts +0 -1
- package/lib-amd/CounterBadge.js +0 -6
- package/lib-amd/CounterBadge.js.map +0 -1
- package/lib-amd/PresenceBadge.d.ts +0 -1
- package/lib-amd/PresenceBadge.js +0 -6
- package/lib-amd/PresenceBadge.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -4
- package/lib-amd/common/isConformant.js +0 -15
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Badge/Badge.d.ts +0 -7
- package/lib-amd/components/Badge/Badge.js +0 -16
- package/lib-amd/components/Badge/Badge.js.map +0 -1
- package/lib-amd/components/Badge/Badge.types.d.ts +0 -65
- package/lib-amd/components/Badge/Badge.types.js +0 -5
- package/lib-amd/components/Badge/Badge.types.js.map +0 -1
- package/lib-amd/components/Badge/index.d.ts +0 -5
- package/lib-amd/components/Badge/index.js +0 -10
- package/lib-amd/components/Badge/index.js.map +0 -1
- package/lib-amd/components/Badge/renderBadge.d.ts +0 -2
- package/lib-amd/components/Badge/renderBadge.js +0 -14
- package/lib-amd/components/Badge/renderBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadge.d.ts +0 -10
- package/lib-amd/components/Badge/useBadge.js +0 -25
- package/lib-amd/components/Badge/useBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadgeStyles.d.ts +0 -5
- package/lib-amd/components/Badge/useBadgeStyles.js +0 -234
- package/lib-amd/components/Badge/useBadgeStyles.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.d.ts +0 -7
- package/lib-amd/components/CounterBadge/CounterBadge.js +0 -16
- package/lib-amd/components/CounterBadge/CounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.types.d.ts +0 -61
- package/lib-amd/components/CounterBadge/CounterBadge.types.js +0 -5
- package/lib-amd/components/CounterBadge/CounterBadge.types.js.map +0 -1
- package/lib-amd/components/CounterBadge/index.d.ts +0 -4
- package/lib-amd/components/CounterBadge/index.js +0 -9
- package/lib-amd/components/CounterBadge/index.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadge.d.ts +0 -10
- package/lib-amd/components/CounterBadge/useCounterBadge.js +0 -28
- package/lib-amd/components/CounterBadge/useCounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js +0 -46
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js.map +0 -1
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -64
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.d.ts +0 -7
- package/lib-amd/components/PresenceBadge/PresenceBadge.js +0 -16
- package/lib-amd/components/PresenceBadge/PresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.d.ts +0 -37
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js +0 -5
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js.map +0 -1
- package/lib-amd/components/PresenceBadge/index.d.ts +0 -4
- package/lib-amd/components/PresenceBadge/index.js +0 -9
- package/lib-amd/components/PresenceBadge/index.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadge.d.ts +0 -10
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js +0 -37
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js +0 -58
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -5
- package/lib-amd/index.js +0 -10
- package/lib-amd/index.js.map +0 -1
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';
|
|
3
|
-
/**
|
|
4
|
-
* Consts listing which props are shorthand props.
|
|
5
|
-
*/
|
|
6
|
-
export declare const counterBadgeShorthandPropsCompat: readonly ["icon"];
|
|
7
|
-
/**
|
|
8
|
-
* Returns the props and state required to render the component
|
|
9
|
-
*/
|
|
10
|
-
export declare const useCounterBadge: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>, defaultProps?: CounterBadgeProps | undefined) => CounterBadgeState;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-utilities", "../Badge/index"], function (require, exports, react_utilities_1, index_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useCounterBadge = exports.counterBadgeShorthandPropsCompat = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Consts listing which props are shorthand props.
|
|
7
|
-
*/
|
|
8
|
-
exports.counterBadgeShorthandPropsCompat = ['icon'];
|
|
9
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
10
|
-
var mergeProps = react_utilities_1.makeMergePropsCompat({ deepMerge: exports.counterBadgeShorthandPropsCompat });
|
|
11
|
-
/**
|
|
12
|
-
* Returns the props and state required to render the component
|
|
13
|
-
*/
|
|
14
|
-
var useCounterBadge = function (props, ref, defaultProps) {
|
|
15
|
-
var state = index_1.useBadge(props, ref, mergeProps({
|
|
16
|
-
showZero: false,
|
|
17
|
-
overflowCount: 99,
|
|
18
|
-
count: 0,
|
|
19
|
-
dot: false,
|
|
20
|
-
}, defaultProps));
|
|
21
|
-
if (!state.dot && !state.children) {
|
|
22
|
-
state.children = state.count > state.overflowCount ? state.overflowCount + "+" : "" + state.count;
|
|
23
|
-
}
|
|
24
|
-
return state;
|
|
25
|
-
};
|
|
26
|
-
exports.useCounterBadge = useCounterBadge;
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=useCounterBadge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCounterBadge.js","sourceRoot":"../src/","sources":["components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";;;;IAMA;;OAEG;IACU,QAAA,gCAAgC,GAAG,CAAC,MAAM,CAAU,CAAC;IAElE,mDAAmD;IACnD,IAAM,UAAU,GAAG,sCAAoB,CAAoB,EAAE,SAAS,EAAE,wCAAgC,EAAE,CAAC,CAAC;IAE5G;;OAEG;IACI,IAAM,eAAe,GAAG,UAC7B,KAAwB,EACxB,GAA2B,EAC3B,YAAgC;QAEhC,IAAM,KAAK,GAAG,gBAAQ,CACpB,KAAK,EACL,GAAG,EACH,UAAU,CACR;YACE,QAAQ,EAAE,KAAK;YACf,aAAa,EAAE,EAAE;YACjB,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,KAAK;SACX,EACD,YAAY,CACC,CACK,CAAC;QAEvB,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACjC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,CAAI,KAAK,CAAC,aAAa,MAAG,CAAC,CAAC,CAAC,KAAG,KAAK,CAAC,KAAO,CAAC;SACnG;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAxBW,QAAA,eAAe,mBAwB1B","sourcesContent":["import * as React from 'react';\nimport { makeMergePropsCompat } from '@fluentui/react-utilities';\nimport { useBadge } from '../Badge/index';\nimport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';\nimport type { BadgeProps } from '../Badge/index';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const counterBadgeShorthandPropsCompat = ['icon'] as const;\n\n// eslint-disable-next-line deprecation/deprecation\nconst mergeProps = makeMergePropsCompat<CounterBadgeState>({ deepMerge: counterBadgeShorthandPropsCompat });\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useCounterBadge = (\n props: CounterBadgeProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: CounterBadgeProps,\n): CounterBadgeState => {\n const state = useBadge(\n props,\n ref,\n mergeProps(\n {\n showZero: false,\n overflowCount: 99,\n count: 0,\n dot: false,\n },\n defaultProps,\n ) as BadgeProps,\n ) as CounterBadgeState;\n\n if (!state.dot && !state.children) {\n state.children = state.count > state.overflowCount ? `${state.overflowCount}+` : `${state.count}`;\n }\n\n return state;\n};\n"]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-make-styles", "../Badge/useBadgeStyles"], function (require, exports, react_make_styles_1, useBadgeStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useCounterBadgeStyles = void 0;
|
|
5
|
-
var useStyles = react_make_styles_1.makeStyles({
|
|
6
|
-
root: {
|
|
7
|
-
minWidth: 'auto',
|
|
8
|
-
},
|
|
9
|
-
warning: function (theme) { return ({
|
|
10
|
-
backgroundColor: theme.global.palette.cranberry.primary,
|
|
11
|
-
borderColor: theme.global.palette.cranberry.primary,
|
|
12
|
-
}); },
|
|
13
|
-
important: function (theme) { return ({
|
|
14
|
-
backgroundColor: theme.global.palette.grey[14],
|
|
15
|
-
borderColor: theme.global.palette.grey[14],
|
|
16
|
-
}); },
|
|
17
|
-
severe: function (theme) { return ({
|
|
18
|
-
// TODO: update these colors once the color used in the design spec has existing color token
|
|
19
|
-
backgroundColor: theme.global.palette.red.primary,
|
|
20
|
-
borderColor: theme.global.palette.red.primary,
|
|
21
|
-
}); },
|
|
22
|
-
informative: function (theme) { return ({
|
|
23
|
-
backgroundColor: theme.global.palette.grey[92],
|
|
24
|
-
borderColor: theme.global.palette.grey[92],
|
|
25
|
-
color: theme.alias.color.neutral.neutralForeground3,
|
|
26
|
-
}); },
|
|
27
|
-
dot: {
|
|
28
|
-
width: '6px',
|
|
29
|
-
height: '6px',
|
|
30
|
-
padding: '0',
|
|
31
|
-
},
|
|
32
|
-
hide: {
|
|
33
|
-
display: 'none',
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
/**
|
|
37
|
-
* Applies style classnames to slots
|
|
38
|
-
*/
|
|
39
|
-
var useCounterBadgeStyles = function (state) {
|
|
40
|
-
var styles = useStyles();
|
|
41
|
-
state.className = react_make_styles_1.mergeClasses(styles.root, state.color === 'warning' && styles.warning, state.color === 'important' && styles.important, state.color === 'severe' && styles.severe, state.color === 'informative' && styles.informative, state.dot && styles.dot, !state.showZero && state.count === 0 && !state.dot && styles.hide, state.className);
|
|
42
|
-
return useBadgeStyles_1.useBadgeStyles(state);
|
|
43
|
-
};
|
|
44
|
-
exports.useCounterBadgeStyles = useCounterBadgeStyles;
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=useCounterBadgeStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCounterBadgeStyles.js","sourceRoot":"../src/","sources":["components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,QAAQ,EAAE,MAAM;SACjB;QACD,OAAO,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACjB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO;YACvD,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO;SACpD,CAAC,EAHgB,CAGhB;QACF,SAAS,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACnB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;SAC3C,CAAC,EAHkB,CAGlB;QACF,MAAM,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YAChB,4FAA4F;YAC5F,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;YACjD,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO;SAC9C,CAAC,EAJe,CAIf;QACF,WAAW,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import type { CounterBadgeState } from './CounterBadge.types';\n\nconst useStyles = makeStyles({\n root: {\n minWidth: 'auto',\n },\n warning: theme => ({\n backgroundColor: theme.global.palette.cranberry.primary,\n borderColor: theme.global.palette.cranberry.primary,\n }),\n important: theme => ({\n backgroundColor: theme.global.palette.grey[14],\n borderColor: theme.global.palette.grey[14],\n }),\n severe: theme => ({\n // TODO: update these colors once the color used in the design spec has existing color token\n backgroundColor: theme.global.palette.red.primary,\n borderColor: theme.global.palette.red.primary,\n }),\n informative: theme => ({\n backgroundColor: theme.global.palette.grey[92],\n borderColor: theme.global.palette.grey[92],\n color: theme.alias.color.neutral.neutralForeground3,\n }),\n dot: {\n width: '6px',\n height: '6px',\n padding: '0',\n },\n hide: {\n display: 'none',\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const useCounterBadgeStyles = (state: CounterBadgeState): CounterBadgeState => {\n const styles = useStyles();\n state.className = mergeClasses(\n styles.root,\n state.color === 'warning' && styles.warning,\n state.color === 'important' && styles.important,\n state.color === 'severe' && styles.severe,\n state.color === 'informative' && styles.informative,\n state.dot && styles.dot,\n !state.showZero && state.count === 0 && !state.dot && styles.hide,\n state.className,\n );\n return useBadgeStyles(state) as CounterBadgeState;\n};\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const renderIcon: (SVGElement: (props: {
|
|
3
|
-
svgClasses: string;
|
|
4
|
-
}) => JSX.Element) => React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
5
|
-
declare const SkypeMinusIcon: React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
6
|
-
declare const SkypeClockIcon: React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
7
|
-
declare const SkypeCheckIcon: React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
8
|
-
declare const SkypeArrowIcon: React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
9
|
-
declare const CancelIcon: React.FC<React.HTMLAttributes<HTMLSpanElement>>;
|
|
10
|
-
export { SkypeMinusIcon, SkypeClockIcon, SkypeCheckIcon, SkypeArrowIcon, CancelIcon };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "@fluentui/react-make-styles", "@fluentui/react-utilities", "react"], function (require, exports, tslib_1, react_make_styles_1, react_utilities_1, React) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CancelIcon = exports.SkypeArrowIcon = exports.SkypeCheckIcon = exports.SkypeClockIcon = exports.SkypeMinusIcon = exports.renderIcon = void 0;
|
|
5
|
-
var useStyles = react_make_styles_1.makeStyles({
|
|
6
|
-
root: {
|
|
7
|
-
display: 'inline-block',
|
|
8
|
-
verticalAlign: 'middle',
|
|
9
|
-
speak: 'none',
|
|
10
|
-
width: '1em',
|
|
11
|
-
height: '1em',
|
|
12
|
-
},
|
|
13
|
-
svg: {
|
|
14
|
-
height: '100%',
|
|
15
|
-
fill: 'currentColor',
|
|
16
|
-
verticalAlign: 'top',
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
//
|
|
20
|
-
// !!! A temporary workaround to avoid dependencies on any icon packages.
|
|
21
|
-
// !!! A usage of converged icon package should be considered.
|
|
22
|
-
//
|
|
23
|
-
var useIconProps = function (props) {
|
|
24
|
-
var _a;
|
|
25
|
-
var containerProps = props['aria-label']
|
|
26
|
-
? {}
|
|
27
|
-
: (_a = {
|
|
28
|
-
role: 'presentation'
|
|
29
|
-
},
|
|
30
|
-
_a['aria-hidden'] = true,
|
|
31
|
-
_a);
|
|
32
|
-
var nativeProps = react_utilities_1.getNativeProps(props, react_utilities_1.htmlElementProperties);
|
|
33
|
-
var styles = useStyles();
|
|
34
|
-
var rootClasses = styles.root;
|
|
35
|
-
var svgClasses = styles.svg;
|
|
36
|
-
return { containerProps: containerProps, nativeProps: nativeProps, rootClasses: rootClasses, svgClasses: svgClasses };
|
|
37
|
-
};
|
|
38
|
-
var renderIcon = function (SVGElement) { return function (props) {
|
|
39
|
-
var _a = useIconProps(props), containerProps = _a.containerProps, nativeProps = _a.nativeProps, rootClasses = _a.rootClasses, svgClasses = _a.svgClasses;
|
|
40
|
-
return React.createElement('span', tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, containerProps), nativeProps), { className: react_make_styles_1.mergeClasses(rootClasses, props.className) }), React.createElement(SVGElement, { svgClasses: svgClasses }));
|
|
41
|
-
}; };
|
|
42
|
-
exports.renderIcon = renderIcon;
|
|
43
|
-
var SkypeMinusIcon = exports.renderIcon(function (props) { return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2048 2048", className: props.svgClasses },
|
|
44
|
-
React.createElement("path", { d: "M1591 823q42 0 78 16t64 43 43 63 16 79q0 42-16 78t-43 64-63 43-79 16H395q-42 0-78-16t-64-43-42-63-16-79q0-42 15-78t43-64 63-43 79-16h1196z" }))); });
|
|
45
|
-
exports.SkypeMinusIcon = SkypeMinusIcon;
|
|
46
|
-
SkypeMinusIcon.displayName = 'SkypeMinusIcon';
|
|
47
|
-
var SkypeClockIcon = exports.renderIcon(function (props) { return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2048 2048", className: props.svgClasses },
|
|
48
|
-
React.createElement("path", { d: "M1431 1705q28 28 43 65t15 77q0 42-15 78t-43 64-63 43-79 16q-83 0-142-59l-594-593q-28-28-43-65t-15-77V201q0-42 15-78t43-64 63-43 79-16q42 0 78 16t64 43 43 63 16 79v970l535 534z" }))); });
|
|
49
|
-
exports.SkypeClockIcon = SkypeClockIcon;
|
|
50
|
-
SkypeClockIcon.displayName = 'SkypeClockIcon';
|
|
51
|
-
var SkypeCheckIcon = exports.renderIcon(function (props) { return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2048 2048", className: props.svgClasses },
|
|
52
|
-
React.createElement("path", { d: "M1570 437q42 0 78 15t64 43 42 63 16 79q0 40-15 77t-43 65l-794 795q-28 28-65 43t-77 16q-40 0-77-15t-65-44l-362-362q-28-28-43-65t-16-77q0-42 16-78t43-64 63-42 79-16q40 0 77 15t65 43l220 220 652-653q28-28 65-43t77-15z" }))); });
|
|
53
|
-
exports.SkypeCheckIcon = SkypeCheckIcon;
|
|
54
|
-
SkypeCheckIcon.displayName = 'SkypeCheckIcon';
|
|
55
|
-
var SkypeArrowIcon = exports.renderIcon(function (props) { return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2048 2048", className: props.svgClasses },
|
|
56
|
-
React.createElement("path", { d: "M1980 964q0 41-15 77t-43 63-63 42-77 16H739l281 280q28 27 43 64t15 76q0 41-15 77t-43 63-63 42-77 16q-39 0-75-15t-65-43l-615-616q-33-33-47-68t-14-82q0-39 17-73t44-61l615-616q28-28 65-43t76-15q41 0 77 16t62 43 42 63 16 77q0 39-15 75t-43 64L739 766h1043q41 0 77 15t63 43 42 63 16 77z" }))); });
|
|
57
|
-
exports.SkypeArrowIcon = SkypeArrowIcon;
|
|
58
|
-
SkypeArrowIcon.displayName = 'SkypeArrowIcon';
|
|
59
|
-
var CancelIcon = exports.renderIcon(function (props) { return (React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2048 2048", className: props.svgClasses },
|
|
60
|
-
React.createElement("path", { d: "M1115 1024l690 691-90 90-691-690-691 690-90-90 690-691-690-691 90-90 691 690 691-690 90 90-690 691z" }))); });
|
|
61
|
-
exports.CancelIcon = CancelIcon;
|
|
62
|
-
CancelIcon.displayName = 'CancelIcon';
|
|
63
|
-
});
|
|
64
|
-
//# sourceMappingURL=DefaultPresenceBadgeIcons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultPresenceBadgeIcons.js","sourceRoot":"../src/","sources":["components/PresenceBadge/DefaultPresenceBadgeIcons.tsx"],"names":[],"mappings":";;;;IAIA,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B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,GAAG,kBAAU,CAAC,UAAA,KAAK,IAAI,OAAA,CACrC,6BAAK,KAAK,EAAC,4BAA4B,EAAC,OAAO,EAAC,eAAe,EAAC,SAAS,EAAE,KAAK,CAAC,UAAU;QACzF,8BAAM,CAAC,EAAC,qGAAqG,GAAG,CAC5G,CACP,EAJsC,CAItC,CAAC,CAAC;IAIsE,gCAAU;IAFnF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { getNativeProps, htmlElementProperties } from '@fluentui/react-utilities';\nimport * as React from 'react';\n\nconst useStyles = makeStyles({\n root: {\n display: 'inline-block',\n verticalAlign: 'middle',\n speak: 'none',\n width: '1em',\n height: '1em',\n },\n svg: {\n height: '100%',\n fill: 'currentColor',\n verticalAlign: 'top',\n },\n});\n\n//\n// !!! A temporary workaround to avoid dependencies on any icon packages.\n// !!! A usage of converged icon package should be considered.\n//\n\nconst useIconProps = (props: React.HTMLAttributes<HTMLSpanElement>) => {\n const containerProps = props['aria-label']\n ? {}\n : {\n role: 'presentation',\n ['aria-hidden']: true,\n };\n const nativeProps = getNativeProps<React.HTMLAttributes<HTMLElement>>(props, htmlElementProperties);\n const styles = useStyles();\n\n const rootClasses = styles.root;\n const svgClasses = styles.svg;\n\n return { containerProps, nativeProps, rootClasses, svgClasses };\n};\n\nexport const renderIcon = (\n SVGElement: (props: { svgClasses: string }) => JSX.Element,\n): React.FC<React.HTMLAttributes<HTMLSpanElement>> => props => {\n const { containerProps, nativeProps, rootClasses, svgClasses } = useIconProps(props);\n\n return React.createElement(\n 'span',\n {\n ...containerProps,\n ...nativeProps,\n className: mergeClasses(rootClasses, props.className),\n },\n <SVGElement svgClasses={svgClasses} />,\n );\n};\n\nconst SkypeMinusIcon = renderIcon(props => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2048 2048\" className={props.svgClasses}>\n <path d=\"M1591 823q42 0 78 16t64 43 43 63 16 79q0 42-16 78t-43 64-63 43-79 16H395q-42 0-78-16t-64-43-42-63-16-79q0-42 15-78t43-64 63-43 79-16h1196z\" />\n </svg>\n));\n\nSkypeMinusIcon.displayName = 'SkypeMinusIcon';\n\nconst SkypeClockIcon = renderIcon(props => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2048 2048\" className={props.svgClasses}>\n <path d=\"M1431 1705q28 28 43 65t15 77q0 42-15 78t-43 64-63 43-79 16q-83 0-142-59l-594-593q-28-28-43-65t-15-77V201q0-42 15-78t43-64 63-43 79-16q42 0 78 16t64 43 43 63 16 79v970l535 534z\" />\n </svg>\n));\n\nSkypeClockIcon.displayName = 'SkypeClockIcon';\n\nconst SkypeCheckIcon = renderIcon(props => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2048 2048\" className={props.svgClasses}>\n <path d=\"M1570 437q42 0 78 15t64 43 42 63 16 79q0 40-15 77t-43 65l-794 795q-28 28-65 43t-77 16q-40 0-77-15t-65-44l-362-362q-28-28-43-65t-16-77q0-42 16-78t43-64 63-42 79-16q40 0 77 15t65 43l220 220 652-653q28-28 65-43t77-15z\" />\n </svg>\n));\n\nSkypeCheckIcon.displayName = 'SkypeCheckIcon';\n\nconst SkypeArrowIcon = renderIcon(props => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2048 2048\" className={props.svgClasses}>\n <path d=\"M1980 964q0 41-15 77t-43 63-63 42-77 16H739l281 280q28 27 43 64t15 76q0 41-15 77t-43 63-63 42-77 16q-39 0-75-15t-65-43l-615-616q-33-33-47-68t-14-82q0-39 17-73t44-61l615-616q28-28 65-43t76-15q41 0 77 16t62 43 42 63 16 77q0 39-15 75t-43 64L739 766h1043q41 0 77 15t63 43 42 63 16 77z\" />\n </svg>\n));\n\nSkypeArrowIcon.displayName = 'SkypeArrowIcon';\n\nconst CancelIcon = renderIcon(props => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 2048 2048\" className={props.svgClasses}>\n <path d=\"M1115 1024l690 691-90 90-691-690-691 690-90-90 690-691-690-691 90-90 691 690 691-690 90 90-690 691z\" />\n </svg>\n));\n\nCancelIcon.displayName = 'CancelIcon';\n\nexport { SkypeMinusIcon, SkypeClockIcon, SkypeCheckIcon, SkypeArrowIcon, CancelIcon };\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { PresenceBadgeProps } from './PresenceBadge.types';
|
|
3
|
-
/**
|
|
4
|
-
* Define a styled Badge, using the `useBadge` hook.
|
|
5
|
-
* {@docCategory Badge}
|
|
6
|
-
*/
|
|
7
|
-
export declare const PresenceBadge: React.ForwardRefExoticComponent<PresenceBadgeProps & React.RefAttributes<HTMLElement>>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "./usePresenceBadge", "./usePresenceBadgeStyles", "../../Badge"], function (require, exports, React, usePresenceBadge_1, usePresenceBadgeStyles_1, Badge_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PresenceBadge = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Define a styled Badge, using the `useBadge` hook.
|
|
7
|
-
* {@docCategory Badge}
|
|
8
|
-
*/
|
|
9
|
-
exports.PresenceBadge = React.forwardRef(function (props, ref) {
|
|
10
|
-
var state = usePresenceBadge_1.usePresenceBadge(props, ref);
|
|
11
|
-
usePresenceBadgeStyles_1.usePresenceBadgeStyles(state);
|
|
12
|
-
return Badge_1.renderBadge(state);
|
|
13
|
-
});
|
|
14
|
-
exports.PresenceBadge.displayName = 'PresenceBadge';
|
|
15
|
-
});
|
|
16
|
-
//# sourceMappingURL=PresenceBadge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceBadge.js","sourceRoot":"../src/","sources":["components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":";;;;IAMA;;;OAGG;IACU,QAAA,aAAa,GAAG,KAAK,CAAC,UAAU,CAAkC,UAAC,KAAK,EAAE,GAAG;QACxF,IAAM,KAAK,GAAG,mCAAgB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC3C,+CAAsB,CAAC,KAAK,CAAC,CAAC;QAE9B,OAAO,mBAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { usePresenceBadge } from './usePresenceBadge';\nimport { usePresenceBadgeStyles } from './usePresenceBadgeStyles';\nimport { renderBadge } from '../../Badge';\nimport type { PresenceBadgeProps } from './PresenceBadge.types';\n\n/**\n * Define a styled Badge, using the `useBadge` hook.\n * {@docCategory Badge}\n */\nexport const PresenceBadge = React.forwardRef<HTMLElement, PresenceBadgeProps>((props, ref) => {\n const state = usePresenceBadge(props, ref);\n usePresenceBadgeStyles(state);\n\n return renderBadge(state);\n});\n\nPresenceBadge.displayName = 'PresenceBadge';\n"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { BadgeProps, BadgeState } from '../Badge/index';
|
|
2
|
-
/**
|
|
3
|
-
* {@docCategory PresenceBadge}
|
|
4
|
-
*/
|
|
5
|
-
export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
|
|
6
|
-
/**
|
|
7
|
-
* {@docCategory PresenceBadge}
|
|
8
|
-
*/
|
|
9
|
-
export interface PresenceBadgeProps extends Omit<BadgeProps, 'shape' | 'appearance'> {
|
|
10
|
-
/**
|
|
11
|
-
* Represents several status
|
|
12
|
-
* @defaultvalue available
|
|
13
|
-
*/
|
|
14
|
-
status?: PresenceBadgeStatus;
|
|
15
|
-
/**
|
|
16
|
-
* Modifies the display to indicate that the user is out of office.
|
|
17
|
-
* This can be combined with any status to display an out-of-office version of that status
|
|
18
|
-
* @defaultvalue false
|
|
19
|
-
*/
|
|
20
|
-
outOfOffice?: boolean;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* {@docCategory Badge}
|
|
24
|
-
*/
|
|
25
|
-
export interface PresenceBadgeState extends Omit<BadgeState, 'shape' | 'appearance'> {
|
|
26
|
-
/**
|
|
27
|
-
* Represents several status
|
|
28
|
-
* @defaultvalue available
|
|
29
|
-
*/
|
|
30
|
-
status: PresenceBadgeStatus;
|
|
31
|
-
/**
|
|
32
|
-
* Modifies the display to indicate that the user is out of office.
|
|
33
|
-
* This can be combined with any status to display an out-of-office version of that status
|
|
34
|
-
* @defaultvalue false
|
|
35
|
-
*/
|
|
36
|
-
outOfOffice: boolean;
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PresenceBadge.types.js","sourceRoot":"../src/","sources":["components/PresenceBadge/PresenceBadge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeProps, BadgeState } from '../Badge/index';\n\n/**\n * {@docCategory PresenceBadge}\n */\nexport type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';\n\n/**\n * {@docCategory PresenceBadge}\n */\nexport interface PresenceBadgeProps extends Omit<BadgeProps, 'shape' | 'appearance'> {\n /**\n * Represents several status\n * @defaultvalue available\n */\n status?: PresenceBadgeStatus;\n /**\n * Modifies the display to indicate that the user is out of office.\n * This can be combined with any status to display an out-of-office version of that status\n * @defaultvalue false\n */\n outOfOffice?: boolean;\n}\n\n/**\n * {@docCategory Badge}\n */\nexport interface PresenceBadgeState extends Omit<BadgeState, 'shape' | 'appearance'> {\n /**\n * Represents several status\n * @defaultvalue available\n */\n status: PresenceBadgeStatus;\n /**\n * Modifies the display to indicate that the user is out of office.\n * This can be combined with any status to display an out-of-office version of that status\n * @defaultvalue false\n */\n outOfOffice: boolean;\n}\n"]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./PresenceBadge", "./PresenceBadge.types", "./usePresenceBadge", "./usePresenceBadgeStyles"], function (require, exports, tslib_1, PresenceBadge_1, PresenceBadge_types_1, usePresenceBadge_1, usePresenceBadgeStyles_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(PresenceBadge_1, exports);
|
|
5
|
-
tslib_1.__exportStar(PresenceBadge_types_1, exports);
|
|
6
|
-
tslib_1.__exportStar(usePresenceBadge_1, exports);
|
|
7
|
-
tslib_1.__exportStar(usePresenceBadgeStyles_1, exports);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/PresenceBadge/index.ts"],"names":[],"mappings":";;;IAAA,+CAAgC;IAChC,qDAAsC;IACtC,kDAAmC;IACnC,wDAAyC","sourcesContent":["export * from './PresenceBadge';\nexport * from './PresenceBadge.types';\nexport * from './usePresenceBadge';\nexport * from './usePresenceBadgeStyles';\n"]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';
|
|
3
|
-
/**
|
|
4
|
-
* Consts listing which props are shorthand props.
|
|
5
|
-
*/
|
|
6
|
-
export declare const presenceBadgeShorthandPropsCompat: (keyof PresenceBadgeProps)[];
|
|
7
|
-
/**
|
|
8
|
-
* Returns the props and state required to render the component
|
|
9
|
-
*/
|
|
10
|
-
export declare const usePresenceBadge: (props: PresenceBadgeProps, ref: React.Ref<HTMLElement>, defaultProps?: PresenceBadgeProps | undefined) => PresenceBadgeState;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "react", "@fluentui/react-utilities", "../Badge/index", "./DefaultPresenceBadgeIcons"], function (require, exports, React, react_utilities_1, index_1, DefaultPresenceBadgeIcons_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.usePresenceBadge = exports.presenceBadgeShorthandPropsCompat = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Consts listing which props are shorthand props.
|
|
7
|
-
*/
|
|
8
|
-
exports.presenceBadgeShorthandPropsCompat = ['icon'];
|
|
9
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
10
|
-
var mergeProps = react_utilities_1.makeMergePropsCompat({ deepMerge: exports.presenceBadgeShorthandPropsCompat });
|
|
11
|
-
var iconMap = function (outOfOffice) { return ({
|
|
12
|
-
busy: null,
|
|
13
|
-
available: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeCheckIcon, null),
|
|
14
|
-
away: outOfOffice ? React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null) : React.createElement(DefaultPresenceBadgeIcons_1.SkypeClockIcon, null),
|
|
15
|
-
offline: React.createElement(DefaultPresenceBadgeIcons_1.CancelIcon, null),
|
|
16
|
-
outOfOffice: React.createElement(DefaultPresenceBadgeIcons_1.SkypeArrowIcon, null),
|
|
17
|
-
doNotDisturb: React.createElement(DefaultPresenceBadgeIcons_1.SkypeMinusIcon, null),
|
|
18
|
-
}); };
|
|
19
|
-
/**
|
|
20
|
-
* Returns the props and state required to render the component
|
|
21
|
-
*/
|
|
22
|
-
var usePresenceBadge = function (props, ref, defaultProps) {
|
|
23
|
-
var _a;
|
|
24
|
-
var state = index_1.useBadge(props, ref, mergeProps({
|
|
25
|
-
size: 'small',
|
|
26
|
-
status: 'available',
|
|
27
|
-
outOfOffice: false,
|
|
28
|
-
icon: { as: 'span' },
|
|
29
|
-
}, defaultProps));
|
|
30
|
-
if (!((_a = state.icon) === null || _a === void 0 ? void 0 : _a.children)) {
|
|
31
|
-
state.icon.children = iconMap(state.outOfOffice)[state.status];
|
|
32
|
-
}
|
|
33
|
-
return state;
|
|
34
|
-
};
|
|
35
|
-
exports.usePresenceBadge = usePresenceBadge;
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=usePresenceBadge.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePresenceBadge.js","sourceRoot":"../src/","sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;IAaA;;OAEG;IACU,QAAA,iCAAiC,GAAiC,CAAC,MAAM,CAAC,CAAC;IAExF,mDAAmD;IACnD,IAAM,UAAU,GAAG,sCAAoB,CAAqB,EAAE,SAAS,EAAE,yCAAiC,EAAE,CAAC,CAAC;IAE9G,IAAM,OAAO,GAA8E,UAAA,WAAW,IAAI,OAAA,CAAC;QACzG,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,oBAAC,0CAAc,OAAG,CAAC,CAAC,CAAC,oBAAC,0CAAc,OAAG;QAChE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,oBAAC,0CAAc,OAAG,CAAC,CAAC,CAAC,oBAAC,0CAAc,OAAG;QAC3D,OAAO,EAAE,oBAAC,sCAAU,OAAG;QACvB,WAAW,EAAE,oBAAC,0CAAc,OAAG;QAC/B,YAAY,EAAE,oBAAC,0CAAc,OAAG;KACjC,CAAC,EAPwG,CAOxG,CAAC;IAEH;;OAEG;IACI,IAAM,gBAAgB,GAAG,UAC9B,KAAyB,EACzB,GAA2B,EAC3B,YAAiC;;QAEjC,IAAM,KAAK,GAAG,gBAAQ,CACpB,KAAK,EACL,GAAG,EACH,UAAU,CACR;YACE,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,WAAW;YACnB,WAAW,EAAE,KAAK;YAClB,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;SACrB,EACD,YAAY,CACC,CACM,CAAC;QAExB,IAAI,QAAC,KAAK,CAAC,IAAI,0CAAE,QAAQ,CAAA,EAAE;YACzB,KAAK,CAAC,IAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;SACjE;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAxBW,QAAA,gBAAgB,oBAwB3B","sourcesContent":["import * as React from 'react';\nimport { makeMergePropsCompat } from '@fluentui/react-utilities';\nimport { useBadge } from '../Badge/index';\nimport {\n SkypeMinusIcon,\n SkypeClockIcon,\n SkypeArrowIcon,\n SkypeCheckIcon,\n CancelIcon,\n} from './DefaultPresenceBadgeIcons';\nimport type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge.types';\nimport type { BadgeProps } from '../Badge/index';\n\n/**\n * Consts listing which props are shorthand props.\n */\nexport const presenceBadgeShorthandPropsCompat: (keyof PresenceBadgeProps)[] = ['icon'];\n\n// eslint-disable-next-line deprecation/deprecation\nconst mergeProps = makeMergePropsCompat<PresenceBadgeState>({ deepMerge: presenceBadgeShorthandPropsCompat });\n\nconst iconMap: (outOfOffice: boolean) => Record<PresenceBadgeStatus, JSX.Element | null> = outOfOffice => ({\n busy: null,\n available: outOfOffice ? <SkypeArrowIcon /> : <SkypeCheckIcon />,\n away: outOfOffice ? <SkypeArrowIcon /> : <SkypeClockIcon />,\n offline: <CancelIcon />,\n outOfOffice: <SkypeArrowIcon />,\n doNotDisturb: <SkypeMinusIcon />,\n});\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n defaultProps?: PresenceBadgeProps,\n): PresenceBadgeState => {\n const state = useBadge(\n props,\n ref,\n mergeProps(\n {\n size: 'small',\n status: 'available',\n outOfOffice: false,\n icon: { as: 'span' },\n },\n defaultProps,\n ) as BadgeProps,\n ) as PresenceBadgeState;\n\n if (!state.icon?.children) {\n state.icon!.children = iconMap(state.outOfOffice)[state.status];\n }\n\n return state;\n};\n"]}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "@fluentui/react-make-styles", "../../Badge"], function (require, exports, react_make_styles_1, Badge_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.usePresenceBadgeStyles = void 0;
|
|
5
|
-
var useStyles = react_make_styles_1.makeStyles({
|
|
6
|
-
root: function (theme) { return ({
|
|
7
|
-
padding: 0,
|
|
8
|
-
borderWidth: theme.global.strokeWidth.thick,
|
|
9
|
-
}); },
|
|
10
|
-
thinBorder: function (theme) { return ({
|
|
11
|
-
borderWidth: theme.global.strokeWidth.thin,
|
|
12
|
-
}); },
|
|
13
|
-
statusBusy: function (theme) { return ({
|
|
14
|
-
backgroundColor: theme.alias.color.red.background3,
|
|
15
|
-
borderColor: theme.alias.color.red.background3,
|
|
16
|
-
}); },
|
|
17
|
-
statusAway: function (theme) { return ({
|
|
18
|
-
backgroundColor: theme.alias.color.marigold.background3,
|
|
19
|
-
borderColor: theme.alias.color.marigold.background3,
|
|
20
|
-
}); },
|
|
21
|
-
statusAvailable: function (theme) { return ({
|
|
22
|
-
backgroundColor: theme.alias.color.lightGreen.foreground3,
|
|
23
|
-
borderColor: theme.alias.color.lightGreen.foreground3,
|
|
24
|
-
}); },
|
|
25
|
-
statusOffline: function (theme) { return ({
|
|
26
|
-
backgroundColor: theme.alias.color.neutral.neutralBackground1,
|
|
27
|
-
color: theme.alias.color.neutral.neutralForeground3,
|
|
28
|
-
borderColor: theme.alias.color.neutral.neutralForeground3,
|
|
29
|
-
}); },
|
|
30
|
-
statusOutOfOffice: function (theme) { return ({
|
|
31
|
-
backgroundColor: theme.alias.color.neutral.neutralBackground1,
|
|
32
|
-
color: theme.alias.color.berry.foreground3,
|
|
33
|
-
borderColor: theme.alias.color.berry.foreground3,
|
|
34
|
-
}); },
|
|
35
|
-
outOfOffice: function (theme) { return ({
|
|
36
|
-
backgroundColor: theme.alias.color.neutral.neutralBackground1,
|
|
37
|
-
}); },
|
|
38
|
-
outOfOfficeAvailable: function (theme) { return ({
|
|
39
|
-
color: theme.alias.color.lightGreen.foreground3,
|
|
40
|
-
}); },
|
|
41
|
-
outOfOfficeBusy: function (theme) { return ({
|
|
42
|
-
color: theme.alias.color.red.background3,
|
|
43
|
-
}); },
|
|
44
|
-
outOfOfficeAway: function (theme) { return ({
|
|
45
|
-
color: theme.alias.color.marigold.background3,
|
|
46
|
-
}); },
|
|
47
|
-
});
|
|
48
|
-
/**
|
|
49
|
-
* Applies style classnames to slots
|
|
50
|
-
*/
|
|
51
|
-
var usePresenceBadgeStyles = function (state) {
|
|
52
|
-
var styles = useStyles();
|
|
53
|
-
state.className = react_make_styles_1.mergeClasses(styles.root, (state.status === 'busy' || state.status === 'doNotDisturb') && styles.statusBusy, state.status === 'away' && styles.statusAway, state.status === 'available' && styles.statusAvailable, state.status === 'offline' && styles.statusOffline, state.status === 'outOfOffice' && styles.statusOutOfOffice, state.outOfOffice && styles.outOfOffice, state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable, state.outOfOffice && (state.status === 'busy' || state.status === 'doNotDisturb') && styles.outOfOfficeBusy, state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway, (state.size === 'smallest' || state.size === 'smaller') && styles.thinBorder, state.className);
|
|
54
|
-
return Badge_1.useBadgeStyles(state);
|
|
55
|
-
};
|
|
56
|
-
exports.usePresenceBadgeStyles = usePresenceBadgeStyles;
|
|
57
|
-
});
|
|
58
|
-
//# sourceMappingURL=usePresenceBadgeStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePresenceBadgeStyles.js","sourceRoot":"../src/","sources":["components/PresenceBadge/usePresenceBadgeStyles.ts"],"names":[],"mappings":";;;;IAIA,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;YACd,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK;SAC5C,C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D,KAAK,CAAC,MAAM,KAAK,aAAa,IAAI,MAAM,CAAC,iBAAiB,EAC1D,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,EACvC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,oBAAoB,EAChF,KAAK,CAAC,WAAW,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc,CAAC,IAAI,MAAM,CAAC,eAAe,EAC3G,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,eAAe,EACtE,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,MAAM,CAAC,UAAU,EAC5E,KAAK,CAAC,SAAS,CAChB,CAAC;QAEF,OAAO,sBAAc,CAAC,KAAK,CAAuB,CAAC;IACrD,CAAC,CAAC;IAlBW,QAAA,sBAAsB,0BAkBjC","sourcesContent":["import { mergeClasses, makeStyles } from '@fluentui/react-make-styles';\nimport { useBadgeStyles } from '../../Badge';\nimport type { PresenceBadgeState } from './PresenceBadge.types';\n\nconst useStyles = makeStyles({\n root: theme => ({\n padding: 0,\n borderWidth: theme.global.strokeWidth.thick,\n }),\n thinBorder: theme => ({\n borderWidth: theme.global.strokeWidth.thin,\n }),\n statusBusy: theme => ({\n backgroundColor: theme.alias.color.red.background3,\n borderColor: theme.alias.color.red.background3,\n }),\n statusAway: theme => ({\n backgroundColor: theme.alias.color.marigold.background3,\n borderColor: theme.alias.color.marigold.background3,\n }),\n statusAvailable: theme => ({\n backgroundColor: theme.alias.color.lightGreen.foreground3,\n borderColor: theme.alias.color.lightGreen.foreground3,\n }),\n statusOffline: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.neutral.neutralForeground3,\n borderColor: theme.alias.color.neutral.neutralForeground3,\n }),\n statusOutOfOffice: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n color: theme.alias.color.berry.foreground3,\n borderColor: theme.alias.color.berry.foreground3,\n }),\n outOfOffice: theme => ({\n backgroundColor: theme.alias.color.neutral.neutralBackground1,\n }),\n outOfOfficeAvailable: theme => ({\n color: theme.alias.color.lightGreen.foreground3,\n }),\n outOfOfficeBusy: theme => ({\n color: theme.alias.color.red.background3,\n }),\n outOfOfficeAway: theme => ({\n color: theme.alias.color.marigold.background3,\n }),\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const usePresenceBadgeStyles = (state: PresenceBadgeState): PresenceBadgeState => {\n const styles = useStyles();\n state.className = mergeClasses(\n styles.root,\n (state.status === 'busy' || state.status === 'doNotDisturb') && styles.statusBusy,\n state.status === 'away' && styles.statusAway,\n state.status === 'available' && styles.statusAvailable,\n state.status === 'offline' && styles.statusOffline,\n state.status === 'outOfOffice' && styles.statusOutOfOffice,\n state.outOfOffice && styles.outOfOffice,\n state.outOfOffice && state.status === 'available' && styles.outOfOfficeAvailable,\n state.outOfOffice && (state.status === 'busy' || state.status === 'doNotDisturb') && styles.outOfOfficeBusy,\n state.outOfOffice && state.status === 'away' && styles.outOfOfficeAway,\n (state.size === 'smallest' || state.size === 'smaller') && styles.thinBorder,\n state.className,\n );\n\n return useBadgeStyles(state) as PresenceBadgeState;\n};\n"]}
|
package/lib-amd/index.d.ts
DELETED
package/lib-amd/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
define(["require", "exports", "tslib", "./components/Badge/index", "./Badge", "./PresenceBadge", "./components/CounterBadge/index", "./CounterBadge"], function (require, exports, tslib_1, index_1, Badge_1, PresenceBadge_1, index_2, CounterBadge_1) {
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
|
5
|
-
tslib_1.__exportStar(Badge_1, exports);
|
|
6
|
-
tslib_1.__exportStar(PresenceBadge_1, exports);
|
|
7
|
-
tslib_1.__exportStar(index_2, exports);
|
|
8
|
-
tslib_1.__exportStar(CounterBadge_1, exports);
|
|
9
|
-
});
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
package/lib-amd/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAAA,uCAAyC;IACzC,uCAAwB;IACxB,+CAAgC;IAChC,uCAAgD;IAChD,8CAA+B","sourcesContent":["export * from './components/Badge/index';\nexport * from './Badge';\nexport * from './PresenceBadge';\nexport * from './components/CounterBadge/index';\nexport * from './CounterBadge';\n"]}
|