@fluentui/react-label 0.0.0-nightlyf3ce1fbe1d20211110.1 → 0.0.0-nightlyfc5cfdc52420220215.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +211 -20
- package/CHANGELOG.md +54 -10
- package/Spec.md +33 -40
- package/dist/react-label.d.ts +13 -20
- package/lib/components/Label/Label.js +6 -6
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/Label.types.d.ts +9 -9
- package/lib/components/Label/renderLabel.d.ts +1 -1
- package/lib/components/Label/renderLabel.js +5 -4
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +4 -9
- package/lib/components/Label/useLabel.js +5 -12
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.d.ts +1 -1
- package/lib/components/Label/useLabelStyles.js +3 -2
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/components/Label/Label.js +3 -3
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +9 -9
- package/lib-commonjs/components/Label/renderLabel.d.ts +1 -1
- package/lib-commonjs/components/Label/renderLabel.js +7 -7
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.d.ts +4 -9
- package/lib-commonjs/components/Label/useLabel.js +8 -15
- 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 +9 -7
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/package.json +9 -11
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -11
- package/lib/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -22
- package/lib-commonjs/common/isConformant.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,66 +2,257 @@
|
|
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": "Tue, 15 Feb 2022 04:11:40 GMT",
|
6
|
+
"tag": "@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1",
|
7
|
+
"version": "0.0.0-nightlyfc5cfdc52420220215.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": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9",
|
14
14
|
"comment": "Release nightly v9"
|
15
15
|
},
|
16
16
|
{
|
17
|
-
"author": "
|
17
|
+
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-label",
|
19
|
-
"
|
20
|
-
"
|
19
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyfc5cfdc52420220215.1",
|
20
|
+
"commit": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-label",
|
25
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyfc5cfdc52420220215.1",
|
26
|
+
"commit": "911569f28daa07a66ee59e1d8b7cfaf6f86051e9"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Thu, 10 Feb 2022 08:51:22 GMT",
|
33
|
+
"tag": "@fluentui/react-label_v9.0.0-beta.5",
|
34
|
+
"version": "9.0.0-beta.5",
|
35
|
+
"comments": {
|
36
|
+
"none": [
|
37
|
+
{
|
38
|
+
"author": "martinhochel@microsoft.com",
|
39
|
+
"package": "@fluentui/react-label",
|
40
|
+
"commit": "8dfa712156b70414205b87b5b6d099367b0c297d",
|
41
|
+
"comment": "chore: use storybook runner for all vNext packages"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"author": "elcraig@microsoft.com",
|
45
|
+
"package": "@fluentui/react-label",
|
46
|
+
"commit": "d892c7f79c543b6008634ecd669b75b5108cad46",
|
47
|
+
"comment": "Relocate comment about props to the correct type, and update spec to accurately reflect props"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"author": "bsunderhus@microsoft.com",
|
51
|
+
"package": "@fluentui/react-label",
|
52
|
+
"commit": "c0d4e63ee58e60e2c6674efbacc0783cd520984e",
|
53
|
+
"comment": "Updates components with nullRender changes"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"author": "elcraig@microsoft.com",
|
57
|
+
"package": "@fluentui/react-label",
|
58
|
+
"commit": "96d9c93544464bcc5ec36b7c5d724b77ae499c73",
|
59
|
+
"comment": "Update docs description"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "andredias@microsoft.com",
|
63
|
+
"package": "@fluentui/react-label",
|
64
|
+
"commit": "084a7183511bae60a43e57fbd57979349c4736a4",
|
65
|
+
"comment": "Migrate package to use solution tsconfigs"
|
21
66
|
},
|
22
67
|
{
|
23
68
|
"author": "olfedias@microsoft.com",
|
24
69
|
"package": "@fluentui/react-label",
|
25
|
-
"commit": "
|
26
|
-
"comment": "
|
70
|
+
"commit": "c061e98be4b4a718c72a144a1f60bb5515824612",
|
71
|
+
"comment": "remove inline-style-expand-shorthand from tsconfigs"
|
72
|
+
}
|
73
|
+
],
|
74
|
+
"prerelease": [
|
75
|
+
{
|
76
|
+
"author": "lingfangao@hotmail.com",
|
77
|
+
"package": "@fluentui/react-label",
|
78
|
+
"commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f",
|
79
|
+
"comment": "Bump Fluent UI dependencies to 9.0.0-rc"
|
80
|
+
},
|
81
|
+
{
|
82
|
+
"author": "olfedias@microsoft.com",
|
83
|
+
"package": "@fluentui/react-label",
|
84
|
+
"commit": "742c191b7f2ea28505e49304117c090f9f36386c",
|
85
|
+
"comment": "Replace make-styles packages with griffel equivalents."
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"author": "mgodbolt@microsoft.com",
|
89
|
+
"package": "@fluentui/react-label",
|
90
|
+
"commit": "839ec14849e112b85aa321d034739ec421199141",
|
91
|
+
"comment": "remove export of commons types"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
95
|
+
"package": "@fluentui/react-label",
|
96
|
+
"commit": "e0b8e1fa6980077e7b311fd1c72c28d3e4305db0",
|
97
|
+
"comment": "Updating based on changes to composition types."
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
101
|
+
"package": "@fluentui/react-label",
|
102
|
+
"commit": "0bc161458eae5ae8d387172430496ce9829b1bb1",
|
103
|
+
"comment": "Using ComponentSlotProps instead of ObjectShorthandProps."
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"author": "behowell@microsoft.com",
|
107
|
+
"package": "@fluentui/react-label",
|
108
|
+
"commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3",
|
109
|
+
"comment": "Refactor component Slot typings"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
113
|
+
"package": "@fluentui/react-label",
|
114
|
+
"commit": "a052fbc9204600669d32b0ac346032d2cd8d9204",
|
115
|
+
"comment": "react-label: Replacing use of functions in makeStyles with direct use of tokens."
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"author": "behowell@microsoft.com",
|
119
|
+
"package": "@fluentui/react-label",
|
120
|
+
"commit": "7cc28ed8320b00f42d91c63882f10316db2205c5",
|
121
|
+
"comment": "Remove component's shorthandProps array"
|
122
|
+
},
|
123
|
+
{
|
124
|
+
"author": "behowell@microsoft.com",
|
125
|
+
"package": "@fluentui/react-label",
|
126
|
+
"commit": "317209bb5cd57c40f35bc42060acb7e3cce5ec95",
|
127
|
+
"comment": "BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet"
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
131
|
+
"package": "@fluentui/react-label",
|
132
|
+
"commit": "00a5d945904c896a0664de6ba72c145a255f0848",
|
133
|
+
"comment": "Updating use of tokens.fontWeight now that we don't need to use casting."
|
134
|
+
},
|
135
|
+
{
|
136
|
+
"author": "beachball",
|
137
|
+
"package": "@fluentui/react-label",
|
138
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1",
|
139
|
+
"commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"author": "beachball",
|
143
|
+
"package": "@fluentui/react-label",
|
144
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1",
|
145
|
+
"commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
|
146
|
+
}
|
147
|
+
]
|
148
|
+
}
|
149
|
+
},
|
150
|
+
{
|
151
|
+
"date": "Thu, 25 Nov 2021 08:34:14 GMT",
|
152
|
+
"tag": "@fluentui/react-label_v9.0.0-beta.4",
|
153
|
+
"version": "9.0.0-beta.4",
|
154
|
+
"comments": {
|
155
|
+
"prerelease": [
|
156
|
+
{
|
157
|
+
"author": "ololubek@microsoft.com",
|
158
|
+
"package": "@fluentui/react-label",
|
159
|
+
"commit": "a683ee69b17c667227acb71c59f609b4f1ca1ef9",
|
160
|
+
"comment": "Add aria-hidden to Label required field"
|
27
161
|
},
|
28
162
|
{
|
29
163
|
"author": "beachball",
|
30
164
|
"package": "@fluentui/react-label",
|
31
|
-
"comment": "Bump @fluentui/react-make-styles to
|
32
|
-
"commit": "
|
165
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.4",
|
166
|
+
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
|
33
167
|
},
|
34
168
|
{
|
35
169
|
"author": "beachball",
|
36
170
|
"package": "@fluentui/react-label",
|
37
|
-
"comment": "Bump @fluentui/react-utilities to
|
38
|
-
"commit": "
|
171
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.4",
|
172
|
+
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
|
39
173
|
},
|
40
174
|
{
|
41
175
|
"author": "beachball",
|
42
176
|
"package": "@fluentui/react-label",
|
43
|
-
"comment": "Bump @fluentui/babel-make-styles to
|
44
|
-
"commit": "
|
177
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.4",
|
178
|
+
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
|
45
179
|
},
|
46
180
|
{
|
47
181
|
"author": "beachball",
|
48
182
|
"package": "@fluentui/react-label",
|
49
|
-
"comment": "Bump @fluentui/jest-serializer-make-styles to
|
50
|
-
"commit": "
|
183
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4",
|
184
|
+
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
|
51
185
|
},
|
52
186
|
{
|
53
187
|
"author": "beachball",
|
54
188
|
"package": "@fluentui/react-label",
|
55
|
-
"comment": "Bump @fluentui/react-conformance-make-styles to
|
56
|
-
"commit": "
|
189
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4",
|
190
|
+
"commit": "48d236ac53a4950fabc3ddd52f91dac93ca0195b"
|
57
191
|
}
|
58
|
-
]
|
192
|
+
]
|
193
|
+
}
|
194
|
+
},
|
195
|
+
{
|
196
|
+
"date": "Fri, 12 Nov 2021 13:25:25 GMT",
|
197
|
+
"tag": "@fluentui/react-label_v9.0.0-beta.3",
|
198
|
+
"version": "9.0.0-beta.3",
|
199
|
+
"comments": {
|
59
200
|
"none": [
|
60
201
|
{
|
61
202
|
"author": "lingfangao@hotmail.com",
|
62
203
|
"package": "@fluentui/react-label",
|
63
204
|
"commit": "7eff1eb4a259988273f8bc709e2951dbb8e0b695",
|
64
205
|
"comment": "chore(Label): Rework documentation to desired format"
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"author": "lingfangao@hotmail.com",
|
209
|
+
"package": "@fluentui/react-label",
|
210
|
+
"commit": "00f70581480b536e723fb69edf0ae617beac4807",
|
211
|
+
"comment": "Remove beta release tag"
|
212
|
+
}
|
213
|
+
],
|
214
|
+
"prerelease": [
|
215
|
+
{
|
216
|
+
"author": "gcox@microsoft.com",
|
217
|
+
"package": "@fluentui/react-label",
|
218
|
+
"commit": "c9bd5b5a02ae94a8239ce1b56cac2f0d0dbd3586",
|
219
|
+
"comment": "Updated beta and RC components to ES2019"
|
220
|
+
},
|
221
|
+
{
|
222
|
+
"author": "olfedias@microsoft.com",
|
223
|
+
"package": "@fluentui/react-label",
|
224
|
+
"commit": "9186578324773f95f4d61be3d70e67752159d843",
|
225
|
+
"comment": "export static classes for components"
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"author": "beachball",
|
229
|
+
"package": "@fluentui/react-label",
|
230
|
+
"comment": "Bump @fluentui/react-make-styles to v9.0.0-beta.3",
|
231
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
232
|
+
},
|
233
|
+
{
|
234
|
+
"author": "beachball",
|
235
|
+
"package": "@fluentui/react-label",
|
236
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-beta.3",
|
237
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
238
|
+
},
|
239
|
+
{
|
240
|
+
"author": "beachball",
|
241
|
+
"package": "@fluentui/react-label",
|
242
|
+
"comment": "Bump @fluentui/babel-make-styles to v9.0.0-beta.3",
|
243
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
244
|
+
},
|
245
|
+
{
|
246
|
+
"author": "beachball",
|
247
|
+
"package": "@fluentui/react-label",
|
248
|
+
"comment": "Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3",
|
249
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
"author": "beachball",
|
253
|
+
"package": "@fluentui/react-label",
|
254
|
+
"comment": "Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3",
|
255
|
+
"commit": "742342e52c65066f779232e4e1302fedf0dd460d"
|
65
256
|
}
|
66
257
|
]
|
67
258
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,24 +1,68 @@
|
|
1
1
|
# Change Log - @fluentui/react-label
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Tue, 15 Feb 2022 04:11:40 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-
|
7
|
+
## [0.0.0-nightlyfc5cfdc52420220215.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.
|
9
|
+
Tue, 15 Feb 2022 04:11:40 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.5..@fluentui/react-label_v0.0.0-nightlyfc5cfdc52420220215.1)
|
11
|
+
|
12
|
+
### Changes
|
13
|
+
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by email not defined)
|
15
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightlyfc5cfdc52420220215.1 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by beachball)
|
16
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyfc5cfdc52420220215.1 ([commit](https://github.com/microsoft/fluentui/commit/911569f28daa07a66ee59e1d8b7cfaf6f86051e9) by beachball)
|
17
|
+
|
18
|
+
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.5)
|
19
|
+
|
20
|
+
Thu, 10 Feb 2022 08:51:22 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.4..@fluentui/react-label_v9.0.0-beta.5)
|
22
|
+
|
23
|
+
### Changes
|
24
|
+
|
25
|
+
- Bump Fluent UI dependencies to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
|
26
|
+
- Replace make-styles packages with griffel equivalents. ([PR #21430](https://github.com/microsoft/fluentui/pull/21430) by olfedias@microsoft.com)
|
27
|
+
- remove export of commons types ([PR #21660](https://github.com/microsoft/fluentui/pull/21660) by mgodbolt@microsoft.com)
|
28
|
+
- Updating based on changes to composition types. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com)
|
29
|
+
- Using ComponentSlotProps instead of ObjectShorthandProps. ([PR #20890](https://github.com/microsoft/fluentui/pull/20890) by Humberto.Morimoto@microsoft.com)
|
30
|
+
- Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com)
|
31
|
+
- 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)
|
32
|
+
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
|
33
|
+
- BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com)
|
34
|
+
- 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)
|
35
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
|
36
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
|
37
|
+
|
38
|
+
## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.4)
|
39
|
+
|
40
|
+
Thu, 25 Nov 2021 08:34:14 GMT
|
41
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.3..@fluentui/react-label_v9.0.0-beta.4)
|
42
|
+
|
43
|
+
### Changes
|
44
|
+
|
45
|
+
- Add aria-hidden to Label required field ([PR #20680](https://github.com/microsoft/fluentui/pull/20680) by ololubek@microsoft.com)
|
46
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
|
47
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
|
48
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
|
49
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
|
50
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.4 ([PR #20762](https://github.com/microsoft/fluentui/pull/20762) by beachball)
|
51
|
+
|
52
|
+
## [9.0.0-beta.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.3)
|
53
|
+
|
54
|
+
Fri, 12 Nov 2021 13:25:25 GMT
|
55
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.0-beta.2..@fluentui/react-label_v9.0.0-beta.3)
|
11
56
|
|
12
57
|
### Changes
|
13
58
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/c7a7f2302f3cfcbc6cd026f4d0ee4d5a2810371a) by email not defined)
|
15
59
|
- Updated beta and RC components to ES2019 ([PR #20405](https://github.com/microsoft/fluentui/pull/20405) by gcox@microsoft.com)
|
16
60
|
- export static classes for components ([PR #20456](https://github.com/microsoft/fluentui/pull/20456) by olfedias@microsoft.com)
|
17
|
-
- Bump @fluentui/react-make-styles to
|
18
|
-
- Bump @fluentui/react-utilities to
|
19
|
-
- Bump @fluentui/babel-make-styles to
|
20
|
-
- Bump @fluentui/jest-serializer-make-styles to
|
21
|
-
- Bump @fluentui/react-conformance-make-styles to
|
61
|
+
- Bump @fluentui/react-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
62
|
+
- Bump @fluentui/react-utilities to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
63
|
+
- Bump @fluentui/babel-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
64
|
+
- Bump @fluentui/jest-serializer-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
65
|
+
- Bump @fluentui/react-conformance-make-styles to v9.0.0-beta.3 ([PR #20583](https://github.com/microsoft/fluentui/pull/20583) by beachball)
|
22
66
|
|
23
67
|
## [9.0.0-beta.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.0-beta.2)
|
24
68
|
|
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: IntrinsicSlotProps<'label'>;
|
100
|
+
required?: IntrinsicSlotProps<'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 | IntrinsicSlotProps<'span'> | React.ReactNode;
|
119
|
+
};
|
127
120
|
```
|
128
121
|
|
129
122
|
## Structure
|
package/dist/react-label.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
2
|
import type { ComponentState } from '@fluentui/react-utilities';
|
3
3
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
4
|
-
import type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
5
|
-
import type { ObjectShorthandProps } from '@fluentui/react-utilities';
|
6
4
|
import * as React_2 from 'react';
|
5
|
+
import type { Slot } from '@fluentui/react-utilities';
|
7
6
|
|
8
7
|
/**
|
9
8
|
* A label component provides a title or name to a component.
|
@@ -12,10 +11,7 @@ export declare const Label: ForwardRefComponent<LabelProps>;
|
|
12
11
|
|
13
12
|
export declare const labelClassName = "fui-Label";
|
14
13
|
|
15
|
-
|
16
|
-
* Label Props
|
17
|
-
*/
|
18
|
-
export declare type LabelCommons = {
|
14
|
+
declare type LabelCommons = {
|
19
15
|
/**
|
20
16
|
* Renders the label as disabled
|
21
17
|
* @defaultvalue false
|
@@ -33,24 +29,21 @@ export declare type LabelCommons = {
|
|
33
29
|
strong: boolean;
|
34
30
|
};
|
35
31
|
|
32
|
+
/**
|
33
|
+
* Label Props
|
34
|
+
*/
|
36
35
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
37
36
|
/**
|
38
37
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
39
38
|
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
40
39
|
* @defaultvalue false
|
41
40
|
*/
|
42
|
-
required?: boolean |
|
41
|
+
required?: boolean | Slot<'span'>;
|
43
42
|
};
|
44
43
|
|
45
|
-
/**
|
46
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
47
|
-
* {@docCatergory Label}
|
48
|
-
*/
|
49
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
50
|
-
|
51
44
|
export declare type LabelSlots = {
|
52
|
-
root:
|
53
|
-
required?:
|
45
|
+
root: Slot<'label'>;
|
46
|
+
required?: Slot<'span'>;
|
54
47
|
};
|
55
48
|
|
56
49
|
/**
|
@@ -61,22 +54,22 @@ export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
|
61
54
|
/**
|
62
55
|
* Render the final JSX of Label
|
63
56
|
*/
|
64
|
-
export declare const
|
57
|
+
export declare const renderLabel_unstable: (state: LabelState) => JSX.Element;
|
65
58
|
|
66
59
|
/**
|
67
60
|
* Create the state required to render Label.
|
68
61
|
*
|
69
|
-
* The returned state can be modified with hooks such as
|
70
|
-
* before being passed to
|
62
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
63
|
+
* before being passed to renderLabel_unstable.
|
71
64
|
*
|
72
65
|
* @param props - props from this instance of Label
|
73
66
|
* @param ref - reference to root HTMLElement of Label
|
74
67
|
*/
|
75
|
-
export declare const
|
68
|
+
export declare const useLabel_unstable: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState;
|
76
69
|
|
77
70
|
/**
|
78
71
|
* Apply styling to the Label slots based on the state
|
79
72
|
*/
|
80
|
-
export declare const
|
73
|
+
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState;
|
81
74
|
|
82
75
|
export { }
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
3
|
-
import {
|
4
|
-
import {
|
2
|
+
import { useLabel_unstable } from './useLabel';
|
3
|
+
import { renderLabel_unstable } from './renderLabel';
|
4
|
+
import { useLabelStyles_unstable } from './useLabelStyles';
|
5
5
|
/**
|
6
6
|
* A label component provides a title or name to a component.
|
7
7
|
*/
|
8
8
|
|
9
9
|
export const Label = /*#__PURE__*/React.forwardRef((props, ref) => {
|
10
|
-
const state =
|
11
|
-
|
12
|
-
return
|
10
|
+
const state = useLabel_unstable(props, ref);
|
11
|
+
useLabelStyles_unstable(state);
|
12
|
+
return renderLabel_unstable(state);
|
13
13
|
});
|
14
14
|
Label.displayName = 'Label';
|
15
15
|
//# sourceMappingURL=Label.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,iBAAT,QAAkC,YAAlC;AACA,SAAS,oBAAT,QAAqC,eAArC;AACA,SAAS,uBAAT,QAAwC,kBAAxC;AAIA;;AAEG;;AACH,OAAO,MAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACpF,QAAM,KAAK,GAAG,iBAAiB,CAAC,KAAD,EAAQ,GAAR,CAA/B;AAEA,EAAA,uBAAuB,CAAC,KAAD,CAAvB;AACA,SAAO,oBAAoB,CAAC,KAAD,CAA3B;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
|
-
export declare type LabelCommons = {
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
declare type LabelCommons = {
|
7
3
|
/**
|
8
4
|
* Renders the label as disabled
|
9
5
|
* @defaultvalue false
|
@@ -21,18 +17,22 @@ export declare type LabelCommons = {
|
|
21
17
|
strong: boolean;
|
22
18
|
};
|
23
19
|
export declare type LabelSlots = {
|
24
|
-
root:
|
25
|
-
required?:
|
20
|
+
root: Slot<'label'>;
|
21
|
+
required?: Slot<'span'>;
|
26
22
|
};
|
27
23
|
/**
|
28
24
|
* State used in rendering Label
|
29
25
|
*/
|
30
26
|
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
27
|
+
/**
|
28
|
+
* Label Props
|
29
|
+
*/
|
31
30
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
31
|
/**
|
33
32
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
34
33
|
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
35
34
|
* @defaultvalue false
|
36
35
|
*/
|
37
|
-
required?: boolean |
|
36
|
+
required?: boolean | Slot<'span'>;
|
38
37
|
};
|
38
|
+
export {};
|
@@ -1,15 +1,16 @@
|
|
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
|
*/
|
7
6
|
|
8
|
-
export const
|
7
|
+
export const renderLabel_unstable = 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, slots.required && /*#__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,oBAAoB,GAAI,KAAD,IAAsB;AACxD,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,EAEG,KAAK,CAAC,QAAN,iBAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAFrB,CADF;AAMD,CATM","sourceRoot":""}
|
@@ -1,17 +1,12 @@
|
|
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
|
*
|
11
|
-
* The returned state can be modified with hooks such as
|
12
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
7
|
+
* before being passed to renderLabel_unstable.
|
13
8
|
*
|
14
9
|
* @param props - props from this instance of Label
|
15
10
|
* @param ref - reference to root HTMLElement of Label
|
16
11
|
*/
|
17
|
-
export declare const
|
12
|
+
export declare const useLabel_unstable: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
@@ -1,22 +1,16 @@
|
|
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
|
*
|
12
|
-
* The returned state can be modified with hooks such as
|
13
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
7
|
+
* before being passed to renderLabel_unstable.
|
14
8
|
*
|
15
9
|
* @param props - props from this instance of Label
|
16
10
|
* @param ref - reference to root HTMLElement of Label
|
17
11
|
*/
|
18
12
|
|
19
|
-
export const
|
13
|
+
export const useLabel_unstable = (props, ref) => {
|
20
14
|
const {
|
21
15
|
disabled = false,
|
22
16
|
required = false,
|
@@ -25,10 +19,9 @@ export const useLabel = (props, ref) => {
|
|
25
19
|
} = props;
|
26
20
|
return {
|
27
21
|
disabled,
|
28
|
-
required: resolveShorthand(required ===
|
29
|
-
required: !!required,
|
22
|
+
required: resolveShorthand(required === true ? '*' : required || undefined, {
|
30
23
|
defaultProps: {
|
31
|
-
|
24
|
+
'aria-hidden': 'true'
|
32
25
|
}
|
33
26
|
}),
|
34
27
|
strong,
|
@@ -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,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AAC9F,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,IAAb,GAAoB,GAApB,GAA0B,QAAQ,IAAI,SAAvC,EAAkD;AAC1E,MAAA,YAAY,EAAE;AAAE,uBAAe;AAAjB;AAD4D,KAAlD,CAFrB;AAKL,IAAA,MALK;AAML,IAAA,IANK;AAOL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KAPP;AAQL,IAAA,IAAI,EAAE,qBAAqB,CAAC,OAAD,EAAU;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAAV;AARtB,GAAP;AAUD,CAZM","sourceRoot":""}
|
@@ -3,4 +3,4 @@ export declare const labelClassName = "fui-Label";
|
|
3
3
|
/**
|
4
4
|
* Apply styling to the Label slots based on the state
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState;
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { __styles, mergeClasses } from '@
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
2
3
|
export const labelClassName = 'fui-Label';
|
3
4
|
/**
|
4
5
|
* Styles for the label
|
@@ -40,7 +41,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
40
41
|
*/
|
41
42
|
|
42
43
|
|
43
|
-
export const
|
44
|
+
export const useLabelStyles_unstable = state => {
|
44
45
|
const styles = useStyles();
|
45
46
|
state.root.className = mergeClasses(labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
46
47
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,gBAAzC;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAGA,OAAO,MAAM,cAAc,GAAG,WAAvB;AAEP;;AAEG;;AACH,MAAM,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,MAAM,uBAAuB,GAAI,KAAD,IAAkC;AACvE,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":""}
|
@@ -18,9 +18,9 @@ const useLabelStyles_1 = /*#__PURE__*/require("./useLabelStyles");
|
|
18
18
|
|
19
19
|
|
20
20
|
exports.Label = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
-
const state = useLabel_1.
|
22
|
-
useLabelStyles_1.
|
23
|
-
return renderLabel_1.
|
21
|
+
const state = useLabel_1.useLabel_unstable(props, ref);
|
22
|
+
useLabelStyles_1.useLabelStyles_unstable(state);
|
23
|
+
return renderLabel_1.renderLabel_unstable(state);
|
24
24
|
});
|
25
25
|
exports.Label.displayName = 'Label';
|
26
26
|
//# sourceMappingURL=Label.js.map
|
@@ -1 +1 @@
|
|
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,
|
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,iBAAA,CAAkB,KAAlB,EAAyB,GAAzB,CAAd;AAEA,EAAA,gBAAA,CAAA,uBAAA,CAAwB,KAAxB;AACA,SAAO,aAAA,CAAA,oBAAA,CAAqB,KAArB,CAAP;AACD,CALqD,CAAzC;AAOb,OAAA,CAAA,KAAA,CAAM,WAAN,GAAoB,OAApB","sourceRoot":""}
|
@@ -1,9 +1,5 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
|
-
export declare type LabelCommons = {
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
|
+
declare type LabelCommons = {
|
7
3
|
/**
|
8
4
|
* Renders the label as disabled
|
9
5
|
* @defaultvalue false
|
@@ -21,18 +17,22 @@ export declare type LabelCommons = {
|
|
21
17
|
strong: boolean;
|
22
18
|
};
|
23
19
|
export declare type LabelSlots = {
|
24
|
-
root:
|
25
|
-
required?:
|
20
|
+
root: Slot<'label'>;
|
21
|
+
required?: Slot<'span'>;
|
26
22
|
};
|
27
23
|
/**
|
28
24
|
* State used in rendering Label
|
29
25
|
*/
|
30
26
|
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
27
|
+
/**
|
28
|
+
* Label Props
|
29
|
+
*/
|
31
30
|
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
31
|
/**
|
33
32
|
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
34
33
|
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
35
34
|
* @defaultvalue false
|
36
35
|
*/
|
37
|
-
required?: boolean |
|
36
|
+
required?: boolean | Slot<'span'>;
|
38
37
|
};
|
38
|
+
export {};
|
@@ -3,25 +3,25 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderLabel_unstable = void 0;
|
7
7
|
|
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
|
*/
|
16
14
|
|
17
15
|
|
18
|
-
const
|
16
|
+
const renderLabel_unstable = 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, slots.required && React.createElement(slots.required, { ...slotProps.required
|
23
|
+
}));
|
24
24
|
};
|
25
25
|
|
26
|
-
exports.
|
26
|
+
exports.renderLabel_unstable = renderLabel_unstable;
|
27
27
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -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,oBAAoB,GAAI,KAAD,IAAsB;AACxD,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,EAEG,KAAK,CAAC,QAAN,IAAkB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,EAAA,GAAK,SAAS,CAAC;AAAf,GAAf,CAFrB,CADF;AAMD,CATM;;AAAM,OAAA,CAAA,oBAAA,GAAoB,oBAApB","sourceRoot":""}
|
@@ -1,17 +1,12 @@
|
|
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
|
*
|
11
|
-
* The returned state can be modified with hooks such as
|
12
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
7
|
+
* before being passed to renderLabel_unstable.
|
13
8
|
*
|
14
9
|
* @param props - props from this instance of Label
|
15
10
|
* @param ref - reference to root HTMLElement of Label
|
16
11
|
*/
|
17
|
-
export declare const
|
12
|
+
export declare const useLabel_unstable: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
@@ -3,29 +3,23 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useLabel_unstable = 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
|
*
|
21
|
-
* The returned state can be modified with hooks such as
|
22
|
-
* before being passed to
|
14
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
15
|
+
* before being passed to renderLabel_unstable.
|
23
16
|
*
|
24
17
|
* @param props - props from this instance of Label
|
25
18
|
* @param ref - reference to root HTMLElement of Label
|
26
19
|
*/
|
27
20
|
|
28
|
-
|
21
|
+
|
22
|
+
const useLabel_unstable = (props, ref) => {
|
29
23
|
const {
|
30
24
|
disabled = false,
|
31
25
|
required = false,
|
@@ -34,10 +28,9 @@ const useLabel = (props, ref) => {
|
|
34
28
|
} = props;
|
35
29
|
return {
|
36
30
|
disabled,
|
37
|
-
required: react_utilities_2.resolveShorthand(required ===
|
38
|
-
required: !!required,
|
31
|
+
required: react_utilities_2.resolveShorthand(required === true ? '*' : required || undefined, {
|
39
32
|
defaultProps: {
|
40
|
-
|
33
|
+
'aria-hidden': 'true'
|
41
34
|
}
|
42
35
|
}),
|
43
36
|
strong,
|
@@ -53,5 +46,5 @@ const useLabel = (props, ref) => {
|
|
53
46
|
};
|
54
47
|
};
|
55
48
|
|
56
|
-
exports.
|
49
|
+
exports.useLabel_unstable = useLabel_unstable;
|
57
50
|
//# sourceMappingURL=useLabel.js.map
|
@@ -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,iBAAiB,GAAG,CAAC,KAAD,EAAoB,GAApB,KAA+D;AAC9F,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,IAAb,GAAoB,GAApB,GAA0B,QAAQ,IAAI,SAAvD,EAAkE;AAC1E,MAAA,YAAY,EAAE;AAAE,uBAAe;AAAjB;AAD4D,KAAlE,CAFL;AAKL,IAAA,MALK;AAML,IAAA,IANK;AAOL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KAPP;AAQL,IAAA,IAAI,EAAE,iBAAA,CAAA,qBAAA,CAAsB,OAAtB,EAA+B;AAAE,MAAA,GAAF;AAAO,SAAG;AAAV,KAA/B;AARD,GAAP;AAUD,CAZM;;AAAM,OAAA,CAAA,iBAAA,GAAiB,iBAAjB","sourceRoot":""}
|
@@ -3,4 +3,4 @@ export declare const labelClassName = "fui-Label";
|
|
3
3
|
/**
|
4
4
|
* Apply styling to the Label slots based on the state
|
5
5
|
*/
|
6
|
-
export declare const
|
6
|
+
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState;
|
@@ -3,16 +3,18 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useLabelStyles_unstable = exports.labelClassName = void 0;
|
7
7
|
|
8
|
-
const
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
11
|
|
10
12
|
exports.labelClassName = 'fui-Label';
|
11
13
|
/**
|
12
14
|
* Styles for the label
|
13
15
|
*/
|
14
16
|
|
15
|
-
const useStyles = /*#__PURE__*/
|
17
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
16
18
|
"root": {
|
17
19
|
"Bahqtrf": "fk6fouc",
|
18
20
|
"sj55zd": "f19n0e5"
|
@@ -48,16 +50,16 @@ const useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
48
50
|
*/
|
49
51
|
|
50
52
|
|
51
|
-
const
|
53
|
+
const useLabelStyles_unstable = state => {
|
52
54
|
const styles = useStyles();
|
53
|
-
state.root.className =
|
55
|
+
state.root.className = react_1.mergeClasses(exports.labelClassName, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
54
56
|
|
55
57
|
if (state.required) {
|
56
|
-
state.required.className =
|
58
|
+
state.required.className = react_1.mergeClasses(styles.required, state.required.className);
|
57
59
|
}
|
58
60
|
|
59
61
|
return state;
|
60
62
|
};
|
61
63
|
|
62
|
-
exports.
|
64
|
+
exports.useLabelStyles_unstable = useLabelStyles_unstable;
|
63
65
|
//# sourceMappingURL=useLabelStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;;AAGa,OAAA,CAAA,cAAA,GAAiB,WAAjB;AAEb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,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,uBAAuB,GAAI,KAAD,IAAkC;AACvE,QAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,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,OAAA,CAAA,YAAA,CAAa,MAAM,CAAC,QAApB,EAA8B,KAAK,CAAC,QAAN,CAAe,SAA7C,CAA3B;AACD;;AAED,SAAO,KAAP;AACD,CAhBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "0.0.0-
|
4
|
-
"description": "
|
3
|
+
"version": "0.0.0-nightlyfc5cfdc52420220215.1",
|
4
|
+
"description": "Fluent UI React Label component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
7
|
"typings": "lib/index.d.ts",
|
@@ -19,17 +19,16 @@
|
|
19
19
|
"just": "just-scripts",
|
20
20
|
"lint": "just-scripts lint",
|
21
21
|
"start": "yarn storybook",
|
22
|
-
"test": "jest",
|
22
|
+
"test": "jest --passWithNoTests",
|
23
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": "
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../scripts/typescript/normalize-import --output ./dist/packages/react-label/src && yarn docs",
|
25
|
+
"storybook": "node ../../scripts/storybook/runner",
|
26
|
+
"type-check": "tsc -b tsconfig.json"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
|
-
"@fluentui/babel-make-styles": "0.0.0-nightlyf3ce1fbe1d20211110.1",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "0.0.0-nightlyf3ce1fbe1d20211110.1",
|
31
30
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-
|
31
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightlyfc5cfdc52420220215.1",
|
33
32
|
"@fluentui/scripts": "^1.0.0",
|
34
33
|
"@types/enzyme": "3.10.3",
|
35
34
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
@@ -43,8 +42,8 @@
|
|
43
42
|
"react-test-renderer": "^16.3.0"
|
44
43
|
},
|
45
44
|
"dependencies": {
|
46
|
-
"@fluentui/react-
|
47
|
-
"@
|
45
|
+
"@fluentui/react-utilities": "0.0.0-nightlyfc5cfdc52420220215.1",
|
46
|
+
"@griffel/react": "1.0.0",
|
48
47
|
"tslib": "^2.1.0"
|
49
48
|
},
|
50
49
|
"peerDependencies": {
|
@@ -54,7 +53,6 @@
|
|
54
53
|
"react-dom": ">=16.8.0 <18.0.0"
|
55
54
|
},
|
56
55
|
"beachball": {
|
57
|
-
"tag": "beta",
|
58
56
|
"disallowedChangeTypes": [
|
59
57
|
"major",
|
60
58
|
"minor",
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
-
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
3
|
-
export function isConformant(testInfo) {
|
4
|
-
const defaultOptions = {
|
5
|
-
asPropHandlesRef: true,
|
6
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
-
extraTests: makeStylesTests
|
8
|
-
};
|
9
|
-
baseIsConformant(defaultOptions, testInfo);
|
10
|
-
}
|
11
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
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,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;AAH+C,GAA7D;AAMA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.isConformant = void 0;
|
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
|
-
|
12
|
-
function isConformant(testInfo) {
|
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);
|
19
|
-
}
|
20
|
-
|
21
|
-
exports.isConformant = isConformant;
|
22
|
-
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +0,0 @@
|
|
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":""}
|