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.
 
 
 

1664 regels
56 KiB

  1. import { NextPage } from 'next';
  2. import * as Choice from '@tesseract-design/web-choice-react';
  3. import * as MultiChoice from '@tesseract-design/web-multichoice-react';
  4. import { DefaultLayout } from '@/components/DefaultLayout';
  5. import {ReactNode} from 'react';
  6. type Props = {
  7. options: ReactNode,
  8. }
  9. const OptionPage: NextPage<Props> = ({
  10. options = (
  11. <>
  12. <optgroup label="Fruits">
  13. <option value="mango">Mango</option>
  14. <option value="strawberry">Strawberry</option>
  15. <option value="avocado">Avocado</option>
  16. <option value="grapes">Grapes</option>
  17. </optgroup>
  18. <optgroup label="Non-fruits">
  19. <option value="chocolate">Chocolate</option>
  20. <option value="milk">Milk</option>
  21. <option value="coffee">Coffee</option>
  22. </optgroup>
  23. </>
  24. )
  25. }) => {
  26. return (
  27. <DefaultLayout
  28. title="Option"
  29. >
  30. <div className="mt-8 mb-16 md:mt-16 md:mb-32">
  31. <section>
  32. <div className="container mx-auto px-4">
  33. <h1>
  34. DropdownSelect
  35. </h1>
  36. <div>
  37. <section>
  38. <h2>
  39. Default
  40. </h2>
  41. <div>
  42. <div className="grid md:grid-cols-2 gap-4 my-4">
  43. <div>
  44. <Choice.DropdownSelect
  45. size="small"
  46. label="Select"
  47. hint="Type anything here&hellip;"
  48. block
  49. >
  50. {options}
  51. </Choice.DropdownSelect>
  52. </div>
  53. <div>
  54. <Choice.DropdownSelect
  55. border
  56. size="small"
  57. label="Select"
  58. hint="Type anything here&hellip;"
  59. block
  60. >
  61. {options}
  62. </Choice.DropdownSelect>
  63. </div>
  64. <div>
  65. <Choice.DropdownSelect
  66. label="Select"
  67. hint="Type anything here&hellip;"
  68. block
  69. >
  70. {options}
  71. </Choice.DropdownSelect>
  72. </div>
  73. <div>
  74. <Choice.DropdownSelect
  75. border
  76. label="Select"
  77. hint="Type anything here&hellip;"
  78. block
  79. >
  80. {options}
  81. </Choice.DropdownSelect>
  82. </div>
  83. <div>
  84. <Choice.DropdownSelect
  85. size="large"
  86. label="Select"
  87. hint="Type anything here&hellip;"
  88. block
  89. >
  90. {options}
  91. </Choice.DropdownSelect>
  92. </div>
  93. <div>
  94. <Choice.DropdownSelect
  95. border
  96. size="large"
  97. label="Select"
  98. hint="Type anything here&hellip;"
  99. block
  100. >
  101. {options}
  102. </Choice.DropdownSelect>
  103. </div>
  104. <div>
  105. <Choice.DropdownSelect
  106. label="Select"
  107. hint="Type anything here&hellip;"
  108. block
  109. disabled
  110. >
  111. {options}
  112. </Choice.DropdownSelect>
  113. </div>
  114. <div>
  115. <Choice.DropdownSelect
  116. border
  117. label="Select"
  118. hint="Type anything here&hellip;"
  119. block
  120. disabled
  121. >
  122. {options}
  123. </Choice.DropdownSelect>
  124. </div>
  125. </div>
  126. <form>
  127. <fieldset
  128. disabled
  129. className="contents"
  130. >
  131. <legend className="sr-only">Disabled Test</legend>
  132. <div className="grid grid-cols-6 gap-4 my-4">
  133. <div className="col-span-2">
  134. <Choice.DropdownSelect
  135. label="First Name"
  136. block
  137. border
  138. />
  139. </div>
  140. <div className="col-span-2">
  141. <Choice.DropdownSelect
  142. label="Middle Name"
  143. block
  144. border
  145. />
  146. </div>
  147. <div className="col-span-2">
  148. <Choice.DropdownSelect
  149. label="Last Name"
  150. block
  151. border
  152. />
  153. </div>
  154. <div className="col-span-3">
  155. <Choice.DropdownSelect
  156. label="Username"
  157. block
  158. border
  159. />
  160. </div>
  161. <div className="col-span-3">
  162. <Choice.DropdownSelect
  163. label="Title"
  164. block
  165. border
  166. />
  167. </div>
  168. </div>
  169. </fieldset>
  170. </form>
  171. <form>
  172. <div>
  173. Hi, my name is
  174. {' '}
  175. <Choice.DropdownSelect
  176. border
  177. label="Name"
  178. size="small"
  179. />
  180. {' '}
  181. but you can call me
  182. {' '}
  183. <Choice.DropdownSelect
  184. border
  185. label="Nickname"
  186. size="small"
  187. />
  188. .
  189. </div>
  190. </form>
  191. </div>
  192. </section>
  193. <section>
  194. <h2>Alternate</h2>
  195. <div>
  196. <div className="grid md:grid-cols-2 gap-4">
  197. <div>
  198. <Choice.DropdownSelect
  199. variant="alternate"
  200. size="small"
  201. label="Select"
  202. hint="Type anything here&hellip;"
  203. block
  204. >
  205. {options}
  206. </Choice.DropdownSelect>
  207. </div>
  208. <div>
  209. <Choice.DropdownSelect
  210. border
  211. variant="alternate"
  212. size="small"
  213. label="Select"
  214. hint="Type anything here&hellip;"
  215. block
  216. >
  217. {options}
  218. </Choice.DropdownSelect>
  219. </div>
  220. <div>
  221. <Choice.DropdownSelect
  222. variant="alternate"
  223. label="Select"
  224. hint="Type anything here&hellip;"
  225. block
  226. >
  227. {options}
  228. </Choice.DropdownSelect>
  229. </div>
  230. <div>
  231. <Choice.DropdownSelect
  232. border
  233. variant="alternate"
  234. label="Select"
  235. hint="Type anything here&hellip;"
  236. block
  237. >
  238. {options}
  239. </Choice.DropdownSelect>
  240. </div>
  241. <div>
  242. <Choice.DropdownSelect
  243. variant="alternate"
  244. size="large"
  245. label="Select"
  246. hint="Type anything here&hellip;"
  247. block
  248. >
  249. {options}
  250. </Choice.DropdownSelect>
  251. </div>
  252. <div>
  253. <Choice.DropdownSelect
  254. border
  255. block
  256. variant="alternate"
  257. size="large"
  258. label="Select"
  259. hint="Type anything here&hellip;"
  260. >
  261. {options}
  262. </Choice.DropdownSelect>
  263. </div>
  264. <div>
  265. <Choice.DropdownSelect
  266. variant="alternate"
  267. label="Select"
  268. hint="Type anything here&hellip;"
  269. block
  270. disabled
  271. >
  272. {options}
  273. </Choice.DropdownSelect>
  274. </div>
  275. <div>
  276. <Choice.DropdownSelect
  277. variant="alternate"
  278. border
  279. label="Select"
  280. hint="Type anything here&hellip;"
  281. block
  282. disabled
  283. >
  284. {options}
  285. </Choice.DropdownSelect>
  286. </div>
  287. </div>
  288. </div>
  289. </section>
  290. </div>
  291. </div>
  292. </section>
  293. <section>
  294. <div className="container mx-auto px-4">
  295. <h1>
  296. MenuSelect
  297. </h1>
  298. <div>
  299. <section>
  300. <h2>
  301. Default
  302. </h2>
  303. <div>
  304. <div className="grid md:grid-cols-2 gap-4">
  305. <div>
  306. <Choice.MenuSelect
  307. size="small"
  308. label="MultilineTextInput"
  309. hint="Type anything here&hellip;"
  310. indicator="A"
  311. block
  312. >
  313. {options}
  314. </Choice.MenuSelect>
  315. </div>
  316. <div>
  317. <Choice.MenuSelect
  318. border
  319. size="small"
  320. label="MultilineTextInput"
  321. hint="Type anything here&hellip;"
  322. indicator="A"
  323. block
  324. >
  325. {options}
  326. </Choice.MenuSelect>
  327. </div>
  328. <div>
  329. <Choice.MenuSelect
  330. label="MultilineTextInput"
  331. hint="Type anything here&hellip;"
  332. indicator="A"
  333. block
  334. >
  335. {options}
  336. </Choice.MenuSelect>
  337. </div>
  338. <div>
  339. <Choice.MenuSelect
  340. border
  341. label="MultilineTextInput"
  342. hint="Type anything here&hellip;"
  343. indicator="A"
  344. block
  345. >
  346. {options}
  347. </Choice.MenuSelect>
  348. </div>
  349. <div>
  350. <Choice.MenuSelect
  351. size="large"
  352. label="MultilineTextInput"
  353. hint="Type anything here&hellip;"
  354. indicator="A"
  355. block
  356. >
  357. {options}
  358. </Choice.MenuSelect>
  359. </div>
  360. <div>
  361. <Choice.MenuSelect
  362. border
  363. size="large"
  364. label="MultilineTextInput"
  365. hint="Type anything here&hellip;"
  366. indicator="A"
  367. block
  368. >
  369. {options}
  370. </Choice.MenuSelect>
  371. </div>
  372. <div>
  373. <Choice.MenuSelect
  374. label="MultilineTextInput"
  375. hint="Type anything here&hellip;"
  376. indicator="A"
  377. block
  378. disabled
  379. >
  380. {options}
  381. </Choice.MenuSelect>
  382. </div>
  383. <div>
  384. <Choice.MenuSelect
  385. border
  386. label="MultilineTextInput"
  387. hint="Type anything here&hellip;"
  388. indicator="A"
  389. block
  390. disabled
  391. >
  392. {options}
  393. </Choice.MenuSelect>
  394. </div>
  395. </div>
  396. </div>
  397. </section>
  398. <section>
  399. <h2>Alternate</h2>
  400. <div>
  401. <div className="grid md:grid-cols-2 gap-4">
  402. <div>
  403. <Choice.MenuSelect
  404. variant="alternate"
  405. size="small"
  406. label="MultilineTextInput"
  407. hint="Type anything here&hellip;"
  408. indicator="A"
  409. block
  410. >
  411. {options}
  412. </Choice.MenuSelect>
  413. </div>
  414. <div>
  415. <Choice.MenuSelect
  416. border
  417. variant="alternate"
  418. size="small"
  419. label="MultilineTextInput"
  420. hint="Type anything here&hellip;"
  421. indicator="A"
  422. block
  423. >
  424. {options}
  425. </Choice.MenuSelect>
  426. </div>
  427. <div>
  428. <Choice.MenuSelect
  429. variant="alternate"
  430. label="MultilineTextInput"
  431. hint="Type anything here&hellip;"
  432. indicator="A"
  433. block
  434. >
  435. {options}
  436. </Choice.MenuSelect>
  437. </div>
  438. <div>
  439. <Choice.MenuSelect
  440. border
  441. variant="alternate"
  442. label="MultilineTextInput"
  443. hint="Type anything here&hellip;"
  444. indicator="A"
  445. block
  446. >
  447. {options}
  448. </Choice.MenuSelect>
  449. </div>
  450. <div>
  451. <Choice.MenuSelect
  452. variant="alternate"
  453. size="large"
  454. label="MultilineTextInput"
  455. hint="Type anything here&hellip;"
  456. indicator="A"
  457. block
  458. >
  459. {options}
  460. </Choice.MenuSelect>
  461. </div>
  462. <div>
  463. <Choice.MenuSelect
  464. border
  465. block
  466. variant="alternate"
  467. size="large"
  468. label="MultilineTextInput"
  469. hint="Type anything here&hellip;"
  470. indicator="A"
  471. >
  472. {options}
  473. </Choice.MenuSelect>
  474. </div>
  475. <div>
  476. <Choice.MenuSelect
  477. variant="alternate"
  478. label="MultilineTextInput"
  479. hint="Type anything here&hellip;"
  480. indicator="A"
  481. block
  482. disabled
  483. >
  484. {options}
  485. </Choice.MenuSelect>
  486. </div>
  487. <div>
  488. <Choice.MenuSelect
  489. variant="alternate"
  490. border
  491. label="MultilineTextInput"
  492. hint="Type anything here&hellip;"
  493. indicator="A"
  494. block
  495. disabled
  496. >
  497. {options}
  498. </Choice.MenuSelect>
  499. </div>
  500. </div>
  501. </div>
  502. </section>
  503. <section>
  504. <h2>
  505. Multiple
  506. </h2>
  507. <div>
  508. <div className="grid md:grid-cols-2 gap-4">
  509. <div>
  510. <MultiChoice.MenuMultiSelect
  511. size="small"
  512. label="MultilineTextInput"
  513. hint="Type anything here&hellip;"
  514. indicator="A"
  515. block
  516. >
  517. {options}
  518. </MultiChoice.MenuMultiSelect>
  519. </div>
  520. <div>
  521. <MultiChoice.MenuMultiSelect
  522. border
  523. size="small"
  524. label="MultilineTextInput"
  525. hint="Type anything here&hellip;"
  526. indicator="A"
  527. block
  528. >
  529. {options}
  530. </MultiChoice.MenuMultiSelect>
  531. </div>
  532. <div>
  533. <MultiChoice.MenuMultiSelect
  534. label="MultilineTextInput"
  535. hint="Type anything here&hellip;"
  536. indicator="A"
  537. block
  538. >
  539. {options}
  540. </MultiChoice.MenuMultiSelect>
  541. </div>
  542. <div>
  543. <MultiChoice.MenuMultiSelect
  544. border
  545. label="MultilineTextInput"
  546. hint="Type anything here&hellip;"
  547. indicator="A"
  548. block
  549. >
  550. {options}
  551. </MultiChoice.MenuMultiSelect>
  552. </div>
  553. <div>
  554. <MultiChoice.MenuMultiSelect
  555. size="large"
  556. label="MultilineTextInput"
  557. hint="Type anything here&hellip;"
  558. indicator="A"
  559. block
  560. >
  561. {options}
  562. </MultiChoice.MenuMultiSelect>
  563. </div>
  564. <div>
  565. <MultiChoice.MenuMultiSelect
  566. border
  567. size="large"
  568. label="MultilineTextInput"
  569. hint="Type anything here&hellip;"
  570. indicator="A"
  571. block
  572. >
  573. {options}
  574. </MultiChoice.MenuMultiSelect>
  575. </div>
  576. <div>
  577. <MultiChoice.MenuMultiSelect
  578. label="MultilineTextInput"
  579. hint="Type anything here&hellip;"
  580. indicator="A"
  581. block
  582. disabled
  583. >
  584. {options}
  585. </MultiChoice.MenuMultiSelect>
  586. </div>
  587. <div>
  588. <MultiChoice.MenuMultiSelect
  589. border
  590. label="MultilineTextInput"
  591. hint="Type anything here&hellip;"
  592. indicator="A"
  593. block
  594. disabled
  595. >
  596. {options}
  597. </MultiChoice.MenuMultiSelect>
  598. </div>
  599. </div>
  600. </div>
  601. </section>
  602. </div>
  603. </div>
  604. </section>
  605. <section>
  606. <div className="container mx-auto px-4">
  607. <h1>
  608. RadioButton
  609. </h1>
  610. <div>
  611. <section>
  612. <h2>Variants</h2>
  613. <div>
  614. <div className="grid md:grid-cols-2 gap-4 my-4">
  615. <div>
  616. <Choice.RadioButton
  617. block
  618. variant="bare"
  619. name="RadioButton"
  620. >
  621. Button
  622. </Choice.RadioButton>
  623. </div>
  624. <div>
  625. <Choice.RadioButton
  626. variant="filled"
  627. block
  628. name="RadioButton"
  629. >
  630. Button
  631. </Choice.RadioButton>
  632. </div>
  633. <div>
  634. <Choice.RadioButton
  635. variant="outline"
  636. block
  637. name="RadioButton"
  638. >
  639. Button
  640. </Choice.RadioButton>
  641. </div>
  642. <div>
  643. <Choice.RadioButton
  644. variant="filled"
  645. block
  646. name="RadioButton"
  647. >
  648. Button
  649. </Choice.RadioButton>
  650. </div>
  651. <div>
  652. <Choice.RadioButton
  653. block
  654. disabled
  655. name="RadioButton"
  656. variant="bare"
  657. >
  658. Button
  659. </Choice.RadioButton>
  660. </div>
  661. <div>
  662. <Choice.RadioButton
  663. variant="filled"
  664. block
  665. disabled
  666. name="RadioButton"
  667. >
  668. Button
  669. </Choice.RadioButton>
  670. </div>
  671. <div>
  672. <Choice.RadioButton
  673. variant="outline"
  674. block
  675. disabled
  676. name="RadioButton"
  677. >
  678. Button
  679. </Choice.RadioButton>
  680. </div>
  681. <div>
  682. <Choice.RadioButton
  683. variant="filled"
  684. block
  685. disabled
  686. name="RadioButton"
  687. >
  688. Button
  689. </Choice.RadioButton>
  690. </div>
  691. </div>
  692. </div>
  693. </section>
  694. <section>
  695. <h2>Sizes</h2>
  696. <div>
  697. <div className="grid md:grid-cols-2 gap-4 my-4">
  698. <div>
  699. <Choice.RadioButton
  700. block
  701. variant="outline"
  702. size="small"
  703. name="RadioButton"
  704. >
  705. Button
  706. </Choice.RadioButton>
  707. </div>
  708. <div>
  709. <Choice.RadioButton
  710. block
  711. variant="filled"
  712. size="small"
  713. name="RadioButton"
  714. >
  715. Button
  716. </Choice.RadioButton>
  717. </div>
  718. <div>
  719. <Choice.RadioButton
  720. block
  721. variant="outline"
  722. size="medium"
  723. name="RadioButton"
  724. >
  725. Button
  726. </Choice.RadioButton>
  727. </div>
  728. <div>
  729. <Choice.RadioButton
  730. block
  731. variant="filled"
  732. size="medium"
  733. name="RadioButton"
  734. >
  735. Button
  736. </Choice.RadioButton>
  737. </div>
  738. <div>
  739. <Choice.RadioButton
  740. block
  741. variant="outline"
  742. size="large"
  743. name="RadioButton"
  744. >
  745. Button
  746. </Choice.RadioButton>
  747. </div>
  748. <div>
  749. <Choice.RadioButton
  750. block
  751. variant="filled"
  752. size="large"
  753. name="RadioButton"
  754. >
  755. Button
  756. </Choice.RadioButton>
  757. </div>
  758. </div>
  759. </div>
  760. </section>
  761. <section>
  762. <h2>Compact</h2>
  763. <div>
  764. <div className="grid md:grid-cols-2 gap-4 my-4">
  765. <div>
  766. <Choice.RadioButton
  767. block
  768. compact
  769. variant="outline"
  770. name="RadioButton"
  771. >
  772. Button
  773. </Choice.RadioButton>
  774. </div>
  775. <div>
  776. <Choice.RadioButton
  777. block
  778. compact
  779. variant="filled"
  780. name="RadioButton"
  781. >
  782. Button
  783. </Choice.RadioButton>
  784. </div>
  785. <div>
  786. <Choice.RadioButton
  787. block
  788. compact
  789. variant="outline"
  790. name="RadioButton"
  791. subtext={
  792. <>
  793. Subtext
  794. </>
  795. }
  796. >
  797. Button
  798. </Choice.RadioButton>
  799. </div>
  800. <div>
  801. <Choice.RadioButton
  802. block
  803. compact
  804. variant="filled"
  805. name="RadioButton"
  806. subtext={
  807. <>
  808. Subtext
  809. </>
  810. }
  811. >
  812. Button
  813. </Choice.RadioButton>
  814. </div>
  815. <div>
  816. <Choice.RadioButton
  817. block
  818. compact
  819. variant="outline"
  820. size="small"
  821. name="RadioButton"
  822. subtext={
  823. <>
  824. Subtext
  825. </>
  826. }
  827. >
  828. Button
  829. </Choice.RadioButton>
  830. </div>
  831. <div>
  832. <Choice.RadioButton
  833. block
  834. compact
  835. variant="filled"
  836. size="small"
  837. name="RadioButton"
  838. subtext={
  839. <>
  840. Subtext
  841. </>
  842. }
  843. >
  844. Button
  845. </Choice.RadioButton>
  846. </div>
  847. </div>
  848. </div>
  849. </section>
  850. </div>
  851. </div>
  852. </section>
  853. <section>
  854. <div className="container mx-auto px-4">
  855. <h1>
  856. RadioTickBox
  857. </h1>
  858. <div>
  859. <div className="grid gap-4 my-4">
  860. <div>
  861. <Choice.RadioTickBox
  862. block
  863. subtext="Subtext"
  864. name="RadioButton"
  865. >
  866. RadioButton
  867. </Choice.RadioTickBox>
  868. </div>
  869. </div>
  870. <div className="grid gap-4 my-4">
  871. <div>
  872. <Choice.RadioTickBox
  873. block
  874. subtext={
  875. <>
  876. <div>
  877. This is a very long text that may span a couple of lines.
  878. </div>
  879. <div>
  880. The subtext should not be included with the click area of the component.
  881. </div>
  882. </>
  883. }
  884. name="RadioButton"
  885. >
  886. RadioButton
  887. </Choice.RadioTickBox>
  888. </div>
  889. </div>
  890. </div>
  891. </div>
  892. </section>
  893. <section>
  894. <div className="container mx-auto px-4">
  895. <h1>
  896. ToggleButton
  897. </h1>
  898. <div>
  899. <section>
  900. <h2>Variants</h2>
  901. <div>
  902. <div className="grid md:grid-cols-2 gap-4 my-4">
  903. <div>
  904. <MultiChoice.ToggleButton
  905. variant="bare"
  906. indeterminate
  907. ref={(el) => { console.log(el); }}
  908. block
  909. >
  910. Button
  911. </MultiChoice.ToggleButton>
  912. </div>
  913. <div>
  914. <MultiChoice.ToggleButton
  915. variant="filled"
  916. block
  917. >
  918. Button
  919. </MultiChoice.ToggleButton>
  920. </div>
  921. <div>
  922. <MultiChoice.ToggleButton
  923. variant="outline"
  924. block
  925. >
  926. Button
  927. </MultiChoice.ToggleButton>
  928. </div>
  929. <div>
  930. <MultiChoice.ToggleButton
  931. variant="filled"
  932. block
  933. >
  934. Button
  935. </MultiChoice.ToggleButton>
  936. </div>
  937. <div>
  938. <MultiChoice.ToggleButton
  939. variant="bare"
  940. block
  941. disabled
  942. >
  943. Button
  944. </MultiChoice.ToggleButton>
  945. </div>
  946. <div>
  947. <MultiChoice.ToggleButton
  948. variant="filled"
  949. block
  950. disabled
  951. >
  952. Button
  953. </MultiChoice.ToggleButton>
  954. </div>
  955. <div>
  956. <MultiChoice.ToggleButton
  957. variant="outline"
  958. block
  959. disabled
  960. >
  961. Button
  962. </MultiChoice.ToggleButton>
  963. </div>
  964. <div>
  965. <MultiChoice.ToggleButton
  966. variant="filled"
  967. block
  968. disabled
  969. >
  970. Button
  971. </MultiChoice.ToggleButton>
  972. </div>
  973. <div>
  974. <MultiChoice.ToggleButton
  975. variant="outline"
  976. block
  977. indeterminate
  978. >
  979. Button
  980. </MultiChoice.ToggleButton>
  981. </div>
  982. <div>
  983. <MultiChoice.ToggleButton
  984. variant="filled"
  985. block
  986. indeterminate
  987. >
  988. Button
  989. </MultiChoice.ToggleButton>
  990. </div>
  991. </div>
  992. </div>
  993. </section>
  994. <section>
  995. <h2>Sizes</h2>
  996. <div>
  997. <div className="grid md:grid-cols-2 gap-4 my-4">
  998. <div>
  999. <MultiChoice.ToggleButton
  1000. block
  1001. variant="outline"
  1002. size="small"
  1003. >
  1004. Button
  1005. </MultiChoice.ToggleButton>
  1006. </div>
  1007. <div>
  1008. <MultiChoice.ToggleButton
  1009. block
  1010. variant="filled"
  1011. size="small"
  1012. >
  1013. Button
  1014. </MultiChoice.ToggleButton>
  1015. </div>
  1016. <div>
  1017. <MultiChoice.ToggleButton
  1018. block
  1019. variant="outline"
  1020. size="medium"
  1021. >
  1022. Button
  1023. </MultiChoice.ToggleButton>
  1024. </div>
  1025. <div>
  1026. <MultiChoice.ToggleButton
  1027. block
  1028. variant="filled"
  1029. size="medium"
  1030. >
  1031. Button
  1032. </MultiChoice.ToggleButton>
  1033. </div>
  1034. <div>
  1035. <MultiChoice.ToggleButton
  1036. block
  1037. variant="outline"
  1038. size="large"
  1039. >
  1040. Button
  1041. </MultiChoice.ToggleButton>
  1042. </div>
  1043. <div>
  1044. <MultiChoice.ToggleButton
  1045. block
  1046. variant="filled"
  1047. size="large"
  1048. >
  1049. Button
  1050. </MultiChoice.ToggleButton>
  1051. </div>
  1052. </div>
  1053. </div>
  1054. </section>
  1055. <section>
  1056. <h2>Compact</h2>
  1057. <div>
  1058. <div className="grid md:grid-cols-2 gap-4 my-4">
  1059. <div>
  1060. <MultiChoice.ToggleButton
  1061. block
  1062. compact
  1063. variant="outline"
  1064. >
  1065. Button
  1066. </MultiChoice.ToggleButton>
  1067. </div>
  1068. <div>
  1069. <MultiChoice.ToggleButton
  1070. block
  1071. compact
  1072. variant="filled"
  1073. >
  1074. Button
  1075. </MultiChoice.ToggleButton>
  1076. </div>
  1077. <div>
  1078. <MultiChoice.ToggleButton
  1079. block
  1080. compact
  1081. variant="outline"
  1082. subtext={
  1083. <>
  1084. Subtext
  1085. </>
  1086. }
  1087. >
  1088. Button
  1089. </MultiChoice.ToggleButton>
  1090. </div>
  1091. <div>
  1092. <MultiChoice.ToggleButton
  1093. block
  1094. compact
  1095. variant="filled"
  1096. subtext={
  1097. <>
  1098. Subtext
  1099. </>
  1100. }
  1101. >
  1102. Button
  1103. </MultiChoice.ToggleButton>
  1104. </div>
  1105. <div>
  1106. <MultiChoice.ToggleButton
  1107. block
  1108. compact
  1109. variant="outline"
  1110. size="small"
  1111. subtext={
  1112. <>
  1113. Subtext
  1114. </>
  1115. }
  1116. >
  1117. Button
  1118. </MultiChoice.ToggleButton>
  1119. </div>
  1120. <div>
  1121. <MultiChoice.ToggleButton
  1122. block
  1123. compact
  1124. variant="filled"
  1125. size="small"
  1126. subtext={
  1127. <>
  1128. Subtext
  1129. </>
  1130. }
  1131. >
  1132. Button
  1133. </MultiChoice.ToggleButton>
  1134. </div>
  1135. </div>
  1136. </div>
  1137. </section>
  1138. </div>
  1139. </div>
  1140. </section>
  1141. <section>
  1142. <div className="container mx-auto px-4">
  1143. <h1>
  1144. ToggleSwitch
  1145. </h1>
  1146. <div>
  1147. <section>
  1148. <h2>Default</h2>
  1149. <div>
  1150. <div className="grid md:grid-cols-2 gap-4 my-4">
  1151. <div>
  1152. <MultiChoice.ToggleSwitch
  1153. block
  1154. subtext="Subtext"
  1155. checkedLabel="Checkbox"
  1156. />
  1157. </div>
  1158. <div>
  1159. <MultiChoice.ToggleSwitch
  1160. block
  1161. subtext="Subtext"
  1162. checkedLabel="Checkbox"
  1163. />
  1164. </div>
  1165. </div>
  1166. </div>
  1167. </section>
  1168. <section>
  1169. <h2>With Unchecked Label</h2>
  1170. <div>
  1171. <div className="grid md:grid-cols-2 gap-4 my-4">
  1172. <div>
  1173. <MultiChoice.ToggleSwitch
  1174. block
  1175. subtext="Subtext"
  1176. checkedLabel="On"
  1177. uncheckedLabel="Off"
  1178. />
  1179. </div>
  1180. <div>
  1181. <MultiChoice.ToggleSwitch
  1182. block
  1183. subtext="Subtext"
  1184. indeterminate
  1185. checkedLabel="On"
  1186. uncheckedLabel="Off"
  1187. />
  1188. </div>
  1189. </div>
  1190. </div>
  1191. </section>
  1192. </div>
  1193. </div>
  1194. </section>
  1195. <section>
  1196. <div className="container mx-auto px-4">
  1197. <h1>
  1198. ToggleTickBox
  1199. </h1>
  1200. <div>
  1201. <section>
  1202. <h2>Default</h2>
  1203. <div>
  1204. <div className="grid md:grid-cols-2 gap-4 my-4">
  1205. <div>
  1206. <MultiChoice.ToggleTickBox
  1207. block
  1208. subtext="Subtext"
  1209. >
  1210. Checkbox
  1211. </MultiChoice.ToggleTickBox>
  1212. </div>
  1213. <div>
  1214. <MultiChoice.ToggleTickBox
  1215. block
  1216. indeterminate
  1217. subtext="Subtext"
  1218. >
  1219. Checkbox
  1220. </MultiChoice.ToggleTickBox>
  1221. </div>
  1222. </div>
  1223. </div>
  1224. </section>
  1225. </div>
  1226. </div>
  1227. </section>
  1228. <section>
  1229. <div className="container mx-auto px-4">
  1230. <h1>
  1231. ComboBox
  1232. </h1>
  1233. <div>
  1234. <section>
  1235. <h2>
  1236. Default
  1237. </h2>
  1238. <div>
  1239. <div className="grid md:grid-cols-2 gap-4">
  1240. <div>
  1241. <Choice.ComboBox
  1242. size="small"
  1243. label="MultilineTextInput"
  1244. hint="Type anything here&hellip;"
  1245. indicator="A"
  1246. block
  1247. >
  1248. {options}
  1249. </Choice.ComboBox>
  1250. </div>
  1251. <div>
  1252. <Choice.ComboBox
  1253. border
  1254. size="small"
  1255. label="MultilineTextInput"
  1256. hint="Type anything here&hellip;"
  1257. indicator="A"
  1258. block
  1259. >
  1260. {options}
  1261. </Choice.ComboBox>
  1262. </div>
  1263. <div>
  1264. <Choice.ComboBox
  1265. label="MultilineTextInput"
  1266. hint="Type anything here&hellip;"
  1267. indicator="A"
  1268. block
  1269. >
  1270. {options}
  1271. </Choice.ComboBox>
  1272. </div>
  1273. <div>
  1274. <Choice.ComboBox
  1275. border
  1276. label="MultilineTextInput"
  1277. hint="Type anything here&hellip;"
  1278. indicator="A"
  1279. block
  1280. >
  1281. {options}
  1282. </Choice.ComboBox>
  1283. </div>
  1284. <div>
  1285. <Choice.ComboBox
  1286. size="large"
  1287. label="MultilineTextInput"
  1288. hint="Type anything here&hellip;"
  1289. indicator="A"
  1290. block
  1291. >
  1292. {options}
  1293. </Choice.ComboBox>
  1294. </div>
  1295. <div>
  1296. <Choice.ComboBox
  1297. border
  1298. size="large"
  1299. label="MultilineTextInput"
  1300. hint="Type anything here&hellip;"
  1301. indicator="A"
  1302. block
  1303. >
  1304. {options}
  1305. </Choice.ComboBox>
  1306. </div>
  1307. <div>
  1308. <Choice.ComboBox
  1309. label="MultilineTextInput"
  1310. hint="Type anything here&hellip;"
  1311. indicator="A"
  1312. block
  1313. disabled
  1314. >
  1315. {options}
  1316. </Choice.ComboBox>
  1317. </div>
  1318. <div>
  1319. <Choice.ComboBox
  1320. border
  1321. label="MultilineTextInput"
  1322. hint="Type anything here&hellip;"
  1323. indicator="A"
  1324. block
  1325. disabled
  1326. >
  1327. {options}
  1328. </Choice.ComboBox>
  1329. </div>
  1330. </div>
  1331. </div>
  1332. </section>
  1333. <section>
  1334. <h2>Alternate</h2>
  1335. <div>
  1336. <div className="grid md:grid-cols-2 gap-4">
  1337. <div>
  1338. <Choice.ComboBox
  1339. variant="alternate"
  1340. size="small"
  1341. label="MultilineTextInput"
  1342. hint="Type anything here&hellip;"
  1343. indicator="A"
  1344. block
  1345. >
  1346. {options}
  1347. </Choice.ComboBox>
  1348. </div>
  1349. <div>
  1350. <Choice.ComboBox
  1351. border
  1352. variant="alternate"
  1353. size="small"
  1354. label="MultilineTextInput"
  1355. hint="Type anything here&hellip;"
  1356. indicator="A"
  1357. block
  1358. >
  1359. {options}
  1360. </Choice.ComboBox>
  1361. </div>
  1362. <div>
  1363. <Choice.ComboBox
  1364. variant="alternate"
  1365. label="MultilineTextInput"
  1366. hint="Type anything here&hellip;"
  1367. indicator="A"
  1368. block
  1369. >
  1370. {options}
  1371. </Choice.ComboBox>
  1372. </div>
  1373. <div>
  1374. <Choice.ComboBox
  1375. border
  1376. variant="alternate"
  1377. label="MultilineTextInput"
  1378. hint="Type anything here&hellip;"
  1379. indicator="A"
  1380. block
  1381. >
  1382. {options}
  1383. </Choice.ComboBox>
  1384. </div>
  1385. <div>
  1386. <Choice.ComboBox
  1387. variant="alternate"
  1388. size="large"
  1389. label="MultilineTextInput"
  1390. hint="Type anything here&hellip;"
  1391. indicator="A"
  1392. block
  1393. >
  1394. {options}
  1395. </Choice.ComboBox>
  1396. </div>
  1397. <div>
  1398. <Choice.ComboBox
  1399. border
  1400. block
  1401. variant="alternate"
  1402. size="large"
  1403. label="MultilineTextInput"
  1404. hint="Type anything here&hellip;"
  1405. indicator="A"
  1406. >
  1407. {options}
  1408. </Choice.ComboBox>
  1409. </div>
  1410. <div>
  1411. <Choice.ComboBox
  1412. variant="alternate"
  1413. label="MultilineTextInput"
  1414. hint="Type anything here&hellip;"
  1415. indicator="A"
  1416. block
  1417. disabled
  1418. >
  1419. {options}
  1420. </Choice.ComboBox>
  1421. </div>
  1422. <div>
  1423. <Choice.ComboBox
  1424. variant="alternate"
  1425. border
  1426. label="MultilineTextInput"
  1427. hint="Type anything here&hellip;"
  1428. indicator="A"
  1429. block
  1430. disabled
  1431. >
  1432. {options}
  1433. </Choice.ComboBox>
  1434. </div>
  1435. </div>
  1436. </div>
  1437. </section>
  1438. </div>
  1439. </div>
  1440. </section>
  1441. <section>
  1442. <div className="container mx-auto px-4">
  1443. <h1>
  1444. TagInput
  1445. </h1>
  1446. <div>
  1447. <section>
  1448. <h2>
  1449. Default
  1450. </h2>
  1451. <div>
  1452. <div className="grid md:grid-cols-2 gap-4">
  1453. <div>
  1454. <MultiChoice.TagInput
  1455. size="small"
  1456. label="MultilineTextInput"
  1457. hint="Type anything here&hellip;"
  1458. indicator="A"
  1459. block
  1460. enhanced
  1461. />
  1462. </div>
  1463. <div>
  1464. <MultiChoice.TagInput
  1465. border
  1466. size="small"
  1467. label="MultilineTextInput"
  1468. hint="Type anything here&hellip;"
  1469. indicator="A"
  1470. block
  1471. enhanced
  1472. />
  1473. </div>
  1474. <div>
  1475. <MultiChoice.TagInput
  1476. label="MultilineTextInput"
  1477. hint="Type anything here&hellip;"
  1478. indicator="A"
  1479. block
  1480. enhanced
  1481. />
  1482. </div>
  1483. <div>
  1484. <MultiChoice.TagInput
  1485. border
  1486. label="MultilineTextInput"
  1487. hint="Type anything here&hellip;"
  1488. indicator="A"
  1489. block
  1490. enhanced
  1491. />
  1492. </div>
  1493. <div>
  1494. <MultiChoice.TagInput
  1495. size="large"
  1496. label="not enhanced"
  1497. hint="Type anything here&hellip;"
  1498. indicator="A"
  1499. block
  1500. onFocus={(e) => {
  1501. console.log('focus', e.currentTarget);
  1502. }}
  1503. onBlur={(e) => {
  1504. console.log('blur', e.currentTarget);
  1505. }}
  1506. onChange={(e) => {
  1507. console.log('change', e.currentTarget.value);
  1508. }}
  1509. />
  1510. </div>
  1511. <div>
  1512. <MultiChoice.TagInput
  1513. border
  1514. size="large"
  1515. label="change"
  1516. hint="Type anything here&hellip;"
  1517. indicator="A"
  1518. block
  1519. enhanced
  1520. separator={['newline', 'comma']}
  1521. onFocus={(e) => {
  1522. console.log('focus', e.currentTarget);
  1523. }}
  1524. onBlur={(e) => {
  1525. console.log('blur', e.currentTarget);
  1526. }}
  1527. onChange={(e) => {
  1528. console.log('change', e.currentTarget.value);
  1529. }}
  1530. />
  1531. </div>
  1532. <div>
  1533. <MultiChoice.TagInput
  1534. label="MultilineTextInput"
  1535. hint="Type anything here&hellip;"
  1536. indicator="A"
  1537. block
  1538. disabled
  1539. enhanced
  1540. />
  1541. </div>
  1542. <div>
  1543. <MultiChoice.TagInput
  1544. border
  1545. label="MultilineTextInput"
  1546. hint="Type anything here&hellip;"
  1547. indicator="A"
  1548. block
  1549. disabled
  1550. enhanced
  1551. />
  1552. </div>
  1553. </div>
  1554. </div>
  1555. </section>
  1556. <section>
  1557. <h2>Alternate</h2>
  1558. <div>
  1559. <div className="grid md:grid-cols-2 gap-4">
  1560. <div>
  1561. <MultiChoice.TagInput
  1562. variant="alternate"
  1563. size="small"
  1564. label="MultilineTextInput"
  1565. hint="Type anything here&hellip;"
  1566. indicator="A"
  1567. block
  1568. enhanced
  1569. />
  1570. </div>
  1571. <div>
  1572. <MultiChoice.TagInput
  1573. border
  1574. variant="alternate"
  1575. size="small"
  1576. label="MultilineTextInput"
  1577. hint="Type anything here&hellip;"
  1578. indicator="A"
  1579. block
  1580. enhanced
  1581. />
  1582. </div>
  1583. <div>
  1584. <MultiChoice.TagInput
  1585. variant="alternate"
  1586. label="MultilineTextInput"
  1587. hint="Type anything here&hellip;"
  1588. indicator="A"
  1589. block
  1590. enhanced
  1591. />
  1592. </div>
  1593. <div>
  1594. <MultiChoice.TagInput
  1595. border
  1596. variant="alternate"
  1597. label="MultilineTextInput"
  1598. hint="Type anything here&hellip;"
  1599. indicator="A"
  1600. block
  1601. enhanced
  1602. />
  1603. </div>
  1604. <div>
  1605. <MultiChoice.TagInput
  1606. variant="alternate"
  1607. size="large"
  1608. label="MultilineTextInput"
  1609. hint="Type anything here&hellip;"
  1610. indicator="A"
  1611. block
  1612. enhanced
  1613. />
  1614. </div>
  1615. <div>
  1616. <MultiChoice.TagInput
  1617. border
  1618. block
  1619. variant="alternate"
  1620. size="large"
  1621. label="MultilineTextInput"
  1622. hint="Type anything here&hellip;"
  1623. indicator="A"
  1624. enhanced
  1625. />
  1626. </div>
  1627. <div>
  1628. <MultiChoice.TagInput
  1629. variant="alternate"
  1630. label="MultilineTextInput"
  1631. hint="Type anything here&hellip;"
  1632. indicator="A"
  1633. block
  1634. disabled
  1635. enhanced
  1636. />
  1637. </div>
  1638. <div>
  1639. <MultiChoice.TagInput
  1640. variant="alternate"
  1641. border
  1642. label="MultilineTextInput"
  1643. hint="Type anything here&hellip;"
  1644. indicator="A"
  1645. block
  1646. disabled
  1647. enhanced
  1648. />
  1649. </div>
  1650. </div>
  1651. </div>
  1652. </section>
  1653. </div>
  1654. </div>
  1655. </section>
  1656. </div>
  1657. </DefaultLayout>
  1658. );
  1659. };
  1660. export default OptionPage;