data.tsx 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. type IconGroupName =
  2. | 'action'
  3. | 'navigation'
  4. | 'content'
  5. | 'file'
  6. | 'issue'
  7. | 'chart'
  8. | 'layout'
  9. | 'media'
  10. | 'device'
  11. | 'other'
  12. | 'logo';
  13. export type IconPropName = 'size' | 'direction' | 'isCircled' | 'isSolid' | 'type';
  14. type IconProps = {
  15. [key in IconPropName]: {
  16. type: 'boolean' | 'select';
  17. options?: [string, string][];
  18. default?: string;
  19. /**
  20. * Whether to list all variants of this prop in the icon list
  21. */
  22. enumerate?: boolean;
  23. };
  24. };
  25. type IconGroup = {
  26. id: IconGroupName;
  27. label: string;
  28. };
  29. export type IconData = {
  30. id: string;
  31. /**
  32. * List of alternative keywords for better icon search, e.g. the
  33. * icon 'checkmark' could have a ['done', 'success'] keyword list
  34. */
  35. keywords: string[];
  36. /**
  37. * Groups that the icon belongs to
  38. */
  39. groups: IconGroupName[];
  40. /**
  41. * Any additional props besides 'size' and 'color'. This includes
  42. * props like 'isCircled' and 'direction'.
  43. */
  44. additionalProps?: IconPropName[];
  45. /**
  46. * Limit the set of options available for certain additional props.
  47. * For example, {direction: ['left', 'up']} would limit the available
  48. * options for the prop 'direction' to just 'left' and 'up'. Useful for
  49. * controlling prop enumeration in the icon list.
  50. */
  51. limitOptions?: Partial<Record<IconPropName, string[][]>>;
  52. };
  53. export const iconProps: IconProps = {
  54. size: {
  55. type: 'select',
  56. options: [
  57. ['xs', 'Extra small'],
  58. ['sm', 'Small'],
  59. ['md', 'Medium'],
  60. ['lg', 'Large'],
  61. ['xl', 'Extra large'],
  62. ],
  63. default: 'sm',
  64. },
  65. type: {
  66. type: 'select',
  67. options: [
  68. ['line', 'Line'],
  69. ['circle', 'Circle'],
  70. ['bar', 'Bar'],
  71. ],
  72. default: 'line',
  73. enumerate: true,
  74. },
  75. direction: {
  76. type: 'select',
  77. options: [
  78. ['left', 'Left'],
  79. ['right', 'Right'],
  80. ['up', 'Up'],
  81. ['down', 'Down'],
  82. ],
  83. default: 'left',
  84. enumerate: true,
  85. },
  86. isCircled: {type: 'boolean', enumerate: true},
  87. isSolid: {type: 'boolean', enumerate: true},
  88. };
  89. export const iconGroups: IconGroup[] = [
  90. {
  91. id: 'action',
  92. label: 'Action',
  93. },
  94. {
  95. id: 'navigation',
  96. label: 'Navigation',
  97. },
  98. {
  99. id: 'content',
  100. label: 'Content',
  101. },
  102. {
  103. id: 'layout',
  104. label: 'Layout',
  105. },
  106. {
  107. id: 'issue',
  108. label: 'Issue',
  109. },
  110. {
  111. id: 'file',
  112. label: 'File',
  113. },
  114. {
  115. id: 'media',
  116. label: 'Media',
  117. },
  118. {
  119. id: 'chart',
  120. label: 'Chart',
  121. },
  122. {
  123. id: 'device',
  124. label: 'Device',
  125. },
  126. {
  127. id: 'other',
  128. label: 'Other',
  129. },
  130. {
  131. id: 'logo',
  132. label: 'Logo',
  133. },
  134. ];
  135. export const icons: IconData[] = [
  136. {id: 'add', groups: ['action'], keywords: ['plus'], additionalProps: ['isCircled']},
  137. {
  138. id: 'subtract',
  139. groups: ['action'],
  140. keywords: ['minus'],
  141. additionalProps: ['isCircled'],
  142. },
  143. {
  144. id: 'checkmark',
  145. groups: ['action'],
  146. keywords: ['done', 'finish', 'success', 'confirm', 'resolve'],
  147. additionalProps: ['isCircled'],
  148. },
  149. {
  150. id: 'close',
  151. groups: ['action'],
  152. keywords: ['cross', 'deny', 'terminate'],
  153. additionalProps: ['isCircled'],
  154. },
  155. {
  156. id: 'chevron',
  157. groups: ['action', 'navigation'],
  158. keywords: [
  159. 'up',
  160. 'down',
  161. 'left',
  162. 'right',
  163. 'point',
  164. 'direct',
  165. 'move',
  166. 'expand',
  167. 'collapse',
  168. 'arrow',
  169. ],
  170. additionalProps: ['isCircled', 'direction'],
  171. },
  172. {
  173. id: 'arrow',
  174. groups: ['navigation'],
  175. keywords: ['up', 'down', 'left', 'right', 'point', 'direct', 'move'],
  176. additionalProps: ['direction'],
  177. },
  178. {id: 'upload', groups: ['action', 'file'], keywords: ['file', 'image', 'up']},
  179. {id: 'download', groups: ['action', 'file'], keywords: ['file', 'image', 'down']},
  180. {id: 'sync', groups: ['action', 'file'], keywords: ['swap']},
  181. {id: 'menu', groups: ['layout'], keywords: ['navigate']},
  182. {id: 'list', groups: ['layout'], keywords: ['item']},
  183. {id: 'activity', groups: ['layout', 'issue'], keywords: ['list']},
  184. {id: 'dashboard', groups: ['layout'], keywords: ['overview', 'group', 'organize']},
  185. {id: 'projects', groups: ['content', 'layout'], keywords: ['overview']},
  186. {
  187. id: 'upgrade',
  188. groups: ['action', 'file'],
  189. keywords: ['up'],
  190. },
  191. {
  192. id: 'open',
  193. groups: ['action', 'file'],
  194. keywords: ['link', 'hyperlink', 'external'],
  195. },
  196. {
  197. id: 'return',
  198. groups: ['action'],
  199. keywords: ['enter'],
  200. },
  201. {
  202. id: 'refresh',
  203. groups: ['action', 'navigation'],
  204. keywords: ['reload', 'restart'],
  205. },
  206. {
  207. id: 'bookmark',
  208. groups: ['action'],
  209. keywords: ['favorite', 'star', 'mark'],
  210. additionalProps: ['isSolid'],
  211. },
  212. {
  213. id: 'pin',
  214. groups: ['action'],
  215. keywords: ['stick'],
  216. additionalProps: ['isSolid'],
  217. },
  218. {
  219. id: 'star',
  220. groups: ['action'],
  221. keywords: ['favorite', 'star', 'bookmark'],
  222. additionalProps: ['isSolid'],
  223. },
  224. {
  225. id: 'play',
  226. groups: ['media'],
  227. keywords: ['video', 'audio', 'unpause'],
  228. },
  229. {
  230. id: 'pause',
  231. groups: ['media'],
  232. keywords: ['video', 'audio', 'stop'],
  233. },
  234. {
  235. id: 'previous',
  236. groups: ['media'],
  237. keywords: ['video', 'audio', 'back', 'return', 'rewind'],
  238. },
  239. {
  240. id: 'next',
  241. groups: ['media'],
  242. keywords: ['video', 'audio', 'skip', 'forward'],
  243. },
  244. {
  245. id: 'graph',
  246. groups: ['chart'],
  247. keywords: ['line', 'plot'],
  248. additionalProps: ['type'],
  249. },
  250. {
  251. id: 'stats',
  252. groups: ['chart'],
  253. keywords: ['bar', 'graph'],
  254. },
  255. {
  256. id: 'file',
  257. groups: ['file', 'content'],
  258. keywords: ['document'],
  259. },
  260. {
  261. id: 'search',
  262. groups: ['action'],
  263. keywords: ['find', 'look', 'query'],
  264. },
  265. {
  266. id: 'copy',
  267. groups: ['action', 'file', 'content'],
  268. keywords: ['duplicate'],
  269. },
  270. {
  271. id: 'delete',
  272. groups: ['action', 'content'],
  273. keywords: ['trash', 'can', 'dumpster', 'remove', 'erase', 'clear'],
  274. },
  275. {
  276. id: 'docs',
  277. groups: ['file'],
  278. keywords: ['document'],
  279. },
  280. {
  281. id: 'print',
  282. groups: ['action', 'file'],
  283. keywords: [],
  284. },
  285. {
  286. id: 'project',
  287. groups: ['issue'],
  288. keywords: [],
  289. },
  290. {
  291. id: 'code',
  292. groups: ['content'],
  293. keywords: ['snippet'],
  294. },
  295. {
  296. id: 'markdown',
  297. groups: ['content'],
  298. keywords: ['code'],
  299. },
  300. {
  301. id: 'terminal',
  302. groups: ['device', 'content'],
  303. keywords: ['code', 'bash', 'command'],
  304. },
  305. {
  306. id: 'commit',
  307. groups: ['content'],
  308. keywords: ['git', 'github'],
  309. },
  310. {
  311. id: 'issues',
  312. groups: ['content', 'issue'],
  313. keywords: ['stack'],
  314. },
  315. {
  316. id: 'releases',
  317. groups: ['content', 'issue'],
  318. keywords: ['stack', 'versions'],
  319. },
  320. {
  321. id: 'stack',
  322. groups: ['layout', 'content'],
  323. keywords: ['group', 'combine', 'view'],
  324. },
  325. {
  326. id: 'span',
  327. groups: ['content'],
  328. keywords: ['performance', 'transaction'],
  329. },
  330. {
  331. id: 'link',
  332. groups: ['action', 'content'],
  333. keywords: ['hyperlink', 'anchor'],
  334. },
  335. {
  336. id: 'attachment',
  337. groups: ['action', 'content'],
  338. keywords: ['include', 'clip'],
  339. },
  340. {
  341. id: 'location',
  342. groups: ['content'],
  343. keywords: ['pin', 'position', 'map'],
  344. additionalProps: ['isSolid'],
  345. },
  346. {
  347. id: 'edit',
  348. groups: ['action', 'content'],
  349. keywords: ['pencil'],
  350. },
  351. {
  352. id: 'filter',
  353. groups: ['action', 'content'],
  354. keywords: [],
  355. },
  356. {
  357. id: 'show',
  358. groups: ['action', 'content'],
  359. keywords: ['visible'],
  360. },
  361. {
  362. id: 'lock',
  363. groups: ['action'],
  364. keywords: ['secure'],
  365. },
  366. {
  367. id: 'grabbable',
  368. groups: ['action', 'layout'],
  369. keywords: ['move', 'arrange', 'organize', 'rank', 'switch'],
  370. },
  371. {
  372. id: 'ellipsis',
  373. groups: ['action', 'layout'],
  374. keywords: ['expand', 'open', 'more', 'hidden'],
  375. },
  376. {
  377. id: 'fire',
  378. groups: ['issue'],
  379. keywords: ['danger', 'severe', 'critical'],
  380. },
  381. {
  382. id: 'megaphone',
  383. groups: ['other'],
  384. keywords: ['speaker', 'announce'],
  385. },
  386. {
  387. id: 'question',
  388. groups: ['layout'],
  389. keywords: ['info', 'about', 'information', 'ask', 'faq', 'q&a'],
  390. },
  391. {
  392. id: 'info',
  393. groups: ['layout'],
  394. keywords: ['more', 'about', 'information', 'ask', 'faq', 'q&a'],
  395. },
  396. {
  397. id: 'warning',
  398. groups: ['issue'],
  399. keywords: ['alert', 'notification'],
  400. },
  401. {
  402. id: 'not',
  403. groups: ['other'],
  404. keywords: ['invalid', 'no', 'forbidden'],
  405. },
  406. {
  407. id: 'laptop',
  408. groups: ['device'],
  409. keywords: ['computer', 'macbook'],
  410. },
  411. {
  412. id: 'mobile',
  413. groups: ['device'],
  414. keywords: ['phone', 'iphone'],
  415. },
  416. {
  417. id: 'window',
  418. groups: ['device'],
  419. keywords: ['application'],
  420. },
  421. {
  422. id: 'user',
  423. groups: ['content'],
  424. keywords: ['person', 'portrait'],
  425. },
  426. {
  427. id: 'group',
  428. groups: ['content'],
  429. keywords: ['person', 'people'],
  430. },
  431. {
  432. id: 'chat',
  433. groups: ['action', 'content'],
  434. keywords: ['message', 'bubble'],
  435. },
  436. {
  437. id: 'support',
  438. groups: ['content'],
  439. keywords: ['microphone', 'help'],
  440. },
  441. {
  442. id: 'clock',
  443. groups: ['content'],
  444. keywords: ['time', 'watch'],
  445. },
  446. {
  447. id: 'calendar',
  448. groups: ['content'],
  449. keywords: ['time', 'date'],
  450. },
  451. {
  452. id: 'sliders',
  453. groups: ['action'],
  454. keywords: ['settings', 'slide', 'adjust'],
  455. additionalProps: ['direction'],
  456. limitOptions: {
  457. direction: [
  458. ['left', 'Left'],
  459. ['up', 'Up'],
  460. ],
  461. },
  462. },
  463. {id: 'switch', groups: ['action'], keywords: ['swap']},
  464. {
  465. id: 'toggle',
  466. groups: ['action'],
  467. keywords: ['switch', 'form', 'disable', 'enable'],
  468. },
  469. {
  470. id: 'settings',
  471. groups: ['content'],
  472. keywords: ['preference'],
  473. },
  474. {
  475. id: 'mail',
  476. groups: ['content'],
  477. keywords: ['email'],
  478. },
  479. {
  480. id: 'fix',
  481. groups: ['action'],
  482. keywords: ['wrench', 'resolve'],
  483. },
  484. {
  485. id: 'lab',
  486. groups: ['content', 'other'],
  487. keywords: ['experiment', 'test'],
  488. },
  489. {
  490. id: 'tag',
  491. groups: ['content'],
  492. keywords: ['price', 'category', 'group'],
  493. },
  494. {
  495. id: 'broadcast',
  496. groups: ['action', 'content'],
  497. keywords: ['stream'],
  498. },
  499. {
  500. id: 'telescope',
  501. groups: ['other'],
  502. keywords: [],
  503. },
  504. {
  505. id: 'moon',
  506. groups: ['action'],
  507. keywords: ['dark', 'night'],
  508. },
  509. {
  510. id: 'lightning',
  511. groups: ['content'],
  512. keywords: ['feature', 'new', 'fresh'],
  513. additionalProps: ['isSolid'],
  514. },
  515. {
  516. id: 'business',
  517. groups: ['content'],
  518. keywords: ['feature', 'promotion', 'fresh', 'new'],
  519. },
  520. {
  521. id: 'bell',
  522. groups: ['content'],
  523. keywords: ['alert', 'notification', 'ring'],
  524. },
  525. {
  526. id: 'siren',
  527. groups: ['content'],
  528. keywords: ['alert', 'important', 'warning'],
  529. },
  530. {
  531. id: 'anchor',
  532. groups: ['other'],
  533. keywords: [],
  534. },
  535. {
  536. id: 'circle',
  537. groups: ['other'],
  538. keywords: ['shape', 'round'],
  539. },
  540. {
  541. id: 'rectangle',
  542. groups: ['other'],
  543. keywords: ['shape', 'rect', 'diamond'],
  544. },
  545. {
  546. id: 'flag',
  547. groups: ['action'],
  548. keywords: ['bookmark', 'mark', 'save', 'warning', 'message'],
  549. },
  550. {
  551. id: 'sound',
  552. groups: ['content', 'action'],
  553. keywords: ['audio'],
  554. },
  555. {
  556. id: 'sentry',
  557. groups: ['logo'],
  558. keywords: [],
  559. },
  560. {
  561. id: 'bitbucket',
  562. groups: ['logo'],
  563. keywords: [],
  564. },
  565. {
  566. id: 'github',
  567. groups: ['logo'],
  568. keywords: [],
  569. },
  570. {
  571. id: 'gitlab',
  572. groups: ['logo'],
  573. keywords: [],
  574. },
  575. {
  576. id: 'google',
  577. groups: ['logo'],
  578. keywords: [],
  579. },
  580. {
  581. id: 'jira',
  582. groups: ['logo'],
  583. keywords: [],
  584. },
  585. {
  586. id: 'trello',
  587. groups: ['logo'],
  588. keywords: [],
  589. },
  590. {
  591. id: 'vsts',
  592. groups: ['logo'],
  593. keywords: [],
  594. },
  595. {
  596. id: 'generic',
  597. groups: ['logo'],
  598. keywords: [],
  599. },
  600. ];