@fluentui/react-badge 0.0.0-nightly-20220517-0418.1 → 0.0.0-nightly-20220520-0418.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.json +35 -9
  2. package/CHANGELOG.md +112 -109
  3. package/dist/index.d.ts +1 -1
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  6. package/lib/components/PresenceBadge/usePresenceBadge.js +15 -3
  7. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  8. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +15 -3
  9. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  10. package/package.json +8 -8
  11. package/lib/Badge.d.ts +0 -1
  12. package/lib/CounterBadge.d.ts +0 -1
  13. package/lib/PresenceBadge.d.ts +0 -1
  14. package/lib/components/Badge/Badge.d.ts +0 -6
  15. package/lib/components/Badge/Badge.types.d.ts +0 -33
  16. package/lib/components/Badge/index.d.ts +0 -5
  17. package/lib/components/Badge/renderBadge.d.ts +0 -2
  18. package/lib/components/Badge/useBadge.d.ts +0 -6
  19. package/lib/components/Badge/useBadgeStyles.d.ts +0 -11
  20. package/lib/components/CounterBadge/CounterBadge.d.ts +0 -6
  21. package/lib/components/CounterBadge/CounterBadge.types.d.ts +0 -42
  22. package/lib/components/CounterBadge/index.d.ts +0 -4
  23. package/lib/components/CounterBadge/useCounterBadge.d.ts +0 -6
  24. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -12
  25. package/lib/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  26. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
  27. package/lib/components/PresenceBadge/index.d.ts +0 -4
  28. package/lib/components/PresenceBadge/presenceIcons.d.ts +0 -11
  29. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  30. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -12
  31. package/lib/index.d.ts +0 -6
  32. package/lib-commonjs/Badge.d.ts +0 -1
  33. package/lib-commonjs/CounterBadge.d.ts +0 -1
  34. package/lib-commonjs/PresenceBadge.d.ts +0 -1
  35. package/lib-commonjs/components/Badge/Badge.d.ts +0 -6
  36. package/lib-commonjs/components/Badge/Badge.types.d.ts +0 -33
  37. package/lib-commonjs/components/Badge/index.d.ts +0 -5
  38. package/lib-commonjs/components/Badge/renderBadge.d.ts +0 -2
  39. package/lib-commonjs/components/Badge/useBadge.d.ts +0 -6
  40. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +0 -11
  41. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +0 -6
  42. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +0 -42
  43. package/lib-commonjs/components/CounterBadge/index.d.ts +0 -4
  44. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +0 -6
  45. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -12
  46. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  47. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +0 -17
  48. package/lib-commonjs/components/PresenceBadge/index.d.ts +0 -4
  49. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +0 -11
  50. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  51. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -12
  52. package/lib-commonjs/index.d.ts +0 -6
package/dist/index.d.ts CHANGED
@@ -119,7 +119,7 @@ export declare const presenceBadgeClassName = "fui-PresenceBadge";
119
119
 
120
120
  export declare const presenceBadgeClassNames: SlotClassNames<BadgeSlots>;
121
121
 
