@fluentic/style 0.1.0-beta.5 → 0.1.0-beta.6

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.
Files changed (183) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +105 -31
  3. package/atomic/className.ts +19 -2
  4. package/atomic/utils/hash.ts +1 -65
  5. package/compiler/compiler/compiler.ts +85 -8
  6. package/compiler/cssProp.ts +0 -14
  7. package/compiler/transform/cssProp/plugin.ts +33 -1
  8. package/compiler/transform/evaluator/evaluator.ts +1 -0
  9. package/compiler/transform/extract/chain/chain.ts +120 -11
  10. package/compiler/utils/import_source.ts +17 -7
  11. package/dist/{combine-Ca6LfFxv.js → combine-D0AXSTn-.js} +2 -2
  12. package/dist/{combine-Ca6LfFxv.js.map → combine-D0AXSTn-.js.map} +1 -1
  13. package/dist/compiler/index.mjs +1 -1
  14. package/dist/{compiler-OgDBuqfs.mjs → compiler-CCvRlaq0.mjs} +141 -89
  15. package/dist/compiler-CCvRlaq0.mjs.map +1 -0
  16. package/dist/{config-Barf8f4B.js → config-B-w6rOe0.js} +2 -2
  17. package/dist/{config-Barf8f4B.js.map → config-B-w6rOe0.js.map} +1 -1
  18. package/dist/{config-CsB4MuFI.js → config-B1WtpYar.js} +2 -2
  19. package/dist/{config-CsB4MuFI.js.map → config-B1WtpYar.js.map} +1 -1
  20. package/dist/{config-t76UljYv.js → config-CCMwA9Gm.js} +2 -2
  21. package/dist/{config-t76UljYv.js.map → config-CCMwA9Gm.js.map} +1 -1
  22. package/dist/{createTransformElement-DDqld3RF.js → createTransformElement-PCilcudP.js} +2 -2
  23. package/dist/{createTransformElement-DDqld3RF.js.map → createTransformElement-PCilcudP.js.map} +1 -1
  24. package/dist/{css-a9O5so0b.js → css-DirG7Jwu.js} +41 -7
  25. package/dist/css-DirG7Jwu.js.map +1 -0
  26. package/dist/{css-YfHN_8Nk.js → css-nmclCl2P.js} +8 -8
  27. package/dist/{css-YfHN_8Nk.js.map → css-nmclCl2P.js.map} +1 -1
  28. package/dist/{css-CZwrac6F.js → css-shX7_73D.js} +12 -41
  29. package/dist/css-shX7_73D.js.map +1 -0
  30. package/dist/css.js +1 -1
  31. package/dist/{data-CzHJg147.js → data-DUvixly5.js} +14 -6
  32. package/dist/data-DUvixly5.js.map +1 -0
  33. package/dist/{debug-DkrxyknP.js → debug-DJRCBKhM.js} +2 -2
  34. package/dist/{debug-DkrxyknP.js.map → debug-DJRCBKhM.js.map} +1 -1
  35. package/dist/dev/rsc.js +5 -5
  36. package/dist/{dev-z4laBwlS.js → dev-Cwha8aAp.js} +4 -4
  37. package/dist/{dev-z4laBwlS.js.map → dev-Cwha8aAp.js.map} +1 -1
  38. package/dist/dev.js +1 -1
  39. package/dist/dialect/extracted/index.js +1 -1
  40. package/dist/dialect/index.js +1 -1
  41. package/dist/{elementMarker-CqhU_l_m.js → elementMarker-Cb46vtLU.js} +3 -3
  42. package/dist/{elementMarker-CqhU_l_m.js.map → elementMarker-Cb46vtLU.js.map} +1 -1
  43. package/dist/entry/dev/adapter/preact.js +2 -2
  44. package/dist/entry/dev/adapter/react.js +2 -2
  45. package/dist/entry/dev/adapter/solid.js +2 -2
  46. package/dist/entry/dev/css.js +2 -2
  47. package/dist/entry/dev/jsx-dev-runtime.js +2 -2
  48. package/dist/entry/dev/jsx-runtime.js +2 -2
  49. package/dist/entry/dev.js +8 -8
  50. package/dist/entry/prod/adapter/preact.js +1 -1
  51. package/dist/entry/prod/adapter/react.js +1 -1
  52. package/dist/entry/prod/adapter/solid.js +1 -1
  53. package/dist/entry/prod/css.js +2 -2
  54. package/dist/entry/prod.js +2 -2
  55. package/dist/entry/rsc-dev/adapter/preact.js +5 -4
  56. package/dist/entry/rsc-dev/adapter/preact.js.map +1 -1
  57. package/dist/entry/rsc-dev/adapter/react.js +5 -4
  58. package/dist/entry/rsc-dev/adapter/react.js.map +1 -1
  59. package/dist/entry/rsc-dev/adapter/solid.js +5 -4
  60. package/dist/entry/rsc-dev/adapter/solid.js.map +1 -1
  61. package/dist/entry/rsc-dev/css.js +2 -2
  62. package/dist/entry/rsc-dev/dev.js +5 -6
  63. package/dist/entry/rsc-dev/dev.js.map +1 -1
  64. package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
  65. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  66. package/dist/entry/rsc-dev.js +5 -5
  67. package/dist/entry/rsc-prod/css.js +2 -2
  68. package/dist/entry/rsc-prod.js +2 -2
  69. package/dist/{env-Db2cRt-h.js → env-0Gu2Jh47.js} +2 -39
  70. package/dist/env-0Gu2Jh47.js.map +1 -0
  71. package/dist/{utils-CLnpwhJd.js → getClassName-CHZKhmde.js} +5 -43
  72. package/dist/getClassName-CHZKhmde.js.map +1 -0
  73. package/dist/{getClassName-DaZF5nfJ.js → getClassName-CHd0iCXp.js} +3 -3
  74. package/dist/{getClassName-DaZF5nfJ.js.map → getClassName-CHd0iCXp.js.map} +1 -1
  75. package/dist/global-Dg37z0lV.js +14 -0
  76. package/dist/global-Dg37z0lV.js.map +1 -0
  77. package/dist/{hash-BOlQThNz.js → hash-Cr-LCWDt.js} +2 -40
  78. package/dist/hash-Cr-LCWDt.js.map +1 -0
  79. package/dist/index.js +6 -6
  80. package/dist/jsx/jsx-dev-runtime.js +1 -1
  81. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  82. package/dist/jsx/jsx-runtime.js +1 -1
  83. package/dist/jsx/jsx-runtime.server.js +1 -1
  84. package/dist/{jsx-C2pnWLcb.js → jsx-BMFC8_tA.js} +4 -4
  85. package/dist/{jsx-C2pnWLcb.js.map → jsx-BMFC8_tA.js.map} +1 -1
  86. package/dist/{jsx_runtime-XJSHujgI.js → jsx_runtime-Ch1pZ6-n.js} +2 -2
  87. package/dist/{jsx_runtime-XJSHujgI.js.map → jsx_runtime-Ch1pZ6-n.js.map} +1 -1
  88. package/dist/{loader-DHvgp0fK.mjs → loader-hNaefW-U.mjs} +13 -14
  89. package/dist/loader-hNaefW-U.mjs.map +1 -0
  90. package/dist/{misc-BuSLnvx0.mjs → misc-1OS0aeY1.mjs} +2 -2
  91. package/dist/{misc-BuSLnvx0.mjs.map → misc-1OS0aeY1.mjs.map} +1 -1
  92. package/dist/{namedTokens-D3tt-joz.js → namedTokens-mgRfd9hs.js} +3 -3
  93. package/dist/{namedTokens-D3tt-joz.js.map → namedTokens-mgRfd9hs.js.map} +1 -1
  94. package/dist/plugin/farm/index.mjs +3 -3
  95. package/dist/plugin/nextjs/index.mjs +120 -16
  96. package/dist/plugin/nextjs/index.mjs.map +1 -1
  97. package/dist/plugin/nextjs/loader.mjs +4 -4
  98. package/dist/plugin/parcel/index.cjs +1 -1
  99. package/dist/plugin/parcel/index.mjs +2 -2
  100. package/dist/plugin/parcel/optimizer.cjs +1 -1
  101. package/dist/plugin/parcel/optimizer.mjs +2 -2
  102. package/dist/plugin/parcel/resolver.cjs +1 -1
  103. package/dist/plugin/parcel/resolver.mjs +2 -2
  104. package/dist/plugin/parcel/runtime.cjs +1 -1
  105. package/dist/plugin/parcel/runtime.mjs +1 -1
  106. package/dist/plugin/parcel/transformer.cjs +1 -1
  107. package/dist/plugin/parcel/transformer.mjs +2 -2
  108. package/dist/plugin/rspack/index.mjs +2 -2
  109. package/dist/plugin/vite/index.mjs +3 -3
  110. package/dist/plugin/webpack/index.mjs +2 -2
  111. package/dist/plugin/webpack/loader.mjs +2 -2
  112. package/dist/presets/tailwind/index.js +25 -3
  113. package/dist/presets/tailwind/index.js.map +1 -1
  114. package/dist/{registry-r3BKWqpI.mjs → registry-OA0niXJL.mjs} +2 -2
  115. package/dist/{registry-r3BKWqpI.mjs.map → registry-OA0niXJL.mjs.map} +1 -1
  116. package/dist/{resolveClassNameRuntime-D5a37GNr.js → resolveClassNameRuntime-BKXT1bmR.js} +2 -2
  117. package/dist/{resolveClassNameRuntime-D5a37GNr.js.map → resolveClassNameRuntime-BKXT1bmR.js.map} +1 -1
  118. package/dist/{rules-B0_rKPfB.js → rules-DgcCENkw.js} +5 -5
  119. package/dist/{rules-B0_rKPfB.js.map → rules-DgcCENkw.js.map} +1 -1
  120. package/dist/server.js +10 -10
  121. package/dist/{shared-8_Msr7Q5.cjs → shared-Bc9RwNNj.cjs} +140 -88
  122. package/dist/shared-Bc9RwNNj.cjs.map +1 -0
  123. package/dist/{shared-BGO_05rW.mjs → shared-COiLPdZ1.mjs} +4 -4
  124. package/dist/{shared-BGO_05rW.mjs.map → shared-COiLPdZ1.mjs.map} +1 -1
  125. package/dist/sheet-B87QCFWF.js +7 -0
  126. package/dist/{sheet-BpLZIIuO.js.map → sheet-B87QCFWF.js.map} +1 -1
  127. package/dist/{sidecar-Bu2x35JE.mjs → sidecar-ViZUL9B8.mjs} +3 -3
  128. package/dist/{sidecar-Bu2x35JE.mjs.map → sidecar-ViZUL9B8.mjs.map} +1 -1
  129. package/dist/{styleStore-BDy5TH6N.js → styleStore-BlC8Ax9f.js} +3 -3
  130. package/dist/{styleStore-BDy5TH6N.js.map → styleStore-BlC8Ax9f.js.map} +1 -1
  131. package/dist/{styleStore-DX3z_UVK.js → styleStore-DHzH25A7.js} +2 -2
  132. package/dist/{styleStore-DX3z_UVK.js.map → styleStore-DHzH25A7.js.map} +1 -1
  133. package/dist/{token-BsW_S8fN.js → token-CAQWMtan.js} +2 -2
  134. package/dist/{token-BsW_S8fN.js.map → token-CAQWMtan.js.map} +1 -1
  135. package/dist/{trace-BdKEpgME.js → trace-D3yBmJad.js} +2 -2
  136. package/dist/{trace-BdKEpgME.js.map → trace-D3yBmJad.js.map} +1 -1
  137. package/dist/{trace-DcuMxR45.js → trace-DdXWjgAD.js} +3 -3
  138. package/dist/{trace-DcuMxR45.js.map → trace-DdXWjgAD.js.map} +1 -1
  139. package/dist/{types-BEUgXuu2.js → types-BhdAXX7z.js} +7 -7
  140. package/dist/{types-BEUgXuu2.js.map → types-BhdAXX7z.js.map} +1 -1
  141. package/dist/utils-B6HVRX10.js +42 -0
  142. package/dist/utils-B6HVRX10.js.map +1 -0
  143. package/dist/{utils-BPDxr-oc.mjs → utils-C7UalRKf.mjs} +41 -7
  144. package/dist/utils-C7UalRKf.mjs.map +1 -0
  145. package/dist/{utils-sBVZEq4u.js → utils-Cd4wqN56.js} +2 -39
  146. package/dist/utils-Cd4wqN56.js.map +1 -0
  147. package/dist/{utils-DZjLTV4D.mjs → utils-DjxH0zc7.mjs} +3 -3
  148. package/dist/{utils-DZjLTV4D.mjs.map → utils-DjxH0zc7.mjs.map} +1 -1
  149. package/dist/utils-DxCpyV2E.js +62 -0
  150. package/dist/utils-DxCpyV2E.js.map +1 -0
  151. package/dist/utils.js +2 -2
  152. package/dist/{webpack-DTKgR-HY.mjs → webpack-6et2ZVI6.mjs} +5 -5
  153. package/dist/{webpack-DTKgR-HY.mjs.map → webpack-6et2ZVI6.mjs.map} +1 -1
  154. package/entry/rsc_dev/adapter/preact.ts +9 -1
  155. package/entry/rsc_dev/adapter/react.ts +9 -1
  156. package/entry/rsc_dev/adapter/solid.ts +9 -1
  157. package/package.json +21 -11
  158. package/plugin/bundler/webpack/shared/loader.ts +9 -7
  159. package/plugin/nextjs/plugin.ts +205 -15
  160. package/plugin/nextjs/types.ts +1 -2
  161. package/plugin/nextjs/utils.ts +50 -0
  162. package/presets/tailwind/classname/transform.ts +32 -1
  163. package/runtime/adapter/utils.ts +40 -14
  164. package/dist/compiler-OgDBuqfs.mjs.map +0 -1
  165. package/dist/css-CZwrac6F.js.map +0 -1
  166. package/dist/css-a9O5so0b.js.map +0 -1
  167. package/dist/css_extra-CXXZAylc.js +0 -8
  168. package/dist/css_extra-CXXZAylc.js.map +0 -1
  169. package/dist/data-CzHJg147.js.map +0 -1
  170. package/dist/env-Db2cRt-h.js.map +0 -1
  171. package/dist/getClassName-DKtQl5ZX.js +0 -32
  172. package/dist/getClassName-DKtQl5ZX.js.map +0 -1
  173. package/dist/global-zYTvWskP.js +0 -10
  174. package/dist/global-zYTvWskP.js.map +0 -1
  175. package/dist/hash-BOlQThNz.js.map +0 -1
  176. package/dist/loader-DHvgp0fK.mjs.map +0 -1
  177. package/dist/shared-8_Msr7Q5.cjs.map +0 -1
  178. package/dist/sheet-BpLZIIuO.js +0 -7
  179. package/dist/utils-BPDxr-oc.mjs.map +0 -1
  180. package/dist/utils-CLnpwhJd.js.map +0 -1
  181. package/dist/utils-okFWrQsg.js +0 -41
  182. package/dist/utils-okFWrQsg.js.map +0 -1
  183. package/dist/utils-sBVZEq4u.js.map +0 -1
