@likable-hair/svelte 0.0.36 → 0.0.39
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/Switch.svelte
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script >export let value = false, height = "20px", width = "40px", padding = "6px", borderRadius = "10px", toggleActiveColor = "#5c5c5c", toggleDeactiveColor = "#5c5c5c", backgroundActiveColor = "#e6e6e6", backgroundDeactiveColor = "#e6e6e6", animationDuration = "0.1s";
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
|
-
<
|
|
4
|
+
<div
|
|
5
5
|
style:--switch-toggle-active-color={toggleActiveColor}
|
|
6
6
|
style:--switch-toggle-deactive-color={toggleDeactiveColor}
|
|
7
7
|
style:--switch-animation-duration={animationDuration}
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
<input
|
|
20
20
|
bind:checked={value}
|
|
21
21
|
type="checkbox"
|
|
22
|
+
on:change
|
|
22
23
|
>
|
|
23
24
|
<span
|
|
24
25
|
class="slider"
|
|
25
26
|
></span>
|
|
26
27
|
</div>
|
|
27
|
-
</
|
|
28
|
+
</div>
|
|
28
29
|
|
|
29
30
|
<style>
|
|
30
31
|
.container {
|
package/forms/Switch.svelte.d.ts
CHANGED
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}
|
|
@@ -164,6 +168,9 @@ $: if (!!labelElement) {
|
|
|
164
168
|
on:focus
|
|
165
169
|
on:blur={handleBlur}
|
|
166
170
|
on:blur
|
|
171
|
+
on:keydown
|
|
172
|
+
on:keypress
|
|
173
|
+
on:keyup
|
|
167
174
|
/>
|
|
168
175
|
{:else if type == 'text'}
|
|
169
176
|
<input
|
|
@@ -181,6 +188,9 @@ $: if (!!labelElement) {
|
|
|
181
188
|
on:focus
|
|
182
189
|
on:blur={handleBlur}
|
|
183
190
|
on:blur
|
|
191
|
+
on:keydown
|
|
192
|
+
on:keypress
|
|
193
|
+
on:keyup
|
|
184
194
|
/>
|
|
185
195
|
{/if}
|
|
186
196
|
<div>
|
|
@@ -210,6 +220,9 @@ $: if (!!labelElement) {
|
|
|
210
220
|
on:focus
|
|
211
221
|
on:blur={handleBlur}
|
|
212
222
|
on:blur
|
|
223
|
+
on:keydown
|
|
224
|
+
on:keypress
|
|
225
|
+
on:keyup
|
|
213
226
|
/>
|
|
214
227
|
{:else if type == 'text'}
|
|
215
228
|
<input
|
|
@@ -227,6 +240,9 @@ $: if (!!labelElement) {
|
|
|
227
240
|
on:focus
|
|
228
241
|
on:blur={handleBlur}
|
|
229
242
|
on:blur
|
|
243
|
+
on:keydown
|
|
244
|
+
on:keypress
|
|
245
|
+
on:keyup
|
|
230
246
|
/>
|
|
231
247
|
{/if}
|
|
232
248
|
<div>
|