122
- export declare type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, 'color'> & Pick<BadgeProps, 'size'> & {
122
+ export declare type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root' | 'icon'>>, 'color'> & Pick<BadgeProps, 'size'> & {
123
123
  /**
124
124
  * Represents several status
125
125
  * @default available
File without changes
@@ -1 +1 @@
1
- {"version":3,"file":"PresenceBadge.types.js","sourceRoot":"../src/","sources":["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 | 'outOfOffice'\n | 'away'\n | 'available'\n | 'offline'\n | 'doNotDisturb'\n | 'unknown';\n\nexport type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, '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"]}
1
+ {"version":3,"file":"PresenceBadge.types.js","sourceRoot":"../src/","sources":["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 | 'outOfOffice'\n | 'away'\n | 'available'\n | 'offline'\n | 'doNotDisturb'\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"]}
@@ -27,19 +27,31 @@ const iconMap = (status, outOfOffice, size) => {
27
27
  return presenceUnknownRegular[size];
28
28
  }
29
29
  };
30
+
31
+ const DEFAULT_STRINGS = {
32
+ busy: 'busy',
33
+ outOfOffice: 'out of office',
34
+ away: 'away',
35
+ available: 'available',
36
+ offline: 'offline',
37
+ doNotDisturb: 'do not disturb',
38
+ unknown: 'unknown'
39
+ };
30
40
  /**
31
41
  * Returns the props and state required to render the component
32
42
  */
33
43
 
34
-
35
44
  export const usePresenceBadge_unstable = (props, ref) => {
36
45
  var _a, _b;
37
46
 
38
47
  const state = { ...useBadge_unstable({
39
48
  size: 'medium',
40
49
  ...props,
41
- icon: resolveShorthand(undefined, {
42
- required: true
50
+ icon: resolveShorthand(props.icon, {
51
+ required: true,
52
+ defaultProps: {
53
+ 'aria-label': props.status && DEFAULT_STRINGS[props.status]
54
+ }
43
55
  })
44
56
  }, ref),
45
57
  status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
@@ -1 +1 @@
1
- {"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,gBAAT,QAAiC,2BAAjC;AACA,SACE,uBADF,EAEE,wBAFF,EAGE,kBAHF,EAIE,kBAJF,EAKE,iBALF,EAME,kBANF,EAOE,sBAPF,EAQE,kBARF,EASE,sBATF,QAUO,iBAVP;AAWA,SAAS,iBAAT,QAA8C,gBAA9C;;AAGA,MAAM,OAAO,GAAG,CACd,MADc,EAEd,WAFc,EAGd,IAHc,KAIoB;AAClC,UAAQ,MAAR;AACE,SAAK,WAAL;AACE,aAAO,WAAW,GAAG,wBAAwB,CAAC,IAAD,CAA3B,GAAoC,uBAAuB,CAAC,IAAD,CAA7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KAAK,CAAC,IAAN,CAAY,QAAZ,gBAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CAzBM","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable, BadgeProps } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'doNotDisturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'outOfOffice':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n ...props,\n icon: resolveShorthand(undefined as BadgeProps['icon'], {\n required: true,\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/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,OAAO,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;AACtB,QAAM,KAAK,GAAuB,EAChC,GAAG,iBAAiB,CAClB;AACE,MAAA,IAAI,EAAE,QADR;AAEE,SAAG,KAFL;AAGE,MAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP,EAAa;AACjC,QAAA,QAAQ,EAAE,IADuB;AAEjC,QAAA,YAAY,EAAE;AACZ,wBAAc,KAAK,CAAC,MAAN,IAAgB,eAAe,CAAC,KAAK,CAAC,MAAP;AADjC;AAFmB,OAAb;AAHxB,KADkB,EAWlB,GAXkB,CADY;AAchC,IAAA,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAdQ;AAehC,IAAA,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;AAfF,GAAlC;AAkBA,QAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;AACA,MAAI,WAAJ,EAAiB;AACf,IAAA,KAAK,CAAC,IAAN,CAAY,QAAZ,gBAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CA5BM","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'doNotDisturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'outOfOffice':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\nconst DEFAULT_STRINGS = {\n busy: 'busy',\n outOfOffice: 'out of office',\n away: 'away',\n available: 'available',\n offline: 'offline',\n doNotDisturb: 'do not disturb',\n unknown: 'unknown',\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n ...props,\n icon: resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n 'aria-label': props.status && DEFAULT_STRINGS[props.status],\n },\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -37,19 +37,31 @@ const iconMap = (status, outOfOffice, size) => {
37
37
  return presenceIcons_1.presenceUnknownRegular[size];
38
38
  }
39
39
  };
40
+
41
+ const DEFAULT_STRINGS = {
42
+ busy: 'busy',
43
+ outOfOffice: 'out of office',
44
+ away: 'away',
45
+ available: 'available',
46
+ offline: 'offline',
47
+ doNotDisturb: 'do not disturb',
48
+ unknown: 'unknown'
49
+ };
40
50
  /**
41
51
  * Returns the props and state required to render the component
42
52
  */
43
53
 
44
-
45
54
  const usePresenceBadge_unstable = (props, ref) => {
46
55
  var _a, _b;
47
56
 
48
57
  const state = { ...index_1.useBadge_unstable({
49
58
  size: 'medium',
50
59
  ...props,
51
- icon: react_utilities_1.resolveShorthand(undefined, {
52
- required: true
60
+ icon: react_utilities_1.resolveShorthand(props.icon, {
61
+ required: true,
62
+ defaultProps: {
63
+ 'aria-label': props.status && DEFAULT_STRINGS[props.status]
64
+ }
53
65
  })
54
66
  }, ref),
55
67
  status: (_a = props.status) !== null && _a !== void 0 ? _a : 'available',
@@ -1 +1 @@
1
- {"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAWA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGA,MAAM,OAAO,GAAG,CACd,MADc,EAEd,WAFc,EAGd,IAHc,KAIoB;AAClC,UAAQ,MAAR;AACE,SAAK,WAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,wBAAA,CAAyB,IAAzB,CAAH,GAAoC,eAAA,CAAA,uBAAA,CAAwB,IAAxB,CAAtD;;AACF,SAAK,MAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;AACF,SAAK,MAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAH,GAAkC,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAApD;;AACF,SAAK,cAAL;AACE,aAAO,WAAW,GAAG,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAH,GAA8B,eAAA,CAAA,iBAAA,CAAkB,IAAlB,CAAhD;;AACF,SAAK,SAAL;AACE,aAAO,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAP;;AACF,SAAK,aAAL;AACE,aAAO,eAAA,CAAA,kBAAA,CAAmB,IAAnB,CAAP;;AACF,SAAK,SAAL;AACE,aAAO,eAAA,CAAA,sBAAA,CAAuB,IAAvB,CAAP;AAdJ;AAgBD,CArBD;AAuBA;;AAEG;;;AACI,MAAM,yBAAyB,GAAG,CACvC,KADuC,EAEvC,GAFuC,KAGjB;;;AACtB,QAAM,KAAK,GAAuB,EAChC,GAAG,OAAA,CAAA,iBAAA,CACD;AACE,MAAA,IAAI,EAAE,QADR;AAEE,SAAG,KAFL;AAGE,MAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,SAAjB,EAAkD;AACtD,QAAA,QAAQ,EAAE;AAD4C,OAAlD;AAHR,KADC,EAQD,GARC,CAD6B;AAWhC,IAAA,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAXQ;AAYhC,IAAA,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;AAZF,GAAlC;AAeA,QAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;AACA,MAAI,WAAJ,EAAiB;AACf,IAAA,KAAK,CAAC,IAAN,CAAY,QAAZ,GAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CAzBM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable, BadgeProps } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'doNotDisturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'outOfOffice':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n ...props,\n icon: resolveShorthand(undefined as BadgeProps['icon'], {\n required: true,\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["components/PresenceBadge/usePresenceBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;;AAW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G,OAAA,CAAA,iBAAA,CACD;AACE,MAAA,IAAI,EAAE,QADR;AAEE,SAAG,KAFL;AAGE,MAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB,EAA6B;AACjC,QAAA,QAAQ,EAAE,IADuB;AAEjC,QAAA,YAAY,EAAE;AACZ,wBAAc,KAAK,CAAC,MAAN,IAAgB,eAAe,CAAC,KAAK,CAAC,MAAP;AADjC;AAFmB,OAA7B;AAHR,KADC,EAWD,GAXC,CAD6B;AAchC,IAAA,MAAM,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,MAAN,MAAY,IAAZ,IAAY,EAAA,KAAA,KAAA,CAAZ,GAAY,EAAZ,GAAgB,WAdQ;AAehC,IAAA,WAAW,EAAE,CAAA,EAAA,GAAA,KAAK,CAAC,WAAN,MAAiB,IAAjB,IAAiB,EAAA,KAAA,KAAA,CAAjB,GAAiB,EAAjB,GAAqB;AAfF,GAAlC;AAkBA,QAAM,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,MAAP,EAAe,KAAK,CAAC,WAArB,EAAkC,KAAK,CAAC,IAAxC,CAA3B;;AACA,MAAI,WAAJ,EAAiB;AACf,IAAA,KAAK,CAAC,IAAN,CAAY,QAAZ,GAAuB,KAAA,CAAA,aAAA,CAAC,WAAD,EAAY,IAAZ,CAAvB;AACD;;AAED,SAAO,KAAP;AACD,CA5BM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport {\n presenceAvailableFilled,\n presenceAvailableRegular,\n presenceAwayFilled,\n presenceBusyFilled,\n presenceDndFilled,\n presenceDndRegular,\n presenceOfflineRegular,\n presenceOofRegular,\n presenceUnknownRegular,\n} from './presenceIcons';\nimport { useBadge_unstable } from '../Badge/index';\nimport type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';\n\nconst iconMap = (\n status: PresenceBadgeState['status'],\n outOfOffice: boolean,\n size: PresenceBadgeState['size'],\n): React.FunctionComponent | null => {\n switch (status) {\n case 'available':\n return outOfOffice ? presenceAvailableRegular[size] : presenceAvailableFilled[size];\n case 'away':\n return outOfOffice ? presenceOfflineRegular[size] : presenceAwayFilled[size];\n case 'busy':\n return outOfOffice ? presenceUnknownRegular[size] : presenceBusyFilled[size];\n case 'doNotDisturb':\n return outOfOffice ? presenceDndRegular[size] : presenceDndFilled[size];\n case 'offline':\n return presenceOfflineRegular[size];\n case 'outOfOffice':\n return presenceOofRegular[size];\n case 'unknown':\n return presenceUnknownRegular[size];\n }\n};\n\nconst DEFAULT_STRINGS = {\n busy: 'busy',\n outOfOffice: 'out of office',\n away: 'away',\n available: 'available',\n offline: 'offline',\n doNotDisturb: 'do not disturb',\n unknown: 'unknown',\n};\n\n/**\n * Returns the props and state required to render the component\n */\nexport const usePresenceBadge_unstable = (\n props: PresenceBadgeProps,\n ref: React.Ref<HTMLElement>,\n): PresenceBadgeState => {\n const state: PresenceBadgeState = {\n ...useBadge_unstable(\n {\n size: 'medium',\n ...props,\n icon: resolveShorthand(props.icon, {\n required: true,\n defaultProps: {\n 'aria-label': props.status && DEFAULT_STRINGS[props.status],\n },\n }),\n },\n ref,\n ),\n status: props.status ?? 'available',\n outOfOffice: props.outOfOffice ?? false,\n };\n\n const IconElement = iconMap(state.status, state.outOfOffice, state.size);\n if (IconElement) {\n state.icon!.children = <IconElement />;\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@fluentui/react-badge",
3
- "version": "0.0.0-nightly-20220517-0418.1",
3
+ "version": "0.0.0-nightly-20220520-0418.1",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
7
- "typings": "lib/index.d.ts",
7
+ "typings": "dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
@@ -21,21 +21,21 @@
21
21
  "start": "yarn storybook",
22
22
  "test": "jest --passWithNoTests",
23
23
  "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-badge/src && yarn docs",
25
- "storybook": "node ../../scripts/storybook/runner",
24
+ "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/types/packages/react-components/react-badge/src && yarn docs",
25
+ "storybook": "node ../../../scripts/storybook/runner",
26
26
  "type-check": "tsc -b tsconfig.json"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@fluentui/eslint-plugin": "*",
30
30
  "@fluentui/react-conformance": "*",
31
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20220517-0418.1",
31
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20220520-0418.1",
32
32
  "@fluentui/scripts": "^1.0.0"
33
33
  },
34
34
  "dependencies": {
35
35
  "@fluentui/react-icons": "^2.0.166-rc.3",
36
- "@griffel/react": "1.0.4",
37
- "@fluentui/react-theme": "0.0.0-nightly-20220517-0418.1",
38
- "@fluentui/react-utilities": "0.0.0-nightly-20220517-0418.1",
36
+ "@griffel/react": "1.0.5",
37
+ "@fluentui/react-theme": "0.0.0-nightly-20220520-0418.1",
38
+ "@fluentui/react-utilities": "0.0.0-nightly-20220520-0418.1",
39
39
  "tslib": "^2.1.0"
40
40
  },
41
41
  "peerDependencies": {
package/lib/Badge.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components/Badge/index';
@@ -1 +0,0 @@
1
- export * from './components/CounterBadge/index';
@@ -1 +0,0 @@
1
- export * from './components/PresenceBadge/index';
@@ -1,6 +0,0 @@
1
- import type { BadgeProps } from './Badge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled Badge, using the `useBadge_unstable` hook.
5
- */
6
- export declare const Badge: ForwardRefComponent<BadgeProps>;
@@ -1,33 +0,0 @@
1
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
- export declare type BadgeSlots = {
3
- root: Slot<'div'>;
4
- icon?: Slot<'span'>;
5
- };
6
- export declare type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & {
7
- /**
8
- * A Badge can be filled, outline, ghost, inverted
9
- * @defaultvalue filled
10
- */
11
- appearance?: 'filled' | 'ghost' | 'outline' | 'tint';
12
- /**
13
- * A Badge can be one of preset colors
14
- * @defaultvalue brand
15
- */
16
- color?: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
17
- /**
18
- * A Badge can position the icon before or after the content.
19
- * @defaultvalue before
20
- */
21
- iconPosition?: 'before' | 'after';
22
- /**
23
- * A Badge can be square, circular or rounded.
24
- * @defaultvalue circular
25
- */
26
- shape?: 'circular' | 'rounded' | 'square';
27
- /**
28
- * A Badge can be on of several preset sizes.
29
- * @defaultvalue medium
30
- */
31
- size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
32
- };
33
- export declare type BadgeState = ComponentState<BadgeSlots> & Required<Pick<BadgeProps, 'appearance' | 'color' | 'iconPosition' | 'shape' | 'size'>>;
@@ -1,5 +0,0 @@
1
- export * from './Badge';
2
- export type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';
3
- export * from './renderBadge';
4
- export * from './useBadge';
5
- export * from './useBadgeStyles';
@@ -1,2 +0,0 @@
1
- import type { BadgeState } from './Badge.types';
2
- export declare const renderBadge_unstable: (state: BadgeState) => JSX.Element;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { BadgeProps, BadgeState } from './Badge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const useBadge_unstable: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
@@ -1,11 +0,0 @@
1
- import type { BadgeSlots, BadgeState } from './Badge.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `badgeClassNames.root` instead.
5
- */
6
- export declare const badgeClassName = "fui-Badge";
7
- export declare const badgeClassNames: SlotClassNames<BadgeSlots>;
8
- /**
9
- * Applies style classnames to slots
10
- */
11
- export declare const useBadgeStyles_unstable: (state: BadgeState) => BadgeState;
@@ -1,6 +0,0 @@
1
- import type { CounterBadgeProps } from './CounterBadge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.
5
- */
6
- export declare const CounterBadge: ForwardRefComponent<CounterBadgeProps>;
@@ -1,42 +0,0 @@
1
- import type { BadgeProps, BadgeState } from '../Badge/index';
2
- export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'color' | 'shape'> & {
3
- /**
4
- * A Badge can have different appearances that emphasize certain parts of it:
5
- * - filled: The default appearance if one is not specified.
6
- * The badge background is filled with color with a contrasting foreground text to match.
7
- * - ghost: The badge background is transparent, with the foreground text taking color to emphasize it.
8
- * @default filled
9
- */
10
- appearance?: 'filled' | 'ghost';
11
- /**
12
- * Semantic colors for a counter badge
13
- * @default brand
14
- */
15
- color?: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;
16
- /**
17
- * Value displayed by the Badge
18
- * @default 0
19
- */
20
- count?: number;
21
- /**
22
- * If a dot should be displayed without the count
23
- * @default false
24
- */
25
- dot?: boolean;
26
- /**
27
- * Max number to be displayed
28
- * @default 99
29
- */
30
- overflowCount?: number;
31
- /**
32
- * A Badge can be circular or rounded
33
- * @default circular
34
- */
35
- shape?: 'circular' | 'rounded';
36
- /**
37
- * If the badge should be shown when count is 0
38
- * @default false
39
- */
40
- showZero?: boolean;
41
- };
42
- export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'color' | 'shape'> & Required<Pick<CounterBadgeProps, 'appearance' | 'color' | 'count' | 'dot' | 'shape' | 'showZero'>>;
@@ -1,4 +0,0 @@
1
- export * from './CounterBadge';
2
- export * from './CounterBadge.types';
3
- export * from './useCounterBadge';
4
- export * from './useCounterBadgeStyles';
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const useCounterBadge_unstable: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>) => CounterBadgeState;
@@ -1,12 +0,0 @@
1
- import type { SlotClassNames } from '@fluentui/react-utilities';
2
- import type { BadgeSlots } from '../Badge/Badge.types';
3
- import type { CounterBadgeState } from './CounterBadge.types';
4
- /**
5
- * @deprecated Use `counterBadgeClassNames.root` instead.
6
- */
7
- export declare const counterBadgeClassName = "fui-CounterBadge";
8
- export declare const counterBadgeClassNames: SlotClassNames<BadgeSlots>;
9
- /**
10
- * Applies style classnames to slots
11
- */
12
- export declare const useCounterBadgeStyles_unstable: (state: CounterBadgeState) => CounterBadgeState;
@@ -1,6 +0,0 @@
1
- import type { PresenceBadgeProps } from './PresenceBadge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled Badge, using the `useBadge_unstable` hook.
5
- */
6
- export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
@@ -1,17 +0,0 @@
1
- import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';
2
- import type { BadgeProps, BadgeState, BadgeSlots } from '../Badge/Badge.types';
3
- export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb' | 'unknown';
4
- export declare type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, 'color'> & Pick<BadgeProps, 'size'> & {
5
- /**
6
- * Represents several status
7
- * @default available
8
- */
9
- status?: PresenceBadgeStatus;
10
- /**
11
- * Modifies the display to indicate that the user is out of office.
12
- * This can be combined with any status to display an out-of-office version of that status
13
- * @default false
14
- */
15
- outOfOffice?: boolean;
16
- };
17
- export declare type PresenceBadgeState = ComponentState<BadgeSlots> & BadgeState & Required<Pick<PresenceBadgeProps, 'status' | 'outOfOffice'>>;
@@ -1,4 +0,0 @@
1
- export * from './PresenceBadge';
2
- export * from './PresenceBadge.types';
3
- export * from './usePresenceBadge';
4
- export * from './usePresenceBadgeStyles';
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import type { PresenceBadgeState } from './PresenceBadge.types';
3
- export declare const presenceAwayFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
4
- export declare const presenceAvailableRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
5
- export declare const presenceAvailableFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
6
- export declare const presenceBusyFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
7
- export declare const presenceDndFilled: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
8
- export declare const presenceDndRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
9
- export declare const presenceOofRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
10
- export declare const presenceOfflineRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
11
- export declare const presenceUnknownRegular: Record<PresenceBadgeState['size'], React.FunctionComponent | null>;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { PresenceBadgeProps, PresenceBadgeState } from './PresenceBadge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const usePresenceBadge_unstable: (props: PresenceBadgeProps, ref: React.Ref<HTMLElement>) => PresenceBadgeState;
@@ -1,12 +0,0 @@
1
- import type { SlotClassNames } from '@fluentui/react-utilities';
2
- import type { BadgeSlots } from '../Badge/Badge.types';
3
- import type { PresenceBadgeState } from './PresenceBadge.types';
4
- /**
5
- * @deprecated Use `presenceBadgeClassNames.root` instead.
6
- */
7
- export declare const presenceBadgeClassName = "fui-PresenceBadge";
8
- export declare const presenceBadgeClassNames: SlotClassNames<BadgeSlots>;
9
- /**
10
- * Applies style classnames to slots
11
- */
12
- export declare const usePresenceBadgeStyles_unstable: (state: PresenceBadgeState) => PresenceBadgeState;
package/lib/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export { Badge, badgeClassName, badgeClassNames, renderBadge_unstable, useBadgeStyles_unstable, useBadge_unstable, } from './Badge';
2
- export type { BadgeProps, BadgeSlots, BadgeState } from './Badge';
3
- export { PresenceBadge, presenceBadgeClassName, presenceBadgeClassNames, usePresenceBadgeStyles_unstable, usePresenceBadge_unstable, } from './PresenceBadge';
4
- export type { PresenceBadgeProps, PresenceBadgeState, PresenceBadgeStatus } from './PresenceBadge';
5
- export { CounterBadge, counterBadgeClassName, counterBadgeClassNames, useCounterBadgeStyles_unstable, useCounterBadge_unstable, } from './CounterBadge';
6
- export type { CounterBadgeProps, CounterBadgeState } from './CounterBadge';
@@ -1 +0,0 @@
1
- export * from './components/Badge/index';
@@ -1 +0,0 @@
1
- export * from './components/CounterBadge/index';
@@ -1 +0,0 @@
1
- export * from './components/PresenceBadge/index';
@@ -1,6 +0,0 @@
1
- import type { BadgeProps } from './Badge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled Badge, using the `useBadge_unstable` hook.
5
- */
6
- export declare const Badge: ForwardRefComponent<BadgeProps>;
@@ -1,33 +0,0 @@
1
- import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
- export declare type BadgeSlots = {
3
- root: Slot<'div'>;
4
- icon?: Slot<'span'>;
5
- };
6
- export declare type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & {
7
- /**
8
- * A Badge can be filled, outline, ghost, inverted
9
- * @defaultvalue filled
10
- */
11
- appearance?: 'filled' | 'ghost' | 'outline' | 'tint';
12
- /**
13
- * A Badge can be one of preset colors
14
- * @defaultvalue brand
15
- */
16
- color?: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
17
- /**
18
- * A Badge can position the icon before or after the content.
19
- * @defaultvalue before
20
- */
21
- iconPosition?: 'before' | 'after';
22
- /**
23
- * A Badge can be square, circular or rounded.
24
- * @defaultvalue circular
25
- */
26
- shape?: 'circular' | 'rounded' | 'square';
27
- /**
28
- * A Badge can be on of several preset sizes.
29
- * @defaultvalue medium
30
- */
31
- size?: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
32
- };
33
- export declare type BadgeState = ComponentState<BadgeSlots> & Required<Pick<BadgeProps, 'appearance' | 'color' | 'iconPosition' | 'shape' | 'size'>>;
@@ -1,5 +0,0 @@
1
- export * from './Badge';
2
- export type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';
3
- export * from './renderBadge';
4
- export * from './useBadge';
5
- export * from './useBadgeStyles';
@@ -1,2 +0,0 @@
1
- import type { BadgeState } from './Badge.types';
2
- export declare const renderBadge_unstable: (state: BadgeState) => JSX.Element;
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { BadgeProps, BadgeState } from './Badge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const useBadge_unstable: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
@@ -1,11 +0,0 @@
1
- import type { BadgeSlots, BadgeState } from './Badge.types';
2
- import type { SlotClassNames } from '@fluentui/react-utilities';
3
- /**
4
- * @deprecated Use `badgeClassNames.root` instead.
5
- */
6
- export declare const badgeClassName = "fui-Badge";
7
- export declare const badgeClassNames: SlotClassNames<BadgeSlots>;
8
- /**
9
- * Applies style classnames to slots
10
- */
11
- export declare const useBadgeStyles_unstable: (state: BadgeState) => BadgeState;
@@ -1,6 +0,0 @@
1
- import type { CounterBadgeProps } from './CounterBadge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled CounterBadge, using the `useCounterBadge_unstable` hook.
5
- */
6
- export declare const CounterBadge: ForwardRefComponent<CounterBadgeProps>;
@@ -1,42 +0,0 @@
1
- import type { BadgeProps, BadgeState } from '../Badge/index';
2
- export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'color' | 'shape'> & {
3
- /**
4
- * A Badge can have different appearances that emphasize certain parts of it:
5
- * - filled: The default appearance if one is not specified.
6
- * The badge background is filled with color with a contrasting foreground text to match.
7
- * - ghost: The badge background is transparent, with the foreground text taking color to emphasize it.
8
- * @default filled
9
- */
10
- appearance?: 'filled' | 'ghost';
11
- /**
12
- * Semantic colors for a counter badge
13
- * @default brand
14
- */
15
- color?: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;
16
- /**
17
- * Value displayed by the Badge
18
- * @default 0
19
- */
20
- count?: number;
21
- /**
22
- * If a dot should be displayed without the count
23
- * @default false
24
- */
25
- dot?: boolean;
26
- /**
27
- * Max number to be displayed
28
- * @default 99
29
- */
30
- overflowCount?: number;
31
- /**
32
- * A Badge can be circular or rounded
33
- * @default circular
34
- */
35
- shape?: 'circular' | 'rounded';
36
- /**
37
- * If the badge should be shown when count is 0
38
- * @default false
39
- */
40
- showZero?: boolean;
41
- };
42
- export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'color' | 'shape'> & Required<Pick<CounterBadgeProps, 'appearance' | 'color' | 'count' | 'dot' | 'shape' | 'showZero'>>;
@@ -1,4 +0,0 @@
1
- export * from './CounterBadge';
2
- export * from './CounterBadge.types';
3
- export * from './useCounterBadge';
4
- export * from './useCounterBadgeStyles';
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- import type { CounterBadgeProps, CounterBadgeState } from './CounterBadge.types';
3
- /**
4
- * Returns the props and state required to render the component
5
- */
6
- export declare const useCounterBadge_unstable: (props: CounterBadgeProps, ref: React.Ref<HTMLElement>) => CounterBadgeState;
@@ -1,12 +0,0 @@
1
- import type { SlotClassNames } from '@fluentui/react-utilities';
2
- import type { BadgeSlots } from '../Badge/Badge.types';
3
- import type { CounterBadgeState } from './CounterBadge.types';
4
- /**
5
- * @deprecated Use `counterBadgeClassNames.root` instead.
6
- */
7
- export declare const counterBadgeClassName = "fui-CounterBadge";
8
- export declare const counterBadgeClassNames: SlotClassNames<BadgeSlots>;
9
- /**
10
- * Applies style classnames to slots
11
- */
12
- export declare const useCounterBadgeStyles_unstable: (state: CounterBadgeState) => CounterBadgeState;
@@ -1,6 +0,0 @@
1
- import type { PresenceBadgeProps } from './PresenceBadge.types';
2
- import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
- /**
4
- * Define a styled Badge, using the `useBadge_unstable` hook.
5
- */
6
- export declare const PresenceBadge: ForwardRefComponent<PresenceBadgeProps>;
@@ -1,17 +0,0 @@
1
- import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';
2
- import type { BadgeProps, BadgeState, BadgeSlots } from '../Badge/Badge.types';
3
- export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb' | 'unknown';
4
- export declare type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, 'color'> & Pick<BadgeProps, 'size'> & {
5
- /**
6
- * Represents several status
7
- * @default available
8
- */
9
- status?: PresenceBadgeStatus;
10
- /**
11
- * Modifies the display to indicate that the user is out of office.
12
- * This can be combined with any status to display an out-of-office version of that status
13
- * @default false
14
- */
15
- outOfOffice?: boolean;
16
- };
17
- export declare type PresenceBadgeState = ComponentState<BadgeSlots> & BadgeState & Required<Pick<PresenceBadgeProps, 'status' | 'outOfOffice'>>;
@@ -1,4 +0,0 @@
1
- export * from './PresenceBadge';
2
- export * from './PresenceBadge.types';
3
- export * from './usePresenceBadge';
4
- export * from './usePresenceBadgeStyles';