@whatsaaaa/design-system 0.8.0 → 0.8.2

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 CHANGED
@@ -65,7 +65,7 @@ CI runs on every pull request:
65
65
  - the unit tests, with the contrast of every role pair in both themes, the comments of the stylesheets in the built ones, and Nuxt UI's colors read from tokens outside any layer,
66
66
  - that `assets/` is what the sources produce,
67
67
  - that the package and the style guide build,
68
- - the browser tests: no page overflows sideways at phone, tablet and desktop width in either theme, and no terminal window or bar of one cuts off its content, no page logs an error when it loads, the easter egg works with the mouse, the keyboard and reduced motion, the keys of the status line work and their switch turns them off, the numbers of the tabs show only while their keys work and keep their place while the keys load, the path of the status line gives way at every width from 320 px, its items take less padding on a phone and the theme button switches the theme, the content of a window starts at the gutter where the brand of the tab bar does on a phone, in the docs theme too, a `dark` or `light` class chooses the theme as `data-theme` does, an element for one theme shows only in it, the browser's theme-color follows the theme and the page as it is sent has it for both themes, without JavaScript, a control that takes the focus is not left under the status line and no bar or corner of the window cuts off its focus ring, a button of the docs theme takes its ring and not the browser's, a code group's language stands in the row of its tabs and off its code, a radius of the page's own wins over the focus ring's and a button without one takes its small corners, with index.css and with tailwind.css, a state lines up with the text beside it, a prompt that wraps keeps its chevron on its first line at every width from 320 px, assistive technology reads the parts of the path above a page title as words of their own, the first tab starts on the border of the sidebar, the pieces of a form fit every width from 320 px (a segmented control works with the keyboard, stands out at 3:1 and takes the selection colors in forced colors, amounts line up at the right in figures of one width, the sections of a review share a term column, two fields share a row from 40rem, a number field has no spin buttons and its arrow keys step it, wrapped code hangs and stays inside its block, a long email breaks after its @, and the icons draw at the icon size and the ghost files draw), both fonts draw Serbian Latin, an app built on the Tailwind entry takes its utilities, layers and `dark:` and `light:` from the tokens and their theme, Nuxt UI's colors take the roles of the theme chosen around them, and the pages of the style guide look like their stored screenshots.
68
+ - the browser tests: no page overflows sideways at phone, tablet and desktop width in either theme, and no terminal window or bar of one cuts off its content, no page logs an error when it loads, the easter egg works with the mouse, the keyboard and reduced motion, the keys of the status line work and their switch turns them off, the numbers of the tabs show only while their keys work and keep their place while the keys load, the path of the status line gives way at every width from 320 px without leaving a stub, and in the docs theme from 180 px with the keys on and 187 px with them off, its items take less padding on a phone and the theme button switches the theme, the content of a window starts at the gutter where the brand of the tab bar does on a phone, in the docs theme too, where a project's mark as the logo starts on it as well and over the sidebar's headings from 60rem up, a `dark` or `light` class chooses the theme as `data-theme` does, an element for one theme shows only in it, the browser's theme-color follows the theme and the page as it is sent has it for both themes, without JavaScript, a control that takes the focus is not left under the status line and no bar or corner of the window cuts off its focus ring, a button of the docs theme takes its ring and not the browser's and the ring of its brand paints over neither the mark nor the name, a code group's language stands in the row of its tabs and off its code, a radius of the page's own wins over the focus ring's and a button without one takes its small corners, with index.css and with tailwind.css, a state lines up with the text beside it, a prompt that wraps keeps its chevron on its first line at every width from 320 px, assistive technology reads the parts of the path above a page title as words of their own, the first tab starts on the border of the sidebar, the pieces of a form fit every width from 320 px (a segmented control works with the keyboard, stands out at 3:1 and takes the selection colors in forced colors, amounts line up at the right in figures of one width, the sections of a review share a term column, two fields share a row from 40rem, a number field has no spin buttons and its arrow keys step it, wrapped code hangs and stays inside its block, a long email breaks after its @, and the icons draw at the icon size and the ghost files draw), both fonts draw Serbian Latin, an app built on the Tailwind entry takes its utilities, layers and `dark:` and `light:` from the tokens and their theme, Nuxt UI's colors take the roles of the theme chosen around them, and the pages of the style guide look like their stored screenshots.
69
69
 
