Skip to content

Commit 958c343

Browse files
committed
New UI
1 parent 07d094e commit 958c343

24 files changed

Lines changed: 841 additions & 621 deletions

apps/plugin/plugin-src/code.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ import {
44
flutterMain,
55
tailwindMain,
66
swiftuiMain,
7-
convertIntoNodes,
87
htmlMain,
98
postSettingsChanged,
109
} from "backend";
11-
import { nodesToJSON } from "backend/src/code";
10+
import { nodesToJSON } from "backend/src/altNodes/jsonNodeConversion";
1211
import { retrieveGenericSolidUIColors } from "backend/src/common/retrieveUI/retrieveColors";
1312
import { flutterCodeGenTextStyles } from "backend/src/flutter/flutterMain";
1413
import { htmlCodeGenTextStyles } from "backend/src/html/htmlMain";
@@ -140,7 +139,8 @@ const standardMode = async () => {
140139
});
141140

142141
// Listen for page changes
143-
figma.on("currentpagechange", () => {
142+
figma.loadAllPagesAsync();
143+
figma.on("documentchange", () => {
144144
console.log("[DEBUG] documentchange event triggered");
145145
// Node: This was causing an infinite load when you try to export a background image from a group that contains children.
146146
// The reason for this is that the code will temporarily hide the children of the group in order to export a clean image

apps/plugin/tailwind.config.js

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,59 @@ module.exports = {
66
"../../packages/plugin-ui/**/*.{js,ts,jsx,tsx}",
77
],
88
darkMode: "class",
9-
9+
theme: {
10+
extend: {
11+
colors: {
12+
border: "hsl(var(--border))",
13+
input: "hsl(var(--input))",
14+
ring: "hsl(var(--ring))",
15+
background: "hsl(var(--background))",
16+
foreground: "hsl(var(--foreground))",
17+
primary: {
18+
DEFAULT: "hsl(var(--primary))",
19+
foreground: "hsl(var(--primary-foreground))",
20+
},
21+
secondary: {
22+
DEFAULT: "hsl(var(--secondary))",
23+
foreground: "hsl(var(--secondary-foreground))",
24+
},
25+
destructive: {
26+
DEFAULT: "hsl(var(--destructive) / <alpha-value>)",
27+
foreground: "hsl(var(--destructive-foreground) / <alpha-value>)",
28+
},
29+
muted: {
30+
DEFAULT: "hsl(var(--muted))",
31+
foreground: "hsl(var(--muted-foreground))",
32+
},
33+
accent: {
34+
DEFAULT: "hsl(var(--accent))",
35+
foreground: "hsl(var(--accent-foreground))",
36+
},
37+
popover: {
38+
DEFAULT: "hsl(var(--popover))",
39+
foreground: "hsl(var(--popover-foreground))",
40+
},
41+
card: {
42+
DEFAULT: "hsl(var(--card))",
43+
foreground: "hsl(var(--card-foreground))",
44+
},
45+
sidebar: {
46+
DEFAULT: "hsl(var(--sidebar-background))",
47+
foreground: "hsl(var(--sidebar-foreground))",
48+
primary: "hsl(var(--sidebar-primary))",
49+
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
50+
accent: "hsl(var(--sidebar-accent))",
51+
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
52+
border: "hsl(var(--sidebar-border))",
53+
ring: "hsl(var(--sidebar-ring))",
54+
},
55+
},
56+
borderRadius: {
57+
xl: "calc(var(--radius) + 4px)",
58+
lg: "var(--radius)",
59+
md: "calc(var(--radius) - 2px)",
60+
sm: "calc(var(--radius) - 4px)",
61+
},
62+
}
63+
}
1064
};

apps/plugin/ui-src/index.css

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
11
@tailwind base;
22
@tailwind components;
33
@tailwind utilities;
4+
5+
6+
@layer base {
7+
:root {
8+
--background: 0 0% 100%;
9+
--foreground: 240 10% 3.9%;
10+
--card: 220 14% 96%;
11+
--card-foreground: 240 10% 3.9%;
12+
--popover: 0 0% 100%;
13+
--popover-foreground: 240 10% 3.9%;
14+
--primary: 142 70% 45%;
15+
--primary-foreground: 0 0% 100%;
16+
--secondary: 240 4.8% 95.9%;
17+
--secondary-foreground: 240 5.9% 10%;
18+
--muted: 240 4.8% 95.9%;
19+
--muted-foreground: 240 3.8% 46.1%;
20+
--accent: 240 4.8% 95.9%;
21+
--accent-foreground: 240 5.9% 10%;
22+
--destructive: 0 84.2% 60.2%;
23+
--destructive-foreground: 0 0% 98%;
24+
--border: 240 5.9% 90%;
25+
--input: 240 5.9% 90%;
26+
--ring: 240 5.9% 10%;
27+
--radius: 0.5rem;
28+
--chart-1: 12 76% 61%;
29+
--chart-2: 173 58% 39%;
30+
--chart-3: 197 37% 24%;
31+
--chart-4: 43 74% 66%;
32+
--chart-5: 27 87% 67%;
33+
}
34+
35+
.dark {
36+
--background: 240 10% 3.9%;
37+
--foreground: 0 0% 98%;
38+
--card: 0 0% 13%;
39+
--card-foreground: 0 0% 98%;
40+
--popover: 240 10% 3.9%;
41+
--popover-foreground: 0 0% 98%;
42+
--primary: 142 70% 45%;
43+
--primary-foreground: 0 0% 100%;
44+
--secondary: 240 3.7% 15.9%;
45+
--secondary-foreground: 0 0% 98%;
46+
--muted: 240 3.7% 15.9%;
47+
--muted-foreground: 240 5% 64.9%;
48+
--accent: 240 3.7% 15.9%;
49+
--accent-foreground: 0 0% 98%;
50+
--destructive: 0 62.8% 30.6%;
51+
--destructive-foreground: 0 0% 98%;
52+
--border: 240 3.7% 15.9%;
53+
--input: 240 3.7% 15.9%;
54+
--ring: 240 4.9% 83.9%;
55+
--chart-1: 220 70% 50%;
56+
--chart-2: 160 60% 45%;
57+
--chart-3: 30 80% 55%;
58+
--chart-4: 280 65% 60%;
59+
--chart-5: 340 75% 55%;
60+
}
61+
}
62+
63+
@layer base {
64+
* {
65+
@apply border-border outline-ring/50;
66+
}
67+
/* body {
68+
@apply bg-background text-foreground;
69+
} */
70+
}

packages/backend/src/altNodes/altConversion.ts

Lines changed: 0 additions & 87 deletions
This file was deleted.

0 commit comments

Comments
 (0)