mm
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ButtonGallery } from "./button-gallery";
|
||||
import { Theme } from "../src/components/theme/theme";
|
||||
import { PopoverGallery } from "./popover-gallery";
|
||||
import { MenuGallery } from "./menu-gallery";
|
||||
|
||||
export function App() {
|
||||
return (
|
||||
@@ -8,6 +9,7 @@ export function App() {
|
||||
<Theme>
|
||||
<ButtonGallery />
|
||||
<PopoverGallery />
|
||||
<MenuGallery />
|
||||
</Theme>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import {
|
||||
Button,
|
||||
Menu,
|
||||
MenuCheckItem,
|
||||
MenuDropdown,
|
||||
MenuItem,
|
||||
MenuRadioItem,
|
||||
MenuRadioItemGroup,
|
||||
MenuTrigger,
|
||||
} from "../src";
|
||||
import { IW } from "./iw";
|
||||
import { OW } from "./ow";
|
||||
|
||||
export const MenuGallery = () => {
|
||||
return (
|
||||
<OW>
|
||||
<IW>
|
||||
<Menu>
|
||||
<MenuTrigger>
|
||||
<Button size="sm" variant="ghost">
|
||||
文件
|
||||
</Button>
|
||||
</MenuTrigger>
|
||||
<MenuDropdown>
|
||||
<MenuItem>Open File...</MenuItem>
|
||||
<MenuItem>Open Folder...</MenuItem>
|
||||
<Menu>
|
||||
<MenuTrigger>
|
||||
<MenuItem>Preferences</MenuItem>
|
||||
</MenuTrigger>
|
||||
<MenuDropdown>
|
||||
<MenuItem>Profile</MenuItem>
|
||||
<MenuItem>Settings</MenuItem>
|
||||
<MenuCheckItem>Auto Lint</MenuCheckItem>
|
||||
</MenuDropdown>
|
||||
</Menu>
|
||||
<Menu>
|
||||
<MenuTrigger>
|
||||
<MenuItem>Ruler</MenuItem>
|
||||
</MenuTrigger>
|
||||
<MenuDropdown>
|
||||
<MenuRadioItemGroup defaultSelectName="hori">
|
||||
<MenuRadioItem name="hori">Hori</MenuRadioItem>
|
||||
<MenuRadioItem name="verti">Verti</MenuRadioItem>
|
||||
<MenuRadioItem name="both">Hoth</MenuRadioItem>
|
||||
</MenuRadioItemGroup>
|
||||
</MenuDropdown>
|
||||
</Menu>
|
||||
</MenuDropdown>
|
||||
</Menu>
|
||||
</IW>
|
||||
</OW>
|
||||
);
|
||||
};
|
||||
@@ -8,6 +8,7 @@ import { brandRecipe } from "../../styles/recipes/brand-recipe";
|
||||
import type { CommonProps } from "../../utils/CommonProps";
|
||||
import { mergeClass } from "../../styles/utils/merge-class";
|
||||
|
||||
// 缺个 loading 动画,暂时没想好怎么做,后面发现样本再抄
|
||||
export type ButtonProps = CommonProps & {
|
||||
size?: "xs" | "sm" | "md" | "lg";
|
||||
variant?: "filled" | "outline" | "subtle" | "ghost";
|
||||
@@ -54,11 +55,6 @@ export const Button = (props: ButtonProps) => {
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const [innerIsLoading, setInnerIsIsLoading] = useState<{
|
||||
state: boolean;
|
||||
class: string;
|
||||
}>({ state: false, class: "" });
|
||||
|
||||
const brandFinal =
|
||||
brand != undefined ? brand : variant == "filled" ? "info" : "default";
|
||||
|
||||
@@ -66,14 +62,13 @@ export const Button = (props: ButtonProps) => {
|
||||
|
||||
const rootClass = mergeClass(
|
||||
displayRecipe(),
|
||||
itemSizeRecipe({ size, shape, isIconOnly, isLongPadding: true }),
|
||||
itemSizeRecipe({ size, shape, isIconOnly}),
|
||||
variantRecipe({ variant, isDisabled }),
|
||||
brandRecipe({ brand: brandFinal }),
|
||||
className,
|
||||
);
|
||||
|
||||
let rootStyle: CSSProperties = {
|
||||
transitionDuration: "all 5s ease-in-out",
|
||||
width: width,
|
||||
...style,
|
||||
};
|
||||
|
||||
@@ -1,36 +1,73 @@
|
||||
import { useState, type ComponentPropsWithRef } from "react";
|
||||
import { useRef, useState, type ChangeEvent, type MouseEvent } 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";
|
||||
import { useMergeRefs } from "@floating-ui/react";
|
||||
|
||||
export type CheckboxProps = CommonProps & {
|
||||
size?: "sm" | "md",
|
||||
defaultCheck?: boolean,
|
||||
onChange?: (preCheck?: boolean, nextCheck?: boolean) => void,
|
||||
controllerCheck?: boolean
|
||||
size?: "sm" | "md";
|
||||
checked?: boolean;
|
||||
defaultChecked?: boolean;
|
||||
onChange?: (nextChecked: boolean) => void;
|
||||
};
|
||||
|
||||
export const Checkbox = (props: CheckboxProps) => {
|
||||
const { defaultCheck = false, ref, onChange, size = "sm", className = "" } = props
|
||||
const {
|
||||
size = "sm",
|
||||
checked: controlledChecked,
|
||||
defaultChecked = false,
|
||||
onChange,
|
||||
ref,
|
||||
className = "",
|
||||
} = props;
|
||||
|
||||
const [isCheck, setIsCheck] = useState<boolean>(defaultCheck)
|
||||
const [checked, setChecked] = useState<boolean>(
|
||||
controlledChecked ?? defaultChecked,
|
||||
);
|
||||
|
||||
const rootClass = mergeClass(inlineSizeRecipe({ size, shape: "rounded", isIconOnly: true }), className)
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
const inputClass = mergeClass("sr-only")
|
||||
const rootClass = mergeClass(
|
||||
inlineSizeRecipe({ size, shape: "rounded", isIconOnly: true }),
|
||||
className,
|
||||
);
|
||||
|
||||
const indicatorClass = mergeClass(inlineSizeRecipe({ size, shape: "rounded" }))
|
||||
const inputClass = mergeClass("sr-only");
|
||||
|
||||
function clickHandler() {
|
||||
const preValue = isCheck
|
||||
setIsCheck(!isCheck)
|
||||
onChange?.(preValue, isCheck)
|
||||
const indicatorClass = mergeClass(
|
||||
inlineSizeRecipe({ size, shape: "rounded" }),
|
||||
);
|
||||
|
||||
// 将 input 的 onClick 范围扩大至整个容器元素
|
||||
function clickHandler(e: MouseEvent<HTMLDivElement>) {
|
||||
// 防止 input 和 div 重叠,响应两次 onClick
|
||||
e.stopPropagation();
|
||||
// 记住前面没有 on
|
||||
inputRef?.current?.click();
|
||||
}
|
||||
|
||||
return <div className={rootClass} onClick={clickHandler} >
|
||||
<input className={inputClass} type="checkbox" ref={ref} />
|
||||
{isCheck && <CheckIndicatorSvg className={indicatorClass} />}
|
||||
// 绑定 state 第2/3步,本元素被键盘点击后,将新值写回 state
|
||||
function changeHandler(e: ChangeEvent<HTMLInputElement>) {
|
||||
// 触发重新渲染,受控模式下,即使 set 也改变不了状态
|
||||
setChecked(e.target.checked);
|
||||
// 执行受控回调函数,向上层传递新值,或许上层组件会拒绝变更从 prop 传入的 checked
|
||||
onChange?.(e.target.checked);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className={rootClass} onClick={clickHandler}>
|
||||
<input
|
||||
className={inputClass}
|
||||
type="checkbox"
|
||||
ref={useMergeRefs([inputRef, ref])}
|
||||
// 绑定 state 第1/3步,从 state 中获取数据
|
||||
checked={checked}
|
||||
// 绑定 state 第2/3步,本元素被键盘点击后,将新值写回 state
|
||||
onChange={changeHandler}
|
||||
/>
|
||||
{checked && <CheckIndicatorSvg className={indicatorClass} />}
|
||||
</div>
|
||||
}
|
||||
Checkbox.displayName = "Checkbox"
|
||||
);
|
||||
};
|
||||
Checkbox.displayName = "Checkbox";
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
|
||||
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 React, {
|
||||
useRef,
|
||||
useState,
|
||||
type CSSProperties,
|
||||
type MouseEvent,
|
||||
} from "react";
|
||||
import { Icon } from "../icon/icon";
|
||||
import { Checkbox } from "../checkbox/checkbox";
|
||||
import { displayRecipe } from "../../styles/recipes/display-recipe";
|
||||
@@ -15,62 +19,101 @@ import { containerRecipe } from "../../styles/recipes/container-recipe";
|
||||
export type MenuCheckItemProps = CommonProps & {
|
||||
iconSvg?: React.ReactNode;
|
||||
hotkey?: string;
|
||||
check?: boolean
|
||||
onChange?: (preCheck?: boolean, nextCheck?: boolean) => void
|
||||
checked?: boolean;
|
||||
defaultChecked?: boolean;
|
||||
onChange?: (nextChecked: boolean) => void;
|
||||
};
|
||||
|
||||
export const MenuCheckItem = (props: MenuCheckItemProps) => {
|
||||
const { ref, children, iconSvg = <div></div>, style, hotkey, isDisabled = false, onChange, ...rest } = props;
|
||||
const {
|
||||
checked: controlledChecked,
|
||||
defaultChecked = false,
|
||||
// ==============================
|
||||
onChange,
|
||||
ref,
|
||||
children,
|
||||
iconSvg = <div></div>,
|
||||
isDisabled = false,
|
||||
hotkey,
|
||||
style,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const [isCheck, setIsCheck] = useState<boolean>(false)
|
||||
const [checked, setChecked] = useState<boolean>(
|
||||
controlledChecked ?? defaultChecked,
|
||||
);
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
// =============== Menu Context ====================================================================
|
||||
|
||||
const menuContext = useMenuContext();
|
||||
const { size = "sm" } = menuContext!
|
||||
const { size = "sm" } = menuContext!;
|
||||
|
||||
// =============== Menu Floating Context ====================================================================
|
||||
|
||||
const menuFloatingContext = useMenuFloatingContext();
|
||||
const { getItemProps, activeIndex, isOpen, } = menuFloatingContext!
|
||||
const { getItemProps, activeIndex, isOpen } = menuFloatingContext!;
|
||||
|
||||
const item = useListItem();
|
||||
const isActive = item.index === activeIndex;
|
||||
|
||||
// ================== Style =================================================================
|
||||
|
||||
const rootClass = mergeClass(displayRecipe({ justifyContent: "between", }), containerRecipe({ hasFocusOutline: "false" }),
|
||||
const rootClass = mergeClass(
|
||||
displayRecipe({ justifyContent: "between" }),
|
||||
containerRecipe({ hasFocusOutline: "false" }),
|
||||
itemSizeRecipe({ size, shape: "rounded" }),
|
||||
variantRecipe({ variant: "ghost", isDisabled }))
|
||||
variantRecipe({ variant: "ghost", isDisabled }),
|
||||
);
|
||||
|
||||
const rootStyle: CSSProperties = {
|
||||
width: "100%",
|
||||
...style
|
||||
...style,
|
||||
};
|
||||
|
||||
const startSectionClass = displayRecipe();
|
||||
|
||||
const endSectionClass = displayRecipe();
|
||||
|
||||
// 将 Checkbox 的 onClick 范围扩大至整个容器元素
|
||||
function clickHandler(e: MouseEvent<HTMLDivElement>) {
|
||||
// 防止 input 和 div 重叠,响应两次 onClick
|
||||
e.stopPropagation();
|
||||
// 前面没有 on
|
||||
inputRef?.current?.click();
|
||||
}
|
||||
|
||||
const startSectionClass = displayRecipe()
|
||||
|
||||
const endSectionClass = displayRecipe()
|
||||
|
||||
function handleOnClick() {
|
||||
const preCheck = isCheck
|
||||
setIsCheck(!isCheck)
|
||||
onChange?.(preCheck, isCheck)
|
||||
// 绑定 state 第2/3步,本元素被键盘点击后,将新值写回 state
|
||||
function changeHandler(nextChecked: boolean) {
|
||||
// 触发重新渲染,受控模式下,即使 set 也改变不了状态
|
||||
setChecked(nextChecked);
|
||||
// 执行受控回调函数,向上层传递新值,或许上层组件会拒绝变更从 prop 传入的 checked
|
||||
onChange?.(nextChecked);
|
||||
}
|
||||
|
||||
return <button {...rest} ref={useMergeRefs([ref, item.ref])}
|
||||
return (
|
||||
<button
|
||||
{...rest}
|
||||
// 此处不需要 mergeRefs,通过 onClick 已经连上了 ref
|
||||
ref={item.ref}
|
||||
className={rootClass}
|
||||
role="menuitem"
|
||||
tabIndex={isActive ? 0 : -1}
|
||||
disabled={isDisabled}
|
||||
{...getItemProps({
|
||||
style: rootStyle,
|
||||
onClick: handleOnClick
|
||||
})
|
||||
}
|
||||
onClick: clickHandler,
|
||||
})}
|
||||
>
|
||||
|
||||
<Checkbox size={size} defaultCheck={isCheck} />
|
||||
<Checkbox
|
||||
ref={useMergeRefs([inputRef, ref])}
|
||||
size={size}
|
||||
defaultChecked={checked}
|
||||
// 绑定 state 第1/3步,从 state 中获取数据
|
||||
checked={checked}
|
||||
// 绑定 state 第2/3步,本元素被键盘点击后,将新值写回 state
|
||||
onChange={changeHandler}
|
||||
/>
|
||||
|
||||
<div className={startSectionClass}>
|
||||
<Icon size={size}>{iconSvg}</Icon>
|
||||
@@ -79,8 +122,11 @@ export const MenuCheckItem = (props: MenuCheckItemProps) => {
|
||||
|
||||
<div className={endSectionClass}>
|
||||
{hotkey && <div>{hotkey}</div>}
|
||||
<Icon size={size}><div></div></Icon>
|
||||
{/* 占位 */}
|
||||
<Icon size={size}>
|
||||
<div></div>
|
||||
</Icon>
|
||||
</div>
|
||||
</button >
|
||||
|
||||
</button>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,49 +7,71 @@ import {
|
||||
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 { containerRecipe } from "../../styles/recipes/container-recipe";
|
||||
import { useThemeContext } from "../theme/use-theme-context";
|
||||
import type { CommonProps } from "../../utils/CommonProps";
|
||||
import { brandRecipe } from "../../styles/recipes/brand-recipe";
|
||||
|
||||
|
||||
export type MenuDropdownProps = ComponentPropsWithoutRef<"div"> & {
|
||||
export type MenuDropdownProps = CommonProps & {
|
||||
modal?: boolean;
|
||||
};
|
||||
|
||||
export const MenuDropdown = (props: MenuDropdownProps) => {
|
||||
const { modal = true, className = "", children, ...rest } = props;
|
||||
const { modal = true, className = "", children, style, ...rest } = props;
|
||||
|
||||
const { size } = useMenuContext()!
|
||||
const { refs, elementsRef, context, floatingStyles, getFloatingProps, isNested, isOpen } = useMenuFloatingContext()!;
|
||||
const { size } = useMenuContext()!;
|
||||
const {
|
||||
refs,
|
||||
elementsRef,
|
||||
context,
|
||||
floatingStyles,
|
||||
getFloatingProps,
|
||||
isNested,
|
||||
isOpen,
|
||||
} = useMenuFloatingContext()!;
|
||||
|
||||
// ==============================================================================================================
|
||||
|
||||
const { themeBaseClass, themeClass } = useThemeContext()!
|
||||
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 rootClass = mergeClass(
|
||||
containerRecipe({
|
||||
boxShadow: true,
|
||||
rounded: size == "sm" ? 4 : 8,
|
||||
padding: size == "sm" ? 4 : 8,
|
||||
background: "base",
|
||||
hasFocusOutline: "false",
|
||||
}),
|
||||
brandRecipe(),
|
||||
themeBaseClass,
|
||||
themeClass,
|
||||
className,
|
||||
);
|
||||
|
||||
const rootStyle: CSSProperties = {
|
||||
...floatingStyles,
|
||||
borderRadius: borderRadius,
|
||||
padding: padding,
|
||||
// invisable the outline
|
||||
outline: 0,
|
||||
background: "var(--base-bg)"
|
||||
...style,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
return <FloatingList elementsRef={elementsRef}>
|
||||
{isOpen && <FloatingPortal >
|
||||
<FloatingFocusManager context={context} modal={modal} >
|
||||
<div {...rest} className={rootClass} style={rootStyle} ref={refs.setFloating} {...getFloatingProps()} >
|
||||
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 >
|
||||
)}
|
||||
</FloatingList>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -97,6 +97,7 @@ export const MenuItem = (props: MenuItemProps) => {
|
||||
)}
|
||||
{isTrigger && !isOpen && <Icon size={size}>{indicatorSvg}</Icon>}
|
||||
{!isTrigger && (
|
||||
// 占位
|
||||
<Icon size={size}>
|
||||
<div></div>
|
||||
</Icon>
|
||||
|
||||
@@ -1,24 +1,34 @@
|
||||
import { useState } from "react";
|
||||
import { useEffect, useRef, 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
|
||||
defaultSelectName?: string;
|
||||
onChange?: (nextSelect?: string) => void;
|
||||
};
|
||||
|
||||
export const MenuRadioItemGroup = (props: MenuRadioItemGroupProps) => {
|
||||
const { size = "sm", defaultSelectName = "", ...rest } = props
|
||||
const {
|
||||
size = "sm",
|
||||
defaultSelectName = "",
|
||||
children,
|
||||
onChange,
|
||||
...rest
|
||||
} = props;
|
||||
|
||||
const [selectName, setSelectName] = useState<string>(defaultSelectName);
|
||||
|
||||
const { size: menuSize } = useMenuContext()!
|
||||
const { size: menuSize } = useMenuContext()!;
|
||||
|
||||
const currentSize = menuSize ?? size
|
||||
const currentSize = menuSize ?? size;
|
||||
|
||||
return <MenuRadioItemGroupContext value={{ size: currentSize, selectName, setSelectName }}>
|
||||
<div {...rest} ></div>
|
||||
return (
|
||||
<MenuRadioItemGroupContext
|
||||
value={{ size: currentSize, selectName, setSelectName }}
|
||||
>
|
||||
<div {...rest}>{children}</div>
|
||||
</MenuRadioItemGroupContext>
|
||||
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
} 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";
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
@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';
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
@layer utility {
|
||||
|
||||
.gap-none {
|
||||
gap: none;
|
||||
gap: var(--gap-none);
|
||||
}
|
||||
|
||||
.gap--xs {
|
||||
gap: 2px;
|
||||
gap: var(--gap-xs);
|
||||
}
|
||||
|
||||
.gap--sm {
|
||||
gap: 4px;
|
||||
gap: var(--gap-sm);
|
||||
}
|
||||
|
||||
.gap--md {
|
||||
gap: 6px;
|
||||
gap: var(--gap-md);
|
||||
}
|
||||
|
||||
.gap--lg {
|
||||
gap: 8px;
|
||||
gap: var(--gap-lg);
|
||||
}
|
||||
|
||||
.gap--xl {
|
||||
gap: 10px;
|
||||
gap: var(--gap-lg);
|
||||
}
|
||||
|
||||
.gap--2xl {
|
||||
gap: 12px;
|
||||
gap: var(--gap-2xl);
|
||||
}
|
||||
|
||||
.gap--3xl {
|
||||
gap: 14px;
|
||||
gap: var(--gap-3xl);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@@ -358,8 +358,8 @@
|
||||
--height-item-xs: 20px;
|
||||
--height-item-sm: 24px;
|
||||
--height-item-md: 28px;
|
||||
--height-item-lg: 34px;
|
||||
--height-item-xl: 44px;
|
||||
--height-item-lg: 32px;
|
||||
--height-item-xl: 42px;
|
||||
--height-item-2xl: 56px;
|
||||
--height-item-3xl: 64px;
|
||||
|
||||
@@ -373,26 +373,18 @@
|
||||
--radius-none: 0;
|
||||
--radius-full: 9999px;
|
||||
|
||||
--padding-xs: 6px;
|
||||
--padding-sm: 8px;
|
||||
--padding-md: 10px;
|
||||
--padding-lg: 12px;
|
||||
--padding-xs: 4px;
|
||||
--padding-sm: 6px;
|
||||
--padding-md: 8px;
|
||||
--padding-lg: 10px;
|
||||
--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-sm: 3px;
|
||||
--gap-md: 4px;
|
||||
--gap-lg: 5px;
|
||||
--gap-xl: 10px;
|
||||
--gap-2xl: 12px;
|
||||
--gap-3xl: 14px;
|
||||
|
||||
@@ -27,14 +27,6 @@ export const itemSizeRecipe = createClassRecipe({
|
||||
},
|
||||
},
|
||||
compoundVariants: [
|
||||
{ size: "xs", isLongPadding: true, class: "px--long-xs" },
|
||||
{ size: "sm", isLongPadding: true, class: "px--long-sm" },
|
||||
{ size: "md", isLongPadding: true, class: "px--long-md" },
|
||||
{ size: "lg", isLongPadding: true, class: "px--long-lg" },
|
||||
{ size: "xl", isLongPadding: true, class: "px--long-xl" },
|
||||
{ size: "2xl", isLongPadding: true, class: "px--long-2xl" },
|
||||
{ size: "3xl", isLongPadding: true, class: "px--long-3xl" },
|
||||
// ==================================================
|
||||
{ shape: "rounded", size: "xs", class: "rounded--xs" },
|
||||
{ shape: "rounded", size: "sm", class: "rounded--sm" },
|
||||
{ shape: "rounded", size: "md", class: "rounded--md" },
|
||||
|
||||
Reference in New Issue
Block a user