@lanrenbang/basecoat-ultra 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG-cn.md +54 -0
  2. package/CHANGELOG.md +54 -0
  3. package/LICENSE +21 -0
  4. package/README-cn.md +186 -0
  5. package/README.md +173 -0
  6. package/dist/css/basecoat.cdn.css +7389 -0
  7. package/dist/css/basecoat.cdn.min.css +2 -0
  8. package/dist/css/basecoat.css +1797 -0
  9. package/dist/css/datepicker.css +382 -0
  10. package/dist/css/datepicker.min.css +1 -0
  11. package/dist/css/resizable.css +96 -0
  12. package/dist/css/resizable.min.css +1 -0
  13. package/dist/js/accordion.js +20 -0
  14. package/dist/js/accordion.min.js +13 -0
  15. package/dist/js/all.js +17 -0
  16. package/dist/js/all.min.js +17 -0
  17. package/dist/js/basecoat.js +75 -0
  18. package/dist/js/basecoat.min.js +56 -0
  19. package/dist/js/carousel.js +104 -0
  20. package/dist/js/carousel.min.js +41 -0
  21. package/dist/js/catppuccin-theme-switcher.js +136 -0
  22. package/dist/js/catppuccin-theme-switcher.min.js +73 -0
  23. package/dist/js/command.js +132 -0
  24. package/dist/js/command.min.js +76 -0
  25. package/dist/js/datepicker.js +2367 -0
  26. package/dist/js/datepicker.min.js +1422 -0
  27. package/dist/js/dialog.js +20 -0
  28. package/dist/js/dialog.min.js +11 -0
  29. package/dist/js/dropdown-menu.js +148 -0
  30. package/dist/js/dropdown-menu.min.js +75 -0
  31. package/dist/js/input-otp.js +94 -0
  32. package/dist/js/input-otp.min.js +38 -0
  33. package/dist/js/lighting.js +80 -0
  34. package/dist/js/lighting.min.js +44 -0
  35. package/dist/js/popover.js +72 -0
  36. package/dist/js/popover.min.js +34 -0
  37. package/dist/js/resizable.js +534 -0
  38. package/dist/js/resizable.min.js +284 -0
  39. package/dist/js/select.js +246 -0
  40. package/dist/js/select.min.js +131 -0
  41. package/dist/js/sheet.js +85 -0
  42. package/dist/js/sheet.min.js +40 -0
  43. package/dist/js/sidebar.js +87 -0
  44. package/dist/js/sidebar.min.js +53 -0
  45. package/dist/js/slider.js +18 -0
  46. package/dist/js/slider.min.js +10 -0
  47. package/dist/js/tabs.js +53 -0
  48. package/dist/js/tabs.min.js +40 -0
  49. package/dist/js/toast.js +137 -0
  50. package/dist/js/toast.min.js +83 -0
  51. package/dist/js/toggle.js +36 -0
  52. package/dist/js/toggle.min.js +20 -0
  53. package/dist/theme/catppuccin/index.css +448 -0
  54. package/dist/theme/catppuccin/index.min.css +1 -0
  55. package/package.json +46 -0
