@shopify/ui-extensions 2026.10.0-rc.8 → 2026.10.0-rc.9

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 (137) hide show
  1. package/build/ts/surfaces/admin/components/AdminAction.d.ts +61 -107
  2. package/build/ts/surfaces/admin/components/AdminBlock.d.ts +22 -107
  3. package/build/ts/surfaces/admin/components/AdminPrintAction.d.ts +20 -101
  4. package/build/ts/surfaces/admin/components/AppNav.d.ts +38 -1
  5. package/build/ts/surfaces/admin/components/Avatar.d.ts +100 -139
  6. package/build/ts/surfaces/admin/components/Badge.d.ts +107 -156
  7. package/build/ts/surfaces/admin/components/Banner.d.ts +102 -127
  8. package/build/ts/surfaces/admin/components/Box.d.ts +145 -234
  9. package/build/ts/surfaces/admin/components/Button.d.ts +156 -266
  10. package/build/ts/surfaces/admin/components/ButtonGroup.d.ts +89 -117
  11. package/build/ts/surfaces/admin/components/Checkbox.d.ts +139 -174
  12. package/build/ts/surfaces/admin/components/Chip.d.ts +117 -15
  13. package/build/ts/surfaces/admin/components/Choice.d.ts +88 -113
  14. package/build/ts/surfaces/admin/components/ChoiceList.d.ts +120 -129
  15. package/build/ts/surfaces/admin/components/Clickable.d.ts +227 -209
  16. package/build/ts/surfaces/admin/components/ClickableChip.d.ts +117 -153
  17. package/build/ts/surfaces/admin/components/ColorField.d.ts +111 -215
  18. package/build/ts/surfaces/admin/components/ColorPicker.d.ts +82 -137
  19. package/build/ts/surfaces/admin/components/DateField.d.ts +140 -230
  20. package/build/ts/surfaces/admin/components/DatePicker.d.ts +178 -181
  21. package/build/ts/surfaces/admin/components/Divider.d.ts +50 -118
  22. package/build/ts/surfaces/admin/components/DropZone.d.ts +153 -12
  23. package/build/ts/surfaces/admin/components/EmailField.d.ts +100 -197
  24. package/build/ts/surfaces/admin/components/EmptyState.d.ts +144 -0
  25. package/build/ts/surfaces/admin/components/Form.d.ts +25 -118
  26. package/build/ts/surfaces/admin/components/FunctionSettings.d.ts +26 -132
  27. package/build/ts/surfaces/admin/components/Grid.d.ts +165 -299
  28. package/build/ts/surfaces/admin/components/GridItem.d.ts +145 -261
  29. package/build/ts/surfaces/admin/components/Heading.d.ts +117 -117
  30. package/build/ts/surfaces/admin/components/Icon.d.ts +91 -129
  31. package/build/ts/surfaces/admin/components/Image.d.ts +216 -251
  32. package/build/ts/surfaces/admin/components/Link.d.ts +125 -126
  33. package/build/ts/surfaces/admin/components/ListItem.d.ts +63 -102
  34. package/build/ts/surfaces/admin/components/Menu.d.ts +82 -150
  35. package/build/ts/surfaces/admin/components/Modal.d.ts +232 -26
  36. package/build/ts/surfaces/admin/components/MoneyField.d.ts +103 -196
  37. package/build/ts/surfaces/admin/components/Number.d.ts +193 -0
  38. package/build/ts/surfaces/admin/components/NumberField.d.ts +114 -208
  39. package/build/ts/surfaces/admin/components/Option.d.ts +67 -108
  40. package/build/ts/surfaces/admin/components/OptionGroup.d.ts +69 -105
  41. package/build/ts/surfaces/admin/components/OrderedList.d.ts +56 -102
  42. package/build/ts/surfaces/admin/components/Page.d.ts +93 -13
  43. package/build/ts/surfaces/admin/components/Paragraph.d.ts +126 -138
  44. package/build/ts/surfaces/admin/components/PasswordField.d.ts +109 -203
  45. package/build/ts/surfaces/admin/components/Popover.d.ts +26 -8
  46. package/build/ts/surfaces/admin/components/QueryContainer.d.ts +77 -116
  47. package/build/ts/surfaces/admin/components/SearchField.d.ts +103 -191
  48. package/build/ts/surfaces/admin/components/Section.d.ts +132 -128
  49. package/build/ts/surfaces/admin/components/Select.d.ts +144 -193
  50. package/build/ts/surfaces/admin/components/Spinner.d.ts +60 -113
  51. package/build/ts/surfaces/admin/components/Stack.d.ts +156 -282
  52. package/build/ts/surfaces/admin/components/Switch.d.ts +75 -165
  53. package/build/ts/surfaces/admin/components/Table.d.ts +100 -210
  54. package/build/ts/surfaces/admin/components/TableBody.d.ts +70 -106
  55. package/build/ts/surfaces/admin/components/TableCell.d.ts +70 -107
  56. package/build/ts/surfaces/admin/components/TableHeader.d.ts +79 -119
  57. package/build/ts/surfaces/admin/components/TableHeaderRow.d.ts +71 -107
  58. package/build/ts/surfaces/admin/components/TableRow.d.ts +81 -109
  59. package/build/ts/surfaces/admin/components/Text.d.ts +123 -164
  60. package/build/ts/surfaces/admin/components/TextArea.d.ts +100 -195
  61. package/build/ts/surfaces/admin/components/TextField.d.ts +120 -204
  62. package/build/ts/surfaces/admin/components/Thumbnail.d.ts +83 -133
  63. package/build/ts/surfaces/admin/components/Tooltip.d.ts +78 -146
  64. package/build/ts/surfaces/admin/components/URLField.d.ts +107 -209
  65. package/build/ts/surfaces/admin/components/UnorderedList.d.ts +58 -110
  66. package/build/ts/surfaces/admin/components/shared.d.ts +4193 -1203
  67. package/build/ts/surfaces/checkout/components/Box.d.ts +56 -1
  68. package/build/ts/surfaces/customer-account/components/Box.d.ts +56 -1
  69. package/build/tsconfig.tsbuildinfo +1 -1
  70. package/package.json +1 -1
  71. package/src/surfaces/admin/components/AdminAction.d.ts +61 -107
  72. package/src/surfaces/admin/components/AdminBlock.d.ts +22 -107
  73. package/src/surfaces/admin/components/AdminPrintAction.d.ts +20 -101
  74. package/src/surfaces/admin/components/AppNav.d.ts +38 -1
  75. package/src/surfaces/admin/components/Avatar.d.ts +100 -139
  76. package/src/surfaces/admin/components/Badge.d.ts +107 -156
  77. package/src/surfaces/admin/components/Banner.d.ts +102 -127
  78. package/src/surfaces/admin/components/Box.d.ts +145 -234
  79. package/src/surfaces/admin/components/Button.d.ts +156 -266
  80. package/src/surfaces/admin/components/ButtonGroup.d.ts +89 -117
  81. package/src/surfaces/admin/components/Checkbox.d.ts +139 -174
  82. package/src/surfaces/admin/components/Chip.d.ts +117 -15
  83. package/src/surfaces/admin/components/Choice.d.ts +88 -113
  84. package/src/surfaces/admin/components/ChoiceList.d.ts +120 -129
  85. package/src/surfaces/admin/components/Clickable.d.ts +227 -209
  86. package/src/surfaces/admin/components/ClickableChip.d.ts +117 -153
  87. package/src/surfaces/admin/components/ColorField.d.ts +111 -215
  88. package/src/surfaces/admin/components/ColorPicker.d.ts +82 -137
  89. package/src/surfaces/admin/components/DateField.d.ts +140 -230
  90. package/src/surfaces/admin/components/DatePicker.d.ts +178 -181
  91. package/src/surfaces/admin/components/Divider.d.ts +50 -118
  92. package/src/surfaces/admin/components/DropZone.d.ts +153 -12
  93. package/src/surfaces/admin/components/EmailField.d.ts +100 -197
  94. package/src/surfaces/admin/components/EmptyState.d.ts +144 -0
  95. package/src/surfaces/admin/components/Form.d.ts +25 -118
  96. package/src/surfaces/admin/components/FunctionSettings.d.ts +26 -132
  97. package/src/surfaces/admin/components/Grid.d.ts +165 -299
  98. package/src/surfaces/admin/components/GridItem.d.ts +145 -261
  99. package/src/surfaces/admin/components/Heading.d.ts +117 -117
  100. package/src/surfaces/admin/components/Icon.d.ts +91 -129
  101. package/src/surfaces/admin/components/Image.d.ts +216 -251
  102. package/src/surfaces/admin/components/Link.d.ts +125 -126
  103. package/src/surfaces/admin/components/ListItem.d.ts +63 -102
  104. package/src/surfaces/admin/components/Menu.d.ts +82 -150
  105. package/src/surfaces/admin/components/Modal.d.ts +232 -26
  106. package/src/surfaces/admin/components/MoneyField.d.ts +103 -196
  107. package/src/surfaces/admin/components/Number.d.ts +193 -0
  108. package/src/surfaces/admin/components/NumberField.d.ts +114 -208
  109. package/src/surfaces/admin/components/Option.d.ts +67 -108
  110. package/src/surfaces/admin/components/OptionGroup.d.ts +69 -105
  111. package/src/surfaces/admin/components/OrderedList.d.ts +56 -102
  112. package/src/surfaces/admin/components/Page.d.ts +93 -13
  113. package/src/surfaces/admin/components/Paragraph.d.ts +126 -138
  114. package/src/surfaces/admin/components/PasswordField.d.ts +109 -203
  115. package/src/surfaces/admin/components/Popover.d.ts +26 -8
  116. package/src/surfaces/admin/components/QueryContainer.d.ts +77 -116
  117. package/src/surfaces/admin/components/SearchField.d.ts +103 -191
  118. package/src/surfaces/admin/components/Section.d.ts +132 -128
  119. package/src/surfaces/admin/components/Select.d.ts +144 -193
  120. package/src/surfaces/admin/components/Spinner.d.ts +60 -113
  121. package/src/surfaces/admin/components/Stack.d.ts +156 -282
  122. package/src/surfaces/admin/components/Switch.d.ts +75 -165
  123. package/src/surfaces/admin/components/Table.d.ts +100 -210
  124. package/src/surfaces/admin/components/TableBody.d.ts +70 -106
  125. package/src/surfaces/admin/components/TableCell.d.ts +70 -107
  126. package/src/surfaces/admin/components/TableHeader.d.ts +79 -119
  127. package/src/surfaces/admin/components/TableHeaderRow.d.ts +71 -107
  128. package/src/surfaces/admin/components/TableRow.d.ts +81 -109
  129. package/src/surfaces/admin/components/Text.d.ts +123 -164
  130. package/src/surfaces/admin/components/TextArea.d.ts +100 -195
  131. package/src/surfaces/admin/components/TextField.d.ts +120 -204
  132. package/src/surfaces/admin/components/Thumbnail.d.ts +83 -133
  133. package/src/surfaces/admin/components/Tooltip.d.ts +78 -146
  134. package/src/surfaces/admin/components/URLField.d.ts +107 -209
  135. package/src/surfaces/admin/components/UnorderedList.d.ts +58 -110
  136. package/src/surfaces/admin/components/shared.d.ts +4193 -1203
  137. package/src/surfaces/checkout/components/Box.d.ts +56 -1
