@fluentui/react-badge 0.0.0-nightlyfbae36b19b20211111.1 → 0.0.0-nightlyfc5cfdc52420220215.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. package/CHANGELOG.json +299 -16
  2. package/CHANGELOG.md +70 -11
  3. package/dist/react-badge.d.ts +27 -28
  4. package/lib/components/Badge/Badge.d.ts +1 -1
  5. package/lib/components/Badge/Badge.js +7 -7
  6. package/lib/components/Badge/Badge.js.map +1 -1
  7. package/lib/components/Badge/Badge.types.d.ts +4 -5
  8. package/lib/components/Badge/index.d.ts +1 -1
  9. package/lib/components/Badge/index.js +0 -1
  10. package/lib/components/Badge/index.js.map +1 -1
  11. package/lib/components/Badge/renderBadge.d.ts +1 -1
  12. package/lib/components/Badge/renderBadge.js +6 -3
  13. package/lib/components/Badge/renderBadge.js.map +1 -1
  14. package/lib/components/Badge/useBadge.d.ts +1 -1
  15. package/lib/components/Badge/useBadge.js +1 -1
  16. package/lib/components/Badge/useBadge.js.map +1 -1
  17. package/lib/components/Badge/useBadgeStyles.d.ts +1 -1
  18. package/lib/components/Badge/useBadgeStyles.js +209 -203
  19. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  20. package/lib/components/CounterBadge/CounterBadge.d.ts +1 -1
  21. package/lib/components/CounterBadge/CounterBadge.js +7 -7
  22. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  23. package/lib/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  24. package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -1
  25. package/lib/components/CounterBadge/useCounterBadge.js +3 -3
  26. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  27. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  28. package/lib/components/CounterBadge/useCounterBadgeStyles.js +7 -38
  29. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  30. package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  31. package/lib/components/PresenceBadge/PresenceBadge.js +7 -7
  32. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  33. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  34. package/lib/components/PresenceBadge/presenceIcons.d.ts +11 -0
  35. package/lib/components/PresenceBadge/presenceIcons.js +128 -0
  36. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
  37. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  38. package/lib/components/PresenceBadge/usePresenceBadge.js +32 -18
  39. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  40. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  41. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +40 -44
  42. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  43. package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
  44. package/lib-commonjs/components/Badge/Badge.js +4 -4
  45. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  46. package/lib-commonjs/components/Badge/Badge.types.d.ts +4 -5
  47. package/lib-commonjs/components/Badge/index.d.ts +1 -1
  48. package/lib-commonjs/components/Badge/index.js +0 -2
  49. package/lib-commonjs/components/Badge/index.js.map +1 -1
  50. package/lib-commonjs/components/Badge/renderBadge.d.ts +1 -1
  51. package/lib-commonjs/components/Badge/renderBadge.js +8 -5
  52. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  53. package/lib-commonjs/components/Badge/useBadge.d.ts +1 -1
  54. package/lib-commonjs/components/Badge/useBadge.js +3 -3
  55. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  56. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -1
  57. package/lib-commonjs/components/Badge/useBadgeStyles.js +212 -205
  58. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  59. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -1
  60. package/lib-commonjs/components/CounterBadge/CounterBadge.js +4 -4
  61. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  62. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  63. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
  64. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +4 -4
  65. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  66. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  67. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +9 -40
  68. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  69. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  70. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +4 -4
  71. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  72. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  73. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +11 -0
  74. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
  75. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
  76. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  77. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +32 -18
  78. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  79. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  80. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +43 -47
  81. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  82. package/package.json +14 -15
  83. package/lib/common/isConformant.d.ts +0 -4
  84. package/lib/common/isConformant.js +0 -13
  85. package/lib/common/isConformant.js.map +0 -1
  86. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  87. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -98
  88. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  89. package/lib-commonjs/common/isConformant.d.ts +0 -4
  90. package/lib-commonjs/common/isConformant.js +0 -24
  91. package/lib-commonjs/common/isConformant.js.map +0 -1
  92. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  93. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -113
  94. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -1,8 +1,7 @@
1
- import * as React from 'react';
2
- import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
3
2
  export declare type BadgeSlots = {
4
- root: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
5
- icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
3
+ root: Slot<'div'>;
4
+ icon?: Slot<'span'>;
6
5
  };
7
6
  export declare type BadgeCommons = {
8
7
  /**
@@ -31,5 +30,5 @@ export declare type BadgeCommons = {
31
30
  */
32
31
  size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
33
32
  };
34
- export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
33
+ export declare type BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & Partial<BadgeCommons>;
35
34
  export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
