@fluentui/react-label 9.0.0-beta.1 → 9.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +493 -1
- package/CHANGELOG.md +183 -51
- package/README.md +2 -1
- package/Spec.md +34 -40
- package/dist/{react-label.d.ts → index.d.ts} +24 -23
- package/lib/Label.js.map +1 -1
- package/lib/components/Label/Label.js +7 -7
- package/lib/components/Label/Label.js.map +1 -1
- package/lib/components/Label/Label.types.d.ts +14 -14
- package/lib/components/Label/Label.types.js.map +1 -1
- package/lib/components/Label/index.js.map +1 -1
- package/lib/components/Label/renderLabel.d.ts +1 -1
- package/lib/components/Label/renderLabel.js +8 -8
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.d.ts +4 -9
- package/lib/components/Label/useLabel.js +18 -27
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.d.ts +8 -2
- package/lib/components/Label/useLabelStyles.js +19 -6
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Label.js +1 -1
- package/lib-commonjs/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.js +8 -8
- package/lib-commonjs/components/Label/Label.js.map +1 -1
- package/lib-commonjs/components/Label/Label.types.d.ts +14 -14
- package/lib-commonjs/components/Label/Label.types.js.map +1 -1
- package/lib-commonjs/components/Label/index.js +1 -1
- package/lib-commonjs/components/Label/index.js.map +1 -1
- package/lib-commonjs/components/Label/renderLabel.d.ts +1 -1
- package/lib-commonjs/components/Label/renderLabel.js +12 -14
- 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 +23 -33
- package/lib-commonjs/components/Label/useLabel.js.map +1 -1
- package/lib-commonjs/components/Label/useLabelStyles.d.ts +8 -2
- package/lib-commonjs/components/Label/useLabelStyles.js +23 -9
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.d.ts +2 -2
- package/lib-commonjs/index.js +39 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +18 -22
- 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
@@ -1,38 +1,38 @@
|
|
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
|
+
* @default false
|
10
6
|
*/
|
11
7
|
disabled: boolean;
|
12
8
|
/**
|
13
9
|
* A label supports different sizes.
|
14
|
-
* @
|
10
|
+
* @default 'medium'
|
15
11
|
*/
|
16
12
|
size: 'small' | 'medium' | 'large';
|
17
13
|
/**
|
18
14
|
* A label supports semibold/strong fontweight.
|
19
|
-
* @
|
15
|
+
* @default false
|
20
16
|
*/
|
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
|
-
* Displays
|
32
|
+
* Displays an 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
|
+
* @default false
|
36
35
|
*/
|
37
|
-
required?: boolean |
|
36
|
+
required?: boolean | Slot<'span'>;
|
38
37
|
};
|
38
|
+
export {};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":""}
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Label/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,eAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,YAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,kBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"],"sourceRoot":"../src/"}
|
@@ -3,27 +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
|
-
|
11
|
-
|
12
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
-
|
14
|
-
var useLabel_1 = /*#__PURE__*/require("./useLabel");
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
15
11
|
/**
|
16
12
|
* Render the final JSX of Label
|
17
13
|
*/
|
18
14
|
|
19
15
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
return React.createElement(slots.root,
|
16
|
+
const renderLabel_unstable = state => {
|
17
|
+
const {
|
18
|
+
slots,
|
19
|
+
slotProps
|
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
|
+
}));
|
26
24
|
};
|
27
25
|
|
28
|
-
exports.
|
26
|
+
exports.renderLabel_unstable = renderLabel_unstable;
|
29
27
|
//# sourceMappingURL=renderLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["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","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"],"sourceRoot":"../src/"}
|
@@ -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,58 +3,48 @@
|
|
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
|
-
|
11
|
-
|
12
|
-
var react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
13
|
-
/**
|
14
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
15
|
-
* {@docCatergory Label}
|
16
|
-
*/
|
17
|
-
|
18
|
-
|
19
|
-
exports.labelShorthandProps = ['root', 'required'];
|
10
|
+
const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
20
11
|
/**
|
21
12
|
* Create the state required to render Label.
|
22
13
|
*
|
23
|
-
* The returned state can be modified with hooks such as
|
24
|
-
* before being passed to
|
14
|
+
* The returned state can be modified with hooks such as useLabelStyles_unstable,
|
15
|
+
* before being passed to renderLabel_unstable.
|
25
16
|
*
|
26
17
|
* @param props - props from this instance of Label
|
27
18
|
* @param ref - reference to root HTMLElement of Label
|
28
19
|
*/
|
29
20
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
size = _d === void 0 ? 'medium' : _d;
|
21
|
+
|
22
|
+
const useLabel_unstable = (props, ref) => {
|
23
|
+
const {
|
24
|
+
disabled = false,
|
25
|
+
required = false,
|
26
|
+
strong = false,
|
27
|
+
size = 'medium'
|
28
|
+
} = props;
|
39
29
|
return {
|
40
|
-
disabled
|
41
|
-
required: react_utilities_2.resolveShorthand(required ===
|
42
|
-
required: !!required,
|
30
|
+
disabled,
|
31
|
+
required: react_utilities_2.resolveShorthand(required === true ? '*' : required || undefined, {
|
43
32
|
defaultProps: {
|
44
|
-
|
33
|
+
'aria-hidden': 'true'
|
45
34
|
}
|
46
35
|
}),
|
47
|
-
strong
|
48
|
-
size
|
36
|
+
strong,
|
37
|
+
size,
|
49
38
|
components: {
|
50
39
|
root: 'label',
|
51
40
|
required: 'span'
|
52
41
|
},
|
53
|
-
root: react_utilities_1.getNativeElementProps('label',
|
54
|
-
ref
|
55
|
-
|
42
|
+
root: react_utilities_1.getNativeElementProps('label', {
|
43
|
+
ref,
|
44
|
+
...props
|
45
|
+
})
|
56
46
|
};
|
57
47
|
};
|
58
48
|
|
59
|
-
exports.
|
49
|
+
exports.useLabel_unstable = useLabel_unstable;
|
60
50
|
//# sourceMappingURL=useLabel.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["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","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, strong = false, size = 'medium' } = props;\n return {\n disabled,\n required: resolveShorthand(required === true ? '*' : required || undefined, {\n defaultProps: { 'aria-hidden': 'true' },\n }),\n strong,\n size,\n components: { root: 'label', required: 'span' },\n root: getNativeElementProps('label', { ref, ...props }),\n };\n};\n"],"sourceRoot":"../src/"}
|
@@ -1,5 +1,11 @@
|
|
1
|
-
import type { LabelState } from './Label.types';
|
1
|
+
import type { LabelSlots, LabelState } from './Label.types';
|
2
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
+
/**
|
4
|
+
* @deprecated Use `labelClassNames.root` instead.
|
5
|
+
*/
|
6
|
+
export declare const labelClassName = "fui-Label";
|
7
|
+
export declare const labelClassNames: SlotClassNames<LabelSlots>;
|
2
8
|
/**
|
3
9
|
* Apply styling to the Label slots based on the state
|
4
10
|
*/
|
5
|
-
export declare const
|
11
|
+
export declare const useLabelStyles_unstable: (state: LabelState) => LabelState;
|
@@ -3,15 +3,26 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useLabelStyles_unstable = exports.labelClassNames = exports.labelClassName = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
9
11
|
/**
|
10
|
-
*
|
12
|
+
* @deprecated Use `labelClassNames.root` instead.
|
11
13
|
*/
|
12
14
|
|
13
15
|
|
14
|
-
|
16
|
+
exports.labelClassName = 'fui-Label';
|
17
|
+
exports.labelClassNames = {
|
18
|
+
root: 'fui-Label',
|
19
|
+
required: 'fui-Label__required'
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* Styles for the label
|
23
|
+
*/
|
24
|
+
|
25
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
15
26
|
"root": {
|
16
27
|
"Bahqtrf": "fk6fouc",
|
17
28
|
"sj55zd": "f19n0e5"
|
@@ -23,6 +34,9 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
23
34
|
"sj55zd": "f1whyuy6",
|
24
35
|
"uwmqm3": ["fycuoez", "f8wuabp"]
|
25
36
|
},
|
37
|
+
"requiredDisabled": {
|
38
|
+
"sj55zd": "f1s2aq7o"
|
39
|
+
},
|
26
40
|
"small": {
|
27
41
|
"Be2twd7": "fy9rknc",
|
28
42
|
"Bg96gwp": "fwrc4pm"
|
@@ -47,16 +61,16 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
47
61
|
*/
|
48
62
|
|
49
63
|
|
50
|
-
|
51
|
-
|
52
|
-
state.root.className =
|
64
|
+
const useLabelStyles_unstable = state => {
|
65
|
+
const styles = useStyles();
|
66
|
+
state.root.className = react_1.mergeClasses(exports.labelClassNames.root, styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
|
53
67
|
|
54
68
|
if (state.required) {
|
55
|
-
state.required.className =
|
69
|
+
state.required.className = react_1.mergeClasses(exports.labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
|
56
70
|
}
|
57
71
|
|
58
72
|
return state;
|
59
73
|
};
|
60
74
|
|
61
|
-
exports.
|
75
|
+
exports.useLabelStyles_unstable = useLabelStyles_unstable;
|
62
76
|
//# sourceMappingURL=useLabelStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,GAAiB,WAAjB;AACA,OAAA,CAAA,eAAA,GAA8C;AACzD,EAAA,IAAI,EAAE,WADmD;AAEzD,EAAA,QAAQ,EAAE;AAF+C,CAA9C;AAKb;;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;AAAA;AAAA;AAAA,EAAlB;AAwCA;;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,eAAA,CAAgB,IADK,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,CACzB,OAAA,CAAA,eAAA,CAAgB,QADS,EAEzB,MAAM,CAAC,QAFkB,EAGzB,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,gBAHA,EAIzB,KAAK,CAAC,QAAN,CAAe,SAJU,CAA3B;AAMD;;AAED,SAAO,KAAP;AACD,CArBM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","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\n/**\n * @deprecated Use `labelClassNames.root` instead.\n */\nexport const labelClassName = 'fui-Label';\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 strong: {\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.strong && styles.strong,\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"],"sourceRoot":"../src/"}
|
package/lib-commonjs/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export {};
|
2
|
-
export
|
1
|
+
export { Label, labelClassName, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable, } from './Label';
|
2
|
+
export type { LabelProps, LabelSlots, LabelState } from './Label';
|
package/lib-commonjs/index.js
CHANGED
@@ -3,8 +3,45 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
+
exports.useLabel_unstable = exports.useLabelStyles_unstable = exports.renderLabel_unstable = exports.labelClassNames = exports.labelClassName = exports.Label = void 0;
|
6
7
|
|
7
|
-
var
|
8
|
+
var Label_1 = /*#__PURE__*/require("./Label");
|
8
9
|
|
9
|
-
|
10
|
+
Object.defineProperty(exports, "Label", {
|
11
|
+
enumerable: true,
|
12
|
+
get: function () {
|
13
|
+
return Label_1.Label;
|
14
|
+
}
|
15
|
+
}); // eslint-disable-next-line deprecation/deprecation
|
16
|
+
|
17
|
+
Object.defineProperty(exports, "labelClassName", {
|
18
|
+
enumerable: true,
|
19
|
+
get: function () {
|
20
|
+
return Label_1.labelClassName;
|
21
|
+
}
|
22
|
+
});
|
23
|
+
Object.defineProperty(exports, "labelClassNames", {
|
24
|
+
enumerable: true,
|
25
|
+
get: function () {
|
26
|
+
return Label_1.labelClassNames;
|
27
|
+
}
|
28
|
+
});
|
29
|
+
Object.defineProperty(exports, "renderLabel_unstable", {
|
30
|
+
enumerable: true,
|
31
|
+
get: function () {
|
32
|
+
return Label_1.renderLabel_unstable;
|
33
|
+
}
|
34
|
+
});
|
35
|
+
Object.defineProperty(exports, "useLabelStyles_unstable", {
|
36
|
+
enumerable: true,
|
37
|
+
get: function () {
|
38
|
+
return Label_1.useLabelStyles_unstable;
|
39
|
+
}
|
40
|
+
});
|
41
|
+
Object.defineProperty(exports, "useLabel_unstable", {
|
42
|
+
enumerable: true,
|
43
|
+
get: function () {
|
44
|
+
return Label_1.useLabel_unstable;
|
45
|
+
}
|
46
|
+
});
|
10
47
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":";;;;;;;AAAA,IAAA,OAAA,gBAAA,OAAA,CAAA,SAAA,CAAA;;AACE,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,OAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,KAAA;AAAK;AAAL,CAAA,E,CACA;;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,gBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,cAAA;AAAc;AAAd,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,iBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,eAAA;AAAe;AAAf,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,sBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,oBAAA;AAAoB;AAApB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,yBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,uBAAA;AAAuB;AAAvB,CAAA;AACA,MAAA,CAAA,cAAA,CAAA,OAAA,EAAA,mBAAA,EAAA;AAAA,EAAA,UAAA,EAAA,IAAA;AAAA,EAAA,GAAA,EAAA,YAAA;AAAA,WAAA,OAAA,CAAA,iBAAA;AAAiB;AAAjB,CAAA","sourcesContent":["export {\n Label,\n // eslint-disable-next-line deprecation/deprecation\n labelClassName,\n labelClassNames,\n renderLabel_unstable,\n useLabelStyles_unstable,\n useLabel_unstable,\n} from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "9.0.0-beta.
|
4
|
-
"description": "
|
3
|
+
"version": "9.0.0-beta.12",
|
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,32 +19,22 @@
|
|
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
|
25
|
-
"storybook": "
|
24
|
+
"build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/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": "9.0.0-beta.1",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-beta.1",
|
31
30
|
"@fluentui/react-conformance": "*",
|
32
|
-
"@fluentui/react-conformance-
|
33
|
-
"@fluentui/scripts": "^1.0.0"
|
34
|
-
"@types/enzyme": "3.10.3",
|
35
|
-
"@types/enzyme-adapter-react-16": "1.0.3",
|
36
|
-
"@types/react": "16.9.42",
|
37
|
-
"@types/react-dom": "16.9.10",
|
38
|
-
"@types/react-test-renderer": "^16.0.0",
|
39
|
-
"enzyme": "~3.10.0",
|
40
|
-
"enzyme-adapter-react-16": "^1.15.0",
|
41
|
-
"react": "16.8.6",
|
42
|
-
"react-dom": "16.8.6",
|
43
|
-
"react-test-renderer": "^16.3.0"
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.5",
|
32
|
+
"@fluentui/scripts": "^1.0.0"
|
44
33
|
},
|
45
34
|
"dependencies": {
|
46
|
-
"@fluentui/react-
|
47
|
-
"@fluentui/react-utilities": "9.0.0-
|
35
|
+
"@fluentui/react-theme": "9.0.0-rc.7",
|
36
|
+
"@fluentui/react-utilities": "9.0.0-rc.8",
|
37
|
+
"@griffel/react": "1.0.3",
|
48
38
|
"tslib": "^2.1.0"
|
49
39
|
},
|
50
40
|
"peerDependencies": {
|
@@ -54,11 +44,17 @@
|
|
54
44
|
"react-dom": ">=16.8.0 <18.0.0"
|
55
45
|
},
|
56
46
|
"beachball": {
|
57
|
-
"tag": "beta",
|
58
47
|
"disallowedChangeTypes": [
|
59
48
|
"major",
|
60
49
|
"minor",
|
61
50
|
"patch"
|
62
51
|
]
|
52
|
+
},
|
53
|
+
"exports": {
|
54
|
+
".": {
|
55
|
+
"types": "./lib/index.d.ts",
|
56
|
+
"import": "./lib/index.js",
|
57
|
+
"require": "./lib-commonjs/index.js"
|
58
|
+
}
|
63
59
|
}
|
64
60
|
}
|
@@ -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
|
-
var 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,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE;AAH+C,GAA7D;AAMA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.isConformant = void 0;
|
7
|
-
|
8
|
-
var react_conformance_1 = /*#__PURE__*/require("@fluentui/react-conformance");
|
9
|
-
|
10
|
-
var react_conformance_make_styles_1 = /*#__PURE__*/require("@fluentui/react-conformance-make-styles");
|
11
|
-
|
12
|
-
function isConformant(testInfo) {
|
13
|
-
var defaultOptions = {
|
14
|
-
asPropHandlesRef: true,
|
15
|
-
componentPath: module.parent.filename.replace('.test', ''),
|
16
|
-
extraTests: react_conformance_make_styles_1.default
|
17
|
-
};
|
18
|
-
react_conformance_1.isConformant(defaultOptions, testInfo);
|
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,IAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAEA,IAAA,+BAAA,gBAAA,OAAA,CAAA,yCAAA,CAAA;;AAEA,SAAgB,YAAhB,CACE,QADF,EAC2F;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE,+BAAA,CAAA;AAH+C,GAA7D;AAMA,EAAA,mBAAA,CAAA,YAAA,CAAiB,cAAjB,EAAiC,QAAjC;AACD;;AAVD,OAAA,CAAA,YAAA,GAAA,YAAA","sourceRoot":""}
|