@fluentui/react-label 9.0.0-alpha.9 → 9.0.0-nightly.46b9ea7036.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +1244 -1
- package/CHANGELOG.md +458 -2
- package/Spec.md +28 -31
- package/dist/react-label.d.ts +27 -46
- package/lib/Label.js.map +1 -1
- package/lib/common/isConformant.d.ts +1 -1
- package/lib/common/isConformant.js +7 -5
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Label/Label.d.ts +3 -4
- package/lib/components/Label/Label.js +5 -5
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/Label.types.d.ts +17 -32
- package/lib/components/Label/Label.types.js.map +1 -1
- package/lib/components/Label/index.js.map +1 -1
- package/lib/components/Label/renderLabel.d.ts +1 -2
- package/lib/components/Label/renderLabel.js +6 -5
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +3 -6
- package/lib/components/Label/useLabel.js +32 -35
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.d.ts +1 -1
- package/lib/components/Label/useLabelStyles.js +42 -34
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Label.js +7 -2
- package/lib-commonjs/Label.js.map +1 -1
- package/lib-commonjs/common/isConformant.d.ts +1 -1
- package/lib-commonjs/common/isConformant.js +16 -7
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Label/Label.d.ts +3 -4
- package/lib-commonjs/components/Label/Label.js +18 -10
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +17 -32
- package/lib-commonjs/components/Label/Label.types.js +4 -1
- package/lib-commonjs/components/Label/Label.types.js.map +1 -1
- package/lib-commonjs/components/Label/index.js +11 -2
- package/lib-commonjs/components/Label/index.js.map +1 -1
- package/lib-commonjs/components/Label/renderLabel.d.ts +1 -2
- package/lib-commonjs/components/Label/renderLabel.js +20 -10
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.d.ts +3 -6
- package/lib-commonjs/components/Label/useLabel.js +42 -37
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.d.ts +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js +49 -35
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js +7 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +15 -11
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -7
- package/etc/react-label.api.md +0 -51
- package/just.config.ts +0 -3
- 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 -14
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Label/Label.d.ts +0 -7
- package/lib-amd/components/Label/Label.js +0 -16
- package/lib-amd/components/Label/Label.js.map +0 -1
- package/lib-amd/components/Label/Label.types.d.ts +0 -53
- 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 -6
- package/lib-amd/components/Label/renderLabel.js +0 -17
- package/lib-amd/components/Label/renderLabel.js.map +0 -1
- package/lib-amd/components/Label/useLabel.d.ts +0 -20
- package/lib-amd/components/Label/useLabel.js +0 -55
- 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 -49
- 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
- package/src/components/Label/Label.types.ts +0 -61
@@ -1,13 +1,22 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.isConformant = void 0;
|
4
|
-
|
7
|
+
|
8
|
+
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
+
|
10
|
+
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
+
|
5
12
|
function isConformant(testInfo) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
var defaultOptions = {
|
14
|
+
asPropHandlesRef: true,
|
15
|
+
componentPath: module.parent.filename.replace('.test', ''),
|
16
|
+
extraTests: react_conformance_make_styles_1.default
|
17
|
+
};
|
18
|
+
react_conformance_1.isConformant(defaultOptions, testInfo);
|
11
19
|
}
|
20
|
+
|
12
21
|
exports.isConformant = isConformant;
|
13
22
|
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import type { LabelProps } from './Label.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* A label component provides a title or name to a component.
|
5
|
-
* {@docCategory Label}
|
6
5
|
*/
|
7
|
-
export declare const Label:
|
6
|
+
export declare const Label: ForwardRefComponent<LabelProps>;
|
@@ -1,18 +1,26 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.Label = void 0;
|
4
|
-
|
5
|
-
var
|
6
|
-
|
7
|
-
var
|
7
|
+
|
8
|
+
var React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
var useLabel_1 = /*#__PURE__*/require("./useLabel");
|
11
|
+
|
12
|
+
var renderLabel_1 = /*#__PURE__*/require("./renderLabel");
|
13
|
+
|
14
|
+
var useLabelStyles_1 = /*#__PURE__*/require("./useLabelStyles");
|
8
15
|
/**
|
9
16
|
* A label component provides a title or name to a component.
|
10
|
-
* {@docCategory Label}
|
11
17
|
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
18
|
+
|
19
|
+
|
20
|
+
exports.Label = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
21
|
+
var state = useLabel_1.useLabel(props, ref);
|
22
|
+
useLabelStyles_1.useLabelStyles(state);
|
23
|
+
return renderLabel_1.renderLabel(state);
|
16
24
|
});
|
17
25
|
exports.Label.displayName = 'Label';
|
18
26
|
//# sourceMappingURL=Label.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChF,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,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,53 +1,38 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
1
2
|
import * as React from 'react';
|
2
|
-
import { ComponentProps, ComponentState, ObjectShorthandProps, ShorthandProps } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Label Props
|
5
|
-
* {@docCategory Label}
|
6
5
|
*/
|
7
|
-
export
|
6
|
+
export declare type LabelCommons = {
|
8
7
|
/**
|
9
8
|
* Renders the label as disabled
|
10
9
|
* @defaultvalue false
|
11
10
|
*/
|
12
|
-
disabled
|
13
|
-
/**
|
14
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
15
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
16
|
-
* @defaultvalue false
|
17
|
-
*/
|
18
|
-
required?: boolean | ShorthandProps<ComponentProps>;
|
11
|
+
disabled: boolean;
|
19
12
|
/**
|
20
13
|
* A label supports different sizes.
|
21
14
|
* @defaultvalue 'medium'
|
22
15
|
*/
|
23
|
-
size
|
16
|
+
size: 'small' | 'medium' | 'large';
|
24
17
|
/**
|
25
18
|
* A label supports semibold/strong fontweight.
|
26
19
|
* @defaultvalue false
|
27
20
|
*/
|
28
|
-
strong
|
29
|
-
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
export declare type LabelShorthandProps = 'required';
|
35
|
-
/**
|
36
|
-
* Names of LabelProps that have a default value in useLabel
|
37
|
-
* {@docCategory Label}
|
38
|
-
*/
|
39
|
-
export declare type LabelDefaultedProps = 'size';
|
21
|
+
strong: boolean;
|
22
|
+
};
|
23
|
+
export declare type LabelSlots = {
|
24
|
+
root: IntrinsicShorthandProps<'label'>;
|
25
|
+
required?: IntrinsicShorthandProps<'span'>;
|
26
|
+
};
|
40
27
|
/**
|
41
28
|
* State used in rendering Label
|
42
|
-
* {@docCategory Label}
|
43
29
|
*/
|
44
|
-
export
|
45
|
-
|
46
|
-
* Ref to the root element
|
47
|
-
*/
|
48
|
-
ref: React.Ref<HTMLElement>;
|
30
|
+
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
31
|
+
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
49
32
|
/**
|
50
|
-
* 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
|
51
36
|
*/
|
52
|
-
required?: ObjectShorthandProps<
|
53
|
-
}
|
37
|
+
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
38
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
@@ -1,9 +1,18 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
4
9
|
tslib_1.__exportStar(require("./Label"), exports);
|
10
|
+
|
5
11
|
tslib_1.__exportStar(require("./Label.types"), exports);
|
12
|
+
|
6
13
|
tslib_1.__exportStar(require("./renderLabel"), exports);
|
14
|
+
|
7
15
|
tslib_1.__exportStar(require("./useLabel"), exports);
|
16
|
+
|
8
17
|
tslib_1.__exportStar(require("./useLabelStyles"), exports);
|
9
18
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
@@ -1,19 +1,29 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.renderLabel = void 0;
|
4
|
-
|
5
|
-
var
|
6
|
-
|
7
|
-
var
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var React = /*#__PURE__*/require("react");
|
11
|
+
|
12
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
+
|
14
|
+
var useLabel_1 = /*#__PURE__*/require("./useLabel");
|
8
15
|
/**
|
9
16
|
* Render the final JSX of Label
|
10
|
-
* {@docCategory Label}
|
11
17
|
*/
|
18
|
+
|
19
|
+
|
12
20
|
var renderLabel = function (state) {
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
21
|
+
var _a = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps),
|
22
|
+
slots = _a.slots,
|
23
|
+
slotProps = _a.slotProps;
|
24
|
+
|
25
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.root.children, React.createElement(slots.required, tslib_1.__assign({}, slotProps.required)));
|
17
26
|
};
|
27
|
+
|
18
28
|
exports.renderLabel = renderLabel;
|
19
29
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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 { 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,8 +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
|
-
*
|
18
|
-
* {@docCategory Label}
|
19
16
|
*/
|
20
|
-
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement
|
17
|
+
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
@@ -1,14 +1,22 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.useLabel = exports.labelShorthandProps = void 0;
|
4
|
-
|
5
|
-
var
|
7
|
+
|
8
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
9
|
+
|
10
|
+
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
|
12
|
+
var react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
6
13
|
/**
|
7
14
|
* Array of all shorthand properties listed in LabelShorthandProps
|
8
15
|
* {@docCatergory Label}
|
9
16
|
*/
|
10
|
-
|
11
|
-
|
17
|
+
|
18
|
+
|
19
|
+
exports.labelShorthandProps = ['root', 'required'];
|
12
20
|
/**
|
13
21
|
* Create the state required to render Label.
|
14
22
|
*
|
@@ -17,39 +25,36 @@ var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.labelShor
|
|
17
25
|
*
|
18
26
|
* @param props - props from this instance of Label
|
19
27
|
* @param ref - reference to root HTMLElement of Label
|
20
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
21
|
-
*
|
22
|
-
* {@docCategory Label}
|
23
28
|
*/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
|
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: {
|
44
|
+
children: '*'
|
45
|
+
}
|
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
|
+
};
|
34
57
|
};
|
58
|
+
|
35
59
|
exports.useLabel = useLabel;
|
36
|
-
/**
|
37
|
-
* Label will first need to check if required is a boolean or shorthandprops,
|
38
|
-
* this allows for the required prop to handle both the default asterisk for required
|
39
|
-
* or a custom required text.
|
40
|
-
*/
|
41
|
-
var resolveLabelShorthandProps = function (props) {
|
42
|
-
var propsNormalized;
|
43
|
-
if (props.required === true) {
|
44
|
-
propsNormalized = tslib_1.__assign(tslib_1.__assign({}, props), { required: { children: '*' } });
|
45
|
-
}
|
46
|
-
else if (props.required === false) {
|
47
|
-
propsNormalized = tslib_1.__assign(tslib_1.__assign({}, props), { required: undefined });
|
48
|
-
}
|
49
|
-
else {
|
50
|
-
// TypeScript needs a nudge to figure out that props.required won't be a boolean here
|
51
|
-
propsNormalized = props;
|
52
|
-
}
|
53
|
-
return react_utilities_1.resolveShorthandProps(propsNormalized, exports.labelShorthandProps);
|
54
|
-
};
|
55
60
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
@@ -1,48 +1,62 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.useLabelStyles = void 0;
|
4
|
-
|
7
|
+
|
8
|
+
var react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
5
9
|
/**
|
6
10
|
* Styles for the label
|
7
11
|
*/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
12
|
+
|
13
|
+
|
14
|
+
var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
15
|
+
"root": {
|
16
|
+
"Bahqtrf": "fk6fouc",
|
17
|
+
"sj55zd": "f19n0e5"
|
18
|
+
},
|
19
|
+
"disabled": {
|
20
|
+
"sj55zd": "f1s2aq7o"
|
21
|
+
},
|
22
|
+
"required": {
|
23
|
+
"sj55zd": "f1whyuy6",
|
24
|
+
"uwmqm3": ["fycuoez", "f8wuabp"]
|
25
|
+
},
|
26
|
+
"small": {
|
27
|
+
"Be2twd7": "fy9rknc",
|
28
|
+
"Bg96gwp": "fwrc4pm"
|
29
|
+
},
|
30
|
+
"medium": {
|
31
|
+
"Be2twd7": "fkhj508",
|
32
|
+
"Bg96gwp": "f1i3iumi"
|
33
|
+
},
|
34
|
+
"large": {
|
35
|
+
"Be2twd7": "fod5ikn",
|
36
|
+
"Bg96gwp": "faaz57k",
|
37
|
+
"Bhrd7zp": "fl43uef"
|
38
|
+
},
|
39
|
+
"strong": {
|
40
|
+
"Bhrd7zp": "fl43uef"
|
41
|
+
}
|
42
|
+
}, {
|
43
|
+
"d": [".fk6fouc{font-family:var(--fontFamilyBase);}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".f1whyuy6{color:var(--colorPaletteRedForeground3);}", ".fycuoez{padding-left:4px;}", ".f8wuabp{padding-right:4px;}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fl43uef{font-weight:var(--fontWeightSemibold);}"]
|
35
44
|
});
|
36
45
|
/**
|
37
46
|
* Apply styling to the Label slots based on the state
|
38
47
|
*/
|
48
|
+
|
49
|
+
|
39
50
|
var useLabelStyles = function (state) {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
51
|
+
var styles = useStyles();
|
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
|
+
|
54
|
+
if (state.required) {
|
55
|
+
state.required.className = react_make_styles_1.mergeClasses(styles.required, state.required.className);
|
56
|
+
}
|
57
|
+
|
58
|
+
return state;
|
46
59
|
};
|
60
|
+
|
47
61
|
exports.useLabelStyles = useLabelStyles;
|
48
62
|
//# sourceMappingURL=useLabelStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
package/lib-commonjs/index.js
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
+
|
4
9
|
tslib_1.__exportStar(require("./Label"), exports);
|
5
10
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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-
|
3
|
+
"version": "9.0.0-nightly.46b9ea7036.0",
|
4
4
|
"description": "Label component for FluentUI library.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -13,19 +13,23 @@
|
|
13
13
|
"license": "MIT",
|
14
14
|
"scripts": {
|
15
15
|
"build": "just-scripts build",
|
16
|
+
"bundle-size": "bundle-size measure",
|
16
17
|
"clean": "just-scripts clean",
|
17
18
|
"code-style": "just-scripts code-style",
|
18
19
|
"just": "just-scripts",
|
19
20
|
"lint": "just-scripts lint",
|
20
|
-
"start": "
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
21
|
+
"start": "yarn storybook",
|
22
|
+
"test": "jest",
|
23
|
+
"docs": "api-extractor run --config=config/api-extractor.local.json --local",
|
24
|
+
"build:local": "tsc -p . --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output dist/packages/react-label/src && yarn docs",
|
25
|
+
"storybook": "start-storybook"
|
24
26
|
},
|
25
27
|
"devDependencies": {
|
26
|
-
"@fluentui/
|
27
|
-
"@fluentui/
|
28
|
-
"@fluentui/
|
28
|
+
"@fluentui/babel-make-styles": "9.0.0-nightly.46b9ea7036.0",
|
29
|
+
"@fluentui/eslint-plugin": "*",
|
30
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-nightly.46b9ea7036.0",
|
31
|
+
"@fluentui/react-conformance": "*",
|
32
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-nightly.46b9ea7036.0",
|
29
33
|
"@fluentui/scripts": "^1.0.0",
|
30
34
|
"@types/enzyme": "3.10.3",
|
31
35
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -39,8 +43,8 @@
|
|
39
43
|
"react-test-renderer": "^16.3.0"
|
40
44
|
},
|
41
45
|
"dependencies": {
|
42
|
-
"@fluentui/react-make-styles": "
|
43
|
-
"@fluentui/react-utilities": "
|
46
|
+
"@fluentui/react-make-styles": "9.0.0-nightly.46b9ea7036.0",
|
47
|
+
"@fluentui/react-utilities": "9.0.0-nightly.46b9ea7036.0",
|
44
48
|
"tslib": "^2.1.0"
|
45
49
|
},
|
46
50
|
"peerDependencies": {
|
@@ -50,7 +54,7 @@
|
|
50
54
|
"react-dom": ">=16.8.0 <18.0.0"
|
51
55
|
},
|
52
56
|
"beachball": {
|
53
|
-
"tag": "
|
57
|
+
"tag": "beta",
|
54
58
|
"disallowedChangeTypes": [
|
55
59
|
"major",
|
56
60
|
"minor",
|