@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,107 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from '../icon/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* THE GLYPH SIZE THAT PAIRS WITH EACH CONTROL SIZE'S LABEL LEADING. Read the map, not the letter.
|
|
5
|
+
*
|
|
6
|
+
* `md` IS 20px AND `lg` IS 24px FROM 2026-09-16, and the numbers are not a preference: a glyph is
|
|
7
|
+
* sized to the leading of the text it sits with, so 20px goes with 14/20 and 24px with 16/24 --
|
|
8
|
+
* governance/code/an-icon-and-the-text-beside-it-share-one-size-and-leading-pair.md.
|
|
9
|
+
*
|
|
10
|
+
* IT WAS `{ md: 'md', lg: 'lg' }` -- 24px and 32px -- AND THAT PAIRED NOTHING. The label was
|
|
11
|
+
* `typography.size.sm` (14) with `typography.line-height.tight` (1.2), so a 24px mark stood against
|
|
12
|
+
* 14/16.8: three numbers from three groups, and 16.8 chosen by nobody. The pair could not be
|
|
13
|
+
* expressed at all until `typography.step` existed, because four ratios across nine sizes let 14px
|
|
14
|
+
* reach 16.8, 18.9, 21 or 23.8 and never 20. contracts/typography.md section 7.2.
|
|
15
|
+
*
|
|
16
|
+
* THE BOX SHRINKS WITH THE GLYPH and that is the design, not a side effect: the padding is one
|
|
17
|
+
* value per size so that equal padding around one glyph reads as a square. md is 20 + 2x12 = 44,
|
|
18
|
+
* which is the floor this library argues for rather than a number near it, and lg is 24 + 2x16 = 56.
|
|
19
|
+
* Holding 48 would have meant a `space` value of 14 whose only job was to leave one box undisturbed.
|
|
20
|
+
*
|
|
21
|
+
* NO PAIR EXISTS FOR A 32px GLYPH and none was invented to keep `lg` where it was. Nothing has ever
|
|
22
|
+
* rendered a non-media `lg` -- see the component blueprint -- so it is the cheapest size in the
|
|
23
|
+
* library to move, and a 22/32 step is one line the day a call site asks for one.
|
|
24
|
+
*/
|
|
25
|
+
const GLYPH = { md: 'sm', lg: 'md' };
|
|
26
|
+
/**
|
|
27
|
+
* A glyph you press to move around a page rather than to act on it: a deck's previous and next, a
|
|
28
|
+
* step back, a panel opened.
|
|
29
|
+
*
|
|
30
|
+
* ---- it is neutral, and that is the whole hierarchy argument ---------------
|
|
31
|
+
*
|
|
32
|
+
* `primary` is a soft outline and `secondary` is a ghost. **There is deliberately no filled tier**,
|
|
33
|
+
* because a filled control competing with a `Button` on the same screen is the confusion this
|
|
34
|
+
* component exists to stay out of -- a row of these should read as one family on any surface, and
|
|
35
|
+
* the thing a page is actually asking for should be the only loud control on it.
|
|
36
|
+
*
|
|
37
|
+
* ---- where it came from, and the two rules it breaks -----------------------
|
|
38
|
+
*
|
|
39
|
+
* **Ported 2026-09-16 from `~/Projects/Harbour Space/-harbour-space-design-system`**, where it is
|
|
40
|
+
* called `Key`. It is the first component in this library that came from outside the house, and
|
|
41
|
+
* what crossed is what `governance/evidence/read-a-reference-for-values-not-for-its-model.md`
|
|
42
|
+
* permits: the values it renders and the interface it presents. Its colour engine did not cross --
|
|
43
|
+
* two hooks per render, a theme slice out of React context, thirteen resolved strings written into
|
|
44
|
+
* inline custom properties. Here the cascade does that and this file is told nothing.
|
|
45
|
+
*
|
|
46
|
+
* **It breaks two of that reference's own rules, both because its first consumer asked.** The
|
|
47
|
+
* reference says a control *never* takes an `href` -- and the first bar to hold one has a back
|
|
48
|
+
* control that navigates, where a `<button>` costs middle-click, the new tab, the status bar and
|
|
49
|
+
* *link* in the accessibility tree. The reference is also icon-only by contract, and the same bar
|
|
50
|
+
* draws *Previous* and *Next* beside the glyphs. Both breaks are argued in
|
|
51
|
+
* `components/control.md`; neither is a rule that was copied past without being read.
|
|
52
|
+
*
|
|
53
|
+
* ---- there is no `sm`, and 44 is why -------------------------------------
|
|
54
|
+
*
|
|
55
|
+
* The reference ships `sm` at **28px**. `icon-link.tsx` in this library already argues that 44px is
|
|
56
|
+
* a floor rather than a taste -- the smallest target a finger reliably hits, the same number on
|
|
57
|
+
* every platform -- and draws a 2.75rem box for it. **A library cannot hold both sentences.** `md`
|
|
58
|
+
* is 48 and `lg` is 64, and a control smaller than the floor needs a call site that can say why the
|
|
59
|
+
* floor does not apply to it.
|
|
60
|
+
*
|
|
61
|
+
* ---- no transition, and that is a vocabulary this library does not have ----
|
|
62
|
+
*
|
|
63
|
+
* Every state in the reference carries `--motion-fast` and `--motion-ease-out`. Newtone has no
|
|
64
|
+
* motion vocabulary at all, so the states here are instant. Writing a duration would hard-code a
|
|
65
|
+
* value the shared layer cannot express -- `a-component-stops-at-a-vocabulary-it-cannot-speak.md`,
|
|
66
|
+
* third refusal -- which is the tempting one in a port, because the number is sitting in the file
|
|
67
|
+
* being read from.
|
|
68
|
+
*/
|
|
69
|
+
export function Control({ icon, variant = 'primary', size = 'md', label, ariaLabel, fill = false, iconEnd = false, className, ...rest }) {
|
|
70
|
+
// No `--bare` modifier. A control with no label is square because `Icon` carries an explicit
|
|
71
|
+
// width and height and the padding is equal on both axes -- there is nothing for a class to
|
|
72
|
+
// say, and the rule that said it anyway was two classes deep on the element a caller styles.
|
|
73
|
+
const classes = [
|
|
74
|
+
'newtone-control',
|
|
75
|
+
`newtone-control--${variant}`,
|
|
76
|
+
`newtone-control--${size}`,
|
|
77
|
+
// Written whether or not there is a label, because the class carries no layout of its own --
|
|
78
|
+
// it only flips which side of the label the extra clearance sits on, and a control with no
|
|
79
|
+
// label has no `.newtone-control-label` for either rule to match.
|
|
80
|
+
iconEnd ? 'newtone-control--icon-end' : null,
|
|
81
|
+
className,
|
|
82
|
+
]
|
|
83
|
+
.filter(Boolean)
|
|
84
|
+
.join(' ');
|
|
85
|
+
// The glyph is decorative in both cases -- where there is a visible label it repeats it, and
|
|
86
|
+
// where there is not, the name is on the element itself. `Icon` writes its own `aria-hidden`,
|
|
87
|
+
// so nothing is passed for it here.
|
|
88
|
+
//
|
|
89
|
+
// `aria-label` is left undefined when the caller did not ask for one, rather than defaulted to
|
|
90
|
+
// `label`: an aria-label silently REPLACES the text a sighted reader sees, so writing it every
|
|
91
|
+
// time would create two names for one control that nothing reports when they drift apart.
|
|
92
|
+
//
|
|
93
|
+
// THE ORDER IS THE COMPONENT'S FROM 2026-09-17 and is not a consumer's `flex-direction` any
|
|
94
|
+
// more. `iconEnd` swaps the two nodes in the MARKUP rather than reversing the flex row, so the
|
|
95
|
+
// accessibility tree, a text selection and a find-in-page all read the control in the order it
|
|
96
|
+
// is drawn -- which `row-reverse` does not give, and which is worth more than the one line it
|
|
97
|
+
// costs here.
|
|
98
|
+
const glyph = _jsx(Icon, { name: icon, size: GLYPH[size], fill: fill });
|
|
99
|
+
const word = label === undefined ? null : _jsx("span", { className: "newtone-control-label", children: label });
|
|
100
|
+
const content = iconEnd ? (_jsxs(_Fragment, { children: [word, glyph] })) : (_jsxs(_Fragment, { children: [glyph, word] }));
|
|
101
|
+
if (rest.href !== undefined) {
|
|
102
|
+
const { href, ...anchor } = rest;
|
|
103
|
+
return (_jsx("a", { href: href, className: classes, "aria-label": ariaLabel, ...anchor, children: content }));
|
|
104
|
+
}
|
|
105
|
+
return (_jsx("button", { type: "button", className: classes, "aria-label": ariaLabel, ...rest, children: content }));
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control.js","sourceRoot":"","sources":["../../src/control/control.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAiB,MAAM,kBAAkB,CAAA;AAKtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,KAAK,GAAkC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;AAyEnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,MAAM,UAAU,OAAO,CAAC,EACpB,IAAI,EACJ,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,KAAK,EACL,SAAS,EACT,IAAI,GAAG,KAAK,EACZ,OAAO,GAAG,KAAK,EACf,SAAS,EACT,GAAG,IAAI,EACI;IACX,6FAA6F;IAC7F,4FAA4F;IAC5F,6FAA6F;IAC7F,MAAM,OAAO,GAAG;QACZ,iBAAiB;QACjB,oBAAoB,OAAO,EAAE;QAC7B,oBAAoB,IAAI,EAAE;QAC1B,6FAA6F;QAC7F,2FAA2F;QAC3F,kEAAkE;QAClE,OAAO,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,IAAI;QAC5C,SAAS;KACZ;SACI,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEd,6FAA6F;IAC7F,8FAA8F;IAC9F,oCAAoC;IACpC,EAAE;IACF,+FAA+F;IAC/F,+FAA+F;IAC/F,0FAA0F;IAC1F,EAAE;IACF,4FAA4F;IAC5F,+FAA+F;IAC/F,+FAA+F;IAC/F,8FAA8F;IAC9F,cAAc;IACd,MAAM,KAAK,GAAG,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,GAAI,CAAA;IACjE,MAAM,IAAI,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,uBAAuB,YAAE,KAAK,GAAQ,CAAA;IAChG,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CACtB,8BACK,IAAI,EACJ,KAAK,IACP,CACN,CAAC,CAAC,CAAC,CACA,8BACK,KAAK,EACL,IAAI,IACN,CACN,CAAA;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,IAG3B,CAAA;QACD,OAAO,CACH,YAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,gBAAc,SAAS,KAAM,MAAM,YAC/D,OAAO,GACR,CACP,CAAA;IACL,CAAC;IAED,OAAO,CACH,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,gBACN,SAAS,KAChB,IAAgD,YAEpD,OAAO,GACH,CACZ,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/* Terms and their values, in ruled rows.
|
|
2
|
+
*
|
|
3
|
+
* THE FLOOR IS THE CALLER'S AND THE RULE IS NOT. `--newtone-data-list-term-min` is read with a
|
|
4
|
+
* 10rem fallback and declared nowhere in this library -- a band that wants a wider term column
|
|
5
|
+
* declares it on an element it already owns and inheritance carries it down. That is
|
|
6
|
+
* `--newtone-card-grid-min`'s shape, second use.
|
|
7
|
+
*
|
|
8
|
+
* THE HAIRLINE IS `data-list.rule`, WHICH REFERENCES `role.divider`. A rule between two rows of one
|
|
9
|
+
* ground is a boundary within that ground rather than ink this component puts on something, which
|
|
10
|
+
* is the narrowing contracts/roles.md section 3 carries and the same act `navbar.bar.border` was
|
|
11
|
+
* settled as on 2026-09-13. */
|
|
12
|
+
.newtone-data-list {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.newtone-data-list-row {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns:
|
|
19
|
+
minmax(var(--newtone-data-list-term-min, 10rem), max-content)
|
|
20
|
+
repeat(auto-fit, minmax(0, 1fr));
|
|
21
|
+
gap: var(--newtone-data-list-gap-block) var(--newtone-data-list-gap-inline);
|
|
22
|
+
padding-block: var(--newtone-data-list-gap-block);
|
|
23
|
+
border-top: 1px solid var(--newtone-data-list-rule);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* The closing rule, so the last row is bounded like every other. A list that rules between its rows
|
|
27
|
+
and not after the last one reads as unfinished rather than as open. */
|
|
28
|
+
.newtone-data-list-row:last-child {
|
|
29
|
+
border-bottom: 1px solid var(--newtone-data-list-rule);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.newtone-data-list-term {
|
|
33
|
+
margin: 0;
|
|
34
|
+
color: var(--newtone-data-list-term);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.newtone-data-list-value {
|
|
38
|
+
margin: 0;
|
|
39
|
+
color: var(--newtone-data-list-value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* THERE IS NO COLLAPSE BREAKPOINT HERE, AND THE FIRST DRAFT HAD ONE AT 48rem.
|
|
43
|
+
*
|
|
44
|
+
* Both call sites this component was sized from collapse at **40rem**, not 48 -- and `open.css`
|
|
45
|
+
* carries the argument for that number, which is that a breakpoint below phone width was needed for
|
|
46
|
+
* a three-column row and fired a deferral in `newtone_ui_tokens` §8 to get it. A component that
|
|
47
|
+
* shipped 48rem would have overridden a number a consumer had already reasoned its way to, at a
|
|
48
|
+
* width that consumer had measured and this one has not.
|
|
49
|
+
*
|
|
50
|
+
* SO THE COLLAPSE IS THE CALLER'S. Put a class on the rows and write the query against it -- which
|
|
51
|
+
* is what both call sites already do. What this file keeps is everything that is true at every
|
|
52
|
+
* width. */
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { DataListRow, type DataListRowProps } from './row/row.js';
|
|
3
|
+
export type { DataListRowProps };
|
|
4
|
+
export interface DataListProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A term and what is known about it, in rows, ruled.
|
|
9
|
+
*
|
|
10
|
+
* **Four consuming repositories built this under six names before it was one component**, and not
|
|
11
|
+
* one of those names is shared with any other -- which is why no repetition count ever saw it: a
|
|
12
|
+
* count recognises a repeated name and this had none. The six, and which repository wrote each, are
|
|
13
|
+
* in this component's blueprint part-file. **They are not named here**, because a component in this
|
|
14
|
+
* library names no consumer -- the repo blueprint's section 5.
|
|
15
|
+
*
|
|
16
|
+
* ---- what varies, and the one thing that is therefore not a prop ----------
|
|
17
|
+
*
|
|
18
|
+
* **The term column is different at every one of the six** -- `10rem`, `5rem`, `minmax(10rem,16rem)`,
|
|
19
|
+
* `minmax(14rem,24rem)`, `minmax(9rem,1fr)`. That is the varying part made visible rather than
|
|
20
|
+
* guessed, which is the condition governance/code/propose-the-system-at-the-third-repetition.md says
|
|
21
|
+
* to wait for, and it is **not a prop**: it is `--newtone-data-list-term-min`, read with a fallback,
|
|
22
|
+
* declared by the caller on an element it already owns. A custom property does not have to reach
|
|
23
|
+
* this element to be read by it -- `card-grid`'s floor settled that on 2026-09-06 and this is the
|
|
24
|
+
* second use of the same shape.
|
|
25
|
+
*
|
|
26
|
+
* **The track count comes from the markup**, because `repeat(auto-fit, …)` counts what is there. A
|
|
27
|
+
* row of a term and two values is three tracks; a row of a term and one value is two. Nothing to
|
|
28
|
+
* keep in sync and no prop to get wrong.
|
|
29
|
+
*
|
|
30
|
+
* ---- why the rows are a SLOT and the first draft's `rows` prop is gone ----
|
|
31
|
+
*
|
|
32
|
+
* **It took `rows: {term, values}[]` and neither call site could have used it.** `price` sets its
|
|
33
|
+
* figure in tabular accent and its third column as an aside -- a class per cell -- and `open` needs
|
|
34
|
+
* `aria-hidden` on a header row that names the columns for sighted readers only. A data prop could
|
|
35
|
+
* express neither without growing a shape per caller, which is
|
|
36
|
+
* governance/evidence/size-an-api-from-call-sites-not-from-the-type.md read backwards.
|
|
37
|
+
*
|
|
38
|
+
* **So the split is: the LAYOUT is this component's and the CELLS are the caller's.** `DataList`
|
|
39
|
+
* and `DataList.Row` publish the `<dl>`, the grid, the rule and the collapse; the `<dt>` and `<dd>`
|
|
40
|
+
* are written at the call site with whatever classes that page needs. `Navbar` is the same shape,
|
|
41
|
+
* and `DataListRow` is private in the same way -- no `index.ts`, reachable only as `DataList.Row`.
|
|
42
|
+
*
|
|
43
|
+
* ---- what it is not -------------------------------------------------------
|
|
44
|
+
*
|
|
45
|
+
* **It is not a table and must not become one.** A `<dl>` says *these terms have these values*; a
|
|
46
|
+
* `<table>` says *these cells are addressable by row and column*. The six call sites are all the
|
|
47
|
+
* first. The day one of them needs a column header that means something to a screen reader, that is
|
|
48
|
+
* a `<table>` and a different component -- not a `header` prop here. `open-list`'s own header row is
|
|
49
|
+
* `aria-hidden` for exactly this reason and stays that way.
|
|
50
|
+
*/
|
|
51
|
+
export declare function DataList({ children, className, ...rest }: DataListProps): import("react").JSX.Element;
|
|
52
|
+
export declare namespace DataList {
|
|
53
|
+
export { DataListRow as Row };
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=data-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-list.d.ts","sourceRoot":"","sources":["../../src/data-list/data-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEjE,YAAY,EAAE,gBAAgB,EAAE,CAAA;AAEhC,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAMvE;yBANe,QAAQ;aAQT,WAAW"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DataListRow } from './row/row.js';
|
|
3
|
+
/**
|
|
4
|
+
* A term and what is known about it, in rows, ruled.
|
|
5
|
+
*
|
|
6
|
+
* **Four consuming repositories built this under six names before it was one component**, and not
|
|
7
|
+
* one of those names is shared with any other -- which is why no repetition count ever saw it: a
|
|
8
|
+
* count recognises a repeated name and this had none. The six, and which repository wrote each, are
|
|
9
|
+
* in this component's blueprint part-file. **They are not named here**, because a component in this
|
|
10
|
+
* library names no consumer -- the repo blueprint's section 5.
|
|
11
|
+
*
|
|
12
|
+
* ---- what varies, and the one thing that is therefore not a prop ----------
|
|
13
|
+
*
|
|
14
|
+
* **The term column is different at every one of the six** -- `10rem`, `5rem`, `minmax(10rem,16rem)`,
|
|
15
|
+
* `minmax(14rem,24rem)`, `minmax(9rem,1fr)`. That is the varying part made visible rather than
|
|
16
|
+
* guessed, which is the condition governance/code/propose-the-system-at-the-third-repetition.md says
|
|
17
|
+
* to wait for, and it is **not a prop**: it is `--newtone-data-list-term-min`, read with a fallback,
|
|
18
|
+
* declared by the caller on an element it already owns. A custom property does not have to reach
|
|
19
|
+
* this element to be read by it -- `card-grid`'s floor settled that on 2026-09-06 and this is the
|
|
20
|
+
* second use of the same shape.
|
|
21
|
+
*
|
|
22
|
+
* **The track count comes from the markup**, because `repeat(auto-fit, …)` counts what is there. A
|
|
23
|
+
* row of a term and two values is three tracks; a row of a term and one value is two. Nothing to
|
|
24
|
+
* keep in sync and no prop to get wrong.
|
|
25
|
+
*
|
|
26
|
+
* ---- why the rows are a SLOT and the first draft's `rows` prop is gone ----
|
|
27
|
+
*
|
|
28
|
+
* **It took `rows: {term, values}[]` and neither call site could have used it.** `price` sets its
|
|
29
|
+
* figure in tabular accent and its third column as an aside -- a class per cell -- and `open` needs
|
|
30
|
+
* `aria-hidden` on a header row that names the columns for sighted readers only. A data prop could
|
|
31
|
+
* express neither without growing a shape per caller, which is
|
|
32
|
+
* governance/evidence/size-an-api-from-call-sites-not-from-the-type.md read backwards.
|
|
33
|
+
*
|
|
34
|
+
* **So the split is: the LAYOUT is this component's and the CELLS are the caller's.** `DataList`
|
|
35
|
+
* and `DataList.Row` publish the `<dl>`, the grid, the rule and the collapse; the `<dt>` and `<dd>`
|
|
36
|
+
* are written at the call site with whatever classes that page needs. `Navbar` is the same shape,
|
|
37
|
+
* and `DataListRow` is private in the same way -- no `index.ts`, reachable only as `DataList.Row`.
|
|
38
|
+
*
|
|
39
|
+
* ---- what it is not -------------------------------------------------------
|
|
40
|
+
*
|
|
41
|
+
* **It is not a table and must not become one.** A `<dl>` says *these terms have these values*; a
|
|
42
|
+
* `<table>` says *these cells are addressable by row and column*. The six call sites are all the
|
|
43
|
+
* first. The day one of them needs a column header that means something to a screen reader, that is
|
|
44
|
+
* a `<table>` and a different component -- not a `header` prop here. `open-list`'s own header row is
|
|
45
|
+
* `aria-hidden` for exactly this reason and stays that way.
|
|
46
|
+
*/
|
|
47
|
+
export function DataList({ children, className, ...rest }) {
|
|
48
|
+
return (_jsx("dl", { className: ['newtone-data-list', className].filter(Boolean).join(' '), ...rest, children: children }));
|
|
49
|
+
}
|
|
50
|
+
DataList.Row = DataListRow;
|
|
51
|
+
//# sourceMappingURL=data-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-list.js","sourceRoot":"","sources":["../../src/data-list/data-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,EAAyB,MAAM,cAAc,CAAA;AAQjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB;IACpE,OAAO,CACH,aAAI,SAAS,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAM,IAAI,YAC9E,QAAQ,GACR,CACR,CAAA;AACL,CAAC;AAED,QAAQ,CAAC,GAAG,GAAG,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data-list/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AACnD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-list/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface DataListRowProps extends HTMLAttributes<HTMLElement> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* One row. A `<div>` inside the `<dl>` -- legal HTML, and the only way to make a row a grid
|
|
7
|
+
* container: without it the `<dt>` and its `<dd>`s are siblings and no selector can group them.
|
|
8
|
+
*
|
|
9
|
+
* **It is a part rather than a prop for the same reason `Navbar.Link` is.** Every call site this
|
|
10
|
+
* component was sized from puts its own class on individual cells -- a figure set in tabular
|
|
11
|
+
* accent, a third column that reads as an aside -- and one of them needs `aria-hidden` on a header
|
|
12
|
+
* row. A `rows={[{term, values}]}` prop could express none of that without growing a shape per
|
|
13
|
+
* call site.
|
|
14
|
+
*/
|
|
15
|
+
export declare function DataListRow({ children, className, ...rest }: DataListRowProps): import("react").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=row.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.d.ts","sourceRoot":"","sources":["../../../src/data-list/row/row.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACjE,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,gBAAgB,+BAM7E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* One row. A `<div>` inside the `<dl>` -- legal HTML, and the only way to make a row a grid
|
|
4
|
+
* container: without it the `<dt>` and its `<dd>`s are siblings and no selector can group them.
|
|
5
|
+
*
|
|
6
|
+
* **It is a part rather than a prop for the same reason `Navbar.Link` is.** Every call site this
|
|
7
|
+
* component was sized from puts its own class on individual cells -- a figure set in tabular
|
|
8
|
+
* accent, a third column that reads as an aside -- and one of them needs `aria-hidden` on a header
|
|
9
|
+
* row. A `rows={[{term, values}]}` prop could express none of that without growing a shape per
|
|
10
|
+
* call site.
|
|
11
|
+
*/
|
|
12
|
+
export function DataListRow({ children, className, ...rest }) {
|
|
13
|
+
return (_jsx("div", { className: ['newtone-data-list-row', className].filter(Boolean).join(' '), ...rest, children: children }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=row.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/data-list/row/row.tsx"],"names":[],"mappings":";AAMA;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAAoB;IAC1E,OAAO,CACH,cAAK,SAAS,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAM,IAAI,YACnF,QAAQ,GACP,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/* The feature card's sheet: a floor, an ink, the copy block that claims the slack, and the window.
|
|
2
|
+
* Every colour is read from this component's own semantic group; none is declared and none is a
|
|
3
|
+
* role. See the repo blueprint, sections 4.1 and 5.
|
|
4
|
+
*
|
|
5
|
+
* ---- the floor, and the count it moved ----------------------------------
|
|
6
|
+
*
|
|
7
|
+
* `20rem` is 320px, the live page's `--ds-measure-md` read on 2026-09-04, and it is the same number
|
|
8
|
+
* achievement-card.css states. It is a rule rather than a prop for the reason card-box.tsx argues:
|
|
9
|
+
* Newtone's `Wrapper` has no sizing family, and a card's floor is invariant per card kind.
|
|
10
|
+
*
|
|
11
|
+
* **It is the FOURTH block width this repo has written by hand, and the first that two sheets have
|
|
12
|
+
* to agree on** -- which is both halves of the trigger blueprint section 4.2 wrote for itself. Two
|
|
13
|
+
* card kinds arrived at about the same room independently; nothing connects the two numbers, so the
|
|
14
|
+
* day one of them moves because that card's copy got longer, the row stops wrapping at one width.
|
|
15
|
+
* The trigger fired, the decision was made again rather than inherited, and the answer was to
|
|
16
|
+
* propose rather than build -- issues/done/030-the-block-width-family.md.
|
|
17
|
+
*
|
|
18
|
+
* **`min(..., 100%)` is not tidiness.** A bare `min-width` is a floor a flex item will not shrink
|
|
19
|
+
* past, so a card in a container narrower than its own minimum pushes out of it and gives the page
|
|
20
|
+
* a horizontal scrollbar. Capped at 100% it simply fills what it has.
|
|
21
|
+
*
|
|
22
|
+
* ---- where the reference's `height="fill"` went -------------------------
|
|
23
|
+
*
|
|
24
|
+
* The copy block claims the leftover height, so in a row of unequal cards the WINDOWS line up along
|
|
25
|
+
* the bottom rather than floating under whichever copy ran short. The reference states that as a
|
|
26
|
+
* prop on its wrapper; Newtone's `Wrapper` has no height prop -- issue 015's sizing family, met from
|
|
27
|
+
* a third side after the two card floors -- so it is `flex: 1 1 auto` here.
|
|
28
|
+
*
|
|
29
|
+
* **Nothing here out-specifies a prop.** `Wrapper` writes an inline style holding `display`,
|
|
30
|
+
* `flex-direction`, `min-width: 0`, and whatever `gap`, `padding` and `align` were passed. It never
|
|
31
|
+
* writes `flex`, so this rule and the call site cannot contradict each other -- which is section
|
|
32
|
+
* 4.2's hazard, and it runs one way.
|
|
33
|
+
*
|
|
34
|
+
* ---- the window, which left this file on 2026-09-05 ----------------------
|
|
35
|
+
*
|
|
36
|
+
* **The card owns the shape and the slot only supplies content**, which is what makes `media` safe
|
|
37
|
+
* as a node: one card can never break the shape of the row it sits in, whether it is holding
|
|
38
|
+
* today's flat mount or the drawings section 8 defers. **That is still true and the card no longer
|
|
39
|
+
* says all of it here.**
|
|
40
|
+
*
|
|
41
|
+
* Five of the seven declarations that were in this rule -- the block box, `flex: none`, the `md`
|
|
42
|
+
* corner, `overflow: hidden`, and the rule that makes the slot's child fill the box -- are
|
|
43
|
+
* `.newtone-media-window` in Newtone's `media-window.css`, because `mode-card` wants the identical five and no folder
|
|
44
|
+
* owns a shape two folders write. Section 8's trigger for that file, word for word, firing a second
|
|
45
|
+
* time. See the repo blueprint, sections 4.1.10 and 4.2.
|
|
46
|
+
*
|
|
47
|
+
* **What stays here is what is this card's:** the crop, and which edge the clearance lands on. Both
|
|
48
|
+
* are invariant per card kind -- every feature card is `3 / 2` at the foot -- which is why they are
|
|
49
|
+
* a rule in this sheet and not a prop on a shared component. card-box.tsx's argument for a floor,
|
|
50
|
+
* applied to a shape instead of a length.
|
|
51
|
+
*
|
|
52
|
+
* **The corner went with the shape and the give-way did not change.** The live page rounds this at
|
|
53
|
+
* `radius-lg`, 16px; Newtone has two steps and it lands on `md` like both of achievement-card's did.
|
|
54
|
+
* the consuming site's own knowledge entry carries the concession, and it is now stated
|
|
55
|
+
* once for both windows rather than once per card. */
|
|
56
|
+
|
|
57
|
+
.newtone-feature-card {
|
|
58
|
+
flex: 1 1 min(20rem, 100%);
|
|
59
|
+
min-width: min(20rem, 100%);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.newtone-feature-card-copy {
|
|
63
|
+
flex: 1 1 auto;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* The lead ink under a title that takes the first level.
|
|
67
|
+
*
|
|
68
|
+
* **The token resolves to `role.text.secondary` and that is legal here as of 2026-09-07.** This card
|
|
69
|
+
* declares no fill of its own -- the `CardBox` around it is what paints -- so the description sits on
|
|
70
|
+
* the same ground running prose sits on, and the role's answer to *how much contrast is enough* is
|
|
71
|
+
* the right answer rather than a borrowed one. `blueprints/newtone/contracts/roles.md` section 3
|
|
72
|
+
* narrowed its prohibition to exactly that distinction when its own trigger fired.
|
|
73
|
+
*
|
|
74
|
+
* The consuming site's third level of ink lands on the second one here; there is no third level in
|
|
75
|
+
* Newtone, and that site's own knowledge entry records what it costs. */
|
|
76
|
+
.newtone-feature-card-description {
|
|
77
|
+
color: var(--newtone-feature-card-description);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Worn beside `.newtone-media-window`, which carries everything a window is. These two are what this
|
|
81
|
+
* card is: a three-by-two crop, and 12px of clearance on the edge that faces the copy above it.
|
|
82
|
+
*
|
|
83
|
+
* **The ratio is a declaration and not a prop**, which is the whole reason the window is a shape here
|
|
84
|
+
* rather than a `<MediaWindow ratio>`: every feature card is 3 / 2 for the life of the card, so it is
|
|
85
|
+
* this sheet's decision and no call site types it. `media-window/media-window.css` argues it in full.
|
|
86
|
+
*
|
|
87
|
+
* **The clearance is a token because the component decides it.** A length the CALLER chooses is read
|
|
88
|
+
* from core at the call site, which is `Wrapper` and `gap={3}`; a length the COMPONENT decides is a
|
|
89
|
+
* semantic token that references core -- section 5, unchanged. */
|
|
90
|
+
.newtone-feature-card-window {
|
|
91
|
+
--newtone-media-window-ratio: 3 / 2;
|
|
92
|
+
margin-block-start: var(--newtone-feature-card-window-clearance);
|
|
93
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A feature: a round mark, a heading, a paragraph, and a picture in a three-by-two window at its
|
|
4
|
+
* foot. `career-path` renders two of them.
|
|
5
|
+
*
|
|
6
|
+
* **It takes four fields and refuses one thing**, and the refusal is the interesting half. The
|
|
7
|
+
* reference's is already `icon`, `title`, `description` and `media`, and every one of them varies at
|
|
8
|
+
* both call sites -- so there is nothing here to cut, which is `achievement-card`'s finding again.
|
|
9
|
+
* See the repo blueprint, section 4.1.6.
|
|
10
|
+
*
|
|
11
|
+
* **`media` is required where the reference makes it optional.** There, an omitted slot stands a
|
|
12
|
+
* placeholder image in. `governance/voice/an-omission-costs-nothing-a-placeholder-makes-a-claim.md` is
|
|
13
|
+
* why not: a card with no picture is not a state this page has, and inventing an image to fill a
|
|
14
|
+
* hole is the one thing a rebuild must not do, because it looks exactly like progress.
|
|
15
|
+
*
|
|
16
|
+
* ---- the window, and what makes a slot safe -----------------------------
|
|
17
|
+
*
|
|
18
|
+
* **The card owns the window's shape and the slot only supplies content** -- the ratio, the corner,
|
|
19
|
+
* the clip and the refusal to shrink are all in feature-card.css. That is what lets `media` be any
|
|
20
|
+
* node at all: one card cannot break the shape of the row it sits in, so the slot can hold the flat
|
|
21
|
+
* `media-plate` it holds today and the drawings section 8 defers without this file learning which.
|
|
22
|
+
*
|
|
23
|
+
* **The window is markup here rather than a folder**, one renderer, which is the plate precedent
|
|
24
|
+
* exactly -- `governance/code/one-folder-per-thing.md`. What IS a folder is the thing that goes in it,
|
|
25
|
+
* and only because the slot puts it at two call sites.
|
|
26
|
+
*
|
|
27
|
+
* **This paragraph used to end "it becomes a folder the day a second card wants a picture", and on
|
|
28
|
+
* 2026-09-05 a second card wanted one and it did not become a folder.** `mode-card` is that card,
|
|
29
|
+
* and `governance/deferrals/a-trigger-is-a-signal-to-decide-again.md` is why the sentence was not the answer:
|
|
30
|
+
* the trigger named the right day and the wrong verb. **The two windows turned out to differ only in
|
|
31
|
+
* a crop and a clearance edge, and both are invariant per card kind** -- so what they share is five
|
|
32
|
+
* declarations, which is a shape (`.newtone-media-window` in Newtone's `media-window.css`), and what they do not share
|
|
33
|
+
* is two values a card states in its own sheet. A component would have taken two props whose call
|
|
34
|
+
* sites each have one value forever.
|
|
35
|
+
*
|
|
36
|
+
* **The prediction could not have got that right and it still earned its place.** When it was
|
|
37
|
+
* written there was one window and nothing to compare it against, so *what varies* was unreadable
|
|
38
|
+
* and the guess had to be a guess. Saying WHEN to look again is the part a note can do. See the
|
|
39
|
+
* repo blueprint, section 4.1.10.
|
|
40
|
+
*
|
|
41
|
+
* ---- the small decisions, each already made somewhere else --------------
|
|
42
|
+
*
|
|
43
|
+
* **The mark is `framed-icon`'s round shape**, and rendering it is what turned that mark from a
|
|
44
|
+
* `<span>` inside `achievement-card` into a folder of its own. The trigger was written there in
|
|
45
|
+
* advance and it fired here.
|
|
46
|
+
*
|
|
47
|
+
* **`h3` is stated rather than passed**, for `stat-card`'s reason: a card always sits inside a
|
|
48
|
+
* section on this template, the section's own head is the `h2`, and the level is a fact about
|
|
49
|
+
* position rather than about the card.
|
|
50
|
+
*
|
|
51
|
+
* **The title does not animate.** The reference gives it the library's entrance; Newtone has no
|
|
52
|
+
* text animation at all, which the knowledge entry's section 4 records as a real absence.
|
|
53
|
+
*
|
|
54
|
+
* **`gap={2}` is 8px and `padding={3}` is 12px** -- the live page's own `--space-xs` and
|
|
55
|
+
* `--space-sm`, restated on Newtone's scale, and the same two terms the other two cards use.
|
|
56
|
+
*/
|
|
57
|
+
export interface FeatureCardProps extends HTMLAttributes<HTMLElement> {
|
|
58
|
+
/** A Material Symbols ligature. */
|
|
59
|
+
icon: string;
|
|
60
|
+
/** The feature, as a short line -- `Jumpstart your Career Path`. */
|
|
61
|
+
title: string;
|
|
62
|
+
/** The paragraph under it. */
|
|
63
|
+
description: string;
|
|
64
|
+
/** What sits in the window at the foot. `media-plate` today; a drawing when one ships. */
|
|
65
|
+
media: ReactNode;
|
|
66
|
+
}
|
|
67
|
+
export declare function FeatureCard({ icon, title, description, media, className, ...rest }: FeatureCardProps): import("react").JSX.Element;
|
|
68
|
+
//# sourceMappingURL=feature-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-card.d.ts","sourceRoot":"","sources":["../../src/feature-card/feature-card.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACjE,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAA;IACb,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,0FAA0F;IAC1F,KAAK,EAAE,SAAS,CAAA;CACnB;AAED,wBAAgB,WAAW,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACV,EAAE,gBAAgB,+BAsBlB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } 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 { Text } from '../text/index.js';
|
|
5
|
+
import { Wrapper } from '../wrapper/index.js';
|
|
6
|
+
import { CardBox } from '../card-box/index.js';
|
|
7
|
+
import { FramedIcon } from '../framed-icon/index.js';
|
|
8
|
+
export function FeatureCard({ icon, title, description, media, className, ...rest }) {
|
|
9
|
+
return (_jsxs(CardBox, { direction: "column", className: ['newtone-feature-card', className].filter(Boolean).join(' '), ...rest, children: [_jsx(Wrapper, { direction: "row", padding: 3, children: _jsx(FramedIcon, { icon: icon, shape: "round" }) }), _jsxs(Wrapper, { direction: "column", gap: 2, padding: 3, className: "newtone-feature-card-copy", children: [_jsx(Text, { as: "h3", scale: "heading-sm", children: title }), _jsx(Text, { scale: "body", className: "newtone-feature-card-description", children: description })] }), _jsx("span", { className: "newtone-media-window newtone-feature-card-window", children: media })] }));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=feature-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature-card.js","sourceRoot":"","sources":["../../src/feature-card/feature-card.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAoEpD,MAAM,UAAU,WAAW,CAAC,EACxB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,KAAK,EACL,SAAS,EACT,GAAG,IAAI,EACQ;IACf,OAAO,CACH,MAAC,OAAO,IACJ,SAAS,EAAC,QAAQ,EAClB,SAAS,EAAE,CAAC,sBAAsB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACpE,IAAI,aAER,KAAC,OAAO,IAAC,SAAS,EAAC,KAAK,EAAC,OAAO,EAAE,CAAC,YAC/B,KAAC,UAAU,IAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,OAAO,GAAG,GAClC,EACV,MAAC,OAAO,IAAC,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAC,2BAA2B,aACjF,KAAC,IAAI,IAAC,EAAE,EAAC,IAAI,EAAC,KAAK,EAAC,YAAY,YAC3B,KAAK,GACH,EACP,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,SAAS,EAAC,kCAAkC,YAC1D,WAAW,GACT,IACD,EAEV,eAAM,SAAS,EAAC,kDAAkD,YAAE,KAAK,GAAQ,IAC3E,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-card/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/feature-card/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|