Skip to content

Commit 9bbf84a

Browse files
Curtis AllanCurtis Allan
Curtis Allan
authored and
Curtis Allan
committed
Changed sheet & dialog close button to match proper shadcn implementation
1 parent 76ac7ab commit 9bbf84a

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

docs/comp_code.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def get(sess):
329329
title="Edit Profile",
330330
description="Make changes to your profile here. Click save when you're done.",
331331
footer=Div(
332-
DialogCloseButton("Save changes"), cls="flex w-full justify-end"
332+
DialogClose("Save changes"), cls="flex w-full justify-end"
333333
),
334334
id="demo-dialog",
335335
)""",
@@ -364,7 +364,7 @@ def get(sess):
364364
),
365365
cls="grid gap-4 py-4",
366366
),
367-
DialogFooter(DialogCloseButton("Save changes")),
367+
DialogFooter(DialogClose("Save changes")),
368368
cls="sm:max-w-[425px]",
369369
),
370370
standard=True,
@@ -549,7 +549,7 @@ def table_rows():
549549
),
550550
title="Demo Sheet",
551551
description="This is a demo sheet.",
552-
footer=SheetCloseButton("Close", cls="w-full"),
552+
footer=SheetClose("Close", cls="w-full"),
553553
trigger="Toggle Sheet",
554554
id="demo-sheet",
555555
)""",
@@ -581,7 +581,7 @@ def table_rows():
581581
),
582582
cls="grid gap-4 py-4",
583583
),
584-
SheetFooter(SheetCloseButton("Close")),
584+
SheetFooter(SheetClose("Close")),
585585
),
586586
standard=True,
587587
)""",

docs/comp_demos.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ def DialogAltBlock():
643643
),
644644
cls="grid gap-4 py-4",
645645
),
646-
DialogFooter(DialogCloseButton("Save changes")),
646+
DialogFooter(DialogClose("Save changes")),
647647
cls="sm:max-w-[425px]",
648648
),
649649
standard=True,
@@ -679,7 +679,7 @@ def dialog_block():
679679
description="Make changes to your profile here. Click save when you're done.",
680680
trigger="Toggle Dialog",
681681
footer=Div(
682-
DialogCloseButton("Save changes"), cls="flex w-full justify-end"
682+
DialogClose("Save changes"), cls="flex w-full justify-end"
683683
),
684684
),
685685
id="dialog",
@@ -922,7 +922,7 @@ def sheet_block():
922922
),
923923
title="Demo Sheet",
924924
description="This is a demo sheet.",
925-
footer=SheetCloseButton("Close", cls="w-full"),
925+
footer=SheetClose("Close", cls="w-full"),
926926
trigger="Toggle Sheet",
927927
),
928928
id="sheet",
@@ -958,7 +958,7 @@ def SheetAltBlock():
958958
),
959959
cls="grid gap-4 py-4",
960960
),
961-
SheetFooter(SheetCloseButton("Close")),
961+
SheetFooter(SheetClose("Close")),
962962
),
963963
standard=True,
964964
),

docs/md/dialog_template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ app, rt = fast_app(pico=False, hdrs=(ShadHead(),))
1818

1919
The dialog component has two methods of implementation. The first method is the FastHtml method for a simpler implementation, and the second method is the standard method for a more Shadcn-ui like implementation.
2020

21-
If you wish to use a button to close the dialog from within, you can use the `DialogCloseButton` component, or simply apply the `dialog-close-button` class to a component.
21+
If you wish to use a button to close the dialog from within, you can use the `DialogClose` component, or simply apply the `dialog-close-button` class to a component.
2222

2323
### FT Method
2424

@@ -32,7 +32,7 @@ Dialog(
3232
trigger="Edit Todo",
3333
title="Edit Todo",
3434
description="Edit the todo item. Click the 'Save' button to save it.",
35-
footer=Div(DialogCloseButton("Save changes")),
35+
footer=Div(DialogClose("Save changes")),
3636
state="closed",
3737
)
3838
```
@@ -77,7 +77,7 @@ Dialog(
7777
),
7878
cls="grid gap-4 py-4",
7979
),
80-
DialogFooter(DialogCloseButton("Save changes")),
80+
DialogFooter(DialogClose("Save changes")),
8181
cls="sm:max-w-[425px]",
8282
state="closed",
8383
),

docs/md/sheet_template.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ app, rt = fast_app(pico=False, hdrs=(ShadHead(),))
1818

1919
The sheet component has two methods of implementation. The first method is the FastHtml method for a simpler implementation, and the second method is the standard method for a more Shadcn-ui like implementation.
2020

21-
If you wish to use a button to close the dialog from within, you can use the `SheetCloseButton` component, or simply apply the `sheet-close-button` class to a component.
21+
If you wish to use a button to close the dialog from within, you can use the `SheetClose` component, or simply apply the `sheet-close-button` class to a component.
2222

2323
### FT Method
2424

@@ -36,7 +36,7 @@ Sheet(
3636
),
3737
title="Demo Sheet",
3838
description="This is a demo sheet.",
39-
footer=SheetCloseButton("Close", cls="w-full"),
39+
footer=SheetClose("Close", cls="w-full"),
4040
trigger="Toggle Sheet",
4141
)
4242
```
@@ -79,7 +79,7 @@ Sheet(
7979
),
8080
cls="grid gap-4 py-4",
8181
),
82-
SheetFooter(SheetCloseButton("Close")),
82+
SheetFooter(SheetClose("Close")),
8383
),
8484
standard=True,
8585
)

llms.txt

Whitespace-only changes.

shad4fast/src/shad4fast/__about__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-FileCopyrightText: 2024-present Curtis Allan <[email protected]>
22
#
33
# SPDX-License-Identifier: MIT
4-
__version__ = "1.2.0"
4+
__version__ = "1.2.1"

shad4fast/src/shad4fast/components/dialog.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"DialogHeader",
88
"DialogFooter",
99
"DialogTitle",
10-
"DialogCloseButton",
10+
"DialogClose",
1111
"DialogDescription",
1212
"DialogContent",
1313
"DialogTrigger",
@@ -46,7 +46,7 @@ def DialogTitle(*c, cls=None, **kwargs):
4646
return H1(*c, **kwargs)
4747

4848

49-
def DialogCloseButton(*c, cls=None, **kwargs):
49+
def DialogClose(*c, cls=None, **kwargs):
5050
new_cls = "dialog-close-button"
5151
if cls:
5252
new_cls += f" {cls}"

shad4fast/src/shad4fast/components/sheet.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
__all__ = [
66
"Sheet",
7-
"SheetCloseButton",
7+
"SheetClose",
88
"SheetContent",
99
"SheetHeader",
1010
"SheetTitle",
@@ -81,7 +81,7 @@ def Sheet(
8181
)
8282

8383

84-
def SheetCloseButton(*c, cls=None, **kwargs):
84+
def SheetClose(*c, cls=None, **kwargs):
8585
new_cls = "sheet-close-button"
8686
if cls:
8787
new_cls += f" {cls}"

shad4fast/v0-prompt.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Generate a {INSERT COMPONENT/S HERE}. It should have no comments within the code, className should be replaced with 'cls', and any icons used should be structured as '<Lucide icon="{icon name}" />', where the icon attribute is a valid icon name from the 'lucide-static' library (NOT lucide-react). It should not use any charts or react/jsx functionality (NO state/ maps etc). It should rely purely on the Shadcn/UI library for handling view toggles and state updates, as per the most recent documentation. There should be no dynamic tailwind class rendering. All styles and components should be hardcoded. Skip ALL import and export statements, and simply have a return statement that returns the code itself (e.g. return(<div>...)). All Card, Alert, Dialog, Table, Carousel, Sheet and Select components, if included, should have an attribute of 'standard' that is set to true.

0 commit comments

Comments
 (0)