text-field.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. [data-component="input"] {
  2. width: 100%;
  3. [data-slot="input-input"] {
  4. width: 100%;
  5. color: var(--text-strong);
  6. /* text-14-regular */
  7. font-family: var(--font-family-sans);
  8. font-size: 14px;
  9. font-style: normal;
  10. font-weight: var(--font-weight-regular);
  11. line-height: var(--line-height-large); /* 142.857% */
  12. letter-spacing: var(--letter-spacing-normal);
  13. &:focus {
  14. outline: none;
  15. }
  16. &::placeholder {
  17. color: var(--text-weak);
  18. }
  19. }
  20. &[data-variant="normal"] {
  21. display: flex;
  22. flex-direction: column;
  23. align-items: flex-start;
  24. gap: 8px;
  25. [data-slot="input-label"] {
  26. color: var(--text-weak);
  27. /* text-12-medium */
  28. font-family: var(--font-family-sans);
  29. font-size: var(--font-size-small);
  30. font-style: normal;
  31. font-weight: var(--font-weight-medium);
  32. line-height: 18px; /* 150% */
  33. letter-spacing: var(--letter-spacing-normal);
  34. }
  35. [data-slot="input-wrapper"] {
  36. display: flex;
  37. align-items: start;
  38. justify-content: space-between;
  39. width: 100%;
  40. padding-right: 4px;
  41. border-radius: var(--radius-md);
  42. border: 1px solid var(--border-weak-base);
  43. background: var(--input-base);
  44. &:focus-within:not(:has([data-readonly])) {
  45. border-color: transparent;
  46. /* border/shadow-xs/select */
  47. box-shadow:
  48. 0 0 0 3px var(--border-weak-selected),
  49. 0 0 0 1px var(--border-selected),
  50. 0 1px 2px -1px rgba(19, 16, 16, 0.25),
  51. 0 1px 2px 0 rgba(19, 16, 16, 0.08),
  52. 0 1px 3px 0 rgba(19, 16, 16, 0.12);
  53. }
  54. &:has([data-invalid]) {
  55. background: var(--surface-critical-weak);
  56. border: 1px solid var(--border-critical-selected);
  57. }
  58. &:not(:has([data-slot="input-copy-button"])) {
  59. padding-right: 0;
  60. }
  61. }
  62. [data-slot="input-input"] {
  63. color: var(--text-strong);
  64. display: flex;
  65. height: 32px;
  66. padding: 2px 12px;
  67. align-items: center;
  68. flex: 1;
  69. min-width: 0;
  70. background: transparent;
  71. border: none;
  72. /* text-14-regular */
  73. font-family: var(--font-family-sans);
  74. font-size: 14px;
  75. font-style: normal;
  76. font-weight: var(--font-weight-regular);
  77. line-height: var(--line-height-large); /* 142.857% */
  78. letter-spacing: var(--letter-spacing-normal);
  79. &:focus {
  80. outline: none;
  81. }
  82. &::placeholder {
  83. color: var(--text-weak);
  84. }
  85. }
  86. textarea[data-slot="input-input"] {
  87. height: auto;
  88. min-height: 32px;
  89. padding: 6px 12px;
  90. resize: none;
  91. }
  92. [data-slot="input-copy-button"] {
  93. flex-shrink: 0;
  94. margin-top: 4px;
  95. color: var(--icon-base);
  96. &:hover {
  97. color: var(--icon-strong-base);
  98. }
  99. }
  100. [data-slot="input-error"] {
  101. color: var(--text-on-critical-base);
  102. /* text-12-medium */
  103. font-family: var(--font-family-sans);
  104. font-size: var(--font-size-small);
  105. font-style: normal;
  106. font-weight: var(--font-weight-medium);
  107. line-height: 18px; /* 150% */
  108. letter-spacing: var(--letter-spacing-normal);
  109. }
  110. }
  111. }