diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..bedee07 --- /dev/null +++ b/404.html @@ -0,0 +1,473 @@ + + + +
+ + + + + + + + + + + + + + + + +HOT maintains many web based tools that require a UI.
+Typically these interfaces were developed using React, due to existing +experience and to avoid fragmentation.
+Going forward HOT requires a more flexible approach that can be used in +multiple different frameworks (including directly in HTML & also HTMX).
+The solution to this is Web Components, which are framework agnostic.
+Web Components are built upon four existing technologies:
+<template>
and <slot>
elementsDOM Diffing
and other performance
+ enhancements.Most of the limitations are addressed by using a framework like Lit.
+A vanilla Web Component:
+class MyElement extends HTMLElement {
+ constructor() {
+ super();
+ const shadow = this.attachShadow({ mode: "open" });
+ const div = document.createElement("div");
+ div.textContent = "Hello, World!";
+ shadow.appendChild(div);
+ }
+}
+
+customElements.define("my-element", MyElement);
+
The component can be used directly in HTML:
+<div>
+ <!-- other html -->
+ <my-element></my-element>
+</div>
+
With React:
+// components/button.tsx
+
+import { cva } from "class-variance-authority";
+
+const buttonStyles = cva("font-semibold rounded border", {
+ variants: {
+ intent: {
+ primary: "bg-blue-500 text-white border-transparent hover:bg-blue-600",
+ secondary: "bg-white text-gray-800 border-gray-400 hover:bg-gray-100"
+ },
+ size: {
+ small: "text-sm py-1 px-2",
+ medium: "text-base py-2 px-4",
+ },
+ },
+ defaultVariants: {
+ intent: "primary",
+ size: "medium",
+ },
+});
+
+// regular button props
+type ButtonProps = {
+ label: string;
+ onClick?: (onClickProps: any) => void;
+ icon?: IconType; // defined elsewhere, pretend this is JSX
+}
+
+// merging button props and CVA variant props with TS utility types
+type buttonVariantsProps = VariantProps<typeof buttonStyles>;
+interface Props
+ extends ButtonProps,
+ // making intent variant required
+ Omit<buttonVariantsProps, "intent">,
+ Required<Pick<buttonVariantsProps, "intent">> {}
+
+// actual button componenent
+const Button = ({label, onClick, icon, intent, size}: Props) => {
+ return (
+ <button
+ className={buttonStyles({intent, size})}
+ onClick={onClick}
+ >
+ {icon && <Icon/>}
+ {label}
+ </button>
+ )
+}
+
{"use strict";/*!
+ * escape-html
+ * Copyright(c) 2012-2013 TJ Holowaychuk
+ * Copyright(c) 2015 Andreas Lubbe
+ * Copyright(c) 2015 Tiancheng "Timothy" Gu
+ * MIT Licensed
+ */var Ha=/["'&<>]/;Un.exports=$a;function $a(e){var t=""+e,r=Ha.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i