@fluentui/react-label 9.0.0-alpha.9 → 9.0.0-nightly.46b9ea7036.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. package/CHANGELOG.json +1244 -1
  2. package/CHANGELOG.md +458 -2
  3. package/Spec.md +28 -31
  4. package/dist/react-label.d.ts +27 -46
  5. package/lib/Label.js.map +1 -1
  6. package/lib/common/isConformant.d.ts +1 -1
  7. package/lib/common/isConformant.js +7 -5
  8. package/lib/common/isConformant.js.map +1 -1
  9. package/lib/components/Label/Label.d.ts +3 -4
  10. package/lib/components/Label/Label.js +5 -5
  11. package/lib/components/Label/Label.js.map +1 -1
  12. package/lib/components/Label/Label.types.d.ts +17 -32
  13. package/lib/components/Label/Label.types.js.map +1 -1
  14. package/lib/components/Label/index.js.map +1 -1
  15. package/lib/components/Label/renderLabel.d.ts +1 -2
  16. package/lib/components/Label/renderLabel.js +6 -5
  17. package/lib/components/Label/renderLabel.js.map +1 -1
  18. package/lib/components/Label/useLabel.d.ts +3 -6
  19. package/lib/components/Label/useLabel.js +32 -35
  20. package/lib/components/Label/useLabel.js.map +1 -1
  21. package/lib/components/Label/useLabelStyles.d.ts +1 -1
  22. package/lib/components/Label/useLabelStyles.js +42 -34
  23. package/lib/components/Label/useLabelStyles.js.map +1 -1
  24. package/lib/index.js.map +1 -1
  25. package/lib/tsdoc-metadata.json +1 -1
  26. package/lib-commonjs/Label.js +7 -2
  27. package/lib-commonjs/Label.js.map +1 -1
  28. package/lib-commonjs/common/isConformant.d.ts +1 -1
  29. package/lib-commonjs/common/isConformant.js +16 -7
  30. package/lib-commonjs/common/isConformant.js.map +1 -1
  31. package/lib-commonjs/components/Label/Label.d.ts +3 -4
  32. package/lib-commonjs/components/Label/Label.js +18 -10
  33. package/lib-commonjs/components/Label/Label.js.map +1 -1
  34. package/lib-commonjs/components/Label/Label.types.d.ts +17 -32
  35. package/lib-commonjs/components/Label/Label.types.js +4 -1
  36. package/lib-commonjs/components/Label/Label.types.js.map +1 -1
  37. package/lib-commonjs/components/Label/index.js +11 -2
  38. package/lib-commonjs/components/Label/index.js.map +1 -1
  39. package/lib-commonjs/components/Label/renderLabel.d.ts +1 -2
  40. package/lib-commonjs/components/Label/renderLabel.js +20 -10
  41. package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
  42. package/lib-commonjs/components/Label/useLabel.d.ts +3 -6
  43. package/lib-commonjs/components/Label/useLabel.js +42 -37
  44. package/lib-commonjs/components/Label/useLabel.js.map +1 -1
  45. package/lib-commonjs/components/Label/useLabelStyles.d.ts +1 -1
  46. package/lib-commonjs/components/Label/useLabelStyles.js +49 -35
  47. package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
  48. package/lib-commonjs/index.js +7 -2
  49. package/lib-commonjs/index.js.map +1 -1
  50. package/package.json +15 -11
  51. package/config/api-extractor.json +0 -3
  52. package/config/tests.js +0 -7
  53. package/etc/react-label.api.md +0 -51
  54. package/just.config.ts +0 -3
  55. package/lib-amd/Label.d.ts +0 -1
  56. package/lib-amd/Label.js +0 -6
  57. package/lib-amd/Label.js.map +0 -1
  58. package/lib-amd/common/isConformant.d.ts +0 -4
  59. package/lib-amd/common/isConformant.js +0 -14
  60. package/lib-amd/common/isConformant.js.map +0 -1
  61. package/lib-amd/components/Label/Label.d.ts +0 -7
  62. package/lib-amd/components/Label/Label.js +0 -16
  63. package/lib-amd/components/Label/Label.js.map +0 -1
  64. package/lib-amd/components/Label/Label.types.d.ts +0 -53
  65. package/lib-amd/components/Label/Label.types.js +0 -5
  66. package/lib-amd/components/Label/Label.types.js.map +0 -1
  67. package/lib-amd/components/Label/index.d.ts +0 -5
  68. package/lib-amd/components/Label/index.js +0 -10
  69. package/lib-amd/components/Label/index.js.map +0 -1
  70. package/lib-amd/components/Label/renderLabel.d.ts +0 -6
  71. package/lib-amd/components/Label/renderLabel.js +0 -17
  72. package/lib-amd/components/Label/renderLabel.js.map +0 -1
  73. package/lib-amd/components/Label/useLabel.d.ts +0 -20
  74. package/lib-amd/components/Label/useLabel.js +0 -55
  75. package/lib-amd/components/Label/useLabel.js.map +0 -1
  76. package/lib-amd/components/Label/useLabelStyles.d.ts +0 -5
  77. package/lib-amd/components/Label/useLabelStyles.js +0 -49
  78. package/lib-amd/components/Label/useLabelStyles.js.map +0 -1
  79. package/lib-amd/index.d.ts +0 -2
  80. package/lib-amd/index.js +0 -6
  81. package/lib-amd/index.js.map +0 -1
  82. package/src/components/Label/Label.types.ts +0 -61
