@aircall/ds 0.17.1 → 0.20.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
@@ -124,36 +124,66 @@ function App() {
124
124
  The package's `exports` point at **source**, so `@aircall/ds/globals.css` is the un-compiled Tailwind source (`@import "tailwindcss"`, `@theme`, …). Your app's Tailwind v4 build compiles it, and `@source` scans your own files for class names:
125
125
 
126
126
  ```css
127
- /* your app's entry CSS */
127
+ /* your app's entry CSS — DS only */
128
128
  @import '@aircall/ds/globals.css';
129
-
130
- /* Scan your own source files for Tailwind classes */
131
129
  @source "your_own_source_file";
132
130
  ```
133
131
 
134
- Benefits:
132
+ If you also use `@aircall/blocks`, import **only** blocks globals — its source already imports DS globals, so `postcss-import` deduplication means DS is compiled once:
135
133
 
136
- - Source-level integration with your app's Tailwind build
137
- - Shared Tailwind context for better optimization
138
- - Access to theme variables and utilities
134
+ ```css
135
+ /* your app's entry CSS — DS + blocks */
136
+ @import '@aircall/blocks/globals.css';
137
+ @source "your_own_source_file";
138
+ ```
139
139
 
140
140
  #### External Apps (published npm package)
141
141
 
142
- The published tarball rewrites `exports` to **`dist`**, so `@aircall/ds/globals.css` is a **precompiled** Tailwind v4 bundle — reset, tokens, and every component utility already generated. Import it directly; no Tailwind build and no `@source` are needed to consume DS, and you must **not** prepend `@import 'tailwindcss'` (it would duplicate the reset):
142
+ The published tarball rewrites `exports` to **`dist`**, so `@aircall/ds/globals.css` is a **precompiled** Tailwind v4 bundle — Preflight, tokens, and every DS utility class already generated.
143
+
144
+ **DS only, no custom Tailwind classes:**
143
145
 
144
146
  ```tsx
145
147
  // main.tsx
146
148
  import '@aircall/ds/globals.css';
147
149
  ```
148
150
 
149
- Benefits:
151
+ **DS + `@aircall/blocks`:** import only blocks globals — it already bundles all of DS (Preflight, theme tokens, all DS utilities). Importing both duplicates the entire DS compiled output:
152
+
153
+ ```tsx
154
+ // main.tsx
155
+ import '@aircall/blocks/globals.css'; // already includes @aircall/ds/globals.css
156
+ ```
157
+
158
+ **Authoring your own Tailwind utility classes** alongside DS or blocks — use the split import to activate Tailwind for `@source` scanning without adding a second Preflight:
150
159
 
151
- - No need to configure Tailwind to scan `node_modules`
152
- - Smaller bundle size (pre-compiled and minified)
153
- - Faster build times
154
- - Simpler setup
160
+ ```css
161
+ /* style.css */
162
+ /* Required: locks layer order so @layer utilities beats @layer base.
163
+ Without this, Preflight's border-width: 0 / display: block beat utility classes. */
164
+ @layer theme, base, components, utilities;
165
+
166
+ /* Split import — no Preflight. The .css extension is required;
167
+ bare specifiers (tailwindcss/theme) silently produce no output in Rsbuild/webpack. */
168
+ @import 'tailwindcss/theme.css' layer(theme);
169
+ @import 'tailwindcss/utilities.css' layer(utilities);
170
+
171
+ @import '@aircall/ds/globals.css'; /* DS only */
172
+ /* OR: @import '@aircall/blocks/globals.css'; for DS + blocks (don't import both) */
173
+
174
+ @source "./src/**/*.{ts,tsx}"; /* scan YOUR code, not node_modules */
175
+ ```
176
+
177
+ **Module-federation consumer** (your app is a remote inside a host that already loads DS globals — e.g. `dashboard-v4`): do NOT import DS or blocks globals. The host's Preflight covers the whole document; a duplicate from your remote's injected `<style>` tag will break DS component borders.
178
+
179
+ ```css
180
+ /* style.css */
181
+ @layer theme, base, components, utilities;
182
+ @import 'tailwindcss/theme.css' layer(theme);
183
+ @import 'tailwindcss/utilities.css' layer(utilities);
184
+ @source "./**/*.{ts,tsx}";
185
+ ```
155
186
 
156
- If your app authors its **own** Tailwind classes, set Tailwind up for *your* sources separately — the precompiled DS bundle still doesn't require it.
157
187
 
158
188
  ### Dark Mode
159
189