basecoat-css 1.0.0-beta.7 → 1.0.1

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 (74) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +83 -35
  3. package/dist/base/base.css +3 -45
  4. package/dist/basecoat-base.cdn.css +171 -132
  5. package/dist/basecoat-base.cdn.min.css +2 -2
  6. package/dist/basecoat-compat.cdn.css +27 -31
  7. package/dist/basecoat-compat.cdn.min.css +2 -2
  8. package/dist/basecoat-components.css +1 -0
  9. package/dist/basecoat-luma.cdn.css +278 -240
  10. package/dist/basecoat-luma.cdn.min.css +2 -2
  11. package/dist/basecoat-lyra.cdn.css +299 -260
  12. package/dist/basecoat-lyra.cdn.min.css +2 -2
  13. package/dist/basecoat-maia.cdn.css +287 -249
  14. package/dist/basecoat-maia.cdn.min.css +2 -2
  15. package/dist/basecoat-mira.cdn.css +315 -277
  16. package/dist/basecoat-mira.cdn.min.css +2 -2
  17. package/dist/basecoat-nova.cdn.css +316 -277
  18. package/dist/basecoat-nova.cdn.min.css +2 -2
  19. package/dist/basecoat-rhea.cdn.css +301 -263
  20. package/dist/basecoat-rhea.cdn.min.css +2 -2
  21. package/dist/basecoat-sera.cdn.css +269 -230
  22. package/dist/basecoat-sera.cdn.min.css +2 -2
  23. package/dist/basecoat-vega.cdn.css +296 -257
  24. package/dist/basecoat-vega.cdn.min.css +2 -2
  25. package/dist/basecoat.cdn.css +296 -257
  26. package/dist/basecoat.cdn.min.css +2 -2
  27. package/dist/compat/legacy.css +19 -1
  28. package/dist/components/input-group.css +1 -1
  29. package/dist/components/scrollbar.css +46 -0
  30. package/dist/components/select.css +16 -16
  31. package/dist/js/accordion.min.js +1 -1
  32. package/dist/js/all.js +28 -8
  33. package/dist/js/all.min.js +1 -1
  34. package/dist/js/basecoat.js +26 -6
  35. package/dist/js/basecoat.min.js +1 -1
  36. package/dist/js/chart.min.js +1 -1
  37. package/dist/js/combobox.min.js +1 -1
  38. package/dist/js/command.min.js +1 -1
  39. package/dist/js/drawer.min.js +1 -1
  40. package/dist/js/dropdown-menu.min.js +1 -1
  41. package/dist/js/popover.min.js +1 -1
  42. package/dist/js/range.min.js +1 -1
  43. package/dist/js/select.min.js +1 -1
  44. package/dist/js/sidebar.js +2 -2
  45. package/dist/js/sidebar.min.js +1 -1
  46. package/dist/js/tabs.min.js +1 -1
  47. package/dist/js/toast.min.js +1 -1
  48. package/dist/styles/luma.css +15 -15
  49. package/dist/styles/lyra.css +14 -14
  50. package/dist/styles/maia.css +15 -15
  51. package/dist/styles/mira.css +16 -16
  52. package/dist/styles/nova.css +14 -14
  53. package/dist/styles/rhea.css +15 -15
  54. package/dist/styles/sera.css +16 -16
  55. package/dist/styles/vega.css +14 -14
  56. package/package.json +26 -6
  57. package/templates/jinja/combobox.html.jinja +147 -0
  58. package/templates/jinja/command.html.jinja +210 -0
  59. package/templates/jinja/dialog.html.jinja +97 -0
  60. package/templates/jinja/dropdown-menu.html.jinja +130 -0
  61. package/templates/jinja/popover.html.jinja +51 -0
  62. package/templates/jinja/select.html.jinja +191 -0
  63. package/templates/jinja/sidebar.html.jinja +149 -0
  64. package/templates/jinja/tabs.html.jinja +82 -0
  65. package/templates/jinja/toast.html.jinja +139 -0
  66. package/templates/nunjucks/combobox.njk +157 -0
  67. package/templates/nunjucks/command.njk +203 -0
  68. package/templates/nunjucks/dialog.njk +92 -0
  69. package/templates/nunjucks/dropdown-menu.njk +125 -0
  70. package/templates/nunjucks/popover.njk +48 -0
  71. package/templates/nunjucks/select.njk +184 -0
  72. package/templates/nunjucks/sidebar.njk +144 -0
  73. package/templates/nunjucks/tabs.njk +39 -0
  74. package/templates/nunjucks/toast.njk +137 -0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Ronan Berder
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.md CHANGED
@@ -1,70 +1,118 @@
1
- # basecoat-css
1
+ # Basecoat
2
2
 