@@ -1,5 +1,5 @@
1
1
  export * from './Badge';
2
- export * from './Badge.types';
2
+ export type { BadgeProps, BadgeSlots, BadgeState } from './Badge.types';
3
3
  export * from './renderBadge';
4
4
  export * from './useBadge';
5
5
  export * from './useBadgeStyles';
@@ -1,5 +1,4 @@
1
1
  export * from './Badge';
2
- export * from './Badge.types';
3
2
  export * from './renderBadge';
4
3
  export * from './useBadge';
5
4
  export * from './useBadgeStyles';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAGxB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import type { BadgeState } from './Badge.types';
2
- export declare const renderBadge: (state: BadgeState) => JSX.Element;
2
+ export declare const renderBadge_unstable: (state: BadgeState) => JSX.Element;
@@ -1,10 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { getSlots } from '@fluentui/react-utilities';
3
- export const renderBadge = state => {
3
+ export const renderBadge_unstable = state => {
4
4
  const {
5
5
  slots,
6
6
  slotProps
7
- } = getSlots(state, ['icon', 'root']);
8
- return /*#__PURE__*/React.createElement(slots.root, Object.assign({}, slotProps.root), state.iconPosition === 'before' && /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, Object.assign({}, slotProps.icon)));
7
+ } = getSlots(state);
8
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
9
+ }, state.iconPosition === 'before' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
10
+ }), state.root.children, state.iconPosition === 'after' && slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
11
+ }));
9
12
  };
10
13
  //# sourceMappingURL=renderBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA,OAA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AN,KAAuB,OAAvB,IAAkC,KAAK,CAAC,IAAxC,iBAAgD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAHnD,CADF;AAOD,CAVM","sourceRoot":""}
@@ -3,4 +3,4 @@ import type { BadgeProps, BadgeState } from './Badge.types';
3
3
  /**
4
4
  * Returns the props and state required to render the component
5
5
  */
6
- export declare const useBadge: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
6
+ export declare const useBadge_unstable: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
@@ -3,7 +3,7 @@ import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utiliti
3
3
  * Returns the props and state required to render the component
4
4
  */
5
5
 
6
- export const useBadge = (props, ref) => {
6
+ export const useBadge_unstable = (props, ref) => {
7
7
  const {
8
8
  shape = 'circular',
9
9
  size = 'medium',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;AAEG;;AACH,OAAO,MAAM,QAAQ,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AACrF,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,IAAI,GAAG,QAFH;AAGJ,IAAA,YAAY,GAAG,QAHX;AAIJ,IAAA,UAAU,GAAG,QAJT;AAKJ,IAAA,KAAK,GAAG;AALJ,MAMF,KANJ;AAQA,QAAM,KAAK,GAAe;AACxB,IAAA,KADwB;AAExB,IAAA,IAFwB;AAGxB,IAAA,YAHwB;AAIxB,IAAA,UAJwB;AAKxB,IAAA,KALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KANY;AAUxB,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,qBAAe,IAFkB;AAGjC,SAAG;AAH8B,KAAR,CAVH;AAexB,IAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP;AAfE,GAA1B;AAkBA,SAAO,KAAP;AACD,CA5BM","sourceRoot":""}
1
+ {"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;AAEG;;AACH,OAAO,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AAC9F,QAAM;AACJ,IAAA,KAAK,GAAG,UADJ;AAEJ,IAAA,IAAI,GAAG,QAFH;AAGJ,IAAA,YAAY,GAAG,QAHX;AAIJ,IAAA,UAAU,GAAG,QAJT;AAKJ,IAAA,KAAK,GAAG;AALJ,MAMF,KANJ;AAQA,QAAM,KAAK,GAAe;AACxB,IAAA,KADwB;AAExB,IAAA,IAFwB;AAGxB,IAAA,YAHwB;AAIxB,IAAA,UAJwB;AAKxB,IAAA,KALwB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KANY;AAUxB,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ;AACjC,MAAA,GADiC;AAEjC,qBAAe,IAFkB;AAGjC,SAAG;AAH8B,KAAR,CAVH;AAexB,IAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP;AAfE,GAA1B;AAkBA,SAAO,KAAP;AACD,CA5BM","sourceRoot":""}
@@ -3,4 +3,4 @@ export declare const badgeClassName = "fui-Badge";
3
3
  /**
4
4
  * Applies style classnames to slots
5
5
  */
6
- export declare const useBadgeStyles: (state: BadgeState) => BadgeState;
6
+ export declare const useBadgeStyles_unstable: (state: BadgeState) => BadgeState;