@jasonsdevspace/design-kit 0.1.0-next.4 → 0.1.0-next.5
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/CHANGELOG.md +25 -0
- package/README.md +17 -13
- package/dist/components.css +14 -2
- package/dist/react.d.ts +2 -1
- package/dist/react.js +3 -2
- package/dist/tokens.css +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,31 @@ keeping a copy. Each version from `0.1.0-next.1` on is staged on npm from a tag
|
|
|
7
7
|
workflow, with provenance, goes live when it is promoted, and has a release on GitHub with the
|
|
8
8
|
entry below as its notes.
|
|
9
9
|
|
|
10
|
+
## 0.1.0-next.5
|
|
11
|
+
|
|
12
|
+
The strip's first link is the author's name and leads to the portfolio. A demo can name its
|
|
13
|
+
switches' width, so the strip wraps the same before they arrive as after, and on a wide screen the
|
|
14
|
+
switches keep to the strip's right edge.
|
|
15
|
+
|
|
16
|
+
- **Page chrome.** The strip's first link reads "Jason Poteet" and leads to the portfolio's home
|
|
17
|
+
page, `PORTFOLIO_URL`, where it read "More work by Jason Poteet" and led to the portfolio's list
|
|
18
|
+
of work. It matches the footer's own "Jason Poteet", which leads to the same place, and no longer
|
|
19
|
+
shares "more work" with the footer's link to the GitHub profile. A page that writes the strip by
|
|
20
|
+
hand changes the link's words and where it leads itself. `PORTFOLIO_WORK_URL` is still exported,
|
|
21
|
+
for a page that links to the list of work.
|
|
22
|
+
- **Page chrome.** A new token, `--dk-strip-tools`, holds the width of a demo's switches in the
|
|
23
|
+
strip, in the strip's own text size, such as `:root { --dk-strip-tools: 20em; }`. It is `auto`, so
|
|
24
|
+
nothing changes for a demo that leaves it alone. A demo whose switches arrive after the page sets
|
|
25
|
+
it at least as wide as they are, and on a wide screen the room the strip keeps for them and the
|
|
26
|
+
section that holds them both take that width, the switches packed at its right end, so the strip
|
|
27
|
+
wraps before they arrive just as it does after. On a phone the switches keep a row of their own at
|
|
28
|
+
its full width.
|
|
29
|
+
- **Page chrome.** On a wide screen the switches keep to the strip's right edge, on the links' row
|
|
30
|
+
or on a row of their own where they wrap below it, where before a wrapped section started at the
|
|
31
|
+
left. Where the switches wrap within their section, its last row sits at the right too. On a phone
|
|
32
|
+
they still start at the left. A page that writes the strip by hand gets this from the sheet, with
|
|
33
|
+
no change to its markup.
|
|
34
|
+
|
|
10
35
|
## 0.1.0-next.4
|
|
11
36
|
|
|
12
37
|
The strip's first link says whose work it leads to, and the footer's sentence holds to the measure.
|
package/README.md
CHANGED
|
@@ -54,8 +54,8 @@ export default defineConfig({ plugins: [themeScriptPlugin()] });
|
|
|
54
54
|
`--dk-danger`, `--dk-danger-bg` and the scrim, `--dk-scrim`. Beside them are steps of space, text
|
|
55
55
|
size and corners, a code size in em that follows the text around it, line heights, weights, a sans
|
|
56
56
|
and a mono font stack, the focus ring's width and offset, a field's height and inline padding, the
|
|
57
|
-
size of a touch target, the height of the portfolio's strip
|
|
58
|
-
shadow and a short duration.
|
|
57
|
+
size of a touch target, the height of the portfolio's strip and the width of a demo's switches in
|
|
58
|
+
it, `auto` until a demo names one, the measure and column widths, a shadow and a short duration.
|
|
59
59
|
- `@jasonsdevspace/design-kit/base.css` gives the page its type and colors, one focus ring in the
|
|
60
60
|
accent for every link and control the keyboard reaches, code in running text a step under the text
|
|
61
61
|
around it, the `.dk-visually-hidden` class for a label a screen reader reads and the eye does not,
|
|
@@ -73,10 +73,10 @@ export default defineConfig({ plugins: [themeScriptPlugin()] });
|
|
|
73
73
|
draw the chrome's markup, and `Button`, `InputField`, `SelectField` and `Callout`, which draw the
|
|
74
74
|
markup of the buttons, fields and callouts, with the types `ButtonProps`, `InputFieldProps`,
|
|
75
75
|
`SelectFieldProps`, `CalloutProps` and `CalloutTone`. It also exports `PORTFOLIO_URL`,
|
|
76
|
-
`PORTFOLIO_WORK_URL` and `GITHUB_PROFILE_URL
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
markup itself never needs.
|
|
76
|
+
`PORTFOLIO_WORK_URL` and `GITHUB_PROFILE_URL`: the portfolio and the GitHub profile, which the
|
|
77
|
+
chrome links to, and the portfolio's list of work, for a page that links to it. It has no
|
|
78
|
+
component for the explainer or the pieces in it, which a page writes by hand. It takes React
|
|
79
|
+
`^19.3.0` as an optional peer, which a page that writes the markup itself never needs.
|
|
80
80
|
- `@jasonsdevspace/design-kit/vite` exports `themeScriptPlugin()`, the Vite plugin that puts the
|
|
81
81
|
script inline in place of `THEME_PLACEHOLDER`, the comment `<!-- theme-script -->`, and
|
|
82
82
|
`themeScriptHash`, the script's hash as a Content Security Policy source. It runs in Node, and
|
|
@@ -117,18 +117,18 @@ does, one pixel clipped to nothing, so it draws nothing and takes no click where
|
|
|
117
117
|
on the page. A box that is positioned holds it, and it shows at the top of that box, inset as it is
|
|
118
118
|
at the top of a page, when a keyboard reaches it.
|
|
119
119
|
|
|
120
|
-
The strip holds a navigation landmark named Portfolio, with links in this order: the author's
|
|
121
|
-
|
|
122
|
-
Poteet", which fits a demo and the kit's own site alike. The strip on the demo's explainer
|
|
123
|
-
explainer's link with `aria-current="page"`. A demo with switches of its own puts them in
|
|
124
|
-
after the links, named for them, and a demo with none leaves the section out.
|
|
120
|
+
The strip holds a navigation landmark named Portfolio, with links in this order: the author's name,
|
|
121
|
+
which leads to the portfolio as the footer's does, how it works and the source. The name reads
|
|
122
|
+
"Jason Poteet", which fits a demo and the kit's own site alike. The strip on the demo's explainer
|
|
123
|
+
marks the explainer's link with `aria-current="page"`. A demo with switches of its own puts them in
|
|
124
|
+
a section after the links, named for them, and a demo with none leaves the section out.
|
|
125
125
|
|
|
126
126
|
<!-- example: strip -->
|
|
127
127
|
|
|
128
128
|
```html
|
|
129
129
|
<div class="dk-strip">
|
|
130
130
|
<nav class="dk-strip-links" aria-label="Portfolio">
|
|
131
|
-
<a href="https://jasonsdevspace.com
|
|
131
|
+
<a href="https://jasonsdevspace.com/">Jason Poteet</a>
|
|
132
132
|
<a href="./about/">How it works</a>
|
|
133
133
|
<a href="https://github.com/jasonsdevspace/example">Source on GitHub</a>
|
|
134
134
|
</nav>
|
|
@@ -151,7 +151,11 @@ switches come they take the room's place in the same section, and the section ta
|
|
|
151
151
|
|
|
152
152
|
The room holds the height of one row of the kit's buttons or fields, beside the links on a wide
|
|
153
153
|
screen and on a row of their own on a phone. Switches of another height, or more than fit on one
|
|
154
|
-
row, still move what is below them when they come.
|
|
154
|
+
row, still move what is below them when they come. On a wide screen the room has no width of its
|
|
155
|
+
own, so a demo whose switches would make the strip wrap where the room did not names their width in
|
|
156
|
+
`--dk-strip-tools`, in the strip's own text size, such as `:root { --dk-strip-tools: 20em; }`. The
|
|
157
|
+
room and the switches then take that width, and the strip wraps before they come as it does after.
|
|
158
|
+
On a phone the switches have a row of their own and the width is left aside.
|
|
155
159
|
|
|
156
160
|
On a wide screen the strip is one 2.5rem row over a 1px rule, in the small text, with its links
|
|
157
161
|
1.5rem apart and the switches on the right. At 48rem wide or less the text steps down to the
|
package/dist/components.css
CHANGED
|
@@ -81,14 +81,22 @@
|
|
|
81
81
|
|
|
82
82
|
/*
|
|
83
83
|
* The switches wrap where larger text leaves no room, and stand at least as tall as the links'
|
|
84
|
-
* row
|
|
84
|
+
* row, against the strip's right edge, on the links' row or on one of their own where they
|
|
85
|
+
* wrap below it. A demo whose switches arrive after the page names their width, at least as
|
|
86
|
+
* wide as they are, in `--dk-strip-tools`, in the strip's own text size, so the room kept for
|
|
87
|
+
* them and the switches that fill it are one width, and a strip too narrow for the links and
|
|
88
|
+
* the switches wraps before they come as it does after. Without it, the section is as wide as
|
|
89
|
+
* what it holds.
|
|
85
90
|
*/
|
|
86
91
|
.dk-strip-tools {
|
|
87
92
|
display: flex;
|
|
88
93
|
flex-wrap: wrap;
|
|
89
94
|
align-items: center;
|
|
95
|
+
justify-content: flex-end;
|
|
90
96
|
gap: var(--dk-space-3);
|
|
97
|
+
inline-size: var(--dk-strip-tools);
|
|
91
98
|
min-height: var(--dk-strip);
|
|
99
|
+
margin-inline-start: auto;
|
|
92
100
|
}
|
|
93
101
|
|
|
94
102
|
/* The exit after a long scroll, its rule the width of the page and its text in the column. */
|
|
@@ -137,7 +145,8 @@
|
|
|
137
145
|
|
|
138
146
|
/*
|
|
139
147
|
* On a phone the links are smaller and closer, and wrap to rows of their own where they must,
|
|
140
|
-
* with the switches on a row below them
|
|
148
|
+
* with the switches on a row below them, at its start and its full width whatever width a demo
|
|
149
|
+
* names.
|
|
141
150
|
*/
|
|
142
151
|
@media (max-width: 48rem) {
|
|
143
152
|
.dk-strip {
|
|
@@ -150,6 +159,9 @@
|
|
|
150
159
|
|
|
151
160
|
.dk-strip-tools {
|
|
152
161
|
flex-basis: 100%;
|
|
162
|
+
justify-content: flex-start;
|
|
163
|
+
inline-size: auto;
|
|
164
|
+
margin-inline-start: 0;
|
|
153
165
|
padding-block: 0 var(--dk-space-2);
|
|
154
166
|
}
|
|
155
167
|
|
package/dist/react.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare const SkipLink: ({ target, children, }: {
|
|
|
17
17
|
/** A page of the demo's that the chrome links to, and can mark as the one it sits on. */
|
|
18
18
|
type ChromePage = 'about';
|
|
19
19
|
/**
|
|
20
|
-
* Whose demo this is, above the page, with three links together on the left
|
|
20
|
+
* Whose demo this is, above the page, with three links together on the left: the author's name,
|
|
21
|
+
* which leads to the portfolio as the footer's does, how it works and the source. It is a navigation
|
|
21
22
|
* landmark in a plain div rather than a header, so the demo's own header stays the page's one
|
|
22
23
|
* banner. A demo with switches of its own puts them beside the links, in a landmark of their own
|
|
23
24
|
* named for them, and while they are on their way the strip keeps their room in that section,
|
package/dist/react.js
CHANGED
|
@@ -31,13 +31,14 @@ export const SkipLink = ({ target = 'main-content', children = 'Skip to content'
|
|
|
31
31
|
/** The mark a link to `page` takes when it is the page the chrome sits on, and none otherwise. */
|
|
32
32
|
const currentAs = (current, page) => current === page ? 'page' : undefined;
|
|
33
33
|
/**
|
|
34
|
-
* Whose demo this is, above the page, with three links together on the left
|
|
34
|
+
* Whose demo this is, above the page, with three links together on the left: the author's name,
|
|
35
|
+
* which leads to the portfolio as the footer's does, how it works and the source. It is a navigation
|
|
35
36
|
* landmark in a plain div rather than a header, so the demo's own header stays the page's one
|
|
36
37
|
* banner. A demo with switches of its own puts them beside the links, in a landmark of their own
|
|
37
38
|
* named for them, and while they are on their way the strip keeps their room in that section,
|
|
38
39
|
* unnamed and so no landmark.
|
|
39
40
|
*/
|
|
40
|
-
export const PortfolioStrip = ({ about, source, current, tools, toolsLabel = 'Demo', toolsWaiting = false, }) => (_jsxs("div", { className: "dk-strip", children: [_jsxs("nav", { className: "dk-strip-links", "aria-label": "Portfolio", children: [_jsx("a", { href:
|
|
41
|
+
export const PortfolioStrip = ({ about, source, current, tools, toolsLabel = 'Demo', toolsWaiting = false, }) => (_jsxs("div", { className: "dk-strip", children: [_jsxs("nav", { className: "dk-strip-links", "aria-label": "Portfolio", children: [_jsx("a", { href: PORTFOLIO_URL, children: "Jason Poteet" }), _jsx("a", { href: about, "aria-current": currentAs(current, 'about'), children: "How it works" }), _jsx("a", { href: source, children: "Source on GitHub" })] }), filled(tools) ? (_jsx("section", { className: "dk-strip-tools", "aria-label": toolsLabel, children: tools })) : toolsWaiting ? (_jsx("section", { className: "dk-strip-tools", children: _jsx("span", { className: "dk-strip-room" }) })) : null] }));
|
|
41
42
|
/**
|
|
42
43
|
* The exit after a long scroll: whose project this is, how it works, where the source and the rest
|
|
43
44
|
* of the work are, and the license, with anything the demo adds of its own after them.
|
package/dist/tokens.css
CHANGED
|
@@ -100,6 +100,11 @@
|
|
|
100
100
|
--dk-target: 2.75rem;
|
|
101
101
|
/* The height of the portfolio strip's row, and of each link in it. */
|
|
102
102
|
--dk-strip: 2.5rem;
|
|
103
|
+
/*
|
|
104
|
+
* The width of a demo's switches in the strip, in the strip's own text size, which a demo
|
|
105
|
+
* whose switches arrive after the page names, so the room kept for them holds it too.
|
|
106
|
+
*/
|
|
107
|
+
--dk-strip-tools: auto;
|
|
103
108
|
|
|
104
109
|
/*
|
|
105
110
|
* The width a page of reading holds to, no more than 80 characters a line in the body size,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jasonsdevspace/design-kit",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.5",
|
|
4
4
|
"description": "Design tokens, base styles, a theme script, page chrome, buttons, fields, callouts and an explainer layout for the demos on jasonsdevspace.com.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design-tokens",
|