@apliteni/apliteni-ui 0.194.0 → 0.196.1
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 +57 -27
- package/guidelines/INDEX.md +1 -1
- package/guidelines/three-column-page.md +55 -13
- package/package.json +1 -1
- package/react/dist/index.css +124 -111
- package/react/dist/index.d.ts +32 -27
- package/react/dist/index.js +115 -87
- package/src/styles/card.css +14 -6
- package/src/styles/stat.css +1 -0
- package/src/styles/table.css +19 -4
package/docs/components.md
CHANGED
|
@@ -87,7 +87,7 @@ what the user sees.
|
|
|
87
87
|
| A section list outside `AppShell` | `SidebarNav` | [Sidebar navigation](#sidebar-navigation) |
|
|
88
88
|
| The product band of a marketing page | `TopBar` | [Top bar](#top-bar) |
|
|
89
89
|
| A sign-in page | `AuthShell` | [Auth shell](#auth-shell) |
|
|
90
|
-
|
|
|
90
|
+
| Parents, the children of the selected parent, and the open child | `ThreeColumnPage` | [Three-column page](#three-column-page) |
|
|
91
91
|
| A site or app footer | `Footer` | [Footer](#footer) |
|
|
92
92
|
| Run an action | `Button` | [Button](#button) |
|
|
93
93
|
| An action that the user cannot undo | `Button hold` | [Hold to confirm](#hold-to-confirm) |
|
|
@@ -320,40 +320,64 @@ ground above the card and centres the title with a line under it. The ground is
|
|
|
320
320
|
|
|
321
321
|
### Three-column page
|
|
322
322
|
|
|
323
|
-
Use `ThreeColumnPage`
|
|
324
|
-
|
|
325
|
-
band and the page's
|
|
326
|
-
|
|
323
|
+
Use `ThreeColumnPage` for a chain of three columns: the parents, the children of the selected
|
|
324
|
+
parent, and the open child, such as folders, files and a file. Put it in `AppShell` with
|
|
325
|
+
`width="full"`, so its lines reach the band and the page's foot. Give `AppShell` the page
|
|
326
|
+
`title`, which the band shows.
|
|
327
327
|
|
|
328
328
|
```tsx
|
|
329
|
-
<AppShell width="full" title="
|
|
330
|
-
<ThreeColumnPage
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
329
|
+
<AppShell width="full" title="Library" sections={sections} pathname="/library" account={account} onSignOut={signOut}>
|
|
330
|
+
<ThreeColumnPage depth={depth} onDepthChange={setDepth} depthHref={(to) => libraryAddress(to)} columns={[
|
|
331
|
+
{ title: 'Folders', count: 5, countLabel: '5 folders', children: <FolderRows /> },
|
|
332
|
+
{ title: 'Shared', count: 3, countLabel: '3 files', menu: { sections: sortAndFilter, onSelect }, children: <FileRows /> },
|
|
333
|
+
{ title: 'Contacts', children: <div className="ui-columns__body"><FileFacts /></div> },
|
|
334
|
+
]} />
|
|
334
335
|
</AppShell>
|
|
335
336
|
```
|
|
336
337
|
|
|
337
|
-
`
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
`columns` holds the three columns. Leave out the third when the selected parent has no
|
|
339
|
+
children: the second column then takes its space and shows the empty state. Each column takes a
|
|
340
|
+
`title`, which is its `h2` and the words of a back link to it, an optional `count` with its spoken
|
|
341
|
+
`countLabel`, optional `tools`, and its `children`. While a filter is on, give the count as "2 of 3".
|
|
342
|
+
`depth` is 1, 2 or 3: how far down the chain the reader is. Pass `depth` with `onDepthChange`, or
|
|
343
|
+
let the page keep it from `defaultDepth`, which is 2. `children` can be a function that gets
|
|
344
|
+
`open`: a row calls it to take the reader one step down, to the next column, in either case.
|
|
345
|
+
`onDepthChange` hears the back link and `open`. Give `depthHref`, so that the back link goes to
|
|
346
|
+
the address of the depth above. The browser follows that address first, and then the page
|
|
347
|
+
changes the depth, so an app that reads the address lands on the parent. `menu` takes the rows of a `Dropdown` menu: with it, the
|
|
348
|
+
title opens the menu, and without it, the title is plain text. A menu row with `selected`, true or
|
|
349
|
+
false, is one choice of its group, and the current choice shows the menu's tick. Put the actions
|
|
350
|
+
in the first group and each set of choices in a labelled group. A menu taller than 300px takes
|
|
351
|
+
`scroll` with its height, so every row shows.
|
|
352
|
+
|
|
353
|
+
A column's list uses the sidebar's rows (`ui-nav__item`) inside `.ui-columns__list`. A row ends
|
|
354
|
+
with `.ui-columns__end`, a count or a date, and a row that opens a column ends with a
|
|
355
|
+
`chevronRight` glyph in `.ui-nav__ic.ui-columns__into`. Other content stands in
|
|
356
|
+
`.ui-columns__body`, on the title's edge. Put an empty state, or a skeleton in a busy region, in
|
|
357
|
+
`.ui-columns__body`.
|
|
341
358
|
|
|
342
359
|
**What the user sees.**
|
|
343
360
|
|
|
344
|
-
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
361
|
+
- In a page area wider than 860px, three columns. Column 1 is 240px. Column 2 is 26% of the
|
|
362
|
+
page area, from 260px to 320px. Column 3 takes the rest, at least 360px. Each column scrolls
|
|
363
|
+
alone below its header row, and a 1px `--border` line from the band to the foot stands between
|
|
364
|
+
two columns.
|
|
365
|
+
- In a page area of 860px or less, two neighbour columns: the parents and the children at depth 1
|
|
366
|
+
and 2, and the children and the open child at depth 3. The first takes 40%, and at least 200px.
|
|
367
|
+
An open sidebar on a small laptop thus gives two columns, as a tablet does.
|
|
368
|
+
- In a window of 560px and less, the column at the depth only, and the page scrolls as one.
|
|
369
|
+
- When a column before the first one on show is hidden, a back link above the columns names it.
|
|
370
|
+
- Each header row has one height, so the titles stand on one line. The title is the card title's
|
|
371
|
+
size, and a long title ends in an ellipsis. The count follows it, and the tools stand at the
|
|
372
|
+
row's end.
|
|
373
|
+
- A list's glyphs start on the title's edge. A step list and a table keep their own inset: the
|
|
374
|
+
step mark stands 4px in, and a table's words stand in by the cell's inset, as in a card.
|
|
375
|
+
|
|
376
|
+
**Keyboard and screen reader.** Each column is a region named by its title. A count with a
|
|
377
|
+
`countLabel` is read as that label. When a move hides or removes the control that had the focus,
|
|
378
|
+
the focus goes to the title of the column at the depth, or to its menu button. A column's
|
|
379
|
+
scroll box shows the inward focus band on its four sides. The back link is named "Back to" and
|
|
380
|
+
the column's title. On a touch phone each list row and the title menu have a 44px target.
|
|
357
381
|
|
|
358
382
|
### Footer
|
|
359
383
|
|
|
@@ -845,6 +869,12 @@ gives less vertical space, and `pad="lg"` makes a centred landing card. `icon` a
|
|
|
845
869
|
centred on the title line. On a touch phone the tools stand `--tap-gap` apart. A `Chart` in a
|
|
846
870
|
titled card puts its Chart and Table switch there.
|
|
847
871
|
|
|
872
|
+
**A card on the light page.** A card draws no box, and its text and its table text start on the
|
|
873
|
+
page title's edge. To do this, the card hangs outside its container by its side inset: 24px, and
|
|
874
|
+
16px at 720px and below. The page shell pads enough for this at every width. If you put a light
|
|
875
|
+
card in another container, pad each side of the container by at least the hang, or the page
|
|
876
|
+
scrolls sideways. A tinted card, a landing card and a stat tile keep their box and do not hang.
|
|
877
|
+
|
|
848
878
|
**Setting rows.** A setting row keeps its choice on one line. On a phone, the control stands under
|
|
849
879
|
its label and hint. Use `ui-card__row--tight-choice` for a three-option row that must stay on one
|
|
850
880
|
line below 360px.
|
package/guidelines/INDEX.md
CHANGED
|
@@ -32,6 +32,6 @@ Each row names one guideline page, the screen parts it covers, and when to read
|
|
|
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
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. |
|
|
34
34
|
| [Session expired](session-expired.md) | A session-ended dialog, its page state and its lasting sign-in notice. | Read it before you handle an ended session. |
|
|
35
|
-
| [Three-column page](three-column-page.md) |
|
|
35
|
+
| [Three-column page](three-column-page.md) | Three columns chained from parent to child: the selected parent, its children and the open child, with the widths, the collapse order and the column header. | Read it before you put a list, its children and the open item side by side. |
|
|
36
36
|
| [Wizard](wizard.md) | Ordered steps, their states, the open step and the final action. | Read it before you build ordered steps. |
|
|
37
37
|
| [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. |
|
|
@@ -1,37 +1,79 @@
|
|
|
1
1
|
# Three-column page
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## Chain the columns from parent to child
|
|
4
4
|
|
|
5
5
|
<!-- rule: three-columns -->
|
|
6
6
|
|
|
7
|
-
**Rule:**
|
|
7
|
+
**Rule:** Make column 1 the parents, column 2 the children of the selected parent, and column 3 the selected child.
|
|
8
8
|
|
|
9
|
-
**Why:** The reader sees
|
|
9
|
+
**Why:** The reader sees where the open item comes from.
|
|
10
10
|
|
|
11
|
-
**Do:** Show the
|
|
11
|
+
**Do:** Show the folders, the selected folder's files, then the open file.
|
|
12
12
|
|
|
13
|
-
**Don't:**
|
|
13
|
+
**Don't:** Put three unrelated columns on one page.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Mark the selected parent
|
|
16
|
+
|
|
17
|
+
<!-- rule: selected-parent -->
|
|
18
|
+
|
|
19
|
+
**Rule:** Keep the selected paint on the selected item in columns 1 and 2, and end each parent row with a chevron.
|
|
20
|
+
|
|
21
|
+
**Why:** The reader sees which parent each column belongs to.
|
|
22
|
+
|
|
23
|
+
**Do:** Mark the selected folder and the open file.
|
|
24
|
+
|
|
25
|
+
**Don't:** Remove a parent's mark when the reader works in the next column.
|
|
26
|
+
|
|
27
|
+
**Except:** A step list's open step keeps its own tint, which shows its state.
|
|
28
|
+
|
|
29
|
+
## Replace the children when the parent changes
|
|
30
|
+
|
|
31
|
+
<!-- rule: replace-children -->
|
|
32
|
+
|
|
33
|
+
**Rule:** When the reader selects a new parent, replace each column after it.
|
|
34
|
+
|
|
35
|
+
**Why:** The old parent's children beside a new parent show wrong data.
|
|
36
|
+
|
|
37
|
+
**Do:** Replace the files and the open file for a new folder.
|
|
38
|
+
|
|
39
|
+
**Don't:** Keep the old folder's files beside a new folder.
|
|
40
|
+
|
|
41
|
+
**Except:** An empty parent gives column 3's space to column 2, which says what is missing.
|
|
42
|
+
|
|
43
|
+
## Keep the child column wide
|
|
16
44
|
|
|
17
45
|
<!-- rule: column-widths -->
|
|
18
46
|
|
|
19
|
-
**Rule:** Give
|
|
47
|
+
**Rule:** Give column 1 240px, column 2 from 260px to 320px, and column 3 the rest.
|
|
20
48
|
|
|
21
|
-
**Why:** The
|
|
49
|
+
**Why:** The open item needs the room.
|
|
22
50
|
|
|
23
|
-
**Do:**
|
|
51
|
+
**Do:** Let each column scroll alone, with a full-height line between columns.
|
|
24
52
|
|
|
25
53
|
**Don't:** Split the page into three equal columns.
|
|
26
54
|
|
|
27
|
-
|
|
55
|
+
**Except:** A narrow page shows two columns, as a tablet does.
|
|
56
|
+
|
|
57
|
+
## Show two columns, then one
|
|
28
58
|
|
|
29
59
|
<!-- rule: collapse-order -->
|
|
30
60
|
|
|
31
|
-
**Rule:**
|
|
61
|
+
**Rule:** On a tablet show the open column and its parent, and on a phone only the open column, under a back link that names the hidden parent.
|
|
32
62
|
|
|
33
|
-
**Why:** The
|
|
63
|
+
**Why:** The reader goes up the chain one step at a time.
|
|
34
64
|
|
|
35
|
-
**Do:** Put
|
|
65
|
+
**Do:** Put a back link to the folders above the files.
|
|
36
66
|
|
|
37
67
|
**Don't:** Squeeze three columns onto a phone.
|
|
68
|
+
|
|
69
|
+
## Give each column one header row
|
|
70
|
+
|
|
71
|
+
<!-- rule: column-header -->
|
|
72
|
+
|
|
73
|
+
**Rule:** Start each column with a header row of one height: the title, then an optional count and tools.
|
|
74
|
+
|
|
75
|
+
**Why:** Titles on one line let the chain read across the page.
|
|
76
|
+
|
|
77
|
+
**Do:** Put a column's sorting, view and quick filters in a menu on its title.
|
|
78
|
+
|
|
79
|
+
**Don't:** Put a bar of view options between the title and the list.
|
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -1691,172 +1691,185 @@
|
|
|
1691
1691
|
}
|
|
1692
1692
|
|
|
1693
1693
|
/* src/ThreeColumnPage.css */
|
|
1694
|
-
.ui-columns {
|
|
1695
|
-
|
|
1696
|
-
display: grid;
|
|
1697
|
-
grid-template-columns: minmax(0, min(var(--panel-lg), 41%)) minmax(0, 1fr);
|
|
1694
|
+
.ui-columns-area {
|
|
1695
|
+
container: ui-columns / inline-size;
|
|
1698
1696
|
flex: 1 1 auto;
|
|
1699
1697
|
min-width: 0;
|
|
1700
1698
|
}
|
|
1701
|
-
.ui-
|
|
1699
|
+
.ui-columns {
|
|
1700
|
+
display: grid;
|
|
1701
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
1702
|
+
grid-template-columns: 240px clamp(260px, 26%, var(--panel-sm)) minmax(0, 1fr);
|
|
1703
|
+
height: calc(100dvh - var(--ui-app-band, 0px));
|
|
1704
|
+
overflow-y: clip;
|
|
1705
|
+
}
|
|
1706
|
+
.ui-columns__up {
|
|
1707
|
+
grid-column: 1 / -1;
|
|
1708
|
+
padding: var(--space-3) var(--space-3) 0;
|
|
1709
|
+
}
|
|
1710
|
+
.ui-columns__col {
|
|
1702
1711
|
display: flex;
|
|
1703
1712
|
flex-direction: column;
|
|
1704
|
-
|
|
1713
|
+
grid-row: 2;
|
|
1705
1714
|
min-width: 0;
|
|
1706
|
-
|
|
1715
|
+
min-height: 0;
|
|
1716
|
+
}
|
|
1717
|
+
.ui-columns__col + .ui-columns__col {
|
|
1718
|
+
border-inline-start: 1px solid var(--border);
|
|
1719
|
+
}
|
|
1720
|
+
.ui-columns__col--2:last-child {
|
|
1721
|
+
grid-column: 2 / -1;
|
|
1722
|
+
}
|
|
1723
|
+
.ui-columns__scroll {
|
|
1724
|
+
flex: 1 1 auto;
|
|
1725
|
+
min-height: 0;
|
|
1726
|
+
overflow-y: auto;
|
|
1727
|
+
}
|
|
1728
|
+
.ui-columns__scroll:focus-visible {
|
|
1729
|
+
outline: var(--ring-scroll);
|
|
1730
|
+
outline-offset: var(--ring-scroll-offset);
|
|
1707
1731
|
}
|
|
1708
1732
|
.ui-columns__head {
|
|
1733
|
+
flex: none;
|
|
1709
1734
|
display: flex;
|
|
1710
|
-
flex-wrap: wrap;
|
|
1711
1735
|
align-items: center;
|
|
1712
|
-
gap: var(--space-2)
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
display: contents;
|
|
1736
|
+
gap: var(--space-2);
|
|
1737
|
+
min-height: calc(var(--space-12) + var(--space-2));
|
|
1738
|
+
padding: 0 var(--space-5);
|
|
1716
1739
|
}
|
|
1717
|
-
.ui-
|
|
1718
|
-
flex: 1 1 auto;
|
|
1740
|
+
.ui-columns__head > h2 {
|
|
1719
1741
|
min-width: 0;
|
|
1720
1742
|
margin: 0;
|
|
1721
1743
|
}
|
|
1722
|
-
.ui-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
gap: var(--space-2);
|
|
1727
|
-
margin-inline-start: calc(var(--ui-app-title-inset, var(--ui-columns-edge, var(--space-6))) - var(--ui-columns-edge, var(--space-6)) - var(--space-3));
|
|
1744
|
+
.ui-columns__head > h2:focus-visible {
|
|
1745
|
+
outline: var(--ring);
|
|
1746
|
+
outline-offset: var(--ring-offset);
|
|
1747
|
+
border-radius: var(--radius-xs);
|
|
1728
1748
|
}
|
|
1729
|
-
.ui-
|
|
1730
|
-
width:
|
|
1749
|
+
.ui-columns__words {
|
|
1750
|
+
min-width: 0;
|
|
1751
|
+
overflow: hidden;
|
|
1752
|
+
text-overflow: ellipsis;
|
|
1753
|
+
white-space: nowrap;
|
|
1731
1754
|
}
|
|
1732
|
-
.ui-
|
|
1733
|
-
|
|
1734
|
-
flex-wrap: wrap;
|
|
1735
|
-
gap: var(--space-4);
|
|
1736
|
-
align-items: stretch;
|
|
1737
|
-
flex: 1 1 auto;
|
|
1738
|
-
margin-inline-start: calc(-1 * (var(--space-4) + 1px));
|
|
1739
|
-
clip-path: inset(0 0 0 calc(var(--space-4) + 1px));
|
|
1755
|
+
.ui-columns__head > .ui-dropdown {
|
|
1756
|
+
min-width: 0;
|
|
1740
1757
|
}
|
|
1741
|
-
.ui-
|
|
1742
|
-
|
|
1743
|
-
|
|
1758
|
+
.ui-columns__head .ui-columns__menu {
|
|
1759
|
+
min-width: 0;
|
|
1760
|
+
max-width: calc(100% + var(--space-2));
|
|
1761
|
+
margin-inline-start: calc(-1 * var(--space-2));
|
|
1762
|
+
padding: var(--space-1) var(--space-2);
|
|
1763
|
+
color: var(--strong);
|
|
1764
|
+
font-family: var(--font-sans);
|
|
1765
|
+
font-size: var(--text-lg);
|
|
1766
|
+
font-weight: var(--weight-semibold);
|
|
1767
|
+
line-height: var(--leading-snug);
|
|
1768
|
+
background: none;
|
|
1769
|
+
border: 0;
|
|
1770
|
+
border-radius: var(--radius-xs);
|
|
1744
1771
|
}
|
|
1745
|
-
.ui-
|
|
1746
|
-
|
|
1747
|
-
|
|
1772
|
+
.ui-columns__head .ui-columns__menu:hover,
|
|
1773
|
+
.ui-columns__head .ui-dropdown.open > .ui-columns__menu {
|
|
1774
|
+
background: color-mix(in srgb, var(--nav-active-fill) 50%, transparent);
|
|
1748
1775
|
}
|
|
1749
|
-
.ui-
|
|
1750
|
-
display: flex;
|
|
1751
|
-
flex-direction: column;
|
|
1752
|
-
gap: var(--space-2);
|
|
1776
|
+
.ui-columns__menu > .ui-dropdown__text {
|
|
1753
1777
|
min-width: 0;
|
|
1778
|
+
overflow: hidden;
|
|
1779
|
+
text-overflow: ellipsis;
|
|
1780
|
+
white-space: nowrap;
|
|
1754
1781
|
}
|
|
1755
|
-
.ui-
|
|
1756
|
-
|
|
1782
|
+
.ui-columns__count {
|
|
1783
|
+
flex: none;
|
|
1784
|
+
font-size: var(--text-sm);
|
|
1785
|
+
font-variant-numeric: tabular-nums;
|
|
1757
1786
|
}
|
|
1758
|
-
.ui-
|
|
1759
|
-
|
|
1760
|
-
scroll-margin-block-start: calc(var(--ui-app-band, 0px) + var(--space-4));
|
|
1787
|
+
.ui-columns__list {
|
|
1788
|
+
padding: 0 var(--space-2) var(--space-4);
|
|
1761
1789
|
}
|
|
1762
|
-
.ui-
|
|
1763
|
-
|
|
1764
|
-
|
|
1790
|
+
.ui-columns__end {
|
|
1791
|
+
flex: none;
|
|
1792
|
+
font-size: var(--text-sm);
|
|
1793
|
+
font-variant-numeric: tabular-nums;
|
|
1765
1794
|
}
|
|
1766
|
-
.ui-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1795
|
+
.ui-columns__into {
|
|
1796
|
+
margin-inline-start: calc(-1 * var(--space-1));
|
|
1797
|
+
}
|
|
1798
|
+
.ui-columns__body {
|
|
1799
|
+
display: flex;
|
|
1800
|
+
flex-direction: column;
|
|
1801
|
+
gap: var(--space-6);
|
|
1802
|
+
padding: 0 var(--space-5) var(--space-10);
|
|
1770
1803
|
}
|
|
1771
|
-
.ui-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
animation: m-fade var(--dur-fast) var(--ease-out) both;
|
|
1804
|
+
.ui-columns__body > p {
|
|
1805
|
+
margin: 0;
|
|
1806
|
+
max-width: var(--prose-body);
|
|
1775
1807
|
}
|
|
1776
|
-
@
|
|
1808
|
+
@container ui-columns (max-width: 860px) {
|
|
1777
1809
|
.ui-columns {
|
|
1778
|
-
|
|
1779
|
-
grid-template-columns: minmax(0, 1fr);
|
|
1780
|
-
align-content: start;
|
|
1810
|
+
grid-template-columns: minmax(200px, 40%) minmax(0, 1fr);
|
|
1781
1811
|
}
|
|
1782
|
-
.ui-
|
|
1783
|
-
|
|
1784
|
-
}
|
|
1785
|
-
.ui-columns__views {
|
|
1786
|
-
display: flex;
|
|
1787
|
-
}
|
|
1788
|
-
.ui-columns__pair {
|
|
1789
|
-
margin-inline-start: 0;
|
|
1790
|
-
clip-path: none;
|
|
1791
|
-
}
|
|
1792
|
-
.ui-columns__pair > .ui-columns__area {
|
|
1793
|
-
padding-bottom: 0;
|
|
1794
|
-
padding-inline-start: 0;
|
|
1795
|
-
border-inline-start: 0;
|
|
1812
|
+
.ui-columns__col--2:last-child {
|
|
1813
|
+
grid-column: auto;
|
|
1796
1814
|
}
|
|
1797
|
-
.ui-
|
|
1815
|
+
.ui-columns:not([data-depth="3"]) > .ui-columns__col--3,
|
|
1816
|
+
.ui-columns[data-depth="3"] > .ui-columns__col--1 {
|
|
1798
1817
|
display: none;
|
|
1799
1818
|
}
|
|
1800
|
-
.ui-
|
|
1801
|
-
max-width: var(--panel-sm);
|
|
1802
|
-
}
|
|
1803
|
-
.ui-columns__area--work {
|
|
1804
|
-
padding: var(--space-8) var(--ui-columns-edge, var(--space-6)) var(--space-10);
|
|
1819
|
+
.ui-columns[data-depth="3"] > .ui-columns__col--2 {
|
|
1805
1820
|
border-inline-start: 0;
|
|
1806
1821
|
}
|
|
1807
|
-
.ui-columns[data-view=nav] .ui-columns__area--nav {
|
|
1808
|
-
display: flex;
|
|
1809
|
-
}
|
|
1810
|
-
.ui-columns[data-view=nav] .ui-columns__area--steps,
|
|
1811
|
-
.ui-columns[data-view=nav] .ui-columns__area--work {
|
|
1812
|
-
display: none;
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
@media (max-width: 720px) {
|
|
1816
|
-
.ui-columns {
|
|
1817
|
-
--ui-columns-edge: var(--space-6);
|
|
1818
|
-
}
|
|
1819
1822
|
}
|
|
1820
1823
|
@media (max-width: 560px) {
|
|
1821
1824
|
.ui-columns {
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
padding: var(--space-6) var(--ui-columns-edge, var(--space-6)) 0;
|
|
1825
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1826
|
+
height: auto;
|
|
1827
|
+
overflow-y: visible;
|
|
1826
1828
|
}
|
|
1827
|
-
.ui-
|
|
1828
|
-
padding: var(--space-
|
|
1829
|
+
.ui-columns__up {
|
|
1830
|
+
padding-inline: var(--space-2);
|
|
1829
1831
|
}
|
|
1830
|
-
.ui-columns .ui-
|
|
1832
|
+
.ui-columns > .ui-columns__col {
|
|
1831
1833
|
display: none;
|
|
1834
|
+
border-inline-start: 0;
|
|
1832
1835
|
}
|
|
1833
|
-
.ui-columns[data-
|
|
1834
|
-
.ui-columns[data-
|
|
1835
|
-
.ui-columns[data-
|
|
1836
|
+
.ui-columns[data-depth="1"] > .ui-columns__col--1,
|
|
1837
|
+
.ui-columns[data-depth="2"] > .ui-columns__col--2,
|
|
1838
|
+
.ui-columns[data-depth="3"] > .ui-columns__col--3 {
|
|
1836
1839
|
display: flex;
|
|
1837
1840
|
}
|
|
1838
|
-
.ui-
|
|
1839
|
-
|
|
1841
|
+
.ui-columns__scroll {
|
|
1842
|
+
overflow-y: visible;
|
|
1843
|
+
}
|
|
1844
|
+
.ui-columns__head,
|
|
1845
|
+
.ui-columns__body {
|
|
1846
|
+
padding-inline: var(--space-4);
|
|
1847
|
+
}
|
|
1848
|
+
.ui-columns__list {
|
|
1849
|
+
padding-inline: var(--space-1);
|
|
1840
1850
|
}
|
|
1841
1851
|
}
|
|
1842
1852
|
@media (max-width: 560px) and (pointer: coarse) {
|
|
1843
|
-
.ui-
|
|
1853
|
+
.ui-columns__list > .ui-nav__list {
|
|
1844
1854
|
gap: var(--tap-gap);
|
|
1845
|
-
--tap-clear-x: var(--tap-gap);
|
|
1846
1855
|
--tap-clear-y: var(--tap-gap);
|
|
1847
1856
|
}
|
|
1848
|
-
.ui-
|
|
1857
|
+
.ui-columns__head {
|
|
1858
|
+
--tap-clear-y: var(--space-3);
|
|
1859
|
+
}
|
|
1860
|
+
.ui-columns__head .ui-columns__menu {
|
|
1861
|
+
position: relative;
|
|
1862
|
+
}
|
|
1863
|
+
.ui-columns__list .ui-nav__item::after,
|
|
1864
|
+
.ui-columns__head .ui-columns__menu::after {
|
|
1849
1865
|
content: "";
|
|
1850
1866
|
position: absolute;
|
|
1851
1867
|
left: 50%;
|
|
1852
1868
|
top: 50%;
|
|
1853
1869
|
transform: translate(-50%, -50%);
|
|
1854
|
-
width:
|
|
1870
|
+
width: 100%;
|
|
1855
1871
|
height: min(max(100%, var(--tap-min)), calc(100% + var(--tap-clear-y)));
|
|
1856
1872
|
}
|
|
1857
|
-
.ui-columns__area > .ui-toolbar:not(:last-child) {
|
|
1858
|
-
margin-bottom: calc(var(--tap-gap) - var(--space-2));
|
|
1859
|
-
}
|
|
1860
1873
|
}
|
|
1861
1874
|
|
|
1862
1875
|
/* src/ThemeChoice.css */
|
package/react/dist/index.d.ts
CHANGED
|
@@ -1121,36 +1121,41 @@ declare const AuthShell: react.ForwardRefExoticComponent<Omit<HTMLAttributes<HTM
|
|
|
1121
1121
|
brandAbove?: boolean;
|
|
1122
1122
|
} & react.RefAttributes<HTMLDivElement>>;
|
|
1123
1123
|
|
|
1124
|
-
|
|
1125
|
-
type
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1124
|
+
/** How far down the chain the reader is: 1 the parents, 2 the children, 3 the open child. */
|
|
1125
|
+
type ThreeColumnDepth = 1 | 2 | 3;
|
|
1126
|
+
/** The rows of a column's title menu, such as the count, sorting, the view and quick filters.
|
|
1127
|
+
* A row with `selected` set, true or false, is one choice of its group: it takes the check
|
|
1128
|
+
* when true. `scroll` is the panel's cap in px, for a menu taller than the kit's 300px. */
|
|
1129
|
+
type ThreeColumnMenu = Pick<DropdownProps, 'items' | 'sections' | 'header' | 'onSelect' | 'scroll'>;
|
|
1130
|
+
type ThreeColumn = {
|
|
1131
|
+
/** The column's h2, and the words of the back link that goes to the column. */
|
|
1132
|
+
title: string;
|
|
1133
|
+
/** A count after the title, such as the number of rows, or "2 of 3" while a filter is on. */
|
|
1134
|
+
count?: number | string;
|
|
1135
|
+
/** The count as a screen reader says it, such as "5 folders". */
|
|
1136
|
+
countLabel?: string;
|
|
1137
|
+
/** Small tools at the end of the header row. */
|
|
1138
|
+
tools?: ReactNode;
|
|
1139
|
+
/** With rows, the title opens a menu. Without them, the title is plain text. */
|
|
1140
|
+
menu?: ThreeColumnMenu;
|
|
1141
|
+
/** The column's content. A function gets `open`, which takes the reader one step down the
|
|
1142
|
+
* chain to the next column, so a row can open its child with or without `depth`. */
|
|
1143
|
+
children: ReactNode | ((open: () => void) => ReactNode);
|
|
1131
1144
|
};
|
|
1132
1145
|
type ThreeColumnPageProps = {
|
|
1133
|
-
/** The
|
|
1134
|
-
*
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
/** The
|
|
1139
|
-
|
|
1140
|
-
/** The
|
|
1141
|
-
|
|
1142
|
-
/** The work half: the rows of the open step. */
|
|
1143
|
-
work: ThreeColumnArea;
|
|
1144
|
-
/** The area shown on a phone, and the list's own view on a tablet. */
|
|
1145
|
-
view?: ThreeColumnView;
|
|
1146
|
-
defaultView?: ThreeColumnView;
|
|
1147
|
-
onViewChange?: (view: ThreeColumnView) => void;
|
|
1148
|
-
/** The name of the link group. */
|
|
1149
|
-
viewsLabel?: string;
|
|
1146
|
+
/** The parents, the children of the selected parent, and the open child. Leave out the
|
|
1147
|
+
* third column when the selected parent has no children: the second takes its space. */
|
|
1148
|
+
columns: readonly [ThreeColumn, ThreeColumn, ThreeColumn?];
|
|
1149
|
+
depth?: ThreeColumnDepth;
|
|
1150
|
+
defaultDepth?: ThreeColumnDepth;
|
|
1151
|
+
/** The back link asks for one step up the chain, and `open` for one step down. */
|
|
1152
|
+
onDepthChange?: (depth: ThreeColumnDepth) => void;
|
|
1153
|
+
/** The address of a depth, for the back link. Without it, the link only calls onDepthChange. */
|
|
1154
|
+
depthHref?: (depth: ThreeColumnDepth) => string;
|
|
1150
1155
|
className?: string;
|
|
1151
1156
|
};
|
|
1152
|
-
/** A
|
|
1153
|
-
declare function ThreeColumnPage({
|
|
1157
|
+
/** A column browser: the parents, the children of the selected parent, and the open child. */
|
|
1158
|
+
declare function ThreeColumnPage({ columns, depth, defaultDepth, onDepthChange, depthHref, className }: ThreeColumnPageProps): react.JSX.Element;
|
|
1154
1159
|
|
|
1155
1160
|
type FooterLink = {
|
|
1156
1161
|
label: string;
|
|
@@ -1605,4 +1610,4 @@ declare const PAGE_SIZES: readonly number[];
|
|
|
1605
1610
|
declare const DEFAULT_PAGE_SIZE: number;
|
|
1606
1611
|
|
|
1607
1612
|
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, ThreeColumnPage, Timeline, Toast, Tooltip, TopBar, VersionSwitcher, ViewSwitch, Wizard, sortTableRows, useToast };
|
|
1608
|
-
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, ChartEstimate, 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,
|
|
1613
|
+
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, ChartEstimate, 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, ThreeColumn, ThreeColumnDepth, ThreeColumnMenu, ThreeColumnPageProps, TimelineEvent, TimelineEventKind, TimelineProps, ToastNotice, ToastProps, TooltipProps, TopBarProps, Version, VersionSwitcherProps, ViewSwitchItem, ViewSwitchProps, WizardFinal, WizardProps, WizardStep, WizardStepState };
|
package/react/dist/index.js
CHANGED
|
@@ -2624,7 +2624,7 @@ function evenMonthLabels(format) {
|
|
|
2624
2624
|
}
|
|
2625
2625
|
var clamp = (index, lo, hi) => Math.min(hi ?? index, Math.max(lo ?? index, index));
|
|
2626
2626
|
function DatePicker({
|
|
2627
|
-
mode = "month",
|
|
2627
|
+
mode: mode2 = "month",
|
|
2628
2628
|
value,
|
|
2629
2629
|
defaultValue = null,
|
|
2630
2630
|
onChange,
|
|
@@ -2650,8 +2650,8 @@ function DatePicker({
|
|
|
2650
2650
|
defaultOpen = false,
|
|
2651
2651
|
onOpenChange
|
|
2652
2652
|
}) {
|
|
2653
|
-
const grain =
|
|
2654
|
-
const picksRange =
|
|
2653
|
+
const grain = mode2 === "day" || mode2 === "day-range" ? "day" : "month";
|
|
2654
|
+
const picksRange = mode2 === "range" || mode2 === "day-range";
|
|
2655
2655
|
const phone = usePhone();
|
|
2656
2656
|
const asSheet = sheet ?? phone;
|
|
2657
2657
|
const root = useRef14(null);
|
|
@@ -5468,83 +5468,111 @@ var AuthShell = forwardRef10(function AuthShell2({ brand, children, split, tagli
|
|
|
5468
5468
|
});
|
|
5469
5469
|
|
|
5470
5470
|
// src/ThreeColumnPage.tsx
|
|
5471
|
-
import { useEffect as useEffect21, useId as useId16, useRef as useRef25, useState as useState21 } from "react";
|
|
5472
|
-
import {
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5471
|
+
import { useEffect as useEffect21, useId as useId16, useLayoutEffect as useLayoutEffect5, useRef as useRef25, useState as useState21, useSyncExternalStore as useSyncExternalStore2 } from "react";
|
|
5472
|
+
import { Fragment as Fragment20, jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
5473
|
+
var choiceRow = (item, props) => item.selected === void 0 ? props.href ? /* @__PURE__ */ jsx44("a", { ...props }) : /* @__PURE__ */ jsx44("div", { ...props }) : /* @__PURE__ */ jsxs40("div", { ...props, role: "menuitemradio", "aria-checked": item.selected, children: [
|
|
5474
|
+
props.children,
|
|
5475
|
+
/* @__PURE__ */ jsx44("span", { className: "ui-dropdown__tick", children: /* @__PURE__ */ jsx44(Icon, { name: "check" }) })
|
|
5476
|
+
] });
|
|
5477
|
+
var AREA = 860;
|
|
5478
|
+
var QUERIES = ["(max-width: 560px)", "(max-width: 860px)"];
|
|
5479
|
+
var lists = () => typeof window === "undefined" || !window.matchMedia ? null : QUERIES.map((q) => window.matchMedia(q));
|
|
5480
|
+
var subscribe2 = (fn) => {
|
|
5481
|
+
const all = lists();
|
|
5482
|
+
all?.forEach((q) => q.addEventListener?.("change", fn));
|
|
5483
|
+
return () => all?.forEach((q) => q.removeEventListener?.("change", fn));
|
|
5484
|
+
};
|
|
5485
|
+
var mode = () => {
|
|
5486
|
+
const [phone, tablet] = lists() ?? [];
|
|
5487
|
+
return phone?.matches ? "phone" : tablet?.matches ? "tablet" : "wide";
|
|
5488
|
+
};
|
|
5489
|
+
var firstShown = (at, depth) => at === "wide" ? 1 : at === "tablet" ? depth === 3 ? 2 : 1 : depth;
|
|
5490
|
+
function ThreeColumnPage({ columns, depth, defaultDepth = 2, onDepthChange, depthHref, className }) {
|
|
5487
5491
|
const uid = useId16();
|
|
5488
|
-
const [own, setOwn] = useState21(
|
|
5489
|
-
const
|
|
5490
|
-
const
|
|
5492
|
+
const [own, setOwn] = useState21(defaultDepth);
|
|
5493
|
+
const count = columns[2] ? 3 : 2;
|
|
5494
|
+
const at = Math.min(depth ?? own, count);
|
|
5495
|
+
const query = useSyncExternalStore2(subscribe2, mode, () => "wide");
|
|
5491
5496
|
const root = useRef25(null);
|
|
5492
|
-
const
|
|
5497
|
+
const [area, setArea] = useState21(null);
|
|
5498
|
+
useLayoutEffect5(() => {
|
|
5499
|
+
const el = root.current?.parentElement;
|
|
5500
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
5501
|
+
const observer = new ResizeObserver(([entry]) => setArea(entry?.contentRect.width || null));
|
|
5502
|
+
observer.observe(el);
|
|
5503
|
+
return () => observer.disconnect();
|
|
5504
|
+
}, []);
|
|
5505
|
+
const shown = query === "phone" || area === null ? query : area > AREA ? "wide" : "tablet";
|
|
5506
|
+
const first = firstShown(shown, at);
|
|
5507
|
+
const held = typeof document !== "undefined" && Boolean(root.current?.contains(document.activeElement));
|
|
5493
5508
|
useEffect21(() => {
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
const
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
const
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
onViewChange?.(next);
|
|
5506
|
-
if (next === shown) {
|
|
5507
|
-
moved.current = null;
|
|
5508
|
-
root.current?.querySelector(`[data-area="${next}"] > h2`)?.focus();
|
|
5509
|
-
}
|
|
5509
|
+
const active = document.activeElement;
|
|
5510
|
+
const lost = !active || active === document.body || (active.checkVisibility ? !active.checkVisibility() : false);
|
|
5511
|
+
if (!held || !lost) return;
|
|
5512
|
+
const col = root.current?.querySelector(`[data-column="${at}"] .ui-columns__head`);
|
|
5513
|
+
const title = col?.querySelector(".ui-columns__menu") ?? col?.querySelector("h2");
|
|
5514
|
+
title?.focus({ preventScroll: true });
|
|
5515
|
+
});
|
|
5516
|
+
const up = at - 1;
|
|
5517
|
+
const go = (to) => {
|
|
5518
|
+
if (depth === void 0) setOwn(to);
|
|
5519
|
+
onDepthChange?.(to);
|
|
5510
5520
|
};
|
|
5511
|
-
const
|
|
5521
|
+
const back = () => go(up);
|
|
5522
|
+
const column = (col, n) => /* @__PURE__ */ jsxs40(
|
|
5512
5523
|
"section",
|
|
5513
5524
|
{
|
|
5514
|
-
"data-
|
|
5515
|
-
className: `ui-
|
|
5516
|
-
"aria-labelledby": `${uid}-${
|
|
5525
|
+
"data-column": n,
|
|
5526
|
+
className: `ui-columns__col ui-columns__col--${n}`,
|
|
5527
|
+
"aria-labelledby": `${uid}-${n}`,
|
|
5517
5528
|
children: [
|
|
5518
|
-
/* @__PURE__ */
|
|
5519
|
-
|
|
5529
|
+
/* @__PURE__ */ jsxs40("header", { className: "ui-columns__head", children: [
|
|
5530
|
+
/* @__PURE__ */ jsx44("h2", { id: `${uid}-${n}`, className: col.menu ? "ui-sr" : "ui-card__title", tabIndex: -1, children: col.menu ? col.title : /* @__PURE__ */ jsx44("span", { className: "ui-columns__words", children: col.title }) }),
|
|
5531
|
+
col.menu && /* @__PURE__ */ jsx44(
|
|
5532
|
+
Dropdown,
|
|
5533
|
+
{
|
|
5534
|
+
variant: "menu",
|
|
5535
|
+
align: "start",
|
|
5536
|
+
triggerContent: col.title,
|
|
5537
|
+
triggerClass: "ui-columns__menu",
|
|
5538
|
+
items: col.menu.items,
|
|
5539
|
+
sections: col.menu.sections,
|
|
5540
|
+
header: col.menu.header,
|
|
5541
|
+
onSelect: col.menu.onSelect,
|
|
5542
|
+
scroll: col.menu.scroll,
|
|
5543
|
+
row: choiceRow
|
|
5544
|
+
}
|
|
5545
|
+
),
|
|
5546
|
+
col.count !== void 0 && /* @__PURE__ */ jsxs40(Fragment20, { children: [
|
|
5547
|
+
/* @__PURE__ */ jsx44("span", { className: "ui-columns__count", "aria-hidden": col.countLabel ? true : void 0, children: col.count }),
|
|
5548
|
+
col.countLabel && /* @__PURE__ */ jsx44("span", { className: "ui-sr", children: col.countLabel })
|
|
5549
|
+
] }),
|
|
5550
|
+
col.tools && /* @__PURE__ */ jsx44("div", { className: "ui-card__tools", children: col.tools })
|
|
5551
|
+
] }),
|
|
5552
|
+
/* @__PURE__ */ jsx44("div", { className: "ui-columns__scroll", children: typeof col.children === "function" ? col.children(() => go(Math.min(n + 1, count))) : col.children })
|
|
5520
5553
|
]
|
|
5521
5554
|
},
|
|
5522
|
-
|
|
5555
|
+
n
|
|
5523
5556
|
);
|
|
5524
|
-
return /* @__PURE__ */ jsxs40("div", { ref: root, className: ["ui-columns", className].filter(Boolean).join(" "), "data-
|
|
5525
|
-
/* @__PURE__ */
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
{
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
area("steps")
|
|
5544
|
-
] })
|
|
5545
|
-
] }),
|
|
5546
|
-
area("work")
|
|
5547
|
-
] });
|
|
5557
|
+
return /* @__PURE__ */ jsx44("div", { className: "ui-columns-area", children: /* @__PURE__ */ jsxs40("div", { ref: root, className: ["ui-columns", className].filter(Boolean).join(" "), "data-depth": at, children: [
|
|
5558
|
+
first > 1 && /* @__PURE__ */ jsx44("div", { className: "ui-columns__up", children: /* @__PURE__ */ jsx44(
|
|
5559
|
+
BackLink,
|
|
5560
|
+
{
|
|
5561
|
+
href: depthHref?.(up) ?? "#",
|
|
5562
|
+
label: columns[first - 2].title,
|
|
5563
|
+
onClick: (event) => {
|
|
5564
|
+
if (!depthHref) {
|
|
5565
|
+
event.preventDefault();
|
|
5566
|
+
back();
|
|
5567
|
+
return;
|
|
5568
|
+
}
|
|
5569
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
|
|
5570
|
+
setTimeout(back);
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5573
|
+
) }),
|
|
5574
|
+
columns.map((col, i) => col && column(col, i + 1))
|
|
5575
|
+
] }) });
|
|
5548
5576
|
}
|
|
5549
5577
|
|
|
5550
5578
|
// src/Footer.tsx
|
|
@@ -5791,7 +5819,7 @@ import {
|
|
|
5791
5819
|
useContext as useContext5,
|
|
5792
5820
|
useEffect as useEffect23,
|
|
5793
5821
|
useId as useId19,
|
|
5794
|
-
useLayoutEffect as
|
|
5822
|
+
useLayoutEffect as useLayoutEffect6,
|
|
5795
5823
|
useMemo as useMemo6,
|
|
5796
5824
|
useRef as useRef27,
|
|
5797
5825
|
useState as useState23
|
|
@@ -5800,7 +5828,7 @@ import { createPortal as createPortal8 } from "react-dom";
|
|
|
5800
5828
|
import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
|
|
5801
5829
|
|
|
5802
5830
|
// src/chart-looks.tsx
|
|
5803
|
-
import { Fragment as
|
|
5831
|
+
import { Fragment as Fragment21, jsx as jsx48, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5804
5832
|
var LOOK_DEFAULT = {
|
|
5805
5833
|
line: "thin",
|
|
5806
5834
|
area: "stacked",
|
|
@@ -6125,7 +6153,7 @@ function linesDrawing(g, open) {
|
|
|
6125
6153
|
)
|
|
6126
6154
|
] }, `end-${layer.id}`);
|
|
6127
6155
|
});
|
|
6128
|
-
return /* @__PURE__ */ jsxs44(
|
|
6156
|
+
return /* @__PURE__ */ jsxs44(Fragment21, { children: [
|
|
6129
6157
|
ramps.some(Boolean) && /* @__PURE__ */ jsx48("defs", { children: ramps.map((ramp) => ramp && /* @__PURE__ */ jsxs44(
|
|
6130
6158
|
"linearGradient",
|
|
6131
6159
|
{
|
|
@@ -6184,7 +6212,7 @@ function rowsDrawing(g, pick) {
|
|
|
6184
6212
|
const { look, labels, format, formatAxis, scale } = g;
|
|
6185
6213
|
const rows = rowsOf(g);
|
|
6186
6214
|
const bottom = rows.row * labels.length;
|
|
6187
|
-
return /* @__PURE__ */ jsxs44(
|
|
6215
|
+
return /* @__PURE__ */ jsxs44(Fragment21, { children: [
|
|
6188
6216
|
pick !== null && pick >= 0 && pick < labels.length && /* @__PURE__ */ jsx48("rect", { className: "ui-chart__band", x: "0", width: px(rows.w), y: px(pick * rows.row), height: px(rows.row) }),
|
|
6189
6217
|
scale.ticks.map((tick) => /* @__PURE__ */ jsxs44("g", { children: [
|
|
6190
6218
|
/* @__PURE__ */ jsx48(
|
|
@@ -6255,7 +6283,7 @@ function ringDrawing(g) {
|
|
|
6255
6283
|
const { look, format } = g;
|
|
6256
6284
|
const ring = ringOf(g);
|
|
6257
6285
|
const total = look.totals[0];
|
|
6258
|
-
return /* @__PURE__ */ jsxs44(
|
|
6286
|
+
return /* @__PURE__ */ jsxs44(Fragment21, { children: [
|
|
6259
6287
|
look.layers.filter((s) => s.to[0] > s.from[0]).map((slice) => /* @__PURE__ */ jsx48(
|
|
6260
6288
|
"path",
|
|
6261
6289
|
{
|
|
@@ -6299,7 +6327,7 @@ function Shares({ look, format, swatch }) {
|
|
|
6299
6327
|
}
|
|
6300
6328
|
|
|
6301
6329
|
// src/Chart.tsx
|
|
6302
|
-
import { Fragment as
|
|
6330
|
+
import { Fragment as Fragment22, jsx as jsx49, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
6303
6331
|
function placeChartTip(mark, tip) {
|
|
6304
6332
|
const rect = mark.getBoundingClientRect();
|
|
6305
6333
|
const view = tip.ownerDocument.documentElement;
|
|
@@ -6646,7 +6674,7 @@ function Chart(props) {
|
|
|
6646
6674
|
const frameEl = useRef27(null);
|
|
6647
6675
|
const card = useContext5(CardTools);
|
|
6648
6676
|
const claim = card?.claim;
|
|
6649
|
-
|
|
6677
|
+
useLayoutEffect6(() => showTable && claim ? claim(uid) : void 0, [showTable, claim, uid]);
|
|
6650
6678
|
const toCard = showTable && card?.owner === uid ? card.slot : null;
|
|
6651
6679
|
const scroller = useRef27(null);
|
|
6652
6680
|
const plot = useRef27(null);
|
|
@@ -6830,11 +6858,11 @@ function Chart(props) {
|
|
|
6830
6858
|
return () => observer.disconnect();
|
|
6831
6859
|
}, []);
|
|
6832
6860
|
const opensAtEnd = Boolean(periods);
|
|
6833
|
-
|
|
6861
|
+
useLayoutEffect6(() => {
|
|
6834
6862
|
const el = scroller.current;
|
|
6835
6863
|
if (opensAtEnd && el) el.scrollLeft = el.scrollWidth - el.clientWidth;
|
|
6836
6864
|
}, [opensAtEnd, plotWidth, boxWidth, count]);
|
|
6837
|
-
|
|
6865
|
+
useLayoutEffect6(() => {
|
|
6838
6866
|
const tip = tipEl.current;
|
|
6839
6867
|
if (!tip) return;
|
|
6840
6868
|
const layered = topLayer;
|
|
@@ -7141,7 +7169,7 @@ function Chart(props) {
|
|
|
7141
7169
|
y2: px2(y(0))
|
|
7142
7170
|
}
|
|
7143
7171
|
),
|
|
7144
|
-
groupFrom >= 0 && /* @__PURE__ */ jsxs45(
|
|
7172
|
+
groupFrom >= 0 && /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
7145
7173
|
/* @__PURE__ */ jsx49(
|
|
7146
7174
|
"line",
|
|
7147
7175
|
{
|
|
@@ -7283,9 +7311,9 @@ function Chart(props) {
|
|
|
7283
7311
|
] })
|
|
7284
7312
|
}
|
|
7285
7313
|
),
|
|
7286
|
-
/* @__PURE__ */ jsx49("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs45(
|
|
7314
|
+
/* @__PURE__ */ jsx49("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
7287
7315
|
/* @__PURE__ */ jsx49("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
|
|
7288
|
-
open.rows ? /* @__PURE__ */ jsxs45(
|
|
7316
|
+
open.rows ? /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
7289
7317
|
open.rows.map((row) => /* @__PURE__ */ jsxs45("span", { className: "ui-tip__value ui-chart__row", children: [
|
|
7290
7318
|
/* @__PURE__ */ jsxs45("span", { className: cx9("ui-chart__key", `ui-chart__tone--${row.tone}`), children: [
|
|
7291
7319
|
/* @__PURE__ */ jsx49(KeyMark, { shape: row.shape }),
|
|
@@ -7317,7 +7345,7 @@ function Chart(props) {
|
|
|
7317
7345
|
/* @__PURE__ */ jsx49("tbody", { children: tableRows.map((row, i) => /* @__PURE__ */ jsxs45("tr", { "aria-current": pick === i ? true : void 0, children: [
|
|
7318
7346
|
/* @__PURE__ */ jsxs45("th", { scope: "row", children: [
|
|
7319
7347
|
row.column.label,
|
|
7320
|
-
row.column.estimated && /* @__PURE__ */ jsxs45(
|
|
7348
|
+
row.column.estimated && /* @__PURE__ */ jsxs45(Fragment22, { children: [
|
|
7321
7349
|
" ",
|
|
7322
7350
|
/* @__PURE__ */ jsx49("span", { className: "ui-chart__state", children: stateOf(row.column) })
|
|
7323
7351
|
] })
|
|
@@ -7374,9 +7402,9 @@ var AccentPicker = forwardRef12(function AccentPicker2({
|
|
|
7374
7402
|
});
|
|
7375
7403
|
|
|
7376
7404
|
// src/TopBar.tsx
|
|
7377
|
-
import { Fragment as
|
|
7405
|
+
import { Fragment as Fragment23 } from "react";
|
|
7378
7406
|
import { prism as prism3, safeUrl as safeUrl6, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
|
|
7379
|
-
import { Fragment as
|
|
7407
|
+
import { Fragment as Fragment24, jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7380
7408
|
function TopBar({
|
|
7381
7409
|
brand,
|
|
7382
7410
|
word = "Strategy",
|
|
@@ -7410,7 +7438,7 @@ function ViewSwitch({ items, active, label = "View", renderLink }) {
|
|
|
7410
7438
|
"aria-current": current ? "page" : void 0,
|
|
7411
7439
|
children: item.label
|
|
7412
7440
|
};
|
|
7413
|
-
return /* @__PURE__ */ jsx51(
|
|
7441
|
+
return /* @__PURE__ */ jsx51(Fragment23, { children: renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx51("a", { ...linkProps }) }, item.id);
|
|
7414
7442
|
}) });
|
|
7415
7443
|
}
|
|
7416
7444
|
var BADGE = { live: "Live", archive: "Archive" };
|
|
@@ -7427,7 +7455,7 @@ function VersionSwitcher({ versions, value, onChange, label = "Version", default
|
|
|
7427
7455
|
chevron: false,
|
|
7428
7456
|
defaultOpen,
|
|
7429
7457
|
ariaLabel: `${label} \u2014 ${current?.label ?? ""}`,
|
|
7430
|
-
triggerContent: /* @__PURE__ */ jsxs46(
|
|
7458
|
+
triggerContent: /* @__PURE__ */ jsxs46(Fragment24, { children: [
|
|
7431
7459
|
/* @__PURE__ */ jsx51("span", { className: "cur", children: current?.label }),
|
|
7432
7460
|
/* @__PURE__ */ jsx51("span", { className: "car", "aria-hidden": "true" })
|
|
7433
7461
|
] }),
|
package/src/styles/card.css
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
why: docs/foundations.md#elevation */
|
|
11
11
|
.ui-card {
|
|
12
12
|
--ui-card-ground: var(--surface); /* the ground a scrolling row inside covers its edge with; a tint repeats it below */
|
|
13
|
+
--ui-card-inset: var(--space-6); /* the side inset, which a table or a viewer in the card bleeds through */
|
|
13
14
|
background: var(--surface);
|
|
14
15
|
border: 1px solid var(--card-edge);
|
|
15
16
|
box-shadow: var(--elev-rest);
|
|
@@ -34,14 +35,21 @@
|
|
|
34
35
|
centred landing card, which keeps its own inset and never hangs out. #850 */
|
|
35
36
|
:root[data-theme="light"] .ui-card:not(.ui-card--pad-lg):not(.ui-card--accent):not(.ui-card--live) {
|
|
36
37
|
padding-block: 0;
|
|
37
|
-
margin-inline: calc(-1 * var(--
|
|
38
|
+
margin-inline: calc(-1 * var(--ui-card-inset));
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
+
/* The folded shell pads the page by --space-4, so the hang shrinks to it. A hang of 24px
|
|
41
|
+
put the card and its table 8px past the page from 561 to 720px. #875 */
|
|
42
|
+
@media (max-width: 720px) {
|
|
40
43
|
:root[data-theme="light"] .ui-card:not(.ui-card--pad-lg):not(.ui-card--accent):not(.ui-card--live) {
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
--ui-card-inset: var(--space-4);
|
|
45
|
+
padding-inline: var(--ui-card-inset);
|
|
43
46
|
}
|
|
44
47
|
}
|
|
48
|
+
/* A light stat tile keeps its box and its 24px inset from 561 to 720px. On a phone it pads
|
|
49
|
+
16px, as it did before #875. */
|
|
50
|
+
@media (max-width: 560px) {
|
|
51
|
+
:root[data-theme="light"] .ui-stats--tiles { --ui-tile-inset: var(--space-4); }
|
|
52
|
+
}
|
|
45
53
|
|
|
46
54
|
/* A table wider than its card scrolls INSIDE the card instead of bleeding past
|
|
47
55
|
the rounded corners / clipping its last column. Clipping to the card's
|
|
@@ -109,7 +117,7 @@
|
|
|
109
117
|
object and the row above it as the tools. Decided on #736.
|
|
110
118
|
why: docs/foundations.md#elevation */
|
|
111
119
|
.ui-card__viewer {
|
|
112
|
-
margin: var(--space-4) calc(-1 * var(--
|
|
120
|
+
margin: var(--space-4) calc(-1 * var(--ui-card-inset)) 0;
|
|
113
121
|
border-top: 1px solid var(--card-edge);
|
|
114
122
|
}
|
|
115
123
|
.ui-card__viewer > .ui-toolbar {
|
|
@@ -285,7 +293,7 @@
|
|
|
285
293
|
.ui-card__glyph svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
|
|
286
294
|
|
|
287
295
|
/* A soft line between blocks: a straight hairline across the column width on the
|
|
288
|
-
block's top edge, with one inner gap of air under it. A light card hangs
|
|
296
|
+
block's top edge, with one inner gap of air under it. A light card hangs its side inset
|
|
289
297
|
outside the column, but its own padding keeps the line on the column's width, and
|
|
290
298
|
the ::before draws straight where a border would follow the rounded corner. Dark
|
|
291
299
|
cards are boxed and already separate, so only the light rule draws.
|
package/src/styles/stat.css
CHANGED
|
@@ -132,6 +132,7 @@ dd.ui-stat__caption { contain: inline-size; }
|
|
|
132
132
|
tiles is tightly placed, so each tile keeps its soft edge and its padding.
|
|
133
133
|
The edge is the card's own --card-edge in both themes. */
|
|
134
134
|
:root[data-theme="light"] .ui-stats--tiles .ui-stat.ui-card:not(.ui-card--pad-lg):not(.ui-card--accent):not(.ui-card--live) {
|
|
135
|
+
--ui-card-inset: var(--ui-tile-inset, var(--space-6)); /* a tile keeps its box, so the folded page does not narrow it. card.css sets the phone inset */
|
|
135
136
|
border: 1px solid var(--card-edge);
|
|
136
137
|
padding-block: var(--space-5);
|
|
137
138
|
margin-inline: 0;
|
package/src/styles/table.css
CHANGED
|
@@ -600,17 +600,18 @@ a.ui-identity:hover { text-decoration: underline; }
|
|
|
600
600
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__act .ui-btn { margin-block: calc(-1 * (var(--btn-pad-y) + var(--btn-edge-width))); }
|
|
601
601
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__act .ui-btn--icon { box-sizing: border-box; width: var(--space-8); height: var(--space-8); padding: 0; justify-content: center; vertical-align: top; margin-block: calc((var(--ui-cell-line) - var(--space-8)) / 2); }
|
|
602
602
|
|
|
603
|
-
/* In a card the table, or its frame, reaches the card's edges, so a row's fill does too.
|
|
603
|
+
/* In a card the table, or its frame, reaches the card's edges, so a row's fill does too. It
|
|
604
|
+
bleeds by the card's own side inset, which is less in a light card on a narrow page. #875 */
|
|
604
605
|
.ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))) {
|
|
605
|
-
width: calc(100% + 2 * var(--
|
|
606
|
+
width: calc(100% + 2 * var(--ui-card-inset));
|
|
606
607
|
max-width: none;
|
|
607
|
-
margin-inline: calc(-1 * var(--
|
|
608
|
+
margin-inline: calc(-1 * var(--ui-card-inset));
|
|
608
609
|
}
|
|
609
610
|
.ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):first-child { margin-top: calc(-1 * var(--space-6)); }
|
|
610
611
|
.ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):last-child { margin-bottom: calc(-1 * var(--space-6)); }
|
|
611
612
|
.ui-card--pad-sm > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):first-child { margin-top: calc(-1 * var(--space-5)); }
|
|
612
613
|
.ui-card--pad-sm > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):last-child { margin-bottom: calc(-1 * var(--space-5)); }
|
|
613
|
-
.ui-card--fit > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))) { width: auto; max-width: calc(100% + 2 * var(--
|
|
614
|
+
.ui-card--fit > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))) { width: auto; max-width: calc(100% + 2 * var(--ui-card-inset)); }
|
|
614
615
|
/* #850: on the light page a table in a card sits on the column, so its rules and its end
|
|
615
616
|
cells end on the column edges. The frame keeps its side bands below.
|
|
616
617
|
why: docs/foundations.md#spacing-and-rhythm */
|
|
@@ -619,6 +620,20 @@ a.ui-identity:hover { text-decoration: underline; }
|
|
|
619
620
|
max-width: 100%;
|
|
620
621
|
margin-inline: 0;
|
|
621
622
|
}
|
|
623
|
+
/* #875: a light card with no box hangs its own inset outside the column, so a table in it
|
|
624
|
+
takes no bleed of its own and its end cells meet the page title's edge. A frame hangs out
|
|
625
|
+
by its side band only. The selector names the light card as card.css does, so it outranks
|
|
626
|
+
each bleed above. A row fill stays inside the page. */
|
|
627
|
+
:root[data-theme="light"] .ui-card:not(.ui-card--pad-lg):not(.ui-card--accent):not(.ui-card--live) > .ui-table {
|
|
628
|
+
width: 100%;
|
|
629
|
+
max-width: 100%;
|
|
630
|
+
margin-inline: 0;
|
|
631
|
+
}
|
|
632
|
+
:root[data-theme="light"] .ui-card:not(.ui-card--pad-lg):not(.ui-card--accent):not(.ui-card--live) > .ui-table-scroll {
|
|
633
|
+
width: calc(100% + 2 * var(--space-1));
|
|
634
|
+
max-width: none;
|
|
635
|
+
margin-inline: calc(-1 * var(--space-1));
|
|
636
|
+
}
|
|
622
637
|
/* #850: the row table's vertical bleed hangs it out by the card's 24px padding, but the
|
|
623
638
|
light card removed that padding. The card clips its overflow, so the last row was cut and
|
|
624
639
|
faded at the bottom. Reset the two ends to 0. why: docs/foundations.md#spacing-and-rhythm */
|