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

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