@fluentui/react-label 0.0.0-nightly442708a36520211209.1 → 0.0.0-nightly5ab766c40f20220114.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +38 -14
- package/CHANGELOG.md +13 -10
- package/Spec.md +33 -40
- package/dist/react-label.d.ts +3 -9
- package/lib/components/Label/Label.types.d.ts +3 -3
- package/lib/components/Label/renderLabel.js +4 -3
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +1 -6
- package/lib/components/Label/useLabel.js +0 -6
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.js +1 -0
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +3 -3
- package/lib-commonjs/components/Label/renderLabel.js +4 -4
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.d.ts +1 -6
- package/lib-commonjs/components/Label/useLabel.js +2 -8
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js +2 -0
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.json
CHANGED
@@ -2,49 +2,73 @@
|
|
2
2
|
"name": "@fluentui/react-label",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-label_v0.0.0-
|
7
|
-
"version": "0.0.0-
|
5
|
+
"date": "Fri, 14 Jan 2022 04:15:08 GMT",
|
6
|
+
"tag": "@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1",
|
7
|
+
"version": "0.0.0-nightly5ab766c40f20220114.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
11
11
|
"author": "email not defined",
|
12
12
|
"package": "@fluentui/react-label",
|
13
|
-
"commit": "
|
13
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
|
+
{
|
17
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
18
|
+
"package": "@fluentui/react-label",
|
19
|
+
"commit": "a052fbc9204600669d32b0ac346032d2cd8d9204",
|
20
|
+
"comment": "react-label: Replacing use of functions in makeStyles with direct use of tokens."
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "behowell@microsoft.com",
|
24
|
+
"package": "@fluentui/react-label",
|
25
|
+
"commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
|
26
|
+
"comment": "Remove component's shorthandProps array"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
30
|
+
"package": "@fluentui/react-label",
|
31
|
+
"commit": "00a5d945904c896a0664de6ba72c145a255f0848",
|
32
|
+
"comment": "Updating use of tokens.fontWeight now that we don't need to use casting."
|
33
|
+
},
|
16
34
|
{
|
17
35
|
"author": "beachball",
|
18
36
|
"package": "@fluentui/react-label",
|
19
|
-
"comment": "Bump @fluentui/react-make-styles to v0.0.0-
|
20
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-make-styles to v0.0.0-nightly5ab766c40f20220114.1",
|
38
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd"
|
21
39
|
},
|
22
40
|
{
|
23
41
|
"author": "beachball",
|
24
42
|
"package": "@fluentui/react-label",
|
25
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-
|
26
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly5ab766c40f20220114.1",
|
44
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd"
|
27
45
|
},
|
28
46
|
{
|
29
47
|
"author": "beachball",
|
30
48
|
"package": "@fluentui/react-label",
|
31
|
-
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-
|
32
|
-
"commit": "
|
49
|
+
"comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightly5ab766c40f20220114.1",
|
50
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd"
|
33
51
|
},
|
34
52
|
{
|
35
53
|
"author": "beachball",
|
36
54
|
"package": "@fluentui/react-label",
|
37
|
-
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-
|
38
|
-
"commit": "
|
55
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly5ab766c40f20220114.1",
|
56
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd"
|
39
57
|
},
|
40
58
|
{
|
41
59
|
"author": "beachball",
|
42
60
|
"package": "@fluentui/react-label",
|
43
|
-
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-
|
44
|
-
"commit": "
|
61
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly5ab766c40f20220114.1",
|
62
|
+
"commit": "afbf0defba27d6180bd53e24443fff8da633f9dd"
|
45
63
|
}
|
46
64
|
],
|
47
65
|
"none": [
|
66
|
+
{
|
67
|
+
"author": "elcraig@microsoft.com",
|
68
|
+
"package": "@fluentui/react-label",
|
69
|
+
"commit": "d892c7f79c543b6008634ecd669b75b5108cad46",
|
70
|
+
"comment": "Relocate comment about props to the correct type, and update spec to accurately reflect props"
|
71
|
+
},
|
48
72
|
{
|
49
73
|
"author": "andredias@microsoft.com",
|
50
74
|
"package": "@fluentui/react-label",
|
package/CHANGELOG.md
CHANGED
@@ -1,22 +1,25 @@
|
|
1
1
|
# Change Log - @fluentui/react-label
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 14 Jan 2022 04:15:08 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightly5ab766c40f20220114.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v0.0.0-
|
9
|
+
Fri, 14 Jan 2022 04:15:08 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v0.0.0-nightly5ab766c40f20220114.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
- Bump @fluentui/
|
19
|
-
- Bump @fluentui/react-
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by email not defined)
|
15
|
+
- react-label: Replacing use of functions in makeStyles with direct use of tokens. ([PR #21046](https://github.com/microsoft/fluentui/pull/21046) by Humberto.Morimoto@microsoft.com)
|
16
|
+
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
|
17
|
+
- Updating use of tokens.fontWeight now that we don't need to use casting. ([PR #21217](https://github.com/microsoft/fluentui/pull/21217) by Humberto.Morimoto@microsoft.com)
|
18
|
+
- Bump @fluentui/react-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball)
|
19
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball)
|
20
|
+
- Bump @fluentui/babel-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball)
|
21
|
+
- Bump @fluentui/jest-serializer-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball)
|
22
|
+
- Bump @fluentui/react-conformance-make-styles to v0.0.0-nightly5ab766c40f20220114.1 ([commit](https://github.com/microsoft/fluentui/commit/afbf0defba27d6180bd53e24443fff8da633f9dd) by beachball)
|
20
23
|
|
21
24
|
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.4)
|
22
25
|
|
package/Spec.md
CHANGED
@@ -75,55 +75,48 @@ The Label component should be simple as shown below. It will just need the text
|
|
75
75
|
## API
|
76
76
|
|
77
77
|
```ts
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
* Renders the label as disabled
|
85
|
-
* @defaultvalue false
|
86
|
-
*/
|
87
|
-
disabled?: boolean;
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Whether the associated form field is required or not. If true it will be an asterisk, otherwise it will be what is provided.
|
91
|
-
* @defaultvalue false
|
92
|
-
*/
|
93
|
-
required?: boolean | ShorthandProps<ComponentProps>;
|
78
|
+
export type LabelCommons = {
|
79
|
+
/**
|
80
|
+
* Renders the label as disabled
|
81
|
+
* @defaultvalue false
|
82
|
+
*/
|
83
|
+
disabled: boolean;
|
94
84
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
85
|
+
/**
|
86
|
+
* A label supports different sizes.
|
87
|
+
* @defaultvalue 'medium'
|
88
|
+
*/
|
89
|
+
size: 'small' | 'medium' | 'large';
|
100
90
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
91
|
+
/**
|
92
|
+
* A label supports semibold/strong fontweight.
|
93
|
+
* @defaultvalue false
|
94
|
+
*/
|
95
|
+
strong: boolean;
|
96
|
+
};
|
107
97
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
98
|
+
export type LabelSlots = {
|
99
|
+
root: IntrinsicShorthandProps<'label'>;
|
100
|
+
required?: IntrinsicShorthandProps<'span'>;
|
101
|
+
};
|
112
102
|
|
113
103
|
/**
|
114
|
-
*
|
104
|
+
* State used in rendering Label
|
115
105
|
*/
|
116
|
-
export type
|
106
|
+
export type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
117
107
|
|
118
108
|
/**
|
119
|
-
*
|
109
|
+
* Label Props
|
120
110
|
*/
|
121
|
-
export type
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
111
|
+
export type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> &
|
112
|
+
Partial<LabelCommons> & {
|
113
|
+
/**
|
114
|
+
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
115
|
+
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
116
|
+
* @defaultvalue false
|
117
|
+
*/
|
118
|
+
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
119
|
+
};
|
127
120
|
```
|
128
121
|
|
129
122
|
## Structure
|
package/dist/react-label.d.ts
CHANGED
@@ -12,9 +12,6 @@ export declare const Label: ForwardRefComponent<LabelProps>;
|
|
12
12
|
|
13
13
|
export declare const labelClassName = "fui-Label";
|
14
14
|
|
15
|
-
/**
|
16
|
-
* Label Props
|
17
|
-
*/
|
18
15
|
export declare type LabelCommons = {
|
19
16
|
/**
|
20
17
|
* Renders the label as disabled
|
@@ -33,6 +30,9 @@ export declare type LabelCommons = {
|
|
33
30
|
strong: boolean;
|
34
31
|
};
|
35
32
|
|
33
|
+
/**
|
34
|
+
* Label Props
|
35
|
+
*/
|
36
36
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
37
37
|
/**
|
38
38
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
@@ -42,12 +42,6 @@ export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> &
|
|
42
42
|
required?: boolean | ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>> | React_2.ReactNode;
|
43
43
|
};
|
44
44
|
|
45
|
-
/**
|
46
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
47
|
-
* {@docCatergory Label}
|
48
|
-
*/
|
49
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
50
|
-
|
51
45
|
export declare type LabelSlots = {
|
52
46
|
root: IntrinsicShorthandProps<'label'>;
|
53
47
|
required?: IntrinsicShorthandProps<'span'>;
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
2
2
|
import * as React from 'react';
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
3
|
export declare type LabelCommons = {
|
7
4
|
/**
|
8
5
|
* Renders the label as disabled
|
@@ -28,6 +25,9 @@ export declare type LabelSlots = {
|
|
28
25
|
* State used in rendering Label
|
29
26
|
*/
|
30
27
|
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
28
|
+
/**
|
29
|
+
* Label Props
|
30
|
+
*/
|
31
31
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
32
|
/**
|
33
33
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import { getSlots } from '@fluentui/react-utilities';
|
3
|
-
import { labelShorthandProps } from './useLabel';
|
4
3
|
/**
|
5
4
|
* Render the final JSX of Label
|
6
5
|
*/
|
@@ -9,7 +8,9 @@ export const renderLabel = state => {
|
|
9
8
|
const {
|
10
9
|
slots,
|
11
10
|
slotProps
|
12
|
-
} = getSlots(state
|
13
|
-
return /*#__PURE__*/React.createElement(slots.root,
|
11
|
+
} = getSlots(state);
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
13
|
+
}, state.root.children, /*#__PURE__*/React.createElement(slots.required, { ...slotProps.required
|
14
|
+
}));
|
14
15
|
};
|
15
16
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAa,KAAb,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAFF,CADF;AAMD,CATM","sourceRoot":""}
|
@@ -1,10 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { LabelProps,
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
5
|
-
* {@docCatergory Label}
|
6
|
-
*/
|
7
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
2
|
+
import type { LabelProps, LabelState } from './Label.types';
|
8
3
|
/**
|
9
4
|
* Create the state required to render Label.
|
10
5
|
*
|
@@ -1,11 +1,5 @@
|
|
1
1
|
import { getNativeElementProps } from '@fluentui/react-utilities';
|
2
2
|
import { resolveShorthand } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
5
|
-
* {@docCatergory Label}
|
6
|
-
*/
|
7
|
-
|
8
|
-
export const labelShorthandProps = ['root', 'required'];
|
9
3
|
/**
|
10
4
|
* Create the state required to render Label.
|
11
5
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":"AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA;;;;;;;;AAQG;;AACH,OAAO,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,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,GAAZ;AAAiB,uBAAe;AAAhC;AAFiD,KAAvC,CAFrB;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,qBAAqB,CAAC,OAAD,EAAU;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAAV;AATtB,GAAP;AAWD,CAbM","sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA,OAAO,MAAM,cAAc,GAAG,WAAvB;AAEP;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,MAAM,cAAc,GAAI,KAAD,IAAkC;AAC9D,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,cADiC,EAEjC,MAAM,CAAC,IAF0B,EAGjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAHQ,EAIjC,MAAM,CAAC,KAAK,CAAC,IAAP,CAJ2B,EAKjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MALU,EAMjC,KAAK,CAAC,IAAN,CAAW,SANsB,CAAnC;;AASA,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,CAhBM","sourceRoot":""}
|
@@ -1,8 +1,5 @@
|
|
1
1
|
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
2
2
|
import * as React from 'react';
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
3
|
export declare type LabelCommons = {
|
7
4
|
/**
|
8
5
|
* Renders the label as disabled
|
@@ -28,6 +25,9 @@ export declare type LabelSlots = {
|
|
28
25
|
* State used in rendering Label
|
29
26
|
*/
|
30
27
|
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
28
|
+
/**
|
29
|
+
* Label Props
|
30
|
+
*/
|
31
31
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
32
|
/**
|
33
33
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
@@ -8,8 +8,6 @@ exports.renderLabel = void 0;
|
|
8
8
|
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
10
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
|
-
const useLabel_1 = /*#__PURE__*/require("./useLabel");
|
13
11
|
/**
|
14
12
|
* Render the final JSX of Label
|
15
13
|
*/
|
@@ -19,8 +17,10 @@ const renderLabel = state => {
|
|
19
17
|
const {
|
20
18
|
slots,
|
21
19
|
slotProps
|
22
|
-
} = react_utilities_1.getSlots(state
|
23
|
-
return React.createElement(slots.root,
|
20
|
+
} = react_utilities_1.getSlots(state);
|
21
|
+
return React.createElement(slots.root, { ...slotProps.root
|
22
|
+
}, state.root.children, React.createElement(slots.required, { ...slotProps.required
|
23
|
+
}));
|
24
24
|
};
|
25
25
|
|
26
26
|
exports.renderLabel = renderLabel;
|
@@ -1 +1 @@
|
|
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
|
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;AAGA;;AAEG;;;AACI,MAAM,WAAW,GAAI,KAAD,IAAsB;AAC/C,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAqB,KAArB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAFF,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX","sourceRoot":""}
|
@@ -1,10 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { LabelProps,
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
5
|
-
* {@docCatergory Label}
|
6
|
-
*/
|
7
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
2
|
+
import type { LabelProps, LabelState } from './Label.types';
|
8
3
|
/**
|
9
4
|
* Create the state required to render Label.
|
10
5
|
*
|
@@ -3,18 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.useLabel =
|
6
|
+
exports.useLabel = void 0;
|
7
7
|
|
8
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
9
9
|
|
10
10
|
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
/**
|
12
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
13
|
-
* {@docCatergory Label}
|
14
|
-
*/
|
15
|
-
|
16
|
-
|
17
|
-
exports.labelShorthandProps = ['root', 'required'];
|
18
11
|
/**
|
19
12
|
* Create the state required to render Label.
|
20
13
|
*
|
@@ -25,6 +18,7 @@ exports.labelShorthandProps = ['root', 'required'];
|
|
25
18
|
* @param ref - reference to root HTMLElement of Label
|
26
19
|
*/
|
27
20
|
|
21
|
+
|
28
22
|
const useLabel = (props, ref) => {
|
29
23
|
const {
|
30
24
|
disabled = false,
|
@@ -1 +1 @@
|
|
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
|
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;;;;;;;;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":""}
|
@@ -7,6 +7,8 @@ exports.useLabelStyles = exports.labelClassName = void 0;
|
|
7
7
|
|
8
8
|
const react_make_styles_1 = /*#__PURE__*/require("@fluentui/react-make-styles");
|
9
9
|
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
|
+
|
10
12
|
exports.labelClassName = 'fui-Label';
|
11
13
|
/**
|
12
14
|
* Styles for the label
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAGa,OAAA,C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AAA;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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "0.0.0-
|
3
|
+
"version": "0.0.0-nightly5ab766c40f20220114.1",
|
4
4
|
"description": "Label component for FluentUI library.",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -26,11 +26,11 @@
|
|
26
26
|
"type-check": "tsc -b tsconfig.json"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
|
-
"@fluentui/babel-make-styles": "0.0.0-
|
29
|
+
"@fluentui/babel-make-styles": "0.0.0-nightly5ab766c40f20220114.1",
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
31
|
-
"@fluentui/jest-serializer-make-styles": "0.0.0-
|
31
|
+
"@fluentui/jest-serializer-make-styles": "0.0.0-nightly5ab766c40f20220114.1",
|
32
32
|
"@fluentui/react-conformance": "*",
|
33
|
-
"@fluentui/react-conformance-make-styles": "0.0.0-
|
33
|
+
"@fluentui/react-conformance-make-styles": "0.0.0-nightly5ab766c40f20220114.1",
|
34
34
|
"@fluentui/scripts": "^1.0.0",
|
35
35
|
"@types/enzyme": "3.10.3",
|
36
36
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -44,8 +44,8 @@
|
|
44
44
|
"react-test-renderer": "^16.3.0"
|
45
45
|
},
|
46
46
|
"dependencies": {
|
47
|
-
"@fluentui/react-make-styles": "0.0.0-
|
48
|
-
"@fluentui/react-utilities": "0.0.0-
|
47
|
+
"@fluentui/react-make-styles": "0.0.0-nightly5ab766c40f20220114.1",
|
48
|
+
"@fluentui/react-utilities": "0.0.0-nightly5ab766c40f20220114.1",
|
49
49
|
"tslib": "^2.1.0"
|
50
50
|
},
|
51
51
|
"peerDependencies": {
|