export joy from a different dir

This commit is contained in:
Zai Shi 2024-04-14 14:22:48 +02:00
parent 5c1aaa7350
commit 9e6e92bbb9
7 changed files with 18 additions and 7 deletions

View File

@ -3,7 +3,8 @@
import React, { useState } from "react";
import { CssVarsProvider, getInitColorSchemeScript } from '@mui/joy/styles';
import CssBaseline from '@mui/joy/CssBaseline';
import { StackTheme, StackJoyTheme } from "@stackframe/stack";
import { StackTheme } from "@stackframe/stack";
import { StackJoyTheme } from "@stackframe/stack/joy";
type UI = 'default' | 'joy';
const CurrentUIContext = React.createContext<[UI, React.Dispatch<React.SetStateAction<UI>>]>(['default', () => {}]);

View File

@ -3,7 +3,8 @@
import React, { useState } from "react";
import { CssVarsProvider, getInitColorSchemeScript } from '@mui/joy/styles';
import CssBaseline from '@mui/joy/CssBaseline';
import { StackTheme, StackJoyTheme } from "@stackframe/stack";
import { StackTheme } from "@stackframe/stack";
import { StackJoyTheme } from "@stackframe/stack/joy";
import { Button } from "./custom-button";
type UI = 'default' | 'joy';

View File

@ -95,7 +95,8 @@ Replace `StackTheme` with `StackJoyTheme`, and put it inside your `CssVarsProvid
import React from "react";
import { CssVarsProvider, getInitColorSchemeScript } from '@mui/joy/styles';
import CssBaseline from '@mui/joy/CssBaseline';
import { StackProvider, StackJoyTheme } from "@stackframe/stack";
import { StackProvider } from "@stackframe/stack";
import StackJoyTheme from "@stackframe/stack/joy";
import Provider from "src/components/provider";
import { stackServerApp } from "src/stack";

View File

@ -1,6 +1,6 @@
import { StackProvider } from "@stackframe/stack";
import { stackServerApp } from "@/stack";
import { StackJoyTheme } from "@stackframe/stack";
import { StackJoyTheme } from "@stackframe/stack/joy";
export default function Layout(props: { children: React.ReactNode }) {
return (

View File

@ -2,8 +2,16 @@
"name": "@stackframe/stack",
"version": "2.2.1",
"type": "module",
"types": "./dist/index.d.ts",
"main": "./dist/index.js",
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./joy": {
"types": "./dist/joy.d.ts",
"default": "./dist/joy.js"
}
},
"scripts": {
"typecheck": "tsc --noEmit",
"build": "tsc",

View File

@ -22,5 +22,4 @@ export { default as AccountSettings } from "./components-page/account-settings";
export { useDesign } from './providers/design-provider';
export { useComponents } from './providers/component-provider';
export { StackTheme, ThemeConfig } from './providers/theme-provider';
export { StackJoyTheme } from './providers/joy-provider';
export * from './components-core';

View File

@ -0,0 +1 @@
export { StackJoyTheme } from './providers/joy-provider';