mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 07:37:11 +01:00
Start using react-zen.
This commit is contained in:
parent
020cfdc646
commit
71e4f8f49b
24 changed files with 1872 additions and 609 deletions
10
package.json
10
package.json
|
|
@ -75,6 +75,7 @@
|
||||||
"@react-spring/web": "^9.7.3",
|
"@react-spring/web": "^9.7.3",
|
||||||
"@tanstack/react-query": "^5.28.6",
|
"@tanstack/react-query": "^5.28.6",
|
||||||
"@umami/prisma-client": "^0.14.0",
|
"@umami/prisma-client": "^0.14.0",
|
||||||
|
"@umami/react-zen": "^0.50.0",
|
||||||
"@umami/redis-client": "^0.26.0",
|
"@umami/redis-client": "^0.26.0",
|
||||||
"bcryptjs": "^2.4.3",
|
"bcryptjs": "^2.4.3",
|
||||||
"chalk": "^4.1.1",
|
"chalk": "^4.1.1",
|
||||||
|
|
@ -111,7 +112,7 @@
|
||||||
"react-basics": "^0.126.0",
|
"react-basics": "^0.126.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.0.0",
|
||||||
"react-error-boundary": "^4.0.4",
|
"react-error-boundary": "^4.0.4",
|
||||||
"react-intl": "^6.5.5",
|
"react-intl": "^7.1.6",
|
||||||
"react-simple-maps": "^2.3.0",
|
"react-simple-maps": "^2.3.0",
|
||||||
"react-use-measure": "^2.0.4",
|
"react-use-measure": "^2.0.4",
|
||||||
"react-window": "^1.8.6",
|
"react-window": "^1.8.6",
|
||||||
|
|
@ -126,6 +127,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@formatjs/cli": "^4.2.29",
|
"@formatjs/cli": "^4.2.29",
|
||||||
"@netlify/plugin-nextjs": "^5.8.1",
|
"@netlify/plugin-nextjs": "^5.8.1",
|
||||||
|
"@react-spring/types": "^9.7.5",
|
||||||
"@rollup/plugin-alias": "^5.0.0",
|
"@rollup/plugin-alias": "^5.0.0",
|
||||||
"@rollup/plugin-commonjs": "^25.0.4",
|
"@rollup/plugin-commonjs": "^25.0.4",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
"@rollup/plugin-json": "^6.0.0",
|
||||||
|
|
@ -135,9 +137,9 @@
|
||||||
"@svgr/webpack": "^8.1.0",
|
"@svgr/webpack": "^8.1.0",
|
||||||
"@types/cypress": "^1.1.3",
|
"@types/cypress": "^1.1.3",
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^22.10.5",
|
"@types/node": "^22.13.1",
|
||||||
"@types/react": "^19.0.4",
|
"@types/react": "^19.0.8",
|
||||||
"@types/react-dom": "^19.0.2",
|
"@types/react-dom": "^19.0.3",
|
||||||
"@types/react-intl": "^3.0.0",
|
"@types/react-intl": "^3.0.0",
|
||||||
"@types/react-window": "^1.8.8",
|
"@types/react-window": "^1.8.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
'use client';
|
'use client';
|
||||||
import { Loading } from 'react-basics';
|
import { Grid, Loading } from '@umami/react-zen';
|
||||||
import Script from 'next/script';
|
import Script from 'next/script';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import { useLogin, useConfig } from '@/components/hooks';
|
|
||||||
import UpdateNotice from './UpdateNotice';
|
import UpdateNotice from './UpdateNotice';
|
||||||
|
import NavBar from '@/app/(main)/NavBar';
|
||||||
|
import Page from '@/components/layout/Page';
|
||||||
|
import { useLogin, useConfig } from '@/components/hooks';
|
||||||
|
|
||||||
export function App({ children }) {
|
export function App({ children }) {
|
||||||
const { user, isLoading, error } = useLogin();
|
const { user, isLoading, error } = useLogin();
|
||||||
|
|
@ -27,13 +29,16 @@ export function App({ children }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<Grid rows="auto 1fr">
|
||||||
{children}
|
<NavBar />
|
||||||
<UpdateNotice user={user} config={config} />
|
<Page>
|
||||||
{process.env.NODE_ENV === 'production' && !pathname.includes('/share/') && (
|
<UpdateNotice user={user} config={config} />
|
||||||
<Script src={`${process.env.basePath || ''}/telemetry.js`} />
|
{children}
|
||||||
)}
|
{process.env.NODE_ENV === 'production' && !pathname.includes('/share/') && (
|
||||||
</>
|
<Script src={`${process.env.basePath || ''}/telemetry.js`} />
|
||||||
|
)}
|
||||||
|
</Page>
|
||||||
|
</Grid>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,16 +10,6 @@
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: 700;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links {
|
.links {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
@ -48,15 +38,10 @@
|
||||||
border-bottom: 2px solid var(--primary400);
|
border-bottom: 2px solid var(--primary400);
|
||||||
}
|
}
|
||||||
|
|
||||||
.actions,
|
|
||||||
.mobile {
|
.mobile {
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
|
||||||
|
|
||||||
.mobile {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,8 +50,7 @@
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(2, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
.links,
|
.links {
|
||||||
.actions {
|
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,15 @@
|
||||||
'use client';
|
'use client';
|
||||||
import { useEffect } from 'react';
|
import { Icon, Text, ThemeButton, Row } from '@umami/react-zen';
|
||||||
import { Icon, Text } from 'react-basics';
|
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import classNames from 'classnames';
|
|
||||||
import HamburgerButton from '@/components/common/HamburgerButton';
|
|
||||||
import ThemeButton from '@/components/input/ThemeButton';
|
|
||||||
import LanguageButton from '@/components/input/LanguageButton';
|
import LanguageButton from '@/components/input/LanguageButton';
|
||||||
import ProfileButton from '@/components/input/ProfileButton';
|
import ProfileButton from '@/components/input/ProfileButton';
|
||||||
import TeamsButton from '@/components/input/TeamsButton';
|
import TeamsButton from '@/components/input/TeamsButton';
|
||||||
import Icons from '@/components/icons';
|
import Icons from '@/components/icons';
|
||||||
import { useMessages, useNavigation, useTeamUrl } from '@/components/hooks';
|
import { useMessages, useTeamUrl } from '@/components/hooks';
|
||||||
import { getItem, setItem } from '@/lib/storage';
|
|
||||||
import styles from './NavBar.module.css';
|
|
||||||
|
|
||||||
export function NavBar() {
|
export function NavBar() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { pathname, router } = useNavigation();
|
const { renderTeamUrl } = useTeamUrl();
|
||||||
const { teamId, renderTeamUrl } = useTeamUrl();
|
|
||||||
|
|
||||||
const cloudMode = !!process.env.cloudMode;
|
|
||||||
|
|
||||||
const links = [
|
const links = [
|
||||||
{ label: formatMessage(labels.dashboard), url: renderTeamUrl('/dashboard') },
|
{ label: formatMessage(labels.dashboard), url: renderTeamUrl('/dashboard') },
|
||||||
|
|
@ -27,106 +18,32 @@ export function NavBar() {
|
||||||
{ label: formatMessage(labels.settings), url: renderTeamUrl('/settings') },
|
{ label: formatMessage(labels.settings), url: renderTeamUrl('/settings') },
|
||||||
].filter(n => n);
|
].filter(n => n);
|
||||||
|
|
||||||
const menuItems = [
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.dashboard),
|
|
||||||
url: renderTeamUrl('/dashboard'),
|
|
||||||
},
|
|
||||||
!cloudMode && {
|
|
||||||
label: formatMessage(labels.settings),
|
|
||||||
url: renderTeamUrl('/settings'),
|
|
||||||
children: [
|
|
||||||
...(teamId
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.team),
|
|
||||||
url: renderTeamUrl('/settings/team'),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.websites),
|
|
||||||
url: renderTeamUrl('/settings/websites'),
|
|
||||||
},
|
|
||||||
...(!teamId
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.teams),
|
|
||||||
url: renderTeamUrl('/settings/teams'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.users),
|
|
||||||
url: '/settings/users',
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.members),
|
|
||||||
url: renderTeamUrl('/settings/members'),
|
|
||||||
},
|
|
||||||
]),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: formatMessage(labels.profile),
|
|
||||||
url: '/profile',
|
|
||||||
},
|
|
||||||
!cloudMode && { label: formatMessage(labels.logout), url: '/logout' },
|
|
||||||
].filter(n => n);
|
|
||||||
|
|
||||||
const handleTeamChange = (teamId: string) => {
|
|
||||||
const url = teamId ? `/teams/${teamId}` : '/';
|
|
||||||
if (!cloudMode) {
|
|
||||||
setItem('umami.team', { id: teamId });
|
|
||||||
}
|
|
||||||
router.push(cloudMode ? `${process.env.cloudUrl}${url}` : url);
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (!cloudMode) {
|
|
||||||
const teamIdLocal = getItem('umami.team')?.id;
|
|
||||||
|
|
||||||
if (teamIdLocal && teamIdLocal !== teamId) {
|
|
||||||
router.push(
|
|
||||||
pathname !== '/' && pathname !== '/dashboard' ? '/' : `/teams/${teamIdLocal}/dashboard`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [cloudMode]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.navbar}>
|
<Row justifyContent="space-between" alignItems="center" paddingX="4" paddingY="3">
|
||||||
<div className={styles.logo}>
|
<Row alignItems="center" gap="3">
|
||||||
<Icon size="lg">
|
<Icon size="md">
|
||||||
<Icons.Logo />
|
<Icons.Logo />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>umami</Text>
|
<Text size="3" weight="bold">
|
||||||
</div>
|
umami
|
||||||
<div className={styles.links}>
|
</Text>
|
||||||
|
</Row>
|
||||||
|
<Row gap="4">
|
||||||
{links.map(({ url, label }) => {
|
{links.map(({ url, label }) => {
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link key={url} href={url} prefetch={url !== '/settings'}>
|
||||||
key={url}
|
|
||||||
href={url}
|
|
||||||
className={classNames({ [styles.selected]: pathname.startsWith(url) })}
|
|
||||||
prefetch={url !== '/settings'}
|
|
||||||
>
|
|
||||||
<Text>{label}</Text>
|
<Text>{label}</Text>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</Row>
|
||||||
<div className={styles.actions}>
|
<Row justifyContent="flex-end">
|
||||||
<TeamsButton onChange={handleTeamChange} />
|
<TeamsButton />
|
||||||
<ThemeButton />
|
<ThemeButton />
|
||||||
<LanguageButton />
|
<LanguageButton />
|
||||||
<ProfileButton />
|
<ProfileButton />
|
||||||
</div>
|
</Row>
|
||||||
<div className={styles.mobile}>
|
</Row>
|
||||||
<TeamsButton onChange={handleTeamChange} showText={false} />
|
|
||||||
<HamburgerButton menuItems={menuItems} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
.notice {
|
|
||||||
position: absolute;
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 800px;
|
|
||||||
gap: 20px;
|
|
||||||
margin: 60px auto;
|
|
||||||
align-self: center;
|
|
||||||
background: var(--base50);
|
|
||||||
padding: 20px;
|
|
||||||
border: 1px solid var(--base300);
|
|
||||||
border-radius: var(--border-radius);
|
|
||||||
z-index: 9999;
|
|
||||||
box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
.message {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
color: var(--font-color100);
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: flex-end;
|
|
||||||
gap: 10px;
|
|
||||||
flex: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 992px) {
|
|
||||||
.message {
|
|
||||||
height: 80px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
import { useEffect, useCallback, useState } from 'react';
|
import { useEffect, useCallback, useState } from 'react';
|
||||||
import { createPortal } from 'react-dom';
|
import { Button, AlertBanner, Flexbox } from '@umami/react-zen';
|
||||||
import { Button } from 'react-basics';
|
|
||||||
import { setItem } from '@/lib/storage';
|
import { setItem } from '@/lib/storage';
|
||||||
import useStore, { checkVersion } from '@/store/version';
|
import useStore, { checkVersion } from '@/store/version';
|
||||||
import { REPO_URL, VERSION_CHECK } from '@/lib/constants';
|
import { REPO_URL, VERSION_CHECK } from '@/lib/constants';
|
||||||
import { useMessages } from '@/components/hooks';
|
import { useMessages } from '@/components/hooks';
|
||||||
import { usePathname } from 'next/navigation';
|
import { usePathname } from 'next/navigation';
|
||||||
import styles from './UpdateNotice.module.css';
|
|
||||||
|
|
||||||
export function UpdateNotice({ user, config }) {
|
export function UpdateNotice({ user, config }) {
|
||||||
const { formatMessage, labels, messages } = useMessages();
|
const { formatMessage, labels, messages } = useMessages();
|
||||||
|
|
@ -47,19 +45,15 @@ export function UpdateNotice({ user, config }) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return createPortal(
|
return (
|
||||||
<div className={styles.notice}>
|
<Flexbox justifyContent="space-between" alignItems="center">
|
||||||
<div className={styles.message}>
|
<AlertBanner title={formatMessage(messages.newVersionAvailable, { version: `v${latest}` })}>
|
||||||
{formatMessage(messages.newVersionAvailable, { version: `v${latest}` })}
|
<Button variant="primary" onPress={handleViewClick}>
|
||||||
</div>
|
|
||||||
<div className={styles.buttons}>
|
|
||||||
<Button variant="primary" onClick={handleViewClick}>
|
|
||||||
{formatMessage(labels.viewDetails)}
|
{formatMessage(labels.viewDetails)}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleDismissClick}>{formatMessage(labels.dismiss)}</Button>
|
<Button onPress={handleDismissClick}>{formatMessage(labels.dismiss)}</Button>
|
||||||
</div>
|
</AlertBanner>
|
||||||
</div>,
|
</Flexbox>
|
||||||
document.body,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
3
src/app/(main)/boards/BoardsPage.tsx
Normal file
3
src/app/(main)/boards/BoardsPage.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default function BoardsPage() {
|
||||||
|
return <h1>hi.</h1>;
|
||||||
|
}
|
||||||
10
src/app/(main)/boards/page.tsx
Normal file
10
src/app/(main)/boards/page.tsx
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import BoardsPage from './BoardsPage';
|
||||||
|
import { Metadata } from 'next';
|
||||||
|
|
||||||
|
export default function () {
|
||||||
|
return <BoardsPage />;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const metadata: Metadata = {
|
||||||
|
title: 'Boards',
|
||||||
|
};
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
.layout {
|
|
||||||
display: grid;
|
|
||||||
grid-template-rows: max-content 1fr;
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav {
|
|
||||||
height: 60px;
|
|
||||||
width: 100vw;
|
|
||||||
grid-column: 1;
|
|
||||||
grid-row: 1 / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.body {
|
|
||||||
grid-column: 1;
|
|
||||||
grid-row: 2 / 3;
|
|
||||||
min-height: 0;
|
|
||||||
height: calc(100vh - 60px);
|
|
||||||
height: calc(100dvh - 60px);
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
@ -1,22 +1,8 @@
|
||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
import App from './App';
|
import App from './App';
|
||||||
import NavBar from './NavBar';
|
|
||||||
import Page from '@/components/layout/Page';
|
|
||||||
import styles from './layout.module.css';
|
|
||||||
|
|
||||||
export default async function ({ children }) {
|
export default async function ({ children }) {
|
||||||
return (
|
return <App>{children}</App>;
|
||||||
<App>
|
|
||||||
<main className={styles.layout}>
|
|
||||||
<nav className={styles.nav}>
|
|
||||||
<NavBar />
|
|
||||||
</nav>
|
|
||||||
<section className={styles.body}>
|
|
||||||
<Page>{children}</Page>
|
|
||||||
</section>
|
|
||||||
</main>
|
|
||||||
</App>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import WebsiteDetailsPage from './WebsiteDetailsPage';
|
import WebsiteDetailsPage from './WebsiteDetailsPage';
|
||||||
import { Metadata } from 'next';
|
import { Metadata } from 'next';
|
||||||
|
|
||||||
export default async function WebsitePage({ params }: { params: { websiteId: string } }) {
|
export default async function WebsitePage({ params }: { params: Promise<{ websiteId: string }> }) {
|
||||||
const { websiteId } = await params;
|
const { websiteId } = await params;
|
||||||
|
|
||||||
return <WebsiteDetailsPage websiteId={websiteId} />;
|
return <WebsiteDetailsPage websiteId={websiteId} />;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
'use client';
|
'use client';
|
||||||
import { IntlProvider } from 'react-intl';
|
import { IntlProvider } from 'react-intl';
|
||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactBasicsProvider } from 'react-basics';
|
import { ZenProvider } from '@umami/react-zen';
|
||||||
import ErrorBoundary from '@/components/common/ErrorBoundary';
|
import ErrorBoundary from '@/components/common/ErrorBoundary';
|
||||||
import { useLocale } from '@/components/hooks';
|
import { useLocale } from '@/components/hooks';
|
||||||
import 'chartjs-adapter-date-fns';
|
import 'chartjs-adapter-date-fns';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
|
import { useRouter } from 'next/navigation';
|
||||||
|
import { RouterProvider } from 'react-aria-components';
|
||||||
|
|
||||||
const client = new QueryClient({
|
const client = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
|
|
@ -32,14 +34,18 @@ function MessagesProvider({ children }) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Providers({ children }) {
|
export function Providers({ children }) {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MessagesProvider>
|
<ZenProvider>
|
||||||
<QueryClientProvider client={client}>
|
<RouterProvider navigate={router.push}>
|
||||||
<ReactBasicsProvider>
|
<MessagesProvider>
|
||||||
<ErrorBoundary>{children}</ErrorBoundary>
|
<QueryClientProvider client={client}>
|
||||||
</ReactBasicsProvider>
|
<ErrorBoundary>{children}</ErrorBoundary>
|
||||||
</QueryClientProvider>
|
</QueryClientProvider>
|
||||||
</MessagesProvider>
|
</MessagesProvider>
|
||||||
|
</RouterProvider>
|
||||||
|
</ZenProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import '@fontsource/inter/300.css';
|
||||||
import '@fontsource/inter/400.css';
|
import '@fontsource/inter/400.css';
|
||||||
import '@fontsource/inter/500.css';
|
import '@fontsource/inter/500.css';
|
||||||
import '@fontsource/inter/700.css';
|
import '@fontsource/inter/700.css';
|
||||||
import 'react-basics/dist/styles.css';
|
import '@umami/react-zen/styles.css';
|
||||||
import '@/styles/index.css';
|
import '@/styles/global.css';
|
||||||
import '@/styles/variables.css';
|
import '@/styles/variables.css';
|
||||||
|
|
||||||
export default function ({ children }) {
|
export default function ({ children }) {
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,16 @@ import { useMessages } from '@/components/hooks';
|
||||||
import styles from './Pager.module.css';
|
import styles from './Pager.module.css';
|
||||||
|
|
||||||
export interface PagerProps {
|
export interface PagerProps {
|
||||||
page: number;
|
page: string | number;
|
||||||
pageSize: number;
|
pageSize: string | number;
|
||||||
count: number;
|
count: string | number;
|
||||||
onPageChange: (nextPage: number) => void;
|
onPageChange: (nextPage: number) => void;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Pager({ page, pageSize, count, onPageChange, className }: PagerProps) {
|
export function Pager({ page, pageSize, count, onPageChange, className }: PagerProps) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const maxPage = pageSize && count ? Math.ceil(count / pageSize) : 0;
|
const maxPage = pageSize && count ? Math.ceil(+count / +pageSize) : 0;
|
||||||
const lastPage = page === maxPage;
|
const lastPage = page === maxPage;
|
||||||
const firstPage = page === 1;
|
const firstPage = page === 1;
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ export function Pager({ page, pageSize, count, onPageChange, className }: PagerP
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlePageChange = (value: number) => {
|
const handlePageChange = (value: number) => {
|
||||||
const nextPage = page + value;
|
const nextPage = +page + +value;
|
||||||
|
|
||||||
if (nextPage > 0 && nextPage <= maxPage) {
|
if (nextPage > 0 && nextPage <= maxPage) {
|
||||||
onPageChange(nextPage);
|
onPageChange(nextPage);
|
||||||
|
|
|
||||||
|
|
@ -1,52 +1,42 @@
|
||||||
import { Icon, Button, PopupTrigger, Popup } from 'react-basics';
|
import { Icon, Button, MenuTrigger, Popover, Grid, Text, Dialog } from '@umami/react-zen';
|
||||||
import classNames from 'classnames';
|
|
||||||
import { languages } from '@/lib/lang';
|
import { languages } from '@/lib/lang';
|
||||||
import { useLocale } from '@/components/hooks';
|
import { useLocale } from '@/components/hooks';
|
||||||
import Icons from '@/components/icons';
|
import Icons from '@/components/icons';
|
||||||
import styles from './LanguageButton.module.css';
|
|
||||||
|
|
||||||
export function LanguageButton() {
|
export function LanguageButton() {
|
||||||
const { locale, saveLocale, dir } = useLocale();
|
const { locale, saveLocale } = useLocale();
|
||||||
const items = Object.keys(languages).map(key => ({ ...languages[key], value: key }));
|
const items = Object.keys(languages).map(key => ({ ...languages[key], value: key }));
|
||||||
|
|
||||||
function handleSelect(value: string, close: () => void, e: MouseEvent) {
|
function handleSelect(value: string) {
|
||||||
e.stopPropagation();
|
|
||||||
saveLocale(value);
|
saveLocale(value);
|
||||||
close();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopupTrigger>
|
<MenuTrigger key="language">
|
||||||
<Button variant="quiet">
|
<Button variant="quiet">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Globe />
|
<Icons.Globe />
|
||||||
</Icon>
|
</Icon>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup position="bottom" alignment={dir === 'rtl' ? 'start' : 'end'}>
|
<Popover placement="bottom end">
|
||||||
{(close: () => void) => {
|
<Dialog variant="menu">
|
||||||
return (
|
<Grid columns="repeat(3, minmax(200px, 1fr))" overflow="hidden">
|
||||||
<div className={styles.menu}>
|
{items.map(({ value, label }) => {
|
||||||
{items.map(({ value, label }) => {
|
return (
|
||||||
return (
|
<Button key={value} variant="quiet" onPress={() => handleSelect(value)}>
|
||||||
<div
|
<Text
|
||||||
key={value}
|
weight={value === locale ? 'bold' : 'normal'}
|
||||||
className={classNames(styles.item, { [styles.selected]: value === locale })}
|
color={value === locale ? 'primary' : 'muted'}
|
||||||
onClick={(e: any) => handleSelect(value, close, e)}
|
|
||||||
>
|
>
|
||||||
<span lang={value}>{label}</span>
|
{label}
|
||||||
{value === locale && (
|
</Text>
|
||||||
<Icon className={styles.icon}>
|
</Button>
|
||||||
<Icons.Check />
|
);
|
||||||
</Icon>
|
})}
|
||||||
)}
|
</Grid>
|
||||||
</div>
|
</Dialog>
|
||||||
);
|
</Popover>
|
||||||
})}
|
</MenuTrigger>
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
</Popup>
|
|
||||||
</PopupTrigger>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,63 @@
|
||||||
import { Key } from 'react';
|
import { Key } from 'react';
|
||||||
import { Icon, Button, PopupTrigger, Popup, Menu, Item, Text } from 'react-basics';
|
import {
|
||||||
|
Icon,
|
||||||
|
Button,
|
||||||
|
MenuTrigger,
|
||||||
|
Popover,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
MenuSeparator,
|
||||||
|
MenuSection,
|
||||||
|
Text,
|
||||||
|
} from '@umami/react-zen';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import Icons from '@/components/icons';
|
import Icons from '@/components/icons';
|
||||||
import { useMessages, useLogin, useLocale } from '@/components/hooks';
|
import { useMessages, useLogin } from '@/components/hooks';
|
||||||
import { CURRENT_VERSION } from '@/lib/constants';
|
|
||||||
import styles from './ProfileButton.module.css';
|
|
||||||
|
|
||||||
export function ProfileButton() {
|
export function ProfileButton() {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { user } = useLogin();
|
const { user } = useLogin();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { dir } = useLocale();
|
|
||||||
const cloudMode = !!process.env.cloudMode;
|
const cloudMode = !!process.env.cloudMode;
|
||||||
|
|
||||||
const handleSelect = (key: Key, close: () => void) => {
|
const handleSelect = (key: Key) => {
|
||||||
if (key === 'profile') {
|
if (key === 'profile') {
|
||||||
router.push('/profile');
|
router.push('/profile');
|
||||||
}
|
}
|
||||||
if (key === 'logout') {
|
if (key === 'logout') {
|
||||||
router.push('/logout');
|
router.push('/logout');
|
||||||
}
|
}
|
||||||
close();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopupTrigger>
|
<MenuTrigger>
|
||||||
<Button data-test="button-profile" variant="quiet">
|
<Button data-test="button-profile" variant="quiet">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Profile />
|
<Icons.Profile />
|
||||||
</Icon>
|
</Icon>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup position="bottom" alignment={dir === 'rtl' ? 'start' : 'end'}>
|
<Popover placement="bottom end">
|
||||||
{(close: () => void) => (
|
<Menu autoFocus="last" onAction={handleSelect}>
|
||||||
<Menu onSelect={key => handleSelect(key, close)} className={styles.menu}>
|
<MenuSection title={user.username}>
|
||||||
<Text className={styles.name}>{user.username}</Text>
|
<MenuSeparator />
|
||||||
<Item key="profile" className={styles.item} divider={true}>
|
<MenuItem id="profile">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.User />
|
<Icons.User />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{formatMessage(labels.profile)}</Text>
|
<Text>{formatMessage(labels.profile)}</Text>
|
||||||
</Item>
|
</MenuItem>
|
||||||
{!cloudMode && (
|
{!cloudMode && (
|
||||||
<Item data-test="item-logout" key="logout" className={styles.item}>
|
<MenuItem data-test="item-logout" id="logout">
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Logout />
|
<Icons.Logout />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{formatMessage(labels.logout)}</Text>
|
<Text>{formatMessage(labels.logout)}</Text>
|
||||||
</Item>
|
</MenuItem>
|
||||||
)}
|
)}
|
||||||
<div className={styles.version}>{`v${CURRENT_VERSION}`}</div>
|
</MenuSection>
|
||||||
</Menu>
|
</Menu>
|
||||||
)}
|
</Popover>
|
||||||
</Popup>
|
</MenuTrigger>
|
||||||
</PopupTrigger>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,45 @@
|
||||||
import { Key } from 'react';
|
import { useState } from 'react';
|
||||||
import { Text, Icon, Button, Popup, Menu, Item, PopupTrigger, Flexbox } from 'react-basics';
|
import type { Selection } from 'react-aria-components';
|
||||||
import classNames from 'classnames';
|
import { useRouter } from 'next/navigation';
|
||||||
|
import {
|
||||||
|
Text,
|
||||||
|
Icon,
|
||||||
|
Button,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
MenuTrigger,
|
||||||
|
MenuSection,
|
||||||
|
MenuSeparator,
|
||||||
|
Popover,
|
||||||
|
Row,
|
||||||
|
Box,
|
||||||
|
} from '@umami/react-zen';
|
||||||
import Icons from '@/components/icons';
|
import Icons from '@/components/icons';
|
||||||
import { useLogin, useMessages, useTeams, useTeamUrl } from '@/components/hooks';
|
import { useLogin, useMessages, useTeams, useTeamUrl } from '@/components/hooks';
|
||||||
import styles from './TeamsButton.module.css';
|
|
||||||
|
|
||||||
export function TeamsButton({
|
export function TeamsButton({
|
||||||
className,
|
className,
|
||||||
showText = true,
|
showText = true,
|
||||||
onChange,
|
|
||||||
}: {
|
}: {
|
||||||
className?: string;
|
className?: string;
|
||||||
showText?: boolean;
|
showText?: boolean;
|
||||||
onChange?: (value: string) => void;
|
|
||||||
}) {
|
}) {
|
||||||
const { user } = useLogin();
|
const { user } = useLogin();
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { result } = useTeams(user.id);
|
const { result } = useTeams(user.id);
|
||||||
const { teamId } = useTeamUrl();
|
const { teamId } = useTeamUrl();
|
||||||
|
const router = useRouter();
|
||||||
const team = result?.data?.find(({ id }) => id === teamId);
|
const team = result?.data?.find(({ id }) => id === teamId);
|
||||||
|
const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set([teamId || user.id]));
|
||||||
|
|
||||||
const handleSelect = (close: () => void, id: Key) => {
|
const handleSelect = (keys: Set<string>) => {
|
||||||
onChange?.((id !== user.id ? id : '') as string);
|
if (keys.size > 0) {
|
||||||
close();
|
const [id] = [...keys];
|
||||||
|
|
||||||
|
router.push(id === user.id ? '/dashboard' : `/teams/${id}/dashboard`);
|
||||||
|
|
||||||
|
setSelectedKeys(keys);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!result?.count) {
|
if (!result?.count) {
|
||||||
|
|
@ -30,41 +47,47 @@ export function TeamsButton({
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PopupTrigger>
|
<MenuTrigger>
|
||||||
<Button className={classNames(styles.button, className)} variant="quiet">
|
<Button className={className} variant="quiet">
|
||||||
<Icon>{teamId ? <Icons.Users /> : <Icons.User />}</Icon>
|
<Row alignItems="center" gap="3">
|
||||||
{showText && <Text>{teamId ? team?.name : user.username}</Text>}
|
<Icon>{teamId ? <Icons.Users /> : <Icons.User />}</Icon>
|
||||||
<Icon>
|
{showText && <Text weight="bold">{teamId ? team?.name : user.username}</Text>}
|
||||||
<Icons.ChevronDown />
|
<Icon>
|
||||||
</Icon>
|
<Icons.ChevronDown />
|
||||||
|
</Icon>
|
||||||
|
</Row>
|
||||||
</Button>
|
</Button>
|
||||||
<Popup alignment="end">
|
<Popover placement="bottom end">
|
||||||
{(close: () => void) => (
|
<Box minWidth={300}>
|
||||||
<Menu className={styles.menu} variant="popup" onSelect={handleSelect.bind(null, close)}>
|
<Menu
|
||||||
<div className={styles.heading}>{formatMessage(labels.myAccount)}</div>
|
selectionMode="single"
|
||||||
<Item key={user.id} className={classNames({ [styles.selected]: !teamId })}>
|
selectedKeys={selectedKeys}
|
||||||
<Flexbox gap={10} alignItems="center">
|
autoFocus="last"
|
||||||
|
onSelectionChange={keys => handleSelect(keys as Set<string>)}
|
||||||
|
>
|
||||||
|
<MenuSection title={formatMessage(labels.myAccount)}>
|
||||||
|
<MenuItem id={user.id}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.User />
|
<Icons.User />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{user.username}</Text>
|
<Text wrap="nowrap">{user.username}</Text>
|
||||||
</Flexbox>
|
</MenuItem>
|
||||||
</Item>
|
</MenuSection>
|
||||||
<div className={styles.heading}>{formatMessage(labels.team)}</div>
|
<MenuSeparator />
|
||||||
{result?.data?.map(({ id, name }) => (
|
<MenuSection title={formatMessage(labels.teams)}>
|
||||||
<Item key={id} className={classNames({ [styles.selected]: id === teamId })}>
|
{result?.data?.map(({ id, name }) => (
|
||||||
<Flexbox gap={10} alignItems="center">
|
<MenuItem key={id} id={id}>
|
||||||
<Icon>
|
<Icon size="sm">
|
||||||
<Icons.Users />
|
<Icons.Users />
|
||||||
</Icon>
|
</Icon>
|
||||||
<Text>{name}</Text>
|
<Text wrap="nowrap">{name}</Text>
|
||||||
</Flexbox>
|
</MenuItem>
|
||||||
</Item>
|
))}
|
||||||
))}
|
</MenuSection>
|
||||||
</Menu>
|
</Menu>
|
||||||
)}
|
</Box>
|
||||||
</Popup>
|
</Popover>
|
||||||
</PopupTrigger>
|
</MenuTrigger>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
.button {
|
|
||||||
width: 50px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button > div {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
position: absolute;
|
|
||||||
}
|
|
||||||
|
|
@ -1,38 +0,0 @@
|
||||||
import { useTransition, animated } from '@react-spring/web';
|
|
||||||
import { Button, Icon } from 'react-basics';
|
|
||||||
import { useTheme } from '@/components/hooks';
|
|
||||||
import Icons from '@/components/icons';
|
|
||||||
import styles from './ThemeButton.module.css';
|
|
||||||
|
|
||||||
export function ThemeButton() {
|
|
||||||
const { theme, saveTheme } = useTheme();
|
|
||||||
|
|
||||||
const transitions = useTransition(theme, {
|
|
||||||
initial: { opacity: 1 },
|
|
||||||
from: {
|
|
||||||
opacity: 0,
|
|
||||||
transform: `translateY(${theme === 'light' ? '20px' : '-20px'}) scale(0.5)`,
|
|
||||||
},
|
|
||||||
enter: { opacity: 1, transform: 'translateY(0px) scale(1.0)' },
|
|
||||||
leave: {
|
|
||||||
opacity: 0,
|
|
||||||
transform: `translateY(${theme === 'light' ? '-20px' : '20px'}) scale(0.5)`,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleClick() {
|
|
||||||
saveTheme(theme === 'light' ? 'dark' : 'light');
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Button variant="quiet" className={styles.button} onClick={handleClick}>
|
|
||||||
{transitions((style, item) => (
|
|
||||||
<animated.div key={item} style={style}>
|
|
||||||
<Icon>{item === 'light' ? <Icons.Sun /> : <Icons.Moon />}</Icon>
|
|
||||||
</animated.div>
|
|
||||||
))}
|
|
||||||
</Button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ThemeButton;
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
import { ReactNode } from 'react';
|
import { ReactNode } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Banner, Loading } from 'react-basics';
|
import { AlertBanner, Loading } from '@umami/react-zen';
|
||||||
import { useMessages } from '@/components/hooks';
|
import { useMessages } from '@/components/hooks';
|
||||||
import styles from './Page.module.css';
|
import styles from './Page.module.css';
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function Page({
|
||||||
const { formatMessage, messages } = useMessages();
|
const { formatMessage, messages } = useMessages();
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return <Banner variant="error">{formatMessage(messages.error)}</Banner>;
|
return <AlertBanner title={formatMessage(messages.error)} variant="error" />;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
|
|
|
||||||
48
src/styles/global.css
Normal file
48
src/styles/global.css
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
html,
|
||||||
|
body {
|
||||||
|
font-family: var(--font-family), sans-serif;
|
||||||
|
color: var(--font-color);
|
||||||
|
font-size: var(--font-size);
|
||||||
|
background-color: var(--background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
a,
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
color: var(--font-color);
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
shape-rendering: geometricPrecision;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 15px;
|
||||||
|
background: var(--background-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-track {
|
||||||
|
border: 7px solid rgba(0, 0, 0, 0);
|
||||||
|
background-color: var(--border-color);
|
||||||
|
background-clip: padding-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body::-webkit-scrollbar-track,
|
||||||
|
main::-webkit-scrollbar-track {
|
||||||
|
background-color: var(--border-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
border: 7px solid rgba(0, 0, 0, 0);
|
||||||
|
background-color: var(--font-color);
|
||||||
|
background-clip: padding-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb:hover {
|
||||||
|
border: 4px solid rgba(0, 0, 0, 0);
|
||||||
|
background-color: var(--font-color);
|
||||||
|
background-clip: padding-box;
|
||||||
|
}
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
html,
|
|
||||||
body {
|
|
||||||
font-family: Inter, sans-serif;
|
|
||||||
font-size: 14px;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: 1.5rem;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
min-height: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
color: var(--font-color100);
|
|
||||||
background: var(--base50);
|
|
||||||
}
|
|
||||||
|
|
||||||
*,
|
|
||||||
*:before,
|
|
||||||
*:after {
|
|
||||||
box-sizing: inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
font-weight: 400;
|
|
||||||
line-height: 30px;
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
a,
|
|
||||||
a:active,
|
|
||||||
a:visited {
|
|
||||||
color: var(--primary400);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
line-height: 1.8rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
main {
|
|
||||||
flex: 1;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
svg {
|
|
||||||
shape-rendering: geometricPrecision;
|
|
||||||
}
|
|
||||||
|
|
||||||
#__next {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
|
||||||
width: 15px;
|
|
||||||
background: var(--base50);
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-track {
|
|
||||||
border: 7px solid rgba(0, 0, 0, 0);
|
|
||||||
background-color: var(--base300);
|
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
body::-webkit-scrollbar-track,
|
|
||||||
main::-webkit-scrollbar-track {
|
|
||||||
background-color: var(--base50);
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb {
|
|
||||||
border: 7px solid rgba(0, 0, 0, 0);
|
|
||||||
background-color: var(--base600);
|
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb:hover {
|
|
||||||
border: 4px solid rgba(0, 0, 0, 0);
|
|
||||||
background-color: var(--base800);
|
|
||||||
background-clip: padding-box;
|
|
||||||
}
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--dark50: #111111;
|
|
||||||
--dark75: #191919;
|
|
||||||
--dark100: #222222;
|
|
||||||
--dark150: #2a2a2a;
|
|
||||||
--dark200: #313131;
|
|
||||||
--dark300: #3a3a3a;
|
|
||||||
--dark400: #484848;
|
|
||||||
--dark500: #606060;
|
|
||||||
--dark600: #6e6e6e;
|
|
||||||
--dark700: #7b7b7b;
|
|
||||||
--dark800: #b4b4b4;
|
|
||||||
--dark900: #eeeeee;
|
|
||||||
}
|
|
||||||
|
|
@ -1,13 +1,3 @@
|
||||||
html body {
|
html body {
|
||||||
--primary400: var(--blue800);
|
--primary-color: var(--accent-color-blue);
|
||||||
--primary500: var(--blue900);
|
|
||||||
--primary600: var(--blue1000);
|
|
||||||
--primary700: var(--blue1100);
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme='dark'] {
|
|
||||||
--primary400: var(--blue600);
|
|
||||||
--primary500: var(--blue700);
|
|
||||||
--primary600: var(--blue800);
|
|
||||||
--primary700: var(--blue900);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue