@fluentui/react-badge 9.0.12 → 9.0.13

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 (88) hide show
  1. package/CHANGELOG.json +36 -1
  2. package/CHANGELOG.md +13 -2
  3. package/lib/Badge.js.map +1 -1
  4. package/lib/CounterBadge.js.map +1 -1
  5. package/lib/PresenceBadge.js.map +1 -1
  6. package/lib/components/Badge/Badge.js.map +1 -1
  7. package/lib/components/Badge/Badge.types.js.map +1 -1
  8. package/lib/components/Badge/index.js.map +1 -1
  9. package/lib/components/Badge/renderBadge.js.map +1 -1
  10. package/lib/components/Badge/useBadge.js.map +1 -1
  11. package/lib/components/Badge/useBadgeStyles.js +12 -4
  12. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  13. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  14. package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
  15. package/lib/components/CounterBadge/index.js.map +1 -1
  16. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  17. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  18. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  19. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  20. package/lib/components/PresenceBadge/index.js.map +1 -1
  21. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
  22. package/lib/components/PresenceBadge/usePresenceBadge.js +13 -12
  23. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  24. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  25. package/lib/index.js.map +1 -1
  26. package/lib-amd/Badge.js +6 -0
  27. package/lib-amd/Badge.js.map +1 -0
  28. package/lib-amd/CounterBadge.js +6 -0
  29. package/lib-amd/CounterBadge.js.map +1 -0
  30. package/lib-amd/PresenceBadge.js +6 -0
  31. package/lib-amd/PresenceBadge.js.map +1 -0
  32. package/lib-amd/components/Badge/Badge.js +15 -0
  33. package/lib-amd/components/Badge/Badge.js.map +1 -0
  34. package/lib-amd/components/Badge/Badge.types.js +5 -0
  35. package/lib-amd/components/Badge/Badge.types.js.map +1 -0
  36. package/lib-amd/components/Badge/index.js +9 -0
  37. package/lib-amd/components/Badge/index.js.map +1 -0
  38. package/lib-amd/components/Badge/renderBadge.js +14 -0
  39. package/lib-amd/components/Badge/renderBadge.js.map +1 -0
  40. package/lib-amd/components/Badge/useBadge.js +27 -0
  41. package/lib-amd/components/Badge/useBadge.js.map +1 -0
  42. package/lib-amd/components/Badge/useBadgeStyles.js +194 -0
  43. package/lib-amd/components/Badge/useBadgeStyles.js.map +1 -0
  44. package/lib-amd/components/CounterBadge/CounterBadge.js +15 -0
  45. package/lib-amd/components/CounterBadge/CounterBadge.js.map +1 -0
  46. package/lib-amd/components/CounterBadge/CounterBadge.types.js +5 -0
  47. package/lib-amd/components/CounterBadge/CounterBadge.types.js.map +1 -0
  48. package/lib-amd/components/CounterBadge/index.js +9 -0
  49. package/lib-amd/components/CounterBadge/index.js.map +1 -0
  50. package/lib-amd/components/CounterBadge/useCounterBadge.js +18 -0
  51. package/lib-amd/components/CounterBadge/useCounterBadge.js.map +1 -0
  52. package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js +28 -0
  53. package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js.map +1 -0
  54. package/lib-amd/components/PresenceBadge/PresenceBadge.js +15 -0
  55. package/lib-amd/components/PresenceBadge/PresenceBadge.js.map +1 -0
  56. package/lib-amd/components/PresenceBadge/PresenceBadge.types.js +5 -0
  57. package/lib-amd/components/PresenceBadge/PresenceBadge.types.js.map +1 -0
  58. package/lib-amd/components/PresenceBadge/index.js +9 -0
  59. package/lib-amd/components/PresenceBadge/index.js.map +1 -0
  60. package/lib-amd/components/PresenceBadge/presenceIcons.js +132 -0
  61. package/lib-amd/components/PresenceBadge/presenceIcons.js.map +1 -0
  62. package/lib-amd/components/PresenceBadge/usePresenceBadge.js +50 -0
  63. package/lib-amd/components/PresenceBadge/usePresenceBadge.js.map +1 -0
  64. package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js +88 -0
  65. package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -0
  66. package/lib-amd/index.js +19 -0
  67. package/lib-amd/index.js.map +1 -0
  68. package/lib-commonjs/Badge.js.map +1 -1
  69. package/lib-commonjs/CounterBadge.js.map +1 -1
  70. package/lib-commonjs/PresenceBadge.js.map +1 -1
  71. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  72. package/lib-commonjs/components/Badge/index.js.map +1 -1
  73. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  74. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  75. package/lib-commonjs/components/Badge/useBadgeStyles.js +12 -4
  76. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  77. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  78. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  79. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  80. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  81. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  82. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  83. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
  84. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +13 -12
  85. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  86. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  87. package/lib-commonjs/index.js.map +1 -1
  88. package/package.json +4 -5
