@fluentui/react-badge 0.0.0-nightlyfe9829e48120211112.1 → 0.0.0-nightlyff78d1e27a20220217.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) 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/Badge.js.map +1 -1
  5. package/lib/CounterBadge.js.map +1 -1
  6. package/lib/PresenceBadge.js.map +1 -1
  7. package/lib/components/Badge/Badge.d.ts +1 -1
  8. package/lib/components/Badge/Badge.js +7 -7
  9. package/lib/components/Badge/Badge.js.map +1 -1
  10. package/lib/components/Badge/Badge.types.d.ts +4 -5
  11. package/lib/components/Badge/Badge.types.js.map +1 -1
  12. package/lib/components/Badge/index.d.ts +1 -1
  13. package/lib/components/Badge/index.js +0 -1
  14. package/lib/components/Badge/index.js.map +1 -1
  15. package/lib/components/Badge/renderBadge.d.ts +1 -1
  16. package/lib/components/Badge/renderBadge.js +6 -3
  17. package/lib/components/Badge/renderBadge.js.map +1 -1
  18. package/lib/components/Badge/useBadge.d.ts +1 -1
  19. package/lib/components/Badge/useBadge.js +1 -1
  20. package/lib/components/Badge/useBadge.js.map +1 -1
  21. package/lib/components/Badge/useBadgeStyles.d.ts +1 -1
  22. package/lib/components/Badge/useBadgeStyles.js +209 -203
  23. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  24. package/lib/components/CounterBadge/CounterBadge.d.ts +1 -1
  25. package/lib/components/CounterBadge/CounterBadge.js +7 -7
  26. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  27. package/lib/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  28. package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
  29. package/lib/components/CounterBadge/index.js.map +1 -1
  30. package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -1
  31. package/lib/components/CounterBadge/useCounterBadge.js +3 -3
  32. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  33. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  34. package/lib/components/CounterBadge/useCounterBadgeStyles.js +7 -38
  35. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  36. package/lib/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  37. package/lib/components/PresenceBadge/PresenceBadge.js +7 -7
  38. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  39. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  40. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  41. package/lib/components/PresenceBadge/index.js.map +1 -1
  42. package/lib/components/PresenceBadge/presenceIcons.d.ts +11 -0
  43. package/lib/components/PresenceBadge/presenceIcons.js +128 -0
  44. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -0
  45. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  46. package/lib/components/PresenceBadge/usePresenceBadge.js +32 -18
  47. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  48. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  49. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +40 -44
  50. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  51. package/lib/index.js.map +1 -1
  52. package/lib-commonjs/Badge.js.map +1 -1
  53. package/lib-commonjs/CounterBadge.js.map +1 -1
  54. package/lib-commonjs/PresenceBadge.js.map +1 -1
  55. package/lib-commonjs/components/Badge/Badge.d.ts +1 -1
  56. package/lib-commonjs/components/Badge/Badge.js +4 -4
  57. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  58. package/lib-commonjs/components/Badge/Badge.types.d.ts +4 -5
  59. package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
  60. package/lib-commonjs/components/Badge/index.d.ts +1 -1
  61. package/lib-commonjs/components/Badge/index.js +0 -2
  62. package/lib-commonjs/components/Badge/index.js.map +1 -1
  63. package/lib-commonjs/components/Badge/renderBadge.d.ts +1 -1
  64. package/lib-commonjs/components/Badge/renderBadge.js +8 -5
  65. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  66. package/lib-commonjs/components/Badge/useBadge.d.ts +1 -1
  67. package/lib-commonjs/components/Badge/useBadge.js +3 -3
  68. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  69. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +1 -1
  70. package/lib-commonjs/components/Badge/useBadgeStyles.js +212 -205
  71. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  72. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -1
  73. package/lib-commonjs/components/CounterBadge/CounterBadge.js +4 -4
  74. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  75. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +9 -9
  76. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
  77. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  78. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -1
  79. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +4 -4
  80. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  81. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +1 -1
  82. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +9 -40
  83. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  84. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +1 -1
  85. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +4 -4
  86. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  87. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +7 -5
  88. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  89. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  90. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +11 -0
  91. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +136 -0
  92. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -0
  93. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -1
  94. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +32 -18
  95. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  96. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +1 -1
  97. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +43 -47
  98. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  99. package/lib-commonjs/index.js.map +1 -1
  100. package/package.json +14 -15
  101. package/lib/common/isConformant.d.ts +0 -4
  102. package/lib/common/isConformant.js +0 -13
  103. package/lib/common/isConformant.js.map +0 -1
  104. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  105. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -98
  106. package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
  107. package/lib-commonjs/common/isConformant.d.ts +0 -4
  108. package/lib-commonjs/common/isConformant.js +0 -24
  109. package/lib-commonjs/common/isConformant.js.map +0 -1
  110. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
  111. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -113
  112. package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
- import { useBadge } from './useBadge';
3
- import { useBadgeStyles } from './useBadgeStyles';
4
- import { renderBadge } from './renderBadge';
2
+ import { useBadge_unstable } from './useBadge';
3
+ import { useBadgeStyles_unstable } from './useBadgeStyles';
4
+ import { renderBadge_unstable } from './renderBadge';
5
5
  /**
6
- * Define a styled Badge, using the `useBadge` hook.
6
+ * Define a styled Badge, using the `useBadge_unstable` hook.
7
7
  */
8
8
 
9
9
  export const Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const state = useBadge(props, ref);
11
- useBadgeStyles(state);
12
- return renderBadge(state);
10
+ const state = useBadge_unstable(props, ref);
11
+ useBadgeStyles_unstable(state);
12
+ return renderBadge_unstable(state);
13
13
  });
14
14
  Badge.displayName = 'Badge';
15
15
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,YAAzB;AACA,SAAS,cAAT,QAA+B,kBAA/B;AACA,SAAS,WAAT,QAA4B,eAA5B;AAIA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CAAtB;AACA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
1
+ {"version":3,"sources":["components/Badge/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,YAAlC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,oBAAT,QAAqC,eAArC;AAIA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;AACA,EAAA,uBAAuB,CAAC,KAAD,CAAvB;AAEA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","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"],"sourceRoot":"../src/"}
@@ -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 +1 @@
1
- {"version":3,"file":"Badge.types.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Badge.types.js","sourceRoot":"../src/","sources":["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\nexport type BadgeCommons = {\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\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'> & Partial<BadgeCommons>;\nexport type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;\n"]}
@@ -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":"../src/","sources":["components/Badge/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AAGxB,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","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"]}
@@ -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,OAAO,MAAM,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,I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AAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAHnD,CADF;AAOD,CAVM","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"],"sourceRoot":"../src/"}
@@ -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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\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 'aria-hidden': true,\n ...props,\n }),\n icon: resolveShorthand(props.icon),\n };\n\n return state;\n};\n"],"sourceRoot":"../src/"}
@@ -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;