70
70
  The screenshots are in `tests/browser/__screenshots__/` and are taken on Linux, in the Playwright container, so they are the same on every machine. After a change that is meant to be seen, update them:
71
71
 
@@ -405,9 +405,9 @@
405
405
 
406
406
  /*
407
407
  * The room the other items leave, which the path takes: the items after it go to the right
408
- * edge, as after a spacer. The path gives way to them inside it. It shrinks to its first
409
- * character and the ellipsis, then goes as a whole, padding and all, so a part of a
410
- * character never shows.
408
+ * edge, as after a spacer. The path gives way to them inside it. It is cut with an ellipsis
409
+ * down to five characters, then goes as a whole, padding and all: a letter or two before
410
+ * the ellipsis reads as a glitch, not a path.
411
411
  */
412
412
  .ws-status-line__path {
413
413
  flex: 1;
@@ -429,12 +429,13 @@
429
429
  }
430
430
 
431
431
  /*
432
- * No room for "~…" between the padding of the path, --ws-space-14 on each side, and
433
- * --ws-space-10 below 64rem. The padding is written out, as a container query takes no var().
434
- * The browser test of the path, tests/browser/status-line.spec.ts, holds them together.
432
+ * No room for five characters and the ellipsis, 6ch of the caption's mono face, between the
433
+ * padding of the path, --ws-space-14 on each side, and --ws-space-10 below 64rem. The padding
434
+ * is written out, as a container query takes no var(). The browser test of the path,
435
+ * tests/browser/status-line.spec.ts, holds them together.
435
436
  */
