@master/internal-site 0.1.2 → 0.2.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.
Files changed (239) hide show
  1. package/README.md +43 -0
  2. package/dist/astro.mjs +233 -47
  3. package/dist/config.d.mts +6 -0
  4. package/dist/localization-LfIbIysE.mjs +356 -0
  5. package/dist/localization.d.mts +69 -0
  6. package/dist/localization.mjs +1 -0
  7. package/package.json +12 -9
  8. package/src/astro/content-pages.ts +30 -11
  9. package/src/astro/index.ts +11 -5
  10. package/src/astro/localized-mdx.ts +45 -0
  11. package/src/astro/routes.template.ts +4 -0
  12. package/src/astro/site-context.ts +10 -2
  13. package/src/astro/style-assets.ts +107 -0
  14. package/src/benchmarks/BenchmarkBarRows.astro +3 -2
  15. package/src/benchmarks/BenchmarkBars.astro +1 -1
  16. package/src/benchmarks/BenchmarkChart.astro +5 -1
  17. package/src/benchmarks/BenchmarkChartGroup.astro +1 -1
  18. package/src/benchmarks/BenchmarkDataTable.astro +1 -1
  19. package/src/benchmarks/BenchmarkFigure.astro +2 -1
  20. package/src/benchmarks/BenchmarkMetricTable.astro +2 -2
  21. package/src/benchmarks/BenchmarkMetrics.astro +1 -1
  22. package/src/benchmarks/BenchmarkSampleSummary.astro +1 -1
  23. package/src/benchmarks/BenchmarkScrollRegion.svelte +2 -1
  24. package/src/benchmarks/BenchmarkSource.astro +1 -1
  25. package/src/benchmarks/BenchmarkStackedBars.astro +4 -3
  26. package/src/benchmarks/BenchmarkStatus.astro +3 -1
  27. package/src/benchmarks/localization.ts +22 -0
  28. package/src/benchmarks/types.ts +2 -0
  29. package/src/blog/article/BlogArticleContents.svelte +1 -1
  30. package/src/blog/article/BlogArticleEnd.astro +6 -9
  31. package/src/blog/article/BlogArticleMasthead.astro +17 -9
  32. package/src/config.ts +3 -0
  33. package/src/css/NamespaceUtilityTable.astro +1 -1
  34. package/src/css/ThemeNumberVariableTable.astro +1 -1
  35. package/src/css/foundation-data/specimen-content.ts +2 -2
  36. package/src/css/markdown.ts +64 -14
  37. package/src/demo/Demo.svelte +10 -4
  38. package/src/demo/DemoAsset.astro +6 -3
  39. package/src/demo/DemoAxes.svelte +4 -2
  40. package/src/demo/DemoCatalog.astro +9 -6
  41. package/src/demo/DemoComparison.svelte +3 -0
  42. package/src/demo/DemoContainer.svelte +8 -3
  43. package/src/demo/DemoControls.svelte +5 -1
  44. package/src/demo/DemoCopyButton.svelte +9 -4
  45. package/src/demo/DemoCopyGroup.svelte +6 -2
  46. package/src/demo/DemoExample.astro +3 -1
  47. package/src/demo/DemoFeatureSupport.svelte +5 -1
  48. package/src/demo/DemoGeneratedCSS.svelte +5 -1
  49. package/src/demo/DemoIndex.astro +6 -3
  50. package/src/demo/DemoLegend.svelte +3 -1
  51. package/src/demo/DemoMeasure.svelte +4 -2
  52. package/src/demo/DemoMedia.svelte +3 -1
  53. package/src/demo/DemoMotion.svelte +6 -3
  54. package/src/demo/DemoPaletteGroups.svelte +4 -2
  55. package/src/demo/DemoScrollArea.svelte +2 -0
  56. package/src/demo/DemoStyleComparison.astro +6 -3
  57. package/src/demo/DemoSurface.svelte +2 -0
  58. package/src/demo/DemoThemeComparison.astro +5 -2
  59. package/src/demo/DemoTokenTable.astro +5 -3
  60. package/src/demo/DemoViewTransition.astro +3 -1
  61. package/src/demo/DemoViewport.svelte +18 -11
  62. package/src/demo/DemoWaterfall.astro +4 -2
  63. package/src/demo/ProjectStyleExample.astro +4 -1
  64. package/src/demo/foundations/FoundationDialog.astro +6 -2
  65. package/src/demo/foundations/FoundationMedia.astro +1 -0
  66. package/src/demo/foundations/FoundationShrink.astro +1 -0
  67. package/src/demo/foundations/FoundationTokensView.astro +16 -5
  68. package/src/demo/foundations/Palette.svelte +11 -7
  69. package/src/demo/foundations/dialog-copy.d.ts +1 -0
  70. package/src/demo/foundations/dialog-copy.js +5 -0
  71. package/src/demo/illustration-materials.ts +1 -1
  72. package/src/demo/illustration.css +218 -0
  73. package/src/docs-shell/common/i18n.config.d.ts +1 -1
  74. package/src/docs-shell/common/i18n.config.js +4 -12
  75. package/src/docs-shell/common/locales.d.ts +8 -0
  76. package/src/docs-shell/common/locales.js +18 -0
  77. package/src/docs-shell/common/terminology.json +32 -0
  78. package/src/docs-shell/common/translations.d.ts +3 -0
  79. package/src/docs-shell/common/translations.js +294 -0
  80. package/src/docs-shell/components/ArticleHeader.astro +5 -3
  81. package/src/docs-shell/components/Callout.astro +1 -0
  82. package/src/docs-shell/components/CodeCopyButton.astro +5 -1
  83. package/src/docs-shell/components/CodeTabBar.astro +7 -3
  84. package/src/docs-shell/components/CodeTabs.astro +2 -1
  85. package/src/docs-shell/components/CodeView.astro +1 -1
  86. package/src/docs-shell/components/DocHeader.svelte +13 -17
  87. package/src/docs-shell/components/DocHeading.astro +3 -1
  88. package/src/docs-shell/components/DocMenuButton.svelte +126 -61
  89. package/src/docs-shell/components/DocSidebar.svelte +3 -2
  90. package/src/docs-shell/components/DocVersionSelect.svelte +2 -0
  91. package/src/docs-shell/components/DocumentAPIIndex.astro +1 -1
  92. package/src/docs-shell/components/DocumentChoices.astro +1 -1
  93. package/src/docs-shell/components/DocumentCodeExampleView.astro +3 -1
  94. package/src/docs-shell/components/DocumentCodeTable.astro +4 -2
  95. package/src/docs-shell/components/DocumentCopyButton.svelte +3 -0
  96. package/src/docs-shell/components/DocumentDisclosure.astro +2 -0
  97. package/src/docs-shell/components/DocumentFileTree.astro +3 -0
  98. package/src/docs-shell/components/DocumentFlow.astro +4 -1
  99. package/src/docs-shell/components/DocumentIllustration.astro +8 -12
  100. package/src/docs-shell/components/DocumentKeyList.astro +6 -4
  101. package/src/docs-shell/components/DocumentNamespaceTable.astro +5 -3
  102. package/src/docs-shell/components/DocumentOptionEntry.astro +0 -1
  103. package/src/docs-shell/components/DocumentOptionList.astro +1 -1
  104. package/src/docs-shell/components/DocumentOptions.astro +3 -2
  105. package/src/docs-shell/components/DocumentParameters.astro +1 -1
  106. package/src/docs-shell/components/DocumentPrompt.astro +2 -0
  107. package/src/docs-shell/components/DocumentValueList.astro +1 -1
  108. package/src/docs-shell/components/DocumentationIndex.svelte +8 -7
  109. package/src/docs-shell/components/ExpandContent.svelte +3 -0
  110. package/src/docs-shell/components/ExplorerView.astro +1 -0
  111. package/src/docs-shell/components/GeneratedCSS.astro +4 -1
  112. package/src/docs-shell/components/Header.svelte +1 -1
  113. package/src/docs-shell/components/InlineCode.astro +1 -0
  114. package/src/docs-shell/components/InteractingIndicator.astro +1 -0
  115. package/src/docs-shell/components/LanguageButton.svelte +1 -0
  116. package/src/docs-shell/components/LanguageSelect.svelte +2 -0
  117. package/src/docs-shell/components/Link.svelte +3 -2
  118. package/src/docs-shell/components/NotFound.astro +6 -4
  119. package/src/docs-shell/components/PMAction.astro +1 -0
  120. package/src/docs-shell/components/PageContent.svelte +1 -1
  121. package/src/docs-shell/components/PageContentDisclosure.astro +2 -1
  122. package/src/docs-shell/components/PageContentList.svelte +2 -0
  123. package/src/docs-shell/components/PageNavs.astro +3 -3
  124. package/src/docs-shell/components/SearchButton.svelte +3 -0
  125. package/src/docs-shell/components/SearchDialog.svelte +18 -16
  126. package/src/docs-shell/components/Segments.svelte +2 -0
  127. package/src/docs-shell/components/StepSection.astro +1 -2
  128. package/src/docs-shell/components/Tabs.astro +1 -0
  129. package/src/docs-shell/components/ThemeSelect.svelte +2 -0
  130. package/src/docs-shell/components/TimeAgo.svelte +6 -6
  131. package/src/docs-shell/components/markdown/Table.astro +1 -0
  132. package/src/docs-shell/components/markdown-components.ts +0 -1
  133. package/src/docs-shell/contexts/search.ts +1 -1
  134. package/src/docs-shell/factories/Page.astro +10 -5
  135. package/src/docs-shell/factories/create-page.ts +33 -6
  136. package/src/docs-shell/layouts/BlogArticle.astro +3 -11
  137. package/src/docs-shell/remark/markdown-components.js +28 -7
  138. package/src/docs-shell/remark/slug-and-toc.js +5 -7
  139. package/src/docs-shell/scripts/code.ts +5 -2
  140. package/src/docs-shell/scripts/document.ts +1 -1
  141. package/src/docs-shell/site.ts +9 -1
  142. package/src/docs-shell/types/Metadata.ts +11 -0
  143. package/src/docs-shell/utils/document-copy.d.ts +2 -0
  144. package/src/docs-shell/utils/document-copy.js +18 -0
  145. package/src/docs-shell/utils/generate-metadata.ts +5 -1
  146. package/src/docs-shell/utils/head.ts +5 -2
  147. package/src/docs-shell/utils/i18n-pathname.ts +13 -2
  148. package/src/docs-shell/utils/i18n.ts +4 -1
  149. package/src/docs-shell/utils/localized-metadata.ts +22 -0
  150. package/src/docs-shell/utils/markdown-links.ts +61 -0
  151. package/src/docs-shell/utils/markdown-tree.ts +19 -6
  152. package/src/docs-shell/utils/resolve-heading.d.ts +1 -0
  153. package/src/docs-shell/utils/resolve-heading.js +21 -0
  154. package/src/docs-shell/utils/search-pages.ts +75 -22
  155. package/src/examples/components/ArticleTransitionScene.svelte +4 -0
  156. package/src/examples/layout-system/page.astro +0 -1
  157. package/src/home/HomeBentoFrame.astro +1 -0
  158. package/src/home/HomeBentoGrid.astro +1 -0
  159. package/src/home/bento.css +167 -0
  160. package/src/home/design.css +1 -1
  161. package/src/home/hero.css +5 -0
  162. package/src/home/home.css +4 -576
  163. package/src/home/segmented-control.css +94 -0
  164. package/src/layouts/Document.astro +4 -2
  165. package/src/public/icons/json.svg +1 -0
  166. package/src/scripts/atomic-class-authoring.ts +98 -0
  167. package/src/scripts/localization.ts +239 -0
  168. package/src/scripts/mdx-sample.ts +12 -0
  169. package/src/scripts/static-social.ts +17 -3
  170. package/src/scripts/style-delivery.mjs +120 -0
  171. package/src/sections/blog.astro +1 -1
  172. package/src/sections/guide.astro +4 -3
  173. package/src/styles/blog-article.css +10 -7
  174. package/src/styles/blog-materials.css +13 -0
  175. package/src/styles/demo.css +0 -1
  176. package/src/styles/docs-shell/code.css +5 -61
  177. package/src/styles/docs-shell/documentation-search.css +1 -0
  178. package/src/styles/docs-shell/header.css +2 -73
  179. package/src/styles/docs-shell/menu.css +37 -17
  180. package/src/styles/docs-shell/page-content.css +2 -37
  181. package/src/styles/docs-shell/prose.css +18 -9
  182. package/src/styles/docs-shell/steps.css +2 -39
  183. package/src/styles/document-comparison.css +5 -2
  184. package/src/styles/documentation-illustration.css +1 -9
  185. package/src/styles/documentation-index.css +2 -1
  186. package/src/styles/documents.css +2 -4
  187. package/src/styles/interface.css +5 -3
  188. package/src/styles/system/DESIGN.md +34 -14
  189. package/src/styles/system/browser.css +21 -0
  190. package/src/styles/system/button-feedback.css +13 -0
  191. package/src/styles/system/callout.css +14 -0
  192. package/src/styles/system/chart.css +18 -0
  193. package/src/styles/system/checks.css +18 -0
  194. package/src/styles/system/code-panel.css +82 -0
  195. package/src/styles/system/code-tabs.css +40 -0
  196. package/src/styles/system/code.css +8 -85
  197. package/src/styles/system/compare.css +7 -0
  198. package/src/styles/system/controls.css +10 -109
  199. package/src/styles/system/copy.css +32 -0
  200. package/src/styles/system/data.css +10 -134
  201. package/src/styles/system/dialog.css +16 -0
  202. package/src/styles/system/disclosure.css +19 -0
  203. package/src/styles/system/expand.css +11 -0
  204. package/src/styles/system/fields.css +25 -0
  205. package/src/styles/system/header-core.css +101 -0
  206. package/src/styles/system/hint.css +5 -0
  207. package/src/styles/system/index.css +13 -0
  208. package/src/styles/system/inline-code.css +4 -0
  209. package/src/styles/system/kbd.css +4 -0
  210. package/src/styles/system/logos.css +10 -0
  211. package/src/styles/system/menu.css +14 -0
  212. package/src/styles/system/metrics.css +22 -0
  213. package/src/styles/system/pagehead.css +13 -0
  214. package/src/styles/system/pager.css +13 -0
  215. package/src/styles/system/parameters.css +17 -0
  216. package/src/styles/system/prompt.css +7 -0
  217. package/src/styles/system/prose.css +4 -75
  218. package/src/styles/system/range.css +12 -0
  219. package/src/styles/system/reading.css +44 -0
  220. package/src/styles/system/scroll.css +6 -0
  221. package/src/styles/system/search-trigger.css +10 -0
  222. package/src/styles/system/segmented.css +22 -0
  223. package/src/styles/system/sheet.css +8 -0
  224. package/src/styles/system/shell.css +8 -102
  225. package/src/styles/system/sidebar.css +14 -0
  226. package/src/styles/system/source.css +5 -0
  227. package/src/styles/system/specimens.css +3 -0
  228. package/src/styles/system/stage.css +18 -0
  229. package/src/styles/system/steps.css +51 -0
  230. package/src/styles/system/surfaces.css +8 -104
  231. package/src/styles/system/table.css +23 -0
  232. package/src/styles/system/toc.css +59 -0
  233. package/src/styles/system/tooltip.css +6 -0
  234. package/src/styles/system/tray-code.css +6 -0
  235. package/src/styles/system/tray.css +20 -0
  236. package/src/styles/system/tree.css +15 -0
  237. package/src/styles/system/waterfall.css +14 -0
  238. package/src/virtual.d.ts +5 -1
  239. package/src/blog/article/language.ts +0 -29
