@newtone-dev/ui-react-web 0.2.0 → 0.6.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 +41 -15
- package/dist/accordion/accordion.css +5 -3
- 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/bar-list/bar-list.css +95 -0
- package/dist/bar-list/bar-list.d.ts +28 -0
- package/dist/bar-list/bar-list.d.ts.map +1 -0
- package/dist/bar-list/bar-list.js +9 -0
- package/dist/bar-list/bar-list.js.map +1 -0
- package/dist/bar-list/index.d.ts +4 -0
- package/dist/bar-list/index.d.ts.map +1 -0
- package/dist/bar-list/index.js +3 -0
- package/dist/bar-list/index.js.map +1 -0
- 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/chart-key/chart-key.css +33 -0
- package/dist/chart-key/chart-key.d.ts +15 -0
- package/dist/chart-key/chart-key.d.ts.map +1 -0
- package/dist/chart-key/chart-key.js +6 -0
- package/dist/chart-key/chart-key.js.map +1 -0
- package/dist/chart-key/index.d.ts +4 -0
- package/dist/chart-key/index.d.ts.map +1 -0
- package/dist/chart-key/index.js +3 -0
- package/dist/chart-key/index.js.map +1 -0
- package/dist/color/seeds.d.ts +7 -0
- package/dist/color/seeds.d.ts.map +1 -1
- package/dist/color/seeds.js +21 -0
- package/dist/color/seeds.js.map +1 -1
- package/dist/column-chart/column-chart.css +89 -0
- package/dist/column-chart/column-chart.d.ts +30 -0
- package/dist/column-chart/column-chart.d.ts.map +1 -0
- package/dist/column-chart/column-chart.js +11 -0
- package/dist/column-chart/column-chart.js.map +1 -0
- package/dist/column-chart/index.d.ts +4 -0
- package/dist/column-chart/index.d.ts.map +1 -0
- package/dist/column-chart/index.js +3 -0
- package/dist/column-chart/index.js.map +1 -0
- 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/count-up/count-up.css +8 -0
- package/dist/count-up/count-up.d.ts +30 -0
- package/dist/count-up/count-up.d.ts.map +1 -0
- package/dist/count-up/count-up.js +92 -0
- package/dist/count-up/count-up.js.map +1 -0
- package/dist/count-up/index.d.ts +4 -0
- package/dist/count-up/index.d.ts.map +1 -0
- package/dist/count-up/index.js +3 -0
- package/dist/count-up/index.js.map +1 -0
- package/dist/figure/figure.css +11 -0
- package/dist/figure/figure.d.ts +17 -0
- package/dist/figure/figure.d.ts.map +1 -0
- package/dist/figure/figure.js +7 -0
- package/dist/figure/figure.js.map +1 -0
- package/dist/figure/index.d.ts +4 -0
- package/dist/figure/index.d.ts.map +1 -0
- package/dist/figure/index.js +3 -0
- package/dist/figure/index.js.map +1 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -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/segmented-control/segmented-control.css +2 -2
- package/dist/split-bar/index.d.ts +4 -0
- package/dist/split-bar/index.d.ts.map +1 -0
- package/dist/split-bar/index.js +3 -0
- package/dist/split-bar/index.js.map +1 -0
- package/dist/split-bar/split-bar.css +86 -0
- package/dist/split-bar/split-bar.d.ts +27 -0
- package/dist/split-bar/split-bar.d.ts.map +1 -0
- package/dist/split-bar/split-bar.js +7 -0
- package/dist/split-bar/split-bar.js.map +1 -0
- package/dist/text/text.css +69 -0
- package/dist/text/text.d.ts +6 -4
- package/dist/text/text.d.ts.map +1 -1
- package/dist/text/text.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 +36 -1
|
@@ -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"}
|
|
@@ -6,11 +6,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
6
6
|
*
|
|
7
7
|
* ---- it does not position itself, and is not named for where it sits ------
|
|
8
8
|
*
|
|
9
|
-
* Whatever pins it -- a corner, a safe-area inset, a dock -- belongs to the page that placed it.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* `
|
|
9
|
+
* Whatever pins it -- a corner, a safe-area inset, a dock -- belongs to the page that placed it. A
|
|
10
|
+
* component called `FloatingButton` would be carrying a word about a slot it does not own.
|
|
11
|
+
*
|
|
12
|
+
* `--newtone-quick-action-size` WAS THE ONE PROPERTY A CALLER RETUNED, and it is **deleted** rather
|
|
13
|
+
* than kept beside `size` -- two ways to say one thing, and the knob had zero call sites anywhere.
|
|
14
|
+
* That is issues/open/201 arriving early: a consumer writes no Newtone property, and what replaces
|
|
15
|
+
* one is a prop.
|
|
14
16
|
*
|
|
15
17
|
* ---- NOTHING RENDERS ONE, and that is recorded rather than smoothed over --
|
|
16
18
|
*
|
|
@@ -43,8 +45,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
43
45
|
* is genuinely weaker than the component it came from, and the fix is a vocabulary rather than
|
|
44
46
|
* anything in this folder -- `newtone_ui_tokens.md` section 8, *Shadows, blur, spread*.
|
|
45
47
|
*/
|
|
46
|
-
export function QuickAction({ label, children, className, ...rest }) {
|
|
47
|
-
const classes = ['newtone-quick-action', className]
|
|
48
|
+
export function QuickAction({ label, children, size = 'lg', className, ...rest }) {
|
|
49
|
+
const classes = ['newtone-quick-action', `newtone-quick-action--${size}`, className]
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.join(' ');
|
|
48
52
|
if (rest.href !== undefined) {
|
|
49
53
|
const { href, ...anchor } = rest;
|
|
50
54
|
return (_jsx("a", { href: href, className: classes, "aria-label": label, ...anchor, children: children }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-action.js","sourceRoot":"","sources":["../../src/quick-action/quick-action.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"quick-action.js","sourceRoot":"","sources":["../../src/quick-action/quick-action.tsx"],"names":[],"mappings":";AA+CA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,MAAM,UAAU,WAAW,CAAC,EACxB,KAAK,EACL,QAAQ,EACR,IAAI,GAAG,IAAI,EACX,SAAS,EACT,GAAG,IAAI,EACQ;IACf,MAAM,OAAO,GAAG,CAAC,sBAAsB,EAAE,yBAAyB,IAAI,EAAE,EAAE,SAAS,CAAC;SAC/E,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAA;IAEd,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAAG,IAG3B,CAAA;QACD,OAAO,CACH,YAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,gBAAc,KAAK,KAAM,MAAM,YAC3D,QAAQ,GACT,CACP,CAAA;IACL,CAAC;IAED,OAAO,CACH,iBACI,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,OAAO,gBACN,KAAK,KACZ,IAAgD,YAEpD,QAAQ,GACJ,CACZ,CAAA;AACL,CAAC"}
|
|
@@ -146,8 +146,8 @@
|
|
|
146
146
|
cursor: pointer;
|
|
147
147
|
user-select: none;
|
|
148
148
|
transition:
|
|
149
|
-
background-color
|
|
150
|
-
color
|
|
149
|
+
background-color var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard),
|
|
150
|
+
color var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard);
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
/* The input is the control and the label is the hit area, so it covers the segment and paints
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-bar/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-bar/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* SplitBar -- blueprint components/split-bar.md. One grid, rows `display: contents`, names in one
|
|
2
|
+
column. Each track is a 100% bar in `mark-muted`; its first part is `mark` and grows by width. */
|
|
3
|
+
|
|
4
|
+
@property --_split-bar-share {
|
|
5
|
+
syntax: '<number>';
|
|
6
|
+
inherits: false;
|
|
7
|
+
initial-value: 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.newtone-split-bar {
|
|
11
|
+
display: grid;
|
|
12
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
13
|
+
align-items: center;
|
|
14
|
+
column-gap: var(--newtone-space-4);
|
|
15
|
+
row-gap: var(--newtone-space-8);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.newtone-split-bar-row {
|
|
19
|
+
display: contents;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.newtone-split-bar-label {
|
|
23
|
+
color: var(--newtone-chart-label);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.newtone-split-bar-track {
|
|
27
|
+
display: flex;
|
|
28
|
+
height: var(--newtone-space-8);
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
border-radius: var(--newtone-chart-radius);
|
|
31
|
+
background: var(--newtone-chart-mark-muted);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.newtone-split-bar-part {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: flex-end;
|
|
38
|
+
width: calc(var(--_split-bar-share) * 100%);
|
|
39
|
+
padding-inline: var(--newtone-space-6);
|
|
40
|
+
background: var(--newtone-chart-mark);
|
|
41
|
+
color: var(--newtone-chart-on-mark);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.newtone-split-bar[data-fill] {
|
|
45
|
+
height: 100%;
|
|
46
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.newtone-split-bar[data-fill] .newtone-split-bar-track {
|
|
50
|
+
height: 100%;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@keyframes newtone-split-bar-grow {
|
|
54
|
+
from {
|
|
55
|
+
--_split-bar-share: 0;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
60
|
+
.newtone-split-bar-part {
|
|
61
|
+
animation: newtone-split-bar-grow var(--newtone-motion-duration-reveal)
|
|
62
|
+
var(--newtone-motion-easing-reveal) both;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (max-width: 40rem) {
|
|
67
|
+
.newtone-split-bar {
|
|
68
|
+
grid-template-columns: minmax(0, 1fr);
|
|
69
|
+
row-gap: var(--newtone-space-1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.newtone-split-bar[data-fill] {
|
|
73
|
+
grid-auto-rows: auto;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Tall enough for the share's own phone size (display-xl steps down to 48), so the figure is
|
|
77
|
+
never shrunk off the scale to fit the bar. */
|
|
78
|
+
.newtone-split-bar-track,
|
|
79
|
+
.newtone-split-bar[data-fill] .newtone-split-bar-track {
|
|
80
|
+
height: var(--newtone-space-16);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.newtone-split-bar-part {
|
|
84
|
+
padding-inline: var(--newtone-space-3);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { type TextScale } from '../text/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* A 100% bar per row, split in two, with the first share printed inside it. From 0.6.0, 2026-09-25.
|
|
5
|
+
* Blueprint components/split-bar.md.
|
|
6
|
+
*
|
|
7
|
+
* Each bar is its own whole -- which is why this is not a BarList: a deck drew two shares of two
|
|
8
|
+
* different totals on one line, and a reader went looking for the missing part of a single whole.
|
|
9
|
+
* The first part is `chart.mark`, the rest `chart.mark-muted`; the share counts up in `chart.on-mark`
|
|
10
|
+
* ink at the first part's end, and rides it as it grows.
|
|
11
|
+
*/
|
|
12
|
+
export interface SplitBarItem {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
/** 0-100, the first part. */
|
|
15
|
+
share: number;
|
|
16
|
+
/** The share as printed. Defaults to the rounded share and `%`. */
|
|
17
|
+
display?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SplitBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
items: SplitBarItem[];
|
|
21
|
+
/** The printed share's scale. Defaults to `display-xl`. */
|
|
22
|
+
figureScale?: TextScale;
|
|
23
|
+
/** Rows share the height of the list's container. */
|
|
24
|
+
fill?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function SplitBar({ items, figureScale, fill, className, ...rest }: SplitBarProps): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=split-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-bar.d.ts","sourceRoot":"","sources":["../../src/split-bar/split-bar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAGvD;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,SAAS,CAAA;IACvB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,WAA0B,EAC1B,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,aAAa,+BA6Bf"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '../text/index.js';
|
|
3
|
+
import { CountUp } from '../count-up/index.js';
|
|
4
|
+
export function SplitBar({ items, figureScale = 'display-xl', fill = false, className, ...rest }) {
|
|
5
|
+
return (_jsx("div", { className: className ? `newtone-split-bar ${className}` : 'newtone-split-bar', "data-fill": fill ? '' : undefined, ...rest, children: items.map((item, i) => (_jsxs("div", { className: "newtone-split-bar-row", children: [_jsx(Text, { as: "div", scale: "body-sm", className: "newtone-split-bar-label", children: item.label }), _jsx("div", { className: "newtone-split-bar-track", children: _jsx("div", { className: "newtone-split-bar-part", style: { '--_split-bar-share': item.share / 100 }, children: _jsx(CountUp, { as: "div", scale: figureScale, value: item.display ?? `${Math.round(item.share)}%`, className: "newtone-split-bar-share" }) }) })] }, i))) }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=split-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-bar.js","sourceRoot":"","sources":["../../src/split-bar/split-bar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAkB,MAAM,kBAAkB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AA2B9C,MAAM,UAAU,QAAQ,CAAC,EACrB,KAAK,EACL,WAAW,GAAG,YAAY,EAC1B,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI,EACK;IACZ,OAAO,CACH,cACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC,CAAC,mBAAmB,eAClE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,KAC5B,IAAI,YAEP,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,eAAa,SAAS,EAAC,uBAAuB,aAC1C,KAAC,IAAI,IAAC,EAAE,EAAC,KAAK,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,yBAAyB,YAC7D,IAAI,CAAC,KAAK,GACR,EACP,cAAK,SAAS,EAAC,yBAAyB,YACpC,cACI,SAAS,EAAC,wBAAwB,EAClC,KAAK,EAAE,EAAE,oBAAoB,EAAE,IAAI,CAAC,KAAK,GAAG,GAAG,EAAmB,YAElE,KAAC,OAAO,IACJ,EAAE,EAAC,KAAK,EACR,KAAK,EAAE,WAAW,EAClB,KAAK,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EACnD,SAAS,EAAC,yBAAyB,GACrC,GACA,GACJ,KAhBA,CAAC,CAiBL,CACT,CAAC,GACA,CACT,CAAA;AACL,CAAC"}
|
package/dist/text/text.css
CHANGED
|
@@ -50,6 +50,51 @@
|
|
|
50
50
|
agree with -- a grouped selector listing them elsewhere would be a second copy of section
|
|
51
51
|
7.1's `font` column, and a second copy is a thing that drifts. */
|
|
52
52
|
|
|
53
|
+
/* THE THREE ABOVE 48, 2026-09-25 -- contracts/typography.md section 7.1 and
|
|
54
|
+
DECISIONS/2026-09-25-display-steps-above-forty-eight.md. Leading `none`, 1. */
|
|
55
|
+
|
|
56
|
+
.newtone-text:where([data-scale='display-3xl']) {
|
|
57
|
+
font-family: var(--newtone-text-scale-display-3xl-family);
|
|
58
|
+
font-variation-settings: var(--newtone-text-scale-display-3xl-variation);
|
|
59
|
+
font-feature-settings: var(--newtone-text-scale-display-3xl-feature);
|
|
60
|
+
font-size: var(--newtone-text-scale-display-3xl-size);
|
|
61
|
+
line-height: var(--newtone-text-scale-display-3xl-line-height);
|
|
62
|
+
letter-spacing: var(--newtone-text-scale-display-3xl-tracking);
|
|
63
|
+
--_weight: var(--_weight-bold);
|
|
64
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
65
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
66
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
67
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.newtone-text:where([data-scale='display-2xl']) {
|
|
71
|
+
font-family: var(--newtone-text-scale-display-2xl-family);
|
|
72
|
+
font-variation-settings: var(--newtone-text-scale-display-2xl-variation);
|
|
73
|
+
font-feature-settings: var(--newtone-text-scale-display-2xl-feature);
|
|
74
|
+
font-size: var(--newtone-text-scale-display-2xl-size);
|
|
75
|
+
line-height: var(--newtone-text-scale-display-2xl-line-height);
|
|
76
|
+
letter-spacing: var(--newtone-text-scale-display-2xl-tracking);
|
|
77
|
+
--_weight: var(--_weight-bold);
|
|
78
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
79
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
80
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
81
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.newtone-text:where([data-scale='display-xl']) {
|
|
85
|
+
font-family: var(--newtone-text-scale-display-xl-family);
|
|
86
|
+
font-variation-settings: var(--newtone-text-scale-display-xl-variation);
|
|
87
|
+
font-feature-settings: var(--newtone-text-scale-display-xl-feature);
|
|
88
|
+
font-size: var(--newtone-text-scale-display-xl-size);
|
|
89
|
+
line-height: var(--newtone-text-scale-display-xl-line-height);
|
|
90
|
+
letter-spacing: var(--newtone-text-scale-display-xl-tracking);
|
|
91
|
+
--_weight: var(--_weight-bold);
|
|
92
|
+
--_weight-regular: var(--newtone-text-display-weight-regular);
|
|
93
|
+
--_weight-medium: var(--newtone-text-display-weight-medium);
|
|
94
|
+
--_weight-semibold: var(--newtone-text-display-weight-semibold);
|
|
95
|
+
--_weight-bold: var(--newtone-text-display-weight-bold);
|
|
96
|
+
}
|
|
97
|
+
|
|
53
98
|
.newtone-text:where([data-scale='display-lg']) {
|
|
54
99
|
font-family: var(--newtone-text-scale-display-lg-family);
|
|
55
100
|
font-variation-settings: var(--newtone-text-scale-display-lg-variation);
|
|
@@ -130,6 +175,30 @@
|
|
|
130
175
|
--_weight: var(--_weight-regular);
|
|
131
176
|
}
|
|
132
177
|
|
|
178
|
+
.newtone-text:where([data-scale='lead-lg']) {
|
|
179
|
+
font-family: var(--newtone-text-scale-lead-lg-family);
|
|
180
|
+
font-variation-settings: var(--newtone-text-scale-lead-lg-variation);
|
|
181
|
+
font-feature-settings: var(--newtone-text-scale-lead-lg-feature);
|
|
182
|
+
font-size: var(--newtone-text-scale-lead-lg-size);
|
|
183
|
+
line-height: var(--newtone-text-scale-lead-lg-line-height);
|
|
184
|
+
letter-spacing: var(--newtone-text-scale-lead-lg-tracking);
|
|
185
|
+
--_weight: var(--_weight-regular);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* THE PHONE STEP-DOWN, 2026-09-25. Below `stack` (40rem, written as the library's other media
|
|
189
|
+
queries are, because a custom property cannot be read inside one) the three largest scales take a
|
|
190
|
+
smaller step's size, never a curve: 128 -> 64, 96 -> 48, 64 -> 48. Their leading stays `none`.
|
|
191
|
+
contracts/typography.md section 7.1, *No clamp()*. Still 0,1,0, after the blocks it narrows. */
|
|
192
|
+
@media (max-width: 40rem) {
|
|
193
|
+
.newtone-text:where([data-scale='display-3xl']) {
|
|
194
|
+
font-size: var(--newtone-text-scale-display-xl-size);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.newtone-text:where([data-scale='display-2xl'], [data-scale='display-xl']) {
|
|
198
|
+
font-size: var(--newtone-text-scale-display-lg-size);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
133
202
|
.newtone-text:where([data-scale='body']) {
|
|
134
203
|
font-family: var(--newtone-text-scale-body-family);
|
|
135
204
|
font-variation-settings: var(--newtone-text-scale-body-variation);
|
package/dist/text/text.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributes, type ReactNode } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* The ten names in contracts/typography.md section 7.1. A closed set, counted out of what
|
|
4
|
-
* sites had already written rather than adapted from the prior art's thirteen: `display-sm`,
|
|
3
|
+
* The ~~ten~~ fourteen names in contracts/typography.md section 7.1. A closed set, counted out of what
|
|
4
|
+
* three sites had already written rather than adapted from the prior art's thirteen: `display-sm`,
|
|
5
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.
|
|
6
|
+
* asked for is a prediction, and giving it a home makes it look like a decision. The four added on
|
|
7
|
+
* 2026-09-25 (`display-3xl`, `display-2xl`, `display-xl`, `lead-lg`) were counted the same way: fifteen
|
|
8
|
+
* consumer rules above 48px, and a 20px line written three times.
|
|
7
9
|
*/
|
|
8
|
-
export type TextScale = 'display-lg' | 'display-md' | 'heading-lg' | 'heading-md' | 'heading-sm' | 'lead' | 'body' | 'body-sm' | 'caption' | 'eyebrow';
|
|
10
|
+
export type TextScale = 'display-3xl' | 'display-2xl' | 'display-xl' | 'display-lg' | 'display-md' | 'heading-lg' | 'heading-md' | 'heading-sm' | 'lead' | 'lead-lg' | 'body' | 'body-sm' | 'caption' | 'eyebrow';
|
|
9
11
|
export type TextFont = 'body' | 'display' | 'code';
|
|
10
12
|
export type TextWeight = 'regular' | 'medium' | 'semibold' | 'bold';
|
|
11
13
|
export type TextCase = 'normal' | 'upper';
|
package/dist/text/text.d.ts.map
CHANGED
|
@@ -1 +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
|
|
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;;;;;;;GAOG;AACH,MAAM,MAAM,SAAS,GACf,aAAa,GACb,aAAa,GACb,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,SAAS,GACT,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"}
|
package/dist/text/text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../src/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAyD,MAAM,OAAO,CAAA;AA2D5F;;;;;;;;;;;;;;;;;;;;;;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"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { type ElementType, type HTMLAttributes } from 'react';
|
|
2
2
|
/**
|
|
3
|
-
* A step on the tokens' spacing scale. These
|
|
3
|
+
* A step on the tokens' spacing scale. These fourteen are the ones `newtone_ui_tokens` emits as
|
|
4
4
|
* `--newtone-space-*`; there is no 7 and no 9.
|
|
5
5
|
*
|
|
6
6
|
* **A step that is not on this list resolves to nothing and the declaration is dropped, in
|
|
7
7
|
* silence** -- `var(--newtone-space-7)` is not an error, it is an undefined custom property with
|
|
8
8
|
* no fallback. That is why this union is closed rather than `number`, and why the blueprint's
|
|
9
9
|
* section 5 carries a one-line check comparing it against the emitted stylesheet.
|
|
10
|
+
*
|
|
11
|
+
* `'2-5'` IS 10px, THE SCALE'S ONE HALF-STEP, AND IT IS A STRING BECAUSE THE EMITTED NAME IS.
|
|
12
|
+
* It arrived 2026-09-21 for the control ladder's 40px rung -- 20 of leading and 10 each side, and
|
|
13
|
+
* the quarter-rem grid has 8 and 12 and nothing between. The key is spelled `2-5` everywhere: in
|
|
14
|
+
* the token source, in the reference, in `--newtone-space-2-5` and here. **`2.5` would have been
|
|
15
|
+
* the obvious spelling and it needs three translations** -- a token reference is split on `.`, a
|
|
16
|
+
* custom property name is a `<dashed-ident>` and `.` is not an ident code point, and the
|
|
17
|
+
* interpolation below would have emitted a name nothing declares. One spelling costs none of them.
|
|
18
|
+
* newtone_ui_tokens.md section 3.
|
|
10
19
|
*/
|
|
11
|
-
export type SpaceStep = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
|
|
20
|
+
export type SpaceStep = 0 | 1 | 2 | '2-5' | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16 | 20 | 24;
|
|
12
21
|
export type WrapperDirection = 'row' | 'column';
|
|
13
22
|
/**
|
|
14
23
|
* Where the contents sit, as one of the nine positions of a 3x3 grid.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAEhG
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAA;AAEhG;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;AAEtF,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE/C;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,GAClB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,aAAa,GACb,QAAQ,GACR,cAAc,GACd,aAAa,GACb,eAAe,GACf,cAAc,CAAA;AAEpB,mGAAmG;AACnG,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG;IAAE,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,kCAAkC;IAClC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,8EAA8E;IAC9E,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,8EAA8E;IAC9E,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,sEAAsE;IACtE,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,EAAE,CAAC,EAAE,WAAW,CAAA;CACnB;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,OAAO,CAAC,EACpB,SAAoB,EACpB,GAAG,EACH,OAAO,EACP,KAAK,EACL,IAAI,EACJ,EAAU,EACV,KAAK,EACL,GAAG,IAAI,EACV,EAAE,YAAY,0FAiBd"}
|
package/dist/wrapper/wrapper.js
CHANGED
|
@@ -73,7 +73,11 @@ export function Wrapper({ direction = 'column', gap, padding, align, wrap, as =
|
|
|
73
73
|
function resolvePadding(padding) {
|
|
74
74
|
if (padding === undefined)
|
|
75
75
|
return {};
|
|
76
|
-
|
|
76
|
+
// NOT `typeof padding === 'number'`. `SpaceStep` gained the string `'2-5'` on 2026-09-21 -- the
|
|
77
|
+
// scale's one half-step, spelled the way the emitted custom property is -- and a number test
|
|
78
|
+
// sends it to the object branch, where `.block` does not exist. The discriminator is whether
|
|
79
|
+
// this is the pair, so that is what is asked.
|
|
80
|
+
if (typeof padding !== 'object')
|
|
77
81
|
return { padding: SPACE(padding) };
|
|
78
82
|
return {
|
|
79
83
|
...(padding.block !== undefined ? { paddingBlock: SPACE(padding.block) } : null),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA6D,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../src/wrapper/wrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA6D,MAAM,OAAO,CAAA;AA6FhG,MAAM,KAAK,GAAG,CAAC,IAAe,EAAE,EAAE,CAAC,uBAAuB,IAAI,GAAG,CAAA;AAEjE,MAAM,IAAI,GAAG,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAW,CAAA;AAEhF;;;;GAIG;AACH,SAAS,YAAY,CAAC,KAAmB,EAAE,SAA2B;IAClE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC3E,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAChF,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IAClF,OAAO,SAAS,KAAK,KAAK;QACtB,CAAC,CAAC,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE;QACtD,CAAC,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,CAAA;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,UAAU,OAAO,CAAC,EACpB,SAAS,GAAG,QAAQ,EACpB,GAAG,EACH,OAAO,EACP,KAAK,EACL,IAAI,EACJ,EAAE,GAAG,KAAK,EACV,KAAK,EACL,GAAG,IAAI,EACI;IACX,MAAM,MAAM,GAAkB;QAC1B,OAAO,EAAE,MAAM;QACf,aAAa,EAAE,SAAS;QACxB,wFAAwF;QACxF,oFAAoF;QACpF,qFAAqF;QACrF,QAAQ,EAAE,CAAC;QACX,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACvC,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACnD,GAAG,cAAc,CAAC,OAAO,CAAC;QAC1B,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAClD,sFAAsF;QACtF,GAAG,KAAK;KACX,CAAA;IAED,OAAO,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC,CAAA;AACxD,CAAC;AAED,SAAS,cAAc,CAAC,OAAmC;IACvD,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IACpC,gGAAgG;IAChG,6FAA6F;IAC7F,6FAA6F;IAC7F,8CAA8C;IAC9C,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,CAAA;IACnE,OAAO;QACH,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAChF,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;KACtF,CAAA;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newtone-dev/ui-react-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
"types": "./dist/numbered-list/index.d.ts",
|
|
90
90
|
"default": "./dist/numbered-list/index.js"
|
|
91
91
|
},
|
|
92
|
+
"./page": {
|
|
93
|
+
"types": "./dist/page/index.d.ts",
|
|
94
|
+
"default": "./dist/page/index.js"
|
|
95
|
+
},
|
|
92
96
|
"./quick-action": {
|
|
93
97
|
"types": "./dist/quick-action/index.d.ts",
|
|
94
98
|
"default": "./dist/quick-action/index.js"
|
|
@@ -141,9 +145,40 @@
|
|
|
141
145
|
"./navbar.css": "./dist/navbar/navbar.css",
|
|
142
146
|
"./numbered-list.css": "./dist/numbered-list/numbered-list.css",
|
|
143
147
|
"./on-media.css": "./dist/on-media/on-media.css",
|
|
148
|
+
"./page.css": "./dist/page/page.css",
|
|
144
149
|
"./quick-action.css": "./dist/quick-action/quick-action.css",
|
|
145
150
|
"./segmented-control.css": "./dist/segmented-control/segmented-control.css",
|
|
146
151
|
"./stat-card.css": "./dist/stat-card/stat-card.css",
|
|
152
|
+
"./count-up": {
|
|
153
|
+
"types": "./dist/count-up/index.d.ts",
|
|
154
|
+
"default": "./dist/count-up/index.js"
|
|
155
|
+
},
|
|
156
|
+
"./count-up.css": "./dist/count-up/count-up.css",
|
|
157
|
+
"./figure": {
|
|
158
|
+
"types": "./dist/figure/index.d.ts",
|
|
159
|
+
"default": "./dist/figure/index.js"
|
|
160
|
+
},
|
|
161
|
+
"./figure.css": "./dist/figure/figure.css",
|
|
162
|
+
"./bar-list": {
|
|
163
|
+
"types": "./dist/bar-list/index.d.ts",
|
|
164
|
+
"default": "./dist/bar-list/index.js"
|
|
165
|
+
},
|
|
166
|
+
"./bar-list.css": "./dist/bar-list/bar-list.css",
|
|
167
|
+
"./split-bar": {
|
|
168
|
+
"types": "./dist/split-bar/index.d.ts",
|
|
169
|
+
"default": "./dist/split-bar/index.js"
|
|
170
|
+
},
|
|
171
|
+
"./split-bar.css": "./dist/split-bar/split-bar.css",
|
|
172
|
+
"./column-chart": {
|
|
173
|
+
"types": "./dist/column-chart/index.d.ts",
|
|
174
|
+
"default": "./dist/column-chart/index.js"
|
|
175
|
+
},
|
|
176
|
+
"./column-chart.css": "./dist/column-chart/column-chart.css",
|
|
177
|
+
"./chart-key": {
|
|
178
|
+
"types": "./dist/chart-key/index.d.ts",
|
|
179
|
+
"default": "./dist/chart-key/index.js"
|
|
180
|
+
},
|
|
181
|
+
"./chart-key.css": "./dist/chart-key/chart-key.css",
|
|
147
182
|
"./tag.css": "./dist/tag/tag.css",
|
|
148
183
|
"./text.css": "./dist/text/text.css",
|
|
149
184
|
"./video-lightbox.css": "./dist/video-lightbox/video-lightbox.css",
|