@@ -1,5 +1,4 @@
1
1
  import type { NextConfig } from 'next';
2
- import type { PHASE_TYPE } from 'next/constants';
3
2
  import type { OmitProps } from '../../utils/type';
4
3
  import type { PluginOptions as BasePluginOptions } from '../utils';
5
4
 
@@ -12,7 +11,7 @@ export type NextConfigContext = {
12
11
  };
13
12
 
14
13
  export type NextConfigFunction = (
15
- phase: PHASE_TYPE,
14
+ phase: string,
16
15
  context: NextConfigContext,
17
16
  ) => MaybePromise<NextConfig>;
18
17
 
@@ -3,8 +3,10 @@ import { createRequire } from 'node:module';
3
3
  import path from 'node:path';
4
4
  import type { Compilation, Compiler, WebpackPluginInstance } from 'webpack';
5
5
  import type { Compiler as PluginCompiler } from '../../compiler';
6
+ import type { ImportSource } from '../../compiler/utils/import_source';
6
7
  import { normalizePath } from '../../compiler/utils/path';
7
8
  import type { BuildConfig, BuildDevConfig } from '../../config/build';
9
+ import { getStyleFnMeta } from '../../style/style';
8
10
  import { createWebpackRegistry } from '../bundler/webpack/shared/registry';
