@fluentui/react-label 9.0.0-alpha.9 → 9.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +1348 -1
- package/CHANGELOG.md +486 -2
- package/Spec.md +28 -31
- package/dist/react-label.d.ts +28 -45
- 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 +7 -7
- 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 -36
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.d.ts +2 -1
- package/lib/components/Label/useLabelStyles.js +44 -35
- 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 +19 -11
- 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 +40 -37
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.d.ts +2 -1
- package/lib-commonjs/components/Label/useLabelStyles.js +52 -37
- 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 +14 -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
|
+
const react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
+
|
10
|
+
const react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
+
|
5
12
|
function isConformant(testInfo) {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
13
|
+
const 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,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,MAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,QAAM,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
|
-
|
6
|
-
|
7
|
-
|
7
|
+
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
const useLabel_1 = /*#__PURE__*/require("./useLabel");
|
11
|
+
|
12
|
+
const renderLabel_1 = /*#__PURE__*/require("./renderLabel");
|
13
|
+
|
14
|
+
const 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((props, ref) => {
|
21
|
+
const 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,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,eAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,KAAA,gBAAyC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,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
|
+
const 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,27 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
3
6
|
exports.renderLabel = void 0;
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
7
|
+
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
|
+
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
+
|
12
|
+
const useLabel_1 = /*#__PURE__*/require("./useLabel");
|
8
13
|
/**
|
9
14
|
* Render the final JSX of Label
|
10
|
-
* {@docCategory Label}
|
11
15
|
*/
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
|
17
|
+
|
18
|
+
const renderLabel = state => {
|
19
|
+
const {
|
20
|
+
slots,
|
21
|
+
slotProps
|
22
|
+
} = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps);
|
23
|
+
return React.createElement(slots.root, Object.assign({}, slotProps.root), state.root.children, React.createElement(slots.required, Object.assign({}, slotProps.required)));
|
17
24
|
};
|
25
|
+
|
18
26
|
exports.renderLabel = renderLabel;
|
19
27
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,UAAA,gBAAA,OAAA,CAAA,YAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,EAA4B,UAAA,CAAA,mBAA5B,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,MAAA,CAAA,MAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,MAAA,CAAA,MAAA,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,20 @@
|
|
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
|
-
|
7
|
+
|
8
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
|
+
|
10
|
+
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
6
11
|
/**
|
7
12
|
* Array of all shorthand properties listed in LabelShorthandProps
|
8
13
|
* {@docCatergory Label}
|
9
14
|
*/
|
10
|
-
|
11
|
-
|
15
|
+
|
16
|
+
|
17
|
+
exports.labelShorthandProps = ['root', 'required'];
|
12
18
|
/**
|
13
19
|
* Create the state required to render Label.
|
14
20
|
*
|
@@ -17,39 +23,36 @@ var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.labelShor
|
|
17
23
|
*
|
18
24
|
* @param props - props from this instance of Label
|
19
25
|
* @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
26
|
*/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
|
28
|
+
const useLabel = (props, ref) => {
|
29
|
+
const {
|
30
|
+
disabled = false,
|
31
|
+
required = false,
|
32
|
+
strong = false,
|
33
|
+
size = 'medium'
|
34
|
+
} = props;
|
35
|
+
return {
|
36
|
+
disabled,
|
37
|
+
required: react_utilities_2.resolveShorthand(required === false ? null : required, {
|
38
|
+
required: !!required,
|
39
|
+
defaultProps: {
|
40
|
+
children: '*',
|
41
|
+
'aria-hidden': 'true'
|
42
|
+
}
|
43
|
+
}),
|
44
|
+
strong,
|
45
|
+
size,
|
46
|
+
components: {
|
47
|
+
root: 'label',
|
48
|
+
required: 'span'
|
49
|
+
},
|
50
|
+
root: react_utilities_1.getNativeElementProps('label', {
|
51
|
+
ref,
|
52
|
+
...props
|
53
|
+
})
|
54
|
+
};
|
34
55
|
};
|
56
|
+
|
35
57
|
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
58
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAEA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;;AAGG;;;AACU,OAAA,CAAA,mBAAA,GAA+C,CAAC,MAAD,EAAS,UAAT,CAA/C;AAEb;;;;;;;;AAQG;;AACI,MAAM,QAAQ,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AACrF,QAAM;AAAE,IAAA,QAAQ,GAAG,KAAb;AAAoB,IAAA,QAAQ,GAAG,KAA/B;AAAsC,IAAA,MAAM,GAAG,KAA/C;AAAsD,IAAA,IAAI,GAAG;AAA7D,MAA0E,KAAhF;AACA,SAAO;AACL,IAAA,QADK;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,GAAZ;AAAiB,uBAAe;AAAhC;AAFiD,KAAvD,CAFL;AAML,IAAA,MANK;AAOL,IAAA,IAPK;AAQL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KARP;AASL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,OAAtB,EAA+B;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAA/B;AATD,GAAP;AAWD,CAbM;;AAAM,OAAA,CAAA,QAAA,GAAQ,QAAR","sourceRoot":""}
|
@@ -1,48 +1,63 @@
|
|
1
1
|
"use strict";
|
2
|
-
|
3
|
-
exports
|
4
|
-
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.useLabelStyles = exports.labelClassName = void 0;
|
7
|
+
|
8
|
+
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
|
+
|
10
|
+
exports.labelClassName = 'fui-Label';
|
5
11
|
/**
|
6
12
|
* Styles for the label
|
7
13
|
*/
|
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
|
-
|
14
|
+
|
15
|
+
const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
16
|
+
"root": {
|
17
|
+
"Bahqtrf": "fk6fouc",
|
18
|
+
"sj55zd": "f19n0e5"
|
19
|
+
},
|
20
|
+
"disabled": {
|
21
|
+
"sj55zd": "f1s2aq7o"
|
22
|
+
},
|
23
|
+
"required": {
|
24
|
+
"sj55zd": "f1whyuy6",
|
25
|
+
"uwmqm3": ["fycuoez", "f8wuabp"]
|
26
|
+
},
|
27
|
+
"small": {
|
28
|
+
"Be2twd7": "fy9rknc",
|
29
|
+
"Bg96gwp": "fwrc4pm"
|
30
|
+
},
|
31
|
+
"medium": {
|
32
|
+
"Be2twd7": "fkhj508",
|
33
|
+
"Bg96gwp": "f1i3iumi"
|
34
|
+
},
|
35
|
+
"large": {
|
36
|
+
"Be2twd7": "fod5ikn",
|
37
|
+
"Bg96gwp": "faaz57k",
|
38
|
+
"Bhrd7zp": "fl43uef"
|
39
|
+
},
|
40
|
+
"strong": {
|
41
|
+
"Bhrd7zp": "fl43uef"
|
42
|
+
}
|
43
|
+
}, {
|
44
|
+
"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
45
|
});
|
36
46
|
/**
|
37
47
|
* Apply styling to the Label slots based on the state
|
38
48
|
*/
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
49
|
+
|
50
|
+
|
51
|
+
const useLabelStyles = state => {
|
52
|
+
const styles = useStyles();
|
53
|
+
state.root.className = react_make_styles_1.mergeClasses(exports.labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
54
|
+
|
55
|
+
if (state.required) {
|
56
|
+
state.required.className = react_make_styles_1.mergeClasses(styles.required, state.required.className);
|
57
|
+
}
|
58
|
+
|
59
|
+
return state;
|
46
60
|
};
|
61
|
+
|
47
62
|
exports.useLabelStyles = useLabelStyles;
|
48
63
|
//# sourceMappingURL=useLabelStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGa,OAAA,CAAA,cAAA,GAAiB,WAAjB;AAEb;;AAEG;;AACH,MAAM,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,MAAM,cAAc,GAAI,KAAD,IAAkC;AAC9D,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,mBAAA,CAAA,YAAA,CACrB,OAAA,CAAA,cADqB,EAErB,MAAM,CAAC,IAFc,EAGrB,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAHJ,EAIrB,MAAM,CAAC,KAAK,CAAC,IAAP,CAJe,EAKrB,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MALF,EAMrB,KAAK,CAAC,IAAN,CAAW,SANU,CAAvB;;AASA,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,CAhBM;;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
|
+
const 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-beta.4",
|
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-beta.4",
|
29
|
+
"@fluentui/eslint-plugin": "*",
|
30
|
+
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.4",
|
31
|
+
"@fluentui/react-conformance": "*",
|
32
|
+
"@fluentui/react-conformance-make-styles": "9.0.0-beta.4",
|
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-beta.4",
|
47
|
+
"@fluentui/react-utilities": "9.0.0-beta.4",
|
44
48
|
"tslib": "^2.1.0"
|
45
49
|
},
|
46
50
|
"peerDependencies": {
|
@@ -50,7 +54,6 @@
|
|
50
54
|
"react-dom": ">=16.8.0 <18.0.0"
|
51
55
|
},
|
52
56
|
"beachball": {
|
53
|
-
"tag": "alpha",
|
54
57
|
"disallowedChangeTypes": [
|
55
58
|
"major",
|
56
59
|
"minor",
|