# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_core.ipynb.

# %% auto 0
__all__ = ['svgs', 'dims', 'SvgNotStr']

# %% ../nbs/00_core.ipynb 2
from .icons import icons
from fastcore.utils import *

# %% ../nbs/00_core.ipynb 3
class SvgNotStr(NotStr):
    "Behaves list a `str`, but isn't a `str`, and displays as SVG in a notebook"
    w=150
    def _repr_html_(self): return f'<div style="max-width: {self.w}px; width: 100%;">{self}</div>'
    def width(self, w:int):
        "Set the width and return self"
        self.w = w
        return self

# %% ../nbs/00_core.ipynb 4
def _svgs(o): return {k:SvgNotStr(v['raw']) for k,v in o.items()}

def _name(o):
    if o[0].isdigit(): o = '_'+o
    return o.replace('-','_')

svgs = dict2obj({_name(k):_svgs(v['svg']) for k,v in icons.items()})

# %% ../nbs/00_core.ipynb 6
def _dims(o): return {k:(v['height'],v['width']) for k,v in o.items()}

dims = dict2obj({_name(k):_dims(v['svg']) for k,v in icons.items()})
