Design system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

602 lines
17 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. block
  289. />
  290. </div>
  291. <div>
  292. <Freeform.MaskedTextInput
  293. border
  294. size="small"
  295. label="MaskedTextInput"
  296. hint="Type anything here&hellip;"
  297. block
  298. />
  299. </div>
  300. <div>
  301. <Freeform.MaskedTextInput
  302. label="MaskedTextInput"
  303. hint="Type anything here&hellip;"
  304. block
  305. />
  306. </div>
  307. <div>
  308. <Freeform.MaskedTextInput
  309. border
  310. label="MaskedTextInput"
  311. hint="Type anything here&hellip;"
  312. block
  313. />
  314. </div>
  315. <div>
  316. <Freeform.MaskedTextInput
  317. size="large"
  318. label="MaskedTextInput"
  319. hint="Type anything here&hellip;"
  320. block
  321. />
  322. </div>
  323. <div>
  324. <Freeform.MaskedTextInput
  325. border
  326. size="large"
  327. label="MaskedTextInput"
  328. hint="Type anything here&hellip;"
  329. block
  330. />
  331. </div>
  332. <div>
  333. <Freeform.MaskedTextInput
  334. label="MaskedTextInput"
  335. hint="Type anything here&hellip;"
  336. block
  337. disabled
  338. />
  339. </div>
  340. <div>
  341. <Freeform.MaskedTextInput
  342. border
  343. label="MaskedTextInput"
  344. hint="Type anything here&hellip;"
  345. block
  346. disabled
  347. />
  348. </div>
  349. </div>
  350. </Subsection>
  351. <Subsection title="Alternate">
  352. <div className="grid md:grid-cols-2 gap-4">
  353. <div>
  354. <Freeform.MaskedTextInput
  355. variant="alternate"
  356. size="small"
  357. label="MaskedTextInput"
  358. hint="Type anything here&hellip;"
  359. block
  360. />
  361. </div>
  362. <div>
  363. <Freeform.MaskedTextInput
  364. border
  365. variant="alternate"
  366. size="small"
  367. label="MaskedTextInput"
  368. hint="Type anything here&hellip;"
  369. block
  370. />
  371. </div>
  372. <div>
  373. <Freeform.MaskedTextInput
  374. variant="alternate"
  375. label="MaskedTextInput"
  376. hint="Type anything here&hellip;"
  377. block
  378. />
  379. </div>
  380. <div>
  381. <Freeform.MaskedTextInput
  382. border
  383. variant="alternate"
  384. label="MaskedTextInput"
  385. hint="Type anything here&hellip;"
  386. block
  387. />
  388. </div>
  389. <div>
  390. <Freeform.MaskedTextInput
  391. variant="alternate"
  392. size="large"
  393. label="MaskedTextInput"
  394. hint="Type anything here&hellip;"
  395. block
  396. />
  397. </div>
  398. <div>
  399. <Freeform.MaskedTextInput
  400. border
  401. block
  402. variant="alternate"
  403. size="large"
  404. label="MaskedTextInput"
  405. hint="Type anything here&hellip;"
  406. />
  407. </div>
  408. <div>
  409. <Freeform.MaskedTextInput
  410. variant="alternate"
  411. label="MaskedTextInput"
  412. hint="Type anything here&hellip;"
  413. block
  414. disabled
  415. />
  416. </div>
  417. <div>
  418. <Freeform.MaskedTextInput
  419. variant="alternate"
  420. border
  421. label="MaskedTextInput"
  422. hint="Type anything here&hellip;"
  423. block
  424. disabled
  425. />
  426. </div>
  427. </div>
  428. </Subsection>
  429. </Section>
  430. <Section title="MultilineTextInput">
  431. <Subsection title="Default">
  432. <div className="grid md:grid-cols-2 gap-4">
  433. <div>
  434. <Freeform.MultilineTextInput
  435. size="small"
  436. label="MultilineTextInput"
  437. hint="Type anything here&hellip;"
  438. indicator="A"
  439. block
  440. />
  441. </div>
  442. <div>
  443. <Freeform.MultilineTextInput
  444. border
  445. size="small"
  446. label="MultilineTextInput"
  447. hint="Type anything here&hellip;"
  448. indicator="A"
  449. block
  450. />
  451. </div>
  452. <div>
  453. <Freeform.MultilineTextInput
  454. label="MultilineTextInput"
  455. hint="Type anything here&hellip;"
  456. indicator="A"
  457. block
  458. />
  459. </div>
  460. <div>
  461. <Freeform.MultilineTextInput
  462. border
  463. label="MultilineTextInput"
  464. hint="Type anything here&hellip;"
  465. indicator="A"
  466. block
  467. />
  468. </div>
  469. <div>
  470. <Freeform.MultilineTextInput
  471. size="large"
  472. label="MultilineTextInput"
  473. hint="Type anything here&hellip;"
  474. indicator="A"
  475. block
  476. />
  477. </div>
  478. <div>
  479. <Freeform.MultilineTextInput
  480. border
  481. size="large"
  482. label="MultilineTextInput"
  483. hint="Type anything here&hellip;"
  484. indicator="A"
  485. block
  486. />
  487. </div>
  488. <div>
  489. <Freeform.MultilineTextInput
  490. label="MultilineTextInput"
  491. hint="Type anything here&hellip;"
  492. indicator="A"
  493. block
  494. disabled
  495. />
  496. </div>
  497. <div>
  498. <Freeform.MultilineTextInput
  499. border
  500. label="MultilineTextInput"
  501. hint="Type anything here&hellip;"
  502. indicator="A"
  503. block
  504. disabled
  505. />
  506. </div>
  507. </div>
  508. </Subsection>
  509. <Subsection title="Alternate">
  510. <div className="grid md:grid-cols-2 gap-4">
  511. <div>
  512. <Freeform.MultilineTextInput
  513. variant="alternate"
  514. size="small"
  515. label="MultilineTextInput"
  516. hint="Type anything here&hellip;"
  517. indicator="A"
  518. block
  519. />
  520. </div>
  521. <div>
  522. <Freeform.MultilineTextInput
  523. border
  524. variant="alternate"
  525. size="small"
  526. label="MultilineTextInput"
  527. hint="Type anything here&hellip;"
  528. indicator="A"
  529. block
  530. />
  531. </div>
  532. <div>
  533. <Freeform.MultilineTextInput
  534. variant="alternate"
  535. label="MultilineTextInput"
  536. hint="Type anything here&hellip;"
  537. indicator="A"
  538. block
  539. />
  540. </div>
  541. <div>
  542. <Freeform.MultilineTextInput
  543. border
  544. variant="alternate"
  545. label="MultilineTextInput"
  546. hint="Type anything here&hellip;"
  547. indicator="A"
  548. block
  549. />
  550. </div>
  551. <div>
  552. <Freeform.MultilineTextInput
  553. variant="alternate"
  554. size="large"
  555. label="MultilineTextInput"
  556. hint="Type anything here&hellip;"
  557. indicator="A"
  558. block
  559. />
  560. </div>
  561. <div>
  562. <Freeform.MultilineTextInput
  563. border
  564. block
  565. variant="alternate"
  566. size="large"
  567. label="MultilineTextInput"
  568. hint="Type anything here&hellip;"
  569. indicator="A"
  570. />
  571. </div>
  572. <div>
  573. <Freeform.MultilineTextInput
  574. variant="alternate"
  575. label="MultilineTextInput"
  576. hint="Type anything here&hellip;"
  577. indicator="A"
  578. block
  579. disabled
  580. />
  581. </div>
  582. <div>
  583. <Freeform.MultilineTextInput
  584. variant="alternate"
  585. border
  586. label="MultilineTextInput"
  587. hint="Type anything here&hellip;"
  588. indicator="A"
  589. block
  590. disabled
  591. />
  592. </div>
  593. </div>
  594. </Subsection>
  595. </Section>
  596. </DefaultLayout>
  597. );
  598. };
  599. export default FreeformPage;