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":"use-scheme.cjs","sources":["../../../../../src/runtime/hooks/use-scheme.ts"],"sourcesContent":["import type { ThemeTable } from '../../core/types'\nimport { useRnwind } from '../components/rnwind-provider'\n\n/**\n * Synthetic scheme name applied when tokens aren't declared under any\n * `@variant` block — the \"no active variant\" fallback every theme table\n * inherits from.\n */\nconst BASE_SCHEME = 'base'\n\n/**\n * Access the resolved theme table for the active scheme.\n *\n * Tokens declared outside any `@variant` block live in the `base` table and\n * should apply everywhere — just like the CSS cascade treats `:root` as a\n * default for every ancestor-scoped override. We merge `base` under the\n * active scheme so a scheme that doesn't declare a token still sees the\n * base default, while the scheme's own entries win on overlap.\n * @returns Token table for the active scheme.\n */\nexport function useTheme(): ThemeTable {\n const { scheme, tables } = useRnwind()\n const base = tables[BASE_SCHEME] ?? {}\n const schemeTable = tables[scheme]\n if (!schemeTable) return base\n // Fast path: nothing to merge when the scheme table is empty.\n if (Object.keys(schemeTable).length === 0) return base\n return { ...base, ...schemeTable }\n}\n\n/**\n * Read a raw CSS custom property's value for the active scheme. Accepts\n * either `--foo` or the bare `foo` form for convenience.\n * @param cssVariable CSS custom property name (with or without the leading `--`).\n * @returns The resolved value, or undefined when the token is missing.\n */\nexport function useToken(cssVariable: string): string | number | undefined {\n const table = useTheme()\n const name = cssVariable.startsWith('--') ? cssVariable : `--${cssVariable}`\n return table[name]\n}\n\n/**\n * Read a color token by shorthand name — `useColor('primary')` resolves\n * `--color-primary` for the active scheme.\n * @param name Token suffix after `--color-`.\n * @returns Resolved color string, or undefined when the token is missing\n * or its value isn't a string.\n */\nexport function useColor(name: string): string | undefined {\n const value = useToken(`--color-${name}`)\n return typeof value === 'string' ? value : undefined\n}\n\n/**\n * Read a spacing token by shorthand name — `useSize('4')` resolves\n * `--spacing-4` for the active scheme.\n * @param name Token suffix after `--spacing-`.\n * @returns Resolved spacing value, or undefined when the token is missing.\n */\nexport function useSize(name: string): number | string | undefined {\n return useToken(`--spacing-${name}`)\n}\n"],"names":["useRnwind"],"mappings":";;;;AAGA;;;;AAIG;AACH,MAAM,WAAW,GAAG,MAAM;AAE1B;;;;;;;;;AASG;SACa,QAAQ,GAAA;IACtB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAGA,wBAAS,EAAE;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE;AACtC,IAAA,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;AAClC,IAAA,IAAI,CAAC,WAAW;AAAE,QAAA,OAAO,IAAI;;IAE7B,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,IAAI;AACtD,IAAA,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,WAAW,EAAE;AACpC;AAEA;;;;;AAKG;AACG,SAAU,QAAQ,CAAC,WAAmB,EAAA;AAC1C,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,MAAM,IAAI,GAAG,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,GAAG,CAAA,EAAA,EAAK,WAAW,EAAE;AAC5E,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB;AAEA;;;;;;AAMG;AACG,SAAU,QAAQ,CAAC,IAAY,EAAA;IACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,WAAW,IAAI,CAAA,CAAE,CAAC;AACzC,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,SAAS;AACtD;AAEA;;;;;AAKG;AACG,SAAU,OAAO,CAAC,IAAY,EAAA;AAClC,IAAA,OAAO,QAAQ,CAAC,CAAA,UAAA,EAAa,IAAI,CAAA,CAAE,CAAC;AACtC;;;;;;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ThemeTable } from '../../core/types';
|
|
2
|
+
/**
|
|
3
|
+
* Access the resolved theme table for the active scheme.
|
|
4
|
+
*
|
|
5
|
+
* Tokens declared outside any `@variant` block live in the `base` table and
|
|
6
|
+
* should apply everywhere — just like the CSS cascade treats `:root` as a
|
|
7
|
+
* default for every ancestor-scoped override. We merge `base` under the
|
|
8
|
+
* active scheme so a scheme that doesn't declare a token still sees the
|
|
9
|
+
* base default, while the scheme's own entries win on overlap.
|
|
10
|
+
* @returns Token table for the active scheme.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useTheme(): ThemeTable;
|
|
13
|
+
/**
|
|
14
|
+
* Read a raw CSS custom property's value for the active scheme. Accepts
|
|
15
|
+
* either `--foo` or the bare `foo` form for convenience.
|
|
16
|
+
* @param cssVariable CSS custom property name (with or without the leading `--`).
|
|
17
|
+
* @returns The resolved value, or undefined when the token is missing.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useToken(cssVariable: string): string | number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Read a color token by shorthand name — `useColor('primary')` resolves
|
|
22
|
+
* `--color-primary` for the active scheme.
|
|
23
|
+
* @param name Token suffix after `--color-`.
|
|
24
|
+
* @returns Resolved color string, or undefined when the token is missing
|
|
25
|
+
* or its value isn't a string.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useColor(name: string): string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Read a spacing token by shorthand name — `useSize('4')` resolves
|
|
30
|
+
* `--spacing-4` for the active scheme.
|
|
31
|
+
* @param name Token suffix after `--spacing-`.
|
|
32
|
+
* @returns Resolved spacing value, or undefined when the token is missing.
|
|
33
|
+
*/
|
|
34
|
+
export declare function useSize(name: string): number | string | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var lookupCss = require('./lookup-css.cjs');
|
|
4
|
+
var rnwindProvider = require('./components/rnwind-provider.cjs');
|
|
5
|
+
var useCss = require('./hooks/use-css.cjs');
|
|
6
|
+
var useInteract = require('./hooks/use-interact.cjs');
|
|
7
|
+
var chainHandlers = require('./chain-handlers.cjs');
|
|
8
|
+
var interactiveBox = require('./interactive-box.cjs');
|
|
9
|
+
var haptics = require('./haptics.cjs');
|
|
10
|
+
var useScheme = require('./hooks/use-scheme.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Installed rnwind version, inlined at publish time. Compare against a pinned
|
|
14
|
+
* string when integrating with build tooling that may see multiple rnwind
|
|
15
|
+
* copies (e.g. workspace overrides).
|
|
16
|
+
*/
|
|
17
|
+
const VERSION = '0.0.1';
|
|
18
|
+
|
|
19
|
+
exports._l = lookupCss.lookupCss;
|
|
20
|
+
exports.activeBreakpointFor = lookupCss.activeBreakpointFor;
|
|
21
|
+
exports.getBreakpoints = lookupCss.getBreakpoints;
|
|
22
|
+
exports.lookupCss = lookupCss.lookupCss;
|
|
23
|
+
exports.registerAtoms = lookupCss.registerAtoms;
|
|
24
|
+
exports.registerBreakpoints = lookupCss.registerBreakpoints;
|
|
25
|
+
exports.registerSchemeLoader = lookupCss.registerSchemeLoader;
|
|
26
|
+
exports.setWindowHeightProvider = lookupCss.setWindowHeightProvider;
|
|
27
|
+
exports.RnwindProvider = rnwindProvider.RnwindProvider;
|
|
28
|
+
exports.useR_ = rnwindProvider.useR_;
|
|
29
|
+
exports.useRnwind = rnwindProvider.useRnwind;
|
|
30
|
+
exports.useCss = useCss.useCss;
|
|
31
|
+
exports.useInteract = useInteract.useInteract;
|
|
32
|
+
exports.chainFocus = chainHandlers.chainFocus;
|
|
33
|
+
exports.chainPress = chainHandlers.chainPress;
|
|
34
|
+
exports.InteractiveBox = interactiveBox.InteractiveBox;
|
|
35
|
+
exports._ib = interactiveBox.InteractiveBox;
|
|
36
|
+
exports._hm = haptics.useMountHaptic;
|
|
37
|
+
exports._ht = haptics.triggerHaptic;
|
|
38
|
+
exports.triggerHaptic = haptics.triggerHaptic;
|
|
39
|
+
exports.useMountHaptic = haptics.useMountHaptic;
|
|
40
|
+
exports.useColor = useScheme.useColor;
|
|
41
|
+
exports.useSize = useScheme.useSize;
|
|
42
|
+
exports.useTheme = useScheme.useTheme;
|
|
43
|
+
exports.useToken = useScheme.useToken;
|
|
44
|
+
exports.VERSION = VERSION;
|
|
45
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/runtime/index.ts"],"sourcesContent":["\n\n\n\nexport {\n lookupCss,\n registerAtoms,\n registerBreakpoints,\n registerSchemeLoader,\n setWindowHeightProvider,\n getBreakpoints,\n activeBreakpointFor,\n lookupCss as _l,\n} from './lookup-css'\nexport { useR_ } from './components/rnwind-provider'\nexport type { HoistedClassName, InteractState, LookupInsets, SafeMarkerSpec } from './lookup-css'\nexport { useCss } from './hooks/use-css'\nexport { useInteract } from './hooks/use-interact'\nexport type { UseInteractResult } from './hooks/use-interact'\nexport { chainPress, chainFocus } from './chain-handlers'\nexport { InteractiveBox, InteractiveBox as _ib } from './interactive-box'\nexport type { InteractiveBoxProps, InteractiveSpec } from './interactive-box'\nexport { RnwindProvider, useRnwind } from './components/rnwind-provider'\nexport type { RnwindProviderProps, RnwindState, Insets } from './components/rnwind-provider'\nexport { useMountHaptic, triggerHaptic, triggerHaptic as _ht, useMountHaptic as _hm } from './haptics'\n\n// ──────────────────────────────────────────────────────────────────────\n// Internal aliases the babel transformer uses. Underscore-prefixed so\n// user code (which imports the public names above) can never collide\n// with what we inject at JSX sites — even if the user shadows\n// `lookupCss` / `useHaptics` / `InteractiveBox` with a local symbol,\n// the transformer's emitted code still references the private alias.\n// Don't import these in app code.\n// ──────────────────────────────────────────────────────────────────────\n/** @internal */\n\n/** @internal */\n\n/** @internal */\n\n/** @internal */\n\nexport type { HapticRequest, HapticTrigger, OnHaptics } from '../core/parser/haptics'\nexport type { AsLinearGradientProps, LinearGradientPoint } from './gradient-types'\nexport type { ThemeTable, ThemeTables } from '../core/types'\nexport { useTheme, useToken, useColor, useSize } from './hooks/use-scheme'\nexport type { Scheme, RnwindConfig } from './types'\n\n/**\n * Installed rnwind version, inlined at publish time. Compare against a pinned\n * string when integrating with build tooling that may see multiple rnwind\n * copies (e.g. workspace overrides).\n */\nexport const VERSION = '0.0.1' as const\n"],"names":[],"mappings":";;;;;;;;;;;AAgDA;;;;AAIG;AACI,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { lookupCss, registerAtoms, registerBreakpoints, registerSchemeLoader, setWindowHeightProvider, getBreakpoints, activeBreakpointFor, lookupCss as _l, } from './lookup-css';
|
|
2
|
+
export { useR_ } from './components/rnwind-provider';
|
|
3
|
+
export type { HoistedClassName, InteractState, LookupInsets, SafeMarkerSpec } from './lookup-css';
|
|
4
|
+
export { useCss } from './hooks/use-css';
|
|
5
|
+
export { useInteract } from './hooks/use-interact';
|
|
6
|
+
export type { UseInteractResult } from './hooks/use-interact';
|
|
7
|
+
export { chainPress, chainFocus } from './chain-handlers';
|
|
8
|
+
export { InteractiveBox, InteractiveBox as _ib } from './interactive-box';
|
|
9
|
+
export type { InteractiveBoxProps, InteractiveSpec } from './interactive-box';
|
|
10
|
+
export { RnwindProvider, useRnwind } from './components/rnwind-provider';
|
|
11
|
+
export type { RnwindProviderProps, RnwindState, Insets } from './components/rnwind-provider';
|
|
12
|
+
export { useMountHaptic, triggerHaptic, triggerHaptic as _ht, useMountHaptic as _hm } from './haptics';
|
|
13
|
+
/** @internal */
|
|
14
|
+
/** @internal */
|
|
15
|
+
/** @internal */
|
|
16
|
+
/** @internal */
|
|
17
|
+
export type { HapticRequest, HapticTrigger, OnHaptics } from '../core/parser/haptics';
|
|
18
|
+
export type { AsLinearGradientProps, LinearGradientPoint } from './gradient-types';
|
|
19
|
+
export type { ThemeTable, ThemeTables } from '../core/types';
|
|
20
|
+
export { useTheme, useToken, useColor, useSize } from './hooks/use-scheme';
|
|
21
|
+
export type { Scheme, RnwindConfig } from './types';
|
|
22
|
+
/**
|
|
23
|
+
* Installed rnwind version, inlined at publish time. Compare against a pinned
|
|
24
|
+
* string when integrating with build tooling that may see multiple rnwind
|
|
25
|
+
* copies (e.g. workspace overrides).
|
|
26
|
+
*/
|
|
27
|
+
export declare const VERSION: "0.0.1";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var chainHandlers = require('./chain-handlers.cjs');
|
|
5
|
+
var useInteract = require('./hooks/use-interact.cjs');
|
|
6
|
+
var lookupCss = require('./lookup-css.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Per-instance wrapper that drives `active:` / `focus:` variants. One
|
|
10
|
+
* `useInteract()` hook per mounted `InteractiveBox` means each element
|
|
11
|
+
* owns its own state — siblings never share `active` / `focus` flags.
|
|
12
|
+
*
|
|
13
|
+
* The transformer replaces
|
|
14
|
+
* `<Pressable className="active:bg-sky-700" onPress={x} />`
|
|
15
|
+
* with
|
|
16
|
+
* `<InteractiveBox _rw={{as: Pressable, cn: _c0, t: _t}} onPress={x} />`.
|
|
17
|
+
* @param props `_rw` spec + any props to forward to the inner component.
|
|
18
|
+
* @returns Rendered element of the inner component with interact wiring.
|
|
19
|
+
*/
|
|
20
|
+
function InteractiveBox(props) {
|
|
21
|
+
const { _rw, onPressIn, onPressOut, onFocus, onBlur, ...rest } = props;
|
|
22
|
+
const interact = useInteract.useInteract();
|
|
23
|
+
const merged = {
|
|
24
|
+
...rest,
|
|
25
|
+
style: lookupCss.lookupCss(_rw.cn, _rw.t, _rw.us, interact.state),
|
|
26
|
+
onPressIn: chainHandlers.chainPress(onPressIn, interact.onPressIn),
|
|
27
|
+
onPressOut: chainHandlers.chainPress(onPressOut, interact.onPressOut),
|
|
28
|
+
onFocus: chainHandlers.chainFocus(onFocus, interact.onFocus),
|
|
29
|
+
onBlur: chainHandlers.chainFocus(onBlur, interact.onBlur),
|
|
30
|
+
};
|
|
31
|
+
return React.createElement(_rw.as, merged);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
exports.InteractiveBox = InteractiveBox;
|
|
35
|
+
//# sourceMappingURL=interactive-box.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactive-box.cjs","sources":["../../../../src/runtime/interactive-box.tsx"],"sourcesContent":["import { createElement, type ComponentType, type ElementType, type ReactElement } from 'react'\nimport { chainFocus, chainPress } from './chain-handlers'\nimport { useInteract } from './hooks/use-interact'\nimport { lookupCss, type HoistedClassName } from './lookup-css'\nimport type { RnwindState } from './components/rnwind-provider'\n\n/**\n * Per-element \"interactive\" spec the transformer packs into the `_rw`\n * prop on every JSX site it rewrites for active/focus support. Carrying\n * it as one object prop (rather than four sibling props) keeps the\n * rewritten JSX legible and avoids colliding with any host component's\n * own naming.\n */\nexport interface InteractiveSpec {\n /** The original JSX tag (`Pressable`, `TextInput`, `Animated.View`, …). */\n readonly as: ElementType\n /** Hoisted atom-name array (or a dynamic classname string). */\n readonly cn: HoistedClassName | string | null | undefined\n /** Full rnwind context — `_t = useRnwind___()` from the call site. */\n readonly t: RnwindState\n /** Optional caller-supplied style forwarded as `lookupCss`'s 3rd arg. */\n readonly us?: unknown\n}\n\n/** Props InteractiveBox accepts — `_rw` plus anything to forward. */\nexport interface InteractiveBoxProps {\n /** Compile-time spec packed by the transformer. */\n readonly _rw: InteractiveSpec\n /** Every other prop passes through to the inner component. */\n readonly [key: string]: unknown\n}\n\n/**\n * Per-instance wrapper that drives `active:` / `focus:` variants. One\n * `useInteract()` hook per mounted `InteractiveBox` means each element\n * owns its own state — siblings never share `active` / `focus` flags.\n *\n * The transformer replaces\n * `<Pressable className=\"active:bg-sky-700\" onPress={x} />`\n * with\n * `<InteractiveBox _rw={{as: Pressable, cn: _c0, t: _t}} onPress={x} />`.\n * @param props `_rw` spec + any props to forward to the inner component.\n * @returns Rendered element of the inner component with interact wiring.\n */\nexport function InteractiveBox(props: InteractiveBoxProps): ReactElement {\n const { _rw, onPressIn, onPressOut, onFocus, onBlur, ...rest } = props\n const interact = useInteract()\n const merged: Record<string, unknown> = {\n ...rest,\n style: lookupCss(_rw.cn, _rw.t, _rw.us, interact.state),\n onPressIn: chainPress(onPressIn as Parameters<typeof chainPress>[0], interact.onPressIn),\n onPressOut: chainPress(onPressOut as Parameters<typeof chainPress>[0], interact.onPressOut),\n onFocus: chainFocus(onFocus as Parameters<typeof chainFocus>[0], interact.onFocus),\n onBlur: chainFocus(onBlur as Parameters<typeof chainFocus>[0], interact.onBlur),\n }\n return createElement(_rw.as as ComponentType<Record<string, unknown>>, merged)\n}\n"],"names":["useInteract","lookupCss","chainPress","chainFocus","createElement"],"mappings":";;;;;;;AAgCA;;;;;;;;;;;AAWG;AACG,SAAU,cAAc,CAAC,KAA0B,EAAA;AACvD,IAAA,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK;AACtE,IAAA,MAAM,QAAQ,GAAGA,uBAAW,EAAE;AAC9B,IAAA,MAAM,MAAM,GAA4B;AACtC,QAAA,GAAG,IAAI;AACP,QAAA,KAAK,EAAEC,mBAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC;QACvD,SAAS,EAAEC,wBAAU,CAAC,SAA6C,EAAE,QAAQ,CAAC,SAAS,CAAC;QACxF,UAAU,EAAEA,wBAAU,CAAC,UAA8C,EAAE,QAAQ,CAAC,UAAU,CAAC;QAC3F,OAAO,EAAEC,wBAAU,CAAC,OAA2C,EAAE,QAAQ,CAAC,OAAO,CAAC;QAClF,MAAM,EAAEA,wBAAU,CAAC,MAA0C,EAAE,QAAQ,CAAC,MAAM,CAAC;KAChF;IACD,OAAOC,mBAAa,CAAC,GAAG,CAAC,EAA4C,EAAE,MAAM,CAAC;AAChF;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type ElementType, type ReactElement } from 'react';
|
|
2
|
+
import { type HoistedClassName } from './lookup-css';
|
|
3
|
+
import type { RnwindState } from './components/rnwind-provider';
|
|
4
|
+
/**
|
|
5
|
+
* Per-element "interactive" spec the transformer packs into the `_rw`
|
|
6
|
+
* prop on every JSX site it rewrites for active/focus support. Carrying
|
|
7
|
+
* it as one object prop (rather than four sibling props) keeps the
|
|
8
|
+
* rewritten JSX legible and avoids colliding with any host component's
|
|
9
|
+
* own naming.
|
|
10
|
+
*/
|
|
11
|
+
export interface InteractiveSpec {
|
|
12
|
+
/** The original JSX tag (`Pressable`, `TextInput`, `Animated.View`, …). */
|
|
13
|
+
readonly as: ElementType;
|
|
14
|
+
/** Hoisted atom-name array (or a dynamic classname string). */
|
|
15
|
+
readonly cn: HoistedClassName | string | null | undefined;
|
|
16
|
+
/** Full rnwind context — `_t = useRnwind___()` from the call site. */
|
|
17
|
+
readonly t: RnwindState;
|
|
18
|
+
/** Optional caller-supplied style forwarded as `lookupCss`'s 3rd arg. */
|
|
19
|
+
readonly us?: unknown;
|
|
20
|
+
}
|
|
21
|
+
/** Props InteractiveBox accepts — `_rw` plus anything to forward. */
|
|
22
|
+
export interface InteractiveBoxProps {
|
|
23
|
+
/** Compile-time spec packed by the transformer. */
|
|
24
|
+
readonly _rw: InteractiveSpec;
|
|
25
|
+
/** Every other prop passes through to the inner component. */
|
|
26
|
+
readonly [key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Per-instance wrapper that drives `active:` / `focus:` variants. One
|
|
30
|
+
* `useInteract()` hook per mounted `InteractiveBox` means each element
|
|
31
|
+
* owns its own state — siblings never share `active` / `focus` flags.
|
|
32
|
+
*
|
|
33
|
+
* The transformer replaces
|
|
34
|
+
* `<Pressable className="active:bg-sky-700" onPress={x} />`
|
|
35
|
+
* with
|
|
36
|
+
* `<InteractiveBox _rw={{as: Pressable, cn: _c0, t: _t}} onPress={x} />`.
|
|
37
|
+
* @param props `_rw` spec + any props to forward to the inner component.
|
|
38
|
+
* @returns Rendered element of the inner component with interact wiring.
|
|
39
|
+
*/
|
|
40
|
+
export declare function InteractiveBox(props: InteractiveBoxProps): ReactElement;
|