instaui 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
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.
- instaui/components/content.py +4 -4
- instaui/components/echarts/echarts.js +128 -0
- instaui/components/echarts/echarts.py +194 -0
- instaui/components/echarts/static/echarts.esm.min.js +45 -0
- instaui/components/element.py +103 -13
- instaui/components/html/__init__.py +31 -18
- instaui/components/html/_preset.py +4 -0
- instaui/components/html/heading.py +51 -0
- instaui/components/html/range.py +3 -0
- instaui/components/html/select.py +16 -35
- instaui/components/html/table.py +36 -0
- instaui/components/html/textarea.py +28 -0
- instaui/components/markdown/markdown.js +33 -0
- instaui/components/markdown/markdown.py +41 -0
- instaui/components/markdown/static/github-markdown.css +12 -0
- instaui/components/markdown/static/marked.esm.js +2579 -0
- instaui/components/shiki_code/shiki_code.js +126 -0
- instaui/components/shiki_code/shiki_code.py +99 -0
- instaui/components/shiki_code/static/langs/css.mjs +5 -0
- instaui/components/shiki_code/static/langs/markdown.mjs +5 -0
- instaui/components/shiki_code/static/langs/python.mjs +5 -0
- instaui/components/shiki_code/static/langs/shell.mjs +2 -0
- instaui/components/shiki_code/static/langs/shellscript.mjs +5 -0
- instaui/components/shiki_code/static/shiki-core.js +5784 -0
- instaui/components/shiki_code/static/shiki-style.css +175 -0
- instaui/components/shiki_code/static/shiki-transformers.js +461 -0
- instaui/components/shiki_code/static/themes/vitesse-dark.mjs +2 -0
- instaui/components/shiki_code/static/themes/vitesse-light.mjs +2 -0
- instaui/components/value_element.py +7 -3
- instaui/components/vfor.py +1 -1
- instaui/consts.py +2 -1
- instaui/daisyui/__init__.py +26 -0
- instaui/daisyui/_index.py +20 -0
- instaui/daisyui/button.py +38 -0
- instaui/daisyui/checkbox.py +17 -0
- instaui/daisyui/static/daisyui.css +1 -0
- instaui/daisyui/static/themes.css +1 -0
- instaui/daisyui/table.py +35 -0
- instaui/dependencies/component_dependency.py +11 -5
- instaui/event/js_event.py +1 -0
- instaui/event/web_event.py +6 -7
- instaui/fastapi_server/dependency_router.py +4 -3
- instaui/fastapi_server/resource.py +12 -16
- instaui/fastapi_server/server.py +34 -24
- instaui/handlers/event_handler.py +3 -1
- instaui/handlers/watch_handler.py +4 -0
- instaui/html_tools.py +44 -2
- instaui/inject.py +3 -3
- instaui/runtime/_app.py +43 -4
- instaui/runtime/_link_manager.py +89 -0
- instaui/runtime/resource.py +21 -8
- instaui/shadcn_classless/_index.py +42 -0
- instaui/shadcn_classless/static/shadcn-classless.css +403 -0
- instaui/spa_router/_functions.py +1 -1
- instaui/spa_router/_route_model.py +1 -1
- instaui/static/insta-ui.css +1 -1
- instaui/static/insta-ui.esm-browser.prod.js +1308 -1252
- instaui/static/insta-ui.js.map +1 -1
- instaui/static/instaui-tools-browser.js +511 -0
- instaui/static/templates/webview.html +78 -0
- instaui/systems/module_system.py +30 -0
- instaui/tailwind/__init__.py +6 -0
- instaui/tailwind/_index.py +24 -0
- instaui/{static/tailwindcss.min.js → tailwind/static/tailwindcss-v3.min.js} +62 -62
- instaui/tailwind/static/tailwindcss-v4.min.js +8 -0
- instaui/template/_utils.py +23 -0
- instaui/template/webview_template.py +50 -0
- instaui/template/zero_template.py +18 -17
- instaui/ui/__build_init.py +73 -0
- instaui/ui/__init__.py +74 -58
- instaui/ui/__init__.pyi +135 -0
- instaui/ui/events.py +1 -1
- instaui/ui_functions/server.py +3 -1
- instaui/vars/event_context.py +4 -0
- instaui/vars/web_computed.py +30 -30
- instaui/watch/web_watch.py +5 -6
- instaui/webview/__init__.py +1 -0
- instaui/webview/_utils.py +8 -0
- instaui/webview/api.py +72 -0
- instaui/webview/func.py +114 -0
- instaui/webview/index.py +162 -0
- instaui/webview/resource.py +172 -0
- instaui/zero/func.py +31 -23
- instaui/zero/scope.py +110 -4
- {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/METADATA +4 -1
- {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/RECORD +88 -44
- instaui/handlers/computed_handler.py +0 -42
- instaui/handlers/config_handler.py +0 -13
- instaui/static/insta-ui.iife.js +0 -29
- instaui/static/insta-ui.iife.js.map +0 -1
- instaui/zero/test.html +0 -44
- {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/LICENSE +0 -0
- {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,89 @@
|
|
1
|
+
from __future__ import annotations
|
2
|
+
from typing import (
|
3
|
+
Callable,
|
4
|
+
Dict,
|
5
|
+
Generic,
|
6
|
+
List,
|
7
|
+
Literal,
|
8
|
+
Optional,
|
9
|
+
Tuple,
|
10
|
+
TypeVar,
|
11
|
+
Hashable,
|
12
|
+
)
|
13
|
+
|
14
|
+
_TLinkActionObj = TypeVar("_TLinkActionObj")
|
15
|
+
|
16
|
+
_DEFAULT_KEY_FN = lambda x: x # noqa: E731
|
17
|
+
|
18
|
+
|
19
|
+
class LinkManager(Generic[_TLinkActionObj]):
|
20
|
+
def __init__(
|
21
|
+
self, key_fn: Optional[Callable[[_TLinkActionObj], Hashable]] = None
|
22
|
+
) -> None:
|
23
|
+
self._key_fn = key_fn or _DEFAULT_KEY_FN
|
24
|
+
self._actions_map: Dict[
|
25
|
+
Tuple[Literal["add", "remove"], Hashable], _TLinkActionObj
|
26
|
+
] = {}
|
27
|
+
|
28
|
+
def add_link(
|
29
|
+
self,
|
30
|
+
obj: _TLinkActionObj,
|
31
|
+
):
|
32
|
+
key = ("add", self._key_fn(obj))
|
33
|
+
self._actions_map[key] = obj
|
34
|
+
|
35
|
+
def remove_link(
|
36
|
+
self,
|
37
|
+
obj: _TLinkActionObj,
|
38
|
+
):
|
39
|
+
key = ("remove", self._key_fn(obj))
|
40
|
+
self._actions_map[key] = obj
|
41
|
+
|
42
|
+
def get_valid_links(
|
43
|
+
self, secondary_manager: Optional[LinkManager] = None
|
44
|
+
) -> List[_TLinkActionObj]:
|
45
|
+
secondary_maps = secondary_manager._actions_map if secondary_manager else {}
|
46
|
+
merger_map = {**secondary_maps, **self._actions_map}
|
47
|
+
|
48
|
+
result = {}
|
49
|
+
|
50
|
+
for (action, key), obj in merger_map.items():
|
51
|
+
if action == "add":
|
52
|
+
result[key] = obj
|
53
|
+
continue
|
54
|
+
|
55
|
+
if key in result:
|
56
|
+
del result[key]
|
57
|
+
|
58
|
+
return list(result.values())
|
59
|
+
|
60
|
+
|
61
|
+
if __name__ == "__main__":
|
62
|
+
|
63
|
+
def test_baes():
|
64
|
+
manager: LinkManager[str] = LinkManager()
|
65
|
+
manager.add_link("a")
|
66
|
+
manager.add_link("b")
|
67
|
+
manager.add_link("c")
|
68
|
+
manager.remove_link("b")
|
69
|
+
|
70
|
+
assert manager.get_valid_links() == ["a", "c"]
|
71
|
+
|
72
|
+
test_baes()
|
73
|
+
|
74
|
+
def test_with_other():
|
75
|
+
other: LinkManager[str] = LinkManager()
|
76
|
+
other.add_link("a")
|
77
|
+
other.add_link("b")
|
78
|
+
other.add_link("c")
|
79
|
+
|
80
|
+
manager1: LinkManager[str] = LinkManager()
|
81
|
+
manager1.add_link("b")
|
82
|
+
manager1.add_link("d")
|
83
|
+
manager1.add_link("e")
|
84
|
+
manager1.remove_link("a")
|
85
|
+
manager1.remove_link("b")
|
86
|
+
|
87
|
+
assert manager1.get_valid_links(other) == ["c", "d", "e"]
|
88
|
+
|
89
|
+
test_with_other()
|
instaui/runtime/resource.py
CHANGED
@@ -2,6 +2,7 @@ from __future__ import annotations
|
|
2
2
|
from pathlib import Path
|
3
3
|
from typing import Any, Dict, List, Optional, Set, Union
|
4
4
|
from .dataclass import JsLink, VueAppUse, VueAppComponent
|
5
|
+
from ._link_manager import LinkManager
|
5
6
|
|
6
7
|
|
7
8
|
class HtmlResource:
|
@@ -10,9 +11,11 @@ class HtmlResource:
|
|
10
11
|
favicon: Optional[Path] = None
|
11
12
|
|
12
13
|
def __init__(self) -> None:
|
13
|
-
self.
|
14
|
+
self._css_links_manager: LinkManager[Union[str, Path]] = LinkManager()
|
14
15
|
self._style_tags: List[str] = []
|
15
|
-
self.
|
16
|
+
self._js_links_manager: LinkManager[JsLink] = LinkManager(
|
17
|
+
key_fn=lambda js_link: js_link.link
|
18
|
+
)
|
16
19
|
self._script_tags: List[str] = []
|
17
20
|
self._vue_app_use: Set[VueAppUse] = set()
|
18
21
|
self._vue_app_components: Set[VueAppComponent] = set()
|
@@ -20,7 +23,10 @@ class HtmlResource:
|
|
20
23
|
self._appConfig = "{}"
|
21
24
|
|
22
25
|
def add_css_link(self, link: Union[str, Path]):
|
23
|
-
self.
|
26
|
+
self._css_links_manager.add_link(link)
|
27
|
+
|
28
|
+
def remove_css_link(self, link: Union[str, Path]):
|
29
|
+
self._css_links_manager.remove_link(link)
|
24
30
|
|
25
31
|
def add_style_tag(self, content: str):
|
26
32
|
self._style_tags.append(content)
|
@@ -30,12 +36,19 @@ class HtmlResource:
|
|
30
36
|
link: Union[str, Path],
|
31
37
|
*,
|
32
38
|
attrs: Optional[Dict[str, Any]] = None,
|
33
|
-
insert_before: int = -1,
|
34
39
|
):
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
self.
|
40
|
+
self._js_links_manager.add_link(JsLink(link, attrs or {}))
|
41
|
+
|
42
|
+
def remove_js_link(self, link: Union[str, Path]):
|
43
|
+
self._js_links_manager.remove_link(JsLink(link))
|
44
|
+
|
45
|
+
def get_valid_js_links(self, default_js_links_manager: LinkManager) -> List[JsLink]:
|
46
|
+
return self._js_links_manager.get_valid_links(default_js_links_manager)
|
47
|
+
|
48
|
+
def get_valid_css_links(
|
49
|
+
self, default_css_links_manager: LinkManager[Union[str, Path]]
|
50
|
+
) -> List[Union[str, Path]]:
|
51
|
+
return self._css_links_manager.get_valid_links(default_css_links_manager)
|
39
52
|
|
40
53
|
def add_script_tag(
|
41
54
|
self, content: str, script_attrs: Optional[Dict[str, Any]] = None
|
@@ -0,0 +1,42 @@
|
|
1
|
+
from pathlib import Path
|
2
|
+
from instaui.runtime._app import get_app_slot
|
3
|
+
|
4
|
+
|
5
|
+
_STATIC_DIR = Path(__file__).parent / "static"
|
6
|
+
_CSS_FILE = _STATIC_DIR / "shadcn-classless.css"
|
7
|
+
|
8
|
+
|
9
|
+
def use_shadcn_classless(value=True):
|
10
|
+
"""Use shadcn-classless.css or not.
|
11
|
+
|
12
|
+
Args:
|
13
|
+
value (bool, optional): Whether to use shadcn-classless.css or not. Defaults to True.
|
14
|
+
|
15
|
+
Example:
|
16
|
+
|
17
|
+
App default use shadcn-classless.css:
|
18
|
+
.. code-block:: python
|
19
|
+
|
20
|
+
@ui.page('/')
|
21
|
+
def index():
|
22
|
+
|
23
|
+
# Create a container with shadcn-classless class
|
24
|
+
with html.div().classes("shadcn-classless"):
|
25
|
+
html.h1("Hello, world!")
|
26
|
+
|
27
|
+
with html.form():
|
28
|
+
html.input()
|
29
|
+
html.button("Submit")
|
30
|
+
|
31
|
+
Can be disabled:
|
32
|
+
.. code-block:: python
|
33
|
+
# App does not use shadcn-classless
|
34
|
+
ui.use_shadcn_classless(False)
|
35
|
+
|
36
|
+
"""
|
37
|
+
|
38
|
+
if value:
|
39
|
+
get_app_slot()._html_resource.add_css_link(_CSS_FILE)
|
40
|
+
|
41
|
+
else:
|
42
|
+
get_app_slot()._html_resource.remove_css_link(_CSS_FILE)
|
@@ -0,0 +1,403 @@
|
|
1
|
+
.shadcn-classless {
|
2
|
+
color-scheme: light dark;
|
3
|
+
font-family: ui-monospace, "Menlo", "Monaco", "Consolas", "Liberation Mono", "Courier New", monospace;
|
4
|
+
background-color: var(--background);
|
5
|
+
color: var(--foreground);
|
6
|
+
line-height: 1.5;
|
7
|
+
padding: 1rem;
|
8
|
+
--radius: 0.5rem;
|
9
|
+
--background: oklch(1 0 0);
|
10
|
+
--foreground: oklch(0.141 0.005 285.823);
|
11
|
+
--card: oklch(1 0 0);
|
12
|
+
--card-foreground: oklch(0.141 0.005 285.823);
|
13
|
+
--popover: oklch(1 0 0);
|
14
|
+
--popover-foreground: oklch(0.141 0.005 285.823);
|
15
|
+
--primary: oklch(0.21 0.006 285.885);
|
16
|
+
--primary-foreground: oklch(0.985 0 0);
|
17
|
+
--secondary: oklch(0.967 0.001 286.375);
|
18
|
+
--secondary-foreground: oklch(0.21 0.006 285.885);
|
19
|
+
--muted: oklch(0.967 0.001 286.375);
|
20
|
+
--muted-foreground: oklch(0.552 0.016 285.938);
|
21
|
+
--accent: oklch(0.967 0.001 286.375);
|
22
|
+
--accent-foreground: oklch(0.21 0.006 285.885);
|
23
|
+
--destructive: oklch(0.577 0.245 27.325);
|
24
|
+
--border: oklch(0.92 0.004 286.32);
|
25
|
+
--input: oklch(0.92 0.004 286.32);
|
26
|
+
--ring: oklch(0.705 0.015 286.067);
|
27
|
+
--chart-1: oklch(0.646 0.222 41.116);
|
28
|
+
--chart-2: oklch(0.6 0.118 184.704);
|
29
|
+
--chart-3: oklch(0.398 0.07 227.392);
|
30
|
+
--chart-4: oklch(0.828 0.189 84.429);
|
31
|
+
--chart-5: oklch(0.769 0.188 70.08);
|
32
|
+
--sidebar: oklch(0.985 0 0);
|
33
|
+
--sidebar-foreground: oklch(0.141 0.005 285.823);
|
34
|
+
--sidebar-primary: oklch(0.21 0.006 285.885);
|
35
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
36
|
+
--sidebar-accent: oklch(0.967 0.001 286.375);
|
37
|
+
--sidebar-accent-foreground: oklch(0.21 0.006 285.885);
|
38
|
+
--sidebar-border: oklch(0.92 0.004 286.32);
|
39
|
+
--sidebar-ring: oklch(0.705 0.015 286.067);
|
40
|
+
}
|
41
|
+
.shadcn-classless.dark-mode {
|
42
|
+
--background: oklch(0.141 0.005 285.823);
|
43
|
+
--foreground: oklch(0.985 0 0);
|
44
|
+
--card: oklch(0.21 0.006 285.885);
|
45
|
+
--card-foreground: oklch(0.985 0 0);
|
46
|
+
--popover: oklch(0.21 0.006 285.885);
|
47
|
+
--popover-foreground: oklch(0.985 0 0);
|
48
|
+
--primary: oklch(0.92 0.004 286.32);
|
49
|
+
--primary-foreground: oklch(0.21 0.006 285.885);
|
50
|
+
--secondary: oklch(0.274 0.006 286.033);
|
51
|
+
--secondary-foreground: oklch(0.985 0 0);
|
52
|
+
--muted: oklch(0.274 0.006 286.033);
|
53
|
+
--muted-foreground: oklch(0.705 0.015 286.067);
|
54
|
+
--accent: oklch(0.274 0.006 286.033);
|
55
|
+
--accent-foreground: oklch(0.985 0 0);
|
56
|
+
--destructive: oklch(0.704 0.191 22.216);
|
57
|
+
--border: oklch(1 0 0 / 10%);
|
58
|
+
--input: oklch(1 0 0 / 15%);
|
59
|
+
--ring: oklch(0.552 0.016 285.938);
|
60
|
+
--chart-1: oklch(0.488 0.243 264.376);
|
61
|
+
--chart-2: oklch(0.696 0.17 162.48);
|
62
|
+
--chart-3: oklch(0.769 0.188 70.08);
|
63
|
+
--chart-4: oklch(0.627 0.265 303.9);
|
64
|
+
--chart-5: oklch(0.645 0.246 16.439);
|
65
|
+
--sidebar: oklch(0.21 0.006 285.885);
|
66
|
+
--sidebar-foreground: oklch(0.985 0 0);
|
67
|
+
--sidebar-primary: oklch(0.488 0.243 264.376);
|
68
|
+
--sidebar-primary-foreground: oklch(0.985 0 0);
|
69
|
+
--sidebar-accent: oklch(0.274 0.006 286.033);
|
70
|
+
--sidebar-accent-foreground: oklch(0.985 0 0);
|
71
|
+
--sidebar-border: oklch(1 0 0 / 10%);
|
72
|
+
--sidebar-ring: oklch(0.552 0.016 285.938);
|
73
|
+
}
|
74
|
+
.shadcn-classless *,
|
75
|
+
.shadcn-classless ::after,
|
76
|
+
.shadcn-classless ::before {
|
77
|
+
box-sizing: border-box;
|
78
|
+
}
|
79
|
+
.shadcn-classless * {
|
80
|
+
margin: 0;
|
81
|
+
padding: 0;
|
82
|
+
}
|
83
|
+
.shadcn-classless h1,
|
84
|
+
.shadcn-classless h2,
|
85
|
+
.shadcn-classless h3,
|
86
|
+
.shadcn-classless h4,
|
87
|
+
.shadcn-classless h5,
|
88
|
+
.shadcn-classless h6 {
|
89
|
+
margin-bottom: 0.5em;
|
90
|
+
font-weight: 700;
|
91
|
+
}
|
92
|
+
.shadcn-classless h1 {
|
93
|
+
letter-spacing: -0.025em;
|
94
|
+
font-weight: 700;
|
95
|
+
font-size: 1.875rem;
|
96
|
+
line-height: 2.25rem;
|
97
|
+
}
|
98
|
+
.shadcn-classless h2 {
|
99
|
+
letter-spacing: -0.025em;
|
100
|
+
font-weight: 600;
|
101
|
+
font-size: 1.25rem;
|
102
|
+
line-height: 1.75rem;
|
103
|
+
}
|
104
|
+
.shadcn-classless h3 {
|
105
|
+
letter-spacing: -0.025em;
|
106
|
+
font-weight: 600;
|
107
|
+
font-size: 1.125rem;
|
108
|
+
line-height: 1.75rem;
|
109
|
+
}
|
110
|
+
.shadcn-classless h4 {
|
111
|
+
letter-spacing: -0.025em;
|
112
|
+
font-weight: 600;
|
113
|
+
font-size: 16px;
|
114
|
+
line-height: 1.75rem;
|
115
|
+
}
|
116
|
+
.shadcn-classless h5 {
|
117
|
+
font-size: 15px;
|
118
|
+
}
|
119
|
+
.shadcn-classless h6 {
|
120
|
+
font-size: 14px;
|
121
|
+
}
|
122
|
+
.shadcn-classless p {
|
123
|
+
margin-bottom: 1em;
|
124
|
+
}
|
125
|
+
.shadcn-classless a {
|
126
|
+
color: var(--primary);
|
127
|
+
text-decoration: none;
|
128
|
+
}
|
129
|
+
.shadcn-classless a:hover {
|
130
|
+
text-decoration: underline;
|
131
|
+
}
|
132
|
+
.shadcn-classless ul,
|
133
|
+
.shadcn-classless ol {
|
134
|
+
margin-bottom: 1em;
|
135
|
+
padding-left: 1.5em;
|
136
|
+
}
|
137
|
+
.shadcn-classless header,
|
138
|
+
.shadcn-classless main {
|
139
|
+
max-width: 800px;
|
140
|
+
margin: 0 auto;
|
141
|
+
}
|
142
|
+
.shadcn-classless header {
|
143
|
+
margin-bottom: 2rem;
|
144
|
+
}
|
145
|
+
.shadcn-classless header h1 {
|
146
|
+
font-size: 2rem;
|
147
|
+
}
|
148
|
+
.shadcn-classless nav ul {
|
149
|
+
list-style: none;
|
150
|
+
padding: 0;
|
151
|
+
display: flex;
|
152
|
+
gap: 1rem;
|
153
|
+
}
|
154
|
+
.shadcn-classless section {
|
155
|
+
margin-bottom: 2rem;
|
156
|
+
}
|
157
|
+
.shadcn-classless form {
|
158
|
+
display: flex;
|
159
|
+
flex-direction: column;
|
160
|
+
gap: 1rem;
|
161
|
+
}
|
162
|
+
.shadcn-classless input,
|
163
|
+
.shadcn-classless select,
|
164
|
+
.shadcn-classless textarea {
|
165
|
+
font-weight: 500;
|
166
|
+
font: inherit;
|
167
|
+
padding: 0.5rem 0.75rem;
|
168
|
+
border: 1px solid var(--border);
|
169
|
+
border-radius: var(--radius);
|
170
|
+
background-color: var(--background);
|
171
|
+
color: var(--foreground);
|
172
|
+
font-size: 0.875rem;
|
173
|
+
}
|
174
|
+
.shadcn-classless select {
|
175
|
+
appearance: none;
|
176
|
+
-webkit-appearance: none;
|
177
|
+
-moz-appearance: none;
|
178
|
+
background: transparent;
|
179
|
+
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
|
180
|
+
background-repeat: no-repeat;
|
181
|
+
background-position-x: calc(100% - 0.75rem);
|
182
|
+
background-position-y: 50%;
|
183
|
+
}
|
184
|
+
.shadcn-classless input[type='submit'],
|
185
|
+
.shadcn-classless button {
|
186
|
+
font: inherit;
|
187
|
+
cursor: pointer;
|
188
|
+
font-size: 0.875rem;
|
189
|
+
font-weight: 500;
|
190
|
+
padding: 0.5rem 1rem;
|
191
|
+
background-color: var(--primary);
|
192
|
+
color: var(--primary-foreground);
|
193
|
+
border: none;
|
194
|
+
border-radius: var(--radius);
|
195
|
+
transition: background-color 0.2s ease-in-out;
|
196
|
+
}
|
197
|
+
.shadcn-classless input[type='submit']:hover,
|
198
|
+
.shadcn-classless button:hover {
|
199
|
+
background-color: color-mix(in srgb, var(--primary) 90%, transparent);
|
200
|
+
}
|
201
|
+
.shadcn-classless fieldset {
|
202
|
+
border: 1px solid var(--border);
|
203
|
+
border-radius: var(--radius);
|
204
|
+
padding: 1rem;
|
205
|
+
}
|
206
|
+
.shadcn-classless legend {
|
207
|
+
padding: 0 0.5rem;
|
208
|
+
}
|
209
|
+
.shadcn-classless label {
|
210
|
+
display: block;
|
211
|
+
}
|
212
|
+
.shadcn-classless small {
|
213
|
+
color: var(--muted-foreground);
|
214
|
+
}
|
215
|
+
.shadcn-classless figure {
|
216
|
+
margin-bottom: 1rem;
|
217
|
+
overflow: hidden;
|
218
|
+
}
|
219
|
+
.shadcn-classless img {
|
220
|
+
max-width: 100%;
|
221
|
+
height: auto;
|
222
|
+
border-radius: var(--radius);
|
223
|
+
}
|
224
|
+
.shadcn-classless figcaption {
|
225
|
+
font-size: 0.875rem;
|
226
|
+
margin-top: 0.5rem;
|
227
|
+
color: var(--muted-foreground);
|
228
|
+
}
|
229
|
+
.shadcn-classless blockquote {
|
230
|
+
border-left: 4px solid var(--border);
|
231
|
+
padding-left: 1rem;
|
232
|
+
font-style: italic;
|
233
|
+
}
|
234
|
+
.shadcn-classless [type='checkbox'],
|
235
|
+
.shadcn-classless [type='radio'] {
|
236
|
+
margin-right: 0.5rem;
|
237
|
+
}
|
238
|
+
.shadcn-classless progress {
|
239
|
+
width: 100%;
|
240
|
+
}
|
241
|
+
.shadcn-classless dialog {
|
242
|
+
background-color: var(--background);
|
243
|
+
color: var(--foreground);
|
244
|
+
border: 1px solid var(--border);
|
245
|
+
border-radius: var(--radius);
|
246
|
+
padding: 24px;
|
247
|
+
margin: auto;
|
248
|
+
}
|
249
|
+
.shadcn-classless dialog::backdrop {
|
250
|
+
background-color: rgba(0, 0, 0, 0.8);
|
251
|
+
}
|
252
|
+
.shadcn-classless details {
|
253
|
+
border: 1px solid var(--border);
|
254
|
+
border-radius: var(--radius);
|
255
|
+
padding: 0.5rem;
|
256
|
+
margin-bottom: 1rem;
|
257
|
+
}
|
258
|
+
.shadcn-classless summary {
|
259
|
+
cursor: pointer;
|
260
|
+
font-weight: bold;
|
261
|
+
}
|
262
|
+
.shadcn-classless article {
|
263
|
+
border: 1px solid var(--border);
|
264
|
+
border-radius: var(--radius);
|
265
|
+
padding: 1rem;
|
266
|
+
margin-bottom: 1rem;
|
267
|
+
}
|
268
|
+
.shadcn-classless footer {
|
269
|
+
margin-top: 2rem;
|
270
|
+
text-align: center;
|
271
|
+
color: var(--muted-foreground);
|
272
|
+
}
|
273
|
+
.shadcn-classless [aria-busy='true'] {
|
274
|
+
opacity: 0.7;
|
275
|
+
cursor: progress;
|
276
|
+
}
|
277
|
+
@media (max-width: 600px) {
|
278
|
+
.shadcn-classless body {
|
279
|
+
padding: 0.5rem;
|
280
|
+
}
|
281
|
+
.shadcn-classless nav ul {
|
282
|
+
flex-direction: column;
|
283
|
+
}
|
284
|
+
}
|
285
|
+
.shadcn-classless input[type='file']::file-selector-button {
|
286
|
+
border: none;
|
287
|
+
background-color: var(--background);
|
288
|
+
font-weight: 600;
|
289
|
+
}
|
290
|
+
.shadcn-classless *:disabled {
|
291
|
+
cursor: not-allowed;
|
292
|
+
}
|
293
|
+
.shadcn-classless input[type='radio'],
|
294
|
+
.shadcn-classless input[type='checkbox'],
|
295
|
+
.shadcn-classless input[type='range'] {
|
296
|
+
accent-color: var(--primary);
|
297
|
+
background-color: var(--background);
|
298
|
+
}
|
299
|
+
.shadcn-classless kbd {
|
300
|
+
padding: 0.125rem 0.625rem;
|
301
|
+
background-color: var(--primary);
|
302
|
+
color: var(--primary-foreground);
|
303
|
+
border-radius: var(--radius);
|
304
|
+
}
|
305
|
+
.shadcn-classless table {
|
306
|
+
caption-side: bottom;
|
307
|
+
border-collapse: collapse;
|
308
|
+
}
|
309
|
+
.shadcn-classless table caption {
|
310
|
+
color: var(--muted-foreground);
|
311
|
+
margin-top: 1rem;
|
312
|
+
}
|
313
|
+
.shadcn-classless table th {
|
314
|
+
color: var(--muted-foreground);
|
315
|
+
}
|
316
|
+
.shadcn-classless table tr {
|
317
|
+
border-bottom: 1px solid var(--border);
|
318
|
+
}
|
319
|
+
.shadcn-classless table tr:hover {
|
320
|
+
background-color: hsl(var(--muted) / 0.5);
|
321
|
+
}
|
322
|
+
.shadcn-classless table td,
|
323
|
+
.shadcn-classless table th {
|
324
|
+
vertical-align: middle;
|
325
|
+
padding: 0.5rem;
|
326
|
+
text-align: start;
|
327
|
+
}
|
328
|
+
.shadcn-classless table tfoot {
|
329
|
+
background-color: var(--muted);
|
330
|
+
}
|
331
|
+
.shadcn-classless dialog[drawer] {
|
332
|
+
border-bottom-right-radius: 0;
|
333
|
+
border-bottom-left-radius: 0;
|
334
|
+
top: auto;
|
335
|
+
bottom: 0;
|
336
|
+
width: 100vw;
|
337
|
+
max-height: 50vh;
|
338
|
+
}
|
339
|
+
.shadcn-classless dialog[drawer][open] {
|
340
|
+
animation: slideup 0.2s ease-in forwards;
|
341
|
+
}
|
342
|
+
.shadcn-classless dialog > header {
|
343
|
+
margin: 0;
|
344
|
+
}
|
345
|
+
@keyframes slideup {
|
346
|
+
0% {
|
347
|
+
transform: translateY(100%);
|
348
|
+
}
|
349
|
+
100% {
|
350
|
+
transform: translateY(0);
|
351
|
+
}
|
352
|
+
}
|
353
|
+
.shadcn-classless progress {
|
354
|
+
-webkit-appearance: none;
|
355
|
+
-moz-appearance: none;
|
356
|
+
appearance: none;
|
357
|
+
height: 0.5rem;
|
358
|
+
border-radius: 9999px;
|
359
|
+
background-color: var(--muted);
|
360
|
+
border: 0;
|
361
|
+
}
|
362
|
+
.shadcn-classless progress[value]::-webkit-progress-value {
|
363
|
+
border-radius: 9999px;
|
364
|
+
background-color: var(--primary);
|
365
|
+
}
|
366
|
+
.shadcn-classless ::-webkit-progress-bar {
|
367
|
+
border-radius: 9999px;
|
368
|
+
background-color: var(--muted);
|
369
|
+
}
|
370
|
+
.shadcn-classless ::-moz-progress-bar {
|
371
|
+
border-radius: 9999px;
|
372
|
+
background-color: var(--primary);
|
373
|
+
}
|
374
|
+
.shadcn-classless progress:indeterminate {
|
375
|
+
background: var(--muted) linear-gradient(to right, var(--primary) 35%, var(--muted) 35%) top left / 150% 150% no-repeat;
|
376
|
+
animation: progress-indeterminate 1.5s linear infinite;
|
377
|
+
}
|
378
|
+
.shadcn-classless progress:indeterminate::-webkit-progress-bar {
|
379
|
+
background-color: transparent;
|
380
|
+
}
|
381
|
+
.shadcn-classless progress:indeterminate::-moz-progress-bar {
|
382
|
+
background-color: transparent;
|
383
|
+
}
|
384
|
+
@keyframes progress-indeterminate {
|
385
|
+
0% {
|
386
|
+
background-position: 200% 0;
|
387
|
+
}
|
388
|
+
100% {
|
389
|
+
background-position: -200% 0;
|
390
|
+
}
|
391
|
+
}
|
392
|
+
.shadcn-classless hr {
|
393
|
+
border: 0;
|
394
|
+
height: 1px;
|
395
|
+
margin: 1rem 0;
|
396
|
+
background-color: var(--border);
|
397
|
+
flex-shrink: 0;
|
398
|
+
}
|
399
|
+
.shadcn-classless hr[vertical] {
|
400
|
+
width: 1px;
|
401
|
+
height: 1.25rem;
|
402
|
+
margin: 0 1rem;
|
403
|
+
}
|
instaui/spa_router/_functions.py
CHANGED
instaui/static/insta-ui.css
CHANGED
@@ -1 +1 @@
|
|
1
|
-
:where(body){--insta-column-gap: 1rem;height:100vh}:where(
|
1
|
+
:root{color-scheme:light dark}:where(body){--insta-column-gap: 1rem;height:100vh}:where(*){box-sizing:border-box}:where(#app){height:100%}:where(.app-box,.insta-main){height:100%}:where(.insta-main){--insta-padding: 16px;padding:var(--insta-padding, 16px)}
|