您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

panel.tsx 2.3KB

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