@@ -1,79 +1,63 @@
1
- import { ComponentProps } from '@fluentui/react-utilities';
2
- import { ComponentState } from '@fluentui/react-utilities';
3
- import { ObjectShorthandProps } from '@fluentui/react-utilities';
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';
4
6
  import * as React_2 from 'react';
5
- import { ShorthandProps } from '@fluentui/react-utilities';
6
7
 
7
8
  /**
8
9
  * A label component provides a title or name to a component.
9
- * {@docCategory Label}
10
10
  */
11
- export declare const Label: React_2.ForwardRefExoticComponent<LabelProps & React_2.RefAttributes<HTMLElement>>;
12
-
13
- /**
14
- * Names of LabelProps that have a default value in useLabel
15
- * {@docCategory Label}
16
- */
17
- export declare type LabelDefaultedProps = 'size';
11
+ export declare const Label: ForwardRefComponent<LabelProps>;
18
12
 
19
13
  /**
20
14
  * Label Props
21
- * {@docCategory Label}
22
15
  */
23
- export declare interface LabelProps extends ComponentProps, React_2.LabelHTMLAttributes<HTMLLabelElement> {
16
+ export declare type LabelCommons = {
24
17
  /**
25
18
  * Renders the label as disabled
26
19
  * @defaultvalue false
27
20
  */
28
- disabled?: boolean;
29
- /**
30
- * Displays and indicator that the label is for a required field. The required prop can be set to true to display
31
- * an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
32
- * @defaultvalue false
33
- */
34
- required?: boolean | ShorthandProps<ComponentProps>;
21
+ disabled: boolean;
35
22
  /**
36
23
  * A label supports different sizes.
37
24
  * @defaultvalue 'medium'
38
25
  */
39
- size?: 'small' | 'medium' | 'large';
26
+ size: 'small' | 'medium' | 'large';
40
27
  /**
41
28
  * A label supports semibold/strong fontweight.
42
29
  * @defaultvalue false
43
30
  */
44
- strong?: boolean;
45
- }
31
+ strong: boolean;
32
+ };
46
33
 
47
- /**
48
- * Names of the shorthand properties in LabelProps
49
- * {@docCategory Label}
50
- */
51
- export declare type LabelShorthandProps = 'required';
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
+ };
52
42
 
53
43
  /**
54
44
  * Array of all shorthand properties listed in LabelShorthandProps
55
45
  * {@docCatergory Label}
56
46
  */
57
- export declare const labelShorthandProps: LabelShorthandProps[];
47
+ export declare const labelShorthandProps: Array<keyof LabelSlots>;
48
+
49
+ export declare type LabelSlots = {
50
+ root: IntrinsicShorthandProps<'label'>;
51
+ required?: IntrinsicShorthandProps<'span'>;
52
+ };
58
53
 
59
54
  /**
60
55
  * State used in rendering Label
61
- * {@docCategory Label}
62
56
  */
63
- export declare interface LabelState extends ComponentState<LabelProps, LabelShorthandProps, LabelDefaultedProps> {
64
- /**
65
- * Ref to the root element
66
- */
67
- ref: React_2.Ref<HTMLElement>;
68
- /**
69
- * The required prop resolved to a slot object
70
- */
71
- required?: ObjectShorthandProps<ComponentProps>;
72
- }
57
+ export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
73
58
 
74
59
  /**
75
60
  * Render the final JSX of Label
76
- * {@docCategory Label}
77
61
  */
78
62
  export declare const renderLabel: (state: LabelState) => JSX.Element;
79
63
 
@@ -85,11 +69,8 @@ export declare const renderLabel: (state: LabelState) => JSX.Element;
85
69
  *
86
70
  * @param props - props from this instance of Label
87
71
  * @param ref - reference to root HTMLElement of Label
88
- * @param defaultProps - (optional) default prop values provided by the implementing type
89
- *
90
- * {@docCategory Label}
91
72
  */
92
- export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement>, defaultProps?: LabelProps | undefined) => LabelState;
73
+ export declare const useLabel: (props: LabelProps, ref: React_2.Ref<HTMLElement>) => LabelState;
93
74
 
