text-field.css 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 {
  45. /* border/shadow-xs/select */
  46. box-shadow:
  47. 0 0 0 3px var(--border-weak-selected),
  48. 0 0 0 1px var(--border-selected),
  49. 0 1px 2px -1px rgba(19, 16, 16, 0.25),
  50. 0 1px 2px 0 rgba(19, 16, 16, 0.08),
  51. 0 1px 3px 0 rgba(19, 16, 16, 0.12);
  52. }
  53. &:has([data-invalid]) {
  54. background: var(--surface-critical-weak);
  55. border: 1px solid var(--border-critical-selected);
  56. }
  57. &:not(:has([data-slot="input-copy-button"])) {
  58. padding-right: 0;
  59. }
  60. }
  61. [data-slot="input-input"] {
  62. color: var(--text-strong);
  63. display: flex;
  64. height: 32px;
  65. padding: 2px 12px;
  66. align-items: center;
  67. flex: 1;
  68. min-width: 0;
  69. background: transparent;
  70. border: none;
  71. /* text-14-regular */
  72. font-family: var(--font-family-sans);
  73. font-size: 14px;
  74. font-style: normal;
  75. font-weight: var(--font-weight-regular);
  76. line-height: var(--line-height-large); /* 142.857% */
  77. letter-spacing: var(--letter-spacing-normal);
  78. &:focus {
  79. outline: none;
  80. }
  81. &::placeholder {
  82. color: var(--text-weak);
  83. }
  84. }
  85. textarea[data-slot="input-input"] {
  86. height: auto;
  87. min-height: 32px;
  88. padding: 6px 12px;
  89. resize: none;
  90. }
  91. [data-slot="input-copy-button"] {
  92. flex-shrink: 0;
  93. margin-top: 4px;
  94. color: var(--icon-base);
  95. &:hover {
  96. color: var(--icon-strong-base);
  97. }
  98. }
  99. [data-slot="input-error"] {
  100. color: var(--text-on-critical-base);
  101. /* text-12-medium */
  102. font-family: var(--font-family-sans);
  103. font-size: var(--font-size-small);
  104. font-style: normal;
  105. font-weight: var(--font-weight-medium);
  106. line-height: 18px; /* 150% */
  107. letter-spacing: var(--letter-spacing-normal);
  108. }
  109. }
  110. }