/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import React from "react"; const DEFAULT_GRADIENT_STOPS = [ { offset: "0%", color: "var(--color-orange-20)" }, { offset: "28%", color: "var(--color-orange-30)" }, { offset: "64%", color: "var(--color-pink-30)" }, { offset: "100%", color: "var(--color-pink-40)" }, ]; export const WidgetCelebration = ({ classNamePrefix = "widget-celebration", celebrationFrame, celebrationId, gradientStops = DEFAULT_GRADIENT_STOPS, headlineL10nId, illustrationSrc, onComplete, subheadL10nId, }) => { const className = suffix => suffix ? `${classNamePrefix}-${suffix}` : classNamePrefix; const resolvedIllustrationSrc = illustrationSrc?.endsWith(".svg") ? `${illustrationSrc}?run=${celebrationId}` : illustrationSrc; const strokeSize = celebrationFrame.strokeInset * 2; const strokeWidth = celebrationFrame.width - strokeSize; const strokeHeight = celebrationFrame.height - strokeSize; return (