@@ -1,151 +1,105 @@
1
- /** VERSION: 1.25.0 **/
1
+ /** VERSION: 2.23.0 **/
2
2
  /* eslint-disable import/extensions */
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace */
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
7
7
  /// <reference lib="DOM" />
8
- import type {ComponentChildren, AdminActionProps$1} from './shared.d.ts';
8
+ import type {
9
+ ComponentChildren,
10
+ AdminActionProps$1,
11
+ PreactCustomElement,
12
+ RenderImpl,
13
+ } from './shared.d.ts';
14
+ import * as preact$1 from 'preact';
15
+ import {ReactNode, RefAttributes} from 'react';
9
16
 
10
17
  /**
11
- * The properties for the admin action component. These properties configure the heading and loading state of the admin action extension interface.
18
+ * Configure the following properties on the admin action component.
12
19
  * @publicDocs
13
20
  */
14
21
  export interface AdminActionProps
15
- extends Pick<AdminActionProps$1, 'heading' | 'loading'> {}
22
+ extends Pick<AdminActionProps$1, 'heading' | 'loading'> {
23
+ /**
24
+ * Whether the action is in a loading state, such as during initial page load or when the action is being opened.
25
+ * When `true`, the action is in an inert state that prevents user interaction.
26
+ *
27
+ * @default false
28
+ */
29
+ loading: AdminActionProps$1['loading'];
30
+ }
16
31
 
