From 430447b9a61a2f49825e8b9aa2c49145128b4733 Mon Sep 17 00:00:00 2001 From: Sami Fouad Date: Sun, 8 Nov 2026 21:35:00 -0600 Subject: [PATCH 1/5] The license, once: MIT text, footer line, hero badge and license page from one License (APS 17) (0.3.0) mitLicense() builds the LICENSE file's text byte for byte (tested against harar's and p8's files, upstream notices kept above ours); LicenseLink, LicenseBadge and LicenseView show it. A source link appears only when a site passes one. The tool header's links wrap at phone width. --- README.md | 31 ++++++- package-lock.json | 4 +- package.json | 2 +- src/footer/index.tsx | 8 +- src/index.ts | 1 + src/kit.css | 27 ++++++ src/license/index.tsx | 134 ++++++++++++++++++++++++++++++ src/tool/index.tsx | 18 ++-- src/tool/tool.css | 7 +- tests/fixtures/harar-LICENSE | 21 +++++ tests/fixtures/p8-runtime-LICENSE | 24 ++++++ tests/license.test.mjs | 87 +++++++++++++++++++ 12 files changed, 351 insertions(+), 13 deletions(-) create mode 100644 src/license/index.tsx create mode 100644 tests/fixtures/harar-LICENSE create mode 100644 tests/fixtures/p8-runtime-LICENSE create mode 100644 tests/license.test.mjs diff --git a/README.md b/README.md index 56b744c..3785717 100644 --- a/README.md +++ b/README.md @@ -42,9 +42,38 @@ import { Header, Footer, HeaderButton, PersonIcon, themeBoot } from '@addiscorp/ - **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. - **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`. - **`HeaderButton`**: a round button with a popover, one popover open at a time with the menu: account, notifications (`badge`), settings, or anything else. -- **`Footer`**: who makes the site (Addis Corp by default; `owner` changes it), the site's name, the light/dark switch. +- **`Footer`**: who makes the site (Addis Corp by default; `owner` changes it), the product's license when `license` is passed, the site's name, the light/dark switch. - **Theme**: `themeBoot` sets light or dark before paint (a `theme` cookie wins, else the system); `ThemeToggle` switches and remembers. +## The license + +Addis products are MIT (APS 17). One `License` describes a product's license, +and the same value drives everything a site shows about it, so the footer, the +badge, the page and the LICENSE file can't disagree. + +```tsx +import { LicenseView, MIT_LICENSE, mitLicense, type License } from '@addiscorp/kit'; + +const license: License = {}; // MIT, Copyright (c) 2026 Sami Fouad +const harar: License = { source: 'https://github.com/addiscorp/harar' }; // public: the source is linked +const p8: License = { // a fork keeps its upstream notices, above ours + github: 'samifouad', + upstream: [{ year: 2025, holder: 'Di Wu', github: 'wudi' }], + preface: 'p8 began as a fork of php-rs by Di Wu.', +}; + +… // footer: "MIT License · © 2026 Sami Fouad" → /license/, then "source" + // a small "MIT licensed" badge beside the buttons → /license/ +… // the same footer line +