@fluentui/react-label 9.0.0-nightly.d730088d7f.0 → 9.0.0-rc.3
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 +543 -18
- package/CHANGELOG.md +205 -61
- package/README.md +17 -3
- package/Spec.md +34 -40
- package/dist/index.d.ts +73 -0
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- 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.js.map +1 -1
- package/lib/components/Label/index.js.map +1 -1
- package/lib/components/Label/renderLabel.js +8 -8
- package/lib/components/Label/renderLabel.js.map +1 -1
- package/lib/components/Label/useLabel.js +18 -27
- package/lib/components/Label/useLabel.js.map +1 -1
- package/lib/components/Label/useLabelStyles.js +14 -6
- package/lib/components/Label/useLabelStyles.js.map +1 -1
- package/lib/index.js +1 -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.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.js +12 -14
- package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
- 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.js +18 -9
- package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
- package/lib-commonjs/index.js +32 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +19 -23
- package/dist/react-label.d.ts +0 -80
- package/lib/Label.d.ts +0 -1
- 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/components/Label/Label.d.ts +0 -6
- package/lib/components/Label/Label.types.d.ts +0 -38
- package/lib/components/Label/index.d.ts +0 -5
- package/lib/components/Label/renderLabel.d.ts +0 -5
- package/lib/components/Label/useLabel.d.ts +0 -17
- package/lib/components/Label/useLabelStyles.d.ts +0 -5
- package/lib/index.d.ts +0 -2
- package/lib-commonjs/Label.d.ts +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/lib-commonjs/components/Label/Label.d.ts +0 -6
- package/lib-commonjs/components/Label/Label.types.d.ts +0 -38
- package/lib-commonjs/components/Label/index.d.ts +0 -5
- package/lib-commonjs/components/Label/renderLabel.d.ts +0 -5
- package/lib-commonjs/components/Label/useLabel.d.ts +0 -17
- package/lib-commonjs/components/Label/useLabelStyles.d.ts +0 -5
- package/lib-commonjs/index.d.ts +0 -2
@@ -3,15 +3,21 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.useLabelStyles_unstable = exports.labelClassNames = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
+
|
10
|
+
const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
|
11
|
+
|
12
|
+
exports.labelClassNames = {
|
13
|
+
root: 'fui-Label',
|
14
|
+
required: 'fui-Label__required'
|
15
|
+
};
|
9
16
|
/**
|
10
17
|
* Styles for the label
|
11
18
|
*/
|
12
19
|
|
13
|
-
|
14
|
-
var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
20
|
+
const useStyles = /*#__PURE__*/react_1.__styles({
|
15
21
|
"root": {
|
16
22
|
"Bahqtrf": "fk6fouc",
|
17
23
|
"sj55zd": "f19n0e5"
|
@@ -23,6 +29,9 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
23
29
|
"sj55zd": "f1whyuy6",
|
24
30
|
"uwmqm3": ["fycuoez", "f8wuabp"]
|
25
31
|
},
|
32
|
+
"requiredDisabled": {
|
33
|
+
"sj55zd": "f1s2aq7o"
|
34
|
+
},
|
26
35
|
"small": {
|
27
36
|
"Be2twd7": "fy9rknc",
|
28
37
|
"Bg96gwp": "fwrc4pm"
|
@@ -47,16 +56,16 @@ var useStyles = /*#__PURE__*/react_make_styles_1.__styles({
|
|
47
56
|
*/
|
48
57
|
|
49
58
|
|
50
|
-
|
51
|
-
|
52
|
-
state.root.className =
|
59
|
+
const useLabelStyles_unstable = state => {
|
60
|
+
const styles = useStyles();
|
61
|
+
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
62
|
|
54
63
|
if (state.required) {
|
55
|
-
state.required.className =
|
64
|
+
state.required.className = react_1.mergeClasses(exports.labelClassNames.required, styles.required, state.disabled && styles.requiredDisabled, state.required.className);
|
56
65
|
}
|
57
66
|
|
58
67
|
return state;
|
59
68
|
};
|
60
69
|
|
61
|
-
exports.
|
70
|
+
exports.useLabelStyles_unstable = useLabelStyles_unstable;
|
62
71
|
//# 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,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\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.js
CHANGED
@@ -3,8 +3,38 @@
|
|
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.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
|
+
});
|
16
|
+
Object.defineProperty(exports, "labelClassNames", {
|
17
|
+
enumerable: true,
|
18
|
+
get: function () {
|
19
|
+
return Label_1.labelClassNames;
|
20
|
+
}
|
21
|
+
});
|
22
|
+
Object.defineProperty(exports, "renderLabel_unstable", {
|
23
|
+
enumerable: true,
|
24
|
+
get: function () {
|
25
|
+
return Label_1.renderLabel_unstable;
|
26
|
+
}
|
27
|
+
});
|
28
|
+
Object.defineProperty(exports, "useLabelStyles_unstable", {
|
29
|
+
enumerable: true,
|
30
|
+
get: function () {
|
31
|
+
return Label_1.useLabelStyles_unstable;
|
32
|
+
}
|
33
|
+
});
|
34
|
+
Object.defineProperty(exports, "useLabel_unstable", {
|
35
|
+
enumerable: true,
|
36
|
+
get: function () {
|
37
|
+
return Label_1.useLabel_unstable;
|
38
|
+
}
|
39
|
+
});
|
10
40
|
//# 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;;AAAS,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;AAAO,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;AAAiB,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;AAAsB,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;AAAyB,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 { Label, labelClassNames, renderLabel_unstable, useLabelStyles_unstable, useLabel_unstable } from './Label';\nexport type { LabelProps, LabelSlots, LabelState } from './Label';\n"],"sourceRoot":"../src/"}
|
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-label",
|
3
|
-
"version": "9.0.0-
|
4
|
-
"description": "
|
3
|
+
"version": "9.0.0-rc.3",
|
4
|
+
"description": "Fluent UI React Label component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -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-nightly.d730088d7f.0",
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
|
-
"@fluentui/jest-serializer-make-styles": "9.0.0-nightly.d730088d7f.0",
|
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.7",
|
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.9",
|
36
|
+
"@fluentui/react-utilities": "9.0.0-rc.9",
|
37
|
+
"@griffel/react": "1.0.5",
|
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
|
}
|
package/dist/react-label.d.ts
DELETED
@@ -1,80 +0,0 @@
|
|
1
|
-
import type { ComponentProps } from '@fluentui/react-utilities';
|
2
|
-
import type { ComponentState } from '@fluentui/react-utilities';
|
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
|
-
import * as React_2 from 'react';
|
7
|
-
|
8
|
-
/**
|
9
|
-
* A label component provides a title or name to a component.
|
10
|
-
*/
|
11
|
-
export declare const Label: ForwardRefComponent<LabelProps>;
|
12
|
-
|
13
|
-
/**
|
14
|
-
* Label Props
|
15
|
-
*/
|
16
|
-
export declare type LabelCommons = {
|
17
|
-
/**
|
18
|
-
* Renders the label as disabled
|
19
|
-
* @defaultvalue false
|
20
|
-
*/
|
21
|
-
disabled: boolean;
|
22
|
-
/**
|
23
|
-
* A label supports different sizes.
|
24
|
-
* @defaultvalue 'medium'
|
25
|
-
*/
|
26
|
-
size: 'small' | 'medium' | 'large';
|
27
|
-
/**
|
28
|
-
* A label supports semibold/strong fontweight.
|
29
|
-
* @defaultvalue false
|
30
|
-
*/
|
31
|
-
strong: boolean;
|
32
|
-
};
|
33
|
-
|
34
|
-
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
35
|
-
/**
|
36
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
37
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
38
|
-
* @defaultvalue false
|
39
|
-
*/
|
40
|
-
required?: boolean | ObjectShorthandProps<React_2.HTMLAttributes<HTMLElement>> | React_2.ReactNode;
|
41
|
-
};
|
42
|
-
|
43
|
-
/**
|
44
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
45
|
-
* {@docCatergory Label}
|
46
|
-
*/
|
47
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
48
|
-
|
49
|
-
export declare type LabelSlots = {
|
50
|
-
root: IntrinsicShorthandProps<'label'>;
|
51
|
-
required?: IntrinsicShorthandProps<'span'>;
|
52
|
-
};
|
53
|
-
|
54
|
-
/**
|
55
|
-
* State used in rendering Label
|
56
|
-
*/
|
57
|
-
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Render the final JSX of Label
|
61
|
-
*/
|
62
|
-
export declare const renderLabel: (state: LabelState) => JSX.Element;
|
63
|
-
|
64
|
-
/**
|
65
|
-
* Create the state required to render Label.
|
66
|
-
*
|
67
|
-
* The returned state can be modified with hooks such as useLabelStyles,
|
68
|
-
* before being passed to renderLabel.
|
69
|
-
*
|
70
|
-
* @param props - props from this instance of Label
|
71
|
-
* @param ref - reference to root HTMLElement of Label
|
72
|
-
*/
|
73
|
-
export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState;
|
74
|
-
|
75
|
-
/**
|
76
|
-
* Apply styling to the Label slots based on the state
|
77
|
-
*/
|
78
|
-
export declare const useLabelStyles: (state: LabelState) => LabelState;
|
79
|
-
|
80
|
-
export { }
|
package/lib/Label.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Label/index';
|
@@ -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,38 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
import * as React from 'react';
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
|
-
export declare type LabelCommons = {
|
7
|
-
/**
|
8
|
-
* Renders the label as disabled
|
9
|
-
* @defaultvalue false
|
10
|
-
*/
|
11
|
-
disabled: boolean;
|
12
|
-
/**
|
13
|
-
* A label supports different sizes.
|
14
|
-
* @defaultvalue 'medium'
|
15
|
-
*/
|
16
|
-
size: 'small' | 'medium' | 'large';
|
17
|
-
/**
|
18
|
-
* A label supports semibold/strong fontweight.
|
19
|
-
* @defaultvalue false
|
20
|
-
*/
|
21
|
-
strong: boolean;
|
22
|
-
};
|
23
|
-
export declare type LabelSlots = {
|
24
|
-
root: IntrinsicShorthandProps<'label'>;
|
25
|
-
required?: IntrinsicShorthandProps<'span'>;
|
26
|
-
};
|
27
|
-
/**
|
28
|
-
* State used in rendering Label
|
29
|
-
*/
|
30
|
-
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
31
|
-
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
|
-
/**
|
33
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
34
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
35
|
-
* @defaultvalue false
|
36
|
-
*/
|
37
|
-
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
38
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { LabelProps, LabelSlots, LabelState } from './Label.types';
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
5
|
-
* {@docCatergory Label}
|
6
|
-
*/
|
7
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
8
|
-
/**
|
9
|
-
* Create the state required to render Label.
|
10
|
-
*
|
11
|
-
* The returned state can be modified with hooks such as useLabelStyles,
|
12
|
-
* before being passed to renderLabel.
|
13
|
-
*
|
14
|
-
* @param props - props from this instance of Label
|
15
|
-
* @param ref - reference to root HTMLElement of Label
|
16
|
-
*/
|
17
|
-
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
package/lib/index.d.ts
DELETED
package/lib-commonjs/Label.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Label/index';
|
@@ -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":""}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
|
2
|
-
import * as React from 'react';
|
3
|
-
/**
|
4
|
-
* Label Props
|
5
|
-
*/
|
6
|
-
export declare type LabelCommons = {
|
7
|
-
/**
|
8
|
-
* Renders the label as disabled
|
9
|
-
* @defaultvalue false
|
10
|
-
*/
|
11
|
-
disabled: boolean;
|
12
|
-
/**
|
13
|
-
* A label supports different sizes.
|
14
|
-
* @defaultvalue 'medium'
|
15
|
-
*/
|
16
|
-
size: 'small' | 'medium' | 'large';
|
17
|
-
/**
|
18
|
-
* A label supports semibold/strong fontweight.
|
19
|
-
* @defaultvalue false
|
20
|
-
*/
|
21
|
-
strong: boolean;
|
22
|
-
};
|
23
|
-
export declare type LabelSlots = {
|
24
|
-
root: IntrinsicShorthandProps<'label'>;
|
25
|
-
required?: IntrinsicShorthandProps<'span'>;
|
26
|
-
};
|
27
|
-
/**
|
28
|
-
* State used in rendering Label
|
29
|
-
*/
|
30
|
-
export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
|
31
|
-
export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
|
32
|
-
/**
|
33
|
-
* Displays and indicator that the label is for a required field. The required prop can be set to true to display
|
34
|
-
* an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
|
35
|
-
* @defaultvalue false
|
36
|
-
*/
|
37
|
-
required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
|
38
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { LabelProps, LabelSlots, LabelState } from './Label.types';
|
3
|
-
/**
|
4
|
-
* Array of all shorthand properties listed in LabelShorthandProps
|
5
|
-
* {@docCatergory Label}
|
6
|
-
*/
|
7
|
-
export declare const labelShorthandProps: Array<keyof LabelSlots>;
|
8
|
-
/**
|
9
|
-
* Create the state required to render Label.
|
10
|
-
*
|
11
|
-
* The returned state can be modified with hooks such as useLabelStyles,
|
12
|
-
* before being passed to renderLabel.
|
13
|
-
*
|
14
|
-
* @param props - props from this instance of Label
|
15
|
-
* @param ref - reference to root HTMLElement of Label
|
16
|
-
*/
|
17
|
-
export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
|
package/lib-commonjs/index.d.ts
DELETED