436
437
  @media (width >= 64rem) {
437
- @container ws-status-line-path (width < calc(2ch + 1.75rem)) {
438
+ @container ws-status-line-path (width < calc(6ch + 1.75rem)) {
438
439
  .ws-status-line__file {
439
440
  display: none;
440
441
  }
@@ -442,7 +443,7 @@
442
443
  }
443
444
 
444
445
  @media (width < 64rem) {
445
- @container ws-status-line-path (width < calc(2ch + 1.25rem)) {
446
+ @container ws-status-line-path (width < calc(6ch + 1.25rem)) {
446
447
  .ws-status-line__file {
447
448
  display: none;
448
449
  }
package/dist/index.css CHANGED
@@ -1630,9 +1630,9 @@ input[type="number"]::-webkit-outer-spin-button {
1630
1630
 
1631
1631
  /*
1632
1632
  * The room the other items leave, which the path takes: the items after it go to the right
1633
- * edge, as after a spacer. The path gives way to them inside it. It shrinks to its first
1634
- * character and the ellipsis, then goes as a whole, padding and all, so a part of a
1635
- * character never shows.
1633
+ * edge, as after a spacer. The path gives way to them inside it. It is cut with an ellipsis
1634
+ * down to five characters, then goes as a whole, padding and all: a letter or two before
1635
+ * the ellipsis reads as a glitch, not a path.
1636
1636
  */
1637
1637
  .ws-status-line__path {
1638
1638
  flex: 1;
@@ -1654,12 +1654,13 @@ input[type="number"]::-webkit-outer-spin-button {
1654
1654
  }
1655
1655
 
1656
1656
  /*
1657
- * No room for "~…" between the padding of the path, --ws-space-14 on each side, and
1658
- * --ws-space-10 below 64rem. The padding is written out, as a container query takes no var().
1659
- * The browser test of the path, tests/browser/status-line.spec.ts, holds them together.
1657
+ * No room for five characters and the ellipsis, 6ch of the caption's mono face, between the
1658
+ * padding of the path, --ws-space-14 on each side, and --ws-space-10 below 64rem. The padding
1659
+ * is written out, as a container query takes no var(). The browser test of the path,
1660
+ * tests/browser/status-line.spec.ts, holds them together.
1660
1661
  */
1661
1662
  @media (width >= 64rem) {
1662
- @container ws-status-line-path (width < calc(2ch + 1.75rem)) {
1663
+ @container ws-status-line-path (width < calc(6ch + 1.75rem)) {
1663
1664
  .ws-status-line__file {
1664
1665
  display: none;
1665
1666
  }
@@ -1667,7 +1668,7 @@ input[type="number"]::-webkit-outer-spin-button {
1667
1668
  }
1668
1669
 
1669
1670
  @media (width < 64rem) {
1670
- @container ws-status-line-path (width < calc(2ch + 1.25rem)) {
1671
+ @container ws-status-line-path (width < calc(6ch + 1.25rem)) {
1671
1672
  .ws-status-line__file {
1672
1673
  display: none;
1673
1674
  }
package/docs/usage.md CHANGED
@@ -271,7 +271,7 @@ The markup of each piece is in the comment above its rules, in its stylesheet in
271
271
  ```
272
272
 
273
273
  - **The mode** says whether the key hints work. It reads `NORMAL`, and `INSERT` while the focus is in a field, where a key is typed and not a shortcut. Use those two words and no others. `isTyping` from `@whatsaaaa/design-system/shortcuts` tells which: check `isTyping(document.activeElement)` on `focusin` and `focusout`. A page without fields stays `NORMAL`.
274
- - **The path** goes in `ws-status-line__path`, which takes the room the other items leave and puts the items after it at the right edge. The path gives way to them on its own: it is cut with an ellipsis, and when not even its first character fits, it goes as a whole. Write no breakpoint or width for it. The status line pads its items `--ws-space-14` on each side, and `--ws-space-10` below 64rem, so on a phone the path has more room. A status line without a path puts `<span class="ws-status-line__spacer"></span>` where the path would be.
274
+ - **The path** goes in `ws-status-line__path`, which takes the room the other items leave and puts the items after it at the right edge. The path gives way to them on its own: it is cut with an ellipsis, down to five characters, and with less room than that it goes as a whole. Write no breakpoint or width for it. The status line pads its items `--ws-space-14` on each side, and `--ws-space-10` below 64rem, so on a phone the path has more room. A status line without a path puts `<span class="ws-status-line__spacer"></span>` where the path would be.
275
275
  - **The theme button** names the theme shown and switches it, at every width: below 64rem, where the key hints are hidden, it is the only theme switch. Call `toggleTheme` when it is clicked. It holds both names, and the styles show the one of the theme, so the name is right before any script runs and the button keeps the focus when the theme changes. Its name for assistive technology is "Switch theme, now rose-pine". Where the key hints show, keep the theme's `t` hint as well.
276
276
  - An item for wide screens only takes `ws-status-line__item--wide`, and one with a border on its left `ws-status-line__item--edge`.
277
277
  - A focus ring in the window's bars is drawn inside its control, so neither the bars nor the window's corners cut it off. A control of your own in a bar does the same: `outline-offset: calc(-1 * var(--ws-border-width-medium))`.
@@ -456,7 +456,7 @@ export default defineConfigWithTheme<ThemeConfig>({
456
456
 
457
457
  Keep the site's nav, sidebar and search config as they are. Do not restyle the theme with `--vp-*` variables: change a token here instead.
458
458
 
459
- From 60rem up the brand has a box as wide as the sidebar, 17rem with the sidebar's padding, and the first tab starts on the sidebar's border, on pages without a sidebar too. With a logo there is room for about 23 characters in the site title, without one about 28. A longer title is cut with an ellipsis: shorten it with `themeConfig.siteTitle`. A short one leaves a gap before the tabs. The labels of the tabs have no such limit: a long one moves the tabs after it. Below 60rem there is no sidebar and the tabs follow the brand, and on a phone they take a row of their own under it. On a phone, below 48rem, the page, the row of its menu and the home page's hero, features and content take the gutter of a phone, as the brand does.
459
+ From 60rem up the brand has a box as wide as the sidebar, 17rem with the sidebar's padding, and the first tab starts on the sidebar's border, on pages without a sidebar too. With a logo there is room for about 24 characters in the site title, without one about 28. A longer title is cut with an ellipsis: shorten it with `themeConfig.siteTitle`. A short one leaves a gap before the tabs. The labels of the tabs have no such limit: a long one moves the tabs after it. Below 60rem there is no sidebar and the tabs follow the brand, and on a phone they take a row of their own under it. On a phone, below 48rem, the page, the row of its menu and the home page's hero, features and content take the gutter of a phone, as the brand does. The theme pulls a project's mark as the logo out by its empty columns, as in section 9, so its pixels start on that gutter too, and over the sidebar's headings from 60rem up.
460
460
 
461
461
  ## 11. Data
462
462
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatsaaaa/design-system",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "Whatsaaaa's design system: brand identity, design tokens, typography, docs theme and asset kit",
5
5
  "homepage": "https://github.com/whatsaaaa/design-system#readme",
6
6
  "bugs": "https://github.com/whatsaaaa/design-system/issues",
@@ -65,11 +65,16 @@ onUnmounted(() => {
65
65
  <template>
66
66
  <footer class="ws-status-line WsStatusLine" aria-label="Status">
67
67
  <span class="ws-status-line__mode">{{ mode }}</span>
68
- <span v-if="file" class="ws-status-line__file"><span>{{ file }}</span></span>
69
- <span v-if="theme.whatsaaaa?.branch" class="ws-status-line__item ws-status-line__item--wide">
70
- {{ theme.whatsaaaa.branch }}
68
+ <!--
69
+ The path takes the room the other items leave, and gives way to them on its own. The
70
+ branch goes in it too, so it stays next to the file.
71
+ -->
72
+ <span class="ws-status-line__path">
73
+ <span v-if="file" class="ws-status-line__file"><span>{{ file }}</span></span>
74
+ <span v-if="theme.whatsaaaa?.branch" class="ws-status-line__item ws-status-line__item--wide">
75
+ {{ theme.whatsaaaa.branch }}
76
+ </span>
71
77
  </span>
72
- <span class="ws-status-line__spacer" />
73
78
  <!-- Each hint is the control it names: the key clicks the button. -->
74
79
  <span class="ws-status-line__keys">
75
80
  <button
@@ -40,9 +40,15 @@
40
40
  background: none;
41
41
  }
42
42
 
43
- /* brand */
43
+ /*
44
+ * brand, with room for the focus ring of the link around the mark and the name, taken from
45
+ * the gutter at its left, as in the tab bar of the terminal frame
46
+ */
44
47
  .VPNav .VPNavBarTitle .title {
45
48
  gap: var(--ws-space-10);
49
+ width: fit-content;
50
+ margin-left: calc(-1 * var(--ws-space-10));
51
+ padding-inline: var(--ws-space-10);
46
52
  border-bottom: 0;
47
53
  color: var(--ws-color-text);
48
54
  font: var(--ws-text-label);
@@ -50,11 +56,16 @@
50
56
  letter-spacing: -0.02em;
51
57
  }
52
58
 
53
- /* a mark in a 64 box at 32 px draws each sprite pixel as 2 px */
59
+ /*
60
+ * A mark in a 64 box at 32 px draws each sprite pixel as 2 px. A project's mark keeps two
61
+ * empty sprite columns on each side, 4 px here: pulled out by them, its pixels start where
62
+ * the brand's text would, on the edge of the page on a phone and of the sidebar's text above.
63
+ */
54
64
  .VPNav .VPNavBarTitle .logo {
55
65
  width: auto;
66
+ max-width: none;
56
67
  height: 2rem;
57
- margin-right: 0;
68
+ margin-inline: calc(-1 * var(--ws-space-4));
58
69
  image-rendering: pixelated;
59
70
  }
60
71
 
@@ -367,12 +378,14 @@
367
378
  padding: 0 var(--ws-space-20) 0 0;
368
379
  }
369
380
 
370
- /* the link is as wide as the brand, and a brand too long for the box is cut with an ellipsis */
381
+ /*
382
+ * A brand too long for the box is cut with an ellipsis. The room for the ring at the right
383
+ * of the link is taken from the padding of the box, so the brand keeps the whole box.
384
+ */
371
385
  .VPNav .VPNavBar .VPNavBarTitle .title {
372
- width: fit-content;
373
- max-width: 100%;
386
+ max-width: calc(100% + 2 * var(--ws-space-10));
374
387
  height: var(--vp-nav-height);
375
- padding: 0;
388
+ margin-right: calc(-1 * var(--ws-space-10));
376
389
  }
377
390
 
378
391
  .VPNav .VPNavBar .VPNavBarTitle .title > span {