17
- declare const tagName = 's-admin-action';
32
+ export type ReactIntrinsicElementChildren<PreactProps extends object> =
33
+ 'children' extends keyof PreactProps
34
+ ? {
35
+ children?: ReactNode;
36
+ }
37
+ : Record<never, never>;
38
+ export type ReactIntrinsicElementProps<
39
+ PreactProps extends object,
40
+ ElementType,
41
+ > = Omit<PreactProps, 'children' | 'key' | 'ref' | 'slot'> &
42
+ ReactIntrinsicElementChildren<PreactProps> &
43
+ RefAttributes<ElementType> & {
44
+ slot?: Lowercase<string>;
45
+ };
46
+ export type ReactIntrinsicElements = {
47
+ [Tag in Exclude<
48
+ Extract<keyof preact$1.createElement.JSX.IntrinsicElements, `s-${string}`>,
49
+ `s-test-${string}`
50
+ >]: ReactIntrinsicElementProps<
51
+ preact$1.createElement.JSX.IntrinsicElements[Tag],
52
+ Tag extends keyof HTMLElementTagNameMap
53
+ ? HTMLElementTagNameMap[Tag]
54
+ : HTMLElement
55
+ >;
56
+ };
57
+ declare module 'react' {
58
+ namespace JSX {
59
+ interface IntrinsicElements extends ReactIntrinsicElements {}
60
+ }
61
+ }
18
62
 
