@astrojs/starlight 0.20.1 → 0.21.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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @astrojs/starlight
2
2
 
3
+ ## 0.21.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1584](https://github.com/withastro/starlight/pull/1584) [`8851d5cd`](https://github.com/withastro/starlight/commit/8851d5cd0d8f8439320ef729ca57a59418db52b9) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds 2 new icons: `apple` and `linux`.
8
+
9
+ - [#1577](https://github.com/withastro/starlight/pull/1577) [`0ba77890`](https://github.com/withastro/starlight/commit/0ba77890e0dcf54a849c735efd870327c10972aa) Thanks [@morinokami](https://github.com/morinokami)! - Translates `fileTree.directory` UI string into Japanese.
10
+
11
+ - [#1593](https://github.com/withastro/starlight/pull/1593) [`fa7ed245`](https://github.com/withastro/starlight/commit/fa7ed2458caf6261d16c5f43365cedbcb8572a48) Thanks [@liruifengv](https://github.com/liruifengv)! - Translates `fileTree.directory` UI string into simplified Chinese.
12
+
13
+ - [#1585](https://github.com/withastro/starlight/pull/1585) [`bd4e278f`](https://github.com/withastro/starlight/commit/bd4e278f7fe7d7335494602db29a63002fd45059) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Translates `fileTree.directory` UI string into French.
14
+
15
+ - [#1587](https://github.com/withastro/starlight/pull/1587) [`c5794260`](https://github.com/withastro/starlight/commit/c5794260251ed414a396089782a1788539c92dd3) Thanks [@Eveeifyeve](https://github.com/Eveeifyeve)! - Adds 1 new icon: `homebrew`.
16
+
17
+ ## 0.21.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#1568](https://github.com/withastro/starlight/pull/1568) [`5f99a71d`](https://github.com/withastro/starlight/commit/5f99a71ddfe92568b1cd3c0bfe5ebfd139797c1a) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds support for optionally setting an icon on a `<TabItem>` component to make it easier to visually distinguish between tabs.
22
+
23
+ - [#1308](https://github.com/withastro/starlight/pull/1308) [`9a918a5b`](https://github.com/withastro/starlight/commit/9a918a5b4902f43729f4d023257772710af3a12b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds `<FileTree>` component to display the structure of a directory.
24
+
25
+ - [#1308](https://github.com/withastro/starlight/pull/1308) [`9a918a5b`](https://github.com/withastro/starlight/commit/9a918a5b4902f43729f4d023257772710af3a12b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds 144 new file-type icons from the [Seti UI icon set](https://github.com/jesseweed/seti-ui#current-icons), available with the `seti:` prefix, e.g. `seti:javascript`.
26
+
27
+ - [#1564](https://github.com/withastro/starlight/pull/1564) [`d880065e`](https://github.com/withastro/starlight/commit/d880065e29a632823a08adcb6158a59fd9557270) Thanks [@delucis](https://github.com/delucis)! - Adds a `<Steps>` component for styling more complex guided tasks.
28
+
29
+ - [#1308](https://github.com/withastro/starlight/pull/1308) [`9a918a5b`](https://github.com/withastro/starlight/commit/9a918a5b4902f43729f4d023257772710af3a12b) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Adds 5 new icons: `astro`, `biome`, `bun`, `mdx`, and `pnpm`.
30
+
3
31
  ## 0.20.1
4
32
 
5
33
  ### Patch Changes
@@ -1,4 +1,6 @@
1
- export const Icons = {
1
+ import { FileIcons } from '../user-components/file-tree-icons';
2
+
3
+ export const BuiltInIcons = {
2
4
  'up-caret':
3
5
  '<path d="m17 13.41-4.29-4.24a.999.999 0 0 0-1.42 0l-4.24 4.24a1 1 0 1 0 1.41 1.42L12 11.29l3.54 3.54a1 1 0 0 0 1.41 0 1 1 0 0 0 .05-1.42Z"/>',
4
6
  'down-caret':
@@ -105,4 +107,22 @@ export const Icons = {
105
107
  '<path d="M22.5 1.5v21h-2.25V24H24V0h-3.75v1.5h2.25ZM7.46 7.95V9.1h.04a3.02 3.02 0 0 1 2.61-1.39c.54 0 1.03.1 1.48.32.44.2.78.58 1.01 1.1.26-.37.6-.7 1.03-.99.44-.28.95-.43 1.55-.43.45 0 .87.06 1.26.17.38.11.71.29.99.53.27.24.49.56.64.95.15.4.23.86.23 1.42v5.72h-2.34v-4.85c0-.29-.01-.56-.04-.8a1.73 1.73 0 0 0-.18-.67 1.1 1.1 0 0 0-.44-.45 1.6 1.6 0 0 0-.78-.16c-.33 0-.6.06-.8.19-.2.12-.37.29-.48.5a2 2 0 0 0-.23.69c-.04.26-.06.52-.06.78v4.77H10.6v-4.8l-.01-.75a2.29 2.29 0 0 0-.14-.69c-.08-.2-.23-.38-.42-.5a1.5 1.5 0 0 0-.85-.2c-.15.01-.3.04-.44.08-.19.06-.37.15-.52.28-.18.14-.32.34-.44.6-.12.26-.18.6-.18 1.02v4.96H5.25V7.94h2.21ZM1.5 1.5v21h2.25V24H0V0h3.75v1.5H1.5Z"/>',
106
108
  openCollective:
107
109
  '<path d="M21.86 5.17a11.94 11.94 0 0 1 0 13.66l-3.1-3.1a7.68 7.68 0 0 0 0-7.46l3.1-3.1Zm-3.03-3.03-3.1 3.1a7.71 7.71 0 1 0 0 13.51l3.1 3.11a12 12 0 1 1 0-19.73Z"/><path d="M21.86 5.17a11.94 11.94 0 0 1 0 13.66l-3.1-3.1a7.68 7.68 0 0 0 0-7.46l3.1-3.1Z"/>',
110
+ astro:
111
+ '<path d="M7.233 15.856c-.456 1.5-.132 3.586.948 4.57v-.036l.036-.096c.132-.636.648-1.032 1.309-1.008.612.012.96.336 1.044 1.044.036.264.036.528.048.803v.084c0 .6.168 1.176.504 1.68.3.48.72.851 1.284 1.103l-.024-.048-.024-.096c-.42-1.26-.12-2.135.984-2.879l.336-.227.745-.492a3.647 3.647 0 0 0 1.536-2.603c.06-.456 0-.9-.132-1.331l-.18.12c-1.668.887-3.577 1.2-5.425.84-1.117-.169-2.197-.48-3-1.416l.011-.012ZM2 15.592s3.205-1.559 6.421-1.559l2.437-7.508c.084-.36.348-.6.648-.6.3 0 .552.24.648.612l2.425 7.496c3.816 0 6.421 1.56 6.421 1.56L15.539.72c-.144-.444-.42-.72-.768-.72H8.24c-.348 0-.6.276-.768.72L2 15.592Z"/>',
112
+ pnpm: '<path d="M0 0v7.5h7.5V0H0Zm8.25 0v7.5h7.498V0H8.25Zm8.25 0v7.5H24V0h-7.5ZM8.25 8.25v7.5h7.498v-7.5H8.25Zm8.25 0v7.5H24v-7.5h-7.5ZM0 16.5V24h7.5v-7.5H0Zm8.25 0V24h7.498v-7.5H8.25Zm8.25 0V24H24v-7.5h-7.5Z"/>',
113
+ biome:
114
+ '<path d="m12 2-5.346 9.259a12.065 12.065 0 0 1 6.326-.22l1.807.427-1.7 7.208-1.81-.427c-2.223-.524-4.36.644-5.263 2.507l-1.672-.809c1.276-2.636 4.284-4.232 7.363-3.505l.848-3.593A10.213 10.213 0 0 0 0 22.785h24L12 2Z"/>',
115
+ bun: '<path d="M11.966 22.132c6.609 0 11.966-4.326 11.966-9.661 0-3.308-2.051-6.23-5.204-7.963-1.283-.713-2.291-1.353-3.13-1.885C14.018 1.619 13.043 1 11.966 1c-1.094 0-2.327.783-3.955 1.816a49.78 49.78 0 0 1-2.808 1.692C2.051 6.241 0 9.163 0 12.471c0 5.335 5.357 9.661 11.966 9.661Zm-1.397-17.83a5.885 5.885 0 0 0 .497-2.403c0-.144.201-.186.229-.028.656 2.775-.9 4.15-2.051 4.61-.124.048-.199-.12-.103-.208a5.747 5.747 0 0 0 1.428-1.971Zm2.052-.102a5.795 5.795 0 0 0-.78-2.3v-.015c-.068-.123.086-.263.185-.172 1.956 2.105 1.303 4.055.554 5.037-.082.102-.229-.003-.188-.126a5.837 5.837 0 0 0 .229-2.424Zm1.771-.559a5.709 5.709 0 0 0-1.607-1.801v-.014c-.112-.085-.024-.274.113-.218 2.588 1.084 2.766 3.171 2.452 4.395a.116.116 0 0 1-.13.09.11.11 0 0 1-.071-.045.118.118 0 0 1-.022-.083 5.863 5.863 0 0 0-.735-2.324ZM9.32 4.2c-.616.544-1.279.758-2.058.997-.116 0-.194-.078-.155-.18 1.747-.907 2.369-1.645 2.99-2.771 0 0 .155-.117.188.085 0 .303-.348 1.325-.965 1.869Zm4.931 11.205a2.95 2.95 0 0 1-.935 1.549 2.16 2.16 0 0 1-1.282.618 2.167 2.167 0 0 1-1.323-.618 2.95 2.95 0 0 1-.923-1.549.243.243 0 0 1 .064-.197.23.23 0 0 1 .192-.069h3.954a.227.227 0 0 1 .244.16c.01.035.014.07.009.106Zm-5.443-2.17a1.85 1.85 0 0 1-2.377-.244 1.969 1.969 0 0 1-.233-2.44c.207-.318.502-.565.846-.711a1.84 1.84 0 0 1 2.053.42c.264.27.443.616.515.99a1.98 1.98 0 0 1-.108 1.118c-.142.35-.384.653-.696.867Zm8.471.005a1.85 1.85 0 0 1-2.374-.252 1.956 1.956 0 0 1-.546-1.362c0-.383.11-.758.319-1.076.207-.318.502-.566.847-.711a1.84 1.84 0 0 1 1.09-.108c.366.076.702.261.965.533s.44.617.512.993a1.98 1.98 0 0 1-.113 1.118 1.922 1.922 0 0 1-.7.865Z"/>',
116
+ mdx: '<path d="m15.494 12.406-3.169 3.169-3.25-3.169.894-.894 1.706 1.707V8.588h1.219V13.3l1.706-1.706.894.812Zm-13.65-.65 2.193 2.194 2.276-2.194v3.575H7.53v-6.58l-3.494 3.493L.625 8.75v6.581h1.219v-3.575ZM22.4 15.25l-2.519-2.519-2.518 2.519-.813-.894 2.519-2.518-2.6-2.6.893-.813 2.52 2.6 2.6-2.6.893.813-2.6 2.6 2.519 2.518-.894.894Z"/>',
117
+ apple:
118
+ '<path d="M14.94 5.19A4.38 4.38 0 0 0 16 2a4.44 4.44 0 0 0-3 1.52 4.17 4.17 0 0 0-1 3.09 3.69 3.69 0 0 0 2.94-1.42Zm2.52 7.44a4.51 4.51 0 0 1 2.16-3.81 4.66 4.66 0 0 0-3.66-2c-1.56-.16-3 .91-3.83.91s-2-.89-3.3-.87a4.92 4.92 0 0 0-4.14 2.53C2.93 12.45 4.24 17 6 19.47c.8 1.21 1.8 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.1 1-.2 1.5-.6l.6-.3c.1 0 .1-.1.1-.1 0-.1 0-.1-.1-.1-.2.1-.5.2-.7.3-.4.3-.9.5-1.4.5-.5 0-.9-.3-1.2-.6-.1 0-.2-.1-.3-.1z"/>',
121
+ homebrew:
122
+ '<path d="M7.94 0a.21.21 0 0 0-.2.16c-.32 1.1.17 2.15.83 2.93.15.18.31.35.48.5a2.04 2.04 0 0 0-.67.02c-1.18.24-2.2.99-2.74 2.53a3.9 3.9 0 0 0-.2 1.47 1.56 1.56 0 0 0-1.16 1.5 1.59 1.59 0 0 0 1.23 1.55l.03 12.04c0 .2.1.38.26.48a.21.21 0 0 0 .01 0c.54.32 2.05.82 5.21.82 3.24 0 4.7-.68 5.18-1.04a.57.57 0 0 0 .22-.45v-1.6a.14.14 0 0 1 .14-.14h1.32a1.83 1.83 0 0 0 1.83-1.82v-5.8a1.83 1.83 0 0 0-1.82-1.83h-1.33a.14.14 0 0 1-.14-.15v-.57a1.57 1.57 0 0 0 1.36-1.56c0-.81-.63-1.49-1.42-1.56a4.34 4.34 0 0 0-.74-2.58 3.1 3.1 0 0 0-2.28-1.32c-.5-.02-.84.12-1.13.25-.21.1-.42.18-.67.22 0-1.28.95-1.98.95-1.98a.21.21 0 0 0 .05-.3s-.09-.12-.21-.26c-.12-.13-.27-.3-.47-.38a.21.21 0 0 0-.08-.01.21.21 0 0 0-.14.05 4.3 4.3 0 0 0-.88 1.1 3.42 3.42 0 0 0-.13.28 3.5 3.5 0 0 0-.38-.85A4.44 4.44 0 0 0 8.02.02.21.21 0 0 0 7.94 0zm.15.52c.85.38 1.43.83 1.8 1.4.27.45.42.97.48 1.6a3.07 3.07 0 0 0-.01.45 6.9 6.9 0 0 1-.17-.05 5.49 5.49 0 0 1-1.3-1.1c-.54-.66-.93-1.46-.8-2.3m3.71 1.1c.07.05.14.1.21.18l.06.07a2.97 2.97 0 0 0-.95 2.45.21.21 0 0 0 .22.2c.47-.02.78-.17 1.06-.3.27-.13.5-.23.93-.21.87.02 1.64.71 1.94 1.13.3.45.65 1 .66 2.36a1.66 1.66 0 0 0-.41.14 1.94 1.94 0 0 0-1.77-1.16 1.94 1.94 0 0 0-1.87 1.45 1.78 1.78 0 0 0-1.36-.64c-.48 0-.9.2-1.23.52a1.87 1.87 0 0 0-1.85-1.63c-.65 0-1.22.34-1.55.84a3.1 3.1 0 0 1 .16-.73c.5-1.44 1.35-2.05 2.42-2.26.36-.07.66 0 .99.1.32.1.67.26 1.09.34a.21.21 0 0 0 .25-.25c-.11-.67.07-1.26.34-1.74a3.71 3.71 0 0 1 .66-.86m-4.36 5A1.44 1.44 0 0 1 8.8 8.53a.21.21 0 0 0 .17.28.21.21 0 0 0 .24-.15 1.37 1.37 0 0 1 2.62 0 .21.21 0 0 0 .41-.1 1.5 1.5 0 0 1 1.5-1.66c.69 0 1.26.44 1.45 1.05a.21.21 0 0 0 .26.15l.15-.04a.21.21 0 0 0 .05-.02 1.14 1.14 0 0 1 1.7 1 1.14 1.14 0 0 1-.98 1.12 2.21 2.21 0 0 0-.49.13 10.65 10.65 0 0 1-1.18.36.21.21 0 0 0-.16.2 1.28 1.28 0 0 1-.14.47 2.07 2.07 0 0 0-.24 1.11v.15a.44.44 0 0 1-.16.36.67.67 0 0 1-.43.14.59.59 0 0 1-.59-.59.8.8 0 0 0-.38-.68 1.28 1.28 0 0 1-.53-.64.21.21 0 0 0-.21-.14 19.47 19.47 0 0 1-5.37-.6 9 9 0 0 0-.84-.2 1.16 1.16 0 0 1-.94-1.13c0-.62.5-1.11 1.1-1.14a.21.21 0 0 0 .21-.17A1.44 1.44 0 0 1 7.44 6.6m8.55 4.1v.46c0 .32.26.57.57.57h1.33a1.4 1.4 0 0 1 1.4 1.4v5.8a1.4 1.4 0 0 1-1.4 1.4h-1.32a.57.57 0 0 0-.58.57v1.6c0 .05-.02.08-.05.11-.35.26-1.75.95-4.92.95-3.1 0-4.59-.52-4.99-.75a.14.14 0 0 1-.06-.12l-.03-11.95.43.1.39.1v10.37c0 .13.07.25.18.31.45.22 1.77.74 4.07.74 2.32 0 3.6-.63 4.02-.89a.36.36 0 0 0 .17-.3v-10.2l.79-.26m-8 .9a.5.5 0 0 1 .5.48v8.58a.5.5 0 0 1-.49.5.5.5 0 0 1-.5-.5V12.1a.5.5 0 0 1 .5-.49zm8.66 1.13a.66.66 0 0 0-.66.66v5.21a.66.66 0 0 0 .66.66h1.14a.66.66 0 0 0 .66-.66v-5.2a.66.66 0 0 0-.66-.67zm0 .43h1.14a.23.23 0 0 1 .23.23v5.21a.23.23 0 0 1-.23.23h-1.14a.23.23 0 0 1-.23-.23v-5.2a.23.23 0 0 1 .23-.24"/>',
123
+ };
124
+
125
+ export const Icons = {
126
+ ...BuiltInIcons,
127
+ ...FileIcons,
108
128
  };
package/components.ts CHANGED
@@ -5,4 +5,6 @@ export { default as Icon } from './user-components/Icon.astro';
5
5
  export { default as Tabs } from './user-components/Tabs.astro';
6
6
  export { default as TabItem } from './user-components/TabItem.astro';
7
7
  export { default as LinkCard } from './user-components/LinkCard.astro';
8
+ export { default as Steps } from './user-components/Steps.astro';
9
+ export { default as FileTree } from './user-components/FileTree.astro';
8
10
  export { Code } from 'astro-expressive-code/components';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.20.1",
3
+ "version": "0.21.1",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -184,7 +184,9 @@
184
184
  "@types/mdast": "^4.0.3",
185
185
  "astro-expressive-code": "^0.33.4",
186
186
  "bcp-47": "^2.1.0",
187
+ "hast-util-from-html": "^2.0.1",
187
188
  "hast-util-select": "^6.0.2",
189
+ "hast-util-to-string": "^3.0.0",
188
190
  "hastscript": "^8.0.0",
189
191
  "mdast-util-directive": "^3.0.0",
190
192
  "mdast-util-to-markdown": "^2.1.0",
package/schemas/i18n.ts CHANGED
@@ -121,6 +121,10 @@ function starlightI18nSchema() {
121
121
  'aside.note': z.string().describe('Text shown on the note aside variant'),
122
122
  'aside.caution': z.string().describe('Text shown on the warning aside variant'),
123
123
  'aside.danger': z.string().describe('Text shown on the danger aside variant'),
124
+
125
+ 'fileTree.directory': z
126
+ .string()
127
+ .describe('Label for the directory icon in the file tree component.'),
124
128
  })
125
129
  .partial();
126
130
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "ملحوظة",
23
23
  "aside.tip": "نصيحة",
24
24
  "aside.caution": "تنبيه",
25
- "aside.danger": "تحذير"
25
+ "aside.danger": "تحذير",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Hinweis",
23
23
  "aside.tip": "Tipp",
24
24
  "aside.caution": "Achtung",
25
- "aside.danger": "Gefahr"
25
+ "aside.danger": "Gefahr",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -25,5 +25,6 @@
25
25
  "aside.danger": "Peligro",
26
26
  "expressiveCode.copyButtonCopied": "¡Copiado!",
27
27
  "expressiveCode.copyButtonTooltip": "Copiar al portapapeles",
28
- "expressiveCode.terminalWindowFallbackTitle": "Ventana de terminal"
28
+ "expressiveCode.terminalWindowFallbackTitle": "Ventana de terminal",
29
+ "fileTree.directory": "Directory"
29
30
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -25,5 +25,6 @@
25
25
  "aside.danger": "Danger",
26
26
  "expressiveCode.copyButtonCopied": "Copié !",
27
27
  "expressiveCode.copyButtonTooltip": "Copier dans le presse-papiers",
28
- "expressiveCode.terminalWindowFallbackTitle": "Fenêtre de terminal"
28
+ "expressiveCode.terminalWindowFallbackTitle": "Fenêtre de terminal",
29
+ "fileTree.directory": "Répertoire"
29
30
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "टिप्पणी",
23
23
  "aside.tip": "संकेत",
24
24
  "aside.caution": "सावधानी",
25
- "aside.danger": "खतरा"
25
+ "aside.danger": "खतरा",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Catatan",
23
23
  "aside.tip": "Tips",
24
24
  "aside.caution": "Perhatian",
25
- "aside.danger": "Bahaya"
25
+ "aside.danger": "Bahaya",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Nota",
23
23
  "aside.tip": "Consiglio",
24
24
  "aside.caution": "Attenzione",
25
- "aside.danger": "Pericolo"
25
+ "aside.danger": "Pericolo",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "ノート",
23
23
  "aside.tip": "ヒント",
24
24
  "aside.caution": "注意",
25
- "aside.danger": "危険"
25
+ "aside.danger": "危険",
26
+ "fileTree.directory": "ディレクトリ"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "노트",
23
23
  "aside.tip": "팁",
24
24
  "aside.caution": "주의",
25
- "aside.danger": "위험"
25
+ "aside.danger": "위험",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Opmerking",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Opgepast",
25
- "aside.danger": "Gevaar"
25
+ "aside.danger": "Gevaar",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Nota",
23
23
  "aside.tip": "Dica",
24
24
  "aside.caution": "Cuidado",
25
- "aside.danger": "Perigo"
25
+ "aside.danger": "Perigo",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Mențiune",
23
23
  "aside.tip": "Sfat",
24
24
  "aside.caution": "Atenție",
25
- "aside.danger": "Pericol"
25
+ "aside.danger": "Pericol",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Заметка",
23
23
  "aside.tip": "Знали ли вы?",
24
24
  "aside.caution": "Осторожно",
25
- "aside.danger": "Опасно"
25
+ "aside.danger": "Опасно",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Note",
23
23
  "aside.tip": "Tip",
24
24
  "aside.caution": "Caution",
25
- "aside.danger": "Danger"
25
+ "aside.danger": "Danger",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Заувага",
23
23
  "aside.tip": "Порада",
24
24
  "aside.caution": "Обережно",
25
- "aside.danger": "Небезпечно"
25
+ "aside.danger": "Небезпечно",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "Ghi chú",
23
23
  "aside.tip": "Mẹo",
24
24
  "aside.caution": "Thận trọng",
25
- "aside.danger": "Nguy hiểm"
25
+ "aside.danger": "Nguy hiểm",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "注意",
23
23
  "aside.tip": "提示",
24
24
  "aside.caution": "警告",
25
- "aside.danger": "危险"
25
+ "aside.danger": "危险",
26
+ "fileTree.directory": "文件夹"
26
27
  }
@@ -22,5 +22,6 @@
22
22
  "aside.note": "注意",
23
23
  "aside.tip": "提示",
24
24
  "aside.caution": "警告",
25
- "aside.danger": "危險"
25
+ "aside.danger": "危險",
26
+ "fileTree.directory": "Directory"
26
27
  }
@@ -0,0 +1,139 @@
1
+ ---
2
+ import { slugToLocaleData } from '../utils/slugs';
3
+ import { useTranslations } from '../utils/translations';
4
+ import { processFileTree } from './rehype-file-tree';
5
+
6
+ const slug = Astro.url.pathname.replace(/^\//, '').replace(/\/$/, '');
7
+ const t = useTranslations(slugToLocaleData(slug).locale);
8
+
9
+ const fileTreeHtml = await Astro.slots.render('default');
10
+ const html = processFileTree(fileTreeHtml, t('fileTree.directory'));
11
+ ---
12
+
13
+ <starlight-file-tree set:html={html} class="not-content" data-pagefind-ignore />
14
+
15
+ <style>
16
+ starlight-file-tree {
17
+ --x-space: 1.5rem;
18
+ --y-space: 0.125rem;
19
+ --y-pad: 0;
20
+
21
+ display: block;
22
+ border: 1px solid var(--sl-color-gray-5);
23
+ padding: 1rem;
24
+ background-color: var(--sl-color-gray-6);
25
+ font-size: var(--sl-text-xs);
26
+ font-family: var(--__sl-font-mono);
27
+ overflow-x: auto;
28
+ }
29
+
30
+ starlight-file-tree :global(.directory > details) {
31
+ border: 0;
32
+ padding: 0;
33
+ padding-inline-start: var(--x-space);
34
+ background: transparent;
35
+ }
36
+
37
+ starlight-file-tree :global(.directory > details > summary) {
38
+ margin-inline-start: calc(-1 * var(--x-space));
39
+ border: 0;
40
+ padding: var(--y-pad) 0.625rem;
41
+ font-weight: normal;
42
+ color: var(--sl-color-white);
43
+ max-width: 100%;
44
+
45
+ &::marker,
46
+ &::-webkit-details-marker {
47
+ color: var(--sl-color-gray-3);
48
+ }
49
+
50
+ &:hover,
51
+ &:hover :global(.tree-icon) {
52
+ cursor: pointer;
53
+ color: var(--sl-color-text-accent);
54
+ fill: var(--sl-color-text-accent);
55
+
56
+ & ~ :global(ul) {
57
+ border-color: var(--sl-color-gray-4);
58
+ }
59
+ }
60
+
61
+ &:hover :global(.highlight .tree-icon) {
62
+ fill: var(--sl-color-text-invert);
63
+ }
64
+ }
65
+
66
+ starlight-file-tree :global(ul) {
67
+ margin-inline-start: 0.5rem;
68
+ border-inline-start: 1px solid var(--sl-color-gray-5);
69
+ padding: 0;
70
+ padding-inline-start: 0.125rem;
71
+ list-style: none;
72
+ }
73
+
74
+ starlight-file-tree > :global(ul) {
75
+ margin: 0;
76
+ border: 0;
77
+ padding: 0;
78
+ }
79
+
80
+ starlight-file-tree :global(li) {
81
+ margin: var(--y-space) 0;
82
+ padding: var(--y-pad) 0;
83
+ }
84
+
85
+ starlight-file-tree :global(.file) {
86
+ margin-inline-start: calc(var(--x-space) - 0.125rem);
87
+ color: var(--sl-color-white);
88
+ }
89
+
90
+ starlight-file-tree :global(.tree-entry) {
91
+ display: inline-flex;
92
+ align-items: flex-start;
93
+ flex-wrap: wrap;
94
+ max-width: calc(100% - 1rem);
95
+
96
+ @media (min-width: 30em) {
97
+ & {
98
+ flex-wrap: nowrap;
99
+ }
100
+ }
101
+
102
+ & > :global(:first-child) {
103
+ flex-shrink: 0;
104
+ }
105
+ }
106
+
107
+ starlight-file-tree :global(.empty) {
108
+ color: var(--sl-color-gray-3);
109
+ padding-inline-start: 0.375rem;
110
+ }
111
+
112
+ starlight-file-tree :global(.comment) {
113
+ color: var(--sl-color-gray-3);
114
+ padding-inline-start: 1.625rem;
115
+ max-width: 24rem;
116
+ min-width: 12rem;
117
+ }
118
+
119
+ starlight-file-tree :global(.highlight) {
120
+ display: inline-block;
121
+ border-radius: 0.25rem;
122
+ padding-inline-end: 0.5rem;
123
+ color: var(--sl-color-text-invert);
124
+ background-color: var(--sl-color-text-accent);
125
+ }
126
+
127
+ starlight-file-tree :global(svg) {
128
+ display: inline;
129
+ fill: var(--sl-color-gray-3);
130
+ vertical-align: middle;
131
+ margin-inline: 0.25rem 0.375rem;
132
+ width: 0.875rem;
133
+ height: 0.875rem;
134
+ }
135
+
136
+ starlight-file-tree :global(.highlight svg.tree-icon) {
137
+ fill: var(--sl-color-text-invert);
138
+ }
139
+ </style>
@@ -0,0 +1,84 @@
1
+ ---
2
+ import { processSteps } from './rehype-steps';
3
+
4
+ const content = await Astro.slots.render('default');
5
+ const { html } = processSteps(content);
6
+ ---
7
+
8
+ <Fragment set:html={html} />
9
+
10
+ <style is:global>
11
+ .sl-steps {
12
+ --bullet-size: calc(var(--sl-line-height) * 1rem);
13
+ --bullet-margin: 0.375rem;
14
+
15
+ list-style: none;
16
+ padding-inline-start: 0;
17
+ }
18
+
19
+ .sl-steps > li {
20
+ position: relative;
21
+ padding-inline-start: calc(var(--bullet-size) + 1rem);
22
+ /* HACK: Keeps any `margin-bottom` inside the `<li>`’s padding box to avoid gaps in the hairline border. */
23
+ padding-bottom: 1px;
24
+ /* Prevent bullets from touching in short list items. */
25
+ min-height: calc(var(--bullet-size) + var(--bullet-margin));
26
+ }
27
+ .sl-steps > li + li {
28
+ /* Remove margin between steps. */
29
+ margin-top: 0;
30
+ }
31
+
32
+ /* Custom list marker element. */
33
+ .sl-steps > li::before {
34
+ content: counter(list-item);
35
+ position: absolute;
36
+ top: 0;
37
+ inset-inline-start: 0;
38
+ width: var(--bullet-size);
39
+ height: var(--bullet-size);
40
+ line-height: var(--bullet-size);
41
+
42
+ font-size: var(--sl-text-xs);
43
+ font-weight: 600;
44
+ text-align: center;
45
+ color: var(--sl-color-white);
46
+ background-color: var(--sl-color-gray-6);
47
+ border-radius: 99rem;
48
+ box-shadow: inset 0 0 0 1px var(--sl-color-gray-5);
49
+ }
50
+
51
+ /* Vertical guideline linking list numbers. */
52
+ .sl-steps > li:not(:last-of-type)::after {
53
+ --guide-width: 1px;
54
+ content: '';
55
+ position: absolute;
56
+ top: calc(var(--bullet-size) + var(--bullet-margin));
57
+ bottom: var(--bullet-margin);
58
+ inset-inline-start: calc((var(--bullet-size) - var(--guide-width)) / 2);
59
+ width: var(--guide-width);
60
+ background-color: var(--sl-color-hairline-light);
61
+ }
62
+
63
+ /* Adjust first item inside a step so that it aligns vertically with the number
64
+ even if using a larger font size (e.g. a heading) */
65
+ .sl-steps > li > :first-child {
66
+ /*
67
+ The `lh` unit is not yet supported by all browsers in our support matrix
68
+ — see https://caniuse.com/mdn-css_types_length_lh
69
+ In unsupported browsers we approximate this using our known line-heights.
70
+ */
71
+ --lh: calc(1em * var(--sl-line-height));
72
+ --shift-y: calc(0.5 * (var(--bullet-size) - var(--lh)));
73
+ transform: translateY(var(--shift-y));
74
+ margin-bottom: var(--shift-y);
75
+ }
76
+ .sl-steps > li > :first-child:where(h1, h2, h3, h4, h5, h6) {
77
+ --lh: calc(1em * var(--sl-line-height-headings));
78
+ }
79
+ @supports (--prop: 1lh) {
80
+ .sl-steps > li > :first-child {
81
+ --lh: 1lh;
82
+ }
83
+ }
84
+ </style>
@@ -1,17 +1,19 @@
1
1
  ---
2
2
  import { TabItemTagname } from './rehype-tabs';
3
+ import type { Icons } from '../components/Icons';
3
4
 
4
5
  interface Props {
6
+ icon?: keyof typeof Icons;
5
7
  label: string;
6
8
  }
7
9
 
8
- const { label } = Astro.props;
10
+ const { icon, label } = Astro.props;
9
11
 
10
12
  if (!label) {
11
13
  throw new Error('Missing prop `label` on `<TabItem>` component.');
12
14
  }
13
15
  ---
14
16
 
15
- <TabItemTagname data-label={label}>
17
+ <TabItemTagname data-label={label} data-icon={icon}>
16
18
  <slot />
17
19
  </TabItemTagname>
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import Icon from './Icon.astro';
2
3
  import { processPanels } from './rehype-tabs';
3
4
 
4
5
  const panelHtml = await Astro.slots.render('default');
@@ -10,7 +11,7 @@ const { html, panels } = processPanels(panelHtml);
10
11
  panels && (
11
12
  <div class="tablist-wrapper not-content">
12
13
  <ul role="tablist">
13
- {panels.map(({ label, panelId, tabId }, idx) => (
14
+ {panels.map(({ icon, label, panelId, tabId }, idx) => (
14
15
  <li role="presentation" class="tab">
15
16
  <a
16
17
  role="tab"
@@ -19,6 +20,7 @@ const { html, panels } = processPanels(panelHtml);
19
20
  aria-selected={idx === 0 && 'true'}
20
21
  tabindex={idx !== 0 ? -1 : 0}
21
22
  >
23
+ {icon && <Icon name={icon} />}
22
24
  {label}
23
25
  </a>
24
26
  </li>
@@ -50,7 +52,9 @@ const { html, panels } = processPanels(panelHtml);
50
52
  margin-bottom: -2px;
51
53
  }
52
54
  .tab > [role='tab'] {
53
- display: block;
55
+ display: flex;
56
+ align-items: center;
57
+ gap: 0.5rem;
54
58
  padding: 0 1.25rem;
55
59
  text-decoration: none;
56
60
  border-bottom: 2px solid var(--sl-color-gray-5);