@likable-hair/svelte 0.0.36 → 0.0.37
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.
- package/forms/Textfield.svelte +8 -4
- package/package.json +1 -1
package/forms/Textfield.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script >export let label = "", placeholder = "", color =
|
|
1
|
+
<script >export let label = "", placeholder = "", color = null, value = "", variant = 'outlined', width = "100%", textColor = "black", borderWeight = "2px", borderRadius = "5px", borderColor = null, focusBorderColor = null, focusedBoxShadow = undefined, backgroundColor = null, padding = undefined, paddingLeft = undefined, paddingRight = undefined, paddingBottom = undefined, paddingTop = undefined, fontSize = undefined, type = 'text';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
3
|
import { onMount } from 'svelte';
|
|
4
4
|
let inputId = uuidv4(), focused = false, legendWidth = 0, labelElement = undefined;
|
|
@@ -23,6 +23,7 @@ $: if (!!labelElement) {
|
|
|
23
23
|
height: 50px;
|
|
24
24
|
position: relative;
|
|
25
25
|
--textfield-final-color: var(--textfield-theme-color, --textfield-border-color, rgb(88, 88, 88));
|
|
26
|
+
--textfield-final-border-color: var(--textfield-border-color, var(--textfield-final-color))
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/* outlined input */
|
|
@@ -44,7 +45,7 @@ $: if (!!labelElement) {
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
.focused .fieldset-outlined {
|
|
47
|
-
border: var(--textfield-border-weight) solid var(--textfield-final-color);
|
|
48
|
+
border: var(--textfield-border-weight) solid var(--textfield-final-border-color);
|
|
48
49
|
color: var(--textfield-final-color);
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -74,11 +75,14 @@ $: if (!!labelElement) {
|
|
|
74
75
|
/* boxed input */
|
|
75
76
|
|
|
76
77
|
.fieldset-boxed {
|
|
77
|
-
border: var(--textfield-border-weight) solid var(--textfield-final-color);
|
|
78
78
|
padding: 5px;
|
|
79
79
|
transition: border 0.3s ease, box-shadow 0.3s ease;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
.not-focused .fieldset-boxed {
|
|
83
|
+
border: var(--textfield-border-weight) solid var(--textfield-final-border-color);
|
|
84
|
+
}
|
|
85
|
+
|
|
82
86
|
.focused .fieldset-boxed {
|
|
83
87
|
border: var(--textfield-border-weight) solid var(--textfield-focus-border-color, var(--textfield-final-color));
|
|
84
88
|
box-shadow: var(--textfield-focused-box-shadow);
|
|
@@ -115,12 +119,12 @@ $: if (!!labelElement) {
|
|
|
115
119
|
style:--textfield-focused-box-shadow={focusedBoxShadow}
|
|
116
120
|
class="input-container"
|
|
117
121
|
class:focused={focused}
|
|
122
|
+
class:not-focused={!focused}
|
|
118
123
|
class:texted={focused || !!value}
|
|
119
124
|
>
|
|
120
125
|
<fieldset
|
|
121
126
|
aria-hidden="true"
|
|
122
127
|
style:border-radius={borderRadius}
|
|
123
|
-
style:border-color={borderColor}
|
|
124
128
|
style:background-color={backgroundColor}
|
|
125
129
|
style:padding={padding}
|
|
126
130
|
style:padding-left={paddingLeft}
|