list.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. @property --bottom-fade {
  2. syntax: "<length>";
  3. inherits: false;
  4. initial-value: 0px;
  5. }
  6. @keyframes scroll {
  7. 0% {
  8. --bottom-fade: 20px;
  9. }
  10. 90% {
  11. --bottom-fade: 20px;
  12. }
  13. 100% {
  14. --bottom-fade: 0;
  15. }
  16. }
  17. [data-component="list"] {
  18. display: flex;
  19. flex-direction: column;
  20. gap: 12px;
  21. overflow: hidden;
  22. padding: 0 12px;
  23. [data-slot="list-search-wrapper"] {
  24. display: flex;
  25. flex-shrink: 0;
  26. align-items: center;
  27. gap: 8px;
  28. align-self: stretch;
  29. margin-bottom: 4px;
  30. > [data-component="icon-button"] {
  31. width: 24px;
  32. height: 24px;
  33. flex-shrink: 0;
  34. background-color: transparent;
  35. opacity: 0.5;
  36. transition: opacity 0.15s ease;
  37. &:hover:not(:disabled),
  38. &:focus-visible:not(:disabled),
  39. &:active:not(:disabled) {
  40. background-color: transparent;
  41. opacity: 0.7;
  42. }
  43. &:hover:not(:disabled) [data-slot="icon-svg"] {
  44. color: var(--icon-hover);
  45. }
  46. &:active:not(:disabled) [data-slot="icon-svg"] {
  47. color: var(--icon-active);
  48. }
  49. }
  50. }
  51. [data-slot="list-search"] {
  52. display: flex;
  53. flex: 1;
  54. padding: 8px;
  55. align-items: center;
  56. gap: 12px;
  57. border-radius: var(--radius-md);
  58. background: var(--surface-base);
  59. [data-slot="list-search-container"] {
  60. display: flex;
  61. align-items: center;
  62. gap: 8px;
  63. flex: 1 0 0;
  64. max-height: 20px;
  65. [data-slot="list-search-input"] {
  66. width: 100%;
  67. &[data-slot="input-input"] {
  68. line-height: 20px;
  69. max-height: 20px;
  70. }
  71. }
  72. }
  73. > [data-component="icon-button"] {
  74. width: 20px;
  75. height: 20px;
  76. background-color: transparent;
  77. opacity: 0.5;
  78. transition: opacity 0.15s ease;
  79. &:hover:not(:disabled),
  80. &:focus-visible:not(:disabled),
  81. &:active:not(:disabled) {
  82. background-color: transparent;
  83. opacity: 0.7;
  84. }
  85. &:hover:not(:disabled) [data-slot="icon-svg"] {
  86. color: var(--icon-hover);
  87. }
  88. &:active:not(:disabled) [data-slot="icon-svg"] {
  89. color: var(--icon-active);
  90. }
  91. }
  92. > [data-component="icon-button"] {
  93. background-color: transparent;
  94. &:hover:not(:disabled),
  95. &:focus:not(:disabled),
  96. &:active:not(:disabled) {
  97. background-color: transparent;
  98. }
  99. &:hover:not(:disabled) [data-slot="icon-svg"] {
  100. color: var(--icon-hover);
  101. }
  102. &:active:not(:disabled) [data-slot="icon-svg"] {
  103. color: var(--icon-active);
  104. }
  105. }
  106. }
  107. [data-slot="list-scroll"] {
  108. display: flex;
  109. flex-direction: column;
  110. gap: 12px;
  111. overflow-y: auto;
  112. overscroll-behavior: contain;
  113. mask: linear-gradient(to bottom, #ffff calc(100% - var(--bottom-fade)), #0000);
  114. animation: scroll;
  115. animation-timeline: --scroll;
  116. scroll-timeline: --scroll y;
  117. scrollbar-width: none;
  118. -ms-overflow-style: none;
  119. &::-webkit-scrollbar {
  120. display: none;
  121. }
  122. [data-slot="list-empty-state"] {
  123. display: flex;
  124. padding: 32px 48px;
  125. flex-direction: column;
  126. justify-content: center;
  127. align-items: center;
  128. gap: 8px;
  129. align-self: stretch;
  130. [data-slot="list-message"] {
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. gap: 2px;
  135. max-width: 100%;
  136. color: var(--text-weak);
  137. white-space: nowrap;
  138. /* text-14-regular */
  139. font-family: var(--font-family-sans);
  140. font-size: 14px;
  141. font-style: normal;
  142. font-weight: var(--font-weight-regular);
  143. line-height: var(--line-height-large); /* 142.857% */
  144. letter-spacing: var(--letter-spacing-normal);
  145. }
  146. [data-slot="list-filter"] {
  147. color: var(--text-strong);
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. }
  151. }
  152. [data-slot="list-group"] {
  153. position: relative;
  154. display: flex;
  155. flex-direction: column;
  156. &:last-child {
  157. padding-bottom: 12px;
  158. }
  159. [data-slot="list-header"] {
  160. display: flex;
  161. z-index: 10;
  162. padding: 8px 12px 8px 8px;
  163. justify-content: space-between;
  164. align-items: center;
  165. align-self: stretch;
  166. background: var(--surface-raised-stronger-non-alpha);
  167. position: sticky;
  168. top: 0;
  169. color: var(--text-weak);
  170. /* text-14-medium */
  171. font-family: var(--font-family-sans);
  172. font-size: 14px;
  173. font-style: normal;
  174. font-weight: var(--font-weight-medium);
  175. line-height: var(--line-height-large); /* 142.857% */
  176. letter-spacing: var(--letter-spacing-normal);
  177. &::after {
  178. content: "";
  179. position: absolute;
  180. top: 100%;
  181. left: 0;
  182. right: 0;
  183. height: 16px;
  184. background: linear-gradient(to bottom, var(--surface-raised-stronger-non-alpha), transparent);
  185. pointer-events: none;
  186. opacity: 0;
  187. transition: opacity 0.15s ease;
  188. }
  189. &[data-stuck="true"]::after {
  190. opacity: 1;
  191. }
  192. }
  193. [data-slot="list-items"] {
  194. display: flex;
  195. flex-direction: column;
  196. align-items: flex-start;
  197. align-self: stretch;
  198. [data-slot="list-item"] {
  199. display: flex;
  200. position: relative;
  201. width: 100%;
  202. padding: 6px 8px 6px 8px;
  203. align-items: center;
  204. color: var(--text-strong);
  205. scroll-margin-top: 28px;
  206. /* text-14-medium */
  207. font-family: var(--font-family-sans);
  208. font-size: 14px;
  209. font-style: normal;
  210. font-weight: var(--font-weight-medium);
  211. line-height: var(--line-height-large); /* 142.857% */
  212. letter-spacing: var(--letter-spacing-normal);
  213. [data-slot="list-item-selected-icon"] {
  214. display: inline-flex;
  215. align-items: center;
  216. justify-content: center;
  217. flex-shrink: 0;
  218. aspect-ratio: 1/1;
  219. [data-component="icon"] {
  220. color: var(--icon-strong-base);
  221. }
  222. }
  223. [data-slot="list-item-active-icon"] {
  224. display: none;
  225. align-items: center;
  226. justify-content: center;
  227. flex-shrink: 0;
  228. aspect-ratio: 1/1;
  229. [data-component="icon"] {
  230. color: var(--icon-strong-base);
  231. }
  232. }
  233. [data-slot="list-item-extra-icon"] {
  234. color: var(--icon-base);
  235. margin-left: -4px;
  236. }
  237. [data-slot="list-item-divider"] {
  238. position: absolute;
  239. bottom: 0;
  240. left: var(--list-divider-inset, 16px);
  241. right: var(--list-divider-inset, 16px);
  242. height: 1px;
  243. background: var(--border-weak-base);
  244. pointer-events: none;
  245. }
  246. [data-slot="list-item"]:last-child [data-slot="list-item-divider"] {
  247. display: none;
  248. }
  249. &[data-active="true"] {
  250. border-radius: var(--radius-md);
  251. background: var(--surface-raised-base-hover);
  252. [data-slot="list-item-active-icon"] {
  253. display: inline-flex;
  254. }
  255. [data-slot="list-item-extra-icon"] {
  256. display: block !important;
  257. color: var(--icon-strong-base) !important;
  258. }
  259. }
  260. &:active {
  261. background: var(--surface-raised-base-active);
  262. }
  263. &:focus-visible {
  264. outline: none;
  265. }
  266. }
  267. [data-slot="list-item-add"] {
  268. display: flex;
  269. position: relative;
  270. width: 100%;
  271. padding: 6px 8px 6px 8px;
  272. align-items: center;
  273. color: var(--text-strong);
  274. /* text-14-medium */
  275. font-family: var(--font-family-sans);
  276. font-size: 14px;
  277. font-style: normal;
  278. font-weight: var(--font-weight-medium);
  279. line-height: var(--line-height-large); /* 142.857% */
  280. letter-spacing: var(--letter-spacing-normal);
  281. [data-component="input"] {
  282. width: 100%;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. }