@fluentui/react-badge 9.0.0-rc.6 → 9.0.0-rc.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/CHANGELOG.json +117 -4
  2. package/CHANGELOG.md +141 -104
  3. package/dist/{react-badge.d.ts → index.d.ts} +35 -38
  4. package/{lib → dist}/tsdoc-metadata.json +0 -0
  5. package/lib/components/Badge/Badge.types.js.map +1 -1
  6. package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
  7. package/lib/components/CounterBadge/useCounterBadge.js +1 -2
  8. package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
  9. package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
  10. package/lib/components/PresenceBadge/usePresenceBadge.js +15 -3
  11. package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  12. package/lib-commonjs/components/CounterBadge/useCounterBadge.js +1 -2
  13. package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
  14. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +15 -3
  15. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
  16. package/package.json +8 -8
  17. package/lib/Badge.d.ts +0 -1
  18. package/lib/CounterBadge.d.ts +0 -1
  19. package/lib/PresenceBadge.d.ts +0 -1
  20. package/lib/components/Badge/Badge.d.ts +0 -6
  21. package/lib/components/Badge/Badge.types.d.ts +0 -34
  22. package/lib/components/Badge/index.d.ts +0 -5
  23. package/lib/components/Badge/renderBadge.d.ts +0 -2
  24. package/lib/components/Badge/useBadge.d.ts +0 -6
  25. package/lib/components/Badge/useBadgeStyles.d.ts +0 -11
  26. package/lib/components/CounterBadge/CounterBadge.d.ts +0 -6
  27. package/lib/components/CounterBadge/CounterBadge.types.d.ts +0 -41
  28. package/lib/components/CounterBadge/index.d.ts +0 -4
  29. package/lib/components/CounterBadge/useCounterBadge.d.ts +0 -6
  30. package/lib/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -12
  31. package/lib/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  32. package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +0 -19
  33. package/lib/components/PresenceBadge/index.d.ts +0 -4
  34. package/lib/components/PresenceBadge/presenceIcons.d.ts +0 -11
  35. package/lib/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  36. package/lib/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -12
  37. package/lib/index.d.ts +0 -6
  38. package/lib-commonjs/Badge.d.ts +0 -1
  39. package/lib-commonjs/CounterBadge.d.ts +0 -1
  40. package/lib-commonjs/PresenceBadge.d.ts +0 -1
  41. package/lib-commonjs/components/Badge/Badge.d.ts +0 -6
  42. package/lib-commonjs/components/Badge/Badge.types.d.ts +0 -34
  43. package/lib-commonjs/components/Badge/index.d.ts +0 -5
  44. package/lib-commonjs/components/Badge/renderBadge.d.ts +0 -2
  45. package/lib-commonjs/components/Badge/useBadge.d.ts +0 -6
  46. package/lib-commonjs/components/Badge/useBadgeStyles.d.ts +0 -11
  47. package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +0 -6
  48. package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +0 -41
  49. package/lib-commonjs/components/CounterBadge/index.d.ts +0 -4
  50. package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +0 -6
  51. package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -12
  52. package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +0 -6
  53. package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +0 -19
  54. package/lib-commonjs/components/PresenceBadge/index.d.ts +0 -4
  55. package/lib-commonjs/components/PresenceBadge/presenceIcons.d.ts +0 -11
  56. package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +0 -6
  57. package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -12
  58. package/lib-commonjs/index.d.ts +0 -6
@@ -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,34 +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 BadgeCommons = {
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 BadgeProps = Omit<ComponentProps<BadgeSlots>, 'color'> & Partial<BadgeCommons>;
34
- export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
@@ -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,41 +0,0 @@
1
- import type { BadgeProps, BadgeState } from '../Badge/index';
2
- declare type CounterBadgeCommons = {
3
- /**
4
- * Max number to be displayed
5
- * @default 99
6
- */
7
- overflowCount: number;
8
- /**
9
- * Value displayed by the Badge
10
- * @default 0
11
- */
12
- count: number;
13
- /**
14
- * If the badge should be shown when count is 0
15
- * @default false
16
- */
17
- showZero: boolean;
18
- /**
19
- * If a dot should be displayed without the count
20
- * @default false
21
- */
22
- dot: boolean;
23
- /**
24
- * A Badge can be circular or rounded
25
- * @default circular
26
- */
27
- shape: 'circular' | 'rounded';
28
- /**
29
- * A Badge can be filled, ghost
30
- * @default filled
31
- */
32
- appearance: 'filled' | 'ghost';
33
- /**
34
- * Semantic colors for a counter badge
35
- * @default brand
36
- */
37
- color: Extract<BadgeProps['color'], 'brand' | 'danger' | 'important' | 'informative'>;
38
- };
39
- export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape' | 'color'> & Partial<CounterBadgeCommons>;
40
- export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape' | 'color'> & CounterBadgeCommons;
41
- export {};
@@ -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,19 +0,0 @@
1
- import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';
2
- import type { BadgeCommons, BadgeSlots } from '../Badge/Badge.types';
3
- export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb' | 'unknown';
4
- declare type PresenceBadgeCommons = {
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
- } & BadgeCommons;
17
- export declare type PresenceBadgeProps = Omit<ComponentProps<Pick<BadgeSlots, 'root'>>, 'color'> & Partial<Pick<PresenceBadgeCommons, 'status' | 'outOfOffice' | 'size'>>;
18
- export declare type PresenceBadgeState = PresenceBadgeCommons & ComponentState<BadgeSlots>;
19
- export {};
@@ -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;
@@ -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';