Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions src/npm-fastui-prebuilt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"name": "@pydantic/fastui-prebuilt",
"version": "0.0.11",
"description": "Pre-built files for FastUI",
"main": "dist/index.html",
"type": "module",
"author": "Samuel Colvin",
"license": "MIT",
"homepage": "https://github.com/pydantic/fastui",
Expand All @@ -16,7 +14,7 @@
"fastapi"
],
"scripts": {
"dev": "vite",
"dev": "vite preview",
"prepublishOnly": "rm -rf dist && tsc --noEmit && vite build",
"typecheck": "tsc --noEmit",
"typewatch": "tsc --noEmit --watch"
Expand Down
4 changes: 4 additions & 0 deletions src/npm-fastui-prebuilt/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { FastUI, renderClassName } from 'fastui'
import * as bootstrap from 'fastui-bootstrap'
import { FC, ReactNode } from 'react'

import { ThemeProvider, optoTheme} from "@optoinvest/opto-design-system"

export default function App() {
return (
<ThemeProvider theme={optoTheme}>
<div className="top-offset">
<FastUI
rootUrl="/api"
Expand All @@ -14,6 +17,7 @@ export default function App() {
Transition={Transition}
/>
</div>
</ThemeProvider>
)
}

Expand Down
2 changes: 1 addition & 1 deletion src/npm-fastui-prebuilt/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default () => {
host: true,
port: 3000,
proxy: {
'/api': 'http://localhost:8000',
'/api': 'http://127.0.0.1:8000',
},
}

Expand Down
4 changes: 3 additions & 1 deletion src/npm-fastui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@
"typewatch": "tsc --noEmit --watch"
},
"dependencies": {
"@optoinvest/opto-design-system": "^1.11.9",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-markdown": "^9.0.1",
"react-select": "^5.8.0",
"react-syntax-highlighter": "^15.5.0",
"remark-gfm": "^4.0.0"
"remark-gfm": "^4.0.0",
"styled-components": "^6.1.3"
},
"devDependencies": {
"@types/react-syntax-highlighter": "^15.5.10"
Expand Down
17 changes: 12 additions & 5 deletions src/npm-fastui/src/components/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { FC } from 'react'
import { ClassName, useClassName } from '../hooks/className'
import { useFireEvent, AnyEvent } from '../events'

// import * as design from "@optoinvest/opto-design-system" as any;
import { ArrowRightStroke, Button } from '@optoinvest/opto-design-system'

export interface ButtonProps {
type: 'Button'
text: string
Expand All @@ -16,9 +19,13 @@ export const ButtonComp: FC<ButtonProps> = (props) => {

const { fireEvent } = useFireEvent()

return (
<button className={useClassName(props)} type={htmlType} onClick={() => fireEvent(onClick)}>
{text}
</button>
)
return <Button text="I come from Opto's design system!" type={htmlType} onClick={() => fireEvent(onClick)} />

// return (<ArrowRightStroke/>)
//
// return (
// <button className={useClassName(props)} type={htmlType} onClick={() => fireEvent(onClick)}>
// {text}
// </button>
// )
}
1 change: 1 addition & 0 deletions src/npm-fastui/src/components/display.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const DisplayRender: FC<DisplayProps> = (props) => {
} else if (typeof value === 'object' && value !== null) {
return <DisplayObject type="DisplayObject" mode={mode} value={value} />
} else {
//@ts-ignore
return <DisplayPrimitive type="DisplayPrimitive" mode={mode} value={value} />
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/python-fastui/fastui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ def prebuilt_html(title: str = ''):
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{title}</title>

<!-- FROM HERE:-->
<script type="module" crossorigin src="{_PREBUILT_CDN_URL}/index.js"></script>
<link rel="stylesheet" crossorigin href="{_PREBUILT_CDN_URL}/index.css">
<!-- TO HERE-->

</head>
<body>
<div id="root"></div>
Expand Down
16 changes: 11 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@
"jsx": "react-jsx",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"strict": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": false,
"noUncheckedIndexedAccess": false,

"noImplicitAny": false,
"noImplicitThis": false,
"strictFunctionTypes": false,
"strictPropertyInitialization": false,
"strictNullChecks": false,

/* Output */
"declaration": true
Expand Down
Loading