@stokelp/styled-system 1.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.
Files changed (148) hide show
  1. package/css/conditions.mjs +34 -0
  2. package/css/css.d.ts +9 -0
  3. package/css/css.mjs +45 -0
  4. package/css/cva.d.ts +6 -0
  5. package/css/cva.mjs +87 -0
  6. package/css/cx.d.ts +5 -0
  7. package/css/cx.mjs +15 -0
  8. package/css/index.d.ts +5 -0
  9. package/css/index.mjs +4 -0
  10. package/css/sva.d.ts +4 -0
  11. package/css/sva.mjs +41 -0
  12. package/jsx/aspect-ratio.d.ts +10 -0
  13. package/jsx/aspect-ratio.mjs +14 -0
  14. package/jsx/bleed.d.ts +10 -0
  15. package/jsx/bleed.mjs +14 -0
  16. package/jsx/box.d.ts +10 -0
  17. package/jsx/box.mjs +14 -0
  18. package/jsx/center.d.ts +10 -0
  19. package/jsx/center.mjs +14 -0
  20. package/jsx/circle.d.ts +10 -0
  21. package/jsx/circle.mjs +14 -0
  22. package/jsx/container.d.ts +10 -0
  23. package/jsx/container.mjs +14 -0
  24. package/jsx/cq.d.ts +10 -0
  25. package/jsx/cq.mjs +14 -0
  26. package/jsx/divider.d.ts +10 -0
  27. package/jsx/divider.mjs +14 -0
  28. package/jsx/factory-helper.mjs +22 -0
  29. package/jsx/factory.d.ts +3 -0
  30. package/jsx/factory.mjs +80 -0
  31. package/jsx/flex.d.ts +10 -0
  32. package/jsx/flex.mjs +14 -0
  33. package/jsx/float.d.ts +10 -0
  34. package/jsx/float.mjs +14 -0
  35. package/jsx/grid-item.d.ts +10 -0
  36. package/jsx/grid-item.mjs +14 -0
  37. package/jsx/grid.d.ts +10 -0
  38. package/jsx/grid.mjs +14 -0
  39. package/jsx/hstack.d.ts +10 -0
  40. package/jsx/hstack.mjs +14 -0
  41. package/jsx/index.d.ts +25 -0
  42. package/jsx/index.mjs +23 -0
  43. package/jsx/is-valid-prop.d.ts +11 -0
  44. package/jsx/is-valid-prop.mjs +17 -0
  45. package/jsx/link-box.d.ts +10 -0
  46. package/jsx/link-box.mjs +14 -0
  47. package/jsx/link-overlay.d.ts +10 -0
  48. package/jsx/link-overlay.mjs +14 -0
  49. package/jsx/spacer.d.ts +10 -0
  50. package/jsx/spacer.mjs +14 -0
  51. package/jsx/square.d.ts +10 -0
  52. package/jsx/square.mjs +14 -0
  53. package/jsx/stack.d.ts +10 -0
  54. package/jsx/stack.mjs +14 -0
  55. package/jsx/visually-hidden.d.ts +10 -0
  56. package/jsx/visually-hidden.mjs +14 -0
  57. package/jsx/vstack.d.ts +10 -0
  58. package/jsx/vstack.mjs +14 -0
  59. package/jsx/wrap.d.ts +10 -0
  60. package/jsx/wrap.mjs +14 -0
  61. package/package.json +56 -0
  62. package/panda.buildinfo.json +75 -0
  63. package/patterns/aspect-ratio.d.ts +21 -0
  64. package/patterns/aspect-ratio.mjs +38 -0
  65. package/patterns/bleed.d.ts +22 -0
  66. package/patterns/bleed.mjs +24 -0
  67. package/patterns/box.d.ts +21 -0
  68. package/patterns/box.mjs +15 -0
  69. package/patterns/center.d.ts +21 -0
  70. package/patterns/center.mjs +21 -0
  71. package/patterns/circle.d.ts +21 -0
  72. package/patterns/circle.mjs +25 -0
  73. package/patterns/container.d.ts +21 -0
  74. package/patterns/container.mjs +21 -0
  75. package/patterns/cq.d.ts +22 -0
  76. package/patterns/cq.mjs +21 -0
  77. package/patterns/divider.d.ts +23 -0
  78. package/patterns/divider.mjs +25 -0
  79. package/patterns/flex.d.ts +27 -0
  80. package/patterns/flex.mjs +26 -0
  81. package/patterns/float.d.ts +24 -0
  82. package/patterns/float.mjs +52 -0
  83. package/patterns/grid-item.d.ts +26 -0
  84. package/patterns/grid-item.mjs +25 -0
  85. package/patterns/grid.d.ts +25 -0
  86. package/patterns/grid.mjs +27 -0
  87. package/patterns/hstack.d.ts +22 -0
  88. package/patterns/hstack.mjs +24 -0
  89. package/patterns/index.d.ts +22 -0
  90. package/patterns/index.mjs +21 -0
  91. package/patterns/link-box.d.ts +21 -0
  92. package/patterns/link-box.mjs +22 -0
  93. package/patterns/link-overlay.d.ts +21 -0
  94. package/patterns/link-overlay.mjs +27 -0
  95. package/patterns/spacer.d.ts +21 -0
  96. package/patterns/spacer.mjs +21 -0
  97. package/patterns/square.d.ts +21 -0
  98. package/patterns/square.mjs +24 -0
  99. package/patterns/stack.d.ts +24 -0
  100. package/patterns/stack.mjs +24 -0
  101. package/patterns/visually-hidden.d.ts +21 -0
  102. package/patterns/visually-hidden.mjs +18 -0
  103. package/patterns/vstack.d.ts +22 -0
  104. package/patterns/vstack.mjs +24 -0
  105. package/patterns/wrap.d.ts +25 -0
  106. package/patterns/wrap.mjs +25 -0
  107. package/recipes/accordion.d.ts +28 -0
  108. package/recipes/accordion.mjs +56 -0
  109. package/recipes/button.d.ts +30 -0
  110. package/recipes/button.mjs +116 -0
  111. package/recipes/checkbox.d.ts +28 -0
  112. package/recipes/checkbox.mjs +52 -0
  113. package/recipes/create-recipe.mjs +82 -0
  114. package/recipes/drawer.d.ts +28 -0
  115. package/recipes/drawer.mjs +77 -0
  116. package/recipes/form-control.d.ts +28 -0
  117. package/recipes/form-control.mjs +24 -0
  118. package/recipes/form-helper-text.d.ts +28 -0
  119. package/recipes/form-helper-text.mjs +24 -0
  120. package/recipes/form-label.d.ts +28 -0
  121. package/recipes/form-label.mjs +36 -0
  122. package/recipes/heading.d.ts +30 -0
  123. package/recipes/heading.mjs +41 -0
  124. package/recipes/index.d.ts +12 -0
  125. package/recipes/index.mjs +11 -0
  126. package/recipes/switch-recipe.d.ts +28 -0
  127. package/recipes/switch-recipe.mjs +52 -0
  128. package/recipes/text.d.ts +31 -0
  129. package/recipes/text.mjs +41 -0
  130. package/recipes/textarea.d.ts +28 -0
  131. package/recipes/textarea.mjs +24 -0
  132. package/tokens/index.d.ts +9 -0
  133. package/tokens/index.mjs +1496 -0
  134. package/tokens/tokens.d.ts +63 -0
  135. package/types/composition.d.ts +111 -0
  136. package/types/conditions.d.ts +270 -0
  137. package/types/csstype.d.ts +21298 -0
  138. package/types/global.d.ts +19 -0
  139. package/types/index.d.ts +8 -0
  140. package/types/jsx.d.ts +52 -0
  141. package/types/parts.d.ts +8 -0
  142. package/types/pattern.d.ts +74 -0
  143. package/types/prop-type.d.ts +242 -0
  144. package/types/recipe.d.ts +173 -0
  145. package/types/selectors.d.ts +59 -0
  146. package/types/static-css.d.ts +51 -0
  147. package/types/style-props.d.ts +7468 -0
  148. package/types/system-types.d.ts +89 -0