@@ -0,0 +1,167 @@
1
+ /* * Cards stand directly on the page ground: no shell around them, so every edge is the card's own 1px
2
+ * contour. A card may hold its figure in a well, 12px in, and nothing deeper. */
3
+ /* The title and description stay together, with a separate illustration to their right. */
4
+ /* * A narrow card cannot spare a 7rem column beside its copy: the title shares a row with a smaller
5
+ * illustration and the description takes the full measure below, so neither wraps a word or two per line. */
6
+ /* * The well's contour is drawn above the figure, so a pane that fills the well never hides it and
7
+ * a pane's own edge never doubles it: every well reads as one 1px line. */
8
+ @layer components {
9
+ .home-bento-frame {
10
+ position: relative;
11
+ }
12
+
13
+ .home-bento-grid {
14
+ display: grid;
15
+ gap: var(--home-gap);
16
+
17
+ @media (--md) {
18
+ gap: 1rem;
19
+ }
20
+ }
21
+
22
+ .home-bento-card {
23
+ position: relative;
24
+ display: flex;
25
+ flex-direction: column;
26
+ min-width: 0;
27
+ border-radius: var(--home-radius-sheet);
28
+ background-color: var(--home-sheet);
29
+ box-shadow: 0 0 0 1px var(--home-hairline), var(--home-elevation-1);
30
+ transition: box-shadow var(--home-base) var(--home-ease);
31
+
32
+ &:hover {
33
+ box-shadow: 0 0 0 1px var(--home-rule), var(--home-elevation-1);
34
+ }
35
+ }
36
+ .home-bento-card-header {
37
+ /* Contain the header only: size containment on the subgrid card collapses auto-height code panes. */
38
+ container: home-card / inline-size;
39
+ padding: 1.75rem 1.5rem 2rem;
40
+
41
+ @media (--sm) {
42
+ padding: 2.25rem 2.25rem 2.5rem;
43
+ }
44
+
45
+ @media (--lg) {
46
+ padding: 2.5rem 2.75rem 2.75rem;
47
+ }
48
+ }
49
+
50
+ .home-bento-card-caption {
51
+ display: grid;
52
+ grid-template-columns: minmax(0, 44ch) 7rem;
53
+ /* In a wide card the copy keeps its measure and the illustration rides the card's right edge. */
54
+ justify-content: space-between;
55
+ align-items: start;
56
+ align-content: start;
57
+ column-gap: 1.5rem;
58
+ }
59
+
60
+ .home-bento-card-copy { min-width: 0; }
61
+
62
+ .home-bento-card-caption > .home-illustration {
63
+ --home-illustration-size: 7rem;
64
+ }
65
+ @container home-card (width < 28rem) {
66
+ .home-bento-card-caption {
67
+ grid-template-columns: minmax(0, 1fr) 4rem;
68
+ align-items: center;
69
+ gap: 0.75rem 1rem;
70
+ }
71
+ .home-bento-card-copy { display: contents; }
72
+ .home-bento-card-title { grid-column: 1; grid-row: 1; }
73
+ .home-bento-card-body { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-top: 0; }
74
+ .home-bento-card-hint { grid-column: 1 / -1; grid-row: 3; margin-top: 0; }
75
+ .home-bento-card-caption > .home-illustration {
76
+ --home-illustration-size: 4rem;
77
+ grid-column: 2;
78
+ grid-row: 1;
79
+ margin-block: 0;
80
+ }
81
+ }
82
+
83
+ @container home-card (width < 16rem) {
84
+ .home-bento-card-caption { grid-template-columns: minmax(0, 1fr) 3rem; column-gap: 0.75rem; }
85
+ .home-bento-card-caption > .home-illustration { --home-illustration-size: 3rem; }
86
+ }
87
+
88
+ @container home-card (width < 12rem) {
89
+ .home-bento-card-caption { grid-template-columns: minmax(0, 1fr); }
90
+ .home-bento-card-caption > .home-illustration { display: none; }
91
+ }
92
+
93
+ @container home-card (width >= 28rem) {
94
+ .home-bento-card-caption { column-gap: 3rem; }
95
+ }
96
+
97
+ .home-bento-card-title {
98
+ min-width: 0;
99
+ margin: 0;
100
+ font-size: var(--home-card-title);
101
+ font-weight: var(--font-weight-regular);
102
+ line-height: 1.25;
103
+ letter-spacing: -0.025em;
104
+ color: var(--home-text);
105
+ text-wrap: balance;
106
+ }
107
+
108
+ .home-bento-card-body {
109
+ min-width: 0;
110
+ max-width: 44ch;
111
+ margin: 0.75rem 0 0;
112
+ font-size: var(--home-body);
113
+ line-height: 1.6;
114
+ color: var(--home-text-quiet);
115
+ text-wrap: pretty;
116
+ }
117
+
118
+ .home-bento-card-hint {
119
+ margin: 0.75rem 0 0;
120
+ font-size: var(--home-caption);
121
+ line-height: 1.5;
122
+ color: var(--home-text-faint);
123
+ }
124
+
125
+ .home-heading-link {
126
+ color: inherit;
127
+ text-decoration: none;
128
+ text-decoration-thickness: 1px;
129
+ text-underline-offset: 0.2em;
130
+
131
+ &:hover { text-decoration-line: underline; }
132
+
133
+ &:focus-visible {
134
+ border-radius: var(--radius-sm);
135
+ outline: 2px solid var(--home-ink);
136
+ outline-offset: 4px;
137
+ }
138
+ }
139
+ .home-bento-visual {
140
+ position: relative;
141
+ isolation: isolate;
142
+ overflow: hidden;
143
+ margin: auto var(--home-gap) var(--home-gap);
144
+ border-radius: var(--home-radius-well);
145
+ background-color: var(--home-well);
146
+
147
+ &::after {
148
+ position: absolute;
149
+ inset: 0;
150
+ z-index: 20;
151
+ border-radius: inherit;
152
+ box-shadow: var(--home-groove);
153
+ pointer-events: none;
154
+ content: '';
155
+ }
156
+ }
157
+
158
+ .home-bento-visual-top {
159
+ margin-top: 0;
160
+ }
161
+ }
162
+
163
+ @layer components { @media (forced-colors: active) { .home-bento-card { outline: 1px solid CanvasText; } } }
164
+
165
+ @layer components {
166
+ .home-page:lang(zh) .home-bento-card-body { text-wrap: balance; }
167
+ }
@@ -420,7 +420,7 @@
420
420
  * Han prose breaks between any two characters, so pretty wrapping still leaves a last line of two characters.
421
421
  * Short leads and card descriptions balance their lines instead.
422
422
  */
423
- .home-page:lang(zh) :is(.home-section-body, .home-bento-card-body) {
423
+ .home-page:lang(zh) .home-section-body {
424
424
  text-wrap: balance;
425
425
  }
426
426
 
package/src/home/hero.css CHANGED
@@ -238,6 +238,11 @@
238
238
  color: var(--home-text);
239
239
  text-wrap: balance;
240
240
  overflow-wrap: anywhere;
241
+
242
+ /* Keep Japanese phrases and Korean words intact; very narrow enlarged text can still wrap in an emergency. */
243
+ &:is(:lang(ja), :lang(ko)) {
244
+ word-break: keep-all;
245
+ }
241
246
  }
242
247
 
243
248
  .home-display-line {