@awenovations/aura 0.0.20 → 0.0.22
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/dist/form-item/form-item.svelte +1 -1
- package/dist/form-item/form-item.svelte.d.ts +2 -2
- package/dist/icons/meta.json +1 -1
- package/dist/text-field/text-field.stories.svelte +24 -0
- package/dist/text-field/text-field.svelte +55 -27
- package/dist/text-field/text-field.svelte.d.ts +1 -4
- package/dist/tokens/_variables.css +1 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@ export let error = false;
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
18
|
<style>.aura-form-item {
|
|
19
|
-
height: 35px;
|
|
19
|
+
min-height: 35px;
|
|
20
20
|
background-color: var(--aura-form-item-background-color);
|
|
21
21
|
border: 1px solid var(--aura-form-item-border-color);
|
|
22
22
|
border-radius: var(--aura-form-item-border-radius);
|
package/dist/icons/meta.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"lastGenerated":
|
|
1
|
+
{"lastGenerated":1725306192870,"icons":[{"name":"apple","size":"large"},{"name":"apple","size":"medium"},{"name":"apple","size":"small"},{"name":"arrow-circle-left","size":"large"},{"name":"arrow-circle-left","size":"medium"},{"name":"arrow-circle-left","size":"small"},{"name":"bug","size":"large"},{"name":"bug","size":"medium"},{"name":"bug","size":"small"},{"name":"caret-down","size":"large"},{"name":"caret-down","size":"medium"},{"name":"caret-down","size":"small"},{"name":"circle-plus","size":"large"},{"name":"circle-plus","size":"medium"},{"name":"circle-plus","size":"small"},{"name":"google-color","size":"large"},{"name":"google-color","size":"medium"},{"name":"google-color","size":"small"},{"name":"microsoft-color","size":"large"},{"name":"microsoft-color","size":"medium"},{"name":"microsoft-color","size":"small"},{"name":"plan","size":"large"},{"name":"plan","size":"medium"},{"name":"plan","size":"small"},{"name":"user-story","size":"large"},{"name":"user-story","size":"medium"},{"name":"user-story","size":"small"}]}
|
|
@@ -32,3 +32,27 @@ export const meta = {
|
|
|
32
32
|
<span slot="label">Label</span>
|
|
33
33
|
</TextField>
|
|
34
34
|
</Story>
|
|
35
|
+
|
|
36
|
+
<Story name="Fixed Width">
|
|
37
|
+
<TextField width="100%" placeholder="Placeholder...">
|
|
38
|
+
<span slot="label">Label</span>
|
|
39
|
+
</TextField>
|
|
40
|
+
</Story>
|
|
41
|
+
|
|
42
|
+
<Story name="Full Width">
|
|
43
|
+
<div style="display: flex; gap: 1rem;">
|
|
44
|
+
<TextField fullWidth placeholder="Placeholder...">
|
|
45
|
+
<span slot="label">Full Width</span>
|
|
46
|
+
</TextField>
|
|
47
|
+
|
|
48
|
+
<TextField placeholder="Placeholder...">
|
|
49
|
+
<span slot="label">Normal width</span>
|
|
50
|
+
</TextField>
|
|
51
|
+
</div>
|
|
52
|
+
</Story>
|
|
53
|
+
|
|
54
|
+
<Story name="Multi Line">
|
|
55
|
+
<TextField height='100px' value="Test thing" type="multi" placeholder="Placeholder...">
|
|
56
|
+
<span slot="label">Label</span>
|
|
57
|
+
</TextField>
|
|
58
|
+
</Story>
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<script>import { v4 as uuidv4 } from "uuid";
|
|
2
2
|
import classNames from "classnames";
|
|
3
3
|
import { createEventDispatcher } from "svelte";
|
|
4
|
-
import FormItem
|
|
4
|
+
import FormItem from "../form-item/form-item.svelte";
|
|
5
|
+
export let fullWidth = false;
|
|
5
6
|
export let type = "text";
|
|
6
7
|
export let value = "";
|
|
7
8
|
export let required = false;
|
|
8
9
|
export let disabled = false;
|
|
9
|
-
export let size = "normal";
|
|
10
10
|
export let showErrors = false;
|
|
11
|
-
export let mode = void 0;
|
|
12
11
|
export let width = void 0;
|
|
13
12
|
export let height = void 0;
|
|
14
13
|
export let id = uuidv4();
|
|
@@ -30,7 +29,7 @@ function onInput(e) {
|
|
|
30
29
|
}
|
|
31
30
|
</script>
|
|
32
31
|
|
|
33
|
-
<div class=
|
|
32
|
+
<div class={classNames('aura-text-field-wrapper', { fullWidth, userSetWidth: !!width })}>
|
|
34
33
|
{#if $$slots.label}
|
|
35
34
|
<label for={id} class="label">
|
|
36
35
|
<slot name="label" />
|
|
@@ -41,31 +40,50 @@ function onInput(e) {
|
|
|
41
40
|
bind:disabled
|
|
42
41
|
{width}
|
|
43
42
|
{height}
|
|
44
|
-
{size}
|
|
45
|
-
{mode}
|
|
46
43
|
error={($$slots.errors || hasErrorsInternal) && showErrors}
|
|
47
44
|
>
|
|
48
45
|
<slot name="left-icon" slot="left-icon" />
|
|
49
|
-
<div class=
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
<div class={classNames('text-field-container', { multi: type === 'multi' })}>
|
|
47
|
+
{#if type === 'multi'}
|
|
48
|
+
<textarea
|
|
49
|
+
{...$$restProps}
|
|
50
|
+
class={classNames('aura-text-field', $$restProps.class)}
|
|
51
|
+
{disabled}
|
|
52
|
+
{id}
|
|
53
|
+
style="height: 100%;"
|
|
54
|
+
bind:this={input}
|
|
55
|
+
on:change={forwardEvent}
|
|
56
|
+
on:input={onInput}
|
|
57
|
+
on:input={forwardEvent}
|
|
58
|
+
on:focus={forwardEvent}
|
|
59
|
+
on:blur={forwardEvent}
|
|
60
|
+
on:keydown={forwardEvent}
|
|
61
|
+
on:keypress={forwardEvent}
|
|
62
|
+
on:keyup={forwardEvent}
|
|
63
|
+
on:focusin={forwardEvent}
|
|
64
|
+
on:focusout={forwardEvent}>{value}</textarea
|
|
65
|
+
>
|
|
66
|
+
{:else}
|
|
67
|
+
<input
|
|
68
|
+
{...$$restProps}
|
|
69
|
+
class={classNames('aura-text-field', $$restProps.class)}
|
|
70
|
+
{disabled}
|
|
71
|
+
{type}
|
|
72
|
+
{value}
|
|
73
|
+
{id}
|
|
74
|
+
bind:this={input}
|
|
75
|
+
on:change={forwardEvent}
|
|
76
|
+
on:input={onInput}
|
|
77
|
+
on:input={forwardEvent}
|
|
78
|
+
on:focus={forwardEvent}
|
|
79
|
+
on:blur={forwardEvent}
|
|
80
|
+
on:keydown={forwardEvent}
|
|
81
|
+
on:keypress={forwardEvent}
|
|
82
|
+
on:keyup={forwardEvent}
|
|
83
|
+
on:focusin={forwardEvent}
|
|
84
|
+
on:focusout={forwardEvent}
|
|
85
|
+
/>
|
|
86
|
+
{/if}
|
|
69
87
|
<div class="extra">
|
|
70
88
|
<slot name="extra" />
|
|
71
89
|
</div>
|
|
@@ -78,7 +96,11 @@ function onInput(e) {
|
|
|
78
96
|
{/if}
|
|
79
97
|
</div>
|
|
80
98
|
|
|
81
|
-
<style>.
|
|
99
|
+
<style>.multi {
|
|
100
|
+
height: 100%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.aura-text-field {
|
|
82
104
|
all: unset;
|
|
83
105
|
width: 100%;
|
|
84
106
|
text-align: initial;
|
|
@@ -93,6 +115,12 @@ function onInput(e) {
|
|
|
93
115
|
display: flex;
|
|
94
116
|
flex-direction: column;
|
|
95
117
|
}
|
|
118
|
+
.aura-text-field-wrapper:not(.fullWidth):not(.userSetWidth) {
|
|
119
|
+
max-width: 400px;
|
|
120
|
+
}
|
|
121
|
+
.aura-text-field-wrapper.fullWidth {
|
|
122
|
+
flex: 1;
|
|
123
|
+
}
|
|
96
124
|
.aura-text-field-wrapper label {
|
|
97
125
|
text-align: left;
|
|
98
126
|
}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import { type Mode } from '../form-item/form-item.svelte';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: Omit<import("svelte/elements").HTMLInputAttributes, "class" | "size" | "value" | "id" | `on:${string}` | "type"> & {
|
|
5
|
-
type?: "number" | "text" | "search" | "time" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "password" | "range" | "tel" | "url" | "week";
|
|
4
|
+
type?: "number" | "text" | "search" | "time" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "month" | "password" | "range" | "tel" | "url" | "week" | "multi";
|
|
6
5
|
value?: string | number | boolean;
|
|
7
|
-
size?: any;
|
|
8
6
|
showErrors?: boolean;
|
|
9
|
-
mode?: Mode | undefined;
|
|
10
7
|
};
|
|
11
8
|
events: {
|
|
12
9
|
change: CustomEvent<{
|