94
75
  /**
95
76
  * Apply styling to the Label slots based on the state
package/lib/Label.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["Label.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC","sourcesContent":["export * from './components/Label/index';\n"]}
1
+ {"version":3,"file":"Label.js","sourceRoot":"","sources":["../src/Label.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
1
+ import type { IsConformantOptions } from '@fluentui/react-conformance';
2
2
  export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
3
  componentPath?: string;
4
4
  }): void;
@@ -1,9 +1,11 @@
1
1
  import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
2
+ import makeStylesTests from '@fluentui/react-conformance-make-styles';
2
3
  export function isConformant(testInfo) {
3
- var defaultOptions = {
4
- asPropHandlesRef: true,
5
- componentPath: module.parent.filename.replace('.test', ''),
6
- };
7
- baseIsConformant(defaultOptions, testInfo);
4
+ var defaultOptions = {
5
+ asPropHandlesRef: true,
6
+ componentPath: module.parent.filename.replace('.test', ''),
7
+ extraTests: makeStylesTests
8
+ };
9
+ baseIsConformant(defaultOptions, testInfo);
8
10
  }
9
11
  //# sourceMappingURL=isConformant.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isConformant.js","sourceRoot":"../src/","sources":["common/isConformant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAuB,MAAM,6BAA6B,CAAC;AAEpG,MAAM,UAAU,YAAY,CAC1B,QAAyF;IAEzF,IAAM,cAAc,GAAyC;QAC3D,gBAAgB,EAAE,IAAI;QACtB,aAAa,EAAE,MAAO,CAAC,MAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;KAC7D,CAAC;IAEF,gBAAgB,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { isConformant as baseIsConformant, IsConformantOptions } from '@fluentui/react-conformance';\n\nexport function isConformant<TProps = {}>(\n testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },\n) {\n const defaultOptions: Partial<IsConformantOptions<TProps>> = {\n asPropHandlesRef: true,\n componentPath: module!.parent!.filename.replace('.test', ''),\n };\n\n baseIsConformant(defaultOptions, testInfo);\n}\n"]}
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,7 +1,6 @@
1
- import * as React from 'react';
2
- import { LabelProps } from './Label.types';
1
+ import type { LabelProps } from './Label.types';
2
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * A label component provides a title or name to a component.
5
- * {@docCategory Label}
6
5
  */
7
- export declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLElement>>;
6
+ export declare const Label: ForwardRefComponent<LabelProps>;
@@ -4,12 +4,12 @@ import { renderLabel } from './renderLabel';
4
4
  import { useLabelStyles } from './useLabelStyles';
5
5
  /**
6
6
  * A label component provides a title or name to a component.
7
- * {@docCategory Label}
8
7
  */
