This commit is contained in:
2026-11-21 22:57:24 +08:00
commit 4bce6dd47e
209 changed files with 11072 additions and 0 deletions
@@ -0,0 +1,12 @@
export const BoldSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M7 5h6a3.5 3.5 0 0 1 0 7H7zm6 7h1a3.5 3.5 0 0 1 0 7H7v-7"
/>
</svg>
);
@@ -0,0 +1,8 @@
export const CheckIndicatorSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M9 16.17L4.83 12l-1.42 1.41L9 19L21 7l-1.41-1.41z"
/>
</svg>
);
@@ -0,0 +1,12 @@
export const ChevronRightSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="m9 6l6 6l-6 6"
/>
</svg>
);
@@ -0,0 +1,12 @@
export const CloseSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M18 6L6 18M6 6l12 12"
></path>
</svg>
);
@@ -0,0 +1,8 @@
export const CutSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M12.14 9.342L7.37 2.329a.75.75 0 1 0-1.24.844l5.13 7.545l-2.395 3.743a4 4 0 1 0 1.178.943l2.135-3.337l2.065 3.036a4 4 0 1 0 1.261-.813l-2.447-3.597l.002-.002zM4.5 18a2.5 2.5 0 1 1 5 0a2.5 2.5 0 0 1-5 0m10 0a2.5 2.5 0 1 1 5 0a2.5 2.5 0 0 1-5 0m-.562-8.684l3.943-6.162a.75.75 0 1 0-1.263-.808L13.02 7.968z"
/>
</svg>
);
@@ -0,0 +1,6 @@
export const DownloadSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" {...props}>
<path fill="currentColor" d="M20,15.5c.55,0,1,.45,1,1v2c0,1.66-1.34,3-3,3H6c-1.66,0-3-1.34-3-3v-2c0-.55.45-1,1-1s1,.45,1,1v2c0,.55.45,1,1,1h12c.55,0,1-.45,1-1v-2c0-.55.45-1,1-1M12,2.5c.55,0,1,.45,1,1v9.59l3.29-3.29c.4-.38,1.03-.37,1.41.02.37.39.37,1,0,1.39l-5,5s-.06.06-.09.08l.09-.08c-.18.18-.42.28-.67.29h-.03s-.03,0-.03,0h-.05s.09,0,.09,0c-.22,0-.44-.07-.62-.21-.03-.02-.06-.05-.09-.08l-5-5c-.38-.4-.37-1.03.02-1.41.39-.37,1-.37,1.39,0l3.29,3.29V3.5c0-.55.45-1,1-1" />
</svg>
);
@@ -0,0 +1,14 @@
export const FileSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<g
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
>
<path d="M14 3v4a1 1 0 0 0 1 1h4" />
<path d="M17 21H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7l5 5v11a2 2 0 0 1-2 2" />
</g>
</svg>
);
@@ -0,0 +1,8 @@
export const KeySvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M7 14q-.825 0-1.412-.587T5 12t.588-1.412T7 10t1.413.588T9 12t-.587 1.413T7 14m0 4q-2.5 0-4.25-1.75T1 12t1.75-4.25T7 6q1.675 0 3.038.825T12.2 9h8.375q.2 0 .388.075t.337.225l2 2q.15.15.212.325t.063.375t-.063.375t-.212.325l-3.175 3.175q-.125.125-.3.2t-.35.1t-.35-.025t-.325-.175L17.5 15l-1.425 1.075q-.125.1-.275.15t-.3.05t-.313-.05t-.287-.15L13.375 15H12.2q-.8 1.35-2.163 2.175T7 18m0-2q1.4 0 2.463-.85T10.875 13H14l1.45 1.025v.013v-.013L17.5 12.5l1.775 1.375L21.15 12h-.012h.012l-1-1v-.012V11h-9.275q-.35-1.3-1.412-2.15T7 8Q5.35 8 4.175 9.175T3 12t1.175 2.825T7 16"
/>
</svg>
);
@@ -0,0 +1,14 @@
export const MeshSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<g
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
>
<path d="M3 9h18M3 15h18M8 4c.485.445 3.5 3.312 3.5 8c0 .663-.07 4.848-3.5 8m7-16a17 17 0 0 1 2.004 8c0 1.51-.201 4.628-2.004 8" />
<path d="M18.778 20H5.222A2.22 2.22 0 0 1 3 17.778V6.222C3 4.995 3.995 4 5.222 4h13.556C20.005 4 21 4.995 21 6.222v11.556A2.22 2.22 0 0 1 18.778 20" />
</g>
</svg>
);
@@ -0,0 +1,12 @@
export const MoonSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M12 3h.393a7.5 7.5 0 0 0 7.92 12.446A9 9 0 1 1 12 2.992z"
/>
</svg>
);
@@ -0,0 +1,8 @@
export const PasteSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M12.753 2c1.158 0 2.111.875 2.234 2h1.763a2.25 2.25 0 0 1 2.245 2.096L19 6.25a.75.75 0 0 1-.647.742L18.249 7a.75.75 0 0 1-.742-.647L17.5 6.25a.75.75 0 0 0-.648-.743L16.75 5.5h-2.132a2.24 2.24 0 0 1-1.865.993H9.247a2.24 2.24 0 0 1-1.865-.992L5.25 5.5a.75.75 0 0 0-.743.648L4.5 6.25v13.505c0 .38.282.693.648.743l.102.007h3a.75.75 0 0 1 .743.647l.007.102a.75.75 0 0 1-.75.75h-3a2.25 2.25 0 0 1-2.245-2.095L3 19.755V6.25a2.25 2.25 0 0 1 2.096-2.245L5.25 4h1.763a2.247 2.247 0 0 1 2.234-2zm5.997 6a2.25 2.25 0 0 1 2.245 2.096l.005.154v9.5a2.25 2.25 0 0 1-2.096 2.245L18.75 22h-6.5a2.25 2.25 0 0 1-2.245-2.096L10 19.75v-9.5a2.25 2.25 0 0 1 2.096-2.245L12.25 8zm0 1.5h-6.5a.75.75 0 0 0-.743.648l-.007.102v9.5c0 .38.282.694.648.743l.102.007h6.5a.75.75 0 0 0 .743-.648l.007-.102v-9.5a.75.75 0 0 0-.648-.743zm-5.997-6H9.247a.747.747 0 0 0 0 1.493h3.506a.747.747 0 1 0 0-1.493"
/>
</svg>
);
@@ -0,0 +1,12 @@
export const RulerSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M5 4h14a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1h-7a1 1 0 0 0-1 1v7a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1M4 8h2m-2 4h3m-3 4h2M8 4v2m4-2v3m4-3v2"
/>
</svg>
);
@@ -0,0 +1,8 @@
export const SearchSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M9.5 16q-2.725 0-4.612-1.888T3 9.5t1.888-4.612T9.5 3t4.613 1.888T16 9.5q0 1.1-.35 2.075T14.7 13.3l5.6 5.6q.275.275.275.7t-.275.7t-.7.275t-.7-.275l-5.6-5.6q-.75.6-1.725.95T9.5 16m0-2q1.875 0 3.188-1.312T14 9.5t-1.312-3.187T9.5 5T6.313 6.313T5 9.5t1.313 3.188T9.5 14"
/>
</svg>
);
@@ -0,0 +1,9 @@
export const SettingSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
fillRule="evenodd"
d="M12.563 3.2h-1.126l-.645 2.578l-.647.2a6.3 6.3 0 0 0-1.091.452l-.599.317l-2.28-1.368l-.796.797l1.368 2.28l-.317.598a6.3 6.3 0 0 0-.453 1.091l-.199.647l-2.578.645v1.126l2.578.645l.2.647q.173.568.452 1.091l.317.599l-1.368 2.28l.797.796l2.28-1.368l.598.317q.523.278 1.091.453l.647.199l.645 2.578h1.126l.645-2.578l.647-.2a6.3 6.3 0 0 0 1.091-.452l.599-.317l2.28 1.368l.796-.797l-1.368-2.28l.317-.598q.278-.523.453-1.091l.199-.647l2.578-.645v-1.126l-2.578-.645l-.2-.647a6.3 6.3 0 0 0-.452-1.091l-.317-.599l1.368-2.28l-.797-.796l-2.28 1.368l-.598-.317a6.3 6.3 0 0 0-1.091-.453l-.647-.199zm2.945 2.17l1.833-1.1a1 1 0 0 1 1.221.15l1.018 1.018a1 1 0 0 1 .15 1.221l-1.1 1.833q.33.62.54 1.3l2.073.519a1 1 0 0 1 .757.97v1.438a1 1 0 0 1-.757.97l-2.073.519q-.21.68-.54 1.3l1.1 1.833a1 1 0 0 1-.15 1.221l-1.018 1.018a1 1 0 0 1-1.221.15l-1.833-1.1q-.62.33-1.3.54l-.519 2.073a1 1 0 0 1-.97.757h-1.438a1 1 0 0 1-.97-.757l-.519-2.073a7.5 7.5 0 0 1-1.3-.54l-1.833 1.1a1 1 0 0 1-1.221-.15L4.42 18.562a1 1 0 0 1-.15-1.221l1.1-1.833a7.5 7.5 0 0 1-.54-1.3l-2.073-.519A1 1 0 0 1 2 12.72v-1.438a1 1 0 0 1 .757-.97l2.073-.519q.21-.68.54-1.3L4.27 6.66a1 1 0 0 1 .15-1.221L5.438 4.42a1 1 0 0 1 1.221-.15l1.833 1.1q.62-.33 1.3-.54l.519-2.073A1 1 0 0 1 11.28 2h1.438a1 1 0 0 1 .97.757l.519 2.073q.68.21 1.3.54zM12 14.8a2.8 2.8 0 1 0 0-5.6a2.8 2.8 0 0 0 0 5.6m0 1.2a4 4 0 1 1 0-8a4 4 0 0 1 0 8"
/>
</svg>
);
@@ -0,0 +1,23 @@
export const SpinnerSvg = (props: React.SVGProps<SVGSVGElement>) => {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="currentColor"
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
opacity="0.25"
/>
<path
fill="currentColor"
d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"
>
<animateTransform
attributeName="transform"
dur="0.75s"
repeatCount="indefinite"
type="rotate"
values="0 12 12;360 12 12"
/>
</path>
</svg>
);
};
@@ -0,0 +1,12 @@
export const SunSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M8 12a4 4 0 1 0 8 0a4 4 0 1 0-8 0m-5 0h1m8-9v1m8 8h1m-9 8v1M5.6 5.6l.7.7m12.1-.7l-.7.7m0 11.4l.7.7m-12.1-.7l-.7.7"
/>
</svg>
);
@@ -0,0 +1,14 @@
export const UserSvg = (props: React.SVGProps<SVGSVGElement>) => {
return (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
d="M19.618 21.25c0-3.602-4.016-6.53-7.618-6.53s-7.618 2.928-7.618 6.53M12 11.456a4.353 4.353 0 1 0 0-8.706a4.353 4.353 0 0 0 0 8.706"
/>
</svg>
);
};
@@ -0,0 +1,12 @@
export const VolumeHighSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 8a5 5 0 0 1 0 8m2.7-11a9 9 0 0 1 0 14M6 15H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h2l3.5-4.5A.8.8 0 0 1 11 5v14a.8.8 0 0 1-1.5.5z"
/>
</svg>
);
@@ -0,0 +1,12 @@
export const VolumeLowSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M15 8a5 5 0 0 1 0 8m-9-1H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h2l3.5-4.5A.8.8 0 0 1 11 5v14a.8.8 0 0 1-1.5.5z"
/>
</svg>
);
@@ -0,0 +1,12 @@
export const VolumeMuteSvg = (props: React.SVGProps<SVGSVGElement>) => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" {...props}>
<path
fill="none"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 15H4a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h2l3.5-4.5A.8.8 0 0 1 11 5v14a.8.8 0 0 1-1.5.5zm10-5l4 4m0-4l-4 4"
/>
</svg>
);
@@ -0,0 +1,54 @@
import {
type CSSProperties,
} from "react";
import { mergeClass } from "../../styles/utils/merge-class";
import { displayRecipe } from "../../styles/recipes/display-recipe";
import { dotSizeRecipe } from "../../styles/recipes/dot-size-recipe";
import type { CommonProps } from "../../utils/CommonProps";
import { brandRecipe } from "../../styles/recipes/brand-recipe";
export type BadgeProps = CommonProps & {
size?: "xs" | "sm" | "md" | "lg";
} & {
isDot?: boolean;
indicatorContent?: string;
};
export const Badge = (props: BadgeProps) => {
const {
indicatorContent = "",
isDot = false,
size = "md",
children,
className = "",
ref,
...rest
} = props;
const wrapperStyle: CSSProperties = {
position: "relative",
height: "fit",
width: "fit",
};
const indicatorStyle: CSSProperties = {
position: "absolute",
top: 0,
right: 0,
transform: "translate(50%,-50%)",
borderRadius: "9999px",
};
const indicatorClass = mergeClass(displayRecipe(), dotSizeRecipe({ size }), brandRecipe({ brand: "danger" }), "pointer-events--none", className);
return (
<div {...rest} ref={ref} style={wrapperStyle}>
{children}
<div className={indicatorClass} style={indicatorStyle}>
{indicatorContent}
</div>
</div>
);
};
@@ -0,0 +1,115 @@
import React, { useState, type CSSProperties, type ReactNode } from "react";
import { SpinnerSvg } from "../../assets/svg/SpinnerSvg";
import { Icon } from "../icon/icon";
import { displayRecipe } from "../../styles/recipes/display-recipe";
import { itemSizeRecipe } from "../../styles/recipes/item-size-recipe";
import { variantRecipe } from "../../styles/recipes/variant-recipe";
import { brandRecipe } from "../../styles/recipes/brand-recipe";
import type { CommonProps } from "../../utils/CommonProps";
import { mergeClass } from "../../styles/utils/merge-class";
export type ButtonProps = CommonProps & {
size?: "xs" | "sm" | "md" | "lg";
variant?: "filled" | "outline" | "subtle" | "ghost";
shape?: "rounded" | "square" | "circle";
brand?: "success" | "danger" | "info" | "warning" | "default";
width?: string;
} & {
isIconOnly?: boolean;
isHideIcon?: boolean;
} & {
canLoading?: boolean;
isLoading?: boolean;
} & {
iconSvg?: ReactNode;
loadingIconSvg?: ReactNode;
onClick?: (e?: React.MouseEvent<Element, MouseEvent>) => void;
};
export const Button = (props: ButtonProps) => {
const {
size = "md",
variant = "filled",
shape = "rounded",
brand,
// ===========================
style,
width,
// ===========================
isIconOnly = false,
isHideIcon = false,
// ===========================
canLoading = false,
isLoading,
// ===========================
isDisabled = false,
// =========================
className = "",
children,
// ==========================
iconSvg,
loadingIconSvg = <SpinnerSvg />,
ref,
onClick,
...rest
} = props;
const [innerIsLoading, setInnerIsIsLoading] = useState<{
state: boolean;
class: string;
}>({ state: false, class: "" });
const brandFinal =
brand != undefined ? brand : variant == "filled" ? "info" : "default";
// ====================================================================================
const rootClass = mergeClass(
displayRecipe(),
itemSizeRecipe({ size, shape, isIconOnly, isLongPadding: true }),
variantRecipe({ variant, isDisabled }),
brandRecipe({ brand: brandFinal }),
className,
);
let rootStyle: CSSProperties = {
transitionDuration: "all 5s ease-in-out",
width: width,
...style,
};
let loadingClass = mergeClass("");
// =========================================================================================
function clickHandler(e: React.MouseEvent<Element, MouseEvent>) {
if (canLoading && isLoading == undefined) {
}
onClick?.(e);
}
// =========================================================================================
const icon = <Icon size={size}>{iconSvg}</Icon>;
const loadingIcon = (
<Icon size={size} className={loadingClass}>
{loadingIconSvg}
</Icon>
);
return (
<button
{...rest}
ref={ref}
className={rootClass}
style={rootStyle}
onClick={clickHandler}
>
{canLoading && isLoading && loadingIcon}
{!isHideIcon && iconSvg && icon}
{!isIconOnly && children}
</button>
);
};
Button.displayName = "Button";
@@ -0,0 +1,36 @@
import { useState, type ComponentPropsWithRef } from "react";
import { CheckIndicatorSvg } from "../../assets/svg/CheckIndicatorSvg";
import type { CommonProps } from "../../utils/CommonProps";
import { mergeClass } from "../../styles/utils/merge-class";
import { inlineSizeRecipe } from "../../styles/recipes/inline-size-recipe";
export type CheckboxProps = CommonProps & {
size?: "sm" | "md",
defaultCheck?: boolean,
onChange?: (preCheck?: boolean, nextCheck?: boolean) => void,
controllerCheck?: boolean
};
export const Checkbox = (props: CheckboxProps) => {
const { defaultCheck = false, ref, onChange, size = "sm", className = "" } = props
const [isCheck, setIsCheck] = useState<boolean>(defaultCheck)
const rootClass = mergeClass(inlineSizeRecipe({ size, shape: "rounded", isIconOnly: true }), className)
const inputClass = mergeClass("sr-only")
const indicatorClass = mergeClass(inlineSizeRecipe({ size, shape: "rounded" }))
function clickHandler() {
const preValue = isCheck
setIsCheck(!isCheck)
onChange?.(preValue, isCheck)
}
return <div className={rootClass} onClick={clickHandler} >
<input className={inputClass} type="checkbox" ref={ref} />
{isCheck && <CheckIndicatorSvg className={indicatorClass} />}
</div>
}
Checkbox.displayName = "Checkbox"
@@ -0,0 +1,24 @@
import { Slot } from "../../utils/slot";
import type { CommonProps } from "../../utils/CommonProps";
import { inlineSizeRecipe } from "../../styles/recipes/inline-size-recipe";
import { mergeClass } from "../../styles/utils/merge-class";
export type IconProps = CommonProps & {
size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
shape?: "square" | "circle" | "rounded";
} & {
onClick?: (e?: React.MouseEvent) => void
};
export const Icon = (props: IconProps) => {
const { size = "md", className = "", children, shape = "square", ref, ...rest } = props;
const rootClass = mergeClass(inlineSizeRecipe({ size, shape, isIconOnly: "true" }), className);
return (
<Slot {...rest} ref={ref} className={rootClass}>{children}</Slot>
);
};
Icon.displayName = "Icon";
@@ -0,0 +1,86 @@
import { useMenuFloatingContext } from "./use-menu-floating-context";
import { useListItem, useMergeRefs } from "@floating-ui/react";
import { useMenuContext } from "./use-menu-context";
import React, { useState, type CSSProperties } from "react";
import { Icon } from "../icon/icon";
import { Checkbox } from "../checkbox/checkbox";
import { displayRecipe } from "../../styles/recipes/display-recipe";
import { mergeClass } from "../../styles/utils/merge-class";
import { itemSizeRecipe } from "../../styles/recipes/item-size-recipe";
import { variantRecipe } from "../../styles/recipes/variant-recipe";
import type { CommonProps } from "../../utils/CommonProps";
import { containerRecipe } from "../../styles/recipes/container-recipe";
export type MenuCheckItemProps = CommonProps & {
iconSvg?: React.ReactNode;
hotkey?: string;
check?: boolean
onChange?: (preCheck?: boolean, nextCheck?: boolean) => void
};
export const MenuCheckItem = (props: MenuCheckItemProps) => {
const { ref, children, iconSvg = <div></div>, style, hotkey, isDisabled = false, onChange, ...rest } = props;
const [isCheck, setIsCheck] = useState<boolean>(false)
// =============== Menu Context ====================================================================
const menuContext = useMenuContext();
const { size = "sm" } = menuContext!
// =============== Menu Floating Context ====================================================================
const menuFloatingContext = useMenuFloatingContext();
const { getItemProps, activeIndex, isOpen, } = menuFloatingContext!
const item = useListItem();
const isActive = item.index === activeIndex;
// ================== Style =================================================================
const rootClass = mergeClass(displayRecipe({ justifyContent: "between", }), containerRecipe({ hasFocusOutline: "false" }),
itemSizeRecipe({ size, shape: "rounded" }),
variantRecipe({ variant: "ghost", isDisabled }))
const rootStyle: CSSProperties = {
width: "100%",
...style
}
const startSectionClass = displayRecipe()
const endSectionClass = displayRecipe()
function handleOnClick() {
const preCheck = isCheck
setIsCheck(!isCheck)
onChange?.(preCheck, isCheck)
}
return <button {...rest} ref={useMergeRefs([ref, item.ref])}
className={rootClass}
role="menuitem"
tabIndex={isActive ? 0 : -1}
disabled={isDisabled}
{...getItemProps({
style: rootStyle,
onClick: handleOnClick
})
}
>
<Checkbox size={size} defaultCheck={isCheck} />
<div className={startSectionClass}>
<Icon size={size}>{iconSvg}</Icon>
{children}
</div>
<div className={endSectionClass}>
{hotkey && <div>{hotkey}</div>}
<Icon size={size}><div></div></Icon>
</div>
</button >
};
@@ -0,0 +1,55 @@
import type { ComponentPropsWithoutRef, CSSProperties } from "react";
import {
FloatingFocusManager,
FloatingList,
FloatingPortal,
} from "@floating-ui/react";
import { useMenuFloatingContext } from "./use-menu-floating-context";
import { useMenuContext } from "./use-menu-context";
import { mergeClass } from "../../styles/utils/merge-class";
import { containerRecipe } from "../../styles/recipes/container-recipe"
import { useThemeContext } from "../theme/use-theme-context";
export type MenuDropdownProps = ComponentPropsWithoutRef<"div"> & {
modal?: boolean;
};
export const MenuDropdown = (props: MenuDropdownProps) => {
const { modal = true, className = "", children, ...rest } = props;
const { size } = useMenuContext()!
const { refs, elementsRef, context, floatingStyles, getFloatingProps, isNested, isOpen } = useMenuFloatingContext()!;
// ==============================================================================================================
const { themeBaseClass, themeClass } = useThemeContext()!
// ===============================================================================================================
const rootClass = mergeClass(themeBaseClass, themeClass, containerRecipe(), className);
const padding = size == "sm" ? "4px" : (size == "md" ? "8px" : undefined);
const borderRadius = size == "sm" ? "4px" : (size == "md" ? "8px" : undefined);
const rootStyle: CSSProperties = {
...floatingStyles,
borderRadius: borderRadius,
padding: padding,
// invisable the outline
outline: 0,
background: "var(--base-bg)"
}
return <FloatingList elementsRef={elementsRef}>
{isOpen && <FloatingPortal >
<FloatingFocusManager context={context} modal={modal} >
<div {...rest} className={rootClass} style={rootStyle} ref={refs.setFloating} {...getFloatingProps()} >
{children}
</div>
</FloatingFocusManager>
</FloatingPortal>
}
</FloatingList >
};
@@ -0,0 +1,107 @@
import { useMenuFloatingContext } from "./use-menu-floating-context";
import { useListItem, useMergeRefs } from "@floating-ui/react";
import React, { type CSSProperties } from "react";
import { Icon } from "../icon/icon";
import { ChevronRightSvg } from "../../assets/svg/ChevronRightSvg";
import { useMenuTriggerContext } from "./use-menu-trigger-context";
import { useMenuContext } from "./use-menu-context";
import { mergeClass } from "../../styles/utils/merge-class";
import { displayRecipe } from "../../styles/recipes/display-recipe";
import { itemSizeRecipe } from "../../styles/recipes/item-size-recipe";
import { variantRecipe } from "../../styles/recipes/variant-recipe";
import type { CommonProps } from "../../utils/CommonProps";
import { containerRecipe } from "../../styles/recipes/container-recipe";
export type MenuItemProps = CommonProps & {
onClick?: (e?: React.MouseEvent) => void;
iconSvg?: React.ReactNode;
indicatorSvg?: React.ReactNode;
hotkey?: string;
};
export const MenuItem = (props: MenuItemProps) => {
const {
ref,
children,
iconSvg = <div></div>,
indicatorSvg = <ChevronRightSvg />,
onClick,
style,
hotkey,
isDisabled = false,
...rest
} = props;
// =============== Menu Context ====================================================================
const { size = "sm" } = useMenuContext()!;
// =============== Menu Floating Context ====================================================================
const menuFloatingContext = useMenuFloatingContext();
const { getItemProps, activeIndex, isOpen } = menuFloatingContext!;
const item = useListItem();
const isActive = item.index === activeIndex;
// =============== Menu Trigger Context ====================================================================
const menuTriggerContext = useMenuTriggerContext();
const isTrigger = !!menuTriggerContext;
// ================== Style =================================================================
const rootClass = mergeClass(
displayRecipe({ justifyContent: "between" }),
containerRecipe({ hasFocusOutline: "false" }),
itemSizeRecipe({ size, shape: "rounded" }),
variantRecipe({ variant: "ghost", isDisabled }),
);
const rootStyle: CSSProperties = {
width: "100%",
...style,
};
const startSectionClass = displayRecipe();
const endSectionClass = displayRecipe();
return (
<button
{...rest}
ref={useMergeRefs([ref, item.ref])}
className={rootClass}
role="menuitem"
tabIndex={isActive ? 0 : -1}
disabled={isDisabled}
{...getItemProps({
style: rootStyle,
onClick: (e) => {
onClick?.(e);
},
})}
>
<div className={startSectionClass}>
<Icon size={size}>{iconSvg}</Icon>
{children}
</div>
<div className={endSectionClass}>
{hotkey && <div>{hotkey}</div>}
{isTrigger && isOpen && (
<Icon size={size} style={{ rotate: "90deg" }}>
{indicatorSvg}
</Icon>
)}
{isTrigger && !isOpen && <Icon size={size}>{indicatorSvg}</Icon>}
{!isTrigger && (
<Icon size={size}>
<div></div>
</Icon>
)}
</div>
</button>
);
};
@@ -0,0 +1,24 @@
import { useState } from "react";
import type { CommonProps } from "../../utils/CommonProps";
import { MenuRadioItemGroupContext } from "./use-menu-radio-item-group-context";
import { useMenuContext } from "./use-menu-context";
export type MenuRadioItemGroupProps = CommonProps & {
size?: "sm" | "md";
defaultSelectName?: string
};
export const MenuRadioItemGroup = (props: MenuRadioItemGroupProps) => {
const { size = "sm", defaultSelectName = "", ...rest } = props
const [selectName, setSelectName] = useState<string>(defaultSelectName);
const { size: menuSize } = useMenuContext()!
const currentSize = menuSize ?? size
return <MenuRadioItemGroupContext value={{ size: currentSize, selectName, setSelectName }}>
<div {...rest} ></div>
</MenuRadioItemGroupContext>
}
@@ -0,0 +1,20 @@
import { useRef } from "react";
import type { CommonProps } from "../../utils/CommonProps";
import { useMenuRadioItemGroupContext } from "./use-menu-radio-item-group-context";
export type MenuRadioItemProps = CommonProps & {
name: string;
iconSvg?: React.ReactNode;
hotkey?: string;
onChange?: (preCheck?: boolean, nextCheck?: boolean) => void
};
export const MenuRadioItem = (props: MenuRadioItemProps) => {
const { name, children, className, hotkey, onChange, ref, iconSvg, style } = props
const { selectName, setSelectName } = useMenuRadioItemGroupContext()!
const isSelect = name === selectName
return <div></div>
}
@@ -0,0 +1,25 @@
import type { ComponentPropsWithoutRef } from "react";
import { useMenuFloatingContext } from "./use-menu-floating-context";
import { Slot } from "../../utils/slot";
import { MenuTriggerContext } from "./use-menu-trigger-context";
export type MenuTriggerProps = ComponentPropsWithoutRef<"div">;
export const MenuTrigger = (props: MenuTriggerProps) => {
const { children } = props;
const menuFloatingContext = useMenuFloatingContext();
const { refs, setIsOpen, getReferenceProps } = menuFloatingContext!;
return (
<MenuTriggerContext.Provider value={{ isTrigger: true }}>
<Slot className={"reset"} ref={refs.setReference} {...getReferenceProps(
{ onClick: () => { setIsOpen(true) } }
)}>
{children}
</Slot>
</MenuTriggerContext.Provider>
)
};
@@ -0,0 +1,55 @@
import {
FloatingNode,
FloatingTree,
} from "@floating-ui/react";
import type { ComponentPropsWithoutRef } from "react";
import { useMenuFloating } from "./use-menu-floating";
import { MenuFloatingContext } from "./use-menu-floating-context";
import { MenuContext } from "./use-menu-context";
import { mergeClass } from "../../styles/utils/merge-class";
export type MenuProps = ComponentPropsWithoutRef<"div"> & {
size?: "sm" | "md";
};
export const Menu = (props: MenuProps) => {
const { size = "sm", className = "", children, ...rest } = props;
const menuFloatingContextValue = useMenuFloating();
const { isNested, nodeId } = menuFloatingContextValue!
// ==========================================================================================
const rootClass = mergeClass("position--relative",className)
// ==========================================================================================
if (!isNested) {
return (
<MenuContext.Provider value={{ size }}>
<MenuFloatingContext.Provider value={menuFloatingContextValue}>
<FloatingTree>
<FloatingNode id={nodeId}>
<div {...rest} className={rootClass}>
{children}
</div>
</FloatingNode>
</FloatingTree>
</MenuFloatingContext.Provider>
</MenuContext.Provider>
);
}
return (
<MenuContext.Provider value={{ size }}>
<MenuFloatingContext.Provider value={menuFloatingContextValue}>
<FloatingNode id={nodeId}>
<div {...rest} className={rootClass} >
{children}
</div>
</FloatingNode>
</MenuFloatingContext.Provider>
</MenuContext.Provider>
);
};
@@ -0,0 +1,11 @@
import { createContext, useContext } from "react";
export type MenuContextValue = { size?: "sm" | "md" } | null;
export const MenuContext = createContext<MenuContextValue>(null);
export function useMenuContext() {
const menuContext = useContext(MenuContext);
return menuContext;
}
@@ -0,0 +1,15 @@
import { createContext, useContext } from "react";
import type { useMenuFloating } from "./use-menu-floating";
export type MenuFloatingContextValue = ReturnType<
typeof useMenuFloating
> | null;
export const MenuFloatingContext =
createContext<MenuFloatingContextValue>(null);
export function useMenuFloatingContext() {
const menuFloatingContext = useContext(MenuFloatingContext);
return menuFloatingContext;
}
@@ -0,0 +1,91 @@
import {
autoUpdate,
flip,
offset,
safePolygon,
shift,
useClick,
useDismiss,
useFloating,
useFloatingNodeId,
useFloatingParentNodeId,
useHover,
useInteractions,
useListNavigation,
useRole,
} from "@floating-ui/react";
import { useRef, useState } from "react";
export function useMenuFloating() {
const [isOpen, setIsOpen] = useState(false);
const [activeIndex, setActiveIndex] = useState<number | null>(null);
const [selectedIndex, setSelectedIndex] = useState<number | null>(null);
const nodeId = useFloatingNodeId();
const parentId = useFloatingParentNodeId();
const isNested = parentId != null;
const elementsRef = useRef<Array<HTMLElement | null>>([]);
const { refs, floatingStyles, context } = useFloating({
nodeId,
placement: isNested ? "right-start" : "bottom-start",
open: isOpen,
onOpenChange: setIsOpen,
whileElementsMounted: autoUpdate,
middleware: [
offset({
mainAxis: isNested ? 0 : 4,
alignmentAxis: isNested ? -4 : 0,
}),
flip(),
shift(),
],
});
const hover = useHover(context, {
enabled: isNested,
delay: { open: 75 },
handleClose: safePolygon({ blockPointerEvents: true }),
});
const click = useClick(context, {
event: "mousedown",
toggle: !isNested,
ignoreMouse: isNested,
});
const role = useRole(context, { role: "menu" });
const dismiss = useDismiss(context, { bubbles: true });
const listNav = useListNavigation(context, {
listRef: elementsRef,
activeIndex,
selectedIndex,
nested: isNested,
onNavigate: setActiveIndex,
});
const { getReferenceProps, getFloatingProps, getItemProps } = useInteractions(
[hover, click, dismiss, role, listNav],
);
return {
nodeId,
parentId,
isNested,
refs,
floatingStyles,
context,
getReferenceProps,
getFloatingProps,
getItemProps,
elementsRef,
selectedIndex,
setSelectedIndex,
activeIndex,
isOpen,
setIsOpen
};
}
@@ -0,0 +1,13 @@
import { createContext, useContext } from "react";
export type MenuRadioItemGroupContextValue = {
size: "sm" | "md"
selectName: string;
setSelectName: React.Dispatch<React.SetStateAction<string>>;
} | null;
export const MenuRadioItemGroupContext = createContext<MenuRadioItemGroupContextValue>(null)
export function useMenuRadioItemGroupContext() {
return useContext(MenuRadioItemGroupContext)
}
@@ -0,0 +1,10 @@
import { createContext, useContext } from "react";
export type MenuTriggerContextValue = { isTrigger?: boolean } | null;
export const MenuTriggerContext = createContext<MenuTriggerContextValue>(null);
export function useMenuTriggerContext() {
return useContext(MenuTriggerContext);
}
@@ -0,0 +1,84 @@
import type { CSSProperties } from "react";
import type { CommonProps } from "../../utils/CommonProps";
import { usePopoverContext } from "./use-popover-context";
import {
FloatingArrow,
FloatingFocusManager,
FloatingPortal,
} from "@floating-ui/react";
import { useThemeContext } from "../theme/use-theme-context";
import { mergeClass } from "../../styles/utils/merge-class";
import { variantRecipe } from "../../styles/recipes/variant-recipe";
import { brandRecipe } from "../../styles/recipes/brand-recipe";
import { containerRecipe } from "../../styles/recipes/container-recipe";
export type PopoverDropdownProps = CommonProps;
export const PopoverDropdown = (props: PopoverDropdownProps) => {
const { children, className = "", style, ...rest } = props;
const {
refs,
floatingStyles,
getFloatingProps,
context,
arrowRef,
isMounted,
transitionStyles,
arrowWidth,
arrowHeight,
} = usePopoverContext()!;
const { themeClass, themeBaseClass } = useThemeContext()!;
const rootClass = mergeClass(
"text--md",
containerRecipe({
boxShadow: true,
rounded: 8,
padding: 12,
background: "base",
hasFocusOutline: "false",
}),
brandRecipe(),
themeBaseClass,
themeClass,
className,
);
const rootStyle: CSSProperties = {
...transitionStyles,
...floatingStyles,
...style,
};
const arrowStyle: CSSProperties = {
fill: "var(--base-background)",
};
return (
<>
{isMounted && (
<FloatingPortal>
<FloatingFocusManager context={context} modal={false}>
<div
className={rootClass}
ref={refs.setFloating}
style={rootStyle}
{...getFloatingProps({ ...rest })}
>
{children}
<FloatingArrow
ref={arrowRef}
context={context}
width={arrowWidth}
height={arrowHeight}
style={arrowStyle}
></FloatingArrow>
</div>
</FloatingFocusManager>
</FloatingPortal>
)}
</>
);
};
@@ -0,0 +1,17 @@
import type { CommonProps } from "../../utils/CommonProps"
import { Slot } from "../../utils/slot";
import { usePopoverContext } from "./use-popover-context";
export type PopoverTriggerProps = CommonProps
export const PopoverTrigger = (props: PopoverTriggerProps) => {
const { children, ...rest } = props;
const { refs, getReferenceProps, setIsOpen, isOpen } = usePopoverContext()!
return <Slot ref={refs.setReference} {...getReferenceProps(
{ ...rest, onClick: () => { setIsOpen(!isOpen) } }
)}>
{children}
</Slot>
}
@@ -0,0 +1,16 @@
import type { CommonProps } from "../../utils/CommonProps"
import { PopoverContext } from "./use-popover-context"
import { usePopoverFloating } from "./use-popover-floating"
export type PopoverProps = CommonProps & {
}
export const Popover = (props: PopoverProps) => {
const { children } = props
const popoverFloatingContext = usePopoverFloating()
return <PopoverContext.Provider value={popoverFloatingContext}>
<div>{children}</div>
</PopoverContext.Provider>
}
@@ -0,0 +1,15 @@
import { createContext, useContext } from "react";
import type { usePopoverFloating } from "./use-popover-floating";
export type PopoverContextValue = ReturnType<
typeof usePopoverFloating
> | null;
export const PopoverContext =
createContext<PopoverContextValue>(null);
export function usePopoverContext() {
const popoverContext = useContext(PopoverContext);
return popoverContext;
}
@@ -0,0 +1,83 @@
import { arrow, autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useInteractions, useRole, useTransitionStyles } from "@floating-ui/react";
import { useMemo, useRef, useState } from "react";
export function usePopoverFloating() {
const [isOpen, setIsOpen] = useState(false);
const arrowRef = useRef(null);
// 拉扯 svg 图像,让三角变得,更尖更长,或者更宽更扁
const arrowWidth = 16
const arrowHeight = 8
const { refs, floatingStyles, context, middlewareData } = useFloating({
placement: "top-start",
open: isOpen,
onOpenChange: setIsOpen,
whileElementsMounted: autoUpdate,
middleware: [
offset(arrowHeight),
flip({ padding: 8 }),
// 偏移完成后,再留 8px 空白,而不是紧贴着父容器
shift({ padding: 8 }),
arrow({
element: arrowRef,
}),
],
});
// 这两个是未经 useFloating 变换前的坐标
// 也就是 arrow 悬浮,左对齐 floating,两者水平中线重合
const arrowX = middlewareData.arrow?.x ?? 0;
const arrowY = middlewareData.arrow?.y ?? 0;
// 变换中心的起始坐标就是 floating 的左上角
const transformX = arrowX + arrowWidth / 2;
const transformY = arrowY + arrowHeight;
// style 用于内容框,而不是 FloatingArrow
const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
duration: 150,
initial: {
opacity: 0,
transform: "scale(0)"
},
close: {
opacity: 0
},
common: ({ side }) => ({
transitionTimingFunction: "ease",
transformOrigin: {
top: `${transformX}px calc(100% + ${arrowHeight}px)`,
bottom: `${transformX}px ${-arrowHeight}px`,
left: `calc(100% + ${arrowHeight}px) ${transformY}px`,
right: `${-arrowHeight}px ${transformY}px`
}[side]
})
})
const click = useClick(context);
const dismiss = useDismiss(context);
const role = useRole(context);
const { getReferenceProps, getFloatingProps } = useInteractions([
click,
dismiss,
role,
]);
return useMemo(() => ({
isOpen,
setIsOpen,
/* only use at {isMounted && <FloatingPortal/>} */
isMounted,
arrowRef,
arrowHeight,
arrowWidth,
refs,
floatingStyles,
transitionStyles,
context,
getReferenceProps,
getFloatingProps
}), [isOpen, setIsOpen, isMounted, refs, arrowHeight, arrowWidth, arrowRef, floatingStyles, transitionStyles, context, getReferenceProps, getFloatingProps])
}
@@ -0,0 +1,23 @@
import type { CSSProperties } from "react";
export const Slider = () => {
const sliderStyle: CSSProperties = {
display: "flex",
flexWrap: "nowrap",
justifyContent: "center",
alignItems: "center",
userSelect: "none",
};
const sliderThumbStyle: CSSProperties = {
height: "16px",
width: "16px",
};
const sliderRailStyle: CSSProperties = {
height: "6px",
width: "auto",
};
return <div></div>
};
@@ -0,0 +1,63 @@
import { Icon } from "../icon/icon";
import { CloseSvg } from "../../assets/svg/CloseSvg";
import { displayRecipe } from "../../styles/recipes/display-recipe";
import { itemSizeRecipe } from "../../styles/recipes/item-size-recipe";
import { brandRecipe } from "../../styles/recipes/brand-recipe";
import { variantRecipe } from "../../styles/recipes/variant-recipe";
import type { CommonProps } from "../../utils/CommonProps";
import { useState, type ReactNode } from "react";
import { mergeClass } from "../../styles/utils/merge-class";
export type TagProps = CommonProps & {
size?: "xs" | "sm";
variant?: "filled" | "outline";
brand?: "success" | "danger" | "info" | "warning" | "default";
color?: string;
background?: string;
borderColor?: string;
} & {
isClosable?: boolean;
onClose?: () => void;
};
export const Tag = (props: TagProps) => {
const {
className = "",
children,
size = "xs",
brand = "info",
color,
background,
borderColor,
onClose,
...rest
} = props;
const rootClass = mergeClass(
displayRecipe(),
variantRecipe({ variant: "filled", isUnclickable: true }),
itemSizeRecipe({ size, shape: 'rounded' }),
className,
);
const closeIconClase = mergeClass(
variantRecipe({ variant: "ghost" }),
brandRecipe({ brand: "default" }),
"cursor--pointer"
);
return (
<div {...rest} className={rootClass} style={{ color: color, background: background, borderColor: borderColor }}>
{children}
<Icon
className={closeIconClase}
size={size}
shape={"circle"}
onClick={onClose}
>
<CloseSvg />
</Icon>
</div>
);
};
@@ -0,0 +1,27 @@
import { useState } from "react";
import type { CommonProps } from "../../utils/CommonProps";
import { ThemeContext } from "./use-theme-context";
import { mergeClass } from "../../styles/utils/merge-class";
export type ThemeProps = CommonProps & {
theme?: "theme--light" | "theme--dark" | string;
};
export const Theme = (props: ThemeProps) => {
const { children, className = "", theme = "theme--light" } = props;
const [themeClass, setThemeClass] = useState<string>(theme);
const themeBaseClass = "theme-base";
const rootClass = mergeClass(themeBaseClass, theme, className);
return (
<ThemeContext.Provider
value={{ themeBaseClass, themeClass, setThemeClass }}
>
<div className={rootClass}>{children}</div>
</ThemeContext.Provider>
);
};
@@ -0,0 +1,14 @@
import { createContext, useContext } from "react";
export type ThemeContextValue = {
themeBaseClass: string;
themeClass: string;
setThemeClass: (v: string) => void;
} | null;
export const ThemeContext = createContext<ThemeContextValue>(null);
export function useThemeContext() {
const themeContext = useContext(ThemeContext);
return themeContext;
}
+55
View File
@@ -0,0 +1,55 @@
@import './styles/css/z-index.css';
@import './styles/css/width-item.css';
@import './styles/css/width-inline.css';
@import './styles/css/width-dot.css';
@import './styles/css/white-space.css';
@import './styles/css/visibility.css';
@import './styles/css/variant.css';
@import './styles/css/variant-unclickable.css';
@import './styles/css/variant-disabled.css';
@import './styles/css/user-select.css';
@import './styles/css/transition.css';
@import './styles/css/theme.css';
@import './styles/css/theme-base.css';
@import './styles/css/text-align.css';
@import './styles/css/screen-reader.css';
@import './styles/css/position.css';
@import './styles/css/pointer-events.css';
@import './styles/css/padding.css';
@import './styles/css/padding-long.css';
@import './styles/css/overscroll-behavior.css';
@import './styles/css/overflow.css';
@import './styles/css/outline.css';
@import './styles/css/max-width.css';
@import './styles/css/max-height.css';
@import './styles/css/justify-self.css';
@import './styles/css/justify-items.css';
@import './styles/css/justify-content.css';
@import './styles/css/height-item.css';
@import './styles/css/height-inline.css';
@import './styles/css/height-dot.css';
@import './styles/css/gap.css';
@import './styles/css/font-weight.css';
@import './styles/css/font-size.css';
@import './styles/css/font-family.css';
@import './styles/css/flex-wrap.css';
@import './styles/css/flex-shrink.css';
@import './styles/css/flex-direction.css';
@import './styles/css/drop-shadow.css';
@import './styles/css/display.css';
@import './styles/css/cursor.css';
@import './styles/css/color.css';
@import './styles/css/break-before.css';
@import './styles/css/break-after.css';
@import './styles/css/brand.css';
@import './styles/css/box-sizing.css';
@import './styles/css/box-shadow.css';
@import './styles/css/box-inside.css';
@import './styles/css/box-decoration.css';
@import './styles/css/border.css';
@import './styles/css/border-radius.css';
@import './styles/css/background.css';
@import './styles/css/animation.css';
@import './styles/css/align-self.css';
@import './styles/css/align-items.css';
@import './styles/css/align-content.css';
+59
View File
@@ -0,0 +1,59 @@
export * from './utils/state-registry.ts';
export * from './utils/slot.tsx';
export * from './utils/merge-props.ts';
export * from './utils/CommonProps.ts';
export * from './utils/camelToKebab.ts';
export * from './styles/utils/merge-class.ts';
export * from './styles/utils/create-class-recipe.ts';
export * from './styles/recipes/variant-recipe.ts';
export * from './styles/recipes/item-size-recipe.ts';
export * from './styles/recipes/inline-size-recipe.ts';
export * from './styles/recipes/dot-size-recipe.ts';
export * from './styles/recipes/display-recipe.ts';
export * from './styles/recipes/container-recipe.ts';
export * from './styles/recipes/brand-recipe.ts';
export * from './components/theme/use-theme-context.ts';
export * from './components/theme/theme.tsx';
export * from './components/tag/tag.tsx';
export * from './components/slider/slider.tsx';
export * from './components/popover/use-popover-floating.ts';
export * from './components/popover/use-popover-context.ts';
export * from './components/popover/popover.tsx';
export * from './components/popover/popover-trigger.tsx';
export * from './components/popover/popover-dropdown.tsx';
export * from './components/menu/use-menu-trigger-context.ts';
export * from './components/menu/use-menu-radio-item-group-context.ts';
export * from './components/menu/use-menu-floating.ts';
export * from './components/menu/use-menu-floating-context.ts';
export * from './components/menu/use-menu-context.ts';
export * from './components/menu/menu.tsx';
export * from './components/menu/menu-trigger.tsx';
export * from './components/menu/menu-radio-item.tsx';
export * from './components/menu/menu-radio-item-group.tsx';
export * from './components/menu/menu-item.tsx';
export * from './components/menu/menu-dropdown.tsx';
export * from './components/menu/menu-check-item.tsx';
export * from './components/icon/icon.tsx';
export * from './components/checkbox/checkbox.tsx';
export * from './components/button/button.tsx';
export * from './components/badge/badge.tsx';
export * from './assets/svg/VolumeMuteSvg.tsx';
export * from './assets/svg/VolumeLowSvg.tsx';
export * from './assets/svg/VolumeHighSvg.tsx';
export * from './assets/svg/UserSvg.tsx';
export * from './assets/svg/SunSvg.tsx';
export * from './assets/svg/SpinnerSvg.tsx';
export * from './assets/svg/SettingSvg.tsx';
export * from './assets/svg/SearchSvg.tsx';
export * from './assets/svg/Ruler.tsx';
export * from './assets/svg/PasteSvg.tsx';
export * from './assets/svg/MoonSvg.tsx';
export * from './assets/svg/MeshSvg.tsx';
export * from './assets/svg/KeySvg.tsx';
export * from './assets/svg/FileSvg.tsx';
export * from './assets/svg/DownloadSvg.tsx';
export * from './assets/svg/CutSvg.tsx';
export * from './assets/svg/CloseSvg.tsx';
export * from './assets/svg/ChevronRightSvg.tsx';
export * from './assets/svg/CheckIndicatorSvg.tsx';
export * from './assets/svg/BoldSvg.tsx';
@@ -0,0 +1,37 @@
@layer utility {
.align-content--normal {
align-content: normal;
}
.align-content--center {
align-content: center;
}
.align-content--start {
align-content: flex-start;
}
.align-content--end {
align-content: flex-end;
}
.align-content--between {
align-content: space-between;
}
.align-content--around {
align-content: space-around;
}
.align-content--evenly {
align-content: space-evenly;
}
.align-content--baseline {
align-content: baseline;
}
.align-content--stretch {
align-content: stretch;
}
}
@@ -0,0 +1,33 @@
@layer utility {
.items--start {
align-items: flex-start;
}
.items--end {
align-items: flex-end;
}
.items-end--safe {
align-items: safe flex-end;
}
.items--center {
align-items: center;
}
.items--center-safe {
align-items: safe center;
}
.items--baseline {
align-items: baseline;
}
.items--baseline-last {
align-items: last baseline;
}
.items--stretch {
align-items: stretch;
}
}
@@ -0,0 +1,37 @@
@layer utility {
.align-self--auto {
align-self: auto;
}
.align-self--start {
align-self: flex-start;
}
.align-self--end {
align-self: flex-end;
}
.align-self--end-safe {
align-self: safe flex-end;
}
.align-self--center {
align-self: center;
}
.align-self--center-safe {
align-self: safe center;
}
.align-self--stretch {
align-self: stretch;
}
.align-self--baseline {
align-self: baseline;
}
.align-self--baseline-last {
align-self: last baseline;
}
}
@@ -0,0 +1,106 @@
@layer utility {
.animate--fade-in-down {
animation: var(--animate-fade-in-down);
@keyframes fade-in-down {
from {
opacity: 0;
transform: translate3d(0, -100%, 0);
}
to {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}
}
.animate--fade-out-down {
animation: var(--animate-fade-out-down);
}
@keyframes fade-out-down {
from {
opacity: 1;
transform: translate3d(0, 0, 0);
}
to {
opacity: 0;
transform: translate3d(0, 100%, 0);
}
}
.animate--fade-in-up {
animation: var(--animate-fade-in-up);
}
@keyframes fade-in-up {
from {
opacity: 0;
transform: translate3d(0, 100%, 0);
}
to {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}
.animate--fade-out-up {
animation: var(--animate-fade-out-up);
}
@keyframes fade-out-up {
from {
opacity: 1;
transform: translate3d(0, 0, 0);
}
to {
opacity: 0;
transform: translate3d(0, -100%, 0);
}
}
.animate--spin {
animation: var(--animate-spin);
@keyframes spin {
to {
transform: rotate(360deg);
}
}
}
.animate--ping {
animation: var(--animate-ping);
@keyframes ping {
75%,
100% {
transform: scale(2);
opacity: 0;
}
}
}
.animate--pulse {
animation: var(--animate-pulse);
@keyframes pulse {
50% {
opacity: 0.5;
}
}
}
.animate--bounce {
animation: var(--animate-bounce); /* bounce 1s infinite */
@keyframes bounce {
0%,
100% {
transform: translateY(-25%);
animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
}
50% {
transform: none;
animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
}
}
}
.animate--none {
animation: none;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.background--base {
background: var(--base-background);
}
}
@@ -0,0 +1,53 @@
@layer utility {
.rounded--full {
border-radius: 9999px;
}
.rounded--none {
border-radius: 0;
}
.rounded--xs {
border-radius: var(--radius-xs);
}
.rounded--sm {
border-radius: var(--radius-sm);
}
.rounded--md {
border-radius: var(--radius-md);
}
.rounded--lg {
border-radius: var(--radius-lg);
}
.rounded--xl {
border-radius: var(--radius-xl);
}
.rounded--2xl {
border-radius: var(--radius-2xl);
}
.rounded--3xl {
border-radius: var(--radius-3xl);
}
.rounded--4 {
border-radius: var(--radius-4);
}
.rounded--8 {
border-radius: var(--radius-8);
}
.rounded--12 {
border-radius: var(--radius-12);
}
.rounded--16 {
border-radius: var(--radius-16);
}
}
@@ -0,0 +1,6 @@
@layer utility {
.border--1 {
border: var(--border-1);
border-color: var(--brand-background-high-active);
}
}
@@ -0,0 +1,9 @@
@layer utility {
.box-decoration--clone {
box-decoration-break: clone;
}
.box-decoration--slice {
box-decoration-break: slice;
}
}
@@ -0,0 +1,17 @@
@layer utility {
.break-inside--auto {
break-inside: auto;
}
.break-inside--avoid {
break-inside: avoid;
}
.break-inside--avoid-page {
break-inside: avoid-page;
}
.break-inside--avoid-column {
break-inside: avoid-column;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.box-shadow {
box-shadow: var(--box-shadow);
}
}
@@ -0,0 +1,9 @@
@layer utility {
.box-sizing--border {
box-sizing: border-box;
}
.box-sizing--content {
box-sizing: content-box;
}
}
@@ -0,0 +1,48 @@
@layer utility {
.brand--default {
--brand-background-high: var(--default-background-high);
--brand-background-high-hover: var(--default-background-high-hover);
--brand-background-high-active: var(--default-background-high-active);
--brand-background-low: var(--default-background-low);
--brand-background-low-hover: var(--default-background-low-hover);
--brand-background-low-active: var(--default-background-low-active);
}
.brand--info {
--brand-background-high: var(--info-background-high);
--brand-background-high-hover: var(--info-background-high-hover);
--brand-background-high-active: var(--info-background-high-active);
--brand-background-low: var(--info-background-low);
--brand-background-low-hover: var(--info-background-low-hover);
--brand-background-low-active: var(--info-background-low-active);
}
.brand--danger {
--brand-background-high: var(--danger-background-high);
--brand-background-high-hover: var(--danger-background-high-hover);
--brand-background-high-active: var(--danger-background-high-active);
--brand-background-low: var(--danger-background-low);
--brand-background-low-hover: var(--danger-background-low-hover);
--brand-background-low-active: var(--danger-background-low-active);
}
.brand--success {
--brand-background-high: var(--success-background-high);
--brand-background-high-hover: var(--success-background-high-hover);
--brand-background-high-active: var(--success-background-high-active);
--brand-background-low: var(--success-background-low);
--brand-background-low-hover: var(--success-background-low-hover);
--brand-background-low-active: var(--success-background-low-active);
}
.brand--warning {
--brand-background-high: var(--warning-background-high);
--brand-background-high-hover: var(--warning-background-high-hover);
--brand-background-high-active: var(--warning-background-high-active);
--brand-background-low: var(--warning-background-low);
--brand-background-low-hover: var(--warning-background-low-hover);
--brand-background-low-active: var(--warning-background-low-active);
}
}
@@ -0,0 +1,33 @@
@layer utility {
.break-after--auto {
break-after: auto;
}
.break-after--avoid {
break-after: avoid;
}
.break-after--all {
break-after: all;
}
.break-after--avoid-page {
break-after: avoid-page;
}
.break-after--page {
break-after: page;
}
.break-after--left {
break-after: left;
}
.break-after--right {
break-after: right;
}
.break-after--column {
break-after: column;
}
}
@@ -0,0 +1,33 @@
@layer utility {
.break-before--auto {
break-before: auto;
}
.break-before--avoid {
break-before: avoid;
}
.break-before--all {
break-before: all;
}
.break-before--avoid-page {
break-before: avoid-page;
}
.break-before--page {
break-before: page;
}
.break-before--left {
break-before: left;
}
.break-before--right {
break-before: right;
}
.break-before--column {
break-before: column;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.color--white {
color: white;
}
}
+111
View File
@@ -0,0 +1,111 @@
@layer utility {
/* ===== 基础光标 ===== */
.cursor--auto {
cursor: auto;
}
.cursor--default {
cursor: default;
}
.cursor--pointer {
cursor: pointer;
}
.cursor--wait {
cursor: wait;
}
.cursor--text {
cursor: text;
}
.cursor--move {
cursor: move;
}
.cursor--help {
cursor: help;
}
.cursor--not-allowed {
cursor: not-allowed;
}
/* ===== 拖拽 / 抓取 ===== */
.cursor--grab {
cursor: grab;
}
.cursor--grabbing {
cursor: grabbing;
}
/* ===== 调整大小(通用 & 方向)===== */
.cursor--resize {
cursor: resize;
}
.cursor--ew-resize {
cursor: ew-resize;
}
.cursor--ns-resize {
cursor: ns-resize;
}
.cursor--nesw-resize {
cursor: nesw-resize;
}
.cursor--nwse-resize {
cursor: nwse-resize;
}
.cursor--col-resize {
cursor: col-resize;
}
.cursor--row-resize {
cursor: row-resize;
}
.cursor--n-resize {
cursor: n-resize;
}
.cursor--e-resize {
cursor: e-resize;
}
.cursor--s-resize {
cursor: s-resize;
}
.cursor--w-resize {
cursor: w-resize;
}
.cursor--ne-resize {
cursor: ne-resize;
}
.cursor--nw-resize {
cursor: nw-resize;
}
.cursor--se-resize {
cursor: se-resize;
}
.cursor--sw-resize {
cursor: sw-resize;
}
/* ===== 视觉反馈 ===== */
.cursor--crosshair {
cursor: crosshair;
}
.cursor--progress {
cursor: progress;
}
.cursor--no-drop {
cursor: no-drop;
}
.cursor--vertical-text {
cursor: vertical-text;
}
/* ===== 现代 / 扩展光标 ===== */
.cursor--zoom-in {
cursor: zoom-in;
}
.cursor--zoom-out {
cursor: zoom-out;
}
.cursor--alias {
cursor: alias;
}
.cursor--copy {
cursor: copy;
}
}
@@ -0,0 +1,90 @@
@layer utility {
/* 基础 display */
.display--inline {
display: inline;
}
.display--block {
display: block;
}
.display--inline-block {
display: inline-block;
}
.display--flow-root {
display: flow-root;
}
.display--contents {
display: contents;
}
.display--none {
display: none;
}
/* Flex */
.display--flex {
display: flex;
}
.display--inline-flex {
display: inline-flex;
}
/* Grid */
.display--grid {
display: grid;
}
.display--inline-grid {
display: inline-grid;
}
/* Table */
.display--table {
display: table;
}
.display--inline-table {
display: inline-table;
}
.display--table-caption {
display: table-caption;
}
.display--table-cell {
display: table-cell;
}
.display--table-column {
display: table-column;
}
.display--table-column-group {
display: table-column-group;
}
.display--table-footer-group {
display: table-footer-group;
}
.display--table-header-group {
display: table-header-group;
}
.display--table-row-group {
display: table-row-group;
}
.display--table-row {
display: table-row;
}
/* List */
.display--list-item {
display: list-item;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.drop-shadow{
filter: var(--drop-shadow);
}
}
@@ -0,0 +1,17 @@
@layer utility {
.flex-direction--row {
flex-direction: row;
}
.flex-direction--row-reverse {
flex-direction: row-reverse;
}
.flex-direction--col {
flex-direction: column;
}
.flex-direction--col-reverse {
flex-direction: column-reverse;
}
}
@@ -0,0 +1,9 @@
@layer utility {
.flex-shrink--1 {
flex-shrink: 1;
}
.flex-shrink--0 {
flex-shrink: 0;
}
}
@@ -0,0 +1,13 @@
@layer utility {
.flex--nowrap {
flex-wrap: nowrap;
}
.flex--wrap {
flex-wrap: wrap;
}
.flex--wrap-reverse {
flex-wrap: wrap-reverse;
}
}
@@ -0,0 +1,11 @@
@layer utility {
.font-family--sans {
font-family: var(--font-sans);
}
.font-family--serif {
font-family: var(--font-serif);
}
.font-family--mono {
font-family: var(--font-mono);
}
}
@@ -0,0 +1,36 @@
@layer utility {
.text--xs {
font-size: var(--font-size-xs);
line-height: var(--line-height);
}
.text--sm {
font-size: var(--font-size-sm);
line-height: var(--line-height);
}
.text--md {
font-size: var(--font-size-md);
line-height: var(--line-height);
}
.text--lg {
font-size: var(--font-size-lg);
line-height: var(--line-height);
}
.text--xl {
font-size: var(--font-size-xl);
line-height: var(--line-height);
}
.text--2xl {
font-size: var(--font-size-2xl);
line-height: var(--line-height);
}
.text--3xl {
font-size: var(--font-size-3xl);
line-height: var(--line-height);
}
}
@@ -0,0 +1,55 @@
@layer utility {
.font-weight--light {
font-weight: var(--font-weight-light);
}
.font-weight--normal {
font-weight: var(--font-weight-normal);
}
.font-weight--extranormal {
font-weight: var(--font-weight-extranormal);
}
.font-weight--semibold {
font-weight: var(--font-weight-semibold);
}
.font-weight--bold {
font-weight: var(--font-weight-bold);
}
.font-weight--extrabold {
font-weight: var(--font-weight-extrabold);
}
/* ================== */
.font-weight--xs {
font-weight: var(--font-weight-xs);
}
.font-weight--sm {
font-weight: var(--font-weight-sm);
}
.font-weight--md {
font-weight: var(--font-weight-md);
}
.font-weight--lg {
font-weight: var(--font-weight-lg);
}
.font-weight--xl {
font-weight: var(--font-weight-xl);
}
.font-weight--2xl {
font-weight: var(--font-weight-2xl);
}
.font-weight--3xl {
font-weight: var(--font-weight-3xl);
}
}
+34
View File
@@ -0,0 +1,34 @@
@layer utility {
.gap-none {
gap: none;
}
.gap--xs {
gap: 2px;
}
.gap--sm {
gap: 4px;
}
.gap--md {
gap: 6px;
}
.gap--lg {
gap: 8px;
}
.gap--xl {
gap: 10px;
}
.gap--2xl {
gap: 12px;
}
.gap--3xl {
gap: 14px;
}
}
@@ -0,0 +1,29 @@
@layer utility {
.h--dot-xs {
height: calc(var(--font-size-xs) / 2);
}
.h--dot-sm {
height: calc(var(--font-size-sm) / 2);
}
.h--dot-md {
height: calc(var(--font-size-md) / 2);
}
.h--dot-lg {
height: calc(var(--font-size-lg) / 2);
}
.h--dot-xl {
height: calc(var(--font-size-xl) / 2);
}
.h--dot-2xl {
height: calc(var(--font-size-2xl) / 2);
}
.h--dot-3xl {
height: calc(var(--font-size-3xl) / 2);
}
}
@@ -0,0 +1,25 @@
@layer utility {
.h--inline-xs {
height: calc(var(--font-size-xs) * var(--line-height));
}
.h--inline-sm {
height: calc(var(--font-size-sm) * var(--line-height));
}
.h--inline-md {
height: calc(var(--font-size-md) * var(--line-height));
}
.h--inline-lg {
height: calc(var(--font-size-lg) * var(--line-height));
}
.h--inline-xl {
height: calc(var(--font-size-xl) * var(--line-height));
}
.h--inline-2xl {
height: calc(var(--font-size-2xl) * var(--line-height));
}
}
@@ -0,0 +1,23 @@
@layer utility {
.h--item-xs {
height: var(--height-item-xs);
}
.h--item-sm {
height: var(--height-item-sm);
}
.h--item-md {
height: var(--height-item-md);
}
.h--item-lg {
height: var(--height-item-lg);
}
.h--item-xl {
height: var(--height-item-xl);
}
.h--item-2xl {
height: var(--height-item-2xl);
}
.h--item-3xl {
height: var(--height-item-3xl);
}
}
@@ -0,0 +1,45 @@
@layer utility {
.justify--start {
justify-content: flex-start;
}
.justify--end {
justify-content: flex-end;
}
.justify--end-safe {
justify-content: safe flex-end;
}
.justify--center {
justify-content: center;
}
.justify--center-safe {
justify-content: safe center;
}
.justify--between {
justify-content: space-between;
}
.justify--around {
justify-content: space-around;
}
.justify--evenly {
justify-content: space-evenly;
}
.justify--stretch {
justify-content: stretch;
}
.justify--baseline {
justify-content: baseline;
}
.justify--normal {
justify-content: normal;
}
}
@@ -0,0 +1,29 @@
@layer utility {
.justify-items--start {
justify-items: start;
}
.justify-items--end {
justify-items: end;
}
.justify-items--end-safe {
justify-items: safe end;
}
.justify-items--center {
justify-items: center;
}
.justify-items--center-safe {
justify-items: safe center;
}
.justify-items--stretch {
justify-items: stretch;
}
.justify-items--normal {
justify-items: normal;
}
}
@@ -0,0 +1,29 @@
@layer utility {
.justify-self--auto {
justify-self: auto;
}
.justify-self--start {
justify-self: start;
}
.justify-self--center {
justify-self: center;
}
.justify-self--center-safe {
justify-self: safe center;
}
.justify-self--end {
justify-self: end;
}
.justify-self--end-safe {
justify-self: safe end;
}
.justify-self--stretch {
justify-self: stretch;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.max-h--max-content {
max-height: max-content;
}
}
@@ -0,0 +1,5 @@
@layer utility {
.max-w--max-content {
max-width: max-content;
}
}
@@ -0,0 +1,16 @@
@layer utility {
.outline--none {
outline: none;
}
.outline {
&:focus-visible {
outline: 3px solid var(--base-focus-outline-color);
outline-offset: 1px;
}
&:focus:not(:focus-visible) {
outline: none;
}
}
}
@@ -0,0 +1,61 @@
@layer utility {
.overflow--auto {
overflow: auto;
}
.overflow--hidden {
overflow: hidden;
}
.overflow--clip {
overflow: clip;
}
.overflow--visible {
overflow: visible;
}
.overflow--scroll {
overflow: scroll;
}
.overflow--x--auto {
overflow-x: auto;
}
.overflow--y--auto {
overflow-y: auto;
}
.overflow--x--hidden {
overflow-x: hidden;
}
.overflow--y--hidden {
overflow-y: hidden;
}
.overflow--x--clip {
overflow-x: clip;
}
.overflow--y--clip {
overflow-y: clip;
}
.overflow--x--visible {
overflow-x: visible;
}
.overflow--y--visible {
overflow-y: visible;
}
.overflow--x--scroll {
overflow-x: scroll;
}
.overflow--y--scroll {
overflow-y: scroll;
}
}
@@ -0,0 +1,37 @@
@layer utility {
.overscroll--auto {
overscroll-behavior: auto;
}
.overscroll--contain {
overscroll-behavior: contain;
}
.overscroll--none {
overscroll-behavior: none;
}
.overscroll--x-auto {
overscroll-behavior-x: auto;
}
.overscroll--x-contain {
overscroll-behavior-x: contain;
}
.overscroll--x-none {
overscroll-behavior-x: none;
}
.overscroll--y-auto {
overscroll-behavior-y: auto;
}
.overscroll--y-contain {
overscroll-behavior-y: contain;
}
.overscroll--y-none {
overscroll-behavior-y: none;
}
}
@@ -0,0 +1,20 @@
@layer utility {
.px--long-xs {
padding-inline: var(--padding-long-xs);
}
.px--long-sm {
padding-inline: var(--padding-long-sm);
}
.px--long-md {
padding-inline: var(--padding-long-md);
}
.px--long-lg {
padding-inline: var(--padding-long-lg);
}
.px--long-xl {
padding-inline: var(--padding-long-xl);
}
.px--long-2xl {
padding-inline: var(--padding-long-2xl);
}
}
@@ -0,0 +1,80 @@
@layer utility {
.px--none {
padding-inline: 0px;
}
.px--xs {
padding-inline: var(--padding-xs);
}
.px--sm {
padding-inline: var(--padding-sm);
}
.px--md {
padding-inline: var(--padding-md);
}
.px--lg {
padding-inline: var(--padding-lg);
}
.px--xl {
padding-inline: var(--padding-xl);
}
.px--2xl {
padding-inline: var(--padding-2xl);
}
.px--3xl {
padding-inline: var(--padding-3xl);
}
/* =================================================== */
.py--none {
padding-block: 0px;
}
.py--xs {
padding-block: var(--padding-xs);
}
.py--sm {
padding-block: var(--padding-sm);
}
.py--md {
padding-block: var(--padding-md);
}
.py--lg {
padding-block: var(--padding-lg);
}
.py--xl {
padding-block: var(--padding-xl);
}
.py--2xl {
padding-block: var(--padding-2xl);
}
.py--3xl {
padding-block: var(--padding-3xl);
}
/* =================================================== */
.px--4 {
padding-inline: var(--padding-4);
}
.py--4 {
padding-block: var(--padding-4);
}
.px--8 {
padding-inline: var(--padding-8);
}
.py--8 {
padding-block: var(--padding-8);
}
.px--12 {
padding-inline: var(--padding-12);
}
.py--12 {
padding-block: var(--padding-12);
}
.px--16 {
padding-inline: var(--padding-16);
}
.py--16 {
padding-block: var(--padding-16);
}
}
@@ -0,0 +1,9 @@
@layer utility {
.pointer-events--auto {
pointer-events: auto;
}
.pointer-events--none {
pointer-events: none;
}
}
@@ -0,0 +1,21 @@
@layer utility {
.position--static {
position: static;
}
.position--fixed {
position: fixed;
}
.position--absolute {
position: absolute;
}
.position--relative {
position: relative;
}
.position--sticky {
position: sticky;
}
}
@@ -0,0 +1,23 @@
@layer utility {
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border-width: 0;
}
.sr-only--cancel {
position: static;
width: auto;
height: auto;
padding: 0;
margin: 0;
overflow: visible;
clip-path: none;
white-space: normal;
}
}
@@ -0,0 +1,25 @@
@layer utility {
.text-align--center {
text-align: center;
}
.text-align--left {
text-align: left;
}
.text-align--right {
text-align: right;
}
.text-align--justify {
text-align: justify;
}
.text-align--start {
text-align: start;
}
.text-align--end {
text-align: end;
}
}
@@ -0,0 +1,444 @@
@layer utility;
.theme-base {
--color-red-50: oklch(97.1% 0.013 17.38);
--color-red-100: oklch(93.6% 0.032 17.717);
--color-red-200: oklch(88.5% 0.062 18.334);
--color-red-300: oklch(80.8% 0.114 19.571);
--color-red-400: oklch(70.4% 0.191 22.216);
--color-red-500: oklch(63.7% 0.237 25.331);
--color-red-600: oklch(57.7% 0.245 27.325);
--color-red-700: oklch(50.5% 0.213 27.518);
--color-red-800: oklch(44.4% 0.177 26.899);
--color-red-900: oklch(39.6% 0.141 25.723);
--color-red-950: oklch(25.8% 0.092 26.042);
--color-orange-50: oklch(98% 0.016 73.684);
--color-orange-100: oklch(95.4% 0.038 75.164);
--color-orange-200: oklch(90.1% 0.076 70.697);
--color-orange-300: oklch(83.7% 0.128 66.29);
--color-orange-400: oklch(75% 0.183 55.934);
--color-orange-500: oklch(70.5% 0.213 47.604);
--color-orange-600: oklch(64.6% 0.222 41.116);
--color-orange-700: oklch(55.3% 0.195 38.402);
--color-orange-800: oklch(47% 0.157 37.304);
--color-orange-900: oklch(40.8% 0.123 38.172);
--color-orange-950: oklch(26.6% 0.079 36.259);
--color-amber-50: oklch(98.7% 0.022 95.277);
--color-amber-100: oklch(96.2% 0.059 95.617);
--color-amber-200: oklch(92.4% 0.12 95.746);
--color-amber-300: oklch(87.9% 0.169 91.605);
--color-amber-400: oklch(82.8% 0.189 84.429);
--color-amber-500: oklch(76.9% 0.188 70.08);
--color-amber-600: oklch(66.6% 0.179 58.318);
--color-amber-700: oklch(55.5% 0.163 48.998);
--color-amber-800: oklch(47.3% 0.137 46.201);
--color-amber-900: oklch(41.4% 0.112 45.904);
--color-amber-950: oklch(27.9% 0.077 45.635);
--color-yellow-50: oklch(98.7% 0.026 102.212);
--color-yellow-100: oklch(97.3% 0.071 103.193);
--color-yellow-200: oklch(94.5% 0.129 101.54);
--color-yellow-300: oklch(90.5% 0.182 98.111);
--color-yellow-400: oklch(85.2% 0.199 91.936);
--color-yellow-500: oklch(79.5% 0.184 86.047);
--color-yellow-600: oklch(68.1% 0.162 75.834);
--color-yellow-700: oklch(55.4% 0.135 66.442);
--color-yellow-800: oklch(47.6% 0.114 61.907);
--color-yellow-900: oklch(42.1% 0.095 57.708);
--color-yellow-950: oklch(28.6% 0.066 53.813);
--color-lime-50: oklch(98.6% 0.031 120.757);
--color-lime-100: oklch(96.7% 0.067 122.328);
--color-lime-200: oklch(93.8% 0.127 124.321);
--color-lime-300: oklch(89.7% 0.196 126.665);
--color-lime-400: oklch(84.1% 0.238 128.85);
--color-lime-500: oklch(76.8% 0.233 130.85);
--color-lime-600: oklch(64.8% 0.2 131.684);
--color-lime-700: oklch(53.2% 0.157 131.589);
--color-lime-800: oklch(45.3% 0.124 130.933);
--color-lime-900: oklch(40.5% 0.101 131.063);
--color-lime-950: oklch(27.4% 0.072 132.109);
--color-green-50: oklch(98.2% 0.018 155.826);
--color-green-100: oklch(96.2% 0.044 156.743);
--color-green-200: oklch(92.5% 0.084 155.995);
--color-green-300: oklch(87.1% 0.15 154.449);
--color-green-400: oklch(79.2% 0.209 151.711);
--color-green-500: oklch(72.3% 0.219 149.579);
--color-green-600: oklch(62.7% 0.194 149.214);
--color-green-700: oklch(52.7% 0.154 150.069);
--color-green-800: oklch(44.8% 0.119 151.328);
--color-green-900: oklch(39.3% 0.095 152.535);
--color-green-950: oklch(26.6% 0.065 152.934);
--color-emerald-50: oklch(97.9% 0.021 166.113);
--color-emerald-100: oklch(95% 0.052 163.051);
--color-emerald-200: oklch(90.5% 0.093 164.15);
--color-emerald-300: oklch(84.5% 0.143 164.978);
--color-emerald-400: oklch(76.5% 0.177 163.223);
--color-emerald-500: oklch(69.6% 0.17 162.48);
--color-emerald-600: oklch(59.6% 0.145 163.225);
--color-emerald-700: oklch(50.8% 0.118 165.612);
--color-emerald-800: oklch(43.2% 0.095 166.913);
--color-emerald-900: oklch(37.8% 0.077 168.94);
--color-emerald-950: oklch(26.2% 0.051 172.552);
--color-teal-50: oklch(98.4% 0.014 180.72);
--color-teal-100: oklch(95.3% 0.051 180.801);
--color-teal-200: oklch(91% 0.096 180.426);
--color-teal-300: oklch(85.5% 0.138 181.071);
--color-teal-400: oklch(77.7% 0.152 181.912);
--color-teal-500: oklch(70.4% 0.14 182.503);
--color-teal-600: oklch(60% 0.118 184.704);
--color-teal-700: oklch(51.1% 0.096 186.391);
--color-teal-800: oklch(43.7% 0.078 188.216);
--color-teal-900: oklch(38.6% 0.063 188.416);
--color-teal-950: oklch(27.7% 0.046 192.524);
--color-cyan-50: oklch(98.4% 0.019 200.873);
--color-cyan-100: oklch(95.6% 0.045 203.388);
--color-cyan-200: oklch(91.7% 0.08 205.041);
--color-cyan-300: oklch(86.5% 0.127 207.078);
--color-cyan-400: oklch(78.9% 0.154 211.53);
--color-cyan-500: oklch(71.5% 0.143 215.221);
--color-cyan-600: oklch(60.9% 0.126 221.723);
--color-cyan-700: oklch(52% 0.105 223.128);
--color-cyan-800: oklch(45% 0.085 224.283);
--color-cyan-900: oklch(39.8% 0.07 227.392);
--color-cyan-950: oklch(30.2% 0.056 229.695);
--color-sky-50: oklch(97.7% 0.013 236.62);
--color-sky-100: oklch(95.1% 0.026 236.824);
--color-sky-200: oklch(90.1% 0.058 230.902);
--color-sky-300: oklch(82.8% 0.111 230.318);
--color-sky-400: oklch(74.6% 0.16 232.661);
--color-sky-500: oklch(68.5% 0.169 237.323);
--color-sky-600: oklch(58.8% 0.158 241.966);
--color-sky-700: oklch(50% 0.134 242.749);
--color-sky-800: oklch(44.3% 0.11 240.79);
--color-sky-900: oklch(39.1% 0.09 240.876);
--color-sky-950: oklch(29.3% 0.066 243.157);
--color-blue-50: oklch(97% 0.014 254.604);
--color-blue-100: oklch(93.2% 0.032 255.585);
--color-blue-200: oklch(88.2% 0.059 254.128);
--color-blue-300: oklch(80.9% 0.105 251.813);
--color-blue-400: oklch(70.7% 0.165 254.624);
--color-blue-500: oklch(62.3% 0.214 259.815);
--color-blue-600: oklch(54.6% 0.245 262.881);
--color-blue-700: oklch(48.8% 0.243 264.376);
--color-blue-800: oklch(42.4% 0.199 265.638);
--color-blue-900: oklch(37.9% 0.146 265.522);
--color-blue-950: oklch(28.2% 0.091 267.935);
--color-indigo-50: oklch(96.2% 0.018 272.314);
--color-indigo-100: oklch(93% 0.034 272.788);
--color-indigo-200: oklch(87% 0.065 274.039);
--color-indigo-300: oklch(78.5% 0.115 274.713);
--color-indigo-400: oklch(67.3% 0.182 276.935);
--color-indigo-500: oklch(58.5% 0.233 277.117);
--color-indigo-600: oklch(51.1% 0.262 276.966);
--color-indigo-700: oklch(45.7% 0.24 277.023);
--color-indigo-800: oklch(39.8% 0.195 277.366);
--color-indigo-900: oklch(35.9% 0.144 278.697);
--color-indigo-950: oklch(25.7% 0.09 281.288);
--color-violet-50: oklch(96.9% 0.016 293.756);
--color-violet-100: oklch(94.3% 0.029 294.588);
--color-violet-200: oklch(89.4% 0.057 293.283);
--color-violet-300: oklch(81.1% 0.111 293.571);
--color-violet-400: oklch(70.2% 0.183 293.541);
--color-violet-500: oklch(60.6% 0.25 292.717);
--color-violet-600: oklch(54.1% 0.281 293.009);
--color-violet-700: oklch(49.1% 0.27 292.581);
--color-violet-800: oklch(43.2% 0.232 292.759);
--color-violet-900: oklch(38% 0.189 293.745);
--color-violet-950: oklch(28.3% 0.141 291.089);
--color-purple-50: oklch(97.7% 0.014 308.299);
--color-purple-100: oklch(94.6% 0.033 307.174);
--color-purple-200: oklch(90.2% 0.063 306.703);
--color-purple-300: oklch(82.7% 0.119 306.383);
--color-purple-400: oklch(71.4% 0.203 305.504);
--color-purple-500: oklch(62.7% 0.265 303.9);
--color-purple-600: oklch(55.8% 0.288 302.321);
--color-purple-700: oklch(49.6% 0.265 301.924);
--color-purple-800: oklch(43.8% 0.218 303.724);
--color-purple-900: oklch(38.1% 0.176 304.987);
--color-purple-950: oklch(29.1% 0.149 302.717);
--color-fuchsia-50: oklch(97.7% 0.017 320.058);
--color-fuchsia-100: oklch(95.2% 0.037 318.852);
--color-fuchsia-200: oklch(90.3% 0.076 319.62);
--color-fuchsia-300: oklch(83.3% 0.145 321.434);
--color-fuchsia-400: oklch(74% 0.238 322.16);
--color-fuchsia-500: oklch(66.7% 0.295 322.15);
--color-fuchsia-600: oklch(59.1% 0.293 322.896);
--color-fuchsia-700: oklch(51.8% 0.253 323.949);
--color-fuchsia-800: oklch(45.2% 0.211 324.591);
--color-fuchsia-900: oklch(40.1% 0.17 325.612);
--color-fuchsia-950: oklch(29.3% 0.136 325.661);
--color-pink-50: oklch(97.1% 0.014 343.198);
--color-pink-100: oklch(94.8% 0.028 342.258);
--color-pink-200: oklch(89.9% 0.061 343.231);
--color-pink-300: oklch(82.3% 0.12 346.018);
--color-pink-400: oklch(71.8% 0.202 349.761);
--color-pink-500: oklch(65.6% 0.241 354.308);
--color-pink-600: oklch(59.2% 0.249 0.584);
--color-pink-700: oklch(52.5% 0.223 3.958);
--color-pink-800: oklch(45.9% 0.187 3.815);
--color-pink-900: oklch(40.8% 0.153 2.432);
--color-pink-950: oklch(28.4% 0.109 3.907);
--color-rose-50: oklch(96.9% 0.015 12.422);
--color-rose-100: oklch(94.1% 0.03 12.58);
--color-rose-200: oklch(89.2% 0.058 10.001);
--color-rose-300: oklch(81% 0.117 11.638);
--color-rose-400: oklch(71.2% 0.194 13.428);
--color-rose-500: oklch(64.5% 0.246 16.439);
--color-rose-600: oklch(58.6% 0.253 17.585);
--color-rose-700: oklch(51.4% 0.222 16.935);
--color-rose-800: oklch(45.5% 0.188 13.697);
--color-rose-900: oklch(41% 0.159 10.272);
--color-rose-950: oklch(27.1% 0.105 12.094);
--color-slate-50: oklch(98.4% 0.003 247.858);
--color-slate-100: oklch(96.8% 0.007 247.896);
--color-slate-200: oklch(92.9% 0.013 255.508);
--color-slate-300: oklch(86.9% 0.022 252.894);
--color-slate-400: oklch(70.4% 0.04 256.788);
--color-slate-500: oklch(55.4% 0.046 257.417);
--color-slate-600: oklch(44.6% 0.043 257.281);
--color-slate-700: oklch(37.2% 0.044 257.287);
--color-slate-800: oklch(27.9% 0.041 260.031);
--color-slate-900: oklch(20.8% 0.042 265.755);
--color-slate-950: oklch(12.9% 0.042 264.695);
--color-gray-50: oklch(98.5% 0.002 247.839);
--color-gray-100: oklch(96.7% 0.003 264.542);
--color-gray-200: oklch(92.8% 0.006 264.531);
--color-gray-300: oklch(87.2% 0.01 258.338);
--color-gray-400: oklch(70.7% 0.022 261.325);
--color-gray-500: oklch(55.1% 0.027 264.364);
--color-gray-600: oklch(44.6% 0.03 256.802);
--color-gray-700: oklch(37.3% 0.034 259.733);
--color-gray-800: oklch(27.8% 0.033 256.848);
--color-gray-900: oklch(21% 0.034 264.665);
--color-gray-950: oklch(13% 0.028 261.692);
--color-zinc-50: oklch(98.5% 0 0);
--color-zinc-100: oklch(96.7% 0.001 286.375);
--color-zinc-200: oklch(92% 0.004 286.32);
--color-zinc-300: oklch(87.1% 0.006 286.286);
--color-zinc-400: oklch(70.5% 0.015 286.067);
--color-zinc-500: oklch(55.2% 0.016 285.938);
--color-zinc-600: oklch(44.2% 0.017 285.786);
--color-zinc-700: oklch(37% 0.013 285.805);
--color-zinc-800: oklch(27.4% 0.006 286.033);
--color-zinc-900: oklch(21% 0.006 285.885);
--color-zinc-950: oklch(14.1% 0.005 285.823);
--color-neutral-50: oklch(98.5% 0 0);
--color-neutral-100: oklch(97% 0 0);
--color-neutral-200: oklch(92.2% 0 0);
--color-neutral-300: oklch(87% 0 0);
--color-neutral-400: oklch(70.8% 0 0);
--color-neutral-500: oklch(55.6% 0 0);
--color-neutral-600: oklch(43.9% 0 0);
--color-neutral-700: oklch(37.1% 0 0);
--color-neutral-800: oklch(26.9% 0 0);
--color-neutral-900: oklch(20.5% 0 0);
--color-neutral-950: oklch(14.5% 0 0);
--color-stone-50: oklch(98.5% 0.001 106.423);
--color-stone-100: oklch(97% 0.001 106.424);
--color-stone-200: oklch(92.3% 0.003 48.717);
--color-stone-300: oklch(86.9% 0.005 56.366);
--color-stone-400: oklch(70.9% 0.01 56.259);
--color-stone-500: oklch(55.3% 0.013 58.071);
--color-stone-600: oklch(44.4% 0.011 73.639);
--color-stone-700: oklch(37.4% 0.01 67.558);
--color-stone-800: oklch(26.8% 0.007 34.298);
--color-stone-900: oklch(21.6% 0.006 56.043);
--color-stone-950: oklch(14.7% 0.004 49.25);
--color-mauve-50: oklch(98.5% 0 0);
--color-mauve-100: oklch(96% 0.003 325.6);
--color-mauve-200: oklch(92.2% 0.005 325.62);
--color-mauve-300: oklch(86.5% 0.012 325.68);
--color-mauve-400: oklch(71.1% 0.019 323.02);
--color-mauve-500: oklch(54.2% 0.034 322.5);
--color-mauve-600: oklch(43.5% 0.029 321.78);
--color-mauve-700: oklch(36.4% 0.029 323.89);
--color-mauve-800: oklch(26.3% 0.024 320.12);
--color-mauve-900: oklch(21.2% 0.019 322.12);
--color-mauve-950: oklch(14.5% 0.008 326);
--color-olive-50: oklch(98.8% 0.003 106.5);
--color-olive-100: oklch(96.6% 0.005 106.5);
--color-olive-200: oklch(93% 0.007 106.5);
--color-olive-300: oklch(88% 0.011 106.6);
--color-olive-400: oklch(73.7% 0.021 106.9);
--color-olive-500: oklch(58% 0.031 107.3);
--color-olive-600: oklch(46.6% 0.025 107.3);
--color-olive-700: oklch(39.4% 0.023 107.4);
--color-olive-800: oklch(28.6% 0.016 107.4);
--color-olive-900: oklch(22.8% 0.013 107.4);
--color-olive-950: oklch(15.3% 0.006 107.1);
--color-mist-50: oklch(98.7% 0.002 197.1);
--color-mist-100: oklch(96.3% 0.002 197.1);
--color-mist-200: oklch(92.5% 0.005 214.3);
--color-mist-300: oklch(87.2% 0.007 219.6);
--color-mist-400: oklch(72.3% 0.014 214.4);
--color-mist-500: oklch(56% 0.021 213.5);
--color-mist-600: oklch(45% 0.017 213.2);
--color-mist-700: oklch(37.8% 0.015 216);
--color-mist-800: oklch(27.5% 0.011 216.9);
--color-mist-900: oklch(21.8% 0.008 223.9);
--color-mist-950: oklch(14.8% 0.004 228.8);
--color-taupe-50: oklch(98.6% 0.002 67.8);
--color-taupe-100: oklch(96% 0.002 17.2);
--color-taupe-200: oklch(92.2% 0.005 34.3);
--color-taupe-300: oklch(86.8% 0.007 39.5);
--color-taupe-400: oklch(71.4% 0.014 41.2);
--color-taupe-500: oklch(54.7% 0.021 43.1);
--color-taupe-600: oklch(43.8% 0.017 39.3);
--color-taupe-700: oklch(36.7% 0.016 35.7);
--color-taupe-800: oklch(26.8% 0.011 36.5);
--color-taupe-900: oklch(21.4% 0.009 43.1);
--color-taupe-950: oklch(14.7% 0.004 49.3);
--color-black: #000;
--color-white: #fff;
--color-transparent: transparent;
--danger-background-high: var(--color-red-600);
--danger-background-high-hover: var(--color-red-500);
--danger-background-high-active: var(--color-red-400);
--danger-background-low: var(--color-red-100);
--danger-background-low-hover: var(--color-red-200);
--danger-background-low-active: var(--color-red-300);
--success-background-high: var(--color-emerald-600);
--success-background-high-hover: var(--color-emerald-500);
--success-background-high-active: var(--color-emerald-400);
--success-background-low: var(--color-emerald-100);
--success-background-low-hover: var(--color-emerald-200);
--success-background-low-active: var(--color-emerald-300);
--info-background-high: var(--color-sky-600);
--info-background-high-hover: var(--color-sky-500);
--info-background-high-active: var(--color-sky-400);
--info-background-low: var(--color-sky-100);
--info-background-low-hover: var(--color-sky-200);
--info-background-low-active: var(--color-sky-300);
--warning-background-high: var(--color-yellow-600);
--warning-background-high-hover: var(--color-yellow-500);
--warning-background-high-active: var(--color-yellow-400);
--warning-background-low: var(--color-yellow-100);
--warning-background-low-hover: var(--color-yellow-200);
--warning-background-low-active: var(--color-yellow-300);
--default-background-high: var(--color-neutral-600);
--default-background-high-hover: var(--color-neutral-500);
--default-background-high-active: var(--color-neutral-400);
--default-background-low: var(--color-neutral-100);
--default-background-low-hover: var(--color-neutral-200);
--default-background-low-active: var(--color-neutral-300);
--disabled-color: var(--color-gray-400);
--disabled-background: var(--color-gray-100);
--disabled-border-color: var(--color-gray-300);
--font-size-xs: 12px;
--font-size-sm: 13px;
--font-size-md: 14px;
--font-size-lg: 16px;
--font-size-xl: 16px;
--font-size-2xl: 24px;
--font-size-3xl: 30px;
--line-height: 1.33;
--font-weight-light: 300;
--font-weight-normal: 400;
--font-weight-extranormal: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
--font-weight-extrabold: 800;
--font-weight-xs: var(--font-weight-normal);
--font-weight-sm: var(--font-weight-normal);
--font-weight-md: var(--font-weight-extranormal);
--font-weight-lg: var(--font-weight-semibold);
--font-weight-xl: var(--font-weight-semibold);
--font-weight-2xl: var(--font-weight-semibold);
--font-weight-3xl: var(--font-weight-bold);
--height-item-xs: 20px;
--height-item-sm: 24px;
--height-item-md: 28px;
--height-item-lg: 34px;
--height-item-xl: 44px;
--height-item-2xl: 56px;
--height-item-3xl: 64px;
--radius-xs: 2px;
--radius-sm: 3px;
--radius-md: 4px;
--radius-lg: 5px;
--radius-xl: 8px;
--radius-2xl: 12px;
--radius-3xl: 16px;
--radius-none: 0;
--radius-full: 9999px;
--padding-xs: 6px;
--padding-sm: 8px;
--padding-md: 10px;
--padding-lg: 12px;
--padding-xl: 16px;
--padding-2xl: 2px;
--padding-3xl: 2px;
--padding-long-xs: 12px;
--padding-long-sm: 14px;
--padding-long-md: 18px;
--padding-long-lg: 26px;
--padding-long-xl: 2px;
--padding-long-2xl: 2px;
--padding-long-3xl: 2px;
--gap-xs: 2px;
--gap-sm: 4px;
--gap-md: 6px;
--gap-lg: 8px;
--gap-xl: 10px;
--gap-2xl: 12px;
--gap-3xl: 14px;
--gap-none: 0;
--drop-shadow: drop-shadow(0 0 4px rgba(0, 0, 0, 0.14))
drop-shadow(0 8px 16px rgba(0, 0, 0, 0.14));
--box-shadow:
0 0 16px 0px rgba(0, 0, 0, 0.1), 0 8px 20px 0px rgba(0, 0, 0, 0.1);
--border-1: 1px solid;
--border-none: 0 solid;
--radius-4: 4px;
--radius-8: 8px;
--radius-12: 12px;
--radius-16: 16px;
--padding-4: 4px;
--padding-8: 8px;
--padding-12: 12px;
--padding-16: 16px;
--animate-spin: spin 1s linear infinite;
--animate-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
--animate-bounce: bounce 1s infinite;
--animate-fade-in-down: fade-in-down 0.5s ease-out both;
--animate-fade-out-down: fade-out-down 0.5s ease-in both;
--animate-fade-in-up: fade-in-up 0.5s ease-out both;
--animate-fade-out-up: fade-out-up 0.5s ease-in both;
--font-sans:
ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol", "Noto Color Emoji";
--font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
--font-mono:
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
"Courier New", monospace;
--height-inline-xs: calc(var(--font-size-xs) * var(--line-height));
--height-inline-sm: calc(var(--font-size-sm) * var(--line-height));
--height-inline-md: calc(var(--font-size-md) * var(--line-height));
--height-inline-lg: calc(var(--font-size-lg) * var(--line-height));
--height-inline-xl: calc(var(--font-size-xl) * var(--line-height));
--height-inline-2xl: calc(var(--font-size-2xl) * var(--line-height));
--height-inline-3xl: calc(var(--font-size-3xl) * var(--line-height));
}
@@ -0,0 +1,15 @@
@layer utility {
.theme--light {
--base-color: var(--color-gray-950);
/* --base-color: oklch(from var(--color-gray-950) l c h / 0.88); */
--base-background: var(--color-white);
--base-focus-outline-color: var(--color-neutral-500);
}
.theme--dark {
--base-color: var(--color-gray-950);
/* --base-color: oklch(from var(--color-gray-50) l c h / 0.88); */
--base-background: var(--color-black);
--base-focus-outline-color: var(--color-neutral-500);
}
}
@@ -0,0 +1,14 @@
@layer utility {
.transition--width-on-click {
width: 0;
transition: width 5s ease-in-out;
&.on-click {
width: max-content;
}
}
}
/* 关于 css动画的思考,首先,容器一定是响应式的,
内部可能有多个元素都有动画,容器宽度是没有固定值的,
如果用 js,那么就是简单的把元素 append 进去,
如果append 第二个元素,那么第一个的动画会重新触发吗
*/
@@ -0,0 +1,17 @@
@layer utility {
.select--none {
user-select: none;
}
.select--text {
user-select: text;
}
.select--all {
user-select: all;
}
.select--auto {
user-select: auto;
}
}
@@ -0,0 +1,155 @@
@layer utility {
.variant--filled-disabled {
--filled-color: var(--color-white);
--filled-color-hover: var(--color-white);
--filled-color-active: var(--color-white);
--filled-background: var(--brand-background-high);
--filled-background-hover: var(--brand-background-high-hover);
--filled-background-active: var(--brand-background-high-active);
--filled-border: var(--border-none);
--filled-border-color: var(--color-transparent);
color: var(--filled-color);
background-color: var(--filled-background);
border: var(--filled-border);
border-color: var(--filled-border-color);
filter: grayscale(100);
&:hover {
color: var(--filled-color);
background-color: var(--filled-background);
filter: grayscale(100);
}
&:focus-visible {
color: var(--filled-color);
background-color: var(--filled-background);
filter: grayscale(100);
}
&:active {
color: var(--filled-color);
background-color: var(--filled-background);
filter: grayscale(100);
}
}
.variant--outline-disabled {
--outline-color: var(--brand-background);
--outline-color-hover: var(--brand-background);
--outline-color-active: var(--brand-background);
--outline-background: var(--color-transparent);
--outline-background-hover: var(--brand-background-low-hover);
--outline-background-active: var(--brand-background-low-active);
--outline-border: var(--border-1);
--outline-border-color: var(--brand-background);
color: var(--outline-color);
background-color: var(--outline-background);
border: var(--outline-border);
border-color: var(--outline-border-color);
filter: grayscale(100);
&:hover {
color: var(--outline-color);
background-color: var(--outline-background);
filter: grayscale(100);
}
&:focus-visible {
color: var(--outline-color);
background-color: var(--outline-background);
filter: grayscale(100);
}
&:active {
color: var(--outline-color);
background-color: var(--outline-background);
filter: grayscale(100);
}
}
.variant--subtle-disabled {
--subtle-color: var(--brand-background);
--subtle-color-hover: var(--brand-background);
--subtle-color-active: var(--brand-background);
--subtle-background: var(--brand-background-low);
--subtle-background-hover: var(--brand-background-low-hover);
--subtle-background-active: var(--brand-background-low-active);
--subtle-border: var(--border-none);
--subtle-border-color: var(--color-transparent);
color: var(--subtle-color);
background-color: var(--subtle-background);
border: var(--subtle-border);
border-color: var(--subtle-border-color);
filter: grayscale(100);
&:hover {
color: var(--subtle-color);
background-color: var(--subtle-background);
filter: grayscale(100);
}
&:focus-visible {
color: var(--subtle-color);
background-color: var(--subtle-background);
filter: grayscale(100);
}
&:active {
color: var(--subtle-color);
background-color: var(--subtle-background);
filter: grayscale(100);
}
}
.variant--ghost-disabled {
--ghost-color: var(--brand-background);
--ghost-color-hover: var(--brand-background);
--ghost-color-active: var(--brand-background);
--ghost-background: var(--color-transparent);
--ghost-background-hover: var(--brand-background-low-hover);
--ghost-background-active: var(--brand-background-low-active);
--ghost-border: var(--border-none);
--ghost-border-color: var(--color-transparent);
color: var(--ghost-color);
background-color: var(--ghost-background);
border: var(--ghost-border);
border-color: var(--ghost-border-color);
filter: grayscale(100);
&:hover {
color: var(--ghost-color);
background-color: var(--ghost-background);
filter: grayscale(100);
}
&:focus-visible {
color: var(--ghost-color);
background-color: var(--ghost-background);
filter: grayscale(100);
}
&:active {
color: var(--ghost-color);
background-color: var(--ghost-background);
filter: grayscale(100);
}
}
}
@@ -0,0 +1,76 @@
@layer utility {
.variant--filled-unclickable {
--filled-color: var(--color-white);
--filled-color-hover: var(--color-white);
--filled-color-active: var(--color-white);
--filled-background: var(--brand-background-high);
--filled-background-hover: var(--brand-background-high-hover);
--filled-background-active: var(--brand-background-high-active);
--filled-border: var(--border-none);
--filled-border-color: var(--color-transparent);
color: var(--filled-color);
background-color: var(--filled-background);
border: var(--filled-border);
border-color: var(--filled-border-color);
}
.variant--outline-unclickable {
--outline-color: var(--brand-background);
--outline-color-hover: var(--brand-background);
--outline-color-active: var(--brand-background);
--outline-background: var(--color-transparent);
--outline-background-hover: var(--brand-background-low-hover);
--outline-background-active: var(--brand-background-low-active);
--outline-border: var(--border-1);
--outline-border-color: var(--brand-background);
color: var(--outline-color);
background-color: var(--outline-background);
border: var(--outline-border);
border-color: var(--outline-border-color);
}
.variant--subtle-unclickable {
--subtle-color: var(--brand-background);
--subtle-color-hover: var(--brand-background);
--subtle-color-active: var(--brand-background);
--subtle-background: var(--brand-background-low);
--subtle-background-hover: var(--brand-background-low-hover);
--subtle-background-active: var(--brand-background-low-active);
--subtle-border: var(--border-none);
--subtle-border-color: var(--color-transparent);
color: var(--subtle-color);
background-color: var(--subtle-background);
border: var(--subtle-border);
border-color: var(--subtle-border-color);
}
.variant--ghost-unclickable {
--ghost-color: var(--brand-background);
--ghost-color-hover: var(--brand-background);
--ghost-color-active: var(--brand-background);
--ghost-background: var(--color-transparent);
--ghost-background-hover: var(--brand-background-low-hover);
--ghost-background-active: var(--brand-background-low-active);
--ghost-border: var(--border-none);
--ghost-border-color: var(--color-transparent);
color: var(--ghost-color);
background-color: var(--ghost-background);
border: var(--ghost-border);
border-color: var(--ghost-border-color);
}
}
@@ -0,0 +1,137 @@
@layer utility {
.variant--filled {
--filled-color: var(--color-white);
--filled-color-hover: var(--color-white);
--filled-color-active: var(--color-white);
--filled-background: var(--brand-background-high);
--filled-background-hover: var(--brand-background-high-hover);
--filled-background-active: var(--brand-background-high-active);
--filled-border: var(--border-none);
--filled-border-color: var(--color-transparent);
color: var(--filled-color);
background-color: var(--filled-background);
border: var(--filled-border);
border-color: var(--filled-border-color);
cursor: pointer;
&:hover {
color: var(--filled-color-hover);
background-color: var(--filled-background-hover);
}
&:focus-visible {
color: var(--filled-color-hover);
background-color: var(--filled-background-hover);
}
&:active {
color: var(--filled-color-active);
background-color: var(--filled-background-active);
}
}
.variant--outline {
--outline-color: var(--brand-background-high);
--outline-color-hover: var(--brand-background-high);
--outline-color-active: var(--brand-background-high);
--outline-background: var(--color-transparent);
--outline-background-hover: var(--brand-background-low-hover);
--outline-background-active: var(--brand-background-low-active);
--outline-border: var(--border-1);
--outline-border-color: var(--brand-background-high-active);
color: var(--outline-color);
background-color: var(--outline-background);
border: var(--outline-border);
border-color: var(--outline-border-color);
cursor: pointer;
&:hover {
color: var(--outline-color-hover);
background-color: var(--outline-background-hover);
}
&:focus-visible {
color: var(--outline-color-hover);
background-color: var(--outline-background-hover);
}
&:active {
color: var(--outline-color-active);
background-color: var(--outline-background-active);
}
}
.variant--subtle {
--subtle-color: var(--brand-background-high);
--subtle-color-hover: var(--brand-background-high);
--subtle-color-active: var(--brand-background-high);
--subtle-background: var(--brand-background-low);
--subtle-background-hover: var(--brand-background-low-hover);
--subtle-background-active: var(--brand-background-low-active);
--subtle-border: var(--border-none);
--subtle-border-color: var(--color-transparent);
color: var(--subtle-color);
background-color: var(--subtle-background);
border: var(--subtle-border);
border-color: var(--subtle-border-color);
cursor: pointer;
&:hover {
background-color: var(--subtle-background-hover);
color: var(--subtle-color-hover);
}
&:focus-visible {
background-color: var(--subtle-background-hover);
color: var(--subtle-color-hover);
}
&:active {
background-color: var(--subtle-background-active);
color: var(--subtle-color-active);
}
}
.variant--ghost {
--ghost-color: var(--brand-background-high);
--ghost-color-hover: var(--brand-background-high);
--ghost-color-active: var(--brand-background-high);
--ghost-background: var(--color-transparent);
--ghost-background-hover: var(--brand-background-low-hover);
--ghost-background-active: var(--brand-background-low-active);
--ghost-border: var(--border-none);
--ghost-border-color: var(--color-transparent);
color: var(--ghost-color);
background-color: var(--ghost-background);
border: var(--ghost-border);
border-color: var(--ghost-border-color);
cursor: pointer;
&:hover {
background-color: var(--ghost-background-hover);
color: var(--ghost-color-hover);
}
&:focus-visible {
background-color: var(--ghost-background-hover);
color: var(--ghost-color-hover);
}
&:active {
background-color: var(--ghost-background-active);
color: var(--ghost-color-active);
}
}
}
@@ -0,0 +1,13 @@
@layer utility {
.visible {
visibility: visible;
}
.visible--hidden {
visibility: hidden;
}
.visible--collapse {
visibility: collapse;
}
}
@@ -0,0 +1,25 @@
@layer utility {
.white-space--normal {
white-space: normal;
}
.white-space--nowrap {
white-space: nowrap;
}
.white-space--pre {
white-space: pre;
}
.white-space--pre-line {
white-space: pre-line;
}
.white-space--pre-wrap {
white-space: pre-wrap;
}
.white-space--break-spaces {
white-space: break-spaces;
}
}
@@ -0,0 +1,30 @@
@layer utility {
.w--dot-xs {
width: calc(var(--font-size-xs) / 2);
}
.w--dot-sm {
width: calc(var(--font-size-sm) / 2);
}
.w--dot-md {
width: calc(var(--font-size-md) / 2);
}
.w--dot-lg {
width: calc(var(--font-size-lg) / 2);
}
.w--dot-xl {
width: calc(var(--font-size-xl) / 2);
}
.w--dot-2xl {
width: calc(var(--font-size-2xl) / 2);
}
.w--dot-3xl {
width: calc(var(--font-size-3xl) / 2);
}
}
@@ -0,0 +1,25 @@
@layer utility {
.w--inline-xs {
width: calc(var(--font-size-xs) * var(--line-height));
}
.w--inline-sm {
width: calc(var(--font-size-sm) * var(--line-height));
}
.w--inline-md {
width: calc(var(--font-size-md) * var(--line-height));
}
.w--inline-lg {
width: calc(var(--font-size-lg) * var(--line-height));
}
.w--inline-xl {
width: calc(var(--font-size-xl) * var(--line-height));
}
.w--inline-xl {
width: calc(var(--font-size-2xl) * var(--line-height));
}
}

Some files were not shown because too many files have changed in this diff Show More