Skip to content

Commit 1e2b41a

Browse files
JshhhhJustin Shih
andauthored
feat: refactor override and utils to strings (#1106)
Co-authored-by: Justin Shih <[email protected]>
1 parent 4fb3cb7 commit 1e2b41a

34 files changed

+3227
-1698
lines changed

packages/codegen-ui-react/lib/__tests__/__snapshots__/react-studio-template-renderer-helper.test.ts.snap

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
1616
"import * as React from \\"react\\";
1717
import { CustomButtonProps } from \\"./CustomButton\\";
1818
import { ViewTestProps } from \\"./ViewTest\\";
19-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
19+
export declare type EscapeHatchProps = {
20+
[elementHierarchy: string]: Record<string, unknown>;
21+
} | null;
22+
export declare type VariantValues = {
23+
[key: string]: string;
24+
};
25+
export declare type Variant = {
26+
variantValues: VariantValues;
27+
overrides: EscapeHatchProps;
28+
};
2029
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
2130
export declare type CustomParentAndChildrenOverridesProps = {
2231
CustomParentAndChildren?: ViewTestProps;
@@ -33,7 +42,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
3342
"import * as React from \\"react\\";
3443
import { CustomButtonProps } from \\"./CustomButton\\";
3544
import { ViewTestProps } from \\"./ViewTest\\";
36-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
45+
export declare type EscapeHatchProps = {
46+
[elementHierarchy: string]: Record<string, unknown>;
47+
} | null;
48+
export declare type VariantValues = {
49+
[key: string]: string;
50+
};
51+
export declare type Variant = {
52+
variantValues: VariantValues;
53+
overrides: EscapeHatchProps;
54+
};
3755
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
3856
export declare type CustomParentAndChildrenOverridesProps = {
3957
CustomParentAndChildren?: ViewTestProps;
@@ -50,7 +68,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
5068
"import * as React from \\"react\\";
5169
import { CustomButtonProps } from \\"./CustomButton\\";
5270
import { ViewTestProps } from \\"./ViewTest\\";
53-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
71+
export declare type EscapeHatchProps = {
72+
[elementHierarchy: string]: Record<string, unknown>;
73+
} | null;
74+
export declare type VariantValues = {
75+
[key: string]: string;
76+
};
77+
export declare type Variant = {
78+
variantValues: VariantValues;
79+
overrides: EscapeHatchProps;
80+
};
5481
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
5582
export declare type CustomParentAndChildrenOverridesProps = {
5683
CustomParentAndChildren?: ViewTestProps;
@@ -67,7 +94,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
6794
"import * as React from \\"react\\";
6895
import { CustomButtonProps } from \\"./CustomButton\\";
6996
import { ViewTestProps } from \\"./ViewTest\\";
70-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
97+
export declare type EscapeHatchProps = {
98+
[elementHierarchy: string]: Record<string, unknown>;
99+
} | null;
100+
export declare type VariantValues = {
101+
[key: string]: string;
102+
};
103+
export declare type Variant = {
104+
variantValues: VariantValues;
105+
overrides: EscapeHatchProps;
106+
};
71107
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
72108
export declare type CustomParentAndChildrenOverridesProps = {
73109
CustomParentAndChildren?: ViewTestProps;
@@ -84,7 +120,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
84120
"import * as React from \\"react\\";
85121
import { CustomButtonProps } from \\"./CustomButton\\";
86122
import { ViewTestProps } from \\"./ViewTest\\";
87-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
123+
export declare type EscapeHatchProps = {
124+
[elementHierarchy: string]: Record<string, unknown>;
125+
} | null;
126+
export declare type VariantValues = {
127+
[key: string]: string;
128+
};
129+
export declare type Variant = {
130+
variantValues: VariantValues;
131+
overrides: EscapeHatchProps;
132+
};
88133
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
89134
export declare type CustomParentAndChildrenOverridesProps = {
90135
CustomParentAndChildren?: ViewTestProps;
@@ -101,7 +146,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
101146
"import * as React from \\"react\\";
102147
import { CustomButtonProps } from \\"./CustomButton\\";
103148
import { ViewTestProps } from \\"./ViewTest\\";
104-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
149+
export declare type EscapeHatchProps = {
150+
[elementHierarchy: string]: Record<string, unknown>;
151+
} | null;
152+
export declare type VariantValues = {
153+
[key: string]: string;
154+
};
155+
export declare type Variant = {
156+
variantValues: VariantValues;
157+
overrides: EscapeHatchProps;
158+
};
105159
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
106160
export declare type CustomParentAndChildrenOverridesProps = {
107161
CustomParentAndChildren?: ViewTestProps;
@@ -118,7 +172,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
118172
"import * as React from \\"react\\";
119173
import { CustomButtonProps } from \\"./CustomButton\\";
120174
import { ViewTestProps } from \\"./ViewTest\\";
121-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
175+
export declare type EscapeHatchProps = {
176+
[elementHierarchy: string]: Record<string, unknown>;
177+
} | null;
178+
export declare type VariantValues = {
179+
[key: string]: string;
180+
};
181+
export declare type Variant = {
182+
variantValues: VariantValues;
183+
overrides: EscapeHatchProps;
184+
};
122185
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
123186
export declare type CustomParentAndChildrenOverridesProps = {
124187
CustomParentAndChildren?: ViewTestProps;
@@ -135,7 +198,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
135198
"import * as React from \\"react\\";
136199
import { CustomButtonProps } from \\"./CustomButton\\";
137200
import { ViewTestProps } from \\"./ViewTest\\";
138-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
201+
export declare type EscapeHatchProps = {
202+
[elementHierarchy: string]: Record<string, unknown>;
203+
} | null;
204+
export declare type VariantValues = {
205+
[key: string]: string;
206+
};
207+
export declare type Variant = {
208+
variantValues: VariantValues;
209+
overrides: EscapeHatchProps;
210+
};
139211
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
140212
export declare type CustomParentAndChildrenOverridesProps = {
141213
CustomParentAndChildren?: ViewTestProps;
@@ -152,7 +224,16 @@ exports[`react-studio-template-renderer-helper transpile successfully transpiles
152224
"import * as React from \\"react\\";
153225
import { CustomButtonProps } from \\"./CustomButton\\";
154226
import { ViewTestProps } from \\"./ViewTest\\";
155-
import { EscapeHatchProps } from \\"@aws-amplify/ui-react/internal\\";
227+
export declare type EscapeHatchProps = {
228+
[elementHierarchy: string]: Record<string, unknown>;
229+
} | null;
230+
export declare type VariantValues = {
231+
[key: string]: string;
232+
};
233+
export declare type Variant = {
234+
variantValues: VariantValues;
235+
overrides: EscapeHatchProps;
236+
};
156237
export declare type PrimitiveOverrideProps<T> = Partial<T> & React.DOMAttributes<HTMLDivElement>;
157238
export declare type CustomParentAndChildrenOverridesProps = {
158239
CustomParentAndChildren?: ViewTestProps;

0 commit comments

Comments
 (0)