@discourser/design-system 0.1.0

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 (144) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +213 -0
  3. package/dist/index.cjs +1250 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +456 -0
  6. package/dist/index.d.ts +456 -0
  7. package/dist/index.js +1234 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +123 -0
  10. package/styled-system/css/conditions.mjs +36 -0
  11. package/styled-system/css/css.d.ts +22 -0
  12. package/styled-system/css/css.mjs +45 -0
  13. package/styled-system/css/cva.d.ts +6 -0
  14. package/styled-system/css/cva.mjs +87 -0
  15. package/styled-system/css/cx.d.ts +5 -0
  16. package/styled-system/css/cx.mjs +15 -0
  17. package/styled-system/css/index.d.ts +5 -0
  18. package/styled-system/css/index.mjs +4 -0
  19. package/styled-system/css/sva.d.ts +4 -0
  20. package/styled-system/css/sva.mjs +41 -0
  21. package/styled-system/helpers.mjs +336 -0
  22. package/styled-system/jsx/aspect-ratio.d.ts +10 -0
  23. package/styled-system/jsx/aspect-ratio.mjs +14 -0
  24. package/styled-system/jsx/bleed.d.ts +10 -0
  25. package/styled-system/jsx/bleed.mjs +14 -0
  26. package/styled-system/jsx/box.d.ts +10 -0
  27. package/styled-system/jsx/box.mjs +14 -0
  28. package/styled-system/jsx/center.d.ts +10 -0
  29. package/styled-system/jsx/center.mjs +14 -0
  30. package/styled-system/jsx/circle.d.ts +10 -0
  31. package/styled-system/jsx/circle.mjs +14 -0
  32. package/styled-system/jsx/container.d.ts +10 -0
  33. package/styled-system/jsx/container.mjs +14 -0
  34. package/styled-system/jsx/cq.d.ts +10 -0
  35. package/styled-system/jsx/cq.mjs +14 -0
  36. package/styled-system/jsx/divider.d.ts +10 -0
  37. package/styled-system/jsx/divider.mjs +14 -0
  38. package/styled-system/jsx/factory-helper.mjs +22 -0
  39. package/styled-system/jsx/factory.d.ts +3 -0
  40. package/styled-system/jsx/factory.mjs +80 -0
  41. package/styled-system/jsx/flex.d.ts +10 -0
  42. package/styled-system/jsx/flex.mjs +14 -0
  43. package/styled-system/jsx/float.d.ts +10 -0
  44. package/styled-system/jsx/float.mjs +14 -0
  45. package/styled-system/jsx/grid-item.d.ts +10 -0
  46. package/styled-system/jsx/grid-item.mjs +14 -0
  47. package/styled-system/jsx/grid.d.ts +10 -0
  48. package/styled-system/jsx/grid.mjs +14 -0
  49. package/styled-system/jsx/hstack.d.ts +10 -0
  50. package/styled-system/jsx/hstack.mjs +14 -0
  51. package/styled-system/jsx/index.d.ts +24 -0
  52. package/styled-system/jsx/index.mjs +22 -0
  53. package/styled-system/jsx/is-valid-prop.d.ts +11 -0
  54. package/styled-system/jsx/is-valid-prop.mjs +17 -0
  55. package/styled-system/jsx/link-overlay.d.ts +10 -0
  56. package/styled-system/jsx/link-overlay.mjs +14 -0
  57. package/styled-system/jsx/spacer.d.ts +10 -0
  58. package/styled-system/jsx/spacer.mjs +14 -0
  59. package/styled-system/jsx/square.d.ts +10 -0
  60. package/styled-system/jsx/square.mjs +14 -0
  61. package/styled-system/jsx/stack.d.ts +10 -0
  62. package/styled-system/jsx/stack.mjs +14 -0
  63. package/styled-system/jsx/visually-hidden.d.ts +10 -0
  64. package/styled-system/jsx/visually-hidden.mjs +14 -0
  65. package/styled-system/jsx/vstack.d.ts +10 -0
  66. package/styled-system/jsx/vstack.mjs +14 -0
  67. package/styled-system/jsx/wrap.d.ts +10 -0
  68. package/styled-system/jsx/wrap.mjs +14 -0
  69. package/styled-system/patterns/aspect-ratio.d.ts +21 -0
  70. package/styled-system/patterns/aspect-ratio.mjs +38 -0
  71. package/styled-system/patterns/bleed.d.ts +22 -0
  72. package/styled-system/patterns/bleed.mjs +24 -0
  73. package/styled-system/patterns/box.d.ts +21 -0
  74. package/styled-system/patterns/box.mjs +15 -0
  75. package/styled-system/patterns/center.d.ts +21 -0
  76. package/styled-system/patterns/center.mjs +21 -0
  77. package/styled-system/patterns/circle.d.ts +21 -0
  78. package/styled-system/patterns/circle.mjs +25 -0
  79. package/styled-system/patterns/container.d.ts +21 -0
  80. package/styled-system/patterns/container.mjs +21 -0
  81. package/styled-system/patterns/cq.d.ts +22 -0
  82. package/styled-system/patterns/cq.mjs +21 -0
  83. package/styled-system/patterns/divider.d.ts +23 -0
  84. package/styled-system/patterns/divider.mjs +25 -0
  85. package/styled-system/patterns/flex.d.ts +27 -0
  86. package/styled-system/patterns/flex.mjs +26 -0
  87. package/styled-system/patterns/float.d.ts +24 -0
  88. package/styled-system/patterns/float.mjs +52 -0
  89. package/styled-system/patterns/grid-item.d.ts +26 -0
  90. package/styled-system/patterns/grid-item.mjs +25 -0
  91. package/styled-system/patterns/grid.d.ts +25 -0
  92. package/styled-system/patterns/grid.mjs +27 -0
  93. package/styled-system/patterns/hstack.d.ts +22 -0
  94. package/styled-system/patterns/hstack.mjs +24 -0
  95. package/styled-system/patterns/index.d.ts +21 -0
  96. package/styled-system/patterns/index.mjs +20 -0
  97. package/styled-system/patterns/link-overlay.d.ts +21 -0
  98. package/styled-system/patterns/link-overlay.mjs +24 -0
  99. package/styled-system/patterns/spacer.d.ts +21 -0
  100. package/styled-system/patterns/spacer.mjs +21 -0
  101. package/styled-system/patterns/square.d.ts +21 -0
  102. package/styled-system/patterns/square.mjs +24 -0
  103. package/styled-system/patterns/stack.d.ts +24 -0
  104. package/styled-system/patterns/stack.mjs +24 -0
  105. package/styled-system/patterns/visually-hidden.d.ts +21 -0
  106. package/styled-system/patterns/visually-hidden.mjs +18 -0
  107. package/styled-system/patterns/vstack.d.ts +22 -0
  108. package/styled-system/patterns/vstack.mjs +24 -0
  109. package/styled-system/patterns/wrap.d.ts +25 -0
  110. package/styled-system/patterns/wrap.mjs +25 -0
  111. package/styled-system/recipes/button.d.ts +39 -0
  112. package/styled-system/recipes/button.mjs +40 -0
  113. package/styled-system/recipes/card.d.ts +39 -0
  114. package/styled-system/recipes/card.mjs +36 -0
  115. package/styled-system/recipes/create-recipe.mjs +82 -0
  116. package/styled-system/recipes/dialog.d.ts +35 -0
  117. package/styled-system/recipes/dialog.mjs +63 -0
  118. package/styled-system/recipes/icon-button.d.ts +39 -0
  119. package/styled-system/recipes/icon-button.mjs +39 -0
  120. package/styled-system/recipes/index.d.ts +7 -0
  121. package/styled-system/recipes/index.mjs +6 -0
  122. package/styled-system/recipes/input.d.ts +40 -0
  123. package/styled-system/recipes/input.mjs +40 -0
  124. package/styled-system/recipes/switch-control.d.ts +35 -0
  125. package/styled-system/recipes/switch-control.mjs +53 -0
  126. package/styled-system/recipes/switch.d.ts +35 -0
  127. package/styled-system/recipes/switch.mjs +53 -0
  128. package/styled-system/tokens/index.d.ts +9 -0
  129. package/styled-system/tokens/index.mjs +924 -0
  130. package/styled-system/tokens/tokens.d.ts +48 -0
  131. package/styled-system/types/composition.d.ts +164 -0
  132. package/styled-system/types/conditions.d.ts +306 -0
  133. package/styled-system/types/csstype.d.ts +21298 -0
  134. package/styled-system/types/global.d.ts +20 -0
  135. package/styled-system/types/index.d.ts +8 -0
  136. package/styled-system/types/jsx.d.ts +52 -0
  137. package/styled-system/types/parts.d.ts +8 -0
  138. package/styled-system/types/pattern.d.ts +78 -0
  139. package/styled-system/types/prop-type.d.ts +224 -0
  140. package/styled-system/types/recipe.d.ts +181 -0
  141. package/styled-system/types/selectors.d.ts +59 -0
  142. package/styled-system/types/static-css.d.ts +56 -0
  143. package/styled-system/types/style-props.d.ts +7468 -0
  144. package/styled-system/types/system-types.d.ts +109 -0
