data.tsx 13 KB

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