@apliteni/apliteni-ui 0.57.0 → 0.58.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/package.json +1 -1
- package/react/dist/index.css +51 -51
- package/react/dist/index.d.ts +6 -2
- package/react/dist/index.js +530 -494
- package/src/components/table-values.js +1 -1
- package/src/styles/segmented.css +19 -7
- package/src/styles/table.css +11 -0
|
@@ -7,7 +7,7 @@ export function numericValue({ value, unit = '', missing = 'Not available' } = {
|
|
|
7
7
|
|
|
8
8
|
export function deltaValue({ value, tone = 'neutral', basisId, missing = 'No earlier figure' } = {}) {
|
|
9
9
|
const present = value != null && value !== '';
|
|
10
|
-
const judged = present && ['success', 'danger'].includes(tone) && !/^[+−-]?0(?:[.,]0+)
|
|
10
|
+
const judged = present && ['success', 'danger'].includes(tone) && !/^[+−-]?0+(?:[.,]0+)?(?:[^\d.,].*)?$/.test(String(value).replace(/\s/g, ''));
|
|
11
11
|
return `<span class="ui-delta${judged ? ` ui-delta--${tone}` : ''}"${basisId ? ` aria-describedby="${esc(basisId)}"` : ''}>${esc(present ? value : missing)}</span>`;
|
|
12
12
|
}
|
|
13
13
|
|
package/src/styles/segmented.css
CHANGED
|
@@ -3,16 +3,23 @@
|
|
|
3
3
|
* The selected button keeps the reading surface and gains an accent edge.
|
|
4
4
|
* ========================================================================== */
|
|
5
5
|
|
|
6
|
+
/* The strip wraps rather than overflows: a track wider than its column used to
|
|
7
|
+
push the page's scrollWidth past the viewport, which drags every sibling with
|
|
8
|
+
it. Wrapping keeps the focus ring's glow unclipped, which `overflow: auto`
|
|
9
|
+
here would not. #435 */
|
|
6
10
|
.ui-seg {
|
|
7
11
|
display: inline-flex;
|
|
8
12
|
/* `inline-flex` sizes the track to its pills, but a flex or grid parent stretches a
|
|
9
13
|
child whatever its display says — and .ui-app__body is a flex column. The control
|
|
10
14
|
states its own alignment; --block and --underline ask for the width back. */
|
|
11
15
|
align-self: start;
|
|
16
|
+
justify-self: start;
|
|
12
17
|
background: var(--surface); --ring-gap: var(--surface);
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
max-width: 100%;
|
|
13
20
|
border-radius: var(--radius-2xl);
|
|
14
|
-
padding:
|
|
15
|
-
gap:
|
|
21
|
+
padding: var(--space-1);
|
|
22
|
+
gap: var(--space-1);
|
|
16
23
|
}
|
|
17
24
|
.ui-seg button {
|
|
18
25
|
font-family: var(--font-sans);
|
|
@@ -22,10 +29,10 @@
|
|
|
22
29
|
color: var(--text);
|
|
23
30
|
background: none;
|
|
24
31
|
border: 0;
|
|
25
|
-
padding:
|
|
32
|
+
padding: var(--space-2) var(--space-4);
|
|
26
33
|
border-radius: var(--radius-2xl);
|
|
27
34
|
cursor: pointer;
|
|
28
|
-
transition: color var(--dur-
|
|
35
|
+
transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
|
|
29
36
|
}
|
|
30
37
|
.ui-seg button:hover { color: var(--strong); }
|
|
31
38
|
/* aria-pressed is what segmented() emits now; aria-selected is kept so markup
|
|
@@ -38,8 +45,13 @@
|
|
|
38
45
|
outline: 1px solid var(--accent);
|
|
39
46
|
}
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
/* Standard pills tighten on phones so six short month names fit one row. */
|
|
49
|
+
@media (max-width: 560px) {
|
|
50
|
+
.ui-seg:not(.ui-seg--sm):not(.ui-seg--underline) button { padding: var(--space-2) var(--space-3); }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.ui-seg--sm button { min-height: var(--space-6); padding: var(--space-1) var(--space-3); font-size: calc(var(--text-xs) + 1px); }
|
|
54
|
+
.ui-seg--block { display: flex; align-self: stretch; justify-self: stretch; }
|
|
43
55
|
.ui-seg--block button { flex: 1; }
|
|
44
56
|
|
|
45
57
|
/* Accent picker — round colour swatches, active gets a ring */
|
|
@@ -61,7 +73,7 @@
|
|
|
61
73
|
}
|
|
62
74
|
.ui-accent-picker button:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring); }
|
|
63
75
|
|
|
64
|
-
.ui-seg--underline { align-self: stretch; background: transparent; --ring-gap: inherit; border-radius: 0; border-bottom: 1px solid var(--border); padding: var(--space-1); overflow: auto; max-width: 100%; }
|
|
76
|
+
.ui-seg--underline { flex-wrap: nowrap; align-self: stretch; justify-self: stretch; background: transparent; --ring-gap: inherit; border-radius: 0; border-bottom: 1px solid var(--border); padding: var(--space-1); overflow: auto; max-width: 100%; }
|
|
65
77
|
.ui-seg--underline button { border-radius: var(--radius-xs); border-bottom: 2px solid transparent; padding: var(--space-3); white-space: nowrap; }
|
|
66
78
|
.ui-seg--underline button.is-active,
|
|
67
79
|
.ui-seg--underline button[aria-pressed="true"] { background: transparent; border-bottom-color: var(--accent); }
|
package/src/styles/table.css
CHANGED
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
/* The empty state (.ui-empty) — shown when a table/list has no rows — now
|
|
99
99
|
lives in styles/empty.css as a standalone component (illustration support). */
|
|
100
100
|
|
|
101
|
+
/* Tables share their containing card’s reading surface, including pinned cells. */
|
|
102
|
+
.ui-card { --table-bg: var(--surface); }
|
|
103
|
+
|
|
101
104
|
/* White in light, base canvas in dark; never a grey or tinted data surface. */
|
|
102
105
|
.ui-table { background: var(--table-bg); --ring-gap: var(--table-bg); }
|
|
103
106
|
.ui-table--zebra tbody tr:nth-child(even) td,
|
|
@@ -116,6 +119,14 @@
|
|
|
116
119
|
width: calc(100% + 2 * var(--space-3));
|
|
117
120
|
margin-inline: calc(-1 * var(--space-3));
|
|
118
121
|
}
|
|
122
|
+
/* A scroll wrapper owns the bleed for a nested dense table: 4px of focus
|
|
123
|
+
clearance plus the 12px end-cell inset. */
|
|
124
|
+
.ui-card > .ui-table-scroll:has(> .ui-table--dense) {
|
|
125
|
+
margin-inline: calc(-1 * var(--space-4));
|
|
126
|
+
}
|
|
127
|
+
.ui-card > .ui-table-scroll > .ui-table--dense {
|
|
128
|
+
padding-inline: 0;
|
|
129
|
+
}
|
|
119
130
|
.ui-table td.ui-table__num { text-align: right; }
|
|
120
131
|
.ui-table--compact td { padding: var(--space-1) var(--space-3); font-size: var(--text-sm); line-height: var(--leading-snug); height: 33px; }
|
|
121
132
|
.ui-table--compact th { padding: var(--space-2) var(--space-3); }
|