@fluentui/react-label 9.0.0-alpha.5 → 9.0.0-alpha.50
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 +1189 -1
- package/CHANGELOG.md +458 -2
- package/README.md +22 -0
- package/Spec.md +30 -35
- package/dist/react-label.d.ts +40 -23
- 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 -3
- package/lib/components/Label/Label.js +5 -4
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/Label.types.d.ts +29 -15
- 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 -1
- package/lib/components/Label/renderLabel.js +6 -2
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +4 -4
- package/lib/components/Label/useLabel.js +34 -11
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.d.ts +1 -1
- package/lib/components/Label/useLabelStyles.js +43 -11
- 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 -3
- package/lib-commonjs/components/Label/Label.js +18 -9
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +29 -15
- 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 -1
- package/lib-commonjs/components/Label/renderLabel.js +20 -7
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.d.ts +4 -4
- package/lib-commonjs/components/Label/useLabel.js +43 -12
- 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 +50 -12
- 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 -10
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -7
- package/etc/react-label.api.md +0 -44
- 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 -6
- 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 -24
- 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 -14
- package/lib-amd/components/Label/renderLabel.js.map +0 -1
- package/lib-amd/components/Label/useLabel.d.ts +0 -17
- package/lib-amd/components/Label/useLabel.js +0 -30
- 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 -25
- 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 -33
package/dist/react-label.d.ts
CHANGED
@@ -1,42 +1,60 @@
|
|
1
|
-
import { ComponentProps } from '@fluentui/react-utilities';
|
2
|
-
import { ComponentState } from '@fluentui/react-utilities';
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
3
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
4
|
+
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
5
|
+
import type { ObjectShorthandProps } from '@fluentui/react-utilities';
|
3
6
|
import * as React_2 from 'react';
|
4
7
|
|
5
8
|
/**
|
6
9
|
* A label component provides a title or name to a component.
|
7
10
|
*/
|
8
|
-
export declare const Label:
|
9
|
-
|
10
|
-
/**
|
11
|
-
* Names of LabelProps that have a default value in useLabel
|
12
|
-
*/
|
13
|
-
export declare type LabelDefaultedProps = never;
|
11
|
+
export declare const Label: ForwardRefComponent<LabelProps>;
|
14
12
|
|
15
13
|
/**
|
16
14
|
* Label Props
|
17
15
|
*/
|
18
|
-
export declare
|
19
|
-
|
16
|
+
export declare type LabelCommons = {
|
17
|
+
/**
|
18
|
+
* Renders the label as disabled
|
19
|
+
* @defaultvalue false
|
20
|
+
*/
|
21
|
+
disabled: boolean;
|
22
|
+
/**
|
23
|
+
* A label supports different sizes.
|
24
|
+
* @defaultvalue 'medium'
|
25
|
+
*/
|
26
|
+
size: 'small' | 'medium' | 'large';
|
27
|
+
/**
|
28
|
+
* A label supports semibold/strong fontweight.
|
29
|
+
* @defaultvalue false
|
30
|
+
*/
|
31
|
+
strong: boolean;
|
32
|
+
};
|
20
33
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
34
|
+
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
35
|
+
/**
|
36
|
+
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
37
|
+
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
38
|
+
* @defaultvalue false
|
39
|
+
*/
|
40
|
+
required?: boolean | ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>> | React_2.ReactNode;
|
41
|
+
};
|
25
42
|
|
26
43
|
/**
|
27
44
|
* Array of all shorthand properties listed in LabelShorthandProps
|
45
|
+
* {@docCatergory Label}
|
28
46
|
*/
|
29
|
-
export declare const labelShorthandProps:
|
47
|
+
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
48
|
+
|
49
|
+
export declare type LabelSlots = {
|
50
|
+
root: IntrinsicShorthandProps<'label'>;
|
51
|
+
required?: IntrinsicShorthandProps<'span'>;
|
52
|
+
};
|
30
53
|
|
31
54
|
/**
|
32
55
|
* State used in rendering Label
|
33
56
|
*/
|
34
|
-
export declare
|
35
|
-
/**
|
36
|
-
* Ref to the root element
|
37
|
-
*/
|
38
|
-
ref: React_2.Ref<HTMLElement>;
|
39
|
-
}
|
57
|
+
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
40
58
|
|
41
59
|
/**
|
42
60
|
* Render the final JSX of Label
|
@@ -51,9 +69,8 @@ export declare const renderLabel: (state: LabelState) => JSX.Element;
|
|
51
69
|
*
|
52
70
|
* @param props - props from this instance of Label
|
53
71
|
* @param ref - reference to root HTMLElement of Label
|
54
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
55
72
|
*/
|
56
|
-
export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement
|
73
|
+
export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState;
|
57
74
|
|
58
75
|
/**
|
59
76
|
* Apply styling to the Label slots based on the state
|
package/lib/Label.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../src/Label.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IsConformantOptions } from '@fluentui/react-conformance';
|
1
|
+
import type { IsConformantOptions } from '@fluentui/react-conformance';
|
2
2
|
export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
|
3
3
|
componentPath?: string;
|
4
4
|
}): void;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
+
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
2
3
|
export function isConformant(testInfo) {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
var defaultOptions = {
|
5
|
+
asPropHandlesRef: true,
|
6
|
+
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
+
extraTests: makeStylesTests
|
8
|
+
};
|
9
|
+
baseIsConformant(defaultOptions, testInfo);
|
8
10
|
}
|
9
11
|
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAiD,6BAAjD;AAEA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,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;AAH+C,GAA7D;AAMA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,6 +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
5
|
*/
|
6
|
-
export declare const Label:
|
6
|
+
export declare const Label: ForwardRefComponent<LabelProps>;
|
@@ -5,10 +5,11 @@ import { useLabelStyles } from './useLabelStyles';
|
|
5
5
|
/**
|
6
6
|
* A label component provides a title or name to a component.
|
7
7
|
*/
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
|
9
|
+
export var Label = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
10
|
+
var state = useLabel(props, ref);
|
11
|
+
useLabelStyles(state);
|
12
|
+
return renderLabel(state);
|
12
13
|
});
|
13
14
|
Label.displayName = 'Label';
|
14
15
|
//# sourceMappingURL=Label.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,YAAzB;AACA,SAAS,WAAT,QAA4B,eAA5B;AACA,SAAS,cAAT,QAA+B,kBAA/B;AAIA;;AAEG;;AACH,OAAO,IAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CAAtB;AAEA,EAAA,cAAc,CAAC,KAAD,CAAd;AACA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,24 +1,38 @@
|
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
1
2
|
import * as React from 'react';
|
2
|
-
import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Label Props
|
5
5
|
*/
|
6
|
-
export
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
/**
|
13
|
-
|
14
|
-
|
15
|
-
|
6
|
+
export declare type LabelCommons = {
|
7
|
+
/**
|
8
|
+
* Renders the label as disabled
|
9
|
+
* @defaultvalue false
|
10
|
+
*/
|
11
|
+
disabled: boolean;
|
12
|
+
/**
|
13
|
+
* A label supports different sizes.
|
14
|
+
* @defaultvalue 'medium'
|
15
|
+
*/
|
16
|
+
size: 'small' | 'medium' | 'large';
|
17
|
+
/**
|
18
|
+
* A label supports semibold/strong fontweight.
|
19
|
+
* @defaultvalue false
|
20
|
+
*/
|
21
|
+
strong: boolean;
|
22
|
+
};
|
23
|
+
export declare type LabelSlots = {
|
24
|
+
root: IntrinsicShorthandProps<'label'>;
|
25
|
+
required?: IntrinsicShorthandProps<'span'>;
|
26
|
+
};
|
16
27
|
/**
|
17
28
|
* State used in rendering Label
|
18
29
|
*/
|
19
|
-
export
|
30
|
+
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
31
|
+
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
20
32
|
/**
|
21
|
-
*
|
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
|
22
36
|
*/
|
23
|
-
|
24
|
-
}
|
37
|
+
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
38
|
+
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Label.types.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Label.types.js","sourceRoot":"","sources":["../../../src/components/Label/Label.types.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Label/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
@@ -5,8 +5,12 @@ import { labelShorthandProps } from './useLabel';
|
|
5
5
|
/**
|
6
6
|
* Render the final JSX of Label
|
7
7
|
*/
|
8
|
+
|
8
9
|
export var renderLabel = function (state) {
|
9
|
-
|
10
|
-
|
10
|
+
var _a = getSlots(state, labelShorthandProps),
|
11
|
+
slots = _a.slots,
|
12
|
+
slotProps = _a.slotProps;
|
13
|
+
|
14
|
+
return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), state.root.children, /*#__PURE__*/React.createElement(slots.required, __assign({}, slotProps.required)));
|
11
15
|
};
|
12
16
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,mBAAT,QAAoC,YAApC;AAGA;;AAEG;;AACH,OAAO,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,QAAQ,CAAa,KAAb,EAAoB,mBAApB,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,IAAN,CAAW,QADd,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAFF,CADF;AAMD,CATM","sourceRoot":""}
|
@@ -1,9 +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
|
+
* {@docCatergory Label}
|
5
6
|
*/
|
6
|
-
export declare const labelShorthandProps:
|
7
|
+
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
7
8
|
/**
|
8
9
|
* Create the state required to render Label.
|
9
10
|
*
|
@@ -12,6 +13,5 @@ export declare const labelShorthandProps: LabelShorthandProps[];
|
|
12
13
|
*
|
13
14
|
* @param props - props from this instance of Label
|
14
15
|
* @param ref - reference to root HTMLElement of Label
|
15
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
16
16
|
*/
|
17
|
-
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement
|
17
|
+
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import {
|
1
|
+
import { __assign } from "tslib";
|
2
|
+
import { getNativeElementProps } from '@fluentui/react-utilities';
|
3
|
+
import { resolveShorthand } from '@fluentui/react-utilities';
|
2
4
|
/**
|
3
5
|
* Array of all shorthand properties listed in LabelShorthandProps
|
6
|
+
* {@docCatergory Label}
|
4
7
|
*/
|
5
|
-
|
6
|
-
|
7
|
-
];
|
8
|
-
var mergeProps = makeMergeProps({ deepMerge: labelShorthandProps });
|
8
|
+
|
9
|
+
export var labelShorthandProps = ['root', 'required'];
|
9
10
|
/**
|
10
11
|
* Create the state required to render Label.
|
11
12
|
*
|
@@ -14,12 +15,34 @@ var mergeProps = makeMergeProps({ deepMerge: labelShorthandProps });
|
|
14
15
|
*
|
15
16
|
* @param props - props from this instance of Label
|
16
17
|
* @param ref - reference to root HTMLElement of Label
|
17
|
-
* @param defaultProps - (optional) default prop values provided by the implementing type
|
18
18
|
*/
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
|
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: {
|
34
|
+
children: '*'
|
35
|
+
}
|
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
|
+
};
|
24
47
|
};
|
25
48
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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":""}
|
@@ -1,20 +1,52 @@
|
|
1
|
-
import {
|
1
|
+
import { __styles, mergeClasses } from '@fluentui/react-make-styles';
|
2
2
|
/**
|
3
|
-
* Styles for the
|
3
|
+
* Styles for the label
|
4
4
|
*/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
var useStyles = /*#__PURE__*/__styles({
|
7
|
+
"root": {
|
8
|
+
"Bahqtrf": "fk6fouc",
|
9
|
+
"sj55zd": "f19n0e5"
|
10
|
+
},
|
11
|
+
"disabled": {
|
12
|
+
"sj55zd": "f1s2aq7o"
|
13
|
+
},
|
14
|
+
"required": {
|
15
|
+
"sj55zd": "f1whyuy6",
|
16
|
+
"uwmqm3": ["fycuoez", "f8wuabp"]
|
17
|
+
},
|
18
|
+
"small": {
|
19
|
+
"Be2twd7": "fy9rknc",
|
20
|
+
"Bg96gwp": "fwrc4pm"
|
21
|
+
},
|
22
|
+
"medium": {
|
23
|
+
"Be2twd7": "fkhj508",
|
24
|
+
"Bg96gwp": "f1i3iumi"
|
25
|
+
},
|
26
|
+
"large": {
|
27
|
+
"Be2twd7": "fod5ikn",
|
28
|
+
"Bg96gwp": "faaz57k",
|
29
|
+
"Bhrd7zp": "fl43uef"
|
30
|
+
},
|
31
|
+
"strong": {
|
32
|
+
"Bhrd7zp": "fl43uef"
|
33
|
+
}
|
34
|
+
}, {
|
35
|
+
"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);}"]
|
9
36
|
});
|
10
37
|
/**
|
11
38
|
* Apply styling to the Label slots based on the state
|
12
39
|
*/
|
40
|
+
|
41
|
+
|
13
42
|
export var useLabelStyles = function (state) {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
43
|
+
var styles = useStyles();
|
44
|
+
state.root.className = mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
45
|
+
|
46
|
+
if (state.required) {
|
47
|
+
state.required.className = mergeClasses(styles.required, state.required.className);
|
48
|
+
}
|
49
|
+
|
50
|
+
return state;
|
19
51
|
};
|
20
52
|
//# sourceMappingURL=useLabelStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
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"}
|
package/lib/tsdoc-metadata.json
CHANGED
package/lib-commonjs/Label.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("./components/Label/index"), exports);
|
5
10
|
//# sourceMappingURL=Label.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../src/Label.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { IsConformantOptions } from '@fluentui/react-conformance';
|
1
|
+
import type { IsConformantOptions } from '@fluentui/react-conformance';
|
2
2
|
export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
|
3
3
|
componentPath?: string;
|
4
4
|
}): void;
|
@@ -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,6 +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
5
|
*/
|
6
|
-
export declare const Label:
|
6
|
+
export declare const Label: ForwardRefComponent<LabelProps>;
|
@@ -1,17 +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
17
|
*/
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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);
|
15
24
|
});
|
16
25
|
exports.Label.displayName = 'Label';
|
17
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":""}
|