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,77 @@
|
|
|
1
|
+
/** Refines CSS numeric token spellings entirely within TypeScript. @module */
|
|
2
|
+
type Digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
|
|
3
|
+
|
|
4
|
+
type Digits<
|
|
5
|
+
text extends string,
|
|
6
|
+
prefix extends string = '',
|
|
7
|
+
> = text extends `${infer first}${infer rest}`
|
|
8
|
+
? first extends Digit
|
|
9
|
+
? Digits<rest, `${prefix}${first}`>
|
|
10
|
+
: readonly [prefix, text]
|
|
11
|
+
: readonly [prefix, '']
|
|
12
|
+
|
|
13
|
+
type Exponent<
|
|
14
|
+
text extends string,
|
|
15
|
+
integer extends boolean,
|
|
16
|
+
> = text extends `${'e' | 'E'}${infer rest}`
|
|
17
|
+
? Digits<Sign<rest>> extends readonly [
|
|
18
|
+
infer digits extends string,
|
|
19
|
+
infer unit extends string,
|
|
20
|
+
]
|
|
21
|
+
? digits extends ''
|
|
22
|
+
? readonly [text, integer]
|
|
23
|
+
: readonly [unit, false]
|
|
24
|
+
: never
|
|
25
|
+
: readonly [text, integer]
|
|
26
|
+
|
|
27
|
+
type Sign<text extends string> = text extends `${'+' | '-'}${infer rest}`
|
|
28
|
+
? rest
|
|
29
|
+
: text
|
|
30
|
+
|
|
31
|
+
type Zeros<text extends string> = text extends ''
|
|
32
|
+
? true
|
|
33
|
+
: text extends `${'0' | '.'}${infer rest}`
|
|
34
|
+
? Zeros<rest>
|
|
35
|
+
: false
|
|
36
|
+
|
|
37
|
+
/** Checks a complete CSS number or integer token without allowing JavaScript radix syntax. */
|
|
38
|
+
export type Checked<
|
|
39
|
+
value extends string | number,
|
|
40
|
+
integer extends boolean = false,
|
|
41
|
+
> = `${number}` extends `${value}`
|
|
42
|
+
? value
|
|
43
|
+
: [Parse<`${value}`>] extends [never]
|
|
44
|
+
? never
|
|
45
|
+
: Parse<`${value}`> extends readonly ['', infer whole extends boolean]
|
|
46
|
+
? integer extends true
|
|
47
|
+
? whole extends true
|
|
48
|
+
? value
|
|
49
|
+
: never
|
|
50
|
+
: value
|
|
51
|
+
: never
|
|
52
|
+
|
|
53
|
+
/** Returns the unconsumed unit and whether the number has integer token syntax. */
|
|
54
|
+
export type Parse<text extends string> =
|
|
55
|
+
Digits<Sign<text>> extends readonly [
|
|
56
|
+
infer digits extends string,
|
|
57
|
+
infer rest extends string,
|
|
58
|
+
]
|
|
59
|
+
? rest extends `.${infer fraction}`
|
|
60
|
+
? Digits<fraction> extends readonly [
|
|
61
|
+
infer decimal extends string,
|
|
62
|
+
infer unit extends string,
|
|
63
|
+
]
|
|
64
|
+
? decimal extends ''
|
|
65
|
+
? never
|
|
66
|
+
: Exponent<unit, false>
|
|
67
|
+
: never
|
|
68
|
+
: digits extends ''
|
|
69
|
+
? never
|
|
70
|
+
: Exponent<rest, true>
|
|
71
|
+
: never
|
|
72
|
+
|
|
73
|
+
/** Identifies signed zero mantissas for nonnegative and positive range constraints. */
|
|
74
|
+
export type Zero<value extends string | number> =
|
|
75
|
+
Sign<`${value}`> extends `${infer mantissa}${'e' | 'E'}${string}`
|
|
76
|
+
? Zeros<mantissa>
|
|
77
|
+
: Zeros<Sign<`${value}`>>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** Carries compile-time query metadata separately from declaration variables. @module */
|
|
2
|
+
import * as Literal from './Literal.js'
|
|
3
|
+
|
|
4
|
+
/** Named thresholds and eligible container identities. */
|
|
5
|
+
export type Metadata = {
|
|
6
|
+
readonly breakpoints: Readonly<Record<string, string>>
|
|
7
|
+
readonly containerNames: readonly string[]
|
|
8
|
+
readonly containers: Readonly<Record<string, string>>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Supported fixed nonnegative threshold lengths. */
|
|
12
|
+
export type Length = Exclude<Literal.Length, `${number}%` | number | '0'>
|
|
13
|
+
|
|
14
|
+
/** Checks threshold structure without converting relative CSS units. */
|
|
15
|
+
export function threshold(value: unknown): value is string {
|
|
16
|
+
if (typeof value !== 'string') return false
|
|
17
|
+
|
|
18
|
+
const match = /^([+]?(?:\d*\.\d+|\d+)(?:[eE][+-]?\d+)?)([a-z]+)$/i.exec(value)
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
!!match &&
|
|
22
|
+
Number.isFinite(Number(match[1])) &&
|
|
23
|
+
Literal.lengthUnits.some(
|
|
24
|
+
(unit) => unit.toLowerCase() === match[2]!.toLowerCase(),
|
|
25
|
+
) &&
|
|
26
|
+
match[2] !== '%'
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Resolves exact named width comparisons and ranges; raw conditions pass through. */
|
|
31
|
+
export function resolve(key: string, metadata: Metadata): string {
|
|
32
|
+
const match = /^@(media|container)[ \t\n\r\f]+([\s\S]+)$/.exec(
|
|
33
|
+
key.replace(/\/\*[^]*?\*\//g, ' '),
|
|
34
|
+
)
|
|
35
|
+
if (!match) return key
|
|
36
|
+
|
|
37
|
+
const kind = match[1]!
|
|
38
|
+
const text = match[2]!.trim()
|
|
39
|
+
if (
|
|
40
|
+
text.includes('(') ||
|
|
41
|
+
(kind === 'media' &&
|
|
42
|
+
/^(?:(?:only|not)\s+)?(?:all|print|screen)(?:\s|,|$)/i.test(text))
|
|
43
|
+
)
|
|
44
|
+
return key
|
|
45
|
+
const pieces = text.split(/[ \t\n\r\f]+/)
|
|
46
|
+
|
|
47
|
+
const name =
|
|
48
|
+
kind === 'container' && pieces.length === 2 ? pieces.shift() : undefined
|
|
49
|
+
if (name && !metadata.containerNames.includes(name))
|
|
50
|
+
throw new Error('Unknown container name.')
|
|
51
|
+
|
|
52
|
+
if (pieces.length !== 1) throw new Error('Malformed query alias.')
|
|
53
|
+
|
|
54
|
+
const alias = pieces[0]!
|
|
55
|
+
const values = kind === 'media' ? metadata.breakpoints : metadata.containers
|
|
56
|
+
|
|
57
|
+
const read = (name: string) => {
|
|
58
|
+
const value = Object.hasOwn(values, name) ? values[name] : undefined
|
|
59
|
+
if (value === undefined) throw new Error('Unknown query threshold.')
|
|
60
|
+
|
|
61
|
+
return value
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const condition = (() => {
|
|
65
|
+
if (alias.includes('..')) {
|
|
66
|
+
const range = alias.split('..')
|
|
67
|
+
if (range.length !== 2) throw new Error('Malformed query range.')
|
|
68
|
+
|
|
69
|
+
const lower = read(range[0]!)
|
|
70
|
+
const upper = read(range[1]!)
|
|
71
|
+
const unit = (value: string) =>
|
|
72
|
+
value
|
|
73
|
+
.replace(/^[+]?(?:\d*\.\d+|\d+)(?:[eE][+-]?\d+)?/, '')
|
|
74
|
+
.toLowerCase()
|
|
75
|
+
if (unit(lower) === unit(upper) && parseFloat(lower) >= parseFloat(upper))
|
|
76
|
+
throw new Error('Query range must increase.')
|
|
77
|
+
|
|
78
|
+
return `${lower} <= width < ${upper}`
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (alias.startsWith('<')) return `width < ${read(alias.slice(1))}`
|
|
82
|
+
|
|
83
|
+
return `width >= ${read(alias.startsWith('>=') ? alias.slice(2) : alias)}`
|
|
84
|
+
})()
|
|
85
|
+
|
|
86
|
+
return `@${kind} ${name ? `${name} ` : ''}(${condition})`
|
|
87
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Retains ordered finite recipe alternatives independently of an output target. @module */
|
|
2
|
+
import type * as Style from '../Style.js'
|
|
3
|
+
|
|
4
|
+
/** Static recipe data shared by source extraction and target compilers. */
|
|
5
|
+
export type Definition<value = Style.Definition> = {
|
|
6
|
+
/** Ordered axes and their finite choice names. */
|
|
7
|
+
readonly axes: Readonly<Record<string, readonly string[]>>
|
|
8
|
+
/** Default choices, with null suppressing an axis. */
|
|
9
|
+
readonly defaults: Readonly<Record<string, string | null>>
|
|
10
|
+
/** Base, choices, and compounds in application order. */
|
|
11
|
+
readonly rules: readonly {
|
|
12
|
+
/** Required choices by axis. An empty list always matches. */
|
|
13
|
+
readonly matches: readonly (readonly [string, readonly string[]])[]
|
|
14
|
+
/** Target-independent declarations or their compiled value. */
|
|
15
|
+
readonly value: value
|
|
16
|
+
}[]
|
|
17
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/** Distinguishes compiler-owned CSS identities from unrelated declaration domains. @module */
|
|
2
|
+
declare const reference: unique symbol
|
|
3
|
+
/** Supported named stylesheet identity domains. */
|
|
4
|
+
export type Kind =
|
|
5
|
+
| 'colorProfile'
|
|
6
|
+
| 'counterStyle'
|
|
7
|
+
| 'cssFunction'
|
|
8
|
+
| 'customMedia'
|
|
9
|
+
| 'fontPaletteValues'
|
|
10
|
+
| 'positionTry'
|
|
11
|
+
/** A fixed CSS name whose domain remains visible to authoring types. */
|
|
12
|
+
export type Reference<kind extends Kind> = (kind extends 'counterStyle'
|
|
13
|
+
? string
|
|
14
|
+
: `--${string}`) & {
|
|
15
|
+
readonly [reference]: kind
|
|
16
|
+
}
|
|
17
|
+
/** Rejects named references outside their property's CSS identity domain. */
|
|
18
|
+
export type Check<value, property> = typeof reference extends keyof value
|
|
19
|
+
? value[typeof reference] extends Domain<property>
|
|
20
|
+
? unknown
|
|
21
|
+
: never
|
|
22
|
+
: value extends readonly unknown[]
|
|
23
|
+
? { [index in keyof value]: Check<value[index], property> }
|
|
24
|
+
: unknown
|
|
25
|
+
|
|
26
|
+
type Domain<property> = property extends `--${string}`
|
|
27
|
+
? Kind
|
|
28
|
+
: property extends 'fallback' | 'listStyle' | 'listStyleType' | 'speakAs'
|
|
29
|
+
? 'counterStyle'
|
|
30
|
+
: property extends 'fontPalette'
|
|
31
|
+
? 'fontPaletteValues'
|
|
32
|
+
: property extends 'positionTry' | 'positionTryFallbacks'
|
|
33
|
+
? 'positionTry'
|
|
34
|
+
: never
|
|
35
|
+
/** Checks domain-sensitive descriptor members without widening literals. */
|
|
36
|
+
export type Checked<value> = { [key in keyof value]: Check<value[key], key> }
|
|
37
|
+
|
|
38
|
+
/** Checks the domain of a compiler-owned identity at untyped source boundaries. */
|
|
39
|
+
export function accepts(kind: Kind, property: string): boolean {
|
|
40
|
+
if (kind === 'cssFunction') return true
|
|
41
|
+
if (kind === 'customMedia') return false
|
|
42
|
+
if (property.startsWith('--')) return true
|
|
43
|
+
if (kind === 'counterStyle')
|
|
44
|
+
return [
|
|
45
|
+
'fallback',
|
|
46
|
+
'listStyle',
|
|
47
|
+
'listStyleType',
|
|
48
|
+
'speakAs',
|
|
49
|
+
'system',
|
|
50
|
+
].includes(property)
|
|
51
|
+
if (kind === 'fontPaletteValues') return property === 'fontPalette'
|
|
52
|
+
if (kind === 'positionTry')
|
|
53
|
+
return ['positionTry', 'positionTryFallbacks'].includes(property)
|
|
54
|
+
return false
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Permits profile identities only as the color-space argument of color(). */
|
|
58
|
+
export function acceptsExpression(
|
|
59
|
+
kind: Kind,
|
|
60
|
+
property: string,
|
|
61
|
+
prefix: string,
|
|
62
|
+
): boolean {
|
|
63
|
+
if (kind === 'colorProfile') {
|
|
64
|
+
const text = prefix.replace(/\/\*[\s\S]*?\*\//g, ' ')
|
|
65
|
+
const groups: { name: string; start: number }[] = []
|
|
66
|
+
let quote = ''
|
|
67
|
+
for (let index = 0; index < text.length; index++) {
|
|
68
|
+
const char = text[index]!
|
|
69
|
+
if (char === '\\') {
|
|
70
|
+
index++
|
|
71
|
+
continue
|
|
72
|
+
}
|
|
73
|
+
if (quote) {
|
|
74
|
+
if (char === quote) quote = ''
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
if (char === '"' || char === "'") {
|
|
78
|
+
quote = char
|
|
79
|
+
continue
|
|
80
|
+
}
|
|
81
|
+
if (char === '(')
|
|
82
|
+
groups.push({
|
|
83
|
+
name:
|
|
84
|
+
text
|
|
85
|
+
.slice(0, index)
|
|
86
|
+
.match(/[\w-]+$/)?.[0]
|
|
87
|
+
?.toLowerCase() ?? '',
|
|
88
|
+
start: index + 1,
|
|
89
|
+
})
|
|
90
|
+
else if (char === ')') groups.pop()
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const group = groups.at(-1)
|
|
94
|
+
if (quote || group?.name !== 'color') return false
|
|
95
|
+
const body = text.slice(group.start)
|
|
96
|
+
if (!body.trim()) return true
|
|
97
|
+
|
|
98
|
+
return /^\s*from\s+(?:#[\da-f]+|[-\w]+(?:\([\s\S]*\))?)\s+$/i.test(body)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return accepts(kind, property)
|
|
102
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Names the stylesheet classes that select a color scheme beside a theme scope. @module */
|
|
2
|
+
|
|
3
|
+
/** Supported scheme selections. */
|
|
4
|
+
export type Name = 'dark' | 'light' | 'light dark'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Compiled class per scheme. Carrying `color-scheme` in stylesheet rules lets
|
|
8
|
+
* Lightning CSS initialize its lowered `light-dark()` helpers when a downstream
|
|
9
|
+
* bundler targets browsers without native support; inline styles cannot.
|
|
10
|
+
*/
|
|
11
|
+
export const classes: Readonly<Record<Name, string>> = Object.freeze({
|
|
12
|
+
dark: 'z_scheme-dark',
|
|
13
|
+
light: 'z_scheme-light',
|
|
14
|
+
'light dark': 'z_scheme-light-dark',
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
/** Selection rules emitted once beside each stylesheet's theme scopes. */
|
|
18
|
+
export const css = (Object.keys(classes) as Name[])
|
|
19
|
+
.map((scheme) => `.${classes[scheme]}{color-scheme:${scheme};}`)
|
|
20
|
+
.join('\n')
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** Validates ordered configuration property aliases without interpreting CSS values. @module */
|
|
2
|
+
import * as Literal from './Literal.js'
|
|
3
|
+
|
|
4
|
+
/** Explicit aliases, each expanding in its declared target order. */
|
|
5
|
+
export type Map = Readonly<Record<string, readonly [Property, ...Property[]]>>
|
|
6
|
+
/** Standard properties accepted as alias targets. */
|
|
7
|
+
export type Property = Exclude<keyof Literal.Properties, `--${string}`>
|
|
8
|
+
|
|
9
|
+
/** Copies validated configuration data; throws for invalid aliases or targets. */
|
|
10
|
+
export function read(value: unknown): Map {
|
|
11
|
+
if (
|
|
12
|
+
!value ||
|
|
13
|
+
typeof value !== 'object' ||
|
|
14
|
+
Array.isArray(value) ||
|
|
15
|
+
(Object.getPrototypeOf(value) !== null &&
|
|
16
|
+
Object.getPrototypeOf(value) !== Object.prototype)
|
|
17
|
+
)
|
|
18
|
+
throw new Error('shorthands must be a property mapping record.')
|
|
19
|
+
|
|
20
|
+
const entries = Object.entries(Object.getOwnPropertyDescriptors(value))
|
|
21
|
+
|
|
22
|
+
return Object.freeze(
|
|
23
|
+
Object.setPrototypeOf(
|
|
24
|
+
Object.fromEntries(
|
|
25
|
+
entries.map(([name, descriptor]) => {
|
|
26
|
+
if (
|
|
27
|
+
!name ||
|
|
28
|
+
name.startsWith(':') ||
|
|
29
|
+
name.startsWith('@') ||
|
|
30
|
+
name.startsWith('--') ||
|
|
31
|
+
name.includes('&') ||
|
|
32
|
+
Object.hasOwn(Literal.rules, name) ||
|
|
33
|
+
[
|
|
34
|
+
'style',
|
|
35
|
+
'theme',
|
|
36
|
+
'themes',
|
|
37
|
+
'typography',
|
|
38
|
+
'script',
|
|
39
|
+
'variants',
|
|
40
|
+
'__proto__',
|
|
41
|
+
].includes(name)
|
|
42
|
+
)
|
|
43
|
+
throw new Error(`Invalid shorthand name: ${name}`)
|
|
44
|
+
|
|
45
|
+
const targets: unknown = descriptor.value
|
|
46
|
+
if (
|
|
47
|
+
!('value' in descriptor) ||
|
|
48
|
+
!Array.isArray(targets) ||
|
|
49
|
+
!targets.length
|
|
50
|
+
)
|
|
51
|
+
throw new Error(
|
|
52
|
+
`Shorthand ${name} requires a nonempty property tuple.`,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
const result: Property[] = []
|
|
56
|
+
|
|
57
|
+
for (let index = 0; index < targets.length; index++) {
|
|
58
|
+
const target: unknown = Object.getOwnPropertyDescriptor(
|
|
59
|
+
targets,
|
|
60
|
+
String(index),
|
|
61
|
+
)?.value
|
|
62
|
+
if (
|
|
63
|
+
typeof target !== 'string' ||
|
|
64
|
+
!Object.hasOwn(Literal.rules, target) ||
|
|
65
|
+
result.includes(target as Property)
|
|
66
|
+
)
|
|
67
|
+
throw new Error(
|
|
68
|
+
`Shorthand ${name} requires unique standard properties.`,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
result.push(target as Property)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return [name, Object.freeze(result)]
|
|
75
|
+
}),
|
|
76
|
+
),
|
|
77
|
+
null,
|
|
78
|
+
),
|
|
79
|
+
) as Map
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** Canonicalizes alias names while preserving each ordered target tuple. */
|
|
83
|
+
export function signature(value: unknown): string {
|
|
84
|
+
return JSON.stringify(
|
|
85
|
+
Object.entries(read(value === undefined ? {} : value)).sort(([a], [b]) =>
|
|
86
|
+
a < b ? -1 : a > b ? 1 : 0,
|
|
87
|
+
),
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** Rejects duplicate targets and names reserved by the authoring surface. */
|
|
92
|
+
export type Validated<mappings extends Map> = {
|
|
93
|
+
[key in keyof mappings]: key extends string
|
|
94
|
+
? key extends
|
|
95
|
+
| keyof Literal.Properties
|
|
96
|
+
| `:${string}`
|
|
97
|
+
| `@${string}`
|
|
98
|
+
| `${string}&${string}`
|
|
99
|
+
| 'style'
|
|
100
|
+
| 'theme'
|
|
101
|
+
| 'themes'
|
|
102
|
+
| 'typography'
|
|
103
|
+
| 'script'
|
|
104
|
+
| 'variants'
|
|
105
|
+
| '__proto__'
|
|
106
|
+
| ''
|
|
107
|
+
? never
|
|
108
|
+
: Unique<mappings[key]>
|
|
109
|
+
: never
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
type Unique<
|
|
113
|
+
targets extends readonly Property[],
|
|
114
|
+
seen extends Property = never,
|
|
115
|
+
> = targets extends readonly [
|
|
116
|
+
infer target extends Property,
|
|
117
|
+
...infer rest extends readonly Property[],
|
|
118
|
+
]
|
|
119
|
+
? target extends seen
|
|
120
|
+
? never
|
|
121
|
+
: Unique<rest, seen | target>
|
|
122
|
+
: unknown
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/** Copies static target data without retaining or freezing caller-owned objects. @module */
|
|
2
|
+
import type * as Native from './NativeProperties.js'
|
|
3
|
+
import type * as Style from '../Style.js'
|
|
4
|
+
|
|
5
|
+
/** Type-only authoring data retained for destination component compatibility. */
|
|
6
|
+
export declare const authored: unique symbol
|
|
7
|
+
|
|
8
|
+
/** Per-style destination domains, computed only when a compiler consumes them. */
|
|
9
|
+
export type Domains<input> = [input] extends [never]
|
|
10
|
+
? unknown
|
|
11
|
+
: {
|
|
12
|
+
[key in keyof input]: {
|
|
13
|
+
android: Overflow<input[key], 'android'>
|
|
14
|
+
ios: Overflow<input[key], 'ios'>
|
|
15
|
+
native: Overflow<input[key], undefined>
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Retains the selected overflow domain, which differs between Image and View. */
|
|
20
|
+
export type Overflow<input, platform> = Merge<
|
|
21
|
+
Value<input>,
|
|
22
|
+
Merge<
|
|
23
|
+
Value<Branch<input, 'native'>>,
|
|
24
|
+
platform extends 'ios' | 'android'
|
|
25
|
+
? Value<Branch<input, platform>>
|
|
26
|
+
: undefined
|
|
27
|
+
>
|
|
28
|
+
>
|
|
29
|
+
type Branch<input, key extends PropertyKey> = input extends {
|
|
30
|
+
readonly targets?: infer targets
|
|
31
|
+
}
|
|
32
|
+
? key extends keyof NonNullable<targets>
|
|
33
|
+
? NonNullable<targets>[key]
|
|
34
|
+
: never
|
|
35
|
+
: never
|
|
36
|
+
type Value<input> = [input] extends [never]
|
|
37
|
+
? undefined
|
|
38
|
+
: 'overflow' extends keyof NonNullable<input>
|
|
39
|
+
? NonNullable<input>['overflow']
|
|
40
|
+
: undefined
|
|
41
|
+
type Merge<before, after> =
|
|
42
|
+
| Exclude<after, undefined>
|
|
43
|
+
| (undefined extends after ? before : never)
|
|
44
|
+
|
|
45
|
+
/** Checks nested native literal keys without accepting host-owned values. */
|
|
46
|
+
export type Checked<input, expected> = expected extends unknown
|
|
47
|
+
? input extends expected
|
|
48
|
+
? input extends readonly unknown[]
|
|
49
|
+
? expected extends readonly (infer value)[]
|
|
50
|
+
? readonly Checked<input[number], value>[]
|
|
51
|
+
: never
|
|
52
|
+
: input extends object
|
|
53
|
+
? {
|
|
54
|
+
[key in keyof input]: key extends keyof expected
|
|
55
|
+
? Checked<input[key], expected[key]>
|
|
56
|
+
: never
|
|
57
|
+
}
|
|
58
|
+
: input
|
|
59
|
+
: never
|
|
60
|
+
: never
|
|
61
|
+
|
|
62
|
+
/** Checks only authored native properties against their destination domains. */
|
|
63
|
+
export type Declarations<input> = input extends undefined
|
|
64
|
+
? undefined
|
|
65
|
+
: input extends (...args: never[]) => unknown
|
|
66
|
+
? never
|
|
67
|
+
: input extends object
|
|
68
|
+
? {
|
|
69
|
+
[key in keyof input]: key extends keyof Native.Properties
|
|
70
|
+
? Checked<input[key], Native.Properties[key]>
|
|
71
|
+
: never
|
|
72
|
+
}
|
|
73
|
+
: never
|
|
74
|
+
|
|
75
|
+
/** Retained compiler data for native and platform-specific declarations. */
|
|
76
|
+
export type NativeBranches = {
|
|
77
|
+
/** Android overrides applied after the common native branch. */
|
|
78
|
+
readonly android?: Native.Properties | undefined
|
|
79
|
+
/** iOS overrides applied after the common native branch. */
|
|
80
|
+
readonly ios?: Native.Properties | undefined
|
|
81
|
+
/** Declarations using native value semantics. */
|
|
82
|
+
readonly native?: Native.Properties | undefined
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Copies only finite primitives, dense arrays, and plain enumerable data records. */
|
|
86
|
+
export function copy(
|
|
87
|
+
value: unknown,
|
|
88
|
+
path: readonly string[] = [],
|
|
89
|
+
depth = 0,
|
|
90
|
+
): unknown {
|
|
91
|
+
if (depth > 64)
|
|
92
|
+
throw new Error(`Target nesting exceeds 64 levels at ${path.join('.')}.`)
|
|
93
|
+
if (
|
|
94
|
+
value === undefined ||
|
|
95
|
+
value === null ||
|
|
96
|
+
typeof value === 'string' ||
|
|
97
|
+
typeof value === 'boolean'
|
|
98
|
+
)
|
|
99
|
+
return value
|
|
100
|
+
if (typeof value === 'number' && Number.isFinite(value)) return value
|
|
101
|
+
if (!value || typeof value !== 'object')
|
|
102
|
+
throw new Error(`Expected static native data at ${path.join('.')}.`)
|
|
103
|
+
const array = Array.isArray(value)
|
|
104
|
+
const prototype = Object.getPrototypeOf(value)
|
|
105
|
+
if (!array && prototype !== null && prototype !== Object.prototype) {
|
|
106
|
+
const constructor = Object.getOwnPropertyDescriptor(
|
|
107
|
+
prototype,
|
|
108
|
+
'constructor',
|
|
109
|
+
)?.value
|
|
110
|
+
if (
|
|
111
|
+
Object.getPrototypeOf(prototype) !== null ||
|
|
112
|
+
typeof constructor !== 'function' ||
|
|
113
|
+
Function.prototype.toString.call(constructor) !==
|
|
114
|
+
Function.prototype.toString.call(Object)
|
|
115
|
+
)
|
|
116
|
+
throw new Error(
|
|
117
|
+
`Host-owned objects are not static target data at ${path.join('.')}.`,
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
const output: Record<string, unknown> = Object.create(null)
|
|
121
|
+
for (const key of Reflect.ownKeys(value)) {
|
|
122
|
+
if (array && key === 'length') continue
|
|
123
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key)!
|
|
124
|
+
if (
|
|
125
|
+
typeof key !== 'string' ||
|
|
126
|
+
!descriptor.enumerable ||
|
|
127
|
+
!('value' in descriptor)
|
|
128
|
+
)
|
|
129
|
+
throw new Error(
|
|
130
|
+
`Target data must not contain accessors or symbols at ${path.join('.')}.`,
|
|
131
|
+
)
|
|
132
|
+
if (!array && descriptor.value === undefined) continue
|
|
133
|
+
output[key] = copy(descriptor.value, [...path, key], depth + 1)
|
|
134
|
+
}
|
|
135
|
+
if (!array) return Object.freeze(output)
|
|
136
|
+
if (
|
|
137
|
+
Object.keys(output).length !== value.length ||
|
|
138
|
+
Object.keys(output).some((key, index) => key !== String(index))
|
|
139
|
+
)
|
|
140
|
+
throw new Error(
|
|
141
|
+
`Target arrays must contain dense data entries at ${path.join('.')}.`,
|
|
142
|
+
)
|
|
143
|
+
return Object.freeze(Object.values(output))
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Selects web overrides without passing native declarations to the CSS compiler. */
|
|
147
|
+
export function web<name extends string>(
|
|
148
|
+
style: Style.NamedStyle<name>,
|
|
149
|
+
): Style.NamedStyle<name> {
|
|
150
|
+
const rules = style.rules?.map((rule) => ({
|
|
151
|
+
...rule,
|
|
152
|
+
style: web(rule.style),
|
|
153
|
+
}))
|
|
154
|
+
const { targets, ...body } = style
|
|
155
|
+
const shared = rules ? { ...body, rules } : body
|
|
156
|
+
if (!targets?.web) return shared
|
|
157
|
+
return {
|
|
158
|
+
...shared,
|
|
159
|
+
declarations: [],
|
|
160
|
+
rules: [{ style: shared }, { style: web(targets.web) }],
|
|
161
|
+
}
|
|
162
|
+
}
|