y200subcontrols 0.0.25 → 0.0.27
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/README.md +3 -55
- package/dist/components/Alert.svelte +56 -0
- package/dist/components/Alert.svelte.d.ts +22 -0
- package/dist/components/Button.svelte.d.ts +2 -1
- package/dist/components/Form.svelte +3 -3
- package/dist/components/Form.svelte.d.ts +2 -0
- package/dist/components/LabeledFormInput.svelte +134 -0
- package/dist/components/LabeledFormInput.svelte.d.ts +43 -0
- package/dist/components/LabeledPasswordInput.svelte +118 -0
- package/dist/components/LabeledPasswordInput.svelte.d.ts +31 -0
- package/dist/components/types.d.ts +1 -0
- package/dist/components/types.js +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,58 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
UI Library using sveltekit and tailwindcss
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
In your tailwind.config.js file add the following to content
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
'./node_modules/y200subcontrols/**/*.{html,js,svelte,ts}'
|
|
6
6
|
|
|
7
|
-
## Creating a project
|
|
8
|
-
|
|
9
|
-
If you're seeing this, you've probably already done this step. Congrats!
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
# create a new project in the current directory
|
|
13
|
-
npm create svelte@latest
|
|
14
|
-
|
|
15
|
-
# create a new project in my-app
|
|
16
|
-
npm create svelte@latest my-app
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Developing
|
|
20
|
-
|
|
21
|
-
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm run dev
|
|
25
|
-
|
|
26
|
-
# or start the server and open the app in a new browser tab
|
|
27
|
-
npm run dev -- --open
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
31
|
-
|
|
32
|
-
## Building
|
|
33
|
-
|
|
34
|
-
To build your library:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
npm run package
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
To create a production version of your showcase app:
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
npm run build
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
You can preview the production build with `npm run preview`.
|
|
47
|
-
|
|
48
|
-
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
|
|
49
|
-
|
|
50
|
-
## Publishing
|
|
51
|
-
|
|
52
|
-
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
53
|
-
|
|
54
|
-
To publish your library to [npm](https://www.npmjs.com):
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npm publish
|
|
58
|
-
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script>import { createEventDispatcher, onMount } from "svelte";
|
|
2
|
+
export let alertType = "info";
|
|
3
|
+
export let dismissable = true;
|
|
4
|
+
export let alertText;
|
|
5
|
+
let alert;
|
|
6
|
+
const dispatch = createEventDispatcher();
|
|
7
|
+
function dismissAlert() {
|
|
8
|
+
alert.style.borderWidth = "0";
|
|
9
|
+
alert.style.gridTemplateRows = "0fr";
|
|
10
|
+
setTimeout(() => {
|
|
11
|
+
dispatch("dismissed");
|
|
12
|
+
}, 300);
|
|
13
|
+
}
|
|
14
|
+
onMount(() => {
|
|
15
|
+
setTimeout(() => {
|
|
16
|
+
alert.style.gridTemplateRows = "1fr";
|
|
17
|
+
}, 10);
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
bind:this={alert}
|
|
23
|
+
class="grid border rounded transition-all ease-linear duration-300
|
|
24
|
+
{alertType === 'error' ? 'bg-red-100 text-red-700 border-red-600' : ''}
|
|
25
|
+
{alertType === 'info' ? 'bg-blue-100 text-blue-600 border-blue-600' : ''}
|
|
26
|
+
{alertType === 'warning' ? 'bg-orange-100 text-orange-700 border-orange-700' : ''}
|
|
27
|
+
{alertType === 'success' ? 'bg-green-100 text-green-700 border-green-700' : ''}
|
|
28
|
+
"
|
|
29
|
+
style="grid-template-rows: 0fr"
|
|
30
|
+
>
|
|
31
|
+
<div class="overflow-hidden">
|
|
32
|
+
<div class="p-2 flex space-x-1">
|
|
33
|
+
<div class="my-auto text-2xl">
|
|
34
|
+
{#if alertType === 'error' || alertType === 'warning'}
|
|
35
|
+
<i class="bi bi-exclamation-triangle"></i>
|
|
36
|
+
{:else if alertType === 'info'}
|
|
37
|
+
<i class="bi bi-info-circle"></i>
|
|
38
|
+
{:else if alertType === 'success'}
|
|
39
|
+
<i class="bi bi-check2-circle"></i>
|
|
40
|
+
{/if}
|
|
41
|
+
</div>
|
|
42
|
+
<div class="my-auto text-center flex-grow">
|
|
43
|
+
{alertText}
|
|
44
|
+
</div>
|
|
45
|
+
{#if dismissable}
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
class=" text-slate-500 hover:text-slate-800 mb-auto"
|
|
49
|
+
on:click={dismissAlert}
|
|
50
|
+
>
|
|
51
|
+
<i class="bi bi-x-lg"></i>
|
|
52
|
+
</button>
|
|
53
|
+
{/if}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
alertType?: "error" | "warning" | "success" | "info";
|
|
5
|
+
dismissable?: boolean;
|
|
6
|
+
alertText: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
dismissed: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
exports?: {} | undefined;
|
|
15
|
+
bindings?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
export type AlertProps = typeof __propDef.props;
|
|
18
|
+
export type AlertEvents = typeof __propDef.events;
|
|
19
|
+
export type AlertSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Alert extends SvelteComponent<AlertProps, AlertEvents, AlertSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Size } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
type?: "submit" | "reset" | "button";
|
|
5
6
|
buttonStyle?: "red" | "dark" | "indigo" | "teal" | "blue";
|
|
6
|
-
buttonSize?:
|
|
7
|
+
buttonSize?: Size;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
customCss?: string;
|
|
9
10
|
isLoading?: boolean;
|
|
@@ -8,7 +8,7 @@ export let defaultButtonContent = "Save changes";
|
|
|
8
8
|
export let extendedCss = "";
|
|
9
9
|
export let isCard = true;
|
|
10
10
|
export let id = void 0;
|
|
11
|
-
let
|
|
11
|
+
export let buttonSize = "md";
|
|
12
12
|
let dispatch = createEventDispatcher();
|
|
13
13
|
function handleSubmit(event) {
|
|
14
14
|
event.preventDefault();
|
|
@@ -27,7 +27,7 @@ function handleSubmit(event) {
|
|
|
27
27
|
}
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
|
-
<Card stylingDisabled={!isCard}
|
|
30
|
+
<Card stylingDisabled={!isCard} {extendedCss}>
|
|
31
31
|
<slot slot="title" name="title" />
|
|
32
32
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
33
33
|
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
@@ -37,7 +37,7 @@ function handleSubmit(event) {
|
|
|
37
37
|
</div>
|
|
38
38
|
<slot name="buttons">
|
|
39
39
|
<div class="my-2 grid">
|
|
40
|
-
<Button type="submit" {isLoading}>
|
|
40
|
+
<Button type="submit" {isLoading} {buttonSize}>
|
|
41
41
|
<span>{@html defaultButtonContent}</span>
|
|
42
42
|
</Button>
|
|
43
43
|
</div>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Size } from './types.js';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
isLoading?: boolean;
|
|
@@ -7,6 +8,7 @@ declare const __propDef: {
|
|
|
7
8
|
extendedCss?: string;
|
|
8
9
|
isCard?: boolean;
|
|
9
10
|
id?: string | undefined;
|
|
11
|
+
buttonSize?: Size;
|
|
10
12
|
};
|
|
11
13
|
events: {
|
|
12
14
|
click: MouseEvent;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script>import { onMount, createEventDispatcher } from "svelte";
|
|
2
|
+
export let size = "lg";
|
|
3
|
+
export let labelText = void 0;
|
|
4
|
+
export let id = void 0;
|
|
5
|
+
export let readonly = false;
|
|
6
|
+
export let required = false;
|
|
7
|
+
export let value = void 0;
|
|
8
|
+
export let name = void 0;
|
|
9
|
+
export let placeholder = void 0;
|
|
10
|
+
export let validationText = "This field is required";
|
|
11
|
+
export let autocomplete = "off";
|
|
12
|
+
export let input = void 0;
|
|
13
|
+
export let autoApplyCss = false;
|
|
14
|
+
export let customCss = "";
|
|
15
|
+
export let visible = true;
|
|
16
|
+
export let numeric = false;
|
|
17
|
+
export let allowZero = false;
|
|
18
|
+
export let disabled = false;
|
|
19
|
+
const dispatch = createEventDispatcher();
|
|
20
|
+
export let isValid = true;
|
|
21
|
+
let inputContainer;
|
|
22
|
+
function validateElement(event) {
|
|
23
|
+
if (input.dataset.validated !== "true") {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
isValid = input.checkValidity();
|
|
27
|
+
if (input.type === "number") {
|
|
28
|
+
if (!allowZero && value === 0 && required) {
|
|
29
|
+
isValid = false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
dispatch("validated", isValid);
|
|
33
|
+
}
|
|
34
|
+
onMount(() => {
|
|
35
|
+
if (id === void 0) {
|
|
36
|
+
let r = (Math.random() + 1).toString(36).substring(2);
|
|
37
|
+
id = `input${r}`;
|
|
38
|
+
}
|
|
39
|
+
let elem = inputContainer.querySelector("input");
|
|
40
|
+
if (elem) {
|
|
41
|
+
elem.dataset.requiresValidation = "true";
|
|
42
|
+
input = elem;
|
|
43
|
+
elem.addEventListener("change", validateElement);
|
|
44
|
+
elem.addEventListener("validate--custom", validateElement);
|
|
45
|
+
if (id) {
|
|
46
|
+
elem.id = id;
|
|
47
|
+
}
|
|
48
|
+
let _input = elem;
|
|
49
|
+
if (_input) {
|
|
50
|
+
_input.name = name ?? "";
|
|
51
|
+
_input.placeholder = placeholder ?? "";
|
|
52
|
+
}
|
|
53
|
+
if (autoApplyCss) {
|
|
54
|
+
elem.className = `border peer block w-full py-1 px-2 rounded-md shadow-sm bg-white text-neutral-900
|
|
55
|
+
focus:outline-none focus:ring read-only:bg-neutral-100
|
|
56
|
+
placeholder:text-sm placeholder:font-thin
|
|
57
|
+
dark:bg-slate-900 dark:text-neutral-100
|
|
58
|
+
${!isValid ? "border-pink-600 dark:border-pink-500 focus:ring-pink-600/20 dark:focus:ring-pink-600/40" : "dark:border-slate-600 border-slate-300 focus:ring-blue-500/20 dark:focus:ring-blue-500/30"} ${customCss}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (numeric && input) {
|
|
62
|
+
input.type = "number";
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<div class={visible ? '' : 'hidden'}>
|
|
68
|
+
{#if labelText}
|
|
69
|
+
<label
|
|
70
|
+
for={id}
|
|
71
|
+
class="inline-block mb-1 text-slate-600 dark:text-neutral-200 font-thin text-lg"
|
|
72
|
+
>
|
|
73
|
+
{labelText}
|
|
74
|
+
{#if required}
|
|
75
|
+
*
|
|
76
|
+
{/if}
|
|
77
|
+
</label>
|
|
78
|
+
{/if}
|
|
79
|
+
<div bind:this={inputContainer}>
|
|
80
|
+
<slot>
|
|
81
|
+
<input
|
|
82
|
+
bind:this={input}
|
|
83
|
+
{disabled}
|
|
84
|
+
{id}
|
|
85
|
+
type="text"
|
|
86
|
+
{required}
|
|
87
|
+
{autocomplete}
|
|
88
|
+
class="border peer block w-full rounded shadow-sm bg-white text-neutral-900
|
|
89
|
+
{size === 'sm' ? 'py-1 px-2 text-sm' : ''}
|
|
90
|
+
{size === 'md' ? 'py-1.5 px-2 text-base' : ''}
|
|
91
|
+
{size === 'lg' ? 'py-2 px-2 text-lg' : ''}
|
|
92
|
+
focus:outline-none focus:ring
|
|
93
|
+
read-only:bg-neutral-100
|
|
94
|
+
dark:read-only:bg-neutral-800
|
|
95
|
+
placeholder:text-sm placeholder:font-thin
|
|
96
|
+
dark:bg-slate-900 dark:text-neutral-100 {numeric ? 'hide-browser-appearance' : ''}
|
|
97
|
+
{!isValid
|
|
98
|
+
? 'border-pink-600 dark:border-pink-500 focus:ring-pink-600/20 dark:focus:ring-pink-600/40'
|
|
99
|
+
: 'dark:border-slate-600 border-slate-300 focus:ring-teal-500/20 dark:focus:ring-teal-500/30'}
|
|
100
|
+
{customCss}"
|
|
101
|
+
bind:value
|
|
102
|
+
{placeholder}
|
|
103
|
+
{name}
|
|
104
|
+
on:change
|
|
105
|
+
on:keydown
|
|
106
|
+
on:keyup
|
|
107
|
+
{readonly}
|
|
108
|
+
step={numeric ? 'any' : undefined}
|
|
109
|
+
/>
|
|
110
|
+
</slot>
|
|
111
|
+
</div>
|
|
112
|
+
|
|
113
|
+
{#if validationText && !isValid}
|
|
114
|
+
<div class="text-xs text-pink-600 dark:text-pink-500 my-1">
|
|
115
|
+
{validationText}
|
|
116
|
+
</div>
|
|
117
|
+
{/if}
|
|
118
|
+
</div>
|
|
119
|
+
|
|
120
|
+
<style>
|
|
121
|
+
.hide-browser-appearance {
|
|
122
|
+
/* -moz-appearance: textfield; */
|
|
123
|
+
-webkit-appearance: none;
|
|
124
|
+
-moz-appearance: none;
|
|
125
|
+
appearance: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.hide-browser-appearance::-webkit-outer-spin-button,
|
|
129
|
+
.hide-browser-appearance::-webkit-inner-spin-button {
|
|
130
|
+
/* -webkit-appearance: none; */
|
|
131
|
+
-webkit-appearance: none;
|
|
132
|
+
appearance: none;
|
|
133
|
+
}
|
|
134
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Size } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
size?: Size;
|
|
6
|
+
labelText?: string | undefined;
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
value?: string | number | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
validationText?: string | undefined;
|
|
14
|
+
autocomplete?: string | undefined;
|
|
15
|
+
input?: HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | any | undefined;
|
|
16
|
+
autoApplyCss?: boolean;
|
|
17
|
+
customCss?: string;
|
|
18
|
+
visible?: boolean;
|
|
19
|
+
numeric?: boolean;
|
|
20
|
+
allowZero?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
isValid?: boolean;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
change: Event;
|
|
26
|
+
keydown: KeyboardEvent;
|
|
27
|
+
keyup: KeyboardEvent;
|
|
28
|
+
validated: CustomEvent<any>;
|
|
29
|
+
} & {
|
|
30
|
+
[evt: string]: CustomEvent<any>;
|
|
31
|
+
};
|
|
32
|
+
slots: {
|
|
33
|
+
default: {};
|
|
34
|
+
};
|
|
35
|
+
exports?: {} | undefined;
|
|
36
|
+
bindings?: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
export type LabeledFormInputProps = typeof __propDef.props;
|
|
39
|
+
export type LabeledFormInputEvents = typeof __propDef.events;
|
|
40
|
+
export type LabeledFormInputSlots = typeof __propDef.slots;
|
|
41
|
+
export default class LabeledFormInput extends SvelteComponent<LabeledFormInputProps, LabeledFormInputEvents, LabeledFormInputSlots> {
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script>import { onMount } from "svelte";
|
|
2
|
+
import LabeledFormInput from "./LabeledFormInput.svelte";
|
|
3
|
+
export let size = "lg";
|
|
4
|
+
export let labelText = void 0;
|
|
5
|
+
export let id = void 0;
|
|
6
|
+
export let readonly = false;
|
|
7
|
+
export let required = true;
|
|
8
|
+
export let value = void 0;
|
|
9
|
+
export let name = void 0;
|
|
10
|
+
export let placeholder = void 0;
|
|
11
|
+
export let validationText = void 0;
|
|
12
|
+
export let customCss = "";
|
|
13
|
+
export let customValidation = void 0;
|
|
14
|
+
let input;
|
|
15
|
+
let isValid = true;
|
|
16
|
+
let inputType = "password";
|
|
17
|
+
function handleValidated(event) {
|
|
18
|
+
console.log(event.detail);
|
|
19
|
+
if (customValidation) {
|
|
20
|
+
isValid = event.detail && customValidation();
|
|
21
|
+
} else {
|
|
22
|
+
isValid = event.detail;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function toggleInputType() {
|
|
26
|
+
inputType = inputType === "password" ? "text" : "password";
|
|
27
|
+
input.type = inputType;
|
|
28
|
+
input.focus();
|
|
29
|
+
}
|
|
30
|
+
onMount(() => {
|
|
31
|
+
if (id === void 0) {
|
|
32
|
+
let r = (Math.random() + 1).toString(36).substring(2);
|
|
33
|
+
id = `password-input${r}`;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<LabeledFormInput
|
|
39
|
+
{labelText}
|
|
40
|
+
{id}
|
|
41
|
+
{validationText}
|
|
42
|
+
bind:isValid
|
|
43
|
+
{name}
|
|
44
|
+
{required}
|
|
45
|
+
{placeholder}
|
|
46
|
+
on:validated={handleValidated}
|
|
47
|
+
>
|
|
48
|
+
<div class="relative group">
|
|
49
|
+
<input
|
|
50
|
+
type="password"
|
|
51
|
+
bind:this={input}
|
|
52
|
+
class="border peer block w-full rounded shadow-sm bg-white text-neutral-900
|
|
53
|
+
{size === 'sm' ? 'py-1 px-2 text-sm' : ''}
|
|
54
|
+
{size === 'md' ? 'py-1.5 px-2 text-base' : ''}
|
|
55
|
+
{size === 'lg' ? 'py-2 px-2 text-lg' : ''}
|
|
56
|
+
focus:outline-none focus:ring
|
|
57
|
+
read-only:bg-neutral-100
|
|
58
|
+
dark:read-only:bg-neutral-800
|
|
59
|
+
placeholder:text-sm placeholder:font-thin
|
|
60
|
+
dark:bg-slate-900 dark:text-neutral-100
|
|
61
|
+
{!isValid
|
|
62
|
+
? 'border-pink-600 dark:border-pink-500 focus:ring-pink-600/20 dark:focus:ring-pink-600/40'
|
|
63
|
+
: 'dark:border-slate-600 border-slate-300 focus:ring-teal-500/20 dark:focus:ring-teal-500/30'}
|
|
64
|
+
{customCss}"
|
|
65
|
+
{placeholder}
|
|
66
|
+
{id}
|
|
67
|
+
{name}
|
|
68
|
+
{readonly}
|
|
69
|
+
{required}
|
|
70
|
+
bind:value
|
|
71
|
+
on:change
|
|
72
|
+
/>
|
|
73
|
+
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
class="absolute top-0 bottom-0 right-0 w-8 px-1
|
|
77
|
+
text-slate-500 hover:text-teal-600 active:text-teal-700 focus:outline-none"
|
|
78
|
+
on:click={toggleInputType}
|
|
79
|
+
>
|
|
80
|
+
{#if inputType === 'password'}
|
|
81
|
+
<svg
|
|
82
|
+
class="w-5 h-5 "
|
|
83
|
+
aria-hidden="true"
|
|
84
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
+
width="24"
|
|
86
|
+
height="24"
|
|
87
|
+
fill="none"
|
|
88
|
+
viewBox="0 0 24 24"
|
|
89
|
+
>
|
|
90
|
+
<path
|
|
91
|
+
stroke="currentColor"
|
|
92
|
+
stroke-width="2"
|
|
93
|
+
d="M21 12c0 1.2-4.03 6-9 6s-9-4.8-9-6c0-1.2 4.03-6 9-6s9 4.8 9 6Z"
|
|
94
|
+
/>
|
|
95
|
+
<path stroke="currentColor" stroke-width="2" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
|
|
96
|
+
</svg>
|
|
97
|
+
{:else}
|
|
98
|
+
<svg
|
|
99
|
+
class="w-5 h-5 "
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
102
|
+
width="24"
|
|
103
|
+
height="24"
|
|
104
|
+
fill="none"
|
|
105
|
+
viewBox="0 0 24 24"
|
|
106
|
+
>
|
|
107
|
+
<path
|
|
108
|
+
stroke="currentColor"
|
|
109
|
+
stroke-linecap="round"
|
|
110
|
+
stroke-linejoin="round"
|
|
111
|
+
stroke-width="2"
|
|
112
|
+
d="M3.933 13.909A4.357 4.357 0 0 1 3 12c0-1 4-6 9-6m7.6 3.8A5.068 5.068 0 0 1 21 12c0 1-3 6-9 6-.314 0-.62-.014-.918-.04M5 19 19 5m-4 7a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"
|
|
113
|
+
/>
|
|
114
|
+
</svg>
|
|
115
|
+
{/if}
|
|
116
|
+
</button>
|
|
117
|
+
</div>
|
|
118
|
+
</LabeledFormInput>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { Size } from './types.js';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
size?: Size;
|
|
6
|
+
labelText?: string | undefined;
|
|
7
|
+
id?: string | undefined;
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
value?: string | number | undefined;
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
placeholder?: string | undefined;
|
|
13
|
+
validationText?: string | undefined;
|
|
14
|
+
customCss?: string;
|
|
15
|
+
customValidation?: (() => Boolean) | undefined;
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
change: Event;
|
|
19
|
+
} & {
|
|
20
|
+
[evt: string]: CustomEvent<any>;
|
|
21
|
+
};
|
|
22
|
+
slots: {};
|
|
23
|
+
exports?: {} | undefined;
|
|
24
|
+
bindings?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
export type LabeledPasswordInputProps = typeof __propDef.props;
|
|
27
|
+
export type LabeledPasswordInputEvents = typeof __propDef.events;
|
|
28
|
+
export type LabeledPasswordInputSlots = typeof __propDef.slots;
|
|
29
|
+
export default class LabeledPasswordInput extends SvelteComponent<LabeledPasswordInputProps, LabeledPasswordInputEvents, LabeledPasswordInputSlots> {
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Size = 'sm' | 'md' | 'lg';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,7 @@ import Card from "./components/Card.svelte";
|
|
|
4
4
|
import CardHeader from "./components/CardHeader.svelte";
|
|
5
5
|
import Form from "./components/Form.svelte";
|
|
6
6
|
import ToggleButton from "./components/ToggleButton.svelte";
|
|
7
|
-
|
|
7
|
+
import LabeledFormInput from "./components/LabeledFormInput.svelte";
|
|
8
|
+
import LabeledPasswordInput from "./components/LabeledPasswordInput.svelte";
|
|
9
|
+
import Alert from "./components/Alert.svelte";
|
|
10
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert };
|
package/dist/index.js
CHANGED
|
@@ -5,4 +5,7 @@ import Card from "./components/Card.svelte";
|
|
|
5
5
|
import CardHeader from "./components/CardHeader.svelte";
|
|
6
6
|
import Form from "./components/Form.svelte";
|
|
7
7
|
import ToggleButton from "./components/ToggleButton.svelte";
|
|
8
|
-
|
|
8
|
+
import LabeledFormInput from "./components/LabeledFormInput.svelte";
|
|
9
|
+
import LabeledPasswordInput from "./components/LabeledPasswordInput.svelte";
|
|
10
|
+
import Alert from "./components/Alert.svelte";
|
|
11
|
+
export { Button, LoadingIndicator, Card, CardHeader, Form, ToggleButton, LabeledFormInput, LabeledPasswordInput, Alert };
|