@apliteni/apliteni-ui 0.27.0 → 0.30.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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/react/README.md +49 -1
  3. package/react/dist/index.css +11 -1
  4. package/react/dist/index.d.ts +61 -2
  5. package/react/dist/index.js +514 -121
  6. package/src/components/back.js +57 -0
  7. package/src/components/command-palette.js +597 -0
  8. package/src/components/confirm.js +3 -2
  9. package/src/components/drawer.js +31 -2
  10. package/src/components/dropdown.js +192 -17
  11. package/src/components/feedback.js +2 -2
  12. package/src/components/index.js +5 -2
  13. package/src/components/loading.js +3 -2
  14. package/src/components/nav.js +15 -7
  15. package/src/components/overlay.js +67 -14
  16. package/src/components/shell.js +11 -2
  17. package/src/components/tabs.js +7 -1
  18. package/src/components/tooltip.js +237 -0
  19. package/src/components/topbar.js +9 -4
  20. package/src/index.css +3 -0
  21. package/src/index.js +3 -0
  22. package/src/inline.js +6 -0
  23. package/src/motion.js +43 -2
  24. package/src/styles/back.css +42 -0
  25. package/src/styles/badge.css +5 -7
  26. package/src/styles/base.css +8 -7
  27. package/src/styles/card.css +12 -8
  28. package/src/styles/code.css +3 -4
  29. package/src/styles/command-palette.css +321 -0
  30. package/src/styles/confirm.css +11 -11
  31. package/src/styles/drawer.css +57 -15
  32. package/src/styles/dropdown.css +70 -11
  33. package/src/styles/feedback.css +2 -0
  34. package/src/styles/footer.css +3 -4
  35. package/src/styles/input.css +1 -1
  36. package/src/styles/layout.css +3 -2
  37. package/src/styles/loading.css +5 -0
  38. package/src/styles/nav.css +12 -8
  39. package/src/styles/success.css +3 -2
  40. package/src/styles/table.css +4 -5
  41. package/src/styles/tabs.css +3 -0
  42. package/src/styles/tooltip.css +65 -0
  43. package/src/styles/topbar.css +3 -4
  44. package/src/tokens/tokens.css +8 -8
@@ -71,10 +71,9 @@
71
71
  gap: 30px 56px;
72
72
  }
73
73
  .ui-footer__col-title {
74
- font-size: 11px;
75
- font-weight: 700;
76
- letter-spacing: 0.1em;
77
- text-transform: uppercase;
74
+ /* rank: label */
75
+ font-size: var(--text-sm);
76
+ font-weight: var(--weight-medium);
78
77
  color: var(--footer-text);
79
78
  margin: 0 0 14px;
80
79
  }
@@ -140,7 +140,7 @@
140
140
  width: 5px; height: 10px;
141
141
  border: solid var(--accent-contrast);
142
142
  border-width: 0 2px 2px 0;
143
- transform: rotate(45deg);
143
+ transform: rotate(45deg); /* motion: still — the turn is the tick's shape, not travel; it lands with the box's fill, which transitions */
144
144
  }
