@newtone-dev/ui-react-web 0.5.0 → 0.7.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 +2 -2
- package/dist/accordion/accordion.css +5 -3
- 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/card-box/card-box.css +5 -0
- package/dist/card-box/card-box.d.ts +10 -1
- package/dist/card-box/card-box.d.ts.map +1 -1
- package/dist/card-box/card-box.js +3 -3
- package/dist/card-box/card-box.js.map +1 -1
- package/dist/card-grid/card-grid.css +20 -0
- package/dist/card-grid/card-grid.d.ts +7 -2
- package/dist/card-grid/card-grid.d.ts.map +1 -1
- package/dist/card-grid/card-grid.js +5 -3
- package/dist/card-grid/card-grid.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/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 +12 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.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/package.json +31 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Newtone's component library for React on the web.
|
|
|
9
9
|
|
|
10
10
|
## What is here
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
**~~Twenty-six~~ Thirty-four components and a colour port** (recounted with `ls src/*/index.ts` on 2026-09-25, when the six chart parts arrived in `0.6.0`; the twenty-six had gone stale before them). `ls src/*/index.ts` is the complete public API that
|
|
13
13
|
JavaScript can reach; `package.json`'s `exports` map is the complete one including stylesheets.
|
|
14
14
|
**This table is the spine and not the list** — the blueprint above carries every component.
|
|
15
15
|
|
|
@@ -56,7 +56,7 @@ what the role layer exists to prevent.
|
|
|
56
56
|
## Scoped identity
|
|
57
57
|
|
|
58
58
|
```tsx
|
|
59
|
-
<Identity seeds={{ system: { accent: { h:
|
|
59
|
+
<Identity seeds={{ system: { accent: { h: 35, c: 0.78 } } }}>
|
|
60
60
|
{/* this subtree wears another brand over the site's own neutrals */}
|
|
61
61
|
</Identity>
|
|
62
62
|
```
|
|
@@ -205,7 +205,8 @@
|
|
|
205
205
|
* element no longer sets -- a declaration whose subject has gone, which is the shape this house
|
|
206
206
|
* keeps meeting. Blueprint components/accordion.md carries the pass. */
|
|
207
207
|
.newtone-accordion-marker > * {
|
|
208
|
-
|
|
208
|
+
/* motion.duration.quick and easing.standard from 0.6.0: the 0.15s ease-out, by name. */
|
|
209
|
+
transition: transform var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard);
|
|
209
210
|
}
|
|
210
211
|
|
|
211
212
|
.newtone-accordion-row[open] .newtone-accordion-marker > * {
|
|
@@ -216,8 +217,9 @@
|
|
|
216
217
|
block-size: 0;
|
|
217
218
|
overflow: clip;
|
|
218
219
|
transition:
|
|
219
|
-
block-size
|
|
220
|
-
content-visibility
|
|
220
|
+
block-size var(--newtone-motion-duration-quick) var(--newtone-motion-easing-standard),
|
|
221
|
+
content-visibility var(--newtone-motion-duration-quick)
|
|
222
|
+
var(--newtone-motion-easing-standard) allow-discrete;
|
|
221
223
|
}
|
|
222
224
|
|
|
223
225
|
.newtone-accordion-row[open]::details-content {
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* BarList -- blueprint components/bar-list.md. One grid; each row is `display: contents`, so every
|
|
2
|
+
name shares one column as wide as the longest. The share is a registered number so the width
|
|
3
|
+
itself animates and the value rides the bar's end. The bar leaves 3rem for its value. */
|
|
4
|
+
|
|
5
|
+
@property --_bar-list-share {
|
|
6
|
+
syntax: '<number>';
|
|
7
|
+
inherits: false;
|
|
8
|
+
initial-value: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.newtone-bar-list {
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: max-content minmax(0, 1fr);
|
|
14
|
+
align-items: center;
|
|
15
|
+
column-gap: var(--newtone-space-4);
|
|
16
|
+
row-gap: var(--newtone-space-2);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.newtone-bar-list-row {
|
|
20
|
+
display: contents;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.newtone-bar-list-label,
|
|
24
|
+
.newtone-bar-list-value {
|
|
25
|
+
color: var(--newtone-chart-label);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.newtone-bar-list-track {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--newtone-space-2);
|
|
33
|
+
height: var(--newtone-space-5);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* The axis every bar starts on: one segment per row reaching half the gap each way, so they meet. */
|
|
37
|
+
.newtone-bar-list-track::before {
|
|
38
|
+
content: '';
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: calc(var(--newtone-space-2) / -2);
|
|
41
|
+
bottom: calc(var(--newtone-space-2) / -2);
|
|
42
|
+
left: 0;
|
|
43
|
+
width: 1px;
|
|
44
|
+
background: var(--newtone-chart-axis);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.newtone-bar-list-bar {
|
|
48
|
+
flex: none;
|
|
49
|
+
width: calc((100% - 3rem) * var(--_bar-list-share));
|
|
50
|
+
height: 100%;
|
|
51
|
+
border-radius: 0 var(--newtone-chart-radius) var(--newtone-chart-radius) 0;
|
|
52
|
+
background: var(--newtone-chart-mark);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.newtone-bar-list[data-tone='muted'] .newtone-bar-list-bar {
|
|
56
|
+
background: var(--newtone-chart-mark-muted);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.newtone-bar-list[data-fill] {
|
|
60
|
+
height: 100%;
|
|
61
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.newtone-bar-list[data-fill] .newtone-bar-list-track {
|
|
65
|
+
height: 100%;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@keyframes newtone-bar-list-grow {
|
|
69
|
+
from {
|
|
70
|
+
--_bar-list-share: 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
75
|
+
.newtone-bar-list-bar {
|
|
76
|
+
animation: newtone-bar-list-grow var(--newtone-motion-duration-reveal)
|
|
77
|
+
var(--newtone-motion-easing-reveal) both;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Below `stack`, each name above its bar; the rows keep their fixed height. */
|
|
82
|
+
@media (max-width: 40rem) {
|
|
83
|
+
.newtone-bar-list {
|
|
84
|
+
grid-template-columns: minmax(0, 1fr);
|
|
85
|
+
row-gap: var(--newtone-space-1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.newtone-bar-list[data-fill] {
|
|
89
|
+
grid-auto-rows: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.newtone-bar-list[data-fill] .newtone-bar-list-track {
|
|
93
|
+
height: var(--newtone-space-5);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A ranked list of horizontal bars: a name, a bar, and the value riding the bar's end. From 0.6.0,
|
|
4
|
+
* 2026-09-25. Blueprint components/bar-list.md.
|
|
5
|
+
*
|
|
6
|
+
* Names sit in one column as wide as the longest (each row is `display: contents` in one grid), the
|
|
7
|
+
* bars start on one axis rule, and each bar's free end takes `chart.radius`. The bar's WIDTH grows,
|
|
8
|
+
* not a transform of it, so the value after it moves with it. Reads only `--newtone-chart-*`,
|
|
9
|
+
* `--newtone-motion-*` and space steps. The share each bar draws is a private custom property the
|
|
10
|
+
* component writes; no consumer writes one.
|
|
11
|
+
*/
|
|
12
|
+
export interface BarListItem {
|
|
13
|
+
label: ReactNode;
|
|
14
|
+
value: number;
|
|
15
|
+
/** The value as written after the bar: `1.4`, `29`. Defaults to `String(value)`. */
|
|
16
|
+
display?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface BarListProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
items: BarListItem[];
|
|
20
|
+
/** The value a full bar stands for. Defaults to the largest `value`. */
|
|
21
|
+
max?: number;
|
|
22
|
+
/** `mark` (default) or `muted`. */
|
|
23
|
+
tone?: 'mark' | 'muted';
|
|
24
|
+
/** Rows share the height of the list's container. */
|
|
25
|
+
fill?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function BarList({ items, max, tone, fill, className, ...rest }: BarListProps): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=bar-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-list.d.ts","sourceRoot":"","sources":["../../src/bar-list/bar-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGrE;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,EAAE,SAAS,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,oFAAoF;IACpF,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,KAAK,EAAE,WAAW,EAAE,CAAA;IACpB,wEAAwE;IACxE,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACvB,qDAAqD;IACrD,IAAI,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,OAAO,CAAC,EACpB,KAAK,EACL,GAAG,EACH,IAAa,EACb,IAAY,EACZ,SAAS,EACT,GAAG,IAAI,EACV,EAAE,YAAY,+BAoCd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '../text/index.js';
|
|
3
|
+
export function BarList({ items, max, tone = 'mark', fill = false, className, ...rest }) {
|
|
4
|
+
const top = max ?? Math.max(...items.map((item) => item.value));
|
|
5
|
+
return (_jsx("div", { className: className ? `newtone-bar-list ${className}` : 'newtone-bar-list', "data-tone": tone, "data-fill": fill ? '' : undefined, ...rest, children: items.map((item, i) => (_jsxs("div", { className: "newtone-bar-list-row", children: [_jsx(Text, { as: "div", scale: "body-sm", className: "newtone-bar-list-label", children: item.label }), _jsxs("div", { className: "newtone-bar-list-track", children: [_jsx("div", { className: "newtone-bar-list-bar", style: {
|
|
6
|
+
'--_bar-list-share': top > 0 ? item.value / top : 0,
|
|
7
|
+
} }), _jsx(Text, { as: "div", scale: "body-sm", figures: "tabular", className: "newtone-bar-list-value", children: item.display ?? String(item.value) })] })] }, i))) }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=bar-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bar-list.js","sourceRoot":"","sources":["../../src/bar-list/bar-list.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AA6BvC,MAAM,UAAU,OAAO,CAAC,EACpB,KAAK,EACL,GAAG,EACH,IAAI,GAAG,MAAM,EACb,IAAI,GAAG,KAAK,EACZ,SAAS,EACT,GAAG,IAAI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W,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bar-list/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -66,6 +66,11 @@
|
|
|
66
66
|
border-radius: var(--newtone-card-box-radius);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/* No ring, 2026-09-25: `outlined={false}`, for a card whose ground tells it apart. card-box.md. */
|
|
70
|
+
.newtone-card-box[data-outlined='false'] {
|
|
71
|
+
border: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
69
74
|
/* The inner box fills the outer one, so a card stretched taller by a neighbour in the same row
|
|
70
75
|
* distributes over its whole height rather than sitting in the top of an empty ring. `Wrapper` sets
|
|
71
76
|
* no height, so this cannot be out-specified by the inline style it writes -- which is the hazard
|
|
@@ -23,6 +23,9 @@ import type { HTMLAttributes, ReactNode } from 'react';
|
|
|
23
23
|
*
|
|
24
24
|
* outlined true, twice -> not a prop. A box that is sometimes not outlined is a
|
|
25
25
|
* different box, and this one is what a card is made of
|
|
26
|
+
* -> A PROP as of 2026-09-25, defaulting to true: a raised card on
|
|
27
|
+
* a deck slide, whose ground tells it apart, is the same box
|
|
28
|
+
* without its ring. card-box.md
|
|
26
29
|
* padding="xs" 8px, twice -> not a prop. The card ladder's frame term, and nothing here
|
|
27
30
|
* has ever wanted a second value
|
|
28
31
|
* -> A PROP as of 2026-09-06, and the sentence above is what fired
|
|
@@ -106,9 +109,15 @@ export interface CardBoxProps extends HTMLAttributes<HTMLElement> {
|
|
|
106
109
|
* is what every card written before 2026-09-18 does. See the docblock for what asked.
|
|
107
110
|
*/
|
|
108
111
|
elevation?: Elevation;
|
|
112
|
+
/**
|
|
113
|
+
* Whether the card draws its ring. Defaults to `true`. `false` is for a card whose ground already
|
|
114
|
+
* tells it apart -- a raised one -- and arrived 2026-09-25; see card-box.md. It says whether there
|
|
115
|
+
* is a ring, never what colour: that is `--newtone-card-box-ring`, and issue 201's prop.
|
|
116
|
+
*/
|
|
117
|
+
outlined?: boolean;
|
|
109
118
|
/** The card's own class. It lands on the outer element, where a slot minimum belongs. */
|
|
110
119
|
className?: string;
|
|
111
120
|
children?: ReactNode;
|
|
112
121
|
}
|
|
113
|
-
export declare function CardBox({ direction, padding, gap, align, elevation, className, children, ...rest }: CardBoxProps): import("react").JSX.Element;
|
|
122
|
+
export declare function CardBox({ direction, padding, gap, align, elevation, outlined, className, children, ...rest }: CardBoxProps): import("react").JSX.Element;
|
|
114
123
|
//# sourceMappingURL=card-box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-box.d.ts","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"card-box.d.ts","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EAEH,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACxB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC7D,yCAAyC;IACzC,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,oEAAoE;IACpE,GAAG,CAAC,EAAE,SAAS,CAAA;IACf,8DAA8D;IAC9D,KAAK,CAAC,EAAE,YAAY,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,OAAO,CAAC,EACpB,SAAS,EACT,OAAW,EACX,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAe,EACf,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACV,EAAE,YAAY,+BAsBd"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
// The subpaths, not the barrel. `@newtone-dev/ui-react-web` re-exports Navbar, Navbar calls hooks, and
|
|
3
3
|
// this is a server component -- see the repo blueprint, section 4.3.
|
|
4
4
|
import { Surface } from '../surface/index.js';
|
|
5
|
-
import { Wrapper } from '../wrapper/index.js';
|
|
6
|
-
export function CardBox({ direction, padding = 2, gap, align, elevation, className, children, ...rest }) {
|
|
7
|
-
return (_jsx(Surface, { elevation: elevation, className: ['newtone-card-box', className].filter(Boolean).join(' '), ...rest, children: _jsx(Wrapper, { direction: direction, gap: gap, align: align, padding: padding, className: "newtone-card-box-body", children: children }) }));
|
|
5
|
+
import { Wrapper, } from '../wrapper/index.js';
|
|
6
|
+
export function CardBox({ direction, padding = 2, gap, align, elevation, outlined = true, className, children, ...rest }) {
|
|
7
|
+
return (_jsx(Surface, { elevation: elevation, className: ['newtone-card-box', className].filter(Boolean).join(' '), "data-outlined": outlined ? undefined : 'false', ...rest, children: _jsx(Wrapper, { direction: direction, gap: gap, align: align, padding: padding, className: "newtone-card-box-body", children: children }) }));
|
|
8
8
|
}
|
|
9
9
|
//# sourceMappingURL=card-box.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-box.js","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAA;AAC7D,OAAO,
|
|
1
|
+
{"version":3,"file":"card-box.js","sourceRoot":"","sources":["../../src/card-box/card-box.tsx"],"names":[],"mappings":";AAAA,uGAAuG;AACvG,qEAAqE;AACrE,OAAO,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACH,OAAO,GAIV,MAAM,qBAAqB,CAAA;AA0H5B,MAAM,UAAU,OAAO,CAAC,EACpB,SAAS,EACT,OAAO,GAAG,CAAC,EACX,GAAG,EACH,KAAK,EACL,SAAS,EACT,QAAQ,GAAG,IAAI,EACf,SAAS,EACT,QAAQ,EACR,GAAG,IAAI,EACI;IACX,OAAO,CACH,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,mBACrD,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,KACzC,IAAI,YAKR,KAAC,OAAO,IACJ,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,uBAAuB,YAEhC,QAAQ,GACH,GACJ,CACb,CAAA;AACL,CAAC"}
|
|
@@ -95,3 +95,23 @@
|
|
|
95
95
|
);
|
|
96
96
|
gap: var(--newtone-card-grid-gap);
|
|
97
97
|
}
|
|
98
|
+
|
|
99
|
+
/* A COUNT AND A FILL, 2026-09-25. `columns={n}` is n equal tracks above 40rem and one at or below;
|
|
100
|
+
* `--_card-grid-count` is written by the component and by nobody else. `fill` shares the height
|
|
101
|
+
* out between the rows, above 40rem, like BarList's and ColumnChart's. card-grid.md. */
|
|
102
|
+
@media (min-width: 40.001rem) {
|
|
103
|
+
.newtone-card-grid--columns[data-count] {
|
|
104
|
+
grid-template-columns: repeat(var(--_card-grid-count), minmax(0, 1fr));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.newtone-card-grid--columns[data-fill] {
|
|
108
|
+
height: 100%;
|
|
109
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (max-width: 40rem) {
|
|
114
|
+
.newtone-card-grid--columns[data-count] {
|
|
115
|
+
grid-template-columns: minmax(0, 1fr);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -56,8 +56,13 @@ export interface CardGridProps extends HTMLAttributes<HTMLElement> {
|
|
|
56
56
|
* Equal tracks, as many as fit, at a floor -- rather than cards that each keep their own floor
|
|
57
57
|
* and share out what is left. Defaults off, which is what two of the three call sites want.
|
|
58
58
|
*/
|
|
59
|
-
columns?: boolean;
|
|
59
|
+
columns?: boolean | number;
|
|
60
|
+
/**
|
|
61
|
+
* The column mode's rows share the container's height, above 40rem. The same word and breakpoint
|
|
62
|
+
* as `BarList` and `ColumnChart`; it sets `data-fill`, which a filling container grows.
|
|
63
|
+
*/
|
|
64
|
+
fill?: boolean;
|
|
60
65
|
children?: ReactNode;
|
|
61
66
|
}
|
|
62
|
-
export declare function CardGrid({ columns, children, className, ...rest }: CardGridProps): import("react").JSX.Element;
|
|
67
|
+
export declare function CardGrid({ columns, fill, children, className, style, ...rest }: CardGridProps): import("react").JSX.Element;
|
|
63
68
|
//# sourceMappingURL=card-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-grid.d.ts","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"card-grid.d.ts","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC9D;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IAI1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,QAAQ,CAAC,EAAE,SAAS,CAAA;CACvB;AAED,wBAAgB,QAAQ,CAAC,EACrB,OAAO,EACP,IAAY,EACZ,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACV,EAAE,aAAa,+BA0Cf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Wrapper } from '../wrapper/index.js';
|
|
3
|
-
export function CardGrid({ columns, children, className, ...rest }) {
|
|
3
|
+
export function CardGrid({ columns, fill = false, children, className, style, ...rest }) {
|
|
4
4
|
// The tracks are a rule in card-grid.css, not props: invariant per row kind, which is
|
|
5
5
|
// card-box.tsx's argument unchanged.
|
|
6
6
|
//
|
|
@@ -11,7 +11,9 @@ export function CardGrid({ columns, children, className, ...rest }) {
|
|
|
11
11
|
// custom property does not have to reach this element to be read by it. card-grid.css carries
|
|
12
12
|
// the three values that produced that answer and the two candidates it beat.
|
|
13
13
|
if (columns) {
|
|
14
|
-
return (_jsx("div", { className: ['newtone-card-grid--columns', className].filter(Boolean).join(' '),
|
|
14
|
+
return (_jsx("div", { className: ['newtone-card-grid--columns', className].filter(Boolean).join(' '), "data-count": typeof columns === 'number' ? '' : undefined, "data-fill": fill ? '' : undefined, style: typeof columns === 'number'
|
|
15
|
+
? { '--_card-grid-count': columns, ...style }
|
|
16
|
+
: style, ...rest, children: children }));
|
|
15
17
|
}
|
|
16
18
|
// gap={4} is 16px, the original's own gutter between cards at every width. It writes a narrower
|
|
17
19
|
// horizontal one on a phone, on the argument that a gap there is width taken from the cards on
|
|
@@ -22,6 +24,6 @@ export function CardGrid({ columns, children, className, ...rest }) {
|
|
|
22
24
|
// because a prop cannot be read by a stylesheet and a rule cannot be read by a call site. The
|
|
23
25
|
// two sit a few lines apart, which makes it readable rather than safe. Trigger for making it
|
|
24
26
|
// one: a third writer of the card gutter, or the gutter changing.
|
|
25
|
-
return (_jsx(Wrapper, { direction: "row", wrap: true, gap: 4, className: className, ...rest, children: children }));
|
|
27
|
+
return (_jsx(Wrapper, { direction: "row", wrap: true, gap: 4, className: className, style: style, ...rest, children: children }));
|
|
26
28
|
}
|
|
27
29
|
//# sourceMappingURL=card-grid.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-grid.js","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"card-grid.js","sourceRoot":"","sources":["../../src/card-grid/card-grid.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAwE7C,MAAM,UAAU,QAAQ,CAAC,EACrB,OAAO,EACP,IAAI,GAAG,KAAK,EACZ,QAAQ,EACR,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACK;IACZ,sFAAsF;IACtF,qCAAqC;IACrC,EAAE;IACF,6FAA6F;IAC7F,wGAAwG;IACxG,2FAA2F;IAC3F,6FAA6F;IAC7F,8FAA8F;IAC9F,6EAA6E;IAC7E,IAAI,OAAO,EAAE,CAAC;QACV,OAAO,CACH,cACI,SAAS,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,gBAClE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,eAC7C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAChC,KAAK,EACD,OAAO,OAAO,KAAK,QAAQ;gBACvB,CAAC,CAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,GAAG,KAAK,EAAoB;gBAChE,CAAC,CAAC,KAAK,KAEX,IAAI,YAEP,QAAQ,GACP,CACT,CAAA;IACL,CAAC;IAED,gGAAgG;IAChG,+FAA+F;IAC/F,4FAA4F;IAC5F,8FAA8F;IAC9F,EAAE;IACF,6FAA6F;IAC7F,8FAA8F;IAC9F,6FAA6F;IAC7F,kEAAkE;IAClE,OAAO,CACH,KAAC,OAAO,IAAC,SAAS,EAAC,KAAK,EAAC,IAAI,QAAC,GAAG,EAAE,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,KAAM,IAAI,YAC7E,QAAQ,GACH,CACb,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* ChartKey -- blueprint components/chart-key.md. */
|
|
2
|
+
|
|
3
|
+
.newtone-chart-key {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
gap: var(--newtone-space-2) var(--newtone-space-6);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.newtone-chart-key-item {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--newtone-space-2);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.newtone-chart-key-swatch {
|
|
16
|
+
flex: none;
|
|
17
|
+
width: 0.875rem;
|
|
18
|
+
height: 0.875rem;
|
|
19
|
+
border-radius: var(--newtone-chart-radius);
|
|
20
|
+
background: var(--newtone-chart-mark);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.newtone-chart-key-swatch[data-tone='muted'] {
|
|
24
|
+
background: var(--newtone-chart-mark-muted);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.newtone-chart-key-swatch[data-tone='off'] {
|
|
28
|
+
background: var(--newtone-chart-mark-off);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.newtone-chart-key-label {
|
|
32
|
+
color: var(--newtone-chart-label);
|
|
33
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The legend for a chart whose colours mean something it cannot label in place. From 0.6.0,
|
|
4
|
+
* 2026-09-25. Blueprint components/chart-key.md. A separate part on purpose: where a reader finds the
|
|
5
|
+
* key belongs to the page.
|
|
6
|
+
*/
|
|
7
|
+
export interface ChartKeyItem {
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
tone: 'mark' | 'muted' | 'off';
|
|
10
|
+
}
|
|
11
|
+
export interface ChartKeyProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
items: ChartKeyItem[];
|
|
13
|
+
}
|
|
14
|
+
export declare function ChartKey({ items, className, ...rest }: ChartKeyProps): import("react").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=chart-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-key.d.ts","sourceRoot":"","sources":["../../src/chart-key/chart-key.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtD;;;;GAIG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,SAAS,CAAA;IAChB,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAA;CACjC;AAED,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;IACjE,KAAK,EAAE,YAAY,EAAE,CAAA;CACxB;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,aAAa,+BAoBpE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from '../text/index.js';
|
|
3
|
+
export function ChartKey({ items, className, ...rest }) {
|
|
4
|
+
return (_jsx("div", { className: className ? `newtone-chart-key ${className}` : 'newtone-chart-key', ...rest, children: items.map((item, i) => (_jsxs("div", { className: "newtone-chart-key-item", children: [_jsx("span", { className: "newtone-chart-key-swatch", "data-tone": item.tone, "aria-hidden": "true" }), _jsx(Text, { as: "span", scale: "body-sm", className: "newtone-chart-key-label", children: item.label })] }, i))) }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=chart-key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chart-key.js","sourceRoot":"","sources":["../../src/chart-key/chart-key.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAgBvC,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,IAAI,EAAiB;IACjE,OAAO,CACH,cACI,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,qBAAqB,SAAS,EAAE,CAAC,CAAC,CAAC,mBAAmB,KACzE,IAAI,YAEP,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,eAAa,SAAS,EAAC,wBAAwB,aAC3C,eACI,SAAS,EAAC,0BAA0B,eACzB,IAAI,CAAC,IAAI,iBACR,MAAM,GACpB,EACF,KAAC,IAAI,IAAC,EAAE,EAAC,MAAM,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAC,yBAAyB,YAC9D,IAAI,CAAC,KAAK,GACR,KARD,CAAC,CASL,CACT,CAAC,GACA,CACT,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chart-key/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/chart-key/index.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/color/seeds.d.ts
CHANGED
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
* There is no lightness, because lightness is a property of the job a colour is doing and
|
|
9
9
|
* the job is not known until a role asks for it. There is no `key` either: a key selects
|
|
10
10
|
* which step a role reads, and roles are references resolved at build time.
|
|
11
|
+
*
|
|
12
|
+
* **`h` and `c` are both narrower than `number`, and the narrowing is not here.** contracts/seeds.md
|
|
13
|
+
* section 1.1: a hue is a whole number of degrees and a saturation carries at most two decimal
|
|
14
|
+
* places. TypeScript cannot say either of those about a `number`, and anything it could say would
|
|
15
|
+
* be erased the moment a seed arrives through `JSON.parse` or an identity API -- which is how every
|
|
16
|
+
* seed in this house arrives. **So `validateSeeds` below is the type**, and asked to "fix the type"
|
|
17
|
+
* this is the honest answer: the interface names the fields, the validator names the values.
|
|
11
18
|
*/
|
|
12
19
|
export interface Seed {
|
|
13
20
|
h: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../src/color/seeds.ts"],"names":[],"mappings":"AAcA
|
|
1
|
+
{"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../src/color/seeds.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,IAAI;IACjB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE3C,mFAAmF;AACnF,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AA+FpE;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,EAAE,CA0CpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,UAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuB1F"}
|
package/dist/color/seeds.js
CHANGED
|
@@ -80,6 +80,18 @@ const inRange = (v, [lo, hi]) => typeof v === 'number' && v >= lo && v <= hi;
|
|
|
80
80
|
// Echoed as the person typed it. Re-rendering someone's input in a different shape makes a
|
|
81
81
|
// message harder to match against the file it came from -- 0.21, never 0.2100.
|
|
82
82
|
const fmt = (v) => (typeof v === 'number' ? String(v) : JSON.stringify(v));
|
|
83
|
+
// contracts/seeds.md section 1.1. A hue is a whole number of degrees; a saturation carries at most
|
|
84
|
+
// two decimal places. Refusals rather than roundings, here for the same reason as in the build: a
|
|
85
|
+
// value nothing can render is a value somebody typed by mistake, and silently fixing it hides the
|
|
86
|
+
// mistake. One JND in OKLab is about 0.002; one degree of hue buys at most 0.0044 of difference and
|
|
87
|
+
// one 0.01 step of c between 0.0013 and 0.0031.
|
|
88
|
+
//
|
|
89
|
+
// THE SATURATION PREDICATE IS `c === Number(c.toFixed(2))`, NOT `Math.round(c * 100) === c * 100`.
|
|
90
|
+
// The second is wrong and rejects 0.14, because `0.14 * 100` is `14.000000000000002` -- along with
|
|
91
|
+
// 0.07, 0.29, 0.57 and 0.58. Both implementations carry the same warning because both would have
|
|
92
|
+
// reached for the same wrong form.
|
|
93
|
+
const isWholeDegree = (n) => Number.isInteger(n);
|
|
94
|
+
const isTwoDecimals = (n) => typeof n === 'number' && n === Number(n.toFixed(2));
|
|
83
95
|
/**
|
|
84
96
|
* Every way this seed set breaks the contract, as the build's own message strings.
|
|
85
97
|
*
|
|
@@ -100,10 +112,17 @@ export function validateSeeds(seeds) {
|
|
|
100
112
|
errs.push(`unknown system palette "${name}"`);
|
|
101
113
|
continue;
|
|
102
114
|
}
|
|
115
|
+
// Range first, granularity as an `else if`. A value that is both out of range and badly
|
|
116
|
+
// grained reports the range only -- the precision of a number nobody should be looking at
|
|
117
|
+
// yet is not the thing to tell them. Same shape as the build's checkKey.
|
|
103
118
|
if (!inRange(seed?.h, rule.h))
|
|
104
119
|
errs.push(`seed color.${name}.h ${fmt(seed?.h)} outside [${rule.h[0]}, ${rule.h[1]}]`);
|
|
120
|
+
else if (!isWholeDegree(seed?.h))
|
|
121
|
+
errs.push(`seed color.${name}.h ${fmt(seed?.h)} is not a whole degree`);
|
|
105
122
|
if (!inRange(seed?.c, rule.c))
|
|
106
123
|
errs.push(`seed color.${name}.c ${fmt(seed?.c)} outside [${rule.c[0].toFixed(3)}, ${rule.c[1].toFixed(3)}]`);
|
|
124
|
+
else if (!isTwoDecimals(seed?.c))
|
|
125
|
+
errs.push(`seed color.${name}.c ${fmt(seed?.c)} is finer than two decimals`);
|
|
107
126
|
}
|
|
108
127
|
for (const [name, seed] of Object.entries(seeds.custom ?? {})) {
|
|
109
128
|
const range = CUSTOM[name];
|
|
@@ -113,6 +132,8 @@ export function validateSeeds(seeds) {
|
|
|
113
132
|
}
|
|
114
133
|
if (!inRange(seed?.h, range))
|
|
115
134
|
errs.push(`seed color.custom.${name}.h ${fmt(seed?.h)} outside [${range[0]}, ${range[1]}]`);
|
|
135
|
+
else if (!isWholeDegree(seed?.h))
|
|
136
|
+
errs.push(`seed color.custom.${name}.h ${fmt(seed?.h)} is not a whole degree`);
|
|
116
137
|
// The rule section 7 could not put in the build's list, and said so: a custom palette is
|
|
117
138
|
// "the group you customise" along ONE axis. Hue is the person's; saturation and key are ours.
|
|
118
139
|
if (seed?.c !== undefined)
|
package/dist/color/seeds.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seeds.js","sourceRoot":"","sources":["../../src/color/seeds.ts"],"names":[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AE,EAAE,CAAC;gBACtC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;gBACnC,KAAK,CAAC,mBAAmB,KAAK,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC,GAAG,IAAI;oBACpD,CAAC,CAAC,SAAS,SAAS,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG;oBACnF,CAAC,CAAC,IAAI,CAAA;YACd,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAA;AAChB,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* ColumnChart -- blueprint components/column-chart.md. Columns 1px apart on one baseline, tops at
|
|
2
|
+
chart.radius, growing up from the baseline (a transform: nothing rides a column's end). */
|
|
3
|
+
|
|
4
|
+
.newtone-column-chart {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: var(--newtone-space-2);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.newtone-column-chart-plot {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: flex-end;
|
|
13
|
+
gap: 1px;
|
|
14
|
+
height: 20rem;
|
|
15
|
+
border-bottom: 1px solid var(--newtone-chart-axis);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* Filling a container is a wide-screen behaviour: below `stack` a container is not stretched, and a plot
|
|
19
|
+
that took "the height left" would take none. The fixed heights hold there. */
|
|
20
|
+
@media (min-width: 40.001rem) {
|
|
21
|
+
.newtone-column-chart[data-fill] {
|
|
22
|
+
height: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.newtone-column-chart[data-fill] .newtone-column-chart-plot {
|
|
26
|
+
flex: 1;
|
|
27
|
+
min-height: 0;
|
|
28
|
+
height: auto;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.newtone-column-chart-column {
|
|
33
|
+
flex: 1;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
justify-content: flex-end;
|
|
37
|
+
height: calc(var(--_column-chart-share) * 100%);
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
border-radius: var(--newtone-chart-radius) var(--newtone-chart-radius) 0 0;
|
|
40
|
+
background: var(--newtone-chart-mark);
|
|
41
|
+
transform-origin: bottom;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.newtone-column-chart-column[data-tone='muted'] {
|
|
45
|
+
background: var(--newtone-chart-mark-muted);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.newtone-column-chart-column[data-tone='off'] {
|
|
49
|
+
background: var(--newtone-chart-mark-off);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.newtone-column-chart-inner {
|
|
53
|
+
flex: none;
|
|
54
|
+
height: calc(var(--_column-chart-inner) * 100%);
|
|
55
|
+
background: var(--newtone-chart-mark);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.newtone-column-chart-ticks {
|
|
59
|
+
position: relative;
|
|
60
|
+
height: var(--newtone-space-5);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.newtone-column-chart-tick {
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: calc(var(--_column-chart-at) * 100%);
|
|
66
|
+
transform: translateX(-50%);
|
|
67
|
+
color: var(--newtone-chart-label);
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@keyframes newtone-column-chart-grow {
|
|
72
|
+
from {
|
|
73
|
+
transform: scaleY(0);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media screen and (prefers-reduced-motion: no-preference) {
|
|
78
|
+
.newtone-column-chart-column {
|
|
79
|
+
animation: newtone-column-chart-grow var(--newtone-motion-duration-reveal)
|
|
80
|
+
var(--newtone-motion-easing-reveal) both;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (max-width: 40rem) {
|
|
85
|
+
.newtone-column-chart-plot {
|
|
86
|
+
gap: 0;
|
|
87
|
+
height: 12rem;
|
|
88
|
+
}
|
|
89
|
+
}
|