@newtone-dev/ui-react-web 0.2.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -14
- package/dist/action/action.css +64 -5
- package/dist/action/action.d.ts +22 -1
- package/dist/action/action.d.ts.map +1 -1
- package/dist/action/action.js +16 -2
- package/dist/action/action.js.map +1 -1
- package/dist/button/button.css +81 -5
- package/dist/button/button.d.ts +24 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js +12 -2
- package/dist/button/button.js.map +1 -1
- package/dist/control/control.css +49 -23
- package/dist/control/control.d.ts +33 -9
- package/dist/control/control.d.ts.map +1 -1
- package/dist/control/control.js +31 -17
- package/dist/control/control.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/navbar/link/drawer/drawer.css +4 -3
- package/dist/navbar/link/link.css +15 -3
- package/dist/navbar/menu-button/menu-button.css +10 -3
- package/dist/navbar/navbar.css +186 -4
- package/dist/navbar/navbar.d.ts +33 -1
- package/dist/navbar/navbar.d.ts.map +1 -1
- package/dist/navbar/navbar.js +4 -2
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/page/band.d.ts +52 -0
- package/dist/page/band.d.ts.map +1 -0
- package/dist/page/band.js +36 -0
- package/dist/page/band.js.map +1 -0
- package/dist/page/index.d.ts +4 -0
- package/dist/page/index.d.ts.map +1 -0
- package/dist/page/index.js +8 -0
- package/dist/page/index.js.map +1 -0
- package/dist/page/page.css +240 -0
- package/dist/page/page.d.ts +137 -0
- package/dist/page/page.d.ts.map +1 -0
- package/dist/page/page.js +29 -0
- package/dist/page/page.js.map +1 -0
- package/dist/quick-action/quick-action.css +36 -7
- package/dist/quick-action/quick-action.d.ts +26 -6
- package/dist/quick-action/quick-action.d.ts.map +1 -1
- package/dist/quick-action/quick-action.js +11 -7
- package/dist/quick-action/quick-action.js.map +1 -1
- package/dist/wrapper/wrapper.d.ts +11 -2
- package/dist/wrapper/wrapper.d.ts.map +1 -1
- package/dist/wrapper/wrapper.js +5 -1
- package/dist/wrapper/wrapper.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// The subpaths, not the barrel, for the reason page.tsx gives: this renders inside server
|
|
3
|
+
// components and must not reach anything that calls a hook. See the repo blueprint, section 4.3.
|
|
4
|
+
import { Surface } from '../surface/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* A full-bleed section with a capped track inside it.
|
|
7
|
+
*
|
|
8
|
+
* **A page's content goes in bands, and `<main>` holds no track of its own.** Until 2026-09-21 it
|
|
9
|
+
* did -- one capped, gutter-paid box, with every block of the page inside it. That is the right
|
|
10
|
+
* shape for a page that is a column of prose and it makes an edge-to-edge section *impossible*: a
|
|
11
|
+
* section that changes ground has to BE the full-width box, and nothing can be a box it is inside
|
|
12
|
+
* of. Joshua, 2026-09-21: *"she should have clear edge to edge sections."*
|
|
13
|
+
*
|
|
14
|
+
* **The negative-margin escape was not taken.** `margin-inline: calc(-1 * <gutter>)` with `100vw`
|
|
15
|
+
* lets a child break out of a container, and `100vw` includes the scrollbar on the platforms that
|
|
16
|
+
* reserve space for one -- so the page gains a few pixels of sideways scroll on Windows and none on
|
|
17
|
+
* a Mac. A shape that is correct on the machine it was written on is the worst kind of wrong.
|
|
18
|
+
*
|
|
19
|
+
* **Two elements, and deliberately nothing else.** No `.section`, no divider between bands, no
|
|
20
|
+
* variant, no named arrangement. A band that changes ground IS the separator; two that do not are
|
|
21
|
+
* two paragraphs. `adenario_website` carries the other answer and its own stylesheet records that
|
|
22
|
+
* rule being written, suppressed, deleted and partly restored over two days --
|
|
23
|
+
* governance/code/one-page-shows-two-dividers-and-names-where-each-one-comes-from.md is parked on
|
|
24
|
+
* exactly that question.
|
|
25
|
+
*
|
|
26
|
+
* **The cap arrives as a custom property and not as a prop**, because a band is a child the
|
|
27
|
+
* CONSUMER renders: `Page` cannot pass it anything. The two alternatives are both worse and both
|
|
28
|
+
* named in components/page.md -- a React context makes every band a client component, and a prop
|
|
29
|
+
* per band is one number written once per section.
|
|
30
|
+
*
|
|
31
|
+
* Discharges blueprints/newtone/repos/newtone_ui_react-web/components/page.md, *The band*.
|
|
32
|
+
*/
|
|
33
|
+
export function PageBand({ as: As = 'section', theme, mode, elevation, className, children, ...rest }) {
|
|
34
|
+
return (_jsx(Surface, { as: As, theme: theme, mode: mode, elevation: elevation, className: ['newtone-page-band', className].filter(Boolean).join(' '), ...rest, children: _jsx("div", { className: "newtone-page-track", children: children }) }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=band.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"band.js","sourceRoot":"","sources":["../../src/page/band.tsx"],"names":[],"mappings":";AAAA,0FAA0F;AAC1F,iGAAiG;AACjG,OAAO,EAAE,OAAO,EAAyC,MAAM,qBAAqB,CAAA;AAwBpF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,QAAQ,CAAC,EACrB,EAAE,EAAE,EAAE,GAAG,SAAS,EAClB,KAAK,EACL,IAAI,EACJ,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACK;IACZ,OAAO,CACH,KAAC,OAAO,IACJ,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KACjE,IAAI,YAER,cAAK,SAAS,EAAC,oBAAoB,YAAE,QAAQ,GAAO,GAC9C,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// The door. `Page`, and the band's prop type -- but not the band.
|
|
2
|
+
//
|
|
3
|
+
// The band is reachable only as `Page.Band`, for the reason navbar/index.ts gives about its own
|
|
4
|
+
// parts: a band outside a page is not a thing. It reads `--newtone-page-max-inline-size` and
|
|
5
|
+
// `--newtone-page-gutter`, both declared on `.newtone-page`, and outside one it resolves neither.
|
|
6
|
+
// The dotted name says that at the call site.
|
|
7
|
+
export { Page } from './page.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/page/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,8CAA8C;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/* The page's own rules: two grounds, two hairlines drawn two ways, and one band that paints past
|
|
2
|
+
its own box.
|
|
3
|
+
*
|
|
4
|
+
* Every colour here is a `page.*` token. Nothing names a role, a facet or another component's group
|
|
5
|
+
* -- blueprints/newtone/repos/newtone_ui_react-web.md section 5. The bar's colour is the bar's, which
|
|
6
|
+
* is why the strip above the bar is painted in navbar.css and not here.
|
|
7
|
+
*
|
|
8
|
+
* One literal: `1px`, for the hairline the gap leaves. Border WIDTH has no core scale to point at --
|
|
9
|
+
* the same block that refuses a radius scale refuses this -- and `1px` is written 26 times across
|
|
10
|
+
* five repos with nothing disagreeing. navbar.css argues it in place for the bar's border; this is
|
|
11
|
+
* the same number for the same reason one band lower. What IS a token is its colour.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/* ---- the page -----------------------------------------------------------
|
|
15
|
+
*
|
|
16
|
+
* TWO ROWS, `auto 1fr`, AND THAT IS WHAT MEASURES THE BAR. The body below has to fill what the bar
|
|
17
|
+
* leaves so that a short page still puts its footer on the bottom of the window. The arithmetic way
|
|
18
|
+
* to do that is `calc(100dvh - var(--newtone-navbar-min-block-size) - 1px)`, and it is wrong twice:
|
|
19
|
+
* it reads another component's token group, and it is a second copy of a height the bar already
|
|
20
|
+
* knows -- governance/documents/staleness/a-second-copy-is-a-thing-that-drifts.md. A grid row does
|
|
21
|
+
* the same arithmetic and cannot fall out of step with the thing it measures.
|
|
22
|
+
*
|
|
23
|
+
* `100dvh` AND NOT `100vh`: on a phone the address bar is part of the viewport `vh` reports and is
|
|
24
|
+
* not part of what the reader can see, so a `vh` page hangs its footer just below the fold and a
|
|
25
|
+
* reader who scrolls to the end finds the hairline moving.
|
|
26
|
+
*
|
|
27
|
+
* THE GROUND IS PAINTED HERE EVEN THOUGH THE BODY COVERS IT. A page with no navbar and no footer is
|
|
28
|
+
* one grid row of body, and a page rendered before its own stylesheet has loaded is neither -- what
|
|
29
|
+
* this rule buys is that `.newtone-page` is never a hole, which is the same fact card-box.css states
|
|
30
|
+
* about a `Surface` deciding a colour and not applying one. */
|
|
31
|
+
.newtone-page {
|
|
32
|
+
display: grid;
|
|
33
|
+
grid-template-rows: auto 1fr;
|
|
34
|
+
min-block-size: 100dvh;
|
|
35
|
+
background: var(--newtone-page-ground);
|
|
36
|
+
|
|
37
|
+
/* ---- the gutter, and the tighter one a phone gets ---------------------
|
|
38
|
+
*
|
|
39
|
+
* 64 / 32 / 16, which is the ladder four consuming sites had each written for themselves.
|
|
40
|
+
* Joshua, 2026-09-21: *"The page padding on websites should be 64 on desktop, 32px on tablet and
|
|
41
|
+
* 16px on mobile."* blueprints/newtone/repos/newtone_ui_react-web/components/page.md, *The
|
|
42
|
+
* gutter*.
|
|
43
|
+
*
|
|
44
|
+
* IT IS CSS AND NOT A TOKEN, AND THAT IS FORCED. A media query condition cannot read a custom
|
|
45
|
+
* property, so a responsive length cannot live in the token layer -- the same reason
|
|
46
|
+
* `breakpoint` is a group whose consumers cannot read it. The two widths below are typed out
|
|
47
|
+
* exactly as they are in navbar.css and in five site stylesheets, and
|
|
48
|
+
* `node tools/check-breakpoints.mjs` from ~/source is what keeps the copies honest.
|
|
49
|
+
*
|
|
50
|
+
* THE TIGHT ONE IS AN ALIAS AND THAT IS THE MECHANISM. It holds the TOKEN rather than the value,
|
|
51
|
+
* substituted where it is used, so above a phone the two are the same length BY CONSTRUCTION --
|
|
52
|
+
* not by two expressions agreeing to the pixel through a ramp. The difference can only ever be
|
|
53
|
+
* non-zero in the one band somebody chose. */
|
|
54
|
+
--newtone-page-gutter: var(--newtone-space-16);
|
|
55
|
+
--newtone-page-gutter-tight: var(--newtone-page-gutter);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (max-width: 80rem) {
|
|
59
|
+
.newtone-page {
|
|
60
|
+
--newtone-page-gutter: var(--newtone-space-8);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media (max-width: 48rem) {
|
|
65
|
+
.newtone-page {
|
|
66
|
+
--newtone-page-gutter: var(--newtone-space-4);
|
|
67
|
+
--newtone-page-gutter-tight: var(--newtone-space-2);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* THE DIFFERENCE BETWEEN THE TWO GUTTERS, AS ONE NEGATIVE MARGIN. On a desktop the two are the same
|
|
72
|
+
* number and this is exactly `0`; on a phone it is `-8`, so a row of cards sits 8px off the glass
|
|
73
|
+
* while the paragraph above it keeps its 16. Measured on the reference this was read from: 16px of
|
|
74
|
+
* card width returned on a 390px phone, nothing changed at any other width.
|
|
75
|
+
*
|
|
76
|
+
* ONE DECLARATION, WHERE THE REFERENCE USES TWO. `CardContainer` cancels the page gutter with a
|
|
77
|
+
* negative margin and re-pays the card gutter as padding. The difference between the two spellings
|
|
78
|
+
* is invisible on a transparent row and matters for exactly one shape this house does not have: a
|
|
79
|
+
* horizontal scroller, where the SCROLL AREA has to reach the glass while its first card stays lined
|
|
80
|
+
* up with the heading above it. Two declarations are what buys that, and they cost something here --
|
|
81
|
+
* `padding-inline` collides with any element that has padding of its own, which an image slot and a
|
|
82
|
+
* card both do. **A `figure` whose sheet wrote `margin: 0` swallowed the margin half of the
|
|
83
|
+
* two-declaration form outright**, because a shorthand in a later sheet beats a longhand in an
|
|
84
|
+
* earlier one -- the same defect `joshuaallenmx_website`'s journal entries had at 420px. One margin
|
|
85
|
+
* has neither problem. **Trigger for the other spelling: this library ships a horizontal scroller.**
|
|
86
|
+
*
|
|
87
|
+
* IT IS NOT A BLEED AND IS NOT CALLED ONE. knowledge/shared/the-width-ladder.md defines a bleed as
|
|
88
|
+
* the ABSENCE of a container -- it pays no gutter and touches the glass. This pays a gutter.
|
|
89
|
+
*
|
|
90
|
+
* ON THE CONTAINER, NEVER ON THE CARD. A row takes it and the cards inside keep their own boxes; on
|
|
91
|
+
* a `CardBox` it would move that card's border and leave its neighbour's where it was. */
|
|
92
|
+
.newtone-page-tight {
|
|
93
|
+
margin-inline: calc(var(--newtone-page-gutter-tight) - var(--newtone-page-gutter));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* ---- the body, which is the second hairline -----------------------------
|
|
97
|
+
*
|
|
98
|
+
* THE GROUND OF THIS ELEMENT IS THE DIVIDER AND ITS TWO CHILDREN PAINT OVER IT. The only divider
|
|
99
|
+
* anybody ever sees is the 1px the gap leaves uncovered.
|
|
100
|
+
*
|
|
101
|
+
* WHY A GAP RATHER THAN A BORDER, which is the whole design and is argued in
|
|
102
|
+
* governance/code/one-page-shows-two-dividers-and-names-where-each-one-comes-from.md: a border has an
|
|
103
|
+
* owner, and an owner is something the neighbour who also drew one can duplicate. This line belongs
|
|
104
|
+
* to neither band. It also survives the two bands being different colours, which they are whenever
|
|
105
|
+
* the footer takes `deep`.
|
|
106
|
+
*
|
|
107
|
+
* `1fr auto` PUTS THE FOOTER ON THE BOTTOM OF A SHORT PAGE. With one child -- no footer -- the gap
|
|
108
|
+
* draws nothing and the row list has nothing to place, so a site with no footer gets no second
|
|
109
|
+
* hairline by construction rather than by a modifier class. */
|
|
110
|
+
.newtone-page-body {
|
|
111
|
+
display: grid;
|
|
112
|
+
grid-template-rows: 1fr auto;
|
|
113
|
+
gap: 1px;
|
|
114
|
+
background: var(--newtone-page-divider);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* `min-inline-size: 0` IS NOT DECORATION. A grid item's automatic minimum size is its content, so a
|
|
118
|
+
wide child -- a table, a code block, a long unbroken string -- makes this row wider than the page
|
|
119
|
+
and the whole document scrolls sideways. It is the one thing a shell owes a page whose contents it
|
|
120
|
+
cannot see. */
|
|
121
|
+
.newtone-page-main {
|
|
122
|
+
min-inline-size: 0;
|
|
123
|
+
background: var(--newtone-page-ground);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ---- the footer, and the paint below it ---------------------------------
|
|
127
|
+
*
|
|
128
|
+
* THE GROUND IS THE SAME TOKEN AS THE MAIN REGION'S AND RESOLVES TO A DIFFERENT COLOUR. This element
|
|
129
|
+
* is a `Surface`, so `--newtone-page-ground` resolves at ITS elevation: the page's rung when the
|
|
130
|
+
* caller passed no `footerElevation`, one below when they passed `deep`. There is no second token,
|
|
131
|
+
* because a `page.footer-ground` would be a name for a value the cascade already computes and the
|
|
132
|
+
* two would agree at `base` and diverge nowhere a test looks.
|
|
133
|
+
*
|
|
134
|
+
* THE BOX-SHADOW IS PAINT AND NOT DEPTH, and the distinction is
|
|
135
|
+
* governance/code/an-elevation-that-is-a-colour-has-no-shadow-to-lend.md: no blur, no offset standing
|
|
136
|
+
* in for altitude, no literal colour. It is a fill doing a background's job past a background's
|
|
137
|
+
* boundary, and it is what lets a reader pull the page past its own bottom edge without revealing
|
|
138
|
+
* the canvas -- which is one colour for a page that has two grounds.
|
|
139
|
+
* governance/code/a-band-that-meets-an-over-scroll-edge-paints-past-its-own-box.md.
|
|
140
|
+
*
|
|
141
|
+
* THE OFFSET AND THE SPREAD ARE THE SAME NUMBER, AND THAT IS THE WHOLE TRICK. A shadow rect is
|
|
142
|
+
* [top + offset - spread, bottom + offset + spread]; with offset = spread its top edge lands exactly
|
|
143
|
+
* on this element's top edge, so the paint reaches from the footer's bottom edge downward and NEVER
|
|
144
|
+
* one pixel above it. One pixel above it is the hairline, and a shadow that covered it would delete
|
|
145
|
+
* the line this component exists to draw. An outer shadow is clipped to outside the border box, so
|
|
146
|
+
* the part behind the footer itself costs nothing.
|
|
147
|
+
*
|
|
148
|
+
* AND IT IS A SHADOW RATHER THAN A PSEUDO-ELEMENT, which is the bar's spelling one band lower and
|
|
149
|
+
* does not work here. Overflow ABOVE the origin is not scrollable and overflow BELOW the bottom is:
|
|
150
|
+
* a `::after` at `inset-block-start: 100%` adds a screenful of scrollable height to the document, a
|
|
151
|
+
* reader can scroll into empty paint, and every `100dvh` on the page still looks right. A shadow
|
|
152
|
+
* affects no layout at all. `node tools/check-page-paint.mjs <url>` is that measurement. */
|
|
153
|
+
.newtone-page-footer {
|
|
154
|
+
min-inline-size: 0;
|
|
155
|
+
background: var(--newtone-page-ground);
|
|
156
|
+
box-shadow: 0 100vh 0 100vh var(--newtone-page-ground);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* ---- the track ----------------------------------------------------------
|
|
160
|
+
*
|
|
161
|
+
* THE CAP IS HERE AND NEVER ON A BAND. The grounds and both hairlines run edge to edge; only what is
|
|
162
|
+
* read stops. A hairline that ends 400px short of the screen edge on a wide display is the mistake
|
|
163
|
+
* knowledge/shared/the-width-ladder.md already describes for a bar whose colour does.
|
|
164
|
+
*
|
|
165
|
+
* `max-inline-size` READS A CUSTOM PROPERTY FROM 2026-09-21 LATE, where it was an inline style on
|
|
166
|
+
* the one track the component rendered. `Page` declares `--newtone-page-max-inline-size` on
|
|
167
|
+
* `.newtone-page` only when a caller passed a cap, and the `none` below is what an uncapped page
|
|
168
|
+
* resolves -- so an uncapped track computes exactly the box it computed before the prop existed.
|
|
169
|
+
*
|
|
170
|
+
* IT HAD TO MOVE BECAUSE A BAND'S TRACK IS A CHILD THE CONSUMER RENDERS. `Page.Band` is written at
|
|
171
|
+
* the call site, so `Page` cannot hand it an inline style. The two alternatives are both worse: a
|
|
172
|
+
* React context makes every band a CLIENT COMPONENT, and a prop per band is one number typed once
|
|
173
|
+
* per section. components/page.md, *The cap is a custom property now*.
|
|
174
|
+
*
|
|
175
|
+
* THE CONSUMER STILL DECLARES NO NEWTONE PROPERTY, which is the half of issue 201's rule that binds.
|
|
176
|
+
* A site passes `maxInlineSize`; the library does the declaring, the same way it declares the gutter
|
|
177
|
+
* two rules up.
|
|
178
|
+
*
|
|
179
|
+
* The bar's cap is not this one, by decision -- *"they should not be linked together"*.
|
|
180
|
+
*
|
|
181
|
+
* THE PADDING IS THE PAGE'S GUTTER, SINCE 2026-09-21 LATE. It was absent that morning, on the ground
|
|
182
|
+
* that four sites agreed about the ladder and a fifth did not, so what was missing was a reading
|
|
183
|
+
* rather than a component -- and the reading arrived as a decision instead. The declaration this
|
|
184
|
+
* replaces was `padding={{ inline: 6 }}` at one site's call site and `.page { padding-inline }` at
|
|
185
|
+
* another's: one number, spent in five places, now spent here once.
|
|
186
|
+
*
|
|
187
|
+
* `box-sizing` IS DECLARED AND IS NOT THE CONSUMER'S TO PROVIDE, which is navbar.css's argument in
|
|
188
|
+
* the one other place this library promises a measurement: a cap of 110rem that silently became 110rem
|
|
189
|
+
* PLUS two gutters would be the component resting its arithmetic on a reset it cannot see. Four of
|
|
190
|
+
* the six consuming sites carry one; the consumer this breaks for is the one nobody has written. */
|
|
191
|
+
.newtone-page-track {
|
|
192
|
+
box-sizing: border-box;
|
|
193
|
+
margin-inline: auto;
|
|
194
|
+
inline-size: 100%;
|
|
195
|
+
max-inline-size: var(--newtone-page-max-inline-size, none);
|
|
196
|
+
padding-inline: var(--newtone-page-gutter);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* ---- the band -----------------------------------------------------------
|
|
200
|
+
*
|
|
201
|
+
* A SECTION THAT REACHES BOTH SCREEN EDGES, WITH THE CAPPED TRACK INSIDE IT. Added 2026-09-21 late
|
|
202
|
+
* -- components/page.md, *The band*. Joshua: *"she should have clear edge to edge sections."*
|
|
203
|
+
*
|
|
204
|
+
* WHY THIS ELEMENT DECLARES ALMOST NOTHING. It is a `Surface`, so its ground, its text colours and
|
|
205
|
+
* everything under it come from the facets the caller forwarded; what it adds is the one thing a
|
|
206
|
+
* Surface has no opinion about, which is that it fills its parent's inline axis and clips nothing.
|
|
207
|
+
* `<main>` is a grid item and this is an ordinary block inside it, so full width is what it already
|
|
208
|
+
* gets -- the rule below exists for `min-inline-size`, not for the width.
|
|
209
|
+
*
|
|
210
|
+
* `min-inline-size: 0` FOR THE SAME REASON `.newtone-page-main` HAS IT, one level down: a band holds
|
|
211
|
+
* whatever a page hands it, and a wide unbreakable child would otherwise push the band past the page
|
|
212
|
+
* and scroll the document sideways. The main region's own copy does not cover this, because that
|
|
213
|
+
* rule protects the grid ROW and this one protects the band's own box.
|
|
214
|
+
*
|
|
215
|
+
* IT PAINTS `--newtone-page-ground` AND IT HAS TO, BECAUSE A SURFACE DECIDES A COLOUR AND DOES NOT
|
|
216
|
+
* APPLY ONE. The facets re-point every role token under this element; painting is the element's own
|
|
217
|
+
* job.
|
|
218
|
+
*
|
|
219
|
+
* THIS RULE SHIPPED WITHOUT THE DECLARATION FOR EXACTLY ONE MEASUREMENT, and the comment that stood
|
|
220
|
+
* here argued for its absence -- that painting would *"make every band opaque at the page's rung and
|
|
221
|
+
* silently break the nested-Surface resolution that `footerElevation` is built on"*. THAT IS BACKWARDS.
|
|
222
|
+
* `--newtone-page-ground` read inside a Surface resolves at THAT Surface's facets, which is the very
|
|
223
|
+
* mechanism `footerElevation` runs on: the footer paints this same token and comes back one rung
|
|
224
|
+
* below. A band with no facets paints the page's own colour and is invisible as a band, which is what
|
|
225
|
+
* a page of one band wants.
|
|
226
|
+
*
|
|
227
|
+
* THE SYMPTOM WAS THE COMPONENT FAILING SILENTLY. A band at `theme="tinted"` carried the attribute,
|
|
228
|
+
* resolved the tinted palette for its text, and computed `backgroundColor: rgba(0, 0, 0, 0)` -- an
|
|
229
|
+
* edge-to-edge section that cannot change ground, which is the only thing it exists to do. Found in a
|
|
230
|
+
* screenshot; every geometric assertion about that band had passed.
|
|
231
|
+
* governance/evidence/a-picture-is-taken-when-the-question-is-not-a-number.md.
|
|
232
|
+
*
|
|
233
|
+
* AND THERE IS NO DIVIDER RULE. A band that changes ground IS the separator; two bands that do not
|
|
234
|
+
* are two paragraphs. governance/code/one-page-shows-two-dividers-and-names-where-each-one-comes-from.md
|
|
235
|
+
* is parked on the question, and a page of five bands still resolves the divider colour on exactly
|
|
236
|
+
* two elements -- which is the check in components/page.md, unchanged by any of this. */
|
|
237
|
+
.newtone-page-band {
|
|
238
|
+
min-inline-size: 0;
|
|
239
|
+
background: var(--newtone-page-ground);
|
|
240
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { type Elevation, type Mode, type Theme } from '../surface/index.js';
|
|
2
|
+
import { PageBand } from './band.js';
|
|
3
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
4
|
+
/**
|
|
5
|
+
* The shell a route renders inside: a sticky bar, a body, and a footer.
|
|
6
|
+
*
|
|
7
|
+
* **It is the first component in this library that is an ARRANGEMENT rather than a part**, and the
|
|
8
|
+
* line that permits it is governance/code/a-consumer-assembles-its-own-arrangements-and-the-library-ships-knobs.md:
|
|
9
|
+
* a name like *the document bar* is a fact about one site's content, and a bar, a body and a footer
|
|
10
|
+
* is a fact about pages. That clause was parked on 2026-09-21 refusing navbar variants and promoted
|
|
11
|
+
* the same day by this component, because its own second trigger -- an arrangement more than one
|
|
12
|
+
* consumer wants -- fired with five.
|
|
13
|
+
*
|
|
14
|
+
* **It exists because §8's page-shell row fired.** That row refused a shell on 2026-09-03 with the
|
|
15
|
+
* count as the reason: the reference's `Page` is 75 KB over six files with eight slots and two call
|
|
16
|
+
* sites, and TWO OF ITS SLOTS WERE NEVER PASSED BY ANYTHING. Those two were `header` and `footer`.
|
|
17
|
+
* **They are the two this ships**, and nothing else came with them.
|
|
18
|
+
*
|
|
19
|
+
* ---- the two hairlines, which are two mechanisms ------------------------
|
|
20
|
+
*
|
|
21
|
+
* Joshua, 2026-09-21: *"a page should only have two visible gaps, using the divider color from the
|
|
22
|
+
* tokens, which is below the navbar and above the footer."*
|
|
23
|
+
*
|
|
24
|
+
* **The bar's is a border and the footer's cannot be.** A sticky bar leaves any line the layout drew
|
|
25
|
+
* between it and what follows, so the bar carries its own bottom border and always has. The footer's
|
|
26
|
+
* line is the **1px gap** in `.newtone-page-body`, whose ground is the divider colour and whose two
|
|
27
|
+
* children each paint over it -- so the line belongs to neither band, and neither has to know it has
|
|
28
|
+
* a neighbour. A rule with an owner is a rule a neighbour can duplicate, which is how the site this
|
|
29
|
+
* was read off ended up drawing three.
|
|
30
|
+
*
|
|
31
|
+
* ---- same rung, or one below -------------------------------------------
|
|
32
|
+
*
|
|
33
|
+
* **`footerElevation` omitted is *same rung*; `"deep"` is *one below*.** The footer is a nested
|
|
34
|
+
* `Surface`, so with no attribute it resolves whatever the page resolves, and `--newtone-page-ground`
|
|
35
|
+
* read inside it comes back as that rung's ground. **Nothing here compares the two**, and nothing
|
|
36
|
+
* here defaults either: blueprints/newtone/repos/newtone_ui_react-web.md section 5's first row counts
|
|
37
|
+
* a default as a READ, and a component that read a facet would have learned that `deep` exists.
|
|
38
|
+
*
|
|
39
|
+
* **The four facet props are declared literally rather than inherited through `Pick<SurfaceProps>`,
|
|
40
|
+
* and that is the invariant's own maintenance rather than a style.** The row is checked by a grep for
|
|
41
|
+
* `theme|mode|elevation` declarations in this repo's components; an inherited type forwards the same
|
|
42
|
+
* props and writes none of those lines, so the count would stay at four while a fifth component
|
|
43
|
+
* forwarded facets -- a check that has quietly stopped measuring.
|
|
44
|
+
*
|
|
45
|
+
* ---- the cap is on the track and never on a band -----------------------
|
|
46
|
+
*
|
|
47
|
+
* The grounds run edge to edge and only `.newtone-page-track` stops. **A hairline that stops 400px
|
|
48
|
+
* short of the screen edge on a wide display is the same mistake as a bar whose colour does**, which
|
|
49
|
+
* knowledge/shared/the-width-ladder.md argues one band higher, and it is the split `Navbar` took the
|
|
50
|
+
* day before this.
|
|
51
|
+
*
|
|
52
|
+
* **`maxInlineSize` is a string and the ladder is not in this library.** §8's container half is *real
|
|
53
|
+
* and is not Newtone's*: the width ladder is written twice, in two site blueprints, deliberately. A
|
|
54
|
+
* `WidthStep` union here would be the third writer nobody has argued for. Four sites pass `110rem`,
|
|
55
|
+
* which is `3xl`, and each of them owns that decision.
|
|
56
|
+
*
|
|
57
|
+
* **The bar's cap is NOT this one.** `Navbar` has its own, deliberately unlinked on 2026-09-20 --
|
|
58
|
+
* *"they should not be linked together"* -- so a page capped at 110rem may carry a bar whose row
|
|
59
|
+
* stops at 48rem, and on a wide display you can see that it does. That is the arrangement, not a
|
|
60
|
+
* defect.
|
|
61
|
+
*
|
|
62
|
+
* ---- <main> has no track, and `Page.Band` is why ------------------------
|
|
63
|
+
*
|
|
64
|
+
* **2026-09-21 late. Joshua:** *"she should have clear edge to edge sections."*
|
|
65
|
+
*
|
|
66
|
+
* This wrapped `children` in one `.newtone-page-track` until that evening. Every block of the page
|
|
67
|
+
* sat inside the cap and inside the gutter, which is exactly right for a column of prose and makes
|
|
68
|
+
* an edge-to-edge section IMPOSSIBLE -- a section that changes ground has to BE the full-width box.
|
|
69
|
+
* **So the track moved out of `<main>` and into `Page.Band`**, and `<main>` holds bands.
|
|
70
|
+
*
|
|
71
|
+
* **The footer kept its track and the asymmetry is the point.** A footer is one band by definition
|
|
72
|
+
* and nothing has ever wanted two, so a `Page.Band` in that slot would be ceremony around a box that
|
|
73
|
+
* can only ever be one. `<main>` is the element that holds many.
|
|
74
|
+
*
|
|
75
|
+
* ---- the cap is a custom property, and the consumer still writes none ---
|
|
76
|
+
*
|
|
77
|
+
* `--newtone-page-max-inline-size`, written inline on the root from `maxInlineSize`, read by every
|
|
78
|
+
* `.newtone-page-track` on the page. **It changed shape because a band's track is not a child this
|
|
79
|
+
* component renders** -- the consumer writes `<Page.Band>`, so the value cannot arrive as a prop
|
|
80
|
+
* without being typed once per section, and it cannot arrive through context without `Band` calling
|
|
81
|
+
* `useContext` and **becoming a client component**, which is the thing the import line at the top of
|
|
82
|
+
* this file exists to avoid.
|
|
83
|
+
*
|
|
84
|
+
* **This does not break issue 201's rule.** *A consumer may declare no Newtone property* binds the
|
|
85
|
+
* CONSUMER: a site passes a prop and writes nothing. A library declaring its own property on its own
|
|
86
|
+
* root is what `--newtone-page-gutter` below already is; the only new thing is that this one's value
|
|
87
|
+
* arrived from a prop instead of from a media query.
|
|
88
|
+
*
|
|
89
|
+
* ---- what it refuses ----------------------------------------------------
|
|
90
|
+
*
|
|
91
|
+
* a divider -> between two bands. A band that changes ground IS the separator; two that do
|
|
92
|
+
* not are two paragraphs. governance/code/one-page-shows-two-dividers-and-names-where-each-one-comes-from.md
|
|
93
|
+
* a fold -> §8, refused 2026-09-21 with the sitting that asked for one. Two sites have a
|
|
94
|
+
* first screenful and they share a height and nothing else
|
|
95
|
+
* a variant -> the same refusal Navbar made on 2026-09-21, for the same reason: a component
|
|
96
|
+
* cannot see the widths it would be arranging
|
|
97
|
+
* a header prop -> `navbar` takes any node. This does not require a `Navbar`, and `atril_web`'s
|
|
98
|
+
* document bar is why that is worth saying
|
|
99
|
+
*
|
|
100
|
+
* **The gutter is NOT on this list any more.** It was, with §8's four-sites-and-a-clamp argument,
|
|
101
|
+
* until it shipped later on 2026-09-21 -- `--newtone-page-gutter`, 64 / 32 / 16, in page.css below.
|
|
102
|
+
* What is still owed is the borinhood reading, which is a reading and not a component.
|
|
103
|
+
*/
|
|
104
|
+
export interface PageProps extends HTMLAttributes<HTMLElement> {
|
|
105
|
+
/**
|
|
106
|
+
* The sticky slot. Any node -- this does not require a `Navbar`, and the bar draws its own
|
|
107
|
+
* hairline wherever it comes from.
|
|
108
|
+
*/
|
|
109
|
+
navbar?: ReactNode;
|
|
110
|
+
/**
|
|
111
|
+
* The footer slot. **Omitted, there is no footer band and no second hairline**, which is the
|
|
112
|
+
* state a site with no footer yet is in.
|
|
113
|
+
*/
|
|
114
|
+
footer?: ReactNode;
|
|
115
|
+
/**
|
|
116
|
+
* The cap on the page's content, as a length. Omitted, the track is uncapped. It caps the TRACK
|
|
117
|
+
* and never a band, so the grounds and both hairlines still run edge to edge.
|
|
118
|
+
*/
|
|
119
|
+
maxInlineSize?: string;
|
|
120
|
+
/** Surface intent for the whole page. Forwarded to the root `Surface`, read nowhere here. */
|
|
121
|
+
theme?: Theme;
|
|
122
|
+
/** Forwarded to the root `Surface`, read nowhere here. */
|
|
123
|
+
mode?: Mode;
|
|
124
|
+
/** How raised the page is. Forwarded to the root `Surface`, read nowhere here. */
|
|
125
|
+
elevation?: Elevation;
|
|
126
|
+
/**
|
|
127
|
+
* How raised the footer is. Forwarded to the footer's own `Surface`, read nowhere here.
|
|
128
|
+
* **Omitted, the footer sits at the page's rung. `"deep"` puts it one below.**
|
|
129
|
+
*/
|
|
130
|
+
footerElevation?: Elevation;
|
|
131
|
+
children?: ReactNode;
|
|
132
|
+
}
|
|
133
|
+
export declare function Page({ navbar, footer, maxInlineSize, theme, mode, elevation, footerElevation, className, children, ...rest }: PageProps): import("react").JSX.Element;
|
|
134
|
+
export declare namespace Page {
|
|
135
|
+
export { PageBand as Band };
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/page/page.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmGG;AACH,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6FAA6F;IAC7F,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,0DAA0D;IAC1D,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,kFAAkF;IAClF,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,SAAS,CAAA;IAC3B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,IAAI,CAAC,EACjB,MAAM,EACN,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,EACJ,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,SAAS,+BAgDX;yBA3De,IAAI;aAqER,QAAQ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
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,
|
|
3
|
+
// and this renders inside server components -- see the repo blueprint, section 4.3.
|
|
4
|
+
import { Surface } from '../surface/index.js';
|
|
5
|
+
import { PageBand } from './band.js';
|
|
6
|
+
export function Page({ navbar, footer, maxInlineSize, theme, mode, elevation, footerElevation, className, children, ...rest }) {
|
|
7
|
+
// THE CAP IS A CUSTOM PROPERTY ON THE ROOT FROM 2026-09-21 LATE, where it was an inline
|
|
8
|
+
// `max-inline-size` on the one track this component rendered. It had to move because a band's
|
|
9
|
+
// track is a child the CONSUMER renders -- see the docblock. `undefined` omits the declaration
|
|
10
|
+
// entirely rather than writing `none`, so an uncapped page computes exactly the box it computed
|
|
11
|
+
// before, and page.css declares the `none` default on the rule itself.
|
|
12
|
+
//
|
|
13
|
+
// THE CONSUMER STILL WRITES NO NEWTONE PROPERTY, which is the half of issue 201's rule that
|
|
14
|
+
// binds: a site passes `maxInlineSize` and this file does the declaring.
|
|
15
|
+
const root = maxInlineSize
|
|
16
|
+
? { '--newtone-page-max-inline-size': maxInlineSize }
|
|
17
|
+
: undefined;
|
|
18
|
+
return (_jsxs(Surface, { theme: theme, mode: mode, elevation: elevation, className: ['newtone-page', className].filter(Boolean).join(' '), style: root, ...rest, children: [navbar, _jsxs("div", { className: "newtone-page-body", children: [_jsx("main", { className: "newtone-page-main", children: children }), footer ? (_jsx(Surface, { as: "footer", elevation: footerElevation, className: "newtone-page-footer", children: _jsx("div", { className: "newtone-page-track", children: footer }) })) : null] })] }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The band hangs off `Page` and is exported nowhere else.
|
|
22
|
+
*
|
|
23
|
+
* **Same boundary as `Navbar`'s parts, for the same reason one level up.** A band outside a page
|
|
24
|
+
* resolves neither `--newtone-page-max-inline-size` nor `--newtone-page-gutter`, because both are
|
|
25
|
+
* declared on `.newtone-page` -- so it would render full-bleed with no track and no inset, which is
|
|
26
|
+
* a silent failure rather than a loud one. `index.ts` exports `Page` and the band's prop type.
|
|
27
|
+
*/
|
|
28
|
+
Page.Band = PageBand;
|
|
29
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/page/page.tsx"],"names":[],"mappings":";AAAA,mGAAmG;AACnG,oFAAoF;AACpF,OAAO,EAAE,OAAO,EAAyC,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAqIpC,MAAM,UAAU,IAAI,CAAC,EACjB,MAAM,EACN,MAAM,EACN,aAAa,EACb,KAAK,EACL,IAAI,EACJ,SAAS,EACT,eAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACC;IACR,wFAAwF;IACxF,8FAA8F;IAC9F,+FAA+F;IAC/F,gGAAgG;IAChG,uEAAuE;IACvE,EAAE;IACF,4FAA4F;IAC5F,yEAAyE;IACzE,MAAM,IAAI,GAAG,aAAa;QACtB,CAAC,CAAE,EAAE,gCAAgC,EAAE,aAAa,EAAoB;QACxE,CAAC,CAAC,SAAS,CAAA;IAEf,OAAO,CACH,MAAC,OAAO,IACJ,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAChE,KAAK,EAAE,IAAI,KACP,IAAI,aAEP,MAAM,EAGP,eAAK,SAAS,EAAC,mBAAmB,aAI9B,eAAM,SAAS,EAAC,mBAAmB,YAAE,QAAQ,GAAQ,EAGpD,MAAM,CAAC,CAAC,CAAC,CACN,KAAC,OAAO,IACJ,EAAE,EAAC,QAAQ,EACX,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAC,qBAAqB,YAM/B,cAAK,SAAS,EAAC,oBAAoB,YAAE,MAAM,GAAO,GAC5C,CACb,CAAC,CAAC,CAAC,IAAI,IACN,IACA,CACb,CAAA;AACL,CAAC;AAED;;;;;;;GAOG;AACH,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAA"}
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
/* QuickAction -- one round action a page keeps within reach. See the repo blueprint, section 3, and
|
|
2
2
|
* blueprints/newtone/repos/newtone_ui_react-web/components/quick-action.md.
|
|
3
3
|
*
|
|
4
|
-
* ---- the size is
|
|
4
|
+
* ---- the size is a ladder now, and the knob it replaced is deleted -------
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* TWO RUNGS, 48 AND 56, `lg` BY DEFAULT -- which is the 3.5rem the deleted knob already held.
|
|
7
|
+
* `--newtone-quick-action-size` was one custom property a caller retuned in its own scope, taken
|
|
8
|
+
* from `Avatar` rather than re-derived, on the reasoning that *a ladder sized from the call sites a
|
|
9
|
+
* library happens to know about leaves the next one off every rung*.
|
|
10
|
+
*
|
|
11
|
+
* THAT REASONING STILL HOLDS AND IS NOT WHAT CHANGED. The ladder in contracts/button.md was not
|
|
12
|
+
* sized from call sites: four components in this library had reached 44 and 56 on 14/20 and 16/24
|
|
13
|
+
* separately, THIS ONE AMONG THEM, before there was a ladder to be a rung of. The knob is deleted
|
|
14
|
+
* rather than kept beside `size` because two ways to say one thing is the shape this library
|
|
15
|
+
* refuses, and it had no call sites at all -- issues/open/154, issues/open/201.
|
|
16
|
+
*
|
|
17
|
+
* The reference narrows its circle on a phone inside the media query that hands its dock back,
|
|
18
|
+
* which is a fact about that shell and not about this component: whatever pins the circle owns
|
|
19
|
+
* that number.
|
|
10
20
|
*
|
|
11
21
|
* ---- 50% is the corner, and the box is square, so this is a disc ---------
|
|
12
22
|
*
|
|
@@ -34,8 +44,14 @@
|
|
|
34
44
|
.newtone-quick-action {
|
|
35
45
|
display: inline-grid;
|
|
36
46
|
place-items: center;
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
/* THE RUNG SETS `--newtone-quick-action-box` BELOW and this reads it, so the disc is one
|
|
48
|
+
* declaration per rung rather than a copy of the block. contracts/button.md, *Sizes*. */
|
|
49
|
+
inline-size: var(--newtone-quick-action-box);
|
|
50
|
+
block-size: var(--newtone-quick-action-box);
|
|
51
|
+
|
|
52
|
+
/* PUBLISHED, NEVER DECLARED -- issues/open/156. Here the box IS the height, so this restates
|
|
53
|
+
* rather than computes; it exists so a row can read every control the same way. */
|
|
54
|
+
--newtone-quick-action-height: var(--newtone-quick-action-box);
|
|
39
55
|
padding: 0;
|
|
40
56
|
border: 1px solid;
|
|
41
57
|
border-radius: var(--newtone-quick-action-radius);
|
|
@@ -46,6 +62,19 @@
|
|
|
46
62
|
border-color: var(--newtone-quick-action-rest-border);
|
|
47
63
|
}
|
|
48
64
|
|
|
65
|
+
/* ---- the rungs ----------------------------------------------------------
|
|
66
|
+
*
|
|
67
|
+
* 48 and 56, the same two `Action` takes. `--newtone-quick-action-size` was one knob a consumer
|
|
68
|
+
* retuned and is deleted rather than kept beside these -- issues/open/201, and it had no call
|
|
69
|
+
* sites. contracts/button.md, *Sizes*. */
|
|
70
|
+
.newtone-quick-action--sm {
|
|
71
|
+
--newtone-quick-action-box: var(--newtone-quick-action-size-sm);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.newtone-quick-action--lg {
|
|
75
|
+
--newtone-quick-action-box: var(--newtone-quick-action-size-lg);
|
|
76
|
+
}
|
|
77
|
+
|
|
49
78
|
.newtone-quick-action > * {
|
|
50
79
|
inline-size: 1.5rem;
|
|
51
80
|
block-size: 1.5rem;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
import type { AnchorHTMLAttributes, ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Two rungs of the ladder's five: **48 and 56**, the same two `Action` takes.
|
|
4
|
+
*
|
|
5
|
+
* THIS COMPONENT ARGUED AGAINST A LADDER AND THE ARGUMENT WAS RIGHT. It shipped a single
|
|
6
|
+
* `--newtone-quick-action-size` knob instead, on `Avatar`'s reasoning: *a ladder sized from the
|
|
7
|
+
* call sites a library happens to know about leaves the next one off every rung.*
|
|
8
|
+
*
|
|
9
|
+
* WHAT CHANGED ON 2026-09-21 IS NOT THE ARGUMENT. It is that the ladder stopped being sized from
|
|
10
|
+
* call sites -- four components in this library had reached 44 and 56 on 14/20 and 16/24
|
|
11
|
+
* separately, **this one among them at 3.5rem, before there was a ladder to be a rung of**. Joining
|
|
12
|
+
* costs no prediction. governance/code/a-controls-size-is-one-rung-and-the-rung-carries-everything.md.
|
|
13
|
+
*/
|
|
14
|
+
export type QuickActionSize = 'sm' | 'lg';
|
|
2
15
|
interface QuickActionCommon {
|
|
3
16
|
/**
|
|
4
17
|
* The accessible name, and the only name this control has. **Never rendered** -- the mark is
|
|
@@ -12,6 +25,11 @@ interface QuickActionCommon {
|
|
|
12
25
|
* ligature. A slot renders both; a name prop renders one.
|
|
13
26
|
*/
|
|
14
27
|
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* Which rung: 48 or 56. Defaults to `lg`, which is 56 -- the value the deleted knob already
|
|
30
|
+
* had, so nothing that renders one would move. Nothing renders one.
|
|
31
|
+
*/
|
|
32
|
+
size?: QuickActionSize;
|
|
15
33
|
}
|
|
16
34
|
export type QuickActionProps = QuickActionCommon & ((Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'aria-label'> & {
|
|
17
35
|
href?: undefined;
|
|
@@ -26,11 +44,13 @@ export type QuickActionProps = QuickActionCommon & ((Omit<ButtonHTMLAttributes<H
|
|
|
26
44
|
*
|
|
27
45
|
* ---- it does not position itself, and is not named for where it sits ------
|
|
28
46
|
*
|
|
29
|
-
* Whatever pins it -- a corner, a safe-area inset, a dock -- belongs to the page that placed it.
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* `
|
|
47
|
+
* Whatever pins it -- a corner, a safe-area inset, a dock -- belongs to the page that placed it. A
|
|
48
|
+
* component called `FloatingButton` would be carrying a word about a slot it does not own.
|
|
49
|
+
*
|
|
50
|
+
* `--newtone-quick-action-size` WAS THE ONE PROPERTY A CALLER RETUNED, and it is **deleted** rather
|
|
51
|
+
* than kept beside `size` -- two ways to say one thing, and the knob had zero call sites anywhere.
|
|
52
|
+
* That is issues/open/201 arriving early: a consumer writes no Newtone property, and what replaces
|
|
53
|
+
* one is a prop.
|
|
34
54
|
*
|
|
35
55
|
* ---- NOTHING RENDERS ONE, and that is recorded rather than smoothed over --
|
|
36
56
|
*
|
|
@@ -63,6 +83,6 @@ export type QuickActionProps = QuickActionCommon & ((Omit<ButtonHTMLAttributes<H
|
|
|
63
83
|
* is genuinely weaker than the component it came from, and the fix is a vocabulary rather than
|
|
64
84
|
* anything in this folder -- `newtone_ui_tokens.md` section 8, *Shadows, blur, spread*.
|
|
65
85
|
*/
|
|
66
|
-
export declare function QuickAction({ label, children, className, ...rest }: QuickActionProps): import("react").JSX.Element;
|
|
86
|
+
export declare function QuickAction({ label, children, size, className, ...rest }: QuickActionProps): import("react").JSX.Element;
|
|
67
87
|
export {};
|
|
68
88
|
//# sourceMappingURL=quick-action.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-action.d.ts","sourceRoot":"","sources":["../../src/quick-action/quick-action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElF,UAAU,iBAAiB;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"quick-action.d.ts","sourceRoot":"","sources":["../../src/quick-action/quick-action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAElF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,CAAA;AAEzC,UAAU,iBAAiB;IACvB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;;OAGG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;CACzB;AAED,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAC5C,CACM,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAA;CACnB,CAAC,GACF,CAAC,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC,GAAG;IACjF,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAA;CACf,CAAC,CACP,CAAA;AAEL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,WAAW,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,IAAW,EACX,SAAS,EACT,GAAG,IAAI,EACV,EAAE,gBAAgB,+BA2BlB"}
|