@@ -0,0 +1,15 @@
1
+ define(["require", "exports", "react", "./useBadge", "./useBadgeStyles", "./renderBadge"], function (require, exports, React, useBadge_1, useBadgeStyles_1, renderBadge_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Badge = void 0;
5
+ /**
6
+ * Define a styled Badge, using the `useBadge_unstable` hook.
7
+ */
8
+ exports.Badge = React.forwardRef(function (props, ref) {
9
+ var state = useBadge_1.useBadge_unstable(props, ref);
10
+ useBadgeStyles_1.useBadgeStyles_unstable(state);
11
+ return renderBadge_1.renderBadge_unstable(state);
12
+ });
13
+ exports.Badge.displayName = 'Badge';
14
+ });
15
+ //# sourceMappingURL=Badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAE/B,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useBadge_unstable } from './useBadge';\nimport { useBadgeStyles_unstable } from './useBadgeStyles';\nimport { renderBadge_unstable } from './renderBadge';\nimport type { BadgeProps } from './Badge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const Badge: ForwardRefComponent<BadgeProps> = React.forwardRef((props, ref) => {\n const state = useBadge_unstable(props, ref);\n useBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nBadge.displayName = 'Badge';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=Badge.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Badge.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/Badge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type BadgeSlots = {\n root: Slot<'div'>;\n icon?: Slot<'span'>;\n};\n\n// react has a non-standard `color` attribute in its types\n// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/a4ab0fa432320e70da9e51c8ae2e47377f65804b/types/react/index.d.ts#L1868\nexport type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & {\n /**\n * A Badge can be filled, outline, ghost, inverted\n * @defaultvalue filled\n */\n appearance?: 'filled' | 'ghost' | 'outline' | 'tint';\n\n /**\n * A Badge can be one of preset colors\n * @defaultvalue brand\n */\n color?: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';\n\n /**\n * A Badge can position the icon before or after the content.\n * @defaultvalue before\n */\n iconPosition?: 'before' | 'after';\n\n /**\n * A Badge can be square, circular or rounded.\n * @defaultvalue circular\n */\n shape?: 'circular' | 'rounded' | 'square';\n\n /**\n * A Badge can be on of several preset sizes.\n * @defaultvalue medium\n */\n size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';\n};\n\nexport type BadgeState = ComponentState<BadgeSlots> &\n Required<Pick<BadgeProps, 'appearance' | 'color' | 'iconPosition' | 'shape' | 'size'>>;\n"]}
@@ -0,0 +1,9 @@
1
+ define(["require", "exports", "tslib", "./Badge", "./renderBadge", "./useBadge", "./useBadgeStyles"], function (require, exports, tslib_1, Badge_1, renderBadge_1, useBadge_1, useBadgeStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(Badge_1, exports);
5
+ tslib_1.__exportStar(renderBadge_1, exports);
6
+ tslib_1.__exportStar(useBadge_1, exports);
7
+ tslib_1.__exportStar(useBadgeStyles_1, exports);
8
+ });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/index.ts"],"names":[],"mappings":";;;IAAA,uCAAwB;IAGxB,6CAA8B;IAC9B,0CAA2B;IAC3B,gDAAiC","sourcesContent":["export * from './Badge';\n// Explicit exports to omit BadgeCommons\nexport type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';\nexport * from './renderBadge';\nexport * from './useBadge';\nexport * from './useBadgeStyles';\n"]}
@@ -0,0 +1,14 @@
1
+ define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.renderBadge_unstable = void 0;
5
+ var renderBadge_unstable = function (state) {
6
+ var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
7
+ return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
8
+ state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
9
+ state.root.children,
10
+ state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon))));
11
+ };
12
+ exports.renderBadge_unstable = renderBadge_unstable;
13
+ });
14
+ //# sourceMappingURL=renderBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;IAIO,IAAM,oBAAoB,GAAG,UAAC,KAAiB;QAC9C,IAAA,KAAuB,0BAAQ,CAAa,KAAK,CAAC,EAAhD,KAAK,WAAA,EAAE,SAAS,eAAgC,CAAC;QAEzD,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,YAAY,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YACnF,KAAK,CAAC,IAAI,CAAC,QAAQ;YACnB,KAAK,CAAC,YAAY,KAAK,OAAO,IAAI,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACxE,CACd,CAAC;IACJ,CAAC,CAAC;IAVW,QAAA,oBAAoB,wBAU/B","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { BadgeState, BadgeSlots } from './Badge.types';\n\nexport const renderBadge_unstable = (state: BadgeState) => {\n const { slots, slotProps } = getSlots<BadgeSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.iconPosition === 'before' && slots.icon && <slots.icon {...slotProps.icon} />}\n {state.root.children}\n {state.iconPosition === 'after' && slots.icon && <slots.icon {...slotProps.icon} />}\n </slots.root>\n );\n};\n"]}
@@ -0,0 +1,27 @@
1
+ define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useBadge_unstable = void 0;
5
+ /**
6
+ * Returns the props and state required to render the component
7
+ */
8
+ var useBadge_unstable = function (props, ref) {
9
+ var _a = props.shape, shape = _a === void 0 ? 'circular' : _a, _b = props.size, size = _b === void 0 ? 'medium' : _b, _c = props.iconPosition, iconPosition = _c === void 0 ? 'before' : _c, _d = props.appearance, appearance = _d === void 0 ? 'filled' : _d, _e = props.color, color = _e === void 0 ? 'brand' : _e;
10
+ var state = {
11
+ shape: shape,
12
+ size: size,
13
+ iconPosition: iconPosition,
14
+ appearance: appearance,
15
+ color: color,
16
+ components: {
17
+ root: 'div',
18
+ icon: 'span',
19
+ },
20
+ root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref }, props)),
21
+ icon: react_utilities_1.resolveShorthand(props.icon),
22
+ };
23
+ return state;
24
+ };
25
+ exports.useBadge_unstable = useBadge_unstable;
26
+ });
27
+ //# sourceMappingURL=useBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,iBAAiB,GAAG,UAAC,KAAiB,EAAE,GAA2B;QAE5E,IAAA,KAKE,KAAK,MALW,EAAlB,KAAK,mBAAG,UAAU,KAAA,EAClB,KAIE,KAAK,KAJQ,EAAf,IAAI,mBAAG,QAAQ,KAAA,EACf,KAGE,KAAK,aAHgB,EAAvB,YAAY,mBAAG,QAAQ,KAAA,EACvB,KAEE,KAAK,WAFc,EAArB,UAAU,mBAAG,QAAQ,KAAA,EACrB,KACE,KAAK,MADQ,EAAf,KAAK,mBAAG,OAAO,KAAA,CACP;QAEV,IAAM,KAAK,GAAe;YACxB,KAAK,OAAA;YACL,IAAI,MAAA;YACJ,YAAY,cAAA;YACZ,UAAU,YAAA;YACV,KAAK,OAAA;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;gBACX,IAAI,EAAE,MAAM;aACb;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,IACA,KAAK,EACR;YACF,IAAI,EAAE,kCAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;SACnC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IA3BW,QAAA,iBAAiB,qBA2B5B","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';\nimport type { BadgeProps, BadgeState } from './Badge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useBadge_unstable = (props: BadgeProps, ref: React.Ref<HTMLElement>): BadgeState => {\n const {\n shape = 'circular',\n size = 'medium',\n iconPosition = 'before',\n appearance = 'filled',\n color = 'brand',\n } = props;\n\n const state: BadgeState = {\n shape,\n size,\n iconPosition,\n appearance,\n color,\n components: {\n root: 'div',\n icon: 'span',\n },\n root: getNativeElementProps('div', {\n ref,\n ...props,\n }),\n icon: resolveShorthand(props.icon),\n };\n\n return state;\n};\n"]}
@@ -0,0 +1,194 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_theme_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useBadgeStyles_unstable = exports.badgeClassNames = void 0;
5
+ exports.badgeClassNames = {
6
+ root: 'fui-Badge',
7
+ icon: 'fui-Badge__icon',
8
+ };
9
+ // The text content of the badge has additional horizontal padding, but there is no `text` slot to add that padding to.
10
+ // Instead, add extra padding to the root, and a negative margin on the icon to "remove" the extra padding on the icon.
11
+ var textPadding = react_theme_1.tokens.spacingHorizontalXXS;
12
+ var useRootStyles = react_1.makeStyles({
13
+ base: tslib_1.__assign({ display: 'inline-flex', boxSizing: 'border-box', alignItems: 'center', justifyContent: 'center', position: 'relative' }, react_theme_1.typographyStyles.caption1Strong),
14
+ fontSmallToTiny: tslib_1.__assign({}, react_theme_1.typographyStyles.caption2Strong),
15
+ // size
16
+ tiny: {
17
+ width: '6px',
18
+ height: '6px',
19
+ fontSize: '4px',
20
+ lineHeight: '4px',
21
+ },
22
+ 'extra-small': {
23
+ width: '10px',
24
+ height: '10px',
25
+ fontSize: '6px',
26
+ lineHeight: '6px',
27
+ },
28
+ small: tslib_1.__assign({ minWidth: '16px', height: '16px' }, react_1.shorthands.padding(0, "calc(" + react_theme_1.tokens.spacingHorizontalXXS + " + " + textPadding + ")")),
29
+ medium: tslib_1.__assign({ height: '20px', minWidth: '20px' }, react_1.shorthands.padding(0, "calc(" + react_theme_1.tokens.spacingHorizontalXS + " + " + textPadding + ")")),
30
+ large: tslib_1.__assign({ minWidth: '24px', height: '24px' }, react_1.shorthands.padding(0, "calc(" + react_theme_1.tokens.spacingHorizontalXS + " + " + textPadding + ")")),
31
+ 'extra-large': tslib_1.__assign({ minWidth: '32px', height: '32px' }, react_1.shorthands.padding(0, "calc(" + react_theme_1.tokens.spacingHorizontalSNudge + " + " + textPadding + ")")),
32
+ // shape
33
+ square: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusNone)),
34
+ rounded: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusMedium)),
35
+ roundedSmallToTiny: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusSmall)),
36
+ circular: tslib_1.__assign({}, react_1.shorthands.borderRadius(react_theme_1.tokens.borderRadiusCircular)),
37
+ // border (all appearances except ghost)
38
+ border: {
39
+ // The border is applied in an :after pseudo-element because it should not affect layout.
40
+ // The padding and size of the badge should be the same regardless of whether or not it has a border.
41
+ '::after': tslib_1.__assign(tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({ content: '""', position: 'absolute', top: 0, left: 0, bottom: 0, right: 0 }, react_1.shorthands.borderStyle('solid')), react_1.shorthands.borderWidth(react_theme_1.tokens.strokeWidthThin)), react_1.shorthands.borderColor('inherit')), react_1.shorthands.borderRadius('inherit')),
42
+ },
43
+ // appearance: filled
44
+ filled: tslib_1.__assign({}, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
45
+ 'filled-brand': {
46
+ backgroundColor: react_theme_1.tokens.colorBrandBackground,
47
+ color: react_theme_1.tokens.colorNeutralForegroundOnBrand,
48
+ },
49
+ 'filled-danger': {
50
+ backgroundColor: react_theme_1.tokens.colorPaletteRedBackground3,
51
+ color: react_theme_1.tokens.colorNeutralForegroundOnBrand,
52
+ },
53
+ 'filled-important': {
54
+ backgroundColor: react_theme_1.tokens.colorNeutralForeground1,
55
+ color: react_theme_1.tokens.colorNeutralBackground1,
56
+ },
57
+ 'filled-informative': {
58
+ backgroundColor: react_theme_1.tokens.colorNeutralBackground5,
59
+ color: react_theme_1.tokens.colorNeutralForeground3,
60
+ },
61
+ 'filled-severe': {
62
+ backgroundColor: react_theme_1.tokens.colorPaletteDarkOrangeBackground3,
63
+ color: react_theme_1.tokens.colorNeutralForegroundOnBrand,
64
+ },
65
+ 'filled-subtle': {
66
+ backgroundColor: react_theme_1.tokens.colorNeutralBackground1,
67
+ color: react_theme_1.tokens.colorNeutralForeground1,
68
+ },
69
+ 'filled-success': {
70
+ backgroundColor: react_theme_1.tokens.colorPaletteGreenBackground3,
71
+ color: react_theme_1.tokens.colorNeutralForegroundOnBrand,
72
+ },
73
+ 'filled-warning': {
74
+ backgroundColor: react_theme_1.tokens.colorPaletteYellowBackground3,
75
+ color: react_theme_1.tokens.colorNeutralForeground1Static,
76
+ },
77
+ // appearance: ghost
78
+ ghost: {
79
+ // No shared colors between ghost appearances
80
+ },
81
+ 'ghost-brand': {
82
+ color: react_theme_1.tokens.colorBrandForeground1,
83
+ },
84
+ 'ghost-danger': {
85
+ color: react_theme_1.tokens.colorPaletteRedForeground3,
86
+ },
87
+ 'ghost-important': {
88
+ color: react_theme_1.tokens.colorNeutralForeground1,
89
+ },
90
+ 'ghost-informative': {
91
+ color: react_theme_1.tokens.colorNeutralForeground3,
92
+ },
93
+ 'ghost-severe': {
94
+ color: react_theme_1.tokens.colorPaletteDarkOrangeForeground3,
95
+ },
96
+ 'ghost-subtle': {
97
+ color: react_theme_1.tokens.colorNeutralForegroundStaticInverted,
98
+ },
99
+ 'ghost-success': {
100
+ color: react_theme_1.tokens.colorPaletteGreenForeground3,
101
+ },
102
+ 'ghost-warning': {
103
+ color: react_theme_1.tokens.colorPaletteYellowForeground2,
104
+ },
105
+ // appearance: outline
106
+ outline: tslib_1.__assign({}, react_1.shorthands.borderColor('currentColor')),
107
+ 'outline-brand': {
108
+ color: react_theme_1.tokens.colorBrandForeground1,
109
+ },
110
+ 'outline-danger': tslib_1.__assign({ color: react_theme_1.tokens.colorPaletteRedForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteRedBorder2)),
111
+ 'outline-important': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStrokeAccessible)),
112
+ 'outline-informative': tslib_1.__assign({ color: react_theme_1.tokens.colorNeutralForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke2)),
113
+ 'outline-severe': {
114
+ color: react_theme_1.tokens.colorPaletteDarkOrangeForeground3,
115
+ },
116
+ 'outline-subtle': {
117
+ color: react_theme_1.tokens.colorNeutralForegroundStaticInverted,
118
+ },
119
+ 'outline-success': tslib_1.__assign({ color: react_theme_1.tokens.colorPaletteGreenForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteGreenBorder2)),
120
+ 'outline-warning': {
121
+ color: react_theme_1.tokens.colorPaletteYellowForeground2,
122
+ },
123
+ // appearance: tint
124
+ tint: {
125
+ // No shared colors between tint appearances
126
+ },
127
+ 'tint-brand': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorBrandBackground2, color: react_theme_1.tokens.colorBrandForeground2 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorBrandStroke2)),
128
+ 'tint-danger': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorPaletteRedBackground1, color: react_theme_1.tokens.colorPaletteRedForeground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteRedBorder1)),
129
+ 'tint-important': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralForeground3, color: react_theme_1.tokens.colorNeutralBackground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorTransparentStroke)),
130
+ 'tint-informative': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackground4, color: react_theme_1.tokens.colorNeutralForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke2)),
131
+ 'tint-severe': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorPaletteDarkOrangeBackground1, color: react_theme_1.tokens.colorPaletteDarkOrangeForeground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteDarkOrangeBorder1)),
132
+ 'tint-subtle': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorNeutralBackground1, color: react_theme_1.tokens.colorNeutralForeground3 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorNeutralStroke2)),
133
+ 'tint-success': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorPaletteGreenBackground1, color: react_theme_1.tokens.colorPaletteGreenForeground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteGreenBorder1)),
134
+ 'tint-warning': tslib_1.__assign({ backgroundColor: react_theme_1.tokens.colorPaletteYellowBackground1, color: react_theme_1.tokens.colorPaletteYellowForeground1 }, react_1.shorthands.borderColor(react_theme_1.tokens.colorPaletteYellowBorder1)),
135
+ });
136
+ var useIconStyles = react_1.makeStyles({
137
+ base: tslib_1.__assign({ display: 'flex', lineHeight: '1' }, react_1.shorthands.margin(0, "calc(-1 * " + textPadding + ")")),
138
+ beforeText: {
139
+ marginRight: "calc(" + react_theme_1.tokens.spacingHorizontalXXS + " + " + textPadding + ")",
140
+ },
141
+ afterText: {
142
+ marginLeft: "calc(" + react_theme_1.tokens.spacingHorizontalXXS + " + " + textPadding + ")",
143
+ },
144
+ beforeTextXL: {
145
+ marginRight: "calc(" + react_theme_1.tokens.spacingHorizontalXS + " + " + textPadding + ")",
146
+ },
147
+ afterTextXL: {
148
+ marginLeft: "calc(" + react_theme_1.tokens.spacingHorizontalXS + " + " + textPadding + ")",
149
+ },
150
+ // size
151
+ tiny: {
152
+ fontSize: '6px',
153
+ },
154
+ 'extra-small': {
155
+ fontSize: '10px',
156
+ },
157
+ small: {
158
+ fontSize: '12px',
159
+ },
160
+ medium: {
161
+ fontSize: '12px',
162
+ },
163
+ large: {
164
+ fontSize: '16px',
165
+ },
166
+ 'extra-large': {
167
+ fontSize: '20px',
168
+ },
169
+ });
170
+ /**
171
+ * Applies style classnames to slots
172
+ */
173
+ var useBadgeStyles_unstable = function (state) {
174
+ var rootStyles = useRootStyles();
175
+ var smallToTiny = state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny';
176
+ state.root.className = react_1.mergeClasses(exports.badgeClassNames.root, rootStyles.base, smallToTiny && rootStyles.fontSmallToTiny, rootStyles[state.size], rootStyles[state.shape], state.shape === 'rounded' && smallToTiny && rootStyles.roundedSmallToTiny, state.appearance !== 'ghost' && rootStyles.border, rootStyles[state.appearance], rootStyles[state.appearance + "-" + state.color], state.root.className);
177
+ var iconStyles = useIconStyles();
178
+ if (state.icon) {
179
+ var iconPositionClass = void 0;
180
+ if (state.root.children) {
181
+ if (state.size === 'extra-large') {
182
+ iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterTextXL : iconStyles.beforeTextXL;
183
+ }
184
+ else {
185
+ iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterText : iconStyles.beforeText;
186
+ }
187
+ }
188
+ state.icon.className = react_1.mergeClasses(exports.badgeClassNames.icon, iconStyles.base, iconPositionClass, iconStyles[state.size], state.icon.className);
189
+ }
190
+ return state;
191
+ };
192
+ exports.useBadgeStyles_unstable = useBadgeStyles_unstable;
193
+ });
194
+ //# sourceMappingURL=useBadgeStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useBadgeStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/Badge/useBadgeStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,eAAe,GAA+B;QACzD,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,iBAAiB;KACxB,CAAC;IAEF,uHAAuH;IACvH,uHAAuH;IACvH,IAAM,WAAW,GAAG,oBAAM,CAAC,oBAAoB,CAAC;IAEhD,IAAM,aAAa,GAAG,kBAAU,CAAC;QAC/B,IAAI,qBACF,OAAO,EAAE,aAAa,EACtB,SAAS,EAAE,YAAY,EACvB,UAAU,EAAE,QAAQ,EACpB,cAAc,EAAE,QAAQ,EACxB,QAAQ,EAAE,UAAU,IACjB,8BAAgB,CAAC,cAAc,CACnC;QAED,eAAe,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e,CAAC,IAAI,EACpB,UAAU,CAAC,IAAI,EACf,iBAAiB,EACjB,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,EACtB,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;SACH;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAvCW,QAAA,uBAAuB,2BAuClC","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { BadgeSlots, BadgeState } from './Badge.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const badgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-Badge',\n icon: 'fui-Badge__icon',\n};\n\n// The text content of the badge has additional horizontal padding, but there is no `text` slot to add that padding to.\n// Instead, add extra padding to the root, and a negative margin on the icon to \"remove\" the extra padding on the icon.\nconst textPadding = tokens.spacingHorizontalXXS;\n\nconst useRootStyles = makeStyles({\n base: {\n display: 'inline-flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n ...typographyStyles.caption1Strong,\n },\n\n fontSmallToTiny: {\n ...typographyStyles.caption2Strong,\n },\n\n // size\n\n tiny: {\n width: '6px',\n height: '6px',\n fontSize: '4px',\n lineHeight: '4px',\n },\n 'extra-small': {\n width: '10px',\n height: '10px',\n fontSize: '6px',\n lineHeight: '6px',\n },\n small: {\n minWidth: '16px',\n height: '16px',\n ...shorthands.padding(0, `calc(${tokens.spacingHorizontalXXS} + ${textPadding})`),\n },\n medium: {\n height: '20px',\n minWidth: '20px',\n ...shorthands.padding(0, `calc(${tokens.spacingHorizontalXS} + ${textPadding})`),\n },\n large: {\n minWidth: '24px',\n height: '24px',\n ...shorthands.padding(0, `calc(${tokens.spacingHorizontalXS} + ${textPadding})`),\n },\n 'extra-large': {\n minWidth: '32px',\n height: '32px',\n ...shorthands.padding(0, `calc(${tokens.spacingHorizontalSNudge} + ${textPadding})`),\n },\n\n // shape\n\n square: {\n ...shorthands.borderRadius(tokens.borderRadiusNone),\n },\n rounded: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n },\n roundedSmallToTiny: {\n ...shorthands.borderRadius(tokens.borderRadiusSmall),\n },\n circular: {\n ...shorthands.borderRadius(tokens.borderRadiusCircular),\n },\n\n // border (all appearances except ghost)\n\n border: {\n // The border is applied in an :after pseudo-element because it should not affect layout.\n // The padding and size of the badge should be the same regardless of whether or not it has a border.\n '::after': {\n content: '\"\"',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n ...shorthands.borderStyle('solid'),\n ...shorthands.borderWidth(tokens.strokeWidthThin),\n ...shorthands.borderColor('inherit'),\n ...shorthands.borderRadius('inherit'),\n },\n },\n\n // appearance: filled\n\n filled: {\n // Use a transparent stroke (rather than no border) so the border is visible in high contrast\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n 'filled-brand': {\n backgroundColor: tokens.colorBrandBackground,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n 'filled-danger': {\n backgroundColor: tokens.colorPaletteRedBackground3,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n 'filled-important': {\n backgroundColor: tokens.colorNeutralForeground1,\n color: tokens.colorNeutralBackground1,\n },\n 'filled-informative': {\n backgroundColor: tokens.colorNeutralBackground5,\n color: tokens.colorNeutralForeground3,\n },\n 'filled-severe': {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground3,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n 'filled-subtle': {\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground1,\n },\n 'filled-success': {\n backgroundColor: tokens.colorPaletteGreenBackground3,\n color: tokens.colorNeutralForegroundOnBrand,\n },\n 'filled-warning': {\n backgroundColor: tokens.colorPaletteYellowBackground3,\n color: tokens.colorNeutralForeground1Static,\n },\n\n // appearance: ghost\n\n ghost: {\n // No shared colors between ghost appearances\n },\n 'ghost-brand': {\n color: tokens.colorBrandForeground1,\n },\n 'ghost-danger': {\n color: tokens.colorPaletteRedForeground3,\n },\n 'ghost-important': {\n color: tokens.colorNeutralForeground1,\n },\n 'ghost-informative': {\n color: tokens.colorNeutralForeground3,\n },\n 'ghost-severe': {\n color: tokens.colorPaletteDarkOrangeForeground3,\n },\n 'ghost-subtle': {\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n 'ghost-success': {\n color: tokens.colorPaletteGreenForeground3,\n },\n 'ghost-warning': {\n color: tokens.colorPaletteYellowForeground2,\n },\n\n // appearance: outline\n\n outline: {\n ...shorthands.borderColor('currentColor'),\n },\n 'outline-brand': {\n color: tokens.colorBrandForeground1,\n },\n 'outline-danger': {\n color: tokens.colorPaletteRedForeground3,\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n 'outline-important': {\n color: tokens.colorNeutralForeground3,\n ...shorthands.borderColor(tokens.colorNeutralStrokeAccessible),\n },\n 'outline-informative': {\n color: tokens.colorNeutralForeground3,\n ...shorthands.borderColor(tokens.colorNeutralStroke2),\n },\n 'outline-severe': {\n color: tokens.colorPaletteDarkOrangeForeground3,\n },\n 'outline-subtle': {\n color: tokens.colorNeutralForegroundStaticInverted,\n },\n 'outline-success': {\n color: tokens.colorPaletteGreenForeground3,\n ...shorthands.borderColor(tokens.colorPaletteGreenBorder2),\n },\n 'outline-warning': {\n color: tokens.colorPaletteYellowForeground2,\n },\n\n // appearance: tint\n\n tint: {\n // No shared colors between tint appearances\n },\n 'tint-brand': {\n backgroundColor: tokens.colorBrandBackground2,\n color: tokens.colorBrandForeground2,\n ...shorthands.borderColor(tokens.colorBrandStroke2),\n },\n 'tint-danger': {\n backgroundColor: tokens.colorPaletteRedBackground1,\n color: tokens.colorPaletteRedForeground1,\n ...shorthands.borderColor(tokens.colorPaletteRedBorder1),\n },\n 'tint-important': {\n backgroundColor: tokens.colorNeutralForeground3,\n color: tokens.colorNeutralBackground1,\n ...shorthands.borderColor(tokens.colorTransparentStroke),\n },\n 'tint-informative': {\n backgroundColor: tokens.colorNeutralBackground4,\n color: tokens.colorNeutralForeground3,\n ...shorthands.borderColor(tokens.colorNeutralStroke2),\n },\n 'tint-severe': {\n backgroundColor: tokens.colorPaletteDarkOrangeBackground1,\n color: tokens.colorPaletteDarkOrangeForeground1,\n ...shorthands.borderColor(tokens.colorPaletteDarkOrangeBorder1),\n },\n 'tint-subtle': {\n backgroundColor: tokens.colorNeutralBackground1,\n color: tokens.colorNeutralForeground3,\n ...shorthands.borderColor(tokens.colorNeutralStroke2),\n },\n 'tint-success': {\n backgroundColor: tokens.colorPaletteGreenBackground1,\n color: tokens.colorPaletteGreenForeground1,\n ...shorthands.borderColor(tokens.colorPaletteGreenBorder1),\n },\n 'tint-warning': {\n backgroundColor: tokens.colorPaletteYellowBackground1,\n color: tokens.colorPaletteYellowForeground1,\n ...shorthands.borderColor(tokens.colorPaletteYellowBorder1),\n },\n});\n\nconst useIconStyles = makeStyles({\n base: {\n display: 'flex',\n lineHeight: '1',\n ...shorthands.margin(0, `calc(-1 * ${textPadding})`), // Remove text padding added to root\n },\n\n beforeText: {\n marginRight: `calc(${tokens.spacingHorizontalXXS} + ${textPadding})`,\n },\n afterText: {\n marginLeft: `calc(${tokens.spacingHorizontalXXS} + ${textPadding})`,\n },\n\n beforeTextXL: {\n marginRight: `calc(${tokens.spacingHorizontalXS} + ${textPadding})`,\n },\n afterTextXL: {\n marginLeft: `calc(${tokens.spacingHorizontalXS} + ${textPadding})`,\n },\n\n // size\n\n tiny: {\n fontSize: '6px',\n },\n 'extra-small': {\n fontSize: '10px',\n },\n small: {\n fontSize: '12px',\n },\n medium: {\n fontSize: '12px',\n },\n large: {\n fontSize: '16px',\n },\n 'extra-large': {\n fontSize: '20px',\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const useBadgeStyles_unstable = (state: BadgeState): BadgeState => {\n const rootStyles = useRootStyles();\n\n const smallToTiny = state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny';\n\n state.root.className = mergeClasses(\n badgeClassNames.root,\n rootStyles.base,\n smallToTiny && rootStyles.fontSmallToTiny,\n rootStyles[state.size],\n rootStyles[state.shape],\n state.shape === 'rounded' && smallToTiny && rootStyles.roundedSmallToTiny,\n state.appearance !== 'ghost' && rootStyles.border,\n rootStyles[state.appearance],\n rootStyles[`${state.appearance}-${state.color}` as const],\n state.root.className,\n );\n\n const iconStyles = useIconStyles();\n if (state.icon) {\n let iconPositionClass;\n if (state.root.children) {\n if (state.size === 'extra-large') {\n iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterTextXL : iconStyles.beforeTextXL;\n } else {\n iconPositionClass = state.iconPosition === 'after' ? iconStyles.afterText : iconStyles.beforeText;\n }\n }\n\n state.icon.className = mergeClasses(\n badgeClassNames.icon,\n iconStyles.base,\n iconPositionClass,\n iconStyles[state.size],\n state.icon.className,\n );\n }\n\n return state;\n};\n"]}
@@ -0,0 +1,15 @@
1
+ define(["require", "exports", "react", "./useCounterBadge", "./useCounterBadgeStyles", "../Badge/index"], function (require, exports, React, useCounterBadge_1, useCounterBadgeStyles_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CounterBadge = void 0;
5
+ /**
6
+ * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.
7
+ */
8
+ exports.CounterBadge = React.forwardRef(function (props, ref) {
9
+ var state = useCounterBadge_1.useCounterBadge_unstable(props, ref);
10
+ useCounterBadgeStyles_1.useCounterBadgeStyles_unstable(state);
11
+ return index_1.renderBadge_unstable(state);
12
+ });
13
+ exports.CounterBadge.displayName = 'CounterBadge';
14
+ });
15
+ //# sourceMappingURL=CounterBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CounterBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/CounterBadge/CounterBadge.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,YAAY,GAA2C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAC9F,IAAM,KAAK,GAAG,0CAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACnD,sDAA8B,CAAC,KAAK,CAAC,CAAC;QAEtC,OAAO,4BAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import * as React from 'react';\nimport { useCounterBadge_unstable } from './useCounterBadge';\nimport { useCounterBadgeStyles_unstable } from './useCounterBadgeStyles';\nimport { renderBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps } from './CounterBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.\n */\nexport const CounterBadge: ForwardRefComponent<CounterBadgeProps> = React.forwardRef((props, ref) => {\n const state = useCounterBadge_unstable(props, ref);\n useCounterBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nCounterBadge.displayName = 'CounterBadge';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=CounterBadge.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CounterBadge.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/CounterBadge/CounterBadge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeProps, BadgeState } from '../Badge/index';\n\nexport type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'color' | 'shape'> & {\n /**\n * A Badge can have different appearances that emphasize certain parts of it:\n * - filled: The default appearance if one is not specified.\n * The badge background is filled with color with a contrasting foreground text to match.\n * - ghost: The badge background is transparent, with the foreground text taking color to emphasize it.\n * @default filled\n */\n appearance?: 'filled' | 'ghost';\n\n /**\n * Semantic colors for a counter badge\n * @default brand\n */\n color?: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;\n\n /**\n * Value displayed by the Badge\n * @default 0\n */\n count?: number;\n\n /**\n * If a dot should be displayed without the count\n * @default false\n */\n dot?: boolean;\n\n /**\n * Max number to be displayed\n * @default 99\n */\n overflowCount?: number;\n\n /**\n * A Badge can be circular or rounded\n * @default circular\n */\n shape?: 'circular' | 'rounded';\n\n /**\n * If the badge should be shown when count is 0\n * @default false\n */\n showZero?: boolean;\n};\n\nexport type CounterBadgeState = Omit<BadgeState, 'appearance' | 'color' | 'shape'> &\n Required<Pick<CounterBadgeProps, 'appearance' | 'color' | 'count' | 'dot' | 'shape' | 'showZero'>>;\n"]}
@@ -0,0 +1,9 @@
1
+ define(["require", "exports", "tslib", "./CounterBadge", "./CounterBadge.types", "./useCounterBadge", "./useCounterBadgeStyles"], function (require, exports, tslib_1, CounterBadge_1, CounterBadge_types_1, useCounterBadge_1, useCounterBadgeStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ tslib_1.__exportStar(CounterBadge_1, exports);
5
+ tslib_1.__exportStar(CounterBadge_types_1, exports);
6
+ tslib_1.__exportStar(useCounterBadge_1, exports);
7
+ tslib_1.__exportStar(useCounterBadgeStyles_1, exports);
8
+ });
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/CounterBadge/index.ts"],"names":[],"mappings":";;;IAAA,8CAA+B;IAC/B,oDAAqC;IACrC,iDAAkC;IAClC,uDAAwC","sourcesContent":["export * from './CounterBadge';\nexport * from './CounterBadge.types';\nexport * from './useCounterBadge';\nexport * from './useCounterBadgeStyles';\n"]}
@@ -0,0 +1,18 @@
1
+ define(["require", "exports", "tslib", "../Badge/index"], function (require, exports, tslib_1, index_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useCounterBadge_unstable = void 0;
5
+ /**
6
+ * Returns the props and state required to render the component
7
+ */
8
+ var useCounterBadge_unstable = function (props, ref) {
9
+ var _a = props.shape, shape = _a === void 0 ? 'circular' : _a, _b = props.appearance, appearance = _b === void 0 ? 'filled' : _b, _c = props.showZero, showZero = _c === void 0 ? false : _c, _d = props.overflowCount, overflowCount = _d === void 0 ? 99 : _d, _e = props.count, count = _e === void 0 ? 0 : _e, _f = props.dot, dot = _f === void 0 ? false : _f;
10
+ var state = tslib_1.__assign(tslib_1.__assign({}, index_1.useBadge_unstable(props, ref)), { shape: shape, appearance: appearance, showZero: showZero, count: count, dot: dot });
11
+ if ((count !== 0 || showZero) && !dot && !state.root.children) {
12
+ state.root.children = count > overflowCount ? overflowCount + "+" : "" + count;
13
+ }
14
+ return state;
15
+ };
16
+ exports.useCounterBadge_unstable = useCounterBadge_unstable;
17
+ });
18
+ //# sourceMappingURL=useCounterBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCounterBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/CounterBadge/useCounterBadge.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,wBAAwB,GAAG,UAAC,KAAwB,EAAE,GAA2B;QAE1F,IAAA,KAME,KAAK,MANW,EAAlB,KAAK,mBAAG,UAAU,KAAA,EAClB,KAKE,KAAK,WALc,EAArB,UAAU,mBAAG,QAAQ,KAAA,EACrB,KAIE,KAAK,SAJS,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,KAGE,KAAK,cAHW,EAAlB,aAAa,mBAAG,EAAE,KAAA,EAClB,KAEE,KAAK,MAFE,EAAT,KAAK,mBAAG,CAAC,KAAA,EACT,KACE,KAAK,IADI,EAAX,GAAG,mBAAG,KAAK,KAAA,CACH;QAEV,IAAM,KAAK,yCACL,yBAAiB,CAAC,KAAK,EAAE,GAAG,CAA+C,KAC/E,KAAK,OAAA,EACL,UAAU,YAAA,EACV,QAAQ,UAAA,EACR,KAAK,OAAA,EACL,GAAG,KAAA,GACJ,CAAC;QAEF,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC7D,KAAK,CAAC,IAAI,CAAC,QAAQ,GAAG,KAAK,GAAG,aAAa,CAAC,CAAC,CAAI,aAAa,MAAG,CAAC,CAAC,CAAC,KAAG,KAAO,CAAC;SAChF;QAED,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAxBW,QAAA,wBAAwB,4BAwBnC","sourcesContent":["import * as React from 'react';\nimport type { BadgeState } from '../Badge/index';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useCounterBadge_unstable = (props: CounterBadgeProps, ref: React.Ref<HTMLElement>): CounterBadgeState => {\n const {\n shape = 'circular',\n appearance = 'filled',\n showZero = false,\n overflowCount = 99,\n count = 0,\n dot = false,\n } = props;\n\n const state: CounterBadgeState = {\n ...(useBadge_unstable(props, ref) as Pick<CounterBadgeState, keyof BadgeState>),\n shape,\n appearance,\n showZero,\n count,\n dot,\n };\n\n if ((count !== 0 || showZero) && !dot && !state.root.children) {\n state.root.children = count > overflowCount ? `${overflowCount}+` : `${count}`;\n }\n\n return state;\n};\n"]}
@@ -0,0 +1,28 @@
1
+ define(["require", "exports", "tslib", "@griffel/react", "../Badge/useBadgeStyles"], function (require, exports, tslib_1, react_1, useBadgeStyles_1) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useCounterBadgeStyles_unstable = exports.counterBadgeClassNames = void 0;
5
+ exports.counterBadgeClassNames = {
6
+ root: 'fui-CounterBadge',
7
+ icon: 'fui-CounterBadge__icon',
8
+ };
9
+ var useStyles = react_1.makeStyles({
10
+ dot: tslib_1.__assign({ minWidth: 'auto', width: '6px', height: '6px' }, react_1.shorthands.padding('0')),
11
+ hide: {
12
+ display: 'none',
13
+ },
14
+ });
15
+ /**
16
+ * Applies style classnames to slots
17
+ */
18
+ var useCounterBadgeStyles_unstable = function (state) {
19
+ var styles = useStyles();
20
+ state.root.className = react_1.mergeClasses(exports.counterBadgeClassNames.root, state.dot && styles.dot, !state.root.children && !state.dot && styles.hide, state.root.className);
21
+ if (state.icon) {
22
+ state.icon.className = react_1.mergeClasses(exports.counterBadgeClassNames.icon, state.icon.className);
23
+ }
24
+ return useBadgeStyles_1.useBadgeStyles_unstable(state);
25
+ };
26
+ exports.useCounterBadgeStyles_unstable = useCounterBadgeStyles_unstable;
27
+ });
28
+ //# sourceMappingURL=useCounterBadgeStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCounterBadgeStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/CounterBadge/useCounterBadgeStyles.ts"],"names":[],"mappings":";;;;IAMa,QAAA,sBAAsB,GAA+B;QAChE,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,wBAAwB;KAC/B,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,GAAG,qBACD,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,KAAK,IACV,kBAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAC3B;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,MAAM;SAChB;KACF,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAAwB;QACrE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CACjC,8BAAsB,CAAC,IAAI,EAC3B,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,GAAG,EACvB,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,EACjD,KAAK,CAAC,IAAI,CAAC,SAAS,CACrB,CAAC;QAEF,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,8BAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SACxF;QAED,OAAO,wCAAuB,CAAC,KAAK,CAAsB,CAAC;IAC7D,CAAC,CAAC;IAdW,QAAA,8BAA8B,kCAczC","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { useBadgeStyles_unstable } from '../Badge/useBadgeStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { BadgeSlots } from '../Badge/Badge.types';\nimport type { CounterBadgeState } from './CounterBadge.types';\n\nexport const counterBadgeClassNames: SlotClassNames<BadgeSlots> = {\n root: 'fui-CounterBadge',\n icon: 'fui-CounterBadge__icon',\n};\n\nconst useStyles = makeStyles({\n dot: {\n minWidth: 'auto',\n width: '6px',\n height: '6px',\n ...shorthands.padding('0'),\n },\n hide: {\n display: 'none',\n },\n});\n\n/**\n * Applies style classnames to slots\n */\nexport const useCounterBadgeStyles_unstable = (state: CounterBadgeState): CounterBadgeState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n counterBadgeClassNames.root,\n state.dot && styles.dot,\n !state.root.children && !state.dot && styles.hide,\n state.root.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(counterBadgeClassNames.icon, state.icon.className);\n }\n\n return useBadgeStyles_unstable(state) as CounterBadgeState;\n};\n"]}
@@ -0,0 +1,15 @@
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_unstable` hook.
7
+ */
8
+ exports.PresenceBadge = React.forwardRef(function (props, ref) {
9
+ var state = usePresenceBadge_1.usePresenceBadge_unstable(props, ref);
10
+ usePresenceBadgeStyles_1.usePresenceBadgeStyles_unstable(state);
11
+ return Badge_1.renderBadge_unstable(state);
12
+ });
13
+ exports.PresenceBadge.displayName = 'PresenceBadge';
14
+ });
15
+ //# sourceMappingURL=PresenceBadge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenceBadge.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/PresenceBadge.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,aAAa,GAA4C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChG,IAAM,KAAK,GAAG,4CAAyB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACpD,wDAA+B,CAAC,KAAK,CAAC,CAAC;QAEvC,OAAO,4BAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import * as React from 'react';\nimport { usePresenceBadge_unstable } from './usePresenceBadge';\nimport { usePresenceBadgeStyles_unstable } from './usePresenceBadgeStyles';\nimport { renderBadge_unstable } from '../../Badge';\nimport type { PresenceBadgeProps } from './PresenceBadge.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Define a styled Badge, using the `useBadge_unstable` hook.\n */\nexport const PresenceBadge: ForwardRefComponent<PresenceBadgeProps> = React.forwardRef((props, ref) => {\n const state = usePresenceBadge_unstable(props, ref);\n usePresenceBadgeStyles_unstable(state);\n\n return renderBadge_unstable(state);\n});\n\nPresenceBadge.displayName = 'PresenceBadge';\n"]}
@@ -0,0 +1,5 @@
1
+ define(["require", "exports"], function (require, exports) {
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ });
5
+ //# sourceMappingURL=PresenceBadge.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresenceBadge.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/components/PresenceBadge/PresenceBadge.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { BadgeProps, BadgeState, BadgeSlots } from '../Badge/Badge.types';\n\nexport type PresenceBadgeStatus =\n | 'busy'\n | 'out-of-office'\n | 'away'\n | 'available'\n | 'offline'\n | 'do-not-disturb'\n | 'unknown';\n\nexport type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root' | 'icon'>>, 'color'> &\n Pick<BadgeProps, 'size'> & {\n /**\n * Represents several status\n * @default available\n */\n status?: PresenceBadgeStatus;\n\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 * @default false\n */\n outOfOffice?: boolean;\n };\n\nexport type PresenceBadgeState = ComponentState<BadgeSlots> &\n BadgeState &\n Required<Pick<PresenceBadgeProps, 'status' | 'outOfOffice'>>;\n"]}
@@ -0,0 +1,9 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-badge/src/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"]}