From dbdc9aef9ccb787c4ecbf03f14f384c0eaafb7eb Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Fri, 1 Dec 2023 17:03:41 +0000 Subject: [PATCH] Better demo (#17) --- README.md | 6 +- package-lock.json | 8 +- packages/fastui-bootstrap/package.json | 4 +- packages/fastui-bootstrap/src/index.tsx | 11 +- packages/fastui-prebuilt/package.json | 2 +- packages/fastui-prebuilt/src/main.scss | 34 ++- packages/fastui/package.json | 2 +- .../fastui/src/components/MarkdownLazy.tsx | 25 +- packages/fastui/src/components/ServerLoad.tsx | 19 +- packages/fastui/src/components/heading.tsx | 3 +- packages/fastui/src/hooks/locationContext.tsx | 8 +- packages/fastui/src/tools.ts | 9 + pyproject.toml | 2 +- python/demo/__init__.py | 4 + python/demo/components_list.py | 188 +++++++++++++ python/demo/forms.py | 175 ++++++++++++ python/demo/main.py | 262 ++---------------- python/demo/shared.py | 42 ++- python/demo/tables.py | 137 ++++----- python/fastui/__init__.py | 4 +- python/fastui/forms.py | 4 + python/fastui/json_schema.py | 10 +- python/requirements/pyproject.txt | 9 +- 23 files changed, 596 insertions(+), 372 deletions(-) create mode 100644 python/demo/components_list.py create mode 100644 python/demo/forms.py diff --git a/README.md b/README.md index 27131f5c..8ff91036 100644 --- a/README.md +++ b/README.md @@ -119,14 +119,14 @@ Of course, that's a very simple application, the [full demo](https://fastui-demo ### Components -FastUI already defines the following components: +FastUI already defines the following components, all are shown in the [demo app](https://fastui-demo.onrender.com): - `Text` - renders a string - `Paragraph` - renders a string as a paragraph - `PageTitle` - renders nothing, sets the HTML page title - `Div` - renders a `
` with arbitrary components inside -- `Page` - a container for components, [example](https://fastui-demo.onrender.com) -- `Heading` - renders a heading `

` to `

`, [example](https://fastui-demo.onrender.com) +- `Page` - a container for components +- `Heading` - renders a heading `

` to `

` - `Markdown` - renders markdown, [example](https://fastui-demo.onrender.com) - `Code` - renders code with highlighting in a `
`
 - `Button` - renders a `