thread-ui 0.1.5 → 0.1.6

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 (252) hide show
  1. package/dist/client/index.d.ts +3 -0
  2. package/dist/client/index.d.ts.map +1 -0
  3. package/dist/client/index.js +3 -0
  4. package/dist/client/index.js.map +1 -0
  5. package/dist/client/make-styles/index.d.ts +2 -0
  6. package/dist/client/make-styles/index.d.ts.map +1 -0
  7. package/dist/client/make-styles/index.js +2 -0
  8. package/dist/client/make-styles/index.js.map +1 -0
  9. package/dist/{functions → client}/make-styles/make-styles.d.ts +8 -4
  10. package/dist/client/make-styles/make-styles.d.ts.map +1 -0
  11. package/dist/{functions → client}/make-styles/make-styles.js +19 -6
  12. package/dist/client/make-styles/make-styles.js.map +1 -0
  13. package/dist/{functions → client}/theme/index.d.ts +0 -1
  14. package/dist/client/theme/index.d.ts.map +1 -0
  15. package/dist/{functions → client}/theme/index.js +0 -1
  16. package/dist/client/theme/index.js.map +1 -0
  17. package/dist/client/theme/theme-provider/index.d.ts.map +1 -0
  18. package/dist/client/theme/theme-provider/index.js.map +1 -0
  19. package/dist/client/theme/theme-provider/set-theme.d.ts.map +1 -0
  20. package/dist/{functions → client}/theme/theme-provider/set-theme.js +1 -1
  21. package/dist/client/theme/theme-provider/set-theme.js.map +1 -0
  22. package/dist/client/theme/theme-provider/theme-provider.d.ts.map +1 -0
  23. package/dist/client/theme/theme-provider/theme-provider.js.map +1 -0
  24. package/dist/client/theme/theme-provider/theme-provider.types.d.ts.map +1 -0
  25. package/dist/client/theme/theme-provider/theme-provider.types.js.map +1 -0
  26. package/dist/client/theme/theme.types.d.ts.map +1 -0
  27. package/dist/client/theme/theme.types.js.map +1 -0
  28. package/dist/components/layouts/column-layout/column-layout.d.ts +0 -8
  29. package/dist/components/layouts/column-layout/column-layout.d.ts.map +1 -1
  30. package/dist/components/layouts/column-layout/column-layout.js +33 -38
  31. package/dist/components/layouts/column-layout/column-layout.js.map +1 -1
  32. package/dist/components/layouts/column-layout/column-layout.types.d.ts +2 -2
  33. package/dist/components/layouts/column-layout/column-layout.types.d.ts.map +1 -1
  34. package/dist/components/layouts/column-layout/column-skeleton/column-skeleton.d.ts.map +1 -1
  35. package/dist/components/layouts/column-layout/column-skeleton/column-skeleton.js +25 -11
  36. package/dist/components/layouts/column-layout/column-skeleton/column-skeleton.js.map +1 -1
  37. package/dist/components/layouts/column-layout/column-skeleton/column-skeleton.types.d.ts +2 -2
  38. package/dist/components/layouts/column-layout/column-skeleton/column-skeleton.types.d.ts.map +1 -1
  39. package/dist/components/layouts/footer/footer.d.ts.map +1 -1
  40. package/dist/components/layouts/footer/footer.js +14 -17
  41. package/dist/components/layouts/footer/footer.js.map +1 -1
  42. package/dist/components/layouts/masonry-layout/masonry-layout.d.ts.map +1 -1
  43. package/dist/components/layouts/masonry-layout/masonry-layout.js +10 -11
  44. package/dist/components/layouts/masonry-layout/masonry-layout.js.map +1 -1
  45. package/dist/components/media/image-panel/image-panel.d.ts.map +1 -1
  46. package/dist/components/media/image-panel/image-panel.js +48 -35
  47. package/dist/components/media/image-panel/image-panel.js.map +1 -1
  48. package/dist/components/media/info-card/info-card.d.ts.map +1 -1
  49. package/dist/components/media/info-card/info-card.js +27 -28
  50. package/dist/components/media/info-card/info-card.js.map +1 -1
  51. package/dist/components/navigation/nav-menu/items/base-item/base-item.d.ts +1 -1
  52. package/dist/components/navigation/nav-menu/items/base-item/base-item.d.ts.map +1 -1
  53. package/dist/components/navigation/nav-menu/items/base-item/base-item.js +40 -28
  54. package/dist/components/navigation/nav-menu/items/base-item/base-item.js.map +1 -1
  55. package/dist/components/navigation/nav-menu/items/base-item/base-item.types.d.ts +1 -1
  56. package/dist/components/navigation/nav-menu/items/base-item/base-item.types.d.ts.map +1 -1
  57. package/dist/components/navigation/nav-menu/items/nav-drop-down-item/nav-drop-down-item.d.ts.map +1 -1
  58. package/dist/components/navigation/nav-menu/items/nav-drop-down-item/nav-drop-down-item.js +39 -36
  59. package/dist/components/navigation/nav-menu/items/nav-drop-down-item/nav-drop-down-item.js.map +1 -1
  60. package/dist/components/navigation/nav-menu/items/nav-icon-item/nav-icon-item.d.ts.map +1 -1
  61. package/dist/components/navigation/nav-menu/items/nav-icon-item/nav-icon-item.js +1 -1
  62. package/dist/components/navigation/nav-menu/items/nav-icon-item/nav-icon-item.js.map +1 -1
  63. package/dist/components/navigation/nav-menu/items/nav-item/nav-item.d.ts.map +1 -1
  64. package/dist/components/navigation/nav-menu/items/nav-item/nav-item.js +2 -10
  65. package/dist/components/navigation/nav-menu/items/nav-item/nav-item.js.map +1 -1
  66. package/dist/components/navigation/nav-menu/nav-menu.d.ts.map +1 -1
  67. package/dist/components/navigation/nav-menu/nav-menu.js +55 -55
  68. package/dist/components/navigation/nav-menu/nav-menu.js.map +1 -1
  69. package/dist/components/typography/typography.d.ts.map +1 -1
  70. package/dist/components/typography/typography.js +0 -1
  71. package/dist/components/typography/typography.js.map +1 -1
  72. package/dist/components/ui/button/button-recipe.d.ts +2 -0
  73. package/dist/components/ui/button/button-recipe.d.ts.map +1 -0
  74. package/dist/components/ui/button/button-recipe.js +240 -0
  75. package/dist/components/ui/button/button-recipe.js.map +1 -0
  76. package/dist/components/ui/button/button.d.ts.map +1 -1
  77. package/dist/components/ui/button/button.js +8 -27
  78. package/dist/components/ui/button/button.js.map +1 -1
  79. package/dist/components/ui/divider/divider.d.ts.map +1 -1
  80. package/dist/components/ui/divider/divider.js +32 -26
  81. package/dist/components/ui/divider/divider.js.map +1 -1
  82. package/dist/components/ui/divider/divider.types.d.ts +1 -1
  83. package/dist/components/ui/divider/divider.types.d.ts.map +1 -1
  84. package/dist/components/ui/icon/icon.d.ts.map +1 -1
  85. package/dist/components/ui/icon-button/icon-button.d.ts.map +1 -1
  86. package/dist/components/ui/icon-button/icon-button.js +3 -5
  87. package/dist/components/ui/icon-button/icon-button.js.map +1 -1
  88. package/dist/components/ui/index.d.ts +0 -1
  89. package/dist/components/ui/index.d.ts.map +1 -1
  90. package/dist/components/ui/index.js +0 -1
  91. package/dist/components/ui/index.js.map +1 -1
  92. package/dist/components/ui/toggle/index.d.ts +0 -1
  93. package/dist/components/ui/toggle/index.d.ts.map +1 -1
  94. package/dist/components/ui/toggle/index.js +0 -1
  95. package/dist/components/ui/toggle/index.js.map +1 -1
  96. package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
  97. package/dist/components/ui/toggle/toggle.js +1 -2
  98. package/dist/components/ui/toggle/toggle.js.map +1 -1
  99. package/dist/index.d.ts +1 -2
  100. package/dist/index.d.ts.map +1 -1
  101. package/dist/index.js +3 -4
  102. package/dist/index.js.map +1 -1
  103. package/dist/internal-components/image/is-html-image-props.d.ts.map +1 -1
  104. package/dist/internal-components/image/render-image.d.ts.map +1 -1
  105. package/dist/internal-components/image/render-image.js +3 -2
  106. package/dist/internal-components/image/render-image.js.map +1 -1
  107. package/dist/styled-system/css/conditions.mjs +36 -0
  108. package/dist/styled-system/css/css.d.ts +22 -0
  109. package/dist/styled-system/css/css.mjs +45 -0
  110. package/dist/styled-system/css/cva.d.ts +6 -0
  111. package/dist/styled-system/css/cva.mjs +87 -0
  112. package/dist/styled-system/css/cx.d.ts +5 -0
  113. package/dist/styled-system/css/cx.mjs +15 -0
  114. package/dist/styled-system/css/index.d.ts +5 -0
  115. package/dist/styled-system/css/index.mjs +4 -0
  116. package/dist/styled-system/css/sva.d.ts +4 -0
  117. package/dist/styled-system/css/sva.mjs +41 -0
  118. package/dist/styled-system/debug/config.json +7433 -0
  119. package/dist/styled-system/helpers.mjs +327 -0
  120. package/dist/styled-system/patterns/aspect-ratio.d.ts +20 -0
  121. package/dist/styled-system/patterns/aspect-ratio.mjs +38 -0
  122. package/dist/styled-system/patterns/bleed.d.ts +21 -0
  123. package/dist/styled-system/patterns/bleed.mjs +24 -0
  124. package/dist/styled-system/patterns/box.d.ts +20 -0
  125. package/dist/styled-system/patterns/box.mjs +15 -0
  126. package/dist/styled-system/patterns/center.d.ts +20 -0
  127. package/dist/styled-system/patterns/center.mjs +21 -0
  128. package/dist/styled-system/patterns/circle.d.ts +20 -0
  129. package/dist/styled-system/patterns/circle.mjs +25 -0
  130. package/dist/styled-system/patterns/container.d.ts +22 -0
  131. package/dist/styled-system/patterns/container.mjs +15 -0
  132. package/dist/styled-system/patterns/cq.d.ts +21 -0
  133. package/dist/styled-system/patterns/cq.mjs +21 -0
  134. package/dist/styled-system/patterns/divider.d.ts +22 -0
  135. package/dist/styled-system/patterns/divider.mjs +25 -0
  136. package/dist/styled-system/patterns/flex.d.ts +26 -0
  137. package/dist/styled-system/patterns/flex.mjs +26 -0
  138. package/dist/styled-system/patterns/float.d.ts +23 -0
  139. package/dist/styled-system/patterns/float.mjs +52 -0
  140. package/dist/styled-system/patterns/grid-item.d.ts +25 -0
  141. package/dist/styled-system/patterns/grid-item.mjs +25 -0
  142. package/dist/styled-system/patterns/grid.d.ts +24 -0
  143. package/dist/styled-system/patterns/grid.mjs +27 -0
  144. package/dist/styled-system/patterns/hstack.d.ts +21 -0
  145. package/dist/styled-system/patterns/hstack.mjs +24 -0
  146. package/dist/styled-system/patterns/index.d.ts +21 -0
  147. package/dist/styled-system/patterns/index.mjs +20 -0
  148. package/dist/styled-system/patterns/link-overlay.d.ts +20 -0
  149. package/dist/styled-system/patterns/link-overlay.mjs +24 -0
  150. package/dist/styled-system/patterns/spacer.d.ts +20 -0
  151. package/dist/styled-system/patterns/spacer.mjs +21 -0
  152. package/dist/styled-system/patterns/square.d.ts +20 -0
  153. package/dist/styled-system/patterns/square.mjs +24 -0
  154. package/dist/styled-system/patterns/stack.d.ts +23 -0
  155. package/dist/styled-system/patterns/stack.mjs +24 -0
  156. package/dist/styled-system/patterns/visually-hidden.d.ts +20 -0
  157. package/dist/styled-system/patterns/visually-hidden.mjs +18 -0
  158. package/dist/styled-system/patterns/vstack.d.ts +21 -0
  159. package/dist/styled-system/patterns/vstack.mjs +24 -0
  160. package/dist/styled-system/patterns/wrap.d.ts +24 -0
  161. package/dist/styled-system/patterns/wrap.mjs +25 -0
  162. package/dist/styled-system/recipes/button.d.ts +43 -0
  163. package/dist/styled-system/recipes/button.mjs +154 -0
  164. package/dist/styled-system/recipes/create-recipe.mjs +82 -0
  165. package/dist/styled-system/recipes/index.d.ts +2 -0
  166. package/dist/styled-system/recipes/index.mjs +1 -0
  167. package/dist/styled-system/styles.css +750 -0
  168. package/dist/styled-system/tokens/index.d.ts +9 -0
  169. package/dist/styled-system/tokens/index.mjs +2060 -0
  170. package/dist/styled-system/tokens/tokens.d.ts +63 -0
  171. package/dist/styled-system/types/composition.d.ts +164 -0
  172. package/dist/styled-system/types/conditions.d.ts +306 -0
  173. package/dist/styled-system/types/csstype.d.ts +21298 -0
  174. package/dist/styled-system/types/global.d.ts +20 -0
  175. package/dist/styled-system/types/index.d.ts +7 -0
  176. package/dist/styled-system/types/parts.d.ts +8 -0
  177. package/dist/styled-system/types/pattern.d.ts +78 -0
  178. package/dist/styled-system/types/prop-type.d.ts +255 -0
  179. package/dist/styled-system/types/recipe.d.ts +181 -0
  180. package/dist/styled-system/types/selectors.d.ts +59 -0
  181. package/dist/styled-system/types/static-css.d.ts +56 -0
  182. package/dist/styled-system/types/style-props.d.ts +7491 -0
  183. package/dist/styled-system/types/system-types.d.ts +193 -0
  184. package/dist/styles/panda.css +1610 -0
  185. package/dist/theme/index.d.ts +2 -0
  186. package/dist/theme/index.d.ts.map +1 -0
  187. package/dist/theme/index.js +2 -0
  188. package/dist/theme/index.js.map +1 -0
  189. package/dist/{functions/theme → theme}/thread-theme.d.ts +1 -1
  190. package/dist/theme/thread-theme.d.ts.map +1 -0
  191. package/dist/{functions/theme → theme}/thread-theme.js +1 -1
  192. package/dist/theme/thread-theme.js.map +1 -0
  193. package/dist/utils/deep-merge/deep-merge.d.ts.map +1 -1
  194. package/dist/utils/get-colored-text-color/get-colored-text-color.d.ts.map +1 -1
  195. package/dist/utils/get-colored-text-color/get-colored-text-color.js +1 -1
  196. package/dist/utils/get-colored-text-color/get-colored-text-color.js.map +1 -1
  197. package/dist/utils/get-text-color/get-text-color.d.ts.map +1 -1
  198. package/dist/utils/get-text-color/get-text-color.js +1 -1
  199. package/dist/utils/get-text-color/get-text-color.js.map +1 -1
  200. package/dist/utils/get-utility-color/get-utility-color-value.d.ts.map +1 -1
  201. package/dist/utils/get-utility-color/get-utility-color-value.js +1 -1
  202. package/dist/utils/get-utility-color/get-utility-color-value.js.map +1 -1
  203. package/dist/utils/get-utility-font-size/getUtilityFontSize.d.ts +1 -1
  204. package/dist/utils/get-utility-font-size/getUtilityFontSize.d.ts.map +1 -1
  205. package/dist/utils/get-utility-icon-size/get-utility-icon-size.d.ts.map +1 -1
  206. package/dist/utils/get-utility-size-value/get-utility-size-value.d.ts.map +1 -1
  207. package/package.json +17 -9
  208. package/dist/components/ui/test-component/index.d.ts +0 -2
  209. package/dist/components/ui/test-component/index.d.ts.map +0 -1
  210. package/dist/components/ui/test-component/index.js +0 -2
  211. package/dist/components/ui/test-component/index.js.map +0 -1
  212. package/dist/components/ui/test-component/test-component.d.ts +0 -2
  213. package/dist/components/ui/test-component/test-component.d.ts.map +0 -1
  214. package/dist/components/ui/test-component/test-component.js +0 -16
  215. package/dist/components/ui/test-component/test-component.js.map +0 -1
  216. package/dist/components/ui/toggle/mode-toggle/mode-toggle.d.ts +0 -2
  217. package/dist/components/ui/toggle/mode-toggle/mode-toggle.d.ts.map +0 -1
  218. package/dist/components/ui/toggle/mode-toggle/mode-toggle.js +0 -10
  219. package/dist/components/ui/toggle/mode-toggle/mode-toggle.js.map +0 -1
  220. package/dist/functions/index.d.ts +0 -3
  221. package/dist/functions/index.d.ts.map +0 -1
  222. package/dist/functions/index.js +0 -3
  223. package/dist/functions/index.js.map +0 -1
  224. package/dist/functions/make-styles/index.d.ts +0 -2
  225. package/dist/functions/make-styles/index.d.ts.map +0 -1
  226. package/dist/functions/make-styles/index.js +0 -2
  227. package/dist/functions/make-styles/index.js.map +0 -1
  228. package/dist/functions/make-styles/make-styles.d.ts.map +0 -1
  229. package/dist/functions/make-styles/make-styles.js.map +0 -1
  230. package/dist/functions/theme/index.d.ts.map +0 -1
  231. package/dist/functions/theme/index.js.map +0 -1
  232. package/dist/functions/theme/theme-provider/index.d.ts.map +0 -1
  233. package/dist/functions/theme/theme-provider/index.js.map +0 -1
  234. package/dist/functions/theme/theme-provider/set-theme.d.ts.map +0 -1
  235. package/dist/functions/theme/theme-provider/set-theme.js.map +0 -1
  236. package/dist/functions/theme/theme-provider/theme-provider.d.ts.map +0 -1
  237. package/dist/functions/theme/theme-provider/theme-provider.js.map +0 -1
  238. package/dist/functions/theme/theme-provider/theme-provider.types.d.ts.map +0 -1
  239. package/dist/functions/theme/theme-provider/theme-provider.types.js.map +0 -1
  240. package/dist/functions/theme/theme.types.d.ts.map +0 -1
  241. package/dist/functions/theme/theme.types.js.map +0 -1
  242. package/dist/functions/theme/thread-theme.d.ts.map +0 -1
  243. package/dist/functions/theme/thread-theme.js.map +0 -1
  244. /package/dist/{functions → client}/theme/theme-provider/index.d.ts +0 -0
  245. /package/dist/{functions → client}/theme/theme-provider/index.js +0 -0
  246. /package/dist/{functions → client}/theme/theme-provider/set-theme.d.ts +0 -0
  247. /package/dist/{functions → client}/theme/theme-provider/theme-provider.d.ts +0 -0
  248. /package/dist/{functions → client}/theme/theme-provider/theme-provider.js +0 -0
  249. /package/dist/{functions → client}/theme/theme-provider/theme-provider.types.d.ts +0 -0
  250. /package/dist/{functions → client}/theme/theme-provider/theme-provider.types.js +0 -0
  251. /package/dist/{functions → client}/theme/theme.types.d.ts +0 -0
  252. /package/dist/{functions → client}/theme/theme.types.js +0 -0
