Skip to content

Commit

Permalink
Merge pull request #51 from kongsgaard/Setup-shadcn
Browse files Browse the repository at this point in the history
Added shadcn components structure, and created action-tooltip component
  • Loading branch information
zach-herridge committed Nov 24, 2023
2 parents bd681e7 + 1175d49 commit f27fe82
Show file tree
Hide file tree
Showing 18 changed files with 1,334 additions and 177 deletions.
144 changes: 68 additions & 76 deletions src/echo-app/package-lock.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions src/echo-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@
"@electron-toolkit/utils": "^2.0.0",
"@electron/remote": "^2.0.12",
"body-parser": "^1.20.2",
"character-plugin": "file:../echo-plugin-examples/character-plugin",
"class-variance-authority": "^0.7.0",
"clsx": "^2.0.0",
"cors": "^2.8.5",
"echo-common": "file:../echo-common",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.2",
"poe-log-plugin": "file:../echo-plugin-examples/poe-log-plugin",
"stash-plugin": "file:../echo-plugin-examples/stash-plugin",
"tailwind-merge": "^2.0.0",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.2.2"
},
"optionalDependencies": {
Expand Down
53 changes: 48 additions & 5 deletions src/echo-app/src/renderer/src/assets/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,54 @@

@layer base {
:root {
--color-primary-surface: #303338;
--color-secondary-surface: #2a2d31;
--color-input-surface: #373a3f;
--color-text: #d4d4d4;
--color-primary-accent: #5764f2;
--color-primary-surface: #303338; /*Deprecated*/
--color-secondary-surface: #2a2d31; /*Deprecated*/
--color-input-surface: #373a3f; /*Deprecated*/
--color-text: #d4d4d4; /*Deprecated*/
--color-primary-accent: #5764f2; /*Deprecated*/

--gradient: #005AA7;

--background: 0 0% 100%;
--foreground: 222.2 47.4% 11.2%;

--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;

--popover: 0 0% 100%;
--popover-foreground: 222.2 47.4% 11.2%;

--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;

--card: 0 0% 100%;
--card-foreground: 222.2 47.4% 11.2%;

--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;

--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;

--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;

--destructive: 0 100% 50%;
--destructive-foreground: 210 40% 98%;

--ring: 215 20.2% 65.1%;

--radius: 0.5rem;
}
}

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
font-feature-settings: "rlig" 1, "calt" 1;
}
}

Expand Down
39 changes: 25 additions & 14 deletions src/echo-app/src/renderer/src/pages/plugin-page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { QuestionMarkCircleIcon } from '@heroicons/react/20/solid'
import { CpuChipIcon, HomeIcon, UserCircleIcon } from '@heroicons/react/24/outline'
import { bind } from '@react-rxjs/core'
import { ECHO_CONTEXT_SERVICE, EchoPluginHook } from 'echo-common'
import { ECHO_CONTEXT_SERVICE, EchoPluginHook, ActionTooltip, cn } from 'echo-common'
import { EchoRoute } from 'echo-common/dist/cjs/echo-router'
import React, { Suspense, useEffect } from 'react'
import { ProfilePage } from './profile-page'
Expand All @@ -25,7 +25,8 @@ export const PluginPage: React.FC = () => {
navItems: [
{
location: 'l-sidebar-m',
icon: HomeIcon
icon: HomeIcon,
displayname: 'Home'
}
],
page: DefaultPage,
Expand All @@ -39,7 +40,8 @@ export const PluginPage: React.FC = () => {
navItems: [
{
location: 'l-sidebar-b',
icon: UserCircleIcon
icon: UserCircleIcon,
displayname: 'Profile'
}
],
page: ProfilePage,
Expand All @@ -50,7 +52,8 @@ export const PluginPage: React.FC = () => {
navItems: [
{
location: 'l-sidebar-b',
icon: CpuChipIcon
icon: CpuChipIcon,
displayname: 'Plugins'
}
],
page: PluginSettingsPage,
Expand Down Expand Up @@ -103,16 +106,24 @@ const RouterIconNavigator = ({ location }: { location: string }) => {
.map((navItem, idx) => {
const Icon = navItem.icon ?? QuestionMarkCircleIcon
return (
<Icon
key={echoRoute.plugin + echoRoute.path + navItem.location + idx}
className={
'h-7 w-7 cursor-pointer ' +
(currentRoute === echoRoute ? 'text-primary-accent' : '')
}
onClick={() => {
APP_CONTEXT.router.push(echoRoute)
}}
></Icon>
<ActionTooltip
side='right'
align='center'
label={navItem.displayname}
>
<Icon
key={echoRoute.plugin + echoRoute.path + navItem.location + idx}
className={
cn(
'h-7 w-7 cursor-pointer' ,
currentRoute === echoRoute && 'text-primary-accent'
)
}
onClick={() => {
APP_CONTEXT.router.push(echoRoute)
}}
></Icon>
</ActionTooltip>
)
})
})}
Expand Down
83 changes: 75 additions & 8 deletions src/echo-app/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,88 @@
const { fontFamily } = require("tailwindcss/defaultTheme")

module.exports = {
content: [
'./*.{js,jsx,ts,tsx,html}',
'./src/**/*.{js,jsx,ts,tsx}',
'../poestack-echo-common/src/**/*.{js,jsx,ts,tsx}',
'../echo-common/src/**/*.{js,jsx,ts,tsx}',
'../echo-plugin-examples/*/src/**/*.{js,jsx,ts,tsx}',
'../echo-plugin/*/src/**/*.{js,jsx,ts,tsx}'
],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
colors: {
'primary-surface': 'var(--color-primary-surface)',
'input-surface': 'var(--color-input-surface)',
'secondary-surface': 'var(--color-secondary-surface)',
'primary-text': 'var(--color-text)',
'primary-accent': 'var(--color-primary-accent)'
}
'primary-surface': 'var(--color-primary-surface)', //Deprecated
'input-surface': 'var(--color-input-surface)', //Deprecated
'secondary-surface': 'var(--color-secondary-surface)', //Deprecated
'primary-text': 'var(--color-text)', //Deprecated
'primary-accent': 'var(--color-primary-accent)', //Deprecated

gradient: "var(--gradient)",
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: `var(--radius)`,
md: `calc(var(--radius) - 2px)`,
sm: "calc(var(--radius) - 4px)",
},
fontFamily: {
sans: ["var(--font-sans)", ...fontFamily.sans],
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
}

},
plugins: []
plugins: [require("tailwindcss-animate")],
}
Loading

0 comments on commit f27fe82

Please sign in to comment.