19
- /**
20
- * The JSX props for the admin action component. These properties extend `AdminActionProps` with slots for primary and secondary action buttons that merchants can interact with.
21
- * @publicDocs
22
- */
63
+ declare const tagName = 's-admin-action';
23
64
  export interface AdminActionJSXProps
24
65
  extends Partial<AdminActionProps>,
25
66
  Pick<AdminActionProps$1, 'id'> {
26
67
  /**
27
- * The primary action button or link to display in the admin action area. This is the main call-to-action that appears prominently in the interface. Typically uses a button component with `variant="primary"` to complete or advance the workflow.
68
+ * The main action button or link displayed in the admin action modal.
69
+ * This represents the primary or most important action that users can take in this modal context, typically displayed with high visual prominence.
28
70
  */
29
71
  primaryAction: ComponentChildren;
30
72
  /**
31
- * The secondary action buttons or links to display in the admin action area. These are supporting actions like cancel, back, or alternative operations. Typically uses button components with `variant="secondary"` or `variant="tertiary"`.
73
+ * Additional action buttons or links displayed in the admin action modal.
74
+ * These provide alternative or supporting actions, visually de-emphasized compared to the primary action to establish clear hierarchy.
32
75
  */
33
76
  secondaryActions: ComponentChildren;
34
77
  }
35
78
 
