@lanrenbang/basecoat-ultra 0.1.6 → 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,200 +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.
8
+ 🎡 **[Live Demo & Documentation](https://lanrenbang.github.io/basecoat-ultra)**
9
9
 
10
10
  ## ✨ Features
11
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.
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
21
22
 
22
23
  ### 🧩 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/).
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
35
28
 
36
29
  ### 🎨 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.
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
41
39
 
42
40
  ## 📦 Installation
43
41
 
44
- Recommended using `bun`, but `npm` or `pnpm` are also supported:
42
+ Choose the package that fits your stack:
45
43
 
44
+ ### For Vanilla HTML/JS, React, Vue, or Other Frameworks
46
45
  ```bash
47
46
  bun add @lanrenbang/basecoat-ultra
48
- # or
49
- npm install @lanrenbang/basecoat-ultra
47
+ # or npm install @lanrenbang/basecoat-ultra
50
48
  ```
51
49
 
52
- ## 🚀 Setup (Bundlers)
53
-
54
- For projects using Vite, Webpack, or other bundlers with Tailwind CSS v4 configured.
55
-
56
- ### 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
57
55
 
58
- In your CSS entry file (e.g., `style.css`).
56
+ # Package approach
57
+ bun add @lanrenbang/basecoat-ultra-svelte
58
+ ```
59
59
 
60
- **Note**: Import the raw CSS (`/css`), letting your Tailwind config handle the styles. Do NOT use the `.cdn.css` version here.
60
+ ## 🚀 Quick Setup
61
61
 
62
+ ### Bundler Setup (Vite, Webpack, etc.)
62
63
  ```css
64
+ /* In your CSS file */
63
65
  @import "tailwindcss";
64
-
65
- /* 1. Basecoat Core (Required) */
66
66
  @import "@lanrenbang/basecoat-ultra";
67
-
68
- /* 2. External Components (Optional) */
69
- /* Only import if you use these specific components */
70
- @import "@lanrenbang/basecoat-ultra/datepicker.css";
71
- @import "@lanrenbang/basecoat-ultra/resizable.css";
72
-
73
- /* 3. Theme (Optional, must be explicit) */
74
- /* We provide a Catppuccin theme suite, or you can build your own */
75
- @import "@lanrenbang/basecoat-ultra/theme/catppuccin";
67
+ @import "@lanrenbang/basecoat-ultra/theme/catppuccin"; /* Optional */
76
68
  ```
77
69
 
78
- ### 2. Import JavaScript
79
-
80
- In your application entry point (e.g., `main.js` or `app.ts`).
81
-
82
- **Option A: Import All (Recommended)**
83
- Includes core logic and most standard components (excludes Datepicker/Resizable).
84
-
85
70
  ```javascript
71
+ // In your JS file
86
72
  import '@lanrenbang/basecoat-ultra/all';
87
73
  ```
88
74
 
89
- **Option B: Cherry-pick**
90
- To reduce bundle size, import only what you need.
91
- **Important**: You MUST import the `basecoat` core module first, as other components rely on it for registration.
92
-
93
- ```javascript
94
- // 1. Core first
95
- import '@lanrenbang/basecoat-ultra/basecoat';
96
-
97
- // 2. Then components
98
- import '@lanrenbang/basecoat-ultra/tabs';
99
- import '@lanrenbang/basecoat-ultra/select';
100
- import '@lanrenbang/basecoat-ultra/popover';
101
- ```
102
-
103
- **External Components (Must be imported separately)**
104
- Regardless of the option above, these components are not included in the main bundle due to size or dependencies:
105
-
106
- ```javascript
107
- import '@lanrenbang/basecoat-ultra/datepicker'; // Uses flatpickr
108
- import '@lanrenbang/basecoat-ultra/resizable'; // Uses split.js
109
- ```
110
-
111
- ---
112
-
113
- ## 🌐 CDN Usage (No Build Tool)
114
-
115
- If you are not using a bundler, you can use the pre-compiled versions via CDN (jsDelivr). These include the compiled Tailwind styles.
116
-
117
- ### CSS
118
-
75
+ ### CDN Setup (No Build Tool)
119
76
  ```html
120
- <!-- Basecoat Core (includes Tailwind styles) -->
77
+ <!-- CSS -->
121
78
  <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/basecoat.cdn.min.css" rel="stylesheet">
122
79
 
123
- <!-- External Components (Optional) -->
124
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/datepicker.min.css" rel="stylesheet">
125
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/css/resizable.min.css" rel="stylesheet">
126
-
127
- <!-- Theme (Optional) -->
128
- <link href="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/theme/catppuccin/index.min.css" rel="stylesheet">
129
- ```
130
-
131
- ### JavaScript
132
-
133
- ```html
134
- <!-- Core & Standard Components -->
80
+ <!-- JavaScript -->
135
81
  <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/all.min.js" defer></script>
136
-
137
- <!-- External Components (Optional) -->
138
- <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/datepicker.min.js" defer></script>
139
- <script src="https://cdn.jsdelivr.net/npm/@lanrenbang/basecoat-ultra@latest/dist/js/resizable.min.js" defer></script>
140
82
  ```
141
83
 
84
+ For detailed setup instructions, configuration options, and usage examples, visit our **[comprehensive documentation](https://lanrenbang.github.io/basecoat-ultra)**.
85
+
142
86
  ## 🛠️ Development
143
87
 
144
- 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:
145
89
 
146
- ### 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
+ ```
147
97
 
98
+ ### Development Commands
148
99
  ```bash
149
- # 1. Clone project
150
- git clone https://github.com/your-username/basecoat-ultra.git
151
- cd basecoat-ultra
152
-
153
- # 2. Install dependencies
100
+ # Install dependencies
154
101
  bun install
155
102
 
156
- # 3. Start dev server
157
- bun run dev
158
- ```
103
+ # Development servers
104
+ bun dev:ultra # Core Ultra package
105
+ bun dev:svelte # Svelte components
106
+ bun dev:docs # Documentation site
159
107
 
160
- ### Anti-flash Script
108
+ # Build packages
109
+ bun run build:ultra
110
+ bun run build:svelte
111
+ bun run build:docs
161
112
 
162
- 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:
163
-
164
- ```html
165
- <script>
166
- (function() {
167
- try {
168
- const t = localStorage.getItem('catppuccin-theme');
169
- const a = localStorage.getItem('catppuccin-accent');
170
- const m = localStorage.getItem('basecoat-mode');
171
- const r = document.documentElement;
172
- // Prioritize theme config
173
- if (t && a) {
174
- r.classList.add(`theme-${t}`, `accent-${a}`);
175
- if(['frappe','macchiato','mocha'].includes(t)) r.classList.add('dark');
176
- } else if (m) {
177
- // Only dark/light mode preference
178
- r.classList.toggle('dark', m === 'dark');
179
- } else {
180
- // Follow system
181
- r.classList.toggle('dark', window.matchMedia('(prefers-color-scheme: dark)').matches);
182
- }
183
- } catch(e) {}
184
- })();
185
- </script>
113
+ # CLI tool
114
+ bun cli # Run CLI locally
186
115
  ```
187
116
 
117
+ ### Build Order
118
+ Due to package dependencies: Ultra → Svelte → Docs
119
+
188
120
  ## ❤️ Credits
189
121
 
190
122
  This project stands on the shoulders of giants:
191
123
 
192
- * **[Basecoat](https://basecoatui.com)**: Original creator [hunvreus](https://github.com/hunvreus). Most foundational code belongs to the original author.
193
- * **[Catppuccin](https://github.com/catppuccin/palette)**: Provided the beautiful color palettes.
194
- * **[puikinsh/login-forms](https://github.com/puikinsh/login-forms/tree/main/forms/neumorphism)**: Inspiration for Neumorphism lighting and 3D effects.
195
- * **[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
196
130
 
197
- ## Support Me
198
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)
199
132
 
200
133
  ## 📄 License