@master/internal-site 0.1.2 → 0.1.3

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.
Files changed (183) hide show
  1. package/README.md +6 -0
  2. package/dist/astro.mjs +145 -10
  3. package/package.json +1 -1
  4. package/src/astro/index.ts +2 -0
  5. package/src/astro/routes.template.ts +1 -0
  6. package/src/astro/style-assets.ts +107 -0
  7. package/src/benchmarks/BenchmarkBarRows.astro +3 -2
  8. package/src/benchmarks/BenchmarkBars.astro +1 -1
  9. package/src/benchmarks/BenchmarkChart.astro +1 -0
  10. package/src/benchmarks/BenchmarkChartGroup.astro +1 -1
  11. package/src/benchmarks/BenchmarkDataTable.astro +1 -1
  12. package/src/benchmarks/BenchmarkFigure.astro +2 -1
  13. package/src/benchmarks/BenchmarkMetricTable.astro +1 -1
  14. package/src/benchmarks/BenchmarkMetrics.astro +1 -1
  15. package/src/benchmarks/BenchmarkSampleSummary.astro +1 -1
  16. package/src/benchmarks/BenchmarkScrollRegion.svelte +2 -1
  17. package/src/benchmarks/BenchmarkSource.astro +1 -1
  18. package/src/benchmarks/BenchmarkStackedBars.astro +2 -1
  19. package/src/benchmarks/types.ts +2 -0
  20. package/src/blog/article/BlogArticleContents.svelte +1 -1
  21. package/src/blog/article/BlogArticleMasthead.astro +12 -1
  22. package/src/css/NamespaceUtilityTable.astro +1 -1
  23. package/src/css/ThemeNumberVariableTable.astro +1 -1
  24. package/src/css/markdown.ts +14 -5
  25. package/src/demo/Demo.svelte +4 -0
  26. package/src/demo/DemoAsset.astro +1 -0
  27. package/src/demo/DemoCatalog.astro +1 -0
  28. package/src/demo/DemoComparison.svelte +3 -0
  29. package/src/demo/DemoContainer.svelte +3 -0
  30. package/src/demo/DemoControls.svelte +2 -0
  31. package/src/demo/DemoCopyButton.svelte +3 -0
  32. package/src/demo/DemoCopyGroup.svelte +2 -0
  33. package/src/demo/DemoFeatureSupport.svelte +2 -0
  34. package/src/demo/DemoGeneratedCSS.svelte +2 -0
  35. package/src/demo/DemoIndex.astro +1 -0
  36. package/src/demo/DemoMotion.svelte +1 -0
  37. package/src/demo/DemoScrollArea.svelte +2 -0
  38. package/src/demo/DemoStyleComparison.astro +1 -0
  39. package/src/demo/DemoSurface.svelte +2 -0
  40. package/src/demo/DemoThemeComparison.astro +1 -0
  41. package/src/demo/DemoTokenTable.astro +1 -1
  42. package/src/demo/DemoViewport.svelte +5 -0
  43. package/src/demo/DemoWaterfall.astro +1 -1
  44. package/src/demo/foundations/FoundationDialog.astro +1 -0
  45. package/src/demo/foundations/FoundationMedia.astro +1 -0
  46. package/src/demo/foundations/FoundationShrink.astro +1 -0
  47. package/src/demo/foundations/Palette.svelte +2 -0
  48. package/src/demo/illustration-materials.ts +1 -1
  49. package/src/demo/illustration.css +218 -0
  50. package/src/docs-shell/components/ArticleHeader.astro +2 -0
  51. package/src/docs-shell/components/Callout.astro +1 -0
  52. package/src/docs-shell/components/CodeCopyButton.astro +2 -0
  53. package/src/docs-shell/components/CodeTabBar.astro +2 -0
  54. package/src/docs-shell/components/CodeTabs.astro +2 -1
  55. package/src/docs-shell/components/CodeView.astro +1 -1
  56. package/src/docs-shell/components/DocHeader.svelte +10 -13
  57. package/src/docs-shell/components/DocMenuButton.svelte +126 -60
  58. package/src/docs-shell/components/DocSidebar.svelte +2 -0
  59. package/src/docs-shell/components/DocVersionSelect.svelte +2 -0
  60. package/src/docs-shell/components/DocumentAPIIndex.astro +1 -1
  61. package/src/docs-shell/components/DocumentChoices.astro +1 -1
  62. package/src/docs-shell/components/DocumentCodeExampleView.astro +3 -1
  63. package/src/docs-shell/components/DocumentCodeTable.astro +1 -1
  64. package/src/docs-shell/components/DocumentCopyButton.svelte +3 -0
  65. package/src/docs-shell/components/DocumentDisclosure.astro +2 -0
  66. package/src/docs-shell/components/DocumentFileTree.astro +3 -0
  67. package/src/docs-shell/components/DocumentFlow.astro +4 -1
  68. package/src/docs-shell/components/DocumentIllustration.astro +5 -11
  69. package/src/docs-shell/components/DocumentKeyList.astro +1 -1
  70. package/src/docs-shell/components/DocumentNamespaceTable.astro +1 -1
  71. package/src/docs-shell/components/DocumentOptionEntry.astro +0 -1
  72. package/src/docs-shell/components/DocumentOptionList.astro +1 -1
  73. package/src/docs-shell/components/DocumentOptions.astro +0 -1
  74. package/src/docs-shell/components/DocumentParameters.astro +1 -1
  75. package/src/docs-shell/components/DocumentPrompt.astro +2 -0
  76. package/src/docs-shell/components/DocumentValueList.astro +1 -1
  77. package/src/docs-shell/components/DocumentationIndex.svelte +2 -0
  78. package/src/docs-shell/components/ExpandContent.svelte +3 -0
  79. package/src/docs-shell/components/ExplorerView.astro +1 -0
  80. package/src/docs-shell/components/GeneratedCSS.astro +1 -0
  81. package/src/docs-shell/components/Header.svelte +1 -1
  82. package/src/docs-shell/components/InlineCode.astro +1 -0
  83. package/src/docs-shell/components/InteractingIndicator.astro +1 -0
  84. package/src/docs-shell/components/LanguageButton.svelte +1 -0
  85. package/src/docs-shell/components/LanguageSelect.svelte +2 -0
  86. package/src/docs-shell/components/NotFound.astro +3 -0
  87. package/src/docs-shell/components/PMAction.astro +1 -0
  88. package/src/docs-shell/components/PageContent.svelte +1 -1
  89. package/src/docs-shell/components/PageContentDisclosure.astro +2 -1
  90. package/src/docs-shell/components/PageContentList.svelte +2 -0
  91. package/src/docs-shell/components/PageNavs.astro +1 -0
  92. package/src/docs-shell/components/SearchButton.svelte +3 -0
  93. package/src/docs-shell/components/SearchDialog.svelte +6 -1
  94. package/src/docs-shell/components/Segments.svelte +2 -0
  95. package/src/docs-shell/components/StepSection.astro +1 -2
  96. package/src/docs-shell/components/Tabs.astro +1 -0
  97. package/src/docs-shell/components/ThemeSelect.svelte +2 -0
  98. package/src/docs-shell/components/markdown/Table.astro +1 -0
  99. package/src/docs-shell/components/markdown-components.ts +0 -1
  100. package/src/docs-shell/remark/markdown-components.js +28 -7
  101. package/src/docs-shell/scripts/document.ts +1 -1
  102. package/src/docs-shell/types/Metadata.ts +11 -0
  103. package/src/docs-shell/utils/generate-metadata.ts +3 -1
  104. package/src/docs-shell/utils/head.ts +5 -2
  105. package/src/examples/components/ArticleTransitionScene.svelte +4 -0
  106. package/src/examples/layout-system/page.astro +0 -1
  107. package/src/home/HomeBentoFrame.astro +1 -0
  108. package/src/home/HomeBentoGrid.astro +1 -0
  109. package/src/home/bento.css +167 -0
  110. package/src/home/design.css +1 -1
  111. package/src/home/home.css +4 -576
  112. package/src/home/segmented-control.css +94 -0
  113. package/src/layouts/Document.astro +3 -1
  114. package/src/public/icons/json.svg +1 -0
  115. package/src/scripts/atomic-class-authoring.ts +98 -0
  116. package/src/scripts/style-delivery.mjs +110 -0
  117. package/src/sections/blog.astro +1 -1
  118. package/src/sections/guide.astro +1 -2
  119. package/src/styles/blog-article.css +10 -7
  120. package/src/styles/blog-materials.css +13 -0
  121. package/src/styles/demo.css +0 -1
  122. package/src/styles/docs-shell/code.css +5 -61
  123. package/src/styles/docs-shell/documentation-search.css +1 -0
  124. package/src/styles/docs-shell/header.css +2 -73
  125. package/src/styles/docs-shell/menu.css +37 -17
  126. package/src/styles/docs-shell/page-content.css +2 -37
  127. package/src/styles/docs-shell/prose.css +18 -9
  128. package/src/styles/docs-shell/steps.css +2 -39
  129. package/src/styles/document-comparison.css +5 -2
  130. package/src/styles/documentation-illustration.css +1 -9
  131. package/src/styles/documentation-index.css +2 -1
  132. package/src/styles/documents.css +2 -4
  133. package/src/styles/interface.css +5 -3
  134. package/src/styles/system/DESIGN.md +34 -14
  135. package/src/styles/system/browser.css +21 -0
  136. package/src/styles/system/button-feedback.css +13 -0
  137. package/src/styles/system/callout.css +14 -0
  138. package/src/styles/system/chart.css +18 -0
  139. package/src/styles/system/checks.css +18 -0
  140. package/src/styles/system/code-panel.css +82 -0
  141. package/src/styles/system/code-tabs.css +40 -0
  142. package/src/styles/system/code.css +8 -85
  143. package/src/styles/system/compare.css +7 -0
  144. package/src/styles/system/controls.css +10 -109
  145. package/src/styles/system/copy.css +32 -0
  146. package/src/styles/system/data.css +10 -134
  147. package/src/styles/system/dialog.css +16 -0
  148. package/src/styles/system/disclosure.css +19 -0
  149. package/src/styles/system/expand.css +11 -0
  150. package/src/styles/system/fields.css +25 -0
  151. package/src/styles/system/header-core.css +101 -0
  152. package/src/styles/system/hint.css +5 -0
  153. package/src/styles/system/index.css +13 -0
  154. package/src/styles/system/inline-code.css +4 -0
  155. package/src/styles/system/kbd.css +4 -0
  156. package/src/styles/system/logos.css +10 -0
  157. package/src/styles/system/menu.css +14 -0
  158. package/src/styles/system/metrics.css +22 -0
  159. package/src/styles/system/pagehead.css +13 -0
  160. package/src/styles/system/pager.css +13 -0
  161. package/src/styles/system/parameters.css +17 -0
  162. package/src/styles/system/prompt.css +7 -0
  163. package/src/styles/system/prose.css +4 -75
  164. package/src/styles/system/range.css +12 -0
  165. package/src/styles/system/reading.css +44 -0
  166. package/src/styles/system/scroll.css +6 -0
  167. package/src/styles/system/search-trigger.css +10 -0
  168. package/src/styles/system/segmented.css +22 -0
  169. package/src/styles/system/sheet.css +8 -0
  170. package/src/styles/system/shell.css +8 -102
  171. package/src/styles/system/sidebar.css +14 -0
  172. package/src/styles/system/source.css +5 -0
  173. package/src/styles/system/specimens.css +3 -0
  174. package/src/styles/system/stage.css +18 -0
  175. package/src/styles/system/steps.css +51 -0
  176. package/src/styles/system/surfaces.css +8 -104
  177. package/src/styles/system/table.css +23 -0
  178. package/src/styles/system/toc.css +59 -0
  179. package/src/styles/system/tooltip.css +6 -0
  180. package/src/styles/system/tray-code.css +6 -0
  181. package/src/styles/system/tray.css +20 -0
  182. package/src/styles/system/tree.css +15 -0
  183. package/src/styles/system/waterfall.css +14 -0
