@fluentui/react-badge 9.0.15 → 9.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. package/CHANGELOG.json +57 -1
  2. package/CHANGELOG.md +22 -2
  3. package/lib/components/Badge/Badge.js +0 -1
  4. package/lib/components/Badge/Badge.js.map +1 -1
  5. package/lib/components/Badge/renderBadge.js +6 -3
  6. package/lib/components/Badge/renderBadge.js.map +1 -1
  7. package/lib/components/Badge/useBadge.js +0 -1
  8. package/lib/components/Badge/useBadge.js.map +1 -1
  9. package/lib/components/Badge/useBadgeStyles.js +242 -250
  10. package/lib/components/Badge/useBadgeStyles.js.map +1 -1
  11. package/lib/components/CounterBadge/CounterBadge.js +0 -1
  12. package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
  13. package/lib/components/CounterBadge/useCounterBadge.js +2 -4
  14. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  15. package/lib/components/CounterBadge/useCounterBadgeStyles.js +11 -16
  16. package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  17. package/lib/components/PresenceBadge/PresenceBadge.js +0 -1
  18. package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
  19. package/lib/components/PresenceBadge/presenceIcons.js.map +1 -1
  20. package/lib/components/PresenceBadge/usePresenceBadge.js +2 -10
  21. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  22. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +49 -56
  23. package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib-commonjs/Badge.js +0 -2
  26. package/lib-commonjs/Badge.js.map +1 -1
  27. package/lib-commonjs/CounterBadge.js +0 -2
  28. package/lib-commonjs/CounterBadge.js.map +1 -1
  29. package/lib-commonjs/PresenceBadge.js +0 -2
  30. package/lib-commonjs/PresenceBadge.js.map +1 -1
  31. package/lib-commonjs/components/Badge/Badge.js +0 -6
  32. package/lib-commonjs/components/Badge/Badge.js.map +1 -1
  33. package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
  34. package/lib-commonjs/components/Badge/index.js +0 -5
  35. package/lib-commonjs/components/Badge/index.js.map +1 -1
  36. package/lib-commonjs/components/Badge/renderBadge.js +6 -7
  37. package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
  38. package/lib-commonjs/components/Badge/useBadge.js +0 -4
  39. package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
  40. package/lib-commonjs/components/Badge/useBadgeStyles.js +242 -254
  41. package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
  42. package/lib-commonjs/components/CounterBadge/CounterBadge.js +0 -6
  43. package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
  44. package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
  45. package/lib-commonjs/components/CounterBadge/index.js +0 -5
  46. package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
  47. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +2 -7
  48. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  49. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +11 -20
  50. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
  51. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js +0 -6
  52. package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
  53. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  54. package/lib-commonjs/components/PresenceBadge/index.js +0 -5
  55. package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
  56. package/lib-commonjs/components/PresenceBadge/presenceIcons.js +0 -2
  57. package/lib-commonjs/components/PresenceBadge/presenceIcons.js.map +1 -1
  58. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +2 -15
  59. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  60. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +49 -60
  61. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
  62. package/lib-commonjs/index.js +0 -6
  63. package/lib-commonjs/index.js.map +1 -1
  64. package/package.json +6 -6
@@ -3,8 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
7
  tslib_1.__exportStar(require("./components/PresenceBadge/index"), exports);
10
8
  //# sourceMappingURL=PresenceBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/PresenceBadge.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kCAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/PresenceBadge/index';\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":";;;;;;AAAAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/PresenceBadge.ts"],"sourcesContent":["export * from './components/PresenceBadge/index';\n"]}
@@ -4,19 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.Badge = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const useBadge_1 = /*#__PURE__*/require("./useBadge");
11
-
12
9
  const useBadgeStyles_1 = /*#__PURE__*/require("./useBadgeStyles");
13
-
14
10
  const renderBadge_1 = /*#__PURE__*/require("./renderBadge");
15
11
  /**
16
12
  * Define a styled Badge, using the `useBadge_unstable` hook.
17
13
  */
