@apliteni/apliteni-ui 0.179.2 → 0.181.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 +56 -15
- package/guidelines/INDEX.md +1 -1
- package/guidelines/account-and-settings.md +13 -13
- package/guidelines/the-page.md +12 -0
- package/package.json +1 -1
- package/react/README.md +14 -0
- package/react/dist/index.css +117 -0
- package/react/dist/index.d.ts +55 -12
- package/react/dist/index.js +268 -172
- package/src/styles/card.css +10 -1
- package/src/styles/layout.css +6 -2
- package/src/styles/nav.css +14 -1
- package/src/styles/table.css +17 -0
- package/src/tokens/tokens.css +3 -0
package/docs/components.md
CHANGED
|
@@ -58,8 +58,9 @@ Neither attribute changes the type. `--font-display` is for headings and brand m
|
|
|
58
58
|
`--font-sans` is for all text that the user reads, and `--font-mono` is for code. The package
|
|
59
59
|
does not ship the font files, so your page loads them. See [Typefaces](foundations.md#typefaces).
|
|
60
60
|
|
|
61
|
-
Use `ThemeToggle` to let the user choose the theme.
|
|
62
|
-
|
|
61
|
+
Use `ThemeToggle` to let the user choose the theme from a bar. Use [`ThemeChoice`](#theme-choice)
|
|
62
|
+
on a settings page. Put `THEME_INIT_SCRIPT` in a `<script>` in the `<head>`, so the first paint has
|
|
63
|
+
the stored theme. Use `AccentPicker` to let the user choose
|
|
63
64
|
the accent. It calls `onChange`. Your page sets `data-accent` and stores the choice. `ACCENTS`
|
|
64
65
|
from the root entry lists the accent names.
|
|
65
66
|
|
|
@@ -140,7 +141,12 @@ account, and you give it the page content. Do not use it for a sign-in page. Use
|
|
|
140
141
|
```
|
|
141
142
|
|
|
142
143
|
`sections` lists the destinations, each with `href`, `label`, `icon` and an optional `count`.
|
|
143
|
-
|
|
144
|
+
A section can hold one level of sub-items in `items`, each with `href`, `label` and an optional
|
|
145
|
+
`count`. That section then opens its sub-items and is not a link itself. To sort the sections
|
|
146
|
+
under group labels instead, give `groups` in place of `sections`: each group has a `label` and its
|
|
147
|
+
`sections`, with no sub-items. A sidebar takes group labels or sub-items, never both, and the
|
|
148
|
+
types refuse the mix. The longest `href` that matches `pathname` is the current section or
|
|
149
|
+
sub-item. The current sub-item stays shown, and its parent row shows as current. `word` names the product, and
|
|
144
150
|
its default is `apliteni-ui`, so set it. `brand` replaces the mark, and `brandHref` is its link,
|
|
145
151
|
`/` by default.
|
|
146
152
|
|
|
@@ -159,20 +165,22 @@ in their own row under the title. `back` puts a [back link](#back-link) above th
|
|
|
159
165
|
**The account menu.** `accountItems` adds rows, such as Account settings and Support, at the top
|
|
160
166
|
of every account menu. A row takes `href` to go to a page, or `onSelect` to open something in
|
|
161
167
|
place. A separator stands before Sign out. In the topbar layout, a Theme row opens a submenu with
|
|
162
|
-
Auto, Light and Dark.
|
|
168
|
+
Auto, Light and Dark. The account button's name is "Signed in as", the name and the address. It
|
|
169
|
+
holds each line of text that the button shows, and the menu takes the same name.
|
|
163
170
|
|
|
164
171
|
**Topbar layout only.**
|
|
165
172
|
|
|
166
173
|
- `searchLabel` gives the words and the accessible name of the search trigger, at every width.
|
|
167
174
|
Its default is "Search or run a command…". `searchShortLabel` is deprecated, and the shell does
|
|
168
175
|
not draw it.
|
|
169
|
-
- `palette` gives the command palette its groups. Without it, the palette lists the sections
|
|
176
|
+
- `palette` gives the command palette its groups. Without it, the palette lists the sections
|
|
177
|
+
under their group labels, or each sub-item with the name of its parent.
|
|
170
178
|
`onNavigate` sends a same-tab pick in the palette to your router, so the page changes without a
|
|
171
179
|
reload. If your `palette` sets its own `onNavigate`, the shell uses that one.
|
|
172
180
|
- `bandControl` stands under the sidebar head. `headControl` is one glyph control in the sidebar
|
|
173
181
|
head, before the fold button.
|
|
174
182
|
|
|
175
|
-
**Routing.** `renderLink` lets your router draw each section link.
|
|
183
|
+
**Routing.** `renderLink` lets your router draw each section and sub-item link.
|
|
176
184
|
|
|
177
185
|
**What the user sees.**
|
|
178
186
|
|
|
@@ -184,13 +192,14 @@ Auto, Light and Dark.
|
|
|
184
192
|
holds the brand mark, the page title on one line, the search trigger and a menu button. In the
|
|
185
193
|
rail layout, it holds only the menu button and the mark. The menu button opens the full section
|
|
186
194
|
list in a drawer. The drawer opens from the side of the menu button: the right in the topbar
|
|
187
|
-
layout and the left in the rail layout. `drawerSide` chooses the side in either layout.
|
|
195
|
+
layout and the left in the rail layout. `drawerSide` chooses the side in either layout. The
|
|
196
|
+
drawer keeps two or more group labels, and leaves out the label of one group. A press
|
|
188
197
|
on a section, Escape or a wider window closes the drawer, and the focus goes back to the menu
|
|
189
198
|
button.
|
|
190
199
|
- Below 560px each band control is a 40px glyph with no border. The search trigger shows only its
|
|
191
200
|
glyph, and keeps the same accessible name.
|
|
192
201
|
- The current section is one quiet fill behind its row. A row under the pointer has a lighter
|
|
193
|
-
fill. In the topbar layout, a shell with one
|
|
202
|
+
fill. In the topbar layout, a shell with one destination and no back link draws no sidebar, no fold
|
|
194
203
|
control and no menu button. The section stays in the command palette. The rail layout always
|
|
195
204
|
draws the rail.
|
|
196
205
|
- In the topbar layout, the theme switch applies the stored theme when the shell mounts, or
|
|
@@ -259,8 +268,10 @@ Use `SidebarNav` for a section list in a layout of your own. In a product page,
|
|
|
259
268
|
active="inv" />
|
|
260
269
|
```
|
|
261
270
|
|
|
262
|
-
It takes flat `items` or captioned `sections`,
|
|
263
|
-
stops at one level. A
|
|
271
|
+
It takes flat `items` or captioned `sections`, rows with sub-items, badges and `renderLink`.
|
|
272
|
+
Nesting stops at one level. A sidebar takes captions or sub-items, never both: the type refuses
|
|
273
|
+
the mix, and in development the component warns. When the current page comes into a group, the
|
|
274
|
+
group opens, and its row shows as current. A collapsed row keeps its name and its count.
|
|
264
275
|
|
|
265
276
|
### Top bar
|
|
266
277
|
|
|
@@ -627,6 +638,29 @@ wider. A long label wraps inside its own option.
|
|
|
627
638
|
keys move and choose, wrap at the ends and skip disabled options. Home and End go to the first and
|
|
628
639
|
last enabled option. In forced colours the chosen option uses the system highlight colours.
|
|
629
640
|
|
|
641
|
+
### Theme choice
|
|
642
|
+
|
|
643
|
+
Use `ThemeChoice` for the theme on a settings page. Use `ThemeToggle` in a bar. Use `Segmented`
|
|
644
|
+
for other preferences.
|
|
645
|
+
|
|
646
|
+
```tsx
|
|
647
|
+
<Card title="Theme"><ThemeChoice /></Card>
|
|
648
|
+
```
|
|
649
|
+
|
|
650
|
+
`label` names the group, `Theme` by default. The choice applies and is stored at once, as with
|
|
651
|
+
`ThemeToggle`, so the page needs no Save.
|
|
652
|
+
|
|
653
|
+
**What the user sees.** Three cards in one row at every width: System, Light and Dark. Each card is
|
|
654
|
+
a small picture of a page in that theme, drawn from the theme's tokens, with its name under it.
|
|
655
|
+
System is half light and half dark. The chosen card has a fill, and its name is in strong, heavier
|
|
656
|
+
ink. Hover gives another card half that fill. The first and last pictures sit on the card's text
|
|
657
|
+
edges. The fill extends 8 px into the card's padding, and the focus ring extends 3 px more. So put
|
|
658
|
+
the group in a padded container, such as `Card`.
|
|
659
|
+
|
|
660
|
+
**Keyboard and screen reader.** One named radio group, with one Tab stop on the chosen card. The
|
|
661
|
+
arrow keys move and choose. The focus ring is the kit's band around the card, and nothing else.
|
|
662
|
+
In forced colours the chosen card's name takes the system highlight colour.
|
|
663
|
+
|
|
630
664
|
### Tabs
|
|
631
665
|
|
|
632
666
|
Use `Tabs` when each choice shows a different block of content on the same page. Use
|
|
@@ -969,8 +1003,10 @@ tooltip or a picker already used closes only that overlay. The next Escape close
|
|
|
969
1003
|
|
|
970
1004
|
### Account window
|
|
971
1005
|
|
|
972
|
-
Use `AccountWindow` for account
|
|
973
|
-
|
|
1006
|
+
Use `AccountWindow` for an account area of several groups. When the account area is only a
|
|
1007
|
+
profile and a few preferences, open a Profile page and a Preferences page in the app shell from
|
|
1008
|
+
the account menu, with no second navigation column:
|
|
1009
|
+
[Account and settings](../guidelines/account-and-settings.md).
|
|
974
1010
|
|
|
975
1011
|
```tsx
|
|
976
1012
|
<AccountWindow open={open} onClose={close} reader={{ name: 'Dana Reyes', email: 'dana@example.com' }}
|
|
@@ -1070,7 +1106,8 @@ least 4.5:1 on a plain or a selected row.
|
|
|
1070
1106
|
**Scrolling.** With `stickyHeader` or `pinnedIdentity`, the table stands in a named scroll region.
|
|
1071
1107
|
`pinnedIdentity` pins the first column, or the column whose key you give. A table wider than its
|
|
1072
1108
|
frame scrolls sideways, and the page does not. The pinned column draws its divider only when the
|
|
1073
|
-
region can scroll.
|
|
1109
|
+
region can scroll. When the region is scrolled, the next column's text stops one cell padding
|
|
1110
|
+
short of the divider. Below 720px a pinned cell keeps one line and is cut at
|
|
1074
1111
|
`--ui-table-identity-max`. Lower that cap for a table with a selection column. Below 560px the
|
|
1075
1112
|
frame has no scrollbar. `scrollLabel` names the region, `Table` by default. Use the subject of the table, such as
|
|
1076
1113
|
`Invoices`, and name the gesture only when the columns overflow at every width.
|
|
@@ -1089,10 +1126,14 @@ selected. A dense table marks a selected row only with its box.
|
|
|
1089
1126
|
focus. A `.ui-table__sub` puts a second value under the first, such as an email under a name.
|
|
1090
1127
|
`.ui-table__pair` groups a reference and a status, and stacks them when the cell is narrow.
|
|
1091
1128
|
|
|
1092
|
-
**Keyboard and screen reader.**
|
|
1093
|
-
edge, so the arrow keys, a trackpad and a finger reach the same columns.
|
|
1129
|
+
**Keyboard and screen reader.** When its content overflows, the scroll region takes the focus and
|
|
1130
|
+
draws the ring inside its edge, so the arrow keys, a trackpad and a finger reach the same columns.
|
|
1131
|
+
When the content fits, also after a resize, the region is not a Tab stop. A control in the region
|
|
1132
|
+
that takes the focus by keyboard or by script scrolls fully into view.
|
|
1094
1133
|
|
|
1095
1134
|
**In a card.** The table reaches the card's edges, and its end cells keep the card's text edge.
|
|
1135
|
+
At 560px and narrower, a row table's end cells pad by 16px, so its first column starts 8px
|
|
1136
|
+
outside the card's text edge. A row table has hover and is neither zebra nor dense.
|
|
1096
1137
|
`.ui-card--fit` makes the card end at the table's content.
|
|
1097
1138
|
|
|
1098
1139
|
### Pagination
|
package/guidelines/INDEX.md
CHANGED
|
@@ -4,7 +4,7 @@ Each row names one guideline page, the screen parts it covers, and when to read
|
|
|
4
4
|
|
|
5
5
|
| Page | Screen parts | When to read |
|
|
6
6
|
| --- | --- | --- |
|
|
7
|
-
| [The page](the-page.md) | The page shell, content width, headings, the main action, nested cards, table density and the page introduction. | Read it before you build any screen. |
|
|
7
|
+
| [The page](the-page.md) | The page shell, the sidebar's grouping, content width, headings, the main action, nested cards, table density and the page introduction. | Read it before you build any screen. |
|
|
8
8
|
| [Dashboards and reports](dashboards-and-reports.md) | Dashboard figures, trends and exceptions, report tables, chart cards and a report export. | Read it before you build a dashboard or a report. |
|
|
9
9
|
| [Destructive actions](destructive-actions.md) | Danger controls, action names and confirmation or undo. | Read it before you add a delete, revoke or remove action. |
|
|
10
10
|
| [Colour and theming](colour-and-theming.md) | Colour tokens, accents, signal colours, theme checks and forced colours. | Read it before you pick colours, accents or check contrast. |
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# Account and settings
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Choose pages or the account window by size
|
|
4
4
|
|
|
5
5
|
<!-- rule: modal -->
|
|
6
6
|
|
|
7
|
-
**Rule:** Open
|
|
7
|
+
**Rule:** Open Profile and Preferences as two pages in the app shell, and keep the account window for an account area of several groups.
|
|
8
8
|
|
|
9
|
-
**Why:**
|
|
9
|
+
**Why:** A column of sections beside the app sidebar reads as a second navigation, and a name and a theme fill no column.
|
|
10
10
|
|
|
11
|
-
**Do:**
|
|
11
|
+
**Do:** Open each page from the account menu, with no sidebar entry lit.
|
|
12
12
|
|
|
13
|
-
**Don't:**
|
|
13
|
+
**Don't:** Open a window with its own sections for a photo and a theme.
|
|
14
14
|
|
|
15
|
-
**Except:** On a phone the sections become tabs under the reader
|
|
15
|
+
**Except:** On a phone the window's sections become tabs under the reader.
|
|
16
16
|
|
|
17
|
-
## Give the
|
|
17
|
+
## Give the account window its own navigation
|
|
18
18
|
|
|
19
19
|
<!-- rule: nav -->
|
|
20
20
|
|
|
21
|
-
**Rule:** Give the
|
|
21
|
+
**Rule:** Give the account window one entry per group a reader arrives to change.
|
|
22
22
|
|
|
23
23
|
**Why:** A reader already knows which group they came for, and a list of names is read faster than every group in turn.
|
|
24
24
|
|
|
25
|
-
**Do:** Stand the entries beside the pane — above it on a phone — and mark the one
|
|
25
|
+
**Do:** Stand the entries beside the pane — above it on a phone — and mark the one shown.
|
|
26
26
|
|
|
27
27
|
**Don't:** Run all five groups down one scroll.
|
|
28
28
|
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
|
|
33
33
|
<!-- rule: menu -->
|
|
34
34
|
|
|
35
|
-
**Rule:** Keep the account menu to the reader,
|
|
35
|
+
**Rule:** Keep the account menu to the reader, the ways in, Support and Sign out, and Theme only where no page holds it.
|
|
36
36
|
|
|
37
37
|
**Why:** A setting answered inside a menu has no address to link, search or come back to.
|
|
38
38
|
|
|
39
|
-
**Do:** Name the reader, then
|
|
39
|
+
**Do:** Name the reader, then Profile, Preferences and Support.
|
|
40
40
|
|
|
41
41
|
**Don't:** Answer the settings in the menu, a row per setting.
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
|
|
51
51
|
**Do:** Flip the weekly digest where it is named.
|
|
52
52
|
|
|
53
|
-
**Don't:** Open the
|
|
53
|
+
**Don't:** Open the account window on a pane to flip one switch.
|
|
54
54
|
|
|
55
55
|
**Except:** A question that must be answered before anything else still stops the page.
|
|
56
56
|
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
|
|
61
61
|
**Rule:** Name an account pane’s action after the change it makes.
|
|
62
62
|
|
|
63
|
-
**Why:** On a pane of
|
|
63
|
+
**Why:** On a pane of agent tokens, Save does not say what the press changes.
|
|
64
64
|
|
|
65
65
|
**Do:** End the tokens pane with “Create token”.
|
|
66
66
|
|
package/guidelines/the-page.md
CHANGED
|
@@ -12,6 +12,18 @@
|
|
|
12
12
|
|
|
13
13
|
**Don't:** Move search or the account menu between pages.
|
|
14
14
|
|
|
15
|
+
## Group the sidebar one way
|
|
16
|
+
|
|
17
|
+
<!-- rule: sidebar -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Give the sidebar group labels with no sub-items, or sub-items with no group labels, and never both.
|
|
20
|
+
|
|
21
|
+
**Why:** Both together make a long sidebar that scrolls, so the reader cannot see all the sections at once.
|
|
22
|
+
|
|
23
|
+
**Do:** Put Pending and History under Payouts, with no group labels.
|
|
24
|
+
|
|
25
|
+
**Don't:** Put Payouts and its sub-items under a Money label.
|
|
26
|
+
|
|
15
27
|
## Choose content width
|
|
16
28
|
|
|
17
29
|
<!-- rule: width -->
|
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -682,6 +682,20 @@ cannot change an earlier paint.
|
|
|
682
682
|
<script nonce={nonce} dangerouslySetInnerHTML={{ __html: THEME_INIT_SCRIPT }} />
|
|
683
683
|
```
|
|
684
684
|
|
|
685
|
+
## ThemeChoice
|
|
686
|
+
|
|
687
|
+
ThemeChoice shows the theme as three picture cards on a settings page: System, Light
|
|
688
|
+
and Dark. It reads and stores the choice as ThemeToggle does, with the same key, the
|
|
689
|
+
same root attributes and the same event.
|
|
690
|
+
|
|
691
|
+
```tsx
|
|
692
|
+
import { Card, ThemeChoice } from '@apliteni/apliteni-ui/react';
|
|
693
|
+
|
|
694
|
+
<Card title="Theme"><ThemeChoice /></Card>
|
|
695
|
+
```
|
|
696
|
+
|
|
697
|
+
`label` names the radio group, `Theme` by default.
|
|
698
|
+
|
|
685
699
|
## AppShell
|
|
686
700
|
|
|
687
701
|
AppShell includes the kit’s rail and top band. Pass the current router pathname so the longest matching section path becomes active. Spread the props from `renderLink` onto your router link. The rail’s folded state is saved in a shared cookie. On phones, the bar shows up to four sections. If there are more, it shows three sections and a More sheet. Provide no more than one primary page action. The palette defaults to section links; pass `palette` to add custom commands. Import both the kit CSS and React CSS.
|
package/react/dist/index.css
CHANGED
|
@@ -1457,3 +1457,120 @@
|
|
|
1457
1457
|
.ui-auth__brand > span {
|
|
1458
1458
|
display: flex;
|
|
1459
1459
|
}
|
|
1460
|
+
|
|
1461
|
+
/* src/ThemeChoice.css */
|
|
1462
|
+
.ui-theme-choice {
|
|
1463
|
+
display: grid;
|
|
1464
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
1465
|
+
gap: var(--space-3);
|
|
1466
|
+
margin-inline: calc(-1 * var(--space-2));
|
|
1467
|
+
}
|
|
1468
|
+
.ui-theme-choice__option {
|
|
1469
|
+
display: flex;
|
|
1470
|
+
flex-direction: column;
|
|
1471
|
+
align-items: center;
|
|
1472
|
+
gap: var(--space-2);
|
|
1473
|
+
min-width: 0;
|
|
1474
|
+
padding: var(--space-2);
|
|
1475
|
+
border-radius: var(--radius-lg);
|
|
1476
|
+
color: var(--text);
|
|
1477
|
+
cursor: pointer;
|
|
1478
|
+
transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
|
|
1479
|
+
}
|
|
1480
|
+
.ui-theme-choice__pic {
|
|
1481
|
+
position: relative;
|
|
1482
|
+
display: block;
|
|
1483
|
+
container-type: inline-size;
|
|
1484
|
+
width: 100%;
|
|
1485
|
+
aspect-ratio: 2 / 1.1;
|
|
1486
|
+
overflow: hidden;
|
|
1487
|
+
border: 1px solid var(--border);
|
|
1488
|
+
border-radius: var(--radius-md);
|
|
1489
|
+
transition: transform var(--dur-fast) var(--ease);
|
|
1490
|
+
}
|
|
1491
|
+
.ui-theme-choice__option:not(:has(:checked)):hover {
|
|
1492
|
+
background: color-mix(in srgb, var(--surface-3) 50%, transparent);
|
|
1493
|
+
color: var(--strong);
|
|
1494
|
+
}
|
|
1495
|
+
.ui-theme-choice__option:has(:checked) {
|
|
1496
|
+
background: var(--surface-3);
|
|
1497
|
+
color: var(--strong);
|
|
1498
|
+
font-weight: var(--weight-semibold);
|
|
1499
|
+
}
|
|
1500
|
+
.ui-theme-choice__option:has(.ui-theme-choice__input:focus-visible) {
|
|
1501
|
+
outline: var(--ring);
|
|
1502
|
+
outline-offset: var(--ring-offset);
|
|
1503
|
+
}
|
|
1504
|
+
.ui-theme-choice__option:active .ui-theme-choice__pic {
|
|
1505
|
+
transform: translateY(1px);
|
|
1506
|
+
}
|
|
1507
|
+
.ui-theme-choice__name {
|
|
1508
|
+
overflow-wrap: anywhere;
|
|
1509
|
+
text-align: center;
|
|
1510
|
+
}
|
|
1511
|
+
.ui-theme-choice__scene {
|
|
1512
|
+
position: absolute;
|
|
1513
|
+
inset: 0;
|
|
1514
|
+
display: grid;
|
|
1515
|
+
grid-template-columns: 24% minmax(0, 1fr);
|
|
1516
|
+
background: var(--bg);
|
|
1517
|
+
}
|
|
1518
|
+
.ui-theme-choice__scene + .ui-theme-choice__scene {
|
|
1519
|
+
clip-path: inset(0 0 0 50%);
|
|
1520
|
+
}
|
|
1521
|
+
.ui-theme-choice__rail {
|
|
1522
|
+
display: flex;
|
|
1523
|
+
flex-direction: column;
|
|
1524
|
+
gap: 4cqi;
|
|
1525
|
+
padding: 8cqi 5cqi;
|
|
1526
|
+
border-inline-end: 1px solid var(--border);
|
|
1527
|
+
background: var(--surface);
|
|
1528
|
+
}
|
|
1529
|
+
.ui-theme-choice__main {
|
|
1530
|
+
display: flex;
|
|
1531
|
+
flex-direction: column;
|
|
1532
|
+
gap: 5cqi;
|
|
1533
|
+
padding: 8cqi 7cqi;
|
|
1534
|
+
}
|
|
1535
|
+
.ui-theme-choice__title {
|
|
1536
|
+
width: 40%;
|
|
1537
|
+
height: 3cqi;
|
|
1538
|
+
border-radius: 2cqi;
|
|
1539
|
+
background: var(--strong);
|
|
1540
|
+
}
|
|
1541
|
+
.ui-theme-choice__card {
|
|
1542
|
+
display: flex;
|
|
1543
|
+
flex: 1;
|
|
1544
|
+
flex-direction: column;
|
|
1545
|
+
justify-content: center;
|
|
1546
|
+
gap: 4cqi;
|
|
1547
|
+
padding-inline: 7cqi;
|
|
1548
|
+
border: 1px solid var(--border);
|
|
1549
|
+
border-radius: 4cqi;
|
|
1550
|
+
background: var(--surface);
|
|
1551
|
+
}
|
|
1552
|
+
.ui-theme-choice__rail > span,
|
|
1553
|
+
.ui-theme-choice__card > span {
|
|
1554
|
+
height: 2cqi;
|
|
1555
|
+
border-radius: 1cqi;
|
|
1556
|
+
background: var(--text);
|
|
1557
|
+
}
|
|
1558
|
+
.ui-theme-choice__rail > span,
|
|
1559
|
+
.ui-theme-choice__card > span + span {
|
|
1560
|
+
background: var(--muted);
|
|
1561
|
+
}
|
|
1562
|
+
.ui-theme-choice__card > span + span {
|
|
1563
|
+
width: 55%;
|
|
1564
|
+
}
|
|
1565
|
+
@media (forced-colors: active) {
|
|
1566
|
+
.ui-theme-choice__pic {
|
|
1567
|
+
forced-color-adjust: none;
|
|
1568
|
+
}
|
|
1569
|
+
.ui-theme-choice__input:checked ~ .ui-theme-choice__name {
|
|
1570
|
+
forced-color-adjust: none;
|
|
1571
|
+
padding-inline: var(--space-2);
|
|
1572
|
+
border-radius: var(--radius-sm);
|
|
1573
|
+
background: Highlight;
|
|
1574
|
+
color: HighlightText;
|
|
1575
|
+
}
|
|
1576
|
+
}
|
package/react/dist/index.d.ts
CHANGED
|
@@ -952,12 +952,34 @@ type ToastProps = {
|
|
|
952
952
|
declare function useToast(): (notice: ToastNotice) => void;
|
|
953
953
|
declare function Toast({ children, collapse }: ToastProps): react.JSX.Element;
|
|
954
954
|
|
|
955
|
-
|
|
955
|
+
/** A row that goes somewhere: a section, or a sub-item under one. */
|
|
956
|
+
type AppShellLink = {
|
|
956
957
|
href: string;
|
|
957
958
|
label: string;
|
|
958
|
-
icon
|
|
959
|
+
icon?: string;
|
|
959
960
|
count?: number;
|
|
960
961
|
};
|
|
962
|
+
type AppShellSection = AppShellLink & {
|
|
963
|
+
icon: string;
|
|
964
|
+
/** One level of sub-items. The row then opens them and goes nowhere itself, and its
|
|
965
|
+
* `href` only names it. Only in `sections`, never in `groups` (#843). */
|
|
966
|
+
items?: AppShellLink[];
|
|
967
|
+
};
|
|
968
|
+
/** A group label over sections with no sub-items (#843). */
|
|
969
|
+
type AppShellGroup = {
|
|
970
|
+
label: string;
|
|
971
|
+
sections: (AppShellSection & {
|
|
972
|
+
items?: never;
|
|
973
|
+
})[];
|
|
974
|
+
};
|
|
975
|
+
/** The sidebar takes group labels or sub-items, never both (#843). */
|
|
976
|
+
type AppShellNav = {
|
|
977
|
+
sections: AppShellSection[];
|
|
978
|
+
groups?: never;
|
|
979
|
+
} | {
|
|
980
|
+
groups: AppShellGroup[];
|
|
981
|
+
sections?: never;
|
|
982
|
+
};
|
|
961
983
|
/** A product's own row in the account menu, such as Account settings or Support (#736). */
|
|
962
984
|
type AppShellAccountItem = {
|
|
963
985
|
label: string;
|
|
@@ -965,14 +987,13 @@ type AppShellAccountItem = {
|
|
|
965
987
|
href?: string;
|
|
966
988
|
onSelect?: () => void;
|
|
967
989
|
};
|
|
968
|
-
type AppShellProps = {
|
|
969
|
-
sections: AppShellSection[];
|
|
990
|
+
type AppShellProps = AppShellNav & {
|
|
970
991
|
/** The vanilla rail layout, or the existing band layout. */
|
|
971
992
|
layout?: 'rail' | 'topbar';
|
|
972
993
|
/** The side the phone menu drawer opens from. By default it is the menu button's side:
|
|
973
994
|
* right in the topbar layout, left in the rail layout (#790). */
|
|
974
995
|
drawerSide?: 'left' | 'right';
|
|
975
|
-
/** Current router pathname; the longest matching section wins. */
|
|
996
|
+
/** Current router pathname; the longest matching section or sub-item wins. */
|
|
976
997
|
pathname: string;
|
|
977
998
|
title: string;
|
|
978
999
|
children?: ReactNode;
|
|
@@ -1012,9 +1033,9 @@ type AppShellProps = {
|
|
|
1012
1033
|
* can change the page without a reload. A palette's own `onNavigate` wins. */
|
|
1013
1034
|
onNavigate?: (href: string) => void;
|
|
1014
1035
|
/** Spread linkProps onto the router link, including children and onClick. */
|
|
1015
|
-
renderLink?: (section:
|
|
1036
|
+
renderLink?: (section: AppShellLink, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
|
|
1016
1037
|
};
|
|
1017
|
-
declare function AppShell({ sections, 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;
|
|
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;
|
|
1018
1039
|
|
|
1019
1040
|
type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
|
|
1020
1041
|
brand: ReactNode;
|
|
@@ -1081,6 +1102,14 @@ type ThemeToggleProps = {
|
|
|
1081
1102
|
};
|
|
1082
1103
|
declare function ThemeToggle({ labelled }: ThemeToggleProps): react.JSX.Element;
|
|
1083
1104
|
|
|
1105
|
+
type ThemeChoiceProps = {
|
|
1106
|
+
/** The group's name. Give the name of the card or the row that holds it. */
|
|
1107
|
+
label?: string;
|
|
1108
|
+
};
|
|
1109
|
+
/** The theme as three picture cards: System, Light and Dark. One radio group, so Tab
|
|
1110
|
+
* stops once and the arrow keys move. A choice applies and is stored at once. */
|
|
1111
|
+
declare function ThemeChoice({ label }: ThemeChoiceProps): react.JSX.Element;
|
|
1112
|
+
|
|
1084
1113
|
type TooltipProps = {
|
|
1085
1114
|
text?: string;
|
|
1086
1115
|
label?: string;
|
|
@@ -1310,13 +1339,27 @@ type SidebarNavItem = SidebarNavLeaf & {
|
|
|
1310
1339
|
items?: SidebarNavLeaf[];
|
|
1311
1340
|
defaultOpen?: boolean;
|
|
1312
1341
|
};
|
|
1313
|
-
|
|
1342
|
+
/** A row with no sub-items: the only row a section with a label takes. */
|
|
1343
|
+
type SidebarNavRow = SidebarNavLeaf & {
|
|
1344
|
+
items?: never;
|
|
1345
|
+
defaultOpen?: never;
|
|
1346
|
+
};
|
|
1347
|
+
/** Group labels over plain rows. */
|
|
1348
|
+
type SidebarNavGroup = {
|
|
1314
1349
|
label?: string;
|
|
1350
|
+
items: SidebarNavRow[];
|
|
1351
|
+
};
|
|
1352
|
+
/** Rows that may hold sub-items, under no group label. */
|
|
1353
|
+
type SidebarNavBlock = {
|
|
1354
|
+
label?: never;
|
|
1315
1355
|
items: SidebarNavItem[];
|
|
1316
1356
|
};
|
|
1357
|
+
type SidebarNavSection = SidebarNavGroup | SidebarNavBlock;
|
|
1358
|
+
/** A sidebar takes group labels or sub-items, never both (#843). */
|
|
1359
|
+
type SidebarNavSections = SidebarNavGroup[] | SidebarNavBlock[];
|
|
1317
1360
|
type SidebarNavProps = Omit<ComponentPropsWithoutRef<'nav'>, 'children'> & {
|
|
1318
1361
|
items?: SidebarNavItem[];
|
|
1319
|
-
sections?:
|
|
1362
|
+
sections?: SidebarNavSections;
|
|
1320
1363
|
active?: string;
|
|
1321
1364
|
activeIs?: 'page' | 'section';
|
|
1322
1365
|
collapsed?: boolean;
|
|
@@ -1326,7 +1369,7 @@ type SidebarNavProps = Omit<ComponentPropsWithoutRef<'nav'>, 'children'> & {
|
|
|
1326
1369
|
};
|
|
1327
1370
|
declare const SidebarNav: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & {
|
|
1328
1371
|
items?: SidebarNavItem[];
|
|
1329
|
-
sections?:
|
|
1372
|
+
sections?: SidebarNavSections;
|
|
1330
1373
|
active?: string;
|
|
1331
1374
|
activeIs?: "page" | "section";
|
|
1332
1375
|
collapsed?: boolean;
|
|
@@ -1440,5 +1483,5 @@ declare const NavTabs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedH
|
|
|
1440
1483
|
declare const PAGE_SIZES: readonly number[];
|
|
1441
1484
|
declare const DEFAULT_PAGE_SIZE: number;
|
|
1442
1485
|
|
|
1443
|
-
export { AccentPicker, AccountMenu, AccountWindow, AppShell, AuthShell, Avatar, BackLink, Badge, BusyRegion, Button, Callout, Card, Chart, CheckList, Checkbox, CommandPalette, Confirm, DEFAULT_PAGE_SIZE, DataTable, DatePicker, DeltaValue, Denied, Drawer, DrawerSection, Dropdown, EmptyState, Feedback, Field, FileDrop, FileField, FilterBar, Footer, Icon, KeyValueList, Modal, NavTabs, NumericValue, PAGE_SIZES, Pagination, Pill, RowIdentity, SearchField, Segmented, SelectField, SidebarNav, Skeleton, SkeletonTable, Snippet, StatBand, StatusDot, Success, SuccessCheck, SuccessPanel, Switch, THEME_INIT_SCRIPT, Tabs, TextArea, TextField, ThemeToggle, Timeline, Toast, Tooltip, TopBar, VersionSwitcher, ViewSwitch, sortTableRows, useToast };
|
|
1444
|
-
export type { Accent, AccentPickerProps, AccountMenuProps, AccountReader, AccountSection, AccountWindowProps, AddFilter, AppShellProps, AppShellSection, AuthShellProps, AvatarProps, BackLinkOwnProps, BackLinkProps, BusyRegionProps, ButtonLinkProps, ButtonProps, CalloutProps, CalloutVariant, ChartAreaLook, ChartBridgeStep, ChartBridgeTones, ChartDonutLook, ChartLineLook, ChartLookSeries, ChartPeriod, ChartProps, ChartSeries, ChartSlice, ChartStackedLook, ChartTone, CheckListProps, CheckboxProps, Column, CommandGroup, CommandItem, CommandPaletteProps, ConfirmProps, DataTableProps, DatePickerMode, DatePickerPreset, DatePickerProps, DatePickerRange, DeltaValueProps, DeniedProps, DrawerProps, DrawerSectionProps, DropdownAvatar, DropdownBadge, DropdownEntry, DropdownItem, DropdownProps, DropdownRowProps, DropdownSearch, DropdownSection, DropdownSeparator, EmptyStateProps, EmptyStateVariant, FeedbackPayload, FeedbackProps, FeedbackResult, FeedbackSection, FieldControlProps, FieldProps, FileDropFile, FileDropProps, FileDropStatus, FileFieldProps, Filter, FilterBarProps, FooterColumn, FooterLink, FooterProps, FooterSocial, KeyValueListProps, KeyValueRow, ModalProps, NativeButtonProps, NavTabBadge, NavTabItem, NavTabsProps, NumericValueProps, PaginationProps, PillProps, RowIdentityProps, SearchFieldProps, SegmentOption, SegmentedProps, SelectFieldProps, SidebarNavBadge, SidebarNavItem, SidebarNavLeaf, SidebarNavProps, SidebarNavSection, SkeletonProps, SkeletonTableProps, SnippetProps, StatBandProps, StatDelta, StatFigure, StatTone, StatVariant, StatusDotProps, SuccessCheckProps, SuccessCountdown, SuccessPanelProps, SuccessProps, SwitchProps, TabItem, TableSort, TabsProps, TextAreaProps, TextFieldProps, ThemeToggleProps, TimelineEvent, TimelineEventKind, TimelineProps, ToastNotice, ToastProps, TooltipProps, TopBarProps, Version, VersionSwitcherProps, ViewSwitchItem, ViewSwitchProps };
|
|
1486
|
+
export { AccentPicker, AccountMenu, AccountWindow, AppShell, AuthShell, Avatar, BackLink, Badge, BusyRegion, Button, Callout, Card, Chart, CheckList, Checkbox, CommandPalette, Confirm, DEFAULT_PAGE_SIZE, DataTable, DatePicker, DeltaValue, Denied, Drawer, DrawerSection, Dropdown, EmptyState, Feedback, Field, FileDrop, FileField, FilterBar, Footer, Icon, KeyValueList, Modal, NavTabs, NumericValue, PAGE_SIZES, Pagination, Pill, RowIdentity, SearchField, Segmented, SelectField, SidebarNav, Skeleton, SkeletonTable, Snippet, StatBand, StatusDot, Success, SuccessCheck, SuccessPanel, Switch, THEME_INIT_SCRIPT, Tabs, TextArea, TextField, ThemeChoice, ThemeToggle, Timeline, Toast, Tooltip, TopBar, VersionSwitcher, ViewSwitch, sortTableRows, useToast };
|
|
1487
|
+
export type { Accent, AccentPickerProps, AccountMenuProps, AccountReader, AccountSection, AccountWindowProps, AddFilter, AppShellGroup, AppShellLink, AppShellProps, AppShellSection, AuthShellProps, AvatarProps, BackLinkOwnProps, BackLinkProps, BusyRegionProps, ButtonLinkProps, ButtonProps, CalloutProps, CalloutVariant, ChartAreaLook, ChartBridgeStep, ChartBridgeTones, ChartDonutLook, ChartLineLook, ChartLookSeries, ChartPeriod, ChartProps, ChartSeries, ChartSlice, ChartStackedLook, ChartTone, CheckListProps, CheckboxProps, Column, CommandGroup, CommandItem, CommandPaletteProps, ConfirmProps, DataTableProps, DatePickerMode, DatePickerPreset, DatePickerProps, DatePickerRange, DeltaValueProps, DeniedProps, DrawerProps, DrawerSectionProps, DropdownAvatar, DropdownBadge, DropdownEntry, DropdownItem, DropdownProps, DropdownRowProps, DropdownSearch, DropdownSection, DropdownSeparator, EmptyStateProps, EmptyStateVariant, FeedbackPayload, FeedbackProps, FeedbackResult, FeedbackSection, FieldControlProps, FieldProps, FileDropFile, FileDropProps, FileDropStatus, FileFieldProps, Filter, FilterBarProps, FooterColumn, FooterLink, FooterProps, FooterSocial, KeyValueListProps, KeyValueRow, ModalProps, NativeButtonProps, NavTabBadge, NavTabItem, NavTabsProps, NumericValueProps, PaginationProps, PillProps, RowIdentityProps, SearchFieldProps, SegmentOption, SegmentedProps, SelectFieldProps, SidebarNavBadge, SidebarNavBlock, SidebarNavGroup, SidebarNavItem, SidebarNavLeaf, SidebarNavProps, SidebarNavRow, SidebarNavSection, SidebarNavSections, SkeletonProps, SkeletonTableProps, SnippetProps, StatBandProps, StatDelta, StatFigure, StatTone, StatVariant, StatusDotProps, SuccessCheckProps, SuccessCountdown, SuccessPanelProps, SuccessProps, SwitchProps, TabItem, TableSort, TabsProps, TextAreaProps, TextFieldProps, ThemeChoiceProps, ThemeToggleProps, TimelineEvent, TimelineEventKind, TimelineProps, ToastNotice, ToastProps, TooltipProps, TopBarProps, Version, VersionSwitcherProps, ViewSwitchItem, ViewSwitchProps };
|