tailwind-styled-v4 5.1.26 → 5.1.27
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/CHANGELOG.md +18 -0
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,24 @@ dan project ini mengikuti [Semantic Versioning](https://semver.org/spec/v2.0.0.h
|
|
|
11
11
|
|
|
12
12
|
All Wave 1-3 features are published to npm and integrated in production (next-js-app example).
|
|
13
13
|
|
|
14
|
+
#### Wave 5.3: TypeScript Props Type Inference Fix (v5.0.18+ ✅ JULY 4, 2026)
|
|
15
|
+
|
|
16
|
+
- **Fixed: `RuntimeProps` Type Now Supports All HTML Attributes (ARIA, data-*, event handlers, etc.)** ✅
|
|
17
|
+
- **Problem:** Passing `role`, `aria-label`, `aria-selected`, `onClick`, `data-*`, and other standard HTML attributes to `tw.*` components resulted in TypeScript errors `Property 'X' does not exist on type...`
|
|
18
|
+
- **Root cause:** `RuntimeProps<TConfig>` was not tag-specific — all `tw.button`, `tw.input`, `tw.div` used identical prop types, ignoring React's built-in tag-specific attribute inference
|
|
19
|
+
- **Solution:** Added `Tag extends React.ElementType` generic parameter to `RuntimeProps`, then use `React.ComponentPropsWithoutRef<TTag>` to dynamically extract all valid props for the actual HTML tag
|
|
20
|
+
```typescript
|
|
21
|
+
// Before: Generic, ignored tag-specific attributes
|
|
22
|
+
type RuntimeProps<TConfig> = InferVariantProps<TConfig> & React.HTMLAttributes<HTMLElement>
|
|
23
|
+
|
|
24
|
+
// After: Tag-specific, includes all native HTML props
|
|
25
|
+
type RuntimeProps<TConfig, TTag extends React.ElementType> =
|
|
26
|
+
InferVariantProps<TConfig> & React.ComponentPropsWithoutRef<TTag>
|
|
27
|
+
```
|
|
28
|
+
- **Impact:** All HTML attributes now work — ARIA attributes, data-attributes, event handlers with correct typings, tag-specific attributes (e.g. `href` on `<a>`, `value` on `<input>`)
|
|
29
|
+
- **Validated:** `npm run build:packages` ✅, `examples/next-js-app tsc --noEmit` ✅, real component usage with ARIA in `aria-dynamic-theme/` example ✅
|
|
30
|
+
- **Reference:** `packages/domain/core/src/createComponent.ts` (lines 219-225), `known-issues.md` (2026-07-04 entry)
|
|
31
|
+
|
|
14
32
|
#### Wave 5.2: Complete Build-Time Magic Documentation (v5.0.17+ ✅ JULY 3, 2026)
|
|
15
33
|
|
|
16
34
|
- **18-Layer Architecture Documentation** - Complete exploration of all magic layers di next-js-app
|