3
- This package provides the core CSS styles for [Basecoat](https://basecoatui.com), a component library built with Tailwind CSS.
3
+ Basecoat is a Tailwind CSS, vanilla HTML/CSS/JavaScript implementation of the shadcn/ui design system. It provides shadcn-style components for any web stack without React, Radix, or framework runtime dependencies.
4
4
 
5
- ## Prerequisites
5
+ ![screenshot](site/public/assets/images/screenshot.png)
6
6
 
7
- Your project must have [Tailwind CSS](https://tailwindcss.com/docs/installation) installed and configured, as Basecoat relies on Tailwind utility classes and theming.
7
+ ## Features
8
8
 
9
- ## Installation
9
+ - Semantic HTML-first components.
10
+ - Tailwind CSS v4 source files and generated CSS bundles.
11
+ - Small vanilla JavaScript for components that need behavior.
12
+ - Standalone style packs: Vega, Nova, Maia, Lyra, Mira, Luma, Sera, and Rhea.
13
+ - Compatible with shadcn/ui themes.
14
+ - Dark mode.
15
+ - CDN, npm, and template usage paths.
16
+ - Nunjucks and Jinja templates.
10
17
 
11
- Install with any package manager:
18
+ ## Documentation
19
+
20
+ - Website: [basecoatui.com](https://basecoatui.com)
21
+ - Installation: [basecoatui.com/installation](https://basecoatui.com/installation)
22
+ - Customization: [basecoatui.com/customization](https://basecoatui.com/customization)
23
+
24
+ ## Install
12
25
 
13
26
  ```bash
14
- npm install basecoat-css # or pnpm add / yarn add / bun add
27
+ npm install basecoat-css
15
28
  ```
16
29
 
17
- ## Usage
18
-
19
- Add it just after Tailwind in your stylesheet:
30
+ Use the default bundle:
20
31
 
21
32
  ```css
22
33
  @import "tailwindcss";
23
34
  @import "basecoat-css";
24
35
  ```
25
36
 
26
- That's it, you can use any Basecoat class (`btn`, `card`, `input`, etc) in your markup.
37
+ Use a specific style bundle:
38
+
39
+ ```css
40
+ @import "tailwindcss";
41
+ @import "basecoat-css/nova";
42
+ ```
27
43
 
28
- To use a specific style, import its standalone bundle instead:
44
+ Use the styleless base plus a custom style file:
29
45
 
30
46
  ```css
31
47
  @import "tailwindcss";
32
- @import "basecoat-css/sera";
48
+ @import "basecoat-css/base";
49
+ @import "./style-acme.css";
33
50
  ```
34
51
 
35
- ### (Optional) JavaScript files
52
+ ## Repository Layout
53
+
54
+ ```text
55
+ .
56
+ ├── dist/ Generated package output
57
+ ├── scripts/ Build and generation scripts
58
+ ├── site/ ReallySimpleDocs/Astro documentation app
59
+ │ ├── public/ Static site assets
60
+ │ └── src/
61
+ │ ├── components/ RSD component overrides
62
+ │ ├── docs/ Documentation pages and examples
63
+ │ ├── fragments/ Site-only rendered fragments
64
+ │ ├── pages/ Astro routes outside the docs tree
65
+ │ └── scripts/ Site scripts
66
+ ├── src/ Package source
67
+ │ ├── css/
68
+ │ ├── js/
69
+ │ └── templates/
70
+ └── templates/ Generated package template output
71
+ ```
36
72
 
37
- Some interactive components (Dropdown Menu, Popover, Select, Sidebar, Tabs, Toast) need some JavaScript.
73
+ ## CSS Architecture
38
74
 
39
- With a build tool (ESM):
75
+ Basecoat separates structure from style:
40
76
 
41
- ```js
42
- import 'basecoat-css/all';
43
- ```
77
+ - `src/css/base/base.css`: shared tokens and semantic utilities.
78
+ - `src/css/components/*.css`: component layout, structure, accessibility selectors, and behavior hooks.
79
+ - `src/css/styles/*.css`: style-pack visuals such as color, radius, shadow, typography, spacing, variants, and state styles.
44
80
 
45
- Or cherry-pick the components you need:
81
+ Generated source entrypoints are committed for transparency and package imports:
46
82
 
47
- ```js
48
- import 'basecoat-css/tabs';
49
- import 'basecoat-css/popover';
50
- ```
83
+ - `src/css/basecoat.css`: default backward-compatible Vega bundle.
84
+ - `src/css/basecoat-base.css`: base plus components, no style pack.
85
+ - `src/css/basecoat-components.css`: component imports only.
86
+ - `src/css/basecoat-<style>.css`: base plus one style pack.
87
+ - `src/css/basecoat-<style>.cdn.css`: CDN-compatible wrapper.
51
88
 
52
- Without a build tool, copy the files from `node_modules`:
89
+ These entrypoints are generated by `scripts/generate-css-entrypoints.js` and by the build scripts.
53
90
 
54
- ```bash
55
- npx copyfiles -u 1 "node_modules/basecoat-css/dist/js/**/*" public/js/basecoat
56
- ```
91
+ ## JavaScript Lifecycle
57
92
 
58
- Then reference what you need, e.g.
93
+ - `window.basecoat.init(name)` initializes uninitialized components for one registered component.
94
+ - `window.basecoat.initAll()` initializes all uninitialized registered components.
95
+ - `window.basecoat.init(name, { force: true })` and `window.basecoat.initAll({ force: true })` destroy and reinitialize matching components. Use this when a framework or navigation library restores previously initialized DOM from a cache. Force mode resets transient component state such as open menus, focus state, and active interactions.
96
+ - `window.basecoat.refresh(element)` asks an initialized component to rescan dynamic children when it supports refresh.
97
+ - Components use internal destroy hooks to clean up listeners when initialized roots are removed from the DOM.
59
98
 
60
- ```html
61
- <script src="/js/basecoat/tabs.min.js" defer></script>
62
- ```
99
+ ## Development
63
100
 
64
- ## Documentation
101
+ ```bash
102
+ # Install dependencies.
103
+ npm i
104
+ npm --prefix site i
105
+
106
+ # Run the ReallySimpleDocs/Astro site.
107
+ npm run docs:dev
65
108
 
66
- For more detailed information on components, their usage, and customization options, please refer to the [Basecoat documentation](https://basecoatui.com/installation/#install-css).
109
+ # Build package assets.
110
+ npm run build
111
+
112
+ # Build the static docs site.
113
+ npm run docs:build
114
+ ```
67
115
 
68
116
  ## License
69
117
 
70
- [MIT](https://github.com/hunvreus/basecoat/blob/main/LICENSE.md)
118
+ [MIT](LICENSE.md)
@@ -1,4 +1,4 @@
1
- @custom-variant dark (&:is(.dark *));
1
+ @custom-variant dark (&:is(html.dark *));
2
2
 
3
3
  :root {
4
4
  --radius: 0.625rem;
@@ -84,6 +84,8 @@
84
84
  }
85
85
 
86
86
  @theme {
87
+ --font-sans: "Geist Sans", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
88
+ --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
87
89
  --radius-sm: calc(var(--radius) - 4px);
88
90
  --radius-md: calc(var(--radius) - 2px);
89
91
  --radius-lg: var(--radius);
@@ -121,50 +123,6 @@
121
123
  --color-sidebar-ring: var(--sidebar-ring);
122
124
  }
123
125
 
124
- @utility scrollbar {
125
- scrollbar-width: auto;
126
- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
127
-
128
- &::-webkit-scrollbar {
129
- width: var(--scrollbar-width);
130
- height: var(--scrollbar-width);
131
- }
132
- &::-webkit-scrollbar-track {
133
- background: var(--scrollbar-track);
134
- }
135
- &::-webkit-scrollbar-thumb {
136
- background: var(--scrollbar-thumb);
137
- border-radius: var(--scrollbar-radius);
138
- border: 1px solid transparent;
139
- background-clip: padding-box;
140
- }
141
- &::-webkit-scrollbar-corner {
142
- background: var(--scrollbar-track);
143
- }
144
- }
145
-
146
- @utility scrollbar-sm {
147
- scrollbar-width: thin;
148
- scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
149
-
150
- &::-webkit-scrollbar {
151
- width: var(--scrollbar-sm-width);
152
- height: var(--scrollbar-sm-width);
153
- }
154
- &::-webkit-scrollbar-track {
155
- background: var(--scrollbar-track);
156
- }
157
- &::-webkit-scrollbar-thumb {
158
- background: var(--scrollbar-thumb);
159
- border-radius: var(--scrollbar-radius);
160
- border: 1px solid transparent;
161
- background-clip: padding-box;
162
- }
163
- &::-webkit-scrollbar-corner {
164
- background: var(--scrollbar-track);
165
- }
166
- }
167
-
168
126
  @layer base {
169
127
  * {
170
128
  @apply border-border outline-ring/50;