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.

panel.tsx 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. import styled from 'styles'
  2. export const Root = styled('div', {
  3. position: 'relative',
  4. backgroundColor: '$panel',
  5. borderRadius: '4px',
  6. overflow: 'hidden',
  7. pointerEvents: 'all',
  8. userSelect: 'none',
  9. zIndex: 200,
  10. border: '1px solid $panel',
  11. boxShadow: '$4',
  12. font: '$ui',
  13. variants: {
  14. bp: {
  15. mobile: {},
  16. small: {},
  17. },
  18. variant: {
  19. code: {},
  20. controls: {
  21. position: 'absolute',
  22. right: 156,
  23. },
  24. },
  25. isOpen: {
  26. true: {},
  27. false: {
  28. padding: '$0',
  29. height: 38,
  30. width: 38,
  31. },
  32. },
  33. },
  34. compoundVariants: [
  35. {
  36. isOpen: true,
  37. variant: 'code',
  38. css: {
  39. position: 'absolute',
  40. top: 8,
  41. left: 8,
  42. right: 8,
  43. bottom: 48,
  44. maxWidth: 680,
  45. zIndex: 1000,
  46. },
  47. },
  48. {
  49. isOpen: true,
  50. variant: 'code',
  51. bp: 'small',
  52. css: {
  53. position: 'absolute',
  54. top: 8,
  55. left: 8,
  56. right: 8,
  57. bottom: 128,
  58. maxWidth: 720,
  59. zIndex: 1000,
  60. },
  61. },
  62. ],
  63. })
  64. export const Layout = styled('div', {
  65. display: 'grid',
  66. gridTemplateColumns: '1fr',
  67. gridTemplateRows: 'auto 1fr',
  68. gridAutoRows: '28px',
  69. height: '100%',
  70. width: 'auto',
  71. minWidth: '100%',
  72. maxWidth: 560,
  73. overflow: 'hidden',
  74. userSelect: 'none',
  75. pointerEvents: 'all',
  76. })
  77. export const Header = styled('div', {
  78. pointerEvents: 'all',
  79. display: 'flex',
  80. width: '100%',
  81. alignItems: 'center',
  82. justifyContent: 'space-between',
  83. padding: '$0',
  84. position: 'relative',
  85. '& h3': {
  86. position: 'absolute',
  87. top: 0,
  88. left: 0,
  89. width: '100%',
  90. height: '100%',
  91. textAlign: 'center',
  92. padding: 0,
  93. margin: 0,
  94. display: 'flex',
  95. justifyContent: 'center',
  96. alignItems: 'center',
  97. fontSize: '13px',
  98. pointerEvents: 'none',
  99. userSelect: 'none',
  100. },
  101. variants: {
  102. side: {
  103. left: {
  104. flexDirection: 'row',
  105. },
  106. right: {
  107. flexDirection: 'row-reverse',
  108. },
  109. },
  110. },
  111. })
  112. export const ButtonsGroup = styled('div', {
  113. display: 'flex',
  114. })
  115. export const Content = styled('div', {
  116. position: 'relative',
  117. pointerEvents: 'all',
  118. overflowY: 'scroll',
  119. })
  120. export const Footer = styled('div', {
  121. overflowX: 'scroll',
  122. color: '$text',
  123. font: '$debug',
  124. padding: '0 12px',
  125. display: 'flex',
  126. alignItems: 'center',
  127. })