-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
145 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.db | ||
*.py[cod] | ||
.web | ||
__pycache__/ |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# This file has been modified by the Nextpy Team in 2023 using AI tools and automation scripts. | ||
# We have rigorously tested these modifications to ensure reliability and performance. Based on successful test results, we are confident in the quality and stability of these changes. | ||
|
54 changes: 54 additions & 0 deletions
54
app-examples/unstyled_example/unstyled_example/unstyled_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import nextpy as xt | ||
|
||
|
||
class CounterState(xt.State): | ||
value: int = 0 | ||
|
||
def change_value(self, amount): | ||
self.value += amount | ||
|
||
|
||
def create_button(label, amount): | ||
return xt.unstyled.button( | ||
label, | ||
on_click=lambda: CounterState.change_value(amount) | ||
) | ||
|
||
|
||
def index() -> xt.Component: | ||
heading_color = xt.match( | ||
CounterState.value, | ||
(0, "red"), | ||
(4, "blue"), | ||
(8, "green"), | ||
(12, "orange"), | ||
(16, "lime"), | ||
(20, "orange"), | ||
"black" | ||
) | ||
|
||
return xt.unstyled.flex( | ||
xt.unstyled.heading( | ||
CounterState.value, | ||
color="white", | ||
background_color=heading_color, | ||
as_="h2" | ||
), | ||
xt.unstyled.flex( | ||
create_button("decrement", -1), | ||
create_button("increment", 1), | ||
gap="2" | ||
), | ||
align_items="center", | ||
direction="column", | ||
gap="2" | ||
) | ||
|
||
|
||
# Global styles defined as a Python dictionary | ||
style = { | ||
"text_align": "center", | ||
} | ||
|
||
app = xt.App(style=style) | ||
app.add_page(index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import nextpy as xt | ||
|
||
config = xt.Config( | ||
app_name="unstyled_example", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,3 @@ | |
from .react_player import * | ||
from .recharts import * | ||
from .suneditor import * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
# This file has been modified by the Nextpy Team in 2023 using AI tools and automation scripts. | ||
# We have rigorously tested these modifications to ensure reliability and performance. Based on successful test results, we are confident in the quality and stability of these changes. | ||
|
||
"""Contains proxy components.""" | ||
|
||
from .animation import animation | ||
from .unstyled import * # Make sure this line is correctly importing headless | ||
|
||
__all__ = ["animation"] | ||
__all__ = ["animation", "headless"] |
Oops, something went wrong.