Skip to content

Commit cc9d56a

Browse files
authored
Merge pull request #4274 from Shopify/forms-web-components-2025-07
Improve Forms component descriptions (2025-07)
2 parents 646f9b1 + de6c0ef commit cc9d56a

12 files changed

Lines changed: 1091 additions & 1093 deletions

File tree

packages/ui-extensions/docs/surfaces/customer-account/generated/customer_account_ui_extensions/2025-07/generated_docs_data.json

Lines changed: 461 additions & 444 deletions
Large diffs are not rendered by default.

packages/ui-extensions/docs/surfaces/customer-account/generated/customer_account_ui_extensions/2025-07/generated_docs_data_v2.json

Lines changed: 558 additions & 570 deletions
Large diffs are not rendered by default.

packages/ui-extensions/src/surfaces/checkout/components/Checkbox/Checkbox.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,23 @@ export interface CheckboxProps extends DisclosureActivatorProps {
3333
checked?: boolean;
3434

3535
/**
36-
* Whether the checkbox can be changed.
36+
* Whether the checkbox is disabled, preventing any user interaction.
3737
*/
3838
disabled?: boolean;
3939

4040
/**
41-
* Indicate an error to the user. The field will be given a specific stylistic treatment
42-
* to communicate problems that have to be resolved immediately.
41+
* An error message displayed below the field to indicate validation problems. When set, the field is styled with error indicators.
4342
*/
4443
error?: string;
4544

4645
/**
47-
* A label used for buyers using assistive technologies. When set, any
46+
* A label used for users of assistive technologies. When set, any
4847
* `children` supplied to this component will not be announced to screen reader users.
4948
*/
5049
accessibilityLabel?: string;
5150

5251
/**
53-
* A callback that is run whenever the checkbox is changed. This callback
52+
* A callback fired when the checkbox value changes. This callback
5453
* is called with a boolean indicating whether the checkbox should now be
5554
* active or inactive. This component is [controlled](https://reactjs.org/docs/forms.html#controlled-components),
5655
* so you must store this value in state and reflect it back in the

packages/ui-extensions/src/surfaces/checkout/components/ChoiceList/ChoiceList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {createRemoteComponent} from '@remote-ui/core';
22

33
/**
4-
* Use choice lists to present a list of choices where buyers can make a single selection or multiple selections.
4+
* Use choice lists to present a list of choices where users can make a single selection or multiple selections.
55
* @publicDocs
66
*/
77
export interface ChoiceListProps<T extends string | string[]> {
@@ -25,7 +25,7 @@ export interface ChoiceListProps<T extends string | string[]> {
2525
*/
2626
variant?: 'base' | 'group';
2727
/**
28-
* A callback that is run whenever the choice list is changed. This callback
28+
* A callback fired when the choice list value changes. This callback
2929
* is called with a string or array of strings indicating the ids of choices
3030
* that should now be selected. This component is
3131
* [controlled](https://reactjs.org/docs/forms.html#controlled-components),
@@ -36,7 +36,7 @@ export interface ChoiceListProps<T extends string | string[]> {
3636
}
3737

3838
/**
39-
* Use choice lists to present a list of choices where buyers can make
39+
* Use choice lists to present a list of choices where users can make
4040
* a single selection or multiple selections.
4141
*/
4242
export const ChoiceList = createRemoteComponent<

packages/ui-extensions/src/surfaces/checkout/components/DateField/DateField.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export interface DateFieldProps
2626
'yearMonth' | 'defaultYearMonth' | 'disabled' | 'onYearMonthChange'
2727
> {
2828
/**
29-
* Callback when the field has an invalid date.
30-
* This callback will be called, if the date typed is invalid or disabled.
29+
* A callback fired when the date field contains an invalid or disabled date after the user finishes editing.
30+
* This callback is invoked when the date typed is invalid or disabled.
3131
*
3232
* Dates that don’t exist or have formatting errors are considered invalid. Some examples of invalid dates are:
3333
* - 2021-02-31: February doesn’t have 31 days
@@ -39,15 +39,15 @@ export interface DateFieldProps
3939
*
4040
* Note that this will be called only when the user **finishes editing** the date,
4141
* after the `onChange` callback.
42-
* The field is **not** validated on every change to the input. Once the buyer has signalled that
42+
* The field is **not** validated on every change to the input. Once the user has signalled that
4343
* they have finished editing the field (typically, by blurring the field), the field gets validated and the callback is run if the value is invalid.
4444
*/
4545
onInvalid?(): void;
4646
}
4747

4848
/**
49-
* The DateField component is used to collect date information from buyers.
50-
* It also provides the ability to display a DatePicker UI, which allows users to select dates with ease.
49+
* The date field component is used to collect date information from users.
50+
* It also provides the ability to display a date picker UI, which allows users to select dates with ease.
5151
*/
5252
export const DateField = createRemoteComponent<'DateField', DateFieldProps>(
5353
'DateField',

packages/ui-extensions/src/surfaces/checkout/components/DatePicker/DatePicker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type SelectedDate = DateString | DateString[] | DateRange;
2929
export type DisabledDate = DateString | DateRange | DayString;
3030

3131
/**
32-
* The DatePicker component is a calendar picker UI that allows users to select a single date or a date range
32+
* The date picker component is a calendar picker UI that allows users to select a single date or a date range.
3333
* @publicDocs
3434
*/
3535
export interface DatePickerProps<T extends SelectedDate> {
@@ -51,7 +51,7 @@ export interface DatePickerProps<T extends SelectedDate> {
5151
*/
5252
disabled?: DisabledDate[] | boolean;
5353
/**
54-
* Whether the date picker is read-only.
54+
* Whether the date picker is read-only and can't be edited. Read-only date pickers remain focusable and their state is announced by screen readers where applicable.
5555
*/
5656
readOnly?: boolean;
5757
/**
@@ -60,15 +60,15 @@ export interface DatePickerProps<T extends SelectedDate> {
6060
*/
6161
selected: T;
6262
/**
63-
* A callback that is run whenever a date is selected or unselected. This callback
63+
* A callback fired when the selected date or dates change. This callback
6464
* is called with a string, an array of strings or a range object representing the selected dates.
6565
* This component is [controlled](https://reactjs.org/docs/forms.html#controlled-components),
6666
* so you must store these values in state and reflect it back in the
6767
* `selected` props.
6868
*/
6969
onChange?(selected: T): void;
7070
/**
71-
* A callback that is run whenever the month is changed. This callback
71+
* A callback fired when the displayed year and month change. This callback
7272
* is called with an object indicating the year/month the UI should change to.
7373
* When year/month navigation is controlled you must store these values in state and
7474
* reflect it back in the `yearMonth` prop.
@@ -77,7 +77,7 @@ export interface DatePickerProps<T extends SelectedDate> {
7777
}
7878

7979
/**
80-
* The DatePicker component is a calendar picker UI that allows users to select a single date or a date range.
80+
* The date picker component is a calendar picker UI that allows users to select a single date or a date range..
8181
*/
8282
export const DatePicker = createRemoteComponent<
8383
'DatePicker',

packages/ui-extensions/src/surfaces/checkout/components/DropZone/DropZone.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import {createRemoteComponent} from '@remote-ui/core';
33
import type {IdProps} from '../shared';
44

55
/**
6-
* DropZone allows file uploads through drag-and-drop functionality into a designated area on a page, or by activating a button. At present, DropZone does not offer image upload preview capabilities. The use of object URLs directly in an image component is not possible due to the extension and host operating on separate domains. Any element focused within the Dropzone component, including child elements such as the 'Add file' button, will initiate the file selector when the Enter or Spacebar key is pressed.
6+
* The drop zone component allows file uploads through drag-and-drop functionality into a designated area on a page, or by activating a button. At present, DropZone does not offer image upload preview capabilities. The use of object URLs directly in an image component is not possible due to the extension and host operating on separate domains. Any element focused within the drop zone component, including child elements such as the 'Add file' button, will initiate the file selector when the Enter or Spacebar key is pressed.
77
* @publicDocs
88
*/
99
export interface DropZoneProps extends IdProps {
1010
/**
11-
* Whether the field can be modified.
11+
* Whether the drop zone is disabled, preventing any user interaction.
1212
*/
1313
disabled?: boolean;
1414

@@ -21,13 +21,12 @@ export interface DropZoneProps extends IdProps {
2121
required?: boolean;
2222

2323
/**
24-
* Indicate an error to the user. The field will be given a specific stylistic treatment
25-
* to communicate problems that have to be resolved immediately.
24+
* An error message displayed below the field to indicate validation problems. When set, the drop zone is styled with error indicators.
2625
*/
2726
error?: string;
2827

2928
/**
30-
* Content to use as the field label.
29+
* The text displayed as the field label, which identifies the purpose of the drop zone to users.
3130
*/
3231
label?: string;
3332

@@ -51,7 +50,7 @@ export interface DropZoneProps extends IdProps {
5150

5251
/**
5352
* A label that describes the purpose or contents of the item. When set,
54-
* it will be announced to buyers using assistive technologies and will
53+
* it will be announced to users of assistive technologies and will
5554
* provide them with more context.
5655
*/
5756
accessibilityLabel?: string;
@@ -64,13 +63,13 @@ export interface DropZoneProps extends IdProps {
6463
multiple?: boolean;
6564

6665
/**
67-
* Callback when files are dropped or selected.
66+
* A callback fired when files are dropped or selected.
6867
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/drop_event
6968
*/
7069
onInput?(files: File[]): void;
7170

7271
/**
73-
* Callback when rejected files are dropped. Files are rejected based on the `accept` prop.
72+
* A callback fired when rejected files are dropped. Files are rejected based on the `accept` prop.
7473
*/
7574
onDropRejected?(files: File[]): void;
7675
}

packages/ui-extensions/src/surfaces/checkout/components/Form/Form.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@ Unlike an HTML `form` element, this component does not support configuring the d
88
*/
99
export interface FormProps {
1010
/**
11-
* Whether the form is able to be submitted. When set to `true`, this will
12-
* disable the implicit submit behavior of the form.
11+
* Whether the form is disabled, preventing submission and the implicit submit behavior from inputs. When set to `true`, pressing Enter in a field will not submit the form.
1312
*/
1413
disabled?: boolean;
1514
/**
16-
* A callback that is run when the form is submitted.
15+
* A callback fired when the form is submitted.
1716
*/
1817
onSubmit(): void;
1918
/**

packages/ui-extensions/src/surfaces/checkout/components/PhoneField/PhoneField.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type {Autocomplete} from '../shared';
55
import type {IconSource} from '../Icon/Icon';
66

77
/**
8-
* A PhoneField is an input field that merchants can type into optimized for phone numbers with a country code base auto-formatting. The country code is required for the initial render of the field but it can be overriden later by the user either by selecting a country in the country selection dropdown or by manually editing the country phone code directly in the text field.
8+
* A phone field is an input field that users can type into optimized for phone numbers with a country code base auto-formatting. The country code is required for the initial render of the field but it can be overriden later by the user either by selecting a country in the country selection dropdown or by manually editing the country phone code directly in the text field.
99
* @publicDocs
1010
*/
1111
export interface PhoneFieldProps {
@@ -36,13 +36,12 @@ export interface PhoneFieldProps {
3636
autocomplete?: Autocomplete | boolean;
3737

3838
/**
39-
* Whether the field can be modified.
39+
* Whether the phone field is disabled, preventing any user interaction.
4040
*/
4141
disabled?: boolean;
4242

4343
/**
44-
* Indicate an error to the user. The field will be given a specific stylistic treatment
45-
* to communicate problems that have to be resolved immediately.
44+
* An error message displayed below the field to indicate validation problems. When set, the field is styled with error indicators.
4645
*/
4746
error?: string;
4847

@@ -59,8 +58,8 @@ export interface PhoneFieldProps {
5958
id?: string;
6059

6160
/**
62-
* Content to use as the field label. This value is also used as the placeholder
63-
* when the field is empty.
61+
* The text displayed as the field label, which identifies the purpose of the field to users.
62+
* This value is also used as the placeholder when the field is empty.
6463
*/
6564
label: string;
6665

@@ -76,7 +75,7 @@ export interface PhoneFieldProps {
7675
name?: string;
7776

7877
/**
79-
* Whether the field is read-only.
78+
* Whether the field is read-only and can't be edited. Read-only fields remain focusable and their content is announced by screen readers.
8079
*/
8180
readonly?: boolean;
8281

@@ -95,11 +94,11 @@ export interface PhoneFieldProps {
9594
value?: string;
9695

9796
/**
98-
* Callback when the buyer has **finished editing** a field or pressed the country dropdown.
97+
* A callback fired when the user has **finished editing** the field, such as when they blur the field, or after using the country dropdown.
9998
* Unlike `onChange` callbacks you may be familiar with from Polaris or other React component libraries,
10099
* this callback is **not** run on every change to the input. Phone fields are
101-
* “partially controlled” components, which means that while the buyer edits the
102-
* field, its state is controlled by the component. Once the buyer has signalled that
100+
* “partially controlled” components, which means that while the user edits the
101+
* field, its state is controlled by the component. Once the user has signalled that
103102
* they have finished editing the field (typically, by blurring the field), `onChange`
104103
* is called if the input actually changed from the most recent `value` property. At
105104
* that point, you are expected to store this “committed value” in state, and reflect
@@ -111,7 +110,7 @@ export interface PhoneFieldProps {
111110
* is to have the component be the source of truth for the input `value`, and update
112111
* the `value` on every user input. The delay in responding to events from a UI
113112
* extension is only a few milliseconds, but attempting to strictly store state with
114-
* this delay can cause issues if a user types quickly, or if the buyer is using a
113+
* this delay can cause issues if a user types quickly, or if the user is using a
115114
* lower-powered device. Having the UI thread take ownership for “in progress” input,
116115
* and only synchronizing when the user is finished with a field, avoids this risk.
117116
*
@@ -125,28 +124,27 @@ export interface PhoneFieldProps {
125124
*/
126125
onChange?(value: string): void;
127126
/**
128-
* Callback when the user makes any changes in the field including selecting a country
129-
* in the dropdown. As noted in the documentation for `onChange`, you must not use
127+
* A callback fired when the user makes any changes in the field, such as typing a character or selecting a country in the dropdown. As noted in the documentation for `onChange`, you must not use
130128
* this to update `state` — use the `onChange` callback for that purpose.
131-
* Use the `onInput` prop when you need to do something as soon as the buyer makes a change,
129+
* Use the `onInput` prop when you need to do something as soon as the user makes a change,
132130
* like clearing validation errors that apply to the field as soon as the user begins
133131
* making the necessary adjustments.
134132
*
135133
* This callback is called with the current formatted value.
136134
*/
137135
onInput?(value: string): void;
138136
/**
139-
* Callback when input is focused.
137+
* A callback fired when the phone field receives focus.
140138
*/
141139
onFocus?(): void;
142140
/**
143-
* Callback when focus is removed.
141+
* A callback fired when the phone field loses focus.
144142
*/
145143
onBlur?(): void;
146144
}
147145

148146
/**
149-
* A PhoneField is an input field that merchants can type into optimized
147+
* A phone field is an input field that users can type into optimized
150148
* for phone numbers with a country code base auto-formatting.
151149
* The country code is required for the initial render of the field but
152150
* it can be overriden later by the user either by selecting a country

0 commit comments

Comments
 (0)