@apliteni/apliteni-ui 0.24.0 → 0.25.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/README.md +21 -1
- package/package.json +1 -1
- package/src/index.css +6 -1
- package/src/styles/base.css +22 -0
- package/src/styles/confirm.css +4 -1
- package/src/styles/drawer.css +4 -0
- package/src/styles/dropdown.css +8 -0
- package/src/styles/layout.css +3 -0
- package/src/styles/topbar.css +4 -0
- package/src/tokens/tokens.css +11 -2
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ npm install @apliteni/apliteni-ui
|
|
|
48
48
|
## Use it
|
|
49
49
|
|
|
50
50
|
```js
|
|
51
|
-
import '@apliteni/apliteni-ui/css'; // once, at app root (
|
|
51
|
+
import '@apliteni/apliteni-ui/css'; // once, at app root (load the two fonts too — see below)
|
|
52
52
|
import { button, card, topbar, wireTopbar } from '@apliteni/apliteni-ui';
|
|
53
53
|
|
|
54
54
|
el.innerHTML = topbar({ word: 'Strategy', account: { name, email } })
|
|
@@ -56,6 +56,26 @@ el.innerHTML = topbar({ word: 'Strategy', account: { name, email } })
|
|
|
56
56
|
wireTopbar(document); // theme toggle, menus, segmented, copy buttons
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
+
### The two fonts
|
|
60
|
+
|
|
61
|
+
The kit names two families and bundles neither, so the host page loads them. Poppins is
|
|
62
|
+
`--font-display` — headings, brand marks, large readouts. IBM Plex Sans is `--font-sans` —
|
|
63
|
+
tables, fields, paragraphs, chat, which is most of an application. Weights 300-700 in both:
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
67
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap">
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Load only one of them and the other falls through to the system stack behind it, without
|
|
71
|
+
saying so. Want the old
|
|
72
|
+
single-family look back? Set both roles to the same family in your own stylesheet, after the
|
|
73
|
+
kit's:
|
|
74
|
+
|
|
75
|
+
```css
|
|
76
|
+
:root { --font-sans: var(--font-display); }
|
|
77
|
+
```
|
|
78
|
+
|
|
59
79
|
### Reuse the account page
|
|
60
80
|
|
|
61
81
|
The whole `/account` layout (topbar + sticky sidebar + page body) ships as one
|
package/package.json
CHANGED
package/src/index.css
CHANGED
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
* addressable — package.json `exports` has no wildcard for ./styles/*, so a deep
|
|
5
5
|
* path into src/styles/ does not resolve. To take one component, read it by name
|
|
6
6
|
* through `apliteni-ui/inline` (`import { topbarCss } from …`).
|
|
7
|
-
* Requires
|
|
7
|
+
* Requires two families, loaded by the host page or the Storybook preview:
|
|
8
|
+
* Poppins (--font-display, headings and brand marks) and IBM Plex Sans
|
|
9
|
+
* (--font-sans, everything else). Weights 300-700 in both. Neither is
|
|
10
|
+
* bundled; a family that never loads falls back to the system stack behind
|
|
11
|
+
* it, in silence.
|
|
12
|
+
* why: docs/specification.md#typefaces
|
|
8
13
|
* ========================================================================== */
|
|
9
14
|
@import "./tokens/brand.generated.css";
|
|
10
15
|
@import "./tokens/tokens.css";
|
package/src/styles/base.css
CHANGED
|
@@ -35,6 +35,28 @@ a {
|
|
|
35
35
|
text-decoration: none;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
/* -- The two typeface roles -----------------------------------------------
|
|
39
|
+
* A heading is the display face, running text is the text face, and the
|
|
40
|
+
* ELEMENT decides which — never the size. A size threshold would change a
|
|
41
|
+
* heading's typeface halfway through a resize, which is the one thing a
|
|
42
|
+
* reader notices. A component that wants a heading tag set in the text face
|
|
43
|
+
* says so on its own rule, which outranks this one at (0,1,0); .ui-drawer__title
|
|
44
|
+
* and .ui-confirm__title are the two that do.
|
|
45
|
+
* why: docs/specification.md#typefaces */
|
|
46
|
+
h1, h2, h3, h4, h5, h6 {
|
|
47
|
+
font-family: var(--font-display);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* The browser default for b/strong is 700, and at the 13px the kit's tables and
|
|
51
|
+
* chat feeds run at, 700 stops reading as emphasis and starts reading as a
|
|
52
|
+
* filled-in shape. The semibold step is the emphasis; the bold step stays
|
|
53
|
+
* available to anything that asks for it by name.
|
|
54
|
+
* why: docs/specification.md#typefaces */
|
|
55
|
+
b,
|
|
56
|
+
strong {
|
|
57
|
+
font-weight: var(--weight-semibold);
|
|
58
|
+
}
|
|
59
|
+
|
|
38
60
|
/* Ambient blurred glow — the deck's signature background depth.
|
|
39
61
|
Place <span class="ui-glow ui-glow--purple"> absolutely inside a positioned
|
|
40
62
|
parent. Two colour variants ship; scale/position with inline styles. */
|
package/src/styles/confirm.css
CHANGED
|
@@ -85,7 +85,10 @@
|
|
|
85
85
|
/* -- Slots ----------------------------------------------------------------- */
|
|
86
86
|
/* The question and the answers keep their size; the consequence between them is
|
|
87
87
|
the one that gives, and scrolls — the same split the drawer's header / body /
|
|
88
|
-
footer makes.
|
|
88
|
+
footer makes. The title is an h2 and opts out of the display face base.css
|
|
89
|
+
gives a heading, for the same reason .ui-drawer__title does: at --text-md it
|
|
90
|
+
is the question on a dialog, set at the size the answer beneath it is set at.
|
|
91
|
+
why: docs/specification.md#typefaces */
|
|
89
92
|
.ui-confirm__title {
|
|
90
93
|
margin: 0;
|
|
91
94
|
flex: none;
|
package/src/styles/drawer.css
CHANGED
|
@@ -119,6 +119,10 @@
|
|
|
119
119
|
border-bottom: 1px solid var(--border);
|
|
120
120
|
flex: none;
|
|
121
121
|
}
|
|
122
|
+
/* An h2, and base.css would give it the display face. It opts out: at 15px in a
|
|
123
|
+
panel header it is a label on a piece of UI rather than a heading anybody
|
|
124
|
+
reads, and the display face at that size is exactly what #253 was about.
|
|
125
|
+
why: docs/specification.md#typefaces */
|
|
122
126
|
.ui-drawer__title {
|
|
123
127
|
margin: 0;
|
|
124
128
|
font-family: var(--font-sans);
|
package/src/styles/dropdown.css
CHANGED
|
@@ -45,6 +45,14 @@
|
|
|
45
45
|
the portal's JS, so an upward panel cannot drift from a downward one.
|
|
46
46
|
why: docs/specification.md#the-dropdown-panel */
|
|
47
47
|
--ui-dropdown-gap: 9px;
|
|
48
|
+
/* The panel states its own role rather than inheriting one, because `portal:
|
|
49
|
+
true` moves it onto <body> and an inherited face is then decided by where
|
|
50
|
+
the panel was MOUNTED rather than by what it is. Measured: the same dropdown
|
|
51
|
+
inside a display-face subtree resolved to var(--font-display) in place and
|
|
52
|
+
var(--font-sans) once portalled — a positioning flag changing the typeface.
|
|
53
|
+
A list of item rows is text, so it is the text face in both placements.
|
|
54
|
+
why: docs/specification.md#typefaces */
|
|
55
|
+
font-family: var(--font-sans);
|
|
48
56
|
position: absolute;
|
|
49
57
|
top: calc(100% + var(--ui-dropdown-gap));
|
|
50
58
|
left: 0;
|
package/src/styles/layout.css
CHANGED
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
gap: var(--space-2);
|
|
56
56
|
padding: 2px 6px;
|
|
57
57
|
text-decoration: none;
|
|
58
|
+
/* display: brand — the rail's lockup is the same mark topbar.css sets, and the
|
|
59
|
+
two have to be the same face or the shell reads as two products. */
|
|
60
|
+
font-family: var(--font-display);
|
|
58
61
|
font-weight: var(--weight-semibold);
|
|
59
62
|
letter-spacing: var(--tracking-tight);
|
|
60
63
|
}
|
package/src/styles/topbar.css
CHANGED
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
display: inline-flex;
|
|
31
31
|
align-items: center;
|
|
32
32
|
gap: 9px;
|
|
33
|
+
/* display: brand — a wordmark is the mark, not text. It is two words beside a
|
|
34
|
+
glyph and it is what the product is recognised by, so it keeps the display
|
|
35
|
+
face at every size it is set at, including the 13px below. */
|
|
36
|
+
font-family: var(--font-display);
|
|
33
37
|
font-weight: 600;
|
|
34
38
|
color: var(--strong);
|
|
35
39
|
text-decoration: none;
|
package/src/tokens/tokens.css
CHANGED
|
@@ -42,8 +42,17 @@
|
|
|
42
42
|
--container: 1120px;
|
|
43
43
|
--measure: 860px;
|
|
44
44
|
|
|
45
|
-
/* -- Typography ---------------------------------------------------------
|
|
46
|
-
|
|
45
|
+
/* -- Typography ---------------------------------------------------------
|
|
46
|
+
* Two roles, not one family. --font-display is the brand voice — headings,
|
|
47
|
+
* brand lockups, large readouts — and --font-sans is what an application is
|
|
48
|
+
* actually made of: tables, fields, paragraphs, chat. Poppins is a geometric
|
|
49
|
+
* display grotesque and holds its character at heading sizes; at 13-14px it
|
|
50
|
+
* smears, worst of all in Cyrillic, which is where the kit spends most of its
|
|
51
|
+
* pixels. IBM Plex Sans is humanist and narrower, and its Cyrillic was drawn
|
|
52
|
+
* by the same team as its Latin.
|
|
53
|
+
* why: docs/specification.md#typefaces */
|
|
54
|
+
--font-display: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
55
|
+
--font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
47
56
|
--font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
48
57
|
|
|
49
58
|
--text-xs: 11px;
|