@mekari/pixel3-styled-system 0.0.0 → 0.0.1

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.
@@ -310,8 +310,18 @@ interface PropertyValueTypes {
310
310
  }
311
311
 
312
312
 
313
- export type PropertyValue<T extends string> = T extends keyof PropertyTypes
314
- ? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
315
- : T extends keyof CssProperties
316
- ? ConditionalValue<CssProperties[T] | (string & {})>
317
- : ConditionalValue<string | number>
313
+
314
+ type PropertyTypeValue<T extends string> = T extends keyof PropertyTypes
315
+ ? ConditionalValue<PropertyTypes[T] | CssValue<T> | (string & {})>
316
+ : never;
317
+
318
+ type CssPropertyValue<T extends string> = T extends keyof CssProperties
319
+ ? ConditionalValue<CssProperties[T] | (string & {})>
320
+ : never;
321
+
322
+ export type PropertyValue<T extends string> = T extends keyof PropertyTypes
323
+ ? PropertyTypeValue<T>
324
+ : T extends keyof CssProperties
325
+ ? CssPropertyValue<T>
326
+ : ConditionalValue<string | number>
327
+
package/types/recipe.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable */
2
+ import type { RecipeRule } from './static-css';
2
3
  import type { SystemStyleObject, DistributiveOmit, Pretty } from './system-types';
3
4
 
4
5
  type StringToBoolean<T> = T extends 'true' | 'false' ? boolean : T
@@ -63,6 +64,10 @@ export interface RecipeDefinition<T extends RecipeVariantRecord> {
63
64
  * The styles to apply when a combination of variants is selected.
64
65
  */
65
66
  compoundVariants?: Pretty<RecipeCompoundVariant<RecipeCompoundSelection<T>>>[]
67
+ /**
68
+ * Variants to pre-generate, will be include in the final `config.staticCss`
69
+ */
70
+ staticCss?: RecipeRule[]
66
71
  }
67
72
 
68
73
  export type RecipeCreatorFn = <T extends RecipeVariantRecord>(config: RecipeDefinition<T>) => RecipeRuntimeFn<T>
@@ -134,6 +139,10 @@ export interface SlotRecipeDefinition<S extends string, T extends SlotRecipeVari
134
139
  * The styles to apply when a combination of variants is selected.
135
140
  */
136
141
  compoundVariants?: Pretty<SlotRecipeCompoundVariant<S, RecipeCompoundSelection<T>>>[]
142
+ /**
143
+ * Variants to pre-generate, will be include in the final `config.staticCss`
144
+ */
145
+ staticCss?: RecipeRule[]
137
146
  }
138
147
 
139
148
  export type SlotRecipeCreatorFn = <S extends string, T extends SlotRecipeVariantRecord<S>>(
@@ -0,0 +1,39 @@
1
+ /* eslint-disable */
2
+ interface CssRule {
3
+ /**
4
+ * The css properties to generate utilities for.
5
+ * @example ['margin', 'padding']
6
+ */
7
+ properties: {
8
+ [property: string]: string[]
9
+ }
10
+ /**
11
+ * The css conditions to generate utilities for.
12
+ * @example ['hover', 'focus']
13
+ */
14
+ conditions?: string[]
15
+ /**
16
+ * Whether to generate responsive utilities.
17
+ */
18
+ responsive?: boolean
19
+ }
20
+
21
+ export type RecipeRule =
22
+ | '*'
23
+ | ({
24
+ conditions?: string[]
25
+ responsive?: boolean
26
+ } & { [variant: string]: boolean | string[] })
27
+
28
+ export interface StaticCssOptions {
29
+ /**
30
+ * The css utility classes to generate.
31
+ */
32
+ css?: CssRule[]
33
+ /**
34
+ * The css recipes to generate.
35
+ */
36
+ recipes?: {
37
+ [recipe: string]: RecipeRule[]
38
+ }
39
+ }