feat: migrate to Tailwind CSS v4 (#7614)

* chore: update deps

* feat: use jsonc/x language

* chore: update eslint 10.0

* fix: no-useless-assignment

* feat: add CLAUDE.md

* chore: ignore

* feat: claude

* fix: lint

* chore: suppot eslint v10

* fix: lint

* fix: lint

* fix: type check

* fix: unit test

* fix: Suggested fix

* fix: unit test

* chore: update stylelint v17

* chore: update all major deps

* fix:  echarts console warn

* chore: update vitest v4

* feat: add skills ignores

* chore: update deps

* chore: update deps

* fix: cspell

* chore: update deps

* chore: update tailwindcss v4

* chore: remove postcss config

* fix: no use catalog

* chore: tailwind v4 config

* fix: tailwindcss v4 sort

* feat: use eslint-plugin-better-tailwindcss

* fix: Interference between enforce-consistent-line-wrapping, jsx-curly-brace-presence and Prettier

* fix: Interference between enforce-consistent-line-wrapping, jsx-curly-brace-presence and Prettier

* fix(lint): resolve prettier and better-tailwindcss formatting conflicts

* fix(tailwind): update theme references and lint sources

* style(format): normalize apps docs and playground vue files

* style(format): normalize core ui-kit components

* style(format): normalize effects ui and layout components
This commit is contained in:
xingyu
2026-03-10 05:08:45 +08:00
committed by GitHub
parent aa7d8630b5
commit a4736a49f8
289 changed files with 5286 additions and 6331 deletions

View File

@@ -25,6 +25,9 @@
"development": "./src/scss-bem/bem.scss",
"default": "./dist/bem.scss"
},
"./theme": {
"default": "./src/css/global.css"
},
".": {
"types": "./src/index.ts",
"development": "./src/index.ts",
@@ -37,5 +40,11 @@
"default": "./dist/index.mjs"
}
}
},
"dependencies": {
"@iconify/json": "catalog:",
"@iconify/tailwind4": "catalog:",
"@tailwindcss/typography": "catalog:",
"tw-animate-css": "catalog:"
}
}

View File

