elbe-ui 0.2.52 → 0.3.1

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/dist/index.d.ts CHANGED
@@ -28,6 +28,8 @@ export * from "./ui/components/badge";
28
28
  export * from "./ui/components/banner";
29
29
  export * from "./ui/components/dialog";
30
30
  export * from "./ui/components/error_view";
31
+ export * from "./ui/components/footer";
32
+ export * from "./ui/components/link";
31
33
  export * from "./ui/components/progress_bar";
32
34
  export * from "./ui/components/spinner";
33
35
  export * from "./ui/components/text";
package/dist/index.js CHANGED
@@ -31,6 +31,8 @@ export * from "./ui/components/badge";
31
31
  export * from "./ui/components/banner";
32
32
  export * from "./ui/components/dialog";
33
33
  export * from "./ui/components/error_view";
34
+ export * from "./ui/components/footer";
35
+ export * from "./ui/components/link";
34
36
  export * from "./ui/components/progress_bar";
35
37
  export * from "./ui/components/spinner";
36
38
  export * from "./ui/components/text";
@@ -0,0 +1,18 @@
1
+ import React from "preact/compat";
2
+ import { IconChild } from "../..";
3
+ export type FooterLink = {
4
+ label: string;
5
+ href: string;
6
+ icon?: IconChild;
7
+ };
8
+ export declare function Footer({ left, right, copyright, version, legal, }: {
9
+ left: (FooterLink | React.ReactNode)[];
10
+ right?: (FooterLink | React.ReactNode)[];
11
+ copyright?: string | React.ReactNode;
12
+ version?: string;
13
+ legal?: FooterLink;
14
+ }): React.JSX.Element;
15
+ export declare function _WrittenIn({ city, href, }: {
16
+ city?: string;
17
+ href?: string;
18
+ }): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ import { HeartIcon } from "lucide-react";
3
+ import { Card, Column, FlexSpace, Link, Row } from "../..";
4
+ export function Footer({ left, right, copyright, version, legal, }) {
5
+ return (_jsx(Card, { scheme: "secondary", sharp: true, style: {
6
+ borderLeft: "none",
7
+ borderRight: "none",
8
+ borderBottom: "none",
9
+ color: "color-mix(in srgb, var(--c-context-front) 60%, transparent)",
10
+ }, children: _jsxs(Column, { gap: 0.5, children: [_jsxs(Row, { main: "space-between", cross: "start", children: [_jsx(Column, { gap: 0.5, flex: 1, cross: "start", children: left.map((item) => (item.label ? _jsx(_Link, Object.assign({}, item)) : item)) }), right && (_jsx(Column, { gap: 0.5, flex: 1, cross: "end", children: right.map((item) => item.label ? _jsx(_Link, Object.assign({}, item)) : item) }))] }), (copyright || version || legal) && _jsx("hr", { style: { opacity: 0.7 } }), (copyright || version || legal) && (_jsxs(Row, { children: [copyright &&
11
+ (typeof copyright === "string" ? _jsx("b", { children: copyright }) : copyright), version && _jsx(_Version, { version: version }), _jsx(FlexSpace, {}), legal && _jsx(_Link, Object.assign({}, legal))] }))] }) }));
12
+ }
13
+ function _Version({ version }) {
14
+ return (_jsx("pre", { style: {
15
+ margin: "0",
16
+ fontSize: ".75rem",
17
+ fontFamily: "monospace",
18
+ }, children: version }));
19
+ }
20
+ function _Link({ href, label }) {
21
+ return (_jsx(Link, { color: "inherit", plain: true, noIcon: true, href: href, label: label, external: true }));
22
+ }
23
+ export function _WrittenIn({ city = "Hamburg", href, }) {
24
+ return (_jsxs("a", { href: href, style: {
25
+ padding: ".25rem .5rem",
26
+ color: "white",
27
+ fontWeight: "bold",
28
+ background: "#818a99",
29
+ borderRadius: "3rem",
30
+ fontSize: ".7rem",
31
+ display: "inline-flex",
32
+ alignItems: "center",
33
+ textDecoration: "none",
34
+ }, children: ["written with", _jsx(HeartIcon, { style: { marginLeft: ".25rem", marginRight: ".25rem" }, size: 10, strokeWidth: 3 }), "in ", city] }));
35
+ }
@@ -0,0 +1,10 @@
1
+ export declare function Link(p: {
2
+ label: string;
3
+ href: string;
4
+ external?: boolean;
5
+ plain?: boolean;
6
+ bold?: boolean;
7
+ noIcon?: boolean;
8
+ underline?: boolean;
9
+ color?: string;
10
+ }): import("preact").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
2
+ import { ExternalLinkIcon } from "lucide-react";
3
+ export function Link(p) {
4
+ return (_jsxs("a", { class: p.plain ? "plain" : "accent action", href: p.href, target: p.external ? "_blank" : undefined, rel: p.external ? "noopener noreferrer" : undefined, style: {
5
+ color: p.color,
6
+ display: "inline-flex",
7
+ textDecoration: p.underline ? "underline" : "none",
8
+ alignItems: "center",
9
+ fontWeight: p.bold ? "bold" : "normal",
10
+ padding: ".125rem .3rem",
11
+ borderRadius: ".5rem",
12
+ margin: "-.125rem -.3rem",
13
+ transition: "background .2s",
14
+ }, children: [p.label, p.external && !p.noIcon && (_jsx(ExternalLinkIcon, { size: 15, style: { marginLeft: ".25rem", marginBottom: ".25rem" } }))] }));
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elbe-ui",
3
- "version": "0.2.52",
3
+ "version": "0.3.1",
4
4
  "author": "Robin Naumann",
5
5
  "license": "MIT",
6
6
  "repository": {