@master/internal-site 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +66 -2
- package/dist/astro.d.mts +3 -0
- package/dist/astro.mjs +510 -0
- package/dist/config.d.mts +64 -0
- package/dist/config.mjs +10 -0
- package/package.json +384 -4
- package/src/astro/Page.astro +12 -0
- package/src/astro/content-pages.ts +75 -0
- package/src/astro/index.ts +124 -0
- package/src/astro/module-id.ts +4 -0
- package/src/astro/propagated-assets.ts +29 -0
- package/src/astro/route-paths.ts +78 -0
- package/src/astro/routes.template.ts +110 -0
- package/src/astro/server-styles.ts +26 -0
- package/src/astro/site-context.ts +27 -0
- package/src/astro/source-url.ts +22 -0
- package/src/astro/svelte-renderer.ts +45 -0
- package/src/astro/svg-markup.ts +23 -0
- package/src/benchmarks/BenchmarkBarRows.astro +34 -0
- package/src/benchmarks/BenchmarkBars.astro +14 -0
- package/src/benchmarks/BenchmarkChart.astro +53 -0
- package/src/benchmarks/BenchmarkChartGroup.astro +24 -0
- package/src/benchmarks/BenchmarkDataTable.astro +24 -0
- package/src/benchmarks/BenchmarkDelta.astro +23 -0
- package/src/benchmarks/BenchmarkFigure.astro +30 -0
- package/src/benchmarks/BenchmarkMetricTable.astro +38 -0
- package/src/benchmarks/BenchmarkMetrics.astro +23 -0
- package/src/benchmarks/BenchmarkSampleSummary.astro +30 -0
- package/src/benchmarks/BenchmarkScrollRegion.svelte +27 -0
- package/src/benchmarks/BenchmarkSource.astro +20 -0
- package/src/benchmarks/BenchmarkStackedBars.astro +54 -0
- package/src/benchmarks/BenchmarkStatus.astro +16 -0
- package/src/benchmarks/types.ts +98 -0
- package/src/benchmarks/utils.ts +42 -0
- package/src/blog/BlogAuthors.astro +25 -0
- package/src/blog/article/BlogArticleContents.svelte +24 -0
- package/src/blog/article/BlogArticleEnd.astro +55 -0
- package/src/blog/article/BlogArticleMasthead.astro +61 -0
- package/src/blog/article/language.ts +29 -0
- package/src/blog/article/neighbors.ts +27 -0
- package/src/blog/article/title-lines.astro +14 -0
- package/src/blog/article/title-parts.ts +9 -0
- package/src/components.d.ts +5 -0
- package/src/config.ts +66 -0
- package/src/css/ButtonPreview.astro +22 -0
- package/src/css/ConfiguredExample.astro +15 -0
- package/src/css/NamespaceUtilityTable.astro +50 -0
- package/src/css/StylesheetExample.astro +15 -0
- package/src/css/ThemeNumberVariableTable.astro +57 -0
- package/src/css/configured-example.ts +53 -0
- package/src/css/foundation-data/elevation/shadow-data.ts +52 -0
- package/src/css/foundation-data/sizing/scale-data.ts +37 -0
- package/src/css/foundation-data/specimen-content.ts +10 -0
- package/src/css/foundation-data/specimens.ts +96 -0
- package/src/css/foundation-data/tokens.ts +32 -0
- package/src/css/generate-preset-css.ts +12 -0
- package/src/css/highlight.ts +34 -0
- package/src/css/manifest-utilities.ts +29 -0
- package/src/css/markdown.ts +279 -0
- package/src/css/preset-css.ts +15 -0
- package/src/css/preset-manifest.ts +3 -0
- package/src/css/stylesheet-example.ts +26 -0
- package/src/css/theme-variables.ts +74 -0
- package/src/css/variable-namespace-sources.ts +20 -0
- package/src/demo/Demo.svelte +55 -0
- package/src/demo/DemoAsset.astro +38 -0
- package/src/demo/DemoAxes.svelte +22 -0
- package/src/demo/DemoBadge.svelte +18 -0
- package/src/demo/DemoCatalog.astro +36 -0
- package/src/demo/DemoComparison.svelte +36 -0
- package/src/demo/DemoConfiguredExample.astro +48 -0
- package/src/demo/DemoContainer.svelte +48 -0
- package/src/demo/DemoControls.svelte +16 -0
- package/src/demo/DemoCopyButton.svelte +50 -0
- package/src/demo/DemoCopyGroup.svelte +15 -0
- package/src/demo/DemoExample.astro +27 -0
- package/src/demo/DemoFeatureSupport.svelte +18 -0
- package/src/demo/DemoGeneratedCSS.svelte +8 -0
- package/src/demo/DemoIndex.astro +23 -0
- package/src/demo/DemoInstallation.astro +17 -0
- package/src/demo/DemoItem.svelte +17 -0
- package/src/demo/DemoLabel.svelte +15 -0
- package/src/demo/DemoLegend.svelte +15 -0
- package/src/demo/DemoMeasure.svelte +28 -0
- package/src/demo/DemoMedia.svelte +43 -0
- package/src/demo/DemoMotion.svelte +41 -0
- package/src/demo/DemoPageViewport.astro +17 -0
- package/src/demo/DemoPalette.astro +29 -0
- package/src/demo/DemoPaletteGroups.svelte +15 -0
- package/src/demo/DemoScrollArea.svelte +15 -0
- package/src/demo/DemoStyleComparison.astro +25 -0
- package/src/demo/DemoSurface.svelte +15 -0
- package/src/demo/DemoSwatch.svelte +19 -0
- package/src/demo/DemoThemeComparison.astro +30 -0
- package/src/demo/DemoTokenTable.astro +34 -0
- package/src/demo/DemoViewTransition.astro +18 -0
- package/src/demo/DemoViewport.svelte +324 -0
- package/src/demo/DemoWaterfall.astro +30 -0
- package/src/demo/FoundationBreakpoint.astro +12 -0
- package/src/demo/ProjectStyleExample.astro +13 -0
- package/src/demo/copy-feedback.ts +10 -0
- package/src/demo/demo-waterfall.ts +17 -0
- package/src/demo/drag-readings.ts +20 -0
- package/src/demo/foundations/FoundationAxes.astro +12 -0
- package/src/demo/foundations/FoundationColorRoles.astro +5 -0
- package/src/demo/foundations/FoundationContainerGrid.astro +24 -0
- package/src/demo/foundations/FoundationDialog.astro +14 -0
- package/src/demo/foundations/FoundationElevation.astro +5 -0
- package/src/demo/foundations/FoundationElevationState.astro +5 -0
- package/src/demo/foundations/FoundationHue.astro +5 -0
- package/src/demo/foundations/FoundationLines.astro +5 -0
- package/src/demo/foundations/FoundationMedia.astro +28 -0
- package/src/demo/foundations/FoundationMotion.astro +5 -0
- package/src/demo/foundations/FoundationPalette.astro +8 -0
- package/src/demo/foundations/FoundationRadius.astro +13 -0
- package/src/demo/foundations/FoundationShapes.astro +12 -0
- package/src/demo/foundations/FoundationShrink.astro +14 -0
- package/src/demo/foundations/FoundationSizing.astro +19 -0
- package/src/demo/foundations/FoundationSpecimen.astro +20 -0
- package/src/demo/foundations/FoundationSurfaces.astro +5 -0
- package/src/demo/foundations/FoundationTextHue.astro +5 -0
- package/src/demo/foundations/FoundationTextRoles.astro +5 -0
- package/src/demo/foundations/FoundationTokens.astro +22 -0
- package/src/demo/foundations/FoundationTokensView.astro +65 -0
- package/src/demo/foundations/FoundationTransition.astro +5 -0
- package/src/demo/foundations/FoundationTypeComparison.astro +12 -0
- package/src/demo/foundations/FoundationTypography.astro +5 -0
- package/src/demo/foundations/Palette.svelte +37 -0
- package/src/demo/foundations/ShadowScaleDemo.astro +22 -0
- package/src/demo/illustration-materials.ts +180 -0
- package/src/demo/maintenance-example.ts +62 -0
- package/src/demo/playback.ts +75 -0
- package/src/demo/project-style-examples.ts +128 -0
- package/src/demo/reference/alignment.ts +42 -0
- package/src/demo/reference/animations.ts +30 -0
- package/src/demo/reference/backgrounds.ts +39 -0
- package/src/demo/reference/border-paint.ts +31 -0
- package/src/demo/reference/clipping.ts +26 -0
- package/src/demo/reference/document.ts +55 -0
- package/src/demo/reference/edges.ts +40 -0
- package/src/demo/reference/effects.ts +27 -0
- package/src/demo/reference/flexbox.ts +33 -0
- package/src/demo/reference/frame.css +118 -0
- package/src/demo/reference/grid.ts +42 -0
- package/src/demo/reference/html.ts +40 -0
- package/src/demo/reference/interaction.ts +42 -0
- package/src/demo/reference/layout-html.ts +10 -0
- package/src/demo/reference/layout.ts +102 -0
- package/src/demo/reference/media.ts +29 -0
- package/src/demo/reference/positioning.ts +90 -0
- package/src/demo/reference/scenes.ts +197 -0
- package/src/demo/reference/scrolling.ts +66 -0
- package/src/demo/reference/shapes.ts +22 -0
- package/src/demo/reference/sizing.ts +43 -0
- package/src/demo/reference/source.ts +8 -0
- package/src/demo/reference/text-effects.ts +37 -0
- package/src/demo/reference/text-flow.ts +41 -0
- package/src/demo/reference/transforms.ts +26 -0
- package/src/demo/reference/transitions.ts +24 -0
- package/src/demo/reference/type-specimens.ts +56 -0
- package/src/demo/reference/types.ts +30 -0
- package/src/demo/reference/typography.ts +32 -0
- package/src/demo/specimens/accent-color.json +50 -0
- package/src/demo/specimens/align-items.json +56 -0
- package/src/demo/specimens/animation-delay.json +55 -0
- package/src/demo/specimens/animation-direction.json +49 -0
- package/src/demo/specimens/animation-fill-mode.json +55 -0
- package/src/demo/specimens/animation-iteration-count.json +55 -0
- package/src/demo/specimens/animation-play-state.json +83 -0
- package/src/demo/specimens/animation-timing-function.json +48 -0
- package/src/demo/specimens/appearance.json +44 -0
- package/src/demo/specimens/aspect-ratio.json +28 -0
- package/src/demo/specimens/backdrop-filter.json +44 -0
- package/src/demo/specimens/background-attachment.json +49 -0
- package/src/demo/specimens/background-image.json +25 -0
- package/src/demo/specimens/background-origin.json +36 -0
- package/src/demo/specimens/background-size.json +29 -0
- package/src/demo/specimens/border-collapse.json +45 -0
- package/src/demo/specimens/border-color.json +35 -0
- package/src/demo/specimens/border-image-repeat.json +50 -0
- package/src/demo/specimens/border-image-slice.json +45 -0
- package/src/demo/specimens/border-radius.json +30 -0
- package/src/demo/specimens/box-decoration-break.json +35 -0
- package/src/demo/specimens/box-shadow.json +33 -0
- package/src/demo/specimens/clear.json +77 -0
- package/src/demo/specimens/clip-path.json +38 -0
- package/src/demo/specimens/content.json +27 -0
- package/src/demo/specimens/counter-set.json +31 -0
- package/src/demo/specimens/fill.json +23 -0
- package/src/demo/specimens/filter.json +23 -0
- package/src/demo/specimens/flex-direction.json +27 -0
- package/src/demo/specimens/flex-grow.json +27 -0
- package/src/demo/specimens/font-style.json +23 -0
- package/src/demo/specimens/font-variant-numeric.json +28 -0
- package/src/demo/specimens/grid-auto-columns.json +29 -0
- package/src/demo/specimens/grid-auto-flow.json +37 -0
- package/src/demo/specimens/grid-template-areas.json +34 -0
- package/src/demo/specimens/grid-template-columns.json +36 -0
- package/src/demo/specimens/isolation.json +25 -0
- package/src/demo/specimens/justify-content.json +36 -0
- package/src/demo/specimens/line-height.json +28 -0
- package/src/demo/specimens/list-style-position.json +36 -0
- package/src/demo/specimens/mask-image.json +54 -0
- package/src/demo/specimens/min-width.json +39 -0
- package/src/demo/specimens/mix-blend-mode.json +43 -0
- package/src/demo/specimens/object-fit.json +27 -0
- package/src/demo/specimens/object-position.json +27 -0
- package/src/demo/specimens/opacity.json +37 -0
- package/src/demo/specimens/order.json +28 -0
- package/src/demo/specimens/overflow-wrap.json +26 -0
- package/src/demo/specimens/overflow.json +53 -0
- package/src/demo/specimens/overscroll-behavior.json +29 -0
- package/src/demo/specimens/padding.json +84 -0
- package/src/demo/specimens/place-content.json +31 -0
- package/src/demo/specimens/pointer-events.json +46 -0
- package/src/demo/specimens/position.json +29 -0
- package/src/demo/specimens/resize.json +32 -0
- package/src/demo/specimens/screen-readers.json +37 -0
- package/src/demo/specimens/scroll-padding.json +29 -0
- package/src/demo/specimens/scroll-snap-stop.json +33 -0
- package/src/demo/specimens/shape-image-threshold.json +37 -0
- package/src/demo/specimens/shape-margin.json +40 -0
- package/src/demo/specimens/shape-outside.json +37 -0
- package/src/demo/specimens/stroke-width.json +27 -0
- package/src/demo/specimens/text-fill-color.json +23 -0
- package/src/demo/specimens/text-stroke-width.json +32 -0
- package/src/demo/specimens/touch-action.json +45 -0
- package/src/demo/specimens/transform-box.json +37 -0
- package/src/demo/specimens/transform-origin.json +56 -0
- package/src/demo/specimens/transform-style.json +55 -0
- package/src/demo/specimens/transform.json +47 -0
- package/src/demo/specimens/transition-delay.json +57 -0
- package/src/demo/specimens/transition-duration.json +60 -0
- package/src/demo/specimens/transition-property.json +60 -0
- package/src/demo/specimens/transition-timing-function.json +65 -0
- package/src/demo/specimens/user-drag.json +28 -0
- package/src/demo/specimens/user-select.json +25 -0
- package/src/demo/specimens/vertical-align.json +28 -0
- package/src/demo/specimens/width.json +56 -0
- package/src/demo/specimens/will-change.json +50 -0
- package/src/demo/specimens/writing-mode.json +26 -0
- package/src/demo/specimens/z-index.json +35 -0
- package/src/demo/style.ts +15 -0
- package/src/demo/tone.ts +4 -0
- package/src/demo/useDemoViewTransition.svelte.ts +71 -0
- package/src/docs-shell/common/i18n.config.d.ts +2 -0
- package/src/docs-shell/common/i18n.config.js +13 -0
- package/src/docs-shell/common/svgo.config.d.ts +2 -0
- package/src/docs-shell/common/svgo.config.js +11 -0
- package/src/docs-shell/components/ArticleHeader.astro +65 -0
- package/src/docs-shell/components/ArticleTOC.astro +18 -0
- package/src/docs-shell/components/Callout.astro +26 -0
- package/src/docs-shell/components/Code.astro +25 -0
- package/src/docs-shell/components/CodeCopyButton.astro +25 -0
- package/src/docs-shell/components/CodeTabBar.astro +40 -0
- package/src/docs-shell/components/CodeTabs.astro +53 -0
- package/src/docs-shell/components/CodeView.astro +23 -0
- package/src/docs-shell/components/Do.astro +5 -0
- package/src/docs-shell/components/DoNot.astro +5 -0
- package/src/docs-shell/components/DocArticle.astro +14 -0
- package/src/docs-shell/components/DocHeader.svelte +87 -0
- package/src/docs-shell/components/DocHeading.astro +28 -0
- package/src/docs-shell/components/DocMain.astro +19 -0
- package/src/docs-shell/components/DocMenuButton.svelte +95 -0
- package/src/docs-shell/components/DocSidebar.svelte +62 -0
- package/src/docs-shell/components/DocVersionSelect.svelte +22 -0
- package/src/docs-shell/components/DocWrapper.astro +11 -0
- package/src/docs-shell/components/DocumentAPIIndex.astro +24 -0
- package/src/docs-shell/components/DocumentChoices.astro +24 -0
- package/src/docs-shell/components/DocumentCodeExample.astro +20 -0
- package/src/docs-shell/components/DocumentCodeExampleView.astro +35 -0
- package/src/docs-shell/components/DocumentCodeTable.astro +19 -0
- package/src/docs-shell/components/DocumentComparison.astro +7 -0
- package/src/docs-shell/components/DocumentCopyButton.svelte +41 -0
- package/src/docs-shell/components/DocumentDeclaration.astro +17 -0
- package/src/docs-shell/components/DocumentDeclarationView.astro +12 -0
- package/src/docs-shell/components/DocumentDisclosure.astro +14 -0
- package/src/docs-shell/components/DocumentFileTree.astro +34 -0
- package/src/docs-shell/components/DocumentFlow.astro +27 -0
- package/src/docs-shell/components/DocumentIdentifier.astro +14 -0
- package/src/docs-shell/components/DocumentIllustration.astro +46 -0
- package/src/docs-shell/components/DocumentKeyList.astro +22 -0
- package/src/docs-shell/components/DocumentNamespaceTable.astro +20 -0
- package/src/docs-shell/components/DocumentOptionEntry.astro +15 -0
- package/src/docs-shell/components/DocumentOptionList.astro +11 -0
- package/src/docs-shell/components/DocumentOptions.astro +23 -0
- package/src/docs-shell/components/DocumentParameters.astro +30 -0
- package/src/docs-shell/components/DocumentPrompt.astro +16 -0
- package/src/docs-shell/components/DocumentValueList.astro +25 -0
- package/src/docs-shell/components/DocumentationIndex.svelte +144 -0
- package/src/docs-shell/components/Dropped.astro +21 -0
- package/src/docs-shell/components/ExpandContent.svelte +21 -0
- package/src/docs-shell/components/ExplorerView.astro +37 -0
- package/src/docs-shell/components/FileIcon.astro +123 -0
- package/src/docs-shell/components/Footer.svelte +80 -0
- package/src/docs-shell/components/GeneratedCSS.astro +8 -0
- package/src/docs-shell/components/Header.svelte +121 -0
- package/src/docs-shell/components/HeaderIcon.astro +14 -0
- package/src/docs-shell/components/HeaderNav.svelte +18 -0
- package/src/docs-shell/components/Image.svelte +56 -0
- package/src/docs-shell/components/Info.astro +5 -0
- package/src/docs-shell/components/InlineCode.astro +30 -0
- package/src/docs-shell/components/InteractingIndicator.astro +19 -0
- package/src/docs-shell/components/LanguageButton.svelte +18 -0
- package/src/docs-shell/components/LanguageSelect.svelte +44 -0
- package/src/docs-shell/components/Link.svelte +127 -0
- package/src/docs-shell/components/ModeImg.astro +11 -0
- package/src/docs-shell/components/NotFound.astro +21 -0
- package/src/docs-shell/components/OverviewButtons.astro +36 -0
- package/src/docs-shell/components/PMAction.astro +25 -0
- package/src/docs-shell/components/PackageBadges.astro +39 -0
- package/src/docs-shell/components/PageContent.svelte +38 -0
- package/src/docs-shell/components/PageContentBootstrap.astro +13 -0
- package/src/docs-shell/components/PageContentDisclosure.astro +25 -0
- package/src/docs-shell/components/PageContentList.svelte +70 -0
- package/src/docs-shell/components/PageContentProvider.svelte +15 -0
- package/src/docs-shell/components/PageContentTitle.svelte +16 -0
- package/src/docs-shell/components/PageNavs.astro +40 -0
- package/src/docs-shell/components/PreparedCodeView.astro +12 -0
- package/src/docs-shell/components/RenderNode.astro +16 -0
- package/src/docs-shell/components/RouteLayers.astro +17 -0
- package/src/docs-shell/components/SearchButton.svelte +31 -0
- package/src/docs-shell/components/SearchDialog.svelte +174 -0
- package/src/docs-shell/components/Segments.svelte +62 -0
- package/src/docs-shell/components/Step.astro +13 -0
- package/src/docs-shell/components/StepL.astro +10 -0
- package/src/docs-shell/components/StepR.astro +10 -0
- package/src/docs-shell/components/StepSection.astro +12 -0
- package/src/docs-shell/components/Tab.astro +8 -0
- package/src/docs-shell/components/Tabs.astro +10 -0
- package/src/docs-shell/components/ThemeIcon.astro +19 -0
- package/src/docs-shell/components/ThemeSelect.svelte +20 -0
- package/src/docs-shell/components/TimeAgo.svelte +32 -0
- package/src/docs-shell/components/Translate.astro +14 -0
- package/src/docs-shell/components/Warn.astro +5 -0
- package/src/docs-shell/components/code-props.ts +28 -0
- package/src/docs-shell/components/document-types.ts +119 -0
- package/src/docs-shell/components/markdown/Anchor.astro +5 -0
- package/src/docs-shell/components/markdown/Heading2.astro +5 -0
- package/src/docs-shell/components/markdown/Heading3.astro +5 -0
- package/src/docs-shell/components/markdown/Table.astro +6 -0
- package/src/docs-shell/components/markdown-components.ts +36 -0
- package/src/docs-shell/components/page-content-bootstrap.ts +115 -0
- package/src/docs-shell/components/page-content.svelte.ts +125 -0
- package/src/docs-shell/contexts/search.ts +18 -0
- package/src/docs-shell/contexts/theme-mode.svelte.ts +61 -0
- package/src/docs-shell/data/authors.ts +17 -0
- package/src/docs-shell/data/base-colors.ts +29 -0
- package/src/docs-shell/data/brands.ts +79 -0
- package/src/docs-shell/data/color-names.ts +1 -0
- package/src/docs-shell/data/color-palette.ts +50 -0
- package/src/docs-shell/data/colors.ts +1 -0
- package/src/docs-shell/factories/Page.astro +35 -0
- package/src/docs-shell/factories/create-page.ts +31 -0
- package/src/docs-shell/layouts/BlogArticle.astro +53 -0
- package/src/docs-shell/layouts/Doc.astro +41 -0
- package/src/docs-shell/remark/markdown-components.d.ts +2 -0
- package/src/docs-shell/remark/markdown-components.js +101 -0
- package/src/docs-shell/remark/slug-and-toc.d.ts +2 -0
- package/src/docs-shell/remark/slug-and-toc.js +53 -0
- package/src/docs-shell/scripts/code-tabs-bootstrap.ts +34 -0
- package/src/docs-shell/scripts/code.ts +124 -0
- package/src/docs-shell/scripts/document-anchor.ts +57 -0
- package/src/docs-shell/scripts/document.ts +47 -0
- package/src/docs-shell/site.ts +67 -0
- package/src/docs-shell/types/IllustrationImages.ts +2 -0
- package/src/docs-shell/types/Metadata.ts +17 -0
- package/src/docs-shell/types/Props.ts +9 -0
- package/src/docs-shell/types/StaticImage.ts +6 -0
- package/src/docs-shell/uses/use-selected-preview-syntax.svelte.ts +16 -0
- package/src/docs-shell/utils/anchor.ts +24 -0
- package/src/docs-shell/utils/beautify-css.ts +14 -0
- package/src/docs-shell/utils/beautify-html.ts +12 -0
- package/src/docs-shell/utils/beautify-js.ts +9 -0
- package/src/docs-shell/utils/create-highlighter.ts +50 -0
- package/src/docs-shell/utils/css-modern-grammar.ts +339 -0
- package/src/docs-shell/utils/documentation-search.ts +68 -0
- package/src/docs-shell/utils/generate-metadata.ts +60 -0
- package/src/docs-shell/utils/group-page-content.ts +10 -0
- package/src/docs-shell/utils/head.ts +72 -0
- package/src/docs-shell/utils/highlight-code-core.ts +146 -0
- package/src/docs-shell/utils/highlight-code.ts +1 -0
- package/src/docs-shell/utils/highlighted-code-text.ts +27 -0
- package/src/docs-shell/utils/i18n-pathname.ts +98 -0
- package/src/docs-shell/utils/i18n.ts +12 -0
- package/src/docs-shell/utils/is-date-within-seven-days.ts +16 -0
- package/src/docs-shell/utils/isBrowser.ts +1 -0
- package/src/docs-shell/utils/isInteractOutside.ts +16 -0
- package/src/docs-shell/utils/markdown-tree.ts +22 -0
- package/src/docs-shell/utils/metadata.ts +25 -0
- package/src/docs-shell/utils/prepared-code.ts +21 -0
- package/src/docs-shell/utils/resolve-heading.d.ts +1 -0
- package/src/docs-shell/utils/resolve-heading.js +19 -0
- package/src/docs-shell/utils/search-pages.ts +271 -0
- package/src/docs-shell/utils/slot-text.ts +15 -0
- package/src/docs-shell/utils/snackbar.ts +39 -0
- package/src/docs-shell/utils/syntax-theme.ts +53 -0
- package/src/docs-shell/utils/transformer-notation-word-mark.ts +146 -0
- package/src/docs-shell/utils/unique-id.ts +11 -0
- package/src/examples/article-transitions/page.astro +7 -0
- package/src/examples/article-transitions/transitions.css +10 -0
- package/src/examples/components/ArticleTransitionScene.svelte +83 -0
- package/src/examples/components/ViewTransitionScene.svelte +31 -0
- package/src/examples/images/article-aurora.jpg +0 -0
- package/src/examples/images/article-coast.jpg +0 -0
- package/src/examples/images/article-grid.jpg +0 -0
- package/src/examples/images/article-studio.jpg +0 -0
- package/src/examples/layout-system/page.astro +59 -0
- package/src/examples/scene.css +3 -0
- package/src/examples/view-transitions/page.astro +7 -0
- package/src/examples/view-transitions/transitions.css +9 -0
- package/src/home/HeroCanvas.svelte +617 -0
- package/src/home/HomeAction.astro +17 -0
- package/src/home/HomeBentoFrame.astro +9 -0
- package/src/home/HomeBentoGrid.astro +9 -0
- package/src/home/HomeCompactIcon.astro +15 -0
- package/src/home/HomeFooter.svelte +63 -0
- package/src/home/HomeIllustration.astro +17 -0
- package/src/home/HomeIllustrationArt.svelte +15 -0
- package/src/home/HomeLamp.svelte +18 -0
- package/src/home/design.css +532 -0
- package/src/home/footer.css +225 -0
- package/src/home/hero-shaders.ts +460 -0
- package/src/home/hero-title-mask.ts +175 -0
- package/src/home/hero.css +547 -0
- package/src/home/home-illustration.ts +5 -0
- package/src/home/home-lamp.ts +225 -0
- package/src/home/home.css +1077 -0
- package/src/home/icons/agent-check-preview-apply.svg +24 -0
- package/src/home/icons/agent-clients.svg +26 -0
- package/src/home/icons/agent-project-tools.svg +23 -0
- package/src/home/icons/artwork/agent-check-preview-apply-dark.webp +0 -0
- package/src/home/icons/artwork/agent-check-preview-apply-light.webp +0 -0
- package/src/home/icons/artwork/agent-clients-dark.webp +0 -0
- package/src/home/icons/artwork/agent-clients-light.webp +0 -0
- package/src/home/icons/artwork/agent-edit-file-dark.webp +0 -0
- package/src/home/icons/artwork/agent-edit-file-light.webp +0 -0
- package/src/home/icons/artwork/agent-project-tools-dark.webp +0 -0
- package/src/home/icons/artwork/agent-project-tools-light.webp +0 -0
- package/src/home/icons/artwork/design-cascade-layers-dark.webp +0 -0
- package/src/home/icons/artwork/design-cascade-layers-light.webp +0 -0
- package/src/home/icons/artwork/design-layout-motion-dark.webp +0 -0
- package/src/home/icons/artwork/design-layout-motion-light.webp +0 -0
- package/src/home/icons/artwork/design-p3-gamut-dark.webp +0 -0
- package/src/home/icons/artwork/design-p3-gamut-light.webp +0 -0
- package/src/home/icons/artwork/design-theme-modes-dark.webp +0 -0
- package/src/home/icons/artwork/design-theme-modes-light.webp +0 -0
- package/src/home/icons/artwork/design-theme-tokens-dark.webp +0 -0
- package/src/home/icons/artwork/design-theme-tokens-light.webp +0 -0
- package/src/home/icons/artwork/editor-color-tools-dark.webp +0 -0
- package/src/home/icons/artwork/editor-color-tools-light.webp +0 -0
- package/src/home/icons/artwork/editor-focused-highlighting-dark.webp +0 -0
- package/src/home/icons/artwork/editor-focused-highlighting-light.webp +0 -0
- package/src/home/icons/artwork/editor-hover-inspection-dark.webp +0 -0
- package/src/home/icons/artwork/editor-hover-inspection-light.webp +0 -0
- package/src/home/icons/artwork/editor-manifest-completions-dark.webp +0 -0
- package/src/home/icons/artwork/editor-manifest-completions-light.webp +0 -0
- package/src/home/icons/artwork/lint-class-order-dark.webp +0 -0
- package/src/home/icons/artwork/lint-class-order-light.webp +0 -0
- package/src/home/icons/artwork/lint-conflicting-classes-dark.webp +0 -0
- package/src/home/icons/artwork/lint-conflicting-classes-light.webp +0 -0
- package/src/home/icons/artwork/lint-fix-previews-dark.webp +0 -0
- package/src/home/icons/artwork/lint-fix-previews-light.webp +0 -0
- package/src/home/icons/artwork/lint-invalid-classes-dark.webp +0 -0
- package/src/home/icons/artwork/lint-invalid-classes-light.webp +0 -0
- package/src/home/icons/artwork/lint-strict-vocabulary-dark.webp +0 -0
- package/src/home/icons/artwork/lint-strict-vocabulary-light.webp +0 -0
- package/src/home/icons/artwork/lint-theme-tokens-dark.webp +0 -0
- package/src/home/icons/artwork/lint-theme-tokens-light.webp +0 -0
- package/src/home/icons/artwork/mcp-apply-preview-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-apply-preview-light.webp +0 -0
- package/src/home/icons/artwork/mcp-css-compare-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-css-compare-light.webp +0 -0
- package/src/home/icons/artwork/mcp-inspect-class-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-inspect-class-light.webp +0 -0
- package/src/home/icons/artwork/mcp-lint-project-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-lint-project-light.webp +0 -0
- package/src/home/icons/artwork/mcp-manifest-query-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-manifest-query-light.webp +0 -0
- package/src/home/icons/artwork/mcp-preview-fixes-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-preview-fixes-light.webp +0 -0
- package/src/home/icons/artwork/mcp-render-css-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-render-css-light.webp +0 -0
- package/src/home/icons/artwork/mcp-scan-project-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-scan-project-light.webp +0 -0
- package/src/home/icons/artwork/mcp-trace-class-dark.webp +0 -0
- package/src/home/icons/artwork/mcp-trace-class-light.webp +0 -0
- package/src/home/icons/artwork/render-progressive-dark.webp +0 -0
- package/src/home/icons/artwork/render-progressive-light.webp +0 -0
- package/src/home/icons/artwork/render-runtime-dark.webp +0 -0
- package/src/home/icons/artwork/render-runtime-light.webp +0 -0
- package/src/home/icons/artwork/render-static-dark.webp +0 -0
- package/src/home/icons/artwork/render-static-light.webp +0 -0
- package/src/home/icons/artwork/section-ai-agents-dark.webp +0 -0
- package/src/home/icons/artwork/section-ai-agents-light.webp +0 -0
- package/src/home/icons/artwork/section-css-size-dark.webp +0 -0
- package/src/home/icons/artwork/section-css-size-light.webp +0 -0
- package/src/home/icons/artwork/section-design-system-dark.webp +0 -0
- package/src/home/icons/artwork/section-design-system-light.webp +0 -0
- package/src/home/icons/artwork/section-editor-dark.webp +0 -0
- package/src/home/icons/artwork/section-editor-light.webp +0 -0
- package/src/home/icons/artwork/section-lint-dark.webp +0 -0
- package/src/home/icons/artwork/section-lint-light.webp +0 -0
- package/src/home/icons/artwork/section-rendering-dark.webp +0 -0
- package/src/home/icons/artwork/section-rendering-light.webp +0 -0
- package/src/home/icons/artwork/section-workflow-dark.webp +0 -0
- package/src/home/icons/artwork/section-workflow-light.webp +0 -0
- package/src/home/icons/artwork/source.json +303 -0
- package/src/home/icons/artwork/workflow-integrations-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-integrations-light.webp +0 -0
- package/src/home/icons/artwork/workflow-monorepo-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-monorepo-light.webp +0 -0
- package/src/home/icons/artwork/workflow-route-styles-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-route-styles-light.webp +0 -0
- package/src/home/icons/artwork/workflow-trace-change-dark.webp +0 -0
- package/src/home/icons/artwork/workflow-trace-change-light.webp +0 -0
- package/src/home/icons/artwork.css +4 -0
- package/src/home/icons/artwork.ts +131 -0
- package/src/home/icons/catalog.ts +381 -0
- package/src/home/icons/design-cascade-layers.svg +32 -0
- package/src/home/icons/design-layout-motion.svg +16 -0
- package/src/home/icons/design-p3-gamut.svg +12 -0
- package/src/home/icons/design-theme-modes.svg +12 -0
- package/src/home/icons/design-theme-tokens.svg +20 -0
- package/src/home/icons/editor-color-tools.svg +18 -0
- package/src/home/icons/editor-focused-highlighting.svg +15 -0
- package/src/home/icons/editor-hover-inspection.svg +19 -0
- package/src/home/icons/editor-manifest-completions.svg +24 -0
- package/src/home/icons/lint-class-order-compact.svg +15 -0
- package/src/home/icons/lint-class-order.svg +28 -0
- package/src/home/icons/lint-conflicting-classes-compact.svg +11 -0
- package/src/home/icons/lint-conflicting-classes.svg +24 -0
- package/src/home/icons/lint-fix-previews-compact.svg +9 -0
- package/src/home/icons/lint-fix-previews.svg +19 -0
- package/src/home/icons/lint-invalid-classes-compact.svg +7 -0
- package/src/home/icons/lint-invalid-classes.svg +17 -0
- package/src/home/icons/lint-strict-vocabulary-compact.svg +8 -0
- package/src/home/icons/lint-strict-vocabulary.svg +16 -0
- package/src/home/icons/lint-theme-tokens-compact.svg +7 -0
- package/src/home/icons/lint-theme-tokens.svg +14 -0
- package/src/home/icons/mcp-apply-preview-compact.svg +9 -0
- package/src/home/icons/mcp-apply-preview.svg +18 -0
- package/src/home/icons/mcp-css-compare-compact.svg +9 -0
- package/src/home/icons/mcp-css-compare.svg +20 -0
- package/src/home/icons/mcp-inspect-class-compact.svg +9 -0
- package/src/home/icons/mcp-inspect-class.svg +18 -0
- package/src/home/icons/mcp-lint-project-compact.svg +14 -0
- package/src/home/icons/mcp-lint-project.svg +30 -0
- package/src/home/icons/mcp-manifest-query-compact.svg +14 -0
- package/src/home/icons/mcp-manifest-query.svg +27 -0
- package/src/home/icons/mcp-preview-fixes-compact.svg +9 -0
- package/src/home/icons/mcp-preview-fixes.svg +15 -0
- package/src/home/icons/mcp-render-css-compact.svg +13 -0
- package/src/home/icons/mcp-render-css.svg +30 -0
- package/src/home/icons/mcp-scan-project-compact.svg +7 -0
- package/src/home/icons/mcp-scan-project.svg +13 -0
- package/src/home/icons/mcp-trace-class-compact.svg +11 -0
- package/src/home/icons/mcp-trace-class.svg +24 -0
- package/src/home/icons/render-progressive.svg +17 -0
- package/src/home/icons/render-runtime.svg +23 -0
- package/src/home/icons/render-static.svg +29 -0
- package/src/home/icons/section-ai-agents.svg +24 -0
- package/src/home/icons/section-css-size.svg +13 -0
- package/src/home/icons/section-design-system.svg +24 -0
- package/src/home/icons/section-editor.svg +14 -0
- package/src/home/icons/section-lint.svg +14 -0
- package/src/home/icons/section-rendering.svg +30 -0
- package/src/home/icons/section-workflow.svg +22 -0
- package/src/home/icons/workflow-integrations.svg +15 -0
- package/src/home/icons/workflow-monorepo.svg +27 -0
- package/src/home/icons/workflow-route-styles.svg +24 -0
- package/src/home/icons/workflow-trace-change.svg +21 -0
- package/src/layouts/Document.astro +71 -0
- package/src/public/brand/v2/logo/mark/master-mark-small-on-dark.svg +1 -0
- package/src/public/brand/v2/logo/master-css/master-css-horizontal-on-dark.svg +1 -0
- package/src/public/brand/v2/logo/master-css/master-css-horizontal-on-light.svg +1 -0
- package/src/public/demo/border-grid.svg +7 -0
- package/src/public/demo/landscape.svg +1 -0
- package/src/public/demo/marker.svg +1 -0
- package/src/public/demo/mask.svg +1 -0
- package/src/public/fonts/Geist-Medium.ttf +0 -0
- package/src/public/fonts/Geist-Regular.ttf +0 -0
- package/src/public/fonts/GeistVariable.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Bold.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Medium.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-Regular.woff2 +0 -0
- package/src/public/fonts/IBMPlexMono-SemiBold.woff2 +0 -0
- package/src/public/fonts/index.css +40 -0
- package/src/public/icons/csharp.svg +1 -0
- package/src/public/icons/css.svg +1 -0
- package/src/public/icons/eslint.svg +1 -0
- package/src/public/icons/folder.svg +12 -0
- package/src/public/icons/html.svg +1 -0
- package/src/public/icons/php.svg +1 -0
- package/src/public/icons/sass.svg +1 -0
- package/src/public/icons/storybook.svg +1 -0
- package/src/public/icons/visualstudiocode.svg +41 -0
- package/src/public/images/authors/aron.jpg +0 -0
- package/src/public/images/authors/benseage.jpg +0 -0
- package/src/public/images/authors/joy.jpg +0 -0
- package/src/public/images/authors/lola.jpg +0 -0
- package/src/public/images/authors/miles.jpg +0 -0
- package/src/public/images/bootstrap.svg +23 -0
- package/src/public/images/build-tools/rsbuild.svg +1 -0
- package/src/public/images/build-tools/rspack.svg +1 -0
- package/src/public/images/build-tools/vite.svg +15 -0
- package/src/public/images/build-tools/webpack.svg +10 -0
- package/src/public/images/cdns/esm-sh.svg +1 -0
- package/src/public/images/chevron-left.svg +4 -0
- package/src/public/images/cover-bg.jpg +0 -0
- package/src/public/images/emotion.svg +1 -0
- package/src/public/images/frameworks/angular.svg +29 -0
- package/src/public/images/frameworks/astro.svg +4 -0
- package/src/public/images/frameworks/blazor.svg +22 -0
- package/src/public/images/frameworks/express.svg +1 -0
- package/src/public/images/frameworks/laravel.svg +8 -0
- package/src/public/images/frameworks/line-liff.svg +1 -0
- package/src/public/images/frameworks/lit.svg +1 -0
- package/src/public/images/frameworks/nextjs.svg +16 -0
- package/src/public/images/frameworks/nuxtjs.svg +3 -0
- package/src/public/images/frameworks/rails.svg +1 -0
- package/src/public/images/frameworks/react.svg +8 -0
- package/src/public/images/frameworks/remix.svg +5 -0
- package/src/public/images/frameworks/shopify.svg +1 -0
- package/src/public/images/frameworks/svelte.svg +6 -0
- package/src/public/images/frameworks/tanstack.svg +1 -0
- package/src/public/images/frameworks/vuejs.svg +11 -0
- package/src/public/images/frameworks/wordpress.svg +1 -0
- package/src/public/images/mui.svg +1 -0
- package/src/public/images/styled-components.svg +4 -0
- package/src/public/images/tailwindcss.svg +1 -0
- package/src/scripts/bundler-imports.ts +25 -0
- package/src/scripts/static-social.ts +333 -0
- package/src/scripts/write-if-changed.ts +26 -0
- package/src/sections/blog.astro +11 -0
- package/src/sections/design-system.astro +14 -0
- package/src/sections/document.astro +8 -0
- package/src/sections/examples.astro +6 -0
- package/src/sections/guide.astro +26 -0
- package/src/sections/home.astro +7 -0
- package/src/sections/page.astro +12 -0
- package/src/styles/base.css +57 -0
- package/src/styles/benchmarks.css +20 -0
- package/src/styles/blog-article.css +670 -0
- package/src/styles/blog-materials.css +399 -0
- package/src/styles/blog.css +568 -0
- package/src/styles/demo.css +30 -0
- package/src/styles/design-system.css +15 -0
- package/src/styles/docs-shell/code.css +61 -0
- package/src/styles/docs-shell/docs.css +79 -0
- package/src/styles/docs-shell/documentation-search.css +42 -0
- package/src/styles/docs-shell/footer.css +38 -0
- package/src/styles/docs-shell/header.css +69 -0
- package/src/styles/docs-shell/materials.css +25 -0
- package/src/styles/docs-shell/menu.css +19 -0
- package/src/styles/docs-shell/not-found.css +10 -0
- package/src/styles/docs-shell/page-content.css +37 -0
- package/src/styles/docs-shell/prose.css +89 -0
- package/src/styles/docs-shell/segments.css +13 -0
- package/src/styles/docs-shell/steps.css +39 -0
- package/src/styles/docs-shell/syntax-theme.css +18 -0
- package/src/styles/docs-shell/theme.css +68 -0
- package/src/styles/docs-shell/wrapper.css +10 -0
- package/src/styles/document-comparison.css +7 -0
- package/src/styles/documentation-illustration.css +34 -0
- package/src/styles/documentation-index.css +100 -0
- package/src/styles/documents.css +4 -0
- package/src/styles/documents.ts +2 -0
- package/src/styles/foundation.css +4 -0
- package/src/styles/globals.css +2 -0
- package/src/styles/interface.css +3 -0
- package/src/styles/interface.ts +2 -0
- package/src/styles/site.ts +2 -0
- package/src/styles/system/DESIGN.md +108 -0
- package/src/styles/system/buttons.css +51 -0
- package/src/styles/system/code.css +85 -0
- package/src/styles/system/controls.css +110 -0
- package/src/styles/system/data.css +134 -0
- package/src/styles/system/mixins.css +7 -0
- package/src/styles/system/prose.css +75 -0
- package/src/styles/system/shell.css +102 -0
- package/src/styles/system/specimens.css +98 -0
- package/src/styles/system/surfaces.css +104 -0
- package/src/styles/system/tokens.css +136 -0
- package/src/utils/cloudflare-image-loader.js +85 -0
- package/src/virtual.d.ts +36 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Code from '@master/internal-site/components/Code.astro'
|
|
3
|
+
import CodeTabs from '@master/internal-site/components/CodeTabs.astro'
|
|
4
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
5
|
+
import DemoGeneratedCSS from '@master/internal-site/demo/DemoGeneratedCSS.svelte'
|
|
6
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
7
|
+
import { demoDocument } from '@master/internal-site/demo/reference/document.ts'
|
|
8
|
+
import { configuredExampleCSS, configuredMarkupClasses } from '@master/internal-site/css/configured-example.ts'
|
|
9
|
+
|
|
10
|
+
export interface DemoConfiguredExampleProps {
|
|
11
|
+
name: string
|
|
12
|
+
title: string
|
|
13
|
+
source: string
|
|
14
|
+
/** Trusted site-authored markup; never pass user-provided HTML. */
|
|
15
|
+
html: string
|
|
16
|
+
caption: string
|
|
17
|
+
theme?: boolean
|
|
18
|
+
code?: boolean
|
|
19
|
+
/** Render generated utilities inside a real, declarative shadow root. */
|
|
20
|
+
shadow?: boolean
|
|
21
|
+
responsive?: boolean
|
|
22
|
+
/** The lesson is a container, not the viewport: no browser chrome, and the range is named for what it sizes. */
|
|
23
|
+
container?: boolean
|
|
24
|
+
motion?: boolean
|
|
25
|
+
widthPresets?: readonly { label: string; width: number }[]
|
|
26
|
+
}
|
|
27
|
+
type Props = DemoConfiguredExampleProps
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* One tray: the preview, its CSS and markup, and the closed generated stylesheet share the same literal source.
|
|
31
|
+
* The CSS is beautified: MDX strips up to two spaces from each line of a multi-line attribute literal.
|
|
32
|
+
*/
|
|
33
|
+
const { name, title, source, html, caption, theme, code = true, shadow = false, responsive, container = false, motion, widthPresets } = Astro.props
|
|
34
|
+
const section = { page: 'project-styles', id: name, title, html: [html], css: source, classes: [], classLists: [], highlighted: [] }
|
|
35
|
+
const generated = configuredExampleCSS(source, configuredMarkupClasses(html))
|
|
36
|
+
const preview = shadow ? `<div data-demo-shadow><template shadowrootmode="open"><style>${generated.replaceAll('</style', '<\\/style')}</style>${html}</template></div>` : html
|
|
37
|
+
const document = demoDocument(section, { html: preview, caption, bodyClass: 'p-md p(8)@media(width<240px)', motion })
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<Demo title={title} caption={caption} frame="none" data-project-style={name}>
|
|
41
|
+
{code && <Fragment slot="source">
|
|
42
|
+
{source.trim()
|
|
43
|
+
? <CodeTabs tabs={[{ name: 'CSS', lang: 'css', beautify: true, code: source }, { name: 'HTML', lang: 'html', beautify: true, code: html }]} />
|
|
44
|
+
: <Code lang="html" beautify code={html} />}
|
|
45
|
+
<DemoGeneratedCSS><Code lang="css" beautify code={generated} /></DemoGeneratedCSS>
|
|
46
|
+
</Fragment>}
|
|
47
|
+
<DemoViewport client:idle={{ timeout: 500 }} title={title} document={document} theme={theme} responsive={responsive} chrome={container ? false : undefined} rangeLabel={container ? 'Container' : undefined} widthPresets={widthPresets} motion={motion} sizing="content" />
|
|
48
|
+
</Demo>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import Demo, { type DemoNode } from '@master/internal-site/demo/Demo.svelte'
|
|
6
|
+
|
|
7
|
+
/** One tray whose tools change a real wrapper's width; children own their query container and layout. */
|
|
8
|
+
let { children, title, caption, maxWidth = 720, ...props }: Omit<HTMLAttributes<HTMLElement>, 'title' | 'style' | 'children'> & {
|
|
9
|
+
children?: Snippet, title: string, caption?: DemoNode, maxWidth?: number
|
|
10
|
+
} = $props()
|
|
11
|
+
let width = $state<number>()
|
|
12
|
+
let measured = $state(480)
|
|
13
|
+
let minimumWidth = $state(240)
|
|
14
|
+
let ready = $state(false)
|
|
15
|
+
let element = $state<HTMLDivElement>()
|
|
16
|
+
const id = $props.id()
|
|
17
|
+
$effect(() => {
|
|
18
|
+
if (!element) return
|
|
19
|
+
const target = element
|
|
20
|
+
const stage = target.parentElement!
|
|
21
|
+
const limit = maxWidth
|
|
22
|
+
const observer = new ResizeObserver(() => {
|
|
23
|
+
measured = Math.round(target.getBoundingClientRect().width)
|
|
24
|
+
const style = getComputedStyle(stage)
|
|
25
|
+
const available = stage.clientWidth - parseFloat(style.paddingLeft) - parseFloat(style.paddingRight)
|
|
26
|
+
minimumWidth = Math.min(240, Math.round(available), limit)
|
|
27
|
+
ready = true
|
|
28
|
+
})
|
|
29
|
+
observer.observe(target)
|
|
30
|
+
observer.observe(stage)
|
|
31
|
+
return () => observer.disconnect()
|
|
32
|
+
})
|
|
33
|
+
const value = $derived(width ?? Math.min(measured, maxWidth))
|
|
34
|
+
const range = $derived(Math.max(1, maxWidth - minimumWidth))
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
{#snippet controls()}
|
|
38
|
+
<label class="ui-label" data-case="as-is" for={id}>Container</label>
|
|
39
|
+
<input {id} class="ui-range" type="range" min={minimumWidth} max={maxWidth} step="1" disabled={!ready} {value}
|
|
40
|
+
style:--value={`${((value - minimumWidth) / range) * 100}%`} style:width="128px" style:max-width="100%"
|
|
41
|
+
oninput={event => { width = Number(event.currentTarget.value) }} />
|
|
42
|
+
<button type="button" class="ui-button" data-size="sm" disabled={!ready} onclick={() => { width = undefined }}>Fit</button>
|
|
43
|
+
<output class="ui-label" data-case="as-is">{ready ? `${measured} px · viewport unchanged` : 'Measuring container…'}</output>
|
|
44
|
+
{/snippet}
|
|
45
|
+
|
|
46
|
+
<Demo {...props} {title} {caption} padding="sm" data-ready={ready} {controls}>
|
|
47
|
+
<div bind:this={element} data-demo-container="" style:width={width ? `${width}px` : `min(100%, ${maxWidth}px)`} style:max-width="100%">{@render children?.()}</div>
|
|
48
|
+
</Demo>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
+
|
|
7
|
+
/** A labelled group of controls. `segmented` draws the sunken track with raised selected buttons. */
|
|
8
|
+
let { label = 'Demo controls', variant = 'plain', class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
9
|
+
label?: string
|
|
10
|
+
variant?: 'plain' | 'segmented'
|
|
11
|
+
style?: DemoStyle
|
|
12
|
+
children?: Snippet
|
|
13
|
+
} = $props()
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<div {...props} role="group" aria-label={label} class={[variant === 'segmented' ? 'ui-segmented' : 'flex flex-wrap items-center gap-xs', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
|
+
import IconCopy from '@tabler/icons-svelte-runes/icons/copy'
|
|
5
|
+
import { getCopyFeedback, type CopyResult } from '@master/internal-site/demo/copy-feedback.ts'
|
|
6
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
7
|
+
|
|
8
|
+
interface Props extends Omit<HTMLButtonAttributes, 'onclick' | 'value' | 'style' | 'children'> {
|
|
9
|
+
value: string
|
|
10
|
+
label: string
|
|
11
|
+
/** Replaces the copy icon; `null` renders none. */
|
|
12
|
+
icon?: Snippet | null
|
|
13
|
+
/** Short status for a specimen that already displays the copied value. */
|
|
14
|
+
feedback?: 'value' | 'compact'
|
|
15
|
+
style?: DemoStyle
|
|
16
|
+
children?: Snippet
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** The visible status describes the actual clipboard result, including denial. */
|
|
20
|
+
let { value, label, icon, feedback = 'value', children, class: className, style, ...props }: Props = $props()
|
|
21
|
+
const notify = getCopyFeedback()
|
|
22
|
+
let status = $state<{ message: string, result: CopyResult }>({ message: '', result: undefined })
|
|
23
|
+
let busy = $state(false)
|
|
24
|
+
const report = notify ?? ((message: string, result: CopyResult) => { status = { message, result } })
|
|
25
|
+
async function copy() {
|
|
26
|
+
if (busy) return
|
|
27
|
+
busy = true
|
|
28
|
+
report('Copying…', undefined)
|
|
29
|
+
try {
|
|
30
|
+
if (!window.isSecureContext || !navigator.clipboard?.writeText) throw new Error('Clipboard unavailable')
|
|
31
|
+
await navigator.clipboard.writeText(value)
|
|
32
|
+
report(feedback === 'compact' ? 'Copied' : `Copied ${value}`, 'success')
|
|
33
|
+
} catch {
|
|
34
|
+
report(feedback === 'compact' ? 'Copy unavailable' : `Copy unavailable: ${value}`, 'error')
|
|
35
|
+
} finally { busy = false }
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
{#snippet button()}
|
|
40
|
+
<button data-size={className ? undefined : 'sm'} {...props} type="button" aria-label={label} class={className ?? 'ui-button'} style={styleText(style)} aria-busy={busy} onclick={copy}>
|
|
41
|
+
{#if icon === undefined}<IconCopy aria-hidden="true" />{:else if icon}{@render icon()}{/if}{@render children?.()}
|
|
42
|
+
</button>
|
|
43
|
+
{/snippet}
|
|
44
|
+
|
|
45
|
+
<!-- Grouped buttons report to the shared status and stay direct children of their layout. -->
|
|
46
|
+
{#if notify}
|
|
47
|
+
{@render button()}
|
|
48
|
+
{:else}
|
|
49
|
+
<span class="ui-copy">{@render button()}<span class="ui-copy-status" role="status" data-result={status.result}>{status.message}</span></span>
|
|
50
|
+
{/if}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import { setCopyFeedback, type CopyResult } from '@master/internal-site/demo/copy-feedback.ts'
|
|
4
|
+
|
|
5
|
+
/** One status for a set of copy actions, such as a palette. The buttons must render in this group's Svelte tree. */
|
|
6
|
+
let { children, instruction = 'Select a swatch to copy its variable.' }: { children?: Snippet, instruction?: string } = $props()
|
|
7
|
+
let state = $state<{ instruction: string, message: string, result: CopyResult }>()
|
|
8
|
+
const current = $derived(state?.instruction === instruction ? state : undefined)
|
|
9
|
+
setCopyFeedback((message, result) => { state = { instruction, message, result } })
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<div class="grid gap-sm">
|
|
13
|
+
<p class="m(0) ui-copy"><span class="ui-copy-status" role="status" data-result={current?.result}>{current?.message ?? instruction}</span></p>
|
|
14
|
+
{@render children?.()}
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
3
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
4
|
+
import { referenceDemoSections } from '@master/internal-site/demo/reference/source.ts'
|
|
5
|
+
import { referenceScenes } from '@master/internal-site/demo/reference/scenes.ts'
|
|
6
|
+
import { demoDocument } from '@master/internal-site/demo/reference/document.ts'
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
page: string
|
|
10
|
+
section: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const { page, section } = Astro.props
|
|
14
|
+
const source = (await referenceDemoSections(page)).find(item => item.id === section)
|
|
15
|
+
if (!source) throw new Error(`Missing demo source: ${page}#${section}`)
|
|
16
|
+
const factory = referenceScenes[page]
|
|
17
|
+
if (!factory) throw new Error(`Missing demo scene: ${page}`)
|
|
18
|
+
const scene = factory(source)
|
|
19
|
+
const responsive = source.classes.some(value => /(?:@|&)(?:sm|md|lg|xl|[\d.]+(?:px|rem))\b/.test(value))
|
|
20
|
+
const themed = source.classes.some(value => /@(?:dark|light)\b/.test(value))
|
|
21
|
+
const printable = source.classes.some(value => value.includes('@media(print)'))
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<Demo title={source.title} frame="none" caption={scene.caption} data-demo-case={`${page}#${section}`}>
|
|
25
|
+
<DemoViewport client:idle={{ timeout: 500 }} title={`${page}: ${source.title}`} document={demoDocument(source, scene)} responsive={scene.responsive ?? responsive}
|
|
26
|
+
theme={scene.theme ?? themed} print={printable} motion={scene.motion} inspect={scene.inspect ?? (section === 'apply-conditionally' ? [page] : undefined)} height={scene.height} maxWidth={scene.maxWidth} sizing={scene.sizing} />
|
|
27
|
+
</Demo>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import { onMount } from 'svelte'
|
|
4
|
+
|
|
5
|
+
/** Reports syntax support only; the example still owns its native CSS behavior. */
|
|
6
|
+
let { condition }: { condition: string } = $props()
|
|
7
|
+
// The server and the first client render agree on "unknown"; the browser answers after mount.
|
|
8
|
+
let mounted = $state(false)
|
|
9
|
+
onMount(() => { mounted = true })
|
|
10
|
+
const supported = $derived(mounted ? CSS.supports(condition) : null)
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<p class="flex flex-wrap items-center gap-xs m(0)" data-supported={supported ?? 'unknown'}>
|
|
14
|
+
<code class="ui-inline-code">{condition}</code>
|
|
15
|
+
<span class="ui-badge" data-variant="dot" data-tone={supported ? 'green' : undefined}>
|
|
16
|
+
{supported === null ? 'Checking…' : supported ? 'Supported' : 'Not supported'}
|
|
17
|
+
</span>
|
|
18
|
+
</p>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
|
|
4
|
+
/** The complete generated stylesheet stays one native, closed disclosure under the source. */
|
|
5
|
+
let { children }: { children?: Snippet } = $props()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<details class="ui-disclosure"><summary>Generated CSS</summary>{@render children?.()}</details>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
|
|
4
|
+
export interface DemoIndexGroup {
|
|
5
|
+
title: string
|
|
6
|
+
links: readonly { href: string, label: string }[]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
label: string
|
|
11
|
+
groups: readonly DemoIndexGroup[]
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/** Native links keep catalog navigation available before hydration. */
|
|
15
|
+
const { label, groups } = Astro.props
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<nav class="grid gap-md" aria-label={label}>
|
|
19
|
+
{groups.map(group => <div class="grid gap-xs">
|
|
20
|
+
<p class="m(0) ui-label">{group.title}</p>
|
|
21
|
+
<ul class="flex flex-wrap gap-2xs m(0) p(0) (list-style:none)">{group.links.map(link => <li><a class="ui-button" data-size="sm" href={link.href}>{link.label}</a></li>)}</ul>
|
|
22
|
+
</div>)}
|
|
23
|
+
</nav>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
3
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
4
|
+
import { demoDocument } from '@master/internal-site/demo/reference/document.ts'
|
|
5
|
+
|
|
6
|
+
/** Keep integration examples isolated from article typography and site-only utilities. */
|
|
7
|
+
const html = '<p id="master-check" class="w-fit m(0) p-md b-solid b(1) b-line-divider r-md text-sm font-regular bg-surface-raised fg-text-strong">Hello World</p>'
|
|
8
|
+
const title = 'Check the installed styles'
|
|
9
|
+
const caption = 'A neutral surface, a fine border, small corners and 1rem of padding on every side.'
|
|
10
|
+
const section = { page: 'installation', id: 'check', title, html: [html], css: '', classes: [], classLists: [], highlighted: [] }
|
|
11
|
+
const document = demoDocument(section, { html, caption, bodyClass: 'p-md' })
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<Demo title={title} caption={caption} frame="none">
|
|
15
|
+
<Fragment slot="source"><slot /></Fragment>
|
|
16
|
+
<DemoViewport client:idle={{ timeout: 500 }} title={title} document={document} sizing="content" />
|
|
17
|
+
</Demo>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
+
import { tone, type DemoTone } from '@master/internal-site/demo/tone.ts'
|
|
7
|
+
|
|
8
|
+
/** A tile that stands for content. Utilities on the item set its size and layout. */
|
|
9
|
+
let { tone: value = 'neutral', variant = 'soft', class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
10
|
+
tone?: DemoTone
|
|
11
|
+
variant?: 'soft' | 'solid' | 'outline' | 'ghost'
|
|
12
|
+
style?: DemoStyle
|
|
13
|
+
children?: Snippet
|
|
14
|
+
} = $props()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<div {...props} data-tone={tone(value)} data-variant={variant === 'soft' ? undefined : variant} class={['ui-item', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from './style'
|
|
6
|
+
|
|
7
|
+
/** Names a condition outside the measured layout. Class names and values keep their case unless `upper` is set. */
|
|
8
|
+
let { upper = false, class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLSpanElement>, 'style'> & {
|
|
9
|
+
upper?: boolean
|
|
10
|
+
style?: DemoStyle
|
|
11
|
+
children?: Snippet
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<span {...props} data-case={upper ? undefined : 'as-is'} class={['ui-label', className]} style={styleText(style)}>{@render children?.()}</span>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
5
|
+
import { tone, type DemoTone } from '@master/internal-site/demo/tone.ts'
|
|
6
|
+
|
|
7
|
+
let { items, class: className, style, ...props }: Omit<HTMLAttributes<HTMLUListElement>, 'style' | 'children'> & {
|
|
8
|
+
items: { label: string, tone: DemoTone }[]
|
|
9
|
+
style?: DemoStyle
|
|
10
|
+
} = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<ul {...props} class={['ui-legend', className]} style={styleText(style)} aria-label="Legend">
|
|
14
|
+
{#each items as { label, tone: value } (label)}<li><i data-tone={tone(value)} aria-hidden="true"></i>{label}</li>{/each}
|
|
15
|
+
</ul>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
|
|
5
|
+
/** A dedicated measurement wrapper, never inserted between layout items and their parent. */
|
|
6
|
+
let { children, label = 'Bounds' }: { children?: Snippet, label?: string } = $props()
|
|
7
|
+
let element = $state<HTMLDivElement>()
|
|
8
|
+
let size = $state<{ width: number, height: number }>()
|
|
9
|
+
$effect(() => {
|
|
10
|
+
if (!element) return
|
|
11
|
+
const target = element
|
|
12
|
+
const observer = new ResizeObserver(() => {
|
|
13
|
+
const bounds = target.getBoundingClientRect()
|
|
14
|
+
size = { width: Math.round(bounds.width), height: Math.round(bounds.height) }
|
|
15
|
+
})
|
|
16
|
+
observer.observe(target)
|
|
17
|
+
return () => observer.disconnect()
|
|
18
|
+
})
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class="ui-measure">
|
|
22
|
+
<div class="ui-measure-head">
|
|
23
|
+
<span>{label}</span>
|
|
24
|
+
<output aria-label={`${label} dimensions`}>{size ? `${size.width} × ${size.height} px` : 'Measuring…'}</output>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="ui-measure-rule" aria-hidden="true"></div>
|
|
27
|
+
<div bind:this={element}>{@render children?.()}</div>
|
|
28
|
+
</div>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { ClassValue } from 'svelte/elements'
|
|
4
|
+
import type { SVGAttributes } from 'svelte/elements'
|
|
5
|
+
import Image, { type ImageProps as SiteImageProps } from '@master/internal-site/components/Image.svelte'
|
|
6
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
7
|
+
import type { DemoTone } from '@master/internal-site/demo/tone.ts'
|
|
8
|
+
|
|
9
|
+
// A media specimen exposes its presentation and accessible name, not every
|
|
10
|
+
// incompatible DOM event signature of both SVG and HTML image elements.
|
|
11
|
+
interface MediaAttributes {
|
|
12
|
+
class?: ClassValue
|
|
13
|
+
id?: string
|
|
14
|
+
width?: number | `${number}`
|
|
15
|
+
height?: number | `${number}`
|
|
16
|
+
'aria-label'?: string
|
|
17
|
+
'aria-hidden'?: boolean | 'true' | 'false'
|
|
18
|
+
}
|
|
19
|
+
type ImageProps = MediaAttributes & Pick<SiteImageProps, 'loading' | 'priority' | 'quality' | 'sizes' | 'fill' | 'placeholder'> & { src: string, alt: string, tone?: never, style?: string }
|
|
20
|
+
type VectorProps = MediaAttributes & { src?: never, alt?: never, tone?: DemoTone, style?: DemoStyle }
|
|
21
|
+
|
|
22
|
+
/** Original artwork in a teaching tone, or a real image with its intrinsic size. */
|
|
23
|
+
let { src, alt, tone: value = 'neutral', style, ...props }: ImageProps | VectorProps = $props()
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
{#if src !== undefined}
|
|
27
|
+
{@const imageProps: SiteImageProps = { width: 320, height: 200, ...(props as Omit<ImageProps, 'src' | 'alt' | 'style'>), style: styleText(style), src, alt: alt! }}
|
|
28
|
+
<Image {...imageProps} />
|
|
29
|
+
{:else}
|
|
30
|
+
<svg viewBox="0 0 320 200" role="img" aria-label="Sun above two mountain ridges" {...props as SVGAttributes<SVGSVGElement>}
|
|
31
|
+
style={[`color:var(--ui-tone-${value})`, styleText(style)].filter(Boolean).join(';')}>
|
|
32
|
+
<rect width="320" height="200" fill="var(--ui-surface-sheet)" />
|
|
33
|
+
<path d="M0 175V158l92-93 113 110H0Z" fill="currentColor" opacity=".1" />
|
|
34
|
+
<path d="M74 200 211 83l109 102v15H74Z" fill="currentColor" opacity=".16" />
|
|
35
|
+
<circle cx="250" cy="49" r="23" fill="currentColor" opacity=".11" />
|
|
36
|
+
<circle cx="250" cy="49" r="22.5" fill="none" stroke="currentColor" stroke-opacity=".5" />
|
|
37
|
+
<path d="M0 158 92 65l113 110M74 200 211 83l109 102M0 175h103" fill="none" stroke="currentColor" stroke-opacity=".38" />
|
|
38
|
+
<path d="M23 183h62m130-6h72" fill="none" stroke="currentColor" stroke-opacity=".18" stroke-width=".75" />
|
|
39
|
+
<circle cx="92" cy="65" r="2.5" fill="currentColor" />
|
|
40
|
+
<circle cx="211" cy="83" r="2.5" fill="currentColor" />
|
|
41
|
+
<rect width="319" height="199" x=".5" y=".5" fill="none" stroke="var(--ui-line-contour)" />
|
|
42
|
+
</svg>
|
|
43
|
+
{/if}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte'
|
|
3
|
+
import { onMount } from 'svelte'
|
|
4
|
+
import IconPlayerPause from '@tabler/icons-svelte-runes/icons/player-pause'
|
|
5
|
+
import IconPlayerPlay from '@tabler/icons-svelte-runes/icons/player-play'
|
|
6
|
+
import IconRefresh from '@tabler/icons-svelte-runes/icons/refresh'
|
|
7
|
+
|
|
8
|
+
/** Play, pause and replay the native animations inside; they start paused and respect reduced motion. */
|
|
9
|
+
let { children }: { children?: Snippet } = $props()
|
|
10
|
+
let element = $state<HTMLDivElement>()
|
|
11
|
+
let playing = $state(false)
|
|
12
|
+
onMount(() => {
|
|
13
|
+
const preference = matchMedia('(prefers-reduced-motion: reduce)')
|
|
14
|
+
const sync = () => {
|
|
15
|
+
element?.getAnimations({ subtree: true }).forEach(animation => animation.pause())
|
|
16
|
+
playing = false
|
|
17
|
+
}
|
|
18
|
+
sync()
|
|
19
|
+
preference.addEventListener('change', sync)
|
|
20
|
+
return () => preference.removeEventListener('change', sync)
|
|
21
|
+
})
|
|
22
|
+
const control = (action: 'play' | 'pause' | 'restart') => {
|
|
23
|
+
element?.getAnimations({ subtree: true }).forEach(animation => {
|
|
24
|
+
if (action === 'restart') animation.currentTime = 0
|
|
25
|
+
if (action === 'pause') animation.pause()
|
|
26
|
+
else animation.play()
|
|
27
|
+
})
|
|
28
|
+
playing = action !== 'pause'
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<div class="grid gap-md w-full">
|
|
33
|
+
<div bind:this={element} data-playback={playing ? 'playing' : 'paused'}>{@render children?.()}</div>
|
|
34
|
+
<div class="ui-player" role="group" aria-label="Animation controls" data-state={playing ? 'playing' : 'paused'}>
|
|
35
|
+
<button type="button" class="ui-button" data-size="sm" onclick={() => control(playing ? 'pause' : 'play')}>
|
|
36
|
+
{#if playing}<IconPlayerPause aria-hidden="true" />{:else}<IconPlayerPlay aria-hidden="true" />{/if}{playing ? 'Pause' : 'Play'}
|
|
37
|
+
</button>
|
|
38
|
+
<button type="button" class="ui-button" data-size="sm" data-variant="quiet" onclick={() => control('restart')}><IconRefresh aria-hidden="true" />Replay</button>
|
|
39
|
+
<span class="ui-player-time"><output>{playing ? 'Playing' : 'Paused'}</output></span>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
3
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
src: string
|
|
7
|
+
title: string
|
|
8
|
+
height?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Site-owned example pages share the same keyboard-accessible viewport controls. */
|
|
12
|
+
const { src, title, height = 420 } = Astro.props
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<Demo title={title} frame="none" caption="Adjust the iframe viewport. Scroll inside the preview to see all content.">
|
|
16
|
+
<DemoViewport client:idle={{ timeout: 500 }} src={src} title={title} height={height} responsive />
|
|
17
|
+
</Demo>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
4
|
+
import DemoPaletteGroups from '@master/internal-site/demo/DemoPaletteGroups.svelte'
|
|
5
|
+
import { getThemeVariables } from '@master/internal-site/css/theme-variables.ts'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
families?: string[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { families } = Astro.props
|
|
12
|
+
const groups = new Map<string, { name: string, step: number, value: string }[]>()
|
|
13
|
+
for (const variable of getThemeVariables('color')) {
|
|
14
|
+
const match = variable.name?.match(/^color-(.+)-(\d+)$/)
|
|
15
|
+
if (!match || typeof variable.value !== 'string' || (families && !families.includes(match[1]))) continue
|
|
16
|
+
const [, family, step] = match
|
|
17
|
+
if (!groups.has(family)) groups.set(family, [])
|
|
18
|
+
groups.get(family)!.push({ name: variable.name!, step: Number(step), value: variable.value })
|
|
19
|
+
}
|
|
20
|
+
// The copy group and its chips are one island, so every chip reports to the shared status.
|
|
21
|
+
const palette = [...groups].map(([family, colors]) => ({
|
|
22
|
+
family,
|
|
23
|
+
colors: colors.sort((a, b) => a.step - b.step).map(({ name, value }) => ({ name, value }))
|
|
24
|
+
}))
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
<Demo title="Preset palette" padding="sm" data-foundation-palette caption="Each swatch shows the fixed preset value in both themes.">
|
|
28
|
+
<DemoPaletteGroups client:idle={{ timeout: 500 }} groups={palette} />
|
|
29
|
+
</Demo>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import DemoCopyButton from '@master/internal-site/demo/DemoCopyButton.svelte'
|
|
4
|
+
import DemoCopyGroup from '@master/internal-site/demo/DemoCopyGroup.svelte'
|
|
5
|
+
|
|
6
|
+
/** DemoPalette's chips: one copy group, so every chip reports to the same status. */
|
|
7
|
+
let { groups }: { groups: { family: string, colors: { name: string, value: string }[] }[] } = $props()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div class="w-full"><DemoCopyGroup><div class="ui-palette">
|
|
11
|
+
{#each groups as { family, colors } (family)}<div class="ui-palette-row" role="group" aria-label={`${family} palette`}>
|
|
12
|
+
<span>{family}</span>
|
|
13
|
+
{#each colors as { name, value } (name)}<DemoCopyButton value={`var(--${name})`} label={`Copy ${name}`} icon={null} class="ui-palette-chip" style={`background-color:${value}`} title={`${name}: ${value}`} />{/each}
|
|
14
|
+
</div>{/each}
|
|
15
|
+
</div></DemoCopyGroup></div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
+
|
|
7
|
+
/** A local, keyboard-reachable scroll region. Name it with aria-label. */
|
|
8
|
+
let { class: className, tabindex = 0, style, children, ...props }: Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
9
|
+
style?: DemoStyle
|
|
10
|
+
children?: Snippet
|
|
11
|
+
} = $props()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
|
|
15
|
+
<div {...props} {tabindex} class={['ui-scroll', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
3
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
4
|
+
|
|
5
|
+
export interface DemoStyleComparisonProps {
|
|
6
|
+
/** Trusted site-authored HTML only. Both previews receive this exact markup. */
|
|
7
|
+
html: string
|
|
8
|
+
css: string
|
|
9
|
+
height?: number
|
|
10
|
+
sizing?: 'viewport' | 'content'
|
|
11
|
+
caption?: string
|
|
12
|
+
}
|
|
13
|
+
type Props = DemoStyleComparisonProps
|
|
14
|
+
|
|
15
|
+
/** Native browser defaults versus supplied CSS, without a flashing transition. */
|
|
16
|
+
const { html, css, height = 320, sizing = 'viewport', caption } = Astro.props
|
|
17
|
+
const document = (styles: string) => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>${styles.replaceAll('</style', '<\\/style')}</style></head><body>${html}</body></html>`
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
<Demo title="Browser defaults and author CSS" description="The same HTML in two documents" frame="none" caption={caption}>
|
|
21
|
+
<div class="ui-compare">
|
|
22
|
+
<figure><figcaption>Browser defaults</figcaption><DemoViewport client:idle={{ timeout: 500 }} title="Browser defaults" document={document('')} height={height} sizing={sizing} /></figure>
|
|
23
|
+
<figure><figcaption>CSS applied</figcaption><DemoViewport client:idle={{ timeout: 500 }} title="CSS applied" document={document(css)} height={height} sizing={sizing} /></figure>
|
|
24
|
+
</div>
|
|
25
|
+
</Demo>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
+
|
|
7
|
+
/** A sheet on the stage. Geometry and padding stay with the example. */
|
|
8
|
+
let { elevation = 'flat', class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
9
|
+
elevation?: 'flat' | 'raised'
|
|
10
|
+
style?: DemoStyle
|
|
11
|
+
children?: Snippet
|
|
12
|
+
} = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div {...props} data-elevation={elevation === 'flat' ? 'flat' : '1'} class={['ui-sheet', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import '@master/internal-site/styles/system/specimens.css'
|
|
3
|
+
import type { Snippet } from 'svelte'
|
|
4
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
5
|
+
import { styleText, type DemoStyle } from '@master/internal-site/demo/style.ts'
|
|
6
|
+
|
|
7
|
+
/** A named role with its actual paint. class and style paint the face. */
|
|
8
|
+
let { label, value, class: className, style, children, ...props }: Omit<HTMLAttributes<HTMLDivElement>, 'style'> & {
|
|
9
|
+
label: string
|
|
10
|
+
value?: string
|
|
11
|
+
style?: DemoStyle
|
|
12
|
+
children?: Snippet
|
|
13
|
+
} = $props()
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<figure class="ui-swatch">
|
|
17
|
+
<div {...props} aria-hidden={props['aria-hidden'] ?? (children == null ? true : undefined)} class={['ui-swatch-paint', className]} style={styleText(style)}>{@render children?.()}</div>
|
|
18
|
+
<figcaption><b>{label}</b>{#if value}<code>{value}</code>{/if}</figcaption>
|
|
19
|
+
</figure>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
import Demo from '@master/internal-site/demo/Demo.svelte'
|
|
3
|
+
import DemoViewport from '@master/internal-site/demo/DemoViewport.svelte'
|
|
4
|
+
import { demoDocument } from '@master/internal-site/demo/reference/document.ts'
|
|
5
|
+
|
|
6
|
+
export interface DemoThemeComparisonProps {
|
|
7
|
+
name: string
|
|
8
|
+
title: string
|
|
9
|
+
/** Trusted site-authored HTML with complete, scannable Master CSS classes. */
|
|
10
|
+
html: string
|
|
11
|
+
css?: string
|
|
12
|
+
caption?: string
|
|
13
|
+
height?: number
|
|
14
|
+
print?: boolean
|
|
15
|
+
}
|
|
16
|
+
type Props = DemoThemeComparisonProps
|
|
17
|
+
|
|
18
|
+
/** Independent documents keep mode variables and native state inside each specimen. */
|
|
19
|
+
const { name, title, html, css = '', caption, height = 240, print = false } = Astro.props
|
|
20
|
+
const document = (mode: 'light' | 'dark') => demoDocument({ page: 'foundations', id: name, title, html: [html], css, classes: [], classLists: [], highlighted: [] }, { html, bodyClass: 'p-md p(8)@media(width<240px) bg-surface-base fg-text-body', caption: '' }, mode)
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<Demo title={title} frame="none" caption={caption} data-foundation-paint={name}>
|
|
24
|
+
<div class="ui-compare">
|
|
25
|
+
{(['light', 'dark'] as const).map(mode => <figure data-theme-specimen={mode}>
|
|
26
|
+
<figcaption>{mode === 'light' ? 'Light' : 'Dark'}</figcaption>
|
|
27
|
+
<DemoViewport client:idle={{ timeout: 500 }} title={`${title} · ${mode}`} document={document(mode)} initialTheme={mode} print={print} height={height} sizing="content" />
|
|
28
|
+
</figure>)}
|
|
29
|
+
</div>
|
|
30
|
+
</Demo>
|