@hypericon/mico 0.1.0

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.
package/README.md ADDED
@@ -0,0 +1,8 @@
1
+
2
+ # Mico
3
+
4
+ **Mi**thril **Co**mponents
5
+
6
+ UI components and utilities built with Mithril.
7
+
8
+
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,21 @@
1
+ import m from "mithril";
2
+ import { IconSolid, IconRegular, IconBrand } from "./icons";
3
+ export type IconAttrs = ({
4
+ fab: IconBrand;
5
+ } | {
6
+ far: IconRegular;
7
+ } | {
8
+ fas: IconSolid;
9
+ }) & {
10
+ class?: string;
11
+ style?: string;
12
+ };
13
+ /**
14
+ * Font Awesome Icon
15
+ *
16
+ * Specify the icon string with one of the keys: `fas`, `far`, or `fab`.
17
+ * Icon strings can be autocompleted on these keys.
18
+ *
19
+ * @see https://fontawesome.com/search
20
+ */
21
+ export declare const Icon: m.Component<IconAttrs>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Icon = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ /**
9
+ * Font Awesome Icon
10
+ *
11
+ * Specify the icon string with one of the keys: `fas`, `far`, or `fab`.
12
+ * Icon strings can be autocompleted on these keys.
13
+ *
14
+ * @see https://fontawesome.com/search
15
+ */
16
+ exports.Icon = {
17
+ view({ attrs }) {
18
+ var _a, _b;
19
+ const icon = ("fas" in attrs) ? `fas fa-${attrs.fas}` :
20
+ ("far" in attrs) ? `far fa-${attrs.far}` :
21
+ ("fab" in attrs) ? `fab fa-${attrs.fab}` :
22
+ "";
23
+ return (0, mithril_1.default)("i", {
24
+ class: `${(_a = attrs.class) !== null && _a !== void 0 ? _a : ""} ${icon}`,
25
+ style: `${(_b = attrs.style) !== null && _b !== void 0 ? _b : ""}`,
26
+ });
27
+ }
28
+ };
@@ -0,0 +1,3 @@
1
+ export type IconSolid = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "fill-drip" | "arrows-to-circle" | "circle-chevron-right" | "at" | "trash-can" | "text-height" | "user-xmark" | "stethoscope" | "message" | "info" | "down-left-and-up-right-to-center" | "explosion" | "file-lines" | "wave-square" | "ring" | "building-un" | "dice-three" | "calendar-days" | "anchor-circle-check" | "building-circle-arrow-right" | "volleyball" | "arrows-up-to-line" | "sort-down" | "circle-minus" | "door-open" | "right-from-bracket" | "atom" | "soap" | "icons" | "microphone-lines-slash" | "bridge-circle-check" | "pump-medical" | "fingerprint" | "hand-point-right" | "magnifying-glass-location" | "forward-step" | "face-smile-beam" | "flag-checkered" | "football" | "school-circle-exclamation" | "crop" | "angles-down" | "users-rectangle" | "people-roof" | "people-line" | "beer-mug-empty" | "diagram-predecessor" | "arrow-up-long" | "fire-flame-simple" | "person" | "laptop" | "file-csv" | "menorah" | "truck-plane" | "record-vinyl" | "face-grin-stars" | "bong" | "spaghetti-monster-flying" | "arrow-down-up-across-line" | "spoon" | "jar-wheat" | "envelopes-bulk" | "file-circle-exclamation" | "circle-h" | "pager" | "address-book" | "strikethrough" | "k" | "landmark-flag" | "pencil" | "backward" | "caret-right" | "comments" | "paste" | "code-pull-request" | "clipboard-list" | "truck-ramp-box" | "user-check" | "vial-virus" | "sheet-plastic" | "blog" | "user-ninja" | "person-arrow-up-from-line" | "scroll-torah" | "broom-ball" | "toggle-off" | "box-archive" | "person-drowning" | "arrow-down-9-1" | "face-grin-tongue-squint" | "spray-can" | "truck-monster" | "w" | "earth-africa" | "rainbow" | "circle-notch" | "tablet-screen-button" | "paw" | "cloud" | "trowel-bricks" | "face-flushed" | "hospital-user" | "tent-arrow-left-right" | "gavel" | "binoculars" | "microphone-slash" | "box-tissue" | "motorcycle" | "bell-concierge" | "pen-ruler" | "people-arrows" | "mars-and-venus-burst" | "square-caret-right" | "scissors" | "sun-plant-wilt" | "toilets-portable" | "hockey-puck" | "table" | "magnifying-glass-arrow-right" | "tachograph-digital" | "users-slash" | "clover" | "reply" | "star-and-crescent" | "house-fire" | "square-minus" | "helicopter" | "compass" | "square-caret-down" | "file-circle-question" | "laptop-code" | "swatchbook" | "prescription-bottle" | "bars" | "people-group" | "hourglass-end" | "heart-crack" | "square-up-right" | "face-kiss-beam" | "film" | "ruler-horizontal" | "people-robbery" | "lightbulb" | "caret-left" | "circle-exclamation" | "school-circle-xmark" | "arrow-right-from-bracket" | "circle-chevron-down" | "unlock-keyhole" | "cloud-showers-heavy" | "headphones-simple" | "sitemap" | "circle-dollar-to-slot" | "memory" | "road-spikes" | "fire-burner" | "flag" | "hanukiah" | "feather" | "volume-low" | "comment-slash" | "cloud-sun-rain" | "compress" | "wheat-awn" | "ankh" | "hands-holding-child" | "asterisk" | "square-check" | "peseta-sign" | "heading" | "ghost" | "list" | "square-phone-flip" | "cart-plus" | "gamepad" | "circle-dot" | "face-dizzy" | "egg" | "house-medical-circle-xmark" | "campground" | "folder-plus" | "futbol" | "paintbrush" | "lock" | "gas-pump" | "hot-tub-person" | "map-location" | "house-flood-water" | "tree" | "bridge-lock" | "sack-dollar" | "pen-to-square" | "car-side" | "share-nodes" | "heart-circle-minus" | "hourglass-half" | "microscope" | "sink" | "bag-shopping" | "arrow-down-z-a" | "mitten" | "person-rays" | "users" | "eye-slash" | "flask-vial" | "hand" | "om" | "worm" | "house-circle-xmark" | "plug" | "chevron-up" | "hand-spock" | "stopwatch" | "face-kiss" | "bridge-circle-xmark" | "face-grin-tongue" | "chess-bishop" | "face-grin-wink" | "ear-deaf" | "road-circle-check" | "dice-five" | "square-rss" | "land-mine-on" | "i-cursor" | "stamp" | "stairs" | "i" | "hryvnia-sign" | "pills" | "face-grin-wide" | "tooth" | "v" | "bangladeshi-taka-sign" | "bicycle" | "staff-snake" | "head-side-cough-slash" | "truck-medical" | "wheat-awn-circle-exclamation" | "snowman" | "mortar-pestle" | "road-barrier" | "school" | "igloo" | "joint" | "angle-right" | "horse" | "q" | "g" | "notes-medical" | "temperature-half" | "dong-sign" | "capsules" | "poo-storm" | "face-frown-open" | "hand-point-up" | "money-bill" | "bookmark" | "align-justify" | "umbrella-beach" | "helmet-un" | "bullseye" | "bacon" | "hand-point-down" | "arrow-up-from-bracket" | "folder" | "file-waveform" | "radiation" | "chart-simple" | "mars-stroke" | "vial" | "gauge" | "wand-magic-sparkles" | "e" | "pen-clip" | "bridge-circle-exclamation" | "user" | "school-circle-check" | "dumpster" | "van-shuttle" | "building-user" | "square-caret-left" | "highlighter" | "key" | "bullhorn" | "globe" | "synagogue" | "person-half-dress" | "road-bridge" | "location-arrow" | "c" | "tablet-button" | "building-lock" | "pizza-slice" | "money-bill-wave" | "chart-area" | "house-flag" | "person-circle-minus" | "ban" | "camera-rotate" | "spray-can-sparkles" | "star" | "repeat" | "cross" | "box" | "venus-mars" | "arrow-pointer" | "maximize" | "charging-station" | "shapes" | "shuffle" | "person-running" | "mobile-retro" | "grip-lines-vertical" | "spider" | "hands-bound" | "file-invoice-dollar" | "plane-circle-exclamation" | "x-ray" | "spell-check" | "slash" | "computer-mouse" | "arrow-right-to-bracket" | "shop-slash" | "server" | "virus-covid-slash" | "shop-lock" | "hourglass-start" | "blender-phone" | "building-wheat" | "person-breastfeeding" | "right-to-bracket" | "venus" | "passport" | "heart-pulse" | "people-carry-box" | "temperature-high" | "microchip" | "crown" | "weight-hanging" | "xmarks-lines" | "file-prescription" | "weight-scale" | "user-group" | "arrow-up-a-z" | "chess-knight" | "face-laugh-squint" | "wheelchair" | "circle-arrow-up" | "toggle-on" | "person-walking" | "l" | "fire" | "bed-pulse" | "shuttle-space" | "face-laugh" | "folder-open" | "heart-circle-plus" | "code-fork" | "city" | "microphone-lines" | "pepper-hot" | "unlock" | "colon-sign" | "headset" | "store-slash" | "road-circle-xmark" | "user-minus" | "mars-stroke-up" | "champagne-glasses" | "clipboard" | "house-circle-exclamation" | "file-arrow-up" | "wifi" | "bath" | "underline" | "user-pen" | "signature" | "stroopwafel" | "bold" | "anchor-lock" | "building-ngo" | "manat-sign" | "not-equal" | "border-top-left" | "map-location-dot" | "jedi" | "square-poll-vertical" | "mug-hot" | "car-battery" | "gift" | "dice-two" | "chess-queen" | "glasses" | "chess-board" | "building-circle-check" | "person-chalkboard" | "mars-stroke-right" | "hand-back-fist" | "square-caret-up" | "cloud-showers-water" | "chart-bar" | "hands-bubbles" | "less-than-equal" | "train" | "eye-low-vision" | "crow" | "sailboat" | "window-restore" | "square-plus" | "torii-gate" | "frog" | "bucket" | "image" | "microphone" | "cow" | "caret-up" | "screwdriver" | "folder-closed" | "house-tsunami" | "square-nfi" | "arrow-up-from-ground-water" | "martini-glass" | "rotate-left" | "table-columns" | "lemon" | "head-side-mask" | "handshake" | "gem" | "dolly" | "smoking" | "minimize" | "monument" | "snowplow" | "angles-right" | "cannabis" | "circle-play" | "tablets" | "ethernet" | "euro-sign" | "chair" | "circle-check" | "circle-stop" | "compass-drafting" | "plate-wheat" | "icicles" | "person-shelter" | "neuter" | "id-badge" | "marker" | "face-laugh-beam" | "helicopter-symbol" | "universal-access" | "circle-chevron-up" | "lari-sign" | "volcano" | "person-walking-dashed-line-arrow-right" | "sterling-sign" | "viruses" | "square-person-confined" | "user-tie" | "arrow-down-long" | "tent-arrow-down-to-line" | "certificate" | "reply-all" | "suitcase" | "person-skating" | "filter-circle-dollar" | "camera-retro" | "circle-arrow-down" | "file-import" | "square-arrow-up-right" | "box-open" | "scroll" | "spa" | "location-pin-lock" | "pause" | "hill-avalanche" | "temperature-empty" | "bomb" | "registered" | "address-card" | "scale-unbalanced-flip" | "subscript" | "diamond-turn-right" | "burst" | "house-laptop" | "face-tired" | "money-bills" | "smog" | "crutch" | "font-awesome" | "cloud-arrow-up" | "palette" | "arrows-turn-right" | "vest" | "ferry" | "arrows-down-to-people" | "seedling" | "left-right" | "boxes-packing" | "circle-arrow-left" | "group-arrows-rotate" | "bowl-food" | "candy-cane" | "arrow-down-wide-short" | "cloud-bolt" | "text-slash" | "face-smile-wink" | "file-word" | "file-powerpoint" | "arrows-left-right" | "house-lock" | "cloud-arrow-down" | "children" | "chalkboard" | "user-large-slash" | "envelope-open" | "handshake-simple-slash" | "mattress-pillow" | "guarani-sign" | "arrows-rotate" | "fire-extinguisher" | "cruzeiro-sign" | "greater-than-equal" | "shield-halved" | "book-atlas" | "virus" | "envelope-circle-check" | "layer-group" | "arrows-to-dot" | "archway" | "heart-circle-check" | "house-chimney-crack" | "file-zipper" | "square" | "martini-glass-empty" | "couch" | "cedi-sign" | "italic" | "church" | "comments-dollar" | "democrat" | "z" | "person-skiing" | "road-lock" | "a" | "temperature-arrow-down" | "feather-pointed" | "p" | "snowflake" | "newspaper" | "rectangle-ad" | "circle-arrow-right" | "filter-circle-xmark" | "locust" | "sort" | "list-ol" | "person-dress-burst" | "money-check-dollar" | "vector-square" | "bread-slice" | "language" | "face-kiss-wink-heart" | "filter" | "question" | "file-signature" | "up-down-left-right" | "house-chimney-user" | "hand-holding-heart" | "puzzle-piece" | "money-check" | "star-half-stroke" | "code" | "whiskey-glass" | "building-circle-exclamation" | "magnifying-glass-chart" | "arrow-up-right-from-square" | "cubes-stacked" | "won-sign" | "virus-covid" | "austral-sign" | "f" | "leaf" | "road" | "taxi" | "person-circle-plus" | "chart-pie" | "bolt-lightning" | "sack-xmark" | "file-excel" | "file-contract" | "fish-fins" | "building-flag" | "face-grin-beam" | "object-ungroup" | "poop" | "location-pin" | "kaaba" | "toilet-paper" | "helmet-safety" | "eject" | "circle-right" | "plane-circle-check" | "face-rolling-eyes" | "object-group" | "chart-line" | "mask-ventilator" | "arrow-right" | "signs-post" | "cash-register" | "person-circle-question" | "h" | "tarp" | "screwdriver-wrench" | "arrows-to-eye" | "plug-circle-bolt" | "heart" | "mars-and-venus" | "house-user" | "dumpster-fire" | "house-crack" | "martini-glass-citrus" | "face-surprise" | "bottle-water" | "circle-pause" | "toilet-paper-slash" | "apple-whole" | "kitchen-set" | "r" | "temperature-quarter" | "cube" | "bitcoin-sign" | "shield-dog" | "solar-panel" | "lock-open" | "elevator" | "money-bill-transfer" | "money-bill-trend-up" | "house-flood-water-circle-arrow-right" | "square-poll-horizontal" | "circle" | "backward-fast" | "recycle" | "user-astronaut" | "plane-slash" | "trademark" | "basketball" | "satellite-dish" | "circle-up" | "mobile-screen-button" | "volume-high" | "users-rays" | "wallet" | "clipboard-check" | "file-audio" | "burger" | "wrench" | "bugs" | "rupee-sign" | "file-image" | "circle-question" | "plane-departure" | "handshake-slash" | "book-bookmark" | "code-branch" | "hat-cowboy" | "bridge" | "phone-flip" | "truck-front" | "cat" | "anchor-circle-exclamation" | "truck-field" | "route" | "clipboard-question" | "panorama" | "comment-medical" | "teeth-open" | "file-circle-minus" | "tags" | "wine-glass" | "forward-fast" | "face-meh-blank" | "square-parking" | "house-signal" | "bars-progress" | "faucet-drip" | "cart-flatbed" | "ban-smoking" | "terminal" | "mobile-button" | "house-medical-flag" | "basket-shopping" | "tape" | "bus-simple" | "eye" | "face-sad-cry" | "audio-description" | "person-military-to-person" | "file-shield" | "user-slash" | "pen" | "tower-observation" | "file-code" | "signal" | "bus" | "heart-circle-xmark" | "house-chimney" | "window-maximize" | "face-frown" | "prescription" | "shop" | "floppy-disk" | "vihara" | "scale-unbalanced" | "sort-up" | "comment-dots" | "plant-wilt" | "diamond" | "face-grin-squint" | "hand-holding-dollar" | "bacterium" | "hand-pointer" | "drum-steelpan" | "hand-scissors" | "hands-praying" | "arrow-rotate-right" | "biohazard" | "location-crosshairs" | "mars-double" | "child-dress" | "users-between-lines" | "lungs-virus" | "face-grin-tears" | "phone" | "calendar-xmark" | "child-reaching" | "head-side-virus" | "user-gear" | "arrow-up-1-9" | "door-closed" | "shield-virus" | "dice-six" | "mosquito-net" | "bridge-water" | "person-booth" | "text-width" | "hat-wizard" | "pen-fancy" | "person-digging" | "trash" | "gauge-simple" | "book-medical" | "poo" | "quote-right" | "shirt" | "cubes" | "divide" | "tenge-sign" | "headphones" | "hands-holding" | "hands-clapping" | "republican" | "arrow-left" | "person-circle-xmark" | "ruler" | "align-left" | "dice-d6" | "restroom" | "j" | "users-viewfinder" | "file-video" | "up-right-from-square" | "table-cells" | "file-pdf" | "book-bible" | "o" | "suitcase-medical" | "user-secret" | "otter" | "person-dress" | "comment-dollar" | "business-time" | "table-cells-large" | "book-tanakh" | "phone-volume" | "hat-cowboy-side" | "clipboard-user" | "child" | "lira-sign" | "satellite" | "plane-lock" | "tag" | "comment" | "cake-candles" | "envelope" | "angles-up" | "paperclip" | "arrow-right-to-city" | "ribbon" | "lungs" | "arrow-up-9-1" | "litecoin-sign" | "border-none" | "circle-nodes" | "parachute-box" | "indent" | "truck-field-un" | "hourglass" | "mountain" | "user-doctor" | "circle-info" | "cloud-meatball" | "camera" | "square-virus" | "meteor" | "car-on" | "sleigh" | "arrow-down-1-9" | "hand-holding-droplet" | "water" | "calendar-check" | "braille" | "prescription-bottle-medical" | "landmark" | "truck" | "crosshairs" | "person-cane" | "tent" | "vest-patches" | "check-double" | "arrow-down-a-z" | "money-bill-wheat" | "cookie" | "arrow-rotate-left" | "hard-drive" | "face-grin-squint-tears" | "dumbbell" | "rectangle-list" | "tarp-droplet" | "house-medical-circle-check" | "person-skiing-nordic" | "calendar-plus" | "plane-arrival" | "circle-left" | "train-subway" | "chart-gantt" | "indian-rupee-sign" | "crop-simple" | "money-bill-1" | "left-long" | "dna" | "virus-slash" | "minus" | "chess" | "arrow-left-long" | "plug-circle-check" | "street-view" | "franc-sign" | "volume-off" | "hands-asl-interpreting" | "gear" | "droplet-slash" | "mosque" | "mosquito" | "star-of-david" | "person-military-rifle" | "cart-shopping" | "vials" | "plug-circle-plus" | "place-of-worship" | "grip-vertical" | "arrow-turn-up" | "u" | "square-root-variable" | "clock" | "backward-step" | "pallet" | "faucet" | "baseball-bat-ball" | "s" | "timeline" | "keyboard" | "caret-down" | "house-chimney-medical" | "temperature-three-quarters" | "mobile-screen" | "plane-up" | "piggy-bank" | "battery-half" | "mountain-city" | "coins" | "khanda" | "sliders" | "folder-tree" | "network-wired" | "map-pin" | "hamsa" | "cent-sign" | "flask" | "person-pregnant" | "wand-sparkles" | "ellipsis-vertical" | "ticket" | "power-off" | "right-long" | "flag-usa" | "laptop-file" | "tty" | "diagram-next" | "person-rifle" | "house-medical-circle-exclamation" | "closed-captioning" | "person-hiking" | "venus-double" | "images" | "calculator" | "people-pulling" | "n" | "cable-car" | "cloud-rain" | "building-circle-xmark" | "ship" | "arrows-down-to-line" | "download" | "face-grin" | "delete-left" | "eye-dropper" | "file-circle-check" | "forward" | "mobile" | "face-meh" | "align-center" | "book-skull" | "id-card" | "outdent" | "heart-circle-exclamation" | "house" | "calendar-week" | "laptop-medical" | "b" | "file-medical" | "dice-one" | "kiwi-bird" | "arrow-right-arrow-left" | "rotate-right" | "utensils" | "arrow-up-wide-short" | "mill-sign" | "bowl-rice" | "skull" | "tower-broadcast" | "truck-pickup" | "up-long" | "stop" | "code-merge" | "upload" | "hurricane" | "mound" | "toilet-portable" | "compact-disc" | "file-arrow-down" | "caravan" | "shield-cat" | "bolt" | "glass-water" | "oil-well" | "vault" | "mars" | "toilet" | "plane-circle-xmark" | "yen-sign" | "ruble-sign" | "sun" | "guitar" | "face-laugh-wink" | "horse-head" | "bore-hole" | "industry" | "circle-down" | "arrows-turn-to-dots" | "florin-sign" | "arrow-down-short-wide" | "less-than" | "angle-down" | "car-tunnel" | "head-side-cough" | "grip-lines" | "thumbs-down" | "user-lock" | "arrow-right-long" | "anchor-circle-xmark" | "ellipsis" | "chess-pawn" | "kit-medical" | "person-through-window" | "toolbox" | "hands-holding-circle" | "bug" | "credit-card" | "car" | "hand-holding-hand" | "book-open-reader" | "mountain-sun" | "arrows-left-right-to-line" | "dice-d20" | "truck-droplet" | "file-circle-xmark" | "temperature-arrow-up" | "medal" | "bed" | "square-h" | "podcast" | "temperature-full" | "bell" | "superscript" | "plug-circle-xmark" | "star-of-life" | "phone-slash" | "paint-roller" | "handshake-angle" | "location-dot" | "file" | "greater-than" | "person-swimming" | "arrow-down" | "droplet" | "eraser" | "earth-americas" | "person-burst" | "dove" | "battery-empty" | "socks" | "inbox" | "section" | "gauge-high" | "envelope-open-text" | "hospital" | "wine-bottle" | "chess-rook" | "bars-staggered" | "dharmachakra" | "hotdog" | "person-walking-with-cane" | "drum" | "ice-cream" | "heart-circle-bolt" | "fax" | "paragraph" | "check-to-slot" | "star-half" | "boxes-stacked" | "link" | "ear-listen" | "tree-city" | "play" | "font" | "rupiah-sign" | "magnifying-glass" | "table-tennis-paddle-ball" | "person-dots-from-line" | "trash-can-arrow-up" | "naira-sign" | "cart-arrow-down" | "walkie-talkie" | "file-pen" | "receipt" | "square-pen" | "suitcase-rolling" | "person-circle-exclamation" | "chevron-down" | "battery-full" | "skull-crossbones" | "code-compare" | "list-ul" | "school-lock" | "tower-cell" | "down-long" | "ranking-star" | "chess-king" | "person-harassing" | "brazilian-real-sign" | "landmark-dome" | "arrow-up" | "tv" | "shrimp" | "list-check" | "jug-detergent" | "circle-user" | "user-shield" | "wind" | "car-burst" | "y" | "person-snowboarding" | "truck-fast" | "fish" | "user-graduate" | "circle-half-stroke" | "clapperboard" | "circle-radiation" | "baseball" | "jet-fighter-up" | "diagram-project" | "copy" | "volume-xmark" | "hand-sparkles" | "grip" | "share-from-square" | "child-combatant" | "gun" | "square-phone" | "plus" | "expand" | "computer" | "xmark" | "arrows-up-down-left-right" | "chalkboard-user" | "peso-sign" | "building-shield" | "baby" | "users-line" | "quote-left" | "tractor" | "trash-arrow-up" | "arrow-down-up-lock" | "lines-leaning" | "ruler-combined" | "copyright" | "equals" | "blender" | "teeth" | "shekel-sign" | "map" | "rocket" | "photo-film" | "folder-minus" | "store" | "arrow-trend-up" | "plug-circle-minus" | "sign-hanging" | "bezier-curve" | "bell-slash" | "tablet" | "school-flag" | "fill" | "angle-up" | "drumstick-bite" | "holly-berry" | "chevron-left" | "bacteria" | "hand-lizard" | "notdef" | "disease" | "briefcase-medical" | "genderless" | "chevron-right" | "retweet" | "car-rear" | "pump-soap" | "video-slash" | "battery-quarter" | "radio" | "baby-carriage" | "traffic-light" | "thermometer" | "vr-cardboard" | "hand-middle-finger" | "percent" | "truck-moving" | "glass-water-droplet" | "display" | "face-smile" | "thumbtack" | "trophy" | "person-praying" | "hammer" | "hand-peace" | "rotate" | "spinner" | "robot" | "peace" | "gears" | "warehouse" | "arrow-up-right-dots" | "splotch" | "face-grin-hearts" | "dice-four" | "sim-card" | "transgender" | "mercury" | "arrow-turn-down" | "person-falling-burst" | "award" | "ticket-simple" | "building" | "angles-left" | "qrcode" | "clock-rotate-left" | "face-grin-beam-sweat" | "file-export" | "shield" | "arrow-up-short-wide" | "house-medical" | "golf-ball-tee" | "circle-chevron-left" | "house-chimney-window" | "pen-nib" | "tent-arrow-turn-left" | "tents" | "wand-magic" | "dog" | "carrot" | "moon" | "wine-glass-empty" | "cheese" | "yin-yang" | "music" | "code-commit" | "temperature-low" | "person-biking" | "broom" | "shield-heart" | "gopuram" | "earth-oceania" | "square-xmark" | "hashtag" | "up-right-and-down-left-from-center" | "oil-can" | "t" | "hippo" | "chart-column" | "infinity" | "vial-circle-check" | "person-arrow-down-to-line" | "voicemail" | "fan" | "person-walking-luggage" | "up-down" | "cloud-moon-rain" | "calendar" | "trailer" | "bahai" | "sd-card" | "dragon" | "shoe-prints" | "circle-plus" | "face-grin-tongue-wink" | "hand-holding" | "plug-circle-exclamation" | "link-slash" | "clone" | "person-walking-arrow-loop-left" | "arrow-up-z-a" | "fire-flame-curved" | "tornado" | "file-circle-plus" | "book-quran" | "anchor" | "border-all" | "face-angry" | "cookie-bite" | "arrow-trend-down" | "rss" | "draw-polygon" | "scale-balanced" | "gauge-simple-high" | "shower" | "desktop" | "m" | "table-list" | "comment-sms" | "book" | "user-plus" | "check" | "battery-three-quarters" | "house-circle-check" | "angle-left" | "diagram-successor" | "truck-arrow-right" | "arrows-split-up-and-left" | "hand-fist" | "cloud-moon" | "briefcase" | "person-falling" | "image-portrait" | "user-tag" | "rug" | "earth-europe" | "cart-flatbed-suitcase" | "rectangle-xmark" | "baht-sign" | "book-open" | "book-journal-whills" | "handcuffs" | "triangle-exclamation" | "database" | "share" | "bottle-droplet" | "mask-face" | "hill-rockslide" | "right-left" | "paper-plane" | "road-circle-exclamation" | "dungeon" | "align-right" | "money-bill-1-wave" | "life-ring" | "hands" | "calendar-day" | "water-ladder" | "arrows-up-down" | "face-grimace" | "wheelchair-move" | "turn-down" | "person-walking-arrow-right" | "square-envelope" | "dice" | "bowling-ball" | "brain" | "bandage" | "calendar-minus" | "circle-xmark" | "gifts" | "hotel" | "earth-asia" | "id-card-clip" | "magnifying-glass-plus" | "thumbs-up" | "user-clock" | "hand-dots" | "file-invoice" | "window-minimize" | "mug-saucer" | "brush" | "mask" | "magnifying-glass-minus" | "ruler-vertical" | "user-large" | "train-tram" | "user-nurse" | "syringe" | "cloud-sun" | "stopwatch-20" | "square-full" | "magnet" | "jar" | "note-sticky" | "bug-slash" | "arrow-up-from-water-pump" | "bone" | "user-injured" | "face-sad-tear" | "plane" | "tent-arrows-down" | "exclamation" | "arrows-spin" | "print" | "turkish-lira-sign" | "dollar-sign" | "x" | "magnifying-glass-dollar" | "users-gear" | "person-military-pointing" | "building-columns" | "umbrella" | "trowel" | "d" | "stapler" | "masks-theater" | "kip-sign" | "hand-point-left" | "handshake-simple" | "jet-fighter" | "square-share-nodes" | "barcode" | "plus-minus" | "video" | "graduation-cap" | "hand-holding-medical" | "person-circle-check" | "turn-up";
2
+ export type IconRegular = "trash-can" | "message" | "file-lines" | "calendar-days" | "hand-point-right" | "face-smile-beam" | "face-grin-stars" | "address-book" | "comments" | "paste" | "face-grin-tongue-squint" | "face-flushed" | "square-caret-right" | "square-minus" | "compass" | "square-caret-down" | "face-kiss-beam" | "lightbulb" | "flag" | "square-check" | "circle-dot" | "face-dizzy" | "futbol" | "pen-to-square" | "hourglass-half" | "eye-slash" | "hand" | "hand-spock" | "face-kiss" | "face-grin-tongue" | "chess-bishop" | "face-grin-wink" | "face-grin-wide" | "face-frown-open" | "hand-point-up" | "bookmark" | "hand-point-down" | "folder" | "user" | "square-caret-left" | "star" | "chess-knight" | "face-laugh-squint" | "face-laugh" | "folder-open" | "clipboard" | "chess-queen" | "hand-back-fist" | "square-caret-up" | "chart-bar" | "window-restore" | "square-plus" | "image" | "folder-closed" | "lemon" | "handshake" | "gem" | "circle-play" | "circle-check" | "circle-stop" | "id-badge" | "face-laugh-beam" | "registered" | "address-card" | "face-tired" | "font-awesome" | "face-smile-wink" | "file-word" | "file-powerpoint" | "envelope-open" | "file-zipper" | "square" | "snowflake" | "newspaper" | "face-kiss-wink-heart" | "star-half-stroke" | "file-excel" | "face-grin-beam" | "object-ungroup" | "circle-right" | "face-rolling-eyes" | "object-group" | "heart" | "face-surprise" | "circle-pause" | "circle" | "circle-up" | "file-audio" | "file-image" | "circle-question" | "face-meh-blank" | "eye" | "face-sad-cry" | "file-code" | "window-maximize" | "face-frown" | "floppy-disk" | "comment-dots" | "face-grin-squint" | "hand-pointer" | "hand-scissors" | "face-grin-tears" | "calendar-xmark" | "file-video" | "file-pdf" | "comment" | "envelope" | "hourglass" | "calendar-check" | "hard-drive" | "face-grin-squint-tears" | "rectangle-list" | "calendar-plus" | "circle-left" | "money-bill-1" | "clock" | "keyboard" | "closed-captioning" | "images" | "face-grin" | "face-meh" | "id-card" | "sun" | "face-laugh-wink" | "circle-down" | "thumbs-down" | "chess-pawn" | "credit-card" | "bell" | "file" | "hospital" | "chess-rook" | "star-half" | "chess-king" | "circle-user" | "copy" | "share-from-square" | "copyright" | "map" | "bell-slash" | "hand-lizard" | "face-smile" | "hand-peace" | "face-grin-hearts" | "building" | "face-grin-beam-sweat" | "moon" | "calendar" | "face-grin-tongue-wink" | "clone" | "face-angry" | "rectangle-xmark" | "paper-plane" | "life-ring" | "face-grimace" | "calendar-minus" | "circle-xmark" | "thumbs-up" | "window-minimize" | "square-full" | "note-sticky" | "face-sad-tear" | "hand-point-left";
3
+ export type IconBrand = "monero" | "hooli" | "yelp" | "cc-visa" | "lastfm" | "shopware" | "creative-commons-nc" | "aws" | "redhat" | "yoast" | "cloudflare" | "ups" | "wpexplorer" | "dyalog" | "bity" | "stackpath" | "buysellads" | "first-order" | "modx" | "guilded" | "vnv" | "square-js" | "microsoft" | "qq" | "orcid" | "java" | "invision" | "creative-commons-pd-alt" | "centercode" | "glide-g" | "drupal" | "hire-a-helper" | "creative-commons-by" | "unity" | "whmcs" | "rocketchat" | "vk" | "untappd" | "mailchimp" | "css3-alt" | "square-reddit" | "vimeo-v" | "contao" | "square-font-awesome" | "deskpro" | "sistrix" | "square-instagram" | "battle-net" | "the-red-yeti" | "square-hacker-news" | "edge" | "napster" | "square-snapchat" | "google-plus-g" | "artstation" | "markdown" | "sourcetree" | "google-plus" | "diaspora" | "foursquare" | "stack-overflow" | "github-alt" | "phoenix-squadron" | "pagelines" | "algolia" | "red-river" | "creative-commons-sa" | "safari" | "google" | "square-font-awesome-stroke" | "atlassian" | "linkedin-in" | "digital-ocean" | "nimblr" | "chromecast" | "evernote" | "hacker-news" | "creative-commons-sampling" | "adversal" | "creative-commons" | "watchman-monitoring" | "fonticons" | "weixin" | "shirtsinbulk" | "codepen" | "git-alt" | "lyft" | "rev" | "windows" | "wizards-of-the-coast" | "square-viadeo" | "meetup" | "centos" | "adn" | "cloudsmith" | "pied-piper-alt" | "square-dribbble" | "codiepie" | "node" | "mix" | "steam" | "cc-apple-pay" | "scribd" | "openid" | "instalod" | "expeditedssl" | "sellcast" | "square-twitter" | "r-project" | "delicious" | "freebsd" | "vuejs" | "accusoft" | "ioxhost" | "fonticons-fi" | "app-store" | "cc-mastercard" | "itunes-note" | "golang" | "kickstarter" | "grav" | "weibo" | "uncharted" | "firstdraft" | "square-youtube" | "wikipedia-w" | "wpressr" | "angellist" | "galactic-republic" | "nfc-directional" | "skype" | "joget" | "fedora" | "stripe-s" | "meta" | "laravel" | "hotjar" | "bluetooth-b" | "sticker-mule" | "creative-commons-zero" | "hips" | "behance" | "reddit" | "discord" | "chrome" | "app-store-ios" | "cc-discover" | "wpbeginner" | "confluence" | "mdb" | "dochub" | "accessible-icon" | "ebay" | "amazon" | "unsplash" | "yarn" | "square-steam" | "500px" | "square-vimeo" | "asymmetrik" | "font-awesome" | "gratipay" | "apple" | "hive" | "gitkraken" | "keybase" | "apple-pay" | "padlet" | "amazon-pay" | "square-github" | "stumbleupon" | "fedex" | "phoenix-framework" | "shopify" | "neos" | "hackerrank" | "researchgate" | "swift" | "angular" | "speakap" | "angrycreative" | "y-combinator" | "empire" | "envira" | "square-gitlab" | "studiovinari" | "pied-piper" | "wordpress" | "product-hunt" | "firefox" | "linode" | "goodreads" | "square-odnoklassniki" | "jsfiddle" | "sith" | "themeisle" | "page4" | "hashnode" | "react" | "cc-paypal" | "squarespace" | "cc-stripe" | "creative-commons-share" | "bitcoin" | "keycdn" | "opera" | "itch-io" | "umbraco" | "galactic-senate" | "ubuntu" | "draft2digital" | "stripe" | "houzz" | "gg" | "dhl" | "square-pinterest" | "xing" | "blackberry" | "creative-commons-pd" | "playstation" | "quinscape" | "less" | "blogger-b" | "opencart" | "vine" | "paypal" | "gitlab" | "typo3" | "reddit-alien" | "yahoo" | "dailymotion" | "affiliatetheme" | "pied-piper-pp" | "bootstrap" | "odnoklassniki" | "nfc-symbol" | "ethereum" | "speaker-deck" | "creative-commons-nc-eu" | "patreon" | "avianex" | "ello" | "gofore" | "bimobject" | "facebook-f" | "square-google-plus" | "mandalorian" | "first-order-alt" | "osi" | "google-wallet" | "d-and-d-beyond" | "periscope" | "fulcrum" | "cloudscale" | "forumbee" | "mizuni" | "schlix" | "square-xing" | "bandcamp" | "wpforms" | "cloudversify" | "usps" | "megaport" | "magento" | "spotify" | "optin-monster" | "fly" | "aviato" | "itunes" | "cuttlefish" | "blogger" | "flickr" | "viber" | "soundcloud" | "digg" | "tencent-weibo" | "symfony" | "maxcdn" | "etsy" | "facebook-messenger" | "audible" | "think-peaks" | "bilibili" | "erlang" | "cotton-bureau" | "dashcube" | "42-group" | "stack-exchange" | "elementor" | "square-pied-piper" | "creative-commons-nd" | "palfed" | "superpowers" | "resolving" | "xbox" | "searchengin" | "tiktok" | "square-facebook" | "renren" | "linux" | "glide" | "linkedin" | "hubspot" | "deploydog" | "twitch" | "ravelry" | "mixer" | "square-lastfm" | "vimeo" | "mendeley" | "uniregistry" | "figma" | "creative-commons-remix" | "cc-amazon-pay" | "dropbox" | "instagram" | "cmplid" | "facebook" | "gripfire" | "jedi-order" | "uikit" | "fort-awesome-alt" | "phabricator" | "ussunnah" | "earlybirds" | "trade-federation" | "autoprefixer" | "whatsapp" | "slideshare" | "google-play" | "viadeo" | "line" | "google-drive" | "servicestack" | "simplybuilt" | "bitbucket" | "imdb" | "deezer" | "raspberry-pi" | "jira" | "docker" | "screenpal" | "bluetooth" | "gitter" | "d-and-d" | "microblog" | "cc-diners-club" | "gg-circle" | "pied-piper-hat" | "kickstarter-k" | "yandex" | "readme" | "html5" | "sellsy" | "sass" | "wirsindhandwerk" | "buromobelexperte" | "salesforce" | "octopus-deploy" | "medapps" | "ns8" | "pinterest-p" | "apper" | "fort-awesome" | "waze" | "cc-jcb" | "snapchat" | "fantasy-flight-games" | "rust" | "wix" | "square-behance" | "supple" | "rebel" | "css3" | "staylinked" | "kaggle" | "space-awesome" | "deviantart" | "cpanel" | "goodreads-g" | "square-git" | "square-tumblr" | "trello" | "creative-commons-nc-jp" | "get-pocket" | "perbyte" | "grunt" | "weebly" | "connectdevelop" | "leanpub" | "black-tie" | "themeco" | "python" | "android" | "bots" | "free-code-camp" | "hornbill" | "js" | "ideal" | "git" | "dev" | "sketch" | "yandex-international" | "cc-amex" | "uber" | "github" | "php" | "alipay" | "youtube" | "skyatlas" | "firefox-browser" | "replyd" | "suse" | "jenkins" | "twitter" | "rockrms" | "pinterest" | "buffer" | "npm" | "yammer" | "btc" | "dribbble" | "stumbleupon-circle" | "internet-explorer" | "stubber" | "telegram" | "old-republic" | "odysee" | "square-whatsapp" | "node-js" | "edge-legacy" | "slack" | "medrt" | "usb" | "tumblr" | "vaadin" | "quora" | "reacteurope" | "medium" | "amilia" | "mixcloud" | "flipboard" | "viacoin" | "critical-role" | "sitrox" | "discourse" | "joomla" | "mastodon" | "airbnb" | "wolf-pack-battalion" | "buy-n-large" | "gulp" | "creative-commons-sampling-plus" | "strava" | "ember" | "canadian-maple-leaf" | "teamspeak" | "pushed" | "wordpress-simple" | "nutritionix" | "wodu" | "google-pay" | "intercom" | "zhihu" | "korvue" | "pix" | "steam-symbol";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./Icon";
2
+ export * from "./icons";
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Icon"), exports);
18
+ __exportStar(require("./icons"), exports);
@@ -0,0 +1 @@
1
+ export * from "./markdown";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./markdown"), exports);
@@ -0,0 +1,29 @@
1
+ import m from "mithril";
2
+ import { marked } from "marked";
3
+ /**
4
+ * Default options for the markdown parser
5
+ *
6
+ * @see https://marked.js.org/using_advanced#options
7
+ */
8
+ export declare const MARKDOWN_DEFAULT_OPTIONS: marked.MarkedOptions;
9
+ /**
10
+ * Render a markdown string.
11
+ *
12
+ * Either provide the markdown string as an attr, or in the first child.
13
+ *
14
+ * Returned in a div with the `markdown` class.
15
+ */
16
+ export declare const Markdown: m.Component<{
17
+ /** The markdown content to parse */
18
+ markdown?: string;
19
+ /** Options for parseing the markdown */
20
+ markedOptions?: marked.MarkedOptions;
21
+ /** Optionally do not sanitise the resulting string */
22
+ unsanitised?: boolean;
23
+ /** Highlight syntax */
24
+ highlight?: boolean;
25
+ /** CSS classes to apply to the container div */
26
+ class?: string;
27
+ /** CSS styles to apply to the container div */
28
+ style?: string;
29
+ }>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.Markdown = exports.MARKDOWN_DEFAULT_OPTIONS = void 0;
7
+ const mithril_1 = __importDefault(require("mithril"));
8
+ const marked_1 = require("marked");
9
+ const dompurify_1 = __importDefault(require("dompurify"));
10
+ // import hljs from "highlight.js/lib/common";
11
+ /**
12
+ * Default options for the markdown parser
13
+ *
14
+ * @see https://marked.js.org/using_advanced#options
15
+ */
16
+ exports.MARKDOWN_DEFAULT_OPTIONS = {
17
+ smartLists: true,
18
+ headerIds: true,
19
+ };
20
+ /**
21
+ * Render a markdown string.
22
+ *
23
+ * Either provide the markdown string as an attr, or in the first child.
24
+ *
25
+ * Returned in a div with the `markdown` class.
26
+ */
27
+ exports.Markdown = {
28
+ oncreate({ attrs }) {
29
+ var _a;
30
+ if (attrs.highlight === true) {
31
+ // console.log("highlighting...");
32
+ (_a = window.hljs) === null || _a === void 0 ? void 0 : _a.highlightAll();
33
+ // hljs.highlightAll();
34
+ }
35
+ },
36
+ // onupdate({ attrs }) {
37
+ // if (attrs.highlight === true) {
38
+ // // console.log("highlighting...");
39
+ // hljs.highlightAll();
40
+ // }
41
+ // },
42
+ view({ attrs, children }) {
43
+ var _a, _b, _c, _d, _e, _f;
44
+ const markdown = (_c = (_b = (_a = attrs.markdown) !== null && _a !== void 0 ? _a : (typeof children === "string" ? children : undefined)) !== null && _b !== void 0 ? _b : (children instanceof Array && children.length > 0 && typeof children[0] === "string" ? children[0] : undefined)) !== null && _c !== void 0 ? _c : "";
45
+ const parsed = marked_1.marked.parse(markdown, (_d = attrs.markedOptions) !== null && _d !== void 0 ? _d : exports.MARKDOWN_DEFAULT_OPTIONS);
46
+ const sanitised = attrs.unsanitised === true ? parsed : dompurify_1.default.sanitize(parsed);
47
+ const result = sanitised;
48
+ // const result = attrs.highlight === true
49
+ // ? hljs.highlightAuto(sanitised).value
50
+ // : sanitised;
51
+ return (0, mithril_1.default)("", {
52
+ class: `markdown ${(_e = attrs.class) !== null && _e !== void 0 ? _e : ""}`,
53
+ style: `${(_f = attrs.style) !== null && _f !== void 0 ? _f : ""}`,
54
+ }, [
55
+ mithril_1.default.trust(result),
56
+ ]);
57
+ }
58
+ };
@@ -0,0 +1 @@
1
+ export * from "./Markdown";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Markdown"), exports);
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
File without changes
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,2 @@
1
+ export * from "./components";
2
+ export * from "./utils";
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./components"), exports);
18
+ __exportStar(require("./utils"), exports);
@@ -0,0 +1,3 @@
1
+ export type DateToHtmlResult<T extends Date | undefined | null> = T extends Date ? string : T extends undefined ? undefined : T extends null ? null : never;
2
+ export declare function dateToHtml<T extends Date | undefined | null>(d: T): DateToHtmlResult<T>;
3
+ export declare function dateToHtmlUTC<T extends Date | undefined | null>(d: T): DateToHtmlResult<T>;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateToHtmlUTC = exports.dateToHtml = void 0;
4
+ function dateToHtml(d) {
5
+ if (d === undefined)
6
+ return undefined;
7
+ if (d === null)
8
+ return null;
9
+ return [
10
+ String(d.getFullYear()),
11
+ String(d.getMonth() + 1).padStart(2, "0"),
12
+ String(d.getDate()).padStart(2, "0"),
13
+ ].join("-");
14
+ }
15
+ exports.dateToHtml = dateToHtml;
16
+ function dateToHtmlUTC(d) {
17
+ if (d === undefined)
18
+ return undefined;
19
+ if (d === null)
20
+ return null;
21
+ return [
22
+ String(d.getUTCFullYear()),
23
+ String(d.getUTCMonth() + 1).padStart(2, "0"),
24
+ String(d.getUTCDate()).padStart(2, "0"),
25
+ ].join("-");
26
+ }
27
+ exports.dateToHtmlUTC = dateToHtmlUTC;
@@ -0,0 +1 @@
1
+ export * from "./date-time";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./date-time"), exports);
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "@hypericon/mico",
3
+ "version": "0.1.0",
4
+ "description": "UI components and utilities with Mithril",
5
+ "author": "Ed Johnson, Hypericon Ltd",
6
+ "license": "MIT",
7
+ "main": "dist/index.js",
8
+ "scripts": {
9
+ "dev": "vite",
10
+ "prebuild": "rimraf dist",
11
+ "build": "tsc --project src",
12
+ "build-example": "vite build",
13
+ "prepublishOnly": "npm run build",
14
+ "predeploy": "npm run build-example",
15
+ "deploy": "git push origin deploy",
16
+ "test": "echo \"Error: no test specified\" && exit 1"
17
+ },
18
+ "dependencies": {
19
+ "@fortawesome/fontawesome-free": "^6.4.0",
20
+ "dompurify": "^3.0.3",
21
+ "highlight.js": "^11.8.0",
22
+ "marked": "^4.3.0",
23
+ "mithril": "^2.2.2"
24
+ },
25
+ "devDependencies": {
26
+ "@types/dompurify": "^3.0.2",
27
+ "@types/marked": "^4.3.0",
28
+ "@types/mithril": "^2.0.12",
29
+ "@types/node": "^20.1.4",
30
+ "rimraf": "^5.0.0",
31
+ "typescript": "^5.0.4",
32
+ "vite": "^4.3.5"
33
+ },
34
+ "files": [
35
+ "dist"
36
+ ]
37
+ }