@webstudio-is/sdk-components-react 0.70.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 (460) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/lib/__generated__/blockquote.props.js +399 -0
  4. package/lib/__generated__/body.props.js +398 -0
  5. package/lib/__generated__/bold.props.js +398 -0
  6. package/lib/__generated__/box.props.js +416 -0
  7. package/lib/__generated__/button.props.js +420 -0
  8. package/lib/__generated__/checkbox-field.props.js +399 -0
  9. package/lib/__generated__/checkbox.props.js +439 -0
  10. package/lib/__generated__/code-text.props.js +405 -0
  11. package/lib/__generated__/error-message.props.js +398 -0
  12. package/lib/__generated__/form.props.js +406 -0
  13. package/lib/__generated__/fragment.props.js +4 -0
  14. package/lib/__generated__/heading.props.js +405 -0
  15. package/lib/__generated__/html-embed.props.js +11 -0
  16. package/lib/__generated__/image.props.js +442 -0
  17. package/lib/__generated__/input.props.js +445 -0
  18. package/lib/__generated__/italic.props.js +398 -0
  19. package/lib/__generated__/label.props.js +400 -0
  20. package/lib/__generated__/link-block.props.js +432 -0
  21. package/lib/__generated__/link.props.js +432 -0
  22. package/lib/__generated__/list-item.props.js +399 -0
  23. package/lib/__generated__/list.props.js +412 -0
  24. package/lib/__generated__/paragraph.props.js +398 -0
  25. package/lib/__generated__/radio-button-field.props.js +399 -0
  26. package/lib/__generated__/radio-button.props.js +439 -0
  27. package/lib/__generated__/rich-text-link.props.js +432 -0
  28. package/lib/__generated__/separator.props.js +398 -0
  29. package/lib/__generated__/slot.props.js +4 -0
  30. package/lib/__generated__/span.props.js +398 -0
  31. package/lib/__generated__/subscript.props.js +398 -0
  32. package/lib/__generated__/success-message.props.js +398 -0
  33. package/lib/__generated__/superscript.props.js +398 -0
  34. package/lib/__generated__/text-block.props.js +405 -0
  35. package/lib/__generated__/textarea.props.js +412 -0
  36. package/lib/blockquote.js +15 -0
  37. package/lib/blockquote.ws.js +76 -0
  38. package/lib/body.js +9 -0
  39. package/lib/body.ws.js +47 -0
  40. package/lib/bold.js +9 -0
  41. package/lib/bold.ws.js +23 -0
  42. package/lib/box.js +14 -0
  43. package/lib/box.ws.js +46 -0
  44. package/lib/button.js +16 -0
  45. package/lib/button.ws.js +31 -0
  46. package/lib/checkbox-field.js +9 -0
  47. package/lib/checkbox-field.ws.js +44 -0
  48. package/lib/checkbox.js +9 -0
  49. package/lib/checkbox.ws.js +40 -0
  50. package/lib/cjs/__generated__/blockquote.props.js +419 -0
  51. package/lib/cjs/__generated__/body.props.js +418 -0
  52. package/lib/cjs/__generated__/bold.props.js +418 -0
  53. package/lib/cjs/__generated__/box.props.js +436 -0
  54. package/lib/cjs/__generated__/button.props.js +440 -0
  55. package/lib/cjs/__generated__/checkbox-field.props.js +419 -0
  56. package/lib/cjs/__generated__/checkbox.props.js +459 -0
  57. package/lib/cjs/__generated__/code-text.props.js +425 -0
  58. package/lib/cjs/__generated__/error-message.props.js +418 -0
  59. package/lib/cjs/__generated__/form.props.js +426 -0
  60. package/lib/cjs/__generated__/fragment.props.js +24 -0
  61. package/lib/cjs/__generated__/heading.props.js +425 -0
  62. package/lib/cjs/__generated__/html-embed.props.js +31 -0
  63. package/lib/cjs/__generated__/image.props.js +462 -0
  64. package/lib/cjs/__generated__/input.props.js +465 -0
  65. package/lib/cjs/__generated__/italic.props.js +418 -0
  66. package/lib/cjs/__generated__/label.props.js +420 -0
  67. package/lib/cjs/__generated__/link-block.props.js +452 -0
  68. package/lib/cjs/__generated__/link.props.js +452 -0
  69. package/lib/cjs/__generated__/list-item.props.js +419 -0
  70. package/lib/cjs/__generated__/list.props.js +432 -0
  71. package/lib/cjs/__generated__/paragraph.props.js +418 -0
  72. package/lib/cjs/__generated__/radio-button-field.props.js +419 -0
  73. package/lib/cjs/__generated__/radio-button.props.js +459 -0
  74. package/lib/cjs/__generated__/rich-text-link.props.js +452 -0
  75. package/lib/cjs/__generated__/separator.props.js +418 -0
  76. package/lib/cjs/__generated__/slot.props.js +24 -0
  77. package/lib/cjs/__generated__/span.props.js +418 -0
  78. package/lib/cjs/__generated__/subscript.props.js +418 -0
  79. package/lib/cjs/__generated__/success-message.props.js +418 -0
  80. package/lib/cjs/__generated__/superscript.props.js +418 -0
  81. package/lib/cjs/__generated__/text-block.props.js +425 -0
  82. package/lib/cjs/__generated__/textarea.props.js +432 -0
  83. package/lib/cjs/blockquote.js +32 -0
  84. package/lib/cjs/blockquote.ws.js +94 -0
  85. package/lib/cjs/body.js +29 -0
  86. package/lib/cjs/body.ws.js +65 -0
  87. package/lib/cjs/bold.js +29 -0
  88. package/lib/cjs/bold.ws.js +41 -0
  89. package/lib/cjs/box.js +31 -0
  90. package/lib/cjs/box.ws.js +53 -0
  91. package/lib/cjs/button.js +36 -0
  92. package/lib/cjs/button.ws.js +49 -0
  93. package/lib/cjs/checkbox-field.js +29 -0
  94. package/lib/cjs/checkbox-field.ws.js +62 -0
  95. package/lib/cjs/checkbox.js +29 -0
  96. package/lib/cjs/checkbox.ws.js +58 -0
  97. package/lib/cjs/code-text.js +39 -0
  98. package/lib/cjs/code-text.ws.js +74 -0
  99. package/lib/cjs/components.js +88 -0
  100. package/lib/cjs/error-message.js +29 -0
  101. package/lib/cjs/error-message.ws.js +40 -0
  102. package/lib/cjs/form.js +29 -0
  103. package/lib/cjs/form.ws.js +82 -0
  104. package/lib/cjs/fragment.js +29 -0
  105. package/lib/cjs/fragment.ws.js +33 -0
  106. package/lib/cjs/heading.js +31 -0
  107. package/lib/cjs/heading.ws.js +56 -0
  108. package/lib/cjs/html-embed.js +80 -0
  109. package/lib/cjs/html-embed.ws.js +45 -0
  110. package/lib/cjs/image.js +76 -0
  111. package/lib/cjs/image.ws.js +66 -0
  112. package/lib/cjs/input.js +29 -0
  113. package/lib/cjs/input.ws.js +55 -0
  114. package/lib/cjs/italic.js +29 -0
  115. package/lib/cjs/italic.ws.js +47 -0
  116. package/lib/cjs/label.js +29 -0
  117. package/lib/cjs/label.ws.js +63 -0
  118. package/lib/cjs/link-block.js +30 -0
  119. package/lib/cjs/link-block.ws.js +53 -0
  120. package/lib/cjs/link.js +48 -0
  121. package/lib/cjs/link.ws.js +79 -0
  122. package/lib/cjs/list-item.js +32 -0
  123. package/lib/cjs/list-item.ws.js +51 -0
  124. package/lib/cjs/list.js +31 -0
  125. package/lib/cjs/list.ws.js +73 -0
  126. package/lib/cjs/metas.js +88 -0
  127. package/lib/cjs/package.json +1 -0
  128. package/lib/cjs/paragraph.js +29 -0
  129. package/lib/cjs/paragraph.ws.js +50 -0
  130. package/lib/cjs/props.js +88 -0
  131. package/lib/cjs/radio-button-field.js +29 -0
  132. package/lib/cjs/radio-button-field.ws.js +62 -0
  133. package/lib/cjs/radio-button.js +29 -0
  134. package/lib/cjs/radio-button.ws.js +58 -0
  135. package/lib/cjs/rich-text-link.js +28 -0
  136. package/lib/cjs/rich-text-link.ws.js +39 -0
  137. package/lib/cjs/separator.js +32 -0
  138. package/lib/cjs/separator.ws.js +70 -0
  139. package/lib/cjs/slot.js +36 -0
  140. package/lib/cjs/slot.ws.js +36 -0
  141. package/lib/cjs/span.js +29 -0
  142. package/lib/cjs/span.ws.js +41 -0
  143. package/lib/cjs/subscript.js +29 -0
  144. package/lib/cjs/subscript.ws.js +41 -0
  145. package/lib/cjs/success-message.js +29 -0
  146. package/lib/cjs/success-message.ws.js +40 -0
  147. package/lib/cjs/superscript.js +29 -0
  148. package/lib/cjs/superscript.ws.js +41 -0
  149. package/lib/cjs/text-block.js +32 -0
  150. package/lib/cjs/text-block.ws.js +57 -0
  151. package/lib/cjs/textarea.js +29 -0
  152. package/lib/cjs/textarea.ws.js +59 -0
  153. package/lib/code-text.js +22 -0
  154. package/lib/code-text.ws.js +56 -0
  155. package/lib/components.js +68 -0
  156. package/lib/error-message.js +9 -0
  157. package/lib/error-message.ws.js +20 -0
  158. package/lib/form.js +9 -0
  159. package/lib/form.ws.js +64 -0
  160. package/lib/fragment.js +9 -0
  161. package/lib/fragment.ws.js +13 -0
  162. package/lib/heading.js +14 -0
  163. package/lib/heading.ws.js +38 -0
  164. package/lib/html-embed.js +65 -0
  165. package/lib/html-embed.ws.js +25 -0
  166. package/lib/image.js +66 -0
  167. package/lib/image.ws.js +48 -0
  168. package/lib/input.js +9 -0
  169. package/lib/input.ws.js +37 -0
  170. package/lib/italic.js +9 -0
  171. package/lib/italic.ws.js +29 -0
  172. package/lib/label.js +9 -0
  173. package/lib/label.ws.js +45 -0
  174. package/lib/link-block.js +10 -0
  175. package/lib/link-block.ws.js +33 -0
  176. package/lib/link.js +32 -0
  177. package/lib/link.ws.js +61 -0
  178. package/lib/list-item.js +15 -0
  179. package/lib/list-item.ws.js +33 -0
  180. package/lib/list.js +14 -0
  181. package/lib/list.ws.js +55 -0
  182. package/lib/metas.js +68 -0
  183. package/lib/paragraph.js +9 -0
  184. package/lib/paragraph.ws.js +32 -0
  185. package/lib/props.js +68 -0
  186. package/lib/radio-button-field.js +9 -0
  187. package/lib/radio-button-field.ws.js +44 -0
  188. package/lib/radio-button.js +9 -0
  189. package/lib/radio-button.ws.js +40 -0
  190. package/lib/rich-text-link.js +8 -0
  191. package/lib/rich-text-link.ws.js +19 -0
  192. package/lib/separator.js +15 -0
  193. package/lib/separator.ws.js +52 -0
  194. package/lib/slot.js +16 -0
  195. package/lib/slot.ws.js +16 -0
  196. package/lib/span.js +9 -0
  197. package/lib/span.ws.js +23 -0
  198. package/lib/subscript.js +9 -0
  199. package/lib/subscript.ws.js +23 -0
  200. package/lib/success-message.js +9 -0
  201. package/lib/success-message.ws.js +20 -0
  202. package/lib/superscript.js +9 -0
  203. package/lib/superscript.ws.js +23 -0
  204. package/lib/text-block.js +15 -0
  205. package/lib/text-block.ws.js +39 -0
  206. package/lib/textarea.js +9 -0
  207. package/lib/textarea.ws.js +41 -0
  208. package/lib/types/__generated__/blockquote.props.d.ts +2 -0
  209. package/lib/types/__generated__/body.props.d.ts +2 -0
  210. package/lib/types/__generated__/bold.props.d.ts +2 -0
  211. package/lib/types/__generated__/box.props.d.ts +2 -0
  212. package/lib/types/__generated__/button.props.d.ts +2 -0
  213. package/lib/types/__generated__/checkbox-field.props.d.ts +2 -0
  214. package/lib/types/__generated__/checkbox.props.d.ts +2 -0
  215. package/lib/types/__generated__/code-text.props.d.ts +2 -0
  216. package/lib/types/__generated__/error-message.props.d.ts +2 -0
  217. package/lib/types/__generated__/form.props.d.ts +2 -0
  218. package/lib/types/__generated__/fragment.props.d.ts +2 -0
  219. package/lib/types/__generated__/heading.props.d.ts +2 -0
  220. package/lib/types/__generated__/html-embed.props.d.ts +2 -0
  221. package/lib/types/__generated__/image.props.d.ts +2 -0
  222. package/lib/types/__generated__/input.props.d.ts +2 -0
  223. package/lib/types/__generated__/italic.props.d.ts +2 -0
  224. package/lib/types/__generated__/label.props.d.ts +2 -0
  225. package/lib/types/__generated__/link-block.props.d.ts +2 -0
  226. package/lib/types/__generated__/link.props.d.ts +2 -0
  227. package/lib/types/__generated__/list-item.props.d.ts +2 -0
  228. package/lib/types/__generated__/list.props.d.ts +2 -0
  229. package/lib/types/__generated__/paragraph.props.d.ts +2 -0
  230. package/lib/types/__generated__/radio-button-field.props.d.ts +2 -0
  231. package/lib/types/__generated__/radio-button.props.d.ts +2 -0
  232. package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
  233. package/lib/types/__generated__/separator.props.d.ts +2 -0
  234. package/lib/types/__generated__/slot.props.d.ts +2 -0
  235. package/lib/types/__generated__/span.props.d.ts +2 -0
  236. package/lib/types/__generated__/subscript.props.d.ts +2 -0
  237. package/lib/types/__generated__/success-message.props.d.ts +2 -0
  238. package/lib/types/__generated__/superscript.props.d.ts +2 -0
  239. package/lib/types/__generated__/text-block.props.d.ts +2 -0
  240. package/lib/types/__generated__/textarea.props.d.ts +2 -0
  241. package/lib/types/blockquote.d.ts +3 -0
  242. package/lib/types/blockquote.stories.d.ts +5 -0
  243. package/lib/types/blockquote.ws.d.ts +3 -0
  244. package/lib/types/body.d.ts +3 -0
  245. package/lib/types/body.stories.d.ts +6 -0
  246. package/lib/types/body.ws.d.ts +3 -0
  247. package/lib/types/bold.d.ts +3 -0
  248. package/lib/types/bold.stories.d.ts +5 -0
  249. package/lib/types/bold.ws.d.ts +3 -0
  250. package/lib/types/box.d.ts +7 -0
  251. package/lib/types/box.stories.d.ts +9 -0
  252. package/lib/types/box.ws.d.ts +3 -0
  253. package/lib/types/button.d.ts +7 -0
  254. package/lib/types/button.stories.d.ts +9 -0
  255. package/lib/types/button.ws.d.ts +3 -0
  256. package/lib/types/checkbox-field.d.ts +3 -0
  257. package/lib/types/checkbox-field.ws.d.ts +3 -0
  258. package/lib/types/checkbox.d.ts +3 -0
  259. package/lib/types/checkbox.ws.d.ts +3 -0
  260. package/lib/types/code-text.d.ts +9 -0
  261. package/lib/types/code-text.stories.d.ts +11 -0
  262. package/lib/types/code-text.ws.d.ts +3 -0
  263. package/lib/types/components.d.ts +33 -0
  264. package/lib/types/error-message.d.ts +3 -0
  265. package/lib/types/error-message.ws.d.ts +3 -0
  266. package/lib/types/form.d.ts +3 -0
  267. package/lib/types/form.stories.d.ts +5 -0
  268. package/lib/types/form.ws.d.ts +3 -0
  269. package/lib/types/fragment.d.ts +6 -0
  270. package/lib/types/fragment.ws.d.ts +3 -0
  271. package/lib/types/heading.d.ts +7 -0
  272. package/lib/types/heading.stories.d.ts +9 -0
  273. package/lib/types/heading.ws.d.ts +3 -0
  274. package/lib/types/html-embed.d.ts +7 -0
  275. package/lib/types/html-embed.stories.d.ts +11 -0
  276. package/lib/types/html-embed.ws.d.ts +3 -0
  277. package/lib/types/image.d.ts +7 -0
  278. package/lib/types/image.stories.d.ts +13 -0
  279. package/lib/types/image.ws.d.ts +3 -0
  280. package/lib/types/input.d.ts +5 -0
  281. package/lib/types/input.stories.d.ts +9 -0
  282. package/lib/types/input.ws.d.ts +3 -0
  283. package/lib/types/italic.d.ts +3 -0
  284. package/lib/types/italic.stories.d.ts +5 -0
  285. package/lib/types/italic.ws.d.ts +3 -0
  286. package/lib/types/label.d.ts +3 -0
  287. package/lib/types/label.ws.d.ts +3 -0
  288. package/lib/types/link-block.d.ts +3 -0
  289. package/lib/types/link-block.stories.d.ts +13 -0
  290. package/lib/types/link-block.ws.d.ts +3 -0
  291. package/lib/types/link.d.ts +9 -0
  292. package/lib/types/link.stories.d.ts +13 -0
  293. package/lib/types/link.ws.d.ts +3 -0
  294. package/lib/types/list-item.d.ts +3 -0
  295. package/lib/types/list-item.stories.d.ts +5 -0
  296. package/lib/types/list-item.ws.d.ts +3 -0
  297. package/lib/types/list.d.ts +9 -0
  298. package/lib/types/list.stories.d.ts +9 -0
  299. package/lib/types/list.ws.d.ts +3 -0
  300. package/lib/types/metas.d.ts +33 -0
  301. package/lib/types/paragraph.d.ts +3 -0
  302. package/lib/types/paragraph.stories.d.ts +5 -0
  303. package/lib/types/paragraph.ws.d.ts +3 -0
  304. package/lib/types/props.d.ts +33 -0
  305. package/lib/types/radio-button-field.d.ts +3 -0
  306. package/lib/types/radio-button-field.ws.d.ts +3 -0
  307. package/lib/types/radio-button.d.ts +3 -0
  308. package/lib/types/radio-button.ws.d.ts +3 -0
  309. package/lib/types/rich-text-link.d.ts +2 -0
  310. package/lib/types/rich-text-link.stories.d.ts +13 -0
  311. package/lib/types/rich-text-link.ws.d.ts +3 -0
  312. package/lib/types/separator.d.ts +3 -0
  313. package/lib/types/separator.stories.d.ts +5 -0
  314. package/lib/types/separator.ws.d.ts +3 -0
  315. package/lib/types/slot.d.ts +6 -0
  316. package/lib/types/slot.stories.d.ts +9 -0
  317. package/lib/types/slot.ws.d.ts +3 -0
  318. package/lib/types/span.d.ts +3 -0
  319. package/lib/types/span.stories.d.ts +5 -0
  320. package/lib/types/span.ws.d.ts +3 -0
  321. package/lib/types/subscript.d.ts +3 -0
  322. package/lib/types/subscript.stories.d.ts +5 -0
  323. package/lib/types/subscript.ws.d.ts +3 -0
  324. package/lib/types/success-message.d.ts +3 -0
  325. package/lib/types/success-message.ws.d.ts +3 -0
  326. package/lib/types/superscript.d.ts +3 -0
  327. package/lib/types/superscript.stories.d.ts +5 -0
  328. package/lib/types/superscript.ws.d.ts +3 -0
  329. package/lib/types/text-block.d.ts +7 -0
  330. package/lib/types/text-block.stories.d.ts +9 -0
  331. package/lib/types/text-block.ws.d.ts +3 -0
  332. package/lib/types/textarea.d.ts +3 -0
  333. package/lib/types/textarea.ws.d.ts +3 -0
  334. package/package.json +69 -0
  335. package/src/__generated__/blockquote.props.ts +444 -0
  336. package/src/__generated__/body.props.ts +443 -0
  337. package/src/__generated__/bold.props.ts +443 -0
  338. package/src/__generated__/box.props.ts +461 -0
  339. package/src/__generated__/button.props.ts +465 -0
  340. package/src/__generated__/checkbox-field.props.ts +444 -0
  341. package/src/__generated__/checkbox.props.ts +484 -0
  342. package/src/__generated__/code-text.props.ts +450 -0
  343. package/src/__generated__/error-message.props.ts +443 -0
  344. package/src/__generated__/form.props.ts +451 -0
  345. package/src/__generated__/fragment.props.ts +3 -0
  346. package/src/__generated__/heading.props.ts +450 -0
  347. package/src/__generated__/html-embed.props.ts +10 -0
  348. package/src/__generated__/image.props.ts +487 -0
  349. package/src/__generated__/input.props.ts +490 -0
  350. package/src/__generated__/italic.props.ts +443 -0
  351. package/src/__generated__/label.props.ts +445 -0
  352. package/src/__generated__/link-block.props.ts +477 -0
  353. package/src/__generated__/link.props.ts +477 -0
  354. package/src/__generated__/list-item.props.ts +444 -0
  355. package/src/__generated__/list.props.ts +457 -0
  356. package/src/__generated__/paragraph.props.ts +443 -0
  357. package/src/__generated__/radio-button-field.props.ts +444 -0
  358. package/src/__generated__/radio-button.props.ts +484 -0
  359. package/src/__generated__/rich-text-link.props.ts +477 -0
  360. package/src/__generated__/separator.props.ts +443 -0
  361. package/src/__generated__/slot.props.ts +3 -0
  362. package/src/__generated__/span.props.ts +443 -0
  363. package/src/__generated__/subscript.props.ts +443 -0
  364. package/src/__generated__/success-message.props.ts +443 -0
  365. package/src/__generated__/superscript.props.ts +443 -0
  366. package/src/__generated__/text-block.props.ts +450 -0
  367. package/src/__generated__/textarea.props.ts +457 -0
  368. package/src/blockquote.stories.tsx +16 -0
  369. package/src/blockquote.tsx +18 -0
  370. package/src/blockquote.ws.tsx +81 -0
  371. package/src/body.stories.tsx +11 -0
  372. package/src/body.tsx +10 -0
  373. package/src/body.ws.tsx +51 -0
  374. package/src/bold.stories.tsx +16 -0
  375. package/src/bold.tsx +10 -0
  376. package/src/bold.ws.tsx +26 -0
  377. package/src/box.stories.tsx +17 -0
  378. package/src/box.tsx +31 -0
  379. package/src/box.ws.ts +52 -0
  380. package/src/button.stories.tsx +13 -0
  381. package/src/button.tsx +23 -0
  382. package/src/button.ws.tsx +34 -0
  383. package/src/checkbox-field.tsx +10 -0
  384. package/src/checkbox-field.ws.tsx +47 -0
  385. package/src/checkbox.tsx +13 -0
  386. package/src/checkbox.ws.tsx +43 -0
  387. package/src/code-text.stories.tsx +16 -0
  388. package/src/code-text.tsx +31 -0
  389. package/src/code-text.ws.tsx +58 -0
  390. package/src/components.ts +33 -0
  391. package/src/error-message.tsx +10 -0
  392. package/src/error-message.ws.tsx +24 -0
  393. package/src/form.stories.tsx +14 -0
  394. package/src/form.tsx +14 -0
  395. package/src/form.ws.tsx +67 -0
  396. package/src/fragment.tsx +11 -0
  397. package/src/fragment.ws.ts +15 -0
  398. package/src/heading.stories.tsx +16 -0
  399. package/src/heading.tsx +20 -0
  400. package/src/heading.ws.tsx +44 -0
  401. package/src/html-embed.stories.tsx +16 -0
  402. package/src/html-embed.tsx +96 -0
  403. package/src/html-embed.ws.ts +27 -0
  404. package/src/image.stories.tsx +15 -0
  405. package/src/image.tsx +83 -0
  406. package/src/image.ws.tsx +54 -0
  407. package/src/input.stories.tsx +14 -0
  408. package/src/input.tsx +13 -0
  409. package/src/input.ws.tsx +40 -0
  410. package/src/italic.stories.tsx +16 -0
  411. package/src/italic.tsx +10 -0
  412. package/src/italic.ws.tsx +32 -0
  413. package/src/label.tsx +10 -0
  414. package/src/label.ws.tsx +48 -0
  415. package/src/link-block.stories.tsx +16 -0
  416. package/src/link-block.tsx +9 -0
  417. package/src/link-block.ws.tsx +38 -0
  418. package/src/link.stories.tsx +16 -0
  419. package/src/link.tsx +44 -0
  420. package/src/link.ws.tsx +64 -0
  421. package/src/list-item.stories.tsx +16 -0
  422. package/src/list-item.tsx +18 -0
  423. package/src/list-item.ws.tsx +36 -0
  424. package/src/list.stories.tsx +17 -0
  425. package/src/list.tsx +26 -0
  426. package/src/list.ws.tsx +58 -0
  427. package/src/metas.ts +33 -0
  428. package/src/paragraph.stories.tsx +16 -0
  429. package/src/paragraph.tsx +10 -0
  430. package/src/paragraph.ws.tsx +35 -0
  431. package/src/props.ts +33 -0
  432. package/src/radio-button-field.tsx +10 -0
  433. package/src/radio-button-field.ws.tsx +47 -0
  434. package/src/radio-button.tsx +13 -0
  435. package/src/radio-button.ws.tsx +43 -0
  436. package/src/rich-text-link.stories.tsx +16 -0
  437. package/src/rich-text-link.tsx +8 -0
  438. package/src/rich-text-link.ws.tsx +22 -0
  439. package/src/separator.stories.tsx +14 -0
  440. package/src/separator.tsx +18 -0
  441. package/src/separator.ws.tsx +56 -0
  442. package/src/slot.stories.tsx +16 -0
  443. package/src/slot.tsx +17 -0
  444. package/src/slot.ws.ts +18 -0
  445. package/src/span.stories.tsx +16 -0
  446. package/src/span.tsx +10 -0
  447. package/src/span.ws.tsx +26 -0
  448. package/src/subscript.stories.tsx +16 -0
  449. package/src/subscript.tsx +10 -0
  450. package/src/subscript.ws.tsx +26 -0
  451. package/src/success-message.tsx +10 -0
  452. package/src/success-message.ws.tsx +24 -0
  453. package/src/superscript.stories.tsx +16 -0
  454. package/src/superscript.tsx +10 -0
  455. package/src/superscript.ws.tsx +26 -0
  456. package/src/text-block.stories.tsx +16 -0
  457. package/src/text-block.tsx +21 -0
  458. package/src/text-block.ws.tsx +42 -0
  459. package/src/textarea.tsx +13 -0
  460. package/src/textarea.ws.tsx +44 -0
