@fluentui/react-label 9.0.0-alpha.4 → 9.0.0-alpha.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/CHANGELOG.json +956 -1
  2. package/CHANGELOG.md +388 -2
  3. package/MIGRATION.md +25 -0
  4. package/README.md +22 -0
  5. package/Spec.md +146 -34
  6. package/dist/react-label.d.ts +42 -9
  7. package/lib/Label.js.map +1 -1
  8. package/lib/common/isConformant.d.ts +1 -1
  9. package/lib/common/isConformant.js +7 -5
  10. package/lib/common/isConformant.js.map +1 -1
  11. package/lib/components/Label/Label.d.ts +6 -2
  12. package/lib/components/Label/Label.js +5 -4
  13. package/lib/components/Label/Label.js.map +1 -1
  14. package/lib/components/Label/Label.types.d.ts +32 -7
  15. package/lib/components/Label/Label.types.js.map +1 -1
  16. package/lib/components/Label/index.js.map +1 -1
  17. package/lib/components/Label/renderLabel.d.ts +1 -1
  18. package/lib/components/Label/renderLabel.js +7 -3
  19. package/lib/components/Label/renderLabel.js.map +1 -1
  20. package/lib/components/Label/useLabel.d.ts +2 -1
  21. package/lib/components/Label/useLabel.js +43 -8
  22. package/lib/components/Label/useLabel.js.map +1 -1
  23. package/lib/components/Label/useLabelStyles.d.ts +1 -1
  24. package/lib/components/Label/useLabelStyles.js +43 -11
  25. package/lib/components/Label/useLabelStyles.js.map +1 -1
  26. package/lib/index.js.map +1 -1
  27. package/lib/tsdoc-metadata.json +1 -1
  28. package/lib-commonjs/Label.js +7 -2
  29. package/lib-commonjs/Label.js.map +1 -1
  30. package/lib-commonjs/common/isConformant.d.ts +1 -1
  31. package/lib-commonjs/common/isConformant.js +16 -7
  32. package/lib-commonjs/common/isConformant.js.map +1 -1
  33. package/lib-commonjs/components/Label/Label.d.ts +6 -2
  34. package/lib-commonjs/components/Label/Label.js +18 -9
  35. package/lib-commonjs/components/Label/Label.js.map +1 -1
  36. package/lib-commonjs/components/Label/Label.types.d.ts +32 -7
  37. package/lib-commonjs/components/Label/Label.types.js +4 -1
  38. package/lib-commonjs/components/Label/Label.types.js.map +1 -1
  39. package/lib-commonjs/components/Label/index.js +11 -2
  40. package/lib-commonjs/components/Label/index.js.map +1 -1
  41. package/lib-commonjs/components/Label/renderLabel.d.ts +1 -1
  42. package/lib-commonjs/components/Label/renderLabel.js +20 -7
  43. package/lib-commonjs/components/Label/renderLabel.js.map +1 -1
  44. package/lib-commonjs/components/Label/useLabel.d.ts +2 -1
  45. package/lib-commonjs/components/Label/useLabel.js +52 -10
  46. package/lib-commonjs/components/Label/useLabel.js.map +1 -1
  47. package/lib-commonjs/components/Label/useLabelStyles.d.ts +1 -1
  48. package/lib-commonjs/components/Label/useLabelStyles.js +50 -12
  49. package/lib-commonjs/components/Label/useLabelStyles.js.map +1 -1
  50. package/lib-commonjs/index.js +7 -2
  51. package/lib-commonjs/index.js.map +1 -1
  52. package/package.json +14 -10
  53. package/config/api-extractor.json +0 -3
  54. package/config/tests.js +0 -7
  55. package/etc/react-label.api.md +0 -44
  56. package/just.config.ts +0 -3
  57. package/lib-amd/Label.d.ts +0 -1
  58. package/lib-amd/Label.js +0 -6
  59. package/lib-amd/Label.js.map +0 -1
  60. package/lib-amd/common/isConformant.d.ts +0 -4
  61. package/lib-amd/common/isConformant.js +0 -14
  62. package/lib-amd/common/isConformant.js.map +0 -1
  63. package/lib-amd/components/Label/Label.d.ts +0 -6
  64. package/lib-amd/components/Label/Label.js +0 -15
  65. package/lib-amd/components/Label/Label.js.map +0 -1
  66. package/lib-amd/components/Label/Label.types.d.ts +0 -24
  67. package/lib-amd/components/Label/Label.types.js +0 -5
  68. package/lib-amd/components/Label/Label.types.js.map +0 -1
  69. package/lib-amd/components/Label/index.d.ts +0 -5
  70. package/lib-amd/components/Label/index.js +0 -10
  71. package/lib-amd/components/Label/index.js.map +0 -1
  72. package/lib-amd/components/Label/renderLabel.d.ts +0 -5
  73. package/lib-amd/components/Label/renderLabel.js +0 -14
  74. package/lib-amd/components/Label/renderLabel.js.map +0 -1
  75. package/lib-amd/components/Label/useLabel.d.ts +0 -17
  76. package/lib-amd/components/Label/useLabel.js +0 -30
  77. package/lib-amd/components/Label/useLabel.js.map +0 -1
  78. package/lib-amd/components/Label/useLabelStyles.d.ts +0 -5
  79. package/lib-amd/components/Label/useLabelStyles.js +0 -25
  80. package/lib-amd/components/Label/useLabelStyles.js.map +0 -1
  81. package/lib-amd/index.d.ts +0 -2
  82. package/lib-amd/index.js +0 -6
  83. package/lib-amd/index.js.map +0 -1
  84. package/src/components/Label/Label.types.ts +0 -33