@@ -0,0 +1,54 @@
1
+ # Basecoat Ultra 更新日志 (Changelog)
2
+
3
+ [English](./CHANGELOG.md) | **中文**
4
+
5
+ 本文档记录了 `basecoat-ultra` 相对于上游 Basecoat 的所有主要变更。
6
+
7
+ ## 🚀 核心架构与构建 (Architecture & Build)
8
+
9
+ * **模块化重构**: 将原版单体 `basecoat.css` 拆分为 `src/css/parts/` 下的独立模块,便于维护和按需引用。
10
+ * **Tailwind v4 适配**: 修复了在 CSS 中使用复杂 `@apply` 选择器(如 `[&_svg:not(...)]`)时的转义与语法错误,改用原生 CSS 嵌套写法。
11
+ * **依赖精简**: 移除了 Nunjucks/Jinja 模板支持,专注于 HTML/JS 组件实现。
12
+
13
+ ## ✨ 组件改进 (Component Improvements)
14
+
15
+ ### 核心组件修复
16
+ * **Button**:
17
+ * 修复 Ghost/Link 变体在某些上下文中的背景残留问题。
18
+ * 增强 Outline 变体的文字对比度。
19
+ * **Dialog**:
20
+ * 重构动画曲线,引入 `cubic-bezier` 回弹效果。
21
+ * 优化居中定位逻辑。
22
+ * **Dropdown Menu**:
23
+ * 修复初始化时的可见性闪烁问题(确保初始 `aria-hidden="true"`)。
24
+ * 支持更灵活的 DOM 结构(直接在 popover 内容上定义 `role="menu"`)。
25
+ * **Sidebar**:
26
+ * 优化 `aria-current` 自动高亮逻辑,自动忽略 `href="#"` 空链接。
27
+ * **Form Elements**:
28
+ * 修复 Checkbox/Radio/Switch/Sidebar 中 `content` 属性转义符丢失导致的构建错误。
29
+ * 调整 Select 和 Checkbox 图标颜色 (`oklch`) 以提升对比度。
30
+ * Range 滑块增加 hover 阴影与手型光标。
31
+
32
+ ### 新增自定义组件 (New Components)
33
+ * **Accordion**: 上游仅做文档演示,本项目已将其标准化封装为正式组件。基于 `<details>`/`<summary>` 的纯 CSS 动画手风琴。
34
+ * **Sheet**: 侧边抽屉组件,支持从屏幕边缘滑出。
35
+ * **Carousel**: 基础轮播图组件。
36
+ * **Input OTP**: 验证码/一次性密码输入组件。
37
+ * **Toggle / Toggle Group**: 独立的开关与开关组组件。
38
+
39
+ ### 外部集成 (External Integrations)
40
+ * **Date Picker**: 集成 `flatpickr`,并提供深度定制的主题样式。
41
+ * **Resizable**: 集成 `split.js`,提供可拖拽布局支持。
42
+
43
+ ## 🎨 视觉与主题 (Visuals & Theming)
44
+
45
+ * **Catppuccin 主题**:
46
+ * 完整集成 Latte, Frappé, Macchiato, Mocha 四款主题。
47
+ * 提供配套的 `Theme Switcher` 逻辑 (`src/js/catppuccin-theme-switcher.js`)。
48
+ * **Neumorphism 扩展**:
49
+ * 新增 `lighting.js`: 实现基于鼠标位置的全局拟态光照效果(灵感来源于 `puikinsh/login-forms`)。
50
+ * 支持 CSS 3D Transform 翻转效果。
51
+
52
+ ---
53
+
54
+ *注意:以上变更基于与 Basecoat 原版 (`references/basecoat`) 的对比。*
package/CHANGELOG.md ADDED
@@ -0,0 +1,54 @@
1
+ # Basecoat Ultra Changelog
2
+
3
+ **English** | [中文](./CHANGELOG-cn.md)
4
+
5
+ This document records all major changes in `basecoat-ultra` relative to the upstream Basecoat.
6
+
7
+ ## 🚀 Architecture & Build
8
+
9
+ * **Modular Refactoring**: Split the monolithic `basecoat.css` into independent modules under `src/css/parts/` for easier maintenance and on-demand usage.
10
+ * **Tailwind v4 Adaptation**: Fixed escaping and syntax errors when using complex `@apply` selectors (e.g., `[&_svg:not(...)]`) in CSS, replacing them with native CSS nesting syntax.
11
+ * **Dependency Slimming**: Removed Nunjucks/Jinja template support to focus on HTML/JS component implementation.
12
+
13
+ ## ✨ Component Improvements
14
+
15
+ ### Core Fixes
16
+ * **Button**:
17
+ * Fixed background residue issues for Ghost/Link variants in specific contexts.
18
+ * Enhanced text contrast for Outline variants.
19
+ * **Dialog**:
20
+ * Refactored animation curves, introducing `cubic-bezier` bounce effects.
21
+ * Optimized centering logic.
22
+ * **Dropdown Menu**:
23
+ * Fixed visibility flicker on initialization (ensured initial `aria-hidden="true"`).
24
+ * Supported more flexible DOM structures (defining `role="menu"` directly on popover content).
25
+ * **Sidebar**:
26
+ * Optimized `aria-current` auto-highlighting logic to ignore `href="#"` empty links.
27
+ * **Form Elements**:
28
+ * Fixed build errors caused by missing escape characters in `content` properties for Checkbox/Radio/Switch/Sidebar.
29
+ * Adjusted Select and Checkbox icon colors (`oklch`) to improve contrast.
30
+ * Added hover shadows and pointer cursor to Range sliders.
31
+
32
+ ### New Custom Components
33
+ * **Accordion**: Standardized and internalized (upstream only had it as a demo). Pure CSS animation based on `<details>`/`<summary>`.
34
+ * **Sheet**: Side drawer component supporting slide-in from screen edges.
35
+ * **Carousel**: Basic carousel component.
36
+ * **Input OTP**: Verification code/One-Time Password input component.
37
+ * **Toggle / Toggle Group**: Independent toggle and toggle group components.
38
+
39
+ ### External Integrations
40
+ * **Date Picker**: Integrated `flatpickr` with deeply customized theme styles.
41
+ * **Resizable**: Integrated `split.js` providing draggable layout support.
42
+
43
+ ## 🎨 Visuals & Theming
44
+
45
+ * **Catppuccin Themes**:
46
+ * Fully integrated Latte, Frappé, Macchiato, and Mocha themes.
47
+ * Provided matching `Theme Switcher` logic (`src/js/catppuccin-theme-switcher.js`).
48
+ * **Neumorphism Extension**:
49
+ * Added `lighting.js`: Implements global neumorphic lighting effects based on mouse position (Inspired by `puikinsh/login-forms`).
50
+ * Supported CSS 3D Transform flip effects.
51
+
52
+ ---
53
+
54
+ *Note: The above changes are based on comparison with the original Basecoat (`references/basecoat`).*
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 L.R.B
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README-cn.md ADDED
@@ -0,0 +1,186 @@
1
+ # Basecoat Ultra
2
+
3
+ [English](./README.md) | **中文**
4
+
5
+ Basecoat is a set of components built with Tailwind CSS. It is designed to be used with any traditional web stack.
6
+ Basecoat brings the magic of shadcn/ui to any traditional web stack: no React required.
7
+
8
+ **Basecoat Ultra** 是基于 [Basecoat](https://basecoatui.com) 开发的增强版 UI 库。它保留了原版“Tailwind 优先、框架无关”的核心理念,并在此基础上根据现代审美与轻量化需求进行了深度定制。我们移除了对 Nunjucks/Jinja 的原生支持,转而专注于提供更丰富的交互组件、开箱即用的主题系统以及细腻的视觉增强。
9
+
10
+ ## ✨ 特性 (Features)
11
+
12
+ ### 🛠️ 核心增强与修复 (Core Improvements)
13
+ 我们对 Basecoat 原版核心进行了大量细节打磨与 bug 修复(详见 CHANGELOG),包括但不限于:
14
+ - **CSS 模块化**: 将单体 CSS 重构为模块化结构,支持按需加载。
15
+ - **构建修复**: 修复了 Tailwind v4 下复杂选择器的转义问题。
16
+ - **组件优化**:
17
+ - `Button`: 修复 Ghost/Link 变体在特定背景下的显示问题。
18
+ - `Dialog`: 引入更自然的缩放与回弹动画。
19
+ - `Dropdown Menu`: 修复初始化时的闪烁问题。
20
+ - `Sidebar`: 智能识别当前页高亮逻辑。
21
+
22
+ ### 🧩 新增组件 (New Components)
23
+ 引入了一系列对标 shadcn/ui 的高频组件,且完全不依赖 React/Vue:
24
+ - **Accordion (手风琴)**: 上游仅在文档中作为演示存在,本项目将其逻辑标准化并内置,基于原生 `<details>` 实现,零 JS 依赖动画。
25
+ - **Sheet (侧边抽屉)**: 优雅的侧边滑出面板。
26
+ - **Carousel (轮播图)**: 轻量级轮播组件。
27
+ - **Input OTP (验证码输入)**: 专用的验证码输入框。
28
+ - **Toggle Group (开关组)**: 类似于 Radio Group 的按钮式交互。
29
+ - **Toggle (开关)**: 独立的开关按钮样式。
30
+
31
+ ### 🔌 外部集成 (External Integrations)
32
+ 集成了优秀的第三方库以弥补纯 CSS/Vanilla JS 的短板(需单独引入):
33
+ - **Date Picker**: 基于 [Flatpickr](https://flatpickr.js.org/) 的深度定制,完美适配主题。
34
+ - **Resizable**: 基于 [Split.js](https://split.js.org/) 的可拖拽分割面板。
35
+
36
+ ### 🎨 视觉增强 (Visual Enhancements)
37
+ - **Catppuccin 主题**: 内置 [Catppuccin](https://github.com/catppuccin/catppuccin) 全系列(Latte, Frappé, Macchiato, Mocha)主题支持。
38
+ - **Neumorphism Extension**:
39
+ - **全局光照系统**: 独特的鼠标跟随光影效果 (`lighting.js`),为 `.neu-panel`, `.neu-btn` 等元素赋予拟态光感。
40
+ - **3D 翻转**: 支持基于 CSS 3D Transform 的卡片翻转效果。
41
+
42
+ ## 📦 安装 (Installation)
43
+
44
+ 本项目已发布到 [JSR (JavaScript Registry)](https://jsr.io/)。
45
+
46
+ ### 1. 安装依赖
47
+
48
+ ```bash
49
+ # 使用 npm
50
+ npx jsr add @lanrenbang/basecoat-ultra
51
+
52
+ # 使用 bun
53
+ bunx jsr add @lanrenbang/basecoat-ultra
54
+
55
+ # 使用 deno
56
+ deno add @lanrenbang/basecoat-ultra
57
+ ```
58
+
59
+ ### 2. 引入样式
60
+
61
+ 在你的 CSS 文件中(需配置 Tailwind CSS v4):
62
+
63
+ ```css
64
+ @import "tailwindcss";
65
+ /* 引入核心样式 */
66
+ @import "@lanrenbang/basecoat-ultra/css/basecoat.css";
67
+ /* 或者使用 CDN 版本(包含 Tailwind 工具类) */
68
+ /* @import "@lanrenbang/basecoat-ultra/css/basecoat.cdn.css"; */
69
+
70
+ /* 引入 Catppuccin 主题(可选) */
71
+ @import "@lanrenbang/basecoat-ultra/dist/theme/catppuccin/index.css";
72
+ ```
73
+
74
+ ### 3. 引入交互逻辑
75
+
76
+ 你可以全量引入,也可以按需引入:
77
+
78
+ ```javascript
79
+ // 全量引入 (包含所有组件逻辑)
80
+ import '@lanrenbang/basecoat-ultra';
81
+
82
+ // 或者按需引入
83
+ import '@lanrenbang/basecoat-ultra/basecoat'; // 核心
84
+ import '@lanrenbang/basecoat-ultra/tabs';
85
+ import '@lanrenbang/basecoat-ultra/sheet';
86
+ // ...
87
+ ```
88
+
89
+ 对于外部组件(Datepicker, Resizable),需要单独引入:
90
+
91
+ ```javascript
92
+ // Datepicker
93
+ import 'flatpickr/dist/flatpickr.css';
94
+ import '@lanrenbang/basecoat-ultra/css/datepicker.css';
95
+ import '@lanrenbang/basecoat-ultra/datepicker';
96
+
97
+ // Resizable
98
+ import '@lanrenbang/basecoat-ultra/css/resizable.css';
99
+ import '@lanrenbang/basecoat-ultra/resizable';
100
+ ```
101
+
102
+ 对于外部组件(Datepicker, Resizable),需要单独引入:
103
+
104
+ ```javascript
105
+ // Datepicker
106
+ import 'flatpickr/dist/flatpickr.css';
107
+ import '@basecoat/ultra/datepicker-css';
108
+ import '@basecoat/ultra/datepicker';
109
+
110
+ // Resizable
111
+ import '@basecoat/ultra/resizable-css';
112
+ import '@basecoat/ultra/resizable';
113
+ ```
114
+
115
+ ## 🛠️ 开发与贡献 (Development)
116
+
117
+ 本项目使用 [Bun](https://bun.sh) 作为包管理器和运行时,使用 [Vite](https://vitejs.dev) 进行构建。
118
+
119
+ ### 环境搭建
120
+
121
+ ```bash
122
+ # 1. 克隆项目
123
+ git clone https://github.com/your-username/basecoat-ultra.git
124
+ cd basecoat-ultra
125
+
126
+ # 2. 安装依赖
127
+ bun install
128
+
129
+ # 3. 启动开发服务器
130
+ bun run dev
131
+ ```
132
+
133
+ ### 主题防闪烁 (Anti-flash Script)
134
+
135
+ 为了在使用 Catppuccin 主题切换器时防止页面刷新出现闪烁(FOUC),请将以下脚本放在 HTML 的 `<head>` 标签顶部:
136
+
137
+ ```html
138
+ <script>
139
+ (function() {
140
+ try {
141
+ const t = localStorage.getItem('catppuccin-theme');
142
+ const a = localStorage.getItem('catppuccin-accent');
143
+ const m = localStorage.getItem('basecoat-mode');
144
+ const r = document.documentElement;
145
+ // 优先加载主题配置
146
+ if (t && a) {
147
+ r.classList.add(`theme-${t}`, `accent-${a}`);
148
+ if(['frappe','macchiato','mocha'].includes(t)) r.classList.add('dark');
149
+ } else if (m) {
150
+ // 只有明暗模式偏好
151
+ r.classList.toggle('dark', m === 'dark');
152
+ } else {
153
+ // 跟随系统
154
+ r.classList.toggle('dark', window.matchMedia('(prefers-color-scheme: dark)').matches);
155
+ }
156
+ } catch(e) {}
157
+ })();
158
+ </script>
159
+ ```
160
+
161
+ ### 发布到 JSR
162
+
163
+ 如果你是维护者,按照以下步骤发布新版本:
164
+
165
+ 1. 登录 JSR (仅需一次):
166
+ ```bash
167
+ bunx jsr login
168
+ ```
169
+ 2. 发布:
170
+ ```bash
171
+ bunx jsr publish
172
+ ```
173
+
174
+ ## ❤️ 鸣谢 (Credits)
175
+
176
+ 本项目站在巨人的肩膀上:
177
+
178
+ * **[Basecoat](https://basecoatui.com)**: 原创者 [hunvreus](https://github.com/hunvreus)。本项目的大部分基础代码归原作者所有。
179
+ * **[Catppuccin](https://github.com/catppuccin/palette)**: 提供了美妙的配色方案。
180
+ * **[puikinsh/login-forms](https://github.com/puikinsh/login-forms/tree/main/forms/neumorphism)**: Neumorphism 光照与 3D 效果的灵感来源。
181
+ * **[Flatpickr](https://flatpickr.js.org/)** & **[Split.js](https://split.js.org/)**: 优秀的第三方库支持。
182
+
183
+ ## 📄 许可 (License)
184
+
185
+ 本项目遵循 [MIT License](LICENSE.md)。
186
+ Basecoat 原始内容版权归属于 hunvreus。
package/README.md ADDED
@@ -0,0 +1,173 @@
1
+ # Basecoat Ultra
2
+
3
+ **English** | [中文](./README-cn.md)
4
+
5
+ Basecoat is a set of components built with Tailwind CSS. It is designed to be used with any traditional web stack.
6
+ Basecoat brings the magic of shadcn/ui to any traditional web stack: no React required.
7
+
8
+ **Basecoat Ultra** is an enhanced UI library based on [Basecoat](https://basecoatui.com). It retains the core philosophy of "Tailwind-first, framework-agnostic" while offering deep customizations tailored for modern aesthetics and lightweight requirements. We have removed native support for Nunjucks/Jinja to focus on providing richer interactive components, an out-of-the-box theming system, and refined visual enhancements.
9
+
10
+ ## ✨ Features
11
+
12
+ ### 🛠️ Core Improvements
13
+ We have polished the Basecoat core with numerous details and bug fixes (see CHANGELOG), including but not limited to:
14
+ - **CSS Modularization**: Refactored monolithic CSS into a modular structure supporting on-demand loading.
15
+ - **Build Fixes**: Resolved escaping issues with complex selectors in Tailwind v4.
16
+ - **Component Optimizations**:
17
+ - `Button`: Fixed Ghost/Link variant background issues in specific contexts.
18
+ - `Dialog`: Introduced more natural scaling and bounce animations.
19
+ - `Dropdown Menu`: Fixed flickering issues during initialization.
20
+ - `Sidebar`: Intelligent logic for identifying and highlighting the current page.
21
+
22
+ ### 🧩 New Components
23
+ Introduced a series of high-frequency components inspired by shadcn/ui, completely independent of React/Vue:
24
+ - **Accordion**: Originally only a demo in upstream docs; standardized and internalized here. Based on native `<details>`, zero-JS animation.
25
+ - **Sheet**: Elegant side-sliding panel.
26
+ - **Carousel**: Lightweight carousel component.
27
+ - **Input OTP**: Dedicated one-time password input.
28
+ - **Toggle Group**: Button-style interaction similar to Radio Group.
29
+ - **Toggle**: Independent toggle button style.
30
+
31
+ ### 🔌 External Integrations
32
+ Integrated excellent third-party libraries to bridge gaps in pure CSS/Vanilla JS (must be imported separately):
33
+ - **Date Picker**: Deeply customized version based on [Flatpickr](https://flatpickr.js.org/), perfectly adapted to themes.
34
+ - **Resizable**: Draggable split panel based on [Split.js](https://split.js.org/).
35
+
36
+ ### 🎨 Visual Enhancements
37
+ - **Catppuccin Themes**: Built-in support for the full [Catppuccin](https://github.com/catppuccin/catppuccin) suite (Latte, Frappé, Macchiato, Mocha).
38
+ - **Neumorphism Extension**:
39
+ - **Global Lighting System**: Unique mouse-following lighting effects (`lighting.js`), giving neumorphic feel to `.neu-panel`, `.neu-btn` elements.
40
+ - **3D Flip**: Supports CSS 3D Transform-based card flip effects.
41
+
42
+ ## 📦 Installation
43
+
44
+ This project is published to the [JSR (JavaScript Registry)](https://jsr.io/).
45
+
46
+ ### 1. Install Dependencies
47
+
48
+ ```bash
49
+ # Using npm
50
+ npx jsr add @lanrenbang/basecoat-ultra
51
+
52
+ # Using bun
53
+ bunx jsr add @lanrenbang/basecoat-ultra
54
+
55
+ # Using deno
56
+ deno add @lanrenbang/basecoat-ultra
57
+ ```
58
+
59
+ ### 2. Import Styles
60
+
61
+ In your CSS file (Tailwind CSS v4 configuration required):
62
+
63
+ ```css
64
+ @import "tailwindcss";
65
+ /* Import core styles */
66
+ @import "@lanrenbang/basecoat-ultra/css/basecoat.css";
67
+ /* Or use the CDN version (includes Tailwind utilities) */
68
+ /* @import "@lanrenbang/basecoat-ultra/css/basecoat.cdn.css"; */
69
+
70
+ /* Import Catppuccin Theme (Optional) */
71
+ @import "@lanrenbang/basecoat-ultra/dist/theme/catppuccin/index.css";
72
+ ```
73
+
74
+ ### 3. Import Logic
75
+
76
+ You can import everything or use on-demand imports:
77
+
78
+ ```javascript
79
+ // Import all component logic
80
+ import '@lanrenbang/basecoat-ultra';
81
+
82
+ // Or on-demand import
83
+ import '@lanrenbang/basecoat-ultra/basecoat'; // Core
84
+ import '@lanrenbang/basecoat-ultra/tabs';
85
+ import '@lanrenbang/basecoat-ultra/sheet';
86
+ // ...
87
+ ```
88
+
89
+ For external components (Datepicker, Resizable), import them separately:
90
+
91
+ ```javascript
92
+ // Datepicker
93
+ import 'flatpickr/dist/flatpickr.css';
94
+ import '@lanrenbang/basecoat-ultra/css/datepicker.css';
95
+ import '@lanrenbang/basecoat-ultra/datepicker';
96
+
97
+ // Resizable
98
+ import '@lanrenbang/basecoat-ultra/css/resizable.css';
99
+ import '@lanrenbang/basecoat-ultra/resizable';
100
+ ```
101
+
102
+ ## 🛠️ Development
103
+
104
+ This project uses [Bun](https://bun.sh) as the package manager and runtime, and [Vite](https://vitejs.dev) for building.
105
+
106
+ ### Setup
107
+
108
+ ```bash
109
+ # 1. Clone project
110
+ git clone https://github.com/your-username/basecoat-ultra.git
111
+ cd basecoat-ultra
112
+
113
+ # 2. Install dependencies
114
+ bun install
115
+
116
+ # 3. Start dev server
117
+ bun run dev
118
+ ```
119
+
120
+ ### Anti-flash Script
121
+
122
+ To prevent page flicker (FOUC) when using the Catppuccin Theme Switcher on refresh, place the following script at the top of your HTML `<head>` tag:
123
+
124
+ ```html
125
+ <script>
126
+ (function() {
127
+ try {
128
+ const t = localStorage.getItem('catppuccin-theme');
129
+ const a = localStorage.getItem('catppuccin-accent');
130
+ const m = localStorage.getItem('basecoat-mode');
131
+ const r = document.documentElement;
132
+ // Prioritize theme config
133
+ if (t && a) {
134
+ r.classList.add(`theme-${t}`, `accent-${a}`);
135
+ if(['frappe','macchiato','mocha'].includes(t)) r.classList.add('dark');
136
+ } else if (m) {
137
+ // Only dark/light mode preference
138
+ r.classList.toggle('dark', m === 'dark');
139
+ } else {
140
+ // Follow system
141
+ r.classList.toggle('dark', window.matchMedia('(prefers-color-scheme: dark)').matches);
142
+ }
143
+ } catch(e) {}
144
+ })();
145
+ </script>
146
+ ```
147
+
148
+ ### Publishing to JSR
149
+
150
+ If you are a maintainer, follow these steps to publish a new version:
151
+
152
+ 1. Login to JSR (Once):
153
+ ```bash
154
+ bunx jsr login
155
+ ```
156
+ 2. Publish:
157
+ ```bash
158
+ bunx jsr publish
159
+ ```
160
+
161
+ ## ❤️ Credits
162
+
163
+ This project stands on the shoulders of giants:
164
+
165
+ * **[Basecoat](https://basecoatui.com)**: Original creator [hunvreus](https://github.com/hunvreus). Most foundational code belongs to the original author.
166
+ * **[Catppuccin](https://github.com/catppuccin/palette)**: Provided the beautiful color palettes.
167
+ * **[puikinsh/login-forms](https://github.com/puikinsh/login-forms/tree/main/forms/neumorphism)**: Inspiration for Neumorphism lighting and 3D effects.
168
+ * **[Flatpickr](https://flatpickr.js.org/)** & **[Split.js](https://split.js.org/)**: Excellent third-party library support.
169
+
170
+ ## 📄 License
171
+
172
+ This project is licensed under the [MIT License](LICENSE.md).
173
+ Original Basecoat content copyright belongs to hunvreus.