instaui 0.1.3__py3-none-any.whl → 0.1.5__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.
Files changed (93) hide show
  1. instaui/components/content.py +4 -4
  2. instaui/components/echarts/echarts.js +128 -0
  3. instaui/components/echarts/echarts.py +194 -0
  4. instaui/components/echarts/static/echarts.esm.min.js +45 -0
  5. instaui/components/element.py +103 -13
  6. instaui/components/html/__init__.py +31 -18
  7. instaui/components/html/_preset.py +4 -0
  8. instaui/components/html/heading.py +51 -0
  9. instaui/components/html/range.py +3 -0
  10. instaui/components/html/select.py +16 -35
  11. instaui/components/html/table.py +36 -0
  12. instaui/components/html/textarea.py +28 -0
  13. instaui/components/markdown/markdown.js +33 -0
  14. instaui/components/markdown/markdown.py +41 -0
  15. instaui/components/markdown/static/github-markdown.css +12 -0
  16. instaui/components/markdown/static/marked.esm.js +2579 -0
  17. instaui/components/shiki_code/shiki_code.js +126 -0
  18. instaui/components/shiki_code/shiki_code.py +99 -0
  19. instaui/components/shiki_code/static/langs/css.mjs +5 -0
  20. instaui/components/shiki_code/static/langs/markdown.mjs +5 -0
  21. instaui/components/shiki_code/static/langs/python.mjs +5 -0
  22. instaui/components/shiki_code/static/langs/shell.mjs +2 -0
  23. instaui/components/shiki_code/static/langs/shellscript.mjs +5 -0
  24. instaui/components/shiki_code/static/shiki-core.js +5784 -0
  25. instaui/components/shiki_code/static/shiki-style.css +175 -0
  26. instaui/components/shiki_code/static/shiki-transformers.js +461 -0
  27. instaui/components/shiki_code/static/themes/vitesse-dark.mjs +2 -0
  28. instaui/components/shiki_code/static/themes/vitesse-light.mjs +2 -0
  29. instaui/components/value_element.py +7 -3
  30. instaui/components/vfor.py +1 -1
  31. instaui/consts.py +2 -1
  32. instaui/daisyui/__init__.py +26 -0
  33. instaui/daisyui/_index.py +20 -0
  34. instaui/daisyui/button.py +38 -0
  35. instaui/daisyui/checkbox.py +17 -0
  36. instaui/daisyui/static/daisyui.css +1 -0
  37. instaui/daisyui/static/themes.css +1 -0
  38. instaui/daisyui/table.py +35 -0
  39. instaui/dependencies/component_dependency.py +11 -5
  40. instaui/event/js_event.py +1 -0
  41. instaui/event/web_event.py +6 -7
  42. instaui/fastapi_server/dependency_router.py +4 -3
  43. instaui/fastapi_server/resource.py +12 -16
  44. instaui/fastapi_server/server.py +34 -24
  45. instaui/handlers/event_handler.py +3 -1
  46. instaui/handlers/watch_handler.py +4 -0
  47. instaui/html_tools.py +44 -2
  48. instaui/inject.py +3 -3
  49. instaui/runtime/_app.py +43 -4
  50. instaui/runtime/_link_manager.py +89 -0
  51. instaui/runtime/resource.py +21 -8
  52. instaui/shadcn_classless/_index.py +42 -0
  53. instaui/shadcn_classless/static/shadcn-classless.css +403 -0
  54. instaui/spa_router/_functions.py +1 -1
  55. instaui/spa_router/_route_model.py +1 -1
  56. instaui/static/insta-ui.css +1 -1
  57. instaui/static/insta-ui.esm-browser.prod.js +1308 -1252
  58. instaui/static/insta-ui.js.map +1 -1
  59. instaui/static/instaui-tools-browser.js +511 -0
  60. instaui/static/templates/webview.html +78 -0
  61. instaui/systems/module_system.py +30 -0
  62. instaui/tailwind/__init__.py +6 -0
  63. instaui/tailwind/_index.py +24 -0
  64. instaui/{static/tailwindcss.min.js → tailwind/static/tailwindcss-v3.min.js} +62 -62
  65. instaui/tailwind/static/tailwindcss-v4.min.js +8 -0
  66. instaui/template/_utils.py +23 -0
  67. instaui/template/webview_template.py +50 -0
  68. instaui/template/zero_template.py +18 -17
  69. instaui/ui/__build_init.py +73 -0
  70. instaui/ui/__init__.py +74 -58
  71. instaui/ui/__init__.pyi +135 -0
  72. instaui/ui/events.py +1 -1
  73. instaui/ui_functions/server.py +3 -1
  74. instaui/vars/event_context.py +4 -0
  75. instaui/vars/web_computed.py +30 -30
  76. instaui/watch/web_watch.py +5 -6
  77. instaui/webview/__init__.py +1 -0
  78. instaui/webview/_utils.py +8 -0
  79. instaui/webview/api.py +72 -0
  80. instaui/webview/func.py +114 -0
  81. instaui/webview/index.py +162 -0
  82. instaui/webview/resource.py +172 -0
  83. instaui/zero/func.py +31 -23
  84. instaui/zero/scope.py +110 -4
  85. {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/METADATA +4 -1
  86. {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/RECORD +88 -44
  87. instaui/handlers/computed_handler.py +0 -42
  88. instaui/handlers/config_handler.py +0 -13
  89. instaui/static/insta-ui.iife.js +0 -29
  90. instaui/static/insta-ui.iife.js.map +0 -1
  91. instaui/zero/test.html +0 -44
  92. {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/LICENSE +0 -0
  93. {instaui-0.1.3.dist-info → instaui-0.1.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,2 @@
1
+ /* Theme: vitesse-light */
2
+ export default Object.freeze(JSON.parse("{\"colors\":{\"activityBar.activeBorder\":\"#1c6b48\",\"activityBar.background\":\"#ffffff\",\"activityBar.border\":\"#f0f0f0\",\"activityBar.foreground\":\"#393a34\",\"activityBar.inactiveForeground\":\"#393a3450\",\"activityBarBadge.background\":\"#4e4f47\",\"activityBarBadge.foreground\":\"#ffffff\",\"badge.background\":\"#393a3490\",\"badge.foreground\":\"#ffffff\",\"breadcrumb.activeSelectionForeground\":\"#22222218\",\"breadcrumb.background\":\"#f7f7f7\",\"breadcrumb.focusForeground\":\"#393a34\",\"breadcrumb.foreground\":\"#6a737d\",\"breadcrumbPicker.background\":\"#ffffff\",\"button.background\":\"#1c6b48\",\"button.foreground\":\"#ffffff\",\"button.hoverBackground\":\"#1c6b48\",\"checkbox.background\":\"#f7f7f7\",\"checkbox.border\":\"#d1d5da\",\"debugToolBar.background\":\"#ffffff\",\"descriptionForeground\":\"#393a3490\",\"diffEditor.insertedTextBackground\":\"#1c6b4830\",\"diffEditor.removedTextBackground\":\"#ab595940\",\"dropdown.background\":\"#ffffff\",\"dropdown.border\":\"#f0f0f0\",\"dropdown.foreground\":\"#393a34\",\"dropdown.listBackground\":\"#f7f7f7\",\"editor.background\":\"#ffffff\",\"editor.findMatchBackground\":\"#e6cc7744\",\"editor.findMatchHighlightBackground\":\"#e6cc7766\",\"editor.focusedStackFrameHighlightBackground\":\"#fff5b1\",\"editor.foldBackground\":\"#22222210\",\"editor.foreground\":\"#393a34\",\"editor.inactiveSelectionBackground\":\"#22222210\",\"editor.lineHighlightBackground\":\"#f7f7f7\",\"editor.selectionBackground\":\"#22222218\",\"editor.selectionHighlightBackground\":\"#22222210\",\"editor.stackFrameHighlightBackground\":\"#fffbdd\",\"editor.wordHighlightBackground\":\"#1c6b4805\",\"editor.wordHighlightStrongBackground\":\"#1c6b4810\",\"editorBracketHighlight.foreground1\":\"#2993a3\",\"editorBracketHighlight.foreground2\":\"#1e754f\",\"editorBracketHighlight.foreground3\":\"#a65e2b\",\"editorBracketHighlight.foreground4\":\"#a13865\",\"editorBracketHighlight.foreground5\":\"#bda437\",\"editorBracketHighlight.foreground6\":\"#296aa3\",\"editorBracketMatch.background\":\"#1c6b4820\",\"editorError.foreground\":\"#ab5959\",\"editorGroup.border\":\"#f0f0f0\",\"editorGroupHeader.tabsBackground\":\"#ffffff\",\"editorGroupHeader.tabsBorder\":\"#f0f0f0\",\"editorGutter.addedBackground\":\"#1e754f\",\"editorGutter.commentRangeForeground\":\"#393a3450\",\"editorGutter.deletedBackground\":\"#ab5959\",\"editorGutter.foldingControlForeground\":\"#393a3490\",\"editorGutter.modifiedBackground\":\"#296aa3\",\"editorHint.foreground\":\"#1e754f\",\"editorIndentGuide.activeBackground\":\"#00000030\",\"editorIndentGuide.background\":\"#00000015\",\"editorInfo.foreground\":\"#296aa3\",\"editorInlayHint.background\":\"#f7f7f7\",\"editorInlayHint.foreground\":\"#999999\",\"editorLineNumber.activeForeground\":\"#4e4f47\",\"editorLineNumber.foreground\":\"#393a3450\",\"editorOverviewRuler.border\":\"#fff\",\"editorStickyScroll.background\":\"#f7f7f7\",\"editorStickyScrollHover.background\":\"#f7f7f7\",\"editorWarning.foreground\":\"#a65e2b\",\"editorWhitespace.foreground\":\"#00000015\",\"editorWidget.background\":\"#ffffff\",\"errorForeground\":\"#ab5959\",\"focusBorder\":\"#00000000\",\"foreground\":\"#393a34\",\"gitDecoration.addedResourceForeground\":\"#1e754f\",\"gitDecoration.conflictingResourceForeground\":\"#a65e2b\",\"gitDecoration.deletedResourceForeground\":\"#ab5959\",\"gitDecoration.ignoredResourceForeground\":\"#393a3450\",\"gitDecoration.modifiedResourceForeground\":\"#296aa3\",\"gitDecoration.submoduleResourceForeground\":\"#393a3490\",\"gitDecoration.untrackedResourceForeground\":\"#2993a3\",\"input.background\":\"#f7f7f7\",\"input.border\":\"#f0f0f0\",\"input.foreground\":\"#393a34\",\"input.placeholderForeground\":\"#393a3490\",\"inputOption.activeBackground\":\"#393a3450\",\"list.activeSelectionBackground\":\"#f7f7f7\",\"list.activeSelectionForeground\":\"#393a34\",\"list.focusBackground\":\"#f7f7f7\",\"list.highlightForeground\":\"#1c6b48\",\"list.hoverBackground\":\"#f7f7f7\",\"list.hoverForeground\":\"#393a34\",\"list.inactiveFocusBackground\":\"#ffffff\",\"list.inactiveSelectionBackground\":\"#f7f7f7\",\"list.inactiveSelectionForeground\":\"#393a34\",\"menu.separatorBackground\":\"#f0f0f0\",\"notificationCenterHeader.background\":\"#ffffff\",\"notificationCenterHeader.foreground\":\"#6a737d\",\"notifications.background\":\"#ffffff\",\"notifications.border\":\"#f0f0f0\",\"notifications.foreground\":\"#393a34\",\"notificationsErrorIcon.foreground\":\"#ab5959\",\"notificationsInfoIcon.foreground\":\"#296aa3\",\"notificationsWarningIcon.foreground\":\"#a65e2b\",\"panel.background\":\"#ffffff\",\"panel.border\":\"#f0f0f0\",\"panelInput.border\":\"#e1e4e8\",\"panelTitle.activeBorder\":\"#1c6b48\",\"panelTitle.activeForeground\":\"#393a34\",\"panelTitle.inactiveForeground\":\"#6a737d\",\"peekViewEditor.background\":\"#ffffff\",\"peekViewResult.background\":\"#ffffff\",\"pickerGroup.border\":\"#f0f0f0\",\"pickerGroup.foreground\":\"#393a34\",\"problemsErrorIcon.foreground\":\"#ab5959\",\"problemsInfoIcon.foreground\":\"#296aa3\",\"problemsWarningIcon.foreground\":\"#a65e2b\",\"progressBar.background\":\"#1c6b48\",\"quickInput.background\":\"#ffffff\",\"quickInput.foreground\":\"#393a34\",\"quickInputList.focusBackground\":\"#f7f7f7\",\"scrollbar.shadow\":\"#6a737d33\",\"scrollbarSlider.activeBackground\":\"#393a3450\",\"scrollbarSlider.background\":\"#393a3410\",\"scrollbarSlider.hoverBackground\":\"#393a3450\",\"settings.headerForeground\":\"#393a34\",\"settings.modifiedItemIndicator\":\"#1c6b48\",\"sideBar.background\":\"#ffffff\",\"sideBar.border\":\"#f0f0f0\",\"sideBar.foreground\":\"#4e4f47\",\"sideBarSectionHeader.background\":\"#ffffff\",\"sideBarSectionHeader.border\":\"#f0f0f0\",\"sideBarSectionHeader.foreground\":\"#393a34\",\"sideBarTitle.foreground\":\"#393a34\",\"statusBar.background\":\"#ffffff\",\"statusBar.border\":\"#f0f0f0\",\"statusBar.debuggingBackground\":\"#f7f7f7\",\"statusBar.debuggingForeground\":\"#4e4f47\",\"statusBar.foreground\":\"#4e4f47\",\"statusBar.noFolderBackground\":\"#ffffff\",\"statusBarItem.prominentBackground\":\"#f7f7f7\",\"tab.activeBackground\":\"#ffffff\",\"tab.activeBorder\":\"#f0f0f0\",\"tab.activeBorderTop\":\"#393a3490\",\"tab.activeForeground\":\"#393a34\",\"tab.border\":\"#f0f0f0\",\"tab.hoverBackground\":\"#f7f7f7\",\"tab.inactiveBackground\":\"#ffffff\",\"tab.inactiveForeground\":\"#6a737d\",\"tab.unfocusedActiveBorder\":\"#f0f0f0\",\"tab.unfocusedActiveBorderTop\":\"#f0f0f0\",\"tab.unfocusedHoverBackground\":\"#ffffff\",\"terminal.ansiBlack\":\"#121212\",\"terminal.ansiBlue\":\"#296aa3\",\"terminal.ansiBrightBlack\":\"#aaaaaa\",\"terminal.ansiBrightBlue\":\"#296aa3\",\"terminal.ansiBrightCyan\":\"#2993a3\",\"terminal.ansiBrightGreen\":\"#1e754f\",\"terminal.ansiBrightMagenta\":\"#a13865\",\"terminal.ansiBrightRed\":\"#ab5959\",\"terminal.ansiBrightWhite\":\"#dddddd\",\"terminal.ansiBrightYellow\":\"#bda437\",\"terminal.ansiCyan\":\"#2993a3\",\"terminal.ansiGreen\":\"#1e754f\",\"terminal.ansiMagenta\":\"#a13865\",\"terminal.ansiRed\":\"#ab5959\",\"terminal.ansiWhite\":\"#dbd7ca\",\"terminal.ansiYellow\":\"#bda437\",\"terminal.foreground\":\"#393a34\",\"terminal.selectionBackground\":\"#22222218\",\"textBlockQuote.background\":\"#ffffff\",\"textBlockQuote.border\":\"#f0f0f0\",\"textCodeBlock.background\":\"#ffffff\",\"textLink.activeForeground\":\"#1c6b48\",\"textLink.foreground\":\"#1c6b48\",\"textPreformat.foreground\":\"#586069\",\"textSeparator.foreground\":\"#d1d5da\",\"titleBar.activeBackground\":\"#ffffff\",\"titleBar.activeForeground\":\"#4e4f47\",\"titleBar.border\":\"#f7f7f7\",\"titleBar.inactiveBackground\":\"#ffffff\",\"titleBar.inactiveForeground\":\"#6a737d\",\"tree.indentGuidesStroke\":\"#e1e4e8\",\"welcomePage.buttonBackground\":\"#f6f8fa\",\"welcomePage.buttonHoverBackground\":\"#e1e4e8\"},\"displayName\":\"Vitesse Light\",\"name\":\"vitesse-light\",\"semanticHighlighting\":true,\"semanticTokenColors\":{\"class\":\"#5a6aa6\",\"interface\":\"#2e808f\",\"namespace\":\"#b05a78\",\"property\":\"#998418\",\"type\":\"#2e808f\"},\"tokenColors\":[{\"scope\":[\"comment\",\"punctuation.definition.comment\",\"string.comment\"],\"settings\":{\"foreground\":\"#a0ada0\"}},{\"scope\":[\"delimiter.bracket\",\"delimiter\",\"invalid.illegal.character-not-allowed-here.html\",\"keyword.operator.rest\",\"keyword.operator.spread\",\"keyword.operator.type.annotation\",\"keyword.operator.relational\",\"keyword.operator.assignment\",\"keyword.operator.type\",\"meta.brace\",\"meta.tag.block.any.html\",\"meta.tag.inline.any.html\",\"meta.tag.structure.input.void.html\",\"meta.type.annotation\",\"meta.embedded.block.github-actions-expression\",\"storage.type.function.arrow\",\"meta.objectliteral.ts\",\"punctuation\",\"punctuation.definition.string.begin.html.vue\",\"punctuation.definition.string.end.html.vue\"],\"settings\":{\"foreground\":\"#999999\"}},{\"scope\":[\"constant\",\"entity.name.constant\",\"variable.language\",\"meta.definition.variable\"],\"settings\":{\"foreground\":\"#a65e2b\"}},{\"scope\":[\"entity\",\"entity.name\"],\"settings\":{\"foreground\":\"#59873a\"}},{\"scope\":\"variable.parameter.function\",\"settings\":{\"foreground\":\"#393a34\"}},{\"scope\":[\"entity.name.tag\",\"tag.html\"],\"settings\":{\"foreground\":\"#1e754f\"}},{\"scope\":\"entity.name.function\",\"settings\":{\"foreground\":\"#59873a\"}},{\"scope\":[\"keyword\",\"storage.type.class.jsdoc\",\"punctuation.definition.template-expression\"],\"settings\":{\"foreground\":\"#1e754f\"}},{\"scope\":[\"storage\",\"storage.type\",\"support.type.builtin\",\"constant.language.undefined\",\"constant.language.null\",\"constant.language.import-export-all.ts\"],\"settings\":{\"foreground\":\"#ab5959\"}},{\"scope\":[\"text.html.derivative\",\"storage.modifier.package\",\"storage.modifier.import\",\"storage.type.java\"],\"settings\":{\"foreground\":\"#393a34\"}},{\"scope\":[\"string\",\"string punctuation.section.embedded source\",\"attribute.value\"],\"settings\":{\"foreground\":\"#b56959\"}},{\"scope\":[\"punctuation.definition.string\"],\"settings\":{\"foreground\":\"#b5695977\"}},{\"scope\":[\"punctuation.support.type.property-name\"],\"settings\":{\"foreground\":\"#99841877\"}},{\"scope\":\"support\",\"settings\":{\"foreground\":\"#998418\"}},{\"scope\":[\"property\",\"meta.property-name\",\"meta.object-literal.key\",\"entity.name.tag.yaml\",\"attribute.name\"],\"settings\":{\"foreground\":\"#998418\"}},{\"scope\":[\"entity.other.attribute-name\",\"invalid.deprecated.entity.other.attribute-name.html\"],\"settings\":{\"foreground\":\"#b07d48\"}},{\"scope\":[\"variable\",\"identifier\"],\"settings\":{\"foreground\":\"#b07d48\"}},{\"scope\":[\"support.type.primitive\",\"entity.name.type\"],\"settings\":{\"foreground\":\"#2e8f82\"}},{\"scope\":\"namespace\",\"settings\":{\"foreground\":\"#b05a78\"}},{\"scope\":[\"keyword.operator\",\"keyword.operator.assignment.compound\",\"meta.var.expr.ts\"],\"settings\":{\"foreground\":\"#ab5959\"}},{\"scope\":\"invalid.broken\",\"settings\":{\"fontStyle\":\"italic\",\"foreground\":\"#b31d28\"}},{\"scope\":\"invalid.deprecated\",\"settings\":{\"fontStyle\":\"italic\",\"foreground\":\"#b31d28\"}},{\"scope\":\"invalid.illegal\",\"settings\":{\"fontStyle\":\"italic\",\"foreground\":\"#b31d28\"}},{\"scope\":\"invalid.unimplemented\",\"settings\":{\"fontStyle\":\"italic\",\"foreground\":\"#b31d28\"}},{\"scope\":\"carriage-return\",\"settings\":{\"background\":\"#d73a49\",\"content\":\"^M\",\"fontStyle\":\"italic underline\",\"foreground\":\"#fafbfc\"}},{\"scope\":\"message.error\",\"settings\":{\"foreground\":\"#b31d28\"}},{\"scope\":\"string variable\",\"settings\":{\"foreground\":\"#b56959\"}},{\"scope\":[\"source.regexp\",\"string.regexp\"],\"settings\":{\"foreground\":\"#ab5e3f\"}},{\"scope\":[\"string.regexp.character-class\",\"string.regexp constant.character.escape\",\"string.regexp source.ruby.embedded\",\"string.regexp string.regexp.arbitrary-repitition\"],\"settings\":{\"foreground\":\"#b56959\"}},{\"scope\":\"string.regexp constant.character.escape\",\"settings\":{\"foreground\":\"#bda437\"}},{\"scope\":[\"support.constant\"],\"settings\":{\"foreground\":\"#a65e2b\"}},{\"scope\":[\"keyword.operator.quantifier.regexp\",\"constant.numeric\",\"number\"],\"settings\":{\"foreground\":\"#2f798a\"}},{\"scope\":[\"keyword.other.unit\"],\"settings\":{\"foreground\":\"#ab5959\"}},{\"scope\":[\"constant.language.boolean\",\"constant.language\"],\"settings\":{\"foreground\":\"#1e754f\"}},{\"scope\":\"meta.module-reference\",\"settings\":{\"foreground\":\"#1c6b48\"}},{\"scope\":\"punctuation.definition.list.begin.markdown\",\"settings\":{\"foreground\":\"#a65e2b\"}},{\"scope\":[\"markup.heading\",\"markup.heading entity.name\"],\"settings\":{\"fontStyle\":\"bold\",\"foreground\":\"#1c6b48\"}},{\"scope\":\"markup.quote\",\"settings\":{\"foreground\":\"#2e808f\"}},{\"scope\":\"markup.italic\",\"settings\":{\"fontStyle\":\"italic\",\"foreground\":\"#393a34\"}},{\"scope\":\"markup.bold\",\"settings\":{\"fontStyle\":\"bold\",\"foreground\":\"#393a34\"}},{\"scope\":\"markup.raw\",\"settings\":{\"foreground\":\"#1c6b48\"}},{\"scope\":[\"markup.deleted\",\"meta.diff.header.from-file\",\"punctuation.definition.deleted\"],\"settings\":{\"background\":\"#ffeef0\",\"foreground\":\"#b31d28\"}},{\"scope\":[\"markup.inserted\",\"meta.diff.header.to-file\",\"punctuation.definition.inserted\"],\"settings\":{\"background\":\"#f0fff4\",\"foreground\":\"#22863a\"}},{\"scope\":[\"markup.changed\",\"punctuation.definition.changed\"],\"settings\":{\"background\":\"#ffebda\",\"foreground\":\"#e36209\"}},{\"scope\":[\"markup.ignored\",\"markup.untracked\"],\"settings\":{\"background\":\"#005cc5\",\"foreground\":\"#f6f8fa\"}},{\"scope\":\"meta.diff.range\",\"settings\":{\"fontStyle\":\"bold\",\"foreground\":\"#6f42c1\"}},{\"scope\":\"meta.diff.header\",\"settings\":{\"foreground\":\"#005cc5\"}},{\"scope\":\"meta.separator\",\"settings\":{\"fontStyle\":\"bold\",\"foreground\":\"#005cc5\"}},{\"scope\":\"meta.output\",\"settings\":{\"foreground\":\"#005cc5\"}},{\"scope\":[\"brackethighlighter.tag\",\"brackethighlighter.curly\",\"brackethighlighter.round\",\"brackethighlighter.square\",\"brackethighlighter.angle\",\"brackethighlighter.quote\"],\"settings\":{\"foreground\":\"#586069\"}},{\"scope\":\"brackethighlighter.unmatched\",\"settings\":{\"foreground\":\"#b31d28\"}},{\"scope\":[\"constant.other.reference.link\",\"string.other.link\",\"punctuation.definition.string.begin.markdown\",\"punctuation.definition.string.end.markdown\"],\"settings\":{\"foreground\":\"#b56959\"}},{\"scope\":[\"markup.underline.link.markdown\",\"markup.underline.link.image.markdown\"],\"settings\":{\"fontStyle\":\"underline\",\"foreground\":\"#393a3490\"}},{\"scope\":[\"type.identifier\",\"constant.other.character-class.regexp\"],\"settings\":{\"foreground\":\"#5a6aa6\"}},{\"scope\":[\"entity.other.attribute-name.html.vue\"],\"settings\":{\"foreground\":\"#59873a\"}},{\"scope\":[\"invalid.illegal.unrecognized-tag.html\"],\"settings\":{\"fontStyle\":\"normal\"}}],\"type\":\"light\"}"))
@@ -11,6 +11,7 @@ from instaui import consts
11
11
 
12
12
  from instaui.vars.types import TMaybeRef
13
13
  from instaui.vars.web_computed import WebComputed
14
+ from instaui.ui_functions.ui_types import is_bindable
14
15
 
15
16
 
16
17
  _T = TypeVar("_T")
@@ -28,10 +29,13 @@ class ValueElement(Element, Generic[_T]):
28
29
  self.__is_html_component = is_html_component
29
30
 
30
31
  if value is not None:
31
- if isinstance(value, WebComputed):
32
- self.props({value_name:value})
32
+ if is_bindable(value):
33
+ if isinstance(value, WebComputed):
34
+ self.props({value_name: value})
35
+ else:
36
+ self.vmodel(value, prop_name=value_name)
33
37
  else:
34
- self.vmodel(value, prop_name=value_name)
38
+ self.props({value_name: value})
35
39
 
36
40
  def vmodel(
37
41
  self,
@@ -60,7 +60,7 @@ class VFor(Component, Generic[_T]):
60
60
  def __enter__(self) -> _T:
61
61
  self.__scope = self.__scope_manager.__enter__()
62
62
  super().__enter__()
63
- return VForItem(self).proxy # type: ignore
63
+ return VForItem(self).proxy # type: ignore
64
64
 
65
65
  def __exit__(self, *_) -> None:
66
66
  self.__scope_manager.__exit__(*_)
instaui/consts.py CHANGED
@@ -13,8 +13,9 @@ APP_CSS_PATH = _STATIC_DIR.joinpath("insta-ui.css")
13
13
  VUE_IIFE_JS_PATH = _STATIC_DIR.joinpath("vue.global.prod.js")
14
14
  VUE_ES_JS_PATH = _STATIC_DIR.joinpath("vue.esm-browser.prod.js")
15
15
  VUE_ES_RUNTIME_JS_PATH = _STATIC_DIR.joinpath("vue.runtime.esm-browser.prod.js")
16
- TAILWIND_JS_PATH = _STATIC_DIR.joinpath("tailwindcss.min.js")
17
16
  FAVICON_PATH = _STATIC_DIR.joinpath("insta-ui.ico")
17
+ # tools
18
+ TOOLS_BROWSER_JS_PATH = _STATIC_DIR.joinpath("instaui-tools-browser.js")
18
19
 
19
20
  PAGE_TITLE = "insta-ui"
20
21
 
@@ -0,0 +1,26 @@
1
+ """
2
+ Easy to use DaisyUI components for InstaUI.
3
+
4
+ Example usage:
5
+ .. code-block:: python
6
+ from instaui import ui, daisyui as dsui
7
+
8
+ dsui.use()
9
+
10
+ @ui.page("/")
11
+ def index_page():
12
+ dsui.checkbox(checked=True)
13
+ """
14
+
15
+ __all__ = [
16
+ "use",
17
+ "checkbox",
18
+ "button",
19
+ "table",
20
+ ]
21
+
22
+
23
+ from ._index import use_daisyui as use
24
+ from .checkbox import Checkbox as checkbox
25
+ from .button import Button as button
26
+ from .table import Table as table
@@ -0,0 +1,20 @@
1
+ from pathlib import Path
2
+ from instaui import ui
3
+
4
+ _STATIC_DIR = Path(__file__).parent / "static"
5
+ _DAISYUI_CSS = _STATIC_DIR / "daisyui.css"
6
+ _THEME_CSS = _STATIC_DIR / "themes.css"
7
+
8
+
9
+ def use_daisyui(value=True):
10
+ """Enable or disable DaisyUI.
11
+
12
+ Args:
13
+ value (bool, optional): Whether to enable or disable DaisyUI. Defaults to True.
14
+ """
15
+ if value:
16
+ ui.add_css_link(_DAISYUI_CSS)
17
+ ui.add_css_link(_THEME_CSS)
18
+ else:
19
+ ui.remove_css_link(_DAISYUI_CSS)
20
+ ui.remove_css_link(_THEME_CSS)
@@ -0,0 +1,38 @@
1
+ from typing import Optional
2
+ from instaui.components.element import Element
3
+ from instaui.components.content import Content
4
+ from instaui.vars.types import TMaybeRef
5
+
6
+
7
+ class Button(Element):
8
+ def __init__(
9
+ self,
10
+ label: Optional[TMaybeRef[str]] = None,
11
+ *,
12
+ soft: Optional[TMaybeRef[bool]] = None,
13
+ outline: Optional[TMaybeRef[bool]] = None,
14
+ dash: Optional[TMaybeRef[bool]] = None,
15
+ active: Optional[TMaybeRef[bool]] = None,
16
+ wide: Optional[TMaybeRef[bool]] = None,
17
+ ):
18
+ super().__init__("button")
19
+ self.classes("btn")
20
+
21
+ if label is not None:
22
+ with self:
23
+ Content(label)
24
+
25
+ if soft is not None:
26
+ self.props({"btn-soft": soft})
27
+
28
+ if outline is not None:
29
+ self.props({"btn-outline": outline})
30
+
31
+ if dash is not None:
32
+ self.props({"btn-dash": dash})
33
+
34
+ if active is not None:
35
+ self.props({"btn-active": active})
36
+
37
+ if wide is not None:
38
+ self.props({"btn-wide": wide})
@@ -0,0 +1,17 @@
1
+ from typing import Optional
2
+ from instaui.components.element import Element
3
+ from instaui.vars.types import TMaybeRef
4
+ from instaui.vars.web_computed import WebComputed
5
+
6
+
7
+ class Checkbox(Element):
8
+ def __init__(self, checked: TMaybeRef[bool] = False):
9
+ super().__init__("input")
10
+ self.classes("checkbox")
11
+ self.props({"type": "checkbox"})
12
+
13
+ if checked is not None:
14
+ if isinstance(checked, WebComputed):
15
+ self.props({"value": checked})
16
+ else:
17
+ self.vmodel(checked, prop_name="value", is_html_component=True)