@shopify/ui-extensions 2025.10.1 → 2025.10.2

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 (86) hide show
  1. package/README.md +16 -34
  2. package/build/ts/surfaces/admin/components/Avatar/Avatar.doc.d.ts.map +1 -1
  3. package/build/ts/surfaces/admin/components/Badge/Badge.doc.d.ts.map +1 -1
  4. package/build/ts/surfaces/admin/components/Chip/Chip.doc.d.ts.map +1 -1
  5. package/build/ts/surfaces/admin/components/Heading/Heading.doc.d.ts.map +1 -1
  6. package/build/ts/surfaces/admin/components/Icon/Icon.doc.d.ts.map +1 -1
  7. package/build/ts/surfaces/admin/components/Image/Image.doc.d.ts.map +1 -1
  8. package/build/ts/surfaces/admin/components/Paragraph/Paragraph.doc.d.ts.map +1 -1
  9. package/build/ts/surfaces/admin/components/Text/Text.doc.d.ts.map +1 -1
  10. package/build/ts/surfaces/admin/components/Thumbnail/Thumbnail.doc.d.ts.map +1 -1
  11. package/build/ts/surfaces/admin/docs-types.d.ts +26 -10
  12. package/build/ts/surfaces/admin/docs-types.d.ts.map +1 -1
  13. package/build/ts/surfaces/customer-account/api/standard-api/standard-api.d.ts +1 -1
  14. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts +0 -11
  15. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts.map +1 -1
  16. package/build/ts/surfaces/point-of-sale/api/pin-pad-api.d.ts +12 -5
  17. package/build/ts/surfaces/point-of-sale/api/pin-pad-api.d.ts.map +1 -1
  18. package/build/ts/surfaces/point-of-sale/types/pin-pad.d.ts +13 -4
  19. package/build/ts/surfaces/point-of-sale/types/pin-pad.d.ts.map +1 -1
  20. package/build/tsconfig.tsbuildinfo +1 -1
  21. package/package.json +1 -1
  22. package/src/surfaces/admin/components/Avatar/examples/basic-usage.html +1 -0
  23. package/src/surfaces/admin/components/Avatar/examples/color-consistency-demo.html +7 -0
  24. package/src/surfaces/admin/components/Avatar/examples/default-avatar-no-props.html +1 -0
  25. package/src/surfaces/admin/components/Avatar/examples/default.html +1 -4
  26. package/src/surfaces/admin/components/Avatar/examples/error-handling-example.html +6 -0
  27. package/src/surfaces/admin/components/Avatar/examples/fulfillment-partner-avatars.html +14 -0
  28. package/src/surfaces/admin/components/Avatar/examples/in-customer-list-context.html +24 -0
  29. package/src/surfaces/admin/components/Avatar/examples/long-initials-handling.html +5 -0
  30. package/src/surfaces/admin/components/Avatar/examples/size-variations.html +7 -0
  31. package/src/surfaces/admin/components/Avatar/examples/staff-member-profiles.html +10 -0
  32. package/src/surfaces/admin/components/Avatar/examples/with-image-source-and-fallback.html +6 -0
  33. package/src/surfaces/admin/components/Avatar/examples/with-section-component.html +17 -0
  34. package/src/surfaces/admin/components/Badge/examples/different-sizes-for-emphasis.html +4 -0
  35. package/src/surfaces/admin/components/Badge/examples/order-status-badges.html +6 -0
  36. package/src/surfaces/admin/components/Badge/examples/status-indicators-with-icons.html +15 -0
  37. package/src/surfaces/admin/components/Badge/examples/within-table-context.html +18 -0
  38. package/src/surfaces/admin/components/Chip/examples/basic-usage.html +3 -0
  39. package/src/surfaces/admin/components/Chip/examples/color-variants.html +12 -0
  40. package/src/surfaces/admin/components/Chip/examples/product-status.html +8 -0
  41. package/src/surfaces/admin/components/Chip/examples/text-truncation.html +12 -0
  42. package/src/surfaces/admin/components/Chip/examples/with-icon-graphic.html +4 -0
  43. package/src/surfaces/admin/components/Heading/examples/basic-heading.html +1 -0
  44. package/src/surfaces/admin/components/Heading/examples/heading-with-custom-accessibility.html +3 -0
  45. package/src/surfaces/admin/components/Heading/examples/heading-with-line-clamping.html +5 -0
  46. package/src/surfaces/admin/components/Heading/examples/heading-within-section-hierarchy.html +12 -0
  47. package/src/surfaces/admin/components/Icon/examples/basic-usage.html +7 -0
  48. package/src/surfaces/admin/components/Icon/examples/in-badge-components.html +4 -0
  49. package/src/surfaces/admin/components/Icon/examples/in-button-components.html +6 -0
  50. package/src/surfaces/admin/components/Icon/examples/small-size.html +1 -0
  51. package/src/surfaces/admin/components/Icon/examples/subdued-color.html +1 -0
  52. package/src/surfaces/admin/components/Icon/examples/with-id-property.html +1 -0
  53. package/src/surfaces/admin/components/Icon/examples/with-interest-relationship.html +1 -0
  54. package/src/surfaces/admin/components/Icon/examples/with-semantic-tone.html +6 -0
  55. package/src/surfaces/admin/components/Image/examples/auto-sized-image.html +5 -0
  56. package/src/surfaces/admin/components/Image/examples/basic-usage.html +1 -0
  57. package/src/surfaces/admin/components/Image/examples/decorative-image.html +7 -0
  58. package/src/surfaces/admin/components/Image/examples/responsive-images-with-srcset.html +9 -0
  59. package/src/surfaces/admin/components/Image/examples/responsive-layout-with-aspect-ratio.html +7 -0
  60. package/src/surfaces/admin/components/Image/examples/with-border-styling.html +12 -0
  61. package/src/surfaces/admin/components/Image/examples/within-layout-components.html +26 -0
  62. package/src/surfaces/admin/components/Paragraph/examples/admin-ui-patterns.html +21 -0
  63. package/src/surfaces/admin/components/Paragraph/examples/basic-usage.html +3 -0
  64. package/src/surfaces/admin/components/Paragraph/examples/line-clamping.html +8 -0
  65. package/src/surfaces/admin/components/Paragraph/examples/rtl-support.html +1 -0
  66. package/src/surfaces/admin/components/Paragraph/examples/screen-reader-text.html +3 -0
  67. package/src/surfaces/admin/components/Paragraph/examples/tabular-numbers.html +3 -0
  68. package/src/surfaces/admin/components/Paragraph/examples/with-tone-and-color.html +9 -0
  69. package/src/surfaces/admin/components/Text/examples/accessibility-hidden-text.html +1 -0
  70. package/src/surfaces/admin/components/Text/examples/basic-usage.html +1 -0
  71. package/src/surfaces/admin/components/Text/examples/interest-for-association.html +6 -0
  72. package/src/surfaces/admin/components/Text/examples/right-to-left-text.html +1 -0
  73. package/src/surfaces/admin/components/Text/examples/semantic-address.html +1 -0
  74. package/src/surfaces/admin/components/Text/examples/status-tones.html +5 -0
  75. package/src/surfaces/admin/components/Text/examples/strong-text.html +1 -0
  76. package/src/surfaces/admin/components/Text/examples/subdued-color.html +1 -0
  77. package/src/surfaces/admin/components/Text/examples/tabular-numbers.html +1 -0
  78. package/src/surfaces/admin/components/Thumbnail/examples/basic-usage.html +5 -0
  79. package/src/surfaces/admin/components/Thumbnail/examples/different-sizes.html +17 -0
  80. package/src/surfaces/admin/components/Thumbnail/examples/empty-state.html +1 -0
  81. package/src/surfaces/admin/components/Thumbnail/examples/with-event-handling.html +6 -0
  82. package/src/surfaces/admin/docs-types.ts +33 -12
  83. package/src/surfaces/customer-account/api/standard-api/standard-api.ts +1 -1
  84. package/src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts +0 -18
  85. package/src/surfaces/point-of-sale/api/pin-pad-api.ts +12 -5
  86. package/src/surfaces/point-of-sale/types/pin-pad.ts +13 -4