@@ -1,12 +1,294 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import 'tailwindcss';
@import 'tw-animate-css';
@plugin '@tailwindcss/typography';
@plugin '@iconify/tailwind4';
/* Monorepo source detection: scan all packages and apps for utility classes */
@source '../../../../../../packages/';
@source '../../../../../../apps/';
@source '../../../../../../docs/';
@source '../../../../../../playground/';
/* Dark mode uses .dark class selector, not prefers-color-scheme */
@custom-variant dark (&:is(.dark *));
@theme inline {
/* Font */
--font-sans: var(--font-family);
/* Border Radius */
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
/* Box Shadow */
--shadow-float:
0 6px 16px 0 rgb(0 0 0 / 8%), 0 3px 6px -4px rgb(0 0 0 / 12%),
0 9px 28px 8px rgb(0 0 0 / 5%);
/* Animations */
--animate-accordion-down: accordion-down 0.2s ease-out;
--animate-accordion-up: accordion-up 0.2s ease-out;
--animate-collapsible-down: collapsible-down 0.2s ease-in-out;
--animate-collapsible-up: collapsible-up 0.2s ease-in-out;
--animate-float: float 5s linear 0ms infinite;
/* ===== Semantic Colors (shadcn-ui) ===== */
--color-background: hsl(var(--background));
--color-background-deep: hsl(var(--background-deep));
--color-foreground: hsl(var(--foreground));
--color-card: hsl(var(--card));
--color-card-foreground: hsl(var(--card-foreground));
--color-popover: hsl(var(--popover));
--color-popover-foreground: hsl(var(--popover-foreground));
--color-muted: hsl(var(--muted));
--color-muted-foreground: hsl(var(--muted-foreground));
--color-accent: hsl(var(--accent));
--color-accent-foreground: hsl(var(--accent-foreground));
--color-accent-hover: hsl(var(--accent-hover));
--color-accent-lighter: hsl(var(--accent-lighter));
--color-border: hsl(var(--border));
--color-input: hsl(var(--input));
--color-input-background: hsl(var(--input-background));
--color-ring: hsl(var(--ring));
--color-secondary: hsl(var(--secondary));
--color-secondary-desc: hsl(var(--secondary-desc));
--color-secondary-foreground: hsl(var(--secondary-foreground));
/* ===== Custom Semantic Colors ===== */
--color-header: hsl(var(--header));
--color-heavy: hsl(var(--heavy));
--color-heavy-foreground: hsl(var(--heavy-foreground));
--color-main: hsl(var(--main));
--color-overlay: hsl(var(--overlay));
--color-overlay-content: hsl(var(--overlay-content));
--color-sidebar: hsl(var(--sidebar));
--color-sidebar-deep: hsl(var(--sidebar-deep));
/* ===== Primary Palette ===== */
--color-primary: hsl(var(--primary));
--color-primary-foreground: hsl(var(--primary-foreground));
--color-primary-50: hsl(var(--primary-50));
--color-primary-100: hsl(var(--primary-100));
--color-primary-200: hsl(var(--primary-200));
--color-primary-300: hsl(var(--primary-300));
--color-primary-400: hsl(var(--primary-400));
--color-primary-500: hsl(var(--primary-500));
--color-primary-600: hsl(var(--primary-600));
--color-primary-700: hsl(var(--primary-700));
--color-primary-active: hsl(var(--primary-700));
--color-primary-background-light: hsl(var(--primary-200));
--color-primary-background-lighter: hsl(var(--primary-100));
--color-primary-background-lightest: hsl(var(--primary-50));
--color-primary-border: hsl(var(--primary-400));
--color-primary-border-light: hsl(var(--primary-300));
--color-primary-hover: hsl(var(--primary-600));
--color-primary-text: hsl(var(--primary-500));
--color-primary-text-active: hsl(var(--primary-700));
--color-primary-text-hover: hsl(var(--primary-600));
/* ===== Destructive Palette ===== */
--color-destructive: hsl(var(--destructive));
--color-destructive-foreground: hsl(var(--destructive-foreground));
--color-destructive-50: hsl(var(--destructive-50));
--color-destructive-100: hsl(var(--destructive-100));
--color-destructive-200: hsl(var(--destructive-200));
--color-destructive-300: hsl(var(--destructive-300));
--color-destructive-400: hsl(var(--destructive-400));
--color-destructive-500: hsl(var(--destructive-500));
--color-destructive-600: hsl(var(--destructive-600));
--color-destructive-700: hsl(var(--destructive-700));
--color-destructive-active: hsl(var(--destructive-700));
--color-destructive-background-light: hsl(var(--destructive-200));
--color-destructive-background-lighter: hsl(var(--destructive-100));
--color-destructive-background-lightest: hsl(var(--destructive-50));
--color-destructive-border: hsl(var(--destructive-400));
--color-destructive-border-light: hsl(var(--destructive-300));
--color-destructive-hover: hsl(var(--destructive-600));
--color-destructive-text: hsl(var(--destructive-500));
--color-destructive-text-active: hsl(var(--destructive-700));
--color-destructive-text-hover: hsl(var(--destructive-600));
/* ===== Success Palette ===== */
--color-success: hsl(var(--success));
--color-success-foreground: hsl(var(--success-foreground));
--color-success-50: hsl(var(--success-50));
--color-success-100: hsl(var(--success-100));
--color-success-200: hsl(var(--success-200));
--color-success-300: hsl(var(--success-300));
--color-success-400: hsl(var(--success-400));
--color-success-500: hsl(var(--success-500));
--color-success-600: hsl(var(--success-600));
--color-success-700: hsl(var(--success-700));
--color-success-active: hsl(var(--success-700));
--color-success-background-light: hsl(var(--success-200));
--color-success-background-lighter: hsl(var(--success-100));
--color-success-background-lightest: hsl(var(--success-50));
--color-success-border: hsl(var(--success-400));
--color-success-border-light: hsl(var(--success-300));
--color-success-hover: hsl(var(--success-600));
--color-success-text: hsl(var(--success-500));
--color-success-text-active: hsl(var(--success-700));
--color-success-text-hover: hsl(var(--success-600));
/* ===== Warning Palette ===== */
--color-warning: hsl(var(--warning));
--color-warning-foreground: hsl(var(--warning-foreground));
--color-warning-50: hsl(var(--warning-50));
--color-warning-100: hsl(var(--warning-100));
--color-warning-200: hsl(var(--warning-200));
--color-warning-300: hsl(var(--warning-300));
--color-warning-400: hsl(var(--warning-400));
--color-warning-500: hsl(var(--warning-500));
--color-warning-600: hsl(var(--warning-600));
--color-warning-700: hsl(var(--warning-700));
--color-warning-active: hsl(var(--warning-700));
--color-warning-background-light: hsl(var(--warning-200));
--color-warning-background-lighter: hsl(var(--warning-100));
--color-warning-background-lightest: hsl(var(--warning-50));
--color-warning-border: hsl(var(--warning-400));
--color-warning-border-light: hsl(var(--warning-300));
--color-warning-hover: hsl(var(--warning-600));
--color-warning-text: hsl(var(--warning-500));
--color-warning-text-active: hsl(var(--warning-700));
--color-warning-text-hover: hsl(var(--warning-600));
/* ===== Green Palette (alias for success shades) ===== */
--color-green-50: hsl(var(--green-50));
--color-green-100: hsl(var(--green-100));
--color-green-200: hsl(var(--green-200));
--color-green-300: hsl(var(--green-300));
--color-green-400: hsl(var(--green-400));
--color-green-500: hsl(var(--green-500));
--color-green-600: hsl(var(--green-600));
--color-green-700: hsl(var(--green-700));
--color-green-active: hsl(var(--green-700));
--color-green-background-light: hsl(var(--green-200));
--color-green-background-lighter: hsl(var(--green-100));
--color-green-background-lightest: hsl(var(--green-50));
--color-green-border: hsl(var(--green-400));
--color-green-border-light: hsl(var(--green-300));
--color-green-foreground: hsl(var(--success-foreground));
--color-green-hover: hsl(var(--green-600));
--color-green-text: hsl(var(--green-500));
--color-green-text-active: hsl(var(--green-700));
--color-green-text-hover: hsl(var(--green-600));
/* ===== Red Palette (alias for destructive shades) ===== */
--color-red-50: hsl(var(--red-50));
--color-red-100: hsl(var(--red-100));
--color-red-200: hsl(var(--red-200));
--color-red-300: hsl(var(--red-300));
--color-red-400: hsl(var(--red-400));
--color-red-500: hsl(var(--red-500));
--color-red-600: hsl(var(--red-600));
--color-red-700: hsl(var(--red-700));
--color-red-active: hsl(var(--red-700));
--color-red-background-light: hsl(var(--red-200));
--color-red-background-lighter: hsl(var(--red-100));
--color-red-background-lightest: hsl(var(--red-50));
--color-red-border: hsl(var(--red-400));
--color-red-border-light: hsl(var(--red-300));
--color-red-foreground: hsl(var(--destructive-foreground));
--color-red-hover: hsl(var(--red-600));
--color-red-text: hsl(var(--red-500));
--color-red-text-active: hsl(var(--red-700));
--color-red-text-hover: hsl(var(--red-600));
/* ===== Yellow Palette (alias for warning shades) ===== */
--color-yellow-50: hsl(var(--yellow-50));
--color-yellow-100: hsl(var(--yellow-100));
--color-yellow-200: hsl(var(--yellow-200));
--color-yellow-300: hsl(var(--yellow-300));
--color-yellow-400: hsl(var(--yellow-400));
--color-yellow-500: hsl(var(--yellow-500));
--color-yellow-600: hsl(var(--yellow-600));
--color-yellow-700: hsl(var(--yellow-700));
--color-yellow-active: hsl(var(--yellow-700));
--color-yellow-background-light: hsl(var(--yellow-200));
--color-yellow-background-lighter: hsl(var(--yellow-100));
--color-yellow-background-lightest: hsl(var(--yellow-50));
--color-yellow-border: hsl(var(--yellow-400));
--color-yellow-border-light: hsl(var(--yellow-300));
--color-yellow-foreground: hsl(var(--warning-foreground));
--color-yellow-hover: hsl(var(--yellow-600));
--color-yellow-text: hsl(var(--yellow-500));
--color-yellow-text-active: hsl(var(--yellow-700));
--color-yellow-text-hover: hsl(var(--yellow-600));
}
/* Keyframes */
@keyframes accordion-down {
from {
height: 0;
}
to {
height: var(--reka-accordion-content-height);
}
}
@keyframes accordion-up {
from {
height: var(--reka-accordion-content-height);
}
to {
height: 0;
}
}
@keyframes collapsible-down {
from {
height: 0;
}
to {
height: var(--reka-collapsible-content-height);
}
}
@keyframes collapsible-up {
from {
height: var(--reka-collapsible-content-height);
}
to {
height: 0;
}
}
@keyframes float {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-20px);
}
100% {
transform: translateY(0);
}
}
/* Base styles */
@layer base {
*,
::after,
::before {
@apply border-border;
@apply border-border outline-ring/50;
box-sizing: border-box;
border-style: solid;
@@ -24,29 +306,16 @@
text-rendering: optimizelegibility;
text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
/* -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; */
}
#app,
body,
html {
@apply size-full;
/* scrollbar-gutter: stable; */
}
body {
min-height: 100vh;
/* pointer-events: auto !important; */
/* overflow: overlay; */
/* -webkit-font-smoothing: antialiased; */
/* -moz-osx-font-smoothing: grayscale; */
}
a,
@@ -63,19 +332,19 @@
}
::view-transition-old(root) {
@apply z-[1];
@apply z-1;
}
::view-transition-new(root) {
@apply z-[2147483646];
@apply z-2147483646;
}
html.dark::view-transition-old(root) {
@apply z-[2147483646];
@apply z-2147483646;
}
html.dark::view-transition-new(root) {
@apply z-[1];
@apply z-1;
}
input::placeholder,
@@ -83,18 +352,12 @@
@apply opacity-100;
}
/* input:-webkit-autofill {
@apply border-none;
box-shadow: 0 0 0 1000px transparent inset;
} */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
@apply m-0 appearance-none;
}
/* 只有非mac下才进行调整mac下使用默认滚动条 */
/* Only adjust scrollbar for non-macOS */
html:not([data-platform='macOs']) {
::-webkit-scrollbar {
@apply h-[10px] w-[10px];
@@ -114,44 +377,184 @@
}
}
@layer components {
.flex-center {
@apply flex items-center justify-center;
}
/* Custom utilities (v4 @utility syntax) */
@utility flex-center {
display: flex;
align-items: center;
justify-content: center;
}
.flex-col-center {
@apply flex flex-col items-center justify-center;
}
@utility flex-col-center {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.outline-box {
@apply outline-border relative cursor-pointer rounded-md p-1 outline outline-1;
}
/* Component styles (complex selectors, not convertible to @utility) */
.outline-box {
@apply outline-border relative cursor-pointer rounded-md p-1 outline-1;
}
.outline-box::after {
@apply absolute left-1/2 top-1/2 z-20 h-0 w-[1px] rounded-sm opacity-0 outline outline-2 outline-transparent transition-all duration-300 content-[""];
}
.outline-box::after {
@apply absolute top-1/2 left-1/2 z-20 h-0 w-px rounded-sm opacity-0 outline-2 outline-transparent transition-all duration-300 content-[""];
}
.outline-box.outline-box-active {
@apply outline-primary outline outline-2;
}
.outline-box.outline-box-active {
@apply outline-primary outline-2;
}
.outline-box.outline-box-active::after {
display: none;
}
.outline-box.outline-box-active::after {
display: none;
}
.outline-box:not(.outline-box-active):hover::after {
@apply outline-primary left-0 top-0 h-full w-full p-1 opacity-100;
}
.outline-box:not(.outline-box-active):hover::after {
@apply outline-primary top-0 left-0 h-full w-full p-1 opacity-100;
}
.vben-link {
@apply text-primary hover:text-primary-hover active:text-primary-active cursor-pointer;
}
.vben-link {
@apply text-primary hover:text-primary-hover active:text-primary-active cursor-pointer;
}
.card-box {
@apply bg-card text-card-foreground border-border rounded-xl border;
.card-box {
@apply bg-card text-card-foreground border-border rounded-xl border;
}
/* Enter animations (converted from enterAnimationPlugin) */
@keyframes enter-x-animation {
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes enter-y-animation {
to {
opacity: 1;
transform: translateY(0);
}
}
.enter-x:nth-child(1) {
opacity: 0;
transform: translateX(50px);
animation: enter-x-animation 0.3s ease-in-out 0.1s forwards;
}
.enter-x:nth-child(2) {
opacity: 0;
transform: translateX(50px);
animation: enter-x-animation 0.3s ease-in-out 0.2s forwards;
}
.enter-x:nth-child(3) {
opacity: 0;
transform: translateX(50px);
animation: enter-x-animation 0.3s ease-in-out 0.3s forwards;
}
.enter-x:nth-child(4) {
opacity: 0;
transform: translateX(50px);
animation: enter-x-animation 0.3s ease-in-out 0.4s forwards;
}
.enter-x:nth-child(5) {
opacity: 0;
transform: translateX(50px);
animation: enter-x-animation 0.3s ease-in-out 0.5s forwards;
}
.enter-y:nth-child(1) {
opacity: 0;
transform: translateY(50px);
animation: enter-y-animation 0.3s ease-in-out 0.1s forwards;
}
.enter-y:nth-child(2) {
opacity: 0;
transform: translateY(50px);
animation: enter-y-animation 0.3s ease-in-out 0.2s forwards;
}
.enter-y:nth-child(3) {
opacity: 0;
transform: translateY(50px);
animation: enter-y-animation 0.3s ease-in-out 0.3s forwards;
}
.enter-y:nth-child(4) {
opacity: 0;
transform: translateY(50px);
animation: enter-y-animation 0.3s ease-in-out 0.4s forwards;
}
.enter-y:nth-child(5) {
opacity: 0;
transform: translateY(50px);
animation: enter-y-animation 0.3s ease-in-out 0.5s forwards;
}
.-enter-x:nth-child(1) {
opacity: 0;
transform: translateX(-50px);
animation: enter-x-animation 0.3s ease-in-out 0.1s forwards;
}
.-enter-x:nth-child(2) {
opacity: 0;
transform: translateX(-50px);
animation: enter-x-animation 0.3s ease-in-out 0.2s forwards;
}
.-enter-x:nth-child(3) {
opacity: 0;
transform: translateX(-50px);
animation: enter-x-animation 0.3s ease-in-out 0.3s forwards;
}
.-enter-x:nth-child(4) {
opacity: 0;
transform: translateX(-50px);
animation: enter-x-animation 0.3s ease-in-out 0.4s forwards;
}
.-enter-x:nth-child(5) {
opacity: 0;
transform: translateX(-50px);
animation: enter-x-animation 0.3s ease-in-out 0.5s forwards;
}
.-enter-y:nth-child(1) {
opacity: 0;
transform: translateY(-50px);
animation: enter-y-animation 0.3s ease-in-out 0.1s forwards;
}
.-enter-y:nth-child(2) {
opacity: 0;
transform: translateY(-50px);
animation: enter-y-animation 0.3s ease-in-out 0.2s forwards;
}
.-enter-y:nth-child(3) {
opacity: 0;
transform: translateY(-50px);
animation: enter-y-animation 0.3s ease-in-out 0.3s forwards;
}
.-enter-y:nth-child(4) {
opacity: 0;
transform: translateY(-50px);
animation: enter-y-animation 0.3s ease-in-out 0.4s forwards;
}
.-enter-y:nth-child(5) {
opacity: 0;
transform: translateY(-50px);
animation: enter-y-animation 0.3s ease-in-out 0.5s forwards;
}
html.invert-mode {
@apply invert;
}

View File

@@ -1,10 +1,12 @@
@reference "./global.css";
/* Make clicks pass-through */
#nprogress {
@apply pointer-events-none;
}
#nprogress .bar {
@apply bg-primary fixed left-0 top-0 z-[1031] h-[2px] w-full;
@apply bg-primary fixed top-0 left-0 z-1031 h-[2px] w-full;
}
/* Fancy blur effect */
@@ -20,11 +22,11 @@
/* Remove these to get rid of the spinner */
#nprogress .spinner {
@apply fixed right-4 top-4 z-[1031] block;
@apply fixed top-4 right-4 z-1031 block;
}
#nprogress .spinner-icon {
@apply border-t-primary border-l-primary size-4 rounded-full border-[2px] border-solid border-transparent;
@apply border-t-primary border-l-primary size-4 rounded-full border-2 border-solid border-transparent;
animation: nprogress-spinner 400ms linear infinite;
}

