@fluentui/react-field 0.0.0-nightly-20230317-0436.1 → 0.0.0-nightly-20230317-1454.1

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.
Files changed (40) hide show
  1. package/.swcrc +39 -0
  2. package/CHANGELOG.json +13 -13
  3. package/CHANGELOG.md +9 -9
  4. package/lib/Field.js +1 -1
  5. package/lib/Field.js.map +1 -1
  6. package/lib/components/Field/Field.js +5 -5
  7. package/lib/components/Field/Field.js.map +1 -1
  8. package/lib/components/Field/Field.types.js +1 -1
  9. package/lib/components/Field/Field.types.js.map +1 -1
  10. package/lib/components/Field/index.js +5 -5
  11. package/lib/components/Field/index.js.map +1 -1
  12. package/lib/components/Field/renderField.js +3 -13
  13. package/lib/components/Field/renderField.js.map +1 -1
  14. package/lib/components/Field/useField.js +28 -29
  15. package/lib/components/Field/useField.js.map +1 -1
  16. package/lib/components/Field/useFieldStyles.js +7 -7
  17. package/lib/components/Field/useFieldStyles.js.map +1 -1
  18. package/lib/index.js +2 -2
  19. package/lib/index.js.map +1 -1
  20. package/lib/util/makeDeprecatedField.js +4 -7
  21. package/lib/util/makeDeprecatedField.js.map +1 -1
  22. package/lib-commonjs/Field.js +5 -4
  23. package/lib-commonjs/Field.js.map +1 -1
  24. package/lib-commonjs/components/Field/Field.js +16 -12
  25. package/lib-commonjs/components/Field/Field.js.map +1 -1
  26. package/lib-commonjs/components/Field/Field.types.js +5 -2
  27. package/lib-commonjs/components/Field/Field.types.js.map +1 -1
  28. package/lib-commonjs/components/Field/index.js +9 -8
  29. package/lib-commonjs/components/Field/index.js.map +1 -1
  30. package/lib-commonjs/components/Field/renderField.js +13 -26
  31. package/lib-commonjs/components/Field/renderField.js.map +1 -1
  32. package/lib-commonjs/components/Field/useField.js +94 -102
  33. package/lib-commonjs/components/Field/useField.js.map +1 -1
  34. package/lib-commonjs/components/Field/useFieldStyles.js +138 -97
  35. package/lib-commonjs/components/Field/useFieldStyles.js.map +1 -1
  36. package/lib-commonjs/index.js +21 -49
  37. package/lib-commonjs/index.js.map +1 -1
  38. package/lib-commonjs/util/makeDeprecatedField.js +53 -71
  39. package/lib-commonjs/util/makeDeprecatedField.js.map +1 -1
  40. package/package.json +8 -8
@@ -1,113 +1,154 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ fieldClassNames: ()=>fieldClassNames,
13
+ useFieldStyles_unstable: ()=>useFieldStyles_unstable
5
14
  });
