tailwind-styled-v4 5.1.26 → 5.1.28

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 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
@@ -976,12 +976,6 @@ function attachExtend(component, originalTag, base, config) {
976
976
  }
977
977
  });
978
978
  };
979
- component.animate = async (_opts) => {
980
- console.warn(
981
- '[tailwind-styled-v4] .animate() tidak tersedia di main bundle.\nGunakan: import { animate } from "tailwind-styled-v4/animate"'
982
- );
983
- return component;
984
- };
985
979
  component.withSub = (() => component);
986
980
  return component;
987
981
  }
@@ -1127,11 +1121,12 @@ function parseTemplate(strings, exprs) {
1127
1121
  return result;
1128
1122
  }
1129
1123
  function makeTag(tag) {
1130
- return ((stringsOrConfig, ...exprs) => {
1124
+ const impl = ((stringsOrConfig, ...exprs) => {
1131
1125
  if (!Array.isArray(stringsOrConfig) && typeof stringsOrConfig === "object" && stringsOrConfig !== null && !("raw" in stringsOrConfig)) {
1132
1126
  return createComponent(tag, stringsOrConfig);
1133
1127
  }
1134
- const parsed = parseTemplate(stringsOrConfig, exprs);
1128
+ const strings = stringsOrConfig;
1129
+ const parsed = parseTemplate(strings, exprs);
1135
1130
  const component = createComponent(tag, parsed.base);
1136
1131
  if (parsed.hasSubs) {
1137
1132
  for (const [name, classes] of Object.entries(parsed.subs)) {
@@ -1148,6 +1143,7 @@ function makeTag(tag) {
1148
1143
  }
1149
1144
  return component;
1150
1145
  });
1146
+ return impl;
1151
1147
  }
1152
1148
  var HTML_TAGS = [
1153
1149
  "html",