-
Notifications
You must be signed in to change notification settings - Fork 7
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
1 parent
8915b7e
commit 328ad02
Showing
9 changed files
with
214 additions
and
2,004 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,22 @@ | ||
{ | ||
"backlog": { | ||
"icon": "<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"mr-2 h-4 w-4 text-muted-foreground\"><path d=\"M0.877075 7.49972C0.877075 3.84204 3.84222 0.876892 7.49991 0.876892C11.1576 0.876892 14.1227 3.84204 14.1227 7.49972C14.1227 11.1574 11.1576 14.1226 7.49991 14.1226C3.84222 14.1226 0.877075 11.1574 0.877075 7.49972ZM7.49991 1.82689C4.36689 1.82689 1.82708 4.36671 1.82708 7.49972C1.82708 10.6327 4.36689 13.1726 7.49991 13.1726C10.6329 13.1726 13.1727 10.6327 13.1727 7.49972C13.1727 4.36671 10.6329 1.82689 7.49991 1.82689ZM8.24993 10.5C8.24993 10.9142 7.91414 11.25 7.49993 11.25C7.08571 11.25 6.74993 10.9142 6.74993 10.5C6.74993 10.0858 7.08571 9.75 7.49993 9.75C7.91414 9.75 8.24993 10.0858 8.24993 10.5ZM6.05003 6.25C6.05003 5.57211 6.63511 4.925 7.50003 4.925C8.36496 4.925 8.95003 5.57211 8.95003 6.25C8.95003 6.74118 8.68002 6.99212 8.21447 7.27494C8.16251 7.30651 8.10258 7.34131 8.03847 7.37854L8.03841 7.37858C7.85521 7.48497 7.63788 7.61119 7.47449 7.73849C7.23214 7.92732 6.95003 8.23198 6.95003 8.7C6.95004 9.00376 7.19628 9.25 7.50004 9.25C7.8024 9.25 8.04778 9.00601 8.05002 8.70417L8.05056 8.7033C8.05924 8.6896 8.08493 8.65735 8.15058 8.6062C8.25207 8.52712 8.36508 8.46163 8.51567 8.37436L8.51571 8.37433C8.59422 8.32883 8.68296 8.27741 8.78559 8.21506C9.32004 7.89038 10.05 7.35382 10.05 6.25C10.05 4.92789 8.93511 3.825 7.50003 3.825C6.06496 3.825 4.95003 4.92789 4.95003 6.25C4.95003 6.55376 5.19628 6.8 5.50003 6.8C5.80379 6.8 6.05003 6.55376 6.05003 6.25Z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"></path></svg>", | ||
"text": "Backlog" | ||
}, | ||
"cancelled": { | ||
"icon": "<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"mr-2 h-4 w-4 text-muted-foreground\"><path d=\"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"></path></svg>", | ||
"text": "Cancelled" | ||
}, | ||
"done": { | ||
"icon": "<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"mr-2 h-4 w-4 text-muted-foreground\"><path d=\"M7.49991 0.877045C3.84222 0.877045 0.877075 3.84219 0.877075 7.49988C0.877075 11.1575 3.84222 14.1227 7.49991 14.1227C11.1576 14.1227 14.1227 11.1575 14.1227 7.49988C14.1227 3.84219 11.1576 0.877045 7.49991 0.877045ZM1.82708 7.49988C1.82708 4.36686 4.36689 1.82704 7.49991 1.82704C10.6329 1.82704 13.1727 4.36686 13.1727 7.49988C13.1727 10.6329 10.6329 13.1727 7.49991 13.1727C4.36689 13.1727 1.82708 10.6329 1.82708 7.49988ZM10.1589 5.53774C10.3178 5.31191 10.2636 5.00001 10.0378 4.84109C9.81194 4.68217 9.50004 4.73642 9.34112 4.96225L6.51977 8.97154L5.35681 7.78706C5.16334 7.59002 4.84677 7.58711 4.64973 7.78058C4.45268 7.97404 4.44978 8.29061 4.64325 8.48765L6.22658 10.1003C6.33054 10.2062 6.47617 10.2604 6.62407 10.2483C6.77197 10.2363 6.90686 10.1591 6.99226 10.0377L10.1589 5.53774Z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"></path></svg>", | ||
"text": "Done" | ||
}, | ||
"progress": { | ||
"icon": "<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"mr-2 h-4 w-4 text-muted-foreground\"><path d=\"M5.49998 0.5C5.49998 0.223858 5.72383 0 5.99998 0H7.49998H8.99998C9.27612 0 9.49998 0.223858 9.49998 0.5C9.49998 0.776142 9.27612 1 8.99998 1H7.99998V2.11922C9.09832 2.20409 10.119 2.56622 10.992 3.13572C11.0116 3.10851 11.0336 3.08252 11.058 3.05806L11.858 2.25806C12.1021 2.01398 12.4978 2.01398 12.7419 2.25806C12.986 2.50214 12.986 2.89786 12.7419 3.14194L11.967 3.91682C13.1595 5.07925 13.9 6.70314 13.9 8.49998C13.9 12.0346 11.0346 14.9 7.49998 14.9C3.96535 14.9 1.09998 12.0346 1.09998 8.49998C1.09998 5.13362 3.69904 2.3743 6.99998 2.11922V1H5.99998C5.72383 1 5.49998 0.776142 5.49998 0.5ZM2.09998 8.49998C2.09998 5.51764 4.51764 3.09998 7.49998 3.09998C10.4823 3.09998 12.9 5.51764 12.9 8.49998C12.9 11.4823 10.4823 13.9 7.49998 13.9C4.51764 13.9 2.09998 11.4823 2.09998 8.49998ZM7.99998 4.5C7.99998 4.22386 7.77612 4 7.49998 4C7.22383 4 6.99998 4.22386 6.99998 4.5V9.5C6.99998 9.77614 7.22383 10 7.49998 10C7.77612 10 7.99998 9.77614 7.99998 9.5V4.5Z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"></path></svg>", | ||
"text": "In Progress" | ||
}, | ||
"todo": { | ||
"icon": "<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" class=\"mr-2 h-4 w-4 text-muted-foreground\"><path d=\"M0.877075 7.49991C0.877075 3.84222 3.84222 0.877075 7.49991 0.877075C11.1576 0.877075 14.1227 3.84222 14.1227 7.49991C14.1227 11.1576 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1576 0.877075 7.49991ZM7.49991 1.82708C4.36689 1.82708 1.82708 4.36689 1.82708 7.49991C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49991C13.1727 4.36689 10.6329 1.82708 7.49991 1.82708Z\" fill=\"currentColor\" fill-rule=\"evenodd\" clip-rule=\"evenodd\"></path></svg>", | ||
"text": "Todo" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,9 +3,9 @@ | |
# AUTOGENERATED! DO NOT EDIT! File to edit: ../ex_nbs/02_cards.ipynb. | ||
|
||
# %% auto 0 | ||
__all__ = ['GalleryCard', 'Left1', 'Card1Svg', 'Card2Svg', 'AppleSvg', 'Left2', 'area_opts', 'severity_opts', 'Right1', | ||
'franken_desc', 'Right2', 'Right3', 'team_members', 'options', 'body', 'Middle1', 'access_roles', 'Middle2', | ||
'Middle3', 'section_content', 'Middle4', 'cards_homepage', 'page'] | ||
__all__ = ['Left1', 'Card1Svg', 'Card2Svg', 'AppleSvg', 'Left2', 'area_opts', 'severity_opts', 'Right1', 'franken_desc', 'Right2', | ||
'Right3', 'team_members', 'options', 'body', 'Middle1', 'access_roles', 'Middle2', 'Middle3', | ||
'section_content', 'Middle4', 'cards_homepage', 'page'] | ||
|
||
# %% ../ex_nbs/02_cards.ipynb 2 | ||
from fasthtml.common import * | ||
|
@@ -14,19 +14,19 @@ | |
import calendar | ||
|
||
# %% ../ex_nbs/02_cards.ipynb 7 | ||
GalleryCard = Card(UkH3("Inline Field Validation"),Br(), | ||
P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'), | ||
header=Img(cls='uk-img',src='public/inline_validation.gif',), | ||
footer=Div(cls=('grid','grid-cols-3', 'gap-12'))( | ||
UkButton('App', cls=UkButtonT.primary), | ||
UkButton('Info'), | ||
UkButton('Code')), | ||
footer_cls='uk-background-muted') | ||
# GalleryCard = Card(UkH3("Inline Field Validation"),Br(), | ||
# P(cls=TextT.muted_sm)('A form with inline field validation on individual inputs with the submit aditionally validating the whole form.'), | ||
# header=Img(cls='uk-img',src='public/inline_validation.gif',), | ||
# footer=Div(cls=('grid','grid-cols-3', 'gap-12'))( | ||
# UkButton('App', cls=UkButtonT.primary), | ||
# UkButton('Info'), | ||
# UkButton('Code')), | ||
# footer_cls='uk-background-muted') | ||
|
||
# %% ../ex_nbs/02_cards.ipynb 9 | ||
Left1 = Card(Div(cls='grid grid-cols-2 gap-6')( | ||
UkButton(Span(cls="uk-margin-small-right", uk_icon="icon: github; ratio: 1"),'Github'), | ||
UkButton(Span(cls="uk-margin-small-right", uk_icon="icon: google; ratio: 1"),'Google')), | ||
UkButton(UkIcon('github',cls='uk-margin-small-right'),'Github'), | ||
UkButton(UkIcon('google',cls='uk-margin-small-right'),'Google')), | ||
UkHSplit("OR CONTINUE WITH", text_cls = (TextB.sz_xsmall, TextB.cl_muted)), | ||
UkInput('Email', 'email', placeholder='[email protected]'), | ||
UkInput('Password', 'Password',placeholder='Password', type='Password'), | ||
|
@@ -42,15 +42,15 @@ | |
# %% ../ex_nbs/02_cards.ipynb 12 | ||
Left2 = Card( | ||
Div(cls='grid grid-cols-3 gap-4')( | ||
UkButton(Div(cls='flex flex-col items-center justify-center')(Card1Svg,"Card"), cls='h-20 w-full border-2 border-primary'), | ||
UkButton(Div(cls='flex flex-col items-center justify-center')(Card2Svg, "Card"), cls='h-20 w-full'), | ||
UkButton(Div(cls='flex flex-col items-center justify-center')(AppleSvg, "Apple"), cls='h-20 w-full')), | ||
UkButton(CenteredContainer(Card1Svg,"Card"), cls='h-20 w-full border-2 border-primary'), | ||
UkButton(CenteredContainer(Card2Svg, "Card"), cls='h-20 w-full'), | ||
UkButton(CenteredContainer(AppleSvg, "Apple"), cls='h-20 w-full')), | ||
Div(cls='space-y-4')( | ||
UkInput('Name', 'name',placeholder='[email protected]'), | ||
UkInput('Card Number', 'card_number',placeholder='[email protected]'), | ||
Div(cls='grid grid-cols-3 gap-4')( | ||
UkSelect(*Options(calendar.month_name[1:],0),label='Expires',id='expire_month'), | ||
UkSelect(*Options(range(2024,2030),0), label='Year', id='expire_year'), | ||
UkSelect(*Options(*calendar.month_name[1:],0),label='Expires',id='expire_month'), | ||
UkSelect(*Options(*range(2024,2030),0), label='Year', id='expire_year'), | ||
UkInput('CVV', 'cvv',placeholder='CVV'))), | ||
header=(UkH3('Payment Method'),P(cls=TextT.muted_sm)('Add a new payment method to your account.'))) | ||
|
||
|
@@ -59,22 +59,22 @@ | |
severity_opts = ('Severity 1 (Highest)', 'Severity 2', 'Severity 3', 'Severity 4 (Lowest)') | ||
Right1 = Card( | ||
Div(cls='grid grid-cols-2 gap-2')( | ||
UkSelect(*Options(area_opts), label='Area', id='area'), | ||
UkSelect(*Options(severity_opts),label='Severity',id='area')), | ||
UkSelect(*Options(*area_opts), label='Area', id='area'), | ||
UkSelect(*Options(*severity_opts),label='Severity',id='area')), | ||
UkInput( label='Subject', placeholder='I need help with'), | ||
UkTextArea( label='Description',placeholder='Please include all information relevant to your issue'), | ||
UkFormLabel(label="Tags",state="danger", value="Spam,Invalid"), | ||
header=(H3('Report an issue'),P(cls=TextT.muted_sm)('What area are you having problems with')), | ||
footer = (UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit')), | ||
footer_cls='flex justify-between') | ||
footer = FullySpacedContainer(UkButton(cls=UkButtonT.ghost)('Cancel'),UkButton(cls=UkButtonT.primary)('Submit'))) | ||
|
||
|
||
# %% ../ex_nbs/02_cards.ipynb 16 | ||
franken_desc ="HTML-first, framework-agnostic, beautifully designed components that you can truly copy and paste into your site. Accessible. Customizable. Open Source." | ||
Right2 = Card(UkH4("franken/ui"), | ||
P(cls=TextT.muted_sm)(franken_desc), | ||
Div(cls=('flex','gap-x-4',TextT.muted_sm))( | ||
Div(cls='flex items-center')("TypeScript"), | ||
Div(cls='flex items-center')(Span(uk_icon='star'),"20k"),"Updated April 2023")) | ||
Div(cls='flex items-center')(UkIcon('star'),"20k"),"Updated April 2023")) | ||
|
||
# %% ../ex_nbs/02_cards.ipynb 18 | ||
Right3 = Card( | ||
|
@@ -91,9 +91,9 @@ | |
team_members = [{"name": "Sofia Davis", "email": "[email protected]", "role": "Owner"},{"name": "Jackson Lee", "email": "[email protected]", "role": "Member"},] | ||
|
||
options = ((Div('Viewer'),Div(cls=TextT.muted_sm)('Can view and comment.',)), | ||
(Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)), | ||
(Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)), | ||
(Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),) | ||
(Div('Developer'),Div(cls=TextT.muted_sm)('Can view, comment and edit.',)), | ||
(Div('Billing'),Div(cls=TextT.muted_sm)('Can view, comment and manage billing.',)), | ||
(Div('Owner'),Div(cls=TextT.muted_sm)('Admin-level to all resources.')),) | ||
|
||
body = [Div(cls='flex items-center space-x-4')( | ||
Span(cls='relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-accent')( | ||
|
@@ -128,7 +128,7 @@ | |
Div(cls='flex-1')( | ||
P(member['name'], cls='text-sm font-medium leading-none'), | ||
P(member['email'], cls=TextT.muted_sm)), | ||
UkSelect(*Options(access_roles, access_roles.index(member['role'])))) for member in team_members], | ||
UkSelect(*Options(*access_roles, selected_idx=access_roles.index(member['role'])))) for member in team_members], | ||
header = (UkH4('Share this document'),Div('Anyone with the link can view this document.', cls=('mt-1.5',TextT.muted_sm)))) | ||
|
||
# %% ../ex_nbs/02_cards.ipynb 25 | ||
|
@@ -150,7 +150,7 @@ | |
# %% ../ex_nbs/02_cards.ipynb 30 | ||
def page(): | ||
return Title("Custom"),Div(cls='uk-child-width-1-3@l uk-child-width-1-2@m', uk_grid=True)( | ||
Div(cls='space-y-6')(map(Div,(Left1,Left2,GalleryCard))), | ||
Div(cls='space-y-6')(map(Div,(Left1,Left2))), | ||
Div(cls='space-y-6')(map(Div,(Middle1,Middle2,Middle3,Middle4))), | ||
Div(cls='space-y-6')(map(Div,(Right1,Right2, Right3)))) | ||
|
||
|
Oops, something went wrong.