@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tag/index.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA"}
|
package/dist/tag/tag.css
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* The pill's sheet: one ground, one ink, one corner and the shape around them. Every colour is read
|
|
2
|
+
* from a Newtone role; none is declared. See the repo blueprint, sections 4.1.7 and 4.2.
|
|
3
|
+
*
|
|
4
|
+
* ---- one pair, two tones -------------------------------------------------
|
|
5
|
+
*
|
|
6
|
+
* There is one `background` rule and one `color` rule here, and both tones use them. The tone is
|
|
7
|
+
* the SCOPE the pill declares -- tag.tsx passes a Newtone theme -- so `surface-secondary` and
|
|
8
|
+
* `text-secondary` resolve to the accent-tinted pair inside a `tinted` pill and the neutral pair
|
|
9
|
+
* inside a `default` one. Two tones out of two role names is what makes it impossible to retune one
|
|
10
|
+
* and not the other.
|
|
11
|
+
*
|
|
12
|
+
* **The ground is the SECONDARY surface and not the primary one**, which is the detail that decides
|
|
13
|
+
* whether the pill is visible at all. A card is painted from the primary surface, so a pill sharing
|
|
14
|
+
* it would be a word with no shape around it. The secondary surface is the step below the ground it
|
|
15
|
+
* sits on, in both scopes, which is what the live page's `neutral-100` on white is doing.
|
|
16
|
+
*
|
|
17
|
+
* ---- the corner ----------------------------------------------------------
|
|
18
|
+
*
|
|
19
|
+
* The live page rounds this with the original's *full*, published as a 2048px length chosen to be
|
|
20
|
+
* larger than any box it lands on. **framed-icon's `50%` is not available here**: this box is wider
|
|
21
|
+
* than it is tall, and a proportion of both sides draws an ellipse rather than a capsule -- the
|
|
22
|
+
* wrong statement rather than a stricter one.
|
|
23
|
+
*
|
|
24
|
+
* So it is an infinite length, which is the same claim `50%` makes on a square: the box has no
|
|
25
|
+
* corner. **The reason it may be written when a finite length may not** is section 5's, unchanged:
|
|
26
|
+
* what that row protects is a number standing in for a step on Newtone's two-step scale, and a give
|
|
27
|
+
* -way can hide inside one. Nothing on a two-step scale is infinite, so nothing is being hidden.
|
|
28
|
+
* The row was widened in the same pass to say so.
|
|
29
|
+
*
|
|
30
|
+
* **What ships is not what is written here, and that is worth knowing rather than fixing.** The
|
|
31
|
+
* build's minifier evaluates the constant, so the served rule carries `3.40282e38px` -- the largest
|
|
32
|
+
* length the format can hold, which is the original's own 2048px trick arrived at from the other
|
|
33
|
+
* end. The invariant reads this file because a give-way hides in what a person typed; a minifier
|
|
34
|
+
* folding a constant is not a person choosing a step. It also means a browser too old for math
|
|
35
|
+
* constants still gets a capsule.
|
|
36
|
+
*
|
|
37
|
+
* ---- the block padding, which is the give-way -----------------------------
|
|
38
|
+
*
|
|
39
|
+
* The live pill is padded 2px above and below -- a deliberate half-step, so it reads as a word with
|
|
40
|
+
* a shape around it rather than as a button. **Newtone's spacing scale starts at 4px and has no
|
|
41
|
+
* half step**, so this takes the nearest real value and the pill comes out 4px taller than the one
|
|
42
|
+
* it copies. That is the same trade the type sizes and the corners each make, and it is recorded
|
|
43
|
+
* with its numbers in the consuming site's own knowledge entry.
|
|
44
|
+
*
|
|
45
|
+
* The inline padding is `space-2`, 8px, which is the live page's own value exactly.
|
|
46
|
+
*
|
|
47
|
+
* **And it stays 8px on both sides now that a pill may carry a glyph**, where the live badge pads
|
|
48
|
+
* `2px 8px 2px 2px` -- the leading side tightened because a 20px glyph brings its own optical space.
|
|
49
|
+
* Newtone's scale starts at 4px and this rule pads with one term, so the choice was a second
|
|
50
|
+
* declaration for a 2px value the scale does not have, or the symmetry. It is the symmetry, and the
|
|
51
|
+
* badge comes out 6px wider on its leading edge than the one it copies. Same trade as the block
|
|
52
|
+
* padding above it, recorded the same way in the consuming site's own knowledge entry.
|
|
53
|
+
*
|
|
54
|
+
* ---- the gap, which is the live page's own and not a nearest step ---------
|
|
55
|
+
*
|
|
56
|
+
* `space-1` is 4px and the served `tag-module` rule declares `gap: var(--space-2xs)`, which resolves
|
|
57
|
+
* to 4px. It is written unconditionally because a pill with no glyph has one child, and a gap with
|
|
58
|
+
* nothing to sit between costs nothing to declare and one condition to avoid.
|
|
59
|
+
*
|
|
60
|
+
* ---- the shape -----------------------------------------------------------
|
|
61
|
+
*
|
|
62
|
+
* `block-size: fit-content` so a pill in a stretched grid cell keeps its own height rather than
|
|
63
|
+
* growing to the row. `white-space: nowrap` so `Elective` never breaks across two lines inside a
|
|
64
|
+
* corner that assumes one. */
|
|
65
|
+
|
|
66
|
+
.newtone-tag {
|
|
67
|
+
display: inline-flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
gap: var(--newtone-tag-gap);
|
|
70
|
+
block-size: fit-content;
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
padding-block: var(--newtone-tag-padding-block);
|
|
73
|
+
padding-inline: var(--newtone-tag-padding-inline);
|
|
74
|
+
border-radius: calc(infinity * 1px);
|
|
75
|
+
background: var(--newtone-tag-fill);
|
|
76
|
+
color: var(--newtone-tag-text);
|
|
77
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A small filled pill carrying one word about the thing it sits beside.
|
|
4
|
+
*
|
|
5
|
+
* ---- the two tones are two SCOPES, not two colours -----------------------
|
|
6
|
+
*
|
|
7
|
+
* `issues/done/031-structure-components.md` asked for both of the live page's pairs to be resolved
|
|
8
|
+
* into colours before either was chosen, and named the failure it expected: one pair for both
|
|
9
|
+
* tones, which would leave the shape of a degree unreadable down the column of module rows.
|
|
10
|
+
*
|
|
11
|
+
* **It is not one pair, because Newtone has a theme axis.** `Surface theme="tinted"` re-scopes every
|
|
12
|
+
* role beneath it to the accent-tinted set, so two role NAMES -- `surface-secondary` and
|
|
13
|
+
* `text-secondary`, written once each in tag.css -- produce both tones:
|
|
14
|
+
*
|
|
15
|
+
* Core tinted #CAC6FD under #6126DA live: #D9D1FF under #6233C1
|
|
16
|
+
* Elective default #E2E2E2 under #555556 live: #EEEEEE under #5F5F61
|
|
17
|
+
*
|
|
18
|
+
* Resolved light, default theme, base elevation, against the live page's served values read on
|
|
19
|
+
* 2026-09-04. **So neither tone can be retuned without the other**, which is framed-icon's
|
|
20
|
+
* *declared once* argument arriving from a different direction, and it is why the concession list
|
|
21
|
+
* gained nothing about this pill's colour.
|
|
22
|
+
*
|
|
23
|
+
* **The Core row's two halves were read on different days, and that is not the two drifting apart.**
|
|
24
|
+
* Its resolved half moved from `#D6D3FD` to `#CAC6FD` on 2026-09-17, when the tinted column stepped
|
|
25
|
+
* one authored rung further from `default` and `surface-secondary` landed on accent-9 where it had
|
|
26
|
+
* landed on accent-7; the `live:` half is still the 2026-09-04 reading of a page nobody has rebuilt
|
|
27
|
+
* since.
|
|
28
|
+
*
|
|
29
|
+
* **Both tones name a theme, including `default`.** A pill that named none would inherit whichever
|
|
30
|
+
* scope its card is in, and the day a card is tinted every `Elective` pill on the page would turn
|
|
31
|
+
* purple with nothing to report it.
|
|
32
|
+
*
|
|
33
|
+
* ---- what a tone MEANS is not this component's business ------------------
|
|
34
|
+
*
|
|
35
|
+
* `accent` and `neutral`, never `core` and `elective`. Which category wears which tone is keyed by
|
|
36
|
+
* the degree's own words, so that map belongs beside the copy and arrives with the band. The
|
|
37
|
+
* reference reaches the same split and says why: a map keyed by content strings that lives away
|
|
38
|
+
* from the content stops matching the day a category is renamed.
|
|
39
|
+
*
|
|
40
|
+
* ---- what it does not take ----------------------------------------------
|
|
41
|
+
*
|
|
42
|
+
* **No `icon`.** The one call site passes `null` in the reference and there is no glyph on the live
|
|
43
|
+
* page. `governance/evidence/size-an-api-from-call-sites-not-from-the-type.md`.
|
|
44
|
+
*
|
|
45
|
+
* **A PROP as of 2026-09-06, and the refusal is kept above because its own terms are what fired
|
|
46
|
+
* it.** *There is no glyph on the live page* was true of the page as it had been read: three module
|
|
47
|
+
* rows in `structure`. Costing `pricing` measured a second pill on the same page -- the discounted
|
|
48
|
+
* card's badge, `percent_discount` at 20px beside `50% off` -- so the sentence stopped being true
|
|
49
|
+
* about the page rather than about the counting rule. Optional, and the three call sites that
|
|
50
|
+
* predate it pass nothing.
|
|
51
|
+
*
|
|
52
|
+
* **The page has two pills and only one of them is this component.** The segmented control's `−50%`
|
|
53
|
+
* is 12/16 at a 4px corner where this is 14/20 in a capsule, and the served sheets carry them as two
|
|
54
|
+
* different modules. Section 4.1.13's decision D argues it; the small one is markup inside
|
|
55
|
+
* `segmented-control/` and section 8 carries the row.
|
|
56
|
+
*
|
|
57
|
+
* **It is two elements, because a themed box is two elements.** `Surface` emits the scope and paints
|
|
58
|
+
* nothing -- a component that painted would have to read a role, which
|
|
59
|
+
* blueprints/newtone/contracts/roles.md forbids -- so the sheet beside this file paints and `Text`
|
|
60
|
+
* is the type. card-box.tsx is the same arrangement for the same reason.
|
|
61
|
+
*
|
|
62
|
+
* **The type is `body-sm` at `weight="medium"`**, which is 14px and 500 -- the live page's own pair
|
|
63
|
+
* exactly rather than the nearest thing to it. That is worth stating because most of this rebuild's
|
|
64
|
+
* type lands one step short of what it copies.
|
|
65
|
+
*/
|
|
66
|
+
export type TagTone = 'accent' | 'neutral';
|
|
67
|
+
export interface TagProps extends HTMLAttributes<HTMLElement> {
|
|
68
|
+
/** The word -- `Core`, `Elective`, `50% off`. Content, and it arrives with the band. */
|
|
69
|
+
label: string;
|
|
70
|
+
/** Which of the two moods. No default: a pill that has not said which it is has not decided. */
|
|
71
|
+
tone: TagTone;
|
|
72
|
+
/**
|
|
73
|
+
* A Material Symbols ligature before the word -- `percent_discount`. Optional: three call sites
|
|
74
|
+
* predate it and pass nothing. It is decorative, like every other glyph here, so the pill's
|
|
75
|
+
* meaning stays in its label.
|
|
76
|
+
*/
|
|
77
|
+
icon?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare function Tag({ label, tone, icon, className, ...rest }: TagProps): import("react").JSX.Element;
|
|
80
|
+
//# sourceMappingURL=tag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAA;AAS1C,MAAM,WAAW,QAAS,SAAQ,cAAc,CAAC,WAAW,CAAC;IACzD,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAA;IACb,gGAAgG;IAChG,IAAI,EAAE,OAAO,CAAA;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,wBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,+BAgBtE"}
|
package/dist/tag/tag.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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 { Surface } from '../surface/index.js';
|
|
5
|
+
import { Text } from '../text/index.js';
|
|
6
|
+
import { Icon } from '../icon/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Which Newtone scope each tone is. Held here rather than at the call sites because it is not a
|
|
9
|
+
* choice a caller makes: `accent` MEANS the tinted scope, and a caller that could pass a theme
|
|
10
|
+
* could paint a pill in a scope the page has no other use for.
|
|
11
|
+
*/
|
|
12
|
+
const SCOPE = { accent: 'tinted', neutral: 'default' };
|
|
13
|
+
export function Tag({ label, tone, icon, className, ...rest }) {
|
|
14
|
+
return (_jsxs(Surface, { as: "span", theme: SCOPE[tone], className: ['newtone-tag', className].filter(Boolean).join(' '), ...rest, children: [icon ? _jsx(Icon, { name: icon, size: "sm" }) : null, _jsx(Text, { as: "span", scale: "body-sm", weight: "medium", children: label })] }));
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAc,MAAM,qBAAqB,CAAA;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAqEvC;;;;GAIG;AACH,MAAM,KAAK,GAA2B,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,CAAA;AAe9E,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,EAAY;IACnE,OAAO,CACH,MAAC,OAAO,IACJ,EAAE,EAAC,MAAM,EACT,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAClB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAC3D,IAAI,aAIP,IAAI,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,IAAI,GAAG,CAAC,CAAC,CAAC,IAAI,EAC7C,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAC,SAAS,EAAC,MAAM,EAAC,QAAQ,YAC1C,KAAK,GACH,IACD,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/text/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/* Text's own styles. Every value is a text.* token; nothing here names a family, a weight, a
|
|
2
|
+
size or a colour. See contracts/typography.md sections 7 and 7.1.
|
|
3
|
+
|
|
4
|
+
THREE THINGS COMPOSE HERE, and the order of the blocks below is the whole mechanism: the
|
|
5
|
+
SCALE a passage is (its family, size, leading, tracking and which weight it wants), an
|
|
6
|
+
optional FONT override, and an optional WEIGHT override. All at one specificity, so a block
|
|
7
|
+
written later wins -- base, scale, font, weight.
|
|
8
|
+
|
|
9
|
+
EVERY ATTRIBUTE BELOW IS WRAPPED IN :where(), WHICH CONTRIBUTES NOTHING, SO THE SENTENCE ABOVE
|
|
10
|
+
IS TRUE. It was not until 2026-09-15. `.newtone-text[data-scale='...']` is 0,2,0 and the base
|
|
11
|
+
block is 0,1,0, so the composition worked by specificity where this comment claimed it worked by
|
|
12
|
+
order -- harmless in here, because the order agrees -- and RUINOUS ONE REPOSITORY OVER. A
|
|
13
|
+
consumer varies a Text by writing one class in a sheet that loads after this one, which is
|
|
14
|
+
0,1,0, and a 0,2,0 rule takes that away SILENTLY: a losing declaration is not an error, not dead
|
|
15
|
+
code, and not unmatched. EIGHT RULES ACROSS adenario_website AND newtone_website SET A TYPE
|
|
16
|
+
PROPERTY THAT HAD NEVER RENDERED -- a section heading, an eyebrow, a page head's tracking, an
|
|
17
|
+
ordinal's leading, a run of fine print, and the wordmark in Newtone's own masthead.
|
|
18
|
+
issues/done/101-every-type-rule-this-site-writes-loses-to-an-attribute.md is the count and
|
|
19
|
+
blueprints/newtone/repos/newtone_ui_react-web.md section 5 is the rule. The consumer-facing half
|
|
20
|
+
is contracts/typography.md section 7.1: declare a scale token to retune, write a class to
|
|
21
|
+
override, and never read a scale token from outside.
|
|
22
|
+
|
|
23
|
+
A NEW RULE HERE GOES AT 0,1,0 OR IT IS A DEFECT. Wrap whatever it matches on and let the order
|
|
24
|
+
do the work -- node tools/check-scale-override.mjs <consumer-repo> is what says it did not.
|
|
25
|
+
|
|
26
|
+
THE WEIGHT IS NAMED, NOT NUMBERED, AND THAT IS WHAT MAKES THE THREE COMPOSE. Composing a
|
|
27
|
+
custom property name out of two props is not something CSS can do. So a block publishes the
|
|
28
|
+
four numbers of whichever family it puts into effect, `--_weight` holds the NAME the passage
|
|
29
|
+
wants, and `font-weight` is declared once, in the base, as `var(--_weight)`. Custom properties
|
|
30
|
+
resolve at use time, so the number is always looked up in the family that actually won --
|
|
31
|
+
which is why `<Text scale="heading-md" font="code">` gets code's semibold and not the display
|
|
32
|
+
family's, and why the 600-in-a-font-with-no-600 defect cannot come back through this door. */
|
|
33
|
+
|
|
34
|
+
.newtone-text {
|
|
35
|
+
margin: 0;
|
|
36
|
+
font-family: var(--newtone-text-body-family);
|
|
37
|
+
font-variation-settings: var(--newtone-text-body-variation);
|
|
38
|
+
font-feature-settings: var(--newtone-text-body-feature);
|
|
39
|
+
--_weight-regular: var(--newtone-text-body-weight-regular);
|
|
40
|
+
--_weight-medium: var(--newtone-text-body-weight-medium);
|
|
41
|
+
--_weight-semibold: var(--newtone-text-body-weight-semibold);
|
|
42
|
+
--_weight-bold: var(--newtone-text-body-weight-bold);
|
|
43
|
+
--_weight: var(--_weight-regular);
|
|
44
|
+
font-weight: var(--_weight);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* --- the scale ---------------------------------------------------------------------------
|
|
48
|
+
Six properties and a weight name, every one a text.scale.* token. The four display-font
|
|
49
|
+
scales also republish that family's four numbers, right beside the family line they have to
|
|
50
|
+
agree with -- a grouped selector listing them elsewhere would be a second copy of section
|
|
51
|
+
7.1's `font` column, and a second copy is a thing that drifts. */
|
|
52
|
+
|
|
53
|
+
.newtone-text:where([data-scale='display-lg']) {
|
|
54
|
+
font-family: var(--newtone-text-scale-display-lg-family);
|
|
55
|
+
font-variation-settings: var(--newtone-text-scale-display-lg-variation);
|
|
56
|
+
font-feature-settings: var(--newtone-text-scale-display-lg-feature);
|
|
57
|
+
font-size: var(--newtone-text-scale-display-lg-size);
|
|
58
|
+
line-height: var(--newtone-text-scale-display-lg-line-height);
|
|
59
|
+
letter-spacing: var(--newtone-text-scale-display-lg-tracking);
|
|
60
|
+
--_weight: var(--_weight-bold);
|
|
61
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
62
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
63
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
64
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.newtone-text:where([data-scale='display-md']) {
|
|
68
|
+
font-family: var(--newtone-text-scale-display-md-family);
|
|
69
|
+
font-variation-settings: var(--newtone-text-scale-display-md-variation);
|
|
70
|
+
font-feature-settings: var(--newtone-text-scale-display-md-feature);
|
|
71
|
+
font-size: var(--newtone-text-scale-display-md-size);
|
|
72
|
+
line-height: var(--newtone-text-scale-display-md-line-height);
|
|
73
|
+
letter-spacing: var(--newtone-text-scale-display-md-tracking);
|
|
74
|
+
--_weight: var(--_weight-bold);
|
|
75
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
76
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
77
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
78
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.newtone-text:where([data-scale='heading-lg']) {
|
|
82
|
+
font-family: var(--newtone-text-scale-heading-lg-family);
|
|
83
|
+
font-variation-settings: var(--newtone-text-scale-heading-lg-variation);
|
|
84
|
+
font-feature-settings: var(--newtone-text-scale-heading-lg-feature);
|
|
85
|
+
font-size: var(--newtone-text-scale-heading-lg-size);
|
|
86
|
+
line-height: var(--newtone-text-scale-heading-lg-line-height);
|
|
87
|
+
letter-spacing: var(--newtone-text-scale-heading-lg-tracking);
|
|
88
|
+
--_weight: var(--_weight-semibold);
|
|
89
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
90
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
91
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
92
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.newtone-text:where([data-scale='heading-md']) {
|
|
96
|
+
font-family: var(--newtone-text-scale-heading-md-family);
|
|
97
|
+
font-variation-settings: var(--newtone-text-scale-heading-md-variation);
|
|
98
|
+
font-feature-settings: var(--newtone-text-scale-heading-md-feature);
|
|
99
|
+
font-size: var(--newtone-text-scale-heading-md-size);
|
|
100
|
+
line-height: var(--newtone-text-scale-heading-md-line-height);
|
|
101
|
+
letter-spacing: var(--newtone-text-scale-heading-md-tracking);
|
|
102
|
+
--_weight: var(--_weight-semibold);
|
|
103
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
104
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
105
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
106
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.newtone-text:where([data-scale='heading-sm']) {
|
|
110
|
+
font-family: var(--newtone-text-scale-heading-sm-family);
|
|
111
|
+
font-variation-settings: var(--newtone-text-scale-heading-sm-variation);
|
|
112
|
+
font-feature-settings: var(--newtone-text-scale-heading-sm-feature);
|
|
113
|
+
font-size: var(--newtone-text-scale-heading-sm-size);
|
|
114
|
+
line-height: var(--newtone-text-scale-heading-sm-line-height);
|
|
115
|
+
letter-spacing: var(--newtone-text-scale-heading-sm-tracking);
|
|
116
|
+
--_weight: var(--_weight-semibold);
|
|
117
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
118
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
119
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
120
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.newtone-text:where([data-scale='lead']) {
|
|
124
|
+
font-family: var(--newtone-text-scale-lead-family);
|
|
125
|
+
font-variation-settings: var(--newtone-text-scale-lead-variation);
|
|
126
|
+
font-feature-settings: var(--newtone-text-scale-lead-feature);
|
|
127
|
+
font-size: var(--newtone-text-scale-lead-size);
|
|
128
|
+
line-height: var(--newtone-text-scale-lead-line-height);
|
|
129
|
+
letter-spacing: var(--newtone-text-scale-lead-tracking);
|
|
130
|
+
--_weight: var(--_weight-regular);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.newtone-text:where([data-scale='body']) {
|
|
134
|
+
font-family: var(--newtone-text-scale-body-family);
|
|
135
|
+
font-variation-settings: var(--newtone-text-scale-body-variation);
|
|
136
|
+
font-feature-settings: var(--newtone-text-scale-body-feature);
|
|
137
|
+
font-size: var(--newtone-text-scale-body-size);
|
|
138
|
+
line-height: var(--newtone-text-scale-body-line-height);
|
|
139
|
+
letter-spacing: var(--newtone-text-scale-body-tracking);
|
|
140
|
+
--_weight: var(--_weight-regular);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.newtone-text:where([data-scale='body-sm']) {
|
|
144
|
+
font-family: var(--newtone-text-scale-body-sm-family);
|
|
145
|
+
font-variation-settings: var(--newtone-text-scale-body-sm-variation);
|
|
146
|
+
font-feature-settings: var(--newtone-text-scale-body-sm-feature);
|
|
147
|
+
font-size: var(--newtone-text-scale-body-sm-size);
|
|
148
|
+
line-height: var(--newtone-text-scale-body-sm-line-height);
|
|
149
|
+
letter-spacing: var(--newtone-text-scale-body-sm-tracking);
|
|
150
|
+
--_weight: var(--_weight-regular);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.newtone-text:where([data-scale='caption']) {
|
|
154
|
+
font-family: var(--newtone-text-scale-caption-family);
|
|
155
|
+
font-variation-settings: var(--newtone-text-scale-caption-variation);
|
|
156
|
+
font-feature-settings: var(--newtone-text-scale-caption-feature);
|
|
157
|
+
font-size: var(--newtone-text-scale-caption-size);
|
|
158
|
+
line-height: var(--newtone-text-scale-caption-line-height);
|
|
159
|
+
letter-spacing: var(--newtone-text-scale-caption-tracking);
|
|
160
|
+
--_weight: var(--_weight-regular);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.newtone-text:where([data-scale='eyebrow']) {
|
|
164
|
+
font-family: var(--newtone-text-scale-eyebrow-family);
|
|
165
|
+
font-variation-settings: var(--newtone-text-scale-eyebrow-variation);
|
|
166
|
+
font-feature-settings: var(--newtone-text-scale-eyebrow-feature);
|
|
167
|
+
font-size: var(--newtone-text-scale-eyebrow-size);
|
|
168
|
+
line-height: var(--newtone-text-scale-eyebrow-line-height);
|
|
169
|
+
letter-spacing: var(--newtone-text-scale-eyebrow-tracking);
|
|
170
|
+
--_weight: var(--_weight-semibold);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* --- the font override -------------------------------------------------------------------
|
|
174
|
+
The family and its four numbers, and deliberately NOT `--_weight`: changing which family a
|
|
175
|
+
passage is set in does not change which weight it wanted. `body` needs no block -- it is
|
|
176
|
+
what the base already publishes. */
|
|
177
|
+
|
|
178
|
+
.newtone-text:where([data-font='display']) {
|
|
179
|
+
font-family: var(--newtone-text-display-family);
|
|
180
|
+
font-variation-settings: var(--newtone-text-display-variation);
|
|
181
|
+
font-feature-settings: var(--newtone-text-display-feature);
|
|
182
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
183
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
184
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
185
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.newtone-text:where([data-font='code']) {
|
|
189
|
+
font-family: var(--newtone-text-code-family);
|
|
190
|
+
font-variation-settings: var(--newtone-text-code-variation);
|
|
191
|
+
font-feature-settings: var(--newtone-text-code-feature);
|
|
192
|
+
--_weight-regular: var(--newtone-text-code-weight-regular);
|
|
193
|
+
--_weight-medium: var(--newtone-text-code-weight-medium);
|
|
194
|
+
--_weight-semibold: var(--newtone-text-code-weight-semibold);
|
|
195
|
+
--_weight-bold: var(--newtone-text-code-weight-bold);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* --- the weight override -----------------------------------------------------------------
|
|
199
|
+
The name only. The number comes from whichever family won above. */
|
|
200
|
+
|
|
201
|
+
.newtone-text:where([data-weight='regular']) {
|
|
202
|
+
--_weight: var(--_weight-regular);
|
|
203
|
+
}
|
|
204
|
+
.newtone-text:where([data-weight='medium']) {
|
|
205
|
+
--_weight: var(--_weight-medium);
|
|
206
|
+
}
|
|
207
|
+
.newtone-text:where([data-weight='semibold']) {
|
|
208
|
+
--_weight: var(--_weight-semibold);
|
|
209
|
+
}
|
|
210
|
+
.newtone-text:where([data-weight='bold']) {
|
|
211
|
+
--_weight: var(--_weight-bold);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/* Uppercase at default tracking is unreadable, so this is not decoration. It overrides the
|
|
215
|
+
scale's tracking, which is why it is written after the scale blocks.
|
|
216
|
+
|
|
217
|
+
It was the literal 0.08em until 2026-09-03, on the argument that letter-spacing was blocked in
|
|
218
|
+
tokens on the same decision as radius. It was not: tracking is a ratio, not a length, and it
|
|
219
|
+
never needed a length group. contracts/typography.md section 6.1. The same 0.08 was written by
|
|
220
|
+
hand in joshuaallenmx_website's .eyebrow, which is the pair that moved it. */
|
|
221
|
+
.newtone-text:where([data-case='upper']) {
|
|
222
|
+
text-transform: uppercase;
|
|
223
|
+
letter-spacing: var(--newtone-text-tracking-wide);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* font-feature-settings above names no tag, so it does not outrank these. */
|
|
227
|
+
.newtone-text:where([data-figures='tabular']) {
|
|
228
|
+
font-variant-numeric: tabular-nums;
|
|
229
|
+
}
|
|
230
|
+
.newtone-text:where([data-ligatures='none']) {
|
|
231
|
+
font-variant-ligatures: none;
|
|
232
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The ten names in contracts/typography.md section 7.1. A closed set, counted out of what three
|
|
4
|
+
* sites had already written rather than adapted from the prior art's thirteen: `display-sm`,
|
|
5
|
+
* `heading-xs` and `label` are theirs and nothing here has ever typed them. A name nobody has
|
|
6
|
+
* asked for is a prediction, and giving it a home makes it look like a decision.
|
|
7
|
+
*/
|
|
8
|
+
export type TextScale = 'display-lg' | 'display-md' | 'heading-lg' | 'heading-md' | 'heading-sm' | 'lead' | 'body' | 'body-sm' | 'caption' | 'eyebrow';
|
|
9
|
+
export type TextFont = 'body' | 'display' | 'code';
|
|
10
|
+
export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
11
|
+
export type TextCase = 'normal' | 'upper';
|
|
12
|
+
export type TextFigures = 'normal' | 'tabular';
|
|
13
|
+
export interface TextProps extends HTMLAttributes<HTMLElement> {
|
|
14
|
+
/**
|
|
15
|
+
* Which job this passage does -- the family, weight, size, leading and tracking together.
|
|
16
|
+
* Defaults to `body`, so a bare `<Text>` is a paragraph.
|
|
17
|
+
*
|
|
18
|
+
* Named `scale` and not `role`: a role is already a token layer here, and `<Text role=...>`
|
|
19
|
+
* would read as a facet prop, which no component takes and none ever will. The prior art
|
|
20
|
+
* calls these roles; the word is still taken.
|
|
21
|
+
*/
|
|
22
|
+
scale?: TextScale;
|
|
23
|
+
/**
|
|
24
|
+
* Overrides the scale's family. Emits nothing when omitted, so the scale's own family wins.
|
|
25
|
+
*/
|
|
26
|
+
font?: TextFont;
|
|
27
|
+
/**
|
|
28
|
+
* Overrides the scale's weight -- one of the four the seed defines for whichever font is in
|
|
29
|
+
* effect. Fixed membership; see the contract. Emits nothing when omitted.
|
|
30
|
+
*/
|
|
31
|
+
weight?: TextWeight;
|
|
32
|
+
/** `upper` carries its own tracking, because uppercase at default tracking is unreadable. */
|
|
33
|
+
case?: TextCase;
|
|
34
|
+
/** Tabular figures line up in columns. Silently ignored by a family with no `tnum`. */
|
|
35
|
+
figures?: TextFigures;
|
|
36
|
+
ligatures?: boolean;
|
|
37
|
+
as?: ElementType;
|
|
38
|
+
children?: ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Discharges blueprints/newtone/contracts/typography.md section 7 -- the instance half of
|
|
42
|
+
* the line between what a seed decides and what one passage decides.
|
|
43
|
+
*
|
|
44
|
+
* **A Text may only spend what the seed bought.** The seed decides which families load and
|
|
45
|
+
* how they are configured; this chooses among what that leaves. There is no way to reach a
|
|
46
|
+
* family the seed did not name.
|
|
47
|
+
*
|
|
48
|
+
* **And it cannot conjure a capability the family does not have.** `figures="tabular"` does
|
|
49
|
+
* nothing on a family with no `tnum`, and small caps exist on almost none. That is a no-op
|
|
50
|
+
* rather than an error because the fix is curating the gallery, not complaining to whoever
|
|
51
|
+
* wrote the prop -- and the tokens build prints what each seeded family can and cannot do,
|
|
52
|
+
* so silently is not the same as invisibly.
|
|
53
|
+
*
|
|
54
|
+
* **There is still no `size` prop.** The trigger for one was "the type scale contract lands", and
|
|
55
|
+
* it landed as section 7.1 -- and what came back was a closed set of names, not a size. A size at
|
|
56
|
+
* the call site is the thing the scale exists to prevent.
|
|
57
|
+
*
|
|
58
|
+
* `font` and `weight` are OVERRIDES rather than defaults: they emit an attribute only when passed,
|
|
59
|
+
* so the scale's family and weight are what a passage gets unless a call site says otherwise. The
|
|
60
|
+
* resolution order is source order in text.css -- base, scale, font, weight, all at one
|
|
61
|
+
* specificity -- so a passed prop wins because it is written later.
|
|
62
|
+
*/
|
|
63
|
+
export declare function Text({ scale, font, weight, case: textCase, figures, ligatures, as, className, ...rest }: TextProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
64
|
+
//# sourceMappingURL=text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAE5F;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GACf,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,MAAM,GACN,SAAS,GACT,SAAS,GACT,SAAS,CAAA;AAEf,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,CAAA;AAClD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;AACnE,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAA;AACzC,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAA;AAE9C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC1D;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,UAAU,CAAA;IACnB,6FAA6F;IAC7F,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,uFAAuF;IACvF,OAAO,CAAC,EAAE,WAAW,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,EAAE,CAAC,EAAE,WAAW,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,IAAI,CAAC,EACjB,KAAc,EACd,IAAI,EACJ,MAAM,EACN,IAAI,EAAE,QAAmB,EACzB,OAAkB,EAClB,SAAgB,EAChB,EAAQ,EACR,SAAS,EACT,GAAG,IAAI,EACV,EAAE,SAAS,0FAWX"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Discharges blueprints/newtone/contracts/typography.md section 7 -- the instance half of
|
|
4
|
+
* the line between what a seed decides and what one passage decides.
|
|
5
|
+
*
|
|
6
|
+
* **A Text may only spend what the seed bought.** The seed decides which families load and
|
|
7
|
+
* how they are configured; this chooses among what that leaves. There is no way to reach a
|
|
8
|
+
* family the seed did not name.
|
|
9
|
+
*
|
|
10
|
+
* **And it cannot conjure a capability the family does not have.** `figures="tabular"` does
|
|
11
|
+
* nothing on a family with no `tnum`, and small caps exist on almost none. That is a no-op
|
|
12
|
+
* rather than an error because the fix is curating the gallery, not complaining to whoever
|
|
13
|
+
* wrote the prop -- and the tokens build prints what each seeded family can and cannot do,
|
|
14
|
+
* so silently is not the same as invisibly.
|
|
15
|
+
*
|
|
16
|
+
* **There is still no `size` prop.** The trigger for one was "the type scale contract lands", and
|
|
17
|
+
* it landed as section 7.1 -- and what came back was a closed set of names, not a size. A size at
|
|
18
|
+
* the call site is the thing the scale exists to prevent.
|
|
19
|
+
*
|
|
20
|
+
* `font` and `weight` are OVERRIDES rather than defaults: they emit an attribute only when passed,
|
|
21
|
+
* so the scale's family and weight are what a passage gets unless a call site says otherwise. The
|
|
22
|
+
* resolution order is source order in text.css -- base, scale, font, weight, all at one
|
|
23
|
+
* specificity -- so a passed prop wins because it is written later.
|
|
24
|
+
*/
|
|
25
|
+
export function Text({ scale = 'body', font, weight, case: textCase = 'normal', figures = 'normal', ligatures = true, as = 'p', className, ...rest }) {
|
|
26
|
+
return createElement(as, {
|
|
27
|
+
className: ['newtone-text', className].filter(Boolean).join(' '),
|
|
28
|
+
'data-scale': scale,
|
|
29
|
+
'data-font': font,
|
|
30
|
+
'data-weight': weight,
|
|
31
|
+
'data-case': textCase === 'normal' ? undefined : textCase,
|
|
32
|
+
'data-figures': figures === 'normal' ? undefined : figures,
|
|
33
|
+
'data-ligatures': ligatures ? undefined : 'none',
|
|
34
|
+
...rest,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAA;AAqD5F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,IAAI,CAAC,EACjB,KAAK,GAAG,MAAM,EACd,IAAI,EACJ,MAAM,EACN,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,OAAO,GAAG,QAAQ,EAClB,SAAS,GAAG,IAAI,EAChB,EAAE,GAAG,GAAG,EACR,SAAS,EACT,GAAG,IAAI,EACC;IACR,OAAO,aAAa,CAAC,EAAE,EAAE;QACrB,SAAS,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAChE,YAAY,EAAE,KAAK;QACnB,WAAW,EAAE,IAAI;QACjB,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ;QACzD,cAAc,EAAE,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;QAC1D,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;QAChD,GAAG,IAAI;KACV,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/video-lightbox/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/video-lightbox/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA"}
|