@danxbot/ui 2.9.0 → 3.0.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.
package/README.md CHANGED
@@ -8,10 +8,17 @@ npm install @danxbot/ui
8
8
 
9
9
  ```tsx
10
10
  import { Button, Chat, ThemeMenu } from "@danxbot/ui";
11
- import "@danxbot/ui/styles.css";
12
11
  ```
13
12
 
14
- Requires React 19 and Tailwind CSS 4. MIT licensed.
13
+ ```css
14
+ /* your app's Tailwind entry — see Setup, all three lines are required */
15
+ @import "tailwindcss";
16
+ @import "@danxbot/ui/theme.css";
17
+ @import "@danxbot/ui/styles.css";
18
+ ```
19
+
20
+ Requires React 19 and Tailwind CSS 4 **in the consuming build** — the package
21
+ ships no compiled utilities, on purpose. MIT licensed.
15
22
 
16
23
  ## What is in it
17
24
 
@@ -100,26 +107,35 @@ Two stylesheets, and you want both. In your application's Tailwind entry:
100
107
 
101
108
  ```css
102
109
  @import "tailwindcss";
103
- @import "@danxbot/ui/theme.css"; /* teaches YOUR build bg-surface, text-2xs, ... */
110
+ @import "@danxbot/ui/theme.css"; /* @source + the @theme bridge */
104
111
  @import "@danxbot/ui/styles.css"; /* the token values, base layer and component CSS */
105
112
  ```
106
113
 
107
- `styles.css` alone is not enough, and the way it falls short is silent.
108
- It is compiled output, so it carries the token values plus exactly the
109
- utilities *this library's own components* happen to use. Write `bg-surface`
110
- in your app and it works; write `bg-accent-subtle` and you get a class that
111
- resolves to nothing no build error, no console warning, just a missing
112
- background. Which utilities happen to work is an accident of our internals,
113
- which is the worst possible contract to hand anybody.
114
-
115
- `theme.css` closes that: it is the `@theme` bridge, extracted from source at
116
- build time, mapping every semantic token onto Tailwind's namespaces so your own
117
- build generates the same utilities ours does. It carries no token values and no
118
- component CSS, so importing both duplicates almost nothing. **Order matters**
119
- `styles.css` must come after, because it supplies the values the bridge points at.
120
-
121
- Not using Tailwind in your app? Import `styles.css` on its own and use the
122
- components; the bridge only matters for utilities you write yourself.
114
+ That is the whole contract. There is no layer-order statement to remember and
115
+ no path to configure.
116
+
117
+ **Your Tailwind build compiles this library's utilities, not ours.**
118
+ `theme.css` carries `@source "./index.js"`, which points your compiler at the
119
+ shipped bundle; the package itself ships zero generated utilities. That is
120
+ deliberate and it is the fix for a real defect: a compiled stylesheet emits into
121
+ `@layer utilities`, which is *the same layer name your build uses*, at equal
122
+ specificity, imported last so the library used to win every tie. Measured in a
123
+ consuming app at 1440px, `grid grid-cols-1 xl:grid-cols-[1.6fr_1fr]` rendered
124
+ one column and `md:grid-cols-2 xl:grid-cols-3` rendered two. Nothing was
125
+ misused; `xl:` is supposed to beat `md:` because Tailwind *sorts* breakpoints,
126
+ and that guarantee only holds inside one compiler's output. So there is one
127
+ compiler.
128
+
129
+ `theme.css` also carries the `@theme` bridge, extracted from source at build
130
+ time, mapping every semantic token onto Tailwind's namespaces — without it your
131
+ own `bg-accent-subtle` compiles to nothing, silently. **Order matters**:
132
+ `styles.css` comes after, because it supplies the values the bridge points at.
133
+
134
+ **Not using Tailwind 4?** Then this package will not style anything: you get the
135
+ tokens, the base layer and the hand-written component CSS, and no utilities at
136
+ all. Components render structurally correct and visually unstyled — loudly, on
137
+ the first screen, rather than as one breakpoint quietly misbehaving. Tailwind 4
138
+ in the consuming build is a requirement, not a recommendation.
123
139
 
124
140
  Fonts are self-hosted woff2 subsets rather than CDN-loaded, because a blocked
125
141
  CDN renders every design in a system font with no error anywhere. They are
package/dist/index.js CHANGED
@@ -20698,7 +20698,7 @@ function x3({
20698
20698
  "aside",
20699
20699
  {
20700
20700
  className: q(
20701
- "hidden shrink-0 flex-col border-r border-border-subtle bg-surface lg:flex",
20701
+ "sticky top-0 hidden h-dvh shrink-0 flex-col border-r border-border-subtle bg-surface lg:flex",
20702
20702
  "transition-[var(--tx-colors),width] duration-(--dur-slow) ease-emphasis",
20703
20703
  u ? "w-14" : "w-60"
20704
20704
  ),