zyzz 0.0.0 → 0.0.3
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/LICENSE +21 -0
- package/README.md +380 -0
- package/dist/Config.d.ts +170 -0
- package/dist/Config.d.ts.map +1 -0
- package/dist/Config.js +249 -0
- package/dist/Config.js.map +1 -0
- package/dist/Props.d.ts +7 -0
- package/dist/Props.d.ts.map +1 -0
- package/dist/Props.js +3 -0
- package/dist/Props.js.map +1 -0
- package/dist/Style.d.ts +170 -0
- package/dist/Style.d.ts.map +1 -0
- package/dist/Style.js +325 -0
- package/dist/Style.js.map +1 -0
- package/dist/Theme.d.ts +157 -0
- package/dist/Theme.d.ts.map +1 -0
- package/dist/Theme.js +273 -0
- package/dist/Theme.js.map +1 -0
- package/dist/babel/NativeEdits.d.ts +8 -0
- package/dist/babel/NativeEdits.d.ts.map +1 -0
- package/dist/babel/NativeEdits.js +233 -0
- package/dist/babel/NativeEdits.js.map +1 -0
- package/dist/babel/NativeJsx.d.ts +10 -0
- package/dist/babel/NativeJsx.d.ts.map +1 -0
- package/dist/babel/NativeJsx.js +204 -0
- package/dist/babel/NativeJsx.js.map +1 -0
- package/dist/babel/index.d.ts +51 -0
- package/dist/babel/index.d.ts.map +1 -0
- package/dist/babel/index.js +220 -0
- package/dist/babel/index.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +178 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/compiler/Graph.d.ts +64 -0
- package/dist/compiler/Graph.d.ts.map +1 -0
- package/dist/compiler/Graph.js +1111 -0
- package/dist/compiler/Graph.js.map +1 -0
- package/dist/compiler/Native.d.ts +53 -0
- package/dist/compiler/Native.d.ts.map +1 -0
- package/dist/compiler/Native.js +617 -0
- package/dist/compiler/Native.js.map +1 -0
- package/dist/compiler/Source.d.ts +167 -0
- package/dist/compiler/Source.d.ts.map +1 -0
- package/dist/compiler/Source.js +1012 -0
- package/dist/compiler/Source.js.map +1 -0
- package/dist/compiler/Transform.d.ts +57 -0
- package/dist/compiler/Transform.d.ts.map +1 -0
- package/dist/compiler/Transform.js +886 -0
- package/dist/compiler/Transform.js.map +1 -0
- package/dist/compiler/index.d.ts +13 -0
- package/dist/compiler/index.d.ts.map +1 -0
- package/dist/compiler/index.js +13 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/internal/Applications.d.ts +35 -0
- package/dist/compiler/internal/Applications.d.ts.map +1 -0
- package/dist/compiler/internal/Applications.js +248 -0
- package/dist/compiler/internal/Applications.js.map +1 -0
- package/dist/compiler/internal/AtRules.d.ts +8 -0
- package/dist/compiler/internal/AtRules.d.ts.map +1 -0
- package/dist/compiler/internal/AtRules.js +180 -0
- package/dist/compiler/internal/AtRules.js.map +1 -0
- package/dist/compiler/internal/Catalogs.d.ts +19 -0
- package/dist/compiler/internal/Catalogs.d.ts.map +1 -0
- package/dist/compiler/internal/Catalogs.js +68 -0
- package/dist/compiler/internal/Catalogs.js.map +1 -0
- package/dist/compiler/internal/ColorProfiles.d.ts +3 -0
- package/dist/compiler/internal/ColorProfiles.d.ts.map +1 -0
- package/dist/compiler/internal/ColorProfiles.js +84 -0
- package/dist/compiler/internal/ColorProfiles.js.map +1 -0
- package/dist/compiler/internal/CompositionBindings.d.ts +16 -0
- package/dist/compiler/internal/CompositionBindings.d.ts.map +1 -0
- package/dist/compiler/internal/CompositionBindings.js +89 -0
- package/dist/compiler/internal/CompositionBindings.js.map +1 -0
- package/dist/compiler/internal/Compositions.d.ts +32 -0
- package/dist/compiler/internal/Compositions.d.ts.map +1 -0
- package/dist/compiler/internal/Compositions.js +464 -0
- package/dist/compiler/internal/Compositions.js.map +1 -0
- package/dist/compiler/internal/Configurations.d.ts +21 -0
- package/dist/compiler/internal/Configurations.d.ts.map +1 -0
- package/dist/compiler/internal/Configurations.js +171 -0
- package/dist/compiler/internal/Configurations.js.map +1 -0
- package/dist/compiler/internal/Contract.d.ts +27 -0
- package/dist/compiler/internal/Contract.d.ts.map +1 -0
- package/dist/compiler/internal/Contract.js +607 -0
- package/dist/compiler/internal/Contract.js.map +1 -0
- package/dist/compiler/internal/Contributions.d.ts +54 -0
- package/dist/compiler/internal/Contributions.d.ts.map +1 -0
- package/dist/compiler/internal/Contributions.js +1109 -0
- package/dist/compiler/internal/Contributions.js.map +1 -0
- package/dist/compiler/internal/Descriptors.d.ts +15 -0
- package/dist/compiler/internal/Descriptors.d.ts.map +1 -0
- package/dist/compiler/internal/Descriptors.js +183 -0
- package/dist/compiler/internal/Descriptors.js.map +1 -0
- package/dist/compiler/internal/Dynamic.d.ts +14 -0
- package/dist/compiler/internal/Dynamic.d.ts.map +1 -0
- package/dist/compiler/internal/Dynamic.js +172 -0
- package/dist/compiler/internal/Dynamic.js.map +1 -0
- package/dist/compiler/internal/Edits.d.ts +12 -0
- package/dist/compiler/internal/Edits.d.ts.map +1 -0
- package/dist/compiler/internal/Edits.js +5 -0
- package/dist/compiler/internal/Edits.js.map +1 -0
- package/dist/compiler/internal/Expression.d.ts +12 -0
- package/dist/compiler/internal/Expression.d.ts.map +1 -0
- package/dist/compiler/internal/Expression.js +98 -0
- package/dist/compiler/internal/Expression.js.map +1 -0
- package/dist/compiler/internal/Functions.d.ts +5 -0
- package/dist/compiler/internal/Functions.d.ts.map +1 -0
- package/dist/compiler/internal/Functions.js +191 -0
- package/dist/compiler/internal/Functions.js.map +1 -0
- package/dist/compiler/internal/Identifiers.d.ts +9 -0
- package/dist/compiler/internal/Identifiers.d.ts.map +1 -0
- package/dist/compiler/internal/Identifiers.js +106 -0
- package/dist/compiler/internal/Identifiers.js.map +1 -0
- package/dist/compiler/internal/Keyframes.d.ts +5 -0
- package/dist/compiler/internal/Keyframes.d.ts.map +1 -0
- package/dist/compiler/internal/Keyframes.js +51 -0
- package/dist/compiler/internal/Keyframes.js.map +1 -0
- package/dist/compiler/internal/Namespaces.d.ts +17 -0
- package/dist/compiler/internal/Namespaces.d.ts.map +1 -0
- package/dist/compiler/internal/Namespaces.js +265 -0
- package/dist/compiler/internal/Namespaces.js.map +1 -0
- package/dist/compiler/internal/NativeBindings.d.ts +74 -0
- package/dist/compiler/internal/NativeBindings.d.ts.map +1 -0
- package/dist/compiler/internal/NativeBindings.js +117 -0
- package/dist/compiler/internal/NativeBindings.js.map +1 -0
- package/dist/compiler/internal/PackedStyles.d.ts +35 -0
- package/dist/compiler/internal/PackedStyles.d.ts.map +1 -0
- package/dist/compiler/internal/PackedStyles.js +345 -0
- package/dist/compiler/internal/PackedStyles.js.map +1 -0
- package/dist/compiler/internal/Properties.d.ts +5 -0
- package/dist/compiler/internal/Properties.d.ts.map +1 -0
- package/dist/compiler/internal/Properties.js +82 -0
- package/dist/compiler/internal/Properties.js.map +1 -0
- package/dist/compiler/internal/RecipeConditions.d.ts +41 -0
- package/dist/compiler/internal/RecipeConditions.d.ts.map +1 -0
- package/dist/compiler/internal/RecipeConditions.js +82 -0
- package/dist/compiler/internal/RecipeConditions.js.map +1 -0
- package/dist/compiler/internal/RecipePayloads.d.ts +31 -0
- package/dist/compiler/internal/RecipePayloads.d.ts.map +1 -0
- package/dist/compiler/internal/RecipePayloads.js +99 -0
- package/dist/compiler/internal/RecipePayloads.js.map +1 -0
- package/dist/compiler/internal/Recipes.d.ts +32 -0
- package/dist/compiler/internal/Recipes.d.ts.map +1 -0
- package/dist/compiler/internal/Recipes.js +339 -0
- package/dist/compiler/internal/Recipes.js.map +1 -0
- package/dist/compiler/internal/Relative.d.ts +19 -0
- package/dist/compiler/internal/Relative.d.ts.map +1 -0
- package/dist/compiler/internal/Relative.js +62 -0
- package/dist/compiler/internal/Relative.js.map +1 -0
- package/dist/compiler/internal/Scope.d.ts +10 -0
- package/dist/compiler/internal/Scope.d.ts.map +1 -0
- package/dist/compiler/internal/Scope.js +28 -0
- package/dist/compiler/internal/Scope.js.map +1 -0
- package/dist/compiler/internal/Selectors.d.ts +12 -0
- package/dist/compiler/internal/Selectors.d.ts.map +1 -0
- package/dist/compiler/internal/Selectors.js +265 -0
- package/dist/compiler/internal/Selectors.js.map +1 -0
- package/dist/compiler/internal/Static.d.ts +39 -0
- package/dist/compiler/internal/Static.d.ts.map +1 -0
- package/dist/compiler/internal/Static.js +532 -0
- package/dist/compiler/internal/Static.js.map +1 -0
- package/dist/compiler/internal/Stylesheets.d.ts +47 -0
- package/dist/compiler/internal/Stylesheets.d.ts.map +1 -0
- package/dist/compiler/internal/Stylesheets.js +272 -0
- package/dist/compiler/internal/Stylesheets.js.map +1 -0
- package/dist/compiler/internal/Syntax.d.ts +17 -0
- package/dist/compiler/internal/Syntax.d.ts.map +1 -0
- package/dist/compiler/internal/Syntax.js +19 -0
- package/dist/compiler/internal/Syntax.js.map +1 -0
- package/dist/compiler/internal/Themes.d.ts +158 -0
- package/dist/compiler/internal/Themes.d.ts.map +1 -0
- package/dist/compiler/internal/Themes.js +1169 -0
- package/dist/compiler/internal/Themes.js.map +1 -0
- package/dist/compiler/internal/Variables.d.ts +31 -0
- package/dist/compiler/internal/Variables.d.ts.map +1 -0
- package/dist/compiler/internal/Variables.js +376 -0
- package/dist/compiler/internal/Variables.js.map +1 -0
- package/dist/compiler/internal/ViewTransitions.d.ts +3 -0
- package/dist/compiler/internal/ViewTransitions.d.ts.map +1 -0
- package/dist/compiler/internal/ViewTransitions.js +68 -0
- package/dist/compiler/internal/ViewTransitions.js.map +1 -0
- package/dist/cx.d.ts +18 -0
- package/dist/cx.d.ts.map +1 -0
- package/dist/cx.js +60 -0
- package/dist/cx.js.map +1 -0
- package/dist/default.d.ts +3225 -0
- package/dist/default.d.ts.map +1 -0
- package/dist/default.js +547 -0
- package/dist/default.js.map +7 -0
- package/dist/default.js.zyzz.json +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/Authoring.d.ts +26 -0
- package/dist/internal/Authoring.d.ts.map +1 -0
- package/dist/internal/Authoring.js +134 -0
- package/dist/internal/Authoring.js.map +1 -0
- package/dist/internal/Binding.d.ts +64 -0
- package/dist/internal/Binding.d.ts.map +1 -0
- package/dist/internal/Binding.js +27 -0
- package/dist/internal/Binding.js.map +1 -0
- package/dist/internal/BindingDomains.d.ts +11 -0
- package/dist/internal/BindingDomains.d.ts.map +1 -0
- package/dist/internal/BindingDomains.js +459 -0
- package/dist/internal/BindingDomains.js.map +1 -0
- package/dist/internal/Cascade.d.ts +45 -0
- package/dist/internal/Cascade.d.ts.map +1 -0
- package/dist/internal/Cascade.js +165 -0
- package/dist/internal/Cascade.js.map +1 -0
- package/dist/internal/Compound.d.ts +132 -0
- package/dist/internal/Compound.d.ts.map +1 -0
- package/dist/internal/Compound.js +2 -0
- package/dist/internal/Compound.js.map +1 -0
- package/dist/internal/Condition.d.ts +33 -0
- package/dist/internal/Condition.d.ts.map +1 -0
- package/dist/internal/Condition.js +180 -0
- package/dist/internal/Condition.js.map +1 -0
- package/dist/internal/Corner.d.ts +9 -0
- package/dist/internal/Corner.d.ts.map +1 -0
- package/dist/internal/Corner.js +14 -0
- package/dist/internal/Corner.js.map +1 -0
- package/dist/internal/FunctionSyntax.d.ts +27 -0
- package/dist/internal/FunctionSyntax.d.ts.map +1 -0
- package/dist/internal/FunctionSyntax.js +91 -0
- package/dist/internal/FunctionSyntax.js.map +1 -0
- package/dist/internal/FunctionValue.d.ts +19 -0
- package/dist/internal/FunctionValue.d.ts.map +1 -0
- package/dist/internal/FunctionValue.js +2 -0
- package/dist/internal/FunctionValue.js.map +1 -0
- package/dist/internal/Geometry.d.ts +8 -0
- package/dist/internal/Geometry.d.ts.map +1 -0
- package/dist/internal/Geometry.js +2 -0
- package/dist/internal/Geometry.js.map +1 -0
- package/dist/internal/Grid.d.ts +15 -0
- package/dist/internal/Grid.d.ts.map +1 -0
- package/dist/internal/Grid.js +2 -0
- package/dist/internal/Grid.js.map +1 -0
- package/dist/internal/Identifier.d.ts +15 -0
- package/dist/internal/Identifier.d.ts.map +1 -0
- package/dist/internal/Identifier.js +2 -0
- package/dist/internal/Identifier.js.map +1 -0
- package/dist/internal/Identity.d.ts +16 -0
- package/dist/internal/Identity.d.ts.map +1 -0
- package/dist/internal/Identity.js +78 -0
- package/dist/internal/Identity.js.map +1 -0
- package/dist/internal/Lexical.d.ts +89 -0
- package/dist/internal/Lexical.d.ts.map +1 -0
- package/dist/internal/Lexical.js +15 -0
- package/dist/internal/Lexical.js.map +1 -0
- package/dist/internal/Literal.d.ts +3459 -0
- package/dist/internal/Literal.d.ts.map +1 -0
- package/dist/internal/Literal.js +3371 -0
- package/dist/internal/Literal.js.map +1 -0
- package/dist/internal/NativeProperties.d.ts +596 -0
- package/dist/internal/NativeProperties.d.ts.map +1 -0
- package/dist/internal/NativeProperties.js +2 -0
- package/dist/internal/NativeProperties.js.map +1 -0
- package/dist/internal/Numeric.d.ts +23 -0
- package/dist/internal/Numeric.d.ts.map +1 -0
- package/dist/internal/Numeric.js +2 -0
- package/dist/internal/Numeric.js.map +1 -0
- package/dist/internal/Query.d.ts +15 -0
- package/dist/internal/Query.d.ts.map +1 -0
- package/dist/internal/Query.js +58 -0
- package/dist/internal/Query.js.map +1 -0
- package/dist/internal/Recipe.d.ts +17 -0
- package/dist/internal/Recipe.d.ts.map +1 -0
- package/dist/internal/Recipe.js +2 -0
- package/dist/internal/Recipe.js.map +1 -0
- package/dist/internal/RuleReference.d.ts +23 -0
- package/dist/internal/RuleReference.d.ts.map +1 -0
- package/dist/internal/RuleReference.js +65 -0
- package/dist/internal/RuleReference.js.map +1 -0
- package/dist/internal/Scheme.d.ts +12 -0
- package/dist/internal/Scheme.d.ts.map +1 -0
- package/dist/internal/Scheme.js +16 -0
- package/dist/internal/Scheme.js.map +1 -0
- package/dist/internal/Shorthands.d.ts +20 -0
- package/dist/internal/Shorthands.d.ts.map +1 -0
- package/dist/internal/Shorthands.js +50 -0
- package/dist/internal/Shorthands.js.map +1 -0
- package/dist/internal/Targets.d.ts +43 -0
- package/dist/internal/Targets.d.ts.map +1 -0
- package/dist/internal/Targets.js +60 -0
- package/dist/internal/Targets.js.map +1 -0
- package/dist/internal/Token.d.ts +104 -0
- package/dist/internal/Token.d.ts.map +1 -0
- package/dist/internal/Token.js +162 -0
- package/dist/internal/Token.js.map +1 -0
- package/dist/internal/Tuple.d.ts +23 -0
- package/dist/internal/Tuple.d.ts.map +1 -0
- package/dist/internal/Tuple.js +2 -0
- package/dist/internal/Tuple.js.map +1 -0
- package/dist/internal/Typography.d.ts +23 -0
- package/dist/internal/Typography.d.ts.map +1 -0
- package/dist/internal/Typography.js +18 -0
- package/dist/internal/Typography.js.map +1 -0
- package/dist/internal/Value.d.ts +74 -0
- package/dist/internal/Value.d.ts.map +1 -0
- package/dist/internal/Value.js +60 -0
- package/dist/internal/Value.js.map +1 -0
- package/dist/metro/Graph.d.ts +8 -0
- package/dist/metro/Graph.d.ts.map +1 -0
- package/dist/metro/Graph.js +63 -0
- package/dist/metro/Graph.js.map +1 -0
- package/dist/metro/Watch.d.ts +21 -0
- package/dist/metro/Watch.d.ts.map +1 -0
- package/dist/metro/Watch.js +51 -0
- package/dist/metro/Watch.js.map +1 -0
- package/dist/metro/index.d.ts +30 -0
- package/dist/metro/index.d.ts.map +1 -0
- package/dist/metro/index.js +52 -0
- package/dist/metro/index.js.map +1 -0
- package/dist/metro/transformer.d.ts +21 -0
- package/dist/metro/transformer.d.ts.map +1 -0
- package/dist/metro/transformer.js +71 -0
- package/dist/metro/transformer.js.map +1 -0
- package/dist/next/index.d.ts +18 -0
- package/dist/next/index.d.ts.map +1 -0
- package/dist/next/index.js +92 -0
- package/dist/next/index.js.map +1 -0
- package/dist/next/loader.d.ts +16 -0
- package/dist/next/loader.d.ts.map +1 -0
- package/dist/next/loader.js +282 -0
- package/dist/next/loader.js.map +1 -0
- package/dist/node/Host.d.ts +80 -0
- package/dist/node/Host.d.ts.map +1 -0
- package/dist/node/Host.js +882 -0
- package/dist/node/Host.js.map +1 -0
- package/dist/node/index.d.ts +7 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +7 -0
- package/dist/node/index.js.map +1 -0
- package/dist/react-native/Host.d.ts +76 -0
- package/dist/react-native/Host.d.ts.map +1 -0
- package/dist/react-native/Host.js +209 -0
- package/dist/react-native/Host.js.map +1 -0
- package/dist/react-native/StyleSheet.d.ts +226 -0
- package/dist/react-native/StyleSheet.d.ts.map +1 -0
- package/dist/react-native/StyleSheet.js +606 -0
- package/dist/react-native/StyleSheet.js.map +1 -0
- package/dist/react-native/Variants.d.ts +38 -0
- package/dist/react-native/Variants.d.ts.map +1 -0
- package/dist/react-native/Variants.js +66 -0
- package/dist/react-native/Variants.js.map +1 -0
- package/dist/react-native/index.d.ts +8 -0
- package/dist/react-native/index.d.ts.map +1 -0
- package/dist/react-native/index.js +8 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/internal/Color.d.ts +7 -0
- package/dist/react-native/internal/Color.d.ts.map +1 -0
- package/dist/react-native/internal/Color.js +93 -0
- package/dist/react-native/internal/Color.js.map +1 -0
- package/dist/react-native/internal/NativeSchema.d.ts +5138 -0
- package/dist/react-native/internal/NativeSchema.d.ts.map +1 -0
- package/dist/react-native/internal/NativeSchema.js +3097 -0
- package/dist/react-native/internal/NativeSchema.js.map +1 -0
- package/dist/react-native/internal/Scalar.d.ts +95 -0
- package/dist/react-native/internal/Scalar.d.ts.map +1 -0
- package/dist/react-native/internal/Scalar.js +199 -0
- package/dist/react-native/internal/Scalar.js.map +1 -0
- package/dist/react-native/internal/Values.d.ts +5 -0
- package/dist/react-native/internal/Values.d.ts.map +1 -0
- package/dist/react-native/internal/Values.js +65 -0
- package/dist/react-native/internal/Values.js.map +1 -0
- package/dist/react-native/react.d.ts +22 -0
- package/dist/react-native/react.d.ts.map +1 -0
- package/dist/react-native/react.js +26 -0
- package/dist/react-native/react.js.map +1 -0
- package/dist/reset.css +244 -0
- package/dist/runtime/Appearance.d.ts +55 -0
- package/dist/runtime/Appearance.d.ts.map +1 -0
- package/dist/runtime/Appearance.js +84 -0
- package/dist/runtime/Appearance.js.map +1 -0
- package/dist/runtime/Composition.d.ts +46 -0
- package/dist/runtime/Composition.d.ts.map +1 -0
- package/dist/runtime/Composition.js +52 -0
- package/dist/runtime/Composition.js.map +1 -0
- package/dist/runtime/CompositionHtml.d.ts +15 -0
- package/dist/runtime/CompositionHtml.d.ts.map +1 -0
- package/dist/runtime/CompositionHtml.js +20 -0
- package/dist/runtime/CompositionHtml.js.map +1 -0
- package/dist/runtime/ConditionalRecipe.d.ts +30 -0
- package/dist/runtime/ConditionalRecipe.d.ts.map +1 -0
- package/dist/runtime/ConditionalRecipe.js +39 -0
- package/dist/runtime/ConditionalRecipe.js.map +1 -0
- package/dist/runtime/Dynamic.d.ts +19 -0
- package/dist/runtime/Dynamic.d.ts.map +1 -0
- package/dist/runtime/Dynamic.js +22 -0
- package/dist/runtime/Dynamic.js.map +1 -0
- package/dist/runtime/Html.d.ts +32 -0
- package/dist/runtime/Html.d.ts.map +1 -0
- package/dist/runtime/Html.js +63 -0
- package/dist/runtime/Html.js.map +1 -0
- package/dist/runtime/Native.d.ts +48 -0
- package/dist/runtime/Native.d.ts.map +1 -0
- package/dist/runtime/Native.js +78 -0
- package/dist/runtime/Native.js.map +1 -0
- package/dist/runtime/NativeContext.d.ts +17 -0
- package/dist/runtime/NativeContext.d.ts.map +1 -0
- package/dist/runtime/NativeContext.js +47 -0
- package/dist/runtime/NativeContext.js.map +1 -0
- package/dist/runtime/NativeDynamic.d.ts +47 -0
- package/dist/runtime/NativeDynamic.d.ts.map +1 -0
- package/dist/runtime/NativeDynamic.js +141 -0
- package/dist/runtime/NativeDynamic.js.map +1 -0
- package/dist/runtime/PayloadRecipe.d.ts +22 -0
- package/dist/runtime/PayloadRecipe.d.ts.map +1 -0
- package/dist/runtime/PayloadRecipe.js +59 -0
- package/dist/runtime/PayloadRecipe.js.map +1 -0
- package/dist/runtime/Props.d.ts +21 -0
- package/dist/runtime/Props.d.ts.map +1 -0
- package/dist/runtime/Props.js +17 -0
- package/dist/runtime/Props.js.map +1 -0
- package/dist/runtime/Recipe.d.ts +52 -0
- package/dist/runtime/Recipe.d.ts.map +1 -0
- package/dist/runtime/Recipe.js +30 -0
- package/dist/runtime/Recipe.js.map +1 -0
- package/dist/runtime/Selection.d.ts +31 -0
- package/dist/runtime/Selection.d.ts.map +1 -0
- package/dist/runtime/Selection.js +30 -0
- package/dist/runtime/Selection.js.map +1 -0
- package/dist/runtime/Variable.d.ts +6 -0
- package/dist/runtime/Variable.d.ts.map +1 -0
- package/dist/runtime/Variable.js +10 -0
- package/dist/runtime/Variable.js.map +1 -0
- package/dist/runtime/index.d.ts +33 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +33 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/styleFunction.d.ts +72 -0
- package/dist/styleFunction.d.ts.map +1 -0
- package/dist/styleFunction.js +18 -0
- package/dist/styleFunction.js.map +1 -0
- package/dist/themes/LICENSE.tailwind +21 -0
- package/dist/variable.d.ts +50 -0
- package/dist/variable.d.ts.map +1 -0
- package/dist/variable.js +20 -0
- package/dist/variable.js.map +1 -0
- package/dist/variants.d.ts +84 -0
- package/dist/variants.d.ts.map +1 -0
- package/dist/variants.js +21 -0
- package/dist/variants.js.map +1 -0
- package/dist/vite/index.d.ts +24 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +1089 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/web/Css.d.ts +81 -0
- package/dist/web/Css.d.ts.map +1 -0
- package/dist/web/Css.js +593 -0
- package/dist/web/Css.js.map +1 -0
- package/dist/web/colorProfile.d.ts +28 -0
- package/dist/web/colorProfile.d.ts.map +1 -0
- package/dist/web/colorProfile.js +8 -0
- package/dist/web/colorProfile.js.map +1 -0
- package/dist/web/counterStyle.d.ts +48 -0
- package/dist/web/counterStyle.d.ts.map +1 -0
- package/dist/web/counterStyle.js +8 -0
- package/dist/web/counterStyle.js.map +1 -0
- package/dist/web/cssFunction.d.ts +80 -0
- package/dist/web/cssFunction.d.ts.map +1 -0
- package/dist/web/cssFunction.js +18 -0
- package/dist/web/cssFunction.js.map +1 -0
- package/dist/web/customMedia.d.ts +12 -0
- package/dist/web/customMedia.d.ts.map +1 -0
- package/dist/web/customMedia.js +7 -0
- package/dist/web/customMedia.js.map +1 -0
- package/dist/web/fontFace.d.ts +26 -0
- package/dist/web/fontFace.d.ts.map +1 -0
- package/dist/web/fontFace.js +7 -0
- package/dist/web/fontFace.js.map +1 -0
- package/dist/web/fontFeatureValues.d.ts +40 -0
- package/dist/web/fontFeatureValues.d.ts.map +1 -0
- package/dist/web/fontFeatureValues.js +7 -0
- package/dist/web/fontFeatureValues.js.map +1 -0
- package/dist/web/fontPaletteValues.d.ts +21 -0
- package/dist/web/fontPaletteValues.d.ts.map +1 -0
- package/dist/web/fontPaletteValues.js +9 -0
- package/dist/web/fontPaletteValues.js.map +1 -0
- package/dist/web/global.d.ts +19 -0
- package/dist/web/global.d.ts.map +1 -0
- package/dist/web/global.js +6 -0
- package/dist/web/global.js.map +1 -0
- package/dist/web/importCss.d.ts +18 -0
- package/dist/web/importCss.d.ts.map +1 -0
- package/dist/web/importCss.js +7 -0
- package/dist/web/importCss.js.map +1 -0
- package/dist/web/index.d.ts +22 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +22 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/internal/Block.d.ts +18 -0
- package/dist/web/internal/Block.d.ts.map +1 -0
- package/dist/web/internal/Block.js +13 -0
- package/dist/web/internal/Block.js.map +1 -0
- package/dist/web/internal/ClassName.d.ts +19 -0
- package/dist/web/internal/ClassName.d.ts.map +1 -0
- package/dist/web/internal/ClassName.js +77 -0
- package/dist/web/internal/ClassName.js.map +1 -0
- package/dist/web/internal/Context.d.ts +11 -0
- package/dist/web/internal/Context.d.ts.map +1 -0
- package/dist/web/internal/Context.js +2 -0
- package/dist/web/internal/Context.js.map +1 -0
- package/dist/web/internal/Contributions.d.ts +70 -0
- package/dist/web/internal/Contributions.d.ts.map +1 -0
- package/dist/web/internal/Contributions.js +109 -0
- package/dist/web/internal/Contributions.js.map +1 -0
- package/dist/web/internal/Namespace.d.ts +13 -0
- package/dist/web/internal/Namespace.d.ts.map +1 -0
- package/dist/web/internal/Namespace.js +13 -0
- package/dist/web/internal/Namespace.js.map +1 -0
- package/dist/web/internal/Themes.d.ts +13 -0
- package/dist/web/internal/Themes.d.ts.map +1 -0
- package/dist/web/internal/Themes.js +96 -0
- package/dist/web/internal/Themes.js.map +1 -0
- package/dist/web/keyframes.d.ts +14 -0
- package/dist/web/keyframes.d.ts.map +1 -0
- package/dist/web/keyframes.js +8 -0
- package/dist/web/keyframes.js.map +1 -0
- package/dist/web/layers.d.ts +4 -0
- package/dist/web/layers.d.ts.map +1 -0
- package/dist/web/layers.js +7 -0
- package/dist/web/layers.js.map +1 -0
- package/dist/web/namespace.d.ts +14 -0
- package/dist/web/namespace.d.ts.map +1 -0
- package/dist/web/namespace.js +7 -0
- package/dist/web/namespace.js.map +1 -0
- package/dist/web/page.d.ts +38 -0
- package/dist/web/page.d.ts.map +1 -0
- package/dist/web/page.js +7 -0
- package/dist/web/page.js.map +1 -0
- package/dist/web/positionTry.d.ts +14 -0
- package/dist/web/positionTry.d.ts.map +1 -0
- package/dist/web/positionTry.js +9 -0
- package/dist/web/positionTry.js.map +1 -0
- package/dist/web/property.d.ts +24 -0
- package/dist/web/property.d.ts.map +1 -0
- package/dist/web/property.js +7 -0
- package/dist/web/property.js.map +1 -0
- package/dist/web/viewTransition.d.ts +29 -0
- package/dist/web/viewTransition.d.ts.map +1 -0
- package/dist/web/viewTransition.js +7 -0
- package/dist/web/viewTransition.js.map +1 -0
- package/package.json +136 -10
- package/src/Config.ts +691 -0
- package/src/Props.ts +8 -0
- package/src/Style.ts +812 -0
- package/src/Theme.ts +784 -0
- package/src/babel/NativeEdits.ts +273 -0
- package/src/babel/NativeJsx.ts +260 -0
- package/src/babel/index.ts +332 -0
- package/src/cli/index.ts +196 -0
- package/src/compiler/Graph.ts +1586 -0
- package/src/compiler/Native.ts +801 -0
- package/src/compiler/Source.ts +1579 -0
- package/src/compiler/Transform.ts +1241 -0
- package/src/compiler/index.ts +12 -0
- package/src/compiler/internal/Applications.ts +378 -0
- package/src/compiler/internal/AtRules.ts +202 -0
- package/src/compiler/internal/Catalogs.ts +114 -0
- package/src/compiler/internal/ColorProfiles.ts +93 -0
- package/src/compiler/internal/CompositionBindings.ts +120 -0
- package/src/compiler/internal/Compositions.ts +629 -0
- package/src/compiler/internal/Configurations.ts +244 -0
- package/src/compiler/internal/Contract.ts +860 -0
- package/src/compiler/internal/Contributions.ts +1507 -0
- package/src/compiler/internal/Descriptors.ts +238 -0
- package/src/compiler/internal/Dynamic.ts +266 -0
- package/src/compiler/internal/Edits.ts +13 -0
- package/src/compiler/internal/Expression.ts +135 -0
- package/src/compiler/internal/Functions.ts +206 -0
- package/src/compiler/internal/Identifiers.ts +124 -0
- package/src/compiler/internal/Keyframes.ts +62 -0
- package/src/compiler/internal/Namespaces.ts +296 -0
- package/src/compiler/internal/NativeBindings.ts +151 -0
- package/src/compiler/internal/PackedStyles.ts +464 -0
- package/src/compiler/internal/Properties.ts +121 -0
- package/src/compiler/internal/RecipeConditions.ts +139 -0
- package/src/compiler/internal/RecipePayloads.ts +132 -0
- package/src/compiler/internal/Recipes.ts +531 -0
- package/src/compiler/internal/Relative.ts +87 -0
- package/src/compiler/internal/Scope.ts +36 -0
- package/src/compiler/internal/Selectors.ts +334 -0
- package/src/compiler/internal/Static.ts +783 -0
- package/src/compiler/internal/Stylesheets.ts +361 -0
- package/src/compiler/internal/Syntax.ts +31 -0
- package/src/compiler/internal/Themes.ts +1794 -0
- package/src/compiler/internal/Variables.ts +497 -0
- package/src/compiler/internal/ViewTransitions.ts +82 -0
- package/src/cx.ts +98 -0
- package/src/default.ts +1177 -0
- package/src/index.ts +20 -0
- package/src/internal/Authoring.ts +199 -0
- package/src/internal/Binding.ts +187 -0
- package/src/internal/BindingDomains.ts +458 -0
- package/src/internal/Cascade.ts +165 -0
- package/src/internal/Compound.ts +522 -0
- package/src/internal/Condition.ts +283 -0
- package/src/internal/Corner.ts +17 -0
- package/src/internal/FunctionSyntax.ts +271 -0
- package/src/internal/FunctionValue.ts +96 -0
- package/src/internal/Geometry.ts +30 -0
- package/src/internal/Grid.ts +67 -0
- package/src/internal/Identifier.ts +14 -0
- package/src/internal/Identity.ts +89 -0
- package/src/internal/Lexical.ts +202 -0
- package/src/internal/Literal.ts +3820 -0
- package/src/internal/NativeProperties.ts +936 -0
- package/src/internal/Numeric.ts +77 -0
- package/src/internal/Query.ts +87 -0
- package/src/internal/Recipe.ts +17 -0
- package/src/internal/RuleReference.ts +102 -0
- package/src/internal/Scheme.ts +20 -0
- package/src/internal/Shorthands.ts +122 -0
- package/src/internal/Targets.ts +162 -0
- package/src/internal/Token.ts +380 -0
- package/src/internal/Tuple.ts +29 -0
- package/src/internal/Typography.ts +51 -0
- package/src/internal/Value.ts +320 -0
- package/src/metro/Graph.ts +78 -0
- package/src/metro/Watch.ts +88 -0
- package/src/metro/index.ts +99 -0
- package/src/metro/transformer.ts +97 -0
- package/src/next/index.ts +114 -0
- package/src/next/loader.ts +369 -0
- package/src/node/Host.ts +1204 -0
- package/src/node/index.ts +6 -0
- package/src/react-native/Host.ts +289 -0
- package/src/react-native/StyleSheet.ts +1084 -0
- package/src/react-native/Variants.ts +122 -0
- package/src/react-native/index.ts +7 -0
- package/src/react-native/internal/Color.ts +110 -0
- package/src/react-native/internal/NativeSchema.ts +3096 -0
- package/src/react-native/internal/Scalar.ts +253 -0
- package/src/react-native/internal/Values.ts +87 -0
- package/src/react-native/react.ts +47 -0
- package/src/reset.css +244 -0
- package/src/runtime/Appearance.ts +155 -0
- package/src/runtime/Composition.ts +87 -0
- package/src/runtime/CompositionHtml.ts +38 -0
- package/src/runtime/ConditionalRecipe.ts +70 -0
- package/src/runtime/Dynamic.ts +51 -0
- package/src/runtime/Html.ts +91 -0
- package/src/runtime/Native.ts +144 -0
- package/src/runtime/NativeContext.ts +74 -0
- package/src/runtime/NativeDynamic.ts +246 -0
- package/src/runtime/PayloadRecipe.ts +96 -0
- package/src/runtime/Props.ts +33 -0
- package/src/runtime/Recipe.ts +74 -0
- package/src/runtime/Selection.ts +82 -0
- package/src/runtime/Variable.ts +15 -0
- package/src/runtime/index.ts +45 -0
- package/src/styleFunction.ts +138 -0
- package/src/themes/LICENSE.tailwind +21 -0
- package/src/variable.ts +105 -0
- package/src/variants.ts +218 -0
- package/src/vite/index.ts +1473 -0
- package/src/web/Css.ts +801 -0
- package/src/web/colorProfile.ts +60 -0
- package/src/web/counterStyle.ts +82 -0
- package/src/web/cssFunction.ts +181 -0
- package/src/web/customMedia.ts +16 -0
- package/src/web/fontFace.ts +41 -0
- package/src/web/fontFeatureValues.ts +79 -0
- package/src/web/fontPaletteValues.ts +42 -0
- package/src/web/global.ts +39 -0
- package/src/web/importCss.ts +23 -0
- package/src/web/index.ts +22 -0
- package/src/web/internal/Block.ts +29 -0
- package/src/web/internal/ClassName.ts +112 -0
- package/src/web/internal/Context.ts +16 -0
- package/src/web/internal/Contributions.ts +219 -0
- package/src/web/internal/Namespace.ts +21 -0
- package/src/web/internal/Themes.ts +133 -0
- package/src/web/keyframes.ts +43 -0
- package/src/web/layers.ts +6 -0
- package/src/web/namespace.ts +19 -0
- package/src/web/page.ts +140 -0
- package/src/web/positionTry.ts +71 -0
- package/src/web/property.ts +35 -0
- package/src/web/viewTransition.ts +89 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/** Converts portable scalar values without source parsing or device state. @module */
|
|
2
|
+
import * as Color from './Color.js'
|
|
3
|
+
|
|
4
|
+
/** Portable property domains shared by static and dynamic native conversion. */
|
|
5
|
+
export const properties = {
|
|
6
|
+
alignContent: [
|
|
7
|
+
'center',
|
|
8
|
+
'flex-end',
|
|
9
|
+
'flex-start',
|
|
10
|
+
'space-around',
|
|
11
|
+
'space-between',
|
|
12
|
+
'space-evenly',
|
|
13
|
+
'stretch',
|
|
14
|
+
],
|
|
15
|
+
alignItems: ['baseline', 'center', 'flex-end', 'flex-start', 'stretch'],
|
|
16
|
+
alignSelf: [
|
|
17
|
+
'auto',
|
|
18
|
+
'baseline',
|
|
19
|
+
'center',
|
|
20
|
+
'flex-end',
|
|
21
|
+
'flex-start',
|
|
22
|
+
'stretch',
|
|
23
|
+
],
|
|
24
|
+
aspectRatio: 'ratio',
|
|
25
|
+
backfaceVisibility: ['hidden', 'visible'],
|
|
26
|
+
backgroundColor: 'color',
|
|
27
|
+
borderBottomColor: 'color',
|
|
28
|
+
borderBottomLeftRadius: 'length',
|
|
29
|
+
borderBottomRightRadius: 'length',
|
|
30
|
+
borderBottomWidth: 'length',
|
|
31
|
+
borderColor: 'color',
|
|
32
|
+
borderLeftColor: 'color',
|
|
33
|
+
borderLeftWidth: 'length',
|
|
34
|
+
borderRadius: 'length',
|
|
35
|
+
borderRightColor: 'color',
|
|
36
|
+
borderRightWidth: 'length',
|
|
37
|
+
borderStyle: ['dashed', 'dotted', 'solid'],
|
|
38
|
+
borderTopColor: 'color',
|
|
39
|
+
borderTopLeftRadius: 'length',
|
|
40
|
+
borderTopRightRadius: 'length',
|
|
41
|
+
borderTopWidth: 'length',
|
|
42
|
+
borderWidth: 'length',
|
|
43
|
+
bottom: 'offset',
|
|
44
|
+
boxSizing: ['border-box', 'content-box'],
|
|
45
|
+
boxShadow: 'shadow',
|
|
46
|
+
color: 'color',
|
|
47
|
+
columnGap: 'length',
|
|
48
|
+
direction: ['ltr', 'rtl'],
|
|
49
|
+
display: ['contents', 'flex', 'none'],
|
|
50
|
+
flexBasis: 'size',
|
|
51
|
+
flexDirection: ['column', 'column-reverse', 'row', 'row-reverse'],
|
|
52
|
+
flexGrow: 'number',
|
|
53
|
+
flexShrink: 'number',
|
|
54
|
+
flexWrap: ['nowrap', 'wrap', 'wrap-reverse'],
|
|
55
|
+
fontFamily: 'font',
|
|
56
|
+
fontSize: 'length',
|
|
57
|
+
fontStyle: ['italic', 'normal'],
|
|
58
|
+
fontVariant: 'fontVariant',
|
|
59
|
+
fontWeight: 'weight',
|
|
60
|
+
gap: 'length',
|
|
61
|
+
height: 'size',
|
|
62
|
+
justifyContent: [
|
|
63
|
+
'center',
|
|
64
|
+
'flex-end',
|
|
65
|
+
'flex-start',
|
|
66
|
+
'space-around',
|
|
67
|
+
'space-between',
|
|
68
|
+
'space-evenly',
|
|
69
|
+
],
|
|
70
|
+
left: 'offset',
|
|
71
|
+
letterSpacing: 'signed',
|
|
72
|
+
lineHeight: 'line',
|
|
73
|
+
margin: 'boxSigned',
|
|
74
|
+
marginBottom: 'signed',
|
|
75
|
+
marginLeft: 'signed',
|
|
76
|
+
marginRight: 'signed',
|
|
77
|
+
marginTop: 'signed',
|
|
78
|
+
maxHeight: 'dimension',
|
|
79
|
+
maxWidth: 'dimension',
|
|
80
|
+
minHeight: 'dimension',
|
|
81
|
+
minWidth: 'dimension',
|
|
82
|
+
objectFit: ['contain', 'cover', 'fill', 'none', 'scale-down'],
|
|
83
|
+
opacity: 'opacity',
|
|
84
|
+
overflow: ['hidden', 'visible'],
|
|
85
|
+
padding: 'box',
|
|
86
|
+
paddingBottom: 'length',
|
|
87
|
+
paddingLeft: 'length',
|
|
88
|
+
paddingRight: 'length',
|
|
89
|
+
paddingTop: 'length',
|
|
90
|
+
position: ['absolute', 'relative', 'static'],
|
|
91
|
+
right: 'offset',
|
|
92
|
+
rowGap: 'length',
|
|
93
|
+
textAlign: ['center', 'end', 'justify', 'left', 'right', 'start'],
|
|
94
|
+
textDecorationColor: 'color',
|
|
95
|
+
textDecorationLine: [
|
|
96
|
+
'line-through',
|
|
97
|
+
'line-through underline',
|
|
98
|
+
'none',
|
|
99
|
+
'underline',
|
|
100
|
+
'underline line-through',
|
|
101
|
+
],
|
|
102
|
+
textDecorationStyle: ['dashed', 'dotted', 'double', 'solid', 'wavy'],
|
|
103
|
+
textShadow: 'textShadow',
|
|
104
|
+
textTransform: ['capitalize', 'lowercase', 'none', 'uppercase'],
|
|
105
|
+
top: 'offset',
|
|
106
|
+
transform: 'transform',
|
|
107
|
+
transformOrigin: 'origin',
|
|
108
|
+
userSelect: ['all', 'auto', 'none', 'text'],
|
|
109
|
+
width: 'size',
|
|
110
|
+
zIndex: 'integer',
|
|
111
|
+
} as const
|
|
112
|
+
|
|
113
|
+
/** Explicit portable-unit and font mappings. */
|
|
114
|
+
export type Options = {
|
|
115
|
+
/** Authored family names mapped to native font names. */
|
|
116
|
+
readonly fonts?: Readonly<Record<string, string>> | undefined
|
|
117
|
+
/** Explicit logical-unit scales. */
|
|
118
|
+
readonly units?:
|
|
119
|
+
| { readonly px?: number | undefined; readonly rem?: number | undefined }
|
|
120
|
+
| undefined
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Converts a validated property domain using explicit unit and font mappings. */
|
|
124
|
+
export function convert(
|
|
125
|
+
kind: (typeof properties)[keyof typeof properties],
|
|
126
|
+
value: number | string,
|
|
127
|
+
options: Options,
|
|
128
|
+
path: readonly string[],
|
|
129
|
+
): number | string {
|
|
130
|
+
if (Array.isArray(kind)) {
|
|
131
|
+
if (typeof value !== 'string' || !kind.includes(value))
|
|
132
|
+
fail('unsupported_value', 'Unsupported native keyword.', path)
|
|
133
|
+
return value === 'line-through underline' ? 'underline line-through' : value
|
|
134
|
+
}
|
|
135
|
+
if (kind === 'ratio') {
|
|
136
|
+
const match =
|
|
137
|
+
typeof value === 'string'
|
|
138
|
+
? /^\s*(\d+(?:\.\d+)?|\.\d+)\s*\/\s*(\d+(?:\.\d+)?|\.\d+)\s*$/.exec(
|
|
139
|
+
value,
|
|
140
|
+
)
|
|
141
|
+
: undefined
|
|
142
|
+
const ratio =
|
|
143
|
+
typeof value === 'number'
|
|
144
|
+
? value
|
|
145
|
+
: match
|
|
146
|
+
? Number(match[1]) / Number(match[2] ?? 1)
|
|
147
|
+
: NaN
|
|
148
|
+
if (!Number.isFinite(ratio) || ratio <= 0)
|
|
149
|
+
fail('unsupported_value', 'Use a positive finite aspect ratio.', path)
|
|
150
|
+
return ratio
|
|
151
|
+
}
|
|
152
|
+
if (kind === 'color') {
|
|
153
|
+
const converted = typeof value === 'string' ? Color.parse(value) : undefined
|
|
154
|
+
if (converted === undefined)
|
|
155
|
+
fail(
|
|
156
|
+
'unsupported_value',
|
|
157
|
+
'Use an absolute sRGB color supported by native conversion.',
|
|
158
|
+
path,
|
|
159
|
+
)
|
|
160
|
+
return converted
|
|
161
|
+
}
|
|
162
|
+
if (kind === 'font') {
|
|
163
|
+
if (typeof value !== 'string' || !Object.hasOwn(options.fonts ?? {}, value))
|
|
164
|
+
fail(
|
|
165
|
+
'unsupported_value',
|
|
166
|
+
'Provide an explicit fonts mapping for this family.',
|
|
167
|
+
path,
|
|
168
|
+
)
|
|
169
|
+
return options.fonts![value]!
|
|
170
|
+
}
|
|
171
|
+
if (kind === 'weight') {
|
|
172
|
+
if (
|
|
173
|
+
value === 'normal' ||
|
|
174
|
+
value === 'bold' ||
|
|
175
|
+
(typeof value === 'number' &&
|
|
176
|
+
value >= 100 &&
|
|
177
|
+
value <= 900 &&
|
|
178
|
+
value % 100 === 0)
|
|
179
|
+
)
|
|
180
|
+
return value
|
|
181
|
+
fail(
|
|
182
|
+
'unsupported_value',
|
|
183
|
+
'Use normal, bold, or numeric weights 100 through 900 in steps of 100.',
|
|
184
|
+
path,
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
if (kind === 'number' || kind === 'integer' || kind === 'opacity') {
|
|
188
|
+
if (
|
|
189
|
+
typeof value !== 'number' ||
|
|
190
|
+
!Number.isFinite(value) ||
|
|
191
|
+
(kind === 'integer' ? !Number.isInteger(value) : value < 0) ||
|
|
192
|
+
(kind === 'opacity' && value > 1)
|
|
193
|
+
)
|
|
194
|
+
fail('unsupported_value', 'Unsupported native numeric value.', path)
|
|
195
|
+
return value
|
|
196
|
+
}
|
|
197
|
+
if (kind === 'size' && value === 'auto') return value
|
|
198
|
+
if (
|
|
199
|
+
(kind === 'dimension' || kind === 'size' || kind === 'offset') &&
|
|
200
|
+
typeof value === 'string' &&
|
|
201
|
+
/^[+-]?(?:\d+(?:\.\d+)?|\.\d+)%$/.test(value)
|
|
202
|
+
) {
|
|
203
|
+
const number = Number(value.slice(0, -1))
|
|
204
|
+
if (Number.isFinite(number) && (kind === 'offset' || number >= 0))
|
|
205
|
+
return value
|
|
206
|
+
fail('unsupported_value', 'Invalid native percentage.', path)
|
|
207
|
+
}
|
|
208
|
+
if (kind === 'box' || kind === 'boxSigned') {
|
|
209
|
+
const values =
|
|
210
|
+
typeof value === 'string' ? value.trim().split(/\s+/) : [value]
|
|
211
|
+
if (!values.length || values.length > 4)
|
|
212
|
+
fail('unsupported_value', 'Use one to four scalar lengths.', path)
|
|
213
|
+
for (const value of values)
|
|
214
|
+
length(value, options, kind === 'boxSigned', path)
|
|
215
|
+
return 0
|
|
216
|
+
}
|
|
217
|
+
return length(value, options, kind === 'signed' || kind === 'offset', path)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Converts a portable length to logical units. */
|
|
221
|
+
export function length(
|
|
222
|
+
value: number | string,
|
|
223
|
+
options: Options,
|
|
224
|
+
signed: boolean,
|
|
225
|
+
path: readonly string[],
|
|
226
|
+
): number {
|
|
227
|
+
if (value === 0 || value === '0') return 0
|
|
228
|
+
const match =
|
|
229
|
+
typeof value === 'string' &&
|
|
230
|
+
/^([+-]?(?:\d+(?:\.\d+)?|\.\d+))(px|rem)$/.exec(value)
|
|
231
|
+
if (!match)
|
|
232
|
+
fail(
|
|
233
|
+
'unsupported_value',
|
|
234
|
+
'Use zero, px, or rem with an explicit rem conversion.',
|
|
235
|
+
path,
|
|
236
|
+
)
|
|
237
|
+
const scale =
|
|
238
|
+
match[2] === 'px' ? (options.units?.px ?? 1) : options.units?.rem
|
|
239
|
+
if (scale === undefined)
|
|
240
|
+
fail('unsupported_value', 'Provide units.rem for rem lengths.', path)
|
|
241
|
+
const result = Number(match[1]) * scale
|
|
242
|
+
if (!Number.isFinite(result) || (!signed && result < 0))
|
|
243
|
+
fail(
|
|
244
|
+
'unsupported_value',
|
|
245
|
+
'Converted length is outside the native property domain.',
|
|
246
|
+
path,
|
|
247
|
+
)
|
|
248
|
+
return result
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
function fail(_code: string, message: string, _path: readonly string[]): never {
|
|
252
|
+
throw new Error(message)
|
|
253
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Validates static native values against the pinned declaration domains. @module */
|
|
2
|
+
import type * as Native from '../../internal/NativeProperties.js'
|
|
3
|
+
import * as Targets from '../../internal/Targets.js'
|
|
4
|
+
import schema from './NativeSchema.js'
|
|
5
|
+
|
|
6
|
+
type Node = {
|
|
7
|
+
kind: string
|
|
8
|
+
properties?: Record<string, { optional: boolean; value: number }> | undefined
|
|
9
|
+
value?: unknown
|
|
10
|
+
values?: readonly number[] | undefined
|
|
11
|
+
}
|
|
12
|
+
const data = schema as { root: number; nodes: readonly Node[] }
|
|
13
|
+
|
|
14
|
+
/** Copies static native declarations and returns the first rejected property as a diagnostic. */
|
|
15
|
+
export function parse(input: unknown): Native.Output {
|
|
16
|
+
const value = Targets.copy(input)
|
|
17
|
+
const root = data.nodes[data.root]!
|
|
18
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
19
|
+
throw new Error('Expected a native declaration record.')
|
|
20
|
+
for (const [key, property] of Object.entries(value)) {
|
|
21
|
+
if (!Object.hasOwn(root.properties!, key))
|
|
22
|
+
throw new Error(`Unknown native property: ${key}.`)
|
|
23
|
+
if (!matches(root.properties![key]!.value, property))
|
|
24
|
+
throw new Error(`Invalid static native value for ${key}.`)
|
|
25
|
+
}
|
|
26
|
+
const transforms = (value as Native.Output).transform
|
|
27
|
+
if (Array.isArray(transforms)) {
|
|
28
|
+
if (transforms.length > 1 && transforms.some((entry) => 'matrix' in entry))
|
|
29
|
+
throw new Error('A native matrix must be the only transform entry.')
|
|
30
|
+
for (const entry of transforms)
|
|
31
|
+
if ('matrix' in entry && ![9, 16].includes(entry.matrix.length))
|
|
32
|
+
throw new Error('Native matrices require nine or sixteen numbers.')
|
|
33
|
+
}
|
|
34
|
+
return value as Native.Output
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function matches(id: number, value: unknown): boolean {
|
|
38
|
+
const node = data.nodes[id]!
|
|
39
|
+
switch (node.kind) {
|
|
40
|
+
case 'tuple':
|
|
41
|
+
return (
|
|
42
|
+
Array.isArray(value) &&
|
|
43
|
+
value.length === node.values!.length &&
|
|
44
|
+
node.values!.every((entry, index) => matches(entry, value[index]))
|
|
45
|
+
)
|
|
46
|
+
case 'array':
|
|
47
|
+
return (
|
|
48
|
+
Array.isArray(value) &&
|
|
49
|
+
value.every((entry) => matches(node.value as number, entry))
|
|
50
|
+
)
|
|
51
|
+
case 'literal':
|
|
52
|
+
return value === node.value
|
|
53
|
+
case 'never':
|
|
54
|
+
return false
|
|
55
|
+
case 'number':
|
|
56
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
57
|
+
case 'object': {
|
|
58
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
59
|
+
return false
|
|
60
|
+
const record = value as Record<string, unknown>
|
|
61
|
+
return (
|
|
62
|
+
Object.keys(record).every((key) =>
|
|
63
|
+
Object.hasOwn(node.properties!, key),
|
|
64
|
+
) &&
|
|
65
|
+
Object.entries(node.properties!).every(([key, property]) =>
|
|
66
|
+
!Object.hasOwn(record, key)
|
|
67
|
+
? property.optional
|
|
68
|
+
: matches(property.value, record[key]),
|
|
69
|
+
)
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
case 'percentage':
|
|
73
|
+
return (
|
|
74
|
+
typeof value === 'string' &&
|
|
75
|
+
/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?%$/i.test(value) &&
|
|
76
|
+
Number.isFinite(Number(value.slice(0, -1)))
|
|
77
|
+
)
|
|
78
|
+
case 'string':
|
|
79
|
+
return typeof value === 'string'
|
|
80
|
+
case 'undefined':
|
|
81
|
+
return value === undefined
|
|
82
|
+
case 'union':
|
|
83
|
+
return node.values!.some((entry) => matches(entry, value))
|
|
84
|
+
default:
|
|
85
|
+
throw new Error(`Unclassified native schema kind: ${node.kind}`)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** React lifecycle for automatically compiled native styling. @module */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
import * as NativeContext from '../runtime/NativeContext.js'
|
|
4
|
+
|
|
5
|
+
const context = React.createContext(styles(undefined))
|
|
6
|
+
|
|
7
|
+
/** Supplies theme and resolved device appearance to compiled native components. */
|
|
8
|
+
export function Provider(props: Provider.Props) {
|
|
9
|
+
if (
|
|
10
|
+
(props.colorScheme !== 'light' && props.colorScheme !== 'dark') ||
|
|
11
|
+
(props.theme !== undefined &&
|
|
12
|
+
(typeof props.theme !== 'string' || !props.theme.trim()))
|
|
13
|
+
)
|
|
14
|
+
throw new Error(
|
|
15
|
+
'Native appearance requires a resolved light/dark scheme and a nonempty theme name.',
|
|
16
|
+
)
|
|
17
|
+
const value = React.useMemo(
|
|
18
|
+
() => styles({ colorScheme: props.colorScheme, theme: props.theme }),
|
|
19
|
+
[props.colorScheme, props.theme],
|
|
20
|
+
)
|
|
21
|
+
return React.createElement(context.Provider, { value }, props.children)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Application boundary inputs. Pass React Native's useColorScheme result with a light fallback. */
|
|
25
|
+
export declare namespace Provider {
|
|
26
|
+
/** Theme selection and resolved appearance for this React subtree. */
|
|
27
|
+
type Props = NativeContext.Context & {
|
|
28
|
+
/** Components that consume compiled native styles. */
|
|
29
|
+
readonly children?: React.ReactNode | undefined
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** Compiler-inserted unconditional subscription, including memoized components. */
|
|
34
|
+
export function useStyles() {
|
|
35
|
+
return React.useContext(context)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function styles(value: NativeContext.Context | undefined) {
|
|
39
|
+
return {
|
|
40
|
+
style: (style: unknown, input?: unknown) =>
|
|
41
|
+
NativeContext.resolve(style, value, input),
|
|
42
|
+
props: (props: Record<string, unknown> | null | undefined) =>
|
|
43
|
+
props && Object.hasOwn(props, 'style')
|
|
44
|
+
? { ...props, style: NativeContext.resolve(props.style, value) }
|
|
45
|
+
: props,
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/reset.css
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Opt-in base reset. Font stacks are inlined because the reset ships as a
|
|
3
|
+
standalone stylesheet without a theme contract. The third-party MIT notice
|
|
4
|
+
covering this file is retained under themes/.
|
|
5
|
+
*/
|
|
6
|
+
@layer reset {
|
|
7
|
+
/* Border-box sizing, no default margins or padding, and a zero-width solid border ready for a width. */
|
|
8
|
+
*,
|
|
9
|
+
::after,
|
|
10
|
+
::before,
|
|
11
|
+
::backdrop,
|
|
12
|
+
::file-selector-button {
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
border: 0 solid;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Consistent line height, no iOS font scaling after orientation changes, a readable tab size, and no tap highlight. */
|
|
20
|
+
html,
|
|
21
|
+
:host {
|
|
22
|
+
line-height: 1.5;
|
|
23
|
+
-webkit-text-size-adjust: 100%;
|
|
24
|
+
tab-size: 4;
|
|
25
|
+
font-family:
|
|
26
|
+
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
|
|
27
|
+
'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
28
|
+
'Segoe UI Symbol', 'Noto Color Emoji';
|
|
29
|
+
font-feature-settings: normal;
|
|
30
|
+
font-variation-settings: normal;
|
|
31
|
+
-webkit-tap-highlight-color: transparent;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* Firefox height, inherited border color, and a 1px top border. */
|
|
35
|
+
hr {
|
|
36
|
+
height: 0;
|
|
37
|
+
color: inherit;
|
|
38
|
+
border-top-width: 1px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
abbr:where([title]) {
|
|
42
|
+
-webkit-text-decoration: underline dotted;
|
|
43
|
+
text-decoration: underline dotted;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
h1,
|
|
47
|
+
h2,
|
|
48
|
+
h3,
|
|
49
|
+
h4,
|
|
50
|
+
h5,
|
|
51
|
+
h6 {
|
|
52
|
+
font-size: inherit;
|
|
53
|
+
font-weight: inherit;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Links opt into styling instead of opting out. */
|
|
57
|
+
a {
|
|
58
|
+
color: inherit;
|
|
59
|
+
-webkit-text-decoration: inherit;
|
|
60
|
+
text-decoration: inherit;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
b,
|
|
64
|
+
strong {
|
|
65
|
+
font-weight: bolder;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Monospace stack and corrected em font sizing. */
|
|
69
|
+
code,
|
|
70
|
+
kbd,
|
|
71
|
+
samp,
|
|
72
|
+
pre {
|
|
73
|
+
font-family:
|
|
74
|
+
ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono',
|
|
75
|
+
'Courier New', monospace;
|
|
76
|
+
font-feature-settings: normal;
|
|
77
|
+
font-variation-settings: normal;
|
|
78
|
+
font-size: 1em;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
small {
|
|
82
|
+
font-size: 80%;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Subscripts and superscripts keep the surrounding line height. */
|
|
86
|
+
sub,
|
|
87
|
+
sup {
|
|
88
|
+
font-size: 75%;
|
|
89
|
+
line-height: 0;
|
|
90
|
+
position: relative;
|
|
91
|
+
vertical-align: baseline;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
sub {
|
|
95
|
+
bottom: -0.25em;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
sup {
|
|
99
|
+
top: -0.5em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* No text indentation, inherited border color, and collapsed borders in tables. */
|
|
103
|
+
table {
|
|
104
|
+
text-indent: 0;
|
|
105
|
+
border-color: inherit;
|
|
106
|
+
border-collapse: collapse;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:-moz-focusring:where(:not(iframe)) {
|
|
110
|
+
outline: auto;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
progress {
|
|
114
|
+
vertical-align: baseline;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
summary {
|
|
118
|
+
display: list-item;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
ol,
|
|
122
|
+
ul,
|
|
123
|
+
menu {
|
|
124
|
+
list-style: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* Replaced elements are block-level and middle-aligned. */
|
|
128
|
+
img,
|
|
129
|
+
svg,
|
|
130
|
+
video,
|
|
131
|
+
canvas,
|
|
132
|
+
audio,
|
|
133
|
+
iframe,
|
|
134
|
+
embed,
|
|
135
|
+
object {
|
|
136
|
+
display: block;
|
|
137
|
+
vertical-align: middle;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
img,
|
|
141
|
+
video {
|
|
142
|
+
max-width: 100%;
|
|
143
|
+
height: auto;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* Form controls inherit typography and drop browser radii, backgrounds, and disabled opacity. */
|
|
147
|
+
button,
|
|
148
|
+
input,
|
|
149
|
+
select,
|
|
150
|
+
optgroup,
|
|
151
|
+
textarea,
|
|
152
|
+
::file-selector-button {
|
|
153
|
+
font: inherit;
|
|
154
|
+
font-feature-settings: inherit;
|
|
155
|
+
font-variation-settings: inherit;
|
|
156
|
+
letter-spacing: inherit;
|
|
157
|
+
color: inherit;
|
|
158
|
+
border-radius: 0;
|
|
159
|
+
background-color: transparent;
|
|
160
|
+
opacity: 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
:where(select:is([multiple], [size])) optgroup {
|
|
164
|
+
font-weight: bolder;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
:where(select:is([multiple], [size])) optgroup option {
|
|
168
|
+
padding-inline-start: 20px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
::file-selector-button {
|
|
172
|
+
margin-inline-end: 4px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
::placeholder {
|
|
176
|
+
opacity: 1;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* Placeholder color mixes currentcolor only in browsers that do not crash on it. */
|
|
180
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) or
|
|
181
|
+
(contain-intrinsic-size: 1px) {
|
|
182
|
+
::placeholder {
|
|
183
|
+
color: color-mix(in oklab, currentcolor 50%, transparent);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
textarea {
|
|
188
|
+
resize: vertical;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
::-webkit-search-decoration {
|
|
192
|
+
-webkit-appearance: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* Date and time inputs keep a stable height and alignment in Safari. */
|
|
196
|
+
::-webkit-date-and-time-value {
|
|
197
|
+
min-height: 1lh;
|
|
198
|
+
text-align: inherit;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
::-webkit-datetime-edit {
|
|
202
|
+
display: inline-flex;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
::-webkit-datetime-edit-fields-wrapper {
|
|
206
|
+
padding: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
::-webkit-datetime-edit,
|
|
210
|
+
::-webkit-datetime-edit-year-field,
|
|
211
|
+
::-webkit-datetime-edit-month-field,
|
|
212
|
+
::-webkit-datetime-edit-day-field,
|
|
213
|
+
::-webkit-datetime-edit-hour-field,
|
|
214
|
+
::-webkit-datetime-edit-minute-field,
|
|
215
|
+
::-webkit-datetime-edit-second-field,
|
|
216
|
+
::-webkit-datetime-edit-millisecond-field,
|
|
217
|
+
::-webkit-datetime-edit-meridiem-field {
|
|
218
|
+
padding-block: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
::-webkit-calendar-picker-indicator {
|
|
222
|
+
line-height: 1;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
:-moz-ui-invalid {
|
|
226
|
+
box-shadow: none;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Button appearance keeps border radius stylable in iOS Safari. */
|
|
230
|
+
button,
|
|
231
|
+
input:where([type='button'], [type='reset'], [type='submit']),
|
|
232
|
+
::file-selector-button {
|
|
233
|
+
appearance: button;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
::-webkit-inner-spin-button,
|
|
237
|
+
::-webkit-outer-spin-button {
|
|
238
|
+
height: auto;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
[hidden]:where(:not([hidden='until-found'])) {
|
|
242
|
+
display: none !important;
|
|
243
|
+
}
|
|
244
|
+
}
|