@@ -0,0 +1,89 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue, Nested } from './conditions';
3
+ import type { PropertiesFallback } from './csstype';
4
+ import type { SystemProperties, CssVarProperties } from './style-props';
5
+
6
+ type String = string & {}
7
+ type Number = number & {}
8
+
9
+ export type Pretty<T> = { [K in keyof T]: T[K] } & {}
10
+
11
+ export type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : never
12
+
13
+ export type DistributiveUnion<T, U> = {
14
+ [K in keyof T]: K extends keyof U ? U[K] | T[K] : T[K]
15
+ } & DistributiveOmit<U, keyof T>
16
+
17
+ export type Assign<T, U> = {
18
+ [K in keyof T]: K extends keyof U ? U[K] : T[K]
19
+ } & U
20
+
21
+ /* -----------------------------------------------------------------------------
22
+ * Native css properties
23
+ * -----------------------------------------------------------------------------*/
24
+
25
+ export type CssProperty = keyof PropertiesFallback
26
+
27
+ export interface CssProperties extends PropertiesFallback<String | Number>, CssVarProperties {}
28
+
29
+ export interface CssKeyframes {
30
+ [name: string]: {
31
+ [time: string]: CssProperties
32
+ }
33
+ }
34
+
35
+ /* -----------------------------------------------------------------------------
36
+ * Conditional css properties
37
+ * -----------------------------------------------------------------------------*/
38
+
39
+ interface GenericProperties {
40
+ [key: string]: ConditionalValue<String | Number | boolean>
41
+ }
42
+
43
+ /* -----------------------------------------------------------------------------
44
+ * Native css props
45
+ * -----------------------------------------------------------------------------*/
46
+
47
+ export type NestedCssProperties = Nested<CssProperties>
48
+
49
+ export type SystemStyleObject = Nested<SystemProperties & CssVarProperties>
50
+
51
+ export interface GlobalStyleObject {
52
+ [selector: string]: SystemStyleObject
53
+ }
54
+ export interface ExtendableGlobalStyleObject {
55
+ [selector: string]: SystemStyleObject | undefined
56
+ extend?: GlobalStyleObject | undefined
57
+ }
58
+
59
+ type FilterStyleObject<P extends string> = {
60
+ [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown
61
+ }
62
+
63
+ export type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>
64
+
65
+ /* -----------------------------------------------------------------------------
66
+ * Jsx style props
67
+ * -----------------------------------------------------------------------------*/
68
+ interface WithCss {
69
+ css?: SystemStyleObject
70
+ }
71
+ type StyleProps = SystemStyleObject & WithCss
72
+
73
+ export type JsxStyleProps = StyleProps & WithCss
74
+
75
+ export interface PatchedHTMLProps {
76
+ htmlWidth?: string | number
77
+ htmlHeight?: string | number
78
+ htmlTranslate?: 'yes' | 'no' | undefined
79
+ htmlContent?: string
80
+ }
81
+
82
+ export type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'
83
+
84
+ type WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps
85
+
86
+ export type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<
87
+ WithHTMLProps<T>,
88
+ P
89
+ >