Skip to content

Commit 64c3168

Browse files
committed
IDs
1 parent b335f0c commit 64c3168

4 files changed

Lines changed: 133 additions & 133 deletions

File tree

monsterui/core.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_core.ipynb.
22

3-
# %% auto 0
3+
# %% auto #0
44
__all__ = ['HEADER_URLS', 'daisy_styles', 'scrollspy_style', 'fast_app', 'FastHTML', 'ThemeRadii', 'ThemeShadows', 'ThemeFont',
55
'Theme']
66

7-
# %% ../nbs/01_core.ipynb
7+
# %% ../nbs/01_core.ipynb #30ffe3c5
88
import fasthtml.common as fh
99
from .foundations import *
1010
from fasthtml.common import FastHTML, fast_app
@@ -13,7 +13,7 @@
1313
import httpx
1414
from pathlib import Path
1515

16-
# %% ../nbs/01_core.ipynb
16+
# %% ../nbs/01_core.ipynb #3a6dce31
1717
@delegates(fh.fast_app, but=['pico'])
1818
def fast_app(*args, pico=False, **kwargs):
1919
"Create a FastHTML or FastHTMLWithLiveReload app with `bg-background text-foreground` to bodykw for frankenui themes"
@@ -22,7 +22,7 @@ def fast_app(*args, pico=False, **kwargs):
2222
kwargs['bodykw']['class'] = stringify((kwargs['bodykw']['class'],'bg-background text-foreground'))
2323
return fh.fast_app(*args, pico=pico, **kwargs)
2424

25-
# %% ../nbs/01_core.ipynb
25+
# %% ../nbs/01_core.ipynb #4f92ea74
2626
@delegates(fh.FastHTML, but=['pico'])
2727
def FastHTML(*args, pico=False, **kwargs):
2828
"Create a FastHTML app and adds `bg-background text-foreground` to bodykw for frankenui themes"
@@ -32,7 +32,7 @@ def FastHTML(*args, pico=False, **kwargs):
3232
bodykw = kwargs.pop('bodykw',{})
3333
return fh.FastHTML(*args, pico=pico, **bodykw, **kwargs)
3434

35-
# %% ../nbs/01_core.ipynb
35+
# %% ../nbs/01_core.ipynb #05dba615
3636
class ThemeRadii(VEnum):
3737
none = 'uk-radii-none'
3838
sm = 'uk-radii-sm'
@@ -49,7 +49,7 @@ class ThemeFont:
4949
sm = 'uk-font-sm'
5050
default = 'uk-font-base'
5151

52-
# %% ../nbs/01_core.ipynb
52+
# %% ../nbs/01_core.ipynb #d91013c7
5353
def _headers_theme(color, mode='auto', radii=ThemeRadii.sm, shadows=ThemeShadows.sm, font=ThemeFont.sm):
5454
franken_init = '''
5555
const __FRANKEN__ = JSON.parse(localStorage.getItem("__FRANKEN__") || "{}");
@@ -81,7 +81,7 @@ def _headers_theme(color, mode='auto', radii=ThemeRadii.sm, shadows=ThemeShadows
8181
htmlElement.classList.add(__FRANKEN__.font || "{font}");
8282
''')
8383