145
145
  .ui-check input[type="radio"]:checked::after {
146
146
  content: "";
@@ -78,7 +78,7 @@
78
78
  smallest of three weak signals doing the most work, so it grows with the row. */
79
79
  .ui-app__rail .ui-nav__ic svg { opacity: 0.62; }
80
80
  .ui-app__rail .ui-nav__item.is-active .ui-nav__ic svg,
81
- .ui-app__rail .ui-nav__item.is-current .ui-nav__ic svg { opacity: 1; stroke: currentColor; }
81
+ .ui-app__rail .ui-nav__item.is-current .ui-nav__ic svg { opacity: 1; stroke: currentColor; } /* motion: still — the glyph brightens with its row, whose own highlight already transitions */
82
82
  .ui-app__rail .ui-nav__item.is-active::before { width: 3px; height: 62%; }
83
83
 
84
84
  /* Sign out is a navigation row and rests like one. The danger intent is the
@@ -133,7 +133,8 @@
133
133
  .ui-app__main .ui-nav--crumbs { margin-bottom: var(--space-5); }
134
134
  .ui-app__main h1 {
135
135
  color: var(--strong);
136
- font-size: 30px;
136
+ /* rank: page-title */
137
+ font-size: var(--text-2xl);
137
138
  font-weight: var(--weight-bold);
138
139
  line-height: 1.1;
139
140
  letter-spacing: var(--tracking-tight);
@@ -31,6 +31,11 @@
31
31
  .ui-busy {
32
32
  display: block;
33
33
  }
34
+ /* What setBusy() puts in the body fades in, without travel. The region the page
35
+ loads with is not animated: only setBusy() adds the class. */
36
+ .ui-busy__body.is-entering {
37
+ animation: m-fade var(--dur-med) var(--ease-out) both;
38
+ }
34
39
 
35
40
  /* -- Skeleton -------------------------------------------------------------- */
36
41
  .ui-skel {
@@ -18,10 +18,9 @@
18
18
  .ui-nav__section + .ui-nav__section { margin-top: 14px; }
19
19
  .ui-nav__list { display: flex; flex-direction: column; gap: 2px; }
20
20
  .ui-nav__cap {
21
- font-size: 11px;
22
- font-weight: 600;
23
- letter-spacing: 0.16em;
24
- text-transform: uppercase;
21
+ /* rank: label */
22
+ font-size: var(--text-sm);
23
+ font-weight: var(--weight-medium);
25
24
  color: var(--muted);
26
25
  padding: 4px 12px 8px;
27
26
  }
@@ -64,7 +63,7 @@
64
63
  width: 3px; height: 17px;
65
64
  border-radius: 3px;
66
65
  background: var(--accent);
67
- transform: translateY(-50%);
66
+ transform: translateY(-50%); /* motion: still — a mark on the current row, whose own highlight already transitions; this centres it, it does not travel */
68
67
  }
69
68
  .ui-nav__item:focus-visible { outline: none; box-shadow: var(--ring); }
70
69
  .ui-nav__item.is-active:focus-visible { box-shadow: var(--ring); }
@@ -72,7 +71,7 @@
72
71
  .ui-nav__ic { display: inline-flex; flex: none; }
73
72
  .ui-nav__ic svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2.2; opacity: 0.72; }
74
73
  .ui-nav__item.is-active .ui-nav__ic svg,
75
- .ui-nav__item.is-current .ui-nav__ic svg { opacity: 1; stroke: var(--accent); }
74
+ .ui-nav__item.is-current .ui-nav__ic svg { opacity: 1; stroke: var(--accent); } /* motion: still — the glyph brightens with its row, whose own highlight already transitions */
76
75
  .ui-nav__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
77
76
 
78
77
  /* Destructive row (sign out, revoke). Quiet at rest, --pink once a pointer or
@@ -148,6 +147,12 @@
148
147
  border-left: 1px solid var(--border);
149
148
  }
150
149
  .ui-nav__sub[hidden] { display: none; }
150
+ /* An opened group's list fades in and drops --space-1 into place. wireNav() adds
151
+ the class when the reader opens it, never at first render. */
152
+ .ui-nav__sub.is-entering {
153
+ --m-dist: var(--space-1);
154
+ animation: m-slide-down var(--dur-fast) var(--ease-out) both;
155
+ }
151
156
  .ui-nav__item--sub { font-size: 14px; padding: 7px 12px; }
152
157
  /* No hairline on a nested current row — but only at rest. box-shadow carries
153
158
  both the hairline and the focus ring, so a rule about the resting look must
@@ -164,8 +169,7 @@
164
169
  .ui-nav--side.is-collapsed .ui-nav__cap,
165
170
  .ui-nav--side.is-collapsed .ui-nav__label,
166
171
  .ui-nav--side.is-collapsed .ui-nav__badge,
167
- .ui-nav--side.is-collapsed .ui-nav__caret,
168
- .ui-nav--side.is-collapsed .ui-nav__sub { display: none; }
172
+ .ui-nav--side.is-collapsed .ui-nav__caret { display: none; } /* motion: still — folding the rail is a layout change of the whole rail; animating these would reflow the page */
169
173
  .ui-nav--side.is-collapsed .ui-nav__item { justify-content: center; padding: 11px 0; gap: 0; }
170
174
  .ui-nav--side.is-collapsed .ui-nav__ic svg { width: 19px; height: 19px; stroke-width: 2; }
171
175
  .ui-nav--side.is-collapsed .ui-nav__item.is-active::before { left: 3px; }
@@ -55,8 +55,9 @@
55
55
  .ui-sx__inner { position: relative; z-index: 1; }
56
56
  .ui-sx__content { min-width: 0; }
57
57
  .ui-sx__eyebrow {
58
- color: var(--green); font-size: 12px; font-weight: var(--weight-semibold);
59
- letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px;
58
+ /* rank: label */
59
+ color: var(--green); font-size: var(--text-sm); font-weight: var(--weight-medium);
60
+ margin-bottom: 10px;
60
61
  }
