diff --git a/components/appframe/README.md b/components/appframe/README.md new file mode 100644 index 00000000000..b598e7cdebf --- /dev/null +++ b/components/appframe/README.md @@ -0,0 +1,7 @@ +# @spectrum-css/appframe + +> The Spectrum CSS app frame component + +This package is part of the [Spectrum CSS project](https://github.com/adobe/spectrum-css). + +See the [Spectrum CSS documentation](https://opensource.adobe.com/spectrum-css/appframe). diff --git a/components/appframe/dist/metadata.json b/components/appframe/dist/metadata.json new file mode 100644 index 00000000000..5b382893818 --- /dev/null +++ b/components/appframe/dist/metadata.json @@ -0,0 +1,67 @@ +{ + "sourceFile": "index.css", + "selectors": [ + ".spectrum--dark .spectrum-AppFrame", + ".spectrum-AppFrame", + ".spectrum-AppFrame--noSideNav", + ".spectrum-AppFrame-content", + ".spectrum-AppFrame-content .spectrum-AppFrame-section:last-of-type", + ".spectrum-AppFrame-content > main", + ".spectrum-AppFrame-content--rounded", + ".spectrum-AppFrame-content--rounded .spectrum-AppFrame-section:last-of-type", + ".spectrum-AppFrame-content-intro", + ".spectrum-AppFrame-header", + ".spectrum-AppFrame-section", + ".spectrum-AppFrame-section + .spectrum-AppFrame-section", + ".spectrum-AppFrame-section .spectrum-AppFrame-section-heading", + ".spectrum-AppFrame-section-grid", + ".spectrum-AppFrame-section-grid > .spectrum-AppFrame-section-grid-item--wide", + ".spectrum-AppFrame-section-grid:is(ul)", + ".spectrum-AppFrame-section-inner > .spectrum-Body", + ".spectrum-AppFrame-section-inner > .spectrum-Heading", + ".spectrum-AppFrame-section-inner:not(:last-child)", + ".spectrum-AppFrame-side-nav" + ], + "modifiers": [ + "--mod-app-frame-background", + "--mod-app-frame-content-background", + "--mod-app-frame-content-corner-radius", + "--mod-app-frame-header-height", + "--mod-app-frame-intro-background", + "--mod-app-frame-max-readable-characters", + "--mod-app-frame-section-grid-gap", + "--mod-app-frame-section-inner-area-vertical-gap", + "--mod-app-frame-section-padding" + ], + "component": [ + "--spectrum-app-frame-background", + "--spectrum-app-frame-content-background", + "--spectrum-app-frame-content-corner-radius", + "--spectrum-app-frame-end-side-column-inline-size", + "--spectrum-app-frame-header-height", + "--spectrum-app-frame-intro-background", + "--spectrum-app-frame-max-readable-characters", + "--spectrum-app-frame-section-gap", + "--spectrum-app-frame-section-grid-gap", + "--spectrum-app-frame-section-heading-margin-block", + "--spectrum-app-frame-section-inner-area-vertical-gap", + "--spectrum-app-frame-section-padding", + "--spectrum-app-frame-start-side-column-inline-size", + "--spectrum-app-frame-to-edge" + ], + "global": [ + "--spectrum-background-base-color", + "--spectrum-background-layer-1-color", + "--spectrum-component-height-400", + "--spectrum-corner-radius-extra-large-default", + "--spectrum-spacing-200", + "--spectrum-spacing-300", + "--spectrum-spacing-400", + "--spectrum-spacing-600" + ], + "passthroughs": [], + "high-contrast": [ + "--highcontrast-app-frame-background", + "--highcontrast-app-frame-content-background" + ] +} diff --git a/components/appframe/index.css b/components/appframe/index.css new file mode 100644 index 00000000000..121646c1d61 --- /dev/null +++ b/components/appframe/index.css @@ -0,0 +1,165 @@ +/*! +Copyright 2023 Adobe. All rights reserved. +This file is licensed to you under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. You may obtain a copy +of the License at http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under +the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +OF ANY KIND, either express or implied. See the License for the specific language +governing permissions and limitations under the License. +*/ + +.spectrum-AppFrame { + --spectrum-app-frame-background: var(--spectrum-background-layer-1-color); + --spectrum-app-frame-content-background: var(--spectrum-background-base-color); + --spectrum-app-frame-intro-background: linear-gradient(93.59deg, #ffeccf 0%, #ffa213 63%, #ff709f 100%); + + --spectrum-app-frame-content-corner-radius: var(--spectrum-corner-radius-extra-large-default); + + --spectrum-app-frame-section-gap: var(--spectrum-spacing-200); + --spectrum-app-frame-to-edge: var(--spectrum-spacing-200); + --spectrum-app-frame-section-padding: var(--spectrum-spacing-400) var(--spectrum-spacing-600) var(--spectrum-spacing-600); + + --spectrum-app-frame-header-height: var(--spectrum-component-height-400); + + --spectrum-app-frame-start-side-column-inline-size: minmax(var(--spectrum-component-height-400), max-content); + --spectrum-app-frame-end-side-column-inline-size: var(--spectrum-app-frame-to-edge); + + --spectrum-app-frame-section-grid-gap: var(--spectrum-spacing-300); + --spectrum-app-frame-section-heading-margin-block: 0px var(--spectrum-spacing-400); + --spectrum-app-frame-section-inner-area-vertical-gap: var(--spectrum-spacing-600); + + /* To-do: not sure about the best way to include this limit and where to apply. */ + --spectrum-app-frame-max-readable-characters: 80ch; + + /* To-do: For demo purposes only; would not convert to SWC. They would need a way of providing different gradients for light/dark. */ + .spectrum--dark & { + --spectrum-app-frame-intro-background: linear-gradient(94.13deg, #003041 0%, #03638c 100%); + } +} + +.spectrum-AppFrame { + background: var(--highcontrast-app-frame-background, var(--mod-app-frame-background, var(--spectrum-app-frame-background))); + inline-size: 100%; + block-size: 100vh; + position: relative; + display: grid; + grid-template-areas: + "head head head" + "side main endside"; + grid-template-rows: var(--mod-app-frame-header-height, var(--spectrum-app-frame-header-height)) 1fr; + grid-template-columns: var(--spectrum-app-frame-start-side-column-inline-size) 1fr var(--spectrum-app-frame-end-side-column-inline-size); +} + +.spectrum-AppFrame--noSideNav { + grid-template-columns: var(--spectrum-app-frame-to-edge) 1fr var(--spectrum-app-frame-to-edge); +} + +.spectrum-AppFrame-header { + grid-area: head; +} + +.spectrum-AppFrame-side-nav { + grid-area: side; +} + +/* Main scrollable content area */ +.spectrum-AppFrame-content { + grid-area: main; + block-size: 100%; + border-radius: var(--mod-app-frame-content-corner-radius, var(--spectrum-app-frame-content-corner-radius)) var(--mod-app-frame-content-corner-radius, var(--spectrum-app-frame-content-corner-radius)) 0 0; + overflow: auto; + position: relative; + container-type: size; + container-name: app-frame-content; +} + +/** + *
is a separate nested element, in order to allow the option for a document level