@fluentui/react-field 0.0.0-nightly-20230207-0424.1 → 0.0.0-nightly-20230209-0424.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +13 -13
- package/CHANGELOG.md +9 -9
- package/README.md +66 -1
- package/dist/index.d.ts +9 -9
- package/lib/components/Field/Field.types.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.json
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
"name": "@fluentui/react-field",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
6
|
-
"tag": "@fluentui/react-field_v0.0.0-nightly-
|
7
|
-
"version": "0.0.0-nightly-
|
5
|
+
"date": "Thu, 09 Feb 2023 04:31:34 GMT",
|
6
|
+
"tag": "@fluentui/react-field_v0.0.0-nightly-20230209-0424.1",
|
7
|
+
"version": "0.0.0-nightly-20230209-0424.1",
|
8
8
|
"comments": {
|
9
9
|
"prerelease": [
|
10
10
|
{
|
@@ -16,32 +16,32 @@
|
|
16
16
|
{
|
17
17
|
"author": "beachball",
|
18
18
|
"package": "@fluentui/react-field",
|
19
|
-
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
20
|
-
"commit": "
|
19
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230209-0424.1",
|
20
|
+
"commit": "f6e8053dd2aad97de5a62a65ead726f46c9068f0"
|
21
21
|
},
|
22
22
|
{
|
23
23
|
"author": "beachball",
|
24
24
|
"package": "@fluentui/react-field",
|
25
|
-
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-
|
26
|
-
"commit": "
|
25
|
+
"comment": "Bump @fluentui/react-label to v0.0.0-nightly-20230209-0424.1",
|
26
|
+
"commit": "f6e8053dd2aad97de5a62a65ead726f46c9068f0"
|
27
27
|
},
|
28
28
|
{
|
29
29
|
"author": "beachball",
|
30
30
|
"package": "@fluentui/react-field",
|
31
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
32
|
-
"commit": "
|
31
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230209-0424.1",
|
32
|
+
"commit": "f6e8053dd2aad97de5a62a65ead726f46c9068f0"
|
33
33
|
},
|
34
34
|
{
|
35
35
|
"author": "beachball",
|
36
36
|
"package": "@fluentui/react-field",
|
37
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
38
|
-
"commit": "
|
37
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230209-0424.1",
|
38
|
+
"commit": "f6e8053dd2aad97de5a62a65ead726f46c9068f0"
|
39
39
|
},
|
40
40
|
{
|
41
41
|
"author": "beachball",
|
42
42
|
"package": "@fluentui/react-field",
|
43
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
44
|
-
"commit": "
|
43
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230209-0424.1",
|
44
|
+
"commit": "f6e8053dd2aad97de5a62a65ead726f46c9068f0"
|
45
45
|
}
|
46
46
|
]
|
47
47
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# Change Log - @fluentui/react-field
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 09 Feb 2023 04:31:34 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20230209-0424.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v0.0.0-nightly-20230209-0424.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-alpha.18..@fluentui/react-field_v0.0.0-nightly-
|
9
|
+
Thu, 09 Feb 2023 04:31:34 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-field_v9.0.0-alpha.18..@fluentui/react-field_v0.0.0-nightly-20230209-0424.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-label to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
18
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
19
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20230209-0424.1 ([commit](https://github.com/microsoft/fluentui/commit/f6e8053dd2aad97de5a62a65ead726f46c9068f0) by beachball)
|
16
|
+
- Bump @fluentui/react-label to v0.0.0-nightly-20230209-0424.1 ([commit](https://github.com/microsoft/fluentui/commit/f6e8053dd2aad97de5a62a65ead726f46c9068f0) by beachball)
|
17
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230209-0424.1 ([commit](https://github.com/microsoft/fluentui/commit/f6e8053dd2aad97de5a62a65ead726f46c9068f0) by beachball)
|
18
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230209-0424.1 ([commit](https://github.com/microsoft/fluentui/commit/f6e8053dd2aad97de5a62a65ead726f46c9068f0) by beachball)
|
19
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230209-0424.1 ([commit](https://github.com/microsoft/fluentui/commit/f6e8053dd2aad97de5a62a65ead726f46c9068f0) by beachball)
|
20
20
|
|
21
21
|
## [9.0.0-alpha.18](https://github.com/microsoft/fluentui/tree/@fluentui/react-field_v9.0.0-alpha.18)
|
22
22
|
|
package/README.md
CHANGED
@@ -1,5 +1,70 @@
|
|
1
1
|
# @fluentui/react-field
|
2
2
|
|
3
|
-
**React Field
|
3
|
+
**React Field component for [Fluent UI React](https://react.fluentui.dev/)**
|
4
4
|
|
5
5
|
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
6
|
+
|
7
|
+
## Description
|
8
|
+
|
9
|
+
Field adds a label, validation message, and hint text to a control. Any single form control can be used as the child of the Field.
|
10
|
+
|
11
|
+
## Usage
|
12
|
+
|
13
|
+
To import Field:
|
14
|
+
|
15
|
+
```js
|
16
|
+
import { Field } from '@fluentui/react-components/unstable';
|
17
|
+
```
|
18
|
+
|
19
|
+
### Examples
|
20
|
+
|
21
|
+
Works with many form controls, for example:
|
22
|
+
|
23
|
+
```jsx
|
24
|
+
<>
|
25
|
+
<Field label="Name">
|
26
|
+
<Input />
|
27
|
+
</Field>
|
28
|
+
<Field label="Description">
|
29
|
+
<Textarea />
|
30
|
+
</Field>
|
31
|
+
<Field label="Size">
|
32
|
+
<RadioGroup>
|
33
|
+
<Radio label="Small" />
|
34
|
+
<Radio label="Medium" />
|
35
|
+
<Radio label="Large" />
|
36
|
+
</RadioGroup>
|
37
|
+
</Field>
|
38
|
+
</>
|
39
|
+
```
|
40
|
+
|
41
|
+
Display hint text:
|
42
|
+
|
43
|
+
```jsx
|
44
|
+
<Field label="Password" hint="Must be at least 8 characters long.">
|
45
|
+
<Input type="password" />
|
46
|
+
</Field>
|
47
|
+
```
|
48
|
+
|
49
|
+
Display an error message:
|
50
|
+
|
51
|
+
```jsx
|
52
|
+
<Field label="Re-enter password" validationMessage="Passwords do not match.">
|
53
|
+
<Input type="password" />
|
54
|
+
</Field>
|
55
|
+
```
|
56
|
+
|
57
|
+
See [Fluent UI Storybook](https://react.fluentui.dev/) for more detailed usage examples.
|
58
|
+
|
59
|
+
Alternatively, run Storybook locally with:
|
60
|
+
|
61
|
+
1. `yarn start`
|
62
|
+
2. Select `react-field` from the list.
|
63
|
+
|
64
|
+
### Specification
|
65
|
+
|
66
|
+
See [SPEC.md](./SPEC.md).
|
67
|
+
|
68
|
+
### Migration Guide
|
69
|
+
|
70
|
+
If you're upgrading to Fluent UI v9 see [MIGRATION.md](./MIGRATION.md) for guidance on updating the Field component.
|
package/dist/index.d.ts
CHANGED
@@ -51,14 +51,14 @@ export declare type FieldProps = Omit<ComponentProps<FieldSlots>, 'children'> &
|
|
51
51
|
/**
|
52
52
|
* The `validationState` affects the display of the `validationMessage` and `validationMessageIcon`.
|
53
53
|
*
|
54
|
-
* *
|
54
|
+
* * error: (default) The validation message has a red error icon and red text, with `role="alert"` so it is
|
55
55
|
* announced by screen readers. Additionally, the control inside the field has `aria-invalid` set, which adds a
|
56
56
|
* red border to some field components (such as `Input`).
|
57
|
-
* *
|
58
|
-
* *
|
59
|
-
* *
|
57
|
+
* * success: The validation message has a green checkmark icon and gray text.
|
58
|
+
* * warning: The validation message has a yellow exclamation icon and gray text.
|
59
|
+
* * none: The validation message has no icon and gray text.
|
60
60
|
*
|
61
|
-
* @default error when
|
61
|
+
* @default error when validationMessage is set; none otherwise.
|
62
62
|
*/
|
63
63
|
validationState?: 'error' | 'warning' | 'success' | 'none';
|
64
64
|
/**
|
@@ -92,10 +92,10 @@ export declare type FieldSlots = {
|
|
92
92
|
* The icon associated with the `validationMessage`. This will only be displayed if `validationMessage` is set.
|
93
93
|
*
|
94
94
|
* The default depends on `validationState`:
|
95
|
-
* *
|
96
|
-
* *
|
97
|
-
* *
|
98
|
-
* *
|
95
|
+
* * error: `<ErrorCircle12Filled />`
|
96
|
+
* * warning: `<Warning12Filled />`
|
97
|
+
* * success: `<CheckmarkCircle12Filled />`
|
98
|
+
* * none: `null`
|
99
99
|
*/
|
100
100
|
validationMessageIcon?: Slot<'span'>;
|
101
101
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Field.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-field/src/components/Field/Field.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * The props added to the Field's child element.\n */\nexport type FieldChildProps = 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 * *
|
1
|
+
{"version":3,"file":"Field.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-field/src/components/Field/Field.types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\nimport { Label } from '@fluentui/react-label';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\n/**\n * The props added to the Field's child element.\n */\nexport type FieldChildProps = 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>`), as well\n * as intrinsic form controls like `<input>` or `<textarea>`. Custom controls can also be used as long as they\n * accept FieldChildProps and spread them on the appropriate element.\n *\n * For more complex scenarios, a render function can be used to pass the FieldChildProps to the appropriate control.\n */\n children?: React.ReactElement<FieldChildProps> | null | ((props: FieldChildProps) => 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.\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' | 'validationState'>>;\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-field",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20230209-0424.1",
|
4
4
|
"description": "Fluent UI Field components",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -27,16 +27,16 @@
|
|
27
27
|
"devDependencies": {
|
28
28
|
"@fluentui/eslint-plugin": "*",
|
29
29
|
"@fluentui/react-conformance": "*",
|
30
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
30
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230209-0424.1",
|
31
31
|
"@fluentui/scripts-api-extractor": "*",
|
32
32
|
"@fluentui/scripts-tasks": "*"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-context-selector": "0.0.0-nightly-
|
35
|
+
"@fluentui/react-context-selector": "0.0.0-nightly-20230209-0424.1",
|
36
36
|
"@fluentui/react-icons": "^2.0.175",
|
37
|
-
"@fluentui/react-label": "0.0.0-nightly-
|
38
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
39
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
37
|
+
"@fluentui/react-label": "0.0.0-nightly-20230209-0424.1",
|
38
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230209-0424.1",
|
39
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230209-0424.1",
|
40
40
|
"@griffel/react": "^1.5.2",
|
41
41
|
"tslib": "^2.1.0"
|
42
42
|
},
|