@neovici/cosmoz-input 4.2.0 → 4.3.1

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.
Files changed (2) hide show
  1. package/dist/styles.js +14 -10
  2. package/package.json +1 -1
package/dist/styles.js CHANGED
@@ -3,7 +3,7 @@ export const styles = css `
3
3
  :host {
4
4
  --font-family: var(
5
5
  --cosmoz-input-font-family,
6
- var(--paper-font-subhead_-_font-family, 'Roboto', 'Noto', sans-serif)
6
+ var(--paper-font-subhead_-_font-family, inherit)
7
7
  );
8
8
  --font-size: var(
9
9
  --cosmoz-input-font-size,
@@ -36,14 +36,14 @@ export const styles = css `
36
36
  );
37
37
  --contour-color: var(--line-color);
38
38
  --contour-size: var(--cosmoz-input-contour-size);
39
+ --label-translate-y: var(--cosmoz-input-label-translate-y, 0%);
40
+
39
41
  display: block;
40
42
  padding: var(--cosmoz-input-padding, 8px 0);
41
43
  padding-top: var(--paper-input-container_-_padding-top, 8px);
42
44
  padding-bottom: var(--paper-input-container_-_padding-bottom, 8px);
43
45
  position: relative;
44
- transition:
45
- transform 0.25s,
46
- width 0.25s;
46
+ transition: transform 0.25s, width 0.25s;
47
47
  transform-origin: left top;
48
48
  max-height: var(--cosmoz-input-max-height);
49
49
  font-size: var(--font-size);
@@ -100,9 +100,7 @@ export const styles = css `
100
100
  top: 0;
101
101
  left: 0;
102
102
  width: var(--cosmoz-input-label-width, 100%);
103
- transition:
104
- transform 0.25s,
105
- width 0.25s;
103
+ transition: transform 0.25s, width 0.25s;
106
104
  transform-origin: left top;
107
105
  color: var(--color);
108
106
  white-space: nowrap;
@@ -110,16 +108,22 @@ export const styles = css `
110
108
  text-overflow: ellipsis;
111
109
  text-transform: var(--cosmoz-input-label-text-transform);
112
110
  font-weight: var(--cosmoz-input-label-font-weight);
113
- padding: var(--cosmoz-input-label-padding);
114
111
  }
115
112
 
116
113
  :host([always-float-label]) label,
117
114
  #input:not(:placeholder-shown) + label {
118
- --cosmoz-input-label-padding: 0 1px;
119
- transform: translateY(calc(var(--label-scale) * -100%))
115
+ transform: translateY(
116
+ calc(var(--label-scale) * -100% + var(--label-translate-y))
117
+ )
120
118
  scale(var(--label-scale));
121
119
  background-color: var(--cosmoz-input-floating-label-bg, var(--bg));
122
120
  }
121
+
122
+ :host([always-float-label]) input,
123
+ #input:not(:placeholder-shown) {
124
+ transform: translateY(var(--label-translate-y));
125
+ }
126
+
123
127
  :host(:not(always-float-label):focus-within) #input::placeholder,
124
128
  :host(:focus-within) label {
125
129
  color: var(--focused-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-input",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "description": "A input web component",
5
5
  "keywords": [
6
6
  "lit-html",