9
11
  import type { FileCssCache } from '../utils/cache';
10
12
  import type { PluginOptions as BasePluginOptions } from '../utils/compiler';
@@ -69,15 +71,63 @@ export function createNextBuildDevConfig(options: PluginOptions): BuildDevConfig
69
71
  export function createNextConfigHash(
70
72
  buildConfig: BuildConfig,
71
73
  dev: boolean,
74
+ importSources?: readonly ImportSource[] | null,
72
75
  ) {
73
76
  const values = [
74
77
  dev ? 'dev' : 'prod',
75
78
  buildConfig.hoist ? 'hoist' : 'no-hoist',
79
+ JSON.stringify(createSerializableImportSources(importSources)),
76
80
  ];
77
81
 
78
82
  return createHash('sha256').update(values.join('\0')).digest('hex');
79
83
  }
80
84
 
85
+ export function createSerializableImportSources(
86
+ importSources: readonly ImportSource[] | null | undefined,
87
+ ): ImportSource[] | undefined {
88
+ if (!importSources?.length) return undefined;
89
+
90
+ const result: ImportSource[] = [];
91
+
92
+ for (const entry of importSources) {
93
+ if (entry.check) continue;
94
+
95
+ const source = serializeImportSourcePattern(entry.source);
96
+ const name = entry.name;
97
+ const meta = entry.meta ?? (entry.styleFn ? getStyleFnMeta(entry.styleFn) : null);
98
+
99
+ if (!meta) continue;
100
+ if (entry.source !== undefined && source === undefined) continue;
101
+
102
+ result.push(removeUndefinedValues({
103
+ source,
104
+ name,
105
+ meta,
106
+ }));
107
+ }
108
+
109
+ return result.length ? result : undefined;
110
+ }
111
+
112
+ function serializeImportSourcePattern(
113
+ source: ImportSource['source'],
114
+ ): string | string[] | undefined {
115
+ if (source === undefined) return undefined;
116
+
117
+ if (Array.isArray(source)) {
118
+ const result: string[] = [];
119
+
120
+ for (const item of source) {
121
+ if (typeof item !== 'string') return undefined;
122
+ result.push(item);
123
+ }
124
+
125
+ return result;
126
+ }
127
+
128
+ return typeof source === 'string' ? source : undefined;
129
+ }
130
+
81
131
  export function resolveNextCompilerOptions(
82
132
  options: PluginOptions,
83
133
  sidecar: SourcemapSidecar | null,
@@ -127,7 +127,7 @@ function classNameToStyle(className: TailwindClassName, theme: TailwindTheme): R
127
127
  if (className.startsWith('w-')) return { w: ref(className, 'w-', [theme.sizes, theme.spacing]) };
128
128
  if (className.startsWith('h-')) return { h: ref(className, 'h-', [theme.sizes, theme.spacing]) };
129
129
  if (className.startsWith('bg-')) return { bg: ref(className, 'bg-', theme.colors) };
130
- if (className.startsWith('text-')) return { text: ref(className, 'text-', [theme.fontSizes, theme.colors]) };
130
+ if (className.startsWith('text-')) return textStyle(className.slice('text-'.length), theme);
131
131
  if (className.startsWith('font-')) return { font: ref(className, 'font-', theme.fontWeights) };
132
132
  if (className.startsWith('leading-')) return { leading: ref(className, 'leading-', theme.lineHeights) };
133
133
  if (className.startsWith('rounded-')) return { rounded: ref(className, 'rounded-', theme.radii) };
@@ -151,6 +151,37 @@ function borderStyle(value: string, theme: TailwindTheme): Record<string, unknow
151
151
  return { borderColor: scaleRef(value, theme.colors) };
152
152
  }
