@apolitical/component-library 6.6.10 → 6.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,13 +9,17 @@ $field: (
9
9
  'border-radius': 8,
10
10
  );
11
11
  $autoresize: (
12
- 'height': 60,
12
+ 'height': 42,
13
13
  );
14
14
  $character-limit: (
15
+ 'max-width': 65,
16
+ 'padding-horizontal': 16,
15
17
  'padding-bottom': 28,
16
18
  );
17
19
 
18
20
  @mixin field-styling {
21
+ @include transition(padding-bottom, 0.5s);
22
+
19
23
  background: get-map($theme, 'form_input_bg');
20
24
  color: get-map($theme, 'form_input');
21
25
  border: px-to-rem(get-map($field, 'border')) solid get-map($theme, 'form_input_border');
@@ -51,19 +55,34 @@ $character-limit: (
51
55
  color: get-map($theme, 'form_input');
52
56
  line-height: px-to-rem(get-map($field, 'line-height'));
53
57
 
54
- &[data-character-limit] {
55
- padding-bottom: px-to-rem(get-map($character-limit, 'padding-bottom'));
56
- }
57
-
58
58
  &.autoresize {
59
59
  @include transition(height, 0.5s);
60
60
 
61
+ min-height: px-to-rem(get-map($autoresize, 'height'));
61
62
  overflow: hidden;
62
63
 
63
- &:empty {
64
+ &:empty,
65
+ &.single-line {
64
66
  // This is to override the inline styles for the height
65
67
  height: px-to-rem(get-map($autoresize, 'height')) !important;
66
68
  }
69
+
70
+ &[data-character-limit] {
71
+ &:focus,
72
+ &:focus-within {
73
+ padding-right: px-to-rem(
74
+ get-map($character-limit, 'max-width') +
75
+ get-map($character-limit, 'padding-horizontal')
76
+ );
77
+ }
78
+ }
79
+ }
80
+
81
+ &:not(.autoresize)[data-character-limit] {
82
+ &:focus,
83
+ &:focus-within {
84
+ padding-bottom: px-to-rem(get-map($character-limit, 'padding-bottom'));
85
+ }
67
86
  }
68
87
 
69
88
  // Remove default styling, for consistency