Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update theme generation for new schema #142

Merged
merged 1 commit into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions packages/amplify-ui-codegen-schema/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
import { theme } from '@aws-amplify/ui';

export type FigmaMetadata = {
/**
* The document URL for the figma document
Expand Down Expand Up @@ -497,11 +495,22 @@ export type StudioComponentStorageBindingProperty = {
key?: string;
};

type DeepPartial<T> = {
[K in keyof T]?: DeepPartial<T[K]>;
export type StudioTheme = {
name: string;
id?: string;
values: StudioThemeValues;
// overrides is a special case becuase it is an array of values
overrides?: StudioThemeValues[];
};

export type StudioThemeValues = {
[token: string]: StudioThemeValue;
};

export type StudioTheme = DeepPartial<typeof theme>;
export type StudioThemeValue = {
value?: string;
children?: StudioThemeValues;
};

/**
* Component action types
Expand Down
Loading