@addiscorp/kit 0.4.2 → 0.5.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 CHANGED
@@ -42,7 +42,7 @@ import { Header, Footer, HeaderButton, PersonIcon, themeBoot } from '@addiscorp/
42
42
  - **The menu**: the brand button opens it; ⌘M / Ctrl+M opens and closes it; ⌘S, Ctrl+S or `/` opens it on search; typing anywhere searches; ↑ ↓ move, Enter opens, 1–9 open a numbered tile, Esc closes, `?` lists the shortcuts. A click outside or a navigation closes it.
43
43
  - **Groups** are tiles (numbered 1–9 in order across groups) or rows (`layout: 'list'`); a `searchOnly` group appears only as search matches. An item has a `href` or an `onSelect`, an optional `icon`, `detail` and `keywords`.
44
44
  - **`HeaderButton`**: a round button with a popover, one popover open at a time with the menu: account, notifications (`badge`), settings, or anything else.
45
- - **`Footer`**: who makes the site, the one copyright line (Addis Corp by default; `owner` changes it); the product's license (`MIT license`, to `/license/`) when `license` is passed; Terms and Privacy, which every Addis site links to the same pages on addis.gg (`TERMS_HREF`, `PRIVACY_HREF`); the light/dark switch.
45
+ - **`Footer`**: who makes the site, the one copyright line (Addis Corp by default; `owner` changes it); the product's license (`MIT license`, to `/license/`) when `license` is passed; Terms and Privacy, which every Addis site links to the same pages on addis.gg (`TERMS_HREF`, `PRIVACY_HREF`), folded on a phone (600px and narrower) into one "legal" link to addis.gg/legal/ (`LEGAL_HREF`), which links to both; `extra`, a site's own control just before the theme switch (a button styled `ak-theme-toggle`); the light/dark switch.
46
46
  - **Theme**: `themeBoot` sets light or dark before paint (a `theme` cookie wins, else the system); `ThemeToggle` switches and remembers.
47
47
 
48
48
  ## The license
@@ -9,11 +9,15 @@ export declare const ADDIS: Owner;
9
9
  /** The terms and privacy pages: one place on addis.gg for every Addis site. */
10
10
  export declare const TERMS_HREF = "https://addis.gg/terms/";
11
11
  export declare const PRIVACY_HREF = "https://addis.gg/privacy/";
12
+ /** One link to both, on a phone: addis.gg/legal/ links to terms and privacy. */
13
+ export declare const LEGAL_HREF = "https://addis.gg/legal/";
12
14
  export type FooterProps = {
13
15
  owner?: Owner;
14
16
  /** The year in the copyright line; this year by default. */
15
17
  year?: number;
16
18
  /** A small line under the footer row, e.g. trademark notices. */
17
19
  note?: ReactNode;
20
+ /** A site's own control, just before the theme switch (a button the size of it, `ak-theme-toggle`). */
21
+ extra?: ReactNode;
18
22
  };
19
- export declare function Footer({ owner, year, note }: FooterProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare function Footer({ owner, year, note, extra }: FooterProps): import("react/jsx-runtime").JSX.Element;
@@ -9,8 +9,10 @@ export const ADDIS = {
9
9
  /** The terms and privacy pages: one place on addis.gg for every Addis site. */
10
10
  export const TERMS_HREF = 'https://addis.gg/terms/';
11
11
  export const PRIVACY_HREF = 'https://addis.gg/privacy/';
12
- export function Footer({ owner = ADDIS, year = new Date().getFullYear(), note }) {
13
- return (_jsxs("footer", { className: "ak-foot", children: [_jsxs("a", { className: "ak-credit", href: owner.href, children: [owner.logo, "\u00A9 ", year, " ", owner.name] }), _jsxs("nav", { className: "ak-foot-end", "aria-label": "Legal", children: [_jsx("a", { href: TERMS_HREF, children: "terms" }), _jsx("a", { href: PRIVACY_HREF, children: "privacy" }), _jsx(ThemeToggle, {})] }), note && _jsx("p", { className: "ak-foot-note", children: note })] }));
12
+ /** One link to both, on a phone: addis.gg/legal/ links to terms and privacy. */
13
+ export const LEGAL_HREF = 'https://addis.gg/legal/';
14
+ export function Footer({ owner = ADDIS, year = new Date().getFullYear(), note, extra }) {
15
+ return (_jsxs("footer", { className: "ak-foot", children: [_jsxs("a", { className: "ak-credit", href: owner.href, children: [owner.logo, "\u00A9 ", year, " ", owner.name] }), _jsxs("nav", { className: "ak-foot-end", "aria-label": "Legal", children: [_jsx("a", { className: "ak-foot-wide", href: TERMS_HREF, children: "terms" }), _jsx("a", { className: "ak-foot-wide", href: PRIVACY_HREF, children: "privacy" }), _jsx("a", { className: "ak-foot-narrow", href: LEGAL_HREF, children: "legal" }), extra, _jsx(ThemeToggle, {})] }), note && _jsx("p", { className: "ak-foot-note", children: note })] }));
14
16
  }
15
17
  function AddisMark() {
16
18
  return (_jsx("svg", { className: "ak-owner-mark", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 32, height: 32, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: '<circle cx="32" cy="32" r="31" fill="#1b1914"/><path fill="#f3efe3" d="M28.48 41L23.89 41L29.63 28.07Q26.87 27.73 25.60 26.27Q24.33 24.82 24.33 22.28L24.33 22.28L24.33 18.87L28.73 18.87L28.73 21.44Q28.73 23.27 29.52 23.95Q30.31 24.63 32.11 24.63L32.11 24.63L35.70 24.63L28.48 41ZM40.17 41L35.55 41Q35.52 38.21 35.08 36.51Q34.65 34.80 33.81 33.85Q32.98 32.91 31.74 32.38L31.74 32.38L33.19 28.91Q35.39 29.69 36.93 31.11Q38.46 32.54 39.28 34.92Q40.11 37.31 40.17 41L40.17 41Z"/><rect x="20" y="47.5" width="8" height="3" fill="#078930"/><rect x="28" y="47.5" width="8" height="3" fill="#fcdd09"/><rect x="36" y="47.5" width="8" height="3" fill="#da121a"/>' } }));
package/dist/kit.css CHANGED
@@ -116,6 +116,12 @@
116
116
  .ak-foot-end { flex-wrap: wrap; justify-content: flex-end; }
117
117
  .ak-foot-end a { color: inherit; text-decoration: none; }
118
118
  .ak-foot-end a:hover { color: var(--ak-ink); text-decoration: underline; text-underline-offset: 3px; }
119
+ /* Terms and privacy on a wide screen; on a phone one "legal" link to both. */
120
+ .ak-foot-end .ak-foot-narrow { display: none; }
121
+ @media (max-width: 600px) {
122
+ .ak-foot-end .ak-foot-wide { display: none; }
123
+ .ak-foot-end .ak-foot-narrow { display: inline; }
124
+ }
119
125
 
120
126
  /* Status: where a product stands. Beta is a filled dot, alpha a hollow one. */
121
127
  .ak-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@addiscorp/kit",
3
- "version": "0.4.2",
3
+ "version": "0.5.0",
4
4
  "description": "The header, footer, theme and tool-site layout every Addis site shares, in each project's own brand colours.",
5
5
  "license": "MIT",
6
6
  "type": "module",