Skip to content

Commit f037a24

Browse files
committed
Fix CA docs: ConsentPolicy, commandFor alignment, code formatting, style cleanup
Made-with: Cursor
1 parent bcdf4db commit f037a24

File tree

6 files changed

+37
-48
lines changed

6 files changed

+37
-48
lines changed

packages/ui-extensions/src/surfaces/checkout/components/MapMarker.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ declare const tagName = "s-map-marker";
4242
/** @publicDocs */
4343
export interface MapMarkerElementProps extends Pick<MapMarkerProps$1, 'accessibilityLabel' | 'blockSize' | 'command' | 'commandFor' | 'clusterable' | 'inlineSize' | 'latitude' | 'longitude'> {
4444
/**
45-
* Sets the action the `commandFor` target should take when this marker is activated. See the documentation of particular components for the actions they support. Learn more about the [`command` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command).
45+
* Sets the action the `commandFor` target should take when this component is activated. Learn more about the [`command` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command).
4646
*
4747
* - `--auto`: a default action for the target component.
4848
* - `--show`: shows the target component.
@@ -53,7 +53,7 @@ export interface MapMarkerElementProps extends Pick<MapMarkerProps$1, 'accessibi
5353
*/
5454
command?: Extract<MapMarkerProps$1['command'], '--auto' | '--show' | '--hide' | '--toggle'>;
5555
/**
56-
* The ID of a component that should respond to activations (for example, clicks) on this component. Refer to the `command` property for how to control the behavior of the target. Learn more about the [`commandfor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
56+
* The ID of the component to control when this component is activated. Pair with the `command` property to specify what action to perform on the target component. Learn more about the [`commandFor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
5757
*/
5858
commandFor?: MapMarkerProps$1['commandFor'];
5959
}

packages/ui-extensions/src/surfaces/checkout/components/Progress.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export interface ProgressProps extends Pick<ProgressProps$1, 'accessibilityLabel
2525
*/
2626
accessibilityLabel?: ProgressProps$1['accessibilityLabel'];
2727
/**
28-
* The total amount of work the task requires. Must be a value greater than 0 and a valid floating point number.
28+
* The total amount of work the task requires. Must be a value greater than `0` and a valid floating point number.
2929
*
3030
* Learn more about the [max attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#max).
3131
*
@@ -42,7 +42,7 @@ export interface ProgressProps extends Pick<ProgressProps$1, 'accessibilityLabel
4242
*/
4343
tone?: Extract<ProgressProps$1['tone'], 'auto' | 'critical'>;
4444
/**
45-
* How much of the task has been completed. Must be a valid floating point number between 0 and `max`, or between 0 and 1 if `max` is omitted. When no value is set, the progress bar is indeterminate, indicating an ongoing activity with no estimated completion time.
45+
* How much of the task has been completed. Must be a valid floating point number between `0` and `max`, or between `0` and `1` if `max` is omitted. When no value is set, the progress bar is indeterminate, indicating an ongoing activity with no estimated completion time.
4646
*
4747
* Learn more about the [value attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#value).
4848
*/