61
62
  .ui-sx__title {
62
63
  color: var(--strong); font-size: 22px; font-weight: var(--weight-semibold);
@@ -1,5 +1,5 @@
1
1
  /* ============================================================================
2
- * Table — .ui-table (borderless-body, hairline rows, uppercase head)
2
+ * Table — .ui-table (borderless-body, hairline rows, muted head)
3
3
  * Row modifiers: .is-dead (revoked/struck), right-aligned .ui-table__act
4
4
  * ========================================================================== */
5
5
 
@@ -10,11 +10,10 @@
10
10
  }
11
11
  .ui-table th {
12
12
  text-align: left;
13
- font-size: var(--text-xs);
14
- letter-spacing: 0.09em;
15
- text-transform: uppercase;
13
+ /* rank: label */
14
+ font-size: var(--text-sm);
15
+ font-weight: var(--weight-medium);
16
16
  color: var(--muted);
17
- font-weight: var(--weight-semibold);
18
17
  padding: 0 var(--space-4) var(--space-3) 0;
19
18
  border-bottom: 1px solid var(--border);
20
19
  }
@@ -26,6 +26,9 @@
26
26
 
27
27
  .ui-tabs__panels { padding-top: 20px; }
28
28
  .ui-tabs__panel[hidden] { display: none; }
29
+ /* The panel the reader switches to fades in, without travel. initTabs() adds the
30
+ class on a switch and never at first render; playEntrance() takes it off. */
31
+ .ui-tabs__panel.is-entering { animation: m-fade var(--dur-fast) var(--ease-out) both; }
29
32
  /* The panel is focusable (tabindex="0", see tabs.js) so a keyboard user can
30
33
  reach text-only content. Show the ring when they land on it. */
31
34
  .ui-tabs__panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
@@ -0,0 +1,65 @@
1
+ /* ============================================================================
2
+ * Tooltip — .ui-tip, the readout that shows a value while a pointer rests on
3
+ * the mark holding it: a bar, a point on a sparkline, a cell in a heatmap.
4
+ * .ui-tip-host the box the readout is placed against
5
+ * .ui-tip the readout — __label, __value, __detail
6
+ * The readout is an overlay in every state. It is absolutely placed inside its
7
+ * host, so showing it, filling it and moving it change the size of nothing.
8
+ * why: docs/specification.md#the-hover-readout
9
+ * ========================================================================== */
10
+
11
+ .ui-tip-host { position: relative; }
12
+
13
+ .ui-tip {
14
+ /* One number for the mark-to-readout distance, read by both placements here
15
+ and by the wiring's flip test, so above and below cannot drift apart. */
16
+ --ui-tip-gap: 8px;
17
+ --ui-tip-bg: var(--surface-3);
18
+ position: absolute;
19
+ top: var(--ui-tip-y, 0px);
20
+ left: var(--ui-tip-x, 50%);
21
+ z-index: var(--z-dropdown);
22
+ translate: calc(-50% + var(--ui-tip-shift, 0px)) calc(-100% - var(--ui-tip-gap));
23
+ display: flex;
24
+ flex-direction: column;
25
+ width: max-content;
26
+ max-width: var(--prose-caption);
27
+ padding: var(--space-2) var(--space-3);
28
+ background: var(--ui-tip-bg);
29
+ border: 1px solid var(--border);
30
+ border-radius: var(--radius-sm);
31
+ box-shadow: var(--shadow-md);
32
+ font-family: var(--font-sans);
33
+ font-size: var(--text-xs);
34
+ line-height: 1.45;
35
+ color: var(--text);
36
+ /* The readout covers the marks beside the one it describes. Were it a hover
37
+ target it would take the pointer, uncover the mark, lose the pointer and
38
+ return — a flicker at pointer speed. */
39
+ pointer-events: none;
40
+ opacity: 0;
41
+ visibility: hidden;
42
+ transition:
43
+ opacity var(--dur-fast) var(--ease),
44
+ /* `linear`: visibility is discrete, the rule the dropdown panel states. */
45
+ visibility var(--dur-fast) linear;
46
+ }
47
+
48
+ /* Light is an all-white app, so the raised surface is white over a hairline,
49
+ the way a light card is. */
50
+ :root[data-theme="light"] .ui-tip { --ui-tip-bg: var(--surface); }
51
+
52
+ /* Below the mark: the wiring's flip when above would be clipped, or the
53
+ author's own choice. */
54
+ .ui-tip.is-below { translate: calc(-50% + var(--ui-tip-shift, 0px)) var(--ui-tip-gap); }
55
+
56
+ .ui-tip.is-open { opacity: 1; visibility: visible; }
57
+
58
+ .ui-tip__label { color: var(--muted); }
59
+ .ui-tip__value {
60
+ font-size: var(--text-sm);
61
+ font-weight: var(--weight-semibold);
62
+ color: var(--strong);
63
+ font-variant-numeric: tabular-nums;
64
+ }
65
+ .ui-tip__detail { color: var(--dim); font-variant-numeric: tabular-nums; }
@@ -164,10 +164,9 @@
164
164
  .vopt .vname { font-family: var(--font-sans); font-size: 12.5px; color: var(--strong); font-weight: 600; letter-spacing: 0.01em; }
165
165
  .vopt .vmeta { font-size: 11px; color: var(--muted); margin-top: 2px; }
166
166
  .vopt .vbadge {
167
- font-size: 9.5px;
168
- letter-spacing: 0.12em;
169
- text-transform: uppercase;
170
- font-weight: 700;
167
+ /* rank: chip */
168
+ font-size: var(--text-xs);
169
+ font-weight: var(--weight-semibold);
171
170
  padding: 2px 7px;
172
171
  border-radius: 999px;
173
172
  margin-left: auto;
@@ -78,7 +78,7 @@
78
78
  --tracking-tight: -0.01em;
79
79
  --tracking-normal: 0;
80
80
  --tracking-wide: 0.04em;
81
- --tracking-caps: 0.14em;
81
+ --tracking-caps: 0.14em; /* nothing in the kit reads it since #268; consumer rules still may */
82
82
 
83
83
  /* -- Motion -------------------------------------------------------------
84
84
  * The kit's legacy --dur-* and --ease names alias onto the brand's
@@ -213,8 +213,8 @@
213
213
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
214
214
  /* Tight elevation for the active segmented pill — stays contained in its track. */
215
215
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.3);
216
- /* Resting elevation for a card. Dark cards are borderless the surface groups on
217
- its own so they cast nothing. */
216
+ /* A card's resting elevation. Nothing in the kit reads it since #284 made .ui-card
217
+ flat; it stays because it is published and a consumer may. Dark casts nothing. */
218
218
  --shadow-card: none;
219
219
  /* THE ONLY --ring in the kit — light and every data-accent sub-theme declare an
220
220
  --accent and inherit this line. Opaque because a translucent ring is a glow, and the
@@ -255,7 +255,7 @@
255
255
  --amber: #b5730a;
256
256
 
257
257
  /* A WHITE app: page and cards are both white, and cards are delineated by a hairline
258
- border + soft shadow (see card.css), not a grey canvas. */
258
+ border (see card.css), not a grey canvas or a shadow. */
259
259
  --bg: #ffffff;
260
260
  --bg-elevated: #ffffff;
261
261
  --surface: #ffffff;
@@ -294,8 +294,8 @@
294
294
  --glow-cyan: rgba(12, 143, 168, 0.1);
295
295
  --glow-pink: rgba(182, 51, 97, 0.1);
296
296
 
297
- /* Solid chip pairs for the white app. Each ink is deepened past its signal hue so 10px
298
- uppercase text clears WCAG AA on its own pale fill. */
297
+ /* Solid chip pairs for the white app. Each ink is deepened past its signal hue so 11px
298
+ chip text clears WCAG AA on its own pale fill. */
299
299
  --chip-success-ink: #1f7a38;
300
300
  --chip-success-fill: #dff3e4;
301
301
  --chip-warn-ink: #8a5e00;
@@ -324,8 +324,8 @@
324
324
  --shadow-lg: 0 18px 50px rgba(30, 30, 50, 0.16);
325
325
  /* Tight elevation for the active segmented pill — stays contained in its track. */
326
326
  --shadow-seg: 0 1px 2px rgba(30, 30, 50, 0.12), 0 2px 4px rgba(30, 30, 50, 0.1);
327
- /* A white card on a white page needs its own flatter-than-sm elevation: a hairline
328
- contact shadow plus a wide soft one (see card.css). */
327
+ /* A hairline contact shadow plus a wide soft one. Unread by the kit since #284 —
328
+ see the dark block. */
329
329
  --shadow-card: 0 1px 2px rgba(20, 25, 45, 0.04), 0 4px 14px rgba(20, 25, 45, 0.05);
330
330
  /* No --ring here. :root's is var(--accent), and light re-points --accent. */
331
331