@fluentui/react-label 9.0.21 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +43 -1
- package/CHANGELOG.md +22 -2
- package/lib/components/Label/Label.js +5 -0
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib-amd/components/Label/Label.js +3 -1
- package/lib-amd/components/Label/Label.js.map +1 -1
- package/lib-commonjs/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.js +5 -0
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.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.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,49 @@
|
|
2
2
|
"name": "@fluentui/react-label",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Wed, 08 Mar 2023 17:39:01 GMT",
|
6
|
+
"tag": "@fluentui/react-label_v9.1.0",
|
7
|
+
"version": "9.1.0",
|
8
|
+
"comments": {
|
9
|
+
"minor": [
|
10
|
+
{
|
11
|
+
"author": "gcox@microsoft.com",
|
12
|
+
"package": "@fluentui/react-label",
|
13
|
+
"commit": "5fa1affa69afbb2f6b9e188e1a8e45b6ebc7b001",
|
14
|
+
"comment": "feat: Adding calls to custom style hooks derived from context."
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-label",
|
19
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.3.0",
|
20
|
+
"commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-label",
|
25
|
+
"comment": "Bump @fluentui/react-utilities to v9.6.1",
|
26
|
+
"commit": "e0d11faf97f6466f4cd23ed18266cf1e80094f56"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Wed, 15 Feb 2023 11:44:52 GMT",
|
33
|
+
"tag": "@fluentui/react-label_v9.0.22",
|
34
|
+
"version": "9.0.22",
|
35
|
+
"comments": {
|
36
|
+
"patch": [
|
37
|
+
{
|
38
|
+
"author": "beachball",
|
39
|
+
"package": "@fluentui/react-label",
|
40
|
+
"comment": "Bump @fluentui/react-utilities to v9.6.0",
|
41
|
+
"commit": "087d981aab96bef2e332a373069a19bc702a7ca2"
|
42
|
+
}
|
43
|
+
]
|
44
|
+
}
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"date": "Mon, 13 Feb 2023 23:43:14 GMT",
|
6
48
|
"tag": "@fluentui/react-label_v9.0.21",
|
7
49
|
"version": "9.0.21",
|
8
50
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,32 @@
|
|
1
1
|
# Change Log - @fluentui/react-label
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Wed, 08 Mar 2023 17:39:01 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.1.0)
|
8
|
+
|
9
|
+
Wed, 08 Mar 2023 17:39:01 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.22..@fluentui/react-label_v9.1.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- feat: Adding calls to custom style hooks derived from context. ([PR #27067](https://github.com/microsoft/fluentui/pull/27067) by gcox@microsoft.com)
|
15
|
+
- Bump @fluentui/react-shared-contexts to v9.3.0 ([PR #27127](https://github.com/microsoft/fluentui/pull/27127) by beachball)
|
16
|
+
- Bump @fluentui/react-utilities to v9.6.1 ([PR #27127](https://github.com/microsoft/fluentui/pull/27127) by beachball)
|
17
|
+
|
18
|
+
## [9.0.22](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.22)
|
19
|
+
|
20
|
+
Wed, 15 Feb 2023 11:44:52 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.21..@fluentui/react-label_v9.0.22)
|
22
|
+
|
23
|
+
### Patches
|
24
|
+
|
25
|
+
- Bump @fluentui/react-utilities to v9.6.0 ([PR #26845](https://github.com/microsoft/fluentui/pull/26845) by beachball)
|
26
|
+
|
7
27
|
## [9.0.21](https://github.com/microsoft/fluentui/tree/@fluentui/react-label_v9.0.21)
|
8
28
|
|
9
|
-
Mon, 13 Feb 2023 23:
|
29
|
+
Mon, 13 Feb 2023 23:43:14 GMT
|
10
30
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-label_v9.0.20..@fluentui/react-label_v9.0.21)
|
11
31
|
|
12
32
|
### Patches
|
@@ -2,12 +2,17 @@ import * as React from 'react';
|
|
2
2
|
import { useLabel_unstable } from './useLabel';
|
3
3
|
import { renderLabel_unstable } from './renderLabel';
|
4
4
|
import { useLabelStyles_unstable } from './useLabelStyles';
|
5
|
+
import { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';
|
5
6
|
/**
|
6
7
|
* A label component provides a title or name to a component.
|
7
8
|
*/
|
8
9
|
export const Label = /*#__PURE__*/React.forwardRef((props, ref) => {
|
9
10
|
const state = useLabel_unstable(props, ref);
|
10
11
|
useLabelStyles_unstable(state);
|
12
|
+
const {
|
13
|
+
useLabelStyles_unstable: useCustomStyles
|
14
|
+
} = useCustomStyleHooks_unstable();
|
15
|
+
useCustomStyles(state);
|
11
16
|
return renderLabel_unstable(state);
|
12
17
|
});
|
13
18
|
Label.displayName = 'Label';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React","useLabel_unstable","renderLabel_unstable","useLabelStyles_unstable","useCustomStyleHooks_unstable","Label","forwardRef","props","ref","state","useCustomStyles","displayName"],"sources":["../src/packages/react-components/react-label/src/components/Label/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label: ForwardRefComponent<LabelProps> = React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n\n useLabelStyles_unstable(state);\n\n const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,iBAAiB,QAAQ,YAAY;AAC9C,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,uBAAuB,QAAQ,kBAAkB;AAG1D,SAASC,4BAA4B,QAAQ,iCAAiC;AAE9E;;;AAGA,OAAO,MAAMC,KAAK,gBAAoCL,KAAK,CAACM,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGR,iBAAiB,CAACM,KAAK,EAAEC,GAAG,CAAC;EAE3CL,uBAAuB,CAACM,KAAK,CAAC;EAE9B,MAAM;IAAEN,uBAAuB,EAAEO;EAAe,CAAE,GAAGN,4BAA4B,EAAE;EACnFM,eAAe,CAACD,KAAK,CAAC;EAEtB,OAAOP,oBAAoB,CAACO,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFJ,KAAK,CAACM,WAAW,GAAG,OAAO"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React","getSlots","renderLabel_unstable","state","slots","slotProps","createElement","root","children","required"],"sources":["../src/packages/react-components/react-label/src/components/Label/renderLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LabelState, LabelSlots } from './Label.types';\n\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = (state: LabelState) => {\n const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,2BAA2B;AAGpD;;;AAGA,OAAO,MAAMC,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,QAAQ,CAAaE,KAAK,CAAC;EAExD,oBACEH,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACG,IAAI;IAAA,GAAKF,SAAS,CAACE;EAAI,GAC3BJ,KAAK,CAACI,IAAI,CAACC,QAAQ,EACnBJ,KAAK,CAACK,QAAQ,iBAAIT,KAAA,CAAAM,aAAA,CAACF,KAAK,CAACK,QAAQ;IAAA,GAAKJ,SAAS,CAACI;EAAQ,EAAI,CAClD;AAEjB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["getNativeElementProps","resolveShorthand","useLabel_unstable","props","ref","disabled","required","weight","size","undefined","defaultProps","components","root"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\n\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: LabelProps, ref: React.Ref<HTMLElement>): LabelState => {\n const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;\n return {\n disabled,\n required: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"mappings":"AACA,SAASA,qBAAqB,QAAQ,2BAA2B;AAEjE,SAASC,gBAAgB,QAAQ,2BAA2B;AAE5D;;;;;;;;;AASA,OAAO,MAAMC,iBAAiB,GAAGA,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;EAC9F,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC,QAAQ,GAAG,KAAK;IAAEC,MAAM,GAAG,SAAS;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGL,KAAK;EACzF,OAAO;IACLE,QAAQ;IACRC,QAAQ,EAAEL,gBAAgB,CAACK,QAAQ,KAAK,IAAI,GAAG,GAAG,GAAGA,QAAQ,IAAIG,SAAS,EAAE;MAC1EC,YAAY,EAAE;QAAE,aAAa,EAAE;MAAM;KACtC,CAAC;IACFH,MAAM;IACNC,IAAI;IACJG,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEN,QAAQ,EAAE;IAAM,CAAE;IAC/CM,IAAI,EAAEZ,qBAAqB,CAAC,OAAO,EAAE;MAAEI,GAAG;MAAE,GAAGD;IAAK,CAAE;GACvD;AACH,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tokens","labelClassNames","root","required","useStyles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","useLabelStyles_unstable","state","styles","className","size","weight"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabelStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"],"mappings":"AAAA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAI9C,OAAO,MAAMC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGN,QAAA;EAAAI,IAAA;IAAAG,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;EAAA;EAAAH,QAAA;IAAAG,MAAA;IAAAE,MAAA;EAAA;EAAAC,gBAAA;IAAAH,MAAA;EAAA;EAAAI,KAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAF,OAAA;IAAAC,OAAA;EAAA;EAAAE,KAAA;IAAAH,OAAA;IAAAC,OAAA;IAAAG,OAAA;EAAA;EAAAC,QAAA;IAAAD,OAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,EAsChB;AAEF;;;AAGA,OAAO,MAAMC,uBAAuB,GAAIC,KAAiB,IAAgB;EACvE,MAAMC,MAAM,GAAGhB,SAAS,EAAE;EAC1Be,KAAK,CAACjB,IAAI,CAACmB,SAAS,GAAGtB,YAAY,CACjCE,eAAe,CAACC,IAAI,EACpBkB,MAAM,CAAClB,IAAI,EACXiB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACb,QAAQ,EACjCa,MAAM,CAACD,KAAK,CAACG,IAAI,CAAC,EAClBH,KAAK,CAACI,MAAM,KAAK,UAAU,IAAIH,MAAM,CAACJ,QAAQ,EAC9CG,KAAK,CAACjB,IAAI,CAACmB,SAAS,CACrB;EAED,IAAIF,KAAK,CAAChB,QAAQ,EAAE;IAClBgB,KAAK,CAAChB,QAAQ,CAACkB,SAAS,GAAGtB,YAAY,CACrCE,eAAe,CAACE,QAAQ,EACxBiB,MAAM,CAACjB,QAAQ,EACfgB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACX,gBAAgB,EACzCU,KAAK,CAAChB,QAAQ,CAACkB,SAAS,CACzB;;EAGH,OAAOF,KAAK;AACd,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
define(["require", "exports", "react", "./useLabel", "./renderLabel", "./useLabelStyles"], function (require, exports, React, useLabel_1, renderLabel_1, useLabelStyles_1) {
|
1
|
+
define(["require", "exports", "react", "./useLabel", "./renderLabel", "./useLabelStyles", "@fluentui/react-shared-contexts"], function (require, exports, React, useLabel_1, renderLabel_1, useLabelStyles_1, react_shared_contexts_1) {
|
2
2
|
"use strict";
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
4
4
|
exports.Label = void 0;
|
@@ -8,6 +8,8 @@ define(["require", "exports", "react", "./useLabel", "./renderLabel", "./useLabe
|
|
8
8
|
exports.Label = React.forwardRef(function (props, ref) {
|
9
9
|
var state = useLabel_1.useLabel_unstable(props, ref);
|
10
10
|
useLabelStyles_1.useLabelStyles_unstable(state);
|
11
|
+
var useCustomStyles = react_shared_contexts_1.useCustomStyleHooks_unstable().useLabelStyles_unstable;
|
12
|
+
useCustomStyles(state);
|
11
13
|
return renderLabel_1.renderLabel_unstable(state);
|
12
14
|
});
|
13
15
|
exports.Label.displayName = 'Label';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/Label.tsx"],"names":[],"mappings":";;;;
|
1
|
+
{"version":3,"file":"Label.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-label/src/components/Label/Label.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,KAAK,GAAoC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QAChF,IAAM,KAAK,GAAG,4BAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE5C,wCAAuB,CAAC,KAAK,CAAC,CAAC;QAEvB,IAAyB,eAAe,GAAK,oDAA4B,EAAE,wBAAnC,CAAoC;QACpF,eAAe,CAAC,KAAK,CAAC,CAAC;QAEvB,OAAO,kCAAoB,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,aAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label: ForwardRefComponent<LabelProps> = React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n\n useLabelStyles_unstable(state);\n\n const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-label/src/Label.ts"],"sourcesContent":["export * from './components/Label/index';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,8BAAAC,OAAA"}
|
@@ -8,12 +8,17 @@ const React = /*#__PURE__*/require("react");
|
|
8
8
|
const useLabel_1 = /*#__PURE__*/require("./useLabel");
|
9
9
|
const renderLabel_1 = /*#__PURE__*/require("./renderLabel");
|
10
10
|
const useLabelStyles_1 = /*#__PURE__*/require("./useLabelStyles");
|
11
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
11
12
|
/**
|
12
13
|
* A label component provides a title or name to a component.
|
13
14
|
*/
|
14
15
|
exports.Label = /*#__PURE__*/React.forwardRef((props, ref) => {
|
15
16
|
const state = useLabel_1.useLabel_unstable(props, ref);
|
16
17
|
useLabelStyles_1.useLabelStyles_unstable(state);
|
18
|
+
const {
|
19
|
+
useLabelStyles_unstable: useCustomStyles
|
20
|
+
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
21
|
+
useCustomStyles(state);
|
17
22
|
return renderLabel_1.renderLabel_unstable(state);
|
18
23
|
});
|
19
24
|
exports.Label.displayName = 'Label';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React","require","useLabel_1","renderLabel_1","useLabelStyles_1","react_shared_contexts_1","exports","Label","forwardRef","props","ref","state","useLabel_unstable","useLabelStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderLabel_unstable","displayName"],"sources":["../src/packages/react-components/react-label/src/components/Label/Label.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useLabel_unstable } from './useLabel';\nimport { renderLabel_unstable } from './renderLabel';\nimport { useLabelStyles_unstable } from './useLabelStyles';\nimport type { LabelProps } from './Label.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * A label component provides a title or name to a component.\n */\nexport const Label: ForwardRefComponent<LabelProps> = React.forwardRef((props, ref) => {\n const state = useLabel_unstable(props, ref);\n\n useLabelStyles_unstable(state);\n\n const { useLabelStyles_unstable: useCustomStyles } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n\n return renderLabel_unstable(state);\n});\n\nLabel.displayName = 'Label';\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,UAAA,gBAAAD,OAAA;AACA,MAAAE,aAAA,gBAAAF,OAAA;AACA,MAAAG,gBAAA,gBAAAH,OAAA;AAGA,MAAAI,uBAAA,gBAAAJ,OAAA;AAEA;;;AAGaK,OAAA,CAAAC,KAAK,gBAAoCP,KAAK,CAACQ,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpF,MAAMC,KAAK,GAAGT,UAAA,CAAAU,iBAAiB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAE3CN,gBAAA,CAAAS,uBAAuB,CAACF,KAAK,CAAC;EAE9B,MAAM;IAAEE,uBAAuB,EAAEC;EAAe,CAAE,GAAGT,uBAAA,CAAAU,4BAA4B,EAAE;EACnFD,eAAe,CAACH,KAAK,CAAC;EAEtB,OAAOR,aAAA,CAAAa,oBAAoB,CAACL,KAAK,CAAC;AACpC,CAAC,CAAC;AAEFL,OAAA,CAAAC,KAAK,CAACU,WAAW,GAAG,OAAO"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":[],"sources":["../src/packages/react-components/react-label/src/components/Label/Label.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * Label Props\n */\nexport type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & {\n /**\n * Renders the label as disabled\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Displays an indicator that the label is for a required field. The required prop can be set to true to display\n * an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.\n * @default false\n */\n required?: boolean | Slot<'span'>;\n\n /**\n * A label supports different sizes.\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A label supports regular and semibold fontweight.\n * @default regular\n */\n weight?: 'regular' | 'semibold';\n};\n\nexport type LabelSlots = {\n root: Slot<'label'>;\n required?: Slot<'span'>;\n};\n\n/**\n * State used in rendering Label\n */\nexport type LabelState = ComponentState<LabelSlots> & Required<Pick<LabelProps, 'disabled' | 'size' | 'weight'>>;\n"],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["tslib_1","__exportStar","require","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/index.ts"],"sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"],"mappings":";;;;;;AAAAA,OAAA,CAAAC,YAAA,CAAAC,OAAA,aAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,mBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,gBAAAC,OAAA;AACAH,OAAA,CAAAC,YAAA,CAAAC,OAAA,sBAAAC,OAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["React","require","react_utilities_1","renderLabel_unstable","state","slots","slotProps","getSlots","createElement","root","children","required","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/renderLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { LabelState, LabelSlots } from './Label.types';\n\n/**\n * Render the final JSX of Label\n */\nexport const renderLabel_unstable = (state: LabelState) => {\n const { slots, slotProps } = getSlots<LabelSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {state.root.children}\n {slots.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"],"mappings":";;;;;;AAAA,MAAAA,KAAA,gBAAAC,OAAA;AACA,MAAAC,iBAAA,gBAAAD,OAAA;AAGA;;;AAGO,MAAME,oBAAoB,GAAIC,KAAiB,IAAI;EACxD,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGJ,iBAAA,CAAAK,QAAQ,CAAaH,KAAK,CAAC;EAExD,OACEJ,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BL,KAAK,CAACK,IAAI,CAACC,QAAQ,EACnBL,KAAK,CAACM,QAAQ,IAAIX,KAAA,CAAAQ,aAAA,CAACH,KAAK,CAACM,QAAQ;IAAA,GAAKL,SAAS,CAACK;EAAQ,EAAI,CAClD;AAEjB,CAAC;AATYC,OAAA,CAAAT,oBAAoB,GAAAA,oBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["react_utilities_1","require","react_utilities_2","useLabel_unstable","props","ref","disabled","required","weight","size","resolveShorthand","undefined","defaultProps","components","root","getNativeElementProps","exports"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabel.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport type { LabelProps, LabelState } from './Label.types';\nimport { resolveShorthand } from '@fluentui/react-utilities';\n\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: LabelProps, ref: React.Ref<HTMLElement>): LabelState => {\n const { disabled = false, required = false, weight = 'regular', size = 'medium' } = props;\n return {\n disabled,\n required: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n weight,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"mappings":";;;;;;AACA,MAAAA,iBAAA,gBAAAC,OAAA;AAEA,MAAAC,iBAAA,gBAAAD,OAAA;AAEA;;;;;;;;;AASO,MAAME,iBAAiB,GAAGA,CAACC,KAAiB,EAAEC,GAA2B,KAAgB;EAC9F,MAAM;IAAEC,QAAQ,GAAG,KAAK;IAAEC,QAAQ,GAAG,KAAK;IAAEC,MAAM,GAAG,SAAS;IAAEC,IAAI,GAAG;EAAQ,CAAE,GAAGL,KAAK;EACzF,OAAO;IACLE,QAAQ;IACRC,QAAQ,EAAEL,iBAAA,CAAAQ,gBAAgB,CAACH,QAAQ,KAAK,IAAI,GAAG,GAAG,GAAGA,QAAQ,IAAII,SAAS,EAAE;MAC1EC,YAAY,EAAE;QAAE,aAAa,EAAE;MAAM;KACtC,CAAC;IACFJ,MAAM;IACNC,IAAI;IACJI,UAAU,EAAE;MAAEC,IAAI,EAAE,OAAO;MAAEP,QAAQ,EAAE;IAAM,CAAE;IAC/CO,IAAI,EAAEd,iBAAA,CAAAe,qBAAqB,CAAC,OAAO,EAAE;MAAEV,GAAG;MAAE,GAAGD;IAAK,CAAE;GACvD;AACH,CAAC;AAZYY,OAAA,CAAAb,iBAAiB,GAAAA,iBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["react_1","require","react_theme_1","exports","labelClassNames","root","required","useStyles","__styles","Bahqtrf","sj55zd","disabled","uwmqm3","requiredDisabled","small","Be2twd7","Bg96gwp","medium","large","Bhrd7zp","semibold","d","useLabelStyles_unstable","state","styles","className","mergeClasses","size","weight"],"sources":["../src/packages/react-components/react-label/src/components/Label/useLabelStyles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { LabelSlots, LabelState } from './Label.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const labelClassNames: SlotClassNames<LabelSlots> = {\n root: 'fui-Label',\n required: 'fui-Label__required',\n};\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: {\n fontFamily: tokens.fontFamilyBase,\n color: tokens.colorNeutralForeground1,\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n required: {\n color: tokens.colorPaletteRedForeground3,\n paddingLeft: '4px', // TODO: Once spacing tokens are added, change this to Horizontal XS\n },\n\n requiredDisabled: {\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n small: {\n fontSize: tokens.fontSizeBase200,\n lineHeight: tokens.lineHeightBase200,\n },\n\n medium: {\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n },\n\n large: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n fontWeight: tokens.fontWeightSemibold,\n },\n\n semibold: {\n fontWeight: tokens.fontWeightSemibold,\n },\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles_unstable = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.root.className = mergeClasses(\n labelClassNames.root,\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.weight === 'semibold' && styles.semibold,\n state.root.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(\n labelClassNames.required,\n styles.required,\n state.disabled && styles.requiredDisabled,\n state.required.className,\n );\n }\n\n return state;\n};\n"],"mappings":";;;;;;AAAA,MAAAA,OAAA,gBAAAC,OAAA;AACA,MAAAC,aAAA,gBAAAD,OAAA;AAIaE,OAAA,CAAAC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,QAAQ,EAAE;CACX;AAED;;;AAGA,MAAMC,SAAS,gBAAGP,OAAA,CAAAQ,QAAU;EAAAH,IAAA;IAAAI,OAAA;IAAAC,MAAA;EAAA;EAAAC,QAAA;IAAAD,MAAA;EAAA;EAAAJ,QAAA;IAAAI,MAAA;IAAAE,MAAA;EAAA;EAAAC,gBAAA;IAAAH,MAAA;EAAA;EAAAI,KAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,MAAA;IAAAF,OAAA;IAAAC,OAAA;EAAA;EAAAE,KAAA;IAAAH,OAAA;IAAAC,OAAA;IAAAG,OAAA;EAAA;EAAAC,QAAA;IAAAD,OAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,EAsC1B;AAEF;;;AAGO,MAAMC,uBAAuB,GAAIC,KAAiB,IAAgB;EACvE,MAAMC,MAAM,GAAGjB,SAAS,EAAE;EAC1BgB,KAAK,CAAClB,IAAI,CAACoB,SAAS,GAAGzB,OAAA,CAAA0B,YAAY,CACjCvB,OAAA,CAAAC,eAAe,CAACC,IAAI,EACpBmB,MAAM,CAACnB,IAAI,EACXkB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACb,QAAQ,EACjCa,MAAM,CAACD,KAAK,CAACI,IAAI,CAAC,EAClBJ,KAAK,CAACK,MAAM,KAAK,UAAU,IAAIJ,MAAM,CAACJ,QAAQ,EAC9CG,KAAK,CAAClB,IAAI,CAACoB,SAAS,CACrB;EAED,IAAIF,KAAK,CAACjB,QAAQ,EAAE;IAClBiB,KAAK,CAACjB,QAAQ,CAACmB,SAAS,GAAGzB,OAAA,CAAA0B,YAAY,CACrCvB,OAAA,CAAAC,eAAe,CAACE,QAAQ,EACxBkB,MAAM,CAAClB,QAAQ,EACfiB,KAAK,CAACZ,QAAQ,IAAIa,MAAM,CAACX,gBAAgB,EACzCU,KAAK,CAACjB,QAAQ,CAACmB,SAAS,CACzB;;EAGH,OAAOF,KAAK;AACd,CAAC;AArBYpB,OAAA,CAAAmB,uBAAuB,GAAAA,uBAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"names":["Label_1","require","Object","defineProperty","exports","enumerable","get","Label","labelClassNames","renderLabel_unstable","useLabelStyles_unstable","useLabel_unstable"],"sources":["../src/packages/react-components/react-label/src/index.ts"],"sourcesContent":["export { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAO,KAAK;EAAA;AAAA;AAAEL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAQ,eAAe;EAAA;AAAA;AAAEN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAS,oBAAoB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAU,uBAAuB;EAAA;AAAA;AAAER,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAW,iBAAiB;EAAA;AAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "9.0
|
3
|
+
"version": "9.1.0",
|
4
4
|
"description": "Fluent UI React Label component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -32,8 +32,9 @@
|
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
+
"@fluentui/react-shared-contexts": "^9.3.0",
|
35
36
|
"@fluentui/react-theme": "^9.1.5",
|
36
|
-
"@fluentui/react-utilities": "^9.
|
37
|
+
"@fluentui/react-utilities": "^9.6.1",
|
37
38
|
"@griffel/react": "^1.5.2",
|
38
39
|
"tslib": "^2.1.0"
|
39
40
|
},
|