@apliteni/apliteni-ui 0.184.0 → 0.185.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 +14 -1
- package/guidelines/notifications.md +1 -1
- package/guidelines/the-page.md +12 -0
- package/package.json +1 -1
- package/react/dist/index.css +86 -2
- package/react/dist/index.d.ts +4 -1
- package/react/dist/index.js +4 -0
package/docs/components.md
CHANGED
|
@@ -179,6 +179,19 @@ holds each line of text that the button shows, and the menu takes the same name.
|
|
|
179
179
|
reload. If your `palette` sets its own `onNavigate`, the shell uses that one.
|
|
180
180
|
- `bandControl` stands under the sidebar head. `headControl` is one glyph control in the sidebar
|
|
181
181
|
head, before the fold button.
|
|
182
|
+
- `bandActions` puts glyph controls, such as a notification bell, at the right end of the band,
|
|
183
|
+
in each sidebar structure and at every width. With a sidebar, they stand before the menu
|
|
184
|
+
button, and search keeps the centre of the band while it has room. Where the band is short of
|
|
185
|
+
room, search moves off the centre and shrinks, and never goes under an action. With no
|
|
186
|
+
sidebar, they stand before the theme switch. Put one or two there, and give each one a hover
|
|
187
|
+
title. Each action there is a 40px square with a 17px glyph, a `Button` and a dropdown trigger
|
|
188
|
+
alike, and the glyph stays in the centre of its square with or without a count. A count in a
|
|
189
|
+
dropdown trigger is a red pill on the trigger's top end corner, with a 2px ring in the band's
|
|
190
|
+
colour that cuts it from the glyph. The focus ring passes under it, so no ring line crosses the
|
|
191
|
+
digits. A long count, such as 99+, grows over the glyph and stays clear of the next control.
|
|
192
|
+
Give the trigger a name that holds the count it shows, such as "Notifications, 99+ unread".
|
|
193
|
+
Below 560px,
|
|
194
|
+
each action is a 40px glyph with no border and keeps a 44 by 44px tap zone.
|
|
182
195
|
|
|
183
196
|
**Routing.** `renderLink` lets your router draw each section and sub-item link.
|
|
184
197
|
|
|
@@ -189,7 +202,7 @@ holds each line of text that the button shows, and the menu takes the same name.
|
|
|
189
202
|
name and its count for keyboard and pointer users. A folded rail takes clicks only on the glyph
|
|
190
203
|
column, so a click beside it reaches the page.
|
|
191
204
|
- At 720px and below, the sidebar goes away and a 52px band shows. In the topbar layout, the band
|
|
192
|
-
holds the brand mark, the page title on one line, the search trigger and a menu button. In the
|
|
205
|
+
holds the brand mark, the page title on one line, the search trigger, the band actions and a menu button. In the
|
|
193
206
|
rail layout, it holds only the menu button and the mark. The menu button opens the full section
|
|
194
207
|
list in a drawer. The drawer opens from the side of the menu button: the right in the topbar
|
|
195
208
|
layout and the left in the rail layout. `drawerSide` chooses the side in either layout. The
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**Except:** A toast for the reader's own action, such as Saved, stays out of the bell.
|
|
12
12
|
|
|
13
|
-
**Do:** Show “99+” above 99, and name
|
|
13
|
+
**Do:** Show “99+” above 99, and name it “Notifications, 99+ unread”.
|
|
14
14
|
|
|
15
15
|
**Don't:** Report a failed run only in a toast.
|
|
16
16
|
|
package/guidelines/the-page.md
CHANGED
|
@@ -24,6 +24,18 @@
|
|
|
24
24
|
|
|
25
25
|
**Don't:** Put Payouts and its sub-items under a Money label.
|
|
26
26
|
|
|
27
|
+
## Keep the bar’s end for product alerts
|
|
28
|
+
|
|
29
|
+
<!-- rule: bar-end -->
|
|
30
|
+
|
|
31
|
+
**Rule:** Put only glyph controls that serve every page, such as the notification bell, at the right end of the bar.
|
|
32
|
+
|
|
33
|
+
**Why:** The reader looks for the bell in the same place on every page, and a phone bar has room for two glyphs at most.
|
|
34
|
+
|
|
35
|
+
**Do:** Put the bell at the bar’s end, after search.
|
|
36
|
+
|
|
37
|
+
**Don't:** Put a page’s own button, such as New report, in the bar.
|
|
38
|
+
|
|
27
39
|
## Choose content width
|
|
28
40
|
|
|
29
41
|
<!-- rule: width -->
|
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -1366,6 +1366,20 @@
|
|
|
1366
1366
|
display: none;
|
|
1367
1367
|
}
|
|
1368
1368
|
}
|
|
1369
|
+
@media (min-width: 561px) {
|
|
1370
|
+
.ui-react-app .ui-app__bar:not(:has(> .ui-app__menu)) .ui-app__bar-gap {
|
|
1371
|
+
display: none;
|
|
1372
|
+
}
|
|
1373
|
+
.ui-react-app .ui-app__bar:not(:has(> .ui-app__menu)) .ui-app__search {
|
|
1374
|
+
margin-inline-end: auto;
|
|
1375
|
+
}
|
|
1376
|
+
}
|
|
1377
|
+
@media (min-width: 561px) and (max-width: 720px) {
|
|
1378
|
+
.ui-react-app .ui-app__bar:has(> .ui-react-app__title) > .ui-react-app__title {
|
|
1379
|
+
flex-shrink: 0;
|
|
1380
|
+
max-width: 50%;
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1369
1383
|
@media (max-width: 560px) {
|
|
1370
1384
|
.ui-react-app .ui-app__bar {
|
|
1371
1385
|
gap: 0;
|
|
@@ -1384,7 +1398,9 @@
|
|
|
1384
1398
|
.ui-react-app .ui-app__bar .ui-app__menu,
|
|
1385
1399
|
.ui-react-app .ui-app__bar .ui-app__search,
|
|
1386
1400
|
.ui-react-app .ui-app__bar .toggle,
|
|
1387
|
-
.ui-react-app .ui-app__bar .ui-app__user-trigger
|
|
1401
|
+
.ui-react-app .ui-app__bar .ui-app__user-trigger,
|
|
1402
|
+
.ui-react-app .ui-app__bar .ui-react-app__band-actions > .ui-btn,
|
|
1403
|
+
.ui-react-app .ui-app__bar .ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger {
|
|
1388
1404
|
flex: none;
|
|
1389
1405
|
justify-content: center;
|
|
1390
1406
|
width: 40px;
|
|
@@ -1399,7 +1415,9 @@
|
|
|
1399
1415
|
}
|
|
1400
1416
|
.ui-react-app .ui-app__bar .ui-app__search:hover,
|
|
1401
1417
|
.ui-react-app .ui-app__bar .toggle:hover,
|
|
1402
|
-
.ui-react-app .ui-app__bar .ui-app__user-trigger:hover
|
|
1418
|
+
.ui-react-app .ui-app__bar .ui-app__user-trigger:hover,
|
|
1419
|
+
.ui-react-app .ui-app__bar .ui-react-app__band-actions > .ui-btn:hover,
|
|
1420
|
+
.ui-react-app .ui-app__bar .ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger:hover {
|
|
1403
1421
|
transform: none;
|
|
1404
1422
|
background: var(--surface);
|
|
1405
1423
|
}
|
|
@@ -1452,6 +1470,72 @@
|
|
|
1452
1470
|
white-space: nowrap;
|
|
1453
1471
|
}
|
|
1454
1472
|
}
|
|
1473
|
+
.ui-react-app__band-actions {
|
|
1474
|
+
display: flex;
|
|
1475
|
+
align-items: center;
|
|
1476
|
+
flex: none;
|
|
1477
|
+
gap: var(--space-1);
|
|
1478
|
+
}
|
|
1479
|
+
.ui-react-app__band-actions > .ui-btn,
|
|
1480
|
+
.ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger {
|
|
1481
|
+
min-width: 40px;
|
|
1482
|
+
min-height: 40px;
|
|
1483
|
+
justify-content: center;
|
|
1484
|
+
}
|
|
1485
|
+
.ui-react-app__band-actions > .ui-btn svg,
|
|
1486
|
+
.ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger svg {
|
|
1487
|
+
flex: none;
|
|
1488
|
+
width: 17px;
|
|
1489
|
+
height: 17px;
|
|
1490
|
+
stroke-width: 2.2;
|
|
1491
|
+
}
|
|
1492
|
+
.ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger {
|
|
1493
|
+
position: relative;
|
|
1494
|
+
gap: 0;
|
|
1495
|
+
padding: 0;
|
|
1496
|
+
border-color: transparent;
|
|
1497
|
+
background: transparent;
|
|
1498
|
+
}
|
|
1499
|
+
.ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger .ui-badge {
|
|
1500
|
+
position: absolute;
|
|
1501
|
+
z-index: var(--z-base);
|
|
1502
|
+
inset-block-start: calc(var(--space-3) / -2);
|
|
1503
|
+
inset-inline-end: 0;
|
|
1504
|
+
min-width: var(--space-5);
|
|
1505
|
+
height: var(--space-5);
|
|
1506
|
+
padding: 0 var(--space-1);
|
|
1507
|
+
justify-content: center;
|
|
1508
|
+
border: calc(var(--space-1) / 2) solid var(--bg);
|
|
1509
|
+
color: var(--danger-contrast);
|
|
1510
|
+
background: var(--signal-solid-danger);
|
|
1511
|
+
}
|
|
1512
|
+
.ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger:hover {
|
|
1513
|
+
transform: none;
|
|
1514
|
+
background: var(--surface);
|
|
1515
|
+
}
|
|
1516
|
+
@media (min-width: 721px) {
|
|
1517
|
+
.ui-react-app .ui-app__bar:has(> .ui-react-app__title):has(> .ui-react-app__band-actions) {
|
|
1518
|
+
display: grid;
|
|
1519
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, var(--panel-sm)) minmax(max-content, 1fr);
|
|
1520
|
+
}
|
|
1521
|
+
.ui-react-app .ui-app__bar:has(> .ui-react-app__title) > .ui-react-app__band-actions {
|
|
1522
|
+
grid-column: 3;
|
|
1523
|
+
justify-self: end;
|
|
1524
|
+
}
|
|
1525
|
+
.ui-react-app .ui-app__bar:has(> .ui-react-app__title):has(> .ui-react-app__band-actions) .ui-app__search {
|
|
1526
|
+
grid-column: 2;
|
|
1527
|
+
margin-inline: 0;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
@media (max-width: 560px) {
|
|
1531
|
+
.ui-react-app .ui-app__bar > .ui-react-app__band-actions {
|
|
1532
|
+
margin-inline: var(--space-1);
|
|
1533
|
+
--tap-clear-x: var(--space-1);
|
|
1534
|
+
}
|
|
1535
|
+
.ui-react-app .ui-app__bar .ui-react-app__band-actions > .ui-dropdown > .ui-dropdown__trigger .ui-badge {
|
|
1536
|
+
inset-block-start: calc(var(--space-3) / -2 + 1px);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1455
1539
|
|
|
1456
1540
|
/* src/AuthShell.css */
|
|
1457
1541
|
.ui-auth__brand > span {
|
package/react/dist/index.d.ts
CHANGED
|
@@ -1014,6 +1014,9 @@ type AppShellProps = AppShellNav & {
|
|
|
1014
1014
|
/** One glyph control in the sidebar head, before the fold button, drawn as the fold is.
|
|
1015
1015
|
* On a phone it stands in the menu panel's head. Topbar layout only (#732). */
|
|
1016
1016
|
headControl?: ReactNode;
|
|
1017
|
+
/** Glyph controls at the right end of the band, such as a notification bell, in every
|
|
1018
|
+
* sidebar structure and at every width. Topbar layout only (#847). */
|
|
1019
|
+
bandActions?: ReactNode;
|
|
1017
1020
|
/** The band trigger's words and its name at every width. Below 560px the trigger shows
|
|
1018
1021
|
* only its glyph (#729), and the words stay its accessible name. */
|
|
1019
1022
|
searchLabel?: string;
|
|
@@ -1035,7 +1038,7 @@ type AppShellProps = AppShellNav & {
|
|
|
1035
1038
|
/** Spread linkProps onto the router link, including children and onClick. */
|
|
1036
1039
|
renderLink?: (section: AppShellLink, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
|
|
1037
1040
|
};
|
|
1038
|
-
declare function AppShell({ sections, groups, pathname, title, children, word, brand, layout, drawerSide, brandHref, width, back, lede, actions, tools, bandControl, headControl, account, accountItems, onSignOut, searchLabel, defaultCollapsed, palette, onNavigate, renderLink }: AppShellProps): react.JSX.Element;
|
|
1041
|
+
declare function AppShell({ sections, groups, pathname, title, children, word, brand, layout, drawerSide, brandHref, width, back, lede, actions, tools, bandControl, headControl, bandActions, account, accountItems, onSignOut, searchLabel, defaultCollapsed, palette, onNavigate, renderLink }: AppShellProps): react.JSX.Element;
|
|
1039
1042
|
|
|
1040
1043
|
type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
1041
1044
|
brand: ReactNode;
|
package/react/dist/index.js
CHANGED
|
@@ -5072,6 +5072,7 @@ function AppShell({
|
|
|
5072
5072
|
tools,
|
|
5073
5073
|
bandControl,
|
|
5074
5074
|
headControl,
|
|
5075
|
+
bandActions,
|
|
5075
5076
|
account,
|
|
5076
5077
|
accountItems = [],
|
|
5077
5078
|
onSignOut,
|
|
@@ -5239,6 +5240,7 @@ function AppShell({
|
|
|
5239
5240
|
}
|
|
5240
5241
|
)
|
|
5241
5242
|
] });
|
|
5243
|
+
const ends = bandActions && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__band-actions", children: bandActions });
|
|
5242
5244
|
const control = bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", inert: collapsed, children: bandControl });
|
|
5243
5245
|
return /* @__PURE__ */ jsxs37("div", { className: `ui-app ui-app--topbar ui-react-app${collapsed ? " is-collapsed" : ""}`, children: [
|
|
5244
5246
|
navigable && /* @__PURE__ */ jsxs37("div", { className: "ui-app__rail", role: "region", "aria-label": "Sidebar", children: [
|
|
@@ -5262,6 +5264,7 @@ function AppShell({
|
|
|
5262
5264
|
/* @__PURE__ */ jsx41("kbd", { className: "ui-cmdk__key", children: paletteHotkey() })
|
|
5263
5265
|
] }),
|
|
5264
5266
|
/* @__PURE__ */ jsx41("span", { className: "ui-app__bar-gap" }),
|
|
5267
|
+
navigable && ends,
|
|
5265
5268
|
navigable ? /* @__PURE__ */ jsx41(
|
|
5266
5269
|
Button,
|
|
5267
5270
|
{
|
|
@@ -5278,6 +5281,7 @@ function AppShell({
|
|
|
5278
5281
|
) : /* @__PURE__ */ jsxs37(Fragment19, { children: [
|
|
5279
5282
|
bandControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: bandControl }),
|
|
5280
5283
|
headControl && /* @__PURE__ */ jsx41("span", { className: "ui-react-app__band-control", children: headControl }),
|
|
5284
|
+
ends,
|
|
5281
5285
|
/* @__PURE__ */ jsx41(ThemeToggle, {}),
|
|
5282
5286
|
/* @__PURE__ */ jsx41("div", { className: "ui-app__user ui-app__user--bar", children: /* @__PURE__ */ jsx41(
|
|
5283
5287
|
Dropdown,
|