fh-matui 0.9.13__py3-none-any.whl → 0.9.14__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fh_matui/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.9.12"
1
+ __version__ = "0.9.13"
fh_matui/_modidx.py CHANGED
@@ -54,6 +54,7 @@ d = { 'settings': { 'branch': 'master',
54
54
  'fh_matui.components.NavSideBarLinks': ('components.html#navsidebarlinks', 'fh_matui/components.py'),
55
55
  'fh_matui.components.NavSubtitle': ('components.html#navsubtitle', 'fh_matui/components.py'),
56
56
  'fh_matui.components.NavToggleButton': ('components.html#navtogglebutton', 'fh_matui/components.py'),
57
+ 'fh_matui.components.Page': ('components.html#page', 'fh_matui/components.py'),
57
58
  'fh_matui.components.Pagination': ('components.html#pagination', 'fh_matui/components.py'),
58
59
  'fh_matui.components.Progress': ('components.html#progress', 'fh_matui/components.py'),
59
60
  'fh_matui.components.Q': ('components.html#q', 'fh_matui/components.py'),
fh_matui/components.py CHANGED
@@ -10,9 +10,9 @@ __all__ = ['BUTTON_SPECIALS', 'ButtonT', 'ANCHOR_SPECIALS', 'AT', 'NavToggleButt
10
10
  'FormGrid', 'Progress', 'LoadingIndicator', 'Table', 'Td', 'Th', 'Thead', 'Tbody', 'Tfoot', 'TableFromLists',
11
11
  'TableFromDicts', 'TableControls', 'Pagination', 'Card', 'Toolbar', 'Toast', 'Snackbar', 'ContainerT',
12
12
  'FormField', 'FormModal', 'NavContainer', 'NavHeaderLi', 'NavDividerLi', 'NavCloseLi', 'NavSubtitle',
13
- 'BottomNav', 'NavSideBarHeader', 'NavSideBarLinks', 'NavSideBarContainer', 'Layout', 'TextT', 'TextPresets',
14
- 'CodeSpan', 'CodeBlock', 'Blockquote', 'Q', 'Em', 'Strong', 'Small', 'Mark', 'Abbr', 'Sub', 'Sup', 'FAQItem',
15
- 'CookiesBanner']
13
+ 'BottomNav', 'NavSideBarHeader', 'NavSideBarLinks', 'NavSideBarContainer', 'Page', 'Layout', 'TextT',
14
+ 'TextPresets', 'CodeSpan', 'CodeBlock', 'Blockquote', 'Q', 'Em', 'Strong', 'Small', 'Mark', 'Abbr', 'Sub',
15
+ 'Sup', 'FAQItem', 'CookiesBanner']
16
16
 
17
17
  # %% ../nbs/02_components.ipynb 2
18
18
  from fastcore.utils import *
@@ -339,7 +339,7 @@ def NavBar(*children, brand=None, sticky=False, cls='', size='small',
339
339
  hx_target: Target element for boosted links (default '#main-content')
340
340
  """
341
341
  size_cls = size if size else ''
342
- nav_cls = f"{'sticky top' if sticky else ''} surface-container {size_cls} {cls}".strip()
342
+ nav_cls = f"{'sticky top' if sticky else ''} surface {size_cls} {cls}".strip()
343
343
 
344
344
  # HTMX SPA optimizations
345
345
  if hx_boost: kwargs['hx_boost'] = 'true'
@@ -1115,7 +1115,7 @@ def NavSideBarContainer(*children, position='left', size='m', cls='', active=Fal
1115
1115
  if 'HX-Request' in req.headers: return content # HTMX swap
1116
1116
  return Layout(content) # Full page load
1117
1117
  """
1118
- base_cls = f"{size} {position} surface-container"
1118
+ base_cls = f"{size} {position} surface"
1119
1119
  if active: base_cls += " active"
1120
1120
  nav_cls = f"{base_cls} {cls}".strip()
1121
1121
 
@@ -1128,6 +1128,26 @@ def NavSideBarContainer(*children, position='left', size='m', cls='', active=Fal
1128
1128
 
1129
1129
  # %% ../nbs/02_components.ipynb 107
1130
1130
  #| code-fold: true
1131
+ def Page(*c, active=True, position=None, cls='', **kwargs):
1132
+ """BeerCSS animated page container.
1133
+
1134
+ Pages are containers that can be a main page, multiple pages, or animated elements.
1135
+
1136
+ Args:
1137
+ active: Show page (default True)
1138
+ position: Animation direction - 'left', 'right', 'top', 'bottom' (optional)
1139
+ cls: Additional classes
1140
+
1141
+ Example:
1142
+ Page(H1("Dashboard"), P("Content here")) # Default active page
1143
+ Page(content, position='right') # Slide from right animation
1144
+ """
1145
+ page_cls = ['page']
1146
+ if active: page_cls.append('active')
1147
+ if position: page_cls.append(position)
1148
+ if cls: page_cls.extend(normalize_tokens(cls))
1149
+ return Div(*c, cls=stringify(page_cls), **kwargs)
1150
+
1131
1151
  def Layout(*content, sidebar=None, sidebar_links=None, nav_bar=None, container_size=ContainerT.expand,
1132
1152
  main_bg='surface', sidebar_id='app-sidebar', main_id='main-content', cls='', **kwargs):
1133
1153
  """App layout with HTMX SPA navigation.
@@ -1150,7 +1170,7 @@ def Layout(*content, sidebar=None, sidebar_links=None, nav_bar=None, container_s
1150
1170
  # Build content wrapper with history caching
1151
1171
  content_wrapper = None
1152
1172
  if content:
1153
- content_wrapper = Div(*content, id=main_id, hx_history_elt='true')
1173
+ content_wrapper = Div(*content, hx_history_elt='true')
1154
1174
 
1155
1175
  # No sidebar - simple layout
1156
1176
  if not sidebar and not sidebar_links:
@@ -1161,7 +1181,8 @@ def Layout(*content, sidebar=None, sidebar_links=None, nav_bar=None, container_s
1161
1181
  result.append(nav_bar)
1162
1182
  if content_wrapper:
1163
1183
  container_cls = stringify((container_size, 'padding', main_bg))
1164
- result.append(Main(content_wrapper, cls=container_cls))
1184
+ page_content = Page(content_wrapper, id=main_id)
1185
+ result.append(Main(page_content, cls=container_cls))
1165
1186
  return Div(*result, cls=cls, **kwargs) if result else Div(cls=cls, **kwargs)
1166
1187
 
1167
1188
  # Sidebar layout with hx-boost
@@ -1184,12 +1205,14 @@ def Layout(*content, sidebar=None, sidebar_links=None, nav_bar=None, container_s
1184
1205
  layout_children.append(nav_rail)
1185
1206
 
1186
1207
  if content_wrapper:
1187
- container_cls = stringify((container_size, 'round', 'elevate', 'margin'))
1188
- layout_children.append(Main(content_wrapper, cls=container_cls))
1208
+ container_cls = stringify((container_size, 'surface-container', 'round', 'padding', 'bottom-margin'))
1209
+ page_content = Page(content_wrapper, id=main_id)
1210
+ layout_children.append(Main(page_content, cls=container_cls))
1189
1211
 
1190
- final_cls = f"surface-container {cls}".strip() if cls else "surface-container"
1212
+ final_cls = f"surface {cls}".strip() if cls else "surface"
1191
1213
  return Div(*layout_children, cls=final_cls, **kwargs)
1192
1214
 
1215
+
1193
1216
  # %% ../nbs/02_components.ipynb 113
1194
1217
  #| code-fold: true
1195
1218
  class TextT(VEnum):
fh_matui/core.py CHANGED
@@ -19,6 +19,7 @@ from nbdev.showdoc import show_doc
19
19
 
20
20
  # %% ../nbs/01_core.ipynb 5
21
21
  #| code-fold: true
22
+ #| code-fold: true
22
23
  HEADER_URLS = {
23
24
  "beercss_css": "https://cdn.jsdelivr.net/npm/beercss@3.13.1/dist/cdn/beer.min.css",
24
25
  "beercss_js": "https://cdn.jsdelivr.net/npm/beercss@3.13.1/dist/cdn/beer.min.js",
@@ -33,6 +34,7 @@ beer_hdrs = (
33
34
 
34
35
  # %% ../nbs/01_core.ipynb 7
35
36
  #| code-fold: true
37
+ #| code-fold: true
36
38
  # All BeerCSS color names
37
39
  COLOR_NAMES = ['amber', 'blue', 'blue_grey', 'brown', 'cyan', 'deep_orange', 'deep_purple',
38
40
  'green', 'grey', 'indigo', 'light_blue', 'light_green', 'lime', 'orange',
@@ -90,6 +92,7 @@ ALL_HELPERS = (SIZES + WIDTH_HEIGHT + ELEVATES + DIRECTIONS + FORMS + MARGINS +
90
92
 
91
93
  # %% ../nbs/01_core.ipynb 10
92
94
  #| code-fold: true
95
+ #| code-fold: true
93
96
  class _ThemeChain:
94
97
  """Internal class for building themed headers"""
95
98
  def __init__(self, color=None):
@@ -156,6 +159,7 @@ class _ThemeChain:
156
159
 
157
160
  # %% ../nbs/01_core.ipynb 11
158
161
  #| code-fold: true
162
+ #| code-fold: true
159
163
  class _ThemeNamespace:
160
164
  """Namespace providing color properties that return _ThemeChain instances"""
161
165
  @property
@@ -215,6 +219,7 @@ MatTheme = _ThemeNamespace()
215
219
 
216
220
  # %% ../nbs/01_core.ipynb 15
217
221
  #| code-fold: true
222
+ #| code-fold: true
218
223
  class BeerCssChain:
219
224
  """Base class for chaining Beer CSS helper classes together"""
220
225
  def __init__(self, tokens=None):
fh_matui/datatable.py CHANGED
@@ -19,6 +19,7 @@ from .components import *
19
19
 
20
20
  # %% ../nbs/05_datatable.ipynb 7
21
21
  #| code-fold: true
22
+ #| code-fold: true
22
23
  from math import ceil
23
24
  from urllib.parse import urlencode
24
25
  from typing import Callable, Optional, Any
fh_matui/foundations.py CHANGED
@@ -13,6 +13,7 @@ from nbdev.showdoc import show_doc
13
13
 
14
14
  # %% ../nbs/00_foundations.ipynb 4
15
15
  #| code-fold: true
16
+ #| code-fold: true
16
17
  class VEnum(Enum):
17
18
  """Enum with string conversion and concatenation support"""
18
19
  def __str__(self): return self.value
@@ -21,6 +22,7 @@ class VEnum(Enum):
21
22
 
22
23
  # %% ../nbs/00_foundations.ipynb 8
23
24
  #| code-fold: true
25
+ #| code-fold: true
24
26
  def stringify(o):
25
27
  """Converts input types into strings that can be passed to FT components"""
26
28
  if is_listy(o):
@@ -29,6 +31,7 @@ def stringify(o):
29
31
 
30
32
  # %% ../nbs/00_foundations.ipynb 12
31
33
  #| code-fold: true
34
+ #| code-fold: true
32
35
  def normalize_tokens(cls):
33
36
  """Normalize class input to list of string tokens"""
34
37
  if cls is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fh-matui
3
- Version: 0.9.13
3
+ Version: 0.9.14
4
4
  Summary: material-ui for fasthtml
5
5
  Home-page: https://github.com/abhisheksreesaila/fh-matui
6
6
  Author: abhishek sreesaila
@@ -0,0 +1,14 @@
1
+ fh_matui/__init__.py,sha256=s9smkhMiLTJ6_VCSfo7J6aeWBGIlYjSsTDGrVprZjrI,24
2
+ fh_matui/_modidx.py,sha256=r9X_k4ptjzUPy6u6AS6411Qn0Fq0NuxMyV5PrpMH2oA,24032
3
+ fh_matui/app_pages.py,sha256=Sn9-tgBpaPNbR-0nZtPLoSCmAWLOGB4UQ88IkFvzBRY,10361
4
+ fh_matui/components.py,sha256=Lgk8Qazjx3TrrkEcGxiUbgPE-4676wL2fcs9nmhv1Cg,54179
5
+ fh_matui/core.py,sha256=fMSw0fHvUTYt1Qd1DzaWDS4xWIDbkyUCcr-LIz2IJ5k,11062
6
+ fh_matui/datatable.py,sha256=cDk_R9A1WTWa7fxDBBAZsnFU36ko_ml94HxmmbL_ENc,41248
7
+ fh_matui/foundations.py,sha256=xiQOeyV4FhNzPpw6mbtIrPWMyzlMi3BENo41IlGnAz8,1880
8
+ fh_matui/web_pages.py,sha256=at_M34Vxc1i9O0ukS41PaRJntkXXDzMqyzlcrgESUcw,35103
9
+ fh_matui-0.9.14.dist-info/licenses/LICENSE,sha256=xV8xoN4VOL0uw9X8RSs2IMuD_Ss_a9yAbtGNeBWZwnw,11337
10
+ fh_matui-0.9.14.dist-info/METADATA,sha256=JGk9Wq2RxIQKXxyatsmyVpGKwbxsmU6n1W-hx3rJrjs,10491
11
+ fh_matui-0.9.14.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
+ fh_matui-0.9.14.dist-info/entry_points.txt,sha256=zn4CR4gNTiAAxbFsCxHAf2tQhtW29_YOffjbUTgeoWI,38
13
+ fh_matui-0.9.14.dist-info/top_level.txt,sha256=l80d5eoA2ZjqtPYwAorLMS5PiHxUxz3zKzxMJ41Xoso,9
14
+ fh_matui-0.9.14.dist-info/RECORD,,
@@ -1,14 +0,0 @@
1
- fh_matui/__init__.py,sha256=4CbYG_FT4tURr5oUs-LmBkXp278FJwRBFCpWMPcLQog,24
2
- fh_matui/_modidx.py,sha256=naHwPQ4kCo-5saE_uozmdPA881kp1gnqvKhmaG-Ya-4,23914
3
- fh_matui/app_pages.py,sha256=Sn9-tgBpaPNbR-0nZtPLoSCmAWLOGB4UQ88IkFvzBRY,10361
4
- fh_matui/components.py,sha256=Cqgsg2i0dNzMgNpETSu7zf1HYyEwZ1_00bBjeue34Nc,53312
5
- fh_matui/core.py,sha256=t9Y5e3g6F4ZjlRuNt7SDabbCEdsolT6QHJXMOpEPa3A,10962
6
- fh_matui/datatable.py,sha256=o7BizE4FMKrfsYT4G6rjMvr2xHo_tvTwL0dI6anDcE4,41228
7
- fh_matui/foundations.py,sha256=b7PnObJpKN8ZAU9NzCm9xpfnHzFjjAROU7E2YvA_tj4,1820
8
- fh_matui/web_pages.py,sha256=at_M34Vxc1i9O0ukS41PaRJntkXXDzMqyzlcrgESUcw,35103
9
- fh_matui-0.9.13.dist-info/licenses/LICENSE,sha256=xV8xoN4VOL0uw9X8RSs2IMuD_Ss_a9yAbtGNeBWZwnw,11337
10
- fh_matui-0.9.13.dist-info/METADATA,sha256=5dnU_4G5vE1zqb28xwlI2pdXnBB0imjDbUxUW9imcLc,10491
11
- fh_matui-0.9.13.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
12
- fh_matui-0.9.13.dist-info/entry_points.txt,sha256=zn4CR4gNTiAAxbFsCxHAf2tQhtW29_YOffjbUTgeoWI,38
13
- fh_matui-0.9.13.dist-info/top_level.txt,sha256=l80d5eoA2ZjqtPYwAorLMS5PiHxUxz3zKzxMJ41Xoso,9
14
- fh_matui-0.9.13.dist-info/RECORD,,