@master/internal-site 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/astro.mjs +9 -1
- package/package.json +9 -8
- package/src/benchmarks/BenchmarkChart.astro +8 -8
- package/src/benchmarks/BenchmarkDelta.astro +2 -3
- package/src/benchmarks/BenchmarkFigure.astro +1 -1
- package/src/benchmarks/BenchmarkMetricTable.astro +10 -10
- package/src/benchmarks/BenchmarkScrollRegion.svelte +2 -2
- package/src/benchmarks/BenchmarkStatus.astro +2 -3
- package/src/benchmarks/utils.ts +1 -9
- package/src/css/NamespaceUtilityTable.astro +11 -11
- package/src/css/ThemeNumberVariableTable.astro +14 -14
- package/src/demo/Demo.svelte +2 -2
- package/src/demo/DemoAsset.astro +3 -3
- package/src/demo/DemoBadge.svelte +3 -3
- package/src/demo/DemoContainer.svelte +2 -2
- package/src/demo/DemoControls.svelte +1 -1
- package/src/demo/DemoCopyButton.svelte +1 -1
- package/src/demo/DemoFeatureSupport.svelte +3 -4
- package/src/demo/DemoIndex.astro +1 -1
- package/src/demo/DemoMotion.svelte +2 -2
- package/src/demo/DemoSurface.svelte +2 -2
- package/src/demo/DemoTokenTable.astro +6 -6
- package/src/demo/DemoViewport.svelte +11 -11
- package/src/demo/foundations/FoundationDialog.astro +1 -1
- package/src/demo/foundations/FoundationMedia.astro +2 -2
- package/src/demo/foundations/FoundationShrink.astro +2 -2
- package/src/demo/foundations/Palette.svelte +1 -1
- package/src/demo/reference/document.ts +3 -2
- package/src/demo/specimens/background-attachment.json +3 -3
- package/src/demo/specimens/background-origin.json +9 -9
- package/src/demo/specimens/clip-path.json +3 -3
- package/src/demo/specimens/counter-set.json +8 -8
- package/src/demo/specimens/filter.json +6 -6
- package/src/demo/specimens/grid-auto-flow.json +3 -3
- package/src/demo/specimens/grid-template-areas.json +5 -5
- package/src/demo/specimens/grid-template-columns.json +6 -6
- package/src/demo/specimens/justify-content.json +8 -8
- package/src/demo/specimens/mask-image.json +3 -3
- package/src/demo/specimens/object-position.json +6 -6
- package/src/demo/specimens/place-content.json +4 -4
- package/src/demo/specimens/scroll-snap-stop.json +3 -3
- package/src/demo/specimens/shape-margin.json +5 -5
- package/src/demo/specimens/shape-outside.json +3 -3
- package/src/demo/specimens/transform-origin.json +3 -3
- package/src/docs-shell/common/locales.js +1 -1
- package/src/docs-shell/components/CodeCopyButton.astro +1 -1
- package/src/docs-shell/components/DocHeader.svelte +3 -3
- package/src/docs-shell/components/DocMenuButton.svelte +4 -5
- package/src/docs-shell/components/DocVersionSelect.svelte +2 -2
- package/src/docs-shell/components/DocumentCodeExampleView.astro +2 -2
- package/src/docs-shell/components/DocumentCodeTable.astro +5 -5
- package/src/docs-shell/components/DocumentCopyButton.svelte +1 -1
- package/src/docs-shell/components/DocumentFileTree.astro +2 -2
- package/src/docs-shell/components/DocumentFlow.astro +2 -2
- package/src/docs-shell/components/DocumentIllustration.astro +2 -2
- package/src/docs-shell/components/DocumentNamespaceTable.astro +6 -6
- package/src/docs-shell/components/DocumentParameters.astro +2 -2
- package/src/docs-shell/components/ExpandContent.svelte +1 -1
- package/src/docs-shell/components/LanguageButton.svelte +2 -2
- package/src/docs-shell/components/LanguageSelect.svelte +2 -2
- package/src/docs-shell/components/NotFound.astro +1 -1
- package/src/docs-shell/components/PageNavs.astro +4 -4
- package/src/docs-shell/components/SearchButton.svelte +1 -1
- package/src/docs-shell/components/SearchDialog.svelte +4 -1
- package/src/docs-shell/components/SearchDialogPanel.svelte +8 -8
- package/src/docs-shell/components/Segments.svelte +2 -1
- package/src/docs-shell/components/ThemeSelect.svelte +2 -2
- package/src/docs-shell/components/markdown/Table.astro +3 -3
- package/src/docs-shell/components/markdown/TableCell.astro +4 -0
- package/src/docs-shell/components/markdown/TableHead.astro +4 -0
- package/src/docs-shell/components/markdown/TableRow.astro +4 -0
- package/src/docs-shell/components/markdown-components.ts +6 -0
- package/src/docs-shell/contexts/search.ts +11 -1
- package/src/docs-shell/contexts/theme-mode.svelte.ts +1 -0
- package/src/docs-shell/data/legacy-design-routes.json +176 -0
- package/src/docs-shell/remark/markdown-components.js +2 -2
- package/src/docs-shell/utils/snackbar.ts +1 -1
- package/src/examples/article-transitions/page.astro +0 -1
- package/src/examples/components/ArticleTransitionScene.svelte +4 -4
- package/src/examples/components/ViewTransitionScene.svelte +1 -1
- package/src/examples/view-transitions/page.astro +0 -1
- package/src/layouts/Document.astro +1 -0
- package/src/scripts/atomic-class-authoring.ts +4 -1
- package/src/scripts/legacy-design-routes.ts +76 -0
- package/src/scripts/style-delivery.mjs +22 -2
- package/src/sections/document.astro +1 -1
- package/src/styles/docs-shell/documentation-search.css +6 -5
- package/src/styles/docs-shell/materials.css +10 -22
- package/src/styles/docs-shell/menu.css +8 -8
- package/src/styles/docs-shell/segments.css +2 -2
- package/src/styles/docs-shell/theme.css +2 -17
- package/src/styles/foundation.css +1 -0
- package/src/styles/site-contract.md +31 -0
- package/src/styles/system/badge-tones.css +4 -0
- package/src/styles/system/badge.ts +2 -0
- package/src/styles/system/browser.css +3 -6
- package/src/styles/system/button-feedback.css +6 -9
- package/src/styles/system/buttons.css +1 -51
- package/src/styles/system/checks.css +4 -18
- package/src/styles/system/controls.css +0 -1
- package/src/styles/system/dialog.css +3 -3
- package/src/styles/system/expand.css +3 -3
- package/src/styles/system/fields.css +7 -23
- package/src/styles/system/header-core.css +10 -10
- package/src/styles/system/kbd.css +1 -4
- package/src/styles/system/mixins.css +2 -2
- package/src/styles/system/pager.css +2 -13
- package/src/styles/system/range.css +1 -12
- package/src/styles/system/search-trigger.css +2 -2
- package/src/styles/system/segmented.css +1 -16
- package/src/styles/system/sheet.css +1 -8
- package/src/styles/system/sheet.ts +2 -0
- package/src/styles/system/sidebar.css +1 -1
- package/src/styles/system/specimens.css +5 -17
- package/src/styles/system/surfaces.css +0 -1
- package/src/styles/system/table-layout.css +12 -0
- package/src/styles/system/table.css +3 -23
- package/src/styles/system/table.ts +4 -0
- package/src/styles/system/tokens.css +48 -63
- package/src/styles/system/tooltip.css +2 -4
- package/src/styles/system/tray-layout.css +20 -0
- package/src/styles/system/tray.css +2 -20
- package/src/styles/system/tray.ts +3 -0
- package/src/demo/DemoScrollArea.svelte +0 -17
- package/src/examples/scene.css +0 -3
- package/src/styles/system/DESIGN.md +0 -128
- package/src/styles/system/menu.css +0 -14
- package/src/styles/system/scroll.css +0 -6
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ First-party Astro and Svelte 5 website framework for Master websites. This packa
|
|
|
4
4
|
|
|
5
5
|
## Ownership
|
|
6
6
|
|
|
7
|
-
Master maintains document layouts, navigation, search, localization, MDX components,
|
|
7
|
+
Master maintains document layouts, navigation, search, localization, MDX components, site composition, UI-backed controls, artwork and demonstration orchestration here. Master CSS maintains its homepage composition, guide/reference content and adapters that read its product data. The organization blog and brand pages live in the Master website, outside this package. Drafts are never packaged.
|
|
8
8
|
|
|
9
9
|
The package imports Master CSS rather than duplicating its compiler or maintaining a parallel CSS implementation. Install the matching Astro, Svelte, Vite and Master CSS toolchain versions declared by your site's lockfile. During RC development, use the exact source-pinned `site` snapshot and its dependency closure; never depend on a moving Git branch.
|
|
10
10
|
|
package/dist/astro.mjs
CHANGED
|
@@ -2311,6 +2311,9 @@ const componentPaths = {
|
|
|
2311
2311
|
img: "Image.svelte",
|
|
2312
2312
|
Image: "Image.svelte",
|
|
2313
2313
|
table: "markdown/Table.astro",
|
|
2314
|
+
th: "markdown/TableHead.astro",
|
|
2315
|
+
td: "markdown/TableCell.astro",
|
|
2316
|
+
tr: "markdown/TableRow.astro",
|
|
2314
2317
|
Code: "Code.astro",
|
|
2315
2318
|
InlineCode: "InlineCode.astro",
|
|
2316
2319
|
PMAction: "PMAction.astro",
|
|
@@ -2325,7 +2328,12 @@ function documentComponents(tree) {
|
|
|
2325
2328
|
visit(tree, (node) => {
|
|
2326
2329
|
if (node.type === "link" || node.type === "linkReference") used.add("a");
|
|
2327
2330
|
if (node.type === "image" || node.type === "imageReference") used.add("img");
|
|
2328
|
-
if (node.type === "table")
|
|
2331
|
+
if (node.type === "table") for (const part of [
|
|
2332
|
+
"table",
|
|
2333
|
+
"th",
|
|
2334
|
+
"td",
|
|
2335
|
+
"tr"
|
|
2336
|
+
]) used.add(part);
|
|
2329
2337
|
if (node.type === "heading" && [2, 3].includes(node.depth)) used.add(`h${node.depth}`);
|
|
2330
2338
|
if (["mdxJsxFlowElement", "mdxJsxTextElement"].includes(node.type) && node.name in componentPaths) used.add(node.name);
|
|
2331
2339
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@master/internal-site",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "First-party Astro and Svelte website framework for Master sites.",
|
|
6
6
|
"engines": {
|
|
@@ -308,14 +308,15 @@
|
|
|
308
308
|
"peerDependencies": {
|
|
309
309
|
"astro": "7.4.2",
|
|
310
310
|
"svelte": "5.57.2",
|
|
311
|
-
"@master/css": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
312
|
-
"@master/css-astro": "^2.0
|
|
311
|
+
"@master/css": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
312
|
+
"@master/css-astro": "^2.1.0",
|
|
313
313
|
"vite": "8.3.5",
|
|
314
|
-
"@master/css-compiler": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
315
|
-
"@master/css-tooling": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
316
|
-
"@master/css-schema": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
317
|
-
"@master/css-preset": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
318
|
-
"@master/css-language-service": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.
|
|
314
|
+
"@master/css-compiler": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
315
|
+
"@master/css-tooling": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
316
|
+
"@master/css-schema": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
317
|
+
"@master/css-preset": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
318
|
+
"@master/css-language-service": "0.0.0 || >=0.0.0-site.1793646900.gdf48b35846c1 <0.0.1 || ^2.1.0",
|
|
319
|
+
"@master/ui": "^0.0.2"
|
|
319
320
|
},
|
|
320
321
|
"dependencies": {
|
|
321
322
|
"@astrojs/svelte": "^9.1.2",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
3
3
|
import { localizeBenchmarkChart } from './localization'
|
|
4
|
-
import '@master/internal-site/styles/system/table.
|
|
4
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
5
5
|
import ExpandContent from '@master/internal-site/components/ExpandContent.svelte'
|
|
6
6
|
import BenchmarkBars from '@master/internal-site/benchmarks/BenchmarkBars.astro'
|
|
7
7
|
import BenchmarkMetricTable from '@master/internal-site/benchmarks/BenchmarkMetricTable.astro'
|
|
@@ -36,18 +36,18 @@ const chart = localizeBenchmarkChart(Astro.props.chart, t)
|
|
|
36
36
|
{chart.kind === 'data-table' && (
|
|
37
37
|
<ExpandContent client:idle={{ timeout: 500 }}>
|
|
38
38
|
{/* Preserve keyboard access to wide result tables. */}
|
|
39
|
-
<div class="ui-table" data-numeric-from={chart.numericFrom} role="region" aria-label={chart.label} tabindex="0">
|
|
40
|
-
<table>
|
|
39
|
+
<div class="ui-table sheet sheet-flat" data-numeric-from={chart.numericFrom} role="region" aria-label={chart.label} tabindex="0">
|
|
40
|
+
<table class="table">
|
|
41
41
|
<thead>
|
|
42
|
-
<tr>
|
|
43
|
-
{chart.headers.map((header) => <th>{header}</th>)}
|
|
42
|
+
<tr class="table-row">
|
|
43
|
+
{chart.headers.map((header) => <th class="table-heading">{header}</th>)}
|
|
44
44
|
</tr>
|
|
45
45
|
</thead>
|
|
46
46
|
<tbody>
|
|
47
47
|
{chart.rows.map(([rowHeader, ...cells]) => (
|
|
48
|
-
<tr>
|
|
49
|
-
<th>{rowHeader}</th>
|
|
50
|
-
{cells.map((cell) => <td>{cell}</td>)}
|
|
48
|
+
<tr class="table-row">
|
|
49
|
+
<th class="table-heading">{rowHeader}</th>
|
|
50
|
+
{cells.map((cell) => <td class="table-cell">{cell}</td>)}
|
|
51
51
|
</tr>
|
|
52
52
|
))}
|
|
53
53
|
</tbody>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/
|
|
2
|
+
import '@master/ui/components/badge.css'
|
|
3
3
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
4
|
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
5
5
|
import type { BenchmarkTone } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
-
import { benchmarkStatusTones } from '@master/internal-site/benchmarks/utils.ts'
|
|
7
6
|
|
|
8
7
|
interface Props {
|
|
9
8
|
value?: unknown
|
|
@@ -17,7 +16,7 @@ const { value, label, tone = 'neutral', class: className } = Astro.props
|
|
|
17
16
|
const { t } = siteOf(Astro)
|
|
18
17
|
---
|
|
19
18
|
|
|
20
|
-
<span class={className
|
|
19
|
+
<span class:list={['badge', className, { 'badge-success': tone === 'good', 'badge-warning': tone === 'warn', 'badge-danger': tone === 'bad' }]}>
|
|
21
20
|
<strong>{Astro.slots.has('default') ? <slot /> : <RenderNode node={value} />}</strong>
|
|
22
21
|
{label && <span>{typeof label === 'string' ? t(label) : <RenderNode node={label} />}</span>}
|
|
23
22
|
</span>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/tray.
|
|
2
|
+
import '@master/internal-site/styles/system/tray.ts'
|
|
3
3
|
import '@master/internal-site/styles/system/tray-code.css'
|
|
4
4
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
5
5
|
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/table.
|
|
2
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
3
3
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
4
|
import BenchmarkStatus from '@master/internal-site/benchmarks/BenchmarkStatus.astro'
|
|
5
5
|
import type { BenchmarkMetric } from '@master/internal-site/benchmarks/types.ts'
|
|
@@ -16,21 +16,21 @@ const hasDetails = metrics.some((metric) => metric.detail)
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
{/* Preserve keyboard access to wide metric tables. */}
|
|
19
|
-
<div class="ui-table" role="region" aria-label={t(label)} tabindex="0">
|
|
20
|
-
<table>
|
|
19
|
+
<div class="ui-table sheet sheet-flat" role="region" aria-label={t(label)} tabindex="0">
|
|
20
|
+
<table class="table">
|
|
21
21
|
<thead>
|
|
22
|
-
<tr>
|
|
23
|
-
<th scope="col">{t('Metric')}</th>
|
|
24
|
-
<th scope="col">{t('Value')}</th>
|
|
25
|
-
{hasDetails && <th scope="col">{t('Detail')}</th>}
|
|
22
|
+
<tr class="table-row">
|
|
23
|
+
<th class="table-heading" scope="col">{t('Metric')}</th>
|
|
24
|
+
<th class="table-heading" scope="col">{t('Value')}</th>
|
|
25
|
+
{hasDetails && <th class="table-heading" scope="col">{t('Detail')}</th>}
|
|
26
26
|
</tr>
|
|
27
27
|
</thead>
|
|
28
28
|
<tbody>
|
|
29
29
|
{metrics.map((metric) => (
|
|
30
|
-
<tr>
|
|
31
|
-
<th scope="row">{t(metric.label)}</th>
|
|
30
|
+
<tr class="table-row">
|
|
31
|
+
<th class="table-heading" scope="row">{t(metric.label)}</th>
|
|
32
32
|
<td class="benchmark-value">{metric.value} <BenchmarkStatus tone={metric.tone} /></td>
|
|
33
|
-
{hasDetails && <td>{metric.detail && t(metric.detail)}</td>}
|
|
33
|
+
{hasDetails && <td class="table-cell">{metric.detail && t(metric.detail)}</td>}
|
|
34
34
|
</tr>
|
|
35
35
|
))}
|
|
36
36
|
</tbody>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import '@master/internal-site/styles/system/table.
|
|
2
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
3
3
|
|
|
4
4
|
import type { Snippet } from 'svelte'
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<!-- Scroll regions need a tab stop; arrow keys operate this region without intercepting children. -->
|
|
24
24
|
<!-- svelte-ignore a11y_no_noninteractive_tabindex, a11y_no_noninteractive_element_interactions -->
|
|
25
|
-
<div class="ui-table" data-density="compact" role="region" aria-label={title} aria-describedby={descriptionId} tabindex="0" onkeydown={scrollWithKeyboard}>
|
|
25
|
+
<div class="ui-table sheet sheet-flat" data-density="compact" role="region" aria-label={title} aria-describedby={descriptionId} tabindex="0" onkeydown={scrollWithKeyboard}>
|
|
26
26
|
<span class="sr-only" id={descriptionId}>Use arrow keys to scroll the table.</span>
|
|
27
27
|
{@render children?.()}
|
|
28
28
|
</div>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
3
3
|
const { t } = siteOf(Astro)
|
|
4
|
-
import '@master/
|
|
4
|
+
import '@master/ui/components/badge.css'
|
|
5
5
|
import type { BenchmarkTone } from '@master/internal-site/benchmarks/types.ts'
|
|
6
|
-
import { benchmarkStatusTones } from '@master/internal-site/benchmarks/utils.ts'
|
|
7
6
|
|
|
8
7
|
interface Props {
|
|
9
8
|
tone?: BenchmarkTone
|
|
@@ -15,4 +14,4 @@ const names: Record<Exclude<BenchmarkTone, 'neutral'>, string> = { good: 'Good',
|
|
|
15
14
|
const { tone } = Astro.props
|
|
16
15
|
---
|
|
17
16
|
|
|
18
|
-
{tone && tone !== 'neutral' && <span class=
|
|
17
|
+
{tone && tone !== 'neutral' && <span class:list={['badge badge-dot badge-sm', { 'badge-success': tone === 'good', 'badge-warning': tone === 'warn', 'badge-danger': tone === 'bad' }]}>{t(names[tone])}</span>}
|
package/src/benchmarks/utils.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BenchmarkColor
|
|
1
|
+
import type { BenchmarkColor } from '@master/internal-site/benchmarks/types.ts'
|
|
2
2
|
|
|
3
3
|
/** Series take the teaching hues that never read as a status first: blue, violet, then neutral. */
|
|
4
4
|
export const benchmarkColors: BenchmarkColor[] = ['blue', 'violet', 'neutral', 'yellow', 'green']
|
|
@@ -18,14 +18,6 @@ export function benchmarkTone(color: BenchmarkColor) {
|
|
|
18
18
|
return benchmarkTones[color]
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
/** Status of a measured value, never a series color. */
|
|
22
|
-
export const benchmarkStatusTones: Record<BenchmarkTone, 'neutral' | 'green' | 'amber' | 'red'> = {
|
|
23
|
-
neutral: 'neutral',
|
|
24
|
-
good: 'green',
|
|
25
|
-
warn: 'amber',
|
|
26
|
-
bad: 'red'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
21
|
export function clampPercent(value: number, max: number) {
|
|
30
22
|
if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) return 0
|
|
31
23
|
return Math.max(0, Math.min(100, value / max * 100))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/table.
|
|
2
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
3
3
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
4
|
import { uniqueId } from '@master/internal-site/utils/unique-id'
|
|
5
5
|
import InlineCode from '@master/internal-site/components/InlineCode.astro'
|
|
@@ -25,23 +25,23 @@ const hasDescriptions = groups.some((group) => group.description)
|
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
{/* The table's narrow overflow region must be focusable for native keyboard scrolling. */}
|
|
28
|
-
<div class="ui-table" role="region" aria-labelledby={captionId} tabindex="0">
|
|
29
|
-
<table>
|
|
28
|
+
<div class="ui-table sheet sheet-flat" role="region" aria-labelledby={captionId} tabindex="0">
|
|
29
|
+
<table class="table">
|
|
30
30
|
<caption id={captionId} class="sr-only">{t('Utility groups table')}</caption>
|
|
31
31
|
<thead>
|
|
32
|
-
<tr>
|
|
33
|
-
<th scope="col">{t('Group')}</th>
|
|
34
|
-
<th scope="col">{t('Utility keys')}</th>
|
|
35
|
-
{hasDescriptions && <th scope="col">{t('Description')}</th>}
|
|
32
|
+
<tr class="table-row">
|
|
33
|
+
<th class="table-heading" scope="col">{t('Group')}</th>
|
|
34
|
+
<th class="table-heading" scope="col">{t('Utility keys')}</th>
|
|
35
|
+
{hasDescriptions && <th class="table-heading" scope="col">{t('Description')}</th>}
|
|
36
36
|
</tr>
|
|
37
37
|
</thead>
|
|
38
38
|
<tbody>
|
|
39
39
|
{
|
|
40
40
|
groups.map((group) => (
|
|
41
|
-
<tr>
|
|
42
|
-
<th scope="row">{t(group.label)}</th>
|
|
43
|
-
<td>{group.keys.map((key, index) => <span><InlineCode code={key} />{index !== group.keys.length - 1 && ', '}</span>)}</td>
|
|
44
|
-
{hasDescriptions && <td>{typeof group.description === 'string' ? t(group.description) : <RenderNode node={group.description} />}</td>}
|
|
41
|
+
<tr class="table-row">
|
|
42
|
+
<th class="table-heading" scope="row">{t(group.label)}</th>
|
|
43
|
+
<td class="table-cell">{group.keys.map((key, index) => <span><InlineCode code={key} />{index !== group.keys.length - 1 && ', '}</span>)}</td>
|
|
44
|
+
{hasDescriptions && <td class="table-cell">{typeof group.description === 'string' ? t(group.description) : <RenderNode node={group.description} />}</td>}
|
|
45
45
|
</tr>
|
|
46
46
|
))
|
|
47
47
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/table.
|
|
2
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
3
3
|
import { siteOf } from '@master/internal-site/astro/site-context'
|
|
4
4
|
import { uniqueId } from '@master/internal-site/utils/unique-id'
|
|
5
5
|
import InlineCode from '@master/internal-site/components/InlineCode.astro'
|
|
@@ -27,28 +27,28 @@ const referenceUnit = entries.every(({ unit }) => unit === 'rem') ? 'px' : 'rem'
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
29
|
{/* Numeric tables scroll within the document column and need native keyboard access. */}
|
|
30
|
-
<div class="ui-table" role="region" aria-labelledby={captionId} tabindex="0">
|
|
31
|
-
<table>
|
|
30
|
+
<div class="ui-table sheet sheet-flat" role="region" aria-labelledby={captionId} tabindex="0">
|
|
31
|
+
<table class="table">
|
|
32
32
|
<caption id={captionId} class="sr-only">{t(namespace === 'breakpoint' ? 'Viewport breakpoints' : 'Numeric theme variables')}</caption>
|
|
33
33
|
<thead>
|
|
34
|
-
<tr>
|
|
35
|
-
<th scope="col">{t(namespace === 'breakpoint' ? 'Query' : 'Token')}</th>
|
|
36
|
-
<th scope="col">{t(namespace === 'breakpoint' ? 'Minimum width' : 'Value')}</th>
|
|
37
|
-
{referenceUnits && <th scope="col" data-align="end">{referenceUnit}</th>}
|
|
38
|
-
{hasSpacingRepresentation && <th scope="col">{t('Representation')}</th>}
|
|
34
|
+
<tr class="table-row">
|
|
35
|
+
<th class="table-heading" scope="col">{t(namespace === 'breakpoint' ? 'Query' : 'Token')}</th>
|
|
36
|
+
<th class="table-heading" scope="col">{t(namespace === 'breakpoint' ? 'Minimum width' : 'Value')}</th>
|
|
37
|
+
{referenceUnits && <th class="table-heading" scope="col" data-align="end">{referenceUnit}</th>}
|
|
38
|
+
{hasSpacingRepresentation && <th class="table-heading" scope="col">{t('Representation')}</th>}
|
|
39
39
|
{hasDescriptions && <th scope="col" class="(min-width:12rem)">{t('Description')}</th>}
|
|
40
40
|
</tr>
|
|
41
41
|
</thead>
|
|
42
42
|
<tbody>
|
|
43
43
|
{
|
|
44
44
|
entries.map((entry) => (
|
|
45
|
-
<tr>
|
|
46
|
-
<th scope="row"><InlineCode code={namespace === 'breakpoint' ? `@${entry.key}` : `--${variablePrefix}-${entry.key}`} /></th>
|
|
47
|
-
<td><InlineCode code={entry.value} /></td>
|
|
48
|
-
{referenceUnits && <td data-align="end">{referenceUnit === 'px' ? formatPx(entry.px) : formatRem(entry.rem)}</td>}
|
|
45
|
+
<tr class="table-row">
|
|
46
|
+
<th class="table-heading" scope="row"><InlineCode code={namespace === 'breakpoint' ? `@${entry.key}` : `--${variablePrefix}-${entry.key}`} /></th>
|
|
47
|
+
<td class="table-cell"><InlineCode code={entry.value} /></td>
|
|
48
|
+
{referenceUnits && <td class="table-cell" data-align="end">{referenceUnit === 'px' ? formatPx(entry.px) : formatRem(entry.rem)}</td>}
|
|
49
49
|
{/* The hatched width is the measured space itself. */}
|
|
50
|
-
{hasSpacingRepresentation && <td><span aria-hidden="true" class="ui-preview" style={{ width: entry.value, background: 'var(--ui-hatch)' }} /></td>}
|
|
51
|
-
{hasDescriptions && <td>{t(descriptions?.[entry.key])}</td>}
|
|
50
|
+
{hasSpacingRepresentation && <td class="table-cell"><span aria-hidden="true" class="ui-preview" style={{ width: entry.value, background: 'var(--ui-hatch)' }} /></td>}
|
|
51
|
+
{hasDescriptions && <td class="table-cell">{t(descriptions?.[entry.key])}</td>}
|
|
52
52
|
</tr>
|
|
53
53
|
))
|
|
54
54
|
}
|
package/src/demo/Demo.svelte
CHANGED
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
<script lang="ts">
|
|
33
33
|
import '@master/internal-site/styles/system/stage.css'
|
|
34
|
-
import '@master/internal-site/styles/system/tray.
|
|
34
|
+
import '@master/internal-site/styles/system/tray.ts'
|
|
35
35
|
import '@master/internal-site/styles/system/tray-code.css'
|
|
36
36
|
|
|
37
37
|
import '@master/internal-site/styles/demo.css'
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
{#snippet node(value: DemoNode, translate = false)}{#if typeof value === 'function'}{@render value()}{:else}{translate ? t(value) : value}{/if}{/snippet}
|
|
51
51
|
|
|
52
|
-
<figure {...props} class={['ui-tray', frameClassName]}>{#if head}<figcaption class="ui-tray-head">
|
|
52
|
+
<figure {...props} class={['tray ui-tray', frameClassName]}>{#if head}<figcaption class="ui-tray-head">
|
|
53
53
|
{#if title || description}<div>
|
|
54
54
|
{#if title}<p class="ui-tray-title">{t(title)}</p>{/if}
|
|
55
55
|
{#if description}<p class="ui-tray-description">{@render node(description, true)}</p>{/if}
|
package/src/demo/DemoAsset.astro
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
import '@master/internal-site/styles/interface.css'
|
|
3
|
-
import '@master/
|
|
3
|
+
import '@master/ui/components/badge.css'
|
|
4
4
|
import IconDownload from '@tabler/icons-svelte-runes/icons/download'
|
|
5
5
|
import Demo from './Demo.svelte'
|
|
6
6
|
import Image from '@master/internal-site/components/Image.svelte'
|
|
@@ -30,8 +30,8 @@ const { t } = siteOf(Astro)
|
|
|
30
30
|
<Demo title={title} description={description} background={surface === 'transparent' ? 'checkerboard' : 'plain'} class={surface === 'transparent' ? undefined : surface} data-asset={surface}>
|
|
31
31
|
<Fragment slot="caption">
|
|
32
32
|
<span class="flex flex-wrap items-center justify-between gap-sm">
|
|
33
|
-
<span class="
|
|
34
|
-
<a href={src} download class="
|
|
33
|
+
<span class="badge badge-sm">{format}</span>
|
|
34
|
+
<a href={src} download class="btn btn-sm" data-size="sm" aria-label={t('Download {title} ({format})').replace('{title}', t(title)).replace('{format}', format)}>
|
|
35
35
|
<IconDownload aria-hidden="true" />
|
|
36
36
|
{t('Download {format}').replace('{format}', format)}
|
|
37
37
|
</a>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import '@master/internal-site/styles/system/
|
|
2
|
+
import '@master/internal-site/styles/system/badge.ts'
|
|
3
3
|
import type { Snippet } from 'svelte'
|
|
4
4
|
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
5
|
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
-
import {
|
|
6
|
+
import type { DemoTone } from '@master/internal-site/demo/tone.ts'
|
|
7
7
|
|
|
8
8
|
/** An inline category or state; keep it outside measured layouts. */
|
|
9
9
|
let { tone: value = 'neutral', size = 'md', variant = 'soft', class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLSpanElement>, 'style'> & {
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
} = $props()
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
|
-
<span {...props}
|
|
18
|
+
<span {...props} class={['badge', className, { 'badge-sm': size === 'sm', 'badge-dot': variant === 'dot', 'badge-info': value === 'blue' || value === 'violet', 'badge-success': value === 'green', 'badge-warning': value === 'amber', 'badge-danger': value === 'red', 'demo-badge-violet': value === 'violet' }]} style={styleText(style)}>{@render children?.()}</span>
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
|
|
42
42
|
{#snippet controls()}
|
|
43
43
|
<label class="ui-label" data-case="as-is" for={id}>{t('Container')}</label>
|
|
44
|
-
<input {id} class="
|
|
44
|
+
<input {id} class="slider" type="range" min={minimumWidth} max={maxWidth} step="1" disabled={!ready} {value}
|
|
45
45
|
style:--value={`${((value - minimumWidth) / range) * 100}%`} style:width="128px" style:max-width="100%"
|
|
46
46
|
oninput={event => { width = Number(event.currentTarget.value) }} />
|
|
47
|
-
<button type="button" class="
|
|
47
|
+
<button type="button" class="btn btn-sm" data-size="sm" disabled={!ready} onclick={() => { width = undefined }}>{t('Fit')}</button>
|
|
48
48
|
<output class="ui-label" data-case="as-is">{ready ? t('{width} px · viewport unchanged').replace('{width}', String(measured)) : t('Measuring container…')}</output>
|
|
49
49
|
{/snippet}
|
|
50
50
|
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
} = $props()
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<div {...props} role="group" aria-label={t(label)} class={[variant === 'segmented' ? '
|
|
20
|
+
<div {...props} role="group" aria-label={t(label)} class={[variant === 'segmented' ? 'segmented' : 'flex flex-wrap items-center gap-xs', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
{#snippet button()}
|
|
45
|
-
<button data-size={className ? undefined : 'sm'} {...props} type="button" aria-label={t(label)} class={className ?? '
|
|
45
|
+
<button data-size={className ? undefined : 'sm'} {...props} type="button" aria-label={t(label)} class={className ?? 'btn btn-sm'} style={styleText(style)} aria-busy={busy} onclick={copy}>
|
|
46
46
|
{#if icon === undefined}<IconCopy aria-hidden="true" />{:else if icon}{@render icon()}{/if}{@render children?.()}
|
|
47
47
|
</button>
|
|
48
48
|
{/snippet}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import '@master/internal-site/styles/system/inline-code.css'
|
|
3
3
|
|
|
4
|
-
import '@master/
|
|
4
|
+
import '@master/ui/components/badge.css'
|
|
5
5
|
import { getSite } from '@master/internal-site/site'
|
|
6
6
|
const { t } = getSite()
|
|
7
7
|
import { onMount } from 'svelte'
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
|
|
17
17
|
<p class="flex flex-wrap items-center gap-xs m(0)" data-supported={supported ?? 'unknown'}>
|
|
18
18
|
<code class="ui-inline-code">{condition}</code>
|
|
19
|
-
<span class="
|
|
20
|
-
|
|
21
|
-
</span>
|
|
19
|
+
<span hidden={supported !== true}><span class="badge badge-dot badge-success">{t('Supported')}</span></span>
|
|
20
|
+
<span hidden={supported === true}><span class="badge badge-dot">{supported === null ? t('Checking…') : t('Not supported')}</span></span>
|
|
22
21
|
</p>
|
package/src/demo/DemoIndex.astro
CHANGED
|
@@ -21,6 +21,6 @@ const { label, groups } = Astro.props
|
|
|
21
21
|
<nav class="grid gap-md" aria-label={t(label)}>
|
|
22
22
|
{groups.map(group => <div class="grid gap-xs">
|
|
23
23
|
<p class="m(0) ui-label">{t(group.title)}</p>
|
|
24
|
-
<ul class="flex flex-wrap gap-2xs m(0) p(0) (list-style:none)">{group.links.map(link => <li><a class="
|
|
24
|
+
<ul class="flex flex-wrap gap-2xs m(0) p(0) (list-style:none)">{group.links.map(link => <li><a class="btn btn-sm" data-size="sm" href={link.href}>{t(link.label)}</a></li>)}</ul>
|
|
25
25
|
</div>)}
|
|
26
26
|
</nav>
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
<div class="grid gap-md w-full">
|
|
36
36
|
<div bind:this={element} data-playback={playing ? 'playing' : 'paused'}>{@render children?.()}</div>
|
|
37
37
|
<div class="ui-player" role="group" aria-label={t('Animation controls')} data-state={playing ? 'playing' : 'paused'}>
|
|
38
|
-
<button type="button" class="
|
|
38
|
+
<button type="button" class="btn btn-sm" data-size="sm" onclick={() => control(playing ? 'pause' : 'play')}>
|
|
39
39
|
{#if playing}<IconPlayerPause aria-hidden="true" />{:else}<IconPlayerPlay aria-hidden="true" />{/if}{playing ? t('Pause') : t('Play')}
|
|
40
40
|
</button>
|
|
41
|
-
<button type="button" class="
|
|
41
|
+
<button type="button" class="btn btn-sm btn-quiet" data-size="sm" data-variant="quiet" onclick={() => control('restart')}><IconRefresh aria-hidden="true" />{t('Replay')}</button>
|
|
42
42
|
<span class="ui-player-time"><output>{playing ? 'Playing' : 'Paused'}</output></span>
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import '@master/internal-site/styles/system/sheet.
|
|
2
|
+
import '@master/internal-site/styles/system/sheet.ts'
|
|
3
3
|
|
|
4
4
|
import '@master/internal-site/styles/system/specimens.css'
|
|
5
5
|
import type { Snippet } from 'svelte'
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
} = $props()
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
<div {...props} data-elevation={elevation === 'flat' ? 'flat' : '1'} class={['ui-sheet', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
17
|
+
<div {...props} data-elevation={elevation === 'flat' ? 'flat' : '1'} class={['sheet ui-sheet', elevation === 'flat' ? 'sheet-flat' : 'sheet-raised', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { siteOf } from '@master/internal-site/astro/site-context.ts'
|
|
3
3
|
const { t } = siteOf(Astro)
|
|
4
|
-
import '@master/internal-site/styles/system/table.
|
|
4
|
+
import '@master/internal-site/styles/system/table.ts'
|
|
5
5
|
import InlineCode from '@master/internal-site/components/InlineCode.astro'
|
|
6
6
|
import RenderNode from '@master/internal-site/components/RenderNode.astro'
|
|
7
7
|
|
|
@@ -24,13 +24,13 @@ const { rows, descriptionTitle = 'Role' } = Astro.props
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
26
|
{/* Narrow token inventories need native keyboard scrolling. */}
|
|
27
|
-
<div class="ui-table" role="region" aria-label={t('{label} token table').replace('{label}', t(descriptionTitle))} tabindex="0"><table>
|
|
28
|
-
<thead><tr><th scope="col">{t('Token / class')}</th><th scope="col" class="(min-width:12rem)">{t(descriptionTitle)}</th></tr></thead>
|
|
29
|
-
<tbody>{rows.map(({ token, utilities, value, description, preview }) => <tr>
|
|
30
|
-
<td>
|
|
27
|
+
<div class="ui-table sheet sheet-flat" role="region" aria-label={t('{label} token table').replace('{label}', t(descriptionTitle))} tabindex="0"><table class="table">
|
|
28
|
+
<thead><tr class="table-row"><th class="table-heading" scope="col">{t('Token / class')}</th><th scope="col" class="(min-width:12rem)">{t(descriptionTitle)}</th></tr></thead>
|
|
29
|
+
<tbody>{rows.map(({ token, utilities, value, description, preview }) => <tr class="table-row">
|
|
30
|
+
<td class="table-cell">
|
|
31
31
|
<div class="whitespace-nowrap">{preview != null && <RenderNode node={preview} />}<code>{token}</code></div>
|
|
32
32
|
{utilities.length > 0 && <div class="flex flex-wrap gap-xs mt-xs">{utilities.map(utility => <InlineCode class="whitespace-nowrap" code={utility} />)}</div>}
|
|
33
33
|
</td>
|
|
34
|
-
<td>{value && <div class="mb-xs"><code>{value}</code></div>}<RenderNode node={description} /></td>
|
|
34
|
+
<td class="table-cell">{value && <div class="mb-xs"><code>{value}</code></div>}<RenderNode node={description} /></td>
|
|
35
35
|
</tr>)}</tbody>
|
|
36
36
|
</table></div>
|
|
@@ -290,9 +290,9 @@
|
|
|
290
290
|
</script>
|
|
291
291
|
|
|
292
292
|
<!-- The controls belong to the example, not to the document it shows: they sit on the tray between the stage and the source. -->
|
|
293
|
-
<div class="ui-browser" data-variant={chrome ? undefined : 'plain'} data-ready={ready}>
|
|
294
|
-
{#if chrome}<div class="ui-browser-bar" aria-hidden="true"><span class="
|
|
295
|
-
<div bind:this={body} class="ui-browser-body">
|
|
293
|
+
<div class="window window-flat ui-browser" data-variant={chrome ? undefined : 'plain'} data-ready={ready}>
|
|
294
|
+
{#if chrome}<div class="window-bar ui-browser-bar" aria-hidden="true"><span class="window-controls" /></div>{/if}
|
|
295
|
+
<div bind:this={body} class="window-body ui-browser-body">
|
|
296
296
|
<div class="ui-browser-viewport" style:width={width ? `${width}px` : `min(100%, ${maxWidth}px)`}>
|
|
297
297
|
<iframe bind:this={frame} title={t(title)} srcdoc={source} {src} loading="lazy" data-ready={ready} data-sizing={sizing}
|
|
298
298
|
style:height={`${sizing === 'content' ? contentHeight ?? height : height}px`} onload={load}></iframe>
|
|
@@ -303,29 +303,29 @@
|
|
|
303
303
|
{#if responsive || motion || print || theme || Boolean(inspect?.length)}
|
|
304
304
|
<div class="ui-browser-tools" role="group" aria-label={t('{label} controls').replace('{label}', t(title))}>
|
|
305
305
|
{#if responsive}
|
|
306
|
-
{#if widthPresets?.length}<div class="
|
|
307
|
-
{#each widthPresets as preset (preset.label)}<button type="button" disabled={!ready}
|
|
306
|
+
{#if widthPresets?.length}<div class="segmented" role="group" aria-label={t('{label} presets').replace('{label}', t(rangeLabel))}>
|
|
307
|
+
{#each widthPresets as preset (preset.label)}<button class="segmented-item" type="button" disabled={!ready}
|
|
308
308
|
aria-pressed={width === preset.width} onclick={() => { width = preset.width }}>{t(preset.label)}</button>{/each}
|
|
309
309
|
</div>{/if}
|
|
310
310
|
<span class="ui-browser-range">
|
|
311
311
|
<label class="ui-label" data-case="as-is" for={widthId}>{t(rangeLabel)}</label>
|
|
312
|
-
<input id={widthId} class="
|
|
312
|
+
<input id={widthId} class="slider" disabled={!ready} type="range" min={range.min} max={range.max} step="1" value={range.value}
|
|
313
313
|
style:--value={`${((range.value - range.min) / Math.max(1, range.max - range.min)) * 100}%`}
|
|
314
314
|
oninput={event => { width = Number(event.currentTarget.value) }} />
|
|
315
315
|
{#if ready}<output class="ui-browser-size" for={widthId}>{fitWidth} px</output>{/if}
|
|
316
316
|
</span>
|
|
317
|
-
<button type="button" disabled={!ready} class="
|
|
317
|
+
<button type="button" disabled={!ready} class="btn btn-sm" data-size="sm" onclick={() => { width = undefined }}>{t('Fit')}</button>
|
|
318
318
|
{/if}
|
|
319
|
-
{#if theme}<button type="button" disabled={!ready} class="
|
|
319
|
+
{#if theme}<button type="button" disabled={!ready} class="btn btn-sm" data-size="sm" aria-pressed={isDark} title={t('Toggle dark theme')} onclick={() => { dark = !isDark }}>
|
|
320
320
|
{#if isDark}<IconMoon aria-hidden="true" />{:else}<IconSun aria-hidden="true" />{/if}{t('Theme')}
|
|
321
321
|
</button>{/if}
|
|
322
322
|
{#if motion}
|
|
323
|
-
<button type="button" disabled={!ready} class="
|
|
323
|
+
<button type="button" disabled={!ready} class="btn btn-sm" data-size="sm" onclick={() => animate(playing ? 'pause' : 'play')}>
|
|
324
324
|
{#if playing}<IconPlayerPause aria-hidden="true" />{:else}<IconPlayerPlay aria-hidden="true" />{/if}{playing ? t('Pause') : t('Play')}
|
|
325
325
|
</button>
|
|
326
|
-
<button type="button" disabled={!ready} class="
|
|
326
|
+
<button type="button" disabled={!ready} class="btn btn-sm btn-quiet" data-size="sm" data-variant="quiet" onclick={() => animate('restart')}><IconRefresh aria-hidden="true" />{t('Replay')}</button>
|
|
327
327
|
{/if}
|
|
328
|
-
{#if print}<button type="button" disabled={!ready} class="
|
|
328
|
+
{#if print}<button type="button" disabled={!ready} class="btn btn-sm" data-size="sm" onclick={() => frame?.contentWindow?.print()}><IconPrinter aria-hidden="true" />{t('Print preview')}</button>{/if}
|
|
329
329
|
{#if properties}<output aria-live="polite">{properties}</output>{/if}
|
|
330
330
|
</div>
|
|
331
331
|
{/if}
|
|
@@ -15,4 +15,4 @@ const { title = dialogCopy.title, caption = dialogCopy.caption } = Astro.props
|
|
|
15
15
|
from { translate: 0 0.5rem; opacity: 0; }
|
|
16
16
|
to { translate: 0; opacity: 1; }
|
|
17
17
|
}
|
|
18
|
-
`, html: "<article class=\"p-md r-sm b(1) b-solid b-line-divider bg-surface-raised\"><h2 class=\"m(0) text-lg font-regular\">Collection settings</h2><p class=\"mt-xs mb-md fg-text-muted\">Open a native dialog to preview its entrance.</p><button id=\"open\" type=\"button\" class=\"
|
|
18
|
+
`, html: "<article class=\"p-md r-sm b(1) b-solid b-line-divider bg-surface-raised\"><h2 class=\"m(0) text-lg font-regular\">Collection settings</h2><p class=\"mt-xs mb-md fg-text-muted\">Open a native dialog to preview its entrance.</p><button id=\"open\" type=\"button\" class=\"btn\">Open details</button></article>\n<dialog id=\"details\" aria-labelledby=\"dialog-title\" aria-describedby=\"dialog-description\" class=\"(width:calc(100%-32px)) max-w-xs m-auto p-md r-lg b(1) b-solid b-line-divider bg-surface-floating fg-text-body shadow-xl animate-dialog-in@media(screen)@motion-safe\">\n<h2 id=\"dialog-title\" class=\"m(0) text-lg font-regular fg-text-strong\">Collection details</h2><p id=\"dialog-description\" class=\"mt-sm mb-md\">This dialog has a finite entrance. Closing it is immediate.</p><form method=\"dialog\"><button class=\"btn\" autofocus>Close details</button></form>\n</dialog><script>const dialog = document.getElementById('details'); const openButton = document.getElementById('open'); openButton.addEventListener('click', () => dialog.showModal()); dialog.addEventListener('close', () => openButton.focus());</script>", caption }} />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/sheet.
|
|
2
|
+
import '@master/internal-site/styles/system/sheet.ts'
|
|
3
3
|
import DemoContainer from '@master/internal-site/demo/DemoContainer.svelte'
|
|
4
4
|
import DemoLabel from '@master/internal-site/demo/DemoLabel.svelte'
|
|
5
5
|
import DemoMedia from '@master/internal-site/demo/DemoMedia.svelte'
|
|
@@ -16,7 +16,7 @@ const media: ComponentProps<typeof DemoMedia> = {
|
|
|
16
16
|
|
|
17
17
|
<DemoContainer client:idle={{ timeout: 500 }} title="A component follows its container" data-foundation="media" caption="Below 28rem of container width, the media stacks. At 28rem it keeps a 9rem width beside flexible text.">
|
|
18
18
|
<div class="container-inline">
|
|
19
|
-
<article class="flex flex-col items-start gap-md p-md flex-row@container(width>=28rem) ui-sheet"
|
|
19
|
+
<article class="flex flex-col items-start gap-md p-md flex-row@container(width>=28rem) sheet sheet-raised ui-sheet">
|
|
20
20
|
<DemoMedia {...media} />
|
|
21
21
|
<div class="(flex:1) min-w(0)">
|
|
22
22
|
<DemoLabel>Collection / 024</DemoLabel>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
import '@master/internal-site/styles/system/sheet.
|
|
2
|
+
import '@master/internal-site/styles/system/sheet.ts'
|
|
3
3
|
import DemoContainer from '@master/internal-site/demo/DemoContainer.svelte'
|
|
4
4
|
import DemoItem from '@master/internal-site/demo/DemoItem.svelte'
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<DemoContainer client:idle={{ timeout: 500 }} title="Keep long content within its cap" data-foundation="shrink" caption="The row stops at sm. The flexible text region can shrink below its content width.">
|
|
8
|
-
<article class="flex gap-md w-full max-w-sm mx-auto p-md ui-sheet"
|
|
8
|
+
<article class="flex gap-md w-full max-w-sm mx-auto p-md sheet sheet-raised ui-sheet">
|
|
9
9
|
<DemoItem class="grid shrink(0) (place-content:center) (height:2.5rem) (width:2.5rem) text-sm font-mono">FN</DemoItem>
|
|
10
10
|
<div class="(flex:1) min-w(0)">
|
|
11
11
|
<div class="text-sm font-semibold">Project archive</div>
|