36
- /**
37
- * The CSS styles as a string, used for styling web components within their shadow DOM.
38
- * @publicDocs
39
- */
40
- export type Styles = string;
41
- /**
42
- * The implementation configuration for rendering a Preact component into a shadow root. Defines the render function that returns JSX elements and optional CSS styles to apply to the component's shadow DOM.
43
- * @publicDocs
44
- */
45
- export type RenderImpl = Omit<ShadowRootInit, 'mode'> & {
46
- /**
47
- * The render function that returns Preact/JSX elements to display in the component's shadow root.
48
- */
49
- ShadowRoot: (element: any) => ComponentChildren;
50
- /**
51
- * The optional CSS styles to inject into the component's shadow DOM.
52
- */
53
- styles?: Styles;
54
- };
55
- /**
56
- * The properties of an activation event (such as a click or keyboard press) that describe which modifier keys and mouse buttons were involved. This is used to determine intended behavior like opening links in new tabs when Command/Control is pressed.
57
- * @publicDocs
58
- */
59
- export interface ActivationEventEsque {
60
- /**
61
- * Whether the Shift key was pressed during the activation event.
62
- */
63
- shiftKey: boolean;
64
- /**
65
- * Whether the Meta key (Command on Mac, Windows key on Windows) was pressed during the activation event.
66
- */
67
- metaKey: boolean;
68
- /**
69
- * Whether the Control key was pressed during the activation event.
70
- */
71
- ctrlKey: boolean;
72
- /**
73
- * The mouse button that was pressed during the activation event. `0` for primary button (left click), `1` for auxiliary button (middle click), `2` for secondary button (right click).
74
- */
75
- button: number;
76
- }
77
- /**
78
- * The options for controlling how a synthetic click behaves. Allows passing modifier key states and button information from an original event to influence link behavior such as opening in new tabs or background tabs.
79
- * @publicDocs
80
- */
81
- export interface ClickOptions {
82
- /**
83
- * The activation event (such as a click or keyboard event) whose modifier key state and button information should influence the synthetic click behavior. For example, passing an event with `metaKey: true` will cause links to open in a new tab.
84
- */
85
- sourceEvent?: ActivationEventEsque;
86
- }
87
- /**
88
- * Base class for creating custom elements with Preact.
89
- * While this class could be used in both Node and the browser, the constructor will only be used in the browser.
90
- * So we give it a type of HTMLElement to avoid typing issues later where it's used, which will only happen in the browser.
91
- */
92
- declare const BaseClass: typeof globalThis.HTMLElement;
93
- declare abstract class PreactCustomElement extends BaseClass {
94
- /** @private */
95
- static get observedAttributes(): string[];
96
- constructor({
97
- styles,
98
- ShadowRoot: renderFunction,
99
- delegatesFocus,
100
- ...options
101
- }: RenderImpl);
102
-
103
- /** @private */
104
- setAttribute(name: string, value: string): void;
105
- /** @private */
106
- attributeChangedCallback(name: string): void;
79
+ declare class PolarisCustomElement extends PreactCustomElement {
80
+ constructor(renderImpl: Omit<RenderImpl, 'globalShadowCSS'>);
107
81
  /** @private */
108
82
  connectedCallback(): void;
109
83
  /** @private */
110
- disconnectedCallback(): void;
111
- /** @private */
112
84
  adoptedCallback(): void;
113
- /**
114
- * Queue a run of the render function.
115
- * You shouldn't need to call this manually - it should be handled by changes to @property values.
116
- * @private
117
- */
118
- queueRender(): void;
119
- /**
120
- * Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`.
121
- *
122
- * For example, if the `sourceEvent` was a middle click, or has particular keys held down,
123
- * components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
124
- * @private
125
- * @param options
126
- */
127
- click({sourceEvent}?: ClickOptions): void;
128
85
  }
129
86
 
130
87
  /**
131
- * The admin action custom element class that renders action controls in the Shopify admin interface. This component creates a standardized action area with a heading and slots for primary and secondary action buttons, used exclusively in admin action extensions.
88
+ * Configure the following properties on the admin action component.
89
+ * @publicDocs
132
90
  */
133
91
  declare class AdminAction
134
- extends PreactCustomElement
92
+ extends PolarisCustomElement
135
93
  implements AdminActionProps
136
94
  {
137
95
  /**
138
- * The heading text to display at the top of the action area. This title describes the action or task the merchant is performing. If not provided, the extension name is used as the heading.
96
+ * The text to use as the Action modal's title. If not provided, the name of the extension will be used.
139
97
  */
140
98
  heading: string;
141
-
142
99
  /**
143
- * Whether the action extension is currently in a loading state, such as during initial data fetching or when opening the action. When `true`, the action area might display loading indicators and prevent user interaction until loading completes.
144
- *
145
- * @default false
100
+ * Whether the action is in a loading state, such as during initial page load or when the action is being opened. When `true`, the action might be in an inert state that prevents user interaction.
146
101
  */
147
102
  loading: boolean;
148
-
149
103
  constructor();
150
104
  }
151
105
  declare global {
@@ -1,140 +1,55 @@
1
- /** VERSION: 1.25.0 **/
1
+ /** VERSION: 2.23.0 **/
2
2
  /* eslint-disable import/extensions */
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace */
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
7
7
  /// <reference lib="DOM" />
8
- import type {AdminBlockProps$1, ComponentChildren} from './shared.d.ts';
8
+ import type {
9
+ AdminBlockProps$1,
10
+ PreactCustomElement,
11
+ RenderImpl,
12
+ } from './shared.d.ts';
9
13
 
10
14
  /**
11
- * The properties for the admin block component. These properties configure the heading and collapsed summary of collapsible content blocks in the admin interface.
15
+ * Configure the following properties on the admin block component.
12
16
  * @publicDocs
13
17
  */
14
18
  export interface AdminBlockProps
15
- extends Pick<AdminBlockProps$1, 'heading' | 'collapsedSummary'> {}
16
-
17
- declare const tagName = 's-admin-block';
18
-
19
- /**
20
- * The JSX props for the admin block component. These properties extend `AdminBlockProps` with an optional `id` for element identification in JSX rendering.
21
- * @publicDocs
22
- */
23
- export interface AdminBlockJSXProps
24
- extends Partial<AdminBlockProps>,
25
- Pick<AdminBlockProps$1, 'id'> {}
26
-
27
- /**
28
- * The CSS styles as a string, used for styling web components within their shadow DOM.
29
- * @publicDocs
30
- */
31
- export type Styles = string;
32
- /**
33
- * The implementation configuration for rendering a Preact component into a shadow root. Defines the render function that returns JSX elements and optional CSS styles to apply to the component's shadow DOM.
34
- * @publicDocs
35
- */
36
- export type RenderImpl = Omit<ShadowRootInit, 'mode'> & {
37
- /**
38
- * The render function that returns Preact/JSX elements to display in the component's shadow root.
39
- */
40
- ShadowRoot: (element: any) => ComponentChildren;
41
- /**
42
- * The optional CSS styles to inject into the component's shadow DOM.
43
- */
44
- styles?: Styles;
45
- };
46
- /**
47
- * The properties of an activation event (such as a click or keyboard press) that describe which modifier keys and mouse buttons were involved. This is used to determine intended behavior like opening links in new tabs when Command/Control is pressed.
48
- * @publicDocs
49
- */
50
- export interface ActivationEventEsque {
51
- /**
52
- * Whether the Shift key was pressed during the activation event.
53
- */
54
- shiftKey: boolean;
19
+ extends Pick<AdminBlockProps$1, 'heading' | 'collapsedSummary'> {
55
20
  /**
56
- * Whether the Meta key (Command on Mac, Windows key on Windows) was pressed during the activation event.
21
+ * The text displayed as the block's title in the header. If not provided, the extension name will be used.
57
22
  */
58
- metaKey: boolean;
23
+ heading: AdminBlockProps$1['heading'];
59
24
  /**
60
- * Whether the Control key was pressed during the activation event.
25
+ * The summary text displayed when the app block is collapsed. Summaries longer than 30 characters will be truncated.
61
26
  */
62
- ctrlKey: boolean;
63
- /**
64
- * The mouse button that was pressed during the activation event. `0` for primary button (left click), `1` for auxiliary button (middle click), `2` for secondary button (right click).
65
- */
66
- button: number;
27
+ collapsedSummary: AdminBlockProps$1['collapsedSummary'];
67
28
  }
68
- /**
69
- * The options for controlling how a synthetic click behaves. Allows passing modifier key states and button information from an original event to influence link behavior such as opening in new tabs or background tabs.
70
- * @publicDocs
71
- */
72
- export interface ClickOptions {
73
- /**
74
- * The activation event (such as a click or keyboard event) whose modifier key state and button information should influence the synthetic click behavior. For example, passing an event with `metaKey: true` will cause links to open in a new tab.
75
- */
76
- sourceEvent?: ActivationEventEsque;
77
- }
78
- /**
79
- * Base class for creating custom elements with Preact.
80
- * While this class could be used in both Node and the browser, the constructor will only be used in the browser.
81
- * So we give it a type of HTMLElement to avoid typing issues later where it's used, which will only happen in the browser.
82
- */
83
- declare const BaseClass: typeof globalThis.HTMLElement;
84
- declare abstract class PreactCustomElement extends BaseClass {
85
- /** @private */
86
- static get observedAttributes(): string[];
87
- constructor({
88
- styles,
89
- ShadowRoot: renderFunction,
90
- delegatesFocus,
91
- ...options
92
- }: RenderImpl);
93
29
 
94
- /** @private */
95
- setAttribute(name: string, value: string): void;
96
- /** @private */
97
- attributeChangedCallback(name: string): void;
30
+ declare const tagName = 's-admin-block';
31
+ export interface AdminBlockJSXProps
32
+ extends Partial<AdminBlockProps>,
33
+ Pick<AdminBlockProps$1, 'id'> {}
34
+
35
+ declare class PolarisCustomElement extends PreactCustomElement {
36
+ constructor(renderImpl: Omit<RenderImpl, 'globalShadowCSS'>);
98
37
  /** @private */
99
38
  connectedCallback(): void;
100
39
  /** @private */
101
- disconnectedCallback(): void;
102
- /** @private */
103
40
  adoptedCallback(): void;
104
- /**
105
- * Queue a run of the render function.
106
- * You shouldn't need to call this manually - it should be handled by changes to @property values.
107
- * @private
108
- */
109
- queueRender(): void;
110
- /**
111
- * Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`.
112
- *
113
- * For example, if the `sourceEvent` was a middle click, or has particular keys held down,
114
- * components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
115
- * @private
116
- * @param options
117
- */
118
- click({sourceEvent}?: ClickOptions): void;
119
41
  }
120
42
 
121
43
  /**
122
- * The admin block custom element class that renders a collapsible content block in the Shopify admin interface. This component organizes content into expandable sections with headings and provides a summary when collapsed.
44
+ * Configure the following properties on the admin block component.
45
+ * @publicDocs
123
46
  */
124
47
  declare class AdminBlock
125
- extends PreactCustomElement
48
+ extends PolarisCustomElement
126
49
  implements AdminBlockProps
127
50
  {
128
- /**
129
- * The heading text to display at the top of the block. This title describes the content section the merchant is viewing. If not provided, no heading is displayed.
130
- */
131
51
  heading: string;
132
-
133
- /**
134
- * The summary text to display when the block is collapsed. This provides merchants with a preview of the block's contents without expanding it. If not provided, no summary is displayed.
135
- */
136
52
  collapsedSummary: string;
137
-
138
53
  constructor();
139
54
  }
140
55
  declare global {
@@ -1,135 +1,54 @@
1
- /** VERSION: 1.25.0 **/
1
+ /** VERSION: 2.23.0 **/
2
2
  /* eslint-disable import/extensions */
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace */
5
5
 
6
6
  // eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
7
7
  /// <reference lib="DOM" />
8
- import type {AdminPrintActionProps$1, ComponentChildren} from './shared.d.ts';
8
+ import type {
9
+ AdminPrintActionProps$1,
10
+ PreactCustomElement,
11
+ RenderImpl,
12
+ } from './shared.d.ts';
9
13
 
10
14
  /**
11
- * The properties for the admin print action component. These properties configure the source URL for printing content within admin extensions.
15
+ * Configure the following properties on the admin print action component.
12
16
  * @publicDocs
13
17
  */
14
18
  export interface AdminPrintActionProps
15
- extends Pick<AdminPrintActionProps$1, 'src'> {}
19
+ extends Pick<AdminPrintActionProps$1, 'src'> {
20
+ /**
21
+ * The URL of the document to preview and print. Supports HTML, PDF, and image formats.
22
+ * If not provided, the preview will show an empty state and the print button will be disabled.
23
+ */
24
+ src: AdminPrintActionProps$1['src'];
25
+ }
16
26
 
17
27
  declare const tagName = 's-admin-print-action';
18
-
19
- /**
20
- * The JSX props for the admin print action component. These properties extend `AdminPrintActionProps` with an optional `id` for element identification in JSX rendering.
21
- * @publicDocs
22
- */
23
28
  export interface AdminPrintActionJSXProps
24
29
  extends Partial<AdminPrintActionProps>,
25
30
  Pick<AdminPrintActionProps$1, 'id'> {}
26
31
 
27
- /**
28
- * The CSS styles as a string, used for styling web components within their shadow DOM.
29
- * @publicDocs
30
- */
31
- export type Styles = string;
32
- /**
33
- * The implementation configuration for rendering a Preact component into a shadow root. Defines the render function that returns JSX elements and optional CSS styles to apply to the component's shadow DOM.
34
- * @publicDocs
35
- */
36
- export type RenderImpl = Omit<ShadowRootInit, 'mode'> & {
37
- /**
38
- * The render function that returns Preact/JSX elements to display in the component's shadow root.
39
- */
40
- ShadowRoot: (element: any) => ComponentChildren;
41
- /**
42
- * The optional CSS styles to inject into the component's shadow DOM.
43
- */
44
- styles?: Styles;
45
- };
46
- /**
47
- * The properties of an activation event (such as a click or keyboard press) that describe which modifier keys and mouse buttons were involved. This is used to determine intended behavior like opening links in new tabs when Command/Control is pressed.
48
- * @publicDocs
49
- */
50
- export interface ActivationEventEsque {
51
- /**
52
- * Whether the Shift key was pressed during the activation event.
53
- */
54
- shiftKey: boolean;
55
- /**
56
- * Whether the Meta key (Command on Mac, Windows key on Windows) was pressed during the activation event.
57
- */
58
- metaKey: boolean;
59
- /**
60
- * Whether the Control key was pressed during the activation event.
61
- */
62
- ctrlKey: boolean;
63
- /**
64
- * The mouse button that was pressed during the activation event. `0` for primary button (left click), `1` for auxiliary button (middle click), `2` for secondary button (right click).
65
- */
66
- button: number;
67
- }
68
- /**
69
- * The options for controlling how a synthetic click behaves. Allows passing modifier key states and button information from an original event to influence link behavior such as opening in new tabs or background tabs.
70
- * @publicDocs
71
- */
72
- export interface ClickOptions {
73
- /**
74
- * The activation event (such as a click or keyboard event) whose modifier key state and button information should influence the synthetic click behavior. For example, passing an event with `metaKey: true` will cause links to open in a new tab.
75
- */
76
- sourceEvent?: ActivationEventEsque;
77
- }
78
- /**
79
- * Base class for creating custom elements with Preact.
80
- * While this class could be used in both Node and the browser, the constructor will only be used in the browser.
81
- * So we give it a type of HTMLElement to avoid typing issues later where it's used, which will only happen in the browser.
82
- */
83
- declare const BaseClass: typeof globalThis.HTMLElement;
84
- declare abstract class PreactCustomElement extends BaseClass {
85
- /** @private */
86
- static get observedAttributes(): string[];
87
- constructor({
88
- styles,
89
- ShadowRoot: renderFunction,
90
- delegatesFocus,
91
- ...options
92
- }: RenderImpl);
93
-
94
- /** @private */
95
- setAttribute(name: string, value: string): void;
96
- /** @private */
97
- attributeChangedCallback(name: string): void;
32
+ declare class PolarisCustomElement extends PreactCustomElement {
33
+ constructor(renderImpl: Omit<RenderImpl, 'globalShadowCSS'>);
98
34
  /** @private */
99
35
  connectedCallback(): void;
100
36
  /** @private */
101
- disconnectedCallback(): void;
102
- /** @private */
103
37
  adoptedCallback(): void;
104
- /**
105
- * Queue a run of the render function.
106
- * You shouldn't need to call this manually - it should be handled by changes to @property values.
107
- * @private
108
- */
109
- queueRender(): void;
110
- /**
111
- * Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`.
112
- *
113
- * For example, if the `sourceEvent` was a middle click, or has particular keys held down,
114
- * components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
115
- * @private
116
- * @param options
117
- */
118
- click({sourceEvent}?: ClickOptions): void;
119
38
  }
120
39
 
121
40
  /**
122
- * The admin print action custom element class that renders a print interface in the Shopify admin. This component enables merchants to print content from a specified source URL using the browser's print functionality.
41
+ * Configure the following properties on the admin print action component.
42
+ * @publicDocs
123
43
  */
124
44
  declare class AdminPrintAction
125
- extends PreactCustomElement
45
+ extends PolarisCustomElement
126
46
  implements AdminPrintActionProps
127
47
  {
128
48
  /**
129
- * The source URL of the content to print. This should point to the document or page that'll be sent to the printer when the merchant initiates the print action.
49
+ * The `src` URL of the preview and the document to print. If not provided, the preview will show an empty state and the print button will be disabled. HTML, PDFs, and images are supported.
130
50
  */
131
51
  src: string;
132
-
133
52
  constructor();
134
53
  }
135
54
  declare global {
@@ -1,4 +1,4 @@
1
- /** VERSION: 1.67.0 **/
1
+ /** VERSION: 2.23.0 **/
2
2
  /* eslint-disable import/extensions */
3
3
 
4
4
  /* eslint-disable @typescript-eslint/no-namespace */
@@ -10,9 +10,42 @@ import type {
10
10
  PreactCustomElement,
11
11
  RenderImpl,
12
12
  } from './shared.d.ts';
13
+ import * as preact$1 from 'preact';
14
+ import {ReactNode, RefAttributes} from 'react';
13
15
 
14
16
  export interface AppNavProps {}
15
17
 
18
+ export type ReactIntrinsicElementChildren<PreactProps extends object> =
19
+ 'children' extends keyof PreactProps
20
+ ? {
21
+ children?: ReactNode;
22
+ }
23
+ : Record<never, never>;
24
+ export type ReactIntrinsicElementProps<
25
+ PreactProps extends object,
26
+ ElementType,
27
+ > = Omit<PreactProps, 'children' | 'key' | 'ref' | 'slot'> &
28
+ ReactIntrinsicElementChildren<PreactProps> &
29
+ RefAttributes<ElementType> & {
30
+ slot?: Lowercase<string>;
31
+ };
32
+ export type ReactIntrinsicElements = {
33
+ [Tag in Exclude<
34
+ Extract<keyof preact$1.createElement.JSX.IntrinsicElements, `s-${string}`>,
35
+ `s-test-${string}`
36
+ >]: ReactIntrinsicElementProps<
37
+ preact$1.createElement.JSX.IntrinsicElements[Tag],
38
+ Tag extends keyof HTMLElementTagNameMap
39
+ ? HTMLElementTagNameMap[Tag]
40
+ : HTMLElement
41
+ >;
42
+ };
43
+ declare module 'react' {
44
+ namespace JSX {
45
+ interface IntrinsicElements extends ReactIntrinsicElements {}
46
+ }
47
+ }
48
+
16
49
  declare const tagName = 's-app-nav';
17
50
  export interface AppNavJSXProps
18
51
  extends Partial<AppNavProps>,
@@ -20,6 +53,10 @@ export interface AppNavJSXProps
20
53
 
21
54
  declare class PolarisCustomElement extends PreactCustomElement {
22
55
  constructor(renderImpl: Omit<RenderImpl, 'globalShadowCSS'>);
56
+ /** @private */
57
+ connectedCallback(): void;
58
+ /** @private */
59
+ adoptedCallback(): void;
23
60
  }
24
61
 
25
62
  declare class AppNav extends PolarisCustomElement implements AppNavProps {