diff --git a/.changeset/swift-dryers-invite.md b/.changeset/swift-dryers-invite.md new file mode 100644 index 0000000000..79282a053d --- /dev/null +++ b/.changeset/swift-dryers-invite.md @@ -0,0 +1,5 @@ +--- +"@primer/view-components": patch +--- + +Move `Overlay` styles to PVC diff --git a/app/components/primer/alpha/dialog.pcss b/app/components/primer/alpha/dialog.pcss new file mode 100644 index 0000000000..86a8da11e0 --- /dev/null +++ b/app/components/primer/alpha/dialog.pcss @@ -0,0 +1,484 @@ +/* Overlay */ + +.Overlay--hidden { + display: none !important; +} + +.Overlay--visibilityHidden { + height: 0; + overflow: hidden; + visibility: hidden; + opacity: 0; +} + +.Overlay { + display: flex; + width: min(var(--overlay-width), 100vw - 2rem); + min-width: 192px; + max-height: min(calc(100vh - 2rem), var(--overlay-height)); + white-space: normal; + flex-direction: column; + background-color: var(--color-canvas-overlay); + border-radius: var(--primer-borderRadius-large, 12px); + box-shadow: var(--color-overlay-shadow); + opacity: 1; + + &.Overlay--size-auto { + min-width: 192px; + max-width: calc(100vw - 2rem); + max-height: calc(100vh - 2rem); + } + + &.Overlay--size-full { + width: 100vw; + height: 100vh; + } + + &.Overlay--size-xsmall { + --overlay-width: 192px; + + max-height: calc(100vh - 2rem); + } + + &.Overlay--size-small { + --overlay-height: 256px; + --overlay-width: 320px; + } + + &.Overlay--size-small-portrait { + --overlay-height: 432px; + --overlay-width: 320px; + } + + &.Overlay--size-medium { + --overlay-height: 320px; + --overlay-width: 480px; + } + + &.Overlay--size-medium-portrait { + --overlay-height: 600px; + --overlay-width: 480px; + } + + &.Overlay--size-large { + --overlay-height: 432px; + --overlay-width: 640px; + } + + &.Overlay--size-xlarge { + --overlay-height: 600px; + --overlay-width: 960px; + } + + &.Overlay--height-auto { + height: auto; + } + + /* start deprecate in favor of Alpha::Dialog */ + &.Overlay--height-xsmall { + height: min(192px, 100vh - 2rem); + } + + &.Overlay--height-small { + height: min(256px, 100vh - 2rem); + } + + &.Overlay--height-medium { + height: min(320px, 100vh - 2rem); + } + + &.Overlay--height-large { + height: min(432px, 100vh - 2rem); + } + + &.Overlay--height-xlarge { + height: min(600px, 100vh - 2rem); + } + + &.Overlay--width-auto { + width: auto; + } + + &.Overlay--width-small { + width: min(256px, 100vw - 2rem); + } + + &.Overlay--width-medium { + width: min(320px, 100vw - 2rem); + } + + &.Overlay--width-large { + width: min(480px, 100vw - 2rem); + } + + &.Overlay--width-xlarge { + width: min(640px, 100vw - 2rem); + } + + &.Overlay--width-xxlarge { + width: min(960px, 100vw - 2rem); + } + + /* end deprecate */ + + &.Overlay--motion-scaleFade { + @media screen and (prefers-reduced-motion: no-preference) { + animation: 200ms cubic-bezier(0.33, 1, 0.68, 1) 0s 1 normal none running Overlay--motion-scaleFade; + } + } +} + +@keyframes Overlay--motion-scaleFade { + 0% { + opacity: 0; + transform: scale(0.5); + } + + 100% { + opacity: 1; + transform: scale(1); + } +} + +/* for