From a686ba9aee20374c593b47ff259943934fb9cb48 Mon Sep 17 00:00:00 2001 From: Dale Pidlisny Date: Fri, 30 Oct 2026 16:07:57 -0600 Subject: [PATCH 1/2] fix conflict on index.tsx --- .../src/components/index.tsx | 13 ++ .../src/components/scalloped-edge/index.tsx | 2 + .../scalloped-edge/readme.stories.mdx | 34 ++++ .../scalloped-edge/scalloped-edge.module.scss | 154 ++++++++++++++++++ .../scalloped-edge/scalloped-edge.stories.tsx | 22 +++ .../scalloped-edge/scalloped-edge.tsx | 30 ++++ 6 files changed, 255 insertions(+) create mode 100644 packages/wethegit-components/src/components/index.tsx create mode 100644 packages/wethegit-components/src/components/scalloped-edge/index.tsx create mode 100644 packages/wethegit-components/src/components/scalloped-edge/readme.stories.mdx create mode 100644 packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.module.scss create mode 100644 packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.stories.tsx create mode 100644 packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.tsx diff --git a/packages/wethegit-components/src/components/index.tsx b/packages/wethegit-components/src/components/index.tsx new file mode 100644 index 00000000..f0f2c2ac --- /dev/null +++ b/packages/wethegit-components/src/components/index.tsx @@ -0,0 +1,13 @@ +export * from "./breakpoint-snipe" +export * from "./flex" +export * from "./grid-layout" +export * from "./icon" +export * from "./image-group" +export * from "./in-view" +export * from "./modal" +export * from "./navigation" +export * from "./scalloped-edge" +export * from "./tag" +export * from "./text" +export * from "./visually-hidden" +export * from "./visually-hidden-links" diff --git a/packages/wethegit-components/src/components/scalloped-edge/index.tsx b/packages/wethegit-components/src/components/scalloped-edge/index.tsx new file mode 100644 index 00000000..2514db78 --- /dev/null +++ b/packages/wethegit-components/src/components/scalloped-edge/index.tsx @@ -0,0 +1,2 @@ +export { ScallopedEdge } from "./scalloped-edge" +export type { ScallopedEdgeProps } from "./scalloped-edge" diff --git a/packages/wethegit-components/src/components/scalloped-edge/readme.stories.mdx b/packages/wethegit-components/src/components/scalloped-edge/readme.stories.mdx new file mode 100644 index 00000000..98de9931 --- /dev/null +++ b/packages/wethegit-components/src/components/scalloped-edge/readme.stories.mdx @@ -0,0 +1,34 @@ +import { Meta } from "@storybook/blocks" + + + +# scalloped-edge + +The scalloped-edge component is a helper component to + +### Install + +```bash +npx @wethegit/components-cli add scalloped-edge +``` + +### Usage + +Import the `ScallopedEdge` component and place it at the root of your application. + +```tsx +import { ScallopedEdge } from "@wethegit/components" + +export function App() { + return ( + + + My App + + + + + + ) +} +``` diff --git a/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.module.scss b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.module.scss new file mode 100644 index 00000000..28fdda6c --- /dev/null +++ b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.module.scss @@ -0,0 +1,154 @@ +@use "@local/styles/breakpoints/breakpoints-variables" as *; + +.scallopedEdge { + isolation: isolate; + position: relative; +} + +.scallopedContent { + position: relative; + z-index: 1; +} + +/* --------------------------------------------------------------------------- + Overlay variant: one band per edge. The artwork lives on ::before so the + band itself stays put while the image is flipped / faded. + --------------------------------------------------------------------------- */ + +.band { + overflow: hidden; + pointer-events: none; + position: absolute; + z-index: 2; +} + +.band::before { + background-image: var(--scallop-image); + background-position: var(--scallop-bg-position, center); + background-repeat: var(--scallop-repeat, no-repeat); + background-size: var(--scallop-bg-size, 100% 100%); + content: ""; + inset: 0; + position: absolute; + transform: var(--scallop-flip, none); +} + +.bandTop { + height: var(--scallop-size); + left: 0; + right: 0; + top: var(--scallop-offset, 0); +} + +.bandBottom { + bottom: var(--scallop-offset, 0); + height: var(--scallop-size); + left: 0; + right: 0; +} + +.bandLeft { + bottom: 0; + left: var(--scallop-offset, 0); + top: 0; + width: var(--scallop-size); +} + +.bandRight { + bottom: 0; + right: var(--scallop-offset, 0); + top: 0; + width: var(--scallop-size); +} + +.bandFade { + --scallop-fade-stop: 60%; +} + +.bandTop.bandFade { + // -webkit-mask-image: linear-gradient( + // to bottom, + // #000 var(--scallop-fade-stop), + // transparent + // ); + mask-image: linear-gradient(to bottom, #000 var(--scallop-fade-stop), transparent); +} + +.bandBottom.bandFade { + // -webkit-mask-image: linear-gradient( + // to top, + // #000 var(--scallop-fade-stop), + // transparent + // ); + mask-image: linear-gradient(to top, #000 var(--scallop-fade-stop), transparent); +} + +.bandLeft.bandFade { + // -webkit-mask-image: linear-gradient( + // to right, + // #000 var(--scallop-fade-stop), + // transparent + // ); + mask-image: linear-gradient(to right, #000 var(--scallop-fade-stop), transparent); +} + +.bandRight.bandFade { + // -webkit-mask-image: linear-gradient( + // to left, + // #000 var(--scallop-fade-stop), + // transparent + // ); + mask-image: linear-gradient(to left, #000 var(--scallop-fade-stop), transparent); +} + +/* --------------------------------------------------------------------------- + Full frame overlay. The artwork is mapped to the whole box, then cropped + to the requested sides with a gradient mask (union by default). + --------------------------------------------------------------------------- */ + +.frameOverlay { + background-image: var(--scallop-image); + background-position: center; + background-repeat: no-repeat; + background-size: 100% 100%; + inset: 0; + pointer-events: none; + position: absolute; + z-index: 2; +} + +/* --------------------------------------------------------------------------- + Full frame sizing. + --------------------------------------------------------------------------- */ + +.frameRoot { + aspect-ratio: var(--scallop-aspect, 16 / 9); +} + +.frameContent { + inset: 0; + overflow: hidden; + position: absolute; +} + +/* --------------------------------------------------------------------------- + Masked variant. The layers themselves are written inline because the + compositing order has to match the array order exactly. If the browser + cannot composite, fall back to an opaque mask so nothing disappears. + --------------------------------------------------------------------------- */ + +@supports not (mask-composite: subtract) { + .masked { + // -webkit-mask-image: linear-gradient(#000, #000) !important; + mask-image: linear-gradient(#000, #000) !important; + + // -webkit-mask-position: 0 0 !important; + mask-position: 0 0 !important; + + // -webkit-mask-repeat: no-repeat !important; + mask-repeat: no-repeat !important; + + // -webkit-mask-size: 100% 100% !important; + mask-size: 100% 100% !important; + } +} diff --git a/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.stories.tsx b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.stories.tsx new file mode 100644 index 00000000..3deab3d6 --- /dev/null +++ b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.stories.tsx @@ -0,0 +1,22 @@ +import type { Meta, StoryObj } from "@storybook/react" + +import { ScallopedEdge } from "@local/components" + +const meta = { + title: "components/scalloped-edge", + component: ScallopedEdge, +} satisfies Meta + +export default meta + +type Story = StoryObj + +export const Default: Story = { + render: (props) => ( + <> +
+ +
+ + ), +} diff --git a/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.tsx b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.tsx new file mode 100644 index 00000000..c57ec158 --- /dev/null +++ b/packages/wethegit-components/src/components/scalloped-edge/scalloped-edge.tsx @@ -0,0 +1,30 @@ +import { classnames } from "@local/utilities" + +import styles from "./scalloped-edge.module.scss" + +export interface ScallopedEdgeProps { + /** + * The color variant of the breakpoint snipe. Use "light" for dark backgrounds and "dark" for light backgrounds. + * @default "light" + */ + // variant?: "light" | "dark" + className?: string +} + +export function ScallopedEdge({ + // variant = "light", + className, + ...props +}: ScallopedEdgeProps) { + return ( +