@llui/components 0.0.37 → 0.0.38
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 +23 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -186,9 +186,30 @@ const button = createVariants({
|
|
|
186
186
|
button({ size: 'sm', intent: 'ghost' }) // → class string
|
|
187
187
|
```
|
|
188
188
|
|
|
189
|
-
##
|
|
189
|
+
## Imports
|
|
190
190
|
|
|
191
|
-
|
|
191
|
+
Three forms, in order of preference:
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
// ✓ best — sub-path import. Bypasses the barrel entirely; smallest
|
|
195
|
+
// bundle, fastest cold builds (no parse cost for unused
|
|
196
|
+
// components).
|
|
197
|
+
import { dialog } from '@llui/components/dialog'
|
|
198
|
+
|
|
199
|
+
// ✓ ok — named import from the barrel. Tree-shakeable, but the
|
|
200
|
+
// bundler still has to parse every transitively-exported
|
|
201
|
+
// module before it can prove the unused ones are dead.
|
|
202
|
+
import { dialog } from '@llui/components'
|
|
203
|
+
|
|
204
|
+
// ✗ bad — namespace import. Defeats tree-shaking: drags every
|
|
205
|
+
// component's state machine into the bundle. The
|
|
206
|
+
// @llui/eslint-plugin `llui/namespace-import` rule
|
|
207
|
+
// flags this at error level (autofixable).
|
|
208
|
+
import * as C from '@llui/components'
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Every component ships its own entry point — sub-path is the right default
|
|
212
|
+
for a new file:
|
|
192
213
|
|
|
193
214
|
```typescript
|
|
194
215
|
import { tabs } from '@llui/components/tabs'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@llui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -457,12 +457,12 @@
|
|
|
457
457
|
}
|
|
458
458
|
},
|
|
459
459
|
"peerDependencies": {
|
|
460
|
-
"@llui/dom": "^0.0.
|
|
460
|
+
"@llui/dom": "^0.0.38"
|
|
461
461
|
},
|
|
462
462
|
"devDependencies": {
|
|
463
463
|
"typescript": "^6.0.0",
|
|
464
464
|
"vitest": "^4.1.2",
|
|
465
|
-
"@llui/dom": "0.0.
|
|
465
|
+
"@llui/dom": "0.0.38"
|
|
466
466
|
},
|
|
467
467
|
"sideEffects": [
|
|
468
468
|
"./dist/styles/theme.css",
|