@@ -0,0 +1,26 @@
1
+ import { BoldIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { b } from "@webstudio-is/react-sdk/css-normalize";
9
+ import { props } from "./__generated__/bold.props";
10
+ import type { defaultTag } from "./bold";
11
+
12
+ const presetStyle = {
13
+ b,
14
+ } satisfies PresetStyle<typeof defaultTag>;
15
+
16
+ export const meta: WsComponentMeta = {
17
+ type: "rich-text-child",
18
+ label: "Bold Text",
19
+ icon: BoldIcon,
20
+ states: defaultStates,
21
+ presetStyle,
22
+ };
23
+
24
+ export const propsMeta: WsComponentPropsMeta = {
25
+ props,
26
+ };
@@ -0,0 +1,17 @@
1
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { Box as BoxPrimitive } from "./box";
3
+
4
+ export default {
5
+ title: "Components/Box",
6
+ component: BoxPrimitive,
7
+ } as ComponentMeta<typeof BoxPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof BoxPrimitive> = (args) => (
10
+ <BoxPrimitive
11
+ {...args}
12
+ style={{ minHeight: 20, outline: "1px solid black" }}
13
+ />
14
+ );
15
+
16
+ export const Box = Template.bind({});
17
+ Box.args = {};
package/src/box.tsx ADDED
@@ -0,0 +1,31 @@
1
+ import {
2
+ createElement,
3
+ forwardRef,
4
+ type ElementRef,
5
+ type ComponentProps,
6
+ } from "react";
7
+
8
+ const defaultTag = "div";
9
+
10
+ // We don't want to enable all tags because Box is usually a container and we have specific components for many tags.
11
+ type Props = ComponentProps<typeof defaultTag> & {
12
+ tag?:
13
+ | "div"
14
+ | "header"
15
+ | "footer"
16
+ | "nav"
17
+ | "main"
18
+ | "section"
19
+ | "article"
20
+ | "aside"
21
+ | "address"
22
+ | "figure";
23
+ };
24
+
25
+ export const Box = forwardRef<ElementRef<typeof defaultTag>, Props>(
26
+ ({ tag = defaultTag, ...props }, ref) => {
27
+ return createElement(tag, { ...props, ref });
28
+ }
29
+ );
30
+
31
+ Box.displayName = "Box";
package/src/box.ws.ts ADDED
@@ -0,0 +1,52 @@
1
+ import type { ComponentProps } from "react";
2
+ import { BoxIcon } from "@webstudio-is/icons/svg";
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
8
+ } from "@webstudio-is/react-sdk";
9
+ import {
10
+ div,
11
+ address,
12
+ article,
13
+ aside,
14
+ figure,
15
+ footer,
16
+ header,
17
+ main,
18
+ nav,
19
+ section,
20
+ } from "@webstudio-is/react-sdk/css-normalize";
21
+ import { props } from "./__generated__/box.props";
22
+ import type { Box } from "./box";
23
+
24
+ type BoxTags = NonNullable<ComponentProps<typeof Box>["tag"]>;
25
+
26
+ const presetStyle = {
27
+ div,
28
+ address,
29
+ article,
30
+ aside,
31
+ figure,
32
+ footer,
33
+ header,
34
+ main,
35
+ nav,
36
+ section,
37
+ } satisfies PresetStyle<BoxTags>;
38
+
39
+ export const meta: WsComponentMeta = {
40
+ category: "general",
41
+ type: "container",
42
+ label: "Box",
43
+ icon: BoxIcon,
44
+ states: defaultStates,
45
+ presetStyle,
46
+ order: 0,
47
+ };
48
+
49
+ export const propsMeta: WsComponentPropsMeta = {
50
+ props,
51
+ initialProps: ["tag"],
52
+ };
@@ -0,0 +1,13 @@
1
+ import type { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import { Button as ButtonPrimitive } from "./button";
3
+
4
+ export default {
5
+ title: "Components/Button",
6
+ component: ButtonPrimitive,
7
+ } as ComponentMeta<typeof ButtonPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof ButtonPrimitive> = (args) => (
10
+ <ButtonPrimitive {...args} />
11
+ );
12
+
13
+ export const Button = Template.bind({});
package/src/button.tsx ADDED
@@ -0,0 +1,23 @@
1
+ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
+
3
+ export const defaultTag = "button";
4
+
5
+ type ButtonProps = ComponentProps<typeof defaultTag> & { innerText?: string };
6
+
7
+ export const Button = forwardRef<ElementRef<typeof defaultTag>, ButtonProps>(
8
+ (
9
+ {
10
+ type = "submit",
11
+ innerText = "Edit Inner Text in Properties",
12
+ children,
13
+ ...props
14
+ },
15
+ ref
16
+ ) => (
17
+ <button type={type} {...props} ref={ref}>
18
+ {children ? children : innerText}
19
+ </button>
20
+ )
21
+ );
22
+
23
+ Button.displayName = "Button";
@@ -0,0 +1,34 @@
1
+ import { ButtonElementIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { button } from "@webstudio-is/react-sdk/css-normalize";
9
+ import { props } from "./__generated__/button.props";
10
+ import type { defaultTag } from "./button";
11
+
12
+ const presetStyle = {
13
+ button,
14
+ } satisfies PresetStyle<typeof defaultTag>;
15
+
16
+ export const meta: WsComponentMeta = {
17
+ category: "forms",
18
+ type: "container",
19
+ invalidAncestors: ["Button"],
20
+ label: "Button",
21
+ icon: ButtonElementIcon,
22
+ presetStyle,
23
+ states: [
24
+ ...defaultStates,
25
+ { selector: ":disabled", label: "Disabled" },
26
+ { selector: ":enabled", label: "Enabled" },
27
+ ],
28
+ order: 1,
29
+ };
30
+
31
+ export const propsMeta: WsComponentPropsMeta = {
32
+ props,
33
+ initialProps: ["type", "innerText", "aria-label"],
34
+ };
@@ -0,0 +1,10 @@
1
+ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
+
3
+ export const defaultTag = "label";
4
+
5
+ export const CheckboxField = forwardRef<
6
+ ElementRef<typeof defaultTag>,
7
+ Omit<ComponentProps<typeof defaultTag>, "htmlFor">
8
+ >((props, ref) => <label {...props} ref={ref} />);
9
+
10
+ CheckboxField.displayName = "CheckboxField";
@@ -0,0 +1,47 @@
1
+ import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { label } from "@webstudio-is/react-sdk/css-normalize";
9
+ import { props } from "./__generated__/checkbox-field.props";
10
+ import type { defaultTag } from "./checkbox-field";
11
+
12
+ const presetStyle = {
13
+ label: [
14
+ ...label,
15
+ { property: "display", value: { type: "keyword", value: "flex" } },
16
+ ],
17
+ } satisfies PresetStyle<typeof defaultTag>;
18
+
19
+ export const meta: WsComponentMeta = {
20
+ category: "forms",
21
+ type: "container",
22
+ label: "Checkbox",
23
+ icon: CheckboxCheckedIcon,
24
+ states: defaultStates,
25
+ presetStyle,
26
+ template: [
27
+ {
28
+ type: "instance",
29
+ component: "CheckboxField",
30
+ children: [
31
+ { type: "instance", component: "Checkbox", children: [] },
32
+ {
33
+ type: "instance",
34
+ component: "TextBlock",
35
+ label: "Checkbox Label",
36
+ props: [],
37
+ children: [{ type: "text", value: "Checkbox" }],
38
+ },
39
+ ],
40
+ },
41
+ ],
42
+ };
43
+
44
+ export const propsMeta: WsComponentPropsMeta = {
45
+ props,
46
+ initialProps: [],
47
+ };
@@ -0,0 +1,13 @@
1
+ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
+
3
+ export const defaultTag = "input";
4
+
5
+ export const Checkbox = forwardRef<
6
+ ElementRef<typeof defaultTag>,
7
+ Omit<ComponentProps<typeof defaultTag>, "type">
8
+ // Make sure children are not passed down to an input, because this will result in error.
9
+ >(({ children: _children, ...props }, ref) => (
10
+ <input {...props} type="checkbox" ref={ref} />
11
+ ));
12
+
13
+ Checkbox.displayName = "Checkbox";
@@ -0,0 +1,43 @@
1
+ import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { input } from "@webstudio-is/react-sdk/css-normalize";
9
+ import type { defaultTag } from "./checkbox";
10
+ import { props } from "./__generated__/checkbox.props";
11
+
12
+ const presetStyle = {
13
+ input: [
14
+ ...input,
15
+ {
16
+ property: "marginRight",
17
+ value: { type: "unit", unit: "em", value: 0.5 },
18
+ },
19
+ ],
20
+ } satisfies PresetStyle<typeof defaultTag>;
21
+
22
+ export const meta: WsComponentMeta = {
23
+ type: "control",
24
+ label: "Checkbox Input",
25
+ icon: CheckboxCheckedIcon,
26
+ presetStyle,
27
+ order: 6,
28
+ states: [
29
+ ...defaultStates,
30
+ { selector: ":checked", label: "Checked" },
31
+ { selector: ":required", label: "Required" },
32
+ { selector: ":optional", label: "Optional" },
33
+ { selector: ":disabled", label: "Disabled" },
34
+ { selector: ":enabled", label: "Enabled" },
35
+ { selector: ":read-only", label: "Read Only" },
36
+ { selector: ":read-write", label: "Read Write" },
37
+ ],
38
+ };
39
+
40
+ export const propsMeta: WsComponentPropsMeta = {
41
+ props,
42
+ initialProps: ["name"],
43
+ };
@@ -0,0 +1,16 @@
1
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { CodeText as CodeTextPrimitive } from "./code-text";
3
+
4
+ export default {
5
+ title: "Components/CodeText",
6
+ component: CodeTextPrimitive,
7
+ } as ComponentMeta<typeof CodeTextPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof CodeTextPrimitive> = (args) => (
10
+ <CodeTextPrimitive {...args} />
11
+ );
12
+
13
+ export const CodeText = Template.bind({});
14
+ CodeText.args = {
15
+ children: "alert('Hello World!')",
16
+ };
@@ -0,0 +1,31 @@
1
+ import {
2
+ forwardRef,
3
+ createElement,
4
+ type ElementRef,
5
+ type ComponentProps,
6
+ } from "react";
7
+ import { cssVars } from "@webstudio-is/css-vars";
8
+
9
+ export const defaultTag = "code";
10
+
11
+ export const displayVarNamespace = cssVars.unique("code-display");
12
+
13
+ const blockStyle = {
14
+ [cssVars.define(displayVarNamespace, true)]: "block",
15
+ };
16
+
17
+ type Props = Omit<ComponentProps<typeof defaultTag>, "inline"> & {
18
+ inline?: boolean;
19
+ meta?: string;
20
+ };
21
+
22
+ export const CodeText = forwardRef<ElementRef<typeof defaultTag>, Props>(
23
+ ({ inline = false, ...props }, ref) => {
24
+ // @todo in the future we should expose the inline prop a an attribute
25
+ // and define the display style in `presetStyle` in meta.
26
+ const style = inline ? undefined : blockStyle;
27
+ return createElement(defaultTag, { ...props, style, ref });
28
+ }
29
+ );
30
+
31
+ CodeText.displayName = "CodeText";
@@ -0,0 +1,58 @@
1
+ import { CodeTextIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { code } from "@webstudio-is/react-sdk/css-normalize";
9
+ import { type defaultTag, displayVarNamespace } from "./code-text";
10
+ import { props } from "./__generated__/code-text.props";
11
+
12
+ const presetStyle = {
13
+ code: [
14
+ ...code,
15
+ {
16
+ property: "display",
17
+ value: {
18
+ type: "var",
19
+ value: displayVarNamespace,
20
+ fallbacks: [{ type: "keyword", value: "inline-block" }],
21
+ },
22
+ },
23
+ {
24
+ property: "paddingLeft",
25
+ value: { type: "unit", value: 0.2, unit: "em" },
26
+ },
27
+ {
28
+ property: "paddingRight",
29
+ value: { type: "unit", value: 0.2, unit: "em" },
30
+ },
31
+ {
32
+ property: "backgroundColor",
33
+ value: { type: "rgb", r: 238, g: 238, b: 238, alpha: 1 },
34
+ },
35
+ ],
36
+ } satisfies PresetStyle<typeof defaultTag>;
37
+
38
+ export const meta: WsComponentMeta = {
39
+ category: "general",
40
+ type: "rich-text",
41
+ label: "Code Text",
42
+ icon: CodeTextIcon,
43
+ states: defaultStates,
44
+ presetStyle,
45
+ template: [
46
+ {
47
+ type: "instance",
48
+ component: "CodeText",
49
+ children: [{ type: "text", value: "Code you can edit" }],
50
+ },
51
+ ],
52
+ order: 8,
53
+ };
54
+
55
+ export const propsMeta: WsComponentPropsMeta = {
56
+ props,
57
+ initialProps: ["inline", "lang", "meta"],
58
+ };
@@ -0,0 +1,33 @@
1
+ export { Slot } from "./slot";
2
+ export { Fragment } from "./fragment";
3
+ export { HtmlEmbed } from "./html-embed";
4
+ export { Body } from "./body";
5
+ export { Box } from "./box";
6
+ export { TextBlock } from "./text-block";
7
+ export { Heading } from "./heading";
8
+ export { Paragraph } from "./paragraph";
9
+ export { Link } from "./link";
10
+ export { LinkBlock } from "./link-block";
11
+ export { RichTextLink } from "./rich-text-link";
12
+ export { Span } from "./span";
13
+ export { Bold } from "./bold";
14
+ export { Italic } from "./italic";
15
+ export { Superscript } from "./superscript";
16
+ export { Subscript } from "./subscript";
17
+ export { Button } from "./button";
18
+ export { Input } from "./input";
19
+ export { Form } from "./form";
20
+ export { Image } from "./image";
21
+ export { Blockquote } from "./blockquote";
22
+ export { List } from "./list";
23
+ export { ListItem } from "./list-item";
24
+ export { Separator } from "./separator";
25
+ export { CodeText } from "./code-text";
26
+ export { Label } from "./label";
27
+ export { SuccessMessage } from "./success-message";
28
+ export { ErrorMessage } from "./error-message";
29
+ export { Textarea } from "./textarea";
30
+ export { RadioButtonField } from "./radio-button-field";
31
+ export { RadioButton } from "./radio-button";
32
+ export { CheckboxField } from "./checkbox-field";
33
+ export { Checkbox } from "./checkbox";
@@ -0,0 +1,10 @@
1
+ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
+
3
+ export const defaultTag = "div";
4
+
5
+ export const ErrorMessage = forwardRef<
6
+ ElementRef<typeof defaultTag>,
7
+ ComponentProps<typeof defaultTag>
8
+ >((props, ref) => <div {...props} ref={ref} />);
9
+
10
+ ErrorMessage.displayName = "ErrorMessage";
@@ -0,0 +1,24 @@
1
+ import { BoxIcon } from "@webstudio-is/icons/svg";
2
+ import type {
3
+ WsComponentMeta,
4
+ WsComponentPropsMeta,
5
+ PresetStyle,
6
+ } from "@webstudio-is/react-sdk";
7
+ import { div } from "@webstudio-is/react-sdk/css-normalize";
8
+ import { props } from "./__generated__/error-message.props";
9
+
10
+ const presetStyle = {
11
+ div,
12
+ } satisfies PresetStyle<"div">;
13
+
14
+ export const meta: WsComponentMeta = {
15
+ type: "container",
16
+ label: "Error Message",
17
+ icon: BoxIcon,
18
+ presetStyle,
19
+ };
20
+
21
+ export const propsMeta: WsComponentPropsMeta = {
22
+ props,
23
+ initialProps: [],
24
+ };
@@ -0,0 +1,14 @@
1
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { Form as FormPrimitive } from "./form";
3
+
4
+ export default {
5
+ title: "Components/Form",
6
+ component: FormPrimitive,
7
+ } as ComponentMeta<typeof FormPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof FormPrimitive> = (args) => (
10
+ <FormPrimitive {...args} />
11
+ );
12
+
13
+ export const Form = Template.bind({});
14
+ Form.args = {};
package/src/form.tsx ADDED
@@ -0,0 +1,14 @@
1
+ import { forwardRef, type ElementRef, type ComponentProps } from "react";
2
+
3
+ export const defaultTag = "form";
4
+
5
+ export const Form = forwardRef<
6
+ ElementRef<typeof defaultTag>,
7
+ ComponentProps<typeof defaultTag>
8
+ >(({ children, ...props }, ref) => (
9
+ <form {...props} ref={ref}>
10
+ {children}
11
+ </form>
12
+ ));
13
+
14
+ Form.displayName = "Form";
@@ -0,0 +1,67 @@
1
+ import { FormIcon } from "@webstudio-is/icons/svg";
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
7
+ } from "@webstudio-is/react-sdk";
8
+ import { form } from "@webstudio-is/react-sdk/css-normalize";
9
+ import type { defaultTag } from "./form";
10
+ import { props } from "./__generated__/form.props";
11
+
12
+ const presetStyle = {
13
+ form: [
14
+ ...form,
15
+ { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } },
16
+ ],
17
+ } satisfies PresetStyle<typeof defaultTag>;
18
+
19
+ export const meta: WsComponentMeta = {
20
+ category: "forms",
21
+ type: "container",
22
+ label: "Form",
23
+ icon: FormIcon,
24
+ states: defaultStates,
25
+ presetStyle,
26
+ order: 0,
27
+ template: [
28
+ {
29
+ type: "instance",
30
+ component: "Form",
31
+ children: [
32
+ {
33
+ type: "instance",
34
+ component: "Label",
35
+ children: [{ type: "text", value: "Name" }],
36
+ },
37
+ {
38
+ type: "instance",
39
+ component: "Input",
40
+ props: [{ type: "string", name: "name", value: "name" }],
41
+ children: [],
42
+ },
43
+ {
44
+ type: "instance",
45
+ component: "Label",
46
+ children: [{ type: "text", value: "Email" }],
47
+ },
48
+ {
49
+ type: "instance",
50
+ component: "Input",
51
+ props: [{ type: "string", name: "name", value: "email" }],
52
+ children: [],
53
+ },
54
+ {
55
+ type: "instance",
56
+ component: "Button",
57
+ children: [{ type: "text", value: "Submit" }],
58
+ },
59
+ ],
60
+ },
61
+ ],
62
+ };
63
+
64
+ export const propsMeta: WsComponentPropsMeta = {
65
+ props,
66
+ initialProps: [],
67
+ };
@@ -0,0 +1,11 @@
1
+ import { forwardRef, type ElementRef, type ReactNode } from "react";
2
+
3
+ type Props = {
4
+ children?: ReactNode;
5
+ };
6
+
7
+ export const Fragment = forwardRef<ElementRef<"div">, Props>((props, ref) => {
8
+ return <div {...props} ref={ref} style={{ display: "contents" }} />;
9
+ });
10
+
11
+ Fragment.displayName = "Fragment";
@@ -0,0 +1,15 @@
1
+ import type {
2
+ WsComponentMeta,
3
+ WsComponentPropsMeta,
4
+ } from "@webstudio-is/react-sdk";
5
+
6
+ export const meta: WsComponentMeta = {
7
+ type: "container",
8
+ label: "Fragment",
9
+ icon: "",
10
+ stylable: false,
11
+ };
12
+
13
+ export const propsMeta: WsComponentPropsMeta = {
14
+ props: {},
15
+ };
@@ -0,0 +1,16 @@
1
+ import type { ComponentStory, ComponentMeta } from "@storybook/react";
2
+ import { Heading as HeadingPrimitive } from "./heading";
3
+
4
+ export default {
5
+ title: "Components/Heading",
6
+ component: HeadingPrimitive,
7
+ } as ComponentMeta<typeof HeadingPrimitive>;
8
+
9
+ const Template: ComponentStory<typeof HeadingPrimitive> = (args) => (
10
+ <HeadingPrimitive {...args} />
11
+ );
12
+
13
+ export const Heading = Template.bind({});
14
+ Heading.args = {
15
+ children: "Heading",
16
+ };
@@ -0,0 +1,20 @@
1
+ import {
2
+ forwardRef,
3
+ createElement,
4
+ type ElementRef,
5
+ type ComponentProps,
6
+ } from "react";
7
+
8
+ const defaultTag = "h1";
9
+
10
+ type Props = ComponentProps<typeof defaultTag> & {
11
+ tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
12
+ };
13
+
14
+ export const Heading = forwardRef<ElementRef<typeof defaultTag>, Props>(
15
+ ({ tag = defaultTag, ...props }, ref) => {
16
+ return createElement(tag, { ...props, ref });
17
+ }
18
+ );
19
+
20
+ Heading.displayName = "Heading";