18
-
19
-
20
14
  exports.Badge = /*#__PURE__*/React.forwardRef((props, ref) => {
21
15
  const state = useBadge_1.useBadge_unstable(props, ref);
22
16
  useBadgeStyles_1.useBadgeStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/components/Badge/Badge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpF,MAAM,KAAK,GAAG,UAAA,CAAA,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;EACA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;EAEA,OAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,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
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,aAAK,gBAAoCC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGC,4BAAiB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAC3CG,wCAAuB,CAACF,KAAK,CAAC;EAE9B,OAAOG,kCAAoB,CAACH,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFL,aAAK,CAACS,WAAW,GAAG,OAAO","names":["exports","React","forwardRef","props","ref","state","useBadge_1","useBadgeStyles_1","renderBadge_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/components/Badge/Badge.tsx"],"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"]}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
1
+ {"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
@@ -3,14 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
6
  const tslib_1 = /*#__PURE__*/require("tslib");
8
-
9
7
  tslib_1.__exportStar(require("./Badge"), exports);
10
-
11
8
  tslib_1.__exportStar(require("./renderBadge"), exports);
12
-
13
9
  tslib_1.__exportStar(require("./useBadge"), exports);
14
-
15
10
  tslib_1.__exportStar(require("./useBadgeStyles"), exports);
16
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/components/Badge/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AAGA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":";;;;;;AAAAA;AAGAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/components/Badge/index.ts"],"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"]}
@@ -4,21 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.renderBadge_unstable = void 0;
7
-
8
7
  const React = /*#__PURE__*/require("react");
9
-
10
8
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
11
-
12
9
  const renderBadge_unstable = state => {
13
10
  const {
14
11
  slots,
15
12
  slotProps
16
13
  } = react_utilities_1.getSlots(state);
17
- return React.createElement(slots.root, { ...slotProps.root
18
- }, state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
19
- }), state.root.children, state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, { ...slotProps.icon
14
+ return React.createElement(slots.root, {
15
+ ...slotProps.root
16
+ }, state.iconPosition === 'before' && slots.icon && React.createElement(slots.icon, {
17
+ ...slotProps.icon
18
+ }), state.root.children, state.iconPosition === 'after' && slots.icon && React.createElement(slots.icon, {
19
+ ...slotProps.icon
20
20
  }));
21
21
  };
22
-
23
22
  exports.renderBadge_unstable = renderBadge_unstable;
24
23
  //# sourceMappingURL=renderBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAGO,MAAM,oBAAoB,GAAI,KAAD,IAAsB;EACxD,MAAM;IAAE,KAAF;IAAS;EAAT,IAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;EAEA,OACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,IAAmC,KAAK,CAAC,IAAzC,IAAiD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CADpD,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,IAAkC,KAAK,CAAC,IAAxC,IAAgD,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;EAAf,CAAX,CAHnD,CADF;AAOD,CAVM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","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/"}
1
+ {"version":3,"mappings":";;;;;;AAAA;AACA;AAGO,MAAMA,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAaH,KAAK,CAAC;EAExD,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BL,KAAK,CAACM,YAAY,KAAK,QAAQ,IAAIL,KAAK,CAACM,IAAI,IAAIH,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,EACnFP,KAAK,CAACK,IAAI,CAACG,QAAQ,EACnBR,KAAK,CAACM,YAAY,KAAK,OAAO,IAAIL,KAAK,CAACM,IAAI,IAAIH,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,CACxE;AAEjB,CAAC;AAVYE,4BAAoB","names":["renderBadge_unstable","state","slots","slotProps","react_utilities_1","React","root","iconPosition","icon","children","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/components/Badge/renderBadge.tsx"],"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"]}
@@ -4,13 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useBadge_unstable = void 0;
7
-
8
7
  const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
9
8
  /**
10
9
  * Returns the props and state required to render the component
11
10
  */
12
-
13
-
14
11
  const useBadge_unstable = (props, ref) => {
15
12
  const {
16
13
  shape = 'circular',
@@ -37,6 +34,5 @@ const useBadge_unstable = (props, ref) => {
37
34
  };
38
35
  return state;
39
36
  };
40
-
41
37
  exports.useBadge_unstable = useBadge_unstable;
42
38
  //# sourceMappingURL=useBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-badge/src/components/Badge/useBadge.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;EAC9F,MAAM;IACJ,KAAK,GAAG,UADJ;IAEJ,IAAI,GAAG,QAFH;IAGJ,YAAY,GAAG,QAHX;IAIJ,UAAU,GAAG,QAJT;IAKJ,KAAK,GAAG;EALJ,IAMF,KANJ;EAQA,MAAM,KAAK,GAAe;IACxB,KADwB;IAExB,IAFwB;IAGxB,YAHwB;IAIxB,UAJwB;IAKxB,KALwB;IAMxB,UAAU,EAAE;MACV,IAAI,EAAE,KADI;MAEV,IAAI,EAAE;IAFI,CANY;IAUxB,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,KAAtB,EAA6B;MACjC,GADiC;MAEjC,GAAG;IAF8B,CAA7B,CAVkB;IAcxB,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,KAAK,CAAC,IAAvB;EAdkB,CAA1B;EAiBA,OAAO,KAAP;AACD,CA3BM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","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"],"sourceRoot":"../src/"}
1
+ {"version":3,"mappings":";;;;;;AACA;AAGA;;;AAGO,MAAMA,iBAAiB,GAAG,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;EAC9F,MAAM;IACJC,KAAK,GAAG,UAAU;IAClBC,IAAI,GAAG,QAAQ;IACfC,YAAY,GAAG,QAAQ;IACvBC,UAAU,GAAG,QAAQ;IACrBC,KAAK,GAAG;EAAO,CAChB,GAAGN,KAAK;EAET,MAAMO,KAAK,GAAe;IACxBL,KAAK;IACLC,IAAI;IACJC,YAAY;IACZC,UAAU;IACVC,KAAK;IACLE,UAAU,EAAE;MACVC,IAAI,EAAE,KAAK;MACXC,IAAI,EAAE;KACP;IACDD,IAAI,EAAEE,uCAAqB,CAAC,KAAK,EAAE;MACjCV,GAAG;MACH,GAAGD;KACJ,CAAC;IACFU,IAAI,EAAEC,kCAAgB,CAACX,KAAK,CAACU,IAAI;GAClC;EAED,OAAOH,KAAK;AACd,CAAC;AA3BYK,yBAAiB","names":["useBadge_unstable","props","ref","shape","size","iconPosition","appearance","color","state","components","root","icon","react_utilities_1","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-badge/src/components/Badge/useBadge.ts"],"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"]}