@fluentui/react-field 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.0

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 (49) hide show
  1. package/CHANGELOG.md +34 -10
  2. package/README.md +13 -0
  3. package/lib/components/Field/Field.js.map +1 -1
  4. package/lib/components/Field/Field.module.css +89 -0
  5. package/lib/components/Field/Field.types.js.map +1 -1
  6. package/lib/components/Field/index.js.map +1 -1
  7. package/lib/components/Field/renderField.js +2 -2
  8. package/lib/components/Field/renderField.js.map +1 -1
  9. package/lib/components/Field/useField.js.map +1 -1
  10. package/lib/components/Field/useFieldBase.js.map +1 -1
  11. package/lib/components/Field/useFieldStyles.styles.css.js +25 -0
  12. package/lib/components/Field/useFieldStyles.styles.css.js.map +1 -0
  13. package/lib/components/Field/useFieldStyles.styles.raw.css.js +25 -0
  14. package/lib/components/Field/useFieldStyles.styles.raw.css.js.map +1 -0
  15. package/lib/components/Field/useFieldStyles.styles.raw.js.map +1 -1
  16. package/lib/contexts/FieldContext.js.map +1 -1
  17. package/lib/contexts/index.js.map +1 -1
  18. package/lib/contexts/useFieldContextValues.js.map +1 -1
  19. package/lib/contexts/useFieldControlProps.js +6 -12
  20. package/lib/contexts/useFieldControlProps.js.map +1 -1
  21. package/lib-commonjs/Field.cjs +7 -7
  22. package/lib-commonjs/components/Field/Field.cjs.map +1 -1
  23. package/lib-commonjs/components/Field/Field.module.css +89 -0
  24. package/lib-commonjs/components/Field/Field.types.cjs.map +1 -1
  25. package/lib-commonjs/components/Field/index.cjs +7 -7
  26. package/lib-commonjs/components/Field/index.cjs.map +1 -1
  27. package/lib-commonjs/components/Field/renderField.cjs.map +1 -1
  28. package/lib-commonjs/components/Field/useField.cjs.map +1 -1
  29. package/lib-commonjs/components/Field/useFieldBase.cjs.map +1 -1
  30. package/lib-commonjs/components/Field/useFieldStyles.styles.cjs +3 -3
  31. package/lib-commonjs/components/Field/useFieldStyles.styles.cjs.map +1 -1
  32. package/lib-commonjs/components/Field/useFieldStyles.styles.css.cjs +44 -0
  33. package/lib-commonjs/components/Field/useFieldStyles.styles.css.cjs.map +1 -0
  34. package/lib-commonjs/components/Field/useFieldStyles.styles.raw.cjs +3 -3
  35. package/lib-commonjs/components/Field/useFieldStyles.styles.raw.cjs.map +1 -1
  36. package/lib-commonjs/components/Field/useFieldStyles.styles.raw.css.cjs +44 -0
  37. package/lib-commonjs/components/Field/useFieldStyles.styles.raw.css.cjs.map +1 -0
  38. package/lib-commonjs/contexts/FieldContext.cjs +3 -3
  39. package/lib-commonjs/contexts/FieldContext.cjs.map +1 -1
  40. package/lib-commonjs/contexts/index.cjs +6 -6
  41. package/lib-commonjs/contexts/index.cjs.map +1 -1
  42. package/lib-commonjs/contexts/useFieldContextValues.cjs.map +1 -1
  43. package/lib-commonjs/contexts/useFieldControlProps.cjs +9 -15
  44. package/lib-commonjs/contexts/useFieldControlProps.cjs.map +1 -1
  45. package/lib-commonjs/index.cjs +11 -11
  46. package/lib-commonjs/index.cjs.map +1 -1
  47. package/package.json +14 -14
  48. package/dist/metadata/api/api-root.json +0 -1
  49. package/dist/metadata/index.json +0 -1
package/CHANGELOG.md CHANGED
@@ -1,22 +1,46 @@
1
1
  # Change Log - @fluentui/react-field
2
2
 
3
- <!-- This log was last generated on Tue, 06 Oct 2026 11:40:22 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Sat, 31 Oct 2026 11:08:44 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.74.7-experimental.cli-api.20261006-ccaa611d58.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.74.7-experimental.cli-api.20261006-ccaa611d58.0)
7
+ ## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
8
8
 
9
- Tue, 06 Oct 2026 11:40:22 GMT
9
+ Sat, 31 Oct 2026 11:08:44 GMT
10
10
 
11
11
  ### Changes
12
12
 
