@apliteni/apliteni-ui 0.180.0 → 0.184.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/docs/components.md +66 -17
- package/guidelines/account-and-settings.md +13 -13
- package/package.json +1 -1
- package/react/README.md +22 -2
- package/react/dist/index.css +117 -0
- package/react/dist/index.d.ts +25 -6
- package/react/dist/index.js +390 -208
- package/src/styles/card.css +10 -1
- package/src/styles/chart.css +33 -21
- package/src/styles/table.css +17 -0
- package/src/tokens/tokens.css +3 -0
package/src/styles/card.css
CHANGED
|
@@ -179,8 +179,17 @@
|
|
|
179
179
|
/* The Theme choice needs 195px and the narrowest settings row gives it 160. Its pills
|
|
180
180
|
give up inline padding as the viewport narrows. Other choices keep their tap width. */
|
|
181
181
|
@media (max-width: 560px) {
|
|
182
|
+
.ui-card__row--tight-choice > .ui-seg:not(.ui-seg--sm):not(.ui-seg--underline) {
|
|
183
|
+
--ui-row-choice-pad: clamp(var(--space-1), calc(var(--space-3) - (360px - 100vw) * 0.3), var(--space-3));
|
|
184
|
+
}
|
|
182
185
|
.ui-card__row--tight-choice > .ui-seg:not(.ui-seg--sm):not(.ui-seg--underline) button {
|
|
183
|
-
padding-inline:
|
|
186
|
+
padding-inline: var(--ui-row-choice-pad);
|
|
187
|
+
}
|
|
188
|
+
/* A stacked choice draws no track on the card, so its first label goes back to the
|
|
189
|
+
row's text edge: the track's padding plus the first pill's. The pill hangs into the
|
|
190
|
+
card's padding. why: guidelines/spacing.md#put-text-on-the-column-edge */
|
|
191
|
+
.ui-card__row > .ui-seg:not(.ui-seg--underline) {
|
|
192
|
+
margin-inline-start: calc(-1 * (var(--space-1) + var(--ui-row-choice-pad, var(--space-3))));
|
|
184
193
|
}
|
|
185
194
|
}
|
|
186
195
|
.ui-card__row + .ui-card__row { border-top: 1px solid var(--border); }
|
package/src/styles/chart.css
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* ============================================================================
|
|
2
2
|
* Chart — .ui-chart, the shapes a money dashboard keeps redrawing.
|
|
3
3
|
* .ui-chart__head the opt-in legend and the chart and table switch
|
|
4
|
-
* .ui-chart__legend one key per series
|
|
4
|
+
* .ui-chart__legend one key per series
|
|
5
5
|
* .ui-chart__frame the tab stop; the value axis beside the scroller
|
|
6
6
|
* .ui-chart__scroll the scroller
|
|
7
7
|
* .ui-chart__plot the drawing and its column labels
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
.ui-chart {
|
|
14
14
|
--ui-chart-col: var(--space-12);
|
|
15
|
-
/* The ground the marks are drawn on, so
|
|
16
|
-
|
|
15
|
+
/* The ground the marks are drawn on, so a point and the rim the line is
|
|
16
|
+
carried on read as cut out of it. A chart outside a card names its
|
|
17
17
|
own. */
|
|
18
18
|
--ui-chart-ground: var(--surface);
|
|
19
19
|
/* The tick's own line box. The axis spans the band the gridlines are drawn
|
|
@@ -65,12 +65,6 @@
|
|
|
65
65
|
.ui-chart__key-mark { flex: none; }
|
|
66
66
|
.ui-chart__key-swatch { fill: var(--ui-chart-tone); }
|
|
67
67
|
.ui-chart__key-line { fill: none; stroke: var(--ui-chart-tone); stroke-width: 2; stroke-linecap: round; }
|
|
68
|
-
.ui-chart__key-estimated {
|
|
69
|
-
fill: var(--ui-chart-tone);
|
|
70
|
-
stroke: var(--ui-chart-ground);
|
|
71
|
-
stroke-width: 1;
|
|
72
|
-
stroke-dasharray: 2 2;
|
|
73
|
-
}
|
|
74
68
|
|
|
75
69
|
/* -- the frame ------------------------------------------------------------- */
|
|
76
70
|
|
|
@@ -94,8 +88,12 @@
|
|
|
94
88
|
display: flex;
|
|
95
89
|
flex-direction: column;
|
|
96
90
|
justify-content: space-between;
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
/* The component sets the band's top and bottom edges past the room that the
|
|
92
|
+
group label and the bars' values take. */
|
|
93
|
+
height: calc(var(--ui-chart-h) - var(--ui-chart-top, var(--ui-chart-pad))
|
|
94
|
+
- var(--ui-chart-bottom, var(--ui-chart-pad)) + var(--ui-chart-tick));
|
|
95
|
+
margin-block: calc(var(--ui-chart-top, var(--ui-chart-pad)) - var(--ui-chart-tick) / 2)
|
|
96
|
+
calc(var(--ui-chart-bottom, var(--ui-chart-pad)) - var(--ui-chart-tick) / 2);
|
|
99
97
|
text-align: right;
|
|
100
98
|
font-variant-numeric: tabular-nums;
|
|
101
99
|
}
|
|
@@ -110,6 +108,8 @@
|
|
|
110
108
|
}
|
|
111
109
|
|
|
112
110
|
.ui-chart__plot { min-width: calc(var(--ui-chart-col) * var(--ui-chart-cols, 1)); }
|
|
111
|
+
/* The months chart's periods share the card's width, so it never scrolls. */
|
|
112
|
+
.ui-chart--months .ui-chart__plot { min-width: 0; }
|
|
113
113
|
.ui-chart__svg { display: block; }
|
|
114
114
|
|
|
115
115
|
.ui-chart__periods {
|
|
@@ -133,6 +133,17 @@
|
|
|
133
133
|
weight a reader who separates no colours still reads. Selection is otherwise
|
|
134
134
|
the band behind the column and the band alone — the outline the chart draws
|
|
135
135
|
belongs to focus. */
|
|
136
|
+
/* Where the labels do not fit, the component prints every n-th one. A printed
|
|
137
|
+
label keeps one line, centred on its column, or on the plot's edge. */
|
|
138
|
+
.ui-chart__periods--step { grid-template-columns: repeat(var(--ui-chart-cols, 1), minmax(0, 1fr)); }
|
|
139
|
+
.ui-chart__periods--step .ui-chart__period {
|
|
140
|
+
justify-self: center;
|
|
141
|
+
width: max-content;
|
|
142
|
+
padding-inline: 0;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
}
|
|
145
|
+
.ui-chart__periods--step .ui-chart__period.is-start { justify-self: start; }
|
|
146
|
+
.ui-chart__periods--step .ui-chart__period.is-end { justify-self: end; }
|
|
136
147
|
.ui-chart__period.is-selected {
|
|
137
148
|
color: var(--strong);
|
|
138
149
|
font-weight: 600;
|
|
@@ -172,13 +183,6 @@
|
|
|
172
183
|
/* The ramp's two stops. Each reads the tone of the gradient that holds it. */
|
|
173
184
|
.ui-chart__fade-base { stop-color: var(--ui-chart-fade); }
|
|
174
185
|
.ui-chart__fade-end { stop-color: var(--ui-chart-tone); }
|
|
175
|
-
/* Keep each series' fill. Ground-coloured dashes mark unfinished data
|
|
176
|
-
without joining the mirrored bars across the zero channel. */
|
|
177
|
-
.ui-chart__bar.is-estimated {
|
|
178
|
-
stroke: var(--ui-chart-ground);
|
|
179
|
-
stroke-width: 1;
|
|
180
|
-
stroke-dasharray: 3 2;
|
|
181
|
-
}
|
|
182
186
|
|
|
183
187
|
/* An isolated value has no segment to draw it. Connected points need no dot. */
|
|
184
188
|
.ui-chart__isolated { fill: var(--ui-chart-tone); stroke: var(--ui-chart-ground); stroke-width: 1; }
|
|
@@ -189,7 +193,6 @@
|
|
|
189
193
|
stroke-width: 2;
|
|
190
194
|
stroke-linecap: round;
|
|
191
195
|
}
|
|
192
|
-
.ui-chart__line.is-estimated { stroke-dasharray: 5 3; }
|
|
193
196
|
|
|
194
197
|
/* The ground carried under the line. The line crosses bars of its own family,
|
|
195
198
|
where hue alone separates them and luminance does not: a stroke of the ground
|
|
@@ -243,7 +246,7 @@
|
|
|
243
246
|
/* The rule under the column the reader is on. It is the zero rule's weight: a
|
|
244
247
|
line read across, not a mark. */
|
|
245
248
|
.ui-chart__cross { stroke: var(--border-strong); stroke-width: 1; }
|
|
246
|
-
/* A point, cut out of the ground
|
|
249
|
+
/* A point, cut out of the ground, so two lines that
|
|
247
250
|
meet still show both points. */
|
|
248
251
|
.ui-chart__dot { fill: var(--ui-chart-tone); stroke: var(--ui-chart-ground); stroke-width: 2; }
|
|
249
252
|
.ui-chart--line-thin .ui-chart__line { stroke-width: 1.5; }
|
|
@@ -266,10 +269,16 @@
|
|
|
266
269
|
stroke-width: 2;
|
|
267
270
|
stroke-linejoin: round;
|
|
268
271
|
}
|
|
269
|
-
.ui-chart__segment.is-estimated { stroke-dasharray: 3 2; }
|
|
270
272
|
/* Words drawn in the plot: a value at a line's end, a row's total, a slice's
|
|
271
273
|
name. They are the chart's own figures, so they take the body ink. */
|
|
272
274
|
.ui-chart__text { fill: var(--text); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
|
|
275
|
+
.ui-chart__value { text-anchor: middle; }
|
|
276
|
+
.ui-chart__value--below { dominant-baseline: hanging; }
|
|
277
|
+
/* The boundary before the first period that is not final, and the words over
|
|
278
|
+
that group. The line is the focus ring's width in the neutral chart tone, and
|
|
279
|
+
solid: a dash would read as a mark of its own. */
|
|
280
|
+
.ui-chart__boundary { stroke: var(--chart-neutral); stroke-width: var(--ring-width); }
|
|
281
|
+
.ui-chart__group { font-weight: var(--weight-medium); }
|
|
273
282
|
.ui-chart__text--strong { fill: var(--strong); font-weight: var(--weight-semibold); }
|
|
274
283
|
.ui-chart__total {
|
|
275
284
|
fill: var(--strong);
|
|
@@ -352,6 +361,9 @@
|
|
|
352
361
|
their height would hide the last period behind a second scrollbar. */
|
|
353
362
|
.ui-chart__data .ui-table-scroll { --ui-table-height: none; }
|
|
354
363
|
.ui-chart__data .ui-table { margin: 0; }
|
|
364
|
+
/* A period that is not final keeps its solid mark in the series ink: the
|
|
365
|
+
readout and the table name its state. */
|
|
366
|
+
|
|
355
367
|
/* Why a period is not final is a sentence, not a label, so it wraps under the
|
|
356
368
|
period it qualifies instead of carrying the money columns another two hundred
|
|
357
369
|
pixels to the right of a 390px card. */
|
package/src/styles/table.css
CHANGED
|
@@ -405,6 +405,19 @@
|
|
|
405
405
|
@container not scroll-state(scrollable: x) {
|
|
406
406
|
.ui-table--pinned :is(.ui-table__identity, .ui-table__selection) { border-right-color: transparent; }
|
|
407
407
|
}
|
|
408
|
+
/* Once the frame is scrolled, the next column's text keeps its cell padding from the
|
|
409
|
+
divider: the pinned cell lays its own ground over that padding, so the text that moves
|
|
410
|
+
under the pin stops short of the line. A frame at rest paints nothing more. The gap is
|
|
411
|
+
the next cell's padding, set beside each padding rule below. Below 720px the cell cuts
|
|
412
|
+
what overflows it, so its cut reaches past the divider to hold the widest band, 12px and
|
|
413
|
+
the 1px line. A plain step, because Chromium computes a calc() here as 0px. why: #845 */
|
|
414
|
+
@container scroll-state(scrollable: left) {
|
|
415
|
+
.ui-table--pinned .ui-table__identity { overflow-clip-margin: var(--space-4); }
|
|
416
|
+
.ui-table--pinned .ui-table__identity::after {
|
|
417
|
+
content: ''; position: absolute; top: 0; bottom: 0; left: calc(100% + 1px);
|
|
418
|
+
width: var(--ui-table-pin-gap, var(--space-3)); background: inherit; pointer-events: none;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
408
421
|
.ui-value, .ui-delta { white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
409
422
|
.ui-value__unit { margin-left: var(--space-1); font-size: var(--text-xs); color: var(--text); }
|
|
410
423
|
.ui-delta--success { color: var(--chip-success-ink); }
|
|
@@ -545,6 +558,10 @@ a.ui-identity:hover { text-decoration: underline; }
|
|
|
545
558
|
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) .ui-table__identity + :is(th, td) { padding-left: var(--space-2); }
|
|
546
559
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) .ui-table__identity { padding-right: calc(var(--cell-gap) / 2); }
|
|
547
560
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) .ui-table__identity + :is(th, td) { padding-left: calc(var(--cell-gap) / 2); }
|
|
561
|
+
/* The scrolled frame's gap after the divider, the same as the padding above. A dense or
|
|
562
|
+
compact cell pads by --space-3, the gap's fallback. */
|
|
563
|
+
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) .ui-table__identity { --ui-table-pin-gap: var(--space-2); }
|
|
564
|
+
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) .ui-table__identity { --ui-table-pin-gap: calc(var(--cell-gap) / 2); }
|
|
548
565
|
/* A link that fills a pinned cell carries the cell's padding, so it gives up the same half. */
|
|
549
566
|
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) td.ui-table__identity.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
|
|
550
567
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) td.ui-table__identity.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding-right: calc(var(--cell-gap) / 2); }
|
package/src/tokens/tokens.css
CHANGED
|
@@ -115,7 +115,9 @@
|
|
|
115
115
|
/* ============================================================================
|
|
116
116
|
* DARK THEME (default) — deck palette from viz/index.html
|
|
117
117
|
* ========================================================================== */
|
|
118
|
+
/* A ThemeChoice scene draws this theme inside a page of either theme. */
|
|
118
119
|
:root,
|
|
120
|
+
.ui-theme-choice__scene--dark,
|
|
119
121
|
:root[data-theme="dark"] {
|
|
120
122
|
color-scheme: dark;
|
|
121
123
|
|
|
@@ -369,6 +371,7 @@
|
|
|
369
371
|
* A document sheet (.ui-card__page) takes this palette in both themes: the document
|
|
370
372
|
* is paper, so it stays white with dark ink on a dark stage too. Decided on #736.
|
|
371
373
|
* ========================================================================== */
|
|
374
|
+
.ui-theme-choice__scene--light,
|
|
372
375
|
.ui-card__page,
|
|
373
376
|
:root[data-theme="light"] {
|
|
374
377
|
color-scheme: light;
|