@chassis-ui/docs 0.6.3 → 0.7.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @chassis-ui/docs
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **Breaking.** The package needs `@chassis-ui/css` 0.6.0 or later: the peer range is `>=0.6.0`, it was `^0.5.0-0`. The layouts use the CSS grid of css 0.6, `.grid` with `col-span-*`, in place of the flexbox grid, `.row` with `.col-*`, which css 0.6 deprecates and css 0.7 removes. The header of `SingleLayout`, the sections list of `DocsLayout`, the footer and the lists of the header are grids. `NavLink` no longer sets a width: the lists of the header are two columns below `lg` by themselves. The loading rows of the search use the fraction widths, `w-4/12`. `.cxd-gutter` sets `--cx-container-padding` in place of `--cx-gutter-x`, with the same page margin of 1rem. The pages look as before, except that the footer columns are separated by the gutter of the breakpoint and move by a few pixels. See [UPGRADING.md](https://github.com/chassis-ui/website/blob/main/packages/docs/UPGRADING.md#from-06-to-07) for the classes to replace in a site's own pages.
8
+
3
9
  ## 0.6.3
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -23,7 +23,7 @@ pnpm add @chassis-ui/docs
23
23
  ```json
24
24
  {
25
25
  "@astrojs/markdown-remark": "^7.0.0",
26
- "@chassis-ui/css": "^0.5.0-0",
26
+ "@chassis-ui/css": ">=0.6.0",
27
27
  "@pagefind/component-ui": "^1.0.0",
28
28
  "@shikijs/transformers": "^4.3.1",
29
29
  "astro": "^7.0.0",
@@ -376,6 +376,7 @@ The integration provides five modules: `virtual:chassis-docs/config`, `virtual:c
376
376
 
377
377
  | `@chassis-ui/docs` | Requires Astro | Requires `@chassis-ui/css` | Requires Node | Built with |
378
378
  | ------------------ | -------------------------- | -------------------------- | ------------- | ------------------------------------ |
379
+ | 0.7.0 | `^7.0.0` | `>=0.6.0` | `>=22.12.0` | Astro 7.3.5, css 0.6.0, tokens 0.6.0 |
379
380
  | 0.6.3 | `^7.0.0` | `^0.5.0-0` | `>=22.12.0` | Astro 7.3.5, css 0.5.2, tokens 0.6.0 |
380
381
  | 0.6.2 | `^7.0.0` | `^0.5.0-0` | `>=22.12.0` | Astro 7.3.5, css 0.5.2, tokens 0.6.0 |
381
382
  | 0.6.1 | `^7.0.0` | `^0.5.0-0` | `>=22.12.0` | Astro 7.3.5, css 0.5.2, tokens 0.6.0 |
package/UPGRADING.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # Upgrading @chassis-ui/docs
2
2
 
3
+ ## From 0.6 to 0.7
4
+
5
+ 0.7.0 needs `@chassis-ui/css` 0.6.0 or later. The layouts use the CSS grid of that version,
6
+ `.grid` with `col-span-*`, in place of the flexbox grid, `.row` with `.col-*`. css 0.6
7
+ deprecates the flexbox grid and css 0.7 removes it.
8
+
9
+ ### 1. Update the dependencies
10
+
11
+ ```sh
12
+ pnpm add -D @chassis-ui/docs@^0.7.0 @chassis-ui/css@^0.6.0
13
+ ```
14
+
15
+ css 0.6.0 has changes of its own. Read its
16
+ [changelog](https://github.com/chassis-ui/css/blob/main/packages/css/CHANGELOG.md) first:
17
+ among them, the default gap of `.grid` is now the gutter token of the breakpoint.
18
+
19
+ ### 2. Move your own pages off the flexbox grid
20
+
21
+ css 0.6 still has the flexbox grid, so the site builds and looks as before without this
22
+ step. css 0.7 removes it. Replace the classes in your own components, pages and content:
23
+
24
+ | Flexbox grid | CSS grid |
25
+ | ---------------------------------------- | -------------------------------------------------- |
26
+ | `row` | `grid` |
27
+ | `col-6`, `md:col-6` | `col-span-6`, `col-span-full md:col-span-6` |
28
+ | `col-12` | `col-span-full` |
29
+ | `row row-cols-1 md:row-cols-3` and `col` | `grid grid-cols-1 md:grid-cols-3`, no class inside |
30
+ | `offset-1` | `col-start-2` |
31
+ | `col lg:col-10 mx-auto` | `col-span-full lg:col-span-10 lg:col-start-2` |
32
+ | `g-md`, `gx-md`, `gy-md` | `gap-md`, `column-gap-md`, `row-gap-md` |
33
+ | `col-auto` | `d-flex` with `gap-*` on the parent |
34
+ | `col-6` outside a `row` | `w-6/12` |
35
+ | `col` outside a `row` | `flex-fill` |
36
+
37
+ - An item without a span is one column wide. A column that was full width below its
38
+ breakpoint, such as `md:col-6`, needs `col-span-full` too.
39
+ - A `row` without a gutter class had a gutter of 1.5rem between columns and none between
40
+ rows. A `grid` has the gutter of the breakpoint in both directions, from 0.5rem to 3rem.
41
+ Add `row-gap-0` where the items have margins of their own.
42
+ - A grid beside the sidebar, or in a card, is narrower than the viewport that the gutter
43
+ follows. Give it a `gap-*` class, and `grid-cols-{n}` in place of twelve columns.
44
+ - An auto margin shrinks a grid item to its content. Center an item with `col-start-*`.
45
+
46
+ The [grid page](https://chassis-ui.com/css/docs/layout/grid/) of Chassis CSS has the full
47
+ table.
48
+
49
+ ### What changes in the package
50
+
51
+ - **`NavLink` sets no width.** Its item was `nav-item col-6 lg:col-auto`, half of the list
52
+ below `lg`. It is `nav-item` now, and the lists of the header are a grid of two columns
53
+ below `lg`. A list of your own that relied on the two columns takes
54
+ `d-grid grid-cols-2 lg:d-flex`.
55
+ - **`.cxd-gutter` sets `--cx-container-padding`.** It set `--cx-gutter-x`, which the
56
+ container stops reading in css 0.7. The page margin of the docs layout is 1rem, as
57
+ before. A rule of your own that set `--cx-gutter-x` on that element sets
58
+ `--cx-container-padding` to half of it.
59
+ - **The footer and the header of `SingleLayout` take the gutter of the breakpoint.** The
60
+ footer columns move by a few pixels, 20 at most on the widest screens.
61
+
62
+ ### Check the result
63
+
64
+ Build the site before and after the upgrade and compare the pages in a browser, at a phone
65
+ width and a desktop width. Apart from the footer columns, nothing of the package moves.
66
+
3
67
  ## From 0.5 to 0.6
4
68
 
5
69
  0.6.0 is a breaking release. In 0.5 a site had to supply five modules behind a `@libs/*`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chassis-ui/docs",
3
3
  "description": "Shared Astro components and layouts for Chassis documentation sites.",
4
- "version": "0.6.3",
4
+ "version": "0.7.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "peerDependencies": {
72
72
  "@astrojs/markdown-remark": "^7.0.0",
73
- "@chassis-ui/css": "^0.5.0-0",
73
+ "@chassis-ui/css": ">=0.6.0",
74
74
  "@pagefind/component-ui": "^1.0.0",
75
75
  "@shikijs/transformers": "^4.3.1",
76
76
  "astro": "^7.0.0",
@@ -106,8 +106,16 @@
106
106
  "unist-util-visit": "^5.1.0"
107
107
  },
108
108
  "devDependencies": {
109
+ "@astrojs/markdown-remark": "^7.3.1",
110
+ "@chassis-ui/css": "^0.6.0",
111
+ "@pagefind/component-ui": "^1.5.2",
112
+ "@shikijs/transformers": "^4.5.0",
109
113
  "astro": "^7.3.5",
114
+ "html-validate": "^11.16.1",
115
+ "rehype-autolink-headings": "^7.1.0",
110
116
  "remark-mdx": "^3.1.1",
111
- "vfile": "^6.0.3"
117
+ "sass": "^1.105.1",
118
+ "vfile": "^6.0.3",
119
+ "vnu-jar": "^26.10.2"
112
120
  }
113
121
  }
@@ -21,7 +21,7 @@ interface Props {
21
21
  const { active, class: className, ...props } = Astro.props
22
22
  ---
23
23
 
24
- <li class="nav-item col-6 lg:col-auto">
24
+ <li class="nav-item">
25
25
  <a
26
26
  aria-current={active ? true : undefined}
27
27
  class:list={['nav-link', className, { active }]}
package/src/js/search.js CHANGED
@@ -472,8 +472,8 @@ class CxdSearchResults extends HTMLElement {
472
472
  <div class="icon cxd-search-icon skeleton">
473
473
  </div>
474
474
  <div class="cxd-search-item-body">
475
- <div class="skeleton col-4"></div>
476
- <div class="skeleton col-12"></div>
475
+ <div class="skeleton w-4/12"></div>
476
+ <div class="skeleton w-100"></div>
477
477
  </div>
478
478
  </div>
479
479
  `
@@ -146,9 +146,9 @@ if (frontmatter.toc) {
146
146
  <div class="cxd-content">
147
147
  {
148
148
  frontmatter.sections && (
149
- <div class="row g-xl">
149
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-xl">
150
150
  {frontmatter.sections.map((section: DocSection) => (
151
- <div class="md:col-6">
151
+ <div>
152
152
  <a
153
153
  class="d-block text-decoration-none"
154
154
  href={getDocsPath(
@@ -24,8 +24,8 @@ mainProps['class'] = 'min-vh-100'
24
24
  <BaseLayout {...Astro.props} layout="single" overrides={{ main: mainProps }}>
25
25
  <header class="py-xl md:py-3xl border-bottom border-subtle">
26
26
  <div class="container 2xl">
27
- <div class="row">
28
- <div class="col lg:col-10 2xl:col-8">
27
+ <div class="grid">
28
+ <div class="col-span-full lg:col-span-10 2xl:col-span-8">
29
29
  <h1 class="mt-0">{title}</h1>
30
30
  <p class="font-lead">{description}</p>
31
31
  <slot name="header-content" />
@@ -10,8 +10,8 @@ import { getStaticPath } from '../../site'
10
10
 
11
11
  <footer class="cxd-footer py-6xl">
12
12
  <div class="container 2xl fg-subtle">
13
- <div class="row">
14
- <div class="md:col-10 lg:col-5 mb-md">
13
+ <div class="grid row-gap-0">
14
+ <div class="col-span-full md:col-span-10 lg:col-span-5 mb-md">
15
15
  <a
16
16
  class="d-inline-flex align-items-center mb-xs text-body-emphasis text-decoration-none"
17
17
  href="/"
@@ -30,7 +30,7 @@ import { getStaticPath } from '../../site'
30
30
  >
31
31
  </p>
32
32
  </div>
33
- <div class="sm:col-4 lg:col-2 lg:offset-1 mb-md">
33
+ <div class="col-span-full sm:col-span-4 lg:col-span-2 lg:col-start-7 mb-md">
34
34
  <p class="h6 mb-xs">Docs</p>
35
35
  <ul class="nav">
36
36
  <li><a href="/tokens">Design Tokens</a></li>
@@ -41,7 +41,7 @@ import { getStaticPath } from '../../site'
41
41
  <li><a href="/icons">Icon Generator</a></li>
42
42
  </ul>
43
43
  </div>
44
- <div class="sm:col-4 lg:col-2 mb-md">
44
+ <div class="col-span-full sm:col-span-4 lg:col-span-2 mb-md">
45
45
  <p class="h6 mb-xs">Github</p>
46
46
  <ul class="nav">
47
47
  <li><a href="https://github.com/chassis-ui/tokens">Chassis Tokens</a></li>
@@ -52,7 +52,7 @@ import { getStaticPath } from '../../site'
52
52
  <li><a href="https://github.com/chassis-ui/icons">Chassis Icons</a></li>
53
53
  </ul>
54
54
  </div>
55
- <div class="sm:col-4 lg:col-2 mb-md">
55
+ <div class="col-span-full sm:col-span-4 lg:col-span-2 mb-md">
56
56
  <p class="h6 mb-xs">Project</p>
57
57
  <ul class="nav">
58
58
  <li><a href="/about">About</a></li>
@@ -90,14 +90,16 @@ const isActive = (path: string) => {
90
90
 
91
91
  <hr class="lg:d-none m-0" />
92
92
  <div class="drawer-body lg:p-0">
93
- <ul class="navbar-nav flex-row flex-wrap cxd-navbar-nav mx-0 lg:mx-md">
93
+ <ul
94
+ class="navbar-nav d-grid grid-cols-2 lg:d-flex flex-row flex-wrap cxd-navbar-nav mx-0 lg:mx-md"
95
+ >
94
96
  <NavLink active={isActive('/tokens')} href="/tokens">Tokens</NavLink>
95
97
  <NavLink active={isActive('/figma')} href="/figma">Figma</NavLink>
96
98
  <NavLink active={isActive('/css')} href="/css">CSS</NavLink>
97
99
  <NavLink active={isActive('/react')} href="/react">React</NavLink>
98
100
  <NavLink active={isActive('/assets')} href="/assets">Assets</NavLink>
99
101
  <NavLink active={isActive('/icons')} href="/icons">Icons</NavLink>
100
- <li class="nav-item col-12 lg:col-auto lg:d-flex">
102
+ <li class="nav-item col-span-full lg:d-flex">
101
103
  <div class="vr d-none lg:d-flex my-auto lg:mx-sm"></div>
102
104
  <hr class="lg:d-none" />
103
105
  </li>
@@ -107,7 +109,9 @@ const isActive = (path: string) => {
107
109
 
108
110
  <hr class="lg:d-none m-0" />
109
111
 
110
- <ul class="navbar-nav flex-row flex-wrap lg:ms-auto align-items-center">
112
+ <ul
113
+ class="navbar-nav d-grid grid-cols-2 lg:d-flex flex-row flex-wrap lg:ms-auto align-items-center"
114
+ >
111
115
  {
112
116
  figmaHandle && (
113
117
  <NavLink
@@ -134,7 +138,7 @@ const isActive = (path: string) => {
134
138
  </NavLink>
135
139
  )
136
140
  }
137
- <li class="nav-item col-12 lg:col-auto">
141
+ <li class="nav-item col-span-full">
138
142
  <div class="vr d-none lg:d-flex h-100 lg:mx-2xs"></div>
139
143
  <hr class="lg:d-none" />
140
144
  </li>
@@ -3,7 +3,7 @@
3
3
 
4
4
  @layer custom {
5
5
  .cxd-gutter {
6
- --cx-gutter-x: #{$cxd-gutter-x};
6
+ --cx-container-padding: #{$cxd-gutter-x * .5};
7
7
  }
8
8
 
9
9
  .cxd-layout {