Skip to content

Commit a57a10e

Browse files
Design v2 (#75)
* Update SCSS variables from Figma * progress * setup form * just to make e2e pass * just to make e2e pass * removed legacy code * cleaned up exports * clean up * clean up on about * progress * progress * setup form * clean up * clean up on about * WIP * Finish Components, Refactor, finalize design for PR * Updated Styles/Padding * Code Review updates * added spinner * More Code Review Changes * final comments * fix About page * adjust about to use variables not mixins --------- Co-authored-by: Stefan Attoh <[email protected]>
1 parent 1b0d8a4 commit a57a10e

File tree

98 files changed

+4966
-824
lines changed

Some content is hidden

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

98 files changed

+4966
-824
lines changed

packages/common/src/types/message-to-ui-payload.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ export interface PRCreatedPayload extends BaseMessageToUIPayload {
4040
prUrl: string;
4141
}
4242

43+
export interface PRCreatingPayload extends BaseMessageToUIPayload {
44+
type: 'pr-creating';
45+
}
46+
4347
export interface ErrorPayload extends BaseMessageToUIPayload {
4448
type: 'error';
4549
message: string;
@@ -58,6 +62,7 @@ export type MessageToUIPayload =
5862
| ProgressEndPayload
5963
| ConfigSavedPayload
6064
| ConfigLoadedPayload
65+
| PRCreatingPayload
6166
| PRCreatedPayload
6267
| ErrorPayload
6368
| TestDataExportedPayload;

packages/figma/scripts/generate-theme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,4 @@ export const themeTokens: {
147147

148148
fs.writeFileSync(path.resolve(__dirname, '../src/theme-tokens.ts'), tsOutput);
149149

150-
console.log('✅ Generated theme-tokens.ts');
150+
console.info('✅ Generated theme-tokens.ts');

packages/figma/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const main = async () => {
3434
// Show the UI with resizable window
3535
figma.showUI(html, {
3636
width: 600,
37-
height: 1200,
37+
height: 900,
3838
themeColors: true,
3939
title: 'Eggstractor',
4040
});

packages/figma/src/services/effect.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export async function collectAllFigmaEffectStyles(
7777
}
7878
}
7979

80-
console.log(`✨ Collected ${effectTokens.length} effect style tokens`);
80+
console.info(`✨ Collected ${effectTokens.length} effect style tokens`);
8181
collection.tokens.push(...effectTokens);
8282
} catch (error) {
8383
console.warn('Failed to collect Figma Effect Styles:', error);

packages/figma/src/services/variable.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ export async function collectPrimitiveVariables(
267267
}
268268
}
269269

270-
console.log(`✨ Collected ${primitiveTokens.length} primitive variable tokens`);
270+
console.info(`✨ Collected ${primitiveTokens.length} primitive variable tokens`);
271271
collection.tokens.push(...primitiveTokens);
272272
} catch (error) {
273273
console.warn('Failed to collect Figma Variables:', error);

packages/figma/src/tests/utils/theme-tokens.utils.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { buildDynamicThemeTokens, generateThemeDirective } from '../../utils/theme-tokens.utils';
22
import { TokenCollection, VariableToken } from '../../types';
33

4-
// Mock console.log to suppress output during tests
4+
// Mock console to suppress output during tests
55
vi.mock('console', () => ({
66
log: vi.fn(),
7+
info: vi.fn(),
78
warn: vi.fn(),
89
error: vi.fn(),
910
}));

packages/ui/src/app/app.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useEffect, useState } from 'react';
22
import { getValidStylesheetFormat } from '@eggstractor/common';
33
import { Route, Routes } from 'react-router-dom';
4-
import '../styles.scss';
54
import { messageMainThread } from './utils';
6-
import { About, Form, StatusProvider } from './routes';
5+
import { Export, Setup, About, Components, StatusProvider } from './routes';
76
import { GeneratedStylesProvider, Config, ConfigProvider } from './context';
87
import { useOnPluginMessage, useRoutePersistence } from './hooks';
9-
import { MemoryPersistenceRouter } from './components';
8+
import { MemoryPersistenceRouter, Nav } from './components';
9+
import '../styles.scss';
1010

1111
export const App = () => {
1212
const initialRoute = useRoutePersistence();
@@ -24,6 +24,7 @@ export const App = () => {
2424
});
2525

2626
useEffect(() => {
27+
console.info('loading config');
2728
// Load saved config when UI opens
2829
messageMainThread({ type: 'load-config' });
2930
}, []);
@@ -37,11 +38,12 @@ export const App = () => {
3738
<GeneratedStylesProvider>
3839
<StatusProvider>
3940
<ConfigProvider {...loadedConfig}>
40-
{/* TODO: Add navigation */}
41-
{/*<Nav />*/}
41+
<Nav />
4242
<Routes>
43-
<Route path="/" element={<Form />} />
43+
<Route path="/" element={<Export />} />
44+
<Route path="/setup" element={<Setup />} />
4445
<Route path="/about" element={<About />} />
46+
<Route path="components" element={<Components />} />
4547
</Routes>
4648
</ConfigProvider>
4749
</StatusProvider>
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
@use '../../../generated.scss' as *;
2+
@use '../../../resets.scss' as *;
3+
4+
.button {
5+
@include reset-button;
6+
@include button;
7+
// TODO: generated set width is causing issues
8+
width: unset;
9+
.label {
10+
@include button-label;
11+
}
12+
&.icon {
13+
@include button-icon;
14+
// TODO: generated icon styles don't include height/width
15+
display: flex;
16+
align-items: center;
17+
justify-content: center;
18+
width: 44px;
19+
height: 44px;
20+
}
21+
22+
&:not(:hover) {
23+
@include button-status_resting;
24+
// TODO: generated padding: 0 is causing issues with padding
25+
padding: $size-none $size-2xl;
26+
&.primary {
27+
@include button-primary-status_resting;
28+
.label {
29+
@include button-label-primary-status_resting;
30+
}
31+
}
32+
&.secondary {
33+
.label {
34+
@include button-label-secondary-status_resting;
35+
}
36+
}
37+
&.icon {
38+
// TODO: generated icon styles don't include color styles for icon
39+
color: $colour-button-secondary-text-resting;
40+
padding: 0rem 0rem;
41+
}
42+
}
43+
&:hover {
44+
@include button-status_hover;
45+
// TODO: generated padding: 0 is causing issues with padding
46+
padding: $size-none $size-2xl;
47+
&.primary {
48+
@include button-primary-status_hover;
49+
width: unset;
50+
.label {
51+
@include button-label-primary-status_hover;
52+
}
53+
}
54+
&.secondary {
55+
.label {
56+
@include button-label-secondary-status_hover;
57+
}
58+
}
59+
&.icon {
60+
// TODO: generated icon styles don't include color styles for icon
61+
color: $colour-button-secondary-text-hover;
62+
padding: 0rem 0rem;
63+
}
64+
}
65+
}
Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
import { ButtonHTMLAttributes, FC } from 'react';
22
import cn from 'classnames';
3+
import styles from './Button.module.scss';
34

4-
export const Button: FC<ButtonHTMLAttributes<HTMLButtonElement>> = ({
5+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
6+
children: React.ReactNode;
7+
variant?: 'primary' | 'secondary' | 'icon';
8+
}
9+
10+
export const Button: FC<ButtonProps> = ({
511
children,
612
type = 'button',
13+
variant = 'primary',
714
...props
815
}) => {
916
return (
10-
<button {...props} className={cn('button', props.className)} type={type}>
11-
{children}
17+
<button
18+
{...props}
19+
className={cn(styles.button, props.className, {
20+
[styles.icon]: variant === 'icon',
21+
[styles.primary]: variant === 'primary',
22+
[styles.secondary]: variant === 'secondary',
23+
})}
24+
type={type}
25+
>
26+
<span className={styles.label}>{children}</span>
1227
</button>
1328
);
1429
};
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
@use '../../../resets.scss' as *;
2+
@use '../../../generated.scss' as *;
3+
4+
.button-group {
5+
display: flex;
6+
width: 100%;
7+
8+
// TODO: There is an issue with rendering the border radius of the buttons
9+
// with the container. The workaround for now is to remove the background
10+
// color of the buttons and just put it on the container
11+
background: $colour-button-segmented-unselected-bg-resting;
12+
13+
// TODO: these styles didn't generate, adding them manually
14+
border-radius: $radius-brand;
15+
border: $size-1px solid $colour-button-segmented-unselected-border;
16+
}
17+
18+
// TODO: These styles didn't generate, adding them manually
19+
.button-group-label {
20+
display: flex;
21+
justify-content: space-between;
22+
23+
// TODO: really should be using eggstracted color variables here.
24+
color: $colour-input-label;
25+
26+
/* Label */
27+
// TODO: same idea; var fallbacks here are indicate the intended design system
28+
font-family: $font-family-display;
29+
font-size: $size-xl;
30+
font-style: normal; // TODO: no variable(s) for font style
31+
font-weight: 600; // TODO: no variable(s) for font weight
32+
line-height: $size-xl; /* 100% */
33+
34+
margin-bottom: $size-md;
35+
}
36+
37+
// TODO: These styles didn't generate, adding them manually
38+
.button-group-hint {
39+
align-self: stretch;
40+
color: $colour-input-hint;
41+
42+
/* Helper */
43+
font-family: $font-family-body;
44+
// TODO: consider design match
45+
font-size: 14px;
46+
font-style: normal; // TODO: no variable(s) for font style
47+
font-weight: 400; // TODO: no variable(s) for font weight
48+
line-height: $size-xl; /* 114.286% */
49+
50+
margin-top: $size-md;
51+
}

0 commit comments

Comments
 (0)