9
- export var Label = React.forwardRef(function (props, ref) {
10
- var state = useLabel(props, ref);
11
- useLabelStyles(state);
12
- return renderLabel(state);
8
+
9
+ export var Label = /*#__PURE__*/React.forwardRef(function (props, ref) {
10
+ var state = useLabel(props, ref);
11
+ useLabelStyles(state);
12
+ return renderLabel(state);
13
13
  });
14
14
  Label.displayName = 'Label';
15
15
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,CAAC,IAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CAA0B,UAAC,KAAK,EAAE,GAAG;IACxE,IAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAEnC,cAAc,CAAC,KAAK,CAAC,CAAC;IACtB,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC,CAAC,CAAC;AAEH,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC","sourcesContent":["import * as React from 'react';\nimport { useLabel } from './useLabel';\nimport { LabelProps } from './Label.types';\nimport { renderLabel } from './renderLabel';\nimport { useLabelStyles } from './useLabelStyles';\n\n/**\n * A label component provides a title or name to a component.\n * {@docCategory Label}\n */\nexport const Label = React.forwardRef<HTMLElement, LabelProps>((props, ref) => {\n const state = useLabel(props, ref);\n\n useLabelStyles(state);\n return renderLabel(state);\n});\n\nLabel.displayName = 'Label';\n"]}
1
+ {"version":3,"sources":["../../../src/components/Label/Label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,YAAzB;AACA,SAAS,WAAT,QAA4B,eAA5B;AACA,SAAS,cAAT,QAA+B,kBAA/B;AAIA;;AAEG;;AACH,OAAO,IAAM,KAAK,gBAAoC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AAChF,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAD,EAAQ,GAAR,CAAtB;AAEA,EAAA,cAAc,CAAC,KAAD,CAAd;AACA,SAAO,WAAW,CAAC,KAAD,CAAlB;AACD,CALqD,CAA/C;AAOP,KAAK,CAAC,WAAN,GAAoB,OAApB","sourceRoot":""}
@@ -1,53 +1,38 @@
1
+ import type { ComponentProps, ComponentState, IntrinsicShorthandProps, ObjectShorthandProps } from '@fluentui/react-utilities';
1
2
  import * as React from 'react';
2
- import { ComponentProps, ComponentState, ObjectShorthandProps, ShorthandProps } from '@fluentui/react-utilities';
3
3
  /**
4
4
  * Label Props
5
- * {@docCategory Label}
6
5
  */
7
- export interface LabelProps extends ComponentProps, React.LabelHTMLAttributes<HTMLLabelElement> {
6
+ export declare type LabelCommons = {
8
7
  /**
9
8
  * Renders the label as disabled
10
9
  * @defaultvalue false
11
10
  */
12
- disabled?: boolean;
13
- /**
14
- * Displays and indicator that the label is for a required field. The required prop can be set to true to display
15
- * an asterisk (*). Or it can be set to a string or jsx content to display a different indicator.
16
- * @defaultvalue false
17
- */
18
- required?: boolean | ShorthandProps<ComponentProps>;
11
+ disabled: boolean;
19
12
  /**
20
13
  * A label supports different sizes.
21
14
  * @defaultvalue 'medium'
22
15
  */
23
- size?: 'small' | 'medium' | 'large';
16
+ size: 'small' | 'medium' | 'large';
24
17
  /**
25
18
  * A label supports semibold/strong fontweight.
26
19
  * @defaultvalue false
27
20
  */
28
- strong?: boolean;
29
- }
30
- /**
31
- * Names of the shorthand properties in LabelProps
32
- * {@docCategory Label}
33
- */
34
- export declare type LabelShorthandProps = 'required';
35
- /**
36
- * Names of LabelProps that have a default value in useLabel
37
- * {@docCategory Label}
38
- */
39
- export declare type LabelDefaultedProps = 'size';
21
+ strong: boolean;
22
+ };
23
+ export declare type LabelSlots = {
24
+ root: IntrinsicShorthandProps<'label'>;
25
+ required?: IntrinsicShorthandProps<'span'>;
26
+ };
40
27
  /**
41
28
  * State used in rendering Label
42
- * {@docCategory Label}
43
29
  */
44
- export interface LabelState extends ComponentState<LabelProps, LabelShorthandProps, LabelDefaultedProps> {
45
- /**
46
- * Ref to the root element
47
- */
48
- ref: React.Ref<HTMLElement>;
30
+ export declare type LabelState = ComponentState<LabelSlots> & LabelCommons;
31
+ export declare type LabelProps = Omit<ComponentProps<LabelSlots>, 'required'> & Partial<LabelCommons> & {
49
32
  /**
50
- * The required prop resolved to a slot object
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
51
36
  */
52
- required?: ObjectShorthandProps<ComponentProps>;
53
- }
37
+ required?: boolean | ObjectShorthandProps<React.HTMLAttributes<HTMLElement>> | React.ReactNode;
38
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Label.types.js","sourceRoot":"../src/","sources":["components/Label/Label.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { ComponentProps, ComponentState, ObjectShorthandProps, ShorthandProps } from '@fluentui/react-utilities';\n\n/**\n * Label Props\n * {@docCategory Label}\n */\nexport interface LabelProps extends ComponentProps, React.LabelHTMLAttributes<HTMLLabelElement> {\n /**\n * Renders the label as disabled\n * @defaultvalue false\n */\n disabled?: boolean;\n\n /**\n * Displays and 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 * @defaultvalue false\n */\n required?: boolean | ShorthandProps<ComponentProps>;\n\n /**\n * A label supports different sizes.\n * @defaultvalue 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * A label supports semibold/strong fontweight.\n * @defaultvalue false\n */\n strong?: boolean;\n}\n\n/**\n * Names of the shorthand properties in LabelProps\n * {@docCategory Label}\n */\nexport type LabelShorthandProps = 'required';\n\n/**\n * Names of LabelProps that have a default value in useLabel\n * {@docCategory Label}\n */\nexport type LabelDefaultedProps = 'size';\n\n/**\n * State used in rendering Label\n * {@docCategory Label}\n */\nexport interface LabelState extends ComponentState<LabelProps, LabelShorthandProps, LabelDefaultedProps> {\n /**\n * Ref to the root element\n */\n ref: React.Ref<HTMLElement>;\n\n /**\n * The required prop resolved to a slot object\n */\n required?: ObjectShorthandProps<ComponentProps>;\n}\n"]}
1
+ {"version":3,"file":"Label.types.js","sourceRoot":"","sources":["../../../src/components/Label/Label.types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Label/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC","sourcesContent":["export * from './Label';\nexport * from './Label.types';\nexport * from './renderLabel';\nexport * from './useLabel';\nexport * from './useLabelStyles';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Label/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -1,6 +1,5 @@
1
- import { LabelState } from './Label.types';
1
+ import type { LabelState } from './Label.types';
2
2
  /**
3
3
  * Render the final JSX of Label
4
- * {@docCategory Label}
5
4
  */
6
5
  export declare const renderLabel: (state: LabelState) => JSX.Element;
@@ -4,12 +4,13 @@ import { getSlots } from '@fluentui/react-utilities';
4
4
  import { labelShorthandProps } from './useLabel';
5
5
  /**
6
6
  * Render the final JSX of Label
7
- * {@docCategory Label}
8
7
  */
8
+
9
9
  export var renderLabel = function (state) {
10
- var _a = getSlots(state, labelShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
11
- return (React.createElement(slots.root, __assign({}, slotProps.root),
12
- state.children,
13
- state.required && React.createElement(slots.required, __assign({}, slotProps.required))));
10
+ var _a = getSlots(state, labelShorthandProps),
11
+ slots = _a.slots,
12
+ slotProps = _a.slotProps;
13
+
14
+ return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), state.root.children, /*#__PURE__*/React.createElement(slots.required, __assign({}, slotProps.required)));
14
15
  };
15
16
  //# sourceMappingURL=renderLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderLabel.js","sourceRoot":"../src/","sources":["components/Label/renderLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD;;;GAGG;AACH,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,KAAiB;IACrC,IAAA,KAAuB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC,EAAzD,KAAK,WAAA,EAAE,SAAS,eAAyC,CAAC;IAElE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,eAAK,SAAS,CAAC,IAAI;QAC3B,KAAK,CAAC,QAAQ;QACd,KAAK,CAAC,QAAQ,IAAI,oBAAC,KAAK,CAAC,QAAQ,eAAK,SAAS,CAAC,QAAQ,EAAI,CAClD,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { LabelState } from './Label.types';\nimport { labelShorthandProps } from './useLabel';\n\n/**\n * Render the final JSX of Label\n * {@docCategory Label}\n */\nexport const renderLabel = (state: LabelState) => {\n const { slots, slotProps } = getSlots(state, labelShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {state.children}\n {state.required && <slots.required {...slotProps.required} />}\n </slots.root>\n );\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Label/renderLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AACA,SAAS,mBAAT,QAAoC,YAApC;AAGA;;AAEG;;AACH,OAAO,IAAM,WAAW,GAAG,UAAC,KAAD,EAAkB;AACrC,MAAA,EAAA,GAAuB,QAAQ,CAAa,KAAb,EAAoB,mBAApB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AAEN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,KAAK,CAAC,IAAN,CAAW,QADd,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,QAAP,EAAe,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,QAAf,CAAf,CAFF,CADF;AAMD,CATM","sourceRoot":""}
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import { LabelProps, LabelShorthandProps, LabelState } from './Label.types';
2
+ import type { LabelProps, LabelSlots, LabelState } from './Label.types';
3
3
  /**
4
4
  * Array of all shorthand properties listed in LabelShorthandProps
5
5
  * {@docCatergory Label}
6
6
  */
7
- export declare const labelShorthandProps: LabelShorthandProps[];
7
+ export declare const labelShorthandProps: Array<keyof LabelSlots>;
8
8
  /**
9
9
  * Create the state required to render Label.
10
10
  *
@@ -13,8 +13,5 @@ export declare const labelShorthandProps: LabelShorthandProps[];
13
13
  *
14
14
  * @param props - props from this instance of Label
15
15
  * @param ref - reference to root HTMLElement of Label
16
- * @param defaultProps - (optional) default prop values provided by the implementing type
17
- *
18
- * {@docCategory Label}
19
16
  */
20
- export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>, defaultProps?: LabelProps | undefined) => LabelState;
17
+ export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>) => LabelState;
@@ -1,11 +1,12 @@
1
1
  import { __assign } from "tslib";
2
- import { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';
2
+ import { getNativeElementProps } from '@fluentui/react-utilities';
3
+ import { resolveShorthand } from '@fluentui/react-utilities';
3
4
  /**
4
5
  * Array of all shorthand properties listed in LabelShorthandProps
5
6
  * {@docCatergory Label}
6
7
  */
7
- export var labelShorthandProps = ['required'];
8
- var mergeProps = makeMergeProps({ deepMerge: labelShorthandProps });
8
+
9
+ export var labelShorthandProps = ['root', 'required'];
9
10
  /**
10
11
  * Create the state required to render Label.
11
12
  *
@@ -14,38 +15,34 @@ var mergeProps = makeMergeProps({ deepMerge: labelShorthandProps });
14
15
  *
15
16
  * @param props - props from this instance of Label
16
17
  * @param ref - reference to root HTMLElement of Label
17
- * @param defaultProps - (optional) default prop values provided by the implementing type
18
- *
19
- * {@docCategory Label}
20
- */
21
- export var useLabel = function (props, ref, defaultProps) {
22
- var state = mergeProps({
23
- ref: ref,
24
- as: 'label',
25
- size: 'medium',
26
- required: {
27
- as: 'span',
28
- },
29
- }, defaultProps && resolveLabelShorthandProps(defaultProps), resolveLabelShorthandProps(props));
30
- return state;
31
- };
32
- /**
33
- * Label will first need to check if required is a boolean or shorthandprops,
34
- * this allows for the required prop to handle both the default asterisk for required
35
- * or a custom required text.
36
18
  */
37
- var resolveLabelShorthandProps = function (props) {
38
- var propsNormalized;
39
- if (props.required === true) {
40
- propsNormalized = __assign(__assign({}, props), { required: { children: '*' } });
41
- }
42
- else if (props.required === false) {
43
- propsNormalized = __assign(__assign({}, props), { required: undefined });
44
- }
45
- else {
46
- // TypeScript needs a nudge to figure out that props.required won't be a boolean here
47
- propsNormalized = props;
48
- }
49
- return resolveShorthandProps(propsNormalized, labelShorthandProps);
19
+
20
+ export var useLabel = function (props, ref) {
21
+ var _a = props.disabled,
22
+ disabled = _a === void 0 ? false : _a,
23
+ _b = props.required,
24
+ required = _b === void 0 ? false : _b,
25
+ _c = props.strong,
26
+ strong = _c === void 0 ? false : _c,
27
+ _d = props.size,
28
+ size = _d === void 0 ? 'medium' : _d;
29
+ return {
30
+ disabled: disabled,
31
+ required: resolveShorthand(required === false ? null : required, {
32
+ required: !!required,
33
+ defaultProps: {
34
+ children: '*'
35
+ }
36
+ }),
37
+ strong: strong,
38
+ size: size,
39
+ components: {
40
+ root: 'label',
41
+ required: 'span'
42
+ },
43
+ root: getNativeElementProps('label', __assign({
44
+ ref: ref
45
+ }, props))
46
+ };
50
47
  };
51
48
  //# sourceMappingURL=useLabel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLabel.js","sourceRoot":"../src/","sources":["components/Label/useLabel.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlF;;;GAGG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAA0B,CAAC,UAAU,CAAC,CAAC;AAEvE,IAAM,UAAU,GAAG,cAAc,CAAa,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAElF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAG,UAAC,KAAiB,EAAE,GAA2B,EAAE,YAAyB;IAChG,IAAM,KAAK,GAAG,UAAU,CACtB;QACE,GAAG,KAAA;QACH,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE;YACR,EAAE,EAAE,MAAM;SACX;KACF,EACD,YAAY,IAAI,0BAA0B,CAAC,YAAY,CAAC,EACxD,0BAA0B,CAAC,KAAK,CAAC,CAClC,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;;GAIG;AACH,IAAM,0BAA0B,GAAG,UAAC,KAAiB;IACnD,IAAI,eAAe,CAAC;IACpB,IAAI,KAAK,CAAC,QAAQ,KAAK,IAAI,EAAE;QAC3B,eAAe,yBAAQ,KAAK,KAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;KAC7D;SAAM,IAAI,KAAK,CAAC,QAAQ,KAAK,KAAK,EAAE;QACnC,eAAe,yBAAQ,KAAK,KAAE,QAAQ,EAAE,SAAS,GAAE,CAAC;KACrD;SAAM;QACL,qFAAqF;QACrF,eAAe,GAAG,KAA6E,CAAC;KACjG;IAED,OAAO,qBAAqB,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;AACrE,CAAC,CAAC","sourcesContent":["import * as React from 'react';\nimport { makeMergeProps, resolveShorthandProps } from '@fluentui/react-utilities';\nimport { LabelProps, LabelShorthandProps, LabelState } from './Label.types';\n\n/**\n * Array of all shorthand properties listed in LabelShorthandProps\n * {@docCatergory Label}\n */\nexport const labelShorthandProps: LabelShorthandProps[] = ['required'];\n\nconst mergeProps = makeMergeProps<LabelState>({ deepMerge: labelShorthandProps });\n\n/**\n * Create the state required to render Label.\n *\n * The returned state can be modified with hooks such as useLabelStyles,\n * before being passed to renderLabel.\n *\n * @param props - props from this instance of Label\n * @param ref - reference to root HTMLElement of Label\n * @param defaultProps - (optional) default prop values provided by the implementing type\n *\n * {@docCategory Label}\n */\nexport const useLabel = (props: LabelProps, ref: React.Ref<HTMLElement>, defaultProps?: LabelProps): LabelState => {\n const state = mergeProps(\n {\n ref,\n as: 'label',\n size: 'medium',\n required: {\n as: 'span',\n },\n },\n defaultProps && resolveLabelShorthandProps(defaultProps),\n resolveLabelShorthandProps(props),\n );\n\n return state;\n};\n\n/**\n * Label will first need to check if required is a boolean or shorthandprops,\n * this allows for the required prop to handle both the default asterisk for required\n * or a custom required text.\n */\nconst resolveLabelShorthandProps = (props: LabelProps) => {\n let propsNormalized;\n if (props.required === true) {\n propsNormalized = { ...props, required: { children: '*' } };\n } else if (props.required === false) {\n propsNormalized = { ...props, required: undefined };\n } else {\n // TypeScript needs a nudge to figure out that props.required won't be a boolean here\n propsNormalized = props as LabelProps & { required?: Exclude<LabelProps['required'], boolean> };\n }\n\n return resolveShorthandProps(propsNormalized, labelShorthandProps);\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Label/useLabel.tsx"],"names":[],"mappings":";AACA,SAAS,qBAAT,QAAsC,2BAAtC;AAEA,SAAS,gBAAT,QAAiC,2BAAjC;AAEA;;;AAGG;;AACH,OAAO,IAAM,mBAAmB,GAA4B,CAAC,MAAD,EAAS,UAAT,CAArD;AAEP;;;;;;;;AAQG;;AACH,OAAO,IAAM,QAAQ,GAAG,UAAC,KAAD,EAAoB,GAApB,EAA+C;AAC7D,MAAA,EAAA,GAAwE,KAAK,CAA7D,QAAhB;AAAA,MAAA,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAhB;AAAA,MAAkB,EAAA,GAAsD,KAAK,CAA3C,QAAlC;AAAA,MAAkB,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlC;AAAA,MAAoC,EAAA,GAAoC,KAAK,CAA3B,MAAlD;AAAA,MAAoC,MAAM,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAlD;AAAA,MAAoD,EAAA,GAAoB,KAAK,CAAV,IAAnE;AAAA,MAAoD,IAAI,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAAnE;AACR,SAAO;AACL,IAAA,QAAQ,EAAA,QADH;AAEL,IAAA,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,KAAK,KAAb,GAAqB,IAArB,GAA4B,QAA7B,EAAuC;AAC/D,MAAA,QAAQ,EAAE,CAAC,CAAC,QADmD;AAE/D,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,EAAE;AAAZ;AAFiD,KAAvC,CAFrB;AAML,IAAA,MAAM,EAAA,MAND;AAOL,IAAA,IAAI,EAAA,IAPC;AAQL,IAAA,UAAU,EAAE;AAAE,MAAA,IAAI,EAAE,OAAR;AAAiB,MAAA,QAAQ,EAAE;AAA3B,KARP;AASL,IAAA,IAAI,EAAE,qBAAqB,CAAC,OAAD,EAAQ,QAAA,CAAA;AAAI,MAAA,GAAG,EAAA;AAAP,KAAA,EAAY,KAAZ,CAAR;AATtB,GAAP;AAWD,CAbM","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { LabelState } from './Label.types';
1
+ import type { LabelState } from './Label.types';
2
2
  /**
3
3
  * Apply styling to the Label slots based on the state
4
4
  */
@@ -1,44 +1,52 @@
1
- import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';
1
+ import { __styles, mergeClasses } from '@fluentui/react-make-styles';
2
2
  /**
3
3
  * Styles for the label
4
4
  */
5
- var useStyles = makeStyles({
6
- root: function (theme) { return ({
7
- fontFamily: theme.global.type.fontFamilies.base,
8
- fontSize: theme.global.type.fontSizes.base[300],
9
- color: theme.alias.color.neutral.neutralForeground1,
10
- }); },
11
- disabled: function (theme) { return ({
12
- color: theme.alias.color.neutral.neutralForegroundDisabled,
13
- }); },
14
- required: function (theme) { return ({
15
- color: theme.alias.color.red.foreground3,
16
- // TODO: Once spacing tokens are added, change this to Horizontal XS
17
- paddingLeft: '4px',
18
- }); },
19
- small: function (theme) { return ({
20
- fontSize: theme.global.type.fontSizes.base[200],
21
- }); },
22
- medium: function (theme) { return ({
23
- fontSize: theme.global.type.fontSizes.base[300],
24
- }); },
25
- large: function (theme) { return ({
26
- fontSize: theme.global.type.fontSizes.base[400],
27
- fontWeight: theme.global.type.fontWeights.semibold,
28
- }); },
29
- strong: function (theme) { return ({
30
- fontWeight: theme.global.type.fontWeights.semibold,
31
- }); },
5
+
6
+ var useStyles = /*#__PURE__*/__styles({
7
+ "root": {
8
+ "Bahqtrf": "fk6fouc",
9
+ "sj55zd": "f19n0e5"
10
+ },
11
+ "disabled": {
12
+ "sj55zd": "f1s2aq7o"
13
+ },
14
+ "required": {
15
+ "sj55zd": "f1whyuy6",
16
+ "uwmqm3": ["fycuoez", "f8wuabp"]
17
+ },
18
+ "small": {
19
+ "Be2twd7": "fy9rknc",
20
+ "Bg96gwp": "fwrc4pm"
21
+ },
22
+ "medium": {
23
+ "Be2twd7": "fkhj508",
24
+ "Bg96gwp": "f1i3iumi"
25
+ },
26
+ "large": {
27
+ "Be2twd7": "fod5ikn",
28
+ "Bg96gwp": "faaz57k",
29
+ "Bhrd7zp": "fl43uef"
30
+ },
31
+ "strong": {
32
+ "Bhrd7zp": "fl43uef"
33
+ }
34
+ }, {
35
+ "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);}"]
32
36
  });
33
37
  /**
34
38
  * Apply styling to the Label slots based on the state
35
39
  */
40
+
41
+
36
42
  export var useLabelStyles = function (state) {
37
- var styles = useStyles();
38
- state.className = mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.className);
39
- if (state.required) {
40
- state.required.className = mergeClasses(styles.required, state.required.className);
41
- }
42
- return state;
43
+ var styles = useStyles();
44
+ state.root.className = mergeClasses(styles.root, state.disabled && styles.disabled, styles[state.size], state.strong && styles.strong, state.root.className);
45
+
46
+ if (state.required) {
47
+ state.required.className = mergeClasses(styles.required, state.required.className);
48
+ }
49
+
50
+ return state;
43
51
  };
44
52
  //# sourceMappingURL=useLabelStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLabelStyles.js","sourceRoot":"../src/","sources":["components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAGvE;;GAEG;AACH,IAAM,SAAS,GAAG,UAAU,CAAC;IAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI;QAC/C,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB;KACpD,CAAC,EAJa,CAIb;IAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,yBAAyB;KAC3D,CAAC,EAFiB,CAEjB;IAEF,QAAQ,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAClB,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW;QACxC,oEAAoE;QACpE,WAAW,EAAE,KAAK;KACnB,CAAC,EAJiB,CAIjB;IAEF,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACf,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;KAChD,CAAC,EAFc,CAEd;IAEF,MAAM,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAChB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;KAChD,CAAC,EAFe,CAEf;IAEF,KAAK,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACf,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/C,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ;KACnD,CAAC,EAHc,CAGd;IAEF,MAAM,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QAChB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ;KACnD,CAAC,EAFe,CAEf;CACH,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,cAAc,GAAG,UAAC,KAAiB;IAC9C,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,KAAK,CAAC,SAAS,GAAG,YAAY,CAC5B,MAAM,CAAC,IAAI,EACX,KAAK,CAAC,QAAQ,IAAI,MAAM,CAAC,QAAQ,EACjC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAClB,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAC7B,KAAK,CAAC,SAAS,CAChB,CAAC;IAEF,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,KAAK,CAAC,QAAQ,CAAC,SAAS,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;KACpF;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { LabelState } from './Label.types';\n\n/**\n * Styles for the label\n */\nconst useStyles = makeStyles({\n root: theme => ({\n fontFamily: theme.global.type.fontFamilies.base,\n fontSize: theme.global.type.fontSizes.base[300],\n color: theme.alias.color.neutral.neutralForeground1,\n }),\n\n disabled: theme => ({\n color: theme.alias.color.neutral.neutralForegroundDisabled,\n }),\n\n required: theme => ({\n color: theme.alias.color.red.foreground3,\n // TODO: Once spacing tokens are added, change this to Horizontal XS\n paddingLeft: '4px',\n }),\n\n small: theme => ({\n fontSize: theme.global.type.fontSizes.base[200],\n }),\n\n medium: theme => ({\n fontSize: theme.global.type.fontSizes.base[300],\n }),\n\n large: theme => ({\n fontSize: theme.global.type.fontSizes.base[400],\n fontWeight: theme.global.type.fontWeights.semibold,\n }),\n\n strong: theme => ({\n fontWeight: theme.global.type.fontWeights.semibold,\n }),\n});\n\n/**\n * Apply styling to the Label slots based on the state\n */\nexport const useLabelStyles = (state: LabelState): LabelState => {\n const styles = useStyles();\n state.className = mergeClasses(\n styles.root,\n state.disabled && styles.disabled,\n styles[state.size],\n state.strong && styles.strong,\n state.className,\n );\n\n if (state.required) {\n state.required.className = mergeClasses(styles.required, state.required.className);\n }\n\n return state;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/Label/useLabelStyles.ts"],"names":[],"mappings":"AAAA,mBAAqB,YAArB,QAAyC,6BAAzC;AAGA;;AAEG;;AACH,IAAM,SAAS,gBAAG;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAlB;AAoCA;;AAEG;;;AACH,OAAO,IAAM,cAAc,GAAG,UAAC,KAAD,EAAkB;AAC9C,MAAM,MAAM,GAAG,SAAS,EAAxB;AACA,EAAA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,MAAM,CAAC,IAD0B,EAEjC,KAAK,CAAC,QAAN,IAAkB,MAAM,CAAC,QAFQ,EAGjC,MAAM,CAAC,KAAK,CAAC,IAAP,CAH2B,EAIjC,KAAK,CAAC,MAAN,IAAgB,MAAM,CAAC,MAJU,EAKjC,KAAK,CAAC,IAAN,CAAW,SALsB,CAAnC;;AAQA,MAAI,KAAK,CAAC,QAAV,EAAoB;AAClB,IAAA,KAAK,CAAC,QAAN,CAAe,SAAf,GAA2B,YAAY,CAAC,MAAM,CAAC,QAAR,EAAkB,KAAK,CAAC,QAAN,CAAe,SAAjC,CAAvC;AACD;;AAED,SAAO,KAAP;AACD,CAfM","sourceRoot":""}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC","sourcesContent":["// TODO: replace with real exports\nexport {};\nexport * from './Label';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC"}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.13.0"
8
+ "packageVersion": "7.18.1"
9
9
  }
10
10
  ]
11
11
  }
@@ -1,5 +1,10 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var tslib_1 = require("tslib");
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var tslib_1 = /*#__PURE__*/require("tslib");
8
+
4
9
  tslib_1.__exportStar(require("./components/Label/index"), exports);
5
10
  //# sourceMappingURL=Label.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Label.js","sourceRoot":"../src/","sources":["Label.ts"],"names":[],"mappings":";;;AAAA,mEAAyC","sourcesContent":["export * from './components/Label/index';\n"]}
1
+ {"version":3,"sources":["../src/Label.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,0BAAA,CAAA,EAAA,OAAA","sourceRoot":""}
@@ -1,4 +1,4 @@
1
- import { IsConformantOptions } from '@fluentui/react-conformance';
1
+ import type { IsConformantOptions } from '@fluentui/react-conformance';
2
2
  export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
3
3
  componentPath?: string;
4
4
  }): void;