84-
# %% ../nbs/01_core.ipynb
84+
# %% ../nbs/01_core.ipynb #6de50d9f
8585
HEADER_URLS = {
8686
'franken_css': "https://cdn.jsdelivr.net/npm/franken-ui@2.0.0/dist/css/core.min.css",
8787
'franken_js_core': "https://cdn.jsdelivr.net/npm/franken-ui@2.0.0/dist/js/core.iife.js",
@@ -105,7 +105,7 @@ def _download_resource(url, static_dir):
105105
fname.write_bytes(content)
106106
return (url[0], f"/{static_dir}/{fname.name}")
107107

108-
# %% ../nbs/01_core.ipynb
108+
# %% ../nbs/01_core.ipynb #86577ea3
109109
daisy_styles = Style("""
110110
:root {
111111
--b1: from hsl(var(--background)) l c h;
@@ -137,7 +137,7 @@ def _download_resource(url, static_dir):
137137
""")
138138

139139

140-
# %% ../nbs/01_core.ipynb
140+
# %% ../nbs/01_core.ipynb #175d2fd7
141141
scrollspy_style= Style('''
142142
.monster-navbar.navbar-bold a {
143143
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
@@ -166,7 +166,7 @@ def _download_resource(url, static_dir):
166166
}
167167
''')
168168

169-
# %% ../nbs/01_core.ipynb
169+
# %% ../nbs/01_core.ipynb #e25b731e
170170
class Theme(Enum):
171171
"Selector to choose theme and get all headers needed for app. Includes frankenui + tailwind + daisyui + highlight.js options"
172172
def _generate_next_value_(name, start, count, last_values): return name

monsterui/daisy.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/03_daisy.ipynb.
22

3-
# %% auto 0
3+
# %% auto #0
44
__all__ = ['AlertT', 'Alert', 'StepsT', 'StepT', 'Steps', 'LiStep', 'LoadingT', 'Loading', 'ToastHT', 'ToastVT', 'Toast']
55

6-
# %% ../nbs/03_daisy.ipynb
6+
# %% ../nbs/03_daisy.ipynb #d623c13c
77
import fasthtml.common as fh
88
from .foundations import *
99
from fasthtml.common import Div, Span, FT
@@ -12,7 +12,7 @@
1212
from fastcore.all import *
1313

1414

15-
# %% ../nbs/03_daisy.ipynb
15+
# %% ../nbs/03_daisy.ipynb #60694dc8
1616
class AlertT(VEnum):
1717
"Alert styles from DaisyUI"
1818
def _generate_next_value_(name, start, count, last_values): return f"alert-{name}"
@@ -21,22 +21,22 @@ def _generate_next_value_(name, start, count, last_values): return f"alert-{name
2121
warning = auto()
2222
error = auto()
2323

24-
# %% ../nbs/03_daisy.ipynb
24+
# %% ../nbs/03_daisy.ipynb #b2109995
2525
def Alert(*c, # Content for Alert (often text and/or icon)
2626
cls='', # Class for the alert (often an `AlertT` option)
2727
**kwargs # Additional arguments for outer Div
2828
)->FT: # Div(Span(...), cls='alert', role='alert')
2929
"Alert informs users about important events."
3030
return Div(Span(*c), cls=('alert', stringify(cls)), role='alert', **kwargs)
3131

32-
# %% ../nbs/03_daisy.ipynb
32+
# %% ../nbs/03_daisy.ipynb #1f043eaf
3333
class StepsT(VEnum):
3434
"Options for Steps"
3535
def _generate_next_value_(name, start, count, last_values): return f'steps-{name}'
3636
vertical = auto()
3737
horizonal = auto()
3838

39-
# %% ../nbs/03_daisy.ipynb
39+
# %% ../nbs/03_daisy.ipynb #c37ed9f9
4040
class StepT(VEnum):
4141
'Step styles for LiStep'
4242
def _generate_next_value_(name, start, count, last_values): return f'step-{name}'
@@ -49,7 +49,7 @@ def _generate_next_value_(name, start, count, last_values): return f'step-{name}
4949
error = auto()
5050
neutral = auto()
5151

52-
# %% ../nbs/03_daisy.ipynb
52+
# %% ../nbs/03_daisy.ipynb #21a7d741
5353
def Steps(*li, # Each `Li` represent a step (generally use `LiStep`)
5454
cls='', # class for Steps (generally a `StepsT` option)
5555
**kwargs # Additional args for outer wrapper (`Ul` component)
@@ -65,7 +65,7 @@ def LiStep(*c, # Description for Step that goes next to bubble (often text)
6565
"Creates a step list item"
6666
return Li(*c, cls=('step', stringify(cls)), data_content=data_content, **kwargs)
6767

68-
# %% ../nbs/03_daisy.ipynb
68+
# %% ../nbs/03_daisy.ipynb #5e8838cf
6969
class LoadingT(VEnum):
7070
def _generate_next_value_(name, start, count, last_values): return f'loading-{name}'
7171
spinner = auto()
@@ -80,7 +80,7 @@ def _generate_next_value_(name, start, count, last_values): return f'loading-{na
8080
md = 'loading-medium'
8181
lg = 'loading-large'
8282

83-
# %% ../nbs/03_daisy.ipynb
83+
# %% ../nbs/03_daisy.ipynb #a7902bff
8484
def Loading(cls=(LoadingT.bars, LoadingT.lg), # Classes for indicator (generally `LoadingT` options)
8585
htmx_indicator=False, # Add htmx-indicator class
8686
**kwargs # additional args for outer conainter (`Span`)
@@ -90,7 +90,7 @@ def Loading(cls=(LoadingT.bars, LoadingT.lg), # Classes for indicator (generally
9090
if htmx_indicator: classes.append('htmx-indicator')
9191
return Span(cls=classes, **kwargs)
9292

93-
# %% ../nbs/03_daisy.ipynb
93+
# %% ../nbs/03_daisy.ipynb #a2c99d2e
9494
class ToastHT(VEnum):
9595
"Horizontal position for Toast"
9696
def _generate_next_value_(name, start, count, last_values): return f'toast-{name}'
@@ -105,7 +105,7 @@ def _generate_next_value_(name, start, count, last_values): return f'toast-{name
105105
middle = auto()
106106
bottom = auto()
107107

108-
# %% ../nbs/03_daisy.ipynb
108+
# %% ../nbs/03_daisy.ipynb #c57bac21
109109
def Toast(*c, # Content for toast (often test)
110110
cls='', # Classes for toast (often `ToastHT` and `ToastVT` options)
111111
alert_cls='', # classes for altert (often `AlertT` options)

monsterui/foundations.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@
22

33
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_foundation.ipynb.
44

5-
# %% auto 0
5+
# %% auto #0
66
__all__ = ['stringify', 'str2ukcls', 'VEnum']
77

8-
# %% ../nbs/00_foundation.ipynb
8+
# %% ../nbs/00_foundation.ipynb #f75dd4c3
99
from enum import Enum, auto
1010
from fastcore.all import *
1111

12-
# %% ../nbs/00_foundation.ipynb
12+
# %% ../nbs/00_foundation.ipynb #cd27da11
1313
# need a better name, stringify might be too general for what it does
1414
def stringify(o # String, Tuple, or Enum options we want stringified
1515
): # String that can be passed FT comp args (such as `cls=`)
1616
"Converts input types into strings that can be passed to FT components"
1717
if is_listy(o): return ' '.join(map(str,o)) if o else ""
1818
return o.__str__()
1919

20-
# %% ../nbs/00_foundation.ipynb
20+
# %% ../nbs/00_foundation.ipynb #4a38717d
2121
def str2ukcls(base, txt): return f"uk-{base}-{txt.replace('_', '-')}".strip('-')
2222

23-
# %% ../nbs/00_foundation.ipynb
23+
# %% ../nbs/00_foundation.ipynb #8682039b
2424
class VEnum(Enum):
2525
def __str__(self): return self.value
2626
def __add__(self, other): return stringify((self,other))

0 commit comments

Comments
 (0)