Design system.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

618 líneas
18 KiB

  1. import { NextPage } from 'next';
  2. import * as Freeform from '@tesseract-design/web-freeform-react';
  3. import { DefaultLayout } from '@/components/DefaultLayout';
  4. import { Section, Subsection } from '@/components/Section';
  5. const FreeformPage: NextPage = () => {
  6. return (
  7. <DefaultLayout title="Freeform">
  8. <Section title="TextInput">
  9. <Subsection title="Default">
  10. <div className="grid md:grid-cols-2 gap-4 my-4">
  11. <div>
  12. <Freeform.TextInput
  13. size="small"
  14. label="TextInput ffgg"
  15. hint="Type anything here&hellip; ffgg"
  16. indicator="A"
  17. block
  18. />
  19. </div>
  20. <div>
  21. <Freeform.TextInput
  22. border
  23. size="small"
  24. label="TextInput ffgg"
  25. hint="Type anything here&hellip; ffgg"
  26. indicator="A"
  27. block
  28. />
  29. </div>
  30. <div>
  31. <Freeform.TextInput
  32. label="TextInput ffgg"
  33. hint="Type anything here&hellip; ffgg"
  34. indicator="A"
  35. block
  36. />
  37. </div>
  38. <div>
  39. <Freeform.TextInput
  40. border
  41. label="TextInput ffgg"
  42. hint="Type anything here&hellip; ffgg"
  43. indicator="A"
  44. block
  45. />
  46. </div>
  47. <div>
  48. <Freeform.TextInput
  49. size="large"
  50. label="TextInput"
  51. hint="Type anything here&hellip;"
  52. indicator="A"
  53. block
  54. />
  55. </div>
  56. <div>
  57. <Freeform.TextInput
  58. border
  59. size="large"
  60. label="TextInput"
  61. hint="Type anything here&hellip;"
  62. indicator="A"
  63. block
  64. />
  65. </div>
  66. <div>
  67. <Freeform.TextInput
  68. label="TextInput"
  69. hint="Type anything here&hellip;"
  70. indicator="A"
  71. block
  72. disabled
  73. />
  74. </div>
  75. <div>
  76. <Freeform.TextInput
  77. border
  78. label="TextInput"
  79. hint="Type anything here&hellip;"
  80. indicator="A"
  81. block
  82. disabled
  83. />
  84. </div>
  85. </div>
  86. <form>
  87. <fieldset className="contents">
  88. <legend className="sr-only">Fieldset Test</legend>
  89. <div className="grid grid-cols-6 gap-4 my-4">
  90. <div className="col-span-2">
  91. <Freeform.TextInput
  92. label="First Name"
  93. block
  94. border
  95. />
  96. </div>
  97. <div className="col-span-2">
  98. <Freeform.TextInput
  99. label="Middle Name"
  100. block
  101. border
  102. />
  103. </div>
  104. <div className="col-span-2">
  105. <Freeform.TextInput
  106. label="Last Name"
  107. block
  108. border
  109. />
  110. </div>
  111. <div className="col-span-3">
  112. <Freeform.TextInput
  113. label="Username"
  114. block
  115. border
  116. />
  117. </div>
  118. <div className="col-span-3">
  119. <Freeform.TextInput
  120. label="Title"
  121. block
  122. border
  123. disabled
  124. />
  125. </div>
  126. </div>
  127. </fieldset>
  128. </form>
  129. <form>
  130. <fieldset
  131. disabled
  132. className="contents"
  133. >
  134. <legend className="sr-only">Disabled Test</legend>
  135. <div className="grid grid-cols-6 gap-4 my-4">
  136. <div className="col-span-2">
  137. <Freeform.TextInput
  138. label="First Name"
  139. block
  140. border
  141. />
  142. </div>
  143. <div className="col-span-2">
  144. <Freeform.TextInput
  145. label="Middle Name"
  146. block
  147. border
  148. />
  149. </div>
  150. <div className="col-span-2">
  151. <Freeform.TextInput
  152. label="Last Name"
  153. block
  154. border
  155. />
  156. </div>
  157. <div className="col-span-3">
  158. <Freeform.TextInput
  159. label="Username"
  160. block
  161. border
  162. />
  163. </div>
  164. <div className="col-span-3">
  165. <Freeform.TextInput
  166. label="Title"
  167. block
  168. border
  169. />
  170. </div>
  171. </div>
  172. </fieldset>
  173. </form>
  174. <form>
  175. <div>
  176. Hi, my name is
  177. {' '}
  178. <Freeform.TextInput
  179. border
  180. label="Name"
  181. size="small"
  182. />
  183. {' '}
  184. but you can call me
  185. {' '}
  186. <Freeform.TextInput
  187. border
  188. label="Nickname"
  189. size="small"
  190. />
  191. .
  192. </div>
  193. </form>
  194. </Subsection>
  195. <Subsection title="Alternate">
  196. <div className="grid md:grid-cols-2 gap-4">
  197. <div>
  198. <Freeform.TextInput
  199. variant="alternate"
  200. size="small"
  201. label="TextInput ffgg"
  202. hint="Type anything here&hellip; ffgg"
  203. indicator="A"
  204. block
  205. />
  206. </div>
  207. <div>
  208. <Freeform.TextInput
  209. border
  210. variant="alternate"
  211. size="small"
  212. label="TextInput ffgg"
  213. hint="Type anything here&hellip; ffgg"
  214. indicator="A"
  215. block
  216. />
  217. </div>
  218. <div>
  219. <Freeform.TextInput
  220. variant="alternate"
  221. label="TextInput ffgg"
  222. hint="Type anything here&hellip; ffgg"
  223. block
  224. />
  225. </div>
  226. <div>
  227. <Freeform.TextInput
  228. border
  229. variant="alternate"
  230. label="TextInput ffgg"
  231. hint="Type anything here&hellip; ffgg"
  232. block
  233. />
  234. </div>
  235. <div>
  236. <Freeform.TextInput
  237. variant="alternate"
  238. size="large"
  239. label="TextInput ffgg"
  240. hint="Type anything here&hellip; ffgg"
  241. indicator="A"
  242. block
  243. />
  244. </div>
  245. <div>
  246. <Freeform.TextInput
  247. border
  248. block
  249. variant="alternate"
  250. size="large"
  251. label="TextInput"
  252. hint="Type anything here&hellip;"
  253. indicator="A"
  254. />
  255. </div>
  256. <div>
  257. <Freeform.TextInput
  258. variant="alternate"
  259. label="TextInput"
  260. hint="Type anything here&hellip;"
  261. indicator="A"
  262. block
  263. disabled
  264. />
  265. </div>
  266. <div>
  267. <Freeform.TextInput
  268. variant="alternate"
  269. border
  270. label="TextInput"
  271. hint="Type anything here&hellip;"
  272. indicator="A"
  273. block
  274. disabled
  275. />
  276. </div>
  277. </div>
  278. </Subsection>
  279. </Section>
  280. <Section title="MaskedTextInput">
  281. <Subsection title="Default">
  282. <div className="grid md:grid-cols-2 gap-4">
  283. <div>
  284. <Freeform.MaskedTextInput
  285. size="small"
  286. label="MaskedTextInput"
  287. hint="Type anything here&hellip;"
  288. indicator="A"
  289. block
  290. />
  291. </div>
  292. <div>
  293. <Freeform.MaskedTextInput
  294. border
  295. size="small"
  296. label="MaskedTextInput"
  297. hint="Type anything here&hellip;"
  298. indicator="A"
  299. block
  300. />
  301. </div>
  302. <div>
  303. <Freeform.MaskedTextInput
  304. label="MaskedTextInput"
  305. hint="Type anything here&hellip;"
  306. indicator="A"
  307. block
  308. />
  309. </div>
  310. <div>
  311. <Freeform.MaskedTextInput
  312. border
  313. label="MaskedTextInput"
  314. hint="Type anything here&hellip;"
  315. indicator="A"
  316. block
  317. />
  318. </div>
  319. <div>
  320. <Freeform.MaskedTextInput
  321. size="large"
  322. label="MaskedTextInput"
  323. hint="Type anything here&hellip;"
  324. indicator="A"
  325. block
  326. />
  327. </div>
  328. <div>
  329. <Freeform.MaskedTextInput
  330. border
  331. size="large"
  332. label="MaskedTextInput"
  333. hint="Type anything here&hellip;"
  334. indicator="A"
  335. block
  336. />
  337. </div>
  338. <div>
  339. <Freeform.MaskedTextInput
  340. label="MaskedTextInput"
  341. hint="Type anything here&hellip;"
  342. indicator="A"
  343. block
  344. disabled
  345. />
  346. </div>
  347. <div>
  348. <Freeform.MaskedTextInput
  349. border
  350. label="MaskedTextInput"
  351. hint="Type anything here&hellip;"
  352. indicator="A"
  353. block
  354. disabled
  355. />
  356. </div>
  357. </div>
  358. </Subsection>
  359. <Subsection title="Alternate">
  360. <div className="grid md:grid-cols-2 gap-4">
  361. <div>
  362. <Freeform.MaskedTextInput
  363. variant="alternate"
  364. size="small"
  365. label="MaskedTextInput"
  366. hint="Type anything here&hellip;"
  367. indicator="A"
  368. block
  369. />
  370. </div>
  371. <div>
  372. <Freeform.MaskedTextInput
  373. border
  374. variant="alternate"
  375. size="small"
  376. label="MaskedTextInput"
  377. hint="Type anything here&hellip;"
  378. indicator="A"
  379. block
  380. />
  381. </div>
  382. <div>
  383. <Freeform.MaskedTextInput
  384. variant="alternate"
  385. label="MaskedTextInput"
  386. hint="Type anything here&hellip;"
  387. indicator="A"
  388. block
  389. />
  390. </div>
  391. <div>
  392. <Freeform.MaskedTextInput
  393. border
  394. variant="alternate"
  395. label="MaskedTextInput"
  396. hint="Type anything here&hellip;"
  397. indicator="A"
  398. block
  399. />
  400. </div>
  401. <div>
  402. <Freeform.MaskedTextInput
  403. variant="alternate"
  404. size="large"
  405. label="MaskedTextInput"
  406. hint="Type anything here&hellip;"
  407. indicator="A"
  408. block
  409. />
  410. </div>
  411. <div>
  412. <Freeform.MaskedTextInput
  413. border
  414. block
  415. variant="alternate"
  416. size="large"
  417. label="MaskedTextInput"
  418. hint="Type anything here&hellip;"
  419. indicator="A"
  420. />
  421. </div>
  422. <div>
  423. <Freeform.MaskedTextInput
  424. variant="alternate"
  425. label="MaskedTextInput"
  426. hint="Type anything here&hellip;"
  427. indicator="A"
  428. block
  429. disabled
  430. />
  431. </div>
  432. <div>
  433. <Freeform.MaskedTextInput
  434. variant="alternate"
  435. border
  436. label="MaskedTextInput"
  437. hint="Type anything here&hellip;"
  438. indicator="A"
  439. block
  440. disabled
  441. />
  442. </div>
  443. </div>
  444. </Subsection>
  445. </Section>
  446. <Section title="MultilineTextInput">
  447. <Subsection title="Default">
  448. <div className="grid md:grid-cols-2 gap-4">
  449. <div>
  450. <Freeform.MultilineTextInput
  451. size="small"
  452. label="MultilineTextInput"
  453. hint="Type anything here&hellip;"
  454. indicator="A"
  455. block
  456. />
  457. </div>
  458. <div>
  459. <Freeform.MultilineTextInput
  460. border
  461. size="small"
  462. label="MultilineTextInput"
  463. hint="Type anything here&hellip;"
  464. indicator="A"
  465. block
  466. />
  467. </div>
  468. <div>
  469. <Freeform.MultilineTextInput
  470. label="MultilineTextInput"
  471. hint="Type anything here&hellip;"
  472. indicator="A"
  473. block
  474. />
  475. </div>
  476. <div>
  477. <Freeform.MultilineTextInput
  478. border
  479. label="MultilineTextInput"
  480. hint="Type anything here&hellip;"
  481. indicator="A"
  482. block
  483. />
  484. </div>
  485. <div>
  486. <Freeform.MultilineTextInput
  487. size="large"
  488. label="MultilineTextInput"
  489. hint="Type anything here&hellip;"
  490. indicator="A"
  491. block
  492. />
  493. </div>
  494. <div>
  495. <Freeform.MultilineTextInput
  496. border
  497. size="large"
  498. label="MultilineTextInput"
  499. hint="Type anything here&hellip;"
  500. indicator="A"
  501. block
  502. />
  503. </div>
  504. <div>
  505. <Freeform.MultilineTextInput
  506. label="MultilineTextInput"
  507. hint="Type anything here&hellip;"
  508. indicator="A"
  509. block
  510. disabled
  511. />
  512. </div>
  513. <div>
  514. <Freeform.MultilineTextInput
  515. border
  516. label="MultilineTextInput"
  517. hint="Type anything here&hellip;"
  518. indicator="A"
  519. block
  520. disabled
  521. />
  522. </div>
  523. </div>
  524. </Subsection>
  525. <Subsection title="Alternate">
  526. <div className="grid md:grid-cols-2 gap-4">
  527. <div>
  528. <Freeform.MultilineTextInput
  529. variant="alternate"
  530. size="small"
  531. label="MultilineTextInput"
  532. hint="Type anything here&hellip;"
  533. indicator="A"
  534. block
  535. />
  536. </div>
  537. <div>
  538. <Freeform.MultilineTextInput
  539. border
  540. variant="alternate"
  541. size="small"
  542. label="MultilineTextInput"
  543. hint="Type anything here&hellip;"
  544. indicator="A"
  545. block
  546. />
  547. </div>
  548. <div>
  549. <Freeform.MultilineTextInput
  550. variant="alternate"
  551. label="MultilineTextInput"
  552. hint="Type anything here&hellip;"
  553. indicator="A"
  554. block
  555. />
  556. </div>
  557. <div>
  558. <Freeform.MultilineTextInput
  559. border
  560. variant="alternate"
  561. label="MultilineTextInput"
  562. hint="Type anything here&hellip;"
  563. indicator="A"
  564. block
  565. />
  566. </div>
  567. <div>
  568. <Freeform.MultilineTextInput
  569. variant="alternate"
  570. size="large"
  571. label="MultilineTextInput"
  572. hint="Type anything here&hellip;"
  573. indicator="A"
  574. block
  575. />
  576. </div>
  577. <div>
  578. <Freeform.MultilineTextInput
  579. border
  580. block
  581. variant="alternate"
  582. size="large"
  583. label="MultilineTextInput"
  584. hint="Type anything here&hellip;"
  585. indicator="A"
  586. />
  587. </div>
  588. <div>
  589. <Freeform.MultilineTextInput
  590. variant="alternate"
  591. label="MultilineTextInput"
  592. hint="Type anything here&hellip;"
  593. indicator="A"
  594. block
  595. disabled
  596. />
  597. </div>
  598. <div>
  599. <Freeform.MultilineTextInput
  600. variant="alternate"
  601. border
  602. label="MultilineTextInput"
  603. hint="Type anything here&hellip;"
  604. indicator="A"
  605. block
  606. disabled
  607. />
  608. </div>
  609. </div>
  610. </Subsection>
  611. </Section>
  612. </DefaultLayout>
  613. );
  614. };
  615. export default FreeformPage;