@@ -0,0 +1,25 @@
1
+ import { getPatternStyles, patternFns } from '../helpers.mjs';
2
+ import { css } from '../css/index.mjs';
3
+
4
+ const wrapConfig = {
5
+ transform(props) {
6
+ const { columnGap, rowGap, gap = columnGap || rowGap ? void 0 : "10px", align, justify, ...rest } = props;
7
+ return {
8
+ display: "flex",
9
+ flexWrap: "wrap",
10
+ alignItems: align,
11
+ justifyContent: justify,
12
+ gap,
13
+ columnGap,
14
+ rowGap,
15
+ ...rest
16
+ };
17
+ }}
18
+
19
+ export const getWrapStyle = (styles = {}) => {
20
+ const _styles = getPatternStyles(wrapConfig, styles)
21
+ return wrapConfig.transform(_styles, patternFns)
22
+ }
23
+
24
+ export const wrap = (styles) => css(getWrapStyle(styles))
25
+ wrap.raw = getWrapStyle
@@ -0,0 +1,43 @@
1
+ /* eslint-disable */
2
+ import type { ConditionalValue } from '../types/index';
3
+ import type { DistributiveOmit, Pretty } from '../types/system-types';
4
+
5
+ interface ButtonVariant {
6
+ /**
7
+ * @default "primary"
8
+ */
9
+ color: "primary" | "secondary" | "tertiary" | "black" | "gray" | "success" | "error" | "info" | "text"
10
+ /**
11
+ * @default "md"
12
+ */
13
+ size: "sm" | "md" | "lg"
14
+ /**
15
+ * @default false
16
+ */
17
+ fullWidth: boolean
18
+ /**
19
+ * @default false
20
+ */
21
+ disabled: boolean
22
+ }
23
+
24
+ type ButtonVariantMap = {
25
+ [key in keyof ButtonVariant]: Array<ButtonVariant[key]>
26
+ }
27
+
28
+ export type ButtonVariantProps = {
29
+ [key in keyof ButtonVariant]?: ButtonVariant[key] | undefined
30
+ }
31
+
32
+ export interface ButtonRecipe {
33
+ __type: ButtonVariantProps
34
+ (props?: ButtonVariantProps): string
35
+ raw: (props?: ButtonVariantProps) => ButtonVariantProps
36
+ variantMap: ButtonVariantMap
37
+ variantKeys: Array<keyof ButtonVariant>
38
+ splitVariantProps<Props extends ButtonVariantProps>(props: Props): [ButtonVariantProps, Pretty<DistributiveOmit<Props, keyof ButtonVariantProps>>]
39
+ getVariantProps: (props?: ButtonVariantProps) => ButtonVariantProps
40
+ }
41
+
42
+
43
+ export declare const button: ButtonRecipe
@@ -0,0 +1,154 @@
1
+ import { memo, splitProps } from '../helpers.mjs';
2
+ import { createRecipe, mergeRecipes } from './create-recipe.mjs';
3
+
4
+ const buttonFn = /* @__PURE__ */ createRecipe('button', {
5
+ "color": "primary",
6
+ "size": "md",
7
+ "fullWidth": false,
8
+ "disabled": false
9
+ }, [
10
+ {
11
+ "color": "primary",
12
+ "disabled": true,
13
+ "css": {
14
+ "_hover": {
15
+ "backgroundColor": "primary.main",
16
+ "color": "background",
17
+ "borderColor": "primary.main"
18
+ }
19
+ }
20
+ },
21
+ {
22
+ "color": "secondary",
23
+ "disabled": true,
24
+ "css": {
25
+ "_hover": {
26
+ "backgroundColor": "secondary.main",
27
+ "color": "background",
28
+ "borderColor": "secondary.main"
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "color": "tertiary",
34
+ "disabled": true,
35
+ "css": {
36
+ "_hover": {
37
+ "backgroundColor": "tertiary.main",
38
+ "color": "background",
39
+ "borderColor": "tertiary.main"
40
+ }
41
+ }
42
+ },
43
+ {
44
+ "color": "gray",
45
+ "disabled": true,
46
+ "css": {
47
+ "_hover": {
48
+ "backgroundColor": "gray.main",
49
+ "color": "background",
50
+ "borderColor": "gray.main"
51
+ }
52
+ }
53
+ },
54
+ {
55
+ "color": "success",
56
+ "disabled": true,
57
+ "css": {
58
+ "_hover": {
59
+ "backgroundColor": "success.main",
60
+ "color": "background",
61
+ "borderColor": "success.main"
62
+ }
63
+ }
64
+ },
65
+ {
66
+ "color": "error",
67
+ "disabled": true,
68
+ "css": {
69
+ "_hover": {
70
+ "backgroundColor": "error.main",
71
+ "color": "background",
72
+ "borderColor": "error.main"
73
+ }
74
+ }
75
+ },
76
+ {
77
+ "color": "info",
78
+ "disabled": true,
79
+ "css": {
80
+ "_hover": {
81
+ "backgroundColor": "info.main",
82
+ "color": "background",
83
+ "borderColor": "info.main"
84
+ }
85
+ }
86
+ },
87
+ {
88
+ "color": "text",
89
+ "disabled": true,
90
+ "css": {
91
+ "_hover": {
92
+ "backgroundColor": "text.standard",
93
+ "color": "background",
94
+ "borderColor": "text.standard"
95
+ }
96
+ }
97
+ },
98
+ {
99
+ "color": "black",
100
+ "disabled": true,
101
+ "css": {
102
+ "_hover": {
103
+ "backgroundColor": "black",
104
+ "color": "background",
105
+ "borderColor": "white"
106
+ }
107
+ }
108
+ }
109
+ ])
110
+
111
+ const buttonVariantMap = {
112
+ "color": [
113
+ "primary",
114
+ "secondary",
115
+ "tertiary",
116
+ "black",
117
+ "gray",
118
+ "success",
119
+ "error",
120
+ "info",
121
+ "text"
122
+ ],
123
+ "size": [
124
+ "sm",
125
+ "md",
126
+ "lg"
127
+ ],
128
+ "fullWidth": [
129
+ "true",
130
+ "false"
131
+ ],
132
+ "disabled": [
133
+ "true",
134
+ "false"
135
+ ]
136
+ }
137
+
138
+ const buttonVariantKeys = Object.keys(buttonVariantMap)
139
+
140
+ export const button = /* @__PURE__ */ Object.assign(memo(buttonFn.recipeFn), {
141
+ __recipe__: true,
142
+ __name__: 'button',
143
+ __getCompoundVariantCss__: buttonFn.__getCompoundVariantCss__,
144
+ raw: (props) => props,
145
+ variantKeys: buttonVariantKeys,
146
+ variantMap: buttonVariantMap,
147
+ merge(recipe) {
148
+ return mergeRecipes(this, recipe)
149
+ },
150
+ splitVariantProps(props) {
151
+ return splitProps(props, buttonVariantKeys)
152
+ },
153
+ getVariantProps: buttonFn.getVariantProps,
154
+ })
@@ -0,0 +1,82 @@
1
+ import { finalizeConditions, sortConditions } from '../css/conditions.mjs';
2
+ import { css } from '../css/css.mjs';
3
+ import { assertCompoundVariant, getCompoundVariantCss } from '../css/cva.mjs';
4
+ import { cx } from '../css/cx.mjs';
5
+ import { compact, createCss, splitProps, uniq, withoutSpace } from '../helpers.mjs';
6
+
7
+ export const createRecipe = (name, defaultVariants, compoundVariants) => {
8
+ const getVariantProps = (variants) => {
9
+ return {
10
+ [name]: '__ignore__',
11
+ ...defaultVariants,
12
+ ...compact(variants),
13
+ };
14
+ };
15
+
16
+ const recipeFn = (variants, withCompoundVariants = true) => {
17
+ const transform = (prop, value) => {
18
+ assertCompoundVariant(name, compoundVariants, variants, prop)
19
+
20
+ if (value === '__ignore__') {
21
+ return { className: name }
22
+ }
23
+
24
+ value = withoutSpace(value)
25
+ return { className: `${name}--${prop}_${value}` }
26
+ }
27
+
28
+ const recipeCss = createCss({
29
+
30
+ conditions: {
31
+ shift: sortConditions,
32
+ finalize: finalizeConditions,
33
+ breakpoints: { keys: ["base","sm","md","lg","xl","2xl"] }
34
+ },
35
+ utility: {
36
+ prefix: "thread-ui",
37
+ toHash: (path, hashFn) => hashFn(path.join(":")),
38
+ transform,
39
+ }
40
+ })
41
+
42
+ const recipeStyles = getVariantProps(variants)
43
+
44
+ if (withCompoundVariants) {
45
+ const compoundVariantStyles = getCompoundVariantCss(compoundVariants, recipeStyles)
46
+ return cx(recipeCss(recipeStyles), css(compoundVariantStyles))
47
+ }
48
+
49
+ return recipeCss(recipeStyles)
50
+ }
51
+
52
+ return {
53
+ recipeFn,
54
+ getVariantProps,
55
+ __getCompoundVariantCss__: (variants) => {
56
+ return getCompoundVariantCss(compoundVariants, getVariantProps(variants));
57
+ },
58
+ }
59
+ }
60
+
61
+ export const mergeRecipes = (recipeA, recipeB) => {
62
+ if (recipeA && !recipeB) return recipeA
63
+ if (!recipeA && recipeB) return recipeB
64
+
65
+ const recipeFn = (...args) => cx(recipeA(...args), recipeB(...args))
66
+ const variantKeys = uniq(recipeA.variantKeys, recipeB.variantKeys)
67
+ const variantMap = variantKeys.reduce((acc, key) => {
68
+ acc[key] = uniq(recipeA.variantMap[key], recipeB.variantMap[key])
69
+ return acc
70
+ }, {})
71
+
72
+ return Object.assign(recipeFn, {
73
+ __recipe__: true,
74
+ __name__: `${recipeA.__name__} ${recipeB.__name__}`,
75
+ raw: (props) => props,
76
+ variantKeys,
77
+ variantMap,
78
+ splitVariantProps(props) {
79
+ return splitProps(props, variantKeys)
80
+ },
81
+ })
82
+ }
@@ -0,0 +1,2 @@
1
+ /* eslint-disable */
2
+ export * from './button';
@@ -0,0 +1 @@
1
+ export * from './button.mjs';