21st.dev 원본
Grouped Input · Serafim
버튼 · MIT
갤러리 안에서는 화면을 벗어나거나 움직임을 멈추면 예제도 닫힙니다. 다시 재생할 때는 처음부터 시작해요.
저장한 HTML에서는 갤러리의 재생 설정이 적용되지 않아요.
SOURCE FILES
원본 코드 읽기
수집한 원본 소스와 실행 안내를 함께 제공합니다. 실행 HTML에는 미리보기를 위한 실행 환경이 들어 있습니다.
baseline-example.tsx
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
export function GroupWithBorder() {
return (
<div className="flex w-full max-w-[400px] -space-x-px">
<Input
type="text"
id="name"
placeholder="Enter your name"
className="rounded-r-none"
/>
<Button variant="outline" className="rounded-l-none">
Submit
</Button>
</div>
);
}LICENSE
MIT License
Copyright (c) 2024 21st.dev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
함께 쓰는 파일 13개 보기
author/apps/web/components/ui/button.tsx
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"
import * as React from "react"
import { cn } from "@/lib/utils"
const buttonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-lg text-sm font-medium transition-colors outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-ring/70 disabled:opacity-50 disabled:pointer-events-none disabled:border-primary/75 disabled:shadow-[inset_0_0.5px_0.5px_rgba(255,255,255,0.15)] [&_svg]:pointer-events-none [&_svg]:shrink-0",
{
variants: {
variant: {
default:
"relative cursor-pointer space-x-2 font-regular dark:text-foreground ease-out duration-200 outline-0 focus-visible:outline-4 focus-visible:outline-offset-1 border bg-gradient-to-b from-[hsl(var(--primary-gradient-start))] to-[hsl(var(--primary-gradient-end))] hover:opacity-90 text-primary-foreground border-[hsl(var(--primary-gradient-start))] focus-visible:outline-[hsl(var(--primary-gradient-start))] data-[state=open]:opacity-90 data-[state=open]:outline-[hsl(var(--primary-gradient-start))]",
destructive:
"bg-destructive text-destructive-foreground shadow-sm shadow-black/5 hover:bg-destructive/90",
outline:
"border border-input bg-background shadow-sm shadow-black/5 hover:bg-accent hover:text-accent-foreground",
secondary:
"bg-secondary text-secondary-foreground shadow-sm shadow-black/5 hover:bg-secondary/80",
ghost: "hover:bg-accent hover:text-accent-foreground",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
sm: "h-8 rounded-lg px-3",
// default: "h-9 px-4 py-2",
default: "h-8 rounded-lg px-3",
lg: "h-10 rounded-lg px-8",
icon: "h-8 w-8",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
)
export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
},
)
Button.displayName = "Button"
export { Button, buttonVariants }
author/apps/web/components/ui/input.tsx
import { cn } from "@/lib/utils";
import * as React from "react";
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<"input">>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-9 w-full rounded-lg border border-input bg-background px-3 py-2 text-sm text-foreground shadow-sm shadow-black/5 transition-shadow placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50",
type === "search" &&
"[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none [&::-webkit-search-results-button]:appearance-none [&::-webkit-search-results-decoration]:appearance-none",
type === "file" &&
"p-0 pr-3 italic text-muted-foreground/70 file:me-3 file:h-full file:border-0 file:border-r file:border-solid file:border-input file:bg-transparent file:px-3 file:text-sm file:font-medium file:not-italic file:text-foreground",
className,
)}
ref={ref}
{...props}
/>
);
},
);
Input.displayName = "Input";
export { Input };
author/apps/web/lib/utils.ts
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function getPackageRunner(packageManager: string) {
switch (packageManager) {
case "pnpm":
return "pnpm dlx"
case "yarn":
return "npx"
case "bun":
return "bunx --bun"
case "npm":
default:
return "npx"
}
}
export function formatDate(date: Date) {
return new Intl.DateTimeFormat("en-US", {
month: "long",
year: "numeric",
}).format(date)
}
export function appendQueryParam(url: string, param: string, value: string) {
try {
const urlObj = new URL(url)
if (!urlObj.searchParams.has(param)) {
urlObj.searchParams.append(param, value)
}
return urlObj.toString()
} catch (e) {
return url
}
}
export function replaceSpacesWithPlus(str: string) {
return str?.trim()?.replace(/\s+/g, "+")
}
export function makeSlugFromName(name: string): string {
return name
.toLowerCase()
.replace(/[^a-z0-9]+/g, "-")
.replace(/^-+|-+$/g, "")
}
export const isMac =
typeof window !== "undefined" &&
/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)
export function formatPrice(price: number) {
return new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
minimumFractionDigits: 0,
maximumFractionDigits: 2,
}).format(price)
}
/**
* Normalize file path by removing @/ prefix and ensuring consistent format
*/
export function normalizePath(path: string): string {
return path.replace(/^@\//, "/")
}
/**
* Compare two paths after normalization
*/
export function arePathsEqual(path1: string, path2: string): boolean {
return normalizePath(path1) === normalizePath(path2)
}
/**
* Check if we should hide leaderboard rankings and vote counts
* (Only show on Saturday and Sunday)
*/
export function shouldHideLeaderboardRankings(): boolean {
const now = new Date()
const day = now.getDay() // 0 is Sunday, 1 is Monday, etc.
// Show only on weekends (Saturday = 6, Sunday = 0)
// Hide on weekdays (Monday through Friday)
return !(day === 0 || day === 6)
}
export function formatK(num: number, toFixed?: number): string {
if (num >= 1000) {
return (num / 1000).toFixed(1).replace(/\.0$/, "") + "k"
}
if (toFixed) {
return num.toFixed(toFixed)
}
return Math.round(num).toString()
}
author/apps/web/app/globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;
html,
body {
width: 100%;
}
/* Safe Area support for testing in browsers */
@supports (padding: max(0px)) {
:root {
--safe-area-top: env(safe-area-inset-top, 0px);
--safe-area-bottom: env(safe-area-inset-bottom, 0px);
--safe-area-left: env(safe-area-inset-left, 0px);
--safe-area-right: env(safe-area-inset-right, 0px);
}
}
body::before {
content: "Safe bottom: " var(--safe-area-bottom);
position: fixed;
bottom: calc(100px + env(safe-area-inset-bottom, 0px));
left: 10px;
z-index: 9999;
background: #fff;
color: #000;
padding: 5px;
font-size: 12px;
pointer-events: none;
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
}
}
/* Invert colors of Lottie animations in dark mode */
.lottie-dark-mode {
color-scheme: light;
filter: brightness(0) invert(1);
}
iframe {
background: var(--background);
}
.sp-wrapper {
height: 100% !important;
width: 100% !important;
}
.sp-preview-container {
height: 100% !important;
width: 100% !important;
}
.css-29ghe2 {
z-index: 1000;
}
.css-1p3m7a8-multiValue {
background-color: #f4f4f4 !important;
border-radius: 4px !important;
}
.css-v7duua:hover {
background-color: #ffe4dd !important;
}
.css-t3ipsp-control {
border-color: transparent !important;
box-shadow: 0 0 0 1px black !important;
border-radius: 6px !important;
}
.css-b62m3t-container {
border-radius: 6px !important;
height: 36px !important;
}
.css-13cymwt-control {
border-color: hsl(var(--input)) !important;
border-width: 1px !important;
border-radius: 6px !important;
min-height: 36px !important;
height: 36px !important;
}
.sp-preview-container {
background: var(--background);
border: hsl(var(--border));
border-radius: 8px;
height: 100% !important;
width: 100% !important;
min-height: 700px;
min-width: 40vw !important;
flex-grow: 1;
}
.sp-c-ikJbEZ {
background: transparent !important;
max-height: 100%;
height: 100%;
overflow: auto;
border: transparent !important;
}
.sp-layout {
max-height: 100%;
height: 100%;
overflow: auto;
}
.cm-content {
margin-bottom: 100px !important;
}
.sp-preview-iframe {
border: none;
height: 100% !important;
width: 100% !important;
border-radius: 8px !important;
background: var(--background);
}
.sp-c-euXojQ {
height: 100% !important;
max-height: 100vh;
overflow-y: auto;
background: transparent !important;
}
.sp-c-dyHYiL {
background: transparent !important;
}
.sp-editor-viewer {
height: 100% !important;
max-height: 100%;
}
.sp-stack {
height: 100% !important;
max-height: 100%;
}
.sp-loading {
display: none !important;
}
.cm-scroller {
max-height: 100%;
overflow-y: auto;
}
.sp-c-gtcpyq {
height: 100% !important;
max-height: 100%;
overflow-y: auto;
}
.shimmer-effect {
box-sizing: border-box;
overflow: hidden;
background: rgba(255, 255, 255, 0.36);
position: absolute;
width: 25%;
height: 100%;
transition: 200ms ease-out;
transform: skewX(-45deg) translateX(-300%);
}
.group:hover .shimmer-effect {
transform: skewX(-45deg) translateX(500%);
}
.shimmer-effect::after {
display: block;
box-sizing: border-box;
content: "";
position: absolute;
width: 400%;
height: 100%;
transform: skewX(45deg) translateX(75%);
transition: 200ms ease-out;
border-width: 2px;
border-style: solid;
border-color: rgba(255, 255, 255, 0.36);
border-radius: 50%;
}
@keyframes shimmer {
0% {
background-position: -200% center;
}
100% {
background-position: 200% center;
}
}
.loading-border {
position: absolute;
inset: 0;
border-radius: 0.5rem;
padding: 1px;
background: linear-gradient(90deg,
rgba(255, 255, 255),
rgba(0, 0, 0, 0.5),
rgba(255, 255, 255));
background-size: 200% 100%;
animation: shimmer 4.5s ease-in-out infinite;
mask:
linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);
mask-composite: exclude;
pointer-events: none;
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 210 83% 53%;
--primary-foreground: 0 0% 98%;
--primary-gradient-start: 210 83% 53%;
--primary-gradient-end: 217 77% 49%;
--mono-gradient-start: 0 0% 0%;
--mono-gradient-end: 0 0% 45%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--kbd: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 100%;
--border: 240 5.9% 90%;
--input: 240 4.9% 83.9%;
--ring: 240 5% 64.9%;
--alpha-300: 240 5% 84%;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
--border-gradient-start: rgba(255, 255, 255, 0.01);
--border-gradient-mid: rgba(0, 0, 0, 0.5);
--border-gradient-end: rgba(255, 255, 255, 0.01);
}
.dark {
--background: 240 10% 3.9%;
--foreground: 240 4.8% 95.9%;
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--mono-gradient-start: 0 0% 100%;
--mono-gradient-end: 0 0% 60%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 240 5.9% 10%;
--kbd: 240 4.8% 95.9%;
--muted-foreground: 240 4.4% 58%;
--accent: 240 5.9% 10%;
--accent-foreground: 0 0% 98%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 100%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 3.8% 46.1%;
--alpha-300: 240 3.7% 15.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
--border-gradient-mid: rgba(255, 255, 255, 0.8);
}
@layer base {
:root {
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}
.dark {
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
}
@media (min-width: 720px) {
.min-720\: {
--container-x-padding: 24px;
}
}
@media (min-width: 1280px) {
.min-1280\: {
--container-x-padding: 32px;
}
}
@media (min-width: 1536px) {
.min-1536\: {
--container-x-padding: 80px;
}
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
@layer utilities {
.bg-gradient-radial {
background-image: radial-gradient(var(--tw-gradient-stops));
}
.hide-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
display: none;
}
.bg-grid-purple\/\[0\.02\] {
background-size: 30px 30px;
background-image:
linear-gradient(to right, rgb(29 31 211 / 0.02) 1px, transparent 1px),
linear-gradient(to bottom, rgb(29 31 211 / 0.02) 1px, transparent 1px);
}
.bg-grid-purple {
background-size: 30px 30px;
background-image:
linear-gradient(to right, rgb(29 31 211 / 0.05) 1px, transparent 1px),
linear-gradient(to bottom, rgb(29 31 211 / 0.05) 1px, transparent 1px);
mask-image: radial-gradient(circle at top, black 30%, transparent 70%);
-webkit-mask-image: radial-gradient(circle at top,
black 30%,
transparent 70%);
z-index: 0;
}
.bg-grid-white {
background-size: 50px 50px;
background-image:
linear-gradient(to right, rgb(255 255 255 / 0.075) 1px, transparent 1px),
linear-gradient(to bottom, rgb(255 255 255 / 0.075) 1px, transparent 1px);
mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
-webkit-mask-image: radial-gradient(circle at center,
black 40%,
transparent 100%);
transform: translateX(-10px);
z-index: 0;
}
}
[data-vaul-drawer-close-button] {
display: none;
}
@keyframes appear {
0% {
opacity: 0;
transform: translateY(20px);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
.animate-appear {
animation: appear 0.6s cubic-bezier(0.2, 0.85, 0.45, 1) forwards;
}
.delay-100 {
animation-delay: 100ms;
}
.delay-300 {
animation-delay: 300ms;
}
.delay-500 {
animation-delay: 500ms;
}
.delay-700 {
animation-delay: 700ms;
}
@keyframes slide-up-fade {
from {
opacity: 0;
transform: translateY(0.5rem);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-slide-up-fade {
animation: slide-up-fade 0.4s ease-out;
}author/apps/web/tailwind.config.js
const {
default: flattenColorPalette,
} = require("tailwindcss/lib/util/flattenColorPalette")
const plugin = require("tailwindcss/plugin")
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: ["class"],
content: [
"./pages/**/*.{ts,tsx}",
"./components/**/*.{ts,tsx}",
"./app/**/*.{ts,tsx}",
"./src/**/*.{ts,tsx}",
],
theme: {
screens: {
"min-420": "420px",
"min-720": "720px",
"min-1280": "1280px",
"min-1536": "1536px",
sm: "640px",
md: "768px",
lg: "1024px",
xl: "1280px",
"2xl": "1536px",
},
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
fontFamily: {
sans: [
"var(--font-geist-sans)",
"Geist",
"Geist Fallback",
"Arial",
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol",
],
mono: ["var(--font-geist-mono)"],
arial: ["Arial", "sans-serif"],
},
zIndex: {
9999: "9999",
},
borderColor: {
border: "hsl(var(--border))",
},
colors: {
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
chart: {
1: "hsl(var(--chart-1))",
2: "hsl(var(--chart-2))",
3: "hsl(var(--chart-3))",
4: "hsl(var(--chart-4))",
5: "hsl(var(--chart-5))",
},
sidebar: {
DEFAULT: "hsl(var(--sidebar-background))",
foreground: "hsl(var(--sidebar-foreground))",
primary: "hsl(var(--sidebar-primary))",
"primary-foreground": "hsl(var(--sidebar-primary-foreground))",
accent: "hsl(var(--sidebar-accent))",
"accent-foreground": "hsl(var(--sidebar-accent-foreground))",
border: "hsl(var(--sidebar-border))",
ring: "hsl(var(--sidebar-ring))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
boxShadow: {
base: "0 0 0 1px hsl(var(--alpha-300)), var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000)",
},
keyframes: {
"pulse-custom": {
"0%, 100%": {
transform: "scale(1)",
opacity: "1",
},
"50%": {
transform: "scale(1.2)",
opacity: "0.8",
},
},
"ping-slow": {
"75%, 100%": {
transform: "scale(1.5)",
opacity: "0",
},
},
"scale-pulse": {
"0%, 100%": {
transform: "scale(1)",
},
"50%": {
transform: "scale(1.3)",
},
},
"accordion-down": {
from: {
height: "0",
},
to: {
height: "var(--radix-accordion-content-height)",
},
},
"accordion-up": {
from: {
height: "var(--radix-accordion-content-height)",
},
to: {
height: "0",
},
},
"spin-around": {
"0%": {
transform: "translateZ(0) rotate(0)",
},
"15%, 35%": {
transform: "translateZ(0) rotate(90deg)",
},
"65%, 85%": {
transform: "translateZ(0) rotate(270deg)",
},
"100%": {
transform: "translateZ(0) rotate(360deg)",
},
},
"shimmer-slide": {
to: {
transform: "translate(calc(100cqw - 100%), 0)",
},
},
"success-pulse": {
"0%": {
opacity: 0,
},
"50%": {
opacity: 1,
},
"100%": {
opacity: 0,
},
},
"success-ring": {
"0%": {
outline: "2px solid hsl(var(--primary))",
outlineOffset: "2px",
opacity: "0",
},
"30%": {
opacity: "1",
},
"100%": {
outline: "2px solid hsl(var(--primary))",
outlineOffset: "2px",
opacity: "0",
},
},
"copy-success": {
"0%": {
opacity: "0",
},
"15%": {
opacity: "1",
},
"100%": {
opacity: "0",
},
},
"border-rotate": {
"0%": { transform: "rotate(0deg)" },
"100%": { transform: "rotate(360deg)" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
"pulse-slow": "pulse-custom 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
"pulse-fast":
"pulse-custom 2s cubic-bezier(0.4, 0, 0.6, 1) infinite 1s",
aurora: "aurora 60s linear infinite",
"shimmer-slide":
"shimmer-slide var(--speed) ease-in-out infinite alternate",
"spin-around": "spin-around calc(var(--speed) * 2) infinite linear",
"success-ring": "success-ring 850ms ease-out forwards",
"copy-success": "copy-success 1000ms ease-out forwards",
"ping-slow": "ping-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
"scale-pulse": "scale-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
"border-rotate": "border-rotate var(--duration) linear infinite",
},
backgroundImage: {
"grid-white/[0.02]": `
linear-gradient(to right, rgb(255 255 255 / 0.02) 1px, transparent 1px),
linear-gradient(to bottom, rgb(255 255 255 / 0.02) 1px, transparent 1px)
`,
},
backgroundSize: {
grid: "30px 30px",
},
},
},
plugins: [
require("tailwindcss-animate"),
require("@tailwindcss/typography"),
plugin(function ({ addUtilities }) {
addUtilities({
".scrollbar-hide": {
/* IE and Edge */
"-ms-overflow-style": "none",
/* Firefox */
"scrollbar-width": "none",
/* Safari and Chrome */
"&::-webkit-scrollbar": {
display: "none",
},
},
})
}),
addVariablesForColors,
],
}
// This plugin adds each Tailwind color as a global CSS variable, e.g. var(--gray-200).
function addVariablesForColors({ addBase, theme }) {
let allColors = flattenColorPalette(theme("colors"))
let newVars = Object.fromEntries(
Object.entries(allColors).map(([key, val]) => [`--${key}`, val]),
)
addBase({
":root": newVars,
})
}
author/apps/web/package.json
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"types": "supabase gen types --lang=typescript --project-id 'vucvdpamtrjkzmubwlts' --schema public > ./types/supabase.ts",
"supabase:login": "supabase login",
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "vitest run",
"build:css": "tailwindcss -i ./input.css -o ./public/compiled-tailwind.css --minify",
"combine-css": "node css/combinedCSS.js",
"generate-embeddings": "ts-node --project scripts/tsconfig.json scripts/generate-embeddings.ts",
"stripe:listen": "stripe listen --forward-to http://localhost:3000/api/stripe/webhook/v2",
"postinstall": "pnpx prisma generate --schema=./prisma/schema.prisma"
},
"dependencies": {
"@amplitude/analytics-browser": "^2.11.10",
"@amplitude/plugin-session-replay-browser": "^1.12.0",
"@aws-sdk/client-s3": "^3.735.0",
"@aws-sdk/credential-providers": "^3.734.0",
"@aws-sdk/s3-request-presigner": "^3.735.0",
"@babel/parser": "^7.25.6",
"@babel/traverse": "^7.25.6",
"@babel/types": "^7.25.6",
"@clerk/nextjs": "^6.11.2",
"@clerk/themes": "^2.1.35",
"@clerk/types": "^4.59.1",
"@codesandbox/sandpack-react": "^2.19.9",
"@codesandbox/sdk": "^0.11.2",
"@hookform/resolvers": "^3.9.1",
"@monaco-editor/react": "^4.6.0",
"@next/third-parties": "15.3.0",
"@number-flow/react": "^0.4.4",
"@prisma/client": "^6.8.2",
"@radix-ui/react-accordion": "^1.2.1",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-avatar": "^1.1.2",
"@radix-ui/react-checkbox": "^1.1.2",
"@radix-ui/react-collapsible": "^1.1.2",
"@radix-ui/react-context-menu": "^2.2.6",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-hover-card": "^1.1.2",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-popover": "^1.1.2",
"@radix-ui/react-progress": "^1.1.1",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.2.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.1",
"@radix-ui/react-toast": "^1.2.1",
"@radix-ui/react-toggle": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.3",
"@react-email/components": "^0.0.33",
"@repo/ui": "workspace:*",
"@stripe/connect-js": "^3.3.23",
"@supabase/auth-helpers-nextjs": "^0.10.0",
"@supabase/postgrest-js": "^1.16.2",
"@supabase/supabase-js": "^2.45.4",
"@tabler/icons-react": "^3.26.0",
"@tailwindcss/typography": "^0.5.15",
"@tanstack/react-query": "^5.59.0",
"@tanstack/react-table": "^8.21.2",
"@types/prismjs": "^1.26.4",
"autoprefixer": "^10.4.20",
"cheerio": "^1.0.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cmdk": "1.0.0",
"date-fns": "^4.1.0",
"embla-carousel-react": "^8.6.0",
"endent": "^2.1.0",
"ffmpeg": "^0.0.4",
"fs": "0.0.1-security",
"geist": "^1.3.1",
"lodash": "^4.17.21",
"lottie-react": "^2.4.1",
"lucide-react": "^0.446.0",
"micro": "^10.0.1",
"monaco-jsx-highlighter": "^2.77.77",
"motion": "^11.18.0",
"next": "15.3.0",
"next-themes": "^0.3.0",
"node-fetch": "^3.3.2",
"openai": "^4.86.1",
"postcss": "^8.4.47",
"posthog-js": "^1.239.1",
"qss": "^3.0.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-dropzone": "^14.2.9",
"react-hook-form": "^7.53.1",
"react-hotkeys-hook": "^4.6.1",
"react-resizable-panels": "^2.1.8",
"recharts": "^2.15.3",
"resend": "^4.1.2",
"shiki": "^3.0.0",
"short-uuid": "^5.2.0",
"sonner": "^1.5.0",
"stripe": "^17.6.0",
"svix": "^1.37.0",
"tailwind-merge": "^2.5.2",
"tailwindcss": "^3.4.14",
"tailwindcss-animate": "^1.0.7",
"vaul": "^1.1.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@prisma/nextjs-monorepo-workaround-plugin": "^6.7.0",
"@repo/eslint-config": "workspace:*",
"@repo/typescript-config": "workspace:*",
"@types/babel__traverse": "^7.20.6",
"@types/lodash": "^4.17.12",
"@types/node": "^20",
"@types/react": "19.1.1",
"@types/react-dom": "19.1.2",
"@types/react-syntax-highlighter": "^15.5.13",
"@types/semver": "^7.7.0",
"dotenv": "^16.4.5",
"eslint": "^8",
"eslint-config-next": "15.3.0",
"supabase": "2.22.6",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.1.3"
},
"pnpm": {
"overrides": {
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"react-is": "19.1.0"
}
},
"resolutions": {
"@types/react": "19.1.1",
"@types/react-dom": "19.1.2"
}
}
Usage.tsx실행 안내·자료
// Local host for the unchanged exact baseline demonstration.
import {GroupWithBorder as OriginalDemo} from "./baseline-example.tsx";
export default function Demo() { return <><OriginalDemo /></>; }
runtime/author-mount.tsx실행 안내·자료
/** Local sandbox host. Ready is a mount observation, never a verification result. */
import React, { Component, useEffect } from 'react';
import { createRoot } from 'react-dom/client';
declare global {
interface Window {
__STYLEGALLERY_PREVIEW__: { id: string; status: string; errors: string[] };
}
}
export function mount(Demo: React.ComponentType, id: string) {
const state = window.__STYLEGALLERY_PREVIEW__ = { id, status: 'loading', errors: [] as string[] };
const send = (message: object) => parent.postMessage({ ...message, id }, '*');
const report = (error: unknown) => {
const message = error instanceof Error ? error.message : String(error);
if (!state.errors.includes(message)) state.errors.push(message);
state.status = 'error';
document.body.dataset.previewStatus = 'error';
send({ type: 'sg-preview-error', message });
};
window.addEventListener('error', (event) => report(event.error ?? event.message));
window.addEventListener('unhandledrejection', (event) => report(event.reason));
window.addEventListener('securitypolicyviolation', (event) => report(`Blocked by preview policy: ${event.violatedDirective}`));
const theme = new URLSearchParams(location.search).get('theme') === 'dark' ? 'dark' : 'light';
document.documentElement.classList.toggle('dark', theme === 'dark');
document.documentElement.dataset.theme = theme;
// Keep original source bytes while ensuring imported attribution/navigation remains local text.
const removeDestinations = () => document.querySelectorAll('a[href]').forEach((link) => {
link.removeAttribute('href');
link.removeAttribute('target');
});
document.addEventListener('click', (event) => {
if ((event.target as Element)?.closest?.('a')) event.preventDefault();
}, true);
document.addEventListener('submit', (event) => event.preventDefault());
new MutationObserver(removeDestinations).observe(document.getElementById('root')!, { childList: true, subtree: true });
const observe = () => {
const root = document.getElementById('root')!;
const elements = Array.from(root.querySelectorAll('*'));
const rect = root.getBoundingClientRect();
const diagnostics = {
textLength: (root.textContent ?? '').trim().length,
elementCount: elements.length,
visibleElementCount: elements.filter((element) => {
const bounds = element.getBoundingClientRect();
const style = getComputedStyle(element);
return bounds.width > 0 && bounds.height > 0 && style.display !== 'none' && style.visibility !== 'hidden' && Number(style.opacity) !== 0;
}).length,
images: [],
canvases: [],
rootRect: { width: rect.width, height: rect.height },
documentWidth: document.documentElement.scrollWidth,
viewportWidth: innerWidth,
};
send({ type: 'sg-preview-observation', diagnostics });
};
class Boundary extends Component<{ children: React.ReactNode }, { error: string | null }> {
state = { error: null as string | null };
static getDerivedStateFromError(error: Error) { return { error: error.message }; }
componentDidCatch(error: Error) { report(error); }
render() { return this.state.error ? <p role="alert">This preview could not render: {this.state.error}</p> : this.props.children; }
}
function Ready() {
useEffect(() => {
const preference = matchMedia('(prefers-reduced-motion: reduce)');
const syncSVG = () => document.querySelectorAll('svg').forEach((svg) => {
if (preference.matches) svg.pauseAnimations?.();
else svg.unpauseAnimations?.();
});
syncSVG();
preference.addEventListener('change', syncSVG);
let second = 0;
let delayed = 0;
const first = requestAnimationFrame(() => { second = requestAnimationFrame(() => {
if (state.status !== 'error') {
state.status = 'mounted';
document.body.dataset.previewStatus = 'mounted';
send({ type: 'sg-preview-ready' });
observe();
delayed = window.setTimeout(observe, 700);
}
}); });
return () => {
cancelAnimationFrame(first);
cancelAnimationFrame(second);
clearTimeout(delayed);
preference.removeEventListener('change', syncSVG);
};
}, []);
return <Demo />;
}
createRoot(document.getElementById('root')!).render(<Boundary><Ready /></Boundary>);
}
runtime/author-styles.css실행 안내·자료
@import "tailwindcss";
@custom-variant dark (&:where(.dark, .dark *));
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--background);
--color-card-foreground: var(--foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--muted);
--color-secondary-foreground: var(--foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--muted);
--color-accent-foreground: var(--foreground);
--color-popover: var(--background);
--color-popover-foreground: var(--foreground);
--color-destructive: #dc2626;
--color-destructive-foreground: #ffffff;
--color-input: var(--border);
--color-border: var(--border);
--color-ring: var(--foreground);
--radius-lg: 0.5rem;
--radius-md: 0.375rem;
--radius-sm: 0.25rem;
}
:root {
--background: #ffffff;
--border: #d4d4d8;
--foreground: #18181b;
--muted: #f4f4f5;
--muted-foreground: #71717a;
--primary: #18181b;
--primary-foreground: #fafafa;
background: var(--background);
color: var(--foreground);
color-scheme: light;
font-family: Arial, sans-serif;
}
.dark {
--background: #09090b;
--border: #3f3f46;
--foreground: #fafafa;
--muted: #27272a;
--muted-foreground: #a1a1aa;
--primary: #fafafa;
--primary-foreground: #18181b;
color-scheme: dark;
}
body {
margin: 0;
min-height: 100vh;
}
#root {
align-items: center;
box-sizing: border-box;
display: flex;
justify-content: center;
min-height: 100vh;
padding: 24px;
width: 100%;
}
#root > * {
max-width: 100%;
}
noscript {
display: block;
padding: 24px;
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-play-state: paused !important;
}
}
runtime/applied-theme.css실행 안내·자료
/* Exact original HSL variables; host maps the original v3 color contract to v4. */
:root {
--background: 0 0% 100%;
--foreground: 240 10% 3.9%;
--card: 0 0% 100%;
--card-foreground: 240 10% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 240 10% 3.9%;
--primary: 210 83% 53%;
--primary-foreground: 0 0% 98%;
--primary-gradient-start: 210 83% 53%;
--primary-gradient-end: 217 77% 49%;
--mono-gradient-start: 0 0% 0%;
--mono-gradient-end: 0 0% 45%;
--secondary: 240 4.8% 95.9%;
--secondary-foreground: 240 5.9% 10%;
--muted: 240 4.8% 95.9%;
--kbd: 240 4.8% 95.9%;
--muted-foreground: 240 3.8% 46.1%;
--accent: 240 4.8% 95.9%;
--accent-foreground: 240 5.9% 10%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 100%;
--border: 240 5.9% 90%;
--input: 240 4.9% 83.9%;
--ring: 240 5% 64.9%;
--alpha-300: 240 5% 84%;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem;
--sidebar-background: 0 0% 98%;
--sidebar-foreground: 240 5.3% 26.1%;
--sidebar-primary: 240 5.9% 10%;
--sidebar-primary-foreground: 0 0% 98%;
--sidebar-accent: 240 4.8% 95.9%;
--sidebar-accent-foreground: 240 5.9% 10%;
--sidebar-border: 220 13% 91%;
--sidebar-ring: 217.2 91.2% 59.8%;
--border-gradient-start: rgba(255, 255, 255, 0.01);
--border-gradient-mid: rgba(0, 0, 0, 0.5);
--border-gradient-end: rgba(255, 255, 255, 0.01);
}
.dark {
--background: 240 10% 3.9%;
--foreground: 240 4.8% 95.9%;
--card: 240 10% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 240 10% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 240 5.9% 10%;
--mono-gradient-start: 0 0% 100%;
--mono-gradient-end: 0 0% 60%;
--secondary: 240 3.7% 15.9%;
--secondary-foreground: 0 0% 98%;
--muted: 240 5.9% 10%;
--kbd: 240 4.8% 95.9%;
--muted-foreground: 240 4.4% 58%;
--accent: 240 5.9% 10%;
--accent-foreground: 0 0% 98%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 100%;
--border: 240 3.7% 15.9%;
--input: 240 3.7% 15.9%;
--ring: 240 3.8% 46.1%;
--alpha-300: 240 3.7% 15.9%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
--sidebar-background: 240 5.9% 10%;
--sidebar-foreground: 240 4.8% 95.9%;
--sidebar-primary: 224.3 76.3% 48%;
--sidebar-primary-foreground: 0 0% 100%;
--sidebar-accent: 240 3.7% 15.9%;
--sidebar-accent-foreground: 240 4.8% 95.9%;
--sidebar-border: 240 3.7% 15.9%;
--sidebar-ring: 217.2 91.2% 59.8%;
--border-gradient-mid: rgba(255, 255, 255, 0.8);
}
:root {
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
}
.dark {
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%;
}
@theme inline {
--color-background: hsl(var(--background));
--color-foreground: hsl(var(--foreground));
--color-card: hsl(var(--card));
--color-card-foreground: hsl(var(--card-foreground));
--color-popover: hsl(var(--popover));
--color-popover-foreground: hsl(var(--popover-foreground));
--color-primary: hsl(var(--primary));
--color-primary-foreground: hsl(var(--primary-foreground));
--color-secondary: hsl(var(--secondary));
--color-secondary-foreground: hsl(var(--secondary-foreground));
--color-muted: hsl(var(--muted));
--color-muted-foreground: hsl(var(--muted-foreground));
--color-accent: hsl(var(--accent));
--color-accent-foreground: hsl(var(--accent-foreground));
--color-destructive: hsl(var(--destructive));
--color-destructive-foreground: hsl(var(--destructive-foreground));
--color-border: hsl(var(--border));
--color-input: hsl(var(--input));
--color-ring: hsl(var(--ring));
--radius-lg:var(--radius);--radius-md:calc(var(--radius) - 2px);--radius-sm:calc(var(--radius) - 4px);
}
:root { background: hsl(var(--background)); color: hsl(var(--foreground)); }
@layer base { * { border-color: hsl(var(--border)); } }THIRD-PARTY-LICENSES.txt실행 안내·자료
react 19.2.3 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
@radix-ui/react-compose-refs 1.1.1 — MIT notice from the same declared Radix primitives repository, included in @radix-ui/react-slot 1.2.3
MIT License
Copyright (c) 2022 WorkOS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
@radix-ui/react-slot 1.1.2 — MIT notice from the same declared Radix primitives repository, included in @radix-ui/react-slot 1.2.3
MIT License
Copyright (c) 2022 WorkOS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
clsx 2.1.1 — license
MIT License
Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
========================================================================
class-variance-authority 0.7.1 — LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
Copyright 2022 Joe Bell
Licensed 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 CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
========================================================================
tailwind-merge 3.3.1 — LICENSE.md
MIT License
Copyright (c) 2021 Dany Castillo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
scheduler 0.27.0 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
react-dom 19.2.3 — LICENSE
MIT License
Copyright (c) Meta Platforms, Inc. and affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
tailwindcss 4.1.13 — LICENSE
MIT License
Copyright (c) Tailwind Labs, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
tailwindcss-animate 1.0.7 — LICENSE
MIT License
Copyright (c) 2020 Jamie Kyle
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
provenance.json실행 안내·자료
{
"id": "21st-1cab4aee05b6",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"demoIdentity": {
"file": "baseline-example.tsx",
"export": "GroupWithBorder",
"source": "exact-public-demo"
},
"fidelity": {
"preserved": "21st 공개 discovery의 고유 데모 ID와 미리보기 이미지가 가리키는 원래 데모 바이트 전체",
"dependency_revision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"observed_differences": [
"원래 CDN 데모 전체를 보존하고 게시자의 공개 저장소에 있는 실제 UI 구현을 연결한다. 공개 저장소의 현재 고정 revision과 과거 비공개 내부 바이트의 동일성은 주장하지 않는다."
],
"mapping": []
},
"acquisitionLimitations": [
"CDN 데모는 SHA256으로, 작성자 원본과 의존 파일은 Git 커밋 및 blob SHA로 고정했다.",
"현재 작성자 revision의 의존 파일이 과거 21st 내부 구현과 바이트 단위로 같다는 주장은 하지 않는다.",
"다운로드한 코드를 실행하지 않았으며 브라우저·상호작용 검증은 별도 단계다."
],
"files": [
{
"file": "baseline-example.tsx",
"kind": "implementation",
"sha256": "d7610b60cb5f0cbb8bb28806e020725cdc9244e50ca20e45fa9864dd88251f47",
"sourceRevision": "sha256:d7610b60cb5f0cbb8bb28806e020725cdc9244e50ca20e45fa9864dd88251f47",
"license": "MIT"
},
{
"file": "LICENSE",
"kind": "license",
"sha256": "1c4cd4798da70ed66cfc2f9c8fd0846063a340bbad8d0ab32fe3ef340daee1cf",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/components/ui/button.tsx",
"kind": "implementation-dependency",
"sha256": "aec5faac9235b61879e2082f46aa630cc3a5d12ea3d27ce26baaa59711b1d1e5",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/components/ui/input.tsx",
"kind": "implementation-dependency",
"sha256": "dafe5ab09b470c1ea2954390397721a39c7cb5d722b6cd9c8a2a57ee2823c889",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/lib/utils.ts",
"kind": "implementation-dependency",
"sha256": "acf5b9a10f78ae8aeec455468d366ba09ed44a52d77a67a6856ea1f7176518d2",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/app/globals.css",
"kind": "theme-source",
"sha256": "3e8fa1a3a2cd369cb9ac5b5170a6c725ae0d59c4d11270d8dab942f2075c46fa",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/tailwind.config.js",
"kind": "theme-source",
"sha256": "a67de6418dbb3796dd7b6829908237cd8f38d4f253b7f19944ca06a1574858ae",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
},
{
"file": "author/apps/web/package.json",
"kind": "dependency-manifest",
"sha256": "8cebb902d1df382d13d7c3cf991a7bc09366eab6c114b57c533b4b562f168d48",
"sourceRevision": "b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf",
"license": "MIT"
}
],
"importMap": {
"@/components/ui/button": "author/apps/web/components/ui/button.tsx",
"@/components/ui/input": "author/apps/web/components/ui/input.tsx",
"@/lib/utils": "author/apps/web/lib/utils.ts"
},
"declaredDependencies": {
"@radix-ui/react-slot": "^1.2.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"react": "19.1.0",
"tailwind-merge": "^2.5.2"
},
"runtimeDependencies": {
"react": "19.2.3",
"@radix-ui/react-compose-refs": "1.1.1",
"@radix-ui/react-slot": "1.1.2",
"clsx": "2.1.1",
"class-variance-authority": "0.7.1",
"tailwind-merge": "3.3.1",
"scheduler": "0.27.0",
"react-dom": "19.2.3",
"tailwindcss": "4.1.13",
"tailwindcss-animate": "1.0.7"
},
"assets": [],
"assetAdaptations": [],
"adaptations": [
"The exact public baseline demonstration is unchanged. Imported primitives come from the pinned public publisher revision; equality with historical private implementation bytes is not claimed.",
"The host applies the original author HSL theme variables and their original color mapping. Unrelated documentation/editor CSS is not applied."
],
"runtime_verified": false
}
README.md실행 안내·자료
# Grouped Input · Serafim
The acquired original files are unchanged. Source revision: b96d84dcf748d5e56f2f72f2bab9a4f7f33574cf. Each exact file hash and any demo content revision is recorded in provenance.json. Keep all included license notices.
- The exact public baseline demonstration is unchanged. Imported primitives come from the pinned public publisher revision; equality with historical private implementation bytes is not claimed.
- The host applies the original author HSL theme variables and their original color mapping. Unrelated documentation/editor CSS is not applied.
- Host spacing and fallback tokens come from runtime/author-styles.css. runtime/applied-theme.css contains the selected original author theme and overrides fallback tokens.
Open the standalone HTML to run with all JavaScript and CSS bundled locally. ?theme=light and ?theme=dark select the host theme. The parent gallery must use an opaque allow-scripts sandbox. No external requests are required.
For source reuse, start with Usage.tsx and the unchanged baseline demonstration. Resolve @/ imports to their included matching author files and install the exact package versions in provenance.json. The host mount and styles are supplied for reference.
Build success and the ready message do not prove runtime or accessibility behavior. Browser validation is recorded separately.
BEHIND THE EXAMPLE
이 장면을 만드는 원리
맞닿은 테두리와 개별 컨트롤 크기
시각적으로 연결된 컨트롤도 크기와 초점 표시의 경계를 각각 확인합니다.
- 이 예제에서는
- 최대 400px flex 행에 -space-x-px를 주고 입력 오른쪽·버튼 왼쪽의 둥근 모서리를 없앱니다. 입력 프리미티브는 h-9, 기본 버튼은 h-8이므로 같은 높이를 선언한 구성은 아닙니다. 물리적 좌우 클래스와 음수 간격이 RTL에서도 원하는 연결을 만드는지는 별도 확인이 필요합니다.
코드와 함께 확인하기
코드에서 찾기
flex w-full max-w-[400px] -space-x-pxbaseline-example.tsx행의 폭 상한과 테두리 겹침을 정하는 원본 선언입니다.
className="rounded-r-none"baseline-example.tsx입력의 물리적 오른쪽 모서리만 제거합니다.
default: "h-8 rounded-lg px-3"button.tsx기본 버튼 높이는 입력의 h-9과 구분해야 합니다.
직접 해보기
320px 폭·긴 Submit 레이블·RTL 방향에서 입력과 버튼을 번갈아 포커스합니다.
살펴볼 변화높이 차이, 겹친 테두리, 초점 링 가림과 가로 넘침을 확인합니다. 연결된 모양만으로 동일 높이·RTL 대응을 보장하지 않습니다.
입력 예제에 아직 없는 폼 계약
입력의 이름, 값 소유자, 제출 이벤트를 시각 묶음과 별도로 선언합니다.
- 이 예제에서는
- 입력에는 id="name"과 placeholder만 있고 연결된 label·aria-label은 없습니다. value·onChange도 지정하지 않은 네이티브 입력이며, 바깥은 form이 아닌 div입니다. Submit 버튼에는 제출 처리나 검증 코드가 없어 입력 값을 저장하는 기능은 없습니다.
코드와 함께 확인하기
코드에서 찾기
placeholder="Enter your name"baseline-example.tsx입력 안내는 있지만 명시적 레이블 관계를 구성하지 않습니다.
React.ComponentProps<"input">input.tsx작성자 Input은 네이티브 입력 props를 받으며 이 데모가 별도 값·제출 정책을 추가하지 않습니다.
직접 해보기
문구를 입력해 placeholder를 없앤 뒤 접근성 트리를 확인하고 Enter와 Submit을 사용합니다.
살펴볼 변화입력 이름의 전달 상태를 실제로 기록합니다. 제출·검증·저장 결과가 구현되어 있다고 설명하지 않습니다.
실제 한글 입력기로 조합·후보 확정을 하고 붙여넣기·실행 취소를 확인합니다.
살펴볼 변화브라우저가 관리하는 편집을 원본이 별도 정규화하지 않는지 확인합니다. 이 제안만으로 IME 검증 완료를 주장하지 않습니다.
