@shopify/ui-extensions 2025.10.0-rc.7 → 2025.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.
- package/build/ts/surfaces/admin/components/AdminAction.d.ts +1 -1
- package/build/ts/surfaces/admin/components/AdminBlock.d.ts +1 -1
- package/build/ts/surfaces/admin/components/AdminPrintAction.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Avatar.d.ts +139 -0
- package/build/ts/surfaces/admin/components/Badge.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Banner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Box.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Button.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Checkbox.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Choice.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ChoiceList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Clickable.d.ts +1 -1
- package/build/ts/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Divider.d.ts +1 -1
- package/build/ts/surfaces/admin/components/EmailField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Form.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Grid.d.ts +1 -1
- package/build/ts/surfaces/admin/components/GridItem.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Heading.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Icon.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Image.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Link.d.ts +1 -1
- package/build/ts/surfaces/admin/components/ListItem.d.ts +1 -1
- package/build/ts/surfaces/admin/components/MoneyField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/NumberField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Option.d.ts +1 -1
- package/build/ts/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/build/ts/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Page.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/build/ts/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/build/ts/surfaces/admin/components/SearchField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Section.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Select.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Spinner.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Stack.d.ts +1 -1
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts +1 -1
- package/build/ts/surfaces/admin/components/StandardComponents.d.ts.map +1 -1
- package/build/ts/surfaces/admin/components/Switch.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Table.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableBody.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableCell.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableHeader.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TableRow.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Text.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextArea.d.ts +1 -1
- package/build/ts/surfaces/admin/components/TextField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/Thumbnail.d.ts +133 -0
- package/build/ts/surfaces/admin/components/URLField.d.ts +1 -1
- package/build/ts/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/build/ts/surfaces/admin/components/shared.d.ts +219 -160
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.abandoned-checkout-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.catalog-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.catalog-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.collection-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.collection-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.collection-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.company-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.company-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.company-location-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customer-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customer-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customer-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customer-index.selection-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customer-segment-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.customers.segmentation-templates.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.discount-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.discount-details.function-settings.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.discount-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.draft-order-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.draft-order-index.selection-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.gift-card-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-details.print-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-fulfilled-card.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.order-index.selection-print-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-details.configuration.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-details.print-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-details.reorder.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-index.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-index.selection-print-action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-purchase-option.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.block.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-variant-details.configuration.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.product-variant-purchase-option.action.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.settings.internal-order-routing-rule.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.settings.order-routing-rule.render.d.ts +121 -11
- package/build/ts/surfaces/admin/targets/admin.settings.validation.render.d.ts +121 -11
- package/build/ts/surfaces/customer-account/components/Avatar/Avatar.doc.d.ts +4 -0
- package/build/ts/surfaces/customer-account/components/Avatar/Avatar.doc.d.ts.map +1 -0
- package/build/ts/surfaces/customer-account/components/Avatar.d.ts +66 -0
- package/build/ts/surfaces/customer-account/components/StandardComponents.d.ts +1 -1
- package/build/ts/surfaces/customer-account/components/StandardComponents.d.ts.map +1 -1
- package/build/ts/surfaces/customer-account/targets/customer-account.footer.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-index.block.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.block.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-item.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.cart-line-list.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.customer-information.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.fulfillment-details.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.payment-details.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.return-details.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order-status.unfulfilled-items.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.menu-item.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.action.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.order.page.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.page.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.addresses.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.block.render.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-details.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-addresses.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-payment.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.company-location-staff.render-after.d.ts +61 -0
- package/build/ts/surfaces/customer-account/targets/customer-account.profile.payment.render-after.d.ts +61 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/surfaces/admin/components/AdminAction.d.ts +1 -1
- package/src/surfaces/admin/components/AdminBlock.d.ts +1 -1
- package/src/surfaces/admin/components/AdminPrintAction.d.ts +1 -1
- package/src/surfaces/admin/components/Avatar.d.ts +139 -0
- package/src/surfaces/admin/components/Badge.d.ts +1 -1
- package/src/surfaces/admin/components/Banner.d.ts +1 -1
- package/src/surfaces/admin/components/Box.d.ts +1 -1
- package/src/surfaces/admin/components/Button.d.ts +1 -1
- package/src/surfaces/admin/components/Checkbox.d.ts +1 -1
- package/src/surfaces/admin/components/Choice.d.ts +1 -1
- package/src/surfaces/admin/components/ChoiceList.d.ts +1 -1
- package/src/surfaces/admin/components/Clickable.d.ts +1 -1
- package/src/surfaces/admin/components/DatePicker.d.ts +1 -1
- package/src/surfaces/admin/components/Divider.d.ts +1 -1
- package/src/surfaces/admin/components/EmailField.d.ts +1 -1
- package/src/surfaces/admin/components/Form.d.ts +1 -1
- package/src/surfaces/admin/components/Grid.d.ts +1 -1
- package/src/surfaces/admin/components/GridItem.d.ts +1 -1
- package/src/surfaces/admin/components/Heading.d.ts +1 -1
- package/src/surfaces/admin/components/Icon.d.ts +1 -1
- package/src/surfaces/admin/components/Image.d.ts +1 -1
- package/src/surfaces/admin/components/Link.d.ts +1 -1
- package/src/surfaces/admin/components/ListItem.d.ts +1 -1
- package/src/surfaces/admin/components/MoneyField.d.ts +1 -1
- package/src/surfaces/admin/components/NumberField.d.ts +1 -1
- package/src/surfaces/admin/components/Option.d.ts +1 -1
- package/src/surfaces/admin/components/OptionGroup.d.ts +1 -1
- package/src/surfaces/admin/components/OrderedList.d.ts +1 -1
- package/src/surfaces/admin/components/Page.d.ts +1 -1
- package/src/surfaces/admin/components/Paragraph.d.ts +1 -1
- package/src/surfaces/admin/components/PasswordField.d.ts +1 -1
- package/src/surfaces/admin/components/QueryContainer.d.ts +1 -1
- package/src/surfaces/admin/components/SearchField.d.ts +1 -1
- package/src/surfaces/admin/components/Section.d.ts +1 -1
- package/src/surfaces/admin/components/Select.d.ts +1 -1
- package/src/surfaces/admin/components/Spinner.d.ts +1 -1
- package/src/surfaces/admin/components/Stack.d.ts +1 -1
- package/src/surfaces/admin/components/StandardComponents.ts +2 -0
- package/src/surfaces/admin/components/Switch.d.ts +1 -1
- package/src/surfaces/admin/components/Table.d.ts +1 -1
- package/src/surfaces/admin/components/TableBody.d.ts +1 -1
- package/src/surfaces/admin/components/TableCell.d.ts +1 -1
- package/src/surfaces/admin/components/TableHeader.d.ts +1 -1
- package/src/surfaces/admin/components/TableHeaderRow.d.ts +1 -1
- package/src/surfaces/admin/components/TableRow.d.ts +1 -1
- package/src/surfaces/admin/components/Text.d.ts +1 -1
- package/src/surfaces/admin/components/TextArea.d.ts +1 -1
- package/src/surfaces/admin/components/TextField.d.ts +1 -1
- package/src/surfaces/admin/components/Thumbnail.d.ts +133 -0
- package/src/surfaces/admin/components/URLField.d.ts +1 -1
- package/src/surfaces/admin/components/UnorderedList.d.ts +1 -1
- package/src/surfaces/admin/components/shared.d.ts +219 -160
- package/src/surfaces/admin/components.d.ts +975 -413
- package/src/surfaces/customer-account/components/Avatar/examples/basic-Avatar-js.example.ts +9 -0
- package/src/surfaces/customer-account/components/Avatar/examples/basic-Avatar-preact.example.tsx +9 -0
- package/src/surfaces/customer-account/components/Avatar.d.ts +66 -0
- package/src/surfaces/customer-account/components/StandardComponents.ts +1 -0
- package/src/surfaces/customer-account/components.d.ts +67 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/** VERSION: 1.2.0 **/
|
|
2
|
+
/* eslint-disable import/extensions */
|
|
3
|
+
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
5
|
+
/* eslint-disable @typescript-eslint/member-ordering */
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
8
|
+
/// <reference lib="DOM" />
|
|
9
|
+
import type {AvatarProps$1, ComponentChild} from './shared.d.ts';
|
|
10
|
+
|
|
11
|
+
export interface AvatarProps
|
|
12
|
+
extends Required<Pick<AvatarProps$1, 'initials' | 'src' | 'alt'>> {
|
|
13
|
+
size: Extract<
|
|
14
|
+
AvatarProps$1['size'],
|
|
15
|
+
'small-200' | 'small' | 'base' | 'large' | 'large-200'
|
|
16
|
+
>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type Styles = string;
|
|
20
|
+
export type RenderImpl = Omit<ShadowRootInit, 'mode'> & {
|
|
21
|
+
ShadowRoot: (element: any) => ComponentChild;
|
|
22
|
+
styles?: Styles;
|
|
23
|
+
};
|
|
24
|
+
export interface ActivationEventEsque {
|
|
25
|
+
shiftKey: boolean;
|
|
26
|
+
metaKey: boolean;
|
|
27
|
+
ctrlKey: boolean;
|
|
28
|
+
button: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ClickOptions {
|
|
31
|
+
/**
|
|
32
|
+
* The event you want to influence the synthetic click.
|
|
33
|
+
*/
|
|
34
|
+
sourceEvent?: ActivationEventEsque;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Base class for creating custom elements with Preact.
|
|
38
|
+
* While this class could be used in both Node and the browser, the constructor will only be used in the browser.
|
|
39
|
+
* So we give it a type of HTMLElement to avoid typing issues later where it's used, which will only happen in the browser.
|
|
40
|
+
*/
|
|
41
|
+
declare const BaseClass: typeof globalThis.HTMLElement;
|
|
42
|
+
declare abstract class PreactCustomElement extends BaseClass {
|
|
43
|
+
/** @private */
|
|
44
|
+
static get observedAttributes(): string[];
|
|
45
|
+
constructor({
|
|
46
|
+
styles,
|
|
47
|
+
ShadowRoot: renderFunction,
|
|
48
|
+
delegatesFocus,
|
|
49
|
+
...options
|
|
50
|
+
}: RenderImpl);
|
|
51
|
+
|
|
52
|
+
/** @private */
|
|
53
|
+
setAttribute(name: string, value: string): void;
|
|
54
|
+
/** @private */
|
|
55
|
+
attributeChangedCallback(name: string): void;
|
|
56
|
+
/** @private */
|
|
57
|
+
connectedCallback(): void;
|
|
58
|
+
/** @private */
|
|
59
|
+
disconnectedCallback(): void;
|
|
60
|
+
/** @private */
|
|
61
|
+
adoptedCallback(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Queue a run of the render function.
|
|
64
|
+
* You shouldn't need to call this manually - it should be handled by changes to @property values.
|
|
65
|
+
* @private
|
|
66
|
+
*/
|
|
67
|
+
queueRender(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`.
|
|
70
|
+
*
|
|
71
|
+
* For example, if the `sourceEvent` was a middle click, or has particular keys held down,
|
|
72
|
+
* components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
|
|
73
|
+
* @private
|
|
74
|
+
* @param options
|
|
75
|
+
*/
|
|
76
|
+
click({sourceEvent}?: ClickOptions): void;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type CallbackEvent<
|
|
80
|
+
TTagName extends keyof HTMLElementTagNameMap,
|
|
81
|
+
TEvent extends Event = Event,
|
|
82
|
+
> = TEvent & {
|
|
83
|
+
currentTarget: HTMLElementTagNameMap[TTagName];
|
|
84
|
+
};
|
|
85
|
+
export type CallbackEventListener<
|
|
86
|
+
TTagName extends keyof HTMLElementTagNameMap,
|
|
87
|
+
TEvent extends Event = Event,
|
|
88
|
+
> =
|
|
89
|
+
| (EventListener & {
|
|
90
|
+
(event: CallbackEvent<TTagName, TEvent>): void;
|
|
91
|
+
})
|
|
92
|
+
| null;
|
|
93
|
+
/** Used when an element does not have children. */
|
|
94
|
+
export interface PreactBaseElementProps<TClass extends HTMLElement> {
|
|
95
|
+
/** Assigns a unique key to this element. */
|
|
96
|
+
key?: preact.Key;
|
|
97
|
+
/** Assigns a ref (generally from `useRef()`) to this element. */
|
|
98
|
+
ref?: preact.Ref<TClass>;
|
|
99
|
+
/** Assigns this element to a parent's slot. */
|
|
100
|
+
slot?: Lowercase<string>;
|
|
101
|
+
}
|
|
102
|
+
/** Used when an element has children. */
|
|
103
|
+
export interface PreactBaseElementPropsWithChildren<TClass extends HTMLElement>
|
|
104
|
+
extends PreactBaseElementProps<TClass> {
|
|
105
|
+
children?: preact.ComponentChildren;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
declare class Avatar extends PreactCustomElement implements AvatarProps {
|
|
109
|
+
accessor initials: AvatarProps['initials'];
|
|
110
|
+
accessor src: AvatarProps['src'];
|
|
111
|
+
accessor size: AvatarProps['size'];
|
|
112
|
+
accessor alt: AvatarProps['alt'];
|
|
113
|
+
accessor onload: CallbackEventListener<typeof tagName> | null;
|
|
114
|
+
accessor onerror: OnErrorEventHandler;
|
|
115
|
+
constructor();
|
|
116
|
+
}
|
|
117
|
+
declare global {
|
|
118
|
+
interface HTMLElementTagNameMap {
|
|
119
|
+
[tagName]: Avatar;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
declare module 'preact' {
|
|
123
|
+
namespace createElement.JSX {
|
|
124
|
+
interface IntrinsicElements {
|
|
125
|
+
[tagName]: AvatarJSXProps & PreactBaseElementPropsWithChildren<Avatar>;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
declare const tagName = 's-avatar';
|
|
131
|
+
export interface AvatarJSXProps
|
|
132
|
+
extends Partial<AvatarProps>,
|
|
133
|
+
Pick<AvatarProps$1, 'id'> {
|
|
134
|
+
onLoad?: () => void;
|
|
135
|
+
onError?: () => void;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export {Avatar};
|
|
139
|
+
export type {AvatarJSXProps};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type StandardComponents = 'Badge' | 'Banner' | 'Box' | 'Button' | 'Checkbox' | 'Choice' | 'ChoiceList' | 'Clickable' | 'DatePicker' | 'Divider' | 'EmailField' | 'Grid' | 'GridItem' | 'Heading' | 'Icon' | 'Image' | 'Link' | 'ListItem' | 'MoneyField' | 'NumberField' | 'Option' | 'OptionGroup' | 'OrderedList' | 'Paragraph' | 'PasswordField' | 'QueryContainer' | 'Section' | 'Select' | 'Spinner' | 'Stack' | 'Table' | 'TableBody' | 'TableCell' | 'TableHeader' | 'TableHeaderRow' | 'TableRow' | 'Text' | 'TextArea' | 'TextField' | 'UnorderedList' | 'URLField';
|
|
1
|
+
export type StandardComponents = 'Avatar' | 'Badge' | 'Banner' | 'Box' | 'Button' | 'Checkbox' | 'Choice' | 'ChoiceList' | 'Clickable' | 'DatePicker' | 'Divider' | 'EmailField' | 'Grid' | 'GridItem' | 'Heading' | 'Icon' | 'Image' | 'Link' | 'ListItem' | 'MoneyField' | 'NumberField' | 'Option' | 'OptionGroup' | 'OrderedList' | 'Paragraph' | 'PasswordField' | 'QueryContainer' | 'Section' | 'Select' | 'Spinner' | 'Stack' | 'Table' | 'TableBody' | 'TableCell' | 'TableHeader' | 'TableHeaderRow' | 'TableRow' | 'Text' | 'TextArea' | 'TextField' | 'Thumbnail' | 'UnorderedList' | 'URLField';
|
|
2
2
|
export default StandardComponents;
|
|
3
3
|
//# sourceMappingURL=StandardComponents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardComponents.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/admin/components/StandardComponents.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,MAAM,GACN,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,UAAU,GACV,YAAY,GACZ,aAAa,GACb,QAAQ,GACR,aAAa,GACb,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,WAAW,GACX,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,UAAU,GACV,MAAM,GACN,UAAU,GACV,WAAW,GACX,eAAe,GACf,UAAU,CAAC;AAEf,eAAe,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"StandardComponents.d.ts","sourceRoot":"","sources":["../../../../../src/surfaces/admin/components/StandardComponents.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,KAAK,GACL,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,MAAM,GACN,UAAU,GACV,SAAS,GACT,MAAM,GACN,OAAO,GACP,MAAM,GACN,UAAU,GACV,YAAY,GACZ,aAAa,GACb,QAAQ,GACR,aAAa,GACb,aAAa,GACb,WAAW,GACX,eAAe,GACf,gBAAgB,GAChB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,WAAW,GACX,WAAW,GACX,aAAa,GACb,gBAAgB,GAChB,UAAU,GACV,MAAM,GACN,UAAU,GACV,WAAW,GACX,WAAW,GACX,eAAe,GACf,UAAU,CAAC;AAEf,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/** VERSION: 1.2.0 **/
|
|
2
|
+
/* eslint-disable import/extensions */
|
|
3
|
+
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
|
5
|
+
/* eslint-disable @typescript-eslint/member-ordering */
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
|
|
8
|
+
/// <reference lib="DOM" />
|
|
9
|
+
import type {ThumbnailProps$1, ComponentChild} from './shared.d.ts';
|
|
10
|
+
|
|
11
|
+
export interface ThumbnailProps
|
|
12
|
+
extends Required<Pick<ThumbnailProps$1, 'src' | 'alt'>> {
|
|
13
|
+
size: Extract<
|
|
14
|
+
ThumbnailProps$1['size'],
|
|
15
|
+
'small-200' | 'small-100' | 'small' | 'base' | 'large' | 'large-100'
|
|
16
|
+
>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type CallbackEvent<
|
|
20
|
+
TTagName extends keyof HTMLElementTagNameMap,
|
|
21
|
+
TEvent extends Event = Event,
|
|
22
|
+
> = TEvent & {
|
|
23
|
+
currentTarget: HTMLElementTagNameMap[TTagName];
|
|
24
|
+
};
|
|
25
|
+
export type CallbackEventListener<
|
|
26
|
+
TTagName extends keyof HTMLElementTagNameMap,
|
|
27
|
+
TEvent extends Event = Event,
|
|
28
|
+
> =
|
|
29
|
+
| (EventListener & {
|
|
30
|
+
(event: CallbackEvent<TTagName, TEvent>): void;
|
|
31
|
+
})
|
|
32
|
+
| null;
|
|
33
|
+
/** Used when an element does not have children. */
|
|
34
|
+
export interface PreactBaseElementProps<TClass extends HTMLElement> {
|
|
35
|
+
/** Assigns a unique key to this element. */
|
|
36
|
+
key?: preact.Key;
|
|
37
|
+
/** Assigns a ref (generally from `useRef()`) to this element. */
|
|
38
|
+
ref?: preact.Ref<TClass>;
|
|
39
|
+
/** Assigns this element to a parent's slot. */
|
|
40
|
+
slot?: Lowercase<string>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type Styles = string;
|
|
44
|
+
export type RenderImpl = Omit<ShadowRootInit, 'mode'> & {
|
|
45
|
+
ShadowRoot: (element: any) => ComponentChild;
|
|
46
|
+
styles?: Styles;
|
|
47
|
+
};
|
|
48
|
+
export interface ActivationEventEsque {
|
|
49
|
+
shiftKey: boolean;
|
|
50
|
+
metaKey: boolean;
|
|
51
|
+
ctrlKey: boolean;
|
|
52
|
+
button: number;
|
|
53
|
+
}
|
|
54
|
+
export interface ClickOptions {
|
|
55
|
+
/**
|
|
56
|
+
* The event you want to influence the synthetic click.
|
|
57
|
+
*/
|
|
58
|
+
sourceEvent?: ActivationEventEsque;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Base class for creating custom elements with Preact.
|
|
62
|
+
* While this class could be used in both Node and the browser, the constructor will only be used in the browser.
|
|
63
|
+
* So we give it a type of HTMLElement to avoid typing issues later where it's used, which will only happen in the browser.
|
|
64
|
+
*/
|
|
65
|
+
declare const BaseClass: typeof globalThis.HTMLElement;
|
|
66
|
+
declare abstract class PreactCustomElement extends BaseClass {
|
|
67
|
+
/** @private */
|
|
68
|
+
static get observedAttributes(): string[];
|
|
69
|
+
constructor({
|
|
70
|
+
styles,
|
|
71
|
+
ShadowRoot: renderFunction,
|
|
72
|
+
delegatesFocus,
|
|
73
|
+
...options
|
|
74
|
+
}: RenderImpl);
|
|
75
|
+
|
|
76
|
+
/** @private */
|
|
77
|
+
setAttribute(name: string, value: string): void;
|
|
78
|
+
/** @private */
|
|
79
|
+
attributeChangedCallback(name: string): void;
|
|
80
|
+
/** @private */
|
|
81
|
+
connectedCallback(): void;
|
|
82
|
+
/** @private */
|
|
83
|
+
disconnectedCallback(): void;
|
|
84
|
+
/** @private */
|
|
85
|
+
adoptedCallback(): void;
|
|
86
|
+
/**
|
|
87
|
+
* Queue a run of the render function.
|
|
88
|
+
* You shouldn't need to call this manually - it should be handled by changes to @property values.
|
|
89
|
+
* @private
|
|
90
|
+
*/
|
|
91
|
+
queueRender(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Like the standard `element.click()`, but you can influence the behavior with a `sourceEvent`.
|
|
94
|
+
*
|
|
95
|
+
* For example, if the `sourceEvent` was a middle click, or has particular keys held down,
|
|
96
|
+
* components will attempt to produce the desired behavior on links, such as opening the page in the background tab.
|
|
97
|
+
* @private
|
|
98
|
+
* @param options
|
|
99
|
+
*/
|
|
100
|
+
click({sourceEvent}?: ClickOptions): void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare class Thumbnail extends PreactCustomElement implements ThumbnailProps {
|
|
104
|
+
accessor src: ThumbnailProps['src'];
|
|
105
|
+
accessor alt: ThumbnailProps['alt'];
|
|
106
|
+
accessor size: ThumbnailProps['size'];
|
|
107
|
+
accessor onload: CallbackEventListener<typeof tagName> | null;
|
|
108
|
+
accessor onerror: OnErrorEventHandler;
|
|
109
|
+
constructor();
|
|
110
|
+
}
|
|
111
|
+
declare global {
|
|
112
|
+
interface HTMLElementTagNameMap {
|
|
113
|
+
[tagName]: Thumbnail;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
declare module 'preact' {
|
|
117
|
+
namespace createElement.JSX {
|
|
118
|
+
interface IntrinsicElements {
|
|
119
|
+
[tagName]: ThumbnailJSXProps & PreactBaseElementProps<Thumbnail>;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare const tagName = 's-thumbnail';
|
|
125
|
+
export interface ThumbnailJSXProps
|
|
126
|
+
extends Partial<ThumbnailProps>,
|
|
127
|
+
Pick<ThumbnailProps$1, 'id'> {
|
|
128
|
+
onLoad?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
129
|
+
onError?: ((event: CallbackEvent<typeof tagName>) => void) | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export {Thumbnail};
|
|
133
|
+
export type {ThumbnailJSXProps};
|