@fluentui/react-label 0.0.0-nightly-20230317-1454.1 → 0.0.0-nightly-20230322-0439.1
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/.swcrc +2 -11
- package/CHANGELOG.json +56 -11
- package/CHANGELOG.md +22 -8
- package/lib/Label.js +1 -1
- package/lib/components/Label/Label.js +6 -6
- package/lib/components/Label/index.js +5 -5
- package/lib/components/Label/renderLabel.js +2 -2
- package/lib/components/Label/useLabel.js +10 -10
- package/lib/components/Label/useLabelStyles.js +5 -5
- package/lib/index.js +1 -1
- package/lib-commonjs/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.js +1 -1
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/index.js.map +1 -1
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabel.js +6 -6
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js +3 -3
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +6 -5
package/.swcrc
CHANGED
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/swcrc",
|
|
3
|
-
"env": {
|
|
4
|
-
"targets": {
|
|
5
|
-
"chrome": "84",
|
|
6
|
-
"edge": "84",
|
|
7
|
-
"firefox": "75",
|
|
8
|
-
"opera": "73",
|
|
9
|
-
"safari": "14.1"
|
|
10
|
-
},
|
|
11
|
-
"bugfixes": true
|
|
12
|
-
},
|
|
13
3
|
"exclude": [
|
|
14
4
|
"/testing",
|
|
15
5
|
"/**/*.cy.ts",
|
|
@@ -32,7 +22,8 @@
|
|
|
32
22
|
"runtime": "classic",
|
|
33
23
|
"useSpread": true
|
|
34
24
|
}
|
|
35
|
-
}
|
|
25
|
+
},
|
|
26
|
+
"target": "es2019"
|
|
36
27
|
},
|
|
37
28
|
"minify": false,
|
|
38
29
|
"sourceMaps": true
|
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui/react-label",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui/react-label_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Wed, 22 Mar 2023 04:46:44 GMT",
|
|
6
|
+
"tag": "@fluentui/react-label_v0.0.0-nightly-20230322-0439.1",
|
|
7
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
@@ -16,26 +16,71 @@
|
|
|
16
16
|
{
|
|
17
17
|
"author": "beachball",
|
|
18
18
|
"package": "@fluentui/react-label",
|
|
19
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
20
|
-
"commit": "
|
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1",
|
|
20
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"author": "beachball",
|
|
24
24
|
"package": "@fluentui/react-label",
|
|
25
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
26
|
-
"commit": "
|
|
25
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1",
|
|
26
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"author": "beachball",
|
|
30
30
|
"package": "@fluentui/react-label",
|
|
31
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
32
|
-
"commit": "
|
|
31
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1",
|
|
32
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"author": "beachball",
|
|
36
36
|
"package": "@fluentui/react-label",
|
|
37
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
38
|
-
"commit": "
|
|
37
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1",
|
|
38
|
+
"commit": "49dde84493fc2c3e96abac5ce918169c9668ba66"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"date": "Tue, 21 Mar 2023 21:23:37 GMT",
|
|
45
|
+
"tag": "@fluentui/react-label_v9.1.5",
|
|
46
|
+
"version": "9.1.5",
|
|
47
|
+
"comments": {
|
|
48
|
+
"patch": [
|
|
49
|
+
{
|
|
50
|
+
"author": "tristan.watanabe@gmail.com",
|
|
51
|
+
"package": "@fluentui/react-label",
|
|
52
|
+
"commit": "2fac1a139149bd13b76b1306207bc988dca9c72c",
|
|
53
|
+
"comment": "chore: migrate to swc transpilation approach."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "tristan.watanabe@gmail.com",
|
|
57
|
+
"package": "@fluentui/react-label",
|
|
58
|
+
"commit": "ead1c6d4c2ac3f3596b62b8cbc07b0a03041f11f",
|
|
59
|
+
"comment": "fix: add node field to package.json exports map."
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@fluentui/react-label",
|
|
64
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.2",
|
|
65
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@fluentui/react-label",
|
|
70
|
+
"comment": "Bump @fluentui/react-theme to v9.1.7",
|
|
71
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@fluentui/react-label",
|
|
76
|
+
"comment": "Bump @fluentui/react-utilities to v9.7.2",
|
|
77
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@fluentui/react-label",
|
|
82
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20",
|
|
83
|
+
"commit": "b7a26f6263c80e3253c6b8338c33b73bae33e2b5"
|
|
39
84
|
}
|
|
40
85
|
]
|
|
41
86
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-label
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 22 Mar 2023 04:46:44 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20230322-0439.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v0.0.0-nightly-20230322-0439.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.1.
|
|
9
|
+
Wed, 22 Mar 2023 04:46:44 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.1.5..@fluentui/react-label_v0.0.0-nightly-20230322-0439.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
16
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
17
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
18
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230322-0439.1 ([commit](https://github.com/microsoft/fluentui/commit/49dde84493fc2c3e96abac5ce918169c9668ba66) by beachball)
|
|
19
|
+
|
|
20
|
+
## [9.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.1.5)
|
|
21
|
+
|
|
22
|
+
Tue, 21 Mar 2023 21:23:37 GMT
|
|
23
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.1.4..@fluentui/react-label_v9.1.5)
|
|
24
|
+
|
|
25
|
+
### Patches
|
|
26
|
+
|
|
27
|
+
- chore: migrate to swc transpilation approach. ([PR #27250](https://github.com/microsoft/fluentui/pull/27250) by tristan.watanabe@gmail.com)
|
|
28
|
+
- fix: add node field to package.json exports map. ([PR #27154](https://github.com/microsoft/fluentui/pull/27154) by tristan.watanabe@gmail.com)
|
|
29
|
+
- Bump @fluentui/react-shared-contexts to v9.3.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
30
|
+
- Bump @fluentui/react-theme to v9.1.7 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
31
|
+
- Bump @fluentui/react-utilities to v9.7.2 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
32
|
+
- Bump @fluentui/react-conformance-griffel to v9.0.0-beta.20 ([PR #27271](https://github.com/microsoft/fluentui/pull/27271) by beachball)
|
|
19
33
|
|
|
20
34
|
## [9.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.1.4)
|
|
21
35
|
|
package/lib/Label.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './components/Label/index';
|
|
2
2
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { useLabel_unstable } from
|
|
3
|
-
import { renderLabel_unstable } from
|
|
4
|
-
import { useLabelStyles_unstable } from
|
|
5
|
-
import { useCustomStyleHooks_unstable } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useLabel_unstable } from './useLabel';
|
|
3
|
+
import { renderLabel_unstable } from './renderLabel';
|
|
4
|
+
import { useLabelStyles_unstable } from './useLabelStyles';
|
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* A label component provides a title or name to a component.
|
|
8
8
|
*/
|
|
@@ -15,5 +15,5 @@ export const Label = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
15
15
|
useCustomStyles(state);
|
|
16
16
|
return renderLabel_unstable(state);
|
|
17
17
|
});
|
|
18
|
-
Label.displayName =
|
|
18
|
+
Label.displayName = 'Label';
|
|
19
19
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './Label';
|
|
2
|
+
export * from './Label.types';
|
|
3
|
+
export * from './renderLabel';
|
|
4
|
+
export * from './useLabel';
|
|
5
|
+
export * from './useLabelStyles';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import { getNativeElementProps } from
|
|
3
|
-
import { resolveShorthand } from
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getNativeElementProps } from '@fluentui/react-utilities';
|
|
3
|
+
import { resolveShorthand } from '@fluentui/react-utilities';
|
|
4
4
|
/**
|
|
5
5
|
* Create the state required to render Label.
|
|
6
6
|
*
|
|
@@ -14,23 +14,23 @@ export const useLabel_unstable = (props, ref) => {
|
|
|
14
14
|
const {
|
|
15
15
|
disabled = false,
|
|
16
16
|
required = false,
|
|
17
|
-
weight =
|
|
18
|
-
size =
|
|
17
|
+
weight = 'regular',
|
|
18
|
+
size = 'medium'
|
|
19
19
|
} = props;
|
|
20
20
|
return {
|
|
21
21
|
disabled,
|
|
22
|
-
required: resolveShorthand(required === true ?
|
|
22
|
+
required: resolveShorthand(required === true ? '*' : required || undefined, {
|
|
23
23
|
defaultProps: {
|
|
24
|
-
|
|
24
|
+
'aria-hidden': 'true'
|
|
25
25
|
}
|
|
26
26
|
}),
|
|
27
27
|
weight,
|
|
28
28
|
size,
|
|
29
29
|
components: {
|
|
30
|
-
root:
|
|
31
|
-
required:
|
|
30
|
+
root: 'label',
|
|
31
|
+
required: 'span'
|
|
32
32
|
},
|
|
33
|
-
root: getNativeElementProps(
|
|
33
|
+
root: getNativeElementProps('label', {
|
|
34
34
|
ref,
|
|
35
35
|
...props
|
|
36
36
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { __styles, mergeClasses } from
|
|
2
|
-
import { tokens } from
|
|
1
|
+
import { __styles, mergeClasses } from '@griffel/react';
|
|
2
|
+
import { tokens } from '@fluentui/react-theme';
|
|
3
3
|
export const labelClassNames = {
|
|
4
|
-
root:
|
|
5
|
-
required:
|
|
4
|
+
root: 'fui-Label',
|
|
5
|
+
required: 'fui-Label__required'
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
8
|
* Styles for the label
|
|
@@ -46,7 +46,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
|
46
46
|
*/
|
|
47
47
|
export const useLabelStyles_unstable = state => {
|
|
48
48
|
const styles = useStyles();
|
|
49
|
-
state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight ===
|
|
49
|
+
state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
|
|
50
50
|
if (state.required) {
|
|
51
51
|
state.required.className = mergeClasses(labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
|
|
52
52
|
}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from
|
|
1
|
+
export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/Label.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../lib/Label.js"],"sourcesContent":["export * from './components/Label/index';\n//# sourceMappingURL=Label.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,iCAAiC"}
|
|
@@ -19,6 +19,6 @@ const Label = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
19
19
|
useCustomStyles(state);
|
|
20
20
|
return (0, _renderLabel.renderLabel_unstable)(state);
|
|
21
21
|
});
|
|
22
|
-
Label.displayName =
|
|
22
|
+
Label.displayName = 'Label'; //# sourceMappingURL=Label.js.map
|
|
23
23
|
|
|
24
24
|
//# sourceMappingURL=Label.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Label/Label.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Label/Label.js"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n useLabelStyles_unstable(state);\n const {\n useLabelStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderLabel_unstable(state);\n});\nLabel.displayName = 'Label';\n//# sourceMappingURL=Label.js.map"],"names":["Label","React","forwardRef","props","ref","state","useLabel_unstable","useLabelStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderLabel_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;0BACW;6BACG;gCACG;qCACK;AAItC,MAAMA,QAAQ,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjE,MAAMC,QAAQC,IAAAA,2BAAiB,EAACH,OAAOC;IACvCG,IAAAA,uCAAuB,EAACF;IACxB,MAAM,EACJE,yBAAyBC,gBAAe,EACzC,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,iCAAoB,EAACL;AAC9B;AACAL,MAAMW,WAAW,GAAG,SACpB,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Label/index.js"],"sourcesContent":["export * from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Label/index.js"],"sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Label/renderLabel.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Label/renderLabel.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, state.root.children, slots.required && /*#__PURE__*/React.createElement(slots.required, slotProps.required));\n};\n//# sourceMappingURL=renderLabel.js.map"],"names":["renderLabel_unstable","state","slots","slotProps","getSlots","React","createElement","root","children","required"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,uBAAuBC,CAAAA,QAAS;IAC3C,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEN,MAAMM,IAAI,CAACC,QAAQ,EAAEN,MAAMO,QAAQ,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMO,QAAQ,EAAEN,UAAUM,QAAQ;AAChL,GACA,uCAAuC"}
|
|
@@ -10,21 +10,21 @@ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildc
|
|
|
10
10
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
11
|
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
12
|
const useLabel_unstable = (props, ref)=>{
|
|
13
|
-
const { disabled =false , required =false , weight =
|
|
13
|
+
const { disabled =false , required =false , weight ='regular' , size ='medium' } = props;
|
|
14
14
|
return {
|
|
15
15
|
disabled,
|
|
16
|
-
required: (0, _reactUtilities.resolveShorthand)(required === true ?
|
|
16
|
+
required: (0, _reactUtilities.resolveShorthand)(required === true ? '*' : required || undefined, {
|
|
17
17
|
defaultProps: {
|
|
18
|
-
|
|
18
|
+
'aria-hidden': 'true'
|
|
19
19
|
}
|
|
20
20
|
}),
|
|
21
21
|
weight,
|
|
22
22
|
size,
|
|
23
23
|
components: {
|
|
24
|
-
root:
|
|
25
|
-
required:
|
|
24
|
+
root: 'label',
|
|
25
|
+
required: 'span'
|
|
26
26
|
},
|
|
27
|
-
root: (0, _reactUtilities.getNativeElementProps)(
|
|
27
|
+
root: (0, _reactUtilities.getNativeElementProps)('label', {
|
|
28
28
|
ref,
|
|
29
29
|
...props
|
|
30
30
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Label/useLabel.js"],"sourcesContent":["import * as React from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Label/useLabel.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { resolveShorthand } from '@fluentui/react-utilities';\n/**\n * Create the state required to render Label.\n *\n * The returned state can be modified with hooks such as useLabelStyles_unstable,\n * before being passed to renderLabel_unstable.\n *\n * @param props - props from this instance of Label\n * @param ref - reference to root HTMLElement of Label\n */\nexport const useLabel_unstable = (props, ref) => {\n const {\n disabled = false,\n required = false,\n weight = 'regular',\n size = 'medium'\n } = props;\n return {\n disabled,\n required: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: {\n 'aria-hidden': 'true'\n }\n }),\n weight,\n size,\n components: {\n root: 'label',\n required: 'span'\n },\n root: getNativeElementProps('label', {\n ref,\n ...props\n })\n };\n};\n//# sourceMappingURL=useLabel.js.map"],"names":["useLabel_unstable","props","ref","disabled","required","weight","size","resolveShorthand","undefined","defaultProps","components","root","getNativeElementProps"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACe;AAW/B,MAAMA,oBAAoB,CAACC,OAAOC,MAAQ;IAC/C,MAAM,EACJC,UAAW,KAAK,CAAA,EAChBC,UAAW,KAAK,CAAA,EAChBC,QAAS,UAAS,EAClBC,MAAO,SAAQ,EAChB,GAAGL;IACJ,OAAO;QACLE;QACAC,UAAUG,IAAAA,gCAAgB,EAACH,aAAa,IAAI,GAAG,MAAMA,YAAYI,SAAS,EAAE;YAC1EC,cAAc;gBACZ,eAAe;YACjB;QACF;QACAJ;QACAC;QACAI,YAAY;YACVC,MAAM;YACNP,UAAU;QACZ;QACAO,MAAMC,IAAAA,qCAAqB,EAAC,SAAS;YACnCV;YACA,GAAGD,KAAK;QACV;IACF;AACF,GACA,oCAAoC"}
|
|
@@ -14,8 +14,8 @@ _export(exports, {
|
|
|
14
14
|
});
|
|
15
15
|
const _react = require("@griffel/react");
|
|
16
16
|
const labelClassNames = {
|
|
17
|
-
root:
|
|
18
|
-
required:
|
|
17
|
+
root: 'fui-Label',
|
|
18
|
+
required: 'fui-Label__required'
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Styles for the label
|
|
@@ -72,7 +72,7 @@ const labelClassNames = {
|
|
|
72
72
|
});
|
|
73
73
|
const useLabelStyles_unstable = (state)=>{
|
|
74
74
|
const styles = useStyles();
|
|
75
|
-
state.root.className = (0, _react.mergeClasses)(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight ===
|
|
75
|
+
state.root.className = (0, _react.mergeClasses)(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);
|
|
76
76
|
if (state.required) {
|
|
77
77
|
state.required.className = (0, _react.mergeClasses)(labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
|
|
78
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Label/useLabelStyles.js"],"sourcesContent":["import { __styles, mergeClasses } from
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Label/useLabelStyles.js"],"sourcesContent":["import { __styles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const labelClassNames = {\n root: 'fui-Label',\n required: 'fui-Label__required'\n};\n/**\n * Styles for the label\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n Bahqtrf: \"fk6fouc\",\n sj55zd: \"f19n0e5\"\n },\n disabled: {\n sj55zd: \"f1s2aq7o\"\n },\n required: {\n sj55zd: \"f1whyuy6\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"]\n },\n requiredDisabled: {\n sj55zd: \"f1s2aq7o\"\n },\n small: {\n Be2twd7: \"fy9rknc\",\n Bg96gwp: \"fwrc4pm\"\n },\n medium: {\n Be2twd7: \"fkhj508\",\n Bg96gwp: \"f1i3iumi\"\n },\n large: {\n Be2twd7: \"fod5ikn\",\n Bg96gwp: \"faaz57k\",\n Bhrd7zp: \"fl43uef\"\n },\n semibold: {\n Bhrd7zp: \"fl43uef\"\n }\n}, {\n 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);}\"]\n});\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.weight === 'semibold' && styles.semibold, state.root.className);\n if (state.required) {\n state.required.className = mergeClasses(labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);\n }\n return state;\n};\n//# sourceMappingURL=useLabelStyles.js.map"],"names":["labelClassNames","useLabelStyles_unstable","root","required","useStyles","__styles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","state","styles","className","mergeClasses","size","weight"],"mappings":";;;;;;;;;;;IAEaA,eAAe,MAAfA;IA4CAC,uBAAuB,MAAvBA;;uBA9C0B;AAEhC,MAAMD,kBAAkB;IAC7BE,MAAM;IACNC,UAAU;AACZ;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCH,MAAM;QACJI,SAAS;QACTC,QAAQ;IACV;IACAC,UAAU;QACRD,QAAQ;IACV;IACAJ,UAAU;QACRI,QAAQ;QACRE,QAAQ;YAAC;YAAW;SAAU;IAChC;IACAC,kBAAkB;QAChBH,QAAQ;IACV;IACAI,OAAO;QACLC,SAAS;QACTC,SAAS;IACX;IACAC,QAAQ;QACNF,SAAS;QACTC,SAAS;IACX;IACAE,OAAO;QACLH,SAAS;QACTC,SAAS;QACTG,SAAS;IACX;IACAC,UAAU;QACRD,SAAS;IACX;AACF,GAAG;IACDE,GAAG;QAAC;QAAgD;QAAmD;QAA2D;QAAuD;QAA+B;QAAgC;QAA+C;QAAmD;QAA+C;QAAoD;QAA+C;QAAmD;KAAmD;AACpnB;AAIO,MAAMjB,0BAA0BkB,CAAAA,QAAS;IAC9C,MAAMC,SAAShB;IACfe,MAAMjB,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,gBAAgBE,IAAI,EAAEkB,OAAOlB,IAAI,EAAEiB,MAAMX,QAAQ,IAAIY,OAAOZ,QAAQ,EAAEY,MAAM,CAACD,MAAMI,IAAI,CAAC,EAAEJ,MAAMK,MAAM,KAAK,cAAcJ,OAAOH,QAAQ,EAAEE,MAAMjB,IAAI,CAACmB,SAAS;IAClM,IAAIF,MAAMhB,QAAQ,EAAE;QAClBgB,MAAMhB,QAAQ,CAACkB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,gBAAgBG,QAAQ,EAAEiB,OAAOjB,QAAQ,EAAEgB,MAAMX,QAAQ,IAAIY,OAAOV,gBAAgB,EAAES,MAAMhB,QAAQ,CAACkB,SAAS;IACxJ,CAAC;IACD,OAAOF;AACT,GACA,0CAA0C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from
|
|
1
|
+
{"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\n//# sourceMappingURL=index.js.map"],"names":["Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;;uBAAQ;CACzG,iCAAiC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-label",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20230322-0439.1",
|
|
4
4
|
"description": "Fluent UI React Label component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
|
29
29
|
"@fluentui/react-conformance": "*",
|
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230322-0439.1",
|
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
36
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
37
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
35
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230322-0439.1",
|
|
36
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230322-0439.1",
|
|
37
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230322-0439.1",
|
|
38
38
|
"@griffel/react": "^1.5.2",
|
|
39
39
|
"@swc/helpers": "^0.4.14"
|
|
40
40
|
},
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"exports": {
|
|
49
49
|
".": {
|
|
50
50
|
"types": "./dist/index.d.ts",
|
|
51
|
+
"node": "./lib-commonjs/index.js",
|
|
51
52
|
"import": "./lib/index.js",
|
|
52
53
|
"require": "./lib-commonjs/index.js"
|
|
53
54
|
},
|