View File

@@ -1,10 +1,7 @@
import { beforeEach, describe, expect, it } from 'vitest';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { loadScript } from '../resources';
const testJsPath =
'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';
describe('loadScript', () => {
beforeEach(() => {
// 每个测试前清空 head保证环境干净
@@ -12,18 +9,14 @@ describe('loadScript', () => {
});
it('should resolve when the script loads successfully', async () => {
const promise = loadScript(testJsPath);
// happy-dom v20+ auto-fires 'load' via handleDisabledFileLoadingAsSuccess
const promise = loadScript('/test-script.js');
// 此时脚本元素已被创建并插入
const script = document.querySelector(
`script[src="${testJsPath}"]`,
'script[src="/test-script.js"]',
) as HTMLScriptElement;
expect(script).toBeTruthy();
// 模拟加载成功
script.dispatchEvent(new Event('load'));
// 等待 promise resolve
await expect(promise).resolves.toBeUndefined();
});
@@ -45,37 +38,42 @@ describe('loadScript', () => {
});
it('should reject when the script fails to load', async () => {
let capturedScript: HTMLScriptElement | null = null;
// 拦截 append捕获 script 元素但不插入 DOM
// 防止 happy-dom v20+ 自动触发 load 事件
const appendSpy = vi
.spyOn(document.head, 'append')
.mockImplementation((...nodes) => {
for (const node of nodes) {
if (node instanceof HTMLScriptElement) {
capturedScript = node;
}
}
});
const promise = loadScript('error.js');
const script = document.querySelector(
'script[src="error.js"]',
) as HTMLScriptElement;
expect(script).toBeTruthy();
appendSpy.mockRestore();
// 模拟加载失败
script.dispatchEvent(new Event('error'));
expect(capturedScript).toBeTruthy();
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
capturedScript!.dispatchEvent(new Event('error'));
await expect(promise).rejects.toThrow('Failed to load script: error.js');
});
it('should handle multiple concurrent calls and only insert one script tag', async () => {
const p1 = loadScript(testJsPath);
const p2 = loadScript(testJsPath);
const script = document.querySelector(
`script[src="${testJsPath}"]`,
) as HTMLScriptElement;
expect(script).toBeTruthy();
// 触发一次 load两个 promise 都应该 resolve
script.dispatchEvent(new Event('load'));
const p1 = loadScript('/test-script.js');
const p2 = loadScript('/test-script.js');
// happy-dom v20+ auto-fires 'load',两个 promise 都应该 resolve
await expect(p1).resolves.toBeUndefined();
await expect(p2).resolves.toBeUndefined();
// 只插入一次
const scripts = document.head.querySelectorAll(
`script[src="${testJsPath}"]`,
'script[src="/test-script.js"]',
);
expect(scripts).toHaveLength(1);
});

View File

@@ -20,8 +20,8 @@ const defaultPreferences: Preferences = {
defaultHomePath: '/analytics',
dynamicTitle: true,
enableCheckUpdates: true,
enablePreferences: true,
enableCopyPreferences: true,
enablePreferences: true,
enableRefreshToken: false,
enableStickyPreferencesNavigationBar: true,
isMobile: false,

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config/postcss';

View File

@@ -75,19 +75,16 @@ export class FormApi {
const defaultState = getDefaultState();
this.store = new Store<VbenFormProps>(
{
...defaultState,
...storeState,
},
{
onUpdate: () => {
this.prevState = this.state;
this.state = this.store.state;
this.updateState();
},
},
);
this.store = new Store<VbenFormProps>({
...defaultState,
...storeState,
});
this.store.subscribe((state) => {
this.prevState = this.state;
this.state = state;
this.updateState();
});
this.state = this.store.state;
this.stateHandler = new StateHandler();

View File

@@ -308,7 +308,7 @@ onUnmounted(() => {
cn(
'flex leading-6',
{
'mr-2 flex-shrink-0 justify-end': !isVertical,
'mr-2 shrink-0 justify-end': !isVertical,
'mb-1 flex-row': isVertical,
},
labelClass,
@@ -324,7 +324,7 @@ onUnmounted(() => {
<VbenRenderContent :content="label" />
</template>
</FormLabel>
<div class="flex-auto overflow-hidden p-[1px]">
<div class="flex-auto overflow-hidden p-px">
<div :class="cn('relative flex w-full items-center', wrapperClass)">
<FormControl :class="cn(controlClass)">
<slot

View File

@@ -157,7 +157,7 @@ const computedSchema = computed(
...schema.formFieldProps,
},
formItemClass: cn(
'flex-shrink-0',
'shrink-0',
{ hidden },
formItemClass,
resolvedSchemaFormItemClass,

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config';

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config/postcss';

View File

@@ -307,7 +307,7 @@ onUnmounted(() => {
<aside
ref="asideRef"
:style="style"
class="fixed left-0 top-0 h-full transition-all duration-150"
class="fixed top-0 left-0 h-full transition-all duration-150"
@mouseenter="handleMouseenter"
@mouseleave="handleMouseleave"
>
@@ -374,7 +374,7 @@ onUnmounted(() => {
<div
v-if="draggable"
ref="dragBarRef"
class="absolute inset-y-0 -right-[1px] z-1000 w-[2px] cursor-col-resize hover:bg-primary"
class="absolute inset-y-0 -right-px z-1000 w-[2px] cursor-col-resize hover:bg-primary"
@mousedown="handleDragSidebar"
></div>
</aside>

View File

@@ -10,7 +10,7 @@ function handleCollapsed() {
<template>
<div
class="flex-center absolute bottom-2 left-3 z-10 cursor-pointer rounded-sm bg-accent p-1 text-foreground/60 hover:bg-accent-hover hover:text-foreground"
class="absolute bottom-2 left-3 z-10 flex-center cursor-pointer rounded-sm bg-accent p-1 text-foreground/60 hover:bg-accent-hover hover:text-foreground"
@click.stop="handleCollapsed"
>
<ChevronsRight v-if="collapsed" class="size-4" />

View File

@@ -10,7 +10,7 @@ function toggleFixed() {
<template>
<div
class="flex-center absolute bottom-2 right-3 z-10 cursor-pointer rounded-sm bg-accent p-[5px] text-foreground/60 transition-all duration-300 hover:bg-accent-hover hover:text-foreground"
class="absolute right-3 bottom-2 z-10 flex-center cursor-pointer rounded-sm bg-accent p-[5px] text-foreground/60 transition-all duration-300 hover:bg-accent-hover hover:text-foreground"
@click="toggleFixed"
>
<PinOff v-if="!expandOnHover" class="size-3.5" />

View File

@@ -275,7 +275,7 @@ const mainStyle = computed(() => {
// 计算 tabbar 的样式
const tabbarStyle = computed((): CSSProperties => {
let width = '';
let width: string;
let marginLeft = 0;
// 如果不是混合导航tabbar 的宽度为 100%
@@ -627,7 +627,7 @@ const idMainContent = ELEMENT_ID_MAIN_CONTENT;
<div
v-if="maskVisible"
:style="maskStyle"
class="fixed left-0 top-0 h-full w-full bg-overlay transition-[background-color] duration-200"
class="fixed top-0 left-0 size-full bg-overlay transition-[background-color] duration-200"
@click="handleClickMask"
></div>
</div>

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config';

View File

@@ -38,6 +38,7 @@
},
"dependencies": {
"@vben-core/composables": "workspace:*",
"@vben-core/design": "workspace:*",
"@vben-core/icons": "workspace:*",
"@vben-core/shadcn-ui": "workspace:*",
"@vben-core/shared": "workspace:*",

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config/postcss';

View File

@@ -16,7 +16,7 @@ withDefaults(defineProps<Props>(), {
<span
:class="dotClass"
:style="dotStyle"
class="absolute inline-flex h-full w-full animate-ping rounded-full opacity-75"
class="absolute inline-flex size-full animate-ping rounded-full opacity-75"
>
</span>
<span

View File

@@ -60,6 +60,8 @@ function menuIcon(menu: MenuRecordRaw) {
<style lang="scss" scoped>
$namespace: vben;
@reference "@vben-core/design/theme";
.#{$namespace}-normal-menu {
--menu-item-margin-y: 4px;
--menu-item-margin-x: 0px;
@@ -129,7 +131,7 @@ $namespace: vben;
.#{$namespace}-normal-menu__name,
.#{$namespace}-normal-menu__icon {
@apply font-semibold text-primary-foreground;
@apply text-primary-foreground font-semibold;
}
}

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config';

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config/postcss';

View File

@@ -147,7 +147,7 @@ async function handleOpenChange(val: boolean) {
:class="
cn(
containerClass,
'left-0 right-0 mx-auto flex max-h-[80%] flex-col p-0 duration-300 sm:w-[520px] sm:max-w-[80%] sm:rounded-[var(--radius)]',
'inset-x-0 mx-auto flex max-h-[80%] flex-col p-0 duration-300 sm:w-[520px] sm:max-w-[80%] sm:rounded-(--radius)',
{
'border border-border': bordered,
'shadow-3xl': !bordered,

View File

@@ -13,21 +13,20 @@ vi.mock('@vben-core/shared/store', () => {
return this._state;
}
private _state: DrawerState;
private subscribers: Array<(state: DrawerState) => void> = [];
private options: any;
constructor(initialState: DrawerState, options: any) {
constructor(initialState: DrawerState) {
this._state = initialState;
this.options = options;
}
batch(cb: () => void) {
cb();
}
setState(fn: (prev: DrawerState) => DrawerState) {
this._state = fn(this._state);
this.options.onUpdate();
this.subscribers.forEach((sub) => sub(this._state));
}
subscribe(fn: (state: DrawerState) => void) {
this.subscribers.push(fn);
return { unsubscribe: () => {} };
}
},
};

View File

@@ -56,23 +56,18 @@ export class DrawerApi {
title: '',
};
this.store = new Store<DrawerState>(
{
...defaultState,
...storeState,
},
{
onUpdate: () => {
const state = this.store.state;
if (state?.isOpen === this.state?.isOpen) {
this.state = state;
} else {
this.state = state;
this.api.onOpenChange?.(!!state?.isOpen);
}
},
},
);
this.store = new Store<DrawerState>({
...defaultState,
...storeState,
});
this.store.subscribe((state) => {
const prevIsOpen = this.state?.isOpen;
this.state = state;
if (state?.isOpen !== prevIsOpen) {
this.api.onOpenChange?.(!!state?.isOpen);
}
});
this.state = this.store.state;
this.api = {
onBeforeClose,

View File

@@ -186,8 +186,8 @@ const getForceMount = computed(() => {
:append-to="getAppendTo"
:class="
cn('flex w-[520px] flex-col', drawerClass, {
'!w-full': isMobile || placement === 'bottom' || placement === 'top',
'max-h-[100vh]': placement === 'bottom' || placement === 'top',
'w-full!': isMobile || placement === 'bottom' || placement === 'top',
'max-h-screen': placement === 'bottom' || placement === 'top',
hidden: isClosed,
})
"
@@ -210,7 +210,7 @@ const getForceMount = computed(() => {
v-if="showHeader"
:class="
cn(
'!flex flex-row items-center justify-between border-b px-6 py-5',
'flex! flex-row items-center justify-between border-b px-6 py-5',
headerClass,
{
'px-4 py-3': closable,
@@ -224,7 +224,7 @@ const getForceMount = computed(() => {
v-if="closable && closeIconPlacement === 'left'"
as-child
:disabled="submitting"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary"
>
<slot name="close-icon">
<VbenIconButton>
@@ -234,7 +234,7 @@ const getForceMount = computed(() => {
</SheetClose>
<Separator
v-if="closable && closeIconPlacement === 'left'"
class="ml-1 mr-2 h-8"
class="mr-2 ml-1 h-8"
decorative
orientation="vertical"
/>
@@ -265,7 +265,7 @@ const getForceMount = computed(() => {
v-if="closable && closeIconPlacement === 'right'"
as-child
:disabled="submitting"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-secondary"
class="ml-[2px] cursor-pointer rounded-full opacity-80 transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary"
>
<slot name="close-icon">
<VbenIconButton>

View File

@@ -12,21 +12,20 @@ vi.mock('@vben-core/shared/store', () => {
return this._state;
}
private _state: ModalState;
private subscribers: Array<(state: ModalState) => void> = [];
private options: any;
constructor(initialState: ModalState, options: any) {
constructor(initialState: ModalState) {
this._state = initialState;
this.options = options;
}
batch(cb: () => void) {
cb();
}
setState(fn: (prev: ModalState) => ModalState) {
this._state = fn(this._state);
this.options.onUpdate();
this.subscribers.forEach((sub) => sub(this._state));
}
subscribe(fn: (state: ModalState) => void) {
this.subscribers.push(fn);
return { unsubscribe: () => {} };
}
},
};

View File

@@ -62,25 +62,19 @@ export class ModalApi {
animationType: 'slide',
};
this.store = new Store<ModalState>(
{
...defaultState,
...storeState,
},
{
onUpdate: () => {
const state = this.store.state;
this.store = new Store<ModalState>({
...defaultState,
...storeState,
});
// 每次更新状态时,都会调用 onOpenChange 回调函数
if (state?.isOpen === this.state?.isOpen) {
this.state = state;
} else {
this.state = state;
this.api.onOpenChange?.(!!state?.isOpen);
}
},
},
);
this.store.subscribe((state) => {
// 每次更新状态时,都会调用 onOpenChange 回调函数
const prevIsOpen = this.state?.isOpen;
this.state = state;
if (state?.isOpen !== prevIsOpen) {
this.api.onOpenChange?.(!!state?.isOpen);
}
});
this.state = this.store.state;

View File

@@ -240,14 +240,13 @@ function handleClosed() {
:append-to="getAppendTo"
:class="
cn(
'left-0 right-0 top-[10vh] mx-auto flex max-h-[80%] w-[520px] flex-col p-0',
shouldFullscreen ? 'sm:rounded-none' : 'sm:rounded-[var(--radius)]',
'inset-x-0 top-[10vh] mx-auto flex max-h-[80%] w-[520px] flex-col p-0',
shouldFullscreen ? 'sm:rounded-none' : 'sm:rounded-(--radius)',
modalClass,
{
'border border-border': bordered,
'shadow-3xl': !bordered,
'left-0 top-0 size-full max-h-full !translate-x-0 !translate-y-0':
shouldFullscreen,
'top-0 left-0 size-full max-h-full translate-0!': shouldFullscreen,
'top-1/2': centered && !shouldFullscreen,
'duration-300': !dragging,
hidden: isClosed,
@@ -320,7 +319,7 @@ function handleClosed() {
<VbenLoading v-if="showLoading || submitting" spinning />
<VbenIconButton
v-if="fullscreenButton"
class="flex-center absolute right-10 top-3 hidden size-6 rounded-full px-1 text-lg text-foreground/80 opacity-70 transition-opacity hover:bg-accent hover:text-accent-foreground hover:opacity-100 focus:outline-none disabled:pointer-events-none sm:block"
class="absolute top-3 right-10 flex-center hidden size-6 rounded-full px-1 text-lg text-foreground/80 opacity-70 transition-opacity hover:bg-accent hover:text-accent-foreground hover:opacity-100 focus:outline-hidden disabled:pointer-events-none sm:block"
@click="handleFullscreen"
>
<Shrink v-if="fullscreen" class="size-3.5" />

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config';

View File

@@ -3,12 +3,11 @@
"style": "new-york",
"typescript": true,
"tailwind": {
"config": "tailwind.config.mjs",
"config": "",
"css": "src/assets/index.css",
"baseColor": "slate",
"cssVariables": true
},
"framework": "vite",
"aliases": {
"components": "@vben-core/shadcn-ui/components",
"utils": "@vben-core/shared/utils"

View File

@@ -41,6 +41,7 @@
},
"dependencies": {
"@vben-core/composables": "workspace:*",
"@vben-core/design": "workspace:*",
"@vben-core/icons": "workspace:*",
"@vben-core/shared": "workspace:*",
"@vben-core/typings": "workspace:*",

View File

@@ -1 +0,0 @@
export { default } from '@vben/tailwind-config/postcss';

View File

@@ -60,7 +60,7 @@ const rootStyle = computed(() => {
<div
:class="props.class"
:style="rootStyle"
class="relative flex flex-shrink-0 items-center"
class="relative flex shrink-0 items-center"
>
<Avatar :class="props.class" class="size-full">
<AvatarImage :alt="alt" :src="src" :style="imageStyle" />
@@ -69,7 +69,7 @@ const rootStyle = computed(() => {
<span
v-if="dot"
:class="dotClass"
class="absolute bottom-0 right-0 size-3 rounded-full border-2 border-background"
class="border-background absolute right-0 bottom-0 size-3 rounded-full border-2"
>
</span>
</div>

View File

@@ -32,7 +32,7 @@ const { handleClick, visible } = useBackTop(props);
<VbenButton
v-if="visible"
:style="backTopStyle"
class="data z-popup fixed bottom-10 size-10 rounded-full bg-background shadow-float duration-500 hover:bg-heavy dark:bg-accent dark:hover:bg-heavy"
class="data z-popup bg-background shadow-float hover:bg-heavy dark:bg-accent dark:hover:bg-heavy fixed bottom-10 size-10 rounded-full duration-500"
size="icon"
variant="icon"
@click="handleClick"

View File

@@ -33,11 +33,11 @@ function handleClick(index: number, path?: string) {
<VbenIcon
v-if="showIcon"
:icon="item.icon"
class="mr-1 size-4 flex-shrink-0"
class="mr-1 size-4 shrink-0"
/>
<span
:class="{
'font-normal text-foreground':
'text-foreground font-normal':
index === breadcrumbs.length - 1,
}"
>{{ item.title }}
@@ -50,12 +50,14 @@ function handleClick(index: number, path?: string) {
</ul>
</template>
<style scoped>
@reference "@vben-core/design/theme";
li {
@apply h-7;
}
li a {
@apply relative mr-9 flex h-7 items-center bg-accent py-0 pl-[5px] pr-2 text-[13px] text-muted-foreground;
@apply bg-accent text-muted-foreground relative mr-9 flex h-7 items-center py-0 pr-2 pl-[5px] text-[13px];
}
li a > span {
@@ -84,7 +86,7 @@ li:last-child a::after {
li a::before,
li a::after {
@apply absolute top-0 h-0 w-0 border-[.875rem] border-solid border-accent content-[''];
@apply border-accent absolute top-0 h-0 w-0 border-[.875rem] border-solid content-[''];
}
li a::before {
@@ -92,7 +94,7 @@ li a::before {
}
li a::after {
@apply left-full border-transparent border-l-accent;
@apply border-l-accent left-full border-transparent;
}
li:not(:last-child) a:hover {

View File

@@ -35,7 +35,7 @@ const isDisabled = computed(() => {
>
<LoaderCircle
v-if="loading"
class="text-md mr-2 size-4 flex-shrink-0 animate-spin"
class="text-md mr-2 size-4 shrink-0 animate-spin"
/>
<slot></slot>
</Primitive>

View File

@@ -35,7 +35,7 @@ function handleItemClick(menu: IDropdownMenuItem) {
<template v-for="menu in menus" :key="menu.value">
<DropdownMenuItem
:disabled="menu.disabled"
class="mb-1 cursor-pointer text-foreground/80 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground"
class="text-foreground/80 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground mb-1 cursor-pointer"
@click="handleItemClick(menu)"
>
<component :is="menu.icon" v-if="menu.icon" class="mr-2 size-4" />

View File

@@ -34,7 +34,7 @@ function handleItemClick(value: string) {
? 'bg-accent text-accent-foreground'
: ''
"
class="mb-1 cursor-pointer text-foreground/80 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground"
class="text-foreground/80 data-[state=checked]:bg-accent data-[state=checked]:text-accent-foreground mb-1 cursor-pointer"
@click="handleItemClick(menu.value)"
>
<component :is="menu.icon" v-if="menu.icon" class="mr-2 size-4" />

View File

@@ -25,7 +25,7 @@ isFullscreen.value = !!(
class="hover:animate-[shrink_0.3s_ease-in-out]"
@click="toggle"
>
<Minimize v-if="isFullscreen" class="size-4 text-foreground" />
<Maximize v-else class="size-4 text-foreground" />
<Minimize v-if="isFullscreen" class="text-foreground size-4" />
<Maximize v-else class="text-foreground size-4" />
</VbenIconButton>
</template>

View File

@@ -38,7 +38,7 @@ const show = ref(false);
/>
<template v-if="passwordStrength">
<PasswordStrength :password="modelValue" />
<p v-if="slots.strengthText" class="mt-1.5 text-xs text-muted-foreground">
<p v-if="slots.strengthText" class="text-muted-foreground mt-1.5 text-xs">
<slot name="strengthText"> </slot>
</p>
</template>
@@ -47,7 +47,7 @@ const show = ref(false);
'top-3': !!passwordStrength,
'top-1/2 -translate-y-1/2 items-center': !passwordStrength,
}"
class="absolute inset-y-0 right-0 flex cursor-pointer pr-3 text-lg leading-5 text-foreground/60 hover:text-foreground"
class="text-foreground/60 hover:text-foreground absolute inset-y-0 right-0 flex cursor-pointer pr-3 text-lg leading-5"
@click="show = !show"
>
<Eye v-if="show" class="size-4" />

View File

@@ -51,7 +51,7 @@ function checkPasswordStrength(password: string) {
<div class="relative mt-2 flex items-center justify-between">
<template v-for="index in 5" :key="index">
<div
class="relative mr-1 h-1.5 w-1/5 rounded-sm bg-heavy last:mr-0 dark:bg-input-background"
class="bg-heavy dark:bg-input-background relative mr-1 h-1.5 w-1/5 rounded-sm last:mr-0"
>
<span
:style="{

View File

@@ -82,7 +82,7 @@ const logoSrc = computed(() => {
/>
<template v-if="!collapsed">
<slot name="text">
<span class="truncate text-nowrap font-semibold text-foreground">
<span class="text-foreground truncate font-semibold text-nowrap">
{{ text }}
</span>
</slot>

View File

@@ -110,7 +110,7 @@ const pinType = 'text' as const;
<VbenButton
:disabled="disabled"
:loading="btnLoading"
class="flex-grow"
class="grow"
size="lg"
variant="outline"
@click="handleSend"

View File

@@ -100,7 +100,7 @@ function handleScroll(event: Event) {
v-if="showShadowTop"
:class="{
'opacity-100': !isAtTop,
'border-t border-border': shadowBorder && !isAtTop,
'border-border border-t': shadowBorder && !isAtTop,
}"
class="scrollbar-top-shadow pointer-events-none absolute top-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"
></div>
@@ -109,7 +109,7 @@ function handleScroll(event: Event) {
v-if="showShadowBottom"
:class="{
'opacity-100': !isAtTop && !isAtBottom,
'border-b border-border': shadowBorder && !isAtTop && !isAtBottom,
'border-border border-b': shadowBorder && !isAtTop && !isAtBottom,
}"
class="scrollbar-bottom-shadow pointer-events-none absolute bottom-0 z-10 h-12 w-full opacity-0 transition-opacity duration-300 ease-in-out will-change-[opacity]"
></div>

View File

@@ -45,14 +45,14 @@ function activeClass(tab: string): string[] {
<Tabs v-model="activeTab" :default-value="getDefaultValue">
<TabsList
:style="tabsStyle"
class="relative grid w-full bg-accent !outline !outline-2 !outline-heavy"
class="bg-accent !outline-heavy relative grid w-full !outline !outline-2"
>
<TabsIndicator :style="tabsIndicatorStyle" />
<template v-for="tab in tabs" :key="tab.value">
<TabsTrigger
:value="tab.value"
:class="activeClass(tab.value)"
class="z-20 inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium hover:text-primary disabled:pointer-events-none disabled:opacity-50"
class="hover:text-primary z-20 inline-flex items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap disabled:pointer-events-none disabled:opacity-50"
>
{{ tab.label }}
</TabsTrigger>

View File

@@ -23,13 +23,13 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-[--reka-tabs-indicator-position] rounded-full px-0 py-1 pr-0.5 transition-[width,transform] duration-300',
'absolute bottom-0 left-0 z-10 h-full w-1/2 translate-x-(--reka-tabs-indicator-position) rounded-full px-0 py-1 pr-0.5 transition-[width,transform] duration-300',
props.class,
)
"
>
<div
class="inline-flex h-full w-full items-center justify-center whitespace-nowrap rounded-md bg-background px-3 py-1 text-sm font-medium text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
class="bg-background text-foreground inline-flex h-full w-full items-center justify-center rounded-md px-3 py-1 text-sm font-medium whitespace-nowrap focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
>
<slot></slot>
</div>

View File

@@ -69,7 +69,7 @@ function onTransitionEnd() {
<div
:class="
cn(
'absolute left-0 top-0 z-100 flex size-full flex-col items-center justify-center bg-overlay-content transition-all duration-500 dark:bg-overlay',
'bg-overlay-content dark:bg-overlay absolute top-0 left-0 z-100 flex size-full flex-col items-center justify-center transition-all duration-500',
{
'invisible opacity-0': !showSpinner,
},
@@ -83,12 +83,12 @@ function onTransitionEnd() {
<i
v-for="index in 4"
:key="index"
class="absolute block size-4 origin-[50%_50%] scale-75 rounded-full bg-primary opacity-30"
class="bg-primary absolute block size-4 origin-[50%_50%] scale-75 rounded-full opacity-30"
></i>
</span>
</slot>
<div v-if="text" class="mt-4 text-xs text-primary">{{ text }}</div>
<div v-if="text" class="text-primary mt-4 text-xs">{{ text }}</div>
<slot></slot>
</div>
</template>

View File

@@ -63,7 +63,7 @@ function onTransitionEnd() {
<div
:class="
cn(
'flex-center absolute left-0 top-0 z-100 size-full bg-overlay-content backdrop-blur-sm transition-all duration-500',
'flex-center bg-overlay-content absolute top-0 left-0 z-100 size-full backdrop-blur-xs transition-all duration-500',
{
'invisible opacity-0': !showSpinner,
},
@@ -75,7 +75,7 @@ function onTransitionEnd() {
<div
:class="{ paused: !renderSpinner }"
v-if="renderSpinner"
class="loader relative size-12 before:absolute before:left-0 before:top-[60px] before:h-[5px] before:w-12 before:rounded-[50%] before:bg-primary/50 before:content-[''] after:absolute after:left-0 after:top-0 after:h-full after:w-full after:rounded after:bg-primary after:content-['']"
class="loader before:bg-primary/50 after:bg-primary relative size-12 before:absolute before:top-[60px] before:left-0 before:h-[5px] before:w-12 before:rounded-[50%] before:content-[''] after:absolute after:top-0 after:left-0 after:h-full after:w-full after:rounded after:content-['']"
></div>
</div>
</template>

View File

@@ -19,7 +19,7 @@ defineProps<{ triggerClass?: string }>();
<CircleHelp
:class="
cn(
'inline-flex size-5 cursor-pointer text-foreground/80 hover:text-foreground',
'text-foreground/80 hover:text-foreground inline-flex size-5 cursor-pointer',
triggerClass,
)
"

View File

@@ -35,7 +35,7 @@ withDefaults(defineProps<Props>(), {
:class="contentClass"
:side="side"
:style="contentStyle"
class="side-content rounded-md bg-accent text-popover-foreground"
class="side-content bg-accent text-popover-foreground rounded-md"
>
<slot></slot>
</TooltipContent>

View File

@@ -19,9 +19,9 @@ const delegatedProps = computed(() => {
<template>
<AccordionContent
v-bind="delegatedProps"
class="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
class="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
>
<div :class="cn('pb-4 pt-0', props.class)">
<div :class="cn('pt-0 pb-4', props.class)">
<slot></slot>
</div>
</AccordionContent>

View File

@@ -31,7 +31,7 @@ const delegatedProps = computed(() => {
<slot></slot>
<slot name="icon">
<ChevronDown
class="h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"
class="text-muted-foreground h-4 w-4 shrink-0 transition-transform duration-200"
/>
</slot>
</AccordionTrigger>

View File

@@ -77,7 +77,7 @@ defineExpose({
v-bind="forwarded"
:class="
cn(
'z-popup bg-background p-6 shadow-lg outline-none sm:rounded-xl',
'z-popup bg-background p-6 shadow-lg outline-hidden sm:rounded-xl',
'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95',
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95',
{

View File

@@ -21,7 +21,7 @@ const forwardedProps = useForwardProps(delegatedProps);
<template>
<AlertDialogDescription
v-bind="forwardedProps"
:class="cn('text-sm text-muted-foreground', props.class)"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</AlertDialogDescription>

View File

@@ -4,5 +4,5 @@ import { useScrollLock } from '@vben-core/composables';
useScrollLock();
</script>
<template>
<div class="z-popup inset-0 bg-overlay"></div>
<div class="z-popup bg-overlay inset-0"></div>
</template>

View File

@@ -22,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps);
<AlertDialogTitle
v-bind="forwardedProps"
:class="
cn('text-lg font-semibold leading-none tracking-tight', props.class)
cn('text-lg leading-none font-semibold tracking-tight', props.class)
"
>
<slot></slot>

View File

@@ -11,9 +11,9 @@ export const badgeVariants = cva(
variants: {
variant: {
default:
'border-transparent bg-accent hover:bg-accent text-primary-foreground shadow',
'border-transparent bg-accent hover:bg-accent text-primary-foreground shadow-sm',
destructive:
'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive-hover',
'border-transparent bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive-hover',
outline: 'text-foreground',
secondary:
'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',

View File

@@ -9,7 +9,7 @@ const props = defineProps<{
<template>
<li
:class="
cn('inline-flex items-center gap-1.5 hover:text-foreground', props.class)
cn('hover:text-foreground inline-flex items-center gap-1.5', props.class)
"
>
<slot></slot>

View File

@@ -14,7 +14,7 @@ const props = withDefaults(defineProps<PrimitiveProps & { class?: any }>(), {
<Primitive
:as="as"
:as-child="asChild"
:class="cn('transition-colors hover:text-foreground', props.class)"
:class="cn('hover:text-foreground transition-colors', props.class)"
>
<slot></slot>
</Primitive>

View File

@@ -10,7 +10,7 @@ const props = defineProps<{
<ol
:class="
cn(
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
props.class,
)
"

View File

@@ -8,7 +8,7 @@ const props = defineProps<{
<template>
<span
:class="cn('font-normal text-foreground', props.class)"
:class="cn('text-foreground font-normal', props.class)"
aria-current="page"
aria-disabled="true"
role="link"

View File

@@ -10,7 +10,7 @@ const props = defineProps<{
<div
:class="
cn(
'rounded-xl border border-border bg-card text-card-foreground',
'border-border bg-card text-card-foreground rounded-xl border',
props.class,
)
"

View File

@@ -7,7 +7,7 @@ const props = defineProps<{
</script>
<template>
<p :class="cn('text-sm text-muted-foreground', props.class)">
<p :class="cn('text-muted-foreground text-sm', props.class)">
<slot></slot>
</p>
</template>

View File

@@ -7,7 +7,7 @@ const props = defineProps<{
</script>
<template>
<h3 :class="cn('font-semibold leading-none tracking-tight', props.class)">
<h3 :class="cn('leading-none font-semibold tracking-tight', props.class)">
<slot></slot>
</h3>
</template>

View File

@@ -27,7 +27,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'peer h-4 w-4 shrink-0 rounded-sm border border-border transition hover:border-primary focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
'peer border-border hover:border-primary focus-visible:ring-ring data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground h-4 w-4 shrink-0 rounded-sm border transition focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"

View File

@@ -32,7 +32,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"

View File

@@ -29,7 +29,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'z-popup min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'z-popup border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"

View File

@@ -26,7 +26,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)

View File

@@ -23,7 +23,7 @@ const delegatedProps = computed(() => {
v-bind="delegatedProps"
:class="
cn(
'px-2 py-1.5 text-sm font-semibold text-foreground',
'text-foreground px-2 py-1.5 text-sm font-semibold',
inset && 'pl-8',
props.class,
)

View File

@@ -32,7 +32,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"

View File

@@ -19,6 +19,6 @@ const delegatedProps = computed(() => {
<template>
<ContextMenuSeparator
v-bind="delegatedProps"
:class="cn('-mx-1 my-1 h-px bg-border', props.class)"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>

View File

@@ -9,7 +9,7 @@ const props = defineProps<{
<template>
<span
:class="
cn('ml-auto text-xs tracking-widest text-muted-foreground', props.class)
cn('text-muted-foreground ml-auto text-xs tracking-widest', props.class)
"
>
<slot></slot>

View File

@@ -28,8 +28,8 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
:class="
cn(
'z-50 min-w-32 overflow-hidden rounded-md',
'border border-border',
'bg-popover p-1 text-popover-foreground shadow-lg',
'border-border border',
'bg-popover text-popover-foreground p-1 shadow-lg',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',

View File

@@ -29,7 +29,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
'focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none',
inset && 'pl-8',
props.class,
)

View File

@@ -102,7 +102,7 @@ defineExpose({
v-bind="forwarded"
:class="
cn(
'z-popup w-full bg-background p-6 shadow-lg outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-xl',
'z-popup bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 w-full p-6 shadow-lg outline-hidden sm:rounded-xl',
{
'data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-top-[48%]':
animationType === 'slide',
@@ -118,7 +118,7 @@ defineExpose({
:disabled="closeDisabled"
:class="
cn(
'flex-center absolute right-3 top-3 h-6 w-6 rounded-full px-1 text-lg text-foreground/80 opacity-70 transition-opacity hover:bg-accent hover:text-accent-foreground hover:opacity-100 focus:outline-none disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',
'flex-center text-foreground/80 hover:bg-accent hover:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-3 right-3 h-6 w-6 rounded-full px-1 text-lg opacity-70 transition-opacity hover:opacity-100 focus:outline-hidden disabled:pointer-events-none',
props.closeClass,
)
"

View File

@@ -21,7 +21,7 @@ const forwardedProps = useForwardProps(delegatedProps);
<template>
<DialogDescription
v-bind="forwardedProps"
:class="cn('text-sm text-muted-foreground', props.class)"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</DialogDescription>

View File

@@ -7,7 +7,7 @@ const props = defineProps<{ class?: any }>();
<template>
<div
:class="
cn('flex flex-row flex-col-reverse justify-end gap-x-2', props.class)
cn('flex flex-col-reverse flex-row justify-end gap-x-2', props.class)
"
>
<slot></slot>

View File

@@ -7,5 +7,5 @@ useScrollLock();
const id = inject('DISMISSABLE_MODAL_ID');
</script>
<template>
<div :data-dismissable-modal="id" class="z-popup inset-0 bg-overlay"></div>
<div :data-dismissable-modal="id" class="z-popup bg-overlay inset-0"></div>
</template>

View File

@@ -33,12 +33,12 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
<DialogPortal>
<DialogOverlay
:style="{ zIndex }"
class="absolute inset-0 grid place-items-center overflow-y-auto border border-border bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"
class="border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 absolute inset-0 grid place-items-center overflow-y-auto border bg-black/80"
>
<DialogContent
:class="
cn(
'relative z-50 my-8 grid w-full max-w-lg gap-4 border border-border bg-background p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
'border-border bg-background relative z-50 my-8 grid w-full max-w-lg gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full',
props.class,
)
"
@@ -60,7 +60,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
<slot></slot>
<DialogClose
class="absolute right-4 top-4 rounded-md p-0.5 transition-colors hover:bg-secondary"
class="hover:bg-secondary absolute top-4 right-4 rounded-md p-0.5 transition-colors"
>
<X class="h-4 w-4" />
<span class="sr-only">Close</span>

View File

@@ -22,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps);
<DialogTitle
v-bind="forwardedProps"
:class="
cn('text-lg font-semibold leading-none tracking-tight', props.class)
cn('text-lg leading-none font-semibold tracking-tight', props.class)
"
>
<slot></slot>

View File

@@ -32,7 +32,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"

View File

@@ -37,7 +37,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'z-popup min-w-32 overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'z-popup border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 min-w-32 overflow-hidden rounded-md border p-1 shadow-md',
props.class,
)
"

View File

@@ -25,7 +25,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
inset && 'pl-8',
props.class,
)

View File

@@ -33,7 +33,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="forwarded"
:class="
cn(
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"

View File

@@ -23,6 +23,6 @@ const delegatedProps = computed(() => {
<template>
<DropdownMenuSeparator
v-bind="delegatedProps"
:class="cn('-mx-1 my-1 h-px bg-border', props.class)"
:class="cn('bg-border -mx-1 my-1 h-px', props.class)"
/>
</template>

View File

@@ -28,8 +28,8 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
:class="
cn(
'z-50 min-w-32 overflow-hidden rounded-md',
'border border-border',
'bg-popover p-1 text-popover-foreground shadow-lg',
'border-border border',
'bg-popover text-popover-foreground p-1 shadow-lg',
'data-[state=open]:animate-in data-[state=closed]:animate-out',
'data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
'data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95',

View File

@@ -24,7 +24,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none',
props.class,
)
"

View File

@@ -9,7 +9,7 @@ const forwardedProps = useForwardProps(props);
</script>
<template>
<DropdownMenuTrigger class="outline-none" v-bind="forwardedProps">
<DropdownMenuTrigger class="outline-hidden" v-bind="forwardedProps">
<slot></slot>
</DropdownMenuTrigger>
</template>

View File

@@ -13,7 +13,7 @@ const { formDescriptionId } = useFormField();
<template>
<p
:id="formDescriptionId"
:class="cn('text-sm text-muted-foreground', props.class)"
:class="cn('text-muted-foreground text-sm', props.class)"
>
<slot></slot>
</p>

View File

@@ -13,6 +13,6 @@ const { formMessageId, name } = useFormField();
:id="formMessageId"
:name="toValue(name)"
as="p"
class="text-[0.8rem] text-destructive"
class="text-destructive text-[0.8rem]"
/>
</template>

View File

@@ -29,7 +29,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'z-popup w-64 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'z-popup border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-64 rounded-md border p-4 shadow-md outline-hidden',
props.class,
)
"

View File

@@ -24,7 +24,7 @@ const modelValue = useVModel(props, 'modelValue', emits, {
v-model="modelValue"
:class="
cn(
'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
'border-input bg-background ring-offset-background placeholder:text-muted-foreground/50 focus-visible:ring-ring flex h-10 w-full rounded-md border px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"

View File

@@ -21,7 +21,7 @@ const delegatedProps = computed(() => {
v-bind="delegatedProps"
:class="
cn(
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
'text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70',
props.class,
)
"

View File

@@ -25,7 +25,7 @@ const forwarded = useForwardProps(delegatedProps);
v-bind="forwarded"
:class="
cn(
'absolute left-0 top-1/2 -translate-y-1/2 p-3 disabled:cursor-not-allowed disabled:opacity-20',
'absolute top-1/2 left-0 -translate-y-1/2 p-3 disabled:cursor-not-allowed disabled:opacity-20',
props.class,
)
"

View File

@@ -25,7 +25,7 @@ const forwarded = useForwardProps(delegatedProps);
v-bind="forwarded"
:class="
cn(
'absolute right-0 top-1/2 -translate-y-1/2 p-3 disabled:cursor-not-allowed disabled:opacity-20',
'absolute top-1/2 right-0 -translate-y-1/2 p-3 disabled:cursor-not-allowed disabled:opacity-20',
props.class,
)
"

View File

@@ -8,7 +8,7 @@ import { NumberFieldInput } from 'reka-ui';
<NumberFieldInput
:class="
cn(
'flex h-9 w-full rounded-md border border-input bg-transparent py-1 text-center text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
'border-input placeholder:text-muted-foreground focus-visible:ring-ring flex h-9 w-full rounded-md border bg-transparent py-1 text-center text-sm shadow-xs transition-colors focus-visible:ring-1 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',
)
"
data-slot="input"

View File

@@ -22,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'relative flex h-10 w-8 items-center justify-center border-y border-r border-input bg-background text-center text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md focus:relative focus:z-10 focus:outline-none focus:ring-2 md:w-10',
'border-input bg-background relative flex h-10 w-8 items-center justify-center border-y border-r text-center text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md focus:relative focus:z-10 focus:ring-2 focus:outline-hidden md:w-10',
props.class,
)
"

View File

@@ -35,7 +35,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
v-bind="{ ...forwarded, ...$attrs }"
:class="
cn(
'w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 w-72 rounded-md border p-4 shadow-md outline-hidden',
props.class,
)
"

View File

@@ -24,7 +24,7 @@ const forwardedProps = useForwardProps(delegatedProps);
v-bind="forwardedProps"
:class="
cn(
'aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50',
'border-primary text-primary focus-visible:ring-ring aspect-square h-4 w-4 rounded-full border shadow-sm focus:outline-hidden focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50',
props.class,
)
"

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