153
153
 
154
+ function textStyle(value: string, theme: TailwindTheme): Record<string, unknown> {
155
+ if (value.startsWith('[') && value.endsWith(']')) {
156
+ const arbitrary = value.slice(1, -1).replace(/_/g, ' ');
157
+ const hinted = parseArbitraryTextHint(arbitrary);
158
+
159
+ if (hinted) return hinted;
160
+ if (isLikelyFontSize(arbitrary)) return { textSize: arbitrary };
161
+
162
+ return { text: arbitrary };
163
+ }
164
+
165
+ return { text: scaleRef(value, [theme.fontSizes, theme.colors]) };
166
+ }
167
+
168
+ function parseArbitraryTextHint(value: string): Record<string, unknown> | null {
169
+ const splitAt = value.indexOf(':');
170
+ if (splitAt < 1) return null;
171
+
172
+ const hint = value.slice(0, splitAt);
173
+ const textValue = value.slice(splitAt + 1);
174
+
175
+ if (hint === 'length' || hint === 'size') return { textSize: textValue };
176
+ if (hint === 'color') return { text: textValue };
177
+
178
+ return null;
179
+ }
180
+
181
+ function isLikelyFontSize(value: string) {
182
+ return /^(?:-?\d*\.?\d+(?:px|r?em|lh|vh|vw|vmin|vmax|%|ch|ex|cap|ic)|(?:calc|clamp|min|max)\()/.test(value);
183
+ }
184
+
154
185
  function scaleRef(value: string, scale?: TailwindScale | (TailwindScale | undefined)[]) {
155
186
  const scales = Array.isArray(scale) ? scale : [scale];
156
187
  const path = value.replace(/-/g, '.');
@@ -7,6 +7,7 @@ export type JsxCssPropMergeOptions = {
7
7
  classProp: 'class' | 'className';
8
8
  styleProp: 'style';
9
9
  styleMode: JsxCssPropStyleMode;
10
+ preserveResultProps?: boolean;
10
11
  };
11
12
 
12
13
  export type JsxCssPropInput = Record<PropertyKey, unknown>;
@@ -22,22 +23,27 @@ export function createMergeJsxProps(
22
23
  ) {
23
24
  return function mergeJsxProps(parts: readonly unknown[]) {
24
25
  let props: JsxCssPropInput | null = null;
26
+ let cssProps: StyleProp[] | null = null;
25
27
 
26
28
  for (let index = 0; index < parts.length; index++) {
27
- props = mergePart(props, parts[index], getClassName, options);
29
+ const result = mergePart(props, parts[index]);
30
+ props = result.props;
31
+
32
+ if (result.css) {
33
+ if (!cssProps) cssProps = [];
34
+ cssProps.push(result.css);
35
+ }
28
36
  }
29
37
 
30
- return props ?? {};
38
+ return mergeCssProps(props ?? {}, cssProps, getClassName, options);
31
39
  };
32
40
  }
33
41
 
34
42
  function mergePart(
35
43
  props: JsxCssPropInput | null,
36
44
  part: unknown,
37
- getClassName: GetClassNameFn,
38
- options: JsxCssPropMergeOptions,
39
45
  ) {
40
- if (!part) return props;
46
+ if (!part) return { css: null, props };
41
47
 
42
48
  const next = props ? { ...props } : {};
43
49
  const attrs = part as JsxCssPropInput;
@@ -47,27 +53,47 @@ function mergePart(
47
53
  if (key !== 'css') next[key] = attrs[key];
48
54
  }
49
55
 
50
- if (!css) return next;
56
+ return {
57
+ css: css ? css as StyleProp : null,
58
+ props: next,
59
+ };
60
+ }
51
61
 
52
- const className = getClassName(css as StyleProp, {
53
- className: getClassValue(next, options.classProp),
54
- style: next[options.styleProp] as ClassNameProps['style'],
62
+ function mergeCssProps(
63
+ props: JsxCssPropInput,
64
+ cssProps: StyleProp[] | null,
65
+ getClassName: GetClassNameFn,
66
+ options: JsxCssPropMergeOptions,
67
+ ) {
68
+ if (!cssProps?.length) return props;
69
+
70
+ const className = getClassName(cssProps.length === 1 ? cssProps[0] : cssProps, {
71
+ className: getClassValue(props, options.classProp),
72
+ style: props[options.styleProp] as ClassNameProps['style'],
55
73
  });
56
74
 
57
- delete next.class;
58
- delete next.className;
75
+ delete props.class;
76
+ delete props.className;
59
77
 
60
78
  if (className.className !== undefined) {
61
- next[options.classProp] = className.className;
79
+ props[options.classProp] = className.className;
62
80
  }
63
81
 
64
82
  if (className.style !== undefined) {
65
- next[options.styleProp] = options.styleMode === 'solid'
83
+ props[options.styleProp] = options.styleMode === 'solid'
66
84
  ? toSolidStyle(className.style as Record<string, unknown>)
67
85
  : className.style;
68
86
  }
69
87
 
70
- return next;
88
+ if (options.preserveResultProps) {
89
+ for (const key in className) {
90
+ if (key === 'className' || key === 'style') continue;
91
+
92
+ props[key] = className[key as keyof ClassNameResult];
93
+ }
94
+ }
95
+
96
+ return props;
71
97
  }
72
98
 
73
99
  function getClassValue(