|
@@ -3,6 +3,7 @@
|
|
from __future__ import annotations
|
|
from __future__ import annotations
|
|
|
|
|
|
from reflex.components.component import Component
|
|
from reflex.components.component import Component
|
|
|
|
+from reflex.components.core.breakpoints import Responsive
|
|
from reflex.vars.base import Var
|
|
from reflex.vars.base import Var
|
|
|
|
|
|
from ..base import LiteralAlign, LiteralSpacing
|
|
from ..base import LiteralAlign, LiteralSpacing
|
|
@@ -13,10 +14,10 @@ class Stack(Flex):
|
|
"""A stack component."""
|
|
"""A stack component."""
|
|
|
|
|
|
# The spacing between each stack item.
|
|
# The spacing between each stack item.
|
|
- spacing: Var[LiteralSpacing] = Var.create("3")
|
|
|
|
|
|
+ spacing: Var[Responsive[LiteralSpacing]] = Var.create("3")
|
|
|
|
|
|
# The alignment of the stack items.
|
|
# The alignment of the stack items.
|
|
- align: Var[LiteralAlign] = Var.create("start")
|
|
|
|
|
|
+ align: Var[Responsive[LiteralAlign]] = Var.create("start")
|
|
|
|
|
|
@classmethod
|
|
@classmethod
|
|
def create(
|
|
def create(
|
|
@@ -49,14 +50,14 @@ class VStack(Stack):
|
|
"""A vertical stack component."""
|
|
"""A vertical stack component."""
|
|
|
|
|
|
# The direction of the stack.
|
|
# The direction of the stack.
|
|
- direction: Var[LiteralFlexDirection] = Var.create("column")
|
|
|
|
|
|
+ direction: Var[Responsive[LiteralFlexDirection]] = Var.create("column")
|
|
|
|
|
|
|
|
|
|
class HStack(Stack):
|
|
class HStack(Stack):
|
|
"""A horizontal stack component."""
|
|
"""A horizontal stack component."""
|
|
|
|
|
|
# The direction of the stack.
|
|
# The direction of the stack.
|
|
- direction: Var[LiteralFlexDirection] = Var.create("row")
|
|
|
|
|
|
+ direction: Var[Responsive[LiteralFlexDirection]] = Var.create("row")
|
|
|
|
|
|
|
|
|
|
stack = Stack.create
|
|
stack = Stack.create
|