6
- exports.useFieldStyles_unstable = exports.fieldClassNames = void 0;
7
- const react_theme_1 = /*#__PURE__*/require("@fluentui/react-theme");
8
- const react_1 = /*#__PURE__*/require("@griffel/react");
9
- exports.fieldClassNames = {
10
- root: `fui-Field`,
11
- label: `fui-Field__label`,
12
- validationMessage: `fui-Field__validationMessage`,
13
- validationMessageIcon: `fui-Field__validationMessageIcon`,
14
- hint: `fui-Field__hint`
15
+ const _react = require("@griffel/react");
16
+ const fieldClassNames = {
17
+ root: `fui-Field`,
18
+ label: `fui-Field__label`,
19
+ validationMessage: `fui-Field__validationMessage`,
20
+ validationMessageIcon: `fui-Field__validationMessageIcon`,
21
+ hint: `fui-Field__hint`
15
22
  };
16
23
  // Size of the icon in the validation message
17
- const iconSize = '12px';
24
+ const iconSize = "12px";
18
25
  /**
19
26
  * Styles for the root slot
20
- */
21
- const useRootStyles = /*#__PURE__*/react_1.__styles({
22
- base: {
23
- mc9l5x: "f13qh94s"
24
- },
25
- horizontal: {
26
- Budl1dq: "f2wwaib",
27
- wkccdc: "f1645dqt"
28
- },
29
- horizontalNoLabel: {
30
- uwmqm3: ["f15jqgz8", "fggqkej"],
31
- Budl1dq: "f1c2z91y"
32
- }
27
+ */ const useRootStyles = /*#__PURE__*/ (0, _react["__styles"])({
28
+ base: {
29
+ mc9l5x: "f13qh94s"
30
+ },
31
+ horizontal: {
32
+ Budl1dq: "f2wwaib",
33
+ wkccdc: "f1645dqt"
34
+ },
35
+ horizontalNoLabel: {
36
+ uwmqm3: [
37
+ "f15jqgz8",
38
+ "fggqkej"
39
+ ],
40
+ Budl1dq: "f1c2z91y"
41
+ }
33
42
  }, {
34
- d: [".f13qh94s{display:grid;}", ".f2wwaib{grid-template-columns:33% 1fr;}", ".f1645dqt{grid-template-rows:auto auto auto 1fr;}", ".f15jqgz8{padding-left:33%;}", ".fggqkej{padding-right:33%;}", ".f1c2z91y{grid-template-columns:1fr;}"]
43
+ d: [
44
+ ".f13qh94s{display:grid;}",
45
+ ".f2wwaib{grid-template-columns:33% 1fr;}",
46
+ ".f1645dqt{grid-template-rows:auto auto auto 1fr;}",
47
+ ".f15jqgz8{padding-left:33%;}",
48
+ ".fggqkej{padding-right:33%;}",
49
+ ".f1c2z91y{grid-template-columns:1fr;}"
50
+ ]
35
51
  });
36
- const useLabelStyles = /*#__PURE__*/react_1.__styles({
37
- base: {
38
- z8tnut: "fclwglc",
39
- Byoj8tv: "fywfov9"
40
- },
41
- large: {
42
- z8tnut: "f1sl3k7w",
43
- Byoj8tv: "f1brlhvm"
44
- },
45
- vertical: {
46
- jrapky: "fyacil5"
47
- },
48
- verticalLarge: {
49
- jrapky: "f8l5zjj"
50
- },
51
- horizontal: {
52
- t21cq0: ["fkujibs", "f199hnxi"],
53
- Ijaq50: "f16hsg94",
54
- nk6f5a: "f1nzqi2z"
55
- }
52
+ const useLabelStyles = /*#__PURE__*/ (0, _react["__styles"])({
53
+ base: {
54
+ z8tnut: "fclwglc",
55
+ Byoj8tv: "fywfov9"
56
+ },
57
+ large: {
58
+ z8tnut: "f1sl3k7w",
59
+ Byoj8tv: "f1brlhvm"
60
+ },
61
+ vertical: {
62
+ jrapky: "fyacil5"
63
+ },
64
+ verticalLarge: {
65
+ jrapky: "f8l5zjj"
66
+ },
67
+ horizontal: {
68
+ t21cq0: [
69
+ "fkujibs",
70
+ "f199hnxi"
71
+ ],
72
+ Ijaq50: "f16hsg94",
73
+ nk6f5a: "f1nzqi2z"
74
+ }
56
75
  }, {
57
- d: [".fclwglc{padding-top:var(--spacingVerticalXXS);}", ".fywfov9{padding-bottom:var(--spacingVerticalXXS);}", ".f1sl3k7w{padding-top:1px;}", ".f1brlhvm{padding-bottom:1px;}", ".fyacil5{margin-bottom:var(--spacingVerticalXXS);}", ".f8l5zjj{margin-bottom:var(--spacingVerticalXS);}", ".fkujibs{margin-right:var(--spacingHorizontalM);}", ".f199hnxi{margin-left:var(--spacingHorizontalM);}", ".f16hsg94{grid-row-start:1;}", ".f1nzqi2z{grid-row-end:-1;}"]
76
+ d: [
77
+ ".fclwglc{padding-top:var(--spacingVerticalXXS);}",
78
+ ".fywfov9{padding-bottom:var(--spacingVerticalXXS);}",
79
+ ".f1sl3k7w{padding-top:1px;}",
80
+ ".f1brlhvm{padding-bottom:1px;}",
81
+ ".fyacil5{margin-bottom:var(--spacingVerticalXXS);}",
82
+ ".f8l5zjj{margin-bottom:var(--spacingVerticalXS);}",
83
+ ".fkujibs{margin-right:var(--spacingHorizontalM);}",
84
+ ".f199hnxi{margin-left:var(--spacingHorizontalM);}",
85
+ ".f16hsg94{grid-row-start:1;}",
86
+ ".f1nzqi2z{grid-row-end:-1;}"
87
+ ]
58
88
  });
59
- const useSecondaryTextBaseClassName = /*#__PURE__*/react_1.__resetStyles("r5c4z9l", null, [".r5c4z9l{margin-top:var(--spacingVerticalXXS);color:var(--colorNeutralForeground3);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"]);
60
- const useSecondaryTextStyles = /*#__PURE__*/react_1.__styles({
61
- error: {
62
- sj55zd: "f1hcrxcs"
63
- },
64
- withIcon: {
65
- uwmqm3: ["frawy03", "fg4c52"]
66
- }
89
+ const useSecondaryTextBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("r5c4z9l", null, [
90
+ ".r5c4z9l{margin-top:var(--spacingVerticalXXS);color:var(--colorNeutralForeground3);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
91
+ ]);
92
+ const useSecondaryTextStyles = /*#__PURE__*/ (0, _react["__styles"])({
93
+ error: {
94
+ sj55zd: "f1hcrxcs"
95
+ },
96
+ withIcon: {
97
+ uwmqm3: [
98
+ "frawy03",
99
+ "fg4c52"
100
+ ]
101
+ }
67
102
  }, {
68
- d: [".f1hcrxcs{color:var(--colorPaletteRedForeground1);}", ".frawy03{padding-left:calc(12px + var(--spacingHorizontalXS));}", ".fg4c52{padding-right:calc(12px + var(--spacingHorizontalXS));}"]
103
+ d: [
104
+ ".f1hcrxcs{color:var(--colorPaletteRedForeground1);}",
105
+ ".frawy03{padding-left:calc(12px + var(--spacingHorizontalXS));}",
106
+ ".fg4c52{padding-right:calc(12px + var(--spacingHorizontalXS));}"
107
+ ]
69
108
  });
70
- const useValidationMessageIconBaseClassName = /*#__PURE__*/react_1.__resetStyles("ra7h1uk", "r1rh6bd7", [".ra7h1uk{display:inline-block;font-size:12px;margin-left:calc(-12px - var(--spacingHorizontalXS));margin-right:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}", ".r1rh6bd7{display:inline-block;font-size:12px;margin-right:calc(-12px - var(--spacingHorizontalXS));margin-left:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}"]);
71
- const useValidationMessageIconStyles = /*#__PURE__*/react_1.__styles({
72
- error: {
73
- sj55zd: "f1hcrxcs"
74
- },
75
- warning: {
76
- sj55zd: "f1k5f75o"
77
- },
78
- success: {
79
- sj55zd: "ffmvakt"
80
- }
109
+ const useValidationMessageIconBaseClassName = /*#__PURE__*/ (0, _react["__resetStyles"])("ra7h1uk", "r1rh6bd7", [
110
+ ".ra7h1uk{display:inline-block;font-size:12px;margin-left:calc(-12px - var(--spacingHorizontalXS));margin-right:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}",
111
+ ".r1rh6bd7{display:inline-block;font-size:12px;margin-right:calc(-12px - var(--spacingHorizontalXS));margin-left:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}"
112
+ ]);
113
+ const useValidationMessageIconStyles = /*#__PURE__*/ (0, _react["__styles"])({
114
+ error: {
115
+ sj55zd: "f1hcrxcs"
116
+ },
117
+ warning: {
118
+ sj55zd: "f1k5f75o"
119
+ },
120
+ success: {
121
+ sj55zd: "ffmvakt"
122
+ }
81
123
  }, {
82
- d: [".f1hcrxcs{color:var(--colorPaletteRedForeground1);}", ".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}", ".ffmvakt{color:var(--colorPaletteGreenForeground1);}"]
124
+ d: [
125
+ ".f1hcrxcs{color:var(--colorPaletteRedForeground1);}",
126
+ ".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}",
127
+ ".ffmvakt{color:var(--colorPaletteGreenForeground1);}"
128
+ ]
83
129
  });
84
- /**
85
- * Apply styling to the Field slots based on the state
86
- */
87
- const useFieldStyles_unstable = state => {
88
- const {
89
- validationState
90
- } = state;
91
- const horizontal = state.orientation === 'horizontal';
92
- const rootStyles = useRootStyles();
93
- state.root.className = react_1.mergeClasses(exports.fieldClassNames.root, rootStyles.base, horizontal && rootStyles.horizontal, horizontal && !state.label && rootStyles.horizontalNoLabel, state.root.className);
94
- const labelStyles = useLabelStyles();
95
- if (state.label) {
96
- state.label.className = react_1.mergeClasses(exports.fieldClassNames.label, labelStyles.base, horizontal && labelStyles.horizontal, !horizontal && labelStyles.vertical, state.label.size === 'large' && labelStyles.large, !horizontal && state.label.size === 'large' && labelStyles.verticalLarge, state.label.className);
97
- }
98
- const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();
99
- const validationMessageIconStyles = useValidationMessageIconStyles();
100
- if (state.validationMessageIcon) {
101
- state.validationMessageIcon.className = react_1.mergeClasses(exports.fieldClassNames.validationMessageIcon, validationMessageIconBaseClassName, validationState !== 'none' && validationMessageIconStyles[validationState], state.validationMessageIcon.className);
102
- }
103
- const secondaryTextBaseClassName = useSecondaryTextBaseClassName();
104
- const secondaryTextStyles = useSecondaryTextStyles();
105
- if (state.validationMessage) {
106
- state.validationMessage.className = react_1.mergeClasses(exports.fieldClassNames.validationMessage, secondaryTextBaseClassName, validationState === 'error' && secondaryTextStyles.error, !!state.validationMessageIcon && secondaryTextStyles.withIcon, state.validationMessage.className);
107
- }
108
- if (state.hint) {
109
- state.hint.className = react_1.mergeClasses(exports.fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);
110
- }
111
- };
112
- exports.useFieldStyles_unstable = useFieldStyles_unstable;
130
+ const useFieldStyles_unstable = (state)=>{
131
+ const { validationState } = state;
132
+ const horizontal = state.orientation === "horizontal";
133
+ const rootStyles = useRootStyles();
134
+ state.root.className = (0, _react.mergeClasses)(fieldClassNames.root, rootStyles.base, horizontal && rootStyles.horizontal, horizontal && !state.label && rootStyles.horizontalNoLabel, state.root.className);
135
+ const labelStyles = useLabelStyles();
136
+ if (state.label) {
137
+ state.label.className = (0, _react.mergeClasses)(fieldClassNames.label, labelStyles.base, horizontal && labelStyles.horizontal, !horizontal && labelStyles.vertical, state.label.size === "large" && labelStyles.large, !horizontal && state.label.size === "large" && labelStyles.verticalLarge, state.label.className);
138
+ }
139
+ const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();
140
+ const validationMessageIconStyles = useValidationMessageIconStyles();
141
+ if (state.validationMessageIcon) {
142
+ state.validationMessageIcon.className = (0, _react.mergeClasses)(fieldClassNames.validationMessageIcon, validationMessageIconBaseClassName, validationState !== "none" && validationMessageIconStyles[validationState], state.validationMessageIcon.className);
143
+ }
144
+ const secondaryTextBaseClassName = useSecondaryTextBaseClassName();
145
+ const secondaryTextStyles = useSecondaryTextStyles();
146
+ if (state.validationMessage) {
147
+ state.validationMessage.className = (0, _react.mergeClasses)(fieldClassNames.validationMessage, secondaryTextBaseClassName, validationState === "error" && secondaryTextStyles.error, !!state.validationMessageIcon && secondaryTextStyles.withIcon, state.validationMessage.className);
148
+ }
149
+ if (state.hint) {
150
+ state.hint.className = (0, _react.mergeClasses)(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);
151
+ }
152
+ }; //# sourceMappingURL=useFieldStyles.js.map
153
+
113
154
  //# sourceMappingURL=useFieldStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["react_theme_1","require","react_1","exports","fieldClassNames","root","label","validationMessage","validationMessageIcon","hint","iconSize","useRootStyles","__styles","base","mc9l5x","horizontal","Budl1dq","wkccdc","horizontalNoLabel","uwmqm3","d","useLabelStyles","z8tnut","Byoj8tv","large","vertical","jrapky","verticalLarge","t21cq0","Ijaq50","nk6f5a","useSecondaryTextBaseClassName","__resetStyles","useSecondaryTextStyles","error","sj55zd","withIcon","useValidationMessageIconBaseClassName","useValidationMessageIconStyles","warning","success","useFieldStyles_unstable","state","validationState","orientation","rootStyles","className","mergeClasses","labelStyles","size","validationMessageIconBaseClassName","validationMessageIconStyles","secondaryTextBaseClassName","secondaryTextStyles"],"sources":["../../../../../../../../../packages/react-components/react-field/src/components/Field/useFieldStyles.ts"],"sourcesContent":["import { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { FieldSlots, FieldState } from './Field.types';\n\nexport const fieldClassNames: SlotClassNames<FieldSlots> = {\n root: `fui-Field`,\n label: `fui-Field__label`,\n validationMessage: `fui-Field__validationMessage`,\n validationMessageIcon: `fui-Field__validationMessageIcon`,\n hint: `fui-Field__hint`,\n};\n\n// Size of the icon in the validation message\nconst iconSize = '12px';\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeStyles({\n base: {\n display: 'grid',\n },\n\n // In horizontal layout, the field is a grid with the label taking up the entire first column.\n // The last row is slack space in case the label is taller than the rest of the content.\n horizontal: {\n gridTemplateColumns: '33% 1fr',\n gridTemplateRows: 'auto auto auto 1fr',\n },\n\n // In horizontal layout without a label, replace the label's column with padding.\n // This lets grid auto-flow properly place the other children, and keeps fields with and without labels aligned.\n horizontalNoLabel: {\n paddingLeft: '33%',\n gridTemplateColumns: '1fr',\n },\n});\n\nconst useLabelStyles = makeStyles({\n base: {\n paddingTop: tokens.spacingVerticalXXS,\n paddingBottom: tokens.spacingVerticalXXS,\n },\n\n large: {\n paddingTop: '1px',\n paddingBottom: '1px',\n },\n\n vertical: {\n marginBottom: tokens.spacingVerticalXXS,\n },\n\n verticalLarge: {\n marginBottom: tokens.spacingVerticalXS,\n },\n\n horizontal: {\n marginRight: tokens.spacingHorizontalM,\n gridRowStart: '1',\n gridRowEnd: '-1',\n },\n});\n\nconst useSecondaryTextBaseClassName = makeResetStyles({\n marginTop: tokens.spacingVerticalXXS,\n color: tokens.colorNeutralForeground3,\n ...typographyStyles.caption1,\n});\n\nconst useSecondaryTextStyles = makeStyles({\n error: {\n color: tokens.colorPaletteRedForeground1,\n },\n\n withIcon: {\n // Add a gutter for the icon, to allow multiple lines of text to line up to the right of the icon.\n paddingLeft: `calc(${iconSize} + ${tokens.spacingHorizontalXS})`,\n },\n});\n\nconst useValidationMessageIconBaseClassName = makeResetStyles({\n display: 'inline-block',\n fontSize: iconSize,\n // Negative left margin puts the icon in the gutter of the validation message div's withIcon style.\n marginLeft: `calc(-${iconSize} - ${tokens.spacingHorizontalXS})`,\n marginRight: tokens.spacingHorizontalXS,\n // Line height of 0 prevents the verticalAlign from affecting the line height of the text.\n lineHeight: '0',\n // Negative verticalAlign shifts the inline icon down to align with the text (effectively top padding).\n verticalAlign: '-1px',\n});\n\nconst useValidationMessageIconStyles = makeStyles({\n error: {\n color: tokens.colorPaletteRedForeground1,\n },\n warning: {\n color: tokens.colorPaletteDarkOrangeForeground1,\n },\n success: {\n color: tokens.colorPaletteGreenForeground1,\n },\n});\n\n/**\n * Apply styling to the Field slots based on the state\n */\nexport const useFieldStyles_unstable = (state: FieldState) => {\n const { validationState } = state;\n const horizontal = state.orientation === 'horizontal';\n\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(\n fieldClassNames.root,\n rootStyles.base,\n horizontal && rootStyles.horizontal,\n horizontal && !state.label && rootStyles.horizontalNoLabel,\n state.root.className,\n );\n\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(\n fieldClassNames.label,\n labelStyles.base,\n horizontal && labelStyles.horizontal,\n !horizontal && labelStyles.vertical,\n state.label.size === 'large' && labelStyles.large,\n !horizontal && state.label.size === 'large' && labelStyles.verticalLarge,\n state.label.className,\n );\n }\n\n const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = mergeClasses(\n fieldClassNames.validationMessageIcon,\n validationMessageIconBaseClassName,\n validationState !== 'none' && validationMessageIconStyles[validationState],\n state.validationMessageIcon.className,\n );\n }\n\n const secondaryTextBaseClassName = useSecondaryTextBaseClassName();\n const secondaryTextStyles = useSecondaryTextStyles();\n if (state.validationMessage) {\n state.validationMessage.className = mergeClasses(\n fieldClassNames.validationMessage,\n secondaryTextBaseClassName,\n validationState === 'error' && secondaryTextStyles.error,\n !!state.validationMessageIcon && secondaryTextStyles.withIcon,\n state.validationMessage.className,\n );\n }\n\n if (state.hint) {\n state.hint.className = mergeClasses(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);\n }\n};\n"],"mappings":";;;;;;AAAA,MAAAA,aAAA,gBAAAC,OAAA;AAEA,MAAAC,OAAA,gBAAAD,OAAA;AAGaE,OAAA,CAAAC,eAAe,GAA+B;EACzDC,IAAI,EAAE,WAAW;EACjBC,KAAK,EAAE,kBAAkB;EACzBC,iBAAiB,EAAE,8BAA8B;EACjDC,qBAAqB,EAAE,kCAAkC;EACzDC,IAAI,EAAE;CACP;AAED;AACA,MAAMC,QAAQ,GAAG,MAAM;AAEvB;;;AAGA,MAAMC,aAAa,gBAAGT,OA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K,CAACnC,iBAAiB,CAACuC,SAAS,GAAG5C,OAAA,CAAA6C,YAAY,CAC9C5C,OAAA,CAAAC,eAAe,CAACG,iBAAiB,EACjC6C,0BAA0B,EAC1BT,eAAe,KAAK,OAAO,IAAIU,mBAAmB,CAACnB,KAAK,EACxD,CAAC,CAACQ,KAAK,CAAClC,qBAAqB,IAAI6C,mBAAmB,CAACjB,QAAQ,EAC7DM,KAAK,CAACnC,iBAAiB,CAACuC,SAAS,CAClC;;EAGH,IAAIJ,KAAK,CAACjC,IAAI,EAAE;IACdiC,KAAK,CAACjC,IAAI,CAACqC,SAAS,GAAG5C,OAAA,CAAA6C,YAAY,CAAC5C,OAAA,CAAAC,eAAe,CAACK,IAAI,EAAE2C,0BAA0B,EAAEV,KAAK,CAACjC,IAAI,CAACqC,SAAS,CAAC;;AAE/G,CAAC;AApDY3C,OAAA,CAAAsC,uBAAuB,GAAAA,uBAAA"}
1
+ {"version":3,"sources":["../../../lib/components/Field/useFieldStyles.js"],"sourcesContent":["import { tokens, typographyStyles } from \"@fluentui/react-theme\";\nimport { __resetStyles, __styles, mergeClasses } from \"@griffel/react\";\nexport const fieldClassNames = {\n root: `fui-Field`,\n label: `fui-Field__label`,\n validationMessage: `fui-Field__validationMessage`,\n validationMessageIcon: `fui-Field__validationMessageIcon`,\n hint: `fui-Field__hint`\n};\n// Size of the icon in the validation message\nconst iconSize = \"12px\";\n/**\n * Styles for the root slot\n */\nconst useRootStyles = /*#__PURE__*/__styles({\n base: {\n mc9l5x: \"f13qh94s\"\n },\n horizontal: {\n Budl1dq: \"f2wwaib\",\n wkccdc: \"f1645dqt\"\n },\n horizontalNoLabel: {\n uwmqm3: [\"f15jqgz8\", \"fggqkej\"],\n Budl1dq: \"f1c2z91y\"\n }\n}, {\n d: [\".f13qh94s{display:grid;}\", \".f2wwaib{grid-template-columns:33% 1fr;}\", \".f1645dqt{grid-template-rows:auto auto auto 1fr;}\", \".f15jqgz8{padding-left:33%;}\", \".fggqkej{padding-right:33%;}\", \".f1c2z91y{grid-template-columns:1fr;}\"]\n});\nconst useLabelStyles = /*#__PURE__*/__styles({\n base: {\n z8tnut: \"fclwglc\",\n Byoj8tv: \"fywfov9\"\n },\n large: {\n z8tnut: \"f1sl3k7w\",\n Byoj8tv: \"f1brlhvm\"\n },\n vertical: {\n jrapky: \"fyacil5\"\n },\n verticalLarge: {\n jrapky: \"f8l5zjj\"\n },\n horizontal: {\n t21cq0: [\"fkujibs\", \"f199hnxi\"],\n Ijaq50: \"f16hsg94\",\n nk6f5a: \"f1nzqi2z\"\n }\n}, {\n d: [\".fclwglc{padding-top:var(--spacingVerticalXXS);}\", \".fywfov9{padding-bottom:var(--spacingVerticalXXS);}\", \".f1sl3k7w{padding-top:1px;}\", \".f1brlhvm{padding-bottom:1px;}\", \".fyacil5{margin-bottom:var(--spacingVerticalXXS);}\", \".f8l5zjj{margin-bottom:var(--spacingVerticalXS);}\", \".fkujibs{margin-right:var(--spacingHorizontalM);}\", \".f199hnxi{margin-left:var(--spacingHorizontalM);}\", \".f16hsg94{grid-row-start:1;}\", \".f1nzqi2z{grid-row-end:-1;}\"]\n});\nconst useSecondaryTextBaseClassName = /*#__PURE__*/__resetStyles(\"r5c4z9l\", null, [\".r5c4z9l{margin-top:var(--spacingVerticalXXS);color:var(--colorNeutralForeground3);font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}\"]);\nconst useSecondaryTextStyles = /*#__PURE__*/__styles({\n error: {\n sj55zd: \"f1hcrxcs\"\n },\n withIcon: {\n uwmqm3: [\"frawy03\", \"fg4c52\"]\n }\n}, {\n d: [\".f1hcrxcs{color:var(--colorPaletteRedForeground1);}\", \".frawy03{padding-left:calc(12px + var(--spacingHorizontalXS));}\", \".fg4c52{padding-right:calc(12px + var(--spacingHorizontalXS));}\"]\n});\nconst useValidationMessageIconBaseClassName = /*#__PURE__*/__resetStyles(\"ra7h1uk\", \"r1rh6bd7\", [\".ra7h1uk{display:inline-block;font-size:12px;margin-left:calc(-12px - var(--spacingHorizontalXS));margin-right:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}\", \".r1rh6bd7{display:inline-block;font-size:12px;margin-right:calc(-12px - var(--spacingHorizontalXS));margin-left:var(--spacingHorizontalXS);line-height:0;vertical-align:-1px;}\"]);\nconst useValidationMessageIconStyles = /*#__PURE__*/__styles({\n error: {\n sj55zd: \"f1hcrxcs\"\n },\n warning: {\n sj55zd: \"f1k5f75o\"\n },\n success: {\n sj55zd: \"ffmvakt\"\n }\n}, {\n d: [\".f1hcrxcs{color:var(--colorPaletteRedForeground1);}\", \".f1k5f75o{color:var(--colorPaletteDarkOrangeForeground1);}\", \".ffmvakt{color:var(--colorPaletteGreenForeground1);}\"]\n});\n/**\n * Apply styling to the Field slots based on the state\n */\nexport const useFieldStyles_unstable = state => {\n const {\n validationState\n } = state;\n const horizontal = state.orientation === \"horizontal\";\n const rootStyles = useRootStyles();\n state.root.className = mergeClasses(fieldClassNames.root, rootStyles.base, horizontal && rootStyles.horizontal, horizontal && !state.label && rootStyles.horizontalNoLabel, state.root.className);\n const labelStyles = useLabelStyles();\n if (state.label) {\n state.label.className = mergeClasses(fieldClassNames.label, labelStyles.base, horizontal && labelStyles.horizontal, !horizontal && labelStyles.vertical, state.label.size === \"large\" && labelStyles.large, !horizontal && state.label.size === \"large\" && labelStyles.verticalLarge, state.label.className);\n }\n const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = mergeClasses(fieldClassNames.validationMessageIcon, validationMessageIconBaseClassName, validationState !== \"none\" && validationMessageIconStyles[validationState], state.validationMessageIcon.className);\n }\n const secondaryTextBaseClassName = useSecondaryTextBaseClassName();\n const secondaryTextStyles = useSecondaryTextStyles();\n if (state.validationMessage) {\n state.validationMessage.className = mergeClasses(fieldClassNames.validationMessage, secondaryTextBaseClassName, validationState === \"error\" && secondaryTextStyles.error, !!state.validationMessageIcon && secondaryTextStyles.withIcon, state.validationMessage.className);\n }\n if (state.hint) {\n state.hint.className = mergeClasses(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);\n }\n};\n//# sourceMappingURL=useFieldStyles.js.map"],"names":["fieldClassNames","useFieldStyles_unstable","root","label","validationMessage","validationMessageIcon","hint","iconSize","useRootStyles","__styles","base","mc9l5x","horizontal","Budl1dq","wkccdc","horizontalNoLabel","uwmqm3","d","useLabelStyles","z8tnut","Byoj8tv","large","vertical","jrapky","verticalLarge","t21cq0","Ijaq50","nk6f5a","useSecondaryTextBaseClassName","__resetStyles","useSecondaryTextStyles","error","sj55zd","withIcon","useValidationMessageIconBaseClassName","useValidationMessageIconStyles","warning","success","state","validationState","orientation","rootStyles","className","mergeClasses","labelStyles","size","validationMessageIconBaseClassName","validationMessageIconStyles","secondaryTextBaseClassName","secondaryTextStyles"],"mappings":";;;;;;;;;;;IAEaA,eAAe,MAAfA;IA8EAC,uBAAuB,MAAvBA;;uBA/EyC;AAC/C,MAAMD,kBAAkB;IAC7BE,MAAM,CAAC,SAAS,CAAC;IACjBC,OAAO,CAAC,gBAAgB,CAAC;IACzBC,mBAAmB,CAAC,4BAA4B,CAAC;IACjDC,uBAAuB,CAAC,gCAAgC,CAAC;IACzDC,MAAM,CAAC,eAAe,CAAC;AACzB;AACA,6CAA6C;AAC7C,MAAMC,WAAW;AACjB;;CAEC,GACD,MAAMC,gBAAgB,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IAC1CC,MAAM;QACJC,QAAQ;IACV;IACAC,YAAY;QACVC,SAAS;QACTC,QAAQ;IACV;IACAC,mBAAmB;QACjBC,QAAQ;YAAC;YAAY;SAAU;QAC/BH,SAAS;IACX;AACF,GAAG;IACDI,GAAG;QAAC;QAA4B;QAA4C;QAAqD;QAAgC;QAAgC;KAAwC;AAC3O;AACA,MAAMC,iBAAiB,WAAW,GAAET,IAAAA,kBAAQ,EAAC;IAC3CC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S;IAC5G,CAAC;AACH,GACA,0CAA0C"}
@@ -1,52 +1,24 @@
1
1
  "use strict";
2
-
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.makeDeprecatedField = exports.getDeprecatedFieldClassNames = exports.useField_unstable = exports.useFieldStyles_unstable = exports.renderField_unstable = exports.fieldClassNames = exports.Field = void 0;
7
- var Field_1 = /*#__PURE__*/require("./Field");
8
- Object.defineProperty(exports, "Field", {
9
- enumerable: true,
10
- get: function () {
11
- return Field_1.Field;
12
- }
13
- });
14
- Object.defineProperty(exports, "fieldClassNames", {
15
- enumerable: true,
16
- get: function () {
17
- return Field_1.fieldClassNames;
18
- }
19
- });
20
- Object.defineProperty(exports, "renderField_unstable", {
21
- enumerable: true,
22
- get: function () {
23
- return Field_1.renderField_unstable;
24
- }
25
- });
26
- Object.defineProperty(exports, "useFieldStyles_unstable", {
27
- enumerable: true,
28
- get: function () {
29
- return Field_1.useFieldStyles_unstable;
30
- }
31
- });
32
- Object.defineProperty(exports, "useField_unstable", {
33
- enumerable: true,
34
- get: function () {
35
- return Field_1.useField_unstable;
36
- }
37
- });
38
- // eslint-disable-next-line deprecation/deprecation
39
- var makeDeprecatedField_1 = /*#__PURE__*/require("./util/makeDeprecatedField");
40
- Object.defineProperty(exports, "getDeprecatedFieldClassNames", {
41
- enumerable: true,
42
- get: function () {
43
- return makeDeprecatedField_1.getDeprecatedFieldClassNames;
44
- }
45
- });
46
- Object.defineProperty(exports, "makeDeprecatedField", {
47
- enumerable: true,
48
- get: function () {
49
- return makeDeprecatedField_1.makeDeprecatedField;
50
- }
51
- });
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ Field: ()=>_field.Field,
13
+ fieldClassNames: ()=>_field.fieldClassNames,
14
+ renderField_unstable: ()=>_field.renderField_unstable,
15
+ useFieldStyles_unstable: ()=>_field.useFieldStyles_unstable,
16
+ useField_unstable: ()=>_field.useField_unstable,
17
+ getDeprecatedFieldClassNames: ()=>_makeDeprecatedField.getDeprecatedFieldClassNames,
18
+ makeDeprecatedField: ()=>_makeDeprecatedField.makeDeprecatedField
19
+ });
20
+ const _field = require("./Field");
21
+ const _makeDeprecatedField = require("./util/makeDeprecatedField");
22
+ //# sourceMappingURL=index.js.map
23
+
52
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Field_1","require","Object","defineProperty","exports","enumerable","get","Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","makeDeprecatedField_1","getDeprecatedFieldClassNames","makeDeprecatedField"],"sources":["../../../../../../../packages/react-components/react-field/src/index.ts"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from './Field';\nexport type { FieldProps, FieldSlots, FieldState } from './Field';\n\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from './util/makeDeprecatedField';\n// eslint-disable-next-line deprecation/deprecation\nexport type { DeprecatedFieldProps } from './util/makeDeprecatedField';\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,gBAAAC,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAO,KAAK;EAAA;AAAA;AAAEL,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAQ,eAAe;EAAA;AAAA;AAAEN,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAS,oBAAoB;EAAA;AAAA;AAAEP,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAU,uBAAuB;EAAA;AAAA;AAAER,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAN,OAAA,CAAAW,iBAAiB;EAAA;AAAA;AAGjG;AACA,IAAAC,qBAAA,gBAAAX,OAAA;AAASC,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,qBAAA,CAAAC,4BAA4B;EAAA;AAAA;AAAEX,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,UAAA;EAAAC,GAAA,WAAAA,CAAA;IAAA,OAAAM,qBAAA,CAAAE,mBAAmB;EAAA;AAAA"}
1
+ {"version":3,"sources":["../lib/index.js"],"sourcesContent":["export { Field, fieldClassNames, renderField_unstable, useFieldStyles_unstable, useField_unstable } from \"./Field\";\n// eslint-disable-next-line deprecation/deprecation\nexport { getDeprecatedFieldClassNames, makeDeprecatedField } from \"./util/makeDeprecatedField\";\n//# sourceMappingURL=index.js.map"],"names":["Field","fieldClassNames","renderField_unstable","useFieldStyles_unstable","useField_unstable","getDeprecatedFieldClassNames","makeDeprecatedField"],"mappings":";;;;;;;;;;;IAASA,KAAK,MAALA,YAAK;IAAEC,eAAe,MAAfA,sBAAe;IAAEC,oBAAoB,MAApBA,2BAAoB;IAAEC,uBAAuB,MAAvBA,8BAAuB;IAAEC,iBAAiB,MAAjBA,wBAAiB;IAExFC,4BAA4B,MAA5BA,iDAA4B;IAAEC,mBAAmB,MAAnBA,wCAAmB;;uBAF+C;qCAEvC;CAClE,iCAAiC"}
@@ -1,79 +1,61 @@
1
- "use strict";
2
-
1
+ /* eslint-disable deprecation/deprecation */ "use strict";
3
2
  Object.defineProperty(exports, "__esModule", {
4
- value: true
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: all[name]
9
+ });
10
+ }
11
+ _export(exports, {
12
+ makeDeprecatedField: ()=>makeDeprecatedField,
13
+ getDeprecatedFieldClassNames: ()=>getDeprecatedFieldClassNames
5
14
  });
6
- exports.getDeprecatedFieldClassNames = exports.makeDeprecatedField = void 0;
7
- /* eslint-disable deprecation/deprecation */
8
- const React = /*#__PURE__*/require("react");
9
- const Field_1 = /*#__PURE__*/require("../Field");
15
+ const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
16
+ const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
17
+ const _field = require("../Field");
10
18
  /**
11
19
  * Partition the props used by the Field itself, from the props that are passed to the underlying field component.
12
- */
13
- function getPartitionedFieldProps(props) {
14
- const {
15
- className,
16
- control,
17
- hint,
18
- label,
19
- orientation,
20
- required,
21
- root,
22
- size,
23
- style,
24
- validationMessage,
25
- validationMessageIcon,
26
- validationState = 'none',
27
- ...restOfProps
28
- } = props;
29
- return [{
30
- className,
31
- hint,
32
- label,
33
- orientation,
34
- required,
35
- size,
36
- style,
37
- validationMessage,
38
- validationMessageIcon,
39
- validationState,
40
- ...root
41
- }, {
42
- required,
43
- size,
44
- ...restOfProps,
45
- ...control
46
- }];
20
+ */ function getPartitionedFieldProps(props) {
21
+ const { className , control , hint , label , orientation , required , root , size , style , validationMessage , validationMessageIcon , validationState ="none" , ...restOfProps } = props;
22
+ return [
23
+ {
24
+ className,
25
+ hint,
26
+ label,
27
+ orientation,
28
+ required,
29
+ size,
30
+ style,
31
+ validationMessage,
32
+ validationMessageIcon,
33
+ validationState,
34
+ ...root
35
+ },
36
+ {
37
+ required,
38
+ size,
39
+ ...restOfProps,
40
+ ...control
41
+ }
42
+ ];
47
43
  }
48
- /**
49
- * @deprecated Only for use to make deprecated [Control]Field shim components.
50
- * @internal
51
- */
52
44
  function makeDeprecatedField(Control, options = {}) {
53
- const {
54
- mapProps = props => props,
55
- displayName = `${Control.displayName}Field`
56
- } = options;
57
- const DeprecatedField = React.forwardRef((props, ref) => {
58
- const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
59
- return React.createElement(Field_1.Field, {
60
- ...fieldProps
61
- }, React.createElement(Control, {
62
- ...controlProps,
63
- ref: ref
64
- }));
65
- });
66
- DeprecatedField.displayName = displayName;
67
- return DeprecatedField;
45
+ const { mapProps =(props)=>props , displayName =`${Control.displayName}Field` } = options;
46
+ const DeprecatedField = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
47
+ const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));
48
+ return /*#__PURE__*/ _react.createElement(_field.Field, fieldProps, /*#__PURE__*/ _react.createElement(Control, {
49
+ ...controlProps,
50
+ ref: ref
51
+ }));
52
+ });
53
+ DeprecatedField.displayName = displayName;
54
+ return DeprecatedField;
68
55
  }
69
- exports.makeDeprecatedField = makeDeprecatedField;
70
- /**
71
- * @deprecated Only for use to make deprecated [Control]Field shim components.
72
- * @internal
73
- */
74
- const getDeprecatedFieldClassNames = controlRootClassName => ({
75
- ...Field_1.fieldClassNames,
76
- control: controlRootClassName
77
- });
78
- exports.getDeprecatedFieldClassNames = getDeprecatedFieldClassNames;
56
+ const getDeprecatedFieldClassNames = (controlRootClassName)=>({
57
+ ..._field.fieldClassNames,
58
+ control: controlRootClassName
59
+ }); //# sourceMappingURL=makeDeprecatedField.js.map
60
+
79
61
  //# sourceMappingURL=makeDeprecatedField.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","require","Field_1","getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","makeDeprecatedField","Control","options","mapProps","displayName","DeprecatedField","forwardRef","ref","fieldProps","controlProps","createElement","Field","exports","getDeprecatedFieldClassNames","controlRootClassName","fieldClassNames"],"sources":["../../../../../../../../packages/react-components/react-field/src/util/makeDeprecatedField.tsx"],"sourcesContent":["/* eslint-disable deprecation/deprecation */\nimport * as React from 'react';\nimport { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from '../Field';\nimport { Field, fieldClassNames } from '../Field';\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport type DeprecatedFieldProps<ControlProps> = ControlProps & {\n root?: FieldProps;\n control?: ControlProps;\n} & Pick<\n FieldProps,\n | 'className'\n | 'hint'\n | 'label'\n | 'orientation'\n | 'style'\n | 'validationMessage'\n | 'validationMessageIcon'\n | 'validationState'\n >;\n\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps<ControlProps>(\n props: DeprecatedFieldProps<ControlProps> & Pick<FieldProps, 'required' | 'size'>,\n) {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n required,\n root,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState = 'none',\n ...restOfProps\n } = props;\n\n return [\n {\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root,\n },\n {\n required,\n size,\n ...restOfProps,\n ...control,\n },\n ];\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField<ControlProps>(\n Control: React.ComponentType<ControlProps>,\n options: {\n mapProps?: (props: DeprecatedFieldProps<ControlProps>) => DeprecatedFieldProps<ControlProps>;\n displayName?: string;\n } = {},\n) {\n const { mapProps = props => props, displayName = `${Control.displayName}Field` } = options;\n\n const DeprecatedField = React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return (\n <Field {...fieldProps}>\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\n <Control {...(controlProps as any)} ref={ref as any} />\n </Field>\n );\n }) as ForwardRefComponent<DeprecatedFieldProps<ControlProps>>;\n\n DeprecatedField.displayName = displayName;\n\n return DeprecatedField;\n}\n\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = (controlRootClassName: string) => ({\n ...fieldClassNames,\n control: controlRoot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EAEzC,OAAOC,eAAe;AACxB;AAtBAO,OAAA,CAAAZ,mBAAA,GAAAA,mBAAA;AAwBA;;;;AAIO,MAAMa,4BAA4B,GAAIC,oBAA4B,KAAM;EAC7E,GAAG9B,OAAA,CAAA+B,eAAe;EAClB3B,OAAO,EAAE0B;CACV,CAAC;AAHWF,OAAA,CAAAC,4BAA4B,GAAAA,4BAAA"}
1
+ {"version":3,"sources":["../../lib/util/makeDeprecatedField.js"],"sourcesContent":["/* eslint-disable deprecation/deprecation */import * as React from \"react\";\nimport { Field, fieldClassNames } from \"../Field\";\n/**\n * Partition the props used by the Field itself, from the props that are passed to the underlying field component.\n */\nfunction getPartitionedFieldProps(props) {\n const {\n className,\n control,\n hint,\n label,\n orientation,\n required,\n root,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState = \"none\",\n ...restOfProps\n } = props;\n return [{\n className,\n hint,\n label,\n orientation,\n required,\n size,\n style,\n validationMessage,\n validationMessageIcon,\n validationState,\n ...root\n }, {\n required,\n size,\n ...restOfProps,\n ...control\n }];\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport function makeDeprecatedField(Control, options = {}) {\n const {\n mapProps = props => props,\n displayName = `${Control.displayName}Field`\n } = options;\n const DeprecatedField = /*#__PURE__*/React.forwardRef((props, ref) => {\n const [fieldProps, controlProps] = getPartitionedFieldProps(mapProps(props));\n return /*#__PURE__*/React.createElement(Field, fieldProps, /*#__PURE__*/React.createElement(Control, {\n ...controlProps,\n ref: ref\n }));\n });\n DeprecatedField.displayName = displayName;\n return DeprecatedField;\n}\n/**\n * @deprecated Only for use to make deprecated [Control]Field shim components.\n * @internal\n */\nexport const getDeprecatedFieldClassNames = controlRootClassName => ({\n ...fieldClassNames,\n control: controlRootClassName\n});\n//# sourceMappingURL=makeDeprecatedField.js.map"],"names":["makeDeprecatedField","getDeprecatedFieldClassNames","getPartitionedFieldProps","props","className","control","hint","label","orientation","required","root","size","style","validationMessage","validationMessageIcon","validationState","restOfProps","Control","options","mapProps","displayName","DeprecatedField","React","forwardRef","ref","fieldProps","controlProps","createElement","Field","controlRootClassName","fieldClassNames"],"mappings":"AAAA,0CAA0C;;;;;;;;;;;IA4C1BA,mBAAmB,MAAnBA;IAmBHC,4BAA4B,MAA5BA;;;6DA/DsD;uBAC5B;AACvC;;CAEC,GACD,SAASC,yBAAyBC,KAAK,EAAE;IACvC,MAAM,EACJC,UAAS,EACTC,QAAO,EACPC,KAAI,EACJC,MAAK,EACLC,YAAW,EACXC,SAAQ,EACRC,KAAI,EACJC,KAAI,EACJC,MAAK,EACLC,kBAAiB,EACjBC,sBAAqB,EACrBC,iBAAkB,OAAM,EACxB,GAAGC,aACJ,GAAGb;IACJ,OAAO;QAAC;YACNC;YACAE;YACAC;YACAC;YACAC;YACAE;YACAC;YACAC;YACAC;YACAC;YACA,GAAGL,IAAI;QACT;QAAG;YACDD;YACAE;YACA,GAAGK,WAAW;YACd,GAAGX,OAAO;QACZ;KAAE;AACJ;AAKO,SAASL,oBAAoBiB,OAAO,EAAEC,UAAU,CAAC,CAAC,EAAE;IACzD,MAAM,EACJC,UAAWhB,CAAAA,QAASA,MAAK,EACzBiB,aAAc,CAAC,EAAEH,QAAQG,WAAW,CAAC,KAAK,CAAC,CAAA,EAC5C,GAAGF;IACJ,MAAMG,kBAAkB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACpB,OAAOqB,MAAQ;QACpE,MAAM,CAACC,YAAYC,aAAa,GAAGxB,yBAAyBiB,SAAShB;QACrE,OAAO,WAAW,GAAEmB,OAAMK,aAAa,CAACC,YAAK,EAAEH,YAAY,WAAW,GAAEH,OAAMK,aAAa,CAACV,SAAS;YACnG,GAAGS,YAAY;YACfF,KAAKA;QACP;IACF;IACAH,gBAAgBD,WAAW,GAAGA;IAC9B,OAAOC;AACT;AAKO,MAAMpB,+BAA+B4B,CAAAA,uBAAyB,CAAA;QACnE,GAAGC,sBAAe;QAClBzB,SAASwB;IACX,CAAA,GACA,+CAA+C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-field",
3
- "version": "0.0.0-nightly-20230317-0436.1",
3
+ "version": "0.0.0-nightly-20230317-1454.1",
4
4
  "description": "Fluent UI Field components",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -22,23 +22,23 @@
22
22
  "storybook": "start-storybook",
23
23
  "test": "jest --passWithNoTests",
24
24
  "type-check": "tsc -b tsconfig.json",
25
- "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
25
+ "generate-api": "just-scripts generate-api"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluentui/eslint-plugin": "*",
29
29
  "@fluentui/react-conformance": "*",
30
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230317-0436.1",
30
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20230317-1454.1",
31
31
  "@fluentui/scripts-api-extractor": "*",
32
32
  "@fluentui/scripts-tasks": "*"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-context-selector": "0.0.0-nightly-20230317-0436.1",
35
+ "@fluentui/react-context-selector": "0.0.0-nightly-20230317-1454.1",
36
36
  "@fluentui/react-icons": "^2.0.175",
37
- "@fluentui/react-label": "0.0.0-nightly-20230317-0436.1",
38
- "@fluentui/react-theme": "0.0.0-nightly-20230317-0436.1",
39
- "@fluentui/react-utilities": "0.0.0-nightly-20230317-0436.1",
37
+ "@fluentui/react-label": "0.0.0-nightly-20230317-1454.1",
38
+ "@fluentui/react-theme": "0.0.0-nightly-20230317-1454.1",
39
+ "@fluentui/react-utilities": "0.0.0-nightly-20230317-1454.1",
40
40
  "@griffel/react": "^1.5.2",
41
- "tslib": "^2.1.0"
41
+ "@swc/helpers": "^0.4.14"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@types/react": ">=16.8.0 <19.0.0",