rnwind 0.0.1 → 0.0.2
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/lib/cjs/core/parser/animation.cjs +427 -0
- package/lib/cjs/core/parser/animation.cjs.map +1 -0
- package/lib/cjs/core/parser/animation.d.ts +126 -0
- package/lib/cjs/core/parser/border-dispatcher.cjs +180 -0
- package/lib/cjs/core/parser/border-dispatcher.cjs.map +1 -0
- package/lib/cjs/core/parser/border-dispatcher.d.ts +15 -0
- package/lib/cjs/core/parser/case-convert.cjs +15 -0
- package/lib/cjs/core/parser/case-convert.cjs.map +1 -0
- package/lib/cjs/core/parser/case-convert.d.ts +6 -0
- package/lib/cjs/core/parser/color-properties-dispatcher.cjs +84 -0
- package/lib/cjs/core/parser/color-properties-dispatcher.cjs.map +1 -0
- package/lib/cjs/core/parser/color-properties-dispatcher.d.ts +19 -0
- package/lib/cjs/core/parser/color.cjs +164 -0
- package/lib/cjs/core/parser/color.cjs.map +1 -0
- package/lib/cjs/core/parser/color.d.ts +12 -0
- package/lib/cjs/core/parser/constants.cjs +21 -0
- package/lib/cjs/core/parser/constants.cjs.map +1 -0
- package/lib/cjs/core/parser/constants.d.ts +8 -0
- package/lib/cjs/core/parser/declaration.cjs +347 -0
- package/lib/cjs/core/parser/declaration.cjs.map +1 -0
- package/lib/cjs/core/parser/declaration.d.ts +15 -0
- package/lib/cjs/core/parser/gradient.cjs +132 -0
- package/lib/cjs/core/parser/gradient.cjs.map +1 -0
- package/lib/cjs/core/parser/gradient.d.ts +59 -0
- package/lib/cjs/core/parser/haptics.cjs +73 -0
- package/lib/cjs/core/parser/haptics.cjs.map +1 -0
- package/lib/cjs/core/parser/haptics.d.ts +47 -0
- package/lib/cjs/core/parser/index.d.ts +8 -0
- package/lib/cjs/core/parser/keyframes.cjs +95 -0
- package/lib/cjs/core/parser/keyframes.cjs.map +1 -0
- package/lib/cjs/core/parser/keyframes.d.ts +26 -0
- package/lib/cjs/core/parser/layout-dispatcher.cjs +100 -0
- package/lib/cjs/core/parser/layout-dispatcher.cjs.map +1 -0
- package/lib/cjs/core/parser/layout-dispatcher.d.ts +14 -0
- package/lib/cjs/core/parser/length.cjs +96 -0
- package/lib/cjs/core/parser/length.cjs.map +1 -0
- package/lib/cjs/core/parser/length.d.ts +48 -0
- package/lib/cjs/core/parser/motion-dispatcher.cjs +77 -0
- package/lib/cjs/core/parser/motion-dispatcher.cjs.map +1 -0
- package/lib/cjs/core/parser/motion-dispatcher.d.ts +11 -0
- package/lib/cjs/core/parser/property.cjs +22 -0
- package/lib/cjs/core/parser/property.cjs.map +1 -0
- package/lib/cjs/core/parser/property.d.ts +8 -0
- package/lib/cjs/core/parser/safe-area.cjs +404 -0
- package/lib/cjs/core/parser/safe-area.cjs.map +1 -0
- package/lib/cjs/core/parser/safe-area.d.ts +39 -0
- package/lib/cjs/core/parser/selector.cjs +22 -0
- package/lib/cjs/core/parser/selector.cjs.map +1 -0
- package/lib/cjs/core/parser/selector.d.ts +11 -0
- package/lib/cjs/core/parser/shorthand.cjs +156 -0
- package/lib/cjs/core/parser/shorthand.cjs.map +1 -0
- package/lib/cjs/core/parser/shorthand.d.ts +61 -0
- package/lib/cjs/core/parser/text-truncate.cjs +78 -0
- package/lib/cjs/core/parser/text-truncate.cjs.map +1 -0
- package/lib/cjs/core/parser/text-truncate.d.ts +44 -0
- package/lib/cjs/core/parser/theme-vars.cjs +414 -0
- package/lib/cjs/core/parser/theme-vars.cjs.map +1 -0
- package/lib/cjs/core/parser/theme-vars.d.ts +61 -0
- package/lib/cjs/core/parser/tokens.cjs +304 -0
- package/lib/cjs/core/parser/tokens.cjs.map +1 -0
- package/lib/cjs/core/parser/tokens.d.ts +45 -0
- package/lib/cjs/core/parser/transform.cjs +198 -0
- package/lib/cjs/core/parser/transform.cjs.map +1 -0
- package/lib/cjs/core/parser/transform.d.ts +36 -0
- package/lib/cjs/core/parser/tw-parser.cjs +1567 -0
- package/lib/cjs/core/parser/tw-parser.cjs.map +1 -0
- package/lib/cjs/core/parser/tw-parser.d.ts +194 -0
- package/lib/cjs/core/parser/types.d.ts +37 -0
- package/lib/cjs/core/parser/typography-dispatcher.cjs +93 -0
- package/lib/cjs/core/parser/typography-dispatcher.cjs.map +1 -0
- package/lib/cjs/core/parser/typography-dispatcher.d.ts +11 -0
- package/lib/cjs/core/parser/typography.cjs +97 -0
- package/lib/cjs/core/parser/typography.cjs.map +1 -0
- package/lib/cjs/core/parser/typography.d.ts +43 -0
- package/lib/cjs/core/style-builder/build-style.cjs +397 -0
- package/lib/cjs/core/style-builder/build-style.cjs.map +1 -0
- package/lib/cjs/core/style-builder/build-style.d.ts +54 -0
- package/lib/cjs/core/style-builder/index.d.ts +3 -0
- package/lib/cjs/core/style-builder/union-builder.cjs +326 -0
- package/lib/cjs/core/style-builder/union-builder.cjs.map +1 -0
- package/lib/cjs/core/style-builder/union-builder.d.ts +128 -0
- package/lib/cjs/core/types.d.ts +14 -0
- package/lib/cjs/metro/dts.cjs +127 -0
- package/lib/cjs/metro/dts.cjs.map +1 -0
- package/lib/cjs/metro/dts.d.ts +16 -0
- package/lib/cjs/metro/index.cjs +19 -0
- package/lib/cjs/metro/index.cjs.map +1 -0
- package/lib/cjs/metro/index.d.ts +9 -0
- package/lib/cjs/metro/resolver.cjs +47 -0
- package/lib/cjs/metro/resolver.cjs.map +1 -0
- package/lib/cjs/metro/resolver.d.ts +22 -0
- package/lib/cjs/metro/state.cjs +251 -0
- package/lib/cjs/metro/state.cjs.map +1 -0
- package/lib/cjs/metro/state.d.ts +72 -0
- package/lib/cjs/metro/transform-ast.cjs +1255 -0
- package/lib/cjs/metro/transform-ast.cjs.map +1 -0
- package/lib/cjs/metro/transform-ast.d.ts +73 -0
- package/lib/cjs/metro/transformer.cjs +345 -0
- package/lib/cjs/metro/transformer.cjs.map +1 -0
- package/lib/cjs/metro/transformer.d.ts +47 -0
- package/lib/cjs/metro/warn-unknown-classes.cjs +86 -0
- package/lib/cjs/metro/warn-unknown-classes.cjs.map +1 -0
- package/lib/cjs/metro/warn-unknown-classes.d.ts +21 -0
- package/lib/cjs/metro/with-config.cjs +196 -0
- package/lib/cjs/metro/with-config.cjs.map +1 -0
- package/lib/cjs/metro/with-config.d.ts +57 -0
- package/lib/cjs/runtime/chain-handlers.cjs +37 -0
- package/lib/cjs/runtime/chain-handlers.cjs.map +1 -0
- package/lib/cjs/runtime/chain-handlers.d.ts +33 -0
- package/lib/cjs/runtime/components/rnwind-provider.cjs +98 -0
- package/lib/cjs/runtime/components/rnwind-provider.cjs.map +1 -0
- package/lib/cjs/runtime/components/rnwind-provider.d.ts +84 -0
- package/lib/cjs/runtime/gradient-types.d.ts +58 -0
- package/lib/cjs/runtime/haptics.cjs +113 -0
- package/lib/cjs/runtime/haptics.cjs.map +1 -0
- package/lib/cjs/runtime/haptics.d.ts +48 -0
- package/lib/cjs/runtime/hooks/use-css.cjs +21 -0
- package/lib/cjs/runtime/hooks/use-css.cjs.map +1 -0
- package/lib/cjs/runtime/hooks/use-css.d.ts +11 -0
- package/lib/cjs/runtime/hooks/use-interact.cjs +46 -0
- package/lib/cjs/runtime/hooks/use-interact.cjs.map +1 -0
- package/lib/cjs/runtime/hooks/use-interact.d.ts +42 -0
- package/lib/cjs/runtime/hooks/use-scheme.cjs +68 -0
- package/lib/cjs/runtime/hooks/use-scheme.cjs.map +1 -0
- package/lib/cjs/runtime/hooks/use-scheme.d.ts +34 -0
- package/lib/cjs/runtime/index.cjs +45 -0
- package/lib/cjs/runtime/index.cjs.map +1 -0
- package/lib/cjs/runtime/index.d.ts +27 -0
- package/lib/cjs/runtime/interactive-box.cjs +35 -0
- package/lib/cjs/runtime/interactive-box.cjs.map +1 -0
- package/lib/cjs/runtime/interactive-box.d.ts +40 -0
- package/lib/cjs/runtime/lookup-css.cjs +542 -0
- package/lib/cjs/runtime/lookup-css.cjs.map +1 -0
- package/lib/cjs/runtime/lookup-css.d.ts +164 -0
- package/lib/cjs/runtime/types.d.ts +29 -0
- package/lib/cjs/testing/index.cjs +367 -0
- package/lib/cjs/testing/index.cjs.map +1 -0
- package/lib/cjs/testing/index.d.ts +145 -0
- package/lib/esm/core/parser/animation.d.ts +126 -0
- package/lib/esm/core/parser/animation.mjs +408 -0
- package/lib/esm/core/parser/animation.mjs.map +1 -0
- package/lib/esm/core/parser/border-dispatcher.d.ts +15 -0
- package/lib/esm/core/parser/border-dispatcher.mjs +178 -0
- package/lib/esm/core/parser/border-dispatcher.mjs.map +1 -0
- package/lib/esm/core/parser/case-convert.d.ts +6 -0
- package/lib/esm/core/parser/case-convert.mjs +13 -0
- package/lib/esm/core/parser/case-convert.mjs.map +1 -0
- package/lib/esm/core/parser/color-properties-dispatcher.d.ts +19 -0
- package/lib/esm/core/parser/color-properties-dispatcher.mjs +82 -0
- package/lib/esm/core/parser/color-properties-dispatcher.mjs.map +1 -0
- package/lib/esm/core/parser/color.d.ts +12 -0
- package/lib/esm/core/parser/color.mjs +162 -0
- package/lib/esm/core/parser/color.mjs.map +1 -0
- package/lib/esm/core/parser/constants.d.ts +8 -0
- package/lib/esm/core/parser/constants.mjs +13 -0
- package/lib/esm/core/parser/constants.mjs.map +1 -0
- package/lib/esm/core/parser/declaration.d.ts +15 -0
- package/lib/esm/core/parser/declaration.mjs +345 -0
- package/lib/esm/core/parser/declaration.mjs.map +1 -0
- package/lib/esm/core/parser/gradient.d.ts +59 -0
- package/lib/esm/core/parser/gradient.mjs +130 -0
- package/lib/esm/core/parser/gradient.mjs.map +1 -0
- package/lib/esm/core/parser/haptics.d.ts +47 -0
- package/lib/esm/core/parser/haptics.mjs +71 -0
- package/lib/esm/core/parser/haptics.mjs.map +1 -0
- package/lib/esm/core/parser/index.d.ts +8 -0
- package/lib/esm/core/parser/keyframes.d.ts +26 -0
- package/lib/esm/core/parser/keyframes.mjs +91 -0
- package/lib/esm/core/parser/keyframes.mjs.map +1 -0
- package/lib/esm/core/parser/layout-dispatcher.d.ts +14 -0
- package/lib/esm/core/parser/layout-dispatcher.mjs +98 -0
- package/lib/esm/core/parser/layout-dispatcher.mjs.map +1 -0
- package/lib/esm/core/parser/length.d.ts +48 -0
- package/lib/esm/core/parser/length.mjs +90 -0
- package/lib/esm/core/parser/length.mjs.map +1 -0
- package/lib/esm/core/parser/motion-dispatcher.d.ts +11 -0
- package/lib/esm/core/parser/motion-dispatcher.mjs +75 -0
- package/lib/esm/core/parser/motion-dispatcher.mjs.map +1 -0
- package/lib/esm/core/parser/property.d.ts +8 -0
- package/lib/esm/core/parser/property.mjs +20 -0
- package/lib/esm/core/parser/property.mjs.map +1 -0
- package/lib/esm/core/parser/safe-area.d.ts +39 -0
- package/lib/esm/core/parser/safe-area.mjs +402 -0
- package/lib/esm/core/parser/safe-area.mjs.map +1 -0
- package/lib/esm/core/parser/selector.d.ts +11 -0
- package/lib/esm/core/parser/selector.mjs +20 -0
- package/lib/esm/core/parser/selector.mjs.map +1 -0
- package/lib/esm/core/parser/shorthand.d.ts +61 -0
- package/lib/esm/core/parser/shorthand.mjs +148 -0
- package/lib/esm/core/parser/shorthand.mjs.map +1 -0
- package/lib/esm/core/parser/text-truncate.d.ts +44 -0
- package/lib/esm/core/parser/text-truncate.mjs +75 -0
- package/lib/esm/core/parser/text-truncate.mjs.map +1 -0
- package/lib/esm/core/parser/theme-vars.d.ts +61 -0
- package/lib/esm/core/parser/theme-vars.mjs +409 -0
- package/lib/esm/core/parser/theme-vars.mjs.map +1 -0
- package/lib/esm/core/parser/tokens.d.ts +45 -0
- package/lib/esm/core/parser/tokens.mjs +298 -0
- package/lib/esm/core/parser/tokens.mjs.map +1 -0
- package/lib/esm/core/parser/transform.d.ts +36 -0
- package/lib/esm/core/parser/transform.mjs +193 -0
- package/lib/esm/core/parser/transform.mjs.map +1 -0
- package/lib/esm/core/parser/tw-parser.d.ts +194 -0
- package/lib/esm/core/parser/tw-parser.mjs +1565 -0
- package/lib/esm/core/parser/tw-parser.mjs.map +1 -0
- package/lib/esm/core/parser/types.d.ts +37 -0
- package/lib/esm/core/parser/typography-dispatcher.d.ts +11 -0
- package/lib/esm/core/parser/typography-dispatcher.mjs +91 -0
- package/lib/esm/core/parser/typography-dispatcher.mjs.map +1 -0
- package/lib/esm/core/parser/typography.d.ts +43 -0
- package/lib/esm/core/parser/typography.mjs +91 -0
- package/lib/esm/core/parser/typography.mjs.map +1 -0
- package/lib/esm/core/style-builder/build-style.d.ts +54 -0
- package/lib/esm/core/style-builder/build-style.mjs +395 -0
- package/lib/esm/core/style-builder/build-style.mjs.map +1 -0
- package/lib/esm/core/style-builder/index.d.ts +3 -0
- package/lib/esm/core/style-builder/union-builder.d.ts +128 -0
- package/lib/esm/core/style-builder/union-builder.mjs +324 -0
- package/lib/esm/core/style-builder/union-builder.mjs.map +1 -0
- package/lib/esm/core/types.d.ts +14 -0
- package/lib/esm/metro/dts.d.ts +16 -0
- package/lib/esm/metro/dts.mjs +125 -0
- package/lib/esm/metro/dts.mjs.map +1 -0
- package/lib/esm/metro/index.d.ts +9 -0
- package/lib/esm/metro/index.mjs +6 -0
- package/lib/esm/metro/index.mjs.map +1 -0
- package/lib/esm/metro/resolver.d.ts +22 -0
- package/lib/esm/metro/resolver.mjs +43 -0
- package/lib/esm/metro/resolver.mjs.map +1 -0
- package/lib/esm/metro/state.d.ts +72 -0
- package/lib/esm/metro/state.mjs +243 -0
- package/lib/esm/metro/state.mjs.map +1 -0
- package/lib/esm/metro/transform-ast.d.ts +73 -0
- package/lib/esm/metro/transform-ast.mjs +1234 -0
- package/lib/esm/metro/transform-ast.mjs.map +1 -0
- package/lib/esm/metro/transformer.d.ts +47 -0
- package/lib/esm/metro/transformer.mjs +322 -0
- package/lib/esm/metro/transformer.mjs.map +1 -0
- package/lib/esm/metro/warn-unknown-classes.d.ts +21 -0
- package/lib/esm/metro/warn-unknown-classes.mjs +84 -0
- package/lib/esm/metro/warn-unknown-classes.mjs.map +1 -0
- package/lib/esm/metro/with-config.d.ts +57 -0
- package/lib/esm/metro/with-config.mjs +194 -0
- package/lib/esm/metro/with-config.mjs.map +1 -0
- package/lib/esm/runtime/chain-handlers.d.ts +33 -0
- package/lib/esm/runtime/chain-handlers.mjs +34 -0
- package/lib/esm/runtime/chain-handlers.mjs.map +1 -0
- package/lib/esm/runtime/components/rnwind-provider.d.ts +84 -0
- package/lib/esm/runtime/components/rnwind-provider.mjs +94 -0
- package/lib/esm/runtime/components/rnwind-provider.mjs.map +1 -0
- package/lib/esm/runtime/gradient-types.d.ts +58 -0
- package/lib/esm/runtime/haptics.d.ts +48 -0
- package/lib/esm/runtime/haptics.mjs +110 -0
- package/lib/esm/runtime/haptics.mjs.map +1 -0
- package/lib/esm/runtime/hooks/use-css.d.ts +11 -0
- package/lib/esm/runtime/hooks/use-css.mjs +19 -0
- package/lib/esm/runtime/hooks/use-css.mjs.map +1 -0
- package/lib/esm/runtime/hooks/use-interact.d.ts +42 -0
- package/lib/esm/runtime/hooks/use-interact.mjs +44 -0
- package/lib/esm/runtime/hooks/use-interact.mjs.map +1 -0
- package/lib/esm/runtime/hooks/use-scheme.d.ts +34 -0
- package/lib/esm/runtime/hooks/use-scheme.mjs +63 -0
- package/lib/esm/runtime/hooks/use-scheme.mjs.map +1 -0
- package/lib/esm/runtime/index.d.ts +27 -0
- package/lib/esm/runtime/index.mjs +18 -0
- package/lib/esm/runtime/index.mjs.map +1 -0
- package/lib/esm/runtime/interactive-box.d.ts +40 -0
- package/lib/esm/runtime/interactive-box.mjs +33 -0
- package/lib/esm/runtime/interactive-box.mjs.map +1 -0
- package/lib/esm/runtime/lookup-css.d.ts +164 -0
- package/lib/esm/runtime/lookup-css.mjs +531 -0
- package/lib/esm/runtime/lookup-css.mjs.map +1 -0
- package/lib/esm/runtime/types.d.ts +29 -0
- package/lib/esm/testing/index.d.ts +145 -0
- package/lib/esm/testing/index.mjs +344 -0
- package/lib/esm/testing/index.mjs.map +1 -0
- package/package.json +79 -13
- package/preset.css +1171 -0
- package/src/core/parser/animation.ts +404 -0
- package/src/core/parser/border-dispatcher.ts +176 -0
- package/src/core/parser/case-convert.ts +10 -0
- package/src/core/parser/color-properties-dispatcher.ts +78 -0
- package/src/core/parser/color.ts +157 -0
- package/src/core/parser/constants.ts +11 -0
- package/src/core/parser/declaration.ts +340 -0
- package/src/core/parser/gradient.ts +148 -0
- package/src/core/parser/haptics.ts +88 -0
- package/src/core/parser/index.ts +8 -0
- package/src/core/parser/keyframes.ts +84 -0
- package/src/core/parser/layout-dispatcher.ts +92 -0
- package/src/core/parser/length.ts +100 -0
- package/src/core/parser/motion-dispatcher.ts +89 -0
- package/src/core/parser/property.ts +15 -0
- package/src/core/parser/safe-area.ts +404 -0
- package/src/core/parser/selector.ts +17 -0
- package/src/core/parser/shorthand.ts +152 -0
- package/src/core/parser/text-truncate.ts +79 -0
- package/src/core/parser/theme-vars.ts +412 -0
- package/src/core/parser/tokens.ts +286 -0
- package/src/core/parser/transform.ts +195 -0
- package/src/core/parser/tw-parser.ts +1709 -0
- package/src/core/parser/types.ts +45 -0
- package/src/core/parser/typography-dispatcher.ts +83 -0
- package/src/core/parser/typography.ts +83 -0
- package/src/core/style-builder/build-style.ts +442 -0
- package/src/core/style-builder/index.ts +3 -0
- package/src/core/style-builder/union-builder.ts +328 -0
- package/src/core/types.ts +15 -0
- package/src/metro/dts.ts +128 -0
- package/src/metro/index.ts +9 -0
- package/src/metro/resolver.ts +42 -0
- package/src/metro/state.ts +257 -0
- package/src/metro/transform-ast.ts +1498 -0
- package/src/metro/transformer.ts +347 -0
- package/src/metro/warn-unknown-classes.ts +79 -0
- package/src/metro/with-config.ts +229 -0
- package/src/runtime/chain-handlers.ts +47 -0
- package/src/runtime/components/rnwind-provider.tsx +144 -0
- package/src/runtime/gradient-types.ts +60 -0
- package/src/runtime/haptics.ts +120 -0
- package/src/runtime/hooks/use-css.ts +16 -0
- package/src/runtime/hooks/use-interact.ts +65 -0
- package/src/runtime/hooks/use-scheme.ts +63 -0
- package/src/runtime/index.ts +54 -0
- package/src/runtime/interactive-box.tsx +57 -0
- package/src/runtime/lookup-css.ts +628 -0
- package/src/runtime/types.ts +32 -0
- package/src/testing/index.ts +507 -0
- package/src/types/tailwindcss-node.d.ts +33 -0
- package/src/index.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","sources":["../../../../../src/core/parser/constants.ts"],"sourcesContent":["/** 1 rem = 16 px — matches the CSS default so unit-bare Tailwind spacing stays predictable. */\nexport const REM_TO_PX = 16\n\n// Hot-path regexes hoisted to module scope so they're compiled once per\n// process; an inline literal would recompile on every declaration.\nexport const BARE_NUMBER_REGEX = /^-?\\d+(?:\\.\\d+)?$/\nexport const LENGTH_PX_REGEX = /^(-?\\d+(?:\\.\\d+)?)px$/\nexport const LENGTH_REM_REGEX = /^(-?\\d+(?:\\.\\d+)?)rem$/\nexport const CALC_RATIO_REGEX = /^calc\\(\\s*(-?\\d+(?:\\.\\d+)?)\\s*\\/\\s*(-?\\d+(?:\\.\\d+)?)\\s*\\)$/\nexport const CALC_MUL_REGEX = /^calc\\(\\s*(-?\\d+(?:\\.\\d+)?)(?:px|rem)?\\s*\\*\\s*(-?\\d+(?:\\.\\d+)?)\\s*\\)$/\nexport const KEBAB_BOUNDARY_REGEX = /-([a-z])/g\n"],"names":[],"mappings":"AAAA;AACO,MAAM,SAAS,GAAG;AAEzB;AACA;AACO,MAAM,iBAAiB,GAAG;AAC1B,MAAM,eAAe,GAAG;AACxB,MAAM,gBAAgB,GAAG;AACzB,MAAM,gBAAgB,GAAG;AACzB,MAAM,cAAc,GAAG;AACvB,MAAM,oBAAoB,GAAG;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Declaration as LcDeclaration } from 'lightningcss';
|
|
2
|
+
import type { RNEntry } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Convert one lightningcss `Declaration` into zero-or-more RN style
|
|
5
|
+
* entries. Shorthand declarations (padding/margin/border-radius/flex) can
|
|
6
|
+
* emit multiple entries; skipped or unsupported properties emit none.
|
|
7
|
+
*
|
|
8
|
+
* The switch branches on `decl.property` so TypeScript narrows
|
|
9
|
+
* `decl.value` to the exact typed shape for each branch — no casts
|
|
10
|
+
* required. Unknown properties fall through to `[]`.
|
|
11
|
+
* @param decl One declaration from a lightningcss style rule.
|
|
12
|
+
* @param themeVars Optional lookup table for resolving `var(--x)` references inside unparsed values.
|
|
13
|
+
* @returns Array of `[key, value]` entries.
|
|
14
|
+
*/
|
|
15
|
+
export declare function declarationToRnEntries(decl: LcDeclaration, themeVars?: ReadonlyMap<string, string>): readonly RNEntry[];
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { kebabToCamel } from './case-convert.mjs';
|
|
2
|
+
import { cssColorToString } from './color.mjs';
|
|
3
|
+
import { lengthPercentageOrAutoToValue, dimensionPercentageToNumber, gapValueToValue, sizeLikeToValue } from './length.mjs';
|
|
4
|
+
import { flexToEntries, expandBorderRadius, expandLogicalBlock, expandLogicalInline, expandFourSided, expandGap, expandBorderColor } from './shorthand.mjs';
|
|
5
|
+
import { serializeTokens, substituteThemeVars, coerceUnparsedValue } from './tokens.mjs';
|
|
6
|
+
import { fontWeightToValue, fontSizeToPx, displayToEntries, zIndexToNumber } from './typography.mjs';
|
|
7
|
+
import { dispatchMotionDeclaration } from './motion-dispatcher.mjs';
|
|
8
|
+
import { dispatchTypographyDeclaration } from './typography-dispatcher.mjs';
|
|
9
|
+
import { dispatchLayoutDeclaration } from './layout-dispatcher.mjs';
|
|
10
|
+
import { dispatchColorPropertyDeclaration } from './color-properties-dispatcher.mjs';
|
|
11
|
+
import { dispatchBorderDeclaration } from './border-dispatcher.mjs';
|
|
12
|
+
import { detectSafeAreaMarker } from './safe-area.mjs';
|
|
13
|
+
|
|
14
|
+
/** CSS timing-function properties that need `cubic-bezier(...)` snapping. */
|
|
15
|
+
const TIMING_FUNCTION_PROPS = new Set(['transition-timing-function', 'animation-timing-function']);
|
|
16
|
+
/** CSS easing keywords Reanimated v4's CSS engine accepts as strings. */
|
|
17
|
+
const CSS_EASING_KEYWORDS = new Set(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'step-start', 'step-end']);
|
|
18
|
+
/** CSS properties with no useful RN equivalent — silently dropped. */
|
|
19
|
+
const UNSUPPORTED_LOGICAL_PROPS = new Set([
|
|
20
|
+
'border-inline-style',
|
|
21
|
+
'border-block-style',
|
|
22
|
+
'border-inline-start-style',
|
|
23
|
+
'border-inline-end-style',
|
|
24
|
+
'border-block-start-style',
|
|
25
|
+
'border-block-end-style',
|
|
26
|
+
]);
|
|
27
|
+
/**
|
|
28
|
+
* Pick the closest predefined CSS easing keyword for a `cubic-bezier`
|
|
29
|
+
* control-point set. Mirrors {@link snapCubicBezierToKeyword} in
|
|
30
|
+
* `animation.ts` — kept here so the unparsed-string path doesn't need
|
|
31
|
+
* to import a typed-only helper.
|
|
32
|
+
* @param x1 First control-point x (0–1).
|
|
33
|
+
* @param y1 First control-point y (0–1).
|
|
34
|
+
* @param x2 Second control-point x (0–1).
|
|
35
|
+
* @param y2 Second control-point y (0–1).
|
|
36
|
+
* @returns CSS easing keyword.
|
|
37
|
+
*/
|
|
38
|
+
function snapBezier(x1, y1, x2, y2) {
|
|
39
|
+
const tol = 0.01;
|
|
40
|
+
const eq = (a, b) => Math.abs(a - b) < tol;
|
|
41
|
+
if (eq(x1, 0) && eq(y1, 0) && eq(x2, 1) && eq(y2, 1))
|
|
42
|
+
return 'linear';
|
|
43
|
+
if (eq(x1, 0.25) && eq(y1, 0.1) && eq(x2, 0.25) && eq(y2, 1))
|
|
44
|
+
return 'ease';
|
|
45
|
+
if (eq(x1, 0.4) && eq(y1, 0) && eq(x2, 1) && eq(y2, 1))
|
|
46
|
+
return 'ease-in';
|
|
47
|
+
if (eq(x1, 0) && eq(y1, 0) && eq(x2, 0.2) && eq(y2, 1))
|
|
48
|
+
return 'ease-out';
|
|
49
|
+
if (eq(x1, 0.4) && eq(y1, 0) && eq(x2, 0.2) && eq(y2, 1))
|
|
50
|
+
return 'ease-in-out';
|
|
51
|
+
const startsFlat = x1 < 0.1;
|
|
52
|
+
const endsFlat = x2 > 0.9;
|
|
53
|
+
if (startsFlat && !endsFlat)
|
|
54
|
+
return 'ease-out';
|
|
55
|
+
if (!startsFlat && endsFlat)
|
|
56
|
+
return 'ease-in';
|
|
57
|
+
return 'ease-in-out';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Snap a cubic-bezier expression string to the closest CSS keyword
|
|
61
|
+
* Reanimated v4's CSS engine accepts. Strings that already are keywords
|
|
62
|
+
* pass through unchanged.
|
|
63
|
+
* @param value Resolved value text from an unparsed timing-function declaration.
|
|
64
|
+
* @returns CSS easing keyword.
|
|
65
|
+
*/
|
|
66
|
+
function coerceCubicBezierString(value) {
|
|
67
|
+
const text = value.trim();
|
|
68
|
+
if (CSS_EASING_KEYWORDS.has(text))
|
|
69
|
+
return text;
|
|
70
|
+
const match = /^cubic-bezier\(\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*,\s*([\d.-]+)\s*\)$/.exec(text);
|
|
71
|
+
if (!match)
|
|
72
|
+
return 'ease-in-out';
|
|
73
|
+
const [, x1, y1, x2, y2] = match;
|
|
74
|
+
return snapBezier(Number(x1), Number(y1), Number(x2), Number(y2));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Fast-path check for the handful of color property names Tailwind emits.
|
|
78
|
+
* @param property Kebab-case CSS property name.
|
|
79
|
+
* @returns Whether the property's value should be treated as a color.
|
|
80
|
+
*/
|
|
81
|
+
function isColorProperty(property) {
|
|
82
|
+
return (property === 'color' ||
|
|
83
|
+
property === 'background-color' ||
|
|
84
|
+
(property.startsWith('border-') && property.endsWith('-color')) ||
|
|
85
|
+
property.endsWith('-color'));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convert an unparsed declaration (typical Tailwind v4 output containing
|
|
89
|
+
* `var()` / `calc()`) into RN entries. Serializes the token list, then
|
|
90
|
+
* coerces the flat string into a number / keyword / length via a tight
|
|
91
|
+
* set of shapes Tailwind actually emits.
|
|
92
|
+
* @param property Real property name (kebab-case).
|
|
93
|
+
* @param tokens Token list from lightningcss.
|
|
94
|
+
* @param themeVars Optional lookup table for resolving `var(--x)` references.
|
|
95
|
+
* @returns RN entries — usually one, empty when unusable.
|
|
96
|
+
*/
|
|
97
|
+
function unparsedToEntries(property, tokens, themeVars) {
|
|
98
|
+
if (property.length === 0)
|
|
99
|
+
return [];
|
|
100
|
+
// Safe-area detection runs BEFORE token serialization because
|
|
101
|
+
// `env()` serializes to an empty string, which would strip the side
|
|
102
|
+
// info we need. If the tokens encode a recognised `env(safe-area-inset-*)`
|
|
103
|
+
// pattern (pure / `max(..., n)` / `calc(...+n)` / `h-screen-safe`),
|
|
104
|
+
// emit a runtime-resolved marker instead.
|
|
105
|
+
if (UNSUPPORTED_LOGICAL_PROPS.has(property))
|
|
106
|
+
return [];
|
|
107
|
+
const safe = detectSafeAreaMarker(tokens, themeVars);
|
|
108
|
+
if (safe !== null)
|
|
109
|
+
return [[kebabToCamel(property), safe]];
|
|
110
|
+
let text = serializeTokens(tokens);
|
|
111
|
+
if (themeVars && themeVars.size > 0)
|
|
112
|
+
text = substituteThemeVars(text, themeVars);
|
|
113
|
+
const coerced = coerceUnparsedValue(text);
|
|
114
|
+
if (coerced === null)
|
|
115
|
+
return [];
|
|
116
|
+
// Skip values that didn't resolve past their `var()` wrapper — they
|
|
117
|
+
// came from a `@property --tw-*` token without a real fallback.
|
|
118
|
+
// Tailwind v4's `border-N` emits `border-style: var(--tw-border-style)`
|
|
119
|
+
// expecting the cascade to fill it in; in RN we drop them and rely on
|
|
120
|
+
// RN's default (solid).
|
|
121
|
+
if (typeof coerced === 'string' && coerced.startsWith('var('))
|
|
122
|
+
return [];
|
|
123
|
+
// Logical-direction CSS properties RN doesn't have direct equivalents
|
|
124
|
+
// for. Keep the dropped names in one place so it's easy to audit.
|
|
125
|
+
if (UNSUPPORTED_LOGICAL_PROPS.has(property))
|
|
126
|
+
return [];
|
|
127
|
+
if (TIMING_FUNCTION_PROPS.has(property) && typeof coerced === 'string') {
|
|
128
|
+
// `transition-colors` and similar emit `var(--tw-ease, cubic-bezier(...))`
|
|
129
|
+
// which serializes to a cubic-bezier STRING after substitution.
|
|
130
|
+
// Reanimated v4's CSS engine rejects those — snap to the closest
|
|
131
|
+
// predefined keyword (same logic as the typed `EasingFunction` path).
|
|
132
|
+
return [[kebabToCamel(property), coerceCubicBezierString(coerced)]];
|
|
133
|
+
}
|
|
134
|
+
if (isColorProperty(property) && typeof coerced === 'string') {
|
|
135
|
+
// Resolved user-theme color strings (e.g. `#ff0099`) go straight to
|
|
136
|
+
// the RN style — no further conversion needed.
|
|
137
|
+
return [[kebabToCamel(property), coerced]];
|
|
138
|
+
}
|
|
139
|
+
return [[kebabToCamel(property), coerced]];
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Convert one lightningcss `Declaration` into zero-or-more RN style
|
|
143
|
+
* entries. Shorthand declarations (padding/margin/border-radius/flex) can
|
|
144
|
+
* emit multiple entries; skipped or unsupported properties emit none.
|
|
145
|
+
*
|
|
146
|
+
* The switch branches on `decl.property` so TypeScript narrows
|
|
147
|
+
* `decl.value` to the exact typed shape for each branch — no casts
|
|
148
|
+
* required. Unknown properties fall through to `[]`.
|
|
149
|
+
* @param decl One declaration from a lightningcss style rule.
|
|
150
|
+
* @param themeVars Optional lookup table for resolving `var(--x)` references inside unparsed values.
|
|
151
|
+
* @returns Array of `[key, value]` entries.
|
|
152
|
+
*/
|
|
153
|
+
function declarationToRnEntries(decl, themeVars) {
|
|
154
|
+
switch (decl.property) {
|
|
155
|
+
case 'custom': {
|
|
156
|
+
// Lightningcss routes two shapes through `custom`:
|
|
157
|
+
// - Actual CSS custom properties (`--my-var`): no RN meaning, drop.
|
|
158
|
+
// - Real properties it doesn't have a dedicated typed entry for
|
|
159
|
+
// (e.g. `object-fit`, `pointer-events`, future CSS keyword-only
|
|
160
|
+
// props): treat like an unparsed declaration so the keyword
|
|
161
|
+
// surfaces in the RN style.
|
|
162
|
+
const customName = decl.value.name;
|
|
163
|
+
if (customName.startsWith('--'))
|
|
164
|
+
return [];
|
|
165
|
+
return unparsedToEntries(customName, decl.value.value ?? [], themeVars);
|
|
166
|
+
}
|
|
167
|
+
case 'unparsed': {
|
|
168
|
+
return unparsedToEntries(decl.value.propertyId.property, decl.value.value, themeVars);
|
|
169
|
+
}
|
|
170
|
+
case 'color':
|
|
171
|
+
case 'background-color':
|
|
172
|
+
case 'border-top-color':
|
|
173
|
+
case 'border-right-color':
|
|
174
|
+
case 'border-bottom-color':
|
|
175
|
+
case 'border-left-color': {
|
|
176
|
+
// `background-color` narrows to `CssColor | 'background'` — the
|
|
177
|
+
// literal keyword means UA default. Skip the keyword.
|
|
178
|
+
if (typeof decl.value === 'string')
|
|
179
|
+
return [];
|
|
180
|
+
return [[kebabToCamel(decl.property), cssColorToString(decl.value)]];
|
|
181
|
+
}
|
|
182
|
+
case 'border-color': {
|
|
183
|
+
return expandBorderColor(decl.value);
|
|
184
|
+
}
|
|
185
|
+
case 'opacity': {
|
|
186
|
+
// Lightningcss hands us an `f32` for opacity, so values like `0.8`
|
|
187
|
+
// round-trip as `0.800000011920929`. Snap to 4 decimals to match the
|
|
188
|
+
// rest of the parser's numeric convention.
|
|
189
|
+
return [[decl.property, Math.round(decl.value * 10_000) / 10_000]];
|
|
190
|
+
}
|
|
191
|
+
case 'z-index': {
|
|
192
|
+
return [['zIndex', zIndexToNumber(decl.value)]];
|
|
193
|
+
}
|
|
194
|
+
case 'top':
|
|
195
|
+
case 'right':
|
|
196
|
+
case 'bottom':
|
|
197
|
+
case 'left': {
|
|
198
|
+
const v = lengthPercentageOrAutoToValue(decl.value);
|
|
199
|
+
if (v === null)
|
|
200
|
+
return [];
|
|
201
|
+
return [[decl.property, v]];
|
|
202
|
+
}
|
|
203
|
+
case 'inset': {
|
|
204
|
+
const top = lengthPercentageOrAutoToValue(decl.value.top);
|
|
205
|
+
const right = lengthPercentageOrAutoToValue(decl.value.right);
|
|
206
|
+
const bottom = lengthPercentageOrAutoToValue(decl.value.bottom);
|
|
207
|
+
const left = lengthPercentageOrAutoToValue(decl.value.left);
|
|
208
|
+
if (top === null || right === null || bottom === null || left === null)
|
|
209
|
+
return [];
|
|
210
|
+
return [
|
|
211
|
+
['top', top],
|
|
212
|
+
['right', right],
|
|
213
|
+
['bottom', bottom],
|
|
214
|
+
['left', left],
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
case 'inset-inline': {
|
|
218
|
+
const start = lengthPercentageOrAutoToValue(decl.value.inlineStart);
|
|
219
|
+
const end = lengthPercentageOrAutoToValue(decl.value.inlineEnd);
|
|
220
|
+
if (start === null || end === null)
|
|
221
|
+
return [];
|
|
222
|
+
return [
|
|
223
|
+
['left', start],
|
|
224
|
+
['right', end],
|
|
225
|
+
];
|
|
226
|
+
}
|
|
227
|
+
case 'inset-block': {
|
|
228
|
+
const start = lengthPercentageOrAutoToValue(decl.value.blockStart);
|
|
229
|
+
const end = lengthPercentageOrAutoToValue(decl.value.blockEnd);
|
|
230
|
+
if (start === null || end === null)
|
|
231
|
+
return [];
|
|
232
|
+
return [
|
|
233
|
+
['top', start],
|
|
234
|
+
['bottom', end],
|
|
235
|
+
];
|
|
236
|
+
}
|
|
237
|
+
case 'width':
|
|
238
|
+
case 'height':
|
|
239
|
+
case 'min-width':
|
|
240
|
+
case 'min-height':
|
|
241
|
+
case 'max-width':
|
|
242
|
+
case 'max-height': {
|
|
243
|
+
const v = sizeLikeToValue(decl.value);
|
|
244
|
+
if (v === null)
|
|
245
|
+
return [];
|
|
246
|
+
return [[kebabToCamel(decl.property), v]];
|
|
247
|
+
}
|
|
248
|
+
case 'gap': {
|
|
249
|
+
return expandGap(decl.value);
|
|
250
|
+
}
|
|
251
|
+
case 'row-gap':
|
|
252
|
+
case 'column-gap': {
|
|
253
|
+
const v = gapValueToValue(decl.value);
|
|
254
|
+
if (v === null)
|
|
255
|
+
return [];
|
|
256
|
+
return [[kebabToCamel(decl.property), v]];
|
|
257
|
+
}
|
|
258
|
+
case 'font-style': {
|
|
259
|
+
return [['fontStyle', decl.value.type]];
|
|
260
|
+
}
|
|
261
|
+
case 'display': {
|
|
262
|
+
return displayToEntries(decl.value);
|
|
263
|
+
}
|
|
264
|
+
case 'position': {
|
|
265
|
+
return [['position', decl.value.type]];
|
|
266
|
+
}
|
|
267
|
+
case 'font-size': {
|
|
268
|
+
const px = fontSizeToPx(decl.value);
|
|
269
|
+
if (px === null)
|
|
270
|
+
return [];
|
|
271
|
+
return [['fontSize', px]];
|
|
272
|
+
}
|
|
273
|
+
case 'font-weight': {
|
|
274
|
+
return [['fontWeight', fontWeightToValue(decl.value)]];
|
|
275
|
+
}
|
|
276
|
+
case 'padding': {
|
|
277
|
+
return expandFourSided('padding', decl.value);
|
|
278
|
+
}
|
|
279
|
+
case 'margin': {
|
|
280
|
+
return expandFourSided('margin', decl.value);
|
|
281
|
+
}
|
|
282
|
+
case 'padding-inline': {
|
|
283
|
+
return expandLogicalInline('padding', decl.value);
|
|
284
|
+
}
|
|
285
|
+
case 'padding-block': {
|
|
286
|
+
return expandLogicalBlock('padding', decl.value);
|
|
287
|
+
}
|
|
288
|
+
case 'margin-inline': {
|
|
289
|
+
return expandLogicalInline('margin', decl.value);
|
|
290
|
+
}
|
|
291
|
+
case 'margin-block': {
|
|
292
|
+
return expandLogicalBlock('margin', decl.value);
|
|
293
|
+
}
|
|
294
|
+
case 'padding-top':
|
|
295
|
+
case 'padding-right':
|
|
296
|
+
case 'padding-bottom':
|
|
297
|
+
case 'padding-left':
|
|
298
|
+
case 'margin-top':
|
|
299
|
+
case 'margin-right':
|
|
300
|
+
case 'margin-bottom':
|
|
301
|
+
case 'margin-left': {
|
|
302
|
+
const v = lengthPercentageOrAutoToValue(decl.value);
|
|
303
|
+
if (v === null)
|
|
304
|
+
return [];
|
|
305
|
+
return [[kebabToCamel(decl.property), v]];
|
|
306
|
+
}
|
|
307
|
+
case 'border-radius': {
|
|
308
|
+
return expandBorderRadius(decl.value);
|
|
309
|
+
}
|
|
310
|
+
case 'border-top-left-radius':
|
|
311
|
+
case 'border-top-right-radius':
|
|
312
|
+
case 'border-bottom-left-radius':
|
|
313
|
+
case 'border-bottom-right-radius': {
|
|
314
|
+
const [xAxis] = decl.value;
|
|
315
|
+
const v = dimensionPercentageToNumber(xAxis);
|
|
316
|
+
if (v === null)
|
|
317
|
+
return [];
|
|
318
|
+
return [[kebabToCamel(decl.property), v]];
|
|
319
|
+
}
|
|
320
|
+
case 'flex': {
|
|
321
|
+
return flexToEntries(decl.value);
|
|
322
|
+
}
|
|
323
|
+
case 'flex-grow':
|
|
324
|
+
case 'flex-shrink': {
|
|
325
|
+
return [[kebabToCamel(decl.property), decl.value]];
|
|
326
|
+
}
|
|
327
|
+
case 'flex-basis': {
|
|
328
|
+
const v = lengthPercentageOrAutoToValue(decl.value);
|
|
329
|
+
if (v === null)
|
|
330
|
+
return [];
|
|
331
|
+
return [['flexBasis', v]];
|
|
332
|
+
}
|
|
333
|
+
default: {
|
|
334
|
+
return (dispatchLayoutDeclaration(decl) ??
|
|
335
|
+
dispatchTypographyDeclaration(decl) ??
|
|
336
|
+
dispatchColorPropertyDeclaration(decl) ??
|
|
337
|
+
dispatchBorderDeclaration(decl) ??
|
|
338
|
+
dispatchMotionDeclaration(decl) ??
|
|
339
|
+
[]);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export { declarationToRnEntries };
|
|
345
|
+
//# sourceMappingURL=declaration.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration.mjs","sources":["../../../../../src/core/parser/declaration.ts"],"sourcesContent":["/* eslint-disable sonarjs/cognitive-complexity -- the main Declaration → RN-entries dispatcher is intentionally a flat switch so each branch keeps its narrowed value type */\nimport type { Declaration as LcDeclaration, TokenOrValue } from 'lightningcss'\nimport { kebabToCamel } from './case-convert'\nimport { cssColorToString } from './color'\nimport { dimensionPercentageToNumber, gapValueToValue, lengthPercentageOrAutoToValue, sizeLikeToValue } from './length'\nimport {\n expandBorderColor,\n expandBorderRadius,\n expandFourSided,\n expandGap,\n expandLogicalBlock,\n expandLogicalInline,\n flexToEntries,\n} from './shorthand'\nimport { coerceUnparsedValue, serializeTokens, substituteThemeVars } from './tokens'\nimport { displayToEntries, fontSizeToPx, fontWeightToValue, zIndexToNumber } from './typography'\nimport { dispatchMotionDeclaration } from './motion-dispatcher'\nimport { dispatchTypographyDeclaration } from './typography-dispatcher'\nimport { dispatchLayoutDeclaration } from './layout-dispatcher'\nimport { dispatchColorPropertyDeclaration } from './color-properties-dispatcher'\nimport { dispatchBorderDeclaration } from './border-dispatcher'\nimport { detectSafeAreaMarker } from './safe-area'\nimport type { RNEntry } from './types'\n\n/** CSS timing-function properties that need `cubic-bezier(...)` snapping. */\nconst TIMING_FUNCTION_PROPS = new Set(['transition-timing-function', 'animation-timing-function'])\n\n/** CSS easing keywords Reanimated v4's CSS engine accepts as strings. */\nconst CSS_EASING_KEYWORDS = new Set(['linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out', 'step-start', 'step-end'])\n\n/** CSS properties with no useful RN equivalent — silently dropped. */\nconst UNSUPPORTED_LOGICAL_PROPS = new Set([\n 'border-inline-style',\n 'border-block-style',\n 'border-inline-start-style',\n 'border-inline-end-style',\n 'border-block-start-style',\n 'border-block-end-style',\n])\n\n/**\n * Pick the closest predefined CSS easing keyword for a `cubic-bezier`\n * control-point set. Mirrors {@link snapCubicBezierToKeyword} in\n * `animation.ts` — kept here so the unparsed-string path doesn't need\n * to import a typed-only helper.\n * @param x1 First control-point x (0–1).\n * @param y1 First control-point y (0–1).\n * @param x2 Second control-point x (0–1).\n * @param y2 Second control-point y (0–1).\n * @returns CSS easing keyword.\n */\nfunction snapBezier(x1: number, y1: number, x2: number, y2: number): string {\n const tol = 0.01\n const eq = (a: number, b: number): boolean => Math.abs(a - b) < tol\n if (eq(x1, 0) && eq(y1, 0) && eq(x2, 1) && eq(y2, 1)) return 'linear'\n if (eq(x1, 0.25) && eq(y1, 0.1) && eq(x2, 0.25) && eq(y2, 1)) return 'ease'\n if (eq(x1, 0.4) && eq(y1, 0) && eq(x2, 1) && eq(y2, 1)) return 'ease-in'\n if (eq(x1, 0) && eq(y1, 0) && eq(x2, 0.2) && eq(y2, 1)) return 'ease-out'\n if (eq(x1, 0.4) && eq(y1, 0) && eq(x2, 0.2) && eq(y2, 1)) return 'ease-in-out'\n const startsFlat = x1 < 0.1\n const endsFlat = x2 > 0.9\n if (startsFlat && !endsFlat) return 'ease-out'\n if (!startsFlat && endsFlat) return 'ease-in'\n return 'ease-in-out'\n}\n\n/**\n * Snap a cubic-bezier expression string to the closest CSS keyword\n * Reanimated v4's CSS engine accepts. Strings that already are keywords\n * pass through unchanged.\n * @param value Resolved value text from an unparsed timing-function declaration.\n * @returns CSS easing keyword.\n */\nfunction coerceCubicBezierString(value: string): string {\n const text = value.trim()\n if (CSS_EASING_KEYWORDS.has(text)) return text\n const match = /^cubic-bezier\\(\\s*([\\d.-]+)\\s*,\\s*([\\d.-]+)\\s*,\\s*([\\d.-]+)\\s*,\\s*([\\d.-]+)\\s*\\)$/.exec(text)\n if (!match) return 'ease-in-out'\n const [, x1, y1, x2, y2] = match\n return snapBezier(Number(x1), Number(y1), Number(x2), Number(y2))\n}\n\n/**\n * Fast-path check for the handful of color property names Tailwind emits.\n * @param property Kebab-case CSS property name.\n * @returns Whether the property's value should be treated as a color.\n */\nfunction isColorProperty(property: string): boolean {\n return (\n property === 'color' ||\n property === 'background-color' ||\n (property.startsWith('border-') && property.endsWith('-color')) ||\n property.endsWith('-color')\n )\n}\n\n/**\n * Convert an unparsed declaration (typical Tailwind v4 output containing\n * `var()` / `calc()`) into RN entries. Serializes the token list, then\n * coerces the flat string into a number / keyword / length via a tight\n * set of shapes Tailwind actually emits.\n * @param property Real property name (kebab-case).\n * @param tokens Token list from lightningcss.\n * @param themeVars Optional lookup table for resolving `var(--x)` references.\n * @returns RN entries — usually one, empty when unusable.\n */\nfunction unparsedToEntries(\n property: string,\n tokens: readonly TokenOrValue[],\n themeVars: ReadonlyMap<string, string> | undefined,\n): readonly RNEntry[] {\n if (property.length === 0) return []\n // Safe-area detection runs BEFORE token serialization because\n // `env()` serializes to an empty string, which would strip the side\n // info we need. If the tokens encode a recognised `env(safe-area-inset-*)`\n // pattern (pure / `max(..., n)` / `calc(...+n)` / `h-screen-safe`),\n // emit a runtime-resolved marker instead.\n if (UNSUPPORTED_LOGICAL_PROPS.has(property)) return []\n const safe = detectSafeAreaMarker(tokens, themeVars)\n if (safe !== null) return [[kebabToCamel(property), safe]]\n let text = serializeTokens(tokens)\n if (themeVars && themeVars.size > 0) text = substituteThemeVars(text, themeVars)\n const coerced = coerceUnparsedValue(text)\n if (coerced === null) return []\n // Skip values that didn't resolve past their `var()` wrapper — they\n // came from a `@property --tw-*` token without a real fallback.\n // Tailwind v4's `border-N` emits `border-style: var(--tw-border-style)`\n // expecting the cascade to fill it in; in RN we drop them and rely on\n // RN's default (solid).\n if (typeof coerced === 'string' && coerced.startsWith('var(')) return []\n // Logical-direction CSS properties RN doesn't have direct equivalents\n // for. Keep the dropped names in one place so it's easy to audit.\n if (UNSUPPORTED_LOGICAL_PROPS.has(property)) return []\n if (TIMING_FUNCTION_PROPS.has(property) && typeof coerced === 'string') {\n // `transition-colors` and similar emit `var(--tw-ease, cubic-bezier(...))`\n // which serializes to a cubic-bezier STRING after substitution.\n // Reanimated v4's CSS engine rejects those — snap to the closest\n // predefined keyword (same logic as the typed `EasingFunction` path).\n return [[kebabToCamel(property), coerceCubicBezierString(coerced)]]\n }\n if (isColorProperty(property) && typeof coerced === 'string') {\n // Resolved user-theme color strings (e.g. `#ff0099`) go straight to\n // the RN style — no further conversion needed.\n return [[kebabToCamel(property), coerced]]\n }\n return [[kebabToCamel(property), coerced]]\n}\n\n/**\n * Convert one lightningcss `Declaration` into zero-or-more RN style\n * entries. Shorthand declarations (padding/margin/border-radius/flex) can\n * emit multiple entries; skipped or unsupported properties emit none.\n *\n * The switch branches on `decl.property` so TypeScript narrows\n * `decl.value` to the exact typed shape for each branch — no casts\n * required. Unknown properties fall through to `[]`.\n * @param decl One declaration from a lightningcss style rule.\n * @param themeVars Optional lookup table for resolving `var(--x)` references inside unparsed values.\n * @returns Array of `[key, value]` entries.\n */\nexport function declarationToRnEntries(decl: LcDeclaration, themeVars?: ReadonlyMap<string, string>): readonly RNEntry[] {\n switch (decl.property) {\n case 'custom': {\n // Lightningcss routes two shapes through `custom`:\n // - Actual CSS custom properties (`--my-var`): no RN meaning, drop.\n // - Real properties it doesn't have a dedicated typed entry for\n // (e.g. `object-fit`, `pointer-events`, future CSS keyword-only\n // props): treat like an unparsed declaration so the keyword\n // surfaces in the RN style.\n const customName = decl.value.name\n if (customName.startsWith('--')) return []\n return unparsedToEntries(customName, decl.value.value ?? [], themeVars)\n }\n case 'unparsed': {\n return unparsedToEntries(decl.value.propertyId.property, decl.value.value, themeVars)\n }\n case 'color':\n case 'background-color':\n case 'border-top-color':\n case 'border-right-color':\n case 'border-bottom-color':\n case 'border-left-color': {\n // `background-color` narrows to `CssColor | 'background'` — the\n // literal keyword means UA default. Skip the keyword.\n if (typeof decl.value === 'string') return []\n return [[kebabToCamel(decl.property), cssColorToString(decl.value)]]\n }\n case 'border-color': {\n return expandBorderColor(decl.value)\n }\n case 'opacity': {\n // Lightningcss hands us an `f32` for opacity, so values like `0.8`\n // round-trip as `0.800000011920929`. Snap to 4 decimals to match the\n // rest of the parser's numeric convention.\n return [[decl.property, Math.round(decl.value * 10_000) / 10_000]]\n }\n case 'z-index': {\n return [['zIndex', zIndexToNumber(decl.value)]]\n }\n case 'top':\n case 'right':\n case 'bottom':\n case 'left': {\n const v = lengthPercentageOrAutoToValue(decl.value)\n if (v === null) return []\n return [[decl.property, v]]\n }\n case 'inset': {\n const top = lengthPercentageOrAutoToValue(decl.value.top)\n const right = lengthPercentageOrAutoToValue(decl.value.right)\n const bottom = lengthPercentageOrAutoToValue(decl.value.bottom)\n const left = lengthPercentageOrAutoToValue(decl.value.left)\n if (top === null || right === null || bottom === null || left === null) return []\n return [\n ['top', top],\n ['right', right],\n ['bottom', bottom],\n ['left', left],\n ]\n }\n case 'inset-inline': {\n const start = lengthPercentageOrAutoToValue(decl.value.inlineStart)\n const end = lengthPercentageOrAutoToValue(decl.value.inlineEnd)\n if (start === null || end === null) return []\n return [\n ['left', start],\n ['right', end],\n ]\n }\n case 'inset-block': {\n const start = lengthPercentageOrAutoToValue(decl.value.blockStart)\n const end = lengthPercentageOrAutoToValue(decl.value.blockEnd)\n if (start === null || end === null) return []\n return [\n ['top', start],\n ['bottom', end],\n ]\n }\n case 'width':\n case 'height':\n case 'min-width':\n case 'min-height':\n case 'max-width':\n case 'max-height': {\n const v = sizeLikeToValue(decl.value)\n if (v === null) return []\n return [[kebabToCamel(decl.property), v]]\n }\n case 'gap': {\n return expandGap(decl.value)\n }\n case 'row-gap':\n case 'column-gap': {\n const v = gapValueToValue(decl.value)\n if (v === null) return []\n return [[kebabToCamel(decl.property), v]]\n }\n case 'font-style': {\n return [['fontStyle', decl.value.type]]\n }\n case 'display': {\n return displayToEntries(decl.value)\n }\n case 'position': {\n return [['position', decl.value.type]]\n }\n case 'font-size': {\n const px = fontSizeToPx(decl.value)\n if (px === null) return []\n return [['fontSize', px]]\n }\n case 'font-weight': {\n return [['fontWeight', fontWeightToValue(decl.value)]]\n }\n case 'padding': {\n return expandFourSided('padding', decl.value)\n }\n case 'margin': {\n return expandFourSided('margin', decl.value)\n }\n case 'padding-inline': {\n return expandLogicalInline('padding', decl.value)\n }\n case 'padding-block': {\n return expandLogicalBlock('padding', decl.value)\n }\n case 'margin-inline': {\n return expandLogicalInline('margin', decl.value)\n }\n case 'margin-block': {\n return expandLogicalBlock('margin', decl.value)\n }\n case 'padding-top':\n case 'padding-right':\n case 'padding-bottom':\n case 'padding-left':\n case 'margin-top':\n case 'margin-right':\n case 'margin-bottom':\n case 'margin-left': {\n const v = lengthPercentageOrAutoToValue(decl.value)\n if (v === null) return []\n return [[kebabToCamel(decl.property), v]]\n }\n case 'border-radius': {\n return expandBorderRadius(decl.value)\n }\n case 'border-top-left-radius':\n case 'border-top-right-radius':\n case 'border-bottom-left-radius':\n case 'border-bottom-right-radius': {\n const [xAxis] = decl.value\n const v = dimensionPercentageToNumber(xAxis)\n if (v === null) return []\n return [[kebabToCamel(decl.property), v]]\n }\n case 'flex': {\n return flexToEntries(decl.value)\n }\n case 'flex-grow':\n case 'flex-shrink': {\n return [[kebabToCamel(decl.property), decl.value]]\n }\n case 'flex-basis': {\n const v = lengthPercentageOrAutoToValue(decl.value)\n if (v === null) return []\n return [['flexBasis', v]]\n }\n default: {\n return (\n dispatchLayoutDeclaration(decl) ??\n dispatchTypographyDeclaration(decl) ??\n dispatchColorPropertyDeclaration(decl) ??\n dispatchBorderDeclaration(decl) ??\n dispatchMotionDeclaration(decl) ??\n []\n )\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAwBA;AACA,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC,CAAC,4BAA4B,EAAE,2BAA2B,CAAC,CAAC;AAElG;AACA,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAEvH;AACA,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IACxC,qBAAqB;IACrB,oBAAoB;IACpB,2BAA2B;IAC3B,yBAAyB;IACzB,0BAA0B;IAC1B,wBAAwB;AACzB,CAAA,CAAC;AAEF;;;;;;;;;;AAUG;AACH,SAAS,UAAU,CAAC,EAAU,EAAE,EAAU,EAAE,EAAU,EAAE,EAAU,EAAA;IAChE,MAAM,GAAG,GAAG,IAAI;AAChB,IAAA,MAAM,EAAE,GAAG,CAAC,CAAS,EAAE,CAAS,KAAc,IAA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|
1
|
+
/**
|
|
2
|
+
* Gradient-atom extractor.
|
|
3
|
+
*
|
|
4
|
+
* Tailwind v4's gradient system is encoded as a set of CSS custom
|
|
5
|
+
* properties Tailwind writes onto specific utility class rules:
|
|
6
|
+
*
|
|
7
|
+
* .from-red-500 → `--tw-gradient-from: #ef4444`
|
|
8
|
+
* .via-green-500 → `--tw-gradient-via: #22c55e`
|
|
9
|
+
* .to-blue-500 → `--tw-gradient-to: #3b82f6`
|
|
10
|
+
* .bg-gradient-to-r → `--tw-gradient-position: to right`
|
|
11
|
+
* .bg-linear-to-br → `--tw-gradient-position: to bottom right`
|
|
12
|
+
*
|
|
13
|
+
* None of these set properties React Native can render (`backgroundImage:
|
|
14
|
+
* linear-gradient(...)` is web-only). Instead, rnwind treats them as
|
|
15
|
+
* **metadata**: the transformer strips gradient atoms from the JSX
|
|
16
|
+
* site's className and emits `colors={[...]} start={...} end={...}`
|
|
17
|
+
* props on the original component (user supplies `<LinearGradient>`
|
|
18
|
+
* from `expo-linear-gradient` or similar).
|
|
19
|
+
*
|
|
20
|
+
* This module walks a lightningcss declaration list, notices the
|
|
21
|
+
* `--tw-gradient-*` writes, and surfaces them as a compact
|
|
22
|
+
* {@link GradientAtomInfo} record the transformer can read per atom.
|
|
23
|
+
*/
|
|
24
|
+
import type { Declaration as LcDeclaration } from 'lightningcss';
|
|
25
|
+
/**
|
|
26
|
+
* The four roles an atom can play in a Tailwind v4 gradient. `from`,
|
|
27
|
+
* `via`, `to` carry a color. `direction` carries one of the 8 stock
|
|
28
|
+
* points (or a bare angle when Tailwind v4's `bg-linear-[angle]`
|
|
29
|
+
* syntax is used).
|
|
30
|
+
*/
|
|
31
|
+
export type GradientAtomInfo = {
|
|
32
|
+
readonly role: 'from';
|
|
33
|
+
readonly color: string;
|
|
34
|
+
} | {
|
|
35
|
+
readonly role: 'via';
|
|
36
|
+
readonly color: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly role: 'to';
|
|
39
|
+
readonly color: string;
|
|
40
|
+
} | {
|
|
41
|
+
readonly role: 'direction';
|
|
42
|
+
readonly dir: GradientDirection;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Eight stock corner directions Tailwind v4 ships. The transformer
|
|
46
|
+
* maps each to a `(start, end)` pair of unit-square points the
|
|
47
|
+
* expo-linear-gradient API expects. Unknown directions are surfaced as
|
|
48
|
+
* `'unknown'` so the transformer can skip them gracefully.
|
|
49
|
+
*/
|
|
50
|
+
export type GradientDirection = 'to-r' | 'to-l' | 'to-t' | 'to-b' | 'to-tr' | 'to-tl' | 'to-br' | 'to-bl' | 'unknown';
|
|
51
|
+
/**
|
|
52
|
+
* Inspect a rule's declaration list for `--tw-gradient-*` writes and
|
|
53
|
+
* return the atom's role + data. Returns `null` for rules that don't
|
|
54
|
+
* belong to a gradient utility.
|
|
55
|
+
* @param declarations Declarations from one lightningcss style rule.
|
|
56
|
+
* @returns Gradient info, or null.
|
|
57
|
+
*/
|
|
58
|
+
declare function detectGradientAtom(declarations: readonly LcDeclaration[]): GradientAtomInfo | null;
|
|
59
|
+
export { detectGradientAtom };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { cssColorToString } from './color.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gradient-atom extractor.
|
|
5
|
+
*
|
|
6
|
+
* Tailwind v4's gradient system is encoded as a set of CSS custom
|
|
7
|
+
* properties Tailwind writes onto specific utility class rules:
|
|
8
|
+
*
|
|
9
|
+
* .from-red-500 → `--tw-gradient-from: #ef4444`
|
|
10
|
+
* .via-green-500 → `--tw-gradient-via: #22c55e`
|
|
11
|
+
* .to-blue-500 → `--tw-gradient-to: #3b82f6`
|
|
12
|
+
* .bg-gradient-to-r → `--tw-gradient-position: to right`
|
|
13
|
+
* .bg-linear-to-br → `--tw-gradient-position: to bottom right`
|
|
14
|
+
*
|
|
15
|
+
* None of these set properties React Native can render (`backgroundImage:
|
|
16
|
+
* linear-gradient(...)` is web-only). Instead, rnwind treats them as
|
|
17
|
+
* **metadata**: the transformer strips gradient atoms from the JSX
|
|
18
|
+
* site's className and emits `colors={[...]} start={...} end={...}`
|
|
19
|
+
* props on the original component (user supplies `<LinearGradient>`
|
|
20
|
+
* from `expo-linear-gradient` or similar).
|
|
21
|
+
*
|
|
22
|
+
* This module walks a lightningcss declaration list, notices the
|
|
23
|
+
* `--tw-gradient-*` writes, and surfaces them as a compact
|
|
24
|
+
* {@link GradientAtomInfo} record the transformer can read per atom.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* Inspect a rule's declaration list for `--tw-gradient-*` writes and
|
|
28
|
+
* return the atom's role + data. Returns `null` for rules that don't
|
|
29
|
+
* belong to a gradient utility.
|
|
30
|
+
* @param declarations Declarations from one lightningcss style rule.
|
|
31
|
+
* @returns Gradient info, or null.
|
|
32
|
+
*/
|
|
33
|
+
function detectGradientAtom(declarations) {
|
|
34
|
+
for (const decl of declarations) {
|
|
35
|
+
if (decl.property !== 'custom')
|
|
36
|
+
continue;
|
|
37
|
+
const custom = decl.value;
|
|
38
|
+
const name = typeof custom.name === 'string' ? custom.name : custom.name.name;
|
|
39
|
+
if (!name.startsWith('--tw-gradient-'))
|
|
40
|
+
continue;
|
|
41
|
+
if (name === '--tw-gradient-from')
|
|
42
|
+
return fromColor('from', custom.value);
|
|
43
|
+
if (name === '--tw-gradient-via')
|
|
44
|
+
return fromColor('via', custom.value);
|
|
45
|
+
if (name === '--tw-gradient-to')
|
|
46
|
+
return fromColor('to', custom.value);
|
|
47
|
+
if (name === '--tw-gradient-position')
|
|
48
|
+
return fromDirection(custom.value);
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Extract a single color token from a custom-property value list and
|
|
54
|
+
* return the `{role, color}` record. Returns `null` when no color token
|
|
55
|
+
* is present (defensive — Tailwind always emits one, but future output
|
|
56
|
+
* shapes may not).
|
|
57
|
+
* @param role Target role (`from` / `via` / `to`).
|
|
58
|
+
* @param tokens Value tokens from the `--tw-gradient-*` declaration.
|
|
59
|
+
* @returns Gradient info, or null.
|
|
60
|
+
*/
|
|
61
|
+
function fromColor(role, tokens) {
|
|
62
|
+
if (!tokens)
|
|
63
|
+
return null;
|
|
64
|
+
for (const token of tokens) {
|
|
65
|
+
if (token.type !== 'color')
|
|
66
|
+
continue;
|
|
67
|
+
const color = cssColorToString(token.value);
|
|
68
|
+
if (!color)
|
|
69
|
+
return null;
|
|
70
|
+
return { role, color };
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Interpret a `--tw-gradient-position` value list as a direction tag.
|
|
76
|
+
* Tailwind emits plain idents (`to`, `right`, `bottom`, …) for the
|
|
77
|
+
* 8 stock corners.
|
|
78
|
+
* @param tokens Value tokens from `--tw-gradient-position`.
|
|
79
|
+
* @returns Direction record, or null when unrecognised.
|
|
80
|
+
*/
|
|
81
|
+
function fromDirection(tokens) {
|
|
82
|
+
if (!tokens)
|
|
83
|
+
return null;
|
|
84
|
+
const idents = [];
|
|
85
|
+
for (const token of tokens) {
|
|
86
|
+
if (token.type !== 'token')
|
|
87
|
+
continue;
|
|
88
|
+
if (token.value.type === 'ident')
|
|
89
|
+
idents.push(token.value.value);
|
|
90
|
+
}
|
|
91
|
+
const dir = directionFromIdents(idents);
|
|
92
|
+
if (!dir)
|
|
93
|
+
return null;
|
|
94
|
+
return { role: 'direction', dir };
|
|
95
|
+
}
|
|
96
|
+
/** Table of Tailwind-space direction idents → compact rnwind tag. */
|
|
97
|
+
const DIRECTION_TABLE = {
|
|
98
|
+
right: 'to-r',
|
|
99
|
+
left: 'to-l',
|
|
100
|
+
top: 'to-t',
|
|
101
|
+
bottom: 'to-b',
|
|
102
|
+
'top-right': 'to-tr',
|
|
103
|
+
'top-left': 'to-tl',
|
|
104
|
+
'bottom-right': 'to-br',
|
|
105
|
+
'bottom-left': 'to-bl',
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Collapse the ident list Tailwind emits (`['to', 'right']`,
|
|
109
|
+
* `['to', 'bottom', 'right']`, etc.) into the compact tag the
|
|
110
|
+
* transformer hoists.
|
|
111
|
+
* @param idents Ident tokens from the declaration value.
|
|
112
|
+
* @returns One of the eight stock directions, `'unknown'`, or null.
|
|
113
|
+
*/
|
|
114
|
+
function directionFromIdents(idents) {
|
|
115
|
+
if (idents.length === 0)
|
|
116
|
+
return null;
|
|
117
|
+
if (idents[0] !== 'to')
|
|
118
|
+
return 'unknown';
|
|
119
|
+
// Tailwind v4 appends `in <colourspace>` for colour interpolation
|
|
120
|
+
// (`to right in oklab`). Strip everything from the `in` keyword on
|
|
121
|
+
// — it's irrelevant for the point mapping.
|
|
122
|
+
const inIndex = idents.indexOf('in');
|
|
123
|
+
const rest = idents.slice(1, inIndex === -1 ? idents.length : inIndex);
|
|
124
|
+
if (rest.length === 0 || rest.length > 2)
|
|
125
|
+
return 'unknown';
|
|
126
|
+
return DIRECTION_TABLE[rest.join('-')] ?? 'unknown';
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { detectGradientAtom };
|
|
130
|
+
//# sourceMappingURL=gradient.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradient.mjs","sources":["../../../../../src/core/parser/gradient.ts"],"sourcesContent":["/**\n * Gradient-atom extractor.\n *\n * Tailwind v4's gradient system is encoded as a set of CSS custom\n * properties Tailwind writes onto specific utility class rules:\n *\n * .from-red-500 → `--tw-gradient-from: #ef4444`\n * .via-green-500 → `--tw-gradient-via: #22c55e`\n * .to-blue-500 → `--tw-gradient-to: #3b82f6`\n * .bg-gradient-to-r → `--tw-gradient-position: to right`\n * .bg-linear-to-br → `--tw-gradient-position: to bottom right`\n *\n * None of these set properties React Native can render (`backgroundImage:\n * linear-gradient(...)` is web-only). Instead, rnwind treats them as\n * **metadata**: the transformer strips gradient atoms from the JSX\n * site's className and emits `colors={[...]} start={...} end={...}`\n * props on the original component (user supplies `<LinearGradient>`\n * from `expo-linear-gradient` or similar).\n *\n * This module walks a lightningcss declaration list, notices the\n * `--tw-gradient-*` writes, and surfaces them as a compact\n * {@link GradientAtomInfo} record the transformer can read per atom.\n */\n\nimport type { Declaration as LcDeclaration, TokenOrValue } from 'lightningcss'\nimport { cssColorToString } from './color'\n\n/**\n * The four roles an atom can play in a Tailwind v4 gradient. `from`,\n * `via`, `to` carry a color. `direction` carries one of the 8 stock\n * points (or a bare angle when Tailwind v4's `bg-linear-[angle]`\n * syntax is used).\n */\nexport type GradientAtomInfo =\n | { readonly role: 'from'; readonly color: string }\n | { readonly role: 'via'; readonly color: string }\n | { readonly role: 'to'; readonly color: string }\n | { readonly role: 'direction'; readonly dir: GradientDirection }\n\n/**\n * Eight stock corner directions Tailwind v4 ships. The transformer\n * maps each to a `(start, end)` pair of unit-square points the\n * expo-linear-gradient API expects. Unknown directions are surfaced as\n * `'unknown'` so the transformer can skip them gracefully.\n */\nexport type GradientDirection =\n | 'to-r'\n | 'to-l'\n | 'to-t'\n | 'to-b'\n | 'to-tr'\n | 'to-tl'\n | 'to-br'\n | 'to-bl'\n | 'unknown'\n\n/**\n * Inspect a rule's declaration list for `--tw-gradient-*` writes and\n * return the atom's role + data. Returns `null` for rules that don't\n * belong to a gradient utility.\n * @param declarations Declarations from one lightningcss style rule.\n * @returns Gradient info, or null.\n */\nfunction detectGradientAtom(declarations: readonly LcDeclaration[]): GradientAtomInfo | null {\n for (const decl of declarations) {\n if (decl.property !== 'custom') continue\n const custom = decl.value as { name: { name: string } | string; value?: readonly TokenOrValue[] }\n const name = typeof custom.name === 'string' ? custom.name : custom.name.name\n if (!name.startsWith('--tw-gradient-')) continue\n if (name === '--tw-gradient-from') return fromColor('from', custom.value)\n if (name === '--tw-gradient-via') return fromColor('via', custom.value)\n if (name === '--tw-gradient-to') return fromColor('to', custom.value)\n if (name === '--tw-gradient-position') return fromDirection(custom.value)\n }\n return null\n}\n\n/**\n * Extract a single color token from a custom-property value list and\n * return the `{role, color}` record. Returns `null` when no color token\n * is present (defensive — Tailwind always emits one, but future output\n * shapes may not).\n * @param role Target role (`from` / `via` / `to`).\n * @param tokens Value tokens from the `--tw-gradient-*` declaration.\n * @returns Gradient info, or null.\n */\nfunction fromColor(role: 'from' | 'via' | 'to', tokens: readonly TokenOrValue[] | undefined): GradientAtomInfo | null {\n if (!tokens) return null\n for (const token of tokens) {\n if (token.type !== 'color') continue\n const color = cssColorToString(token.value as never)\n if (!color) return null\n return { role, color } as GradientAtomInfo\n }\n return null\n}\n\n/**\n * Interpret a `--tw-gradient-position` value list as a direction tag.\n * Tailwind emits plain idents (`to`, `right`, `bottom`, …) for the\n * 8 stock corners.\n * @param tokens Value tokens from `--tw-gradient-position`.\n * @returns Direction record, or null when unrecognised.\n */\nfunction fromDirection(tokens: readonly TokenOrValue[] | undefined): GradientAtomInfo | null {\n if (!tokens) return null\n const idents: string[] = []\n for (const token of tokens) {\n if (token.type !== 'token') continue\n if (token.value.type === 'ident') idents.push(token.value.value as string)\n }\n const dir = directionFromIdents(idents)\n if (!dir) return null\n return { role: 'direction', dir }\n}\n\n/** Table of Tailwind-space direction idents → compact rnwind tag. */\nconst DIRECTION_TABLE: Record<string, GradientDirection> = {\n right: 'to-r',\n left: 'to-l',\n top: 'to-t',\n bottom: 'to-b',\n 'top-right': 'to-tr',\n 'top-left': 'to-tl',\n 'bottom-right': 'to-br',\n 'bottom-left': 'to-bl',\n}\n\n/**\n * Collapse the ident list Tailwind emits (`['to', 'right']`,\n * `['to', 'bottom', 'right']`, etc.) into the compact tag the\n * transformer hoists.\n * @param idents Ident tokens from the declaration value.\n * @returns One of the eight stock directions, `'unknown'`, or null.\n */\nfunction directionFromIdents(idents: readonly string[]): GradientDirection | null {\n if (idents.length === 0) return null\n if (idents[0] !== 'to') return 'unknown'\n // Tailwind v4 appends `in <colourspace>` for colour interpolation\n // (`to right in oklab`). Strip everything from the `in` keyword on\n // — it's irrelevant for the point mapping.\n const inIndex = idents.indexOf('in')\n const rest = idents.slice(1, inIndex === -1 ? idents.length : inIndex)\n if (rest.length === 0 || rest.length > 2) return 'unknown'\n return DIRECTION_TABLE[rest.join('-')] ?? 'unknown'\n}\n\nexport { detectGradientAtom }\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AAkCH;;;;;;AAMG;AACH,SAAS,kBAAkB,CAAC,YAAsC,EAAA;AAChE,IAAA,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;AAC/B,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,QAAQ;YAAE;AAChC,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,KAA6E;QACjG,MAAM,IAAI,GAAG,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI;AAC7E,QAAA,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC;YAAE;QACxC,IAAI,IAAI,KAAK,oBAAoB;YAAE,OAAO,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;QACzE,IAAI,IAAI,KAAK,mBAAmB;YAAE,OAAO,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC;QACvE,IAAI,IAAI,KAAK,kBAAkB;YAAE,OAAO,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC;QACrE,IAAI,IAAI,KAAK,wBAAwB;AAAE,YAAA,OAAO,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC;IAC3E;AACA,IAAA,OAAO,IAAI;AACb;AAEA;;;;;;;;AAQG;AACH,SAAS,SAAS,CAAC,IAA2B,EAAE,MAA2C,EAAA;AACzF,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI;AACxB,IAAA,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;AAC1B,QAAA,IAAI,KAAK,CAAC,IAAI,KAAK,OAAO;YAAE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