Skip to content

Commit

Permalink
Support recursive definitions and complex template literals
Browse files Browse the repository at this point in the history
Support full template expansion

Fix naming collision for InputProps
Fix missing props for Checkbox
  • Loading branch information
vividviolet committed Jan 16, 2025
1 parent f7cc208 commit 1d9246a
Show file tree
Hide file tree
Showing 2 changed files with 250 additions and 74 deletions.
58 changes: 29 additions & 29 deletions packages/ui-extensions/src/surfaces/admin/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2794,11 +2794,9 @@ export type ButtonBaseProps = Required<
| 'target'
| 'href'
| 'download'
| 'onBlur'
| 'onClick'
| 'onFocus'
>
>;
> &
Pick<ButtonOnlyProps, 'onBlur' | 'onClick' | 'onFocus'>;
export interface ButtonProps extends ButtonBaseProps {
tone: Extract<ButtonProps$1['tone'], 'neutral' | 'critical' | 'auto'>;
icon: IconProps['type'];
Expand Down Expand Up @@ -2856,24 +2854,24 @@ declare module 'preact' {
}

declare const internals: unique symbol;
export type InputProps = Required<
export type InputElementInputProps = Required<
Pick<TextFieldProps, 'disabled' | 'id' | 'name' | 'value'>
>;
declare class PreactInputElement
extends PreactCustomElement
implements InputProps
implements InputElementInputProps
{
static formAssociated: boolean;
/** @private */
[internals]: ElementInternals;
protected getDefaultValue(): string;
accessor onchange: EventListener | null;
accessor oninput: EventListener | null;
accessor disabled: InputProps['disabled'];
accessor id: InputProps['id'];
accessor name: InputProps['name'];
get value(): InputProps['value'];
set value(value: InputProps['value']);
accessor disabled: InputElementInputProps['disabled'];
accessor id: InputElementInputProps['id'];
accessor name: InputElementInputProps['name'];
get value(): InputElementInputProps['value'];
set value(value: InputElementInputProps['value']);
constructor(renderImpl: RenderImpl);
}

Expand All @@ -2889,7 +2887,8 @@ export type CheckboxProps = InputProps &
| 'label'
| 'required'
>
>;
> &
Pick<CheckboxProps$1, 'onChange' | 'onInput'>;

declare const tagName$i = 'shopify-checkbox';
export interface ReactProps$i
Expand Down Expand Up @@ -3207,28 +3206,29 @@ export type FieldReactProps = Pick<
declare const tagName$8 = 'shopify-select';
export interface ReactProps$8 extends Partial<SharedProps & FieldReactProps> {}

export type FieldProps<Autocomplete extends string = string> = InputProps &
Required<
Pick<
TextFieldProps,
| 'defaultValue'
| 'details'
| 'error'
| 'label'
| 'placeholder'
| 'readOnly'
| 'required'
>
> & {
autocomplete: Autocomplete;
};
export type FieldPropsAutocomplete<Autocomplete extends string = string> =
InputProps &
Required<
Pick<
TextFieldProps,
| 'defaultValue'
| 'details'
| 'error'
| 'label'
| 'placeholder'
| 'readOnly'
| 'required'
>
> & {
autocomplete: Autocomplete;
};
declare class PreactFieldElement<Autocomplete extends string = string>
extends PreactInputElement
implements FieldProps<Autocomplete>
implements FieldPropsAutocomplete<Autocomplete>
{
accessor onblur: EventListener | null;
accessor onfocus: EventListener | null;
accessor autocomplete: FieldProps<Autocomplete>['autocomplete'];
accessor autocomplete: FieldPropsAutocomplete<Autocomplete>['autocomplete'];
accessor defaultValue: FieldProps['defaultValue'];
accessor details: FieldProps['details'];
accessor error: FieldProps['error'];
Expand Down
Loading

0 comments on commit 1d9246a

Please sign in to comment.