@@ -1,96 +1,162 @@
1
1
  <script lang="ts" module>
2
2
  import type { Attachment } from 'svelte/attachments'
3
3
 
4
- /** The sheet lives at the end of the body, outside the header that opens it. */
5
- const portal: Attachment<HTMLElement> = (node) => {
4
+ /** Keep the modal outside the header's transforms and stacking context. */
5
+ const portal: Attachment<HTMLDialogElement> = (node) => {
6
6
  document.body.append(node)
7
- return () => node.remove()
7
+ return () => { node.close(); node.remove() }
8
8
  }
9
9
  </script>
10
10
 
11
11
  <script lang="ts">
12
+ import '@master/internal-site/styles/interface.css'
13
+ import '@master/internal-site/styles/system/dialog.css'
14
+ import '@master/internal-site/styles/system/header-core.css'
15
+
12
16
  import '../../styles/docs-shell/menu.css'
17
+ import { onMount } from 'svelte'
13
18
  import clsx from 'clsx'
14
19
  import Link from './Link.svelte'
15
- import DocSidebar, { type DocSidebarProps } from './DocSidebar.svelte'
16
20
  import SearchButton from './SearchButton.svelte'
17
21
  import IconArrowUpRight from '@tabler/icons-svelte-runes/icons/arrow-up-right'
18
- import IconMenu2 from '@tabler/icons-svelte-runes/icons/menu-2'
19
- import IconX from '@tabler/icons-svelte-runes/icons/x'
22
+ import IconSearch from '@tabler/icons-svelte-runes/icons/search'
23
+ import IconMenu from '@tabler/icons-svelte-runes/icons/menu'
20
24
  import ThemeSelect from './ThemeSelect.svelte'
21
25
  import DocVersionSelect from './DocVersionSelect.svelte'
22
26
  import LanguageSelect from './LanguageSelect.svelte'
27
+ import { openSearch } from '../contexts/search'
23
28
  import app from 'virtual:master-site/app'
24
29
  import { getSite } from '../site'
25
30
 
26
- interface Props {
27
- class?: string
28
- documentNavigation?: DocSidebarProps['pageCategories']
29
- documentNavigationTitle?: string
30
- }
31
+ interface Props { class?: string }
31
32
 
32
- /** The compact header's menu: site sections, the section's chapters, community links and preferences in one sheet. */
33
- let { class: className, documentNavigation, documentNavigationTitle }: Props = $props()
33
+ /** Primary destinations, with community and preferences kept in a quiet footer. */
34
+ let { class: className }: Props = $props()
34
35
  let opened = $state(false)
35
36
  const id = $props.id()
36
- let dialog = $state<HTMLDialogElement>()
37
- let trigger = $state<HTMLButtonElement>()
37
+ let dialog: HTMLDialogElement
38
+ let trigger: HTMLButtonElement
39
+ let closing: ReturnType<typeof setTimeout> | undefined
38
40
  const { t, locale, i18n } = getSite()
39
41
  const tw = locale === 'tw'
40
42
 
43
+ function finishClose(restoreFocus = true) {
44
+ clearTimeout(closing)
45
+ closing = undefined
46
+ opened = false
47
+ dialog.close()
48
+ if (restoreFocus) {
49
+ const target = trigger.getClientRects().length ? trigger : trigger.closest('header')?.querySelector<HTMLElement>('.ui-header-brand')
50
+ target?.focus({ preventScroll: true })
51
+ }
52
+ }
53
+
54
+ function open() {
55
+ clearTimeout(closing)
56
+ closing = undefined
57
+ if (!dialog.open) {
58
+ dialog.showModal()
59
+ dialog.scrollTop = 0
60
+ // Establish the closed style before changing the target; CSS can reverse an interrupted transition.
61
+ getComputedStyle(dialog).opacity
62
+ }
63
+ opened = true
64
+ }
65
+
41
66
  function close() {
42
- dialog?.close()
43
67
  opened = false
44
- trigger?.focus({ preventScroll: true })
68
+ clearTimeout(closing)
69
+ if (matchMedia('(prefers-reduced-motion: reduce)').matches) finishClose()
70
+ else closing = setTimeout(finishClose, 220)
45
71
  }
46
72
 
47
- $effect(() => {
48
- if (!opened) return
49
- const element = dialog
50
- if (element && !element.open) element.showModal()
73
+ function transitionEnd(event: TransitionEvent) {
74
+ if (event.target === dialog && event.propertyName === 'opacity' && !opened) finishClose()
75
+ }
76
+
77
+ function search(event: Event) {
78
+ event.preventDefault()
79
+ const searchTrigger = trigger.closest('header')?.querySelector<HTMLElement>('.ui-header-search')
80
+ const target = searchTrigger?.getClientRects().length ? searchTrigger : trigger
81
+ finishClose(false)
82
+ openSearch(target)
83
+ }
84
+
85
+ function keydown(event: KeyboardEvent) {
86
+ if (event.key === 'Tab') {
87
+ const controls = Array.from(dialog.querySelectorAll<HTMLElement>('a[href], button:not(:disabled), select:not(:disabled)'))
88
+ .filter(element => element.getClientRects().length)
89
+ const first = controls[0]
90
+ const last = controls.at(-1)
91
+ if (event.shiftKey && document.activeElement === first) { event.preventDefault(); last?.focus() }
92
+ else if (!event.shiftKey && document.activeElement === last) { event.preventDefault(); first?.focus() }
93
+ }
94
+ if (!event.isComposing && (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k') {
95
+ event.stopPropagation()
96
+ search(event)
97
+ }
98
+ }
99
+
100
+ onMount(() => {
51
101
  const wide = matchMedia('(width >= 64rem)')
52
- const resize = () => { if (wide.matches) close() }
102
+ const motion = matchMedia('(prefers-reduced-motion: reduce)')
103
+ const resize = () => { if (wide.matches && dialog.open) finishClose() }
104
+ const reduceMotion = () => { if (motion.matches && closing) finishClose() }
53
105
  wide.addEventListener('change', resize)
54
- return () => wide.removeEventListener('change', resize)
106
+ motion.addEventListener('change', reduceMotion)
107
+ return () => {
108
+ clearTimeout(closing)
109
+ wide.removeEventListener('change', resize)
110
+ motion.removeEventListener('change', reduceMotion)
111
+ }
55
112
  })
56
113
  </script>
57
114
 
58
- <button bind:this={trigger} type="button" class={clsx('ui-button', className)} data-variant="quiet" data-shape="icon"
59
- aria-label={t('Menu')} aria-expanded={opened} aria-haspopup="dialog" aria-controls={opened ? id : undefined}
60
- onclick={() => { opened = !opened }}>
61
- <IconMenu2 size={20} stroke={1.5} aria-hidden="true" />
115
+ {#snippet lines()}
116
+ <IconMenu class="ui-menu-glyph" size={18} stroke={1.5} data-open={opened} aria-hidden="true" />
117
+ {/snippet}
118
+
119
+ <button bind:this={trigger} type="button" class={clsx('ui-button ui-menu-toggle', className)} data-variant="quiet" data-shape="icon"
120
+ aria-label={t('Menu')} aria-expanded={opened} aria-haspopup="dialog" aria-controls={id} onclick={open}>
121
+ {@render lines()}
62
122
  </button>
63
- {#if opened}
64
- <dialog bind:this={dialog} {@attach portal} {id} class="ui-dialog" data-variant="sheet" aria-labelledby={`${id}-title`} oncancel={event => { event.preventDefault(); close() }}>
65
- <div class="ui-dialog-bar">
66
- <button type="button" class="ui-button" data-variant="quiet" data-shape="icon" onclick={close} aria-label={tw ? '關閉選單' : 'Close menu'}><IconX size={20} stroke={1.5} aria-hidden="true" /></button>
67
- <Link href="/" class="ui-header-brand" onclick={close} aria-label={`${app.name} ${tw ? '首頁' : 'home'}`}><app.Logotype style="height: 20px; width: auto" aria-hidden="true" /></Link>
68
- </div>
69
- <div class="ui-dialog-body">
70
- <h2 class="sr-only" id={`${id}-title`}>{tw ? '網站導覽' : 'Navigation'}</h2>
71
- <SearchButton class="ui-search-trigger" />
72
- <nav class="ui-nav-group" aria-label={tw ? '主要導覽' : 'Main navigation'}>
73
- {#each app.navs as { Icon, disabled, fullName, ...link } (link.name)}<Link class="ui-nav-link" current="true" ambiguous {...link} {disabled} onclick={close}>
74
- {#if Icon}<Icon size={18} stroke={1.5} aria-hidden="true" />{/if}{t(fullName || link.name)}
75
- {#if link.href?.startsWith('http')}<IconArrowUpRight size={14} stroke={1.5} aria-hidden="true" />{/if}
76
- </Link>{/each}
77
- </nav>
78
- {#if documentNavigation?.length}<details class="ui-disclosure" data-variant="rule" open>
79
- <summary>{t(documentNavigationTitle || 'Documentation')}<span class="ui-disclosure-meta">{tw ? '文件章節' : 'Chapters'}</span></summary>
80
- <DocSidebar embedded includeNestedPages pageCategories={documentNavigation} onNavigate={close} />
81
- </details>{/if}
82
- {#if app.communityNavs?.length}<nav class="ui-nav-group" aria-labelledby={`${id}-community`}>
83
- <h4 id={`${id}-community`}>{t('Community')}</h4>
84
- {#each app.communityNavs as { Icon, disabled, fullName, ...link } (link.name)}<Link class="ui-nav-link" {...link} {disabled} onclick={close}>
85
- {#if Icon}<Icon size={18} stroke={1.5} aria-hidden="true" />{/if}{t(fullName || link.name)}<IconArrowUpRight size={14} stroke={1.5} aria-hidden="true" />
86
- </Link>{/each}
87
- </nav>{/if}
88
- <section class="ui-dialog-fields" aria-labelledby={`${id}-system`}>
89
- <h4 id={`${id}-system`}>{t('System')}</h4>
90
- {#if app.versions.length > 0}<label class="ui-field">{t('Version')}<DocVersionSelect aria-label={t('Version')} data-variant={undefined} /></label>{/if}
91
- {#if i18n.locales.length > 1}<label class="ui-field">{t('Language')}<LanguageSelect aria-label={t('Language')} data-variant={undefined} /></label>{/if}
92
- <label class="ui-field">{t('Theme')}<ThemeSelect aria-label={t('Theme')} data-variant={undefined} /></label>
93
- </section>
123
+ <dialog bind:this={dialog} {@attach portal} {id} class="ui-dialog ui-mobile-menu" data-variant="sheet" data-open={opened}
124
+ aria-labelledby={`${id}-title`} oncancel={event => { event.preventDefault(); close() }} ontransitionend={transitionEnd}
125
+ onkeydown={keydown} onclose={() => { if (!dialog.open) { opened = false; clearTimeout(closing) } }}>
126
+ <div class="ui-mobile-menu-bar">
127
+ <button type="button" class="ui-button ui-header-control ui-menu-toggle" data-variant="quiet" data-shape="icon"
128
+ onclick={() => opened ? close() : open()} aria-label={opened ? (tw ? '關閉選單' : 'Close menu') : t('Menu')} aria-expanded={opened} aria-controls={id}>
129
+ {@render lines()}
130
+ </button>
131
+ <Link href="/" class="ui-header-brand" onclick={() => finishClose(false)} aria-label={`${app.name} ${tw ? '首頁' : 'home'}`}><app.Logotype style="height: 20px; width: auto" aria-hidden="true" /></Link>
132
+ <SearchButton class="ui-button ui-header-control ui-menu-search" data-variant="quiet" data-shape="icon" onclick={search}><IconSearch size={18} stroke={1.5} aria-hidden="true" /></SearchButton>
133
+ </div>
134
+ <div class="ui-mobile-menu-body">
135
+ <h2 class="sr-only" id={`${id}-title`}>{tw ? '網站導覽' : 'Navigation'}</h2>
136
+ <nav class="ui-mobile-menu-nav" aria-label={tw ? '主要導覽' : 'Main navigation'}>
137
+ {#each app.navs as { Icon: _Icon, disabled, fullName, ...link }, index (link.name)}
138
+ <Link class="ui-mobile-menu-link" current="true" ambiguous {...link} {disabled} style={`--menu-order: ${index}`} onclick={() => finishClose(false)}>
139
+ <span>{t(fullName || link.name)}</span>
140
+ {#if link.href?.startsWith('http')}<IconArrowUpRight size={16} stroke={1.5} aria-hidden="true" />{/if}
141
+ </Link>
142
+ {/each}
143
+ </nav>
144
+ <div class="ui-mobile-menu-footer">
145
+ {#if app.communityNavs?.length}
146
+ <nav class="ui-mobile-menu-community" aria-label={t('Community')}>
147
+ {#each app.communityNavs as { Icon, disabled, fullName, ...link } (link.name)}
148
+ <Link {...link} {disabled} aria-label={fullName || link.name} title={fullName || link.name} onclick={() => finishClose(false)}>
149
+ {#if Icon}<Icon size={20} stroke={1.5} aria-hidden="true" />{:else}{t(fullName || link.name)}{/if}
150
+ {#if Icon && link.href?.startsWith('http')}<IconArrowUpRight class="ui-menu-external" size={10} stroke={1.5} aria-hidden="true" />{/if}
151
+ </Link>
152
+ {/each}
153
+ </nav>
154
+ {/if}
155
+ <div class="ui-mobile-menu-preferences">
156
+ <ThemeSelect aria-label={t('Theme')} data-variant={undefined} />
157
+ {#if i18n.locales.length > 1}<LanguageSelect aria-label={t('Language')} data-variant={undefined} />{/if}
158
+ {#if app.versions.length > 0}<DocVersionSelect aria-label={t('Version')} data-variant={undefined} />{/if}
159
+ </div>
94
160
  </div>
95
- </dialog>
96
- {/if}
161
+ </div>
162
+ </dialog>
@@ -14,6 +14,8 @@
14
14
  </script>
15
15
 
16
16
  <script lang="ts">
17
+ import '@master/internal-site/styles/system/sidebar.css'
18
+
17
19
  import Link from './Link.svelte'
18
20
  import { getSite } from '../site'
19
21
 
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/system/fields.css'
3
+
2
4
  import type { HTMLSelectAttributes } from 'svelte/elements'
3
5
  import clsx from 'clsx'
4
6
  import app from 'virtual:master-site/app'
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/index.css'
3
3
  import Link from '@master/internal-site/components/Link.svelte'
4
4
  import DocumentIdentifier from '@master/internal-site/components/DocumentIdentifier.astro'
5
5
  import type { DocumentAPIEntry } from '@master/internal-site/components/document-types.ts'
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/index.css'
3
3
  import Link from '@master/internal-site/components/Link.svelte'
4
4
  import RenderNode from '@master/internal-site/components/RenderNode.astro'
5
5
  import type { DocumentChoice } from '@master/internal-site/components/document-types.ts'
@@ -1,5 +1,7 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/callout.css'
3
+ import '@master/internal-site/styles/system/tray.css'
4
+ import '@master/internal-site/styles/system/tray-code.css'
3
5
  import IconAlertTriangle from '@tabler/icons-svelte-runes/icons/alert-triangle'
4
6
  import IconCircleX from '@tabler/icons-svelte-runes/icons/circle-x'
5
7
  import RenderNode from '@master/internal-site/components/RenderNode.astro'
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/table.css'
3
3
 
4
4
  interface Props {
5
5
  label?: string
@@ -1,4 +1,7 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/interface.css'
3
+ import '@master/internal-site/styles/system/copy.css'
4
+
2
5
  import { onMount } from 'svelte'
3
6
  import IconCheck from '@tabler/icons-svelte-runes/icons/check'
4
7
  import IconCopy from '@tabler/icons-svelte-runes/icons/copy'
@@ -1,4 +1,6 @@
1
1
  ---
2
+ import '@master/internal-site/styles/documents.css'
3
+ import '@master/internal-site/styles/system/disclosure.css'
2
4
  interface Props {
3
5
  title: string
4
6
  open?: boolean
@@ -1,4 +1,7 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/tray.css'
3
+ import '@master/internal-site/styles/system/tray-code.css'
4
+ import '@master/internal-site/styles/system/tree.css'
2
5
  import IconFile from '@tabler/icons-svelte-runes/icons/file'
3
6
  import IconFolder from '@tabler/icons-svelte-runes/icons/folder'
4
7
  import type { DocumentFileEntry, DocumentFileTreeProps } from '@master/internal-site/components/document-types.ts'
@@ -1,5 +1,8 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/stage.css'
3
+ import '@master/internal-site/styles/system/steps.css'
4
+ import '@master/internal-site/styles/system/tray.css'
5
+ import '@master/internal-site/styles/system/tray-code.css'
3
6
  import type { DocumentFlowProps } from '@master/internal-site/components/document-types.ts'
4
7
 
5
8
  export type { DocumentFlowStep, DocumentFlowProps } from '@master/internal-site/components/document-types.ts'
@@ -1,6 +1,8 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/disclosure.css'
3
+ import '@master/internal-site/styles/system/tray.css'
4
+ import '@master/internal-site/styles/system/tray-code.css'
2
5
  import '@master/internal-site/styles/documentation-illustration.css'
3
- import IconArrowsMaximize from '@tabler/icons-svelte-runes/icons/arrows-maximize'
4
6
  import Image from '@master/internal-site/components/Image.svelte'
5
7
  import type { IllustrationImages } from '../types/IllustrationImages'
6
8
 
@@ -11,23 +13,15 @@ interface Props {
11
13
  alt: string
12
14
  images: IllustrationImages
13
15
  caption: string
14
- fullSize?: boolean
15
16
  }
16
17
 
17
18
  /** A static figure with one accessible image and an independent text description. */
18
- const { title, alt, images, caption, fullSize = false } = Astro.props
19
+ const { title, alt, images, caption } = Astro.props
19
20
  ---
20
21
 
21
- <figure class="ui-tray" aria-label={title} data-illustration-expandable={fullSize || undefined}>
22
+ <figure class="ui-tray" aria-label={title}>
22
23
  <figcaption class="ui-tray-head">
23
24
  <p class="ui-tray-title">{title}</p>
24
- {fullSize && (['light', 'dark'] as const).map(scheme => <a
25
- class="document-illustration-expand ui-button"
26
- data-variant="quiet" data-shape="icon" data-size="sm" data-scheme={scheme}
27
- href={images[scheme].src} target="_blank" rel="noopener noreferrer"
28
- aria-label={`View full-size illustration: ${title} (opens in a new tab)`}
29
- title="View full-size illustration (opens in a new tab)"
30
- ><IconArrowsMaximize aria-hidden="true" /></a>)}
31
25
  </figcaption>
32
26
  <div class="document-illustration" role="img" aria-label={alt}>
33
27
  {(['light', 'dark'] as const).map(scheme => <Image
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/disclosure.css'
3
3
 
4
4
  interface Props {
5
5
  keys: string[]
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/table.css'
3
3
  import DocumentKeyList from '@master/internal-site/components/DocumentKeyList.astro'
4
4
 
5
5
  interface Props {
@@ -1,5 +1,4 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
3
2
  import DocumentIdentifier from '@master/internal-site/components/DocumentIdentifier.astro'
4
3
 
5
4
  interface Props {
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/parameters.css'
3
3
 
4
4
  interface Props {
5
5
  label: string
@@ -1,5 +1,4 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
3
2
  import RenderNode from '@master/internal-site/components/RenderNode.astro'
4
3
  import DocumentOptionEntry from '@master/internal-site/components/DocumentOptionEntry.astro'
5
4
  import DocumentOptionList from '@master/internal-site/components/DocumentOptionList.astro'
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/parameters.css'
3
3
  import '@master/internal-site/styles/system/specimens.css'
4
4
  import RenderNode from '@master/internal-site/components/RenderNode.astro'
5
5
  import DocumentIdentifier from '@master/internal-site/components/DocumentIdentifier.astro'
@@ -1,4 +1,6 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/code-panel.css'
3
+ import '@master/internal-site/styles/system/prompt.css'
2
4
  import DocumentCopyButton from '@master/internal-site/components/DocumentCopyButton.svelte'
3
5
  import type { DocumentPromptProps } from '@master/internal-site/components/document-types.ts'
4
6
 
@@ -1,5 +1,5 @@
1
1
  ---
2
- import '@master/internal-site/styles/system/data.css'
2
+ import '@master/internal-site/styles/system/parameters.css'
3
3
  import type { DocumentValueRow } from '@master/internal-site/components/document-types.ts'
4
4
 
5
5
  export type { DocumentValueRow } from '@master/internal-site/components/document-types.ts'
@@ -3,6 +3,8 @@
3
3
  </script>
4
4
 
5
5
  <script lang="ts">
6
+ import '@master/internal-site/styles/system/segmented.css'
7
+
6
8
  import '@master/internal-site/styles/documentation-index.css'
7
9
  import Link from '@master/internal-site/components/Link.svelte'
8
10
  import { getSite } from '@master/internal-site/site'
@@ -1,4 +1,7 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/interface.css'
3
+ import '@master/internal-site/styles/system/expand.css'
4
+
2
5
  import type { Snippet } from 'svelte'
3
6
  import IconChevronDown from '@tabler/icons-svelte-runes/icons/chevron-down'
4
7
  import { getSite } from '../site'
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/tree.css'
2
3
  import FileIcon from './FileIcon.astro'
3
4
  import FolderSvg from '../../public/icons/folder.svg'
4
5
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/disclosure.css'
2
3
  /** A closed native disclosure keeps the complete output in the server HTML. */
3
4
  ---
4
5
 
@@ -12,7 +12,7 @@
12
12
  </script>
13
13
 
14
14
  <script lang="ts">
15
- import '../../styles/docs-shell/header.css'
15
+ import '../../styles/system/header-core.css'
16
16
  import { throttle } from 'throttle-debounce'
17
17
  import { flushSync } from 'svelte'
18
18
  import clsx from 'clsx'
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/inline-code.css'
2
3
  import clsx from 'clsx'
3
4
  import { toHtml } from 'hast-util-to-html'
4
5
  import highlightCode from '../utils/highlight-code'
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/hint.css'
2
3
  import IconForms from '@tabler/icons-svelte-runes/icons/forms'
3
4
  import IconHandClick from '@tabler/icons-svelte-runes/icons/hand-click'
4
5
  import IconHandMove from '@tabler/icons-svelte-runes/icons/hand-move'
@@ -1,4 +1,5 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/interface.css'
2
3
  import IconLanguage from '@tabler/icons-svelte-runes/icons/language'
3
4
  import LanguageSelect from './LanguageSelect.svelte'
4
5
  import clsx from 'clsx'
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/system/fields.css'
3
+
2
4
  import type { Snippet } from 'svelte'
3
5
  import type { HTMLSelectAttributes } from 'svelte/elements'
4
6
  import clsx from 'clsx'
@@ -1,4 +1,7 @@
1
1
  ---
2
+ import '@master/internal-site/styles/interface.css'
3
+ import '@master/internal-site/styles/system/pagehead.css'
4
+ import '@master/internal-site/styles/system/search-trigger.css'
2
5
  import '../../styles/docs-shell/not-found.css'
3
6
  import { siteOf } from '../../astro/site-context'
4
7
  import SearchButton from './SearchButton.svelte'
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/code-panel.css'
2
3
  import { resolveCommand } from 'package-manager-detector/commands'
3
4
  import CodeTabs from './CodeTabs.astro'
4
5
  import { slotText } from '../utils/slot-text'
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import '../../styles/docs-shell/page-content.css'
2
+ import '../../styles/system/toc.css'
3
3
  import Link from './Link.svelte'
4
4
  import app from 'virtual:master-site/app'
5
5
  import PageContentProvider from './PageContentProvider.svelte'
@@ -1,5 +1,6 @@
1
1
  ---
2
- import '../../styles/docs-shell/page-content.css'
2
+ import '@master/internal-site/styles/system/disclosure.css'
3
+ import '../../styles/system/toc.css'
3
4
  import type { PageContentItem } from './page-content.svelte'
4
5
  import PageContentTitle from './PageContentTitle.svelte'
5
6
  import groupPageContent from '../utils/group-page-content'
@@ -6,6 +6,8 @@
6
6
  </script>
7
7
 
8
8
  <script lang="ts">
9
+ import '@master/internal-site/styles/system/toc.css'
10
+
9
11
  import Link from './Link.svelte'
10
12
  import PageContentTitle from './PageContentTitle.svelte'
11
13
  import { usePageContent, type PageContentItem } from './page-content.svelte'
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/pager.css'
2
3
  import Link from './Link.svelte'
3
4
  import { createTranslation } from '../utils/i18n'
4
5
 
@@ -1,4 +1,7 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/interface.css'
3
+ import '@master/internal-site/styles/system/search-trigger.css'
4
+
2
5
  import type { Snippet } from 'svelte'
3
6
  import type { HTMLButtonAttributes } from 'svelte/elements'
4
7
  import IconSearch from '@tabler/icons-svelte-runes/icons/search'
@@ -20,6 +20,9 @@
20
20
  </script>
21
21
 
22
22
  <script lang="ts">
23
+ import '@master/internal-site/styles/interface.css'
24
+ import '@master/internal-site/styles/system/dialog.css'
25
+
23
26
  import '../../styles/docs-shell/documentation-search.css'
24
27
  import { untrack } from 'svelte'
25
28
  import Link from './Link.svelte'
@@ -38,6 +41,7 @@
38
41
  const tw = locale === 'tw'
39
42
  let opened = $state(false)
40
43
  let query = $state('')
44
+ let shortcutModifier = $state('⌘')
41
45
  let pages = $state.raw<DocumentationSearchPage[]>([])
42
46
  let error = $state('')
43
47
  let loading = $state(false)
@@ -67,6 +71,7 @@
67
71
  }
68
72
 
69
73
  function open(event?: Event) {
74
+ shortcutModifier = /Mac|iPhone|iPad|iPod/.test(navigator.platform) ? '⌘' : 'Ctrl'
70
75
  const trigger = (event as CustomEvent<{ trigger?: HTMLElement }> | undefined)?.detail?.trigger
71
76
  returnFocus = trigger instanceof HTMLElement ? trigger : document.activeElement as HTMLElement
72
77
  opened = true
@@ -169,6 +174,6 @@
169
174
  </li>{/each}{/if}
170
175
  </ol>
171
176
  </div>
172
- <div class="ui-dialog-foot" aria-hidden="true"><span><span class="ui-kbd"><IconArrowUp size={12} /></span><span class="ui-kbd"><IconArrowDown size={12} /></span>{tw ? '選擇' : 'Navigate'}</span><span><span class="ui-kbd"><IconCornerDownLeft size={12} /></span>{tw ? '開啟' : 'Open'}</span><span>{tw ? '文件搜尋' : 'Documentation'}</span></div>
177
+ <div class="ui-dialog-foot" aria-hidden="true"><span><span class="ui-kbd"><IconArrowUp size={12} /></span><span class="ui-kbd"><IconArrowDown size={12} /></span>{tw ? '選擇' : 'Navigate'}</span><span><span class="ui-kbd"><IconCornerDownLeft size={12} /></span>{tw ? '開啟' : 'Open'}</span><span class="ui-search-shortcut">{tw ? '隨時搜尋' : 'Search anytime'}<kbd class="ui-kbd">{shortcutModifier}</kbd><kbd class="ui-kbd">K</kbd></span></div>
173
178
  </dialog>
174
179
  {/if}
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ import '@master/internal-site/styles/system/segmented.css'
3
+
2
4
  import '../../styles/docs-shell/segments.css'
3
5
  import type { Snippet } from 'svelte'
4
6
 
@@ -1,6 +1,5 @@
1
1
  ---
2
- import '../../styles/system/data.css'
3
- import '../../styles/docs-shell/steps.css'
2
+ import '../../styles/system/steps.css'
4
3
  import type { HTMLAttributes } from 'astro/types'
5
4
 
6
5
  type Props = HTMLAttributes<'ol'>
@@ -1,4 +1,5 @@
1
1
  ---
2
+ import '@master/internal-site/styles/system/segmented.css'
2
3
  import type { HTMLAttributes } from 'astro/types'
3
4
 
4
5
  type Props = HTMLAttributes<'nav'>