@fluentui/react-badge 9.0.0-alpha.83 → 9.0.0-alpha.87
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +182 -8
- package/CHANGELOG.md +63 -8
- package/Spec.md +3 -47
- package/dist/react-badge.d.ts +73 -123
- package/lib/Badge.js.map +1 -1
- package/lib/CounterBadge.js.map +1 -1
- package/lib/PresenceBadge.js.map +1 -1
- package/lib/common/isConformant.js +2 -0
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Badge/Badge.d.ts +6 -2
- package/lib/components/Badge/Badge.js.map +1 -1
- package/lib/components/Badge/Badge.types.d.ts +20 -32
- package/lib/components/Badge/Badge.types.js.map +1 -1
- package/lib/components/Badge/index.js.map +1 -1
- package/lib/components/Badge/renderBadge.js +3 -4
- package/lib/components/Badge/renderBadge.js.map +1 -1
- package/lib/components/Badge/useBadge.d.ts +1 -5
- package/lib/components/Badge/useBadge.js +29 -18
- package/lib/components/Badge/useBadge.js.map +1 -1
- package/lib/components/Badge/useBadgeStyles.js +5 -5
- package/lib/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.d.ts +1 -8
- package/lib/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/CounterBadge.types.d.ts +24 -38
- package/lib/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib/components/CounterBadge/index.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadge.d.ts +1 -5
- package/lib/components/CounterBadge/useCounterBadge.js +25 -19
- package/lib/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js +1 -1
- package/lib/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.d.ts +6 -4
- package/lib/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/PresenceBadge.types.d.ts +6 -17
- package/lib/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib/components/PresenceBadge/index.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadge.d.ts +1 -5
- package/lib/components/PresenceBadge/usePresenceBadge.js +15 -21
- package/lib/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
- package/lib/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Badge.js.map +1 -1
- package/lib-commonjs/CounterBadge.js.map +1 -1
- package/lib-commonjs/PresenceBadge.js.map +1 -1
- package/lib-commonjs/common/isConformant.js +2 -0
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.d.ts +6 -2
- package/lib-commonjs/components/Badge/Badge.js.map +1 -1
- package/lib-commonjs/components/Badge/Badge.types.d.ts +20 -32
- package/lib-commonjs/components/Badge/Badge.types.js.map +1 -1
- package/lib-commonjs/components/Badge/index.js.map +1 -1
- package/lib-commonjs/components/Badge/renderBadge.js +2 -4
- package/lib-commonjs/components/Badge/renderBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadge.d.ts +1 -5
- package/lib-commonjs/components/Badge/useBadge.js +30 -19
- package/lib-commonjs/components/Badge/useBadge.js.map +1 -1
- package/lib-commonjs/components/Badge/useBadgeStyles.js +5 -5
- package/lib-commonjs/components/Badge/useBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.d.ts +1 -8
- package/lib-commonjs/components/CounterBadge/CounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.d.ts +24 -38
- package/lib-commonjs/components/CounterBadge/CounterBadge.types.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/index.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadge.d.ts +1 -5
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js +27 -21
- package/lib-commonjs/components/CounterBadge/useCounterBadge.js.map +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js +1 -1
- package/lib-commonjs/components/CounterBadge/useCounterBadgeStyles.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.d.ts +6 -4
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.d.ts +6 -17
- package/lib-commonjs/components/PresenceBadge/PresenceBadge.types.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/index.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.d.ts +1 -5
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js +16 -22
- package/lib-commonjs/components/PresenceBadge/usePresenceBadge.js.map +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js +1 -1
- package/lib-commonjs/components/PresenceBadge/usePresenceBadgeStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
- package/lib-amd/Badge.d.ts +0 -1
- package/lib-amd/Badge.js +0 -6
- package/lib-amd/Badge.js.map +0 -1
- package/lib-amd/CounterBadge.d.ts +0 -1
- package/lib-amd/CounterBadge.js +0 -6
- package/lib-amd/CounterBadge.js.map +0 -1
- package/lib-amd/PresenceBadge.d.ts +0 -1
- package/lib-amd/PresenceBadge.js +0 -6
- package/lib-amd/PresenceBadge.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -4
- package/lib-amd/common/isConformant.js +0 -15
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Badge/Badge.d.ts +0 -6
- package/lib-amd/components/Badge/Badge.js +0 -15
- package/lib-amd/components/Badge/Badge.js.map +0 -1
- package/lib-amd/components/Badge/Badge.types.d.ts +0 -47
- package/lib-amd/components/Badge/Badge.types.js +0 -5
- package/lib-amd/components/Badge/Badge.types.js.map +0 -1
- package/lib-amd/components/Badge/index.d.ts +0 -5
- package/lib-amd/components/Badge/index.js +0 -10
- package/lib-amd/components/Badge/index.js.map +0 -1
- package/lib-amd/components/Badge/renderBadge.d.ts +0 -2
- package/lib-amd/components/Badge/renderBadge.js +0 -14
- package/lib-amd/components/Badge/renderBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadge.d.ts +0 -10
- package/lib-amd/components/Badge/useBadge.js +0 -25
- package/lib-amd/components/Badge/useBadge.js.map +0 -1
- package/lib-amd/components/Badge/useBadgeStyles.d.ts +0 -5
- package/lib-amd/components/Badge/useBadgeStyles.js +0 -234
- package/lib-amd/components/Badge/useBadgeStyles.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.d.ts +0 -12
- package/lib-amd/components/CounterBadge/CounterBadge.js +0 -15
- package/lib-amd/components/CounterBadge/CounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/CounterBadge.types.d.ts +0 -55
- package/lib-amd/components/CounterBadge/CounterBadge.types.js +0 -5
- package/lib-amd/components/CounterBadge/CounterBadge.types.js.map +0 -1
- package/lib-amd/components/CounterBadge/index.d.ts +0 -4
- package/lib-amd/components/CounterBadge/index.js +0 -9
- package/lib-amd/components/CounterBadge/index.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadge.d.ts +0 -10
- package/lib-amd/components/CounterBadge/useCounterBadge.js +0 -28
- package/lib-amd/components/CounterBadge/useCounterBadge.js.map +0 -1
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.d.ts +0 -5
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js +0 -46
- package/lib-amd/components/CounterBadge/useCounterBadgeStyles.js.map +0 -1
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.d.ts +0 -10
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.js +0 -64
- package/lib-amd/components/PresenceBadge/DefaultPresenceBadgeIcons.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.d.ts +0 -8
- package/lib-amd/components/PresenceBadge/PresenceBadge.js +0 -15
- package/lib-amd/components/PresenceBadge/PresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.d.ts +0 -28
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js +0 -5
- package/lib-amd/components/PresenceBadge/PresenceBadge.types.js.map +0 -1
- package/lib-amd/components/PresenceBadge/index.d.ts +0 -4
- package/lib-amd/components/PresenceBadge/index.js +0 -9
- package/lib-amd/components/PresenceBadge/index.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadge.d.ts +0 -10
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js +0 -37
- package/lib-amd/components/PresenceBadge/usePresenceBadge.js.map +0 -1
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.d.ts +0 -5
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js +0 -58
- package/lib-amd/components/PresenceBadge/usePresenceBadgeStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -5
- package/lib-amd/index.js +0 -10
- package/lib-amd/index.js.map +0 -1
package/dist/react-badge.d.ts
CHANGED
@@ -1,182 +1,132 @@
|
|
1
|
-
import type {
|
2
|
-
import type {
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
3
|
+
import { ObjectShorthandProps } from '@fluentui/react-utilities';
|
3
4
|
import * as React_2 from 'react';
|
4
|
-
import
|
5
|
+
import { ShorthandProps } from '@fluentui/react-utilities';
|
6
|
+
import { ShorthandRenderFunction } from '@fluentui/react-utilities';
|
5
7
|
|
6
8
|
/**
|
7
9
|
* Define a styled Badge, using the `useBadge` hook.
|
8
10
|
*/
|
9
|
-
export declare const Badge: React_2.
|
11
|
+
export declare const Badge: React_2.ForwardRefExoticComponent<Pick<{
|
12
|
+
root?: ShorthandProps<ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>>;
|
13
|
+
icon?: ShorthandProps<ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>>;
|
14
|
+
}, "icon"> & React_2.HTMLAttributes<HTMLElement> & {
|
15
|
+
children?: string | number | boolean | {} | React_2.ReactElement<any, string | ((props: any) => React_2.ReactElement<any, string | any | (new (props: any) => React_2.Component<any, any, any>)> | null) | (new (props: any) => React_2.Component<any, any, any>)> | React_2.ReactNodeArray | React_2.ReactPortal | ShorthandRenderFunction<React_2.HTMLAttributes<HTMLElement>> | null | undefined;
|
16
|
+
} & Partial<BadgeCommons> & React_2.RefAttributes<HTMLElement>>;
|
10
17
|
|
11
|
-
export declare type
|
12
|
-
|
13
|
-
export declare type BadgeColors = 'brand' | 'danger' | 'severe' | 'warning' | 'success' | 'important' | 'informative' | 'subtle';
|
14
|
-
|
15
|
-
export declare type BadgeProps = ComponentPropsCompat & React_2.HTMLAttributes<HTMLElement> & {
|
16
|
-
/**
|
17
|
-
* A Badge can be sized.
|
18
|
-
* @defaultvalue medium
|
19
|
-
*/
|
20
|
-
size?: BadgeSize;
|
21
|
-
/**
|
22
|
-
* A Badge can be square, circular or rounded
|
23
|
-
* @defaultvalue circular
|
24
|
-
*/
|
25
|
-
shape?: BadgeShape;
|
18
|
+
export declare type BadgeCommons = {
|
26
19
|
/**
|
27
20
|
* A Badge can be filled, outline, ghost, inverted
|
28
21
|
* @defaultvalue filled
|
29
22
|
*/
|
30
|
-
appearance
|
23
|
+
appearance: 'filled' | 'ghost' | 'outline' | 'tint';
|
31
24
|
/**
|
32
|
-
* A Badge
|
33
|
-
* @defaultvalue
|
25
|
+
* A Badge can be one of preset colors
|
26
|
+
* @defaultvalue brand
|
34
27
|
*/
|
35
|
-
color
|
28
|
+
color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
|
36
29
|
/**
|
37
|
-
*
|
38
|
-
*/
|
39
|
-
icon?: ShorthandPropsCompat<React_2.HTMLAttributes<HTMLElement>>;
|
40
|
-
/**
|
41
|
-
* Position for Icon to be rendered
|
30
|
+
* A Badge can position the icon before or after the content.
|
42
31
|
* @defaultvalue before
|
43
32
|
*/
|
44
|
-
iconPosition
|
45
|
-
};
|
46
|
-
|
47
|
-
export declare type BadgeShape = 'rounded' | 'square' | 'circular';
|
48
|
-
|
49
|
-
/**
|
50
|
-
* Consts listing which props are shorthand props.
|
51
|
-
*/
|
52
|
-
export declare const badgeShorthandPropsCompat: readonly ["icon"];
|
53
|
-
|
54
|
-
export declare type BadgeSize = 'smallest' | 'smaller' | 'small' | 'medium' | 'large' | 'larger' | 'largest';
|
55
|
-
|
56
|
-
export declare type BadgeState = BadgeProps & {
|
33
|
+
iconPosition: 'before' | 'after';
|
57
34
|
/**
|
58
|
-
*
|
35
|
+
* A Badge can be square, circular or rounded.
|
36
|
+
* @defaultvalue circular
|
59
37
|
*/
|
60
|
-
|
38
|
+
shape: 'circular' | 'rounded' | 'square';
|
61
39
|
/**
|
62
|
-
*
|
40
|
+
* A Badge can be on of several preset sizes.
|
41
|
+
* @defaultvalue medium
|
63
42
|
*/
|
64
|
-
|
43
|
+
size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
65
44
|
};
|
66
45
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
appearance?: "filled" | "ghost" | undefined;
|
73
|
-
overflowCount?: number | undefined;
|
74
|
-
count?: number | undefined;
|
75
|
-
showZero?: boolean | undefined;
|
76
|
-
dot?: boolean | undefined;
|
77
|
-
} & React_2.RefAttributes<HTMLElement>>;
|
78
|
-
|
79
|
-
export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape'> & {
|
80
|
-
/**
|
81
|
-
* A Badge can be circular or rounded
|
82
|
-
* @defaultvalue circular
|
83
|
-
*/
|
84
|
-
shape?: Extract<BadgeProps['shape'], 'rounded' | 'circular'>;
|
85
|
-
/**
|
86
|
-
* A Badge can be filled, ghost
|
87
|
-
* @defaultvalue filled
|
88
|
-
*/
|
89
|
-
appearance?: Extract<BadgeProps['appearance'], 'filled' | 'ghost'>;
|
90
|
-
/**
|
91
|
-
* Max number to be displayed
|
92
|
-
* @defaultvalue 99
|
93
|
-
*/
|
94
|
-
overflowCount?: number;
|
95
|
-
/**
|
96
|
-
* Value displayed by the Badge
|
97
|
-
* @defaultvalue 0
|
98
|
-
*/
|
99
|
-
count?: number;
|
100
|
-
/**
|
101
|
-
* If the badge should be shown when count is 0
|
102
|
-
* @defaultvalue false
|
103
|
-
*/
|
104
|
-
showZero?: boolean;
|
105
|
-
/**
|
106
|
-
* If a dot badge should be displayed
|
107
|
-
* @defaultvalue false
|
108
|
-
*/
|
109
|
-
dot?: boolean;
|
46
|
+
export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
|
47
|
+
|
48
|
+
export declare type BadgeSlots = {
|
49
|
+
root: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
|
50
|
+
icon?: ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>;
|
110
51
|
};
|
111
52
|
|
53
|
+
export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|
54
|
+
|
112
55
|
/**
|
113
|
-
*
|
56
|
+
* Define a styled CounterBadge, using the `useCounterBadge` hook.
|
114
57
|
*/
|
115
|
-
export declare const
|
58
|
+
export declare const CounterBadge: React_2.ForwardRefExoticComponent<Pick<BadgeProps, "icon" | "children" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "iconPosition" | "size"> & Partial<CounterBadgeCommons> & React_2.RefAttributes<HTMLElement>>;
|
116
59
|
|
117
|
-
export declare type
|
60
|
+
export declare type CounterBadgeCommons = {
|
118
61
|
/**
|
119
62
|
* Max number to be displayed
|
120
|
-
* @
|
63
|
+
* @default 99
|
121
64
|
*/
|
122
65
|
overflowCount: number;
|
123
66
|
/**
|
124
67
|
* Value displayed by the Badge
|
125
|
-
* @
|
68
|
+
* @default 0
|
126
69
|
*/
|
127
70
|
count: number;
|
128
71
|
/**
|
129
72
|
* If the badge should be shown when count is 0
|
130
|
-
* @
|
73
|
+
* @default false
|
131
74
|
*/
|
132
75
|
showZero: boolean;
|
133
76
|
/**
|
134
|
-
* If a dot
|
135
|
-
* @
|
77
|
+
* If a dot should be displayed without the count
|
78
|
+
* @default false
|
136
79
|
*/
|
137
80
|
dot: boolean;
|
138
|
-
};
|
139
|
-
|
140
|
-
/**
|
141
|
-
* Define a styled Badge, using the `useBadge` hook.
|
142
|
-
*/
|
143
|
-
export declare const PresenceBadge: React_2.ForwardRefExoticComponent<Pick<BadgeProps, "children" | "as" | "className" | "icon" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "css" | "size" | "iconPosition"> & {
|
144
|
-
status?: "available" | "busy" | "outOfOffice" | "away" | "offline" | "doNotDisturb" | undefined;
|
145
|
-
outOfOffice?: boolean | undefined;
|
146
|
-
} & React_2.RefAttributes<HTMLElement>>;
|
147
|
-
|
148
|
-
export declare type PresenceBadgeProps = Omit<BadgeProps, 'shape' | 'appearance'> & {
|
149
81
|
/**
|
150
|
-
*
|
151
|
-
* @
|
82
|
+
* A Badge can be circular or rounded
|
83
|
+
* @default circular
|
152
84
|
*/
|
153
|
-
|
85
|
+
shape: 'circular' | 'rounded';
|
154
86
|
/**
|
155
|
-
*
|
156
|
-
*
|
157
|
-
* @defaultvalue false
|
87
|
+
* A Badge can be filled, ghost
|
88
|
+
* @default filled
|
158
89
|
*/
|
159
|
-
|
90
|
+
appearance: 'filled' | 'ghost';
|
160
91
|
};
|
161
92
|
|
162
93
|
/**
|
163
|
-
*
|
94
|
+
* {@docCategory CounterBadge}
|
95
|
+
*/
|
96
|
+
export declare type CounterBadgeProps = Omit<BadgeProps, 'appearance' | 'shape'> & Partial<CounterBadgeCommons>;
|
97
|
+
|
98
|
+
/**
|
99
|
+
* {@docCategory CounterBadge}
|
100
|
+
*/
|
101
|
+
export declare type CounterBadgeState = Omit<BadgeState, 'appearance' | 'shape'> & CounterBadgeCommons;
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Define a styled Badge, using the `useBadge` hook.
|
164
105
|
*/
|
165
|
-
export declare const
|
106
|
+
export declare const PresenceBadge: React_2.ForwardRefExoticComponent<Pick<{
|
107
|
+
root?: ShorthandProps<ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>>;
|
108
|
+
icon?: ShorthandProps<ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>>>;
|
109
|
+
}, "icon"> & React_2.HTMLAttributes<HTMLElement> & {
|
110
|
+
children?: string | number | boolean | {} | React_2.ReactElement<any, string | ((props: any) => React_2.ReactElement<any, string | any | (new (props: any) => React_2.Component<any, any, any>)> | null) | (new (props: any) => React_2.Component<any, any, any>)> | React_2.ReactNodeArray | React_2.ReactPortal | ShorthandRenderFunction<React_2.HTMLAttributes<HTMLElement>> | null | undefined;
|
111
|
+
} & Partial<BadgeCommons> & Partial<PresenceBadgeCommons> & React_2.RefAttributes<HTMLElement>>;
|
166
112
|
|
167
|
-
export declare
|
113
|
+
export declare interface PresenceBadgeCommons {
|
168
114
|
/**
|
169
115
|
* Represents several status
|
170
|
-
* @
|
116
|
+
* @default available
|
171
117
|
*/
|
172
118
|
status: PresenceBadgeStatus;
|
173
119
|
/**
|
174
120
|
* Modifies the display to indicate that the user is out of office.
|
175
121
|
* This can be combined with any status to display an out-of-office version of that status
|
176
|
-
* @
|
122
|
+
* @default false
|
177
123
|
*/
|
178
124
|
outOfOffice: boolean;
|
179
|
-
}
|
125
|
+
}
|
126
|
+
|
127
|
+
export declare type PresenceBadgeProps = BadgeProps & Partial<PresenceBadgeCommons>;
|
128
|
+
|
129
|
+
export declare type PresenceBadgeState = BadgeState & PresenceBadgeCommons;
|
180
130
|
|
181
131
|
export declare type PresenceBadgeStatus = 'busy' | 'outOfOffice' | 'away' | 'available' | 'offline' | 'doNotDisturb';
|
182
132
|
|
@@ -185,7 +135,7 @@ export declare const renderBadge: (state: BadgeState) => JSX.Element;
|
|
185
135
|
/**
|
186
136
|
* Returns the props and state required to render the component
|
187
137
|
*/
|
188
|
-
export declare const useBadge: (props: BadgeProps, ref: React_2.Ref<HTMLElement
|
138
|
+
export declare const useBadge: (props: BadgeProps, ref: React_2.Ref<HTMLElement>) => BadgeState;
|
189
139
|
|
190
140
|
/**
|
191
141
|
* Applies style classnames to slots
|
@@ -195,7 +145,7 @@ export declare const useBadgeStyles: (state: BadgeState) => BadgeState;
|
|
195
145
|
/**
|
196
146
|
* Returns the props and state required to render the component
|
197
147
|
*/
|
198
|
-
export declare const useCounterBadge: (props: CounterBadgeProps, ref: React_2.Ref<HTMLElement
|
148
|
+
export declare const useCounterBadge: (props: CounterBadgeProps, ref: React_2.Ref<HTMLElement>) => CounterBadgeState;
|
199
149
|
|
200
150
|
/**
|
201
151
|
* Applies style classnames to slots
|
@@ -205,7 +155,7 @@ export declare const useCounterBadgeStyles: (state: CounterBadgeState) => Counte
|
|
205
155
|
/**
|
206
156
|
* Returns the props and state required to render the component
|
207
157
|
*/
|
208
|
-
export declare const usePresenceBadge: (props: PresenceBadgeProps, ref: React_2.Ref<HTMLElement
|
158
|
+
export declare const usePresenceBadge: (props: PresenceBadgeProps, ref: React_2.Ref<HTMLElement>) => PresenceBadgeState;
|
209
159
|
|
210
160
|
/**
|
211
161
|
* Applies style classnames to slots
|
package/lib/Badge.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Badge.js","sourceRoot":"","sources":["../src/Badge.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
package/lib/CounterBadge.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CounterBadge.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"CounterBadge.js","sourceRoot":"","sources":["../src/CounterBadge.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
package/lib/PresenceBadge.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PresenceBadge.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"PresenceBadge.js","sourceRoot":"","sources":["../src/PresenceBadge.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
@@ -4,6 +4,8 @@ export function isConformant(testInfo) {
|
|
4
4
|
var defaultOptions = {
|
5
5
|
asPropHandlesRef: true,
|
6
6
|
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
+
// https://github.com/microsoft/fluentui/issues/19522
|
8
|
+
skipAsPropTests: true,
|
7
9
|
extraTests: makeStylesTests
|
8
10
|
};
|
9
11
|
baseIsConformant(defaultOptions, testInfo);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE;
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAGA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D;AACA,IAAA,eAAe,EAAE,IAJ0C;AAK3D,IAAA,UAAU,EAAE;AAL+C,GAA7D;AAQA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { BadgeProps } from './Badge.types';
|
3
2
|
/**
|
4
3
|
* Define a styled Badge, using the `useBadge` hook.
|
5
4
|
*/
|
6
|
-
export declare const Badge: React.
|
5
|
+
export declare const Badge: React.ForwardRefExoticComponent<Pick<{
|
6
|
+
root?: import("@fluentui/react-utilities").ShorthandProps<import("@fluentui/react-utilities").ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>>;
|
7
|
+
icon?: import("@fluentui/react-utilities").ShorthandProps<import("@fluentui/react-utilities").ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>>;
|
8
|
+
}, "icon"> & React.HTMLAttributes<HTMLElement> & {
|
9
|
+
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | import("@fluentui/react-utilities").ShorthandRenderFunction<React.HTMLAttributes<HTMLElement>> | null | undefined;
|
10
|
+
} & Partial<import("./Badge.types").BadgeCommons> & React.RefAttributes<HTMLElement>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["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;AAGA;;AAEG;;AACH,OAAO,IAAM,KAAK,
|
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;AAGA;;AAEG;;AACH,OAAO,IAAM,KAAK,gBAAG,KAAK,CAAC,UAAN,CAA0C,UAAC,KAAD,EAAQ,GAAR,EAAW;AACxE,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CAAtB;AACA,EAAA,cAAc,CAAC,KAAD,CAAd;AAEA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALoB,CAAd;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,47 +1,35 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type {
|
3
|
-
export declare type
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
export declare type
|
8
|
-
/**
|
9
|
-
* A Badge can be sized.
|
10
|
-
* @defaultvalue medium
|
11
|
-
*/
|
12
|
-
size?: BadgeSize;
|
13
|
-
/**
|
14
|
-
* A Badge can be square, circular or rounded
|
15
|
-
* @defaultvalue circular
|
16
|
-
*/
|
17
|
-
shape?: BadgeShape;
|
2
|
+
import type { ComponentProps, ComponentState, ObjectShorthandProps } from '@fluentui/react-utilities';
|
3
|
+
export declare type BadgeSlots = {
|
4
|
+
root: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
5
|
+
icon?: ObjectShorthandProps<React.HTMLAttributes<HTMLElement>>;
|
6
|
+
};
|
7
|
+
export declare type BadgeCommons = {
|
18
8
|
/**
|
19
9
|
* A Badge can be filled, outline, ghost, inverted
|
20
10
|
* @defaultvalue filled
|
21
11
|
*/
|
22
|
-
appearance
|
12
|
+
appearance: 'filled' | 'ghost' | 'outline' | 'tint';
|
23
13
|
/**
|
24
|
-
* A Badge
|
25
|
-
* @defaultvalue
|
26
|
-
*/
|
27
|
-
color?: BadgeColors;
|
28
|
-
/**
|
29
|
-
* Icon slot
|
14
|
+
* A Badge can be one of preset colors
|
15
|
+
* @defaultvalue brand
|
30
16
|
*/
|
31
|
-
|
17
|
+
color: 'brand' | 'danger' | 'important' | 'informative' | 'severe' | 'subtle' | 'success' | 'warning';
|
32
18
|
/**
|
33
|
-
*
|
19
|
+
* A Badge can position the icon before or after the content.
|
34
20
|
* @defaultvalue before
|
35
21
|
*/
|
36
|
-
iconPosition
|
37
|
-
};
|
38
|
-
export declare type BadgeState = BadgeProps & {
|
22
|
+
iconPosition: 'before' | 'after';
|
39
23
|
/**
|
40
|
-
*
|
24
|
+
* A Badge can be square, circular or rounded.
|
25
|
+
* @defaultvalue circular
|
41
26
|
*/
|
42
|
-
|
27
|
+
shape: 'circular' | 'rounded' | 'square';
|
43
28
|
/**
|
44
|
-
*
|
29
|
+
* A Badge can be on of several preset sizes.
|
30
|
+
* @defaultvalue medium
|
45
31
|
*/
|
46
|
-
|
32
|
+
size: 'tiny' | 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large';
|
47
33
|
};
|
34
|
+
export declare type BadgeProps = ComponentProps<Partial<BadgeSlots>> & Partial<BadgeCommons>;
|
35
|
+
export declare type BadgeState = ComponentState<BadgeSlots> & BadgeCommons;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Badge.types.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Badge.types.js","sourceRoot":"","sources":["../../../src/components/Badge/Badge.types.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
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,12 +1,11 @@
|
|
1
1
|
import { __assign } from "tslib";
|
2
2
|
import * as React from 'react';
|
3
|
-
import {
|
4
|
-
import { badgeShorthandPropsCompat } from './useBadge';
|
3
|
+
import { getSlots } from '@fluentui/react-utilities';
|
5
4
|
export var renderBadge = function (state) {
|
6
|
-
var _a =
|
5
|
+
var _a = getSlots(state, ['icon', 'root']),
|
7
6
|
slots = _a.slots,
|
8
7
|
slotProps = _a.slotProps;
|
9
8
|
|
10
|
-
return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), state.iconPosition === 'before' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), state.children, state.iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)));
|
9
|
+
return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), state.iconPosition === 'before' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)), state.root.children, state.iconPosition === 'after' && /*#__PURE__*/React.createElement(slots.icon, __assign({}, slotProps.icon)));
|
11
10
|
};
|
12
11
|
//# sourceMappingURL=renderBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Badge/renderBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/renderBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA,OAAO,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,QAAQ,CAAa,KAAb,EAAoB,CAAC,MAAD,EAAS,MAAT,CAApB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,YAAN,KAAuB,QAAvB,iBAAmC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CADtC,EAEG,KAAK,CAAC,IAAN,CAAW,QAFd,EAGG,KAAK,CAAC,YAAN,KAAuB,OAAvB,iBAAkC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,CAHrC,CADF;AAOD,CAVM","sourceRoot":""}
|
@@ -1,10 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import type { BadgeProps, BadgeState } from './Badge.types';
|
3
|
-
/**
|
4
|
-
* Consts listing which props are shorthand props.
|
5
|
-
*/
|
6
|
-
export declare const badgeShorthandPropsCompat: readonly ["icon"];
|
7
3
|
/**
|
8
4
|
* Returns the props and state required to render the component
|
9
5
|
*/
|
10
|
-
export declare const useBadge: (props: BadgeProps, ref: React.Ref<HTMLElement
|
6
|
+
export declare const useBadge: (props: BadgeProps, ref: React.Ref<HTMLElement>) => BadgeState;
|
@@ -1,25 +1,36 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
/**
|
4
|
-
* Consts listing which props are shorthand props.
|
5
|
-
*/
|
6
|
-
|
7
|
-
export var badgeShorthandPropsCompat = ['icon'];
|
8
|
-
var mergeProps = /*#__PURE__*/makeMergeProps({
|
9
|
-
deepMerge: badgeShorthandPropsCompat
|
10
|
-
});
|
1
|
+
import { __assign } from "tslib";
|
2
|
+
import { getNativeElementProps, resolveShorthand } from '@fluentui/react-utilities';
|
11
3
|
/**
|
12
4
|
* Returns the props and state required to render the component
|
13
5
|
*/
|
14
6
|
|
15
|
-
export var useBadge = function (props, ref
|
16
|
-
var
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
7
|
+
export var useBadge = function (props, ref) {
|
8
|
+
var _a = props.shape,
|
9
|
+
shape = _a === void 0 ? 'circular' : _a,
|
10
|
+
_b = props.size,
|
11
|
+
size = _b === void 0 ? 'medium' : _b,
|
12
|
+
_c = props.iconPosition,
|
13
|
+
iconPosition = _c === void 0 ? 'before' : _c,
|
14
|
+
_d = props.appearance,
|
15
|
+
appearance = _d === void 0 ? 'filled' : _d,
|
16
|
+
_e = props.color,
|
17
|
+
color = _e === void 0 ? 'brand' : _e;
|
18
|
+
var state = {
|
19
|
+
shape: shape,
|
20
|
+
size: size,
|
21
|
+
iconPosition: iconPosition,
|
22
|
+
appearance: appearance,
|
23
|
+
color: color,
|
24
|
+
components: {
|
25
|
+
root: 'div',
|
26
|
+
icon: 'span'
|
27
|
+
},
|
28
|
+
root: getNativeElementProps('div', __assign({
|
29
|
+
ref: ref,
|
30
|
+
'aria-hidden': true
|
31
|
+
}, props)),
|
32
|
+
icon: resolveShorthand(props.icon)
|
33
|
+
};
|
23
34
|
return state;
|
24
35
|
};
|
25
36
|
//# sourceMappingURL=useBadge.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Badge/useBadge.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Badge/useBadge.ts"],"names":[],"mappings":";AACA,SAAS,qBAAT,EAAgC,gBAAhC,QAAwD,2BAAxD;AAGA;;AAEG;;AACH,OAAO,IAAM,QAAQ,GAAG,UAAC,KAAD,EAAoB,GAApB,EAA+C;AAEnE,MAAA,EAAA,GAKE,KAAK,CALW,KAAlB;AAAA,MAAA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,UAAH,GAAa,EAAlB;AAAA,MACA,EAAA,GAIE,KAAK,CAJQ,IADf;AAAA,MACA,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EADf;AAAA,MAEA,EAAA,GAGE,KAAK,CAHgB,YAFvB;AAAA,MAEA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAFvB;AAAA,MAGA,EAAA,GAEE,KAAK,CAFc,UAHrB;AAAA,MAGA,UAAU,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAHrB;AAAA,MAIA,EAAA,GACE,KAAK,CADQ,KAJf;AAAA,MAIA,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,OAAH,GAAU,EAJf;AAOF,MAAM,KAAK,GAAe;AACxB,IAAA,KAAK,EAAA,KADmB;AAExB,IAAA,IAAI,EAAA,IAFoB;AAGxB,IAAA,YAAY,EAAA,YAHY;AAIxB,IAAA,UAAU,EAAA,UAJc;AAKxB,IAAA,KAAK,EAAA,KALmB;AAMxB,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,IAAI,EAAE;AAFI,KANY;AAUxB,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAM,QAAA,CAAA;AAC/B,MAAA,GAAG,EAAA,GAD4B;AAE/B,qBAAe;AAFgB,KAAA,EAG5B,KAH4B,CAAN,CAVH;AAexB,IAAA,IAAI,EAAE,gBAAgB,CAAC,KAAK,CAAC,IAAP;AAfE,GAA1B;AAkBA,SAAO,KAAP;AACD,CA5BM","sourceRoot":""}
|
@@ -24,12 +24,12 @@ var useStyles = /*#__PURE__*/__styles({
|
|
24
24
|
"Bahqtrf": "f1kx028l",
|
25
25
|
"qhf8xq": "f10pi13n"
|
26
26
|
},
|
27
|
-
"
|
27
|
+
"rootTiny": {
|
28
28
|
"a9b677": "f16dn6v3",
|
29
29
|
"Bqenvij": "f3mu39s",
|
30
30
|
"Be2twd7": "f130uwy9"
|
31
31
|
},
|
32
|
-
"
|
32
|
+
"rootExtraSmall": {
|
33
33
|
"a9b677": "fpd43o0",
|
34
34
|
"Bqenvij": "f30q22z",
|
35
35
|
"Be2twd7": "f1tccstq"
|
@@ -58,7 +58,7 @@ var useStyles = /*#__PURE__*/__styles({
|
|
58
58
|
"Be2twd7": "f1ugzwwg",
|
59
59
|
"rmohyg": "f19jf40t"
|
60
60
|
},
|
61
|
-
"
|
61
|
+
"rootExtraLarge": {
|
62
62
|
"Bf4jedk": "fwbmr0d",
|
63
63
|
"Bqenvij": "f1d2rq10",
|
64
64
|
"z189sj": ["f11qrl6u", "fjlbh76"],
|
@@ -73,7 +73,7 @@ var useStyles = /*#__PURE__*/__styles({
|
|
73
73
|
"rootRounded": {
|
74
74
|
"Dimara": "fnpfh4l"
|
75
75
|
},
|
76
|
-
"
|
76
|
+
"rootRoundedSmallToTiny": {
|
77
77
|
"Dimara": "f1mhewp8"
|
78
78
|
},
|
79
79
|
"rootCircular": {
|
@@ -313,7 +313,7 @@ export var useBadgeStyles = function (state) {
|
|
313
313
|
var isImportant = state.color === 'important';
|
314
314
|
var isInformative = state.color === 'informative';
|
315
315
|
var isSubtle = state.color === 'subtle';
|
316
|
-
state.className = mergeClasses(styles.root, state.size === '
|
316
|
+
state.root.className = mergeClasses(styles.root, state.size === 'tiny' && styles.rootTiny, state.size === 'extra-small' && styles.rootExtraSmall, state.size === 'small' && styles.rootSmall, state.size === 'medium' && styles.rootMedium, state.size === 'large' && styles.rootLarge, state.size === 'extra-large' && styles.rootExtraLarge, state.shape === 'circular' && styles.rootCircular, state.shape === 'rounded' && styles.rootRounded, state.shape === 'rounded' && (state.size === 'small' || state.size === 'extra-small' || state.size === 'tiny') && styles.rootRoundedSmallToTiny, isGhost && styles.rootGhost, isOutline && styles.rootOutline, isTint && styles.rootTint, isFilled && isDanger && styles.rootFilledDanger, isOutline && isDanger && styles.rootOutlineDanger, isTint && isDanger && styles.rootTintDanger, isGhost && isDanger && styles.rootGhostDanger, isFilled && isSevere && styles.rootFilledSevere, isOutline && isSevere && styles.rootOutlineSevere, isTint && isSevere && styles.rootTintSevere, isGhost && isSevere && styles.rootGhostSevere, isFilled && isWarning && styles.rootFilledWarning, isOutline && isWarning && styles.rootOutlineWarning, isTint && isWarning && styles.rootTintWarning, isGhost && isWarning && styles.rootGhostWarning, isFilled && isSuccess && styles.rootFilledSuccess, isOutline && isSuccess && styles.rootOutlineSuccess, isTint && isSuccess && styles.rootTintSuccess, isGhost && isSuccess && styles.rootGhostSuccess, isFilled && isImportant && styles.rootFilledImportant, isOutline && isImportant && styles.rootOutlineImportant, isTint && isImportant && styles.rootTintImportant, isGhost && isImportant && styles.rootGhostImportant, isFilled && isInformative && styles.rootFilledInformative, isOutline && isInformative && styles.rootOutlineInformative, isTint && isInformative && styles.rootTintInformative, isGhost && isInformative && styles.rootGhostInformative, isFilled && isSubtle && styles.rootFilledSubtle, isOutline && isSubtle && styles.rootOutlineSubtle, isTint && isSubtle && styles.rootTintSubtle, isGhost && isSubtle && styles.rootGhostSubtle, state.root.className);
|
317
317
|
|
318
318
|
if (state.icon) {
|
319
319
|
state.icon.className = mergeClasses(styles.icon, state.icon.className);
|