@fluentui/react-label 9.0.0-alpha.42 → 9.0.0-alpha.46
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +171 -7
- package/CHANGELOG.md +59 -7
- package/dist/react-label.d.ts +26 -41
- package/lib/Label.js.map +1 -1
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Label/Label.d.ts +2 -5
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/Label.types.d.ts +15 -26
- package/lib/components/Label/Label.types.js.map +1 -1
- package/lib/components/Label/index.js.map +1 -1
- package/lib/components/Label/renderLabel.js +3 -3
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +3 -4
- package/lib/components/Label/useLabel.js +28 -40
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.js +1 -1
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Label.js.map +1 -1
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Label/Label.d.ts +2 -5
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +15 -26
- package/lib-commonjs/components/Label/Label.types.js.map +1 -1
- package/lib-commonjs/components/Label/index.js.map +1 -1
- package/lib-commonjs/components/Label/renderLabel.js +2 -2
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.d.ts +3 -4
- package/lib-commonjs/components/Label/useLabel.js +30 -41
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -6
- package/lib-amd/Label.d.ts +0 -1
- package/lib-amd/Label.js +0 -6
- package/lib-amd/Label.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/Label/Label.d.ts +0 -10
- package/lib-amd/components/Label/Label.js +0 -15
- package/lib-amd/components/Label/Label.js.map +0 -1
- package/lib-amd/components/Label/Label.types.d.ts +0 -49
- package/lib-amd/components/Label/Label.types.js +0 -5
- package/lib-amd/components/Label/Label.types.js.map +0 -1
- package/lib-amd/components/Label/index.d.ts +0 -5
- package/lib-amd/components/Label/index.js +0 -10
- package/lib-amd/components/Label/index.js.map +0 -1
- package/lib-amd/components/Label/renderLabel.d.ts +0 -5
- package/lib-amd/components/Label/renderLabel.js +0 -16
- package/lib-amd/components/Label/renderLabel.js.map +0 -1
- package/lib-amd/components/Label/useLabel.d.ts +0 -18
- package/lib-amd/components/Label/useLabel.js +0 -53
- package/lib-amd/components/Label/useLabel.js.map +0 -1
- package/lib-amd/components/Label/useLabelStyles.d.ts +0 -5
- package/lib-amd/components/Label/useLabelStyles.js +0 -50
- package/lib-amd/components/Label/useLabelStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -2
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
@@ -1,14 +1,12 @@
|
|
1
1
|
import { __assign } from "tslib";
|
2
|
-
import {
|
2
|
+
import { getNativeElementProps } from '@fluentui/react-utilities';
|
3
|
+
import { resolveShorthand } from '@fluentui/react-utilities';
|
3
4
|
/**
|
4
5
|
* Array of all shorthand properties listed in LabelShorthandProps
|
5
6
|
* {@docCatergory Label}
|
6
7
|
*/
|
7
8
|
|
8
|
-
export var labelShorthandProps = ['required'];
|
9
|
-
var mergeProps = /*#__PURE__*/makeMergeProps({
|
10
|
-
deepMerge: labelShorthandProps
|
11
|
-
});
|
9
|
+
export var labelShorthandProps = ['root', 'required'];
|
12
10
|
/**
|
13
11
|
* Create the state required to render Label.
|
14
12
|
*
|
@@ -17,44 +15,34 @@ var mergeProps = /*#__PURE__*/makeMergeProps({
|
|
17
15
|
*
|
18
16
|
* @param props - props from this instance of Label
|
19
17
|
* @param ref - reference to root HTMLElement of Label
|
20
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
21
18
|
*/
|
22
19
|
|
23
|
-
export var useLabel = function (props, ref
|
24
|
-
var
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
return
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
* or a custom required text.
|
38
|
-
*/
|
39
|
-
|
40
|
-
var resolveLabelShorthandProps = function (props) {
|
41
|
-
var propsNormalized;
|
42
|
-
|
43
|
-
if (props.required === true) {
|
44
|
-
propsNormalized = __assign(__assign({}, props), {
|
45
|
-
required: {
|
20
|
+
export var useLabel = function (props, ref) {
|
21
|
+
var _a = props.disabled,
|
22
|
+
disabled = _a === void 0 ? false : _a,
|
23
|
+
_b = props.required,
|
24
|
+
required = _b === void 0 ? false : _b,
|
25
|
+
_c = props.strong,
|
26
|
+
strong = _c === void 0 ? false : _c,
|
27
|
+
_d = props.size,
|
28
|
+
size = _d === void 0 ? 'medium' : _d;
|
29
|
+
return {
|
30
|
+
disabled: disabled,
|
31
|
+
required: resolveShorthand(required === false ? null : required, {
|
32
|
+
required: !!required,
|
33
|
+
defaultProps: {
|
46
34
|
children: '*'
|
47
35
|
}
|
48
|
-
})
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
36
|
+
}),
|
37
|
+
strong: strong,
|
38
|
+
size: size,
|
39
|
+
components: {
|
40
|
+
root: 'label',
|
41
|
+
required: 'span'
|
42
|
+
},
|
43
|
+
root: getNativeElementProps('label', __assign({
|
44
|
+
ref: ref
|
45
|
+
}, props))
|
46
|
+
};
|
59
47
|
};
|
60
48
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/useLabel.tsx"],"names":[],"mappings":";AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":";AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA;;;AAGG;;AACH,OAAO,IAAM,mBAAmB,GAA4B,CAAC,MAAD,EAAS,UAAT,CAArD;AAEP;;;;;;;;AAQG;;AACH,OAAO,IAAM,QAAQ,GAAG,UAAC,KAAD,EAAoB,GAApB,EAA+C;AAC7D,MAAA,EAAA,GAAwE,KAAK,CAA7D,QAAhB;AAAA,MAAA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAhB;AAAA,MAAkB,EAAA,GAAsD,KAAK,CAA3C,QAAlC;AAAA,MAAkB,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlC;AAAA,MAAoC,EAAA,GAAoC,KAAK,CAA3B,MAAlD;AAAA,MAAoC,MAAM,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlD;AAAA,MAAoD,EAAA,GAAoB,KAAK,CAAV,IAAnE;AAAA,MAAoD,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAAnE;AACR,SAAO;AACL,IAAA,QAAQ,EAAA,QADH;AAEL,IAAA,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,KAAK,KAAb,GAAqB,IAArB,GAA4B,QAA7B,EAAuC;AAC/D,MAAA,QAAQ,EAAE,CAAC,CAAC,QADmD;AAE/D,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,EAAE;AAAZ;AAFiD,KAAvC,CAFrB;AAML,IAAA,MAAM,EAAA,MAND;AAOL,IAAA,IAAI,EAAA,IAPC;AAQL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KARP;AASL,IAAA,IAAI,EAAE,qBAAqB,CAAC,OAAD,EAAQ,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAAR;AATtB,GAAP;AAWD,CAbM","sourceRoot":""}
|
@@ -41,7 +41,7 @@ var useStyles = /*#__PURE__*/__styles({
|
|
41
41
|
|
42
42
|
export var useLabelStyles = function (state) {
|
43
43
|
var styles = useStyles();
|
44
|
-
state.className = mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.className);
|
44
|
+
state.root.className = mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
45
45
|
|
46
46
|
if (state.required) {
|
47
47
|
state.required.className = mergeClasses(styles.required, state.required.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA;;AAEG;;AACH,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAkB;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA;;AAEG;;AACH,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAkB;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,MAAM,CAAC,IAD0B,EAEjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAFQ,EAGjC,MAAM,CAAC,KAAK,CAAC,IAAP,CAH2B,EAIjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MAJU,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;;AAQA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,MAAM,CAAC,QAAR,EAAkB,KAAK,CAAC,QAAN,CAAe,SAAjC,CAAvC;AACD;;AAED,SAAO,KAAP;AACD,CAfM","sourceRoot":""}
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["Label.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","
|
1
|
+
{"version":3,"sources":["../src/Label.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;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,+BAAA,CAAA;AAH+C,GAA7D;AAMA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAVD,OAAA,CAAA,YAAA,GAAA,YAAA","
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;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,+BAAA,CAAA;AAH+C,GAA7D;AAMA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAVD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|
@@ -2,9 +2,6 @@ import * as React from 'react';
|
|
2
2
|
/**
|
3
3
|
* A label component provides a title or name to a component.
|
4
4
|
*/
|
5
|
-
export declare const Label: React.ForwardRefExoticComponent<import("@fluentui/react-utilities").
|
6
|
-
|
7
|
-
required?: 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").ObjectShorthandPropsCompat<import("@fluentui/react-utilities").ComponentPropsCompat> | null | undefined;
|
8
|
-
size?: "small" | "medium" | "large" | undefined;
|
9
|
-
strong?: boolean | undefined;
|
5
|
+
export declare const Label: React.ForwardRefExoticComponent<Pick<import("@fluentui/react-utilities").ComponentProps<import("./Label.types").LabelSlots, "root">, "form" | "slot" | "style" | "title" | "key" | "htmlFor" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "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" | "children" | "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" | "as"> & Partial<import("./Label.types").LabelCommons> & {
|
6
|
+
required?: 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").ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | null | undefined;
|
10
7
|
} & React.RefAttributes<HTMLElement>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/Label.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAGA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAQ,KAAK,CAAC,UAAN,CAA0C,UAAC,KAAD,EAAQ,GAAR,EAAW;AACxE,MAAM,KAAK,GAAG,UAAA,CAAA,QAAA,CAAS,KAAT,EAAgB,GAAhB,CAAd;AAEA,EAAA,gBAAA,CAAA,cAAA,CAAe,KAAf;AACA,SAAO,aAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALoB,CAAR;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":";;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,IAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,IAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAGA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAQ,KAAK,CAAC,UAAN,CAA0C,UAAC,KAAD,EAAQ,GAAR,EAAW;AACxE,MAAM,KAAK,GAAG,UAAA,CAAA,QAAA,CAAS,KAAT,EAAgB,GAAhB,CAAd;AAEA,EAAA,gBAAA,CAAA,cAAA,CAAe,KAAf;AACA,SAAO,aAAA,CAAA,WAAA,CAAY,KAAZ,CAAP;AACD,CALoB,CAAR;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,49 +1,38 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
1
2
|
import * as React from 'react';
|
2
|
-
import type { ComponentPropsCompat, ComponentStateCompat, ObjectShorthandPropsCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Label Props
|
5
5
|
*/
|
6
|
-
export declare type
|
6
|
+
export declare type LabelCommons = {
|
7
7
|
/**
|
8
8
|
* Renders the label as disabled
|
9
9
|
* @defaultvalue false
|
10
10
|
*/
|
11
|
-
disabled
|
12
|
-
/**
|
13
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
14
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
15
|
-
* @defaultvalue false
|
16
|
-
*/
|
17
|
-
required?: boolean | ShorthandPropsCompat<ComponentPropsCompat>;
|
11
|
+
disabled: boolean;
|
18
12
|
/**
|
19
13
|
* A label supports different sizes.
|
20
14
|
* @defaultvalue 'medium'
|
21
15
|
*/
|
22
|
-
size
|
16
|
+
size: 'small' | 'medium' | 'large';
|
23
17
|
/**
|
24
18
|
* A label supports semibold/strong fontweight.
|
25
19
|
* @defaultvalue false
|
26
20
|
*/
|
27
|
-
strong
|
21
|
+
strong: boolean;
|
22
|
+
};
|
23
|
+
export declare type LabelSlots = {
|
24
|
+
root: IntrinsicShorthandProps<'label'>;
|
25
|
+
required?: IntrinsicShorthandProps<'span'>;
|
28
26
|
};
|
29
|
-
/**
|
30
|
-
* Names of the shorthand properties in LabelProps
|
31
|
-
*/
|
32
|
-
export declare type LabelShorthandProps = 'required';
|
33
|
-
/**
|
34
|
-
* Names of LabelProps that have a default value in useLabel
|
35
|
-
*/
|
36
|
-
export declare type LabelDefaultedProps = 'size';
|
37
27
|
/**
|
38
28
|
* State used in rendering Label
|
39
29
|
*/
|
40
|
-
export declare type LabelState =
|
41
|
-
|
42
|
-
* Ref to the root element
|
43
|
-
*/
|
44
|
-
ref: React.Ref<HTMLElement>;
|
30
|
+
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
31
|
+
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
45
32
|
/**
|
46
|
-
* The required prop
|
33
|
+
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
34
|
+
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
35
|
+
* @defaultvalue false
|
47
36
|
*/
|
48
|
-
required?:
|
37
|
+
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
49
38
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,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","
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,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","sourceRoot":""}
|
@@ -18,11 +18,11 @@ var useLabel_1 = /*#__PURE__*/require("./useLabel");
|
|
18
18
|
|
19
19
|
|
20
20
|
var renderLabel = function (state) {
|
21
|
-
var _a = react_utilities_1.
|
21
|
+
var _a = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps),
|
22
22
|
slots = _a.slots,
|
23
23
|
slotProps = _a.slotProps;
|
24
24
|
|
25
|
-
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.children,
|
25
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.root.children, React.createElement(slots.required, tslib_1.__assign({}, slotProps.required)));
|
26
26
|
};
|
27
27
|
|
28
28
|
exports.renderLabel = renderLabel;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/renderLabel.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,iBAAA,CAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,IAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,IAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;AAGA;;AAEG;;;AACI,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,EAA4B,UAAA,CAAA,mBAA5B,CAAvB;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,OAAA,CAAA,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAFF,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { LabelProps,
|
2
|
+
import type { LabelProps, LabelSlots, LabelState } from './Label.types';
|
3
3
|
/**
|
4
4
|
* Array of all shorthand properties listed in LabelShorthandProps
|
5
5
|
* {@docCatergory Label}
|
6
6
|
*/
|
7
|
-
export declare const labelShorthandProps:
|
7
|
+
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
8
8
|
/**
|
9
9
|
* Create the state required to render Label.
|
10
10
|
*
|
@@ -13,6 +13,5 @@ export declare const labelShorthandProps: LabelShorthandProps[];
|
|
13
13
|
*
|
14
14
|
* @param props - props from this instance of Label
|
15
15
|
* @param ref - reference to root HTMLElement of Label
|
16
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
17
16
|
*/
|
18
|
-
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement
|
17
|
+
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
@@ -8,16 +8,15 @@ exports.useLabel = exports.labelShorthandProps = void 0;
|
|
8
8
|
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
9
|
|
10
10
|
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
|
12
|
+
var react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
13
|
/**
|
12
14
|
* Array of all shorthand properties listed in LabelShorthandProps
|
13
15
|
* {@docCatergory Label}
|
14
16
|
*/
|
15
17
|
|
16
18
|
|
17
|
-
exports.labelShorthandProps = ['required'];
|
18
|
-
var mergeProps = /*#__PURE__*/react_utilities_1.makeMergeProps({
|
19
|
-
deepMerge: exports.labelShorthandProps
|
20
|
-
});
|
19
|
+
exports.labelShorthandProps = ['root', 'required'];
|
21
20
|
/**
|
22
21
|
* Create the state required to render Label.
|
23
22
|
*
|
@@ -26,46 +25,36 @@ var mergeProps = /*#__PURE__*/react_utilities_1.makeMergeProps({
|
|
26
25
|
*
|
27
26
|
* @param props - props from this instance of Label
|
28
27
|
* @param ref - reference to root HTMLElement of Label
|
29
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
30
|
-
*/
|
31
|
-
|
32
|
-
var useLabel = function (props, ref, defaultProps) {
|
33
|
-
var state = mergeProps({
|
34
|
-
ref: ref,
|
35
|
-
as: 'label',
|
36
|
-
size: 'medium',
|
37
|
-
required: {
|
38
|
-
as: 'span'
|
39
|
-
}
|
40
|
-
}, defaultProps && resolveLabelShorthandProps(defaultProps), resolveLabelShorthandProps(props));
|
41
|
-
return state;
|
42
|
-
};
|
43
|
-
|
44
|
-
exports.useLabel = useLabel;
|
45
|
-
/**
|
46
|
-
* Label will first need to check if required is a boolean or shorthandprops,
|
47
|
-
* this allows for the required prop to handle both the default asterisk for required
|
48
|
-
* or a custom required text.
|
49
28
|
*/
|
50
29
|
|
51
|
-
var
|
52
|
-
var
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
30
|
+
var useLabel = function (props, ref) {
|
31
|
+
var _a = props.disabled,
|
32
|
+
disabled = _a === void 0 ? false : _a,
|
33
|
+
_b = props.required,
|
34
|
+
required = _b === void 0 ? false : _b,
|
35
|
+
_c = props.strong,
|
36
|
+
strong = _c === void 0 ? false : _c,
|
37
|
+
_d = props.size,
|
38
|
+
size = _d === void 0 ? 'medium' : _d;
|
39
|
+
return {
|
40
|
+
disabled: disabled,
|
41
|
+
required: react_utilities_2.resolveShorthand(required === false ? null : required, {
|
42
|
+
required: !!required,
|
43
|
+
defaultProps: {
|
57
44
|
children: '*'
|
58
45
|
}
|
59
|
-
})
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
46
|
+
}),
|
47
|
+
strong: strong,
|
48
|
+
size: size,
|
49
|
+
components: {
|
50
|
+
root: 'label',
|
51
|
+
required: 'span'
|
52
|
+
},
|
53
|
+
root: react_utilities_1.getNativeElementProps('label', tslib_1.__assign({
|
54
|
+
ref: ref
|
55
|
+
}, props))
|
56
|
+
};
|
70
57
|
};
|
58
|
+
|
59
|
+
exports.useLabel = useLabel;
|
71
60
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/useLabel.tsx"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":";;;;;;;;;AACA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,IAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;;AAGG;;;AACU,OAAA,CAAA,mBAAA,GAA+C,CAAC,MAAD,EAAS,UAAT,CAA/C;AAEb;;;;;;;;AAQG;;AACI,IAAM,QAAQ,GAAG,UAAC,KAAD,EAAoB,GAApB,EAA+C;AAC7D,MAAA,EAAA,GAAwE,KAAK,CAA7D,QAAhB;AAAA,MAAA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAhB;AAAA,MAAkB,EAAA,GAAsD,KAAK,CAA3C,QAAlC;AAAA,MAAkB,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlC;AAAA,MAAoC,EAAA,GAAoC,KAAK,CAA3B,MAAlD;AAAA,MAAoC,MAAM,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlD;AAAA,MAAoD,EAAA,GAAoB,KAAK,CAAV,IAAnE;AAAA,MAAoD,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAAnE;AACR,SAAO;AACL,IAAA,QAAQ,EAAA,QADH;AAEL,IAAA,QAAQ,EAAE,iBAAA,CAAA,gBAAA,CAAiB,QAAQ,KAAK,KAAb,GAAqB,IAArB,GAA4B,QAA7C,EAAuD;AAC/D,MAAA,QAAQ,EAAE,CAAC,CAAC,QADmD;AAE/D,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,EAAE;AAAZ;AAFiD,KAAvD,CAFL;AAML,IAAA,MAAM,EAAA,MAND;AAOL,IAAA,IAAI,EAAA,IAPC;AAQL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KARP;AASL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,OAAtB,EAA6B,OAAA,CAAA,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAA7B;AATD,GAAP;AAWD,CAbM;;AAAM,OAAA,CAAA,QAAA,GAAQ,QAAR","sourceRoot":""}
|
@@ -49,7 +49,7 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
49
49
|
|
50
50
|
var useLabelStyles = function (state) {
|
51
51
|
var styles = useStyles();
|
52
|
-
state.className = react_make_styles_1.mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.className);
|
52
|
+
state.root.className = react_make_styles_1.mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
53
53
|
|
54
54
|
if (state.required) {
|
55
55
|
state.required.className = react_make_styles_1.mergeClasses(styles.required, state.required.className);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAGA;;AAEG;;;AACH,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAkB;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;AAGA;;AAEG;;;AACH,IAAM,SAAS,gBAAG,mBAAA,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACI,IAAM,cAAc,GAAG,UAAC,KAAD,EAAkB;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,MAAM,CAAC,IADc,EAErB,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAFJ,EAGrB,MAAM,CAAC,KAAK,CAAC,IAAP,CAHe,EAIrB,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MAJF,EAKrB,KAAK,CAAC,IAAN,CAAW,SALU,CAAvB;;AAQA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,mBAAA,CAAA,YAAA,CAAa,MAAM,CAAC,QAApB,EAA8B,KAAK,CAAC,QAAN,CAAe,SAA7C,CAA3B;AACD;;AAED,SAAO,KAAP;AACD,CAfM;;AAAM,OAAA,CAAA,cAAA,GAAc,cAAd","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;;AAEA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;AAEA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "9.0.0-alpha.
|
3
|
+
"version": "9.0.0-alpha.46",
|
4
4
|
"description": "Label component for FluentUI library.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -25,11 +25,11 @@
|
|
25
25
|
"storybook": "start-storybook"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@fluentui/babel-make-styles": "9.0.0-alpha.
|
28
|
+
"@fluentui/babel-make-styles": "9.0.0-alpha.55",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-alpha.
|
30
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-alpha.48",
|
31
31
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-make-styles": "9.0.0-alpha.
|
32
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-alpha.17",
|
33
33
|
"@fluentui/scripts": "^1.0.0",
|
34
34
|
"@types/enzyme": "3.10.3",
|
35
35
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -43,8 +43,8 @@
|
|
43
43
|
"react-test-renderer": "^16.3.0"
|
44
44
|
},
|
45
45
|
"dependencies": {
|
46
|
-
"@fluentui/react-make-styles": "9.0.0-alpha.
|
47
|
-
"@fluentui/react-utilities": "9.0.0-alpha.
|
46
|
+
"@fluentui/react-make-styles": "9.0.0-alpha.73",
|
47
|
+
"@fluentui/react-utilities": "9.0.0-alpha.53",
|
48
48
|
"tslib": "^2.1.0"
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
package/lib-amd/Label.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Label/index';
|
package/lib-amd/Label.js
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
define(["require", "exports", "tslib", "./components/Label/index"], function (require, exports, tslib_1, index_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
tslib_1.__exportStar(index_1, exports);
|
5
|
-
});
|
6
|
-
//# sourceMappingURL=Label.js.map
|
package/lib-amd/Label.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["Label.ts"],"names":[],"mappings":";;;IAAA,uCAAyC","sourcesContent":["export * from './components/Label/index';\n"]}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
define(["require", "exports", "@fluentui/react-conformance", "@fluentui/react-conformance-make-styles"], function (require, exports, react_conformance_1, react_conformance_make_styles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.isConformant = void 0;
|
5
|
-
function isConformant(testInfo) {
|
6
|
-
var defaultOptions = {
|
7
|
-
asPropHandlesRef: true,
|
8
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
9
|
-
extraTests: react_conformance_make_styles_1.default,
|
10
|
-
};
|
11
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
12
|
-
}
|
13
|
-
exports.isConformant = isConformant;
|
14
|
-
});
|
15
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":";;;;IAIA,SAAgB,YAAY,CAC1B,QAAyF;QAEzF,IAAM,cAAc,GAAyC;YAC3D,gBAAgB,EAAE,IAAI;YACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;YAC5D,UAAU,EAAE,uCAAqC;SAClD,CAAC;QAEF,gCAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IAC7C,CAAC;IAVD,oCAUC","sourcesContent":["import { isConformant as baseIsConformant } from '@fluentui/react-conformance';\nimport type { IsConformantOptions, TestObject } from '@fluentui/react-conformance';\nimport makeStylesTests from '@fluentui/react-conformance-make-styles';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n extraTests: makeStylesTests as TestObject<TProps>,\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
/**
|
3
|
-
* A label component provides a title or name to a component.
|
4
|
-
*/
|
5
|
-
export declare const Label: React.ForwardRefExoticComponent<import("@fluentui/react-utilities").ComponentPropsCompat & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
6
|
-
disabled?: boolean | undefined;
|
7
|
-
required?: 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").ObjectShorthandPropsCompat<import("@fluentui/react-utilities").ComponentPropsCompat> | null | undefined;
|
8
|
-
size?: "small" | "medium" | "large" | undefined;
|
9
|
-
strong?: boolean | undefined;
|
10
|
-
} & React.RefAttributes<HTMLElement>>;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
define(["require", "exports", "react", "./useLabel", "./renderLabel", "./useLabelStyles"], function (require, exports, React, useLabel_1, renderLabel_1, useLabelStyles_1) {
|
2
|
-
"use strict";
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
exports.Label = void 0;
|
5
|
-
/**
|
6
|
-
* A label component provides a title or name to a component.
|
7
|
-
*/
|
8
|
-
exports.Label = React.forwardRef(function (props, ref) {
|
9
|
-
var state = useLabel_1.useLabel(props, ref);
|
10
|
-
useLabelStyles_1.useLabelStyles(state);
|
11
|
-
return renderLabel_1.renderLabel(state);
|
12
|
-
});
|
13
|
-
exports.Label.displayName = 'Label';
|
14
|
-
});
|
15
|
-
//# sourceMappingURL=Label.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["components/Label/Label.tsx"],"names":[],"mappings":";;;;IAMA;;OAEG;IACU,QAAA,KAAK,GAAG,KAAK,CAAC,UAAU,CAA0B,UAAC,KAAK,EAAE,GAAG;QACxE,IAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEnC,+BAAc,CAAC,KAAK,CAAC,CAAC;QACtB,OAAO,yBAAW,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useLabel } from './useLabel';\nimport { renderLabel } from './renderLabel';\nimport { useLabelStyles } from './useLabelStyles';\nimport type { LabelProps } from './Label.types';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label = React.forwardRef<HTMLElement, LabelProps>((props, ref) => {\n const state = useLabel(props, ref);\n\n useLabelStyles(state);\n return renderLabel(state);\n});\n\nLabel.displayName = 'Label';\n"]}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { ComponentPropsCompat, ComponentStateCompat, ObjectShorthandPropsCompat, ShorthandPropsCompat } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
|
-
export declare type LabelProps = ComponentPropsCompat & React.LabelHTMLAttributes<HTMLLabelElement> & {
|
7
|
-
/**
|
8
|
-
* Renders the label as disabled
|
9
|
-
* @defaultvalue false
|
10
|
-
*/
|
11
|
-
disabled?: boolean;
|
12
|
-
/**
|
13
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
14
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
15
|
-
* @defaultvalue false
|
16
|
-
*/
|
17
|
-
required?: boolean | ShorthandPropsCompat<ComponentPropsCompat>;
|
18
|
-
/**
|
19
|
-
* A label supports different sizes.
|
20
|
-
* @defaultvalue 'medium'
|
21
|
-
*/
|
22
|
-
size?: 'small' | 'medium' | 'large';
|
23
|
-
/**
|
24
|
-
* A label supports semibold/strong fontweight.
|
25
|
-
* @defaultvalue false
|
26
|
-
*/
|
27
|
-
strong?: boolean;
|
28
|
-
};
|
29
|
-
/**
|
30
|
-
* Names of the shorthand properties in LabelProps
|
31
|
-
*/
|
32
|
-
export declare type LabelShorthandProps = 'required';
|
33
|
-
/**
|
34
|
-
* Names of LabelProps that have a default value in useLabel
|
35
|
-
*/
|
36
|
-
export declare type LabelDefaultedProps = 'size';
|
37
|
-
/**
|
38
|
-
* State used in rendering Label
|
39
|
-
*/
|
40
|
-
export declare type LabelState = ComponentStateCompat<LabelProps, LabelShorthandProps, LabelDefaultedProps> & {
|
41
|
-
/**
|
42
|
-
* Ref to the root element
|
43
|
-
*/
|
44
|
-
ref: React.Ref<HTMLElement>;
|
45
|
-
/**
|
46
|
-
* The required prop resolved to a slot object
|
47
|
-
*/
|
48
|
-
required?: ObjectShorthandPropsCompat<ComponentPropsCompat>;
|
49
|
-
};
|