13
- - Release 9.74.7-experimental.cli-api.20261006-ccaa611d58 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
- - Bump @fluentui/react-context-selector to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
- - Bump @fluentui/react-jsx-runtime to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
- - Bump @fluentui/react-label to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
- - Bump @fluentui/react-theme to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
- - Bump @fluentui/react-utilities to v9.74.7-experimental.cli-api.20261006-ccaa611d58.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
13
+ - Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
14
+ - Bump @fluentui/react-context-selector to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
15
+ - Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
16
+ - Bump @fluentui/react-label to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
18
+ - Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
19
+ - Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
+
21
+ ## [9.5.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.5.6)
22
+
23
+ Mon, 19 Oct 2026 16:49:01 GMT
24
+
25
+ ### Patches
26
+
27
+ - Bump @fluentui/react-context-selector to v9.2.21 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
28
+ - Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
29
+ - Bump @fluentui/react-label to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
30
+ - Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
31
+
32
+ ## [9.5.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.5.5)
33
+
34
+ Tue, 22 Sep 2026 11:25:39 GMT
35
+
36
+ ### Patches
37
+
38
+ - fix: remove unused react-dom and @types/react-dom peer dependencies, mark @types/react as optional ([PR #36559](https://github.com/microsoft/fluentui/pull/36559) by martinhochel@microsoft.com)
39
+ - Bump @fluentui/react-context-selector to v9.2.20 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
40
+ - Bump @fluentui/react-jsx-runtime to v9.4.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
41
+ - Bump @fluentui/react-label to v9.4.5 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
42
+ - Bump @fluentui/react-shared-contexts to v9.26.4 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
43
+ - Bump @fluentui/react-utilities to v9.26.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
20
44
 
21
45
  ## [9.5.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.5.4)
22
46
 
package/README.md CHANGED
@@ -66,3 +66,16 @@ See [SPEC.md](./SPEC.md).
66
66
  ### Migration Guide
67
67
 
68
68
  If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating the Field component.
69
+
70
+ ## Opt-in CSS Modules styles
71
+
72
+ The `use*Styles.styles.css` modules beside the existing Griffel hooks provide opt-in,
73
+ layered CSS alternatives with the same exports. Configure the bundler to replace
74
+ `.styles` with `.styles.css.ts` for source imports and `.styles.js` with
75
+ `.styles.css.js` for built imports. Load CSS Modules as default class-name maps and
76
+ retain the package CSS assets. Default component imports still use Griffel.
77
+ Composed components require their own style alternatives; this does not remove
78
+ all reachable Griffel dependencies. Browser, forced-colors, RTL, and visual-regression
79
+ parity must be validated before switching defaults.
80
+
81
+ Select the CSS Modules alternative for the composed `Label` as well; mixing a layered parent with an unlayered Griffel child can change the label cascade.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/Field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from './Field.types';\nimport { renderField_unstable } from './renderField';\nimport { useField_unstable } from './useField';\nimport { useFieldStyles_unstable } from './useFieldStyles.styles';\nimport { useFieldContextValues_unstable } from '../../contexts/index';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nexport const Field: ForwardRefComponent<FieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref);\n useFieldStyles_unstable(state);\n useCustomStyleHook_unstable('useFieldStyles_unstable')(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nField.displayName = 'Field';\n"],"names":["React","renderField_unstable","useField_unstable","useFieldStyles_unstable","useFieldContextValues_unstable","useCustomStyleHook_unstable","Field","forwardRef","props","ref","state","context","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,uBAAuB,QAAQ,6BAA0B;AAClE,SAASC,8BAA8B,QAAQ,0BAAuB;AACtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,OAAO,MAAMC,sBAAyCN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IACvCN,wBAAwBO;IACxBL,4BAA4B,2BAA2BK;IACvD,MAAMC,UAAUP,+BAA+BM;IAC/C,OAAOT,qBAAqBS,OAAOC;AACrC,GAAG;AAEHL,MAAMM,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from './Field.types';\nimport { renderField_unstable } from './renderField';\nimport { useField_unstable } from './useField';\nimport { useFieldStyles_unstable } from './useFieldStyles.styles';\nimport { useFieldContextValues_unstable } from '../../contexts/index';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nexport const Field: ForwardRefComponent<FieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref);\n useFieldStyles_unstable(state);\n useCustomStyleHook_unstable('useFieldStyles_unstable')(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nField.displayName = 'Field';\n"],"names":["React","renderField_unstable","useField_unstable","useFieldStyles_unstable","useFieldContextValues_unstable","useCustomStyleHook_unstable","Field","forwardRef","props","ref","state","context","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,uBAAuB,QAAQ,6BAA0B;AAClE,SAASC,8BAA8B,QAAQ,0BAAuB;AACtE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,OAAO,MAAMC,sBAAyCN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,QAAQR,kBAAkBM,OAAOC;IACvCN,wBAAwBO;IACxBL,4BAA4B,2BAA2BK;IACvD,MAAMC,UAAUP,+BAA+BM;IAC/C,OAAOT,qBAAqBS,OAAOC;AACrC,GAAG;AAEHL,MAAMM,WAAW,GAAG"}
@@ -0,0 +1,89 @@
1
+ @layer fluentui {
2
+ .root {
3
+ display: grid;
4
+ }
5
+
6
+ .root:where(.horizontal) {
7
+ grid-template-columns: 33% 1fr;
8
+ grid-template-rows: auto auto auto 1fr;
9
+ }
10
+
11
+ .root:where(.horizontal:not(.withLabel)) {
12
+ padding-inline-start: 33%;
13
+ grid-template-columns: 1fr;
14
+ }
15
+
16
+ .label {
17
+ max-width: max-content;
18
+ max-height: max-content;
19
+ }
20
+
21
+ :where(.vertical) > .label {
22
+ padding-top: var(--spacingVerticalXXS);
23
+ padding-bottom: var(--spacingVerticalXXS);
24
+ margin-bottom: var(--spacingVerticalXXS);
25
+ }
26
+
27
+ :where(.vertical.large) > .label {
28
+ padding-top: calc(var(--spacingVerticalXXS) / 2);
29
+ padding-bottom: calc(var(--spacingVerticalXXS) / 2);
30
+ margin-bottom: var(--spacingVerticalXS);
31
+ }
32
+
33
+ :where(.horizontal) > .label {
34
+ padding-top: var(--spacingVerticalSNudge);
35
+ padding-bottom: var(--spacingVerticalSNudge);
36
+ margin-inline-end: var(--spacingHorizontalM);
37
+ grid-row-start: 1;
38
+ grid-row-end: -1;
39
+ }
40
+
41
+ :where(.horizontal.small) > .label {
42
+ padding-top: var(--spacingVerticalXS);
43
+ padding-bottom: var(--spacingVerticalXS);
44
+ }
45
+
46
+ :where(.horizontal.large) > .label {
47
+ padding-top: calc(var(--spacingVerticalS) + var(--spacingVerticalXXS) / 2);
48
+ padding-bottom: calc(var(--spacingVerticalS) + var(--spacingVerticalXXS) / 2);
49
+ }
50
+
51
+ .validationMessage,
52
+ .hint {
53
+ margin-top: var(--spacingVerticalXXS);
54
+ color: var(--colorNeutralForeground3);
55
+ font-family: var(--fontFamilyBase);
56
+ font-size: var(--fontSizeBase200);
57
+ font-weight: var(--fontWeightRegular);
58
+ line-height: var(--lineHeightBase200);
59
+ }
60
+
61
+ :where(.error) > .validationMessage {
62
+ color: var(--colorPaletteRedForeground1);
63
+ }
64
+
65
+ :where(.withIcon) > .validationMessage {
66
+ padding-inline-start: calc(var(--spacingHorizontalM) + var(--spacingHorizontalXS));
67
+ }
68
+
69
+ .validationMessageIcon {
70
+ display: inline-block;
71
+ font-size: var(--fontSizeBase200);
72
+ margin-inline-start: calc(calc(0px - var(--spacingHorizontalM)) - var(--spacingHorizontalXS));
73
+ margin-inline-end: var(--spacingHorizontalXS);
74
+ line-height: 0;
75
+ vertical-align: calc(var(--spacingVerticalXXS) / -2);
76
+ }
77
+
78
+ :where(.error) > :where(.validationMessage) > .validationMessageIcon {
79
+ color: var(--colorPaletteRedForeground1);
80
+ }
81
+
82
+ :where(.warning) > :where(.validationMessage) > .validationMessageIcon {
83
+ color: var(--colorPaletteDarkOrangeForeground1);
84
+ }
85
+
86
+ :where(.success) > :where(.validationMessage) > .validationMessageIcon {
87
+ color: var(--colorPaletteGreenForeground1);
88
+ }
89
+ }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/Field.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\n\n/**\n * The props added to the control inside the Field.\n */\nexport type FieldControlProps = Pick<\n React.HTMLAttributes<HTMLElement>,\n 'id' | 'aria-labelledby' | 'aria-describedby' | 'aria-invalid' | 'aria-required'\n>;\n\n/**\n * Slots of the Field component\n */\nexport type FieldSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * The label associated with the field.\n */\n label?: Slot<typeof Label>;\n\n /**\n * A message about the validation state. By default, this is an error message, but it can be a success, warning,\n * or custom message by setting `validationState`.\n */\n validationMessage?: Slot<'div'>;\n\n /**\n * The icon associated with the `validationMessage`. This will only be displayed if `validationMessage` is set.\n *\n * The default depends on `validationState`:\n * * error: `<ErrorCircle12Filled />`\n * * warning: `<Warning12Filled />`\n * * success: `<CheckmarkCircle12Filled />`\n * * none: `null`\n */\n validationMessageIcon?: Slot<'span'>;\n\n /**\n * Additional hint text below the field.\n */\n hint?: Slot<'div'>;\n};\n\n/**\n * Field Props\n */\nexport type FieldProps = Omit<ComponentProps<FieldSlots>, 'children'> & {\n /**\n * The Field's child can be a single form control, or a render function that takes the props that should be spread on\n * a form control.\n *\n * All form controls in this library can be used directly as children (such as `<Input>` or `<RadioGroup>`).\n *\n * For other controls, there are two options:\n * 1. The child of Field can be a render function that is given the props that should be spread on the control.\n * `<Field>{(props) => <MyInput {...props} />}</Field>`\n * 2. The control itself can merge props from field with useFieldControlProps_unstable().\n * `props = useFieldControlProps_unstable(props);`\n */\n children?: React.ReactNode | ((props: FieldControlProps) => React.ReactNode);\n\n /**\n * The orientation of the label relative to the field component.\n * This only affects the label, and not the validationMessage or hint (which always appear below the field component).\n *\n * @default vertical\n */\n orientation?: 'vertical' | 'horizontal';\n\n /**\n * The `validationState` affects the display of the `validationMessage` and `validationMessageIcon`.\n *\n * * error: (default) The validation message has a red error icon and red text, with `role=\"alert\"` so it is\n * announced by screen readers. Additionally, the control inside the field has `aria-invalid` set, which adds a\n * red border to some field components (such as `Input`).\n * * success: The validation message has a green checkmark icon and gray text.\n * * warning: The validation message has a yellow exclamation icon and gray text, with `role=\"alert\"` so it is\n * announced by screen readers.\n * * none: The validation message has no icon and gray text.\n *\n * @default error when validationMessage is set; none otherwise.\n */\n validationState?: 'error' | 'warning' | 'success' | 'none';\n\n /**\n * Marks the Field as required. If `true`, an asterisk will be appended to the label, and `aria-required` will be set\n * on the Field's child.\n */\n required?: boolean;\n\n /**\n * The size of the Field's label.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering Field\n */\nexport type FieldState = ComponentState<Required<FieldSlots>> &\n Required<Pick<FieldProps, 'orientation' | 'required' | 'size' | 'validationState'>> &\n Pick<FieldProps, 'children'> & {\n /**\n * The ID generated for the control inside the field, and the default value of label.htmlFor prop.\n */\n generatedControlId: string;\n };\n\nexport type FieldBaseProps = DistributiveOmit<FieldProps, 'orientation' | 'size'>;\n\nexport type FieldBaseState = DistributiveOmit<FieldState, 'orientation' | 'size'>;\n\nexport type FieldContextValue = Readonly<\n Pick<FieldState, 'generatedControlId' | 'orientation' | 'required' | 'size' | 'validationState'> & {\n /** The label's for prop. Undefined if there is no label. */\n labelFor?: string;\n /** The label's id prop. Undefined if there is no label. */\n labelId?: string;\n /** The validationMessage's id prop. Undefined if there is no validationMessage. */\n validationMessageId?: string;\n /** The hint's id prop. Undefined if there is no hint. */\n hintId?: string;\n }\n>;\n\nexport type FieldContextValues = {\n field: FieldContextValue;\n};\n"],"names":[],"mappings":"AAkIA,WAEE"}
1
+ {"version":3,"sources":["../../../src/components/Field/Field.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, DistributiveOmit, Slot } from '@fluentui/react-utilities';\n\n/**\n * The props added to the control inside the Field.\n */\nexport type FieldControlProps = Pick<\n React.HTMLAttributes<HTMLElement>,\n 'id' | 'aria-labelledby' | 'aria-describedby' | 'aria-invalid' | 'aria-required'\n>;\n\n/**\n * Slots of the Field component\n */\nexport type FieldSlots = {\n root: NonNullable<Slot<'div'>>;\n\n /**\n * The label associated with the field.\n */\n label?: Slot<typeof Label>;\n\n /**\n * A message about the validation state. By default, this is an error message, but it can be a success, warning,\n * or custom message by setting `validationState`.\n */\n validationMessage?: Slot<'div'>;\n\n /**\n * The icon associated with the `validationMessage`. This will only be displayed if `validationMessage` is set.\n *\n * The default depends on `validationState`:\n * * error: `<ErrorCircle12Filled />`\n * * warning: `<Warning12Filled />`\n * * success: `<CheckmarkCircle12Filled />`\n * * none: `null`\n */\n validationMessageIcon?: Slot<'span'>;\n\n /**\n * Additional hint text below the field.\n */\n hint?: Slot<'div'>;\n};\n\n/**\n * Field Props\n */\nexport type FieldProps = Omit<ComponentProps<FieldSlots>, 'children'> & {\n /**\n * The Field's child can be a single form control, or a render function that takes the props that should be spread on\n * a form control.\n *\n * All form controls in this library can be used directly as children (such as `<Input>` or `<RadioGroup>`).\n *\n * For other controls, there are two options:\n * 1. The child of Field can be a render function that is given the props that should be spread on the control.\n * `<Field>{(props) => <MyInput {...props} />}</Field>`\n * 2. The control itself can merge props from field with useFieldControlProps_unstable().\n * `props = useFieldControlProps_unstable(props);`\n */\n children?: React.ReactNode | ((props: FieldControlProps) => React.ReactNode);\n\n /**\n * The orientation of the label relative to the field component.\n * This only affects the label, and not the validationMessage or hint (which always appear below the field component).\n *\n * @default vertical\n */\n orientation?: 'vertical' | 'horizontal';\n\n /**\n * The `validationState` affects the display of the `validationMessage` and `validationMessageIcon`.\n *\n * * error: (default) The validation message has a red error icon and red text, with `role=\"alert\"` so it is\n * announced by screen readers. Additionally, the control inside the field has `aria-invalid` set, which adds a\n * red border to some field components (such as `Input`).\n * * success: The validation message has a green checkmark icon and gray text.\n * * warning: The validation message has a yellow exclamation icon and gray text, with `role=\"alert\"` so it is\n * announced by screen readers.\n * * none: The validation message has no icon and gray text.\n *\n * @default error when validationMessage is set; none otherwise.\n */\n validationState?: 'error' | 'warning' | 'success' | 'none';\n\n /**\n * Marks the Field as required. If `true`, an asterisk will be appended to the label, and `aria-required` will be set\n * on the Field's child.\n */\n required?: boolean;\n\n /**\n * The size of the Field's label.\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n};\n\n/**\n * State used in rendering Field\n */\nexport type FieldState = ComponentState<Required<FieldSlots>> &\n Required<Pick<FieldProps, 'orientation' | 'required' | 'size' | 'validationState'>> &\n Pick<FieldProps, 'children'> & {\n /**\n * The ID generated for the control inside the field, and the default value of label.htmlFor prop.\n */\n generatedControlId: string;\n };\n\nexport type FieldBaseProps = DistributiveOmit<FieldProps, 'orientation' | 'size'>;\n\nexport type FieldBaseState = DistributiveOmit<FieldState, 'orientation' | 'size'>;\n\nexport type FieldContextValue = Readonly<\n Pick<FieldState, 'generatedControlId' | 'orientation' | 'required' | 'size' | 'validationState'> & {\n /** The label's for prop. Undefined if there is no label. */\n labelFor?: string;\n /** The label's id prop. Undefined if there is no label. */\n labelId?: string;\n /** The validationMessage's id prop. Undefined if there is no validationMessage. */\n validationMessageId?: string;\n /** The hint's id prop. Undefined if there is no hint. */\n hintId?: string;\n }\n>;\n\nexport type FieldContextValues = {\n field: FieldContextValue;\n};\n"],"names":[],"mappings":"AAkIA,WAEE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/index.ts"],"sourcesContent":["export type {\n FieldBaseProps,\n FieldBaseState,\n FieldContextValue,\n FieldContextValues,\n FieldControlProps,\n FieldProps,\n FieldSlots,\n FieldState,\n} from './Field.types';\nexport { Field } from './Field';\nexport { renderField_unstable } from './renderField';\nexport { useField_unstable } from './useField';\nexport { useFieldBase_unstable } from './useFieldBase';\nexport { fieldClassNames, useFieldStyles_unstable } from './useFieldStyles.styles';\n"],"names":["Field","renderField_unstable","useField_unstable","useFieldBase_unstable","fieldClassNames","useFieldStyles_unstable"],"mappings":"AAUA,SAASA,KAAK,QAAQ,aAAU;AAChC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,6BAA0B"}
1
+ {"version":3,"sources":["../../../src/components/Field/index.ts"],"sourcesContent":["export type {\n FieldBaseProps,\n FieldBaseState,\n FieldContextValue,\n FieldContextValues,\n FieldControlProps,\n FieldProps,\n FieldSlots,\n FieldState,\n} from './Field.types';\nexport { Field } from './Field';\nexport { renderField_unstable } from './renderField';\nexport { useField_unstable } from './useField';\nexport { useFieldBase_unstable } from './useFieldBase';\nexport { fieldClassNames, useFieldStyles_unstable } from './useFieldStyles.styles';\n"],"names":["Field","renderField_unstable","useField_unstable","useFieldBase_unstable","fieldClassNames","useFieldStyles_unstable"],"mappings":"AAUA,SAASA,KAAK,QAAQ,aAAU;AAChC,SAASC,oBAAoB,QAAQ,mBAAgB;AACrD,SAASC,iBAAiB,QAAQ,gBAAa;AAC/C,SAASC,qBAAqB,QAAQ,oBAAiB;AACvD,SAASC,eAAe,EAAEC,uBAAuB,QAAQ,6BAA0B"}
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from "@fluentui/react-utilities";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  import { FieldContextProvider, getFieldControlProps } from "../../contexts/index.js";
4
4
  /**
5
5
  * Render the final JSX of Field
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/renderField.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\nimport type { FieldContextValues, FieldSlots, FieldBaseState } from './Field.types';\n\n/**\n * Render the final JSX of Field\n */\nexport const renderField_unstable = (state: FieldBaseState, contextValues: FieldContextValues): JSXElement => {\n assertSlots<FieldSlots>(state);\n\n let { children } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n\n return (\n <FieldContextProvider value={contextValues?.field}>\n <state.root>\n {state.label && <state.label />}\n {children}\n {state.validationMessage && (\n <state.validationMessage>\n {state.validationMessageIcon && <state.validationMessageIcon />}\n {state.validationMessage.children}\n </state.validationMessage>\n )}\n\n {state.hint && <state.hint />}\n </state.root>\n </FieldContextProvider>\n );\n};\n"],"names":["assertSlots","FieldContextProvider","getFieldControlProps","renderField_unstable","state","contextValues","children","field","value","root","label","validationMessage","validationMessageIcon","hint"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,0BAAuB;AAGlF;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAuBC;IAC1DL,YAAwBI;IAExB,IAAI,EAAEE,QAAQ,EAAE,GAAGF;IACnB,IAAI,OAAOE,aAAa,YAAY;QAClCA,WAAWA,SAASJ,qBAAqBG,cAAcE,KAAK,KAAK,CAAC;IACpE;IAEA,qBACE,KAACN;QAAqBO,KAAK,EAAEH,0BAAAA,oCAAAA,cAAeE,KAAK;kBAC/C,cAAA,MAACH,MAAMK,IAAI;;gBACRL,MAAMM,KAAK,kBAAI,KAACN,MAAMM,KAAK;gBAC3BJ;gBACAF,MAAMO,iBAAiB,kBACtB,MAACP,MAAMO,iBAAiB;;wBACrBP,MAAMQ,qBAAqB,kBAAI,KAACR,MAAMQ,qBAAqB;wBAC3DR,MAAMO,iBAAiB,CAACL,QAAQ;;;gBAIpCF,MAAMS,IAAI,kBAAI,KAACT,MAAMS,IAAI;;;;AAIlC,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Field/renderField.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { FieldContextProvider, getFieldControlProps } from '../../contexts/index';\nimport type { FieldContextValues, FieldSlots, FieldBaseState } from './Field.types';\n\n/**\n * Render the final JSX of Field\n */\nexport const renderField_unstable = (state: FieldBaseState, contextValues: FieldContextValues): JSXElement => {\n assertSlots<FieldSlots>(state);\n\n let { children } = state;\n if (typeof children === 'function') {\n children = children(getFieldControlProps(contextValues.field) || {});\n }\n\n return (\n <FieldContextProvider value={contextValues?.field}>\n <state.root>\n {state.label && <state.label />}\n {children}\n {state.validationMessage && (\n <state.validationMessage>\n {state.validationMessageIcon && <state.validationMessageIcon />}\n {state.validationMessage.children}\n </state.validationMessage>\n )}\n\n {state.hint && <state.hint />}\n </state.root>\n </FieldContextProvider>\n );\n};\n"],"names":["assertSlots","FieldContextProvider","getFieldControlProps","renderField_unstable","state","contextValues","children","field","value","root","label","validationMessage","validationMessageIcon","hint"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,0BAAuB;AAGlF;;CAEC,GACD,OAAO,MAAMC,uBAAuB,CAACC,OAAuBC;IAC1DL,YAAwBI;IAExB,IAAI,EAAEE,QAAQ,EAAE,GAAGF;IACnB,IAAI,OAAOE,aAAa,YAAY;QAClCA,WAAWA,SAASJ,qBAAqBG,cAAcE,KAAK,KAAK,CAAC;IACpE;IAEA,qBACE,KAACN;QAAqBO,KAAK,EAAEH,0BAAAA,oCAAAA,cAAeE,KAAK;kBAC/C,cAAA,MAACH,MAAMK,IAAI;;gBACRL,MAAMM,KAAK,kBAAI,KAACN,MAAMM,KAAK;gBAC3BJ;gBACAF,MAAMO,iBAAiB,kBACtB,MAACP,MAAMO,iBAAiB;;wBACrBP,MAAMQ,qBAAqB,kBAAI,KAACR,MAAMQ,qBAAqB;wBAC3DR,MAAMO,iBAAiB,CAACL,QAAQ;;;gBAIpCF,MAAMS,IAAI,kBAAI,KAACT,MAAMS,IAAI;;;;AAIlC,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/useField.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { CheckmarkCircle12Filled, DiamondDismiss12Filled, Warning12Filled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { slot } from '@fluentui/react-utilities';\nimport type { FieldProps, FieldState } from './Field.types';\nimport { useFieldBase_unstable } from './useFieldBase';\n\nconst validationMessageIcons = {\n error: <DiamondDismiss12Filled />,\n warning: <Warning12Filled />,\n success: <CheckmarkCircle12Filled />,\n none: undefined,\n} as const;\n\n/**\n * Create the state required to render Field.\n *\n * The returned state can be modified with hooks such as useFieldStyles_unstable,\n * before being passed to renderField_unstable.\n *\n * @param props - Props passed to this field\n * @param ref - Ref to the root\n */\nexport const useField_unstable = (props: FieldProps, ref: React.Ref<HTMLDivElement>): FieldState => {\n const { orientation = 'vertical', size = 'medium', ...fieldProps } = props;\n const state = useFieldBase_unstable(fieldProps, ref);\n\n const defaultIcon = validationMessageIcons[state.validationState];\n\n return {\n ...state,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n components: { ...state.components, label: Label },\n label: slot.optional(props.label, {\n defaultProps: { size, ...state.label },\n elementType: Label,\n }),\n validationMessageIcon: slot.optional(props.validationMessageIcon, {\n renderByDefault: !!defaultIcon,\n defaultProps: { children: defaultIcon },\n elementType: 'span',\n }),\n orientation,\n size,\n };\n};\n"],"names":["React","CheckmarkCircle12Filled","DiamondDismiss12Filled","Warning12Filled","Label","slot","useFieldBase_unstable","validationMessageIcons","error","warning","success","none","undefined","useField_unstable","props","ref","orientation","size","fieldProps","state","defaultIcon","validationState","components","label","optional","defaultProps","elementType","validationMessageIcon","renderByDefault","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,EAAEC,sBAAsB,EAAEC,eAAe,QAAQ,wBAAwB;AACzG,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,qBAAqB,QAAQ,oBAAiB;AAEvD,MAAMC,yBAAyB;IAC7BC,qBAAO,oBAACN;IACRO,uBAAS,oBAACN;IACVO,uBAAS,oBAACT;IACVU,MAAMC;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,cAAc,UAAU,EAAEC,OAAO,QAAQ,EAAE,GAAGC,YAAY,GAAGJ;IACrE,MAAMK,QAAQb,sBAAsBY,YAAYH;IAEhD,MAAMK,cAAcb,sBAAsB,CAACY,MAAME,eAAe,CAAC;IAEjE,OAAO;QACL,GAAGF,KAAK;QACR,4DAA4D;QAC5DG,YAAY;YAAE,GAAGH,MAAMG,UAAU;YAAEC,OAAOnB;QAAM;QAChDmB,OAAOlB,KAAKmB,QAAQ,CAACV,MAAMS,KAAK,EAAE;YAChCE,cAAc;gBAAER;gBAAM,GAAGE,MAAMI,KAAK;YAAC;YACrCG,aAAatB;QACf;QACAuB,uBAAuBtB,KAAKmB,QAAQ,CAACV,MAAMa,qBAAqB,EAAE;YAChEC,iBAAiB,CAAC,CAACR;YACnBK,cAAc;gBAAEI,UAAUT;YAAY;YACtCM,aAAa;QACf;QACAV;QACAC;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Field/useField.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { CheckmarkCircle12Filled, DiamondDismiss12Filled, Warning12Filled } from '@fluentui/react-icons';\nimport { Label } from '@fluentui/react-label';\nimport { slot } from '@fluentui/react-utilities';\nimport type { FieldProps, FieldState } from './Field.types';\nimport { useFieldBase_unstable } from './useFieldBase';\n\nconst validationMessageIcons = {\n error: <DiamondDismiss12Filled />,\n warning: <Warning12Filled />,\n success: <CheckmarkCircle12Filled />,\n none: undefined,\n} as const;\n\n/**\n * Create the state required to render Field.\n *\n * The returned state can be modified with hooks such as useFieldStyles_unstable,\n * before being passed to renderField_unstable.\n *\n * @param props - Props passed to this field\n * @param ref - Ref to the root\n */\nexport const useField_unstable = (props: FieldProps, ref: React.Ref<HTMLDivElement>): FieldState => {\n const { orientation = 'vertical', size = 'medium', ...fieldProps } = props;\n const state = useFieldBase_unstable(fieldProps, ref);\n\n const defaultIcon = validationMessageIcons[state.validationState];\n\n return {\n ...state,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n components: { ...state.components, label: Label },\n label: slot.optional(props.label, {\n defaultProps: { size, ...state.label },\n elementType: Label,\n }),\n validationMessageIcon: slot.optional(props.validationMessageIcon, {\n renderByDefault: !!defaultIcon,\n defaultProps: { children: defaultIcon },\n elementType: 'span',\n }),\n orientation,\n size,\n };\n};\n"],"names":["React","CheckmarkCircle12Filled","DiamondDismiss12Filled","Warning12Filled","Label","slot","useFieldBase_unstable","validationMessageIcons","error","warning","success","none","undefined","useField_unstable","props","ref","orientation","size","fieldProps","state","defaultIcon","validationState","components","label","optional","defaultProps","elementType","validationMessageIcon","renderByDefault","children"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,EAAEC,sBAAsB,EAAEC,eAAe,QAAQ,wBAAwB;AACzG,SAASC,KAAK,QAAQ,wBAAwB;AAC9C,SAASC,IAAI,QAAQ,4BAA4B;AAEjD,SAASC,qBAAqB,QAAQ,oBAAiB;AAEvD,MAAMC,yBAAyB;IAC7BC,qBAAO,oBAACN;IACRO,uBAAS,oBAACN;IACVO,uBAAS,oBAACT;IACVU,MAAMC;AACR;AAEA;;;;;;;;CAQC,GACD,OAAO,MAAMC,oBAAoB,CAACC,OAAmBC;IACnD,MAAM,EAAEC,cAAc,UAAU,EAAEC,OAAO,QAAQ,EAAE,GAAGC,YAAY,GAAGJ;IACrE,MAAMK,QAAQb,sBAAsBY,YAAYH;IAEhD,MAAMK,cAAcb,sBAAsB,CAACY,MAAME,eAAe,CAAC;IAEjE,OAAO;QACL,GAAGF,KAAK;QACR,4DAA4D;QAC5DG,YAAY;YAAE,GAAGH,MAAMG,UAAU;YAAEC,OAAOnB;QAAM;QAChDmB,OAAOlB,KAAKmB,QAAQ,CAACV,MAAMS,KAAK,EAAE;YAChCE,cAAc;gBAAER;gBAAM,GAAGE,MAAMI,KAAK;YAAC;YACrCG,aAAatB;QACf;QACAuB,uBAAuBtB,KAAKmB,QAAQ,CAACV,MAAMa,qBAAqB,EAAE;YAChEC,iBAAiB,CAAC,CAACR;YACnBK,cAAc;gBAAEI,UAAUT;YAAY;YACtCM,aAAa;QACf;QACAV;QACAC;IACF;AACF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/useFieldBase.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport type { FieldBaseProps, FieldBaseState } from './Field.types';\n\n/**\n * Base hook for Field component, which manages state related to validation, ARIA attributes,\n * ID generation, and slot structure without design props.\n *\n * @param props - Props passed to this field\n * @param ref - Ref to the root\n */\nexport const useFieldBase_unstable = (props: FieldBaseProps, ref: React.Ref<HTMLDivElement>): FieldBaseState => {\n const { children, required = false, validationState = props.validationMessage ? 'error' : 'none' } = props;\n\n const baseId = useId('field-');\n const generatedControlId = baseId + '__control';\n\n const root = slot.always(getIntrinsicElementProps('div', { ...props, ref }, /*excludedPropNames:*/ ['children']), {\n elementType: 'div',\n });\n const label = slot.optional(props.label, {\n defaultProps: { htmlFor: generatedControlId, id: baseId + '__label', required },\n elementType: 'label',\n });\n const validationMessage = slot.optional(props.validationMessage, {\n defaultProps: {\n id: baseId + '__validationMessage',\n role: validationState === 'error' || validationState === 'warning' ? 'alert' : undefined,\n },\n elementType: 'div',\n });\n const hint = slot.optional(props.hint, { defaultProps: { id: baseId + '__hint' }, elementType: 'div' });\n const validationMessageIcon = slot.optional(props.validationMessageIcon, {\n renderByDefault: false,\n elementType: 'span',\n });\n\n return {\n children,\n generatedControlId,\n required,\n validationState,\n components: { root: 'div', label: 'label', validationMessage: 'div', validationMessageIcon: 'span', hint: 'div' },\n root,\n label,\n validationMessageIcon,\n validationMessage,\n hint,\n };\n};\n"],"names":["getIntrinsicElementProps","useId","slot","useFieldBase_unstable","props","ref","children","required","validationState","validationMessage","baseId","generatedControlId","root","always","elementType","label","optional","defaultProps","htmlFor","id","role","undefined","hint","validationMessageIcon","renderByDefault","components"],"mappings":"AAEA,SAASA,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAGlF;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,QAAQ,EAAEC,WAAW,KAAK,EAAEC,kBAAkBJ,MAAMK,iBAAiB,GAAG,UAAU,MAAM,EAAE,GAAGL;IAErG,MAAMM,SAAST,MAAM;IACrB,MAAMU,qBAAqBD,SAAS;IAEpC,MAAME,OAAOV,KAAKW,MAAM,CAACb,yBAAyB,OAAO;QAAE,GAAGI,KAAK;QAAEC;IAAI,GAAG,oBAAoB,GAAG;QAAC;KAAW,GAAG;QAChHS,aAAa;IACf;IACA,MAAMC,QAAQb,KAAKc,QAAQ,CAACZ,MAAMW,KAAK,EAAE;QACvCE,cAAc;YAAEC,SAASP;YAAoBQ,IAAIT,SAAS;YAAWH;QAAS;QAC9EO,aAAa;IACf;IACA,MAAML,oBAAoBP,KAAKc,QAAQ,CAACZ,MAAMK,iBAAiB,EAAE;QAC/DQ,cAAc;YACZE,IAAIT,SAAS;YACbU,MAAMZ,oBAAoB,WAAWA,oBAAoB,YAAY,UAAUa;QACjF;QACAP,aAAa;IACf;IACA,MAAMQ,OAAOpB,KAAKc,QAAQ,CAACZ,MAAMkB,IAAI,EAAE;QAAEL,cAAc;YAAEE,IAAIT,SAAS;QAAS;QAAGI,aAAa;IAAM;IACrG,MAAMS,wBAAwBrB,KAAKc,QAAQ,CAACZ,MAAMmB,qBAAqB,EAAE;QACvEC,iBAAiB;QACjBV,aAAa;IACf;IAEA,OAAO;QACLR;QACAK;QACAJ;QACAC;QACAiB,YAAY;YAAEb,MAAM;YAAOG,OAAO;YAASN,mBAAmB;YAAOc,uBAAuB;YAAQD,MAAM;QAAM;QAChHV;QACAG;QACAQ;QACAd;QACAa;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Field/useFieldBase.tsx"],"sourcesContent":["import type * as React from 'react';\n\nimport { getIntrinsicElementProps, useId, slot } from '@fluentui/react-utilities';\nimport type { FieldBaseProps, FieldBaseState } from './Field.types';\n\n/**\n * Base hook for Field component, which manages state related to validation, ARIA attributes,\n * ID generation, and slot structure without design props.\n *\n * @param props - Props passed to this field\n * @param ref - Ref to the root\n */\nexport const useFieldBase_unstable = (props: FieldBaseProps, ref: React.Ref<HTMLDivElement>): FieldBaseState => {\n const { children, required = false, validationState = props.validationMessage ? 'error' : 'none' } = props;\n\n const baseId = useId('field-');\n const generatedControlId = baseId + '__control';\n\n const root = slot.always(getIntrinsicElementProps('div', { ...props, ref }, /*excludedPropNames:*/ ['children']), {\n elementType: 'div',\n });\n const label = slot.optional(props.label, {\n defaultProps: { htmlFor: generatedControlId, id: baseId + '__label', required },\n elementType: 'label',\n });\n const validationMessage = slot.optional(props.validationMessage, {\n defaultProps: {\n id: baseId + '__validationMessage',\n role: validationState === 'error' || validationState === 'warning' ? 'alert' : undefined,\n },\n elementType: 'div',\n });\n const hint = slot.optional(props.hint, { defaultProps: { id: baseId + '__hint' }, elementType: 'div' });\n const validationMessageIcon = slot.optional(props.validationMessageIcon, {\n renderByDefault: false,\n elementType: 'span',\n });\n\n return {\n children,\n generatedControlId,\n required,\n validationState,\n components: { root: 'div', label: 'label', validationMessage: 'div', validationMessageIcon: 'span', hint: 'div' },\n root,\n label,\n validationMessageIcon,\n validationMessage,\n hint,\n };\n};\n"],"names":["getIntrinsicElementProps","useId","slot","useFieldBase_unstable","props","ref","children","required","validationState","validationMessage","baseId","generatedControlId","root","always","elementType","label","optional","defaultProps","htmlFor","id","role","undefined","hint","validationMessageIcon","renderByDefault","components"],"mappings":"AAEA,SAASA,wBAAwB,EAAEC,KAAK,EAAEC,IAAI,QAAQ,4BAA4B;AAGlF;;;;;;CAMC,GACD,OAAO,MAAMC,wBAAwB,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,QAAQ,EAAEC,WAAW,KAAK,EAAEC,kBAAkBJ,MAAMK,iBAAiB,GAAG,UAAU,MAAM,EAAE,GAAGL;IAErG,MAAMM,SAAST,MAAM;IACrB,MAAMU,qBAAqBD,SAAS;IAEpC,MAAME,OAAOV,KAAKW,MAAM,CAACb,yBAAyB,OAAO;QAAE,GAAGI,KAAK;QAAEC;IAAI,GAAG,oBAAoB,GAAG;QAAC;KAAW,GAAG;QAChHS,aAAa;IACf;IACA,MAAMC,QAAQb,KAAKc,QAAQ,CAACZ,MAAMW,KAAK,EAAE;QACvCE,cAAc;YAAEC,SAASP;YAAoBQ,IAAIT,SAAS;YAAWH;QAAS;QAC9EO,aAAa;IACf;IACA,MAAML,oBAAoBP,KAAKc,QAAQ,CAACZ,MAAMK,iBAAiB,EAAE;QAC/DQ,cAAc;YACZE,IAAIT,SAAS;YACbU,MAAMZ,oBAAoB,WAAWA,oBAAoB,YAAY,UAAUa;QACjF;QACAP,aAAa;IACf;IACA,MAAMQ,OAAOpB,KAAKc,QAAQ,CAACZ,MAAMkB,IAAI,EAAE;QAAEL,cAAc;YAAEE,IAAIT,SAAS;QAAS;QAAGI,aAAa;IAAM;IACrG,MAAMS,wBAAwBrB,KAAKc,QAAQ,CAACZ,MAAMmB,qBAAqB,EAAE;QACvEC,iBAAiB;QACjBV,aAAa;IACf;IAEA,OAAO;QACLR;QACAK;QACAJ;QACAC;QACAiB,YAAY;YAAEb,MAAM;YAAOG,OAAO;YAASN,mBAAmB;YAAOc,uBAAuB;YAAQD,MAAM;QAAM;QAChHV;QACAG;QACAQ;QACAd;QACAa;IACF;AACF,EAAE"}
@@ -0,0 +1,25 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./Field.module.css";
3
+ export const fieldClassNames = {
4
+ root: `fui-Field`,
5
+ label: `fui-Field__label`,
6
+ validationMessage: `fui-Field__validationMessage`,
7
+ validationMessageIcon: `fui-Field__validationMessageIcon`,
8
+ hint: `fui-Field__hint`
9
+ };
10
+ export const useFieldStyles_unstable = (state)=>{
11
+ state.root.className = clsx(fieldClassNames.root, styles.root, styles[state.orientation], styles[state.size], styles[state.validationState], state.label && styles.withLabel, state.validationMessageIcon && styles.withIcon, state.root.className);
12
+ if (state.label) {
13
+ state.label.className = clsx(fieldClassNames.label, styles.label, state.label.className);
14
+ }
15
+ if (state.validationMessage) {
16
+ state.validationMessage.className = clsx(fieldClassNames.validationMessage, styles.validationMessage, state.validationMessage.className);
17
+ }
18
+ if (state.validationMessageIcon) {
19
+ state.validationMessageIcon.className = clsx(fieldClassNames.validationMessageIcon, styles.validationMessageIcon, state.validationMessageIcon.className);
20
+ }
21
+ if (state.hint) {
22
+ state.hint.className = clsx(fieldClassNames.hint, styles.hint, state.hint.className);
23
+ }
24
+ return state;
25
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Field/useFieldStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { FieldSlots, FieldState } from './Field.types';\nimport styles from './Field.module.css';\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\nexport const useFieldStyles_unstable = (state: FieldState): FieldState => {\n state.root.className = clsx(\n fieldClassNames.root,\n styles.root,\n styles[state.orientation],\n styles[state.size],\n styles[state.validationState],\n state.label && styles.withLabel,\n state.validationMessageIcon && styles.withIcon,\n state.root.className,\n );\n if (state.label) {\n state.label.className = clsx(fieldClassNames.label, styles.label, state.label.className);\n }\n if (state.validationMessage) {\n state.validationMessage.className = clsx(\n fieldClassNames.validationMessage,\n styles.validationMessage,\n state.validationMessage.className,\n );\n }\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = clsx(\n fieldClassNames.validationMessageIcon,\n styles.validationMessageIcon,\n state.validationMessageIcon.className,\n );\n }\n if (state.hint) {\n state.hint.className = clsx(fieldClassNames.hint, styles.hint, state.hint.className);\n }\n\n return state;\n};\n"],"names":["clsx","styles","fieldClassNames","root","label","validationMessage","validationMessageIcon","hint","useFieldStyles_unstable","state","className","orientation","size","validationState","withLabel","withIcon"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,qBAAqB;AAExC,OAAO,MAAMC,kBAA8C;IACzDC,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,EAAE;AAEF,OAAO,MAAMC,0BAA0B,CAACC;IACtCA,MAAMN,IAAI,CAACO,SAAS,GAAGV,KACrBE,gBAAgBC,IAAI,EACpBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,MAAME,WAAW,CAAC,EACzBV,MAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBX,MAAM,CAACQ,MAAMI,eAAe,CAAC,EAC7BJ,MAAML,KAAK,IAAIH,OAAOa,SAAS,EAC/BL,MAAMH,qBAAqB,IAAIL,OAAOc,QAAQ,EAC9CN,MAAMN,IAAI,CAACO,SAAS;IAEtB,IAAID,MAAML,KAAK,EAAE;QACfK,MAAML,KAAK,CAACM,SAAS,GAAGV,KAAKE,gBAAgBE,KAAK,EAAEH,OAAOG,KAAK,EAAEK,MAAML,KAAK,CAACM,SAAS;IACzF;IACA,IAAID,MAAMJ,iBAAiB,EAAE;QAC3BI,MAAMJ,iBAAiB,CAACK,SAAS,GAAGV,KAClCE,gBAAgBG,iBAAiB,EACjCJ,OAAOI,iBAAiB,EACxBI,MAAMJ,iBAAiB,CAACK,SAAS;IAErC;IACA,IAAID,MAAMH,qBAAqB,EAAE;QAC/BG,MAAMH,qBAAqB,CAACI,SAAS,GAAGV,KACtCE,gBAAgBI,qBAAqB,EACrCL,OAAOK,qBAAqB,EAC5BG,MAAMH,qBAAqB,CAACI,SAAS;IAEzC;IACA,IAAID,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACG,SAAS,GAAGV,KAAKE,gBAAgBK,IAAI,EAAEN,OAAOM,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IACrF;IAEA,OAAOD;AACT,EAAE"}
@@ -0,0 +1,25 @@
1
+ import { clsx } from "clsx";
2
+ import styles from "./Field.module.css";
3
+ export const fieldClassNames = {
4
+ root: `fui-Field`,
5
+ label: `fui-Field__label`,
6
+ validationMessage: `fui-Field__validationMessage`,
7
+ validationMessageIcon: `fui-Field__validationMessageIcon`,
8
+ hint: `fui-Field__hint`
9
+ };
10
+ export const useFieldStyles_unstable = (state)=>{
11
+ state.root.className = clsx(fieldClassNames.root, styles.root, styles[state.orientation], styles[state.size], styles[state.validationState], state.label && styles.withLabel, state.validationMessageIcon && styles.withIcon, state.root.className);
12
+ if (state.label) {
13
+ state.label.className = clsx(fieldClassNames.label, styles.label, state.label.className);
14
+ }
15
+ if (state.validationMessage) {
16
+ state.validationMessage.className = clsx(fieldClassNames.validationMessage, styles.validationMessage, state.validationMessage.className);
17
+ }
18
+ if (state.validationMessageIcon) {
19
+ state.validationMessageIcon.className = clsx(fieldClassNames.validationMessageIcon, styles.validationMessageIcon, state.validationMessageIcon.className);
20
+ }
21
+ if (state.hint) {
22
+ state.hint.className = clsx(fieldClassNames.hint, styles.hint, state.hint.className);
23
+ }
24
+ return state;
25
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/Field/useFieldStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { FieldSlots, FieldState } from './Field.types';\nimport styles from './Field.module.css';\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\nexport const useFieldStyles_unstable = (state: FieldState): FieldState => {\n state.root.className = clsx(\n fieldClassNames.root,\n styles.root,\n styles[state.orientation],\n styles[state.size],\n styles[state.validationState],\n state.label && styles.withLabel,\n state.validationMessageIcon && styles.withIcon,\n state.root.className,\n );\n if (state.label) {\n state.label.className = clsx(fieldClassNames.label, styles.label, state.label.className);\n }\n if (state.validationMessage) {\n state.validationMessage.className = clsx(\n fieldClassNames.validationMessage,\n styles.validationMessage,\n state.validationMessage.className,\n );\n }\n if (state.validationMessageIcon) {\n state.validationMessageIcon.className = clsx(\n fieldClassNames.validationMessageIcon,\n styles.validationMessageIcon,\n state.validationMessageIcon.className,\n );\n }\n if (state.hint) {\n state.hint.className = clsx(fieldClassNames.hint, styles.hint, state.hint.className);\n }\n\n return state;\n};\n"],"names":["clsx","styles","fieldClassNames","root","label","validationMessage","validationMessageIcon","hint","useFieldStyles_unstable","state","className","orientation","size","validationState","withLabel","withIcon"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,qBAAqB;AAExC,OAAO,MAAMC,kBAA8C;IACzDC,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,EAAE;AAEF,OAAO,MAAMC,0BAA0B,CAACC;IACtCA,MAAMN,IAAI,CAACO,SAAS,GAAGV,KACrBE,gBAAgBC,IAAI,EACpBF,OAAOE,IAAI,EACXF,MAAM,CAACQ,MAAME,WAAW,CAAC,EACzBV,MAAM,CAACQ,MAAMG,IAAI,CAAC,EAClBX,MAAM,CAACQ,MAAMI,eAAe,CAAC,EAC7BJ,MAAML,KAAK,IAAIH,OAAOa,SAAS,EAC/BL,MAAMH,qBAAqB,IAAIL,OAAOc,QAAQ,EAC9CN,MAAMN,IAAI,CAACO,SAAS;IAEtB,IAAID,MAAML,KAAK,EAAE;QACfK,MAAML,KAAK,CAACM,SAAS,GAAGV,KAAKE,gBAAgBE,KAAK,EAAEH,OAAOG,KAAK,EAAEK,MAAML,KAAK,CAACM,SAAS;IACzF;IACA,IAAID,MAAMJ,iBAAiB,EAAE;QAC3BI,MAAMJ,iBAAiB,CAACK,SAAS,GAAGV,KAClCE,gBAAgBG,iBAAiB,EACjCJ,OAAOI,iBAAiB,EACxBI,MAAMJ,iBAAiB,CAACK,SAAS;IAErC;IACA,IAAID,MAAMH,qBAAqB,EAAE;QAC/BG,MAAMH,qBAAqB,CAACI,SAAS,GAAGV,KACtCE,gBAAgBI,qBAAqB,EACrCL,OAAOK,qBAAqB,EAC5BG,MAAMH,qBAAqB,CAACI,SAAS;IAEzC;IACA,IAAID,MAAMF,IAAI,EAAE;QACdE,MAAMF,IAAI,CAACG,SAAS,GAAGV,KAAKE,gBAAgBK,IAAI,EAAEN,OAAOM,IAAI,EAAEE,MAAMF,IAAI,CAACG,SAAS;IACrF;IAEA,OAAOD;AACT,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/useFieldStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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 maxWidth: 'max-content',\n maxHeight: 'max-content',\n },\n\n vertical: {\n paddingTop: tokens.spacingVerticalXXS,\n paddingBottom: tokens.spacingVerticalXXS,\n marginBottom: tokens.spacingVerticalXXS,\n },\n\n verticalLarge: {\n paddingTop: '1px',\n paddingBottom: '1px',\n marginBottom: tokens.spacingVerticalXS,\n },\n\n horizontal: {\n paddingTop: tokens.spacingVerticalSNudge,\n paddingBottom: tokens.spacingVerticalSNudge,\n marginRight: tokens.spacingHorizontalM,\n gridRowStart: '1',\n gridRowEnd: '-1',\n },\n\n horizontalSmall: {\n paddingTop: tokens.spacingVerticalXS,\n paddingBottom: tokens.spacingVerticalXS,\n },\n\n horizontalLarge: {\n // To align the label text with the Input text, it should be centered within the 40px height of the Input.\n // This is (40px - lineHeightBase400) / 2 = 9px. Hardcoded since there is no 9px padding token.\n paddingTop: '9px',\n paddingBottom: '9px',\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): FieldState => {\n const { validationState, size } = state;\n const horizontal = state.orientation === 'horizontal';\n\n const rootStyles = useRootStyles();\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\n state.label.className = mergeClasses(\n fieldClassNames.label,\n labelStyles.base,\n horizontal && labelStyles.horizontal,\n horizontal && size === 'small' && labelStyles.horizontalSmall,\n horizontal && size === 'large' && labelStyles.horizontalLarge,\n !horizontal && labelStyles.vertical,\n !horizontal && size === 'large' && labelStyles.verticalLarge,\n state.label.className,\n );\n }\n\n const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\n state.hint.className = mergeClasses(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);\n }\n\n return state;\n};\n"],"names":["tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","fieldClassNames","root","label","validationMessage","validationMessageIcon","hint","iconSize","useRootStyles","base","display","horizontal","gridTemplateColumns","gridTemplateRows","horizontalNoLabel","paddingLeft","useLabelStyles","maxWidth","maxHeight","vertical","paddingTop","spacingVerticalXXS","paddingBottom","marginBottom","verticalLarge","spacingVerticalXS","spacingVerticalSNudge","marginRight","spacingHorizontalM","gridRowStart","gridRowEnd","horizontalSmall","horizontalLarge","useSecondaryTextBaseClassName","marginTop","color","colorNeutralForeground3","caption1","useSecondaryTextStyles","error","colorPaletteRedForeground1","withIcon","spacingHorizontalXS","useValidationMessageIconBaseClassName","fontSize","marginLeft","lineHeight","verticalAlign","useValidationMessageIconStyles","warning","colorPaletteDarkOrangeForeground1","success","colorPaletteGreenForeground1","useFieldStyles_unstable","state","validationState","size","orientation","rootStyles","className","labelStyles","validationMessageIconBaseClassName","validationMessageIconStyles","secondaryTextBaseClassName","secondaryTextStyles"],"mappings":"AAAA;AAEA,SAASA,MAAM,EAAEC,gBAAgB,QAAQ,wBAAwB;AAEjE,SAASC,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,OAAO,MAAMC,kBAA8C;IACzDC,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,EAAE;AAEF,6CAA6C;AAC7C,MAAMC,WAAW;AAEjB;;CAEC,GACD,MAAMC,gBAAgBT,WAAW;IAC/BU,MAAM;QACJC,SAAS;IACX;IAEA,8FAA8F;IAC9F,wFAAwF;IACxFC,YAAY;QACVC,qBAAqB;QACrBC,kBAAkB;IACpB;IAEA,iFAAiF;IACjF,gHAAgH;IAChHC,mBAAmB;QACjBC,aAAa;QACbH,qBAAqB;IACvB;AACF;AAEA,MAAMI,iBAAiBjB,WAAW;IAChCU,MAAM;QACJQ,UAAU;QACVC,WAAW;IACb;IAEAC,UAAU;QACRC,YAAYxB,OAAOyB,kBAAkB;QACrCC,eAAe1B,OAAOyB,kBAAkB;QACxCE,cAAc3B,OAAOyB,kBAAkB;IACzC;IAEAG,eAAe;QACbJ,YAAY;QACZE,eAAe;QACfC,cAAc3B,OAAO6B,iBAAiB;IACxC;IAEAd,YAAY;QACVS,YAAYxB,OAAO8B,qBAAqB;QACxCJ,eAAe1B,OAAO8B,qBAAqB;QAC3CC,aAAa/B,OAAOgC,kBAAkB;QACtCC,cAAc;QACdC,YAAY;IACd;IAEAC,iBAAiB;QACfX,YAAYxB,OAAO6B,iBAAiB;QACpCH,eAAe1B,OAAO6B,iBAAiB;IACzC;IAEAO,iBAAiB;QACf,0GAA0G;QAC1G,+FAA+F;QAC/FZ,YAAY;QACZE,eAAe;IACjB;AACF;AAEA,MAAMW,gCAAgCnC,gBAAgB;IACpDoC,WAAWtC,OAAOyB,kBAAkB;IACpCc,OAAOvC,OAAOwC,uBAAuB;IACrC,GAAGvC,iBAAiBwC,QAAQ;AAC9B;AAEA,MAAMC,yBAAyBvC,WAAW;IACxCwC,OAAO;QACLJ,OAAOvC,OAAO4C,0BAA0B;IAC1C;IAEAC,UAAU;QACR,kGAAkG;QAClG1B,aAAa,CAAC,KAAK,EAAER,SAAS,GAAG,EAAEX,OAAO8C,mBAAmB,CAAC,CAAC,CAAC;IAClE;AACF;AAEA,MAAMC,wCAAwC7C,gBAAgB;IAC5DY,SAAS;IACTkC,UAAUrC;IACV,mGAAmG;IACnGsC,YAAY,CAAC,MAAM,EAAEtC,SAAS,GAAG,EAAEX,OAAO8C,mBAAmB,CAAC,CAAC,CAAC;IAChEf,aAAa/B,OAAO8C,mBAAmB;IACvC,0FAA0F;IAC1FI,YAAY;IACZ,uGAAuG;IACvGC,eAAe;AACjB;AAEA,MAAMC,iCAAiCjD,WAAW;IAChDwC,OAAO;QACLJ,OAAOvC,OAAO4C,0BAA0B;IAC1C;IACAS,SAAS;QACPd,OAAOvC,OAAOsD,iCAAiC;IACjD;IACAC,SAAS;QACPhB,OAAOvC,OAAOwD,4BAA4B;IAC5C;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,0BAA0B,CAACC;IACtC,MAAM,EAAEC,eAAe,EAAEC,IAAI,EAAE,GAAGF;IAClC,MAAM3C,aAAa2C,MAAMG,WAAW,KAAK;IAEzC,MAAMC,aAAalD;IACnB,oDAAoD;IACpD8C,MAAMpD,IAAI,CAACyD,SAAS,GAAG3D,aACrBC,gBAAgBC,IAAI,EACpBwD,WAAWjD,IAAI,EACfE,cAAc+C,WAAW/C,UAAU,EACnCA,cAAc,CAAC2C,MAAMnD,KAAK,IAAIuD,WAAW5C,iBAAiB,EAC1DwC,MAAMpD,IAAI,CAACyD,SAAS;IAGtB,MAAMC,cAAc5C;IACpB,IAAIsC,MAAMnD,KAAK,EAAE;QACf,oDAAoD;QACpDmD,MAAMnD,KAAK,CAACwD,SAAS,GAAG3D,aACtBC,gBAAgBE,KAAK,EACrByD,YAAYnD,IAAI,EAChBE,cAAciD,YAAYjD,UAAU,EACpCA,cAAc6C,SAAS,WAAWI,YAAY7B,eAAe,EAC7DpB,cAAc6C,SAAS,WAAWI,YAAY5B,eAAe,EAC7D,CAACrB,cAAciD,YAAYzC,QAAQ,EACnC,CAACR,cAAc6C,SAAS,WAAWI,YAAYpC,aAAa,EAC5D8B,MAAMnD,KAAK,CAACwD,SAAS;IAEzB;IAEA,MAAME,qCAAqClB;IAC3C,MAAMmB,8BAA8Bd;IACpC,IAAIM,MAAMjD,qBAAqB,EAAE;QAC/B,oDAAoD;QACpDiD,MAAMjD,qBAAqB,CAACsD,SAAS,GAAG3D,aACtCC,gBAAgBI,qBAAqB,EACrCwD,oCACAN,oBAAoB,UAAUO,2BAA2B,CAACP,gBAAgB,EAC1ED,MAAMjD,qBAAqB,CAACsD,SAAS;IAEzC;IAEA,MAAMI,6BAA6B9B;IACnC,MAAM+B,sBAAsB1B;IAC5B,IAAIgB,MAAMlD,iBAAiB,EAAE;QAC3B,oDAAoD;QACpDkD,MAAMlD,iBAAiB,CAACuD,SAAS,GAAG3D,aAClCC,gBAAgBG,iBAAiB,EACjC2D,4BACAR,oBAAoB,WAAWS,oBAAoBzB,KAAK,EACxD,CAAC,CAACe,MAAMjD,qBAAqB,IAAI2D,oBAAoBvB,QAAQ,EAC7Da,MAAMlD,iBAAiB,CAACuD,SAAS;IAErC;IAEA,IAAIL,MAAMhD,IAAI,EAAE;QACd,oDAAoD;QACpDgD,MAAMhD,IAAI,CAACqD,SAAS,GAAG3D,aAAaC,gBAAgBK,IAAI,EAAEyD,4BAA4BT,MAAMhD,IAAI,CAACqD,SAAS;IAC5G;IAEA,OAAOL;AACT,EAAE"}
1
+ {"version":3,"sources":["../../../src/components/Field/useFieldStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { 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 maxWidth: 'max-content',\n maxHeight: 'max-content',\n },\n\n vertical: {\n paddingTop: tokens.spacingVerticalXXS,\n paddingBottom: tokens.spacingVerticalXXS,\n marginBottom: tokens.spacingVerticalXXS,\n },\n\n verticalLarge: {\n paddingTop: '1px',\n paddingBottom: '1px',\n marginBottom: tokens.spacingVerticalXS,\n },\n\n horizontal: {\n paddingTop: tokens.spacingVerticalSNudge,\n paddingBottom: tokens.spacingVerticalSNudge,\n marginRight: tokens.spacingHorizontalM,\n gridRowStart: '1',\n gridRowEnd: '-1',\n },\n\n horizontalSmall: {\n paddingTop: tokens.spacingVerticalXS,\n paddingBottom: tokens.spacingVerticalXS,\n },\n\n horizontalLarge: {\n // To align the label text with the Input text, it should be centered within the 40px height of the Input.\n // This is (40px - lineHeightBase400) / 2 = 9px. Hardcoded since there is no 9px padding token.\n paddingTop: '9px',\n paddingBottom: '9px',\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): FieldState => {\n const { validationState, size } = state;\n const horizontal = state.orientation === 'horizontal';\n\n const rootStyles = useRootStyles();\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\n state.label.className = mergeClasses(\n fieldClassNames.label,\n labelStyles.base,\n horizontal && labelStyles.horizontal,\n horizontal && size === 'small' && labelStyles.horizontalSmall,\n horizontal && size === 'large' && labelStyles.horizontalLarge,\n !horizontal && labelStyles.vertical,\n !horizontal && size === 'large' && labelStyles.verticalLarge,\n state.label.className,\n );\n }\n\n const validationMessageIconBaseClassName = useValidationMessageIconBaseClassName();\n const validationMessageIconStyles = useValidationMessageIconStyles();\n if (state.validationMessageIcon) {\n // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\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 // eslint-disable-next-line react-hooks/immutability\n state.hint.className = mergeClasses(fieldClassNames.hint, secondaryTextBaseClassName, state.hint.className);\n }\n\n return state;\n};\n"],"names":["tokens","typographyStyles","makeResetStyles","makeStyles","mergeClasses","fieldClassNames","root","label","validationMessage","validationMessageIcon","hint","iconSize","useRootStyles","base","display","horizontal","gridTemplateColumns","gridTemplateRows","horizontalNoLabel","paddingLeft","useLabelStyles","maxWidth","maxHeight","vertical","paddingTop","spacingVerticalXXS","paddingBottom","marginBottom","verticalLarge","spacingVerticalXS","spacingVerticalSNudge","marginRight","spacingHorizontalM","gridRowStart","gridRowEnd","horizontalSmall","horizontalLarge","useSecondaryTextBaseClassName","marginTop","color","colorNeutralForeground3","caption1","useSecondaryTextStyles","error","colorPaletteRedForeground1","withIcon","spacingHorizontalXS","useValidationMessageIconBaseClassName","fontSize","marginLeft","lineHeight","verticalAlign","useValidationMessageIconStyles","warning","colorPaletteDarkOrangeForeground1","success","colorPaletteGreenForeground1","useFieldStyles_unstable","state","validationState","size","orientation","rootStyles","className","labelStyles","validationMessageIconBaseClassName","validationMessageIconStyles","secondaryTextBaseClassName","secondaryTextStyles"],"mappings":"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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/FieldContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { FieldContextValue } from '../Field';\n\nconst FieldContext = React.createContext<FieldContextValue | undefined>(undefined);\n\nexport const FieldContextProvider = FieldContext.Provider;\n\nexport const useFieldContext_unstable = (): FieldContextValue | undefined => React.useContext(FieldContext);\n"],"names":["React","FieldContext","createContext","undefined","FieldContextProvider","Provider","useFieldContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,MAAMC,eAAeD,MAAME,aAAa,CAAgCC;AAExE,OAAO,MAAMC,uBAAuBH,aAAaI,QAAQ,CAAC;AAE1D,OAAO,MAAMC,2BAA2B,IAAqCN,MAAMO,UAAU,CAACN,cAAc"}
1
+ {"version":3,"sources":["../../src/contexts/FieldContext.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { FieldContextValue } from '../Field';\n\nconst FieldContext = React.createContext<FieldContextValue | undefined>(undefined);\n\nexport const FieldContextProvider = FieldContext.Provider;\n\nexport const useFieldContext_unstable = (): FieldContextValue | undefined => React.useContext(FieldContext);\n"],"names":["React","FieldContext","createContext","undefined","FieldContextProvider","Provider","useFieldContext_unstable","useContext"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,MAAMC,eAAeD,MAAME,aAAa,CAAgCC;AAExE,OAAO,MAAMC,uBAAuBH,aAAaI,QAAQ,CAAC;AAE1D,OAAO,MAAMC,2BAA2B,IAAqCN,MAAMO,UAAU,CAACN,cAAc"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export { FieldContextProvider, useFieldContext_unstable } from './FieldContext';\nexport { useFieldContextValues_unstable } from './useFieldContextValues';\nexport type { FieldControlPropsOptions } from './useFieldControlProps';\nexport { getFieldControlProps, useFieldControlProps_unstable } from './useFieldControlProps';\n"],"names":["FieldContextProvider","useFieldContext_unstable","useFieldContextValues_unstable","getFieldControlProps","useFieldControlProps_unstable"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,wBAAwB,QAAQ,oBAAiB;AAChF,SAASC,8BAA8B,QAAQ,6BAA0B;AAEzE,SAASC,oBAAoB,EAAEC,6BAA6B,QAAQ,4BAAyB"}
1
+ {"version":3,"sources":["../../src/contexts/index.ts"],"sourcesContent":["export { FieldContextProvider, useFieldContext_unstable } from './FieldContext';\nexport { useFieldContextValues_unstable } from './useFieldContextValues';\nexport type { FieldControlPropsOptions } from './useFieldControlProps';\nexport { getFieldControlProps, useFieldControlProps_unstable } from './useFieldControlProps';\n"],"names":["FieldContextProvider","useFieldContext_unstable","useFieldContextValues_unstable","getFieldControlProps","useFieldControlProps_unstable"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,wBAAwB,QAAQ,oBAAiB;AAChF,SAASC,8BAA8B,QAAQ,6BAA0B;AAEzE,SAASC,oBAAoB,EAAEC,6BAA6B,QAAQ,4BAAyB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/useFieldContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { FieldContextValue, FieldContextValues, FieldState } from '../Field';\n\n/**\n * Get the context values used when rendering Field.\n */\nexport const useFieldContextValues_unstable = (state: FieldState): FieldContextValues => {\n const { generatedControlId, orientation, required, size, validationState } = state;\n const labelFor = state.label?.htmlFor;\n const labelId = state.label?.id;\n const validationMessageId = state.validationMessage?.id;\n const hintId = state.hint?.id;\n\n const field: FieldContextValue = React.useMemo(\n () => ({\n generatedControlId,\n hintId,\n labelFor,\n labelId,\n orientation,\n required,\n size,\n validationMessageId,\n validationState,\n }),\n [generatedControlId, hintId, labelFor, labelId, orientation, required, size, validationMessageId, validationState],\n );\n\n return { field };\n};\n"],"names":["React","useFieldContextValues_unstable","state","generatedControlId","orientation","required","size","validationState","labelFor","label","htmlFor","labelId","id","validationMessageId","validationMessage","hintId","hint","field","useMemo"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;QAE5BA,cACDA,eACYA,0BACbA;IAJf,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,eAAe,EAAE,GAAGL;IAC7E,MAAMM,YAAWN,eAAAA,MAAMO,KAAK,cAAXP,mCAAAA,aAAaQ,OAAO;IACrC,MAAMC,WAAUT,gBAAAA,MAAMO,KAAK,cAAXP,oCAAAA,cAAaU,EAAE;IAC/B,MAAMC,uBAAsBX,2BAAAA,MAAMY,iBAAiB,cAAvBZ,+CAAAA,yBAAyBU,EAAE;IACvD,MAAMG,UAASb,cAAAA,MAAMc,IAAI,cAAVd,kCAAAA,YAAYU,EAAE;IAE7B,MAAMK,QAA2BjB,MAAMkB,OAAO,CAC5C,IAAO,CAAA;YACLf;YACAY;YACAP;YACAG;YACAP;YACAC;YACAC;YACAO;YACAN;QACF,CAAA,GACA;QAACJ;QAAoBY;QAAQP;QAAUG;QAASP;QAAaC;QAAUC;QAAMO;QAAqBN;KAAgB;IAGpH,OAAO;QAAEU;IAAM;AACjB,EAAE"}
1
+ {"version":3,"sources":["../../src/contexts/useFieldContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport type { FieldContextValue, FieldContextValues, FieldState } from '../Field';\n\n/**\n * Get the context values used when rendering Field.\n */\nexport const useFieldContextValues_unstable = (state: FieldState): FieldContextValues => {\n const { generatedControlId, orientation, required, size, validationState } = state;\n const labelFor = state.label?.htmlFor;\n const labelId = state.label?.id;\n const validationMessageId = state.validationMessage?.id;\n const hintId = state.hint?.id;\n\n const field: FieldContextValue = React.useMemo(\n () => ({\n generatedControlId,\n hintId,\n labelFor,\n labelId,\n orientation,\n required,\n size,\n validationMessageId,\n validationState,\n }),\n [generatedControlId, hintId, labelFor, labelId, orientation, required, size, validationMessageId, validationState],\n );\n\n return { field };\n};\n"],"names":["React","useFieldContextValues_unstable","state","generatedControlId","orientation","required","size","validationState","labelFor","label","htmlFor","labelId","id","validationMessageId","validationMessage","hintId","hint","field","useMemo"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;QAE5BA,cACDA,eACYA,0BACbA;IAJf,MAAM,EAAEC,kBAAkB,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,eAAe,EAAE,GAAGL;IAC7E,MAAMM,YAAWN,eAAAA,MAAMO,KAAK,cAAXP,mCAAAA,aAAaQ,OAAO;IACrC,MAAMC,WAAUT,gBAAAA,MAAMO,KAAK,cAAXP,oCAAAA,cAAaU,EAAE;IAC/B,MAAMC,uBAAsBX,2BAAAA,MAAMY,iBAAiB,cAAvBZ,+CAAAA,yBAAyBU,EAAE;IACvD,MAAMG,UAASb,cAAAA,MAAMc,IAAI,cAAVd,kCAAAA,YAAYU,EAAE;IAE7B,MAAMK,QAA2BjB,MAAMkB,OAAO,CAC5C,IAAO,CAAA;YACLf;YACAY;YACAP;YACAG;YACAP;YACAC;YACAC;YACAO;YACAN;QACF,CAAA,GACA;QAACJ;QAAoBY;QAAQP;QAAUG;QAASP;QAAaC;QAAUC;QAAMO;QAAqBN;KAAgB;IAGpH,OAAO;QAAEU;IAAM;AACjB,EAAE"}
@@ -18,15 +18,13 @@ export function useFieldControlProps_unstable(props, options) {
18
18
  };
19
19
  const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;
20
20
  if (generatedControlId) {
21
- var _props;
22
- var _id;
21
+ var _props, _id;
23
22
  (_id = (_props = props).id) !== null && _id !== void 0 ? _id : _props.id = generatedControlId;
24
23
  }
25
24
  // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer
26
25
  // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).
27
26
  if (labelId && (!(options === null || options === void 0 ? void 0 : options.supportsLabelFor) || labelFor !== props.id)) {
28
- var _props1, _arialabelledby;
29
- var _;
27
+ var _props1, _arialabelledby, _;
30
28
  (_ = (_props1 = props)[_arialabelledby = 'aria-labelledby']) !== null && _ !== void 0 ? _ : _props1[_arialabelledby] = labelId;
31
29
  }
32
30
  // The control is described by the validation message, or hint, or both.
@@ -41,25 +39,21 @@ export function useFieldControlProps_unstable(props, options) {
41
39
  ].filter(Boolean).join(' ');
42
40
  }
43
41
  if (validationState === 'error') {
44
- var _props2, _ariainvalid;
45
- var _1;
42
+ var _props2, _ariainvalid, _1;
46
43
  (_1 = (_props2 = props)[_ariainvalid = 'aria-invalid']) !== null && _1 !== void 0 ? _1 : _props2[_ariainvalid] = true;
47
44
  }
48
45
  if (required) {
49
46
  if (options === null || options === void 0 ? void 0 : options.supportsRequired) {
50
- var _props3;
51
- var _required;
47
+ var _props3, _required;
52
48
  (_required = (_props3 = props).required) !== null && _required !== void 0 ? _required : _props3.required = true;
53
49
  } else {
54
- var _props4, _ariarequired;
55
- var _2;
50
+ var _props4, _ariarequired, _2;
56
51
  (_2 = (_props4 = props)[_ariarequired = 'aria-required']) !== null && _2 !== void 0 ? _2 : _props4[_ariarequired] = true;
57
52
  }
58
53
  }
59
54
  // Include the size prop if this control supports it
60
55
  if (options === null || options === void 0 ? void 0 : options.supportsSize) {
61
- var _props5;
62
- var _size;
56
+ var _props5, _size;
63
57
  (_size = (_props5 = props).size) !== null && _size !== void 0 ? _size : _props5.size = context.size;
64
58
  }
65
59
  return props;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/contexts/useFieldControlProps.ts"],"sourcesContent":["'use client';\n\nimport type { FieldContextValue, FieldControlProps } from '../Field';\nimport { useFieldContext_unstable } from './FieldContext';\n\n/**\n * Options for `useFieldControlProps_unstable`.\n */\nexport type FieldControlPropsOptions = {\n /**\n * Skips setting `aria-labelledby` on the control if the `label.htmlFor` refers to the control.\n *\n * This should be used with controls that can be the target of a label's `for` prop:\n * `<button>`, `<input>`, `<progress>`, `<select>`, `<textarea>`.\n */\n supportsLabelFor?: boolean;\n\n /**\n * Sets `required` instead of `aria-required` when the Field is marked required.\n *\n * This should be used with controls that support the `required` prop:\n * `<input>` (except `range` or `color`), `<select>`, `<textarea>`.\n */\n supportsRequired?: boolean;\n\n /**\n * Sets the size prop on the control to match the Field's size: `'small' | 'medium' | 'large'`.\n *\n * This should be used with controls that have a custom size prop that matches the Field's size prop.\n *\n * NOTE: the size is set on the props *returned* by this hook, so the control must read `size` from the returned\n * props. It has no effect if `size` is read from the original props (for example destructured by a wrapper hook\n * before calling this one) - in that case read the size from `useFieldContext_unstable()` directly instead.\n */\n supportsSize?: boolean;\n};\n\n/**\n * Gets the control props from the field context, if this inside a `<Field>`.\n *\n * When called with no arguments, returns the FieldControlProps that should be applied to the control.\n *\n * @returns A FieldControlProps object if inside a `<Field>`, otherwise undefined.\n */\nexport function useFieldControlProps_unstable(): FieldControlProps | undefined;\n\n/**\n * Copies and merges the FieldControlProps with the given props, if this inside a `<Field>`.\n *\n * @param props - The existing props for the control. These will be merged with the control props from the field context.\n * @param options - Option to include the size prop.\n * @returns Merged props if inside a `<Field>`, otherwise the original props, or undefined if no props given.\n */\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props: Props,\n options?: FieldControlPropsOptions,\n): Props;\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n\n/**\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n *\n * @internal\n */\nexport function getFieldControlProps<Props extends FieldControlProps>(\n context: FieldContextValue | undefined,\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n if (!context) {\n return props;\n }\n\n // Create a copy of props so we don't modify the original\n props = { ...props } as Props;\n\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n\n if (generatedControlId) {\n props.id ??= generatedControlId;\n }\n\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!options?.supportsLabelFor || labelFor !== props.id)) {\n props['aria-labelledby'] ??= labelId;\n }\n\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [validationMessageId, hintId, props?.['aria-describedby']].filter(Boolean).join(' ');\n }\n\n if (validationState === 'error') {\n props['aria-invalid'] ??= true;\n }\n\n if (required) {\n if (options?.supportsRequired) {\n (props as { required?: boolean }).required ??= true;\n } else {\n props['aria-required'] ??= true;\n }\n }\n\n // Include the size prop if this control supports it\n if (options?.supportsSize) {\n (props as { size?: FieldContextValue['size'] }).size ??= context.size;\n }\n\n return props;\n}\n"],"names":["useFieldContext_unstable","useFieldControlProps_unstable","props","options","getFieldControlProps","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","id","supportsLabelFor","filter","Boolean","join","supportsRequired","supportsSize","size"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,QAAQ,oBAAiB;AAsD1D,OAAO,SAASC,8BACdC,KAAa,EACbC,OAAkC;IAElC,OAAOC,qBAAqBJ,4BAA4BE,OAAOC;AACjE;AAEA;;;;;CAKC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCH,KAAa,EACbC,OAAkC;IAElC,IAAI,CAACE,SAAS;QACZ,OAAOH;IACT;IAEA,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEI,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,eAAe,EAAE,GAAGP;IAE1G,IAAIC,oBAAoB;YACtBJ;;QAAAA,QAAAA,SAAAA,OAAMW,uCAANX,OAAMW,KAAOP;IACf;IAEA,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,EAACN,oBAAAA,8BAAAA,QAASW,gBAAgB,KAAIN,aAAaN,MAAMW,EAAE,AAAD,GAAI;YACpEX,SAAM;;QAANA,MAAAA,UAAAA,MAAK,CAAC,kBAAA,kBAAkB,iCAAxBA,OAAK,CAAC,gBAAkB,GAAKO;IAC/B;IAEA,wEAAwE;IACxE,+DAA+D;IAC/D,yFAAyF;IACzF,IAAIE,uBAAuBJ,QAAQ;QACjC,kFAAkF;QAClFL,KAAK,CAAC,mBAAmB,GAAG;YAACS;YAAqBJ;YAAQL,kBAAAA,4BAAAA,KAAO,CAAC,mBAAmB;SAAC,CAACa,MAAM,CAACC,SAASC,IAAI,CAAC;IAC9G;IAEA,IAAIL,oBAAoB,SAAS;YAC/BV,SAAM;;QAANA,OAAAA,UAAAA,MAAK,CAAC,eAAA,eAAe,mCAArBA,OAAK,CAAC,aAAe,GAAK;IAC5B;IAEA,IAAIQ,UAAU;QACZ,IAAIP,oBAAAA,8BAAAA,QAASe,gBAAgB,EAAE;gBAC5BhB;;YAAD,cAACA,UAAAA,OAAiCQ,yDAAjCR,QAAiCQ,WAAa;QACjD,OAAO;gBACLR,SAAM;;YAANA,OAAAA,UAAAA,MAAK,CAAC,gBAAA,gBAAgB,mCAAtBA,OAAK,CAAC,cAAgB,GAAK;QAC7B;IACF;IAEA,oDAAoD;IACpD,IAAIC,oBAAAA,8BAAAA,QAASgB,YAAY,EAAE;YACxBjB;;QAAD,UAACA,UAAAA,OAA+CkB,6CAA/ClB,QAA+CkB,OAASf,QAAQe,IAAI;IACvE;IAEA,OAAOlB;AACT"}
1
+ {"version":3,"sources":["../../src/contexts/useFieldControlProps.ts"],"sourcesContent":["'use client';\n\nimport type { FieldContextValue, FieldControlProps } from '../Field';\nimport { useFieldContext_unstable } from './FieldContext';\n\n/**\n * Options for `useFieldControlProps_unstable`.\n */\nexport type FieldControlPropsOptions = {\n /**\n * Skips setting `aria-labelledby` on the control if the `label.htmlFor` refers to the control.\n *\n * This should be used with controls that can be the target of a label's `for` prop:\n * `<button>`, `<input>`, `<progress>`, `<select>`, `<textarea>`.\n */\n supportsLabelFor?: boolean;\n\n /**\n * Sets `required` instead of `aria-required` when the Field is marked required.\n *\n * This should be used with controls that support the `required` prop:\n * `<input>` (except `range` or `color`), `<select>`, `<textarea>`.\n */\n supportsRequired?: boolean;\n\n /**\n * Sets the size prop on the control to match the Field's size: `'small' | 'medium' | 'large'`.\n *\n * This should be used with controls that have a custom size prop that matches the Field's size prop.\n *\n * NOTE: the size is set on the props *returned* by this hook, so the control must read `size` from the returned\n * props. It has no effect if `size` is read from the original props (for example destructured by a wrapper hook\n * before calling this one) - in that case read the size from `useFieldContext_unstable()` directly instead.\n */\n supportsSize?: boolean;\n};\n\n/**\n * Gets the control props from the field context, if this inside a `<Field>`.\n *\n * When called with no arguments, returns the FieldControlProps that should be applied to the control.\n *\n * @returns A FieldControlProps object if inside a `<Field>`, otherwise undefined.\n */\nexport function useFieldControlProps_unstable(): FieldControlProps | undefined;\n\n/**\n * Copies and merges the FieldControlProps with the given props, if this inside a `<Field>`.\n *\n * @param props - The existing props for the control. These will be merged with the control props from the field context.\n * @param options - Option to include the size prop.\n * @returns Merged props if inside a `<Field>`, otherwise the original props, or undefined if no props given.\n */\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props: Props,\n options?: FieldControlPropsOptions,\n): Props;\nexport function useFieldControlProps_unstable<Props extends FieldControlProps>(\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n return getFieldControlProps(useFieldContext_unstable(), props, options);\n}\n\n/**\n * Implementation of useFieldControlProps_unstable.\n * Split out so it can be used directly in renderField_unstable.\n *\n * @internal\n */\nexport function getFieldControlProps<Props extends FieldControlProps>(\n context: FieldContextValue | undefined,\n props?: Props,\n options?: FieldControlPropsOptions,\n): Props | undefined {\n if (!context) {\n return props;\n }\n\n // Create a copy of props so we don't modify the original\n props = { ...props } as Props;\n\n const { generatedControlId, hintId, labelFor, labelId, required, validationMessageId, validationState } = context;\n\n if (generatedControlId) {\n props.id ??= generatedControlId;\n }\n\n // Set aria-labelledby if the control doesn't support label.htmlFor, or if the label's htmlFor doesn't refer\n // to this control (i.e. the user set this control's id prop without also setting the Field's label.htmlFor).\n if (labelId && (!options?.supportsLabelFor || labelFor !== props.id)) {\n props['aria-labelledby'] ??= labelId;\n }\n\n // The control is described by the validation message, or hint, or both.\n // We also preserve and append any aria-describedby from props.\n // For reference: https://github.com/microsoft/fluentui/pull/25580#discussion_r1017259933\n if (validationMessageId || hintId) {\n // NOTE: Not using ??= since we're merging and overriding the user-provided value.\n props['aria-describedby'] = [validationMessageId, hintId, props?.['aria-describedby']].filter(Boolean).join(' ');\n }\n\n if (validationState === 'error') {\n props['aria-invalid'] ??= true;\n }\n\n if (required) {\n if (options?.supportsRequired) {\n (props as { required?: boolean }).required ??= true;\n } else {\n props['aria-required'] ??= true;\n }\n }\n\n // Include the size prop if this control supports it\n if (options?.supportsSize) {\n (props as { size?: FieldContextValue['size'] }).size ??= context.size;\n }\n\n return props;\n}\n"],"names":["useFieldContext_unstable","useFieldControlProps_unstable","props","options","getFieldControlProps","context","generatedControlId","hintId","labelFor","labelId","required","validationMessageId","validationState","id","supportsLabelFor","filter","Boolean","join","supportsRequired","supportsSize","size"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,QAAQ,oBAAiB;AAsD1D,OAAO,SAASC,8BACdC,KAAa,EACbC,OAAkC;IAElC,OAAOC,qBAAqBJ,4BAA4BE,OAAOC;AACjE;AAEA;;;;;CAKC,GACD,OAAO,SAASC,qBACdC,OAAsC,EACtCH,KAAa,EACbC,OAAkC;IAElC,IAAI,CAACE,SAAS;QACZ,OAAOH;IACT;IAEA,yDAAyD;IACzDA,QAAQ;QAAE,GAAGA,KAAK;IAAC;IAEnB,MAAM,EAAEI,kBAAkB,EAAEC,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,eAAe,EAAE,GAAGP;IAE1G,IAAIC,oBAAoB;YACtBJ,QAAAA;SAAAA,MAAAA,CAAAA,SAAAA,OAAMW,EAAE,cAARX,iBAAAA,MAAAA,OAAMW,EAAE,GAAKP;IACf;IAEA,4GAA4G;IAC5G,6GAA6G;IAC7G,IAAIG,WAAY,CAAA,EAACN,oBAAAA,8BAAAA,QAASW,gBAAgB,KAAIN,aAAaN,MAAMW,EAAE,AAAD,GAAI;YACpEX,SAAM,iBAANA;SAAAA,IAAAA,CAAAA,UAAAA,MAAK,CAAC,kBAAA,kBAAkB,cAAxBA,eAAAA,IAAAA,OAAK,CAAC,gBAAkB,GAAKO;IAC/B;IAEA,wEAAwE;IACxE,+DAA+D;IAC/D,yFAAyF;IACzF,IAAIE,uBAAuBJ,QAAQ;QACjC,kFAAkF;QAClFL,KAAK,CAAC,mBAAmB,GAAG;YAACS;YAAqBJ;YAAQL,kBAAAA,4BAAAA,KAAO,CAAC,mBAAmB;SAAC,CAACa,MAAM,CAACC,SAASC,IAAI,CAAC;IAC9G;IAEA,IAAIL,oBAAoB,SAAS;YAC/BV,SAAM,cAANA;SAAAA,KAAAA,CAAAA,UAAAA,MAAK,CAAC,eAAA,eAAe,cAArBA,gBAAAA,KAAAA,OAAK,CAAC,aAAe,GAAK;IAC5B;IAEA,IAAIQ,UAAU;QACZ,IAAIP,oBAAAA,8BAAAA,QAASe,gBAAgB,EAAE;gBAC5BhB,SAAD;aAAA,YAAA,CAACA,UAAAA,OAAiCQ,QAAQ,cAA1C,uBAAA,YAAA,AAACR,QAAiCQ,QAAQ,GAAK;QACjD,OAAO;gBACLR,SAAM,eAANA;aAAAA,KAAAA,CAAAA,UAAAA,MAAK,CAAC,gBAAA,gBAAgB,cAAtBA,gBAAAA,KAAAA,OAAK,CAAC,cAAgB,GAAK;QAC7B;IACF;IAEA,oDAAoD;IACpD,IAAIC,oBAAAA,8BAAAA,QAASgB,YAAY,EAAE;YACxBjB,SAAD;SAAA,QAAA,CAACA,UAAAA,OAA+CkB,IAAI,cAApD,mBAAA,QAAA,AAAClB,QAA+CkB,IAAI,GAAKf,QAAQe,IAAI;IACvE;IAEA,OAAOlB;AACT"}
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
5
5
  function _export(target, all) {
6
6
  for(var name in all)Object.defineProperty(target, name, {
7
7
  enumerable: true,
8
- get: all[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- Field: function() {
12
+ get Field () {
13
13
  return _index.Field;
14
14
  },
15
- fieldClassNames: function() {
15
+ get fieldClassNames () {
16
16
  return _index.fieldClassNames;
17
17
  },
18
- renderField_unstable: function() {
18
+ get renderField_unstable () {
19
19
  return _index.renderField_unstable;
20
20
  },
21
- useFieldBase_unstable: function() {
21
+ get useFieldBase_unstable () {
22
22
  return _index.useFieldBase_unstable;
23
23
  },
24
- useFieldStyles_unstable: function() {
24
+ get useFieldStyles_unstable () {
25
25
  return _index.useFieldStyles_unstable;
26
26
  },
27
- useField_unstable: function() {
27
+ get useField_unstable () {
28
28
  return _index.useField_unstable;
29
29
  }
30
30
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/Field/Field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from './Field.types';\nimport { renderField_unstable } from './renderField';\nimport { useField_unstable } from './useField';\nimport { useFieldStyles_unstable } from './useFieldStyles.styles';\nimport { useFieldContextValues_unstable } from '../../contexts/index';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nexport const Field: ForwardRefComponent<FieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref);\n useFieldStyles_unstable(state);\n useCustomStyleHook_unstable('useFieldStyles_unstable')(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nField.displayName = 'Field';\n"],"names":["React","renderField_unstable","useField_unstable","useFieldStyles_unstable","useFieldContextValues_unstable","useCustomStyleHook_unstable","Field","forwardRef","props","ref","state","context","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;6BAGM,mBAAgB;0BACnB,gBAAa;sCACP,6BAA0B;uBACnB,0BAAuB;qCAC1B,kCAAkC;AAEvE,MAAMM,QAAAA,WAAAA,GAAyCN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,YAAQR,2BAAAA,EAAkBM,OAAOC;QACvCN,6CAAAA,EAAwBO;QACxBL,gDAAAA,EAA4B,2BAA2BK;IACvD,MAAMC,cAAUP,qCAAAA,EAA+BM;IAC/C,WAAOT,iCAAAA,EAAqBS,OAAOC;AACrC,GAAG;AAEHL,MAAMM,WAAW,GAAG"}
1
+ {"version":3,"sources":["../../../src/components/Field/Field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { FieldProps } from './Field.types';\nimport { renderField_unstable } from './renderField';\nimport { useField_unstable } from './useField';\nimport { useFieldStyles_unstable } from './useFieldStyles.styles';\nimport { useFieldContextValues_unstable } from '../../contexts/index';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\nexport const Field: ForwardRefComponent<FieldProps> = React.forwardRef((props, ref) => {\n const state = useField_unstable(props, ref);\n useFieldStyles_unstable(state);\n useCustomStyleHook_unstable('useFieldStyles_unstable')(state);\n const context = useFieldContextValues_unstable(state);\n return renderField_unstable(state, context);\n});\n\nField.displayName = 'Field';\n"],"names":["React","renderField_unstable","useField_unstable","useFieldStyles_unstable","useFieldContextValues_unstable","useCustomStyleHook_unstable","Field","forwardRef","props","ref","state","context","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;6BAGM,mBAAgB;0BACnB,gBAAa;sCACP,6BAA0B;uBACnB,0BAAuB;qCAC1B,kCAAkC;AAEvE,MAAMM,QAAAA,WAAAA,GAAyCN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IAC7E,MAAMC,YAAQR,2BAAAA,EAAkBM,OAAOC;QACvCN,6CAAAA,EAAwBO;QACxBL,gDAAAA,EAA4B,2BAA2BK;IACvD,MAAMC,cAAUP,qCAAAA,EAA+BM;IAC/C,WAAOT,iCAAAA,EAAqBS,OAAOC;AACrC,GAAG;AAEHL,MAAMM,WAAW,GAAG"}