Skip to content

Commit 5abf678

Browse files
authored
Merge pull request #3522 from Shopify/bump-admin-ui-extensions-and-fix-text-field-children-type
Update admin ui extensions, fix TextField children, and add DropZone
2 parents bd0239c + 6b16f5e commit 5abf678

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+595
-113
lines changed

.changeset/nasty-views-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Fix missing children property for TextField

.changeset/whole-pumas-brake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Add DropZone component to admin ui-extensions

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

Lines changed: 48 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22

33
/* eslint-disable @typescript-eslint/ban-types */
44
/* eslint-disable @typescript-eslint/no-namespace */
@@ -166,11 +166,11 @@ export interface ExtendableEvent extends Event {
166166
*/
167167
waitUntil?: (promise: Promise<void>) => void;
168168
}
169-
interface AggregateError$1<T extends Error> extends Error {
169+
export interface AggregateError<T extends Error> extends Error {
170170
errors: T[];
171171
}
172172
export interface AggregateErrorEvent<T extends Error> extends ErrorEvent {
173-
error: AggregateError$1<T>;
173+
error: AggregateError<T>;
174174
}
175175
export type SizeKeyword =
176176
| 'small-500'
@@ -278,6 +278,7 @@ declare const privateIconArray: readonly [
278278
'arrow-up-right',
279279
'arrows-in-horizontal',
280280
'arrows-out-horizontal',
281+
'asterisk',
281282
'attachment',
282283
'automation',
283284
'backspace',
@@ -2026,7 +2027,10 @@ interface ClickableProps$1
20262027
*/
20272028
lang?: string;
20282029
}
2029-
interface ClickableChipProps$1 extends ChipProps$1, GlobalProps {
2030+
interface ClickableChipProps$1
2031+
extends ChipProps$1,
2032+
GlobalProps,
2033+
InteractionProps {
20302034
/**
20312035
* Callback when the chip is clicked.
20322036
*/
@@ -2035,6 +2039,7 @@ interface ClickableChipProps$1 extends ChipProps$1, GlobalProps {
20352039
* The URL to link to.
20362040
*
20372041
* - If set, it will navigate to the location specified by `href` after executing the `click` event.
2042+
* - If a `commandFor` is set, the `command` will be executed instead of the navigation.
20382043
*/
20392044
href?: string;
20402045
/**
@@ -3105,6 +3110,21 @@ interface NumberFieldProps$1
31053110
* @default 'decimal'
31063111
*/
31073112
inputMode?: 'decimal' | 'numeric';
3113+
/**
3114+
* Callback when the user has **finished editing** a field, e.g. once they have blurred
3115+
* the field after changing the value.
3116+
* Also fired after `onInput` on every step when interacting with the controls or the keyboard up and down arrows.
3117+
*
3118+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
3119+
*/
3120+
onChange?: (event: Event) => void;
3121+
/**
3122+
* Callback when the user makes any changes in the field.
3123+
* Also fired before `onChange` on every step when interacting with the controls or the keyboard up and down arrows.
3124+
*
3125+
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event
3126+
*/
3127+
onInput?: (event: Event) => void;
31083128
}
31093129
export type NumberAutocompleteField = ExtractStrict<
31103130
AnyAutocompleteField,
@@ -3810,6 +3830,7 @@ type IconType$1 =
38103830
| 'arrow-up-right'
38113831
| 'arrows-in-horizontal'
38123832
| 'arrows-out-horizontal'
3833+
| 'asterisk'
38133834
| 'attachment'
38143835
| 'automation'
38153836
| 'backspace'
@@ -3890,6 +3911,7 @@ type IconType$1 =
38903911
| 'clipboard-check'
38913912
| 'clipboard-checklist'
38923913
| 'clock'
3914+
| 'clock-list'
38933915
| 'clock-revert'
38943916
| 'code'
38953917
| 'code-add'
@@ -4086,6 +4108,7 @@ type IconType$1 =
40864108
| 'note'
40874109
| 'note-add'
40884110
| 'notification'
4111+
| 'number-one'
40894112
| 'order'
40904113
| 'order-batches'
40914114
| 'order-draft'
@@ -4166,6 +4189,7 @@ type IconType$1 =
41664189
| 'profile-filled'
41674190
| 'question-circle'
41684191
| 'question-circle-filled'
4192+
| 'radio-control'
41694193
| 'receipt'
41704194
| 'receipt-dollar'
41714195
| 'receipt-euro'
@@ -4276,6 +4300,9 @@ type IconType$1 =
42764300
| 'unlock'
42774301
| 'upload'
42784302
| 'variant'
4303+
| 'variant-list'
4304+
| 'video'
4305+
| 'video-list'
42794306
| 'view'
42804307
| 'viewport-narrow'
42814308
| 'viewport-short'
@@ -5333,11 +5360,18 @@ export interface ClickableChipProps
53335360
| 'hidden'
53345361
| 'href'
53355362
| 'disabled'
5363+
| 'command'
5364+
| 'commandFor'
5365+
| 'interestFor'
53365366
>
53375367
> {}
53385368

5369+
declare const ClickableChip_base: (abstract new (
5370+
args_0: RenderImpl,
5371+
) => PreactCustomElement & PreactOverlayControlProps) &
5372+
Pick<typeof PreactCustomElement, 'prototype' | 'observedAttributes'>;
53395373
declare class ClickableChip
5340-
extends PreactCustomElement
5374+
extends ClickableChip_base
53415375
implements ClickableChipProps
53425376
{
53435377
accessor color: ClickableChipProps['color'];
@@ -5761,7 +5795,8 @@ declare global {
57615795
declare module 'preact' {
57625796
namespace createElement.JSX {
57635797
interface IntrinsicElements {
5764-
[tagName$I]: DropZoneJSXProps & PreactBaseElementProps<DropZone>;
5798+
[tagName$I]: DropZoneJSXProps &
5799+
PreactBaseElementPropsWithChildren<DropZone>;
57655800
}
57665801
}
57675802
}
@@ -7604,7 +7639,7 @@ declare module 'preact' {
76047639
namespace createElement.JSX {
76057640
interface IntrinsicElements {
76067641
[tagName$9]: Omit<TextFieldJSXProps, 'accessory'> &
7607-
PreactBaseElementProps<TextField>;
7642+
PreactBaseElementPropsWithChildren<TextField>;
76087643
}
76097644
}
76107645
}
@@ -8917,14 +8952,16 @@ declare global {
89178952
declare module 'react' {
89188953
namespace JSX {
89198954
interface IntrinsicElements {
8920-
[tagName$I]: DropZoneJSXProps & ReactBaseElementProps<DropZone>;
8955+
[tagName$I]: DropZoneJSXProps &
8956+
ReactBaseElementPropsWithChildren<DropZone>;
89218957
}
89228958
}
89238959
}
89248960
declare global {
89258961
namespace JSX {
89268962
interface IntrinsicElements {
8927-
[tagName$I]: DropZoneJSXProps & ReactBaseElementProps<DropZone>;
8963+
[tagName$I]: DropZoneJSXProps &
8964+
ReactBaseElementPropsWithChildren<DropZone>;
89288965
}
89298966
}
89308967
}
@@ -9442,15 +9479,15 @@ declare module 'react' {
94429479
namespace JSX {
94439480
interface IntrinsicElements {
94449481
[tagName$9]: Omit<TextFieldJSXProps, 'accessory'> &
9445-
ReactBaseElementProps<TextField>;
9482+
ReactBaseElementPropsWithChildren<TextField>;
94469483
}
94479484
}
94489485
}
94499486
declare global {
94509487
namespace JSX {
94519488
interface IntrinsicElements {
94529489
[tagName$9]: Omit<TextFieldJSXProps, 'accessory'> &
9453-
ReactBaseElementProps<TextField>;
9490+
ReactBaseElementPropsWithChildren<TextField>;
94549491
}
94559492
}
94569493
}

packages/ui-extensions/src/surfaces/admin/components/AdminAction.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */

packages/ui-extensions/src/surfaces/admin/components/AdminBlock.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */

packages/ui-extensions/src/surfaces/admin/components/AdminPrintAction.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */

packages/ui-extensions/src/surfaces/admin/components/Avatar.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */

packages/ui-extensions/src/surfaces/admin/components/Badge.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */
@@ -139,7 +139,12 @@ declare module 'preact' {
139139
declare const tagName = 's-badge';
140140
export interface BadgeJSXProps
141141
extends Partial<BadgeProps>,
142-
Pick<BadgeProps$1, 'id'> {}
142+
Pick<BadgeProps$1, 'id' | 'children'> {
143+
/**
144+
* The content of the Badge.
145+
*/
146+
children?: ComponentChildren;
147+
}
143148

144149
export {Badge};
145150
export type {BadgeJSXProps};

packages/ui-extensions/src/surfaces/admin/components/Banner.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */
@@ -129,7 +129,11 @@ declare module 'preact' {
129129
declare const tagName = 's-banner';
130130
export interface BannerJSXProps
131131
extends Partial<BannerProps>,
132-
Pick<BannerProps$1, 'id'> {
132+
Pick<BannerProps$1, 'id' | 'children'> {
133+
/**
134+
* The content of the Banner.
135+
*/
136+
children?: ComponentChildren;
133137
/**
134138
* The secondary actions to display at the bottom of the Banner.
135139
*

packages/ui-extensions/src/surfaces/admin/components/Box.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/** VERSION: 1.22.1 **/
1+
/** VERSION: 1.25.0 **/
22
/* eslint-disable import/extensions */
33

44
/* eslint-disable @typescript-eslint/no-namespace */
@@ -382,7 +382,12 @@ declare module 'preact' {
382382
declare const tagName = 's-box';
383383
export interface BoxJSXProps
384384
extends Partial<BoxProps>,
385-
Pick<BoxProps$1, 'id'> {}
385+
Pick<BoxProps$1, 'id' | 'children'> {
386+
/**
387+
* The content of the Box.
388+
*/
389+
children?: ComponentChildren;
390+
}
386391

387392
export {Box};
388393
export type {BoxJSXProps};

0 commit comments

Comments
 (0)