Compare commits

...

8 commits

16 changed files with 95 additions and 23 deletions

3
.gitignore vendored
View file

@ -12,4 +12,5 @@ yarn-error.log*
pnpm-lock.yaml
dist
dist
build

View file

@ -7,7 +7,12 @@
"typescript": "^5.5.3"
},
"scripts": {
"showcase": "pnpm --filter showcase run"
"showcase": "pnpm --filter showcase run",
"core": "pnpm --filter core run"
},
"private": true
"private": true,
"workspaces": [
"packages/core",
"src/core"
]
}

View file

@ -3,9 +3,21 @@
"version": "0.0.0",
"description": "Thunder Network's Dynamic Design",
"license": "MIT",
"author": "Thunder Network RaD | KillerBossOriginal",
"author": {
"name": "Thunder Network Research and Development",
"email": "thundernetwork.org@gmail.com",
"url": "https://thundernetwork.org"
},
"contributors": [
{
"name": "KillerBossOriginal",
"email": "KillerBossOriginal@outlook.it",
"url": "https://source.thundernetwork.org/KillerBossOriginal"
}
],
"main": "dist/index.js",
"scripts": {
"build": "tsc && sass styles build"
"build": "tsc && sass src/styles:build"
},
"keywords": [
"components",

View file

@ -1,26 +1,18 @@
"use client";
import {CursorProvider, CursorProviderProps} from "./Cursor";
import {ThemeProvider} from "./Theme";
import Theme from "../types/theme";
import {defaultTheme} from "../index";
import {NavigationProvider, NavigationProviderProps} from "./Navigation";
import { ThemeProvider } from "@core/components/Theme";
import Theme from "@core/types/theme";
import { defaultTheme } from "@core/index";
interface DynamicProviderProps {
cursor?: CursorProviderProps,
theme?: Theme,
children: React.ReactNode,
selector?: NavigationProviderProps
children: React.ReactNode
}
export function DynamicProvider({ children, cursor, theme, selector }: DynamicProviderProps) {
export function DynamicProvider({ children, theme }: DynamicProviderProps) {
const actualTheme = theme || defaultTheme
return (
<ThemeProvider defaultTheme={actualTheme}>
<CursorProvider hidden={cursor?.hidden || true} exists={cursor?.exists || false} cursor={cursor?.cursor}>
<NavigationProvider defaultCoords={selector?.defaultCoords}>
{children}
</NavigationProvider>
</CursorProvider>
{children}
</ThemeProvider>
);
}

View file

@ -1,5 +1,10 @@
import Theme from "@core/types/theme";
import { DynamicProvider } from "./components/DynamicProvider";
export const defaultTheme: Theme = {
colorScheme: "light"
}
export {
DynamicProvider
}

View file

@ -0,0 +1,17 @@
// Geist
@font-face {
font-style: normal;
font-weight: 100 900;
src: url("fonts/geist.woff2") format("woff2");
font-family: "Geist";
font-display: swap;
}
// Geist Mono
@font-face {
font-style: normal;
font-weight: 100 900;
src: url("fonts/geist-mono.woff2") format("woff2");
font-family: "Geist Mono";
font-display: swap;
}

View file

@ -0,0 +1,4 @@
// Converts px values to rem
@function rpx($px-value) {
@return ($px-value / 16) + rem;
}

View file

@ -0,0 +1,27 @@
@use "functions" as *;
@mixin theme-variables {
:root {
@content ("light");
}
[data-theme="dark"] {
@content ("dark");
}
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
@content ("dark");
}
}
}
@include theme-variables using ($theme) {
@if $theme == "dark" {
--color: #fff;
}
else {
--color: #000;
}
}

View file

@ -0,0 +1,4 @@
@use "components/variables";
@use "components/fonts";
@use "components/typography";

View file

@ -26,4 +26,4 @@ export function NavigationProvider({ children, defaultCoords }: NavigationProvid
export function useNavigation() {
return useContext(NavigationContext);
}
}

Binary file not shown.

Before

Width: 256px  |  Height: 256px  |  Size: 25 KiB

After

Width: 256px  |  Height: 256px  |  Size: 21 KiB

View file

@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { DynamicProvider } from "@dynamic/core";
const geistSans = Geist({
variable: "--font-geist-sans",
@ -25,7 +26,9 @@ export default function RootLayout({
return (
<html lang="en">
<body className={`${geistSans.variable} ${geistMono.variable}`}>
{children}
<DynamicProvider>
{children}
</DynamicProvider>
</body>
</html>
);

View file

@ -1,4 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
@ -19,7 +20,8 @@
}
],
"paths": {
"@/*": ["./*"]
"@/*": ["./*"],
"@dynamic/core": ["../core/src/index"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],

View file

@ -6,7 +6,7 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"outDir": "dist",
"outDir": "build",
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"],