basecoat-css 0.2.1 → 0.2.3

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.
package/README.md CHANGED
@@ -8,42 +8,51 @@ Your project must have [Tailwind CSS](https://tailwindcss.com/docs/installation)
8
8
 
9
9
  ## Installation
10
10
 
11
- You can install `basecoat-css` using your preferred package manager:
11
+ Install with any package manager:
12
12
 
13
13
  ```bash
14
- # npm
15
- npm install basecoat-css
14
+ npm install basecoat-css # or pnpm add / yarn add / bun add
15
+ ```
16
16
 
17
- # yarn
18
- yarn add basecoat-css
17
+ ## Usage
19
18
 
20
- # pnpm
21
- pnpm add basecoat-css
19
+ Add it just after Tailwind in your stylesheet:
22
20
 
23
- # bun
24
- bun add basecoat-css
21
+ ```css
22
+ @import "tailwindcss";
23
+ @import "basecoat-css";
25
24
  ```
26
25
 
27
- Alternatively, you can download the `basecoat.css` file directly from the [GitHub repository](https://github.com/hunvreus/basecoat/blob/main/src/css/basecoat.css) (or the `dist/basecoat.css` file from this package after installation) and include it in your project.
26
+ That's it, you can use any Basecoat class (`btn`, `card`, `input`, etc) in your markup.
28
27
 
29
- ## Usage
28
+ ### (Optional) JavaScript files
30
29
 
31
- After installation, import `basecoat-css` into your main CSS file. Make sure to import it **after** Tailwind CSS and **before** any custom theme overrides.
30
+ Some interactive components (Dropdown Menu, Popover, Select, Sidebar, Tabs, Toast) need some JavaScript.
32
31
 
33
- ```css
34
- /* Your main CSS file (e.g., styles.css) */
32
+ With a build tool (ESM):
33
+
34
+ ```js
35
+ import 'basecoat-css/all';
36
+ ```
37
+
38
+ Or cherry-pick the components you need:
35
39
 
36
- @import "tailwindcss/base";
37
- @import "tailwindcss/components";
38
- @import "tailwindcss/utilities";
40
+ ```js
41
+ import 'basecoat-css/tabs';
42
+ import 'basecoat-css/popover';
43
+ ```
39
44
 
40
- @import "basecoat-css"; /* Or the path to basecoat.css if manually added */
45
+ Without a build tool, copy the files from `node_modules`:
41
46
 
42
- /* Your custom styles or theme overrides (optional) */
43
- /* @import "your-theme.css"; */
47
+ ```bash
48
+ npx copyfiles -u 1 "node_modules/basecoat-css/dist/js/**/*" public/js/basecoat
44
49
  ```
45
50
 
46
- Once imported, you can start using Basecoat's component classes in your HTML.
51
+ Then reference what you need, e.g.
52
+
53
+ ```html
54
+ <script src="/js/basecoat/tabs.min.js" defer></script>
55
+ ```
47
56
 
48
57
  ## Documentation
49
58
 
@@ -2502,7 +2502,6 @@
2502
2502
  .dropdown-menu {
2503
2503
  position: relative;
2504
2504
  display: inline-flex;
2505
- padding: calc(var(--spacing) * 1);
2506
2505
  [data-popover] {
2507
2506
  padding: calc(var(--spacing) * 1);
2508
2507
  min-width: anchor-size(width);
@@ -2554,28 +2553,30 @@
2554
2553
  & svg {
2555
2554
  color: var(--color-muted-foreground);
2556
2555
  }
2557
- &:hover {
2558
- @media (hover: hover) {
2556
+ &:not([aria-disabled='true']) {
2557
+ &:hover {
2558
+ @media (hover: hover) {
2559
+ background-color: var(--color-accent);
2560
+ }
2561
+ }
2562
+ &:hover {
2563
+ @media (hover: hover) {
2564
+ color: var(--color-accent-foreground);
2565
+ }
2566
+ }
2567
+ &:focus-visible {
2559
2568
  background-color: var(--color-accent);
2560
2569
  }
2561
- }
2562
- &:hover {
2563
- @media (hover: hover) {
2570
+ &:focus-visible {
2564
2571
  color: var(--color-accent-foreground);
2565
2572
  }
2566
2573
  }
2567
- &:focus-visible {
2568
- background-color: var(--color-accent);
2569
- }
2570
- &:focus-visible {
2571
- color: var(--color-accent-foreground);
2572
- }
2573
2574
  &.active {
2574
2575
  background-color: var(--color-accent);
2575
2576
  color: var(--color-accent-foreground);
2576
2577
  }
2577
2578
  }
2578
- [role='menu'] [role="presentation"] {
2579
+ [role='menu'] [role='heading'] {
2579
2580
  display: flex;
2580
2581
  padding-inline: calc(var(--spacing) * 2);
2581
2582
  padding-block: calc(var(--spacing) * 1.5);
@@ -3167,7 +3168,7 @@
3167
3168
  background-repeat: no-repeat;
3168
3169
  }
3169
3170
  }
3170
- [role='listbox'] [role="presentation"] {
3171
+ [role='listbox'] [role='heading'] {
3171
3172
  display: flex;
3172
3173
  padding-inline: calc(var(--spacing) * 2);
3173
3174
  padding-block: calc(var(--spacing) * 1.5);