kite-ui 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kite_ui-0.2.0/.gitignore +8 -0
- kite_ui-0.2.0/LICENSE +21 -0
- kite_ui-0.2.0/PKG-INFO +146 -0
- kite_ui-0.2.0/README.md +120 -0
- kite_ui-0.2.0/THIRD_PARTY_NOTICES.md +190 -0
- kite_ui-0.2.0/demo.py +167 -0
- kite_ui-0.2.0/islands/build.mjs +26 -0
- kite_ui-0.2.0/islands/notices.mjs +34 -0
- kite_ui-0.2.0/islands/package-lock.json +1451 -0
- kite_ui-0.2.0/islands/package.json +19 -0
- kite_ui-0.2.0/islands/src/docs.jsx +7 -0
- kite_ui-0.2.0/islands/src/main.jsx +75 -0
- kite_ui-0.2.0/kite/LICENSE +21 -0
- kite_ui-0.2.0/kite/THIRD_PARTY_NOTICES.md +190 -0
- kite_ui-0.2.0/kite/__init__.py +8 -0
- kite_ui-0.2.0/kite/__main__.py +51 -0
- kite_ui-0.2.0/kite/app.py +145 -0
- kite_ui-0.2.0/kite/components/__init__.py +10 -0
- kite_ui-0.2.0/kite/components/charts.py +103 -0
- kite_ui-0.2.0/kite/components/chrome.py +27 -0
- kite_ui-0.2.0/kite/components/code.py +49 -0
- kite_ui-0.2.0/kite/components/data.py +82 -0
- kite_ui-0.2.0/kite/components/display.py +300 -0
- kite_ui-0.2.0/kite/components/dock.py +68 -0
- kite_ui-0.2.0/kite/components/inputs.py +185 -0
- kite_ui-0.2.0/kite/components/islands.py +103 -0
- kite_ui-0.2.0/kite/components/layout.py +408 -0
- kite_ui-0.2.0/kite/components/nav.py +75 -0
- kite_ui-0.2.0/kite/core.py +168 -0
- kite_ui-0.2.0/kite/docsite.py +467 -0
- kite_ui-0.2.0/kite/export.py +378 -0
- kite_ui-0.2.0/kite/fonts.py +91 -0
- kite_ui-0.2.0/kite/icons.py +39 -0
- kite_ui-0.2.0/kite/presets.py +286 -0
- kite_ui-0.2.0/kite/react/components/charts.jsx +243 -0
- kite_ui-0.2.0/kite/react/components/codeblock.jsx +31 -0
- kite_ui-0.2.0/kite/react/components/core.jsx +341 -0
- kite_ui-0.2.0/kite/react/components/debug.js +34 -0
- kite_ui-0.2.0/kite/react/components/dock.js +75 -0
- kite_ui-0.2.0/kite/react/components/helpers.jsx +48 -0
- kite_ui-0.2.0/kite/react/components/index.js +8 -0
- kite_ui-0.2.0/kite/react/components/layout.jsx +185 -0
- kite_ui-0.2.0/kite/react/components/overlays.jsx +109 -0
- kite_ui-0.2.0/kite/react/docs/Playground.jsx +172 -0
- kite_ui-0.2.0/kite/react/icons.json +1 -0
- kite_ui-0.2.0/kite/react/layout.json +12 -0
- kite_ui-0.2.0/kite/static/fonts/Inter-Variable.woff2 +0 -0
- kite_ui-0.2.0/kite/static/fonts/JetBrainsMono-Variable.woff2 +0 -0
- kite_ui-0.2.0/kite/static/fonts/OFL-Inter.txt +93 -0
- kite_ui-0.2.0/kite/static/fonts/OFL-JetBrainsMono.txt +93 -0
- kite_ui-0.2.0/kite/static/kite.css +631 -0
- kite_ui-0.2.0/kite/static/kite.docs.js +45 -0
- kite_ui-0.2.0/kite/static/kite.islands.js +106 -0
- kite_ui-0.2.0/kite/theme.py +303 -0
- kite_ui-0.2.0/pyproject.toml +45 -0
- kite_ui-0.2.0/tests/test_app_export.py +223 -0
- kite_ui-0.2.0/tests/test_components.py +154 -0
- kite_ui-0.2.0/tests/test_docs.py +177 -0
- kite_ui-0.2.0/tests/test_layout.py +178 -0
- kite_ui-0.2.0/tests/test_theme.py +208 -0
kite_ui-0.2.0/.gitignore
ADDED
kite_ui-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruhan Ahuja
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
kite_ui-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: kite-ui
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Python UI with a real design language: components, themes, interactive charts, a macOS-style dock. Serve it, save one offline file, or export React/Electron.
|
|
5
|
+
Author-email: Ruhan Ahuja <ruhan.ahuja1514@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
9
|
+
Keywords: components,dashboard,design-system,electron,react,themes,ui
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Classifier: Topic :: Software Development :: User Interfaces
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
|
|
27
|
+
# kite 🪁
|
|
28
|
+
|
|
29
|
+
Apple polish, Bloomberg precision. Write UI in Python; serve it, save it as **one offline HTML file**, or export a real **React / Electron** project.
|
|
30
|
+
Everything is bundled: fonts, icons, JS, CSS. No CDN, no network.
|
|
31
|
+
|
|
32
|
+
## Try it in 10 seconds
|
|
33
|
+
```
|
|
34
|
+
pip install kite-ui
|
|
35
|
+
kite-ui --docs # interactive docs: learn it, and try every component's arguments live
|
|
36
|
+
```
|
|
37
|
+
The docs are a kite app: every component has a playground (click options, see the preview and the Python update), recipes, and step-by-step lessons.
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from kite import *
|
|
41
|
+
|
|
42
|
+
app = App("My site", theme=Theme.apple()) # or Theme.bloomberg(), .nord(), .custom(base="github", primary="#f00")
|
|
43
|
+
|
|
44
|
+
@app.page("/")
|
|
45
|
+
def home():
|
|
46
|
+
return [
|
|
47
|
+
Navbar("🪁 My site", right=ThemeToggle()),
|
|
48
|
+
Container(
|
|
49
|
+
H1("Hello"),
|
|
50
|
+
Button("Download", startIcon="download", color="primary"),
|
|
51
|
+
LineChart(rows, x="month", y=["revenue", "costs"], prefix="$"),
|
|
52
|
+
CandlestickChart(ohlc, x="t", id="px"),
|
|
53
|
+
),
|
|
54
|
+
Dock([("Home", "house", "/"), ("Charts", "chart-line", "#charts")], glass="regular"),
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
app.run() # http://127.0.0.1:8000 (stdlib server)
|
|
58
|
+
app.save("site.html") # ONE self-contained file; double-click to open offline
|
|
59
|
+
app.export("web") # Vite + React project (type="windows" | "mac" | "linux" adds Electron)
|
|
60
|
+
```
|
|
61
|
+
`kite-ui --docs` teaches it; `python demo.py` shows everything (`--save demo.html`, `--export web --type mac`).
|
|
62
|
+
CLI: `python -m kite run app.py` · `python -m kite export app.py out [web|windows|mac|linux]`
|
|
63
|
+
|
|
64
|
+
Naming: classes are `PascalCase` (`Button`, `Theme`), everything else is `camelCase` (`startIcon`, `headingFont`, `app.save`).
|
|
65
|
+
Props match the React ones 1:1, and attributes follow React too (`className`, `ariaLabel`, `onClick`, `style={"marginTop": "1rem"}`).
|
|
66
|
+
|
|
67
|
+
## Looks
|
|
68
|
+
21 presets: `Theme.apple()` (= plain, crisp macOS: flat, monochrome, no gradients; `glass=True` opts into Liquid Glass) · `ios()` · `github()` · `bloomberg()` · `linear()` · `notion()` · `stripe()` · `vercel()` · `shadcn()` · `material()` · `fluent()` · `nord()` · `dracula()` ·
|
|
69
|
+
`catppuccin()` · `tokyoNight()` · `gruvbox()` · `rosePine()` · `solarized()` · `terminal()` · `heroui()`, and `Theme.custom(base=..., **tokens)` to start from any of them.
|
|
70
|
+
Presets change *structure*, not just color. GitHub gets 32px controls with 1px borders, gray default buttons, a green primary action, boxed cards with a gray header,
|
|
71
|
+
a dark header bar and an orange tab underline. macOS gets white bezeled buttons, 28px compact controls, 6px corners, hairlines and blue only as an accent. iOS gets capsule buttons, filled gray text
|
|
72
|
+
fields, a big green switch and glass chrome. These are all tokens you can set yourself: `btnRadius`, `btnBorder`, `inputBg`, `focusRing`, `navbarBg`, `cardHeaderBg`, `switchW`, `sliderThumb`,
|
|
73
|
+
`iconStroke`, `headingTracking`, `borderW`, `tabAccent`, `checkOn`, …
|
|
74
|
+
Every preset takes overrides (`Theme.apple(primary="#ff375f", glass=False)`). Colors get generated 50–900 scales; grays, dividers and dark mode derive from
|
|
75
|
+
`background` + `foreground`. Several themes at once: `App(themes={"apple": Theme.apple(), ...})` + `ThemeSwitcher([...])`.
|
|
76
|
+
Other structure options: `density` (compact/regular/comfortable), `border` (shadow/hairline), `numerals="tabular"`, `labelCase="upper"`, `glass=True`.
|
|
77
|
+
|
|
78
|
+
**Liquid glass**: `glass="regular|clear|tinted"` on `Card, Navbar, Dock, Alert, Tabs, Modal, Drawer, Popover, Tooltip`, `Button(variant="glass")`, or `Theme(glass=True)` for all chrome.
|
|
79
|
+
|
|
80
|
+
## Fonts (all bundled)
|
|
81
|
+
Default: SF Pro body, JetBrains Mono headings. Inter and JetBrains Mono (SIL OFL) ship inside kite. **SF Pro is Apple-licensed, so kite
|
|
82
|
+
does not ship it**: it renders natively on Apple devices (`-apple-system`) and falls back to Inter elsewhere. To bundle any font, put its
|
|
83
|
+
files in `./fonts/` (`Poppins-Regular.woff2`, `Poppins-Bold.ttf`, `SF-Pro-Text-Regular.otf` …) and name it in `Theme(font="Poppins")`.
|
|
84
|
+
`kite.fonts.download("Poppins")` fetches an open-source Google font into `./fonts/` once. It's the only network call kite can make.
|
|
85
|
+
|
|
86
|
+
## Components
|
|
87
|
+
Buttons, inputs, selects, switches, sliders, OTP, cards, tables, alerts, chips, avatars, progress, skeletons, calendar, listbox, navbar, **dock**
|
|
88
|
+
(see below), breadcrumbs, pagination, tabs, accordion, modal, drawer, dropdown,
|
|
89
|
+
popover, tooltip, toasts, `Stat`, `Delta`, `Ticker`, and all of [Lucide](https://lucide.dev) (`icon("rocket")`).
|
|
90
|
+
|
|
91
|
+
**Charts** (interactive, theme-aware): `LineChart AreaChart BarChart CandlestickChart DonutChart Sparkline`. Hover for crosshair + tooltip, click the
|
|
92
|
+
legend to hide a series, ← → to inspect, live data with `id="px"` + `Script("kite.charts.push('px', {...}, {max: 60})")`.
|
|
93
|
+
|
|
94
|
+
## Placement: say where things go
|
|
95
|
+
No flexbox, grid, `position` or `z-index` to learn. Describe where things go; kite writes the CSS. **Ctrl+Shift+L** outlines every box (or `App(debug=True)`).
|
|
96
|
+
|
|
97
|
+
| I want to... | Write |
|
|
98
|
+
|---|---|
|
|
99
|
+
| one under the other / side by side | `Stack(a, b)` · `Row(a, b)` |
|
|
100
|
+
| push to the two ends / centre them | `Row(a, b, space="between")` · `Row(a, b, space="center")` |
|
|
101
|
+
| line up vertically | `Row(a, b, align="top" \| "middle" \| "bottom")` |
|
|
102
|
+
| centre something | `Center(x)` |
|
|
103
|
+
| a grid that fits the screen by itself | `Grid(a, b, c, d)` (or `minItem="12rem"`) |
|
|
104
|
+
| exactly N columns, or different per screen | `Grid(..., cols=3)` · `cols={"base": 1, "md": 2, "lg": 4}` |
|
|
105
|
+
| make one grid item wider | `Cell(x, span=2)` |
|
|
106
|
+
| stack a row on phones | `Row(a, b, stackBelow="md")` |
|
|
107
|
+
| draw the whole page | `Layout("header header / nav main / footer footer", header=..., nav=..., main=..., footer=...)` |
|
|
108
|
+
| the standard app shell | `Page(main, header=Navbar(), sidebar=Sidebar(), footer=...)` |
|
|
109
|
+
| put things on top of each other | `Layer(background, Pin(label, at="bottom-left", to="parent"))` |
|
|
110
|
+
| a badge on a corner | `Attach(Avatar("Ada"), Badge("3"), at="top-right")` |
|
|
111
|
+
| a floating button | `Pin(Button("Chat"), at="bottom-right")` (`to="parent"` to pin inside something) |
|
|
112
|
+
| stay visible while scrolling | `Sticky(header, edge="top")` |
|
|
113
|
+
| exact pixels | `Canvas(At(x=40, y=24, ...), w=640, h=360)` |
|
|
114
|
+
|
|
115
|
+
`at` is one of `top-left top top-right left center right bottom-left bottom bottom-right` (the same words as `Dock(at=...)`), and **changing it at runtime glides** there.
|
|
116
|
+
Spacing and sizes use a **named scale that follows the theme** (`gap="md"`, `pad="lg"`, `w="sm"`; compact themes tighten automatically), and raw values still work (`pad=12`, `w="20rem"`).
|
|
117
|
+
Mistakes are explained: `Row(align="midle")` -> *did you mean 'middle'?*
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
# before: CSS in a dict
|
|
121
|
+
Div(Row(Chip("a"), Chip("b"), style={"display": "flex", "justifyContent": "space-between", "padding": "8px"}), style={"position": "relative"})
|
|
122
|
+
# after: plain words
|
|
123
|
+
Row(Chip("a"), Chip("b"), space="between", pad="sm")
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Dock
|
|
127
|
+
```python
|
|
128
|
+
Dock([("Home", "house", "/"), ("Mail", "mail", "/mail", None, 3), "-", ("Docs", "book-open", "/docs", "primary")],
|
|
129
|
+
current="/", position="bottom", glass="regular", magnify=1.7, size="md", autoHide=False)
|
|
130
|
+
```
|
|
131
|
+
Spring-driven magnification pushes neighbours apart (no CSS lag), items bounce on click and take badges (5th tuple element or `{"badge": ...}`).
|
|
132
|
+
`position` (or `at`; `bottom|top|left|right`) pins the dock to that edge, centered; change it at any time with `dock.dataset.position = "left"` and it **glides** there.
|
|
133
|
+
`autoHide=True` tucks it away until you approach the edge. `static=True` lays it out inline instead of fixed. Respects `prefers-reduced-motion`.
|
|
134
|
+
|
|
135
|
+
## Export
|
|
136
|
+
`app.export(dir, type=...)` turns pages into JSX (`<Button color="primary">`) backed by the real React source in `src/components`.
|
|
137
|
+
Every token is editable in `src/theme.css`; fonts are copied to `src/fonts/`. Desktop types add `electron/main.cjs`, `electron/preload.cjs`
|
|
138
|
+
(exposes `window.kiteDesktop`) and an electron-builder config. Then `npm install && npm run dev` (web) or `npm run start` / `npm run dist` (desktop).
|
|
139
|
+
|
|
140
|
+
## Develop
|
|
141
|
+
```
|
|
142
|
+
python -m venv .venv && .venv/bin/pip install -e .[dev]
|
|
143
|
+
cd islands && npm install && npm run build # rebuilds kite/static/kite.islands.js from kite/react/components
|
|
144
|
+
.venv/bin/pytest
|
|
145
|
+
```
|
|
146
|
+
Third-party licenses (Lucide, Inter, JetBrains Mono, React, Radix and friends) are in `THIRD_PARTY_NOTICES.md` (regenerate with `node islands/notices.mjs`).
|
kite_ui-0.2.0/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# kite 🪁
|
|
2
|
+
|
|
3
|
+
Apple polish, Bloomberg precision. Write UI in Python; serve it, save it as **one offline HTML file**, or export a real **React / Electron** project.
|
|
4
|
+
Everything is bundled: fonts, icons, JS, CSS. No CDN, no network.
|
|
5
|
+
|
|
6
|
+
## Try it in 10 seconds
|
|
7
|
+
```
|
|
8
|
+
pip install kite-ui
|
|
9
|
+
kite-ui --docs # interactive docs: learn it, and try every component's arguments live
|
|
10
|
+
```
|
|
11
|
+
The docs are a kite app: every component has a playground (click options, see the preview and the Python update), recipes, and step-by-step lessons.
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from kite import *
|
|
15
|
+
|
|
16
|
+
app = App("My site", theme=Theme.apple()) # or Theme.bloomberg(), .nord(), .custom(base="github", primary="#f00")
|
|
17
|
+
|
|
18
|
+
@app.page("/")
|
|
19
|
+
def home():
|
|
20
|
+
return [
|
|
21
|
+
Navbar("🪁 My site", right=ThemeToggle()),
|
|
22
|
+
Container(
|
|
23
|
+
H1("Hello"),
|
|
24
|
+
Button("Download", startIcon="download", color="primary"),
|
|
25
|
+
LineChart(rows, x="month", y=["revenue", "costs"], prefix="$"),
|
|
26
|
+
CandlestickChart(ohlc, x="t", id="px"),
|
|
27
|
+
),
|
|
28
|
+
Dock([("Home", "house", "/"), ("Charts", "chart-line", "#charts")], glass="regular"),
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
app.run() # http://127.0.0.1:8000 (stdlib server)
|
|
32
|
+
app.save("site.html") # ONE self-contained file; double-click to open offline
|
|
33
|
+
app.export("web") # Vite + React project (type="windows" | "mac" | "linux" adds Electron)
|
|
34
|
+
```
|
|
35
|
+
`kite-ui --docs` teaches it; `python demo.py` shows everything (`--save demo.html`, `--export web --type mac`).
|
|
36
|
+
CLI: `python -m kite run app.py` · `python -m kite export app.py out [web|windows|mac|linux]`
|
|
37
|
+
|
|
38
|
+
Naming: classes are `PascalCase` (`Button`, `Theme`), everything else is `camelCase` (`startIcon`, `headingFont`, `app.save`).
|
|
39
|
+
Props match the React ones 1:1, and attributes follow React too (`className`, `ariaLabel`, `onClick`, `style={"marginTop": "1rem"}`).
|
|
40
|
+
|
|
41
|
+
## Looks
|
|
42
|
+
21 presets: `Theme.apple()` (= plain, crisp macOS: flat, monochrome, no gradients; `glass=True` opts into Liquid Glass) · `ios()` · `github()` · `bloomberg()` · `linear()` · `notion()` · `stripe()` · `vercel()` · `shadcn()` · `material()` · `fluent()` · `nord()` · `dracula()` ·
|
|
43
|
+
`catppuccin()` · `tokyoNight()` · `gruvbox()` · `rosePine()` · `solarized()` · `terminal()` · `heroui()`, and `Theme.custom(base=..., **tokens)` to start from any of them.
|
|
44
|
+
Presets change *structure*, not just color. GitHub gets 32px controls with 1px borders, gray default buttons, a green primary action, boxed cards with a gray header,
|
|
45
|
+
a dark header bar and an orange tab underline. macOS gets white bezeled buttons, 28px compact controls, 6px corners, hairlines and blue only as an accent. iOS gets capsule buttons, filled gray text
|
|
46
|
+
fields, a big green switch and glass chrome. These are all tokens you can set yourself: `btnRadius`, `btnBorder`, `inputBg`, `focusRing`, `navbarBg`, `cardHeaderBg`, `switchW`, `sliderThumb`,
|
|
47
|
+
`iconStroke`, `headingTracking`, `borderW`, `tabAccent`, `checkOn`, …
|
|
48
|
+
Every preset takes overrides (`Theme.apple(primary="#ff375f", glass=False)`). Colors get generated 50–900 scales; grays, dividers and dark mode derive from
|
|
49
|
+
`background` + `foreground`. Several themes at once: `App(themes={"apple": Theme.apple(), ...})` + `ThemeSwitcher([...])`.
|
|
50
|
+
Other structure options: `density` (compact/regular/comfortable), `border` (shadow/hairline), `numerals="tabular"`, `labelCase="upper"`, `glass=True`.
|
|
51
|
+
|
|
52
|
+
**Liquid glass**: `glass="regular|clear|tinted"` on `Card, Navbar, Dock, Alert, Tabs, Modal, Drawer, Popover, Tooltip`, `Button(variant="glass")`, or `Theme(glass=True)` for all chrome.
|
|
53
|
+
|
|
54
|
+
## Fonts (all bundled)
|
|
55
|
+
Default: SF Pro body, JetBrains Mono headings. Inter and JetBrains Mono (SIL OFL) ship inside kite. **SF Pro is Apple-licensed, so kite
|
|
56
|
+
does not ship it**: it renders natively on Apple devices (`-apple-system`) and falls back to Inter elsewhere. To bundle any font, put its
|
|
57
|
+
files in `./fonts/` (`Poppins-Regular.woff2`, `Poppins-Bold.ttf`, `SF-Pro-Text-Regular.otf` …) and name it in `Theme(font="Poppins")`.
|
|
58
|
+
`kite.fonts.download("Poppins")` fetches an open-source Google font into `./fonts/` once. It's the only network call kite can make.
|
|
59
|
+
|
|
60
|
+
## Components
|
|
61
|
+
Buttons, inputs, selects, switches, sliders, OTP, cards, tables, alerts, chips, avatars, progress, skeletons, calendar, listbox, navbar, **dock**
|
|
62
|
+
(see below), breadcrumbs, pagination, tabs, accordion, modal, drawer, dropdown,
|
|
63
|
+
popover, tooltip, toasts, `Stat`, `Delta`, `Ticker`, and all of [Lucide](https://lucide.dev) (`icon("rocket")`).
|
|
64
|
+
|
|
65
|
+
**Charts** (interactive, theme-aware): `LineChart AreaChart BarChart CandlestickChart DonutChart Sparkline`. Hover for crosshair + tooltip, click the
|
|
66
|
+
legend to hide a series, ← → to inspect, live data with `id="px"` + `Script("kite.charts.push('px', {...}, {max: 60})")`.
|
|
67
|
+
|
|
68
|
+
## Placement: say where things go
|
|
69
|
+
No flexbox, grid, `position` or `z-index` to learn. Describe where things go; kite writes the CSS. **Ctrl+Shift+L** outlines every box (or `App(debug=True)`).
|
|
70
|
+
|
|
71
|
+
| I want to... | Write |
|
|
72
|
+
|---|---|
|
|
73
|
+
| one under the other / side by side | `Stack(a, b)` · `Row(a, b)` |
|
|
74
|
+
| push to the two ends / centre them | `Row(a, b, space="between")` · `Row(a, b, space="center")` |
|
|
75
|
+
| line up vertically | `Row(a, b, align="top" \| "middle" \| "bottom")` |
|
|
76
|
+
| centre something | `Center(x)` |
|
|
77
|
+
| a grid that fits the screen by itself | `Grid(a, b, c, d)` (or `minItem="12rem"`) |
|
|
78
|
+
| exactly N columns, or different per screen | `Grid(..., cols=3)` · `cols={"base": 1, "md": 2, "lg": 4}` |
|
|
79
|
+
| make one grid item wider | `Cell(x, span=2)` |
|
|
80
|
+
| stack a row on phones | `Row(a, b, stackBelow="md")` |
|
|
81
|
+
| draw the whole page | `Layout("header header / nav main / footer footer", header=..., nav=..., main=..., footer=...)` |
|
|
82
|
+
| the standard app shell | `Page(main, header=Navbar(), sidebar=Sidebar(), footer=...)` |
|
|
83
|
+
| put things on top of each other | `Layer(background, Pin(label, at="bottom-left", to="parent"))` |
|
|
84
|
+
| a badge on a corner | `Attach(Avatar("Ada"), Badge("3"), at="top-right")` |
|
|
85
|
+
| a floating button | `Pin(Button("Chat"), at="bottom-right")` (`to="parent"` to pin inside something) |
|
|
86
|
+
| stay visible while scrolling | `Sticky(header, edge="top")` |
|
|
87
|
+
| exact pixels | `Canvas(At(x=40, y=24, ...), w=640, h=360)` |
|
|
88
|
+
|
|
89
|
+
`at` is one of `top-left top top-right left center right bottom-left bottom bottom-right` (the same words as `Dock(at=...)`), and **changing it at runtime glides** there.
|
|
90
|
+
Spacing and sizes use a **named scale that follows the theme** (`gap="md"`, `pad="lg"`, `w="sm"`; compact themes tighten automatically), and raw values still work (`pad=12`, `w="20rem"`).
|
|
91
|
+
Mistakes are explained: `Row(align="midle")` -> *did you mean 'middle'?*
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
# before: CSS in a dict
|
|
95
|
+
Div(Row(Chip("a"), Chip("b"), style={"display": "flex", "justifyContent": "space-between", "padding": "8px"}), style={"position": "relative"})
|
|
96
|
+
# after: plain words
|
|
97
|
+
Row(Chip("a"), Chip("b"), space="between", pad="sm")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Dock
|
|
101
|
+
```python
|
|
102
|
+
Dock([("Home", "house", "/"), ("Mail", "mail", "/mail", None, 3), "-", ("Docs", "book-open", "/docs", "primary")],
|
|
103
|
+
current="/", position="bottom", glass="regular", magnify=1.7, size="md", autoHide=False)
|
|
104
|
+
```
|
|
105
|
+
Spring-driven magnification pushes neighbours apart (no CSS lag), items bounce on click and take badges (5th tuple element or `{"badge": ...}`).
|
|
106
|
+
`position` (or `at`; `bottom|top|left|right`) pins the dock to that edge, centered; change it at any time with `dock.dataset.position = "left"` and it **glides** there.
|
|
107
|
+
`autoHide=True` tucks it away until you approach the edge. `static=True` lays it out inline instead of fixed. Respects `prefers-reduced-motion`.
|
|
108
|
+
|
|
109
|
+
## Export
|
|
110
|
+
`app.export(dir, type=...)` turns pages into JSX (`<Button color="primary">`) backed by the real React source in `src/components`.
|
|
111
|
+
Every token is editable in `src/theme.css`; fonts are copied to `src/fonts/`. Desktop types add `electron/main.cjs`, `electron/preload.cjs`
|
|
112
|
+
(exposes `window.kiteDesktop`) and an electron-builder config. Then `npm install && npm run dev` (web) or `npm run start` / `npm run dist` (desktop).
|
|
113
|
+
|
|
114
|
+
## Develop
|
|
115
|
+
```
|
|
116
|
+
python -m venv .venv && .venv/bin/pip install -e .[dev]
|
|
117
|
+
cd islands && npm install && npm run build # rebuilds kite/static/kite.islands.js from kite/react/components
|
|
118
|
+
.venv/bin/pytest
|
|
119
|
+
```
|
|
120
|
+
Third-party licenses (Lucide, Inter, JetBrains Mono, React, Radix and friends) are in `THIRD_PARTY_NOTICES.md` (regenerate with `node islands/notices.mjs`).
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
kite-ui itself is licensed as stated in its LICENSE. It bundles the following third-party software; each keeps its own license, reproduced below.
|
|
4
|
+
|
|
5
|
+
## Icons: Lucide (ISC)
|
|
6
|
+
`kite/react/icons.json` is derived from [Lucide](https://lucide.dev) (lucide-static 1.83.0). Lucide is ISC licensed; portions derive from Feather (MIT). See https://github.com/lucide-icons/lucide/blob/main/LICENSE.
|
|
7
|
+
|
|
8
|
+
## Fonts (SIL Open Font License 1.1)
|
|
9
|
+
Inter and JetBrains Mono (`kite/static/fonts/`); their license texts ship next to the font files (OFL-Inter.txt, OFL-JetBrainsMono.txt).
|
|
10
|
+
SF Pro is NOT included (Apple license).
|
|
11
|
+
|
|
12
|
+
## JavaScript bundled into kite/static/kite.islands.js and kite.docs.js
|
|
13
|
+
|
|
14
|
+
### @floating-ui/core@1.8.0, @floating-ui/dom@1.8.0, @floating-ui/react-dom@2.1.9, @floating-ui/utils@0.2.12
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
MIT License
|
|
18
|
+
|
|
19
|
+
Copyright (c) 2021-present Floating UI contributors
|
|
20
|
+
|
|
21
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
22
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
23
|
+
the Software without restriction, including without limitation the rights to
|
|
24
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
25
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
26
|
+
subject to the following conditions:
|
|
27
|
+
|
|
28
|
+
The above copyright notice and this permission notice shall be included in all
|
|
29
|
+
copies or substantial portions of the Software.
|
|
30
|
+
|
|
31
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
33
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
34
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
35
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
36
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### @radix-ui/primitive@1.2.0, @radix-ui/react-accordion@1.3.1, @radix-ui/react-arrow@1.1.17, @radix-ui/react-collapsible@1.2.1, @radix-ui/react-collection@1.2.0, @radix-ui/react-compose-refs@1.1.5, @radix-ui/react-context@1.3.0, @radix-ui/react-dialog@1.3.1, @radix-ui/react-direction@1.2.0, @radix-ui/react-dismissable-layer@1.2.1, @radix-ui/react-dropdown-menu@2.2.1, @radix-ui/react-focus-guards@1.2.0, @radix-ui/react-focus-scope@1.3.1, @radix-ui/react-id@1.1.4, @radix-ui/react-menu@2.2.1, @radix-ui/react-popover@1.3.1, @radix-ui/react-popper@1.4.0, @radix-ui/react-portal@1.2.0, @radix-ui/react-presence@1.1.11, @radix-ui/react-primitive@2.2.0, @radix-ui/react-roving-focus@1.2.1, @radix-ui/react-slot@1.5.0, @radix-ui/react-tabs@1.2.1, @radix-ui/react-tooltip@1.4.1, @radix-ui/react-use-callback-ref@1.1.5, @radix-ui/react-use-controllable-state@1.3.0, @radix-ui/react-use-effect-event@0.0.5, @radix-ui/react-use-is-hydrated@0.1.3, @radix-ui/react-use-layout-effect@1.1.4, @radix-ui/react-use-size@1.1.5, @radix-ui/react-visually-hidden@1.2.13
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
MIT License
|
|
43
|
+
|
|
44
|
+
Copyright (c) 2022 WorkOS
|
|
45
|
+
|
|
46
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
47
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
48
|
+
in the Software without restriction, including without limitation the rights
|
|
49
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
50
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
51
|
+
furnished to do so, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
The above copyright notice and this permission notice shall be included in all
|
|
54
|
+
copies or substantial portions of the Software.
|
|
55
|
+
|
|
56
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
57
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
58
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
59
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
60
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
61
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
62
|
+
SOFTWARE.
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### aria-hidden@1.2.6, react-remove-scroll@2.7.2, react-style-singleton@2.2.3, use-callback-ref@1.3.3, use-sidecar@1.1.3
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
MIT License
|
|
69
|
+
|
|
70
|
+
Copyright (c) 2017 Anton Korzunov
|
|
71
|
+
|
|
72
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
73
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
74
|
+
in the Software without restriction, including without limitation the rights
|
|
75
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
76
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
77
|
+
furnished to do so, subject to the following conditions:
|
|
78
|
+
|
|
79
|
+
The above copyright notice and this permission notice shall be included in all
|
|
80
|
+
copies or substantial portions of the Software.
|
|
81
|
+
|
|
82
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
83
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
84
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
85
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
86
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
87
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
88
|
+
SOFTWARE.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### detect-node-es@1.1.0
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
MIT License
|
|
95
|
+
|
|
96
|
+
Copyright (c) 2017 Ilya Kantor
|
|
97
|
+
|
|
98
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
99
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
100
|
+
in the Software without restriction, including without limitation the rights
|
|
101
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
102
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
103
|
+
furnished to do so, subject to the following conditions:
|
|
104
|
+
|
|
105
|
+
The above copyright notice and this permission notice shall be included in all
|
|
106
|
+
copies or substantial portions of the Software.
|
|
107
|
+
|
|
108
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
109
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
110
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
111
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
112
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
113
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
114
|
+
SOFTWARE.
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### get-nonce@1.0.1
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
MIT License
|
|
121
|
+
|
|
122
|
+
Copyright (c) 2020 Anton Korzunov
|
|
123
|
+
|
|
124
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
125
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
126
|
+
in the Software without restriction, including without limitation the rights
|
|
127
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
128
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
129
|
+
furnished to do so, subject to the following conditions:
|
|
130
|
+
|
|
131
|
+
The above copyright notice and this permission notice shall be included in all
|
|
132
|
+
copies or substantial portions of the Software.
|
|
133
|
+
|
|
134
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
135
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
136
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
137
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
138
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
139
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
140
|
+
SOFTWARE.
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### react@19.3.1, react-dom@19.3.1, scheduler@0.28.0
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
MIT License
|
|
147
|
+
|
|
148
|
+
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
149
|
+
|
|
150
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
151
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
152
|
+
in the Software without restriction, including without limitation the rights
|
|
153
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
154
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
155
|
+
furnished to do so, subject to the following conditions:
|
|
156
|
+
|
|
157
|
+
The above copyright notice and this permission notice shall be included in all
|
|
158
|
+
copies or substantial portions of the Software.
|
|
159
|
+
|
|
160
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
161
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
162
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
163
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
164
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
165
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
166
|
+
SOFTWARE.
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### react-remove-scroll-bar@2.3.8
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
(MIT: see the package)
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### tslib@2.9.1
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
Copyright (c) Microsoft Corporation.
|
|
179
|
+
|
|
180
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
181
|
+
purpose with or without fee is hereby granted.
|
|
182
|
+
|
|
183
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
184
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
185
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
186
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
187
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
188
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
189
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
190
|
+
```
|