@shopify/ui-extensions 2026.7.0 → 2026.7.1

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.
@@ -27,18 +27,28 @@ export interface BaseElementProps<TClass = HTMLElement> {
27
27
  */
28
28
  slot?: Lowercase<string>;
29
29
  }
30
+ /**
31
+ * The base properties for elements that have children, extending `BaseElementProps` with children support.
32
+ * @publicDocs
33
+ */
34
+ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends BaseElementProps<TClass> {
35
+ /**
36
+ * The child elements to render within this component.
37
+ */
38
+ children?: preact.ComponentChildren;
39
+ }
30
40
  /**
31
41
  * An event type that narrows the `currentTarget` to the specific HTML element associated with the custom element tag. This provides type-safe event handling in callback listeners.
42
+ * @publicDocs
32
43
  */
33
44
  export type CallbackEvent<TTagName extends keyof HTMLElementTagNameMap, TEvent extends Event = Event> = TEvent & {
34
45
  currentTarget: HTMLElementTagNameMap[TTagName];
35
46
  };
36
47
  /**
37
48
  * A typed event listener for custom element events. The listener receives a `CallbackEvent` with the correct `currentTarget` type for the associated custom element tag.
49
+ * @publicDocs
38
50
  */
39
- export type CallbackEventListener<TTagName extends keyof HTMLElementTagNameMap, TData = object> = (EventListener & {
40
- (event: CallbackEvent<TTagName, Event> & TData): void;
41
- }) | null;
51
+ export type CallbackEventListener<TTagName extends keyof HTMLElementTagNameMap, TData = object> = (EventListener & ((event: CallbackEvent<TTagName, Event> & TData) => void)) | null;
42
52
 
43
53
  declare const tagName = "s-checkbox";
44
54
  /** @publicDocs */
@@ -51,6 +61,7 @@ export interface CheckboxElementProps extends Pick<CheckboxProps$1, 'accessibili
51
61
  */
52
62
  label?: string;
53
63
  }
64
+ /** @publicDocs */
54
65
  export interface CheckboxEvents extends Pick<CheckboxProps$1, 'onChange'> {
55
66
  }
56
67
  /** @publicDocs */
@@ -62,6 +73,7 @@ export interface CheckboxElementEvents {
62
73
  */
63
74
  change?: CallbackEventListener<typeof tagName>;
64
75
  }
76
+ /** @publicDocs */
65
77
  export interface CheckboxElement extends CheckboxElementProps, Omit<HTMLElement, 'id' | 'onchange'> {
66
78
  onchange: CheckboxEvents['onChange'];
67
79
  }
@@ -85,7 +97,7 @@ declare global {
85
97
  declare module 'preact' {
86
98
  namespace createElement.JSX {
87
99
  interface IntrinsicElements {
88
- [tagName]: CheckboxProps & BaseElementProps<CheckboxElement>;
100
+ [tagName]: CheckboxProps & BaseElementPropsWithChildren<CheckboxElement>;
89
101
  }
90
102
  }
91
103
  }
@@ -27,18 +27,28 @@ export interface BaseElementProps<TClass = HTMLElement> {
27
27
  */
28
28
  slot?: Lowercase<string>;
29
29
  }
30
+ /**
31
+ * The base properties for elements that have children, extending `BaseElementProps` with children support.
32
+ * @publicDocs
33
+ */
34
+ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends BaseElementProps<TClass> {
35
+ /**
36
+ * The child elements to render within this component.
37
+ */
38
+ children?: preact.ComponentChildren;
39
+ }
30
40
  /**
31
41
  * An event type that narrows the `currentTarget` to the specific HTML element associated with the custom element tag. This provides type-safe event handling in callback listeners.
42
+ * @publicDocs
32
43
  */
33
44
  export type CallbackEvent<TTagName extends keyof HTMLElementTagNameMap, TEvent extends Event = Event> = TEvent & {
34
45
  currentTarget: HTMLElementTagNameMap[TTagName];
35
46
  };
36
47
  /**
37
48
  * A typed event listener for custom element events. The listener receives a `CallbackEvent` with the correct `currentTarget` type for the associated custom element tag.
49
+ * @publicDocs
38
50
  */
39
- export type CallbackEventListener<TTagName extends keyof HTMLElementTagNameMap, TData = object> = (EventListener & {
40
- (event: CallbackEvent<TTagName, Event> & TData): void;
41
- }) | null;
51
+ export type CallbackEventListener<TTagName extends keyof HTMLElementTagNameMap, TData = object> = (EventListener & ((event: CallbackEvent<TTagName, Event> & TData) => void)) | null;
42
52
 
43
53
  declare const tagName = "s-checkbox";
44
54
  /** @publicDocs */
@@ -51,6 +61,7 @@ export interface CheckboxElementProps extends Pick<CheckboxProps$1, 'accessibili
51
61
  */
52
62
  label?: string;
53
63
  }
64
+ /** @publicDocs */
54
65
  export interface CheckboxEvents extends Pick<CheckboxProps$1, 'onChange'> {
55
66
  }
56
67
  /** @publicDocs */
@@ -62,6 +73,7 @@ export interface CheckboxElementEvents {
62
73
  */
63
74
  change?: CallbackEventListener<typeof tagName>;
64
75
  }
76
+ /** @publicDocs */
65
77
  export interface CheckboxElement extends CheckboxElementProps, Omit<HTMLElement, 'id' | 'onchange'> {
66
78
  onchange: CheckboxEvents['onChange'];
67
79
  }
@@ -85,7 +97,7 @@ declare global {
85
97
  declare module 'preact' {
86
98
  namespace createElement.JSX {
87
99
  interface IntrinsicElements {
88
- [tagName]: CheckboxProps & BaseElementProps<CheckboxElement>;
100
+ [tagName]: CheckboxProps & BaseElementPropsWithChildren<CheckboxElement>;
89
101
  }
90
102
  }
91
103
  }