@lanrenbang/basecoat-ultra 0.1.7 → 0.2.0

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.
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2025 L.R.B
3
+ Copyright (c) 2025 Ronan Berder
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,203 +1,133 @@
1
1
  # Basecoat Ultra
2
2
 
3
- **English** | [中文](./README-cn.md)
3
+ [![Version](https://img.shields.io/npm/v/@lanrenbang/basecoat-ultra?style=flat-square)](https://www.npmjs.com/package/@lanrenbang/basecoat-ultra)
4
+ [![License](https://img.shields.io/github/license/hunvreus/basecoat?style=flat-square)](https://github.com/hunvreus/basecoat/blob/main/LICENSE.md)
4
5
 
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.
6
+ **Basecoat Ultra** is a Tailwind-first UI component library designed for high performance, minimalism, and deep customization. Built upon the excellent foundation of [Basecoat](https://basecoatui.com) by [hunvreus](https://github.com/hunvreus), it brings the magic of shadcn/ui to any traditional web stack without requiring React.
7
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
- ## 🎡 Components Preview
11
- [lanrenbang.github.io/basecoat-ultra](https://lanrenbang.github.io/basecoat-ultra)
8
+ 🎡 **[Live Demo & Documentation](https://lanrenbang.github.io/basecoat-ultra)**
12
9
 
13
10
  ## ✨ Features
14
11
 
15
- ### 🛠️ Core Improvements
16
- We have polished the Basecoat core with numerous details and bug fixes (see CHANGELOG), including but not limited to:
17
- - **CSS Modularization**: Refactored monolithic CSS into a modular structure supporting on-demand loading.
18
- - **Build Fixes**: Resolved escaping issues with complex selectors in Tailwind v4.
19
- - **Component Optimizations**:
20
- - `Button`: Fixed Ghost/Link variant background issues in specific contexts.
21
- - `Dialog`: Introduced more natural scaling and bounce animations.
22
- - `Dropdown Menu`: Fixed flickering issues during initialization.
23
- - `Sidebar`: Intelligent logic for identifying and highlighting the current page.
12
+ ### 🛠️ Core Improvements Over Upstream
13
+ Enhanced from the original Basecoat with numerous optimizations and bug fixes:
14
+ - **CSS Modularization**: Refactored monolithic CSS into modular structure supporting on-demand loading
15
+ - **Tailwind v4 Compatibility**: Fixed escaping issues with complex selectors and modern CSS nesting
16
+ - **Component Optimizations**:
17
+ - Button: Fixed Ghost/Link variant background issues
18
+ - Dialog: Enhanced animations with natural scaling and bounce effects
19
+ - Dropdown Menu: Resolved initialization flickering
20
+ - Sidebar: Intelligent current page highlighting logic
21
+ - Form Elements: Improved contrast and accessibility
24
22
 
25
23
  ### 🧩 New Components
26
- Introduced a series of high-frequency components inspired by shadcn/ui, completely independent of React/Vue:
27
- - **Accordion**: Originally only a demo in upstream docs; standardized and internalized here. Based on native `<details>`, zero-JS animation.
28
- - **Sheet**: Elegant side-sliding panel.
29
- - **Carousel**: Lightweight carousel component.
30
- - **Input OTP**: Dedicated one-time password input.
31
- - **Toggle Group**: Button-style interaction similar to Radio Group.
32
- - **Toggle**: Independent toggle button style.
33
-
34
- ### 🔌 External Integrations
35
- Integrated excellent third-party libraries to bridge gaps in pure CSS/Vanilla JS (must be imported separately):
36
- - **Date Picker**: Deeply customized version based on [Flatpickr](https://flatpickr.js.org/), perfectly adapted to themes.
37
- - **Resizable**: Draggable split panel based on [Split.js](https://split.js.org/).
24
+ Comprehensive component library inspired by shadcn/ui, completely framework-independent:
25
+ - **Standard Components**: Accordion, Sheet, Carousel, Input OTP, Toggle Group, Toggle
26
+ - **External Integrations**: Date Picker (Flatpickr), Resizable Panels (Split.js)
27
+ - **Advanced Features**: Command palette, enhanced dialogs, improved navigation
38
28
 
39
29
  ### 🎨 Visual Enhancements
40
- - **Catppuccin Themes**: Built-in support for the full [Catppuccin](https://github.com/catppuccin/catppuccin) suite (Latte, Frappé, Macchiato, Mocha).
41
- - **Neumorphism Extension**:
42
- - **Global Lighting System**: Unique mouse-following lighting effects (`lighting.js`), giving neumorphic feel to `.neu-panel`, `.neu-btn` elements.
43
- - **3D Flip**: Supports CSS 3D Transform-based card flip effects.
30
+ - **Catppuccin Themes**: Full suite support (Latte, Frappé, Macchiato, Mocha) with theme switcher
31
+ - **Neumorphism Effects**: Global lighting system with mouse-following effects and 3D transforms
32
+ - **Enhanced Animations**: Smooth transitions and micro-interactions throughout
33
+
34
+ ### 🏗️ Multi-Package Architecture
35
+ - **Ultra Package**: Framework-agnostic CSS/JS components for any stack
36
+ - **Svelte Package**: Native Svelte 5 components with Runes support
37
+ - **CLI Tool**: Copy-paste workflow for Svelte components
38
+ - **Documentation**: Comprehensive guides and interactive examples
44
39
 
45
40
  ## 📦 Installation
46
41
 
47
- Recommended using `bun`, but `npm` or `pnpm` are also supported:
42
+ Choose the package that fits your stack:
48
43
 
44
+ ### For Vanilla HTML/JS, React, Vue, or Other Frameworks
49
45
  ```bash
50
46
  bun add @lanrenbang/basecoat-ultra
51
- # or
52
- npm install @lanrenbang/basecoat-ultra
47
+ # or npm install @lanrenbang/basecoat-ultra
53
48
  ```
54
49
 
55
- ## 🚀 Setup (Bundlers)
56
-
57
- For projects using Vite, Webpack, or other bundlers with Tailwind CSS v4 configured.
58
-
59
- ### 1. Import CSS
50
+ ### For Svelte 5 Projects
51
+ ```bash
52
+ # CLI approach (recommended)
53
+ npx basecoat-ultra-svelte@latest init
54
+ npx basecoat-ultra-svelte@latest add button
60
55
 
61
- In your CSS entry file (e.g., `style.css`).
56
+ # Package approach
57
+ bun add @lanrenbang/basecoat-ultra-svelte
58
+ ```
62
59
 
63
- **Note**: Import the raw CSS (`/css`), letting your Tailwind config handle the styles. Do NOT use the `.cdn.css` version here.
60
+ ## 🚀 Quick Setup
64
61
 
62
+ ### Bundler Setup (Vite, Webpack, etc.)
65
63
  ```css
64
+ /* In your CSS file */
66
65
  @import "tailwindcss";
67
-
68
- /* 1. Basecoat Core (Required) */
69
66
  @import "@lanrenbang/basecoat-ultra";
70
-
71
- /* 2. External Components (Optional) */
72
- /* Only import if you use these specific components */
73
- @import "@lanrenbang/basecoat-ultra/datepicker.css";
74
- @import "@lanrenbang/basecoat-ultra/resizable.css";
75
-
76
- /* 3. Theme (Optional, must be explicit) */
77
- /* We provide a Catppuccin theme suite, or you can build your own */
78
- @import "@lanrenbang/basecoat-ultra/theme/catppuccin";
67
+ @import "@lanrenbang/basecoat-ultra/theme/catppuccin"; /* Optional */
79
68
  ```
80
69
 
81
- ### 2. Import JavaScript
82
-
83
- In your application entry point (e.g., `main.js` or `app.ts`).
84
-
85
- **Option A: Import All (Recommended)**
86
- Includes core logic and most standard components (excludes Datepicker/Resizable).
87
-
88
70
  ```javascript
71
+ // In your JS file
89
72
  import '@lanrenbang/basecoat-ultra/all';
90
73
  ```
91
74
 
92
- **Option B: Cherry-pick**
93
- To reduce bundle size, import only what you need.
94
- **Important**: You MUST import the `basecoat` core module first, as other components rely on it for registration.
95
-
96
- ```javascript
97
- // 1. Core first
98
- import '@lanrenbang/basecoat-ultra/basecoat';
99
-
100
- // 2. Then components
101
- import '@lanrenbang/basecoat-ultra/tabs';
102
- import '@lanrenbang/basecoat-ultra/select';
103
- import '@lanrenbang/basecoat-ultra/popover';
104
- ```
105
-
106
- **External Components (Must be imported separately)**
107
- Regardless of the option above, these components are not included in the main bundle due to size or dependencies:
108
-
109
- ```javascript
110
- import '@lanrenbang/basecoat-ultra/datepicker'; // Uses flatpickr
111
- import '@lanrenbang/basecoat-ultra/resizable'; // Uses split.js
112
- ```
113
-
114
- ---
115
-
116
- ## 🌐 CDN Usage (No Build Tool)
117
-
118
- If you are not using a bundler, you can use the pre-compiled versions via CDN (jsDelivr). These include the compiled Tailwind styles.
119
-
120
- ### CSS
121
-
75
+ ### CDN Setup (No Build Tool)
122
76
  ```html
123
- <!-- Basecoat Core (includes Tailwind styles) -->
77
+ <!-- CSS -->
124
78
  <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/basecoat.cdn.min.css" rel="stylesheet">
125
79
 
126
- <!-- External Components (Optional) -->
127
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/datepicker.min.css" rel="stylesheet">
128
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/resizable.min.css" rel="stylesheet">
129
-
130
- <!-- Theme (Optional) -->
131
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/theme/catppuccin/index.min.css" rel="stylesheet">
132
- ```
133
-
134
- ### JavaScript
135
-
136
- ```html
137
- <!-- Core & Standard Components -->
80
+ <!-- JavaScript -->
138
81
  <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/all.min.js" defer></script>
139
-
140
- <!-- External Components (Optional) -->
141
- <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/datepicker.min.js" defer></script>
142
- <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/resizable.min.js" defer></script>
143
82
  ```
144
83
 
84
+ For detailed setup instructions, configuration options, and usage examples, visit our **[comprehensive documentation](https://lanrenbang.github.io/basecoat-ultra)**.
85
+
145
86
  ## 🛠️ Development
146
87
 
147
- This project uses [Bun](https://bun.sh) as the package manager and runtime, and [Vite](https://vitejs.dev) for building.
88
+ This project uses a Bun workspace monorepo structure:
148
89
 
149
- ### Setup
90
+ ```
91
+ packages/
92
+ ├── ultra/ # Core CSS/JS library (framework-agnostic)
93
+ ├── svelte/ # Svelte 5 components with Runes
94
+ ├── cli/ # CLI tool for Svelte components
95
+ └── docs/ # Documentation site (SvelteKit)
96
+ ```
150
97
 
98
+ ### Development Commands
151
99
  ```bash
152
- # 1. Clone project
153
- git clone https://github.com/your-username/basecoat-ultra.git
154
- cd basecoat-ultra
155
-
156
- # 2. Install dependencies
100
+ # Install dependencies
157
101
  bun install
158
102
 
159
- # 3. Start dev server
160
- bun run dev
161
- ```
162
-
163
- ### Anti-flash Script
103
+ # Development servers
104
+ bun dev:ultra # Core Ultra package
105
+ bun dev:svelte # Svelte components
106
+ bun dev:docs # Documentation site
164
107
 
165
- 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:
108
+ # Build packages
109
+ bun run build:ultra
110
+ bun run build:svelte
111
+ bun run build:docs
166
112
 
167
- ```html
168
- <script>
169
- (function() {
170
- try {
171
- const t = localStorage.getItem('catppuccin-theme');
172
- const a = localStorage.getItem('catppuccin-accent');
173
- const m = localStorage.getItem('basecoat-mode');
174
- const r = document.documentElement;
175
- // Prioritize theme config
176
- if (t && a) {
177
- r.classList.add(`theme-${t}`, `accent-${a}`);
178
- if(['frappe','macchiato','mocha'].includes(t)) r.classList.add('dark');
179
- } else if (m) {
180
- // Only dark/light mode preference
181
- r.classList.toggle('dark', m === 'dark');
182
- } else {
183
- // Follow system
184
- r.classList.toggle('dark', window.matchMedia('(prefers-color-scheme: dark)').matches);
185
- }
186
- } catch(e) {}
187
- })();
188
- </script>
113
+ # CLI tool
114
+ bun cli # Run CLI locally
189
115
  ```
190
116
 
117
+ ### Build Order
118
+ Due to package dependencies: Ultra → Svelte → Docs
119
+
191
120
  ## ❤️ Credits
192
121
 
193
122
  This project stands on the shoulders of giants:
194
123
 
195
- * **[Basecoat](https://basecoatui.com)**: Original creator [hunvreus](https://github.com/hunvreus). Most foundational code belongs to the original author.
196
- * **[Catppuccin](https://github.com/catppuccin/palette)**: Provided the beautiful color palettes.
197
- * **[puikinsh/login-forms](https://github.com/puikinsh/login-forms/tree/main/forms/neumorphism)**: Inspiration for Neumorphism lighting and 3D effects.
198
- * **[Flatpickr](https://flatpickr.js.org/)** & **[Split.js](https://split.js.org/)**: Excellent third-party library support.
124
+ - **[Basecoat](https://basecoatui.com)**: Original creator [hunvreus](https://github.com/hunvreus). Most foundational code belongs to the original author.
125
+ - **[Catppuccin](https://github.com/catppuccin/palette)**: Beautiful color palettes for theming
126
+ - **[Flatpickr](https://flatpickr.js.org/)** & **[Split.js](https://split.js.org/)**: Excellent third-party integrations
127
+ - **[puikinsh/login-forms](https://github.com/puikinsh/login-forms/tree/main/forms/neumorphism)**: Inspiration for neumorphism effects
128
+
129
+ ## ☕ Support
199
130
 
200
- ## ☕ Support Me
201
131
  [![BuyMeACoffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-ffdd00?style=for-the-badge&logo=buy-me-a-coffee&logoColor=black)](https://buymeacoffee.com/bobbynona) [![Ko-Fi](https://img.shields.io/badge/Ko--fi-F16061?style=for-the-badge&logo=ko-fi&logoColor=white)](https://ko-fi.com/bobbynona) [![USDT(TRC20)/Tether](https://img.shields.io/badge/Tether-168363?style=for-the-badge&logo=tether&logoColor=white)](https://github.com/Lanrenbang/.github/blob/5b06b0b2d0b8e4ce532c1c37c72115dd98d7d849/custom/USDT-TRC20.md) [![Litecoin](https://img.shields.io/badge/Litecoin-A6A9AA?style=for-the-badge&logo=litecoin&logoColor=white)](https://github.com/Lanrenbang/.github/blob/5b06b0b2d0b8e4ce532c1c37c72115dd98d7d849/custom/Litecoin.md)
202
132
 
203
133
  ## 📄 License