packages/ui-extensions/src/surfaces/checkout/components/components-shared.d.ts

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ export interface MultipleInputProps extends BaseInputProps {
15761576
*/
15771577
onInput?: (event: Event) => void;
15781578
/**
1579-
* An array of the `value`s of the selected options.
1579+
* An array of `value` attributes for the currently selected options.
15801580
*
15811581
* This is a convenience prop for setting the `selected` prop on child options.
15821582
*/
@@ -2109,7 +2109,10 @@ export type AutocompleteAddressGroup = "fax" | "home" | "mobile" | "pager";
21092109
export type AnyAutocompleteField = "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "country-name" | "country" | "current-password" | "email" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "language" | "name" | "new-password" | "nickname" | "one-time-code" | "organization-title" | "organization" | "photo" | "postal-code" | "sex" | "street-address" | "transaction-amount" | "transaction-currency" | "url" | "username" | "bday-day" | "bday-month" | "bday-year" | "bday" | "cc-additional-name" | "cc-expiry-month" | "cc-expiry-year" | "cc-expiry" | "cc-family-name" | "cc-given-name" | "cc-name" | "cc-number" | "cc-csc" | "cc-type" | `${AutocompleteAddressGroup} email` | "impp" | `${AutocompleteAddressGroup} impp` | "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local-prefix" | "tel-local-suffix" | "tel-local" | "tel-national" | `${AutocompleteAddressGroup} tel` | `${AutocompleteAddressGroup} tel-area-code` | `${AutocompleteAddressGroup} tel-country-code` | `${AutocompleteAddressGroup} tel-extension` | `${AutocompleteAddressGroup} tel-local-prefix` | `${AutocompleteAddressGroup} tel-local-suffix` | `${AutocompleteAddressGroup} tel-local` | `${AutocompleteAddressGroup} tel-national`;
21102110
/** @publicDocs */
21112111
export type TextAutocompleteField = ExtractStrict<AnyAutocompleteField, "additional-name" | "address-level1" | "address-level2" | "address-level3" | "address-level4" | "address-line1" | "address-line2" | "address-line3" | "country-name" | "country" | "family-name" | "given-name" | "honorific-prefix" | "honorific-suffix" | "language" | "name" | "nickname" | "one-time-code" | "organization-title" | "organization" | "postal-code" | "sex" | "street-address" | "transaction-currency" | "username" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-type">;
2112-
/** @publicDocs */
2112+
/**
2113+
* The policy for which buyer consent is being collected. Used by the [consent checkbox](/docs/api/{API_NAME}/{API_VERSION}/polaris-web-components/forms/consent-checkbox) and [consent phone field](/docs/api/{API_NAME}/{API_VERSION}/polaris-web-components/forms/consent-phone-field) components to identify the type of marketing permission requested.
2114+
* @publicDocs
2115+
*/
21132116
export type ConsentPolicy = "sms-marketing";
21142117
interface ConsentCheckboxProps$1 extends GlobalProps, CheckboxProps$1 {
21152118
/**
@@ -2123,11 +2126,9 @@ interface ConsentCheckboxProps$1 extends GlobalProps, CheckboxProps$1 {
21232126
export type PhoneAutocompleteField = ExtractStrict<AnyAutocompleteField, "tel" | "tel-area-code" | "tel-country-code" | "tel-extension" | "tel-local-prefix" | "tel-local-suffix" | "tel-local" | "tel-national" | `${AutocompleteAddressGroup} tel` | `${AutocompleteAddressGroup} tel-area-code` | `${AutocompleteAddressGroup} tel-country-code` | `${AutocompleteAddressGroup} tel-extension` | `${AutocompleteAddressGroup} tel-local-prefix` | `${AutocompleteAddressGroup} tel-local-suffix` | `${AutocompleteAddressGroup} tel-local` | `${AutocompleteAddressGroup} tel-national`>;
21242127
interface PhoneFieldProps$1 extends GlobalProps, BaseTextFieldProps, Pick<FieldDecorationProps, "accessory">, AutocompleteProps<PhoneAutocompleteField> {
21252128
/**
2126-
* The type of number to collect.
2129+
* The type of phone number to collect. Specific styling may be applied to each type to provide extra guidance to users. No additional validation is performed based on the type.
21272130
*
2128-
* Specific style may be applied to each type to provide extra guidance to users. Note that no extra validation is performed based on the type.
2129-
*
2130-
* @default '' meaning no specific kind of phone number
2131+
* @default ''
21312132
*/
21322133
type?: "mobile" | "";
21332134
}
@@ -2173,9 +2174,7 @@ interface DatePickerProps$1 extends GlobalProps, InputProps, FocusEventProps {
21732174
*/
21742175
type?: "single" | "multiple" | "range";
21752176
/**
2176-
* Dates that can be selected.
2177-
*
2178-
* A comma-separated list of dates, date ranges. Whitespace is allowed after commas.
2177+
* Restricts which dates the user can select. Accepts a comma-separated list of dates and date ranges. Whitespace is allowed after commas.
21792178
*
21802179
* The default `''` allows all dates.
21812180
*
@@ -2226,7 +2225,7 @@ interface DatePickerProps$1 extends GlobalProps, InputProps, FocusEventProps {
22262225
*/
22272226
disallow?: string;
22282227
/**
2229-
* Days of the week that can be selected. These intersect with the result of `allow` and `disallow`.
2228+
* Restricts which days of the week the user can select. Only dates that fall on an allowed day AND pass the `allow`/`disallow` filters are selectable. For example, setting `allowedDays` to `'mon, wed, fri'` with `allow` set to `'2024-06'` restricts selection to Mondays, Wednesdays, and Fridays in June 2024.
22302229
*
22312230
* A comma-separated list of days. Whitespace is allowed after commas.
22322231
*
@@ -2306,9 +2305,8 @@ interface DateFieldProps$1 extends GlobalProps, BaseTextFieldProps, Pick<DatePic
23062305
*
23072306
* Disallowed dates are considered invalid.
23082307
*
2309-
* It’s important to note that this callback will be called only when the user **finishes editing** the date,
2310-
* and it’s called right after the `onChange` callback.
2311-
* The field is **not** validated on every change to the input. Once the buyer has signalled that
2308+
* This callback fires only when the user finishes editing the date, right after the `change` callback.
2309+
* The field isn’t validated on every change to the input. Once the user has signalled that
23122310
* 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.
23132311
*/
23142312
onInvalid?: (event: Event) => void;
@@ -3172,7 +3170,7 @@ interface ProgressProps$1 extends GlobalProps {
31723170
/**
31733171
* Specifies how much of the task has been completed.
31743172
*
3175-
* It must be a valid floating point number between 0 and `max`, or between 0 and 1 if `max` is omitted.
3173+
* It must be a valid floating point number between `0` and `max`, or between `0` and `1` if `max` is omitted.
31763174
* If there is no value attribute, the progress bar is indeterminate;
31773175
* this indicates that an activity is ongoing with no indication of how long it is expected to take.
31783176
*
@@ -3186,7 +3184,7 @@ interface ProgressProps$1 extends GlobalProps {
31863184
/**
31873185
* This attribute describes how much work the task indicated by the progress element requires.
31883186
*
3189-
* The `max` attribute, if present, must have a value greater than 0 and be a valid floating point number.
3187+
* The `max` attribute, if present, must have a value greater than `0` and be a valid floating point number.
31903188
*
31913189
* @default 1
31923190
*
@@ -3334,7 +3332,7 @@ interface SheetProps$1 extends BaseOverlayProps, BaseOverlayMethods, ToggleEvent
33343332
/**
33353333
* Adjust the padding of all edges.
33363334
*
3337-
* - `base`: Applies padding that is appropriate for the element. Note that it may result in no padding if Shopify believes this is the right design decision in a particular context.
3335+
* - `base`: Applies padding that is appropriate for the element. This might result in no padding if Shopify determines that is the right design decision for a particular context.
33383336
* - `none`: Removes all padding from the element. This can be useful when elements inside the sheet need to span to the edge of the sheet. For example, a full-width image. In this case, rely on box with a padding of `base` to bring back the desired padding for the rest of the content.
33393337
*
33403338
* @default 'base'

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

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,7 +1551,7 @@ export interface MultipleInputProps extends BaseInputProps {
15511551
*/
15521552
onInput?: (event: Event) => void;
15531553
/**
1554-
* An array of the `value`s of the selected options.
1554+
* An array of `value` attributes for the currently selected options.
15551555
*
15561556
* This is a convenience prop for setting the `selected` prop on child options.
15571557
*/
@@ -1954,7 +1954,7 @@ interface ClickableProps$1 extends GlobalProps, BaseBoxProps, BaseClickableProps
19541954
/**
19551955
* Disables the clickable, meaning it cannot be clicked or receive focus.
19561956
*
1957-
* In this state, onClick will not fire.
1957+
* In this state, `click` won’t fire.
19581958
* If the click event originates from a child element, the event will immediately stop propagating from this element.
19591959
*
19601960
* However, items within the clickable can still receive focus and be interacted with.
@@ -2148,9 +2148,7 @@ interface DatePickerProps$1 extends GlobalProps, InputProps, FocusEventProps {
21482148
*/
21492149
type?: "single" | "multiple" | "range";
21502150
/**
2151-
* Dates that can be selected.
2152-
*
2153-
* A comma-separated list of dates, date ranges. Whitespace is allowed after commas.
2151+
* Restricts which dates the user can select. Accepts a comma-separated list of dates and date ranges. Whitespace is allowed after commas.
21542152
*
21552153
* The default `''` allows all dates.
21562154
*
@@ -2201,7 +2199,7 @@ interface DatePickerProps$1 extends GlobalProps, InputProps, FocusEventProps {
22012199
*/
22022200
disallow?: string;
22032201
/**
2204-
* Days of the week that can be selected. These intersect with the result of `allow` and `disallow`.
2202+
* Restricts which days of the week the user can select. These intersect with the result of `allow` and `disallow`.
22052203
*
22062204
* A comma-separated list of days. Whitespace is allowed after commas.
22072205
*
@@ -3112,7 +3110,7 @@ interface ProgressProps$1 extends GlobalProps {
31123110
/**
31133111
* Specifies how much of the task has been completed.
31143112
*
3115-
* It must be a valid floating point number between 0 and `max`, or between 0 and 1 if `max` is omitted.
3113+
* It must be a valid floating point number between `0` and `max`, or between `0` and `1` if `max` is omitted.
31163114
* If there is no value attribute, the progress bar is indeterminate;
31173115
* this indicates that an activity is ongoing with no indication of how long it is expected to take.
31183116
*
@@ -3126,7 +3124,7 @@ interface ProgressProps$1 extends GlobalProps {
31263124
/**
31273125
* This attribute describes how much work the task indicated by the progress element requires.
31283126
*
3129-
* The `max` attribute, if present, must have a value greater than 0 and be a valid floating point number.
3127+
* The `max` attribute, if present, must have a value greater than `0` and be a valid floating point number.
31303128
*
31313129
* @default 1
31323130
*
@@ -4276,7 +4274,7 @@ declare module 'preact' {
42764274
declare const tagName$v = "s-map-marker";
42774275
interface MapMarkerElementProps extends Pick<MapMarkerProps$1, 'accessibilityLabel' | 'blockSize' | 'command' | 'commandFor' | 'clusterable' | 'inlineSize' | 'latitude' | 'longitude'> {
42784276
/**
4279-
* Sets the action the `commandFor` target should take when this marker is activated. See the documentation of particular components for the actions they support. Learn more about the [`command` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command).
4277+
* Sets the action the `commandFor` target should take when this component is activated. Learn more about the [`command` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command).
42804278
*
42814279
* - `--auto`: a default action for the target component.
42824280
* - `--show`: shows the target component.
@@ -4287,7 +4285,7 @@ interface MapMarkerElementProps extends Pick<MapMarkerProps$1, 'accessibilityLab
42874285
*/
42884286
command?: Extract<MapMarkerProps$1['command'], '--auto' | '--show' | '--hide' | '--toggle'>;
42894287
/**
4290-
* The ID of a component that should respond to activations (for example, clicks) on this component. Refer to the `command` property for how to control the behavior of the target. Learn more about the [`commandfor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
4288+
* The ID of the component to control when this component is activated. Pair with the `command` property to specify what action to perform on the target component. Learn more about the [`commandFor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
42914289
*/
42924290
commandFor?: MapMarkerProps$1['commandFor'];
42934291
}

packages/ui-extensions/src/surfaces/customer-account/api/docs.ts

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,21 @@ interface ButtonProps {
3535
*/
3636
accessibilityLabel?: string;
3737
/**
38-
* ID of a component that should respond to activations (e.g. clicks) on this component.
39-
*
40-
* See `command` for how to control the behavior of the target.
41-
*
42-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor
38+
* The ID of the component to control when this component is activated. Pair with the `command` property to specify what action to perform on the target component. Learn more about the [`commandFor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
4339
*/
4440
commandFor?: string;
4541
/**
46-
* Sets the action the `commandFor` should take when this clickable is activated.
42+
* Sets the action the `commandFor` target should take when this component is activated.
4743
*
48-
* See the documentation of particular components for the actions they support.
44+
* - `--auto`: A default action for the target component.
45+
* - `--show`: Shows the target component.
46+
* - `--hide`: Hides the target component.
47+
* - `--toggle`: Toggles the target component.
48+
* - `--copy`: Copies the target clipboard item.
4949
*
50-
* - `--auto`: a default action for the target component.
51-
* - `--show`: shows the target component.
52-
* - `--hide`: hides the target component.
53-
* - `--toggle`: toggles the target component.
54-
* - `--copy`: copies the target ClipboardItem.
50+
* Learn more about the [`command` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command).
5551
*
5652
* @default '--auto'
57-
*
58-
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#command
5953
*/
6054
command?: '--auto' | '--show' | '--hide' | '--toggle' | '--copy';
6155
/**
@@ -351,7 +345,7 @@ export interface Docs_Page_Button_PrimaryAction
351345
*/
352346
command?: ButtonProps['command'];
353347
/**
354-
* The `id` of a component that should respond to activations on this button. See `command` for how to control the behavior of the target.
348+
* The ID of the component to control when this component is activated. Pair with the `command` property to specify what action to perform on the target component. Learn more about the [`commandFor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
355349
*/
356350
commandFor?: ButtonProps['commandFor'];
357351
/**
@@ -407,7 +401,7 @@ export interface Docs_Page_Button_SecondaryAction
407401
*/
408402
command?: ButtonProps['command'];
409403
/**
410-
* The `id` of a component that should respond to activations on this button. See `command` for how to control the behavior of the target.
404+
* The ID of the component to control when this component is activated. Pair with the `command` property to specify what action to perform on the target component. Learn more about the [`commandFor` attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#commandfor).
411405
*/
412406
commandFor?: ButtonProps['commandFor'];
413407
/**

packages/ui-extensions/src/surfaces/customer-account/api/order-status/order-status.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ export interface OrderStatusApi<Target extends ExtensionTarget> {
290290
* The identifier that specifies where in Shopify's UI your code is being injected. This will be one of the targets you have included in your extension's configuration file.
291291
*
292292
* @example 'customer-account.order-status.block.render'
293-
* @see /docs/api/customer-account-ui-extensions/extension-targets-overview
294-
* @see /docs/apps/app-extensions/configuration#targets
293+
* Learn more about [targets](/docs/api/customer-account-ui-extensions/{API_VERSION}/targets) and [target configuration](/docs/api/customer-account-ui-extensions/{API_VERSION}#configuration).
295294
*
296295
* @deprecated Deprecated as of version `2023-07`, use `extension.target` instead.
297296
*/

0 commit comments

Comments
 (0)