@neovici/cosmoz-input 4.1.1 → 4.3.0

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 +13 -9
  2. package/package.json +1 -1
package/dist/styles.js CHANGED
@@ -36,14 +36,13 @@ 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%);
39
40
  display: block;
40
41
  padding: var(--cosmoz-input-padding, 8px 0);
41
42
  padding-top: var(--paper-input-container_-_padding-top, 8px);
42
43
  padding-bottom: var(--paper-input-container_-_padding-bottom, 8px);
43
44
  position: relative;
44
- transition:
45
- transform 0.25s,
46
- width 0.25s;
45
+ transition: transform 0.25s, width 0.25s;
47
46
  transform-origin: left top;
48
47
  max-height: var(--cosmoz-input-max-height);
49
48
  font-size: var(--font-size);
@@ -66,6 +65,7 @@ export const styles = css `
66
65
  align-items: center;
67
66
  position: relative;
68
67
  background: var(--bg);
68
+ opacity: var(--cosmoz-input-opacity);
69
69
  border-radius: var(--cosmoz-input-border-radius);
70
70
  box-shadow: 0 0 0 var(--contour-size) var(--contour-color);
71
71
  }
@@ -99,9 +99,7 @@ export const styles = css `
99
99
  top: 0;
100
100
  left: 0;
101
101
  width: var(--cosmoz-input-label-width, 100%);
102
- transition:
103
- transform 0.25s,
104
- width 0.25s;
102
+ transition: transform 0.25s, width 0.25s;
105
103
  transform-origin: left top;
106
104
  color: var(--color);
107
105
  white-space: nowrap;
@@ -109,16 +107,22 @@ export const styles = css `
109
107
  text-overflow: ellipsis;
110
108
  text-transform: var(--cosmoz-input-label-text-transform);
111
109
  font-weight: var(--cosmoz-input-label-font-weight);
112
- padding: var(--cosmoz-input-label-padding);
113
110
  }
114
111
 
115
112
  :host([always-float-label]) label,
116
113
  #input:not(:placeholder-shown) + label {
117
- --cosmoz-input-label-padding: 0 1px;
118
- transform: translateY(calc(var(--label-scale) * -100%))
114
+ transform: translateY(
115
+ calc(var(--label-scale) * -100% + var(--label-translate-y))
116
+ )
119
117
  scale(var(--label-scale));
120
118
  background-color: var(--cosmoz-input-floating-label-bg, var(--bg));
121
119
  }
120
+
121
+ :host([always-float-label]) input,
122
+ #input:not(:placeholder-shown) {
123
+ transform: translateY(var(--label-translate-y));
124
+ }
125
+
122
126
  :host(:not(always-float-label):focus-within) #input::placeholder,
123
127
  :host(:focus-within) label {
124
128
  color: var(--focused-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-input",
3
- "version": "4.1.1",
3
+ "version": "4.3.0",
4
4
  "description": "A input web component",
5
5
  "keywords": [
6
6
  "lit-html",