@@ -0,0 +1,109 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue, Nested } from './conditions';
3
+ import type { AtRule, 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 = Omit<Nested<SystemProperties & CssVarProperties>, 'base'>
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
+ /* -----------------------------------------------------------------------------
60
+ * Composition (text styles, layer styles)
61
+ * -----------------------------------------------------------------------------*/
62
+
63
+ type FilterStyleObject<P extends string> = {
64
+ [K in P]?: K extends keyof SystemStyleObject ? SystemStyleObject[K] : unknown
65
+ }
66
+
67
+ export type CompositionStyleObject<Property extends string> = Nested<FilterStyleObject<Property> & CssVarProperties>
68
+
69
+ /* -----------------------------------------------------------------------------
70
+ * Font face
71
+ * -----------------------------------------------------------------------------*/
72
+
73
+ export type GlobalFontfaceRule = Omit<AtRule.FontFaceFallback, 'src'> & Required<Pick<AtRule.FontFaceFallback, 'src'>>
74
+
75
+ export type FontfaceRule = Omit<GlobalFontfaceRule, 'fontFamily'>
76
+
77
+ export interface GlobalFontface {
78
+ [name: string]: FontfaceRule | FontfaceRule[]
79
+ }
80
+
81
+ export interface ExtendableGlobalFontface {
82
+ [name: string]: FontfaceRule | FontfaceRule[] | GlobalFontface | undefined
83
+ extend?: GlobalFontface | undefined
84
+ }
85
+
86
+ /* -----------------------------------------------------------------------------
87
+ * Jsx style props
88
+ * -----------------------------------------------------------------------------*/
89
+ interface WithCss {
90
+ css?: SystemStyleObject | SystemStyleObject[]
91
+ }
92
+
93
+ export type JsxStyleProps = SystemStyleObject & WithCss
94
+
95
+ export interface PatchedHTMLProps {
96
+ htmlWidth?: string | number
97
+ htmlHeight?: string | number
98
+ htmlTranslate?: 'yes' | 'no' | undefined
99
+ htmlContent?: string
100
+ }
101
+
102
+ export type OmittedHTMLProps = 'color' | 'translate' | 'transition' | 'width' | 'height' | 'content'
103
+
104
+ type WithHTMLProps<T> = DistributiveOmit<T, OmittedHTMLProps> & PatchedHTMLProps
105
+
106
+ export type JsxHTMLProps<T extends Record<string, any>, P extends Record<string, any> = {}> = Assign<
107
+ WithHTMLProps<T>,
108
+ P
109
+ >