package/README.md CHANGED
@@ -1,42 +1,24 @@
1
1
  # `@shopify/ui-extensions`
2
2
 
3
- This package contains the public type definitions and utilities needed to create a Shopify UI extension. This is a generalized package that is intended to be the long-term home of the surface-specific UI extension packages, like [`@shopify/checkout-ui-extensions`](https://github.com/Shopify/ui-extensions/tree/main/packages/checkout-ui-extensions) and [`@shopify/admin-ui-extensions`](https://github.com/Shopify/ui-extensions/tree/main/packages/admin-ui-extensions).
3
+ This package contains the public type definitions and utilities needed to create Shopify UI extensions.
4
4
 
5
- > **Is your extension currently using `@shopify/checkout-ui-extensions`?** You can learn what you need to do to upgrade to this API versioned package in the [migration guide](../../documentation/upgrade/checkout-ui-extension-api-versioning.md).
5
+ This package supports the development of UI extension for [Admin](https://shopify.dev/docs/api/admin-extensions), [Customer account](https://shopify.dev/docs/api/customer-account-ui-extensions), [POS](https://shopify.dev/docs/api/pos-ui-extensions), and [Checkout](https://shopify.dev/docs/api/checkout-ui-extensions) surfaces.
6
6
 
7
- Currently, this package only contains the extension APIs for the [`checkout`](./src/surfaces/checkout) and [`admin`](./src/surfaces/admin) surfaces, but other Shopify surfaces will be added here soon.
7
+ All extensions, regardless of where they appear in Shopify, make use of the same [underlying technology](https://github.com/Shopify/remote-dom), and most of the same “core” components (e.g., `s-block`, `s-button`, `s-text-field`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.
8
8
 
9
- All extensions, regardless of where they appear in Shopify, make use of the same [underlying technology](../../documentation/how-extensions-work.md), and most of the same “core” components (e.g., `BlockStack`, `Button`, `TextField`, etc) and capabilities (e.g., direct API access, session tokens). Separating APIs by surface makes it easier for a developer to see what is available to them in each context, and gives us a flexible system for introducing components and APIs available in only some areas of Shopify.
10
-
11
- A checkout extension using “vanilla” JavaScript would be written as follows:
9
+ A checkout extension using Preact would be written as follows:
12
10
 
13
11
  ```ts
14
- import {extension, TextField} from '@shopify/ui-extensions/checkout';
15
-
16
- export default extension(
17
- 'purchase.checkout.block.render',
18
- (root, {i18n, metafields, applyMetafieldChange}) => {
19
- const metafield = metafields.current.find(
20
- (metafield) =>
21
- metafield.namespace === 'custom' && metafield.key === 'gift_note',
22
- );
23
-
24
- const textfield = root.createComponent(TextField, {
25
- label: i18n.translate('gift_note.label'),
26
- value: metafield?.value ?? '',
27
- onChange(value) {
28
- textfield.updateProps({value});
29
-
30
- applyMetafieldChange({
31
- namespace: 'custom',
32
- key: 'gift_note',
33
- value,
34
- valueType: 'string',
35
- });
36
- },
37
- });
38
-
39
- root.appendChild(textfield);
40
- },
41
- );
12
+ import '@shopify/ui-extensions/preact';
13
+ import {render} from 'preact';
14
+
15
+ export default function extension() {
16
+ render(<Extension />, document.body);
17
+ }
18
+
19
+ function Extension() {
20
+ return (
21
+ <s-text>Line item title: {shopify.target.value.merchandise.title}</s-text>
22
+ );
23
+ }
42
24
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Avatar/Avatar.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA8BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Avatar.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Avatar/Avatar.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAuLX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Badge/Badge.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA6BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Badge.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Badge/Badge.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA2FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Chip.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Chip/Chip.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA4BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Chip.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Chip/Chip.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAuGX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Heading/Heading.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAsDX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Heading.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Heading/Heading.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAoHX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Icon.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Icon/Icon.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAwBX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Icon.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Icon/Icon.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA0IX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Image.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Image/Image.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA6CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Image.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Image/Image.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAkJX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Paragraph.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Paragraph/Paragraph.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAgDX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Paragraph.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Paragraph/Paragraph.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCAqJX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Text.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Text/Text.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA+CX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Text.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Text/Text.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA8KX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Thumbnail/Thumbnail.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA+BX,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Thumbnail.doc.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/admin/components/Thumbnail/Thumbnail.doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kCAAkC,EAAC,MAAM,kBAAkB,CAAC;AAGpE,QAAA,MAAM,IAAI,EAAE,kCA6FX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,15 +1,31 @@
1
1
  import type { CSSProperties } from 'react';
2
- import { ReferenceEntityTemplateSchema, CodeTabType } from '@shopify/generate-docs';
2
+ import { ReferenceEntityTemplateSchema, CodeTabType, ExampleType, ExampleSectionSchema, ExampleGroupType } from '@shopify/generate-docs';
3
3
  type AllowedCSSProperties = Pick<CSSProperties, 'minHeight' | 'minBlockSize'>;
4
- export interface AdminReferenceEntityTemplateSchema extends Omit<ReferenceEntityTemplateSchema, 'defaultExample'> {
5
- defaultExample?: Omit<NonNullable<ReferenceEntityTemplateSchema['defaultExample']>, 'codeblock'> & {
6
- codeblock?: {
7
- title: string;
8
- tabs: (CodeTabType & {
9
- layout?: string;
10
- customStyles?: AllowedCSSProperties;
11
- })[];
12
- };
4
+ type AdminCodeTabType = CodeTabType & {
5
+ layout?: string;
6
+ customStyles?: AllowedCSSProperties;
7
+ };
8
+ interface CodeLinkType {
9
+ name: string;
10
+ url: string;
11
+ icon: string;
12
+ }
13
+ interface AdminCodeblockType {
14
+ title: string;
15
+ tabs: AdminCodeTabType[];
16
+ links?: CodeLinkType[];
17
+ }
18
+ type AdminExampleType = Omit<ExampleType, 'codeblock'> & {
19
+ codeblock: AdminCodeblockType | AdminCodeblockType[];
20
+ };
21
+ type AdminExampleGroupType = Omit<ExampleGroupType, 'examples'> & {
22
+ examples: AdminExampleType[];
23
+ };
24
+ export interface AdminReferenceEntityTemplateSchema extends Omit<ReferenceEntityTemplateSchema, 'defaultExample' | 'examples'> {
25
+ defaultExample?: AdminExampleType;
26
+ examples?: Omit<ExampleSectionSchema, 'exampleGroups' | 'examples'> & {
27
+ exampleGroups?: AdminExampleGroupType[] | null;
28
+ examples?: AdminExampleType[] | null;
13
29
  };
14
30
  }
15
31
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"docs-types.d.ts","sourceRoot":"","sources":["../../../../src/surfaces/admin/docs-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAGhC,KAAK,oBAAoB,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,cAAc,CAAC,CAAC;AAE9E,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,6BAA6B,EAAE,gBAAgB,CAAC;IAC7D,cAAc,CAAC,EAAE,IAAI,CACnB,WAAW,CAAC,6BAA6B,CAAC,gBAAgB,CAAC,CAAC,EAC5D,WAAW,CACZ,GAAG;QACF,SAAS,CAAC,EAAE;YACV,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,CAAC,WAAW,GAAG;gBACnB,MAAM,CAAC,EAAE,MAAM,CAAC;gBAChB,YAAY,CAAC,EAAE,oBAAoB,CAAC;aACrC,CAAC,EAAE,CAAC;SACN,CAAC;KACH,CAAC;CACH"}
1
+ {"version":3,"file":"docs-types.d.ts","sourceRoot":"","sources":["../../../../src/surfaces/admin/docs-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AACzC,OAAO,EACL,6BAA6B,EAC7B,WAAW,EACX,WAAW,EACX,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAGhC,KAAK,oBAAoB,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,GAAG,cAAc,CAAC,CAAC;AAE9E,KAAK,gBAAgB,GAAG,WAAW,GAAG;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,oBAAoB,CAAC;CACrC,CAAC;AAEF,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;CACxB;AAED,KAAK,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,GAAG;IACvD,SAAS,EAAE,kBAAkB,GAAG,kBAAkB,EAAE,CAAC;CACtD,CAAC;AAEF,KAAK,qBAAqB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAChE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAEF,MAAM,WAAW,kCACf,SAAQ,IAAI,CAAC,6BAA6B,EAAE,gBAAgB,GAAG,UAAU,CAAC;IAC1E,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,eAAe,GAAG,UAAU,CAAC,GAAG;QACpE,aAAa,CAAC,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC;QAC/C,QAAQ,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;KACtC,CAAC;CACH"}
@@ -84,7 +84,7 @@ export interface StandardApi<Target extends ExtensionTarget = ExtensionTarget> {
84
84
  *
85
85
  * - Use noun + past tense verb format. For example, \`Changes saved\`.
86
86
  *
87
- * For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/unstable/components/feedback/banner) component.
87
+ * For errors, or information that needs to persist on the page, use a [banner](/docs/api/checkout-ui-extensions/polaris-web-components/feedback/banner) component.
88
88
  */
89
89
  toast: ToastApi;
90
90
  /**
@@ -19,15 +19,6 @@ export interface NavigationHistoryEntry {
19
19
  */
20
20
  getState(): unknown;
21
21
  }
22
- /**
23
- * The NavigationCurrentEntryChangeEvent interface of the Navigation API is the event object for the currententrychange event, which fires when the Navigation.currentEntry has changed.
24
- */
25
- export interface NavigationCurrentEntryChangeEvent {
26
- /**
27
- * Returns the NavigationHistoryEntry that was navigated from.
28
- */
29
- from: NavigationHistoryEntry;
30
- }
31
22
  export interface Navigation {
32
23
  /**
33
24
  * The navigate() method navigates to a specific URL, updating any provided state in the history entries list.
@@ -41,7 +32,5 @@ export interface Navigation {
41
32
  * The back() method of the Navigation interface navigates to the previous entry in the history list.
42
33
  */
43
34
  back(): void;
44
- addEventListener(type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void): void;
45
- removeEventListener(type: 'currententrychange', cb: (event: NavigationCurrentEntryChangeEvent) => void): void;
46
35
  }
47
36
  //# sourceMappingURL=navigation-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4KAA4K;IAC5K,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC;CAC9B;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E;;OAEG;IACH,YAAY,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IACb,gBAAgB,CACd,IAAI,EAAE,oBAAoB,EAC1B,EAAE,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,IAAI,GACrD,IAAI,CAAC;IACR,mBAAmB,CACjB,IAAI,EAAE,oBAAoB,EAC1B,EAAE,EAAE,CAAC,KAAK,EAAE,iCAAiC,KAAK,IAAI,GACrD,IAAI,CAAC;CACT"}
1
+ {"version":3,"file":"navigation-api.d.ts","sourceRoot":"","sources":["../../../../../../src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4KAA4K;IAC5K,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E;;OAEG;IACH,YAAY,EAAE,sBAAsB,CAAC;IACrC;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;CACd"}
@@ -1,15 +1,22 @@
1
1
  import { PinPadOptions, PinValidationResult } from '../types/pin-pad';
2
2
  export interface PinPadApiContent {
3
- /** Shows a pin pad to the user in a modal dialog.
3
+ /** Shows a PIN pad to the user in a modal dialog.
4
+ *
5
+ * `onSubmit` is called when the PIN is submitted for validation by the user. The callback
6
+ * should validate the PIN and accept or reject it.
7
+ *
8
+ * If the PIN is accepted, the modal will be dismissed and the `onDismissed` callback
9
+ * (provided via `options`) will be called. It is recommended that any post-validation
10
+ * navigation is performed in this callback rather than in `onSubmit`.
11
+ *
12
+ * If the PIN is rejected, the optional `errorMessage` will be displayed to the user and the modal
13
+ * will not be dismissed.
4
14
  *
5
- * @param onSubmit the function to be called when the PIN is submitted.
6
- * The callback should be used to validate the PIN and return `accept` or `reject`.
7
- * @param options the options for the pin pad
8
15
  */
9
16
  showPinPad(onSubmit: (pin: number[]) => Promise<PinValidationResult> | PinValidationResult, options?: PinPadOptions): void;
10
17
  }
11
18
  /**
12
- * Access the Pin Pad API for pin pad functionality in a modal.
19
+ * Access the PIN Pad API for PIN pad functionality in a modal.
13
20
  */
14
21
  export interface PinPadApi {
15
22
  pinPad: PinPadApiContent;
@@ -1 +1 @@
1
- {"version":3,"file":"pin-pad-api.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/api/pin-pad-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,UAAU,CACR,QAAQ,EAAE,CACR,GAAG,EAAE,MAAM,EAAE,KACV,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,EACvD,OAAO,CAAC,EAAE,aAAa,GACtB,IAAI,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
1
+ {"version":3,"file":"pin-pad-api.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/api/pin-pad-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;OAYG;IACH,UAAU,CACR,QAAQ,EAAE,CACR,GAAG,EAAE,MAAM,EAAE,KACV,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,EACvD,OAAO,CAAC,EAAE,aAAa,GACtB,IAAI,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,gBAAgB,CAAC;CAC1B"}
@@ -25,27 +25,34 @@ export interface PinPadActionType {
25
25
  }
26
26
  export interface PinPadOptions {
27
27
  /**
28
- * The function to be called when a pin is entered
28
+ * The function to be called whenever the entered PIN is updated
29
29
  */
30
30
  onPinEntry?: (pin: number[]) => void;
31
31
  /**
32
- * The function to be called when the pin pad modal is dismissed
32
+ * The function to be called when the PIN pad modal is dismissed
33
33
  */
34
34
  onDismissed?: (result: PinPadResult) => void;
35
35
  /**
36
- * The content for the prompt on the pin pad
36
+ * The content for the prompt on the PIN pad. This will be overridden by any
37
+ * `errorMessage` provided when rejecting a PIN from the `onSubmit` callback.
37
38
  */
38
39
  label?: string;
39
40
  /**
40
41
  * Whether the entered PIN should be masked
42
+ *
43
+ * @default true
41
44
  */
42
45
  masked?: boolean;
43
46
  /**
44
47
  * The minimum length of the PIN
48
+ *
49
+ * @default 4
45
50
  */
46
51
  minPinLength?: PinLength;
47
52
  /**
48
53
  * The maximum length of the PIN
54
+ *
55
+ * @default 6
49
56
  */
50
57
  maxPinLength?: PinLength;
51
58
  /**
@@ -57,7 +64,9 @@ export interface PinPadOptions {
57
64
  */
58
65
  title?: string;
59
66
  /**
60
- * Whether the pin should be automatically submitted when the user has entered the maximum PIN length
67
+ * Whether the PIN should be automatically submitted when the user has entered the maximum PIN length
68
+ *
69
+ * @default false
61
70
  */
62
71
  autoSubmit?: boolean;
63
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pin-pad.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/point-of-sale/types/pin-pad.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAC,G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