@@ -1,14 +0,0 @@
1
- define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "./useLabel"], function (require, exports, tslib_1, React, react_utilities_1, useLabel_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.renderLabel = void 0;
5
- /**
6
- * Render the final JSX of Label
7
- */
8
- var renderLabel = function (state) {
9
- var _a = react_utilities_1.getSlots(state, useLabel_1.labelShorthandProps), slots = _a.slots, slotProps = _a.slotProps;
10
- return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root), state.children));
11
- };
12
- exports.renderLabel = renderLabel;
13
- });
14
- //# sourceMappingURL=renderLabel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderLabel.js","sourceRoot":"../src/","sources":["components/Label/renderLabel.tsx"],"names":[],"mappings":";;;;IAKA;;OAEG;IACI,IAAM,WAAW,GAAG,UAAC,KAAiB;QACrC,IAAA,KAAuB,0BAAQ,CAAC,KAAK,EAAE,8BAAmB,CAAC,EAAzD,KAAK,WAAA,EAAE,SAAS,eAAyC,CAAC;QAElE,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,GAE3B,KAAK,CAAC,QAAQ,CACJ,CACd,CAAC;IACJ,CAAC,CAAC;IATW,QAAA,WAAW,eAStB","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 */\nexport const renderLabel = (state: LabelState) => {\n const { slots, slotProps } = getSlots(state, labelShorthandProps);\n\n return (\n <slots.root {...slotProps.root}>\n {/* TODO Add additional slots in the appropriate place */}\n {state.children}\n </slots.root>\n );\n};\n"]}
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
- import { LabelProps, LabelShorthandProps, LabelState } from './Label.types';
3
- /**
4
- * Array of all shorthand properties listed in LabelShorthandProps
5
- */
6
- export declare const labelShorthandProps: LabelShorthandProps[];
7
- /**
8
- * Create the state required to render Label.
9
- *
10
- * The returned state can be modified with hooks such as useLabelStyles,
11
- * before being passed to renderLabel.
12
- *
13
- * @param props - props from this instance of Label
14
- * @param ref - reference to root HTMLElement of Label
15
- * @param defaultProps - (optional) default prop values provided by the implementing type
16
- */
17
- export declare const useLabel: (props: LabelProps, ref: React.Ref<HTMLElement>, defaultProps?: LabelProps | undefined) => LabelState;
@@ -1,30 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-utilities"], function (require, exports, react_utilities_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLabel = exports.labelShorthandProps = void 0;
5
- /**
6
- * Array of all shorthand properties listed in LabelShorthandProps
7
- */
8
- exports.labelShorthandProps = [
9
- /* TODO add shorthand property names */
10
- ];
11
- var mergeProps = react_utilities_1.makeMergeProps({ deepMerge: exports.labelShorthandProps });
12
- /**
13
- * Create the state required to render Label.
14
- *
15
- * The returned state can be modified with hooks such as useLabelStyles,
16
- * before being passed to renderLabel.
17
- *
18
- * @param props - props from this instance of Label
19
- * @param ref - reference to root HTMLElement of Label
20
- * @param defaultProps - (optional) default prop values provided by the implementing type
21
- */
22
- var useLabel = function (props, ref, defaultProps) {
23
- var state = mergeProps({
24
- ref: ref,
25
- }, defaultProps && react_utilities_1.resolveShorthandProps(defaultProps, exports.labelShorthandProps), react_utilities_1.resolveShorthandProps(props, exports.labelShorthandProps));
26
- return state;
27
- };
28
- exports.useLabel = useLabel;
29
- });
30
- //# sourceMappingURL=useLabel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLabel.js","sourceRoot":"../src/","sources":["components/Label/useLabel.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACU,QAAA,mBAAmB,GAA0B;IACxD,uCAAuC;KACxC,CAAC;IAEF,IAAM,UAAU,GAAG,gCAAc,CAAa,EAAE,SAAS,EAAE,2BAAmB,EAAE,CAAC,CAAC;IAElF;;;;;;;;;OASG;IACI,IAAM,QAAQ,GAAG,UAAC,KAAiB,EAAE,GAA2B,EAAE,YAAyB;QAChG,IAAM,KAAK,GAAG,UAAU,CACtB;YACE,GAAG,KAAA;SACJ,EACD,YAAY,IAAI,uCAAqB,CAAC,YAAY,EAAE,2BAAmB,CAAC,EACxE,uCAAqB,CAAC,KAAK,EAAE,2BAAmB,CAAC,CAClD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAVW,QAAA,QAAQ,YAUnB","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 */\nexport const labelShorthandProps: LabelShorthandProps[] = [\n /* TODO add shorthand property names */\n];\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 */\nexport const useLabel = (props: LabelProps, ref: React.Ref<HTMLElement>, defaultProps?: LabelProps): LabelState => {\n const state = mergeProps(\n {\n ref,\n },\n defaultProps && resolveShorthandProps(defaultProps, labelShorthandProps),\n resolveShorthandProps(props, labelShorthandProps),\n );\n\n return state;\n};\n"]}
@@ -1,5 +0,0 @@
1
- import { LabelState } from './Label.types';
2
- /**
3
- * Apply styling to the Label slots based on the state
4
- */
5
- export declare const useLabelStyles: (state: LabelState) => LabelState;
@@ -1,25 +0,0 @@
1
- define(["require", "exports", "@fluentui/react-make-styles"], function (require, exports, react_make_styles_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useLabelStyles = void 0;
5
- /**
6
- * Styles for the root slot
7
- */
8
- var useStyles = react_make_styles_1.makeStyles({
9
- root: function (theme) { return ({
10
- // TODO Add default styles for the root element
11
- }); },
12
- });
13
- /**
14
- * Apply styling to the Label slots based on the state
15
- */
16
- var useLabelStyles = function (state) {
17
- var styles = useStyles();
18
- state.className = react_make_styles_1.mergeClasses(styles.root, state.className);
19
- // TODO Add class names to slots, for example:
20
- // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
21
- return state;
22
- };
23
- exports.useLabelStyles = useLabelStyles;
24
- });
25
- //# sourceMappingURL=useLabelStyles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useLabelStyles.js","sourceRoot":"../src/","sources":["components/Label/useLabelStyles.ts"],"names":[],"mappings":";;;;IAGA;;OAEG;IACH,IAAM,SAAS,GAAG,8BAAU,CAAC;QAC3B,IAAI,EAAE,UAAA,KAAK,IAAI,OAAA,CAAC;QACd,+CAA+C;SAChD,CAAC,EAFa,CAEb;KAGH,CAAC,CAAC;IAEH;;OAEG;IACI,IAAM,cAAc,GAAG,UAAC,KAAiB;QAC9C,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,SAAS,GAAG,gCAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;QAE7D,8CAA8C;QAC9C,gFAAgF;QAEhF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IARW,QAAA,cAAc,kBAQzB","sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-make-styles';\nimport { LabelState } from './Label.types';\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: theme => ({\n // TODO Add default styles for the root element\n }),\n\n // TODO add additional classes for different states and/or slots\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(styles.root, state.className);\n\n // TODO Add class names to slots, for example:\n // state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);\n\n return state;\n};\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- export * from './Label';
package/lib-amd/index.js DELETED
@@ -1,6 +0,0 @@
1
- define(["require", "exports", "tslib", "./Label"], function (require, exports, tslib_1, Label_1) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- tslib_1.__exportStar(Label_1, exports);
5
- });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":";;;IAEA,uCAAwB","sourcesContent":["// TODO: replace with real exports\nexport {};\nexport * from './Label';\n"]}
@@ -1,33 +0,0 @@
1
- import * as React from 'react';
2
- import { ComponentProps, ComponentState } from '@fluentui/react-utilities';
3
-
4
- /**
5
- * Label Props
6
- */
7
- export interface LabelProps extends ComponentProps, React.HTMLAttributes<HTMLElement> {
8
- /*
9
- * TODO Add props and slots here
10
- * Any slot property should be listed in the labelShorthandProps array below
11
- * Any property that has a default value should be listed in LabelDefaultedProps as e.g. 'size' | 'icon'
12
- */
13
- }
14
-
15
- /**
16
- * Names of the shorthand properties in LabelProps
17
- */
18
- export type LabelShorthandProps = never; // TODO add shorthand property names
19
-
20
- /**
21
- * Names of LabelProps that have a default value in useLabel
22
- */
23
- export type LabelDefaultedProps = never; // TODO add names of properties with default values
24
-
25
- /**
26
- * State used in rendering Label
27
- */
28
- export interface LabelState extends ComponentState<LabelProps, LabelShorthandProps, LabelDefaultedProps> {
29
- /**
30
- * Ref to the root element
31
- */
32
- ref: React.Ref<HTMLElement>;
33
- }