@newtone-dev/ui-react-web 0.2.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/LICENSE +21 -0
- package/README.md +83 -0
- package/dist/accordion/accordion.css +239 -0
- package/dist/accordion/accordion.d.ts +106 -0
- package/dist/accordion/accordion.d.ts.map +1 -0
- package/dist/accordion/accordion.js +15 -0
- package/dist/accordion/accordion.js.map +1 -0
- package/dist/accordion/index.d.ts +4 -0
- package/dist/accordion/index.d.ts.map +1 -0
- package/dist/accordion/index.js +3 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/action/action.css +86 -0
- package/dist/action/action.d.ts +62 -0
- package/dist/action/action.d.ts.map +1 -0
- package/dist/action/action.js +59 -0
- package/dist/action/action.js.map +1 -0
- package/dist/action/index.d.ts +4 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +3 -0
- package/dist/action/index.js.map +1 -0
- package/dist/avatar/avatar.css +39 -0
- package/dist/avatar/avatar.d.ts +43 -0
- package/dist/avatar/avatar.d.ts.map +1 -0
- package/dist/avatar/avatar.js +38 -0
- package/dist/avatar/avatar.js.map +1 -0
- package/dist/avatar/index.d.ts +4 -0
- package/dist/avatar/index.d.ts.map +1 -0
- package/dist/avatar/index.js +3 -0
- package/dist/avatar/index.js.map +1 -0
- package/dist/button/button.css +112 -0
- package/dist/button/button.d.ts +36 -0
- package/dist/button/button.d.ts.map +1 -0
- package/dist/button/button.js +24 -0
- package/dist/button/button.js.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.d.ts.map +1 -0
- package/dist/button/index.js +2 -0
- package/dist/button/index.js.map +1 -0
- package/dist/card-box/card-box.css +75 -0
- package/dist/card-box/card-box.d.ts +114 -0
- package/dist/card-box/card-box.d.ts.map +1 -0
- package/dist/card-box/card-box.js +9 -0
- package/dist/card-box/card-box.js.map +1 -0
- package/dist/card-box/index.d.ts +4 -0
- package/dist/card-box/index.d.ts.map +1 -0
- package/dist/card-box/index.js +3 -0
- package/dist/card-box/index.js.map +1 -0
- package/dist/card-grid/card-grid.css +97 -0
- package/dist/card-grid/card-grid.d.ts +63 -0
- package/dist/card-grid/card-grid.d.ts.map +1 -0
- package/dist/card-grid/card-grid.js +27 -0
- package/dist/card-grid/card-grid.js.map +1 -0
- package/dist/card-grid/index.d.ts +4 -0
- package/dist/card-grid/index.d.ts.map +1 -0
- package/dist/card-grid/index.js +3 -0
- package/dist/card-grid/index.js.map +1 -0
- package/dist/color/gamut.d.ts +20 -0
- package/dist/color/gamut.d.ts.map +1 -0
- package/dist/color/gamut.js +72 -0
- package/dist/color/gamut.js.map +1 -0
- package/dist/color/index.d.ts +8 -0
- package/dist/color/index.d.ts.map +1 -0
- package/dist/color/index.js +21 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/oklch.d.ts +35 -0
- package/dist/color/oklch.d.ts.map +1 -0
- package/dist/color/oklch.js +103 -0
- package/dist/color/oklch.js.map +1 -0
- package/dist/color/scale.d.ts +20 -0
- package/dist/color/scale.d.ts.map +1 -0
- package/dist/color/scale.js +75 -0
- package/dist/color/scale.js.map +1 -0
- package/dist/color/seeds.d.ts +33 -0
- package/dist/color/seeds.d.ts.map +1 -0
- package/dist/color/seeds.js +148 -0
- package/dist/color/seeds.js.map +1 -0
- package/dist/control/control.css +203 -0
- package/dist/control/control.d.ts +112 -0
- package/dist/control/control.d.ts.map +1 -0
- package/dist/control/control.js +107 -0
- package/dist/control/control.js.map +1 -0
- package/dist/control/index.d.ts +4 -0
- package/dist/control/index.d.ts.map +1 -0
- package/dist/control/index.js +3 -0
- package/dist/control/index.js.map +1 -0
- package/dist/data-list/data-list.css +52 -0
- package/dist/data-list/data-list.d.ts +55 -0
- package/dist/data-list/data-list.d.ts.map +1 -0
- package/dist/data-list/data-list.js +51 -0
- package/dist/data-list/data-list.js.map +1 -0
- package/dist/data-list/index.d.ts +5 -0
- package/dist/data-list/index.d.ts.map +1 -0
- package/dist/data-list/index.js +3 -0
- package/dist/data-list/index.js.map +1 -0
- package/dist/data-list/row/row.d.ts +16 -0
- package/dist/data-list/row/row.d.ts.map +1 -0
- package/dist/data-list/row/row.js +15 -0
- package/dist/data-list/row/row.js.map +1 -0
- package/dist/feature-card/feature-card.css +93 -0
- package/dist/feature-card/feature-card.d.ts +68 -0
- package/dist/feature-card/feature-card.d.ts.map +1 -0
- package/dist/feature-card/feature-card.js +11 -0
- package/dist/feature-card/feature-card.js.map +1 -0
- package/dist/feature-card/index.d.ts +4 -0
- package/dist/feature-card/index.d.ts.map +1 -0
- package/dist/feature-card/index.js +3 -0
- package/dist/feature-card/index.js.map +1 -0
- package/dist/framed-icon/framed-icon.css +77 -0
- package/dist/framed-icon/framed-icon.d.ts +61 -0
- package/dist/framed-icon/framed-icon.d.ts.map +1 -0
- package/dist/framed-icon/framed-icon.js +14 -0
- package/dist/framed-icon/framed-icon.js.map +1 -0
- package/dist/framed-icon/index.d.ts +4 -0
- package/dist/framed-icon/index.d.ts.map +1 -0
- package/dist/framed-icon/index.js +3 -0
- package/dist/framed-icon/index.js.map +1 -0
- package/dist/gallery/gallery.css +165 -0
- package/dist/gallery/gallery.d.ts +85 -0
- package/dist/gallery/gallery.d.ts.map +1 -0
- package/dist/gallery/gallery.js +75 -0
- package/dist/gallery/gallery.js.map +1 -0
- package/dist/gallery/index.d.ts +4 -0
- package/dist/gallery/index.d.ts.map +1 -0
- package/dist/gallery/index.js +3 -0
- package/dist/gallery/index.js.map +1 -0
- package/dist/icon/icon.css +83 -0
- package/dist/icon/icon.d.ts +69 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.js +18 -0
- package/dist/icon/icon.js.map +1 -0
- package/dist/icon/index.d.ts +4 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.js +3 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/icon-link/icon-link.css +57 -0
- package/dist/icon-link/icon-link.d.ts +47 -0
- package/dist/icon-link/icon-link.d.ts.map +1 -0
- package/dist/icon-link/icon-link.js +35 -0
- package/dist/icon-link/icon-link.js.map +1 -0
- package/dist/icon-link/index.d.ts +4 -0
- package/dist/icon-link/index.d.ts.map +1 -0
- package/dist/icon-link/index.js +3 -0
- package/dist/icon-link/index.js.map +1 -0
- package/dist/identity/identity.d.ts +25 -0
- package/dist/identity/identity.d.ts.map +1 -0
- package/dist/identity/identity.js +25 -0
- package/dist/identity/identity.js.map +1 -0
- package/dist/identity/index.d.ts +3 -0
- package/dist/identity/index.d.ts.map +1 -0
- package/dist/identity/index.js +2 -0
- package/dist/identity/index.js.map +1 -0
- package/dist/index.d.ts +57 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/link/index.d.ts +3 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +2 -0
- package/dist/link/index.js.map +1 -0
- package/dist/link/link.css +65 -0
- package/dist/link/link.d.ts +38 -0
- package/dist/link/link.d.ts.map +1 -0
- package/dist/link/link.js +22 -0
- package/dist/link/link.js.map +1 -0
- package/dist/logo-marquee/index.d.ts +4 -0
- package/dist/logo-marquee/index.d.ts.map +1 -0
- package/dist/logo-marquee/index.js +3 -0
- package/dist/logo-marquee/index.js.map +1 -0
- package/dist/logo-marquee/logo-marquee.css +227 -0
- package/dist/logo-marquee/logo-marquee.d.ts +69 -0
- package/dist/logo-marquee/logo-marquee.d.ts.map +1 -0
- package/dist/logo-marquee/logo-marquee.js +11 -0
- package/dist/logo-marquee/logo-marquee.js.map +1 -0
- package/dist/media-plate/index.d.ts +4 -0
- package/dist/media-plate/index.d.ts.map +1 -0
- package/dist/media-plate/index.js +3 -0
- package/dist/media-plate/index.js.map +1 -0
- package/dist/media-plate/media-plate.css +41 -0
- package/dist/media-plate/media-plate.d.ts +45 -0
- package/dist/media-plate/media-plate.d.ts.map +1 -0
- package/dist/media-plate/media-plate.js +5 -0
- package/dist/media-plate/media-plate.js.map +1 -0
- package/dist/media-window/media-window.css +82 -0
- package/dist/navbar/actions/actions.d.ts +14 -0
- package/dist/navbar/actions/actions.d.ts.map +1 -0
- package/dist/navbar/actions/actions.js +12 -0
- package/dist/navbar/actions/actions.js.map +1 -0
- package/dist/navbar/brand/brand.d.ts +12 -0
- package/dist/navbar/brand/brand.d.ts.map +1 -0
- package/dist/navbar/brand/brand.js +10 -0
- package/dist/navbar/brand/brand.js.map +1 -0
- package/dist/navbar/context.d.ts +12 -0
- package/dist/navbar/context.d.ts.map +1 -0
- package/dist/navbar/context.js +13 -0
- package/dist/navbar/context.js.map +1 -0
- package/dist/navbar/index.d.ts +8 -0
- package/dist/navbar/index.d.ts.map +1 -0
- package/dist/navbar/index.js +8 -0
- package/dist/navbar/index.js.map +1 -0
- package/dist/navbar/link/drawer/drawer.css +50 -0
- package/dist/navbar/link/drawer/drawer.d.ts +20 -0
- package/dist/navbar/link/drawer/drawer.d.ts.map +1 -0
- package/dist/navbar/link/drawer/drawer.js +44 -0
- package/dist/navbar/link/drawer/drawer.js.map +1 -0
- package/dist/navbar/link/link.css +54 -0
- package/dist/navbar/link/link.d.ts +30 -0
- package/dist/navbar/link/link.d.ts.map +1 -0
- package/dist/navbar/link/link.js +29 -0
- package/dist/navbar/link/link.js.map +1 -0
- package/dist/navbar/links/links.d.ts +14 -0
- package/dist/navbar/links/links.d.ts.map +1 -0
- package/dist/navbar/links/links.js +14 -0
- package/dist/navbar/links/links.js.map +1 -0
- package/dist/navbar/menu-button/menu-button.css +20 -0
- package/dist/navbar/menu-button/menu-button.d.ts +13 -0
- package/dist/navbar/menu-button/menu-button.d.ts.map +1 -0
- package/dist/navbar/menu-button/menu-button.js +20 -0
- package/dist/navbar/menu-button/menu-button.js.map +1 -0
- package/dist/navbar/navbar.css +179 -0
- package/dist/navbar/navbar.d.ts +58 -0
- package/dist/navbar/navbar.d.ts.map +1 -0
- package/dist/navbar/navbar.js +96 -0
- package/dist/navbar/navbar.js.map +1 -0
- package/dist/numbered-list/index.d.ts +4 -0
- package/dist/numbered-list/index.d.ts.map +1 -0
- package/dist/numbered-list/index.js +3 -0
- package/dist/numbered-list/index.js.map +1 -0
- package/dist/numbered-list/numbered-list.css +46 -0
- package/dist/numbered-list/numbered-list.d.ts +31 -0
- package/dist/numbered-list/numbered-list.d.ts.map +1 -0
- package/dist/numbered-list/numbered-list.js +26 -0
- package/dist/numbered-list/numbered-list.js.map +1 -0
- package/dist/on-media/on-media.css +198 -0
- package/dist/quick-action/index.d.ts +4 -0
- package/dist/quick-action/index.d.ts.map +1 -0
- package/dist/quick-action/index.js +3 -0
- package/dist/quick-action/index.js.map +1 -0
- package/dist/quick-action/quick-action.css +70 -0
- package/dist/quick-action/quick-action.d.ts +68 -0
- package/dist/quick-action/quick-action.d.ts.map +1 -0
- package/dist/quick-action/quick-action.js +54 -0
- package/dist/quick-action/quick-action.js.map +1 -0
- package/dist/segmented-control/index.d.ts +4 -0
- package/dist/segmented-control/index.d.ts.map +1 -0
- package/dist/segmented-control/index.js +3 -0
- package/dist/segmented-control/index.js.map +1 -0
- package/dist/segmented-control/segmented-control.css +206 -0
- package/dist/segmented-control/segmented-control.d.ts +91 -0
- package/dist/segmented-control/segmented-control.d.ts.map +1 -0
- package/dist/segmented-control/segmented-control.js +9 -0
- package/dist/segmented-control/segmented-control.js.map +1 -0
- package/dist/stat-card/index.d.ts +4 -0
- package/dist/stat-card/index.d.ts.map +1 -0
- package/dist/stat-card/index.js +3 -0
- package/dist/stat-card/index.js.map +1 -0
- package/dist/stat-card/stat-card.css +56 -0
- package/dist/stat-card/stat-card.d.ts +48 -0
- package/dist/stat-card/stat-card.d.ts.map +1 -0
- package/dist/stat-card/stat-card.js +11 -0
- package/dist/stat-card/stat-card.js.map +1 -0
- package/dist/surface/index.d.ts +3 -0
- package/dist/surface/index.d.ts.map +1 -0
- package/dist/surface/index.js +2 -0
- package/dist/surface/index.js.map +1 -0
- package/dist/surface/surface.d.ts +40 -0
- package/dist/surface/surface.d.ts.map +1 -0
- package/dist/surface/surface.js +22 -0
- package/dist/surface/surface.js.map +1 -0
- package/dist/tag/index.d.ts +4 -0
- package/dist/tag/index.d.ts.map +1 -0
- package/dist/tag/index.js +3 -0
- package/dist/tag/index.js.map +1 -0
- package/dist/tag/tag.css +77 -0
- package/dist/tag/tag.d.ts +80 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +16 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/text/index.d.ts +3 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +2 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/text.css +232 -0
- package/dist/text/text.d.ts +64 -0
- package/dist/text/text.d.ts.map +1 -0
- package/dist/text/text.js +37 -0
- package/dist/text/text.js.map +1 -0
- package/dist/video-lightbox/index.d.ts +4 -0
- package/dist/video-lightbox/index.d.ts.map +1 -0
- package/dist/video-lightbox/index.js +3 -0
- package/dist/video-lightbox/index.js.map +1 -0
- package/dist/video-lightbox/video-lightbox.css +167 -0
- package/dist/video-lightbox/video-lightbox.d.ts +92 -0
- package/dist/video-lightbox/video-lightbox.d.ts.map +1 -0
- package/dist/video-lightbox/video-lightbox.js +31 -0
- package/dist/video-lightbox/video-lightbox.js.map +1 -0
- package/dist/wrapper/index.d.ts +3 -0
- package/dist/wrapper/index.d.ts.map +1 -0
- package/dist/wrapper/index.js +2 -0
- package/dist/wrapper/index.js.map +1 -0
- package/dist/wrapper/wrapper.d.ts +113 -0
- package/dist/wrapper/wrapper.d.ts.map +1 -0
- package/dist/wrapper/wrapper.js +83 -0
- package/dist/wrapper/wrapper.js.map +1 -0
- package/package.json +184 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The subpaths, not the barrel. `@newtone-dev/ui-react-web` re-exports Navbar, Navbar calls hooks, and
|
|
3
|
+
// this is a server component -- see the repo blueprint, section 4.3.
|
|
4
|
+
import { Surface } from '../surface/index.js';
|
|
5
|
+
import { Wrapper } from '../wrapper/index.js';
|
|
6
|
+
export function CardBox({ direction, padding = 2, gap, align, elevation, className, children, ...rest }) {
|
|
7
|
+
return (_jsx(Surface, { elevation: elevation, className: ['newtone-card-box', className].filter(Boolean).join(' '), ...rest, children: _jsx(Wrapper, { direction: direction, gap: gap, align: align, padding: padding, className: "newtone-card-box-body", children: children }) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=card-box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-box.js","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAAE,OAAO,EAA4D,MAAM,qBAAqB,CAAA;AAiHvG,MAAM,UAAU,OAAO,CAAC,EACpB,SAAS,EACT,OAAO,GAAG,CAAC,EACX,GAAG,EACH,KAAK,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACI;IACX,OAAO,CACH,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAChE,IAAI,YAKR,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,uBAAuB,YAEhC,QAAQ,GACH,GACJ,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/card-box/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card-box/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* The row's sheet, and this folder's first: the column mode's tracks, its floor and its gutter. See
|
|
2
|
+
* the repo blueprint, sections 4.1.7 and 4.2.
|
|
3
|
+
*
|
|
4
|
+
* ---- why this file did not exist until 2026-09-04 ------------------------
|
|
5
|
+
*
|
|
6
|
+
* **A component gets a sheet when it has a rule that is true every time.** Until the column mode
|
|
7
|
+
* arrived, everything this component said was a value the box already takes -- three fixed props on
|
|
8
|
+
* a `Wrapper` -- so there was nothing invariant left to declare and an empty sheet would have been a
|
|
9
|
+
* file the `@import` list has to keep in order for no reason. A row of equal tracks at a floor IS
|
|
10
|
+
* such a rule, and it cannot be said as a prop on a box. So the refusal and this file are the same
|
|
11
|
+
* rule read on two different days.
|
|
12
|
+
*
|
|
13
|
+
* ---- the tracks ---------------------------------------------------------
|
|
14
|
+
*
|
|
15
|
+
* `auto-fit` with a `minmax` floor: as many equal columns as fit, and the row reflows by dropping a
|
|
16
|
+
* column rather than by letting one card set the pace. `min(15rem, 100%)` rather than a bare floor
|
|
17
|
+
* for the reason the two card sheets already state -- a floor a track will not shrink past pushes
|
|
18
|
+
* out of a container narrower than itself and gives the page a horizontal scrollbar. Capped at 100%
|
|
19
|
+
* it simply fills what it has.
|
|
20
|
+
*
|
|
21
|
+
* `15rem` is 240px, the live page's `--newtone-card-grid-min` read on 2026-09-04. **It is the fifth block
|
|
22
|
+
* width this repo has written by hand**, and the first that neither existing card states -- so it is
|
|
23
|
+
* a fifth number rather than a third repeat. issues/done/030-the-block-width-family.md counts them.
|
|
24
|
+
*
|
|
25
|
+
* ---- and the floor was asked for a second value on 2026-09-05 ------------
|
|
26
|
+
*
|
|
27
|
+
* `faculty`'s container declares **`--newtone-card-grid-min: 260px`**. A floor that had been invariant per
|
|
28
|
+
* ROW KIND now has two values, which is what makes this a question rather than an oversight: the
|
|
29
|
+
* argument that put the floor in a sheet instead of a prop -- card-box.tsx's -- rests on it being
|
|
30
|
+
* invariant, and per band it is not.
|
|
31
|
+
*
|
|
32
|
+
* **It stays at 240 for both, and the three candidates were argued rather than ranked.**
|
|
33
|
+
*
|
|
34
|
+
* a length prop would put a block width at a CALL SITE. All seven this repo has written by
|
|
35
|
+
* hand live in a stylesheet, and 030 counts them precisely because where they
|
|
36
|
+
* live is what makes them findable. `master-page.tsx` typing `260px` would be
|
|
37
|
+
* the first that does not.
|
|
38
|
+
* a second class has to be NAMED, and the only thing separating the two rows is what they hold
|
|
39
|
+
* -- three claims against eleven faces. A class named for its contents is
|
|
40
|
+
* tag.tsx's refusal exactly: what a thing MEANS is not this component's business.
|
|
41
|
+
* take 240 which is this, with the 20px recorded in
|
|
42
|
+
* the consuming site's own knowledge entry.
|
|
43
|
+
*
|
|
44
|
+
* **Two values is the second occurrence and not the third.**
|
|
45
|
+
* `governance/code/propose-the-system-at-the-third-repetition.md` is explicit that the second is not
|
|
46
|
+
* what buys a shape, and it asks for the varying part to be READ rather than guessed -- which
|
|
47
|
+
* cannot be done at two, because one of the two answers would be the guess.
|
|
48
|
+
*
|
|
49
|
+
* **Trigger: a third floor.** Blueprint section 8 carries the row, and section 4.1.9 the argument.
|
|
50
|
+
*
|
|
51
|
+
* ---- and the third arrived on 2026-09-06 --------------------------------
|
|
52
|
+
*
|
|
53
|
+
* `testimonials`' row declares **480px**, and that one cannot be absorbed the way 260 was: at the
|
|
54
|
+
* 1160 container the live page gives at 1600 a 240 floor produces FOUR columns where the page gives
|
|
55
|
+
* two, and at 904 it produces three where the page gives one. **A concession of 20px of column is a
|
|
56
|
+
* concession; a concession of the number of columns is a different band.**
|
|
57
|
+
*
|
|
58
|
+
* **So the floor is a value a row can state, and the answer is a fourth candidate none of the three
|
|
59
|
+
* above.** `--newtone-card-grid-min` with `15rem` as its default: a band that wants a wider card sets the
|
|
60
|
+
* property in its own sheet on an element it already owns, and a band that wants 240 says nothing.
|
|
61
|
+
* `structure` and `faculty` say nothing.
|
|
62
|
+
*
|
|
63
|
+
* **The reason it was not on the list is worth more than the answer.** All three candidates assumed
|
|
64
|
+
* something had to REACH this element -- a prop carrying a class, a second class to select, a length
|
|
65
|
+
* at a call site -- and a custom property inherits, so nothing reaches anything. The number is still
|
|
66
|
+
* in a stylesheet, which is what 030 counts; it is simply in the caller's stylesheet rather than in
|
|
67
|
+
* this one. That was an assumption about the mechanism standing in for a reading of it, and it had
|
|
68
|
+
* been standing since 2026-09-05.
|
|
69
|
+
*
|
|
70
|
+
* **What the third occurrence bought is a reading, and it is checkable.** The live page carries
|
|
71
|
+
* exactly one `--newtone-card-grid-min` and exactly three values of it -- 240px, 260px, 480px, one per
|
|
72
|
+
* container, grepped out of the served markup on 2026-09-06. 240 / 260 / 480 is not a ladder
|
|
73
|
+
* anybody could have extrapolated from the first two; the third is nearly twice the second. A shape
|
|
74
|
+
* proposed at two would have been a scale, and it would have been wrong about its own SHAPE rather
|
|
75
|
+
* than about a number.
|
|
76
|
+
*
|
|
77
|
+
* **`faculty`'s 260 is now restorable and this sitting did not restore it.** Nothing built in
|
|
78
|
+
* issues/done/042-testimonials-components.md renders, so moving a shipped band's floor would be a
|
|
79
|
+
* change nobody could look at -- `governance/evidence/verify-what-renders-not-what-was-written.md`. The 20px
|
|
80
|
+
* concession stands until the sitting that renders the band spends it.
|
|
81
|
+
*
|
|
82
|
+
* ---- the gutter ---------------------------------------------------------
|
|
83
|
+
*
|
|
84
|
+
* `space-4` is 16px, which is the same value the row mode passes as `gap={4}` four lines away in
|
|
85
|
+
* card-grid.tsx. **The two are one gutter written in the two syntaxes the two modes have available**
|
|
86
|
+
* -- a prop cannot be read by a sheet, and a rule cannot be read by a call site. Co-location is what
|
|
87
|
+
* makes that readable rather than safe, and the trigger for turning it into one statement is a third
|
|
88
|
+
* writer of the card gutter, or the gutter changing. */
|
|
89
|
+
|
|
90
|
+
.newtone-card-grid--columns {
|
|
91
|
+
display: grid;
|
|
92
|
+
grid-template-columns: repeat(
|
|
93
|
+
auto-fit,
|
|
94
|
+
minmax(min(var(--newtone-card-grid-min, 15rem), 100%), 1fr)
|
|
95
|
+
);
|
|
96
|
+
gap: var(--newtone-card-grid-gap);
|
|
97
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The row a section puts its cards in.
|
|
4
|
+
*
|
|
5
|
+
* **It is one `Wrapper` with three fixed props and no stylesheet of its own**, and that is the whole
|
|
6
|
+
* of it today. Which raises the obvious question -- why is it a component rather than three props
|
|
7
|
+
* typed at each call site -- and the answer is that `overview` alone writes two of these rows, so
|
|
8
|
+
* the gap between cards is already a fact stated twice. A gap agreed at two call sites is a gap that
|
|
9
|
+
* disagrees at the third. governance/documents/staleness/a-second-copy-is-a-thing-that-drifts.md.
|
|
10
|
+
*
|
|
11
|
+
* **The cards size themselves.** Each one states its own slot minimum in its own sheet -- see
|
|
12
|
+
* card-box.tsx for why that is not a prop -- so this row does not distribute anything: a card keeps
|
|
13
|
+
* its floor, fills what it has, and the row wraps when the floors no longer fit. No viewport is
|
|
14
|
+
* named anywhere in that sentence, which is the point.
|
|
15
|
+
*
|
|
16
|
+
* ---- `columns`, which was deferred here and fired -----------------------
|
|
17
|
+
*
|
|
18
|
+
* **Equal tracks rather than proportional ones, as many as fit.** It was deferred in this docblock
|
|
19
|
+
* with the trigger *something passes it*, and `structure` does: the live page's row of three claims
|
|
20
|
+
* is a real grid at `repeat(auto-fit, minmax(min(240px, 100%), 1fr))`. `overview` and `career-path`
|
|
21
|
+
* want a card to keep its own floor and fill what is left; **three equal tracks is a statement about
|
|
22
|
+
* the ROW**, which is the one thing a row of self-sizing cards cannot express, and it is why one
|
|
23
|
+
* component has two modes rather than two components having one each.
|
|
24
|
+
*
|
|
25
|
+
* **It cannot be a fourth prop on the `Wrapper`.** That component writes `display: flex` as an
|
|
26
|
+
* INLINE style on every instance, and an inline declaration out-specifies every class -- the hazard
|
|
27
|
+
* the repo blueprint's section 4.2 names, running the direction this repo had not hit before.
|
|
28
|
+
* Passing `style={{ display: 'grid' }}` would work, because a caller's style is spread last, and it
|
|
29
|
+
* would put invariant geometry at a call site. So the column mode is a plain element carrying a
|
|
30
|
+
* class, and this folder gained the first stylesheet it has ever had.
|
|
31
|
+
*
|
|
32
|
+
* **The deferral was also in the wrong place, which is the finding that outlived it.** All three of
|
|
33
|
+
* these lived here and none was a row in the blueprint's section 8 -- the table a reader consults
|
|
34
|
+
* for what is deferred -- so a trigger coming true was found by costing a band rather than by
|
|
35
|
+
* reading the table. Section 8 carries all three now, and
|
|
36
|
+
* `governance/deferrals/a-deferral-lives-where-deferrals-are-listed.md` is parked on it.
|
|
37
|
+
*
|
|
38
|
+
* ---- the two the original's row still does that this one does not --------
|
|
39
|
+
*
|
|
40
|
+
* **`pair`** -- two-up below a breakpoint instead of stacking. It is a column COUNT, which no slot
|
|
41
|
+
* minimum can state at more than one width, and it is the one thing in that component that needs a
|
|
42
|
+
* media query. Zero call sites across three bands.
|
|
43
|
+
*
|
|
44
|
+
* **The bleed** -- the row reaching back out to a page margin sized for cards rather than for text,
|
|
45
|
+
* so that copy inside a card does not pay the page's inset and then its own. The original measured
|
|
46
|
+
* that on a 390px phone and found carded copy running 42px narrower than the paragraph above it,
|
|
47
|
+
* and the fix computes to exactly 0px on a desktop. **We cannot take it, because this site has one
|
|
48
|
+
* page margin and the trick is a difference between two.** The measurement is written down in
|
|
49
|
+
* the consuming site's own knowledge entry, so that the day this site has a second
|
|
50
|
+
* margin the argument does not have to be found again.
|
|
51
|
+
*
|
|
52
|
+
* Both land here when something fires them, which is the other half of why this is a component.
|
|
53
|
+
*/
|
|
54
|
+
export interface CardGridProps extends HTMLAttributes<HTMLElement> {
|
|
55
|
+
/**
|
|
56
|
+
* Equal tracks, as many as fit, at a floor -- rather than cards that each keep their own floor
|
|
57
|
+
* and share out what is left. Defaults off, which is what two of the three call sites want.
|
|
58
|
+
*/
|
|
59
|
+
columns?: boolean;
|
|
60
|
+
children?: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
export declare function CardGrid({ columns, children, className, ...rest }: CardGridProps): import("react").JSX.Element;
|
|
63
|
+
//# sourceMappingURL=card-grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-grid.d.ts","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAmChF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Wrapper } from '../wrapper/index.js';
|
|
3
|
+
export function CardGrid({ columns, children, className, ...rest }) {
|
|
4
|
+
// The tracks are a rule in card-grid.css, not props: invariant per row kind, which is
|
|
5
|
+
// card-box.tsx's argument unchanged.
|
|
6
|
+
//
|
|
7
|
+
// **The floor is the one thing a row states about itself, and as of 2026-09-06 it is a value
|
|
8
|
+
// rather than a constant.** The sheet reads `--newtone-card-grid-min` with a 15rem default; a band that
|
|
9
|
+
// wants a wider card declares the property in its own stylesheet, on an element it already
|
|
10
|
+
// owns, and inheritance carries it down. It is not a prop here because it never had to be: a
|
|
11
|
+
// custom property does not have to reach this element to be read by it. card-grid.css carries
|
|
12
|
+
// the three values that produced that answer and the two candidates it beat.
|
|
13
|
+
if (columns) {
|
|
14
|
+
return (_jsx("div", { className: ['newtone-card-grid--columns', className].filter(Boolean).join(' '), ...rest, children: children }));
|
|
15
|
+
}
|
|
16
|
+
// gap={4} is 16px, the original's own gutter between cards at every width. It writes a narrower
|
|
17
|
+
// horizontal one on a phone, on the argument that a gap there is width taken from the cards on
|
|
18
|
+
// the axis a phone has none to spare -- that is a second breakpoint and a second value, and
|
|
19
|
+
// taking it without the measurement behind it would be copying a rule and leaving its reason.
|
|
20
|
+
//
|
|
21
|
+
// **That 16px is stated twice in this folder**, here as a prop and in the sheet as a length,
|
|
22
|
+
// because a prop cannot be read by a stylesheet and a rule cannot be read by a call site. The
|
|
23
|
+
// two sit a few lines apart, which makes it readable rather than safe. Trigger for making it
|
|
24
|
+
// one: a third writer of the card gutter, or the gutter changing.
|
|
25
|
+
return (_jsx(Wrapper, { direction: "row", wrap: true, gap: 4, className: className, ...rest, children: children }));
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=card-grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-grid.js","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAgE7C,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB;IAC7E,sFAAsF;IACtF,qCAAqC;IACrC,EAAE;IACF,6FAA6F;IAC7F,wGAAwG;IACxG,2FAA2F;IAC3F,6FAA6F;IAC7F,8FAA8F;IAC9F,6EAA6E;IAC7E,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CACH,cACI,SAAS,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAC1E,IAAI,YAEP,QAAQ,GACP,CACT,CAAA;IACL,CAAC;IAED,gGAAgG;IAChG,+FAA+F;IAC/F,4FAA4F;IAC5F,8FAA8F;IAC9F,EAAE;IACF,6FAA6F;IAC7F,8FAA8F;IAC9F,6FAA6F;IAC7F,kEAAkE;IAClE,OAAO,CACH,KAAC,OAAO,IAAC,SAAS,EAAC,KAAK,EAAC,IAAI,QAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,KAAM,IAAI,YAC/D,QAAQ,GACH,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/card-grid/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/card-grid/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Oklch, Gamut } from './oklch.js';
|
|
2
|
+
/**
|
|
3
|
+
* The largest chroma that fits, at this lightness and hue, in this gamut. Section 6.6.
|
|
4
|
+
*
|
|
5
|
+
* `0.5` is above the largest chroma any real hue reaches in either gamut, so it is a safe
|
|
6
|
+
* upper bracket, and the early return costs one check and saves twenty. The endpoints
|
|
7
|
+
* return 0 because the gamut narrows to a point at black and white -- which is what pins
|
|
8
|
+
* step 0 to pure white.
|
|
9
|
+
*/
|
|
10
|
+
export declare function maxChroma(lightness: number, hue: number, gamut: Gamut): number;
|
|
11
|
+
/**
|
|
12
|
+
* The colour at a lightness on a palette's vector. Section 6.6.
|
|
13
|
+
*
|
|
14
|
+
* The ratio is applied against the P3 ceiling and then clamped to the target gamut, so a
|
|
15
|
+
* colour that fits inside sRGB is the SAME colour on both -- `min` is a no-op until P3 is
|
|
16
|
+
* genuinely wider. This is a ceiling, not a mapping: nothing overflows, so there is
|
|
17
|
+
* nothing to map back down, and L and H are preserved by construction.
|
|
18
|
+
*/
|
|
19
|
+
export declare function colorAt(hue: number, chroma: number, gamut: Gamut, lightness: number): Oklch;
|
|
20
|
+
//# sourceMappingURL=gamut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gamut.d.ts","sourceRoot":"","sources":["../../src/color/gamut.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,KAAK,EAAE,KAAK,EAAK,MAAM,YAAY,CAAA;AAkCjD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,CAiB9E;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAM3F"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// The gamut: how much chroma actually fits at a given lightness and hue.
|
|
2
|
+
//
|
|
3
|
+
// Contract sections 6.4 and 6.6. This is the half that runs inside two nested searches
|
|
4
|
+
// fifty-one times per palette, which is why `inGamutRaw` is inlined rather than composed
|
|
5
|
+
// out of `mul`.
|
|
6
|
+
//
|
|
7
|
+
// Private to `color/`. What leaves the folder is decided by index.ts.
|
|
8
|
+
import { EPSILON, DEG_TO_RAD, clamp01, SRGB_R, SRGB_G, SRGB_B, P3_R, P3_G, P3_B } from './oklch.js';
|
|
9
|
+
// Inlined rather than composed out of `mul`: this runs inside two nested searches, 51
|
|
10
|
+
// times per palette, and the allocation showed.
|
|
11
|
+
function inGamutRaw(l, cosH, sinH, c, mr, mg, mb) {
|
|
12
|
+
const a = c * cosH;
|
|
13
|
+
const b = c * sinH;
|
|
14
|
+
const l_ = l + 0.3963377774 * a + 0.2158037573 * b;
|
|
15
|
+
const m_ = l - 0.1055613458 * a - 0.0638541728 * b;
|
|
16
|
+
const s_ = l - 0.0894841775 * a - 1.291485548 * b;
|
|
17
|
+
const lc = l_ * l_ * l_;
|
|
18
|
+
const mc = m_ * m_ * m_;
|
|
19
|
+
const sc = s_ * s_ * s_;
|
|
20
|
+
const r = mr[0] * lc + mr[1] * mc + mr[2] * sc;
|
|
21
|
+
if (r < -EPSILON || r > 1 + EPSILON)
|
|
22
|
+
return false;
|
|
23
|
+
const g = mg[0] * lc + mg[1] * mc + mg[2] * sc;
|
|
24
|
+
if (g < -EPSILON || g > 1 + EPSILON)
|
|
25
|
+
return false;
|
|
26
|
+
const bb = mb[0] * lc + mb[1] * mc + mb[2] * sc;
|
|
27
|
+
return bb >= -EPSILON && bb <= 1 + EPSILON;
|
|
28
|
+
}
|
|
29
|
+
const matrices = (gamut) => gamut === 'p3' ? [P3_R, P3_G, P3_B] : [SRGB_R, SRGB_G, SRGB_B];
|
|
30
|
+
/**
|
|
31
|
+
* The largest chroma that fits, at this lightness and hue, in this gamut. Section 6.6.
|
|
32
|
+
*
|
|
33
|
+
* `0.5` is above the largest chroma any real hue reaches in either gamut, so it is a safe
|
|
34
|
+
* upper bracket, and the early return costs one check and saves twenty. The endpoints
|
|
35
|
+
* return 0 because the gamut narrows to a point at black and white -- which is what pins
|
|
36
|
+
* step 0 to pure white.
|
|
37
|
+
*/
|
|
38
|
+
export function maxChroma(lightness, hue, gamut) {
|
|
39
|
+
if (lightness <= 0 || lightness >= 1)
|
|
40
|
+
return 0;
|
|
41
|
+
const [mr, mg, mb] = matrices(gamut);
|
|
42
|
+
const cosH = Math.cos(hue * DEG_TO_RAD);
|
|
43
|
+
const sinH = Math.sin(hue * DEG_TO_RAD);
|
|
44
|
+
let lo = 0;
|
|
45
|
+
let hi = 0.5;
|
|
46
|
+
if (inGamutRaw(lightness, cosH, sinH, hi, mr, mg, mb))
|
|
47
|
+
return hi;
|
|
48
|
+
for (let i = 0; i < 20; i++) {
|
|
49
|
+
const mid = (lo + hi) / 2;
|
|
50
|
+
if (inGamutRaw(lightness, cosH, sinH, mid, mr, mg, mb))
|
|
51
|
+
lo = mid;
|
|
52
|
+
else
|
|
53
|
+
hi = mid;
|
|
54
|
+
}
|
|
55
|
+
return lo;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The colour at a lightness on a palette's vector. Section 6.6.
|
|
59
|
+
*
|
|
60
|
+
* The ratio is applied against the P3 ceiling and then clamped to the target gamut, so a
|
|
61
|
+
* colour that fits inside sRGB is the SAME colour on both -- `min` is a no-op until P3 is
|
|
62
|
+
* genuinely wider. This is a ceiling, not a mapping: nothing overflows, so there is
|
|
63
|
+
* nothing to map back down, and L and H are preserved by construction.
|
|
64
|
+
*/
|
|
65
|
+
export function colorAt(hue, chroma, gamut, lightness) {
|
|
66
|
+
const l = clamp01(lightness);
|
|
67
|
+
const ratio = clamp01(chroma);
|
|
68
|
+
const absolute = maxChroma(l, hue, 'p3') * ratio;
|
|
69
|
+
const c = gamut === 'p3' ? absolute : Math.min(absolute, maxChroma(l, hue, 'srgb'));
|
|
70
|
+
return { l, c, h: hue };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=gamut.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gamut.js","sourceRoot":"","sources":["../../src/color/gamut.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,uFAAuF;AACvF,yFAAyF;AACzF,gBAAgB;AAChB,EAAE;AACF,sEAAsE;AAEtE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAGnG,sFAAsF;AACtF,gDAA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GAAG,GAAG,CAAA;;YAC3D,EAAE,GAAG,GAAG,CAAA;IACjB,CAAC;IACD,OAAO,EAAE,CAAA;AACb,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,MAAc,EAAE,KAAY,EAAE,SAAiB;IAChF,MAAM,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAA;IAC5B,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC7B,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,KAAK,CAAA;IAChD,MAAM,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAA;IACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { hexToOklch, oklchToLinearSrgb, oklchToHex, cssNumber } from './oklch.js';
|
|
2
|
+
export type { Oklch, Gamut } from './oklch.js';
|
|
3
|
+
export { maxChroma } from './gamut.js';
|
|
4
|
+
export { deriveScale, STEPS } from './scale.js';
|
|
5
|
+
export type { PaletteStep } from './scale.js';
|
|
6
|
+
export { seedProperties, validateSeeds } from './seeds.js';
|
|
7
|
+
export type { Seed, SeedGroup, Seeds } from './seeds.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACjF,YAAY,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC1D,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// The web port of blueprints/newtone/contracts/color-derivation.md.
|
|
2
|
+
//
|
|
3
|
+
// This is the runtime half of `identity`: the tokens repo derives the default seeds at
|
|
4
|
+
// build time in newtone_ui_tokens/compute/, and this derives a scoped seed set in the
|
|
5
|
+
// browser. Both must produce the same bytes, which is why the maths lives in a contract
|
|
6
|
+
// rather than in either of them. Conformance is section 8's vectors.
|
|
7
|
+
//
|
|
8
|
+
// There is no shape table here, and nothing is read out of the emitted CSS. The shape is
|
|
9
|
+
// `L* = 100 - 2 x step` over fifty-one steps, and the chroma column is the Display P3
|
|
10
|
+
// ceiling scaled by one number per palette -- both computed, so there is no data to drift.
|
|
11
|
+
//
|
|
12
|
+
// Four files sit behind this door and none of them is reachable from outside the folder:
|
|
13
|
+
// oklch.ts the colour space -- matrices, transfer functions, hex, serialization
|
|
14
|
+
// gamut.ts how much chroma fits at a lightness and hue
|
|
15
|
+
// scale.ts CIE L*, the lightness search, the fifty-one steps
|
|
16
|
+
// seeds.ts seeds in, custom properties out
|
|
17
|
+
export { hexToOklch, oklchToLinearSrgb, oklchToHex, cssNumber } from './oklch.js';
|
|
18
|
+
export { maxChroma } from './gamut.js';
|
|
19
|
+
export { deriveScale, STEPS } from './scale.js';
|
|
20
|
+
export { seedProperties, validateSeeds } from './seeds.js';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/color/index.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,EAAE;AACF,uFAAuF;AACvF,sFAAsF;AACtF,wFAAwF;AACxF,qEAAqE;AACrE,EAAE;AACF,yFAAyF;AACzF,sFAAsF;AACtF,2FAA2F;AAC3F,EAAE;AACF,yFAAyF;AACzF,oFAAoF;AACpF,2DAA2D;AAC3D,iEAAiE;AACjE,+CAA+C;AAE/C,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEjF,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const LMS_FROM_LRGB: readonly [readonly [0.4122214708, 0.5363325363, 0.0514459929], readonly [0.2119034982, 0.6806995451, 0.1073969566], readonly [0.0883024619, 0.2817188376, 0.6299787005]];
|
|
2
|
+
export declare const LAB_FROM_LMSP: readonly [readonly [0.2104542553, 0.793617785, -0.0040720468], readonly [1.9779984951, -2.428592205, 0.4505937099], readonly [0.0259040371, 0.7827717662, -0.808675766]];
|
|
3
|
+
export declare const SRGB_R: readonly [4.0765379686154635, -3.3070962248908753, 0.2308224615351424];
|
|
4
|
+
export declare const SRGB_G: readonly [-1.2686058016641382, 2.60974741090216, -0.3411636310115355];
|
|
5
|
+
export declare const SRGB_B: readonly [-0.004199535952631, -0.7035140435404212, 1.7072021573980527];
|
|
6
|
+
export declare const P3_R: readonly [3.128110529032312, -2.257075018354871, 0.1293047884378317];
|
|
7
|
+
export declare const P3_G: readonly [-1.0911281609083134, 2.4132667617599557, -0.3221681708589348];
|
|
8
|
+
export declare const P3_B: readonly [-0.0260136497064853, -0.5080276489512767, 1.5333166822296191];
|
|
9
|
+
export declare const EPSILON = 0.000001;
|
|
10
|
+
export declare const DEG_TO_RAD: number;
|
|
11
|
+
export type M = readonly (readonly number[])[];
|
|
12
|
+
export type V = readonly [number, number, number];
|
|
13
|
+
export declare const clamp01: (x: number) => number;
|
|
14
|
+
export interface Oklch {
|
|
15
|
+
l: number;
|
|
16
|
+
c: number;
|
|
17
|
+
h: number;
|
|
18
|
+
}
|
|
19
|
+
export type Gamut = 'srgb' | 'p3';
|
|
20
|
+
/** Measure a colour picked by eye. Its `c` is an ABSOLUTE chroma, not a seed's ratio. */
|
|
21
|
+
export declare function hexToOklch(hex: string): Oklch;
|
|
22
|
+
export declare function oklchToLinearSrgb(l: number, c: number, h: number): V;
|
|
23
|
+
/** Section 6.7, the sRGB half. Uppercase, to match everything the tokens repo emits. */
|
|
24
|
+
export declare function oklchToHex({ l, c, h }: Oklch): string;
|
|
25
|
+
/**
|
|
26
|
+
* A number as CSS, rounded to 6 places and NEVER in exponent notation.
|
|
27
|
+
*
|
|
28
|
+
* The second half is load-bearing and is a workaround for somebody else's bug. esbuild --
|
|
29
|
+
* what Vite runs over a production stylesheet -- strips trailing zeros from a number token
|
|
30
|
+
* without first separating the mantissa from the exponent, so `4.656612873077393e-10`
|
|
31
|
+
* comes out of a minified build as `4.656612873077393e-1`. That is the difference between
|
|
32
|
+
* black and a mid grey, it happens only in a production build, and nothing warns.
|
|
33
|
+
*/
|
|
34
|
+
export declare function cssNumber(value: number): string;
|
|
35
|
+
//# sourceMappingURL=oklch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklch.d.ts","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,aAAa,sBACrB,YAAY,EAAE,YAAY,EAAE,YAAY,aACxC,YAAY,EAAE,YAAY,EAAE,YAAY,aACxC,YAAY,EAAE,YAAY,EAAE,YAAY,EACnC,CAAA;AACV,eAAO,MAAM,aAAa,sBACrB,YAAY,EAAE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C,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,CAAC,CAepE;AAED,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,GAAG,MAAM,CASrD;AAMD;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAG/C"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// The OKLCH colour space itself: the matrices, the transfer functions, and the two
|
|
2
|
+
// conversions that are not on the derivation path.
|
|
3
|
+
//
|
|
4
|
+
// Split out of one 349-line file on 2026-09-02 so that the invariant in the blueprint's
|
|
5
|
+
// section 5 -- "the forward matrices match contract 6.1 exactly" -- and its single
|
|
6
|
+
// deliberate exception are checkable by reading forty lines instead of scanning three
|
|
7
|
+
// hundred. That is the pain the split answers; the tidiness is a side effect.
|
|
8
|
+
//
|
|
9
|
+
// Private to `color/`. What leaves the folder is decided by index.ts.
|
|
10
|
+
// Linear sRGB -> LMS, and LMS' -> OKLab. Section 6.3 only, OFF the derivation path.
|
|
11
|
+
// These are Ottosson's published values and are deliberately not the forward pair below:
|
|
12
|
+
// they serve `hexToOklch`, which measures a colour someone picked by eye.
|
|
13
|
+
export const LMS_FROM_LRGB = [
|
|
14
|
+
[0.4122214708, 0.5363325363, 0.0514459929],
|
|
15
|
+
[0.2119034982, 0.6806995451, 0.1073969566],
|
|
16
|
+
[0.0883024619, 0.2817188376, 0.6299787005],
|
|
17
|
+
];
|
|
18
|
+
export const LAB_FROM_LMSP = [
|
|
19
|
+
[0.2104542553, 0.793617785, -0.0040720468],
|
|
20
|
+
[1.9779984951, -2.428592205, 0.4505937099],
|
|
21
|
+
[0.0259040371, 0.7827717662, -0.808675766],
|
|
22
|
+
];
|
|
23
|
+
// ON the derivation path. The two forward matrices are the products of
|
|
24
|
+
// (XYZ -> RGB) x (LMS -> XYZ) carried at full double precision, NOT Ottosson's pre-rounded
|
|
25
|
+
// publication. About 4% of hexes move by one unit in one channel between the two; nothing
|
|
26
|
+
// is visible, and every byte is nonetheless different. Using the published rounding here
|
|
27
|
+
// breaks CHARTER.md non-negotiable 4 the moment this is compared with the tokens build.
|
|
28
|
+
export const SRGB_R = [4.0765379686154635, -3.3070962248908753, 0.2308224615351424];
|
|
29
|
+
export const SRGB_G = [-1.2686058016641382, 2.6097474109021599, -0.3411636310115355];
|
|
30
|
+
export const SRGB_B = [-0.004199535952631, -0.7035140435404212, 1.7072021573980527];
|
|
31
|
+
export const P3_R = [3.1281105290323121, -2.2570750183548709, 0.1293047884378317];
|
|
32
|
+
export const P3_G = [-1.0911281609083134, 2.4132667617599557, -0.3221681708589348];
|
|
33
|
+
export const P3_B = [-0.0260136497064853, -0.5080276489512767, 1.5333166822296191];
|
|
34
|
+
export const EPSILON = 1e-6;
|
|
35
|
+
export const DEG_TO_RAD = Math.PI / 180;
|
|
36
|
+
const mul = (m, v) => [
|
|
37
|
+
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2],
|
|
38
|
+
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2],
|
|
39
|
+
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2],
|
|
40
|
+
];
|
|
41
|
+
// Section 6.2. Two different thresholds. Using one for both is the classic bug.
|
|
42
|
+
const decode = (x) => (x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4));
|
|
43
|
+
const encode = (x) => (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
|
|
44
|
+
export const clamp01 = (x) => Math.max(0, Math.min(1, x));
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Section 6.3 -- hex to OKLCH. Tooling only; a seed no longer carries a hex.
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
/** Measure a colour picked by eye. Its `c` is an ABSOLUTE chroma, not a seed's ratio. */
|
|
49
|
+
export function hexToOklch(hex) {
|
|
50
|
+
const n = parseInt(hex.replace('#', ''), 16);
|
|
51
|
+
const lms = mul(LMS_FROM_LRGB, [
|
|
52
|
+
decode(((n >> 16) & 255) / 255),
|
|
53
|
+
decode(((n >> 8) & 255) / 255),
|
|
54
|
+
decode((n & 255) / 255),
|
|
55
|
+
]);
|
|
56
|
+
const [l, a, b] = mul(LAB_FROM_LMSP, lms.map(Math.cbrt));
|
|
57
|
+
let h = (Math.atan2(b, a) * 180) / Math.PI;
|
|
58
|
+
if (h < 0)
|
|
59
|
+
h += 360;
|
|
60
|
+
return { l, c: Math.hypot(a, b), h };
|
|
61
|
+
}
|
|
62
|
+
export function oklchToLinearSrgb(l, c, h) {
|
|
63
|
+
const rad = h * DEG_TO_RAD;
|
|
64
|
+
const a = c * Math.cos(rad);
|
|
65
|
+
const b = c * Math.sin(rad);
|
|
66
|
+
const l_ = l + 0.3963377774 * a + 0.2158037573 * b;
|
|
67
|
+
const m_ = l - 0.1055613458 * a - 0.0638541728 * b;
|
|
68
|
+
const s_ = l - 0.0894841775 * a - 1.291485548 * b;
|
|
69
|
+
const lc = l_ * l_ * l_;
|
|
70
|
+
const mc = m_ * m_ * m_;
|
|
71
|
+
const sc = s_ * s_ * s_;
|
|
72
|
+
return [
|
|
73
|
+
SRGB_R[0] * lc + SRGB_R[1] * mc + SRGB_R[2] * sc,
|
|
74
|
+
SRGB_G[0] * lc + SRGB_G[1] * mc + SRGB_G[2] * sc,
|
|
75
|
+
SRGB_B[0] * lc + SRGB_B[1] * mc + SRGB_B[2] * sc,
|
|
76
|
+
];
|
|
77
|
+
}
|
|
78
|
+
/** Section 6.7, the sRGB half. Uppercase, to match everything the tokens repo emits. */
|
|
79
|
+
export function oklchToHex({ l, c, h }) {
|
|
80
|
+
return ('#' +
|
|
81
|
+
oklchToLinearSrgb(l, c, h)
|
|
82
|
+
.map((x) => Math.round(encode(clamp01(x)) * 255))
|
|
83
|
+
.map((x) => x.toString(16).padStart(2, '0'))
|
|
84
|
+
.join('')
|
|
85
|
+
.toUpperCase());
|
|
86
|
+
}
|
|
87
|
+
// ---------------------------------------------------------------------------
|
|
88
|
+
// Section 6.8 -- serialization
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
/**
|
|
91
|
+
* A number as CSS, rounded to 6 places and NEVER in exponent notation.
|
|
92
|
+
*
|
|
93
|
+
* The second half is load-bearing and is a workaround for somebody else's bug. esbuild --
|
|
94
|
+
* what Vite runs over a production stylesheet -- strips trailing zeros from a number token
|
|
95
|
+
* without first separating the mantissa from the exponent, so `4.656612873077393e-10`
|
|
96
|
+
* comes out of a minified build as `4.656612873077393e-1`. That is the difference between
|
|
97
|
+
* black and a mid grey, it happens only in a production build, and nothing warns.
|
|
98
|
+
*/
|
|
99
|
+
export function cssNumber(value) {
|
|
100
|
+
const trimmed = value.toFixed(6).replace(/\.?0+$/, '');
|
|
101
|
+
return trimmed === '-0' || trimmed === '' ? '0' : trimmed;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=oklch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklch.js","sourceRoot":"","sources":["../../src/color/oklch.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,mDAAmD;AACnD,EAAE;AACF,wFAAwF;AACxF,mFAAmF;AACnF,sFAAsF;AACtF,8EAA8E;AAC9E,EAAE;AACF,sEAAsE;AAEtE,oFAAoF;AACpF,yFAAyF;AACzF,0EAA0E;AAC1E,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;IAC1C,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,CAAC;CACpC,CAAA;AACV,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,CAAC,YAAY,EAAE,WAAW,EAAE,CAAC,YAAY,CAAC;IAC1C,CAA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E,CACrB,CAAA;AACL,CAAC;AAED,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,UAAU,SAAS,CAAC,KAAa;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACtD,OAAO,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAA;AAC7D,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Oklch } from './oklch.js';
|
|
2
|
+
/** Fifty-one steps, index 0 to 50. Fixed by section 5.1, not by the colour maths. */
|
|
3
|
+
export declare const STEPS = 51;
|
|
4
|
+
export interface PaletteStep {
|
|
5
|
+
oklch: Oklch;
|
|
6
|
+
srgb: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* One palette's fifty-one steps, from a hue and a saturation ratio.
|
|
10
|
+
*
|
|
11
|
+
* Derived TWICE, not encoded twice: the hex comes off a vector clamped to the sRGB
|
|
12
|
+
* ceiling and the OKLCH channels off one at the P3 ceiling. Where a colour fits inside
|
|
13
|
+
* sRGB the two agree; where it does not they do not round-trip, and that is section 6.7
|
|
14
|
+
* rather than a rounding artefact.
|
|
15
|
+
*
|
|
16
|
+
* Quantised at 6 places for `l` and `c` -- which is what makes the L* = 0 endpoint round
|
|
17
|
+
* to exactly 0 rather than to 4.66e-10 -- and 2 for `h`, a seed input never searched for.
|
|
18
|
+
*/
|
|
19
|
+
export declare function deriveScale(hue: number, chroma: number): PaletteStep[];
|
|
20
|
+
//# sourceMappingURL=scale.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.d.ts","sourceRoot":"","sources":["../../src/color/scale.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,YAAY,CAAA;AA0C9C,qFAAqF;AACrF,eAAO,MAAM,KAAK,KAAK,CAAA;AAEvB,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE,CAgBtE"}
|