@apliteni/apliteni-ui 0.165.3 → 0.166.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 +1 -0
- package/guidelines/INDEX.md +1 -0
- package/guidelines/notifications.md +43 -0
- package/package.json +1 -1
- package/react/dist/index.css +0 -9
- package/src/styles/callout.css +7 -7
- package/src/styles/dropdown.css +18 -3
package/docs/components.md
CHANGED
|
@@ -328,6 +328,7 @@ page before anything is clicked. A panel adds nothing to the page's scrollable w
|
|
|
328
328
|
`--ui-dropdown-edge` is the gap a panel keeps from the edge of the view. Set it to 0 for a panel
|
|
329
329
|
flush with the edge, or wider for more room. A view that cannot afford the gap on both sides halves
|
|
330
330
|
it. At 720px and below the gap is the page margin, 16px, so a panel lines up with the page's text.
|
|
331
|
+
Where a phone's safe area is wider than 16px, the gap is the safe area.
|
|
331
332
|
|
|
332
333
|
**A panel has a floor and a ceiling.** The floor is the kit's 240px, which is what makes a list of
|
|
333
334
|
rows readable. The ceiling is the view less that gap at each side. The floor wins where the two
|
package/guidelines/INDEX.md
CHANGED
|
@@ -30,4 +30,5 @@ Each row names one guideline page, the screen parts it covers, and when to read
|
|
|
30
30
|
| [Hover readouts](hover-readouts.md) | Hover values, their placement and touch access. | Read it before you show values on hover or tap. |
|
|
31
31
|
| [Going back](going-back.md) | The back link, its destination and the parent address. | Read it when a page sits under another page. |
|
|
32
32
|
| [Account and settings](account-and-settings.md) | The account window, the account menu and settings rows. | Read it before you build the account menu or settings. |
|
|
33
|
+
| [Notifications](notifications.md) | The bell, its unread count, read state and a failed load. | Read it before you build a bell or a notifications list. |
|
|
33
34
|
| [Guidelines](overview.md) | No screen parts. The file holds only the collection heading. | Read it only for the heading. The six-card overview is in Storybook, not in the package. |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Notifications
|
|
2
|
+
|
|
3
|
+
## Keep missed events in the bell
|
|
4
|
+
|
|
5
|
+
<!-- rule: bell-toast-callout -->
|
|
6
|
+
|
|
7
|
+
**Rule:** Put an event that the reader can miss in the bell.
|
|
8
|
+
|
|
9
|
+
**Why:** A toast closes after 5 seconds.
|
|
10
|
+
|
|
11
|
+
**Except:** A toast for the reader's own action, such as Saved, stays out of the bell.
|
|
12
|
+
|
|
13
|
+
**Do:** Show “99+” above 99, and name the bell “Notifications, 120 unread”.
|
|
14
|
+
|
|
15
|
+
**Don't:** Report a failed run only in a toast.
|
|
16
|
+
|
|
17
|
+
## Mark read on open
|
|
18
|
+
|
|
19
|
+
<!-- rule: read-state -->
|
|
20
|
+
|
|
21
|
+
**Rule:** Mark a notification read when the reader opens it, and let a toast undo Mark all read.
|
|
22
|
+
|
|
23
|
+
**Why:** One Undo restores the set, so a confirmation only adds a click.
|
|
24
|
+
|
|
25
|
+
**Do:** Show “3 notifications marked read” with Undo.
|
|
26
|
+
|
|
27
|
+
**Don't:** Ask “Mark all notifications read?” first.
|
|
28
|
+
|
|
29
|
+
**Gap #798:** The kit has no unread row weight, so only hidden text marks the row.
|
|
30
|
+
|
|
31
|
+
## Show a failed load as an error
|
|
32
|
+
|
|
33
|
+
<!-- rule: failed-load -->
|
|
34
|
+
|
|
35
|
+
**Rule:** When a list or a panel fails to load, say so and offer Retry.
|
|
36
|
+
|
|
37
|
+
**Why:** “No notifications” after a failure tells the reader that nothing happened.
|
|
38
|
+
|
|
39
|
+
**Do:** Show “Notifications did not load” with Retry.
|
|
40
|
+
|
|
41
|
+
**Don't:** Show “No notifications” after a failed request.
|
|
42
|
+
|
|
43
|
+
**Gap #798:** The dropdown has no error part, so a panel uses the empty state.
|
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -1087,15 +1087,6 @@
|
|
|
1087
1087
|
clip-path: inset(-100vmax var(--toast-card-clip, -100vmax) var(--toast-card-clip, -100vmax));
|
|
1088
1088
|
transition: translate var(--dur-med) var(--ease), scale var(--dur-med) var(--ease);
|
|
1089
1089
|
}
|
|
1090
|
-
.ui-toast-stack--collapsed > .ui-toast > .ui-toast__icon,
|
|
1091
|
-
.ui-toast-stack--collapsed > .ui-toast > .ui-toast__body,
|
|
1092
|
-
.ui-toast-stack--collapsed > .ui-toast > .ui-toast__action {
|
|
1093
|
-
margin-block: auto;
|
|
1094
|
-
}
|
|
1095
|
-
.ui-toast-stack--collapsed:hover > .ui-toast > *,
|
|
1096
|
-
.ui-toast-stack--collapsed:focus-within > .ui-toast > * {
|
|
1097
|
-
margin-block: 0;
|
|
1098
|
-
}
|
|
1099
1090
|
.ui-toast-stack--collapsed:hover,
|
|
1100
1091
|
.ui-toast-stack--collapsed:focus-within {
|
|
1101
1092
|
height: var(--toast-fan-height, auto);
|
package/src/styles/callout.css
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
.ui-toast {
|
|
37
37
|
position: relative;
|
|
38
38
|
display: flex;
|
|
39
|
-
align-items:
|
|
39
|
+
align-items: flex-start; /* every part centres on the first line: a glyph or a button never drifts to the middle of a wrapped text */
|
|
40
40
|
gap: 12px;
|
|
41
41
|
padding: var(--space-3);
|
|
42
42
|
border-radius: var(--radius-sm);
|
|
@@ -58,28 +58,28 @@
|
|
|
58
58
|
.ui-toast--info { --toast-accent: var(--cyan); --toast-action-ink: var(--chip-info-ink); --toast-glow: var(--glow-cyan); --toast-on: var(--signal-contrast); --toast-solid: var(--signal-solid-info); }
|
|
59
59
|
.ui-toast--neutral { --toast-accent: var(--muted); --toast-action-ink: var(--text); --toast-glow: var(--surface); --toast-on: var(--signal-solid-ink); --toast-solid: var(--signal-solid-neutral); }
|
|
60
60
|
|
|
61
|
-
.ui-toast__icon { width: 22px; height:
|
|
61
|
+
.ui-toast__icon { width: 22px; height: 1lh; flex: none; display: grid; place-items: center; background: transparent; color: var(--toast-action-ink); }
|
|
62
62
|
.ui-toast__icon svg { width: var(--space-4); height: var(--space-4); stroke: currentColor; fill: none; stroke-width: 2.25; } /* 16px × 2.25 / 24 = 1.5 CSS px. */
|
|
63
63
|
.ui-toast__body { flex: 1; min-width: 0; }
|
|
64
64
|
.ui-toast__title { font-weight: var(--weight-medium); color: var(--strong); }
|
|
65
65
|
.ui-toast__text { color: var(--text); }
|
|
66
66
|
|
|
67
67
|
/* Tone ink keeps actions readable on the neutral surface. */
|
|
68
|
-
.ui-toast__action { flex: none;
|
|
68
|
+
.ui-toast__action { flex: none; margin-block: -4px; /* the fill overhangs the first line by its own padding */ background: none; border: 0; padding: 4px 9px; border-radius: var(--radius-xs); font: inherit; font-weight: var(--weight-medium); color: var(--toast-action-ink); cursor: pointer; }
|
|
69
69
|
.ui-toast__action:hover { background: color-mix(in srgb, var(--bg) 55%, transparent); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
|
|
70
70
|
.ui-toast__action:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
71
71
|
|
|
72
|
-
.ui-toast__close { flex: none; align-self: flex-start; background: none; border: 0; /* muted-ink: glyph — dismiss icon */ color: var(--muted); cursor: pointer; padding: 2px; display: grid; place-items: center; position: relative; font: inherit; }
|
|
72
|
+
.ui-toast__close { flex: none; align-self: flex-start; background: none; border: 0; /* muted-ink: glyph — dismiss icon */ color: var(--muted); cursor: pointer; height: 1lh; padding: 0 2px; display: grid; place-items: center; position: relative; font: inherit; }
|
|
73
73
|
.ui-toast__close svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }
|
|
74
74
|
/* The target, not the ink. WCAG 2.5.8 measures what a pointer can land on, and
|
|
75
|
-
the drawn button is
|
|
76
|
-
to 24 would push the glyph
|
|
75
|
+
the drawn button is 19px wide and one line tall, a 15px glyph centred on the
|
|
76
|
+
first line. Growing the box to 24 would push the glyph off that line, so the
|
|
77
77
|
TARGET grows instead and the glyph does not move at all.
|
|
78
78
|
Centred, so the overhang is 2.5px on every side. It has 12px of flex gap to
|
|
79
79
|
.ui-toast__action beside it and 12px between stacked toasts, so it reaches no
|
|
80
80
|
neighbouring target; .ui-toast's overflow: hidden clips at 12px of padding,
|
|
81
81
|
well outside it. Measured, not asserted:
|
|
82
|
-
stories/
|
|
82
|
+
stories/tap-zone.test.js reads this rule out of the
|
|
83
83
|
sheet and reports the target it makes. #219 */
|
|
84
84
|
.ui-toast__close::before {
|
|
85
85
|
content: '';
|
package/src/styles/dropdown.css
CHANGED
|
@@ -216,10 +216,13 @@
|
|
|
216
216
|
at the room the viewport left either way. #489 */
|
|
217
217
|
.ui-dropdown__panel.is-scroll { --ui-dropdown-cap: var(--ui-dropdown-max); }
|
|
218
218
|
|
|
219
|
-
/* On a phone, the panel keeps the page's 16px margin at the shell fold
|
|
219
|
+
/* On a phone, the panel keeps the page's 16px margin at the shell fold, or the wider
|
|
220
|
+
safe-area inset, the gap the phone account window keeps. Registered as a length so
|
|
221
|
+
the wiring reads one number, not the max() expression. #808
|
|
220
222
|
why: docs/components.md#the-dropdown-panel */
|
|
223
|
+
@property --ui-dropdown-edge { syntax: "<length>"; inherits: true; initial-value: 8px; }
|
|
221
224
|
@media (max-width: 720px) {
|
|
222
|
-
.ui-dropdown__panel { --ui-dropdown-edge: var(--space-4); }
|
|
225
|
+
.ui-dropdown__panel { --ui-dropdown-edge: max(var(--space-4), env(safe-area-inset-left), env(safe-area-inset-right)); }
|
|
223
226
|
}
|
|
224
227
|
|
|
225
228
|
/* The wiring adds this where the room is below the floor: even spending the whole
|
|
@@ -378,7 +381,8 @@
|
|
|
378
381
|
/* rank: chip */
|
|
379
382
|
font-size: var(--text-xs);
|
|
380
383
|
font-weight: var(--weight-semibold);
|
|
381
|
-
|
|
384
|
+
--ui-dropdown-badge-pad: 3px;
|
|
385
|
+
padding: var(--ui-dropdown-badge-pad) 9px;
|
|
382
386
|
border-radius: var(--radius-pill);
|
|
383
387
|
margin-left: auto;
|
|
384
388
|
flex: none;
|
|
@@ -390,6 +394,17 @@
|
|
|
390
394
|
}
|
|
391
395
|
.ui-dropdown__badge.is-live { color: var(--chip-success-ink); background: var(--chip-success-fill); /* code-bg: inherit — decorative or text-only surface has no nested chip. */ }
|
|
392
396
|
|
|
397
|
+
/* A row with a description is two lines tall. Its glyph, its trailing parts and its
|
|
398
|
+
tick centre on the label line, not on the middle of the two lines. The badge
|
|
399
|
+
subtracts its own line and its block padding (#798). */
|
|
400
|
+
.ui-dropdown__item:has(> .ui-dropdown__main > .ui-dropdown__desc) {
|
|
401
|
+
--ui-dropdown-line: calc((var(--text-sm) - 0.5px) * var(--leading-normal));
|
|
402
|
+
align-items: flex-start;
|
|
403
|
+
}
|
|
404
|
+
.ui-dropdown__item:has(> .ui-dropdown__main > .ui-dropdown__desc) > :is(.ui-dropdown__ic, .ui-dropdown__tick, .ui-dropdown__more) { height: var(--ui-dropdown-line); align-items: center; }
|
|
405
|
+
.ui-dropdown__item:has(> .ui-dropdown__main > .ui-dropdown__desc) > .ui-dropdown__aside { line-height: var(--ui-dropdown-line); }
|
|
406
|
+
.ui-dropdown__item:has(> .ui-dropdown__main > .ui-dropdown__desc) > .ui-dropdown__badge { margin-top: calc((var(--ui-dropdown-line) - var(--text-xs) * var(--leading-normal)) / 2 - var(--ui-dropdown-badge-pad)); }
|
|
407
|
+
|
|
393
408
|
/* Disabled + danger rows */
|
|
394
409
|
.ui-dropdown__item.is-disabled { /* muted-ink: state — unavailable control */ color: var(--disabled-ink); cursor: not-allowed; pointer-events: none; }
|
|
395
410
|
.ui-dropdown__item.is-disabled .ui-dropdown__label,
|