sveltacular 0.0.73 → 0.0.75
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 +31 -31
- package/dist/forms/bool-box/bool-box.svelte +3 -3
- package/dist/forms/button/button.svelte +14 -7
- package/dist/forms/button/button.svelte.d.ts +1 -0
- package/dist/forms/check-box/check-box-group.svelte +14 -14
- package/dist/forms/check-box/check-box.svelte +23 -23
- package/dist/forms/combo/new-or-existing-combo.svelte +56 -56
- package/dist/forms/date-box/date-box.svelte +26 -26
- package/dist/forms/file-area/file-area.svelte +31 -31
- package/dist/forms/file-box/file-box.svelte +23 -23
- package/dist/forms/form-field.svelte +7 -7
- package/dist/forms/form-footer.svelte +15 -15
- package/dist/forms/form-header.svelte +9 -9
- package/dist/forms/form-label.svelte +5 -5
- package/dist/forms/form-section.svelte +14 -14
- package/dist/forms/form.svelte +7 -7
- package/dist/forms/info-box/info-box.svelte +19 -19
- package/dist/forms/list-box/list-box.svelte +44 -44
- package/dist/forms/money-box/money-box.svelte +54 -54
- package/dist/forms/number-box/number-box.svelte +31 -31
- package/dist/forms/phone-box/phone-box.svelte +50 -50
- package/dist/forms/radio-group/radio-box.svelte +15 -15
- package/dist/forms/radio-group/radio-group.svelte +12 -12
- package/dist/forms/switch-box/switch-box.svelte +16 -16
- package/dist/forms/text-area/text-area.svelte +10 -10
- package/dist/forms/text-box/text-box.svelte +34 -34
- package/dist/forms/url-box/url-box.svelte +14 -14
- package/dist/generic/address/address.svelte +16 -16
- package/dist/generic/card/card-container.svelte +7 -7
- package/dist/generic/card/card.svelte +10 -10
- package/dist/generic/date/date-time.svelte +3 -3
- package/dist/generic/divider/divider.svelte +3 -3
- package/dist/generic/dot/dot.svelte +5 -5
- package/dist/generic/dropdown-item/dropdown-item.svelte +35 -0
- package/dist/generic/dropdown-item/dropdown-item.svelte.d.ts +22 -0
- package/dist/generic/email/email.svelte +12 -12
- package/dist/generic/empty/empty.svelte +14 -14
- package/dist/generic/header/header.svelte +17 -17
- package/dist/generic/link/link.svelte +13 -13
- package/dist/generic/list/list-item.svelte +19 -19
- package/dist/generic/list/list.svelte +12 -12
- package/dist/generic/menu/menu.svelte +38 -38
- package/dist/generic/notice/notice.svelte +25 -25
- package/dist/generic/overlay.svelte +8 -8
- package/dist/generic/panel/panel.svelte +10 -10
- package/dist/generic/phone/phone.svelte +16 -16
- package/dist/generic/phone/phone.svelte.d.ts +1 -1
- package/dist/generic/pill/pill.svelte +7 -7
- package/dist/generic/scorecard/scorecard.svelte +10 -10
- package/dist/generic/section/section.svelte +10 -10
- package/dist/generic/toaster/toaster.svelte +6 -6
- package/dist/icons/angle-right-icon.svelte +11 -11
- package/dist/icons/angle-up-icon.svelte +9 -9
- package/dist/icons/check-icon.svelte +17 -17
- package/dist/icons/envelope-icon.svelte +8 -8
- package/dist/icons/folder-open-icon.svelte +12 -12
- package/dist/icons/hamburger-icon.svelte +15 -15
- package/dist/icons/home-icon.svelte +7 -7
- package/dist/icons/link-icon.svelte +15 -15
- package/dist/icons/mobile-phone-icon.svelte +5 -5
- package/dist/icons/phone-icon.svelte +9 -9
- package/dist/icons/svg-icon.svelte +5 -5
- package/dist/icons/upload-icon.svelte +9 -9
- package/dist/images/icon.svelte +5 -5
- package/dist/images/image.svelte +28 -28
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/layout/flex-col.svelte +10 -10
- package/dist/layout/flex-item.svelte +5 -5
- package/dist/layout/flex-row.svelte +13 -13
- package/dist/layout/grid.svelte +17 -17
- package/dist/modals/alert.svelte +24 -24
- package/dist/modals/confirm.svelte +27 -27
- package/dist/modals/dialog-body.svelte +5 -5
- package/dist/modals/dialog-close-button.svelte +7 -7
- package/dist/modals/dialog-footer.svelte +9 -9
- package/dist/modals/dialog-header.svelte +5 -5
- package/dist/modals/dialog-window.svelte +9 -9
- package/dist/modals/modal.svelte +12 -12
- package/dist/modals/prompt.svelte +29 -29
- package/dist/navigation/accordian/accordian.svelte +17 -17
- package/dist/navigation/app-bar/app-bar.svelte +7 -7
- package/dist/navigation/app-bar/app-branding.svelte +18 -18
- package/dist/navigation/app-bar/app-logo.svelte +11 -11
- package/dist/navigation/app-bar/app-nav-item.svelte +14 -14
- package/dist/navigation/app-bar/app-nav.svelte +12 -12
- package/dist/navigation/breadcrumbs/breadcrumbs.svelte +25 -25
- package/dist/navigation/dropdown-button/dropdown-button.svelte +97 -0
- package/dist/navigation/dropdown-button/dropdown-button.svelte.d.ts +21 -0
- package/dist/navigation/pagination/pagination.svelte +27 -27
- package/dist/navigation/side-bar/side-bar.svelte +10 -10
- package/dist/navigation/tabs/tab-group.svelte +20 -20
- package/dist/navigation/tabs/tab.svelte +13 -13
- package/dist/navigation/wizard/wizard-step.svelte +12 -12
- package/dist/navigation/wizard/wizard.svelte +27 -27
- package/dist/placeholders/loading.svelte +9 -9
- package/dist/placeholders/progress.svelte +9 -9
- package/dist/placeholders/skeleton-input.svelte +43 -43
- package/dist/placeholders/skeleton-text.svelte +5 -5
- package/dist/tables/data-grid.svelte +83 -83
- package/dist/tables/table-body.svelte +3 -3
- package/dist/tables/table-caption.svelte +7 -7
- package/dist/tables/table-cell.svelte +7 -7
- package/dist/tables/table-footer-cell.svelte +21 -21
- package/dist/tables/table-footer-row.svelte +3 -3
- package/dist/tables/table-footer.svelte +13 -13
- package/dist/tables/table-header-cell.svelte +7 -7
- package/dist/tables/table-header-row.svelte +4 -4
- package/dist/tables/table-header.svelte +14 -14
- package/dist/tables/table-row.svelte +16 -16
- package/dist/tables/table.svelte +11 -11
- package/dist/timeline/timeline-item.svelte +26 -26
- package/dist/timeline/timeline.svelte +5 -5
- package/dist/typography/code-block.svelte +7 -7
- package/dist/typography/headline.svelte +19 -19
- package/dist/typography/paragraph.svelte +13 -13
- package/dist/typography/subtitle.svelte +7 -7
- package/dist/typography/text.svelte +11 -11
- package/package.json +101 -101
package/README.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
Sveltacular is TypeScript and SASS based component library for Svelte, with no other dependencies.
|
|
4
|
-
|
|
5
|
-
Why did I create it when there are other options? Well, mainly because the best options out there were based on Tailwind. And, no disrespect to those who love it, but I didn't want to use Tailwind. So since I didn't find what I was loooking for, I made my own.
|
|
6
|
-
|
|
7
|
-
## Run Storybook
|
|
8
|
-
|
|
9
|
-
I don't have great documentation for now, but you can browse all of the available components by running Storybook locally. Check out the repo and then run this command:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm run storybook
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Usage
|
|
16
|
-
|
|
17
|
-
Install it in your project
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm i sveltacular
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
Then use it like this:
|
|
24
|
-
|
|
25
|
-
```svelte
|
|
26
|
-
<script lang="ts">
|
|
27
|
-
import { Button } from 'sveltacular';
|
|
28
|
-
</script>
|
|
29
|
-
|
|
30
|
-
<Button>Hello World</Button>
|
|
31
|
-
```
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
Sveltacular is TypeScript and SASS based component library for Svelte, with no other dependencies.
|
|
4
|
+
|
|
5
|
+
Why did I create it when there are other options? Well, mainly because the best options out there were based on Tailwind. And, no disrespect to those who love it, but I didn't want to use Tailwind. So since I didn't find what I was loooking for, I made my own.
|
|
6
|
+
|
|
7
|
+
## Run Storybook
|
|
8
|
+
|
|
9
|
+
I don't have great documentation for now, but you can browse all of the available components by running Storybook locally. Check out the repo and then run this command:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm run storybook
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
Install it in your project
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm i sveltacular
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Then use it like this:
|
|
24
|
+
|
|
25
|
+
```svelte
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import { Button } from 'sveltacular';
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<Button>Hello World</Button>
|
|
31
|
+
```
|
|
@@ -14,6 +14,6 @@ $:
|
|
|
14
14
|
{ value: "true", name: options[0] },
|
|
15
15
|
{ value: "false", name: options[1] }
|
|
16
16
|
];
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<ListBox {items} bind:value={stringValue} {size} on:change={onChange}><slot /></ListBox>
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<ListBox {items} bind:value={stringValue} {size} on:change={onChange}><slot /></ListBox>
|
|
@@ -9,6 +9,7 @@ export let flex = false;
|
|
|
9
9
|
export let disabled = false;
|
|
10
10
|
export let noMargin = false;
|
|
11
11
|
export let collapse = false;
|
|
12
|
+
export let repeatSubmitDelay = 500;
|
|
12
13
|
const dispatch = createEventDispatcher();
|
|
13
14
|
const click = (e) => {
|
|
14
15
|
if (disabled) {
|
|
@@ -17,16 +18,22 @@ const click = (e) => {
|
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
20
|
dispatch("click");
|
|
21
|
+
if (repeatSubmitDelay) {
|
|
22
|
+
disabled = true;
|
|
23
|
+
if (repeatSubmitDelay !== "infinite") {
|
|
24
|
+
setTimeout(() => disabled = false, repeatSubmitDelay);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
20
27
|
if (href) {
|
|
21
28
|
navigateTo(href);
|
|
22
29
|
}
|
|
23
30
|
};
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<button {type} on:click={click} class="{size} {style} {flex ? 'flex' : ''}" class:block class:noMargin class:collapse {disabled}>
|
|
27
|
-
<slot />
|
|
28
|
-
</button>
|
|
29
|
-
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<button {type} on:click={click} class="{size} {style} {flex ? 'flex' : ''}" class:block class:noMargin class:collapse {disabled}>
|
|
34
|
+
<slot />
|
|
35
|
+
</button>
|
|
36
|
+
|
|
30
37
|
<style>button {
|
|
31
38
|
display: inline-block;
|
|
32
39
|
min-width: 10rem;
|
|
@@ -157,4 +164,4 @@ button.link {
|
|
|
157
164
|
}
|
|
158
165
|
button.link:hover {
|
|
159
166
|
color: var(--base-link-hover-fg, #1e88e5);
|
|
160
|
-
}</style>
|
|
167
|
+
}</style>
|
|
@@ -21,17 +21,17 @@ const onChecked = () => {
|
|
|
21
21
|
dispatch("change", { selected: group });
|
|
22
22
|
};
|
|
23
23
|
onChecked();
|
|
24
|
-
</script>
|
|
25
|
-
|
|
26
|
-
<FormField {size}>
|
|
27
|
-
{#if $$slots.default}
|
|
28
|
-
<FormLabel {id} {required}><slot /></FormLabel>
|
|
29
|
-
{/if}
|
|
30
|
-
<div>
|
|
31
|
-
{#each items as item}
|
|
32
|
-
<CheckBox {disabled} value={item.value} bind:isChecked={item.isChecked} on:change={onChecked}
|
|
33
|
-
>{item.name}</CheckBox
|
|
34
|
-
>
|
|
35
|
-
{/each}
|
|
36
|
-
</div>
|
|
37
|
-
</FormField>
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<FormField {size}>
|
|
27
|
+
{#if $$slots.default}
|
|
28
|
+
<FormLabel {id} {required}><slot /></FormLabel>
|
|
29
|
+
{/if}
|
|
30
|
+
<div>
|
|
31
|
+
{#each items as item}
|
|
32
|
+
<CheckBox {disabled} value={item.value} bind:isChecked={item.isChecked} on:change={onChecked}
|
|
33
|
+
>{item.name}</CheckBox
|
|
34
|
+
>
|
|
35
|
+
{/each}
|
|
36
|
+
</div>
|
|
37
|
+
</FormField>
|
|
@@ -12,28 +12,28 @@ const onChecked = (event) => {
|
|
|
12
12
|
isChecked = target.checked;
|
|
13
13
|
dispatch("change", { isChecked, value });
|
|
14
14
|
};
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<label>
|
|
18
|
-
<input
|
|
19
|
-
type="checkbox"
|
|
20
|
-
{id}
|
|
21
|
-
{disabled}
|
|
22
|
-
{name}
|
|
23
|
-
bind:value
|
|
24
|
-
bind:checked={isChecked}
|
|
25
|
-
on:change={onChecked}
|
|
26
|
-
/>
|
|
27
|
-
<span class="checkbox">
|
|
28
|
-
<span class="checkmark"><CheckIcon /></span>
|
|
29
|
-
</span>
|
|
30
|
-
{#if $$slots.default}
|
|
31
|
-
<div class="text">
|
|
32
|
-
<slot />
|
|
33
|
-
</div>
|
|
34
|
-
{/if}
|
|
35
|
-
</label>
|
|
36
|
-
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<label>
|
|
18
|
+
<input
|
|
19
|
+
type="checkbox"
|
|
20
|
+
{id}
|
|
21
|
+
{disabled}
|
|
22
|
+
{name}
|
|
23
|
+
bind:value
|
|
24
|
+
bind:checked={isChecked}
|
|
25
|
+
on:change={onChecked}
|
|
26
|
+
/>
|
|
27
|
+
<span class="checkbox">
|
|
28
|
+
<span class="checkmark"><CheckIcon /></span>
|
|
29
|
+
</span>
|
|
30
|
+
{#if $$slots.default}
|
|
31
|
+
<div class="text">
|
|
32
|
+
<slot />
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
35
|
+
</label>
|
|
36
|
+
|
|
37
37
|
<style>label {
|
|
38
38
|
display: flex;
|
|
39
39
|
align-items: center;
|
|
@@ -81,4 +81,4 @@ label input:checked + .checkbox {
|
|
|
81
81
|
label input:checked + .checkbox .checkmark {
|
|
82
82
|
width: 100%;
|
|
83
83
|
height: 100%;
|
|
84
|
-
}</style>
|
|
84
|
+
}</style>
|
|
@@ -16,59 +16,59 @@ export let searchable = false;
|
|
|
16
16
|
export let search = void 0;
|
|
17
17
|
export let searchPlaceholder = "Search";
|
|
18
18
|
export let newPlaceholder = "New";
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<div class="group">
|
|
22
|
-
<FlexRow>
|
|
23
|
-
<div class="labels">
|
|
24
|
-
<FlexCol>
|
|
25
|
-
<div class="radio">
|
|
26
|
-
<RadioBox value="existing" bind:group={mode}>Existing:</RadioBox>
|
|
27
|
-
</div>
|
|
28
|
-
<div class="radio">
|
|
29
|
-
<RadioBox value="new" bind:group={mode}>New:</RadioBox>
|
|
30
|
-
</div>
|
|
31
|
-
</FlexCol>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="inputs">
|
|
34
|
-
<FlexCol>
|
|
35
|
-
<div class="input">
|
|
36
|
-
<ListBox
|
|
37
|
-
bind:value={existingValue}
|
|
38
|
-
{searchable}
|
|
39
|
-
{search}
|
|
40
|
-
{required}
|
|
41
|
-
{items}
|
|
42
|
-
{size}
|
|
43
|
-
placeholder={searchPlaceholder}
|
|
44
|
-
disabled={disabled || mode == 'new'}
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
47
|
-
<div class="input">
|
|
48
|
-
<TextBox
|
|
49
|
-
bind:value={newValue}
|
|
50
|
-
{size}
|
|
51
|
-
placeholder={newPlaceholder}
|
|
52
|
-
disabled={disabled || mode == 'existing'}
|
|
53
|
-
/>
|
|
54
|
-
</div>
|
|
55
|
-
</FlexCol>
|
|
56
|
-
</div>
|
|
57
|
-
</FlexRow>
|
|
58
|
-
</div>
|
|
59
|
-
|
|
60
|
-
<style>
|
|
61
|
-
.labels {
|
|
62
|
-
flex-shrink: 1;
|
|
63
|
-
}
|
|
64
|
-
.inputs {
|
|
65
|
-
flex-grow: 1;
|
|
66
|
-
}
|
|
67
|
-
.radio,
|
|
68
|
-
.input {
|
|
69
|
-
height: 2.5rem;
|
|
70
|
-
}
|
|
71
|
-
.radio {
|
|
72
|
-
padding-top: 0.1rem;
|
|
73
|
-
}
|
|
74
|
-
</style>
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<div class="group">
|
|
22
|
+
<FlexRow>
|
|
23
|
+
<div class="labels">
|
|
24
|
+
<FlexCol>
|
|
25
|
+
<div class="radio">
|
|
26
|
+
<RadioBox value="existing" bind:group={mode}>Existing:</RadioBox>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="radio">
|
|
29
|
+
<RadioBox value="new" bind:group={mode}>New:</RadioBox>
|
|
30
|
+
</div>
|
|
31
|
+
</FlexCol>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="inputs">
|
|
34
|
+
<FlexCol>
|
|
35
|
+
<div class="input">
|
|
36
|
+
<ListBox
|
|
37
|
+
bind:value={existingValue}
|
|
38
|
+
{searchable}
|
|
39
|
+
{search}
|
|
40
|
+
{required}
|
|
41
|
+
{items}
|
|
42
|
+
{size}
|
|
43
|
+
placeholder={searchPlaceholder}
|
|
44
|
+
disabled={disabled || mode == 'new'}
|
|
45
|
+
/>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="input">
|
|
48
|
+
<TextBox
|
|
49
|
+
bind:value={newValue}
|
|
50
|
+
{size}
|
|
51
|
+
placeholder={newPlaceholder}
|
|
52
|
+
disabled={disabled || mode == 'existing'}
|
|
53
|
+
/>
|
|
54
|
+
</div>
|
|
55
|
+
</FlexCol>
|
|
56
|
+
</div>
|
|
57
|
+
</FlexRow>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<style>
|
|
61
|
+
.labels {
|
|
62
|
+
flex-shrink: 1;
|
|
63
|
+
}
|
|
64
|
+
.inputs {
|
|
65
|
+
flex-grow: 1;
|
|
66
|
+
}
|
|
67
|
+
.radio,
|
|
68
|
+
.input {
|
|
69
|
+
height: 2.5rem;
|
|
70
|
+
}
|
|
71
|
+
.radio {
|
|
72
|
+
padding-top: 0.1rem;
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -47,31 +47,31 @@ if (!value) {
|
|
|
47
47
|
}
|
|
48
48
|
$:
|
|
49
49
|
disabled = !enabled;
|
|
50
|
-
</script>
|
|
51
|
-
|
|
52
|
-
<FormField {size}>
|
|
53
|
-
{#if $$slots.default}
|
|
54
|
-
<FormLabel {id} {required}><slot /></FormLabel>
|
|
55
|
-
{/if}
|
|
56
|
-
<div class:nullable class:disabled>
|
|
57
|
-
<span class="input">
|
|
58
|
-
<input {...{ type }} {id} {placeholder} {disabled} bind:value {required} on:input={onInput} />
|
|
59
|
-
</span>
|
|
60
|
-
{#if nullable}
|
|
61
|
-
<span class="toggle">
|
|
62
|
-
<input type="checkbox" bind:checked={enabled} on:change={checkChanged} />
|
|
63
|
-
</span>
|
|
64
|
-
{/if}
|
|
65
|
-
{#if steps.length > 0}
|
|
66
|
-
<span class="steps">
|
|
67
|
-
{#each steps as step}
|
|
68
|
-
<Button noMargin={true} collapse={true} on:click={() => incrementValue(step)}>{step.label}</Button>
|
|
69
|
-
{/each}
|
|
70
|
-
</span>
|
|
71
|
-
{/if}
|
|
72
|
-
</div>
|
|
73
|
-
</FormField>
|
|
74
|
-
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<FormField {size}>
|
|
53
|
+
{#if $$slots.default}
|
|
54
|
+
<FormLabel {id} {required}><slot /></FormLabel>
|
|
55
|
+
{/if}
|
|
56
|
+
<div class:nullable class:disabled>
|
|
57
|
+
<span class="input">
|
|
58
|
+
<input {...{ type }} {id} {placeholder} {disabled} bind:value {required} on:input={onInput} />
|
|
59
|
+
</span>
|
|
60
|
+
{#if nullable}
|
|
61
|
+
<span class="toggle">
|
|
62
|
+
<input type="checkbox" bind:checked={enabled} on:change={checkChanged} />
|
|
63
|
+
</span>
|
|
64
|
+
{/if}
|
|
65
|
+
{#if steps.length > 0}
|
|
66
|
+
<span class="steps">
|
|
67
|
+
{#each steps as step}
|
|
68
|
+
<Button noMargin={true} collapse={true} on:click={() => incrementValue(step)}>{step.label}</Button>
|
|
69
|
+
{/each}
|
|
70
|
+
</span>
|
|
71
|
+
{/if}
|
|
72
|
+
</div>
|
|
73
|
+
</FormField>
|
|
74
|
+
|
|
75
75
|
<style>input {
|
|
76
76
|
width: 100%;
|
|
77
77
|
padding: 0.5rem 1rem;
|
|
@@ -114,4 +114,4 @@ div.disabled input {
|
|
|
114
114
|
background-color: #f5f5f5;
|
|
115
115
|
border-color: #e0e0e0;
|
|
116
116
|
color: #a0a0a0;
|
|
117
|
-
}</style>
|
|
117
|
+
}</style>
|
|
@@ -56,36 +56,36 @@ $:
|
|
|
56
56
|
draggingClass = isDragging ? "isDragging" : "";
|
|
57
57
|
$:
|
|
58
58
|
filesSelectedText = selectedFiles.length ? `${selectedFiles.length} file${selectedFiles.length > 1 ? "s" : ""} selected` : "";
|
|
59
|
-
</script>
|
|
60
|
-
|
|
61
|
-
<div
|
|
62
|
-
class="dropzone {filesClass} {enabledClass} {draggingClass}"
|
|
63
|
-
data-file-count={selectedFiles.length}
|
|
64
|
-
>
|
|
65
|
-
<label
|
|
66
|
-
on:drop={dropFiles}
|
|
67
|
-
on:dragenter={dragStart}
|
|
68
|
-
on:dragstart={dragStart}
|
|
69
|
-
on:dragover={dragStart}
|
|
70
|
-
on:dragend={dragStop}
|
|
71
|
-
on:dragleave={dragStop}
|
|
72
|
-
on:dragexit={dragStop}
|
|
73
|
-
>
|
|
74
|
-
<input type="file" id="upload-button" accept="image/*" on:change={selectFiles} {disabled} />
|
|
75
|
-
<div class="icon"><UploadIcon /></div>
|
|
76
|
-
<div class="text">
|
|
77
|
-
{#if $$slots.default}
|
|
78
|
-
<slot />
|
|
79
|
-
{:else}
|
|
80
|
-
<span>Drop file or click to select</span>
|
|
81
|
-
{/if}
|
|
82
|
-
{#if filesSelectedText}
|
|
83
|
-
<span class="file-count">{filesSelectedText}</span>
|
|
84
|
-
{/if}
|
|
85
|
-
</div>
|
|
86
|
-
</label>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<div
|
|
62
|
+
class="dropzone {filesClass} {enabledClass} {draggingClass}"
|
|
63
|
+
data-file-count={selectedFiles.length}
|
|
64
|
+
>
|
|
65
|
+
<label
|
|
66
|
+
on:drop={dropFiles}
|
|
67
|
+
on:dragenter={dragStart}
|
|
68
|
+
on:dragstart={dragStart}
|
|
69
|
+
on:dragover={dragStart}
|
|
70
|
+
on:dragend={dragStop}
|
|
71
|
+
on:dragleave={dragStop}
|
|
72
|
+
on:dragexit={dragStop}
|
|
73
|
+
>
|
|
74
|
+
<input type="file" id="upload-button" accept="image/*" on:change={selectFiles} {disabled} />
|
|
75
|
+
<div class="icon"><UploadIcon /></div>
|
|
76
|
+
<div class="text">
|
|
77
|
+
{#if $$slots.default}
|
|
78
|
+
<slot />
|
|
79
|
+
{:else}
|
|
80
|
+
<span>Drop file or click to select</span>
|
|
81
|
+
{/if}
|
|
82
|
+
{#if filesSelectedText}
|
|
83
|
+
<span class="file-count">{filesSelectedText}</span>
|
|
84
|
+
{/if}
|
|
85
|
+
</div>
|
|
86
|
+
</label>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
89
|
<style>input[type=file] {
|
|
90
90
|
display: none;
|
|
91
91
|
}
|
|
@@ -135,4 +135,4 @@ $:
|
|
|
135
135
|
display: block;
|
|
136
136
|
font-size: 0.75rem;
|
|
137
137
|
margin-top: 0.5rem;
|
|
138
|
-
}</style>
|
|
138
|
+
}</style>
|
|
@@ -11,28 +11,28 @@ export let readonly = false;
|
|
|
11
11
|
export let multiple = false;
|
|
12
12
|
export let mimeTypes = [];
|
|
13
13
|
export let capture = void 0;
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<FormField {size}>
|
|
17
|
-
{#if $$slots.default}
|
|
18
|
-
<FormLabel {id} {required}><slot /></FormLabel>
|
|
19
|
-
{/if}
|
|
20
|
-
<div>
|
|
21
|
-
<input
|
|
22
|
-
{id}
|
|
23
|
-
{placeholder}
|
|
24
|
-
{multiple}
|
|
25
|
-
bind:value
|
|
26
|
-
type="file"
|
|
27
|
-
{disabled}
|
|
28
|
-
{readonly}
|
|
29
|
-
{required}
|
|
30
|
-
accept={mimeTypes.join(',')}
|
|
31
|
-
{capture}
|
|
32
|
-
/>
|
|
33
|
-
</div>
|
|
34
|
-
</FormField>
|
|
35
|
-
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<FormField {size}>
|
|
17
|
+
{#if $$slots.default}
|
|
18
|
+
<FormLabel {id} {required}><slot /></FormLabel>
|
|
19
|
+
{/if}
|
|
20
|
+
<div>
|
|
21
|
+
<input
|
|
22
|
+
{id}
|
|
23
|
+
{placeholder}
|
|
24
|
+
{multiple}
|
|
25
|
+
bind:value
|
|
26
|
+
type="file"
|
|
27
|
+
{disabled}
|
|
28
|
+
{readonly}
|
|
29
|
+
{required}
|
|
30
|
+
accept={mimeTypes.join(',')}
|
|
31
|
+
{capture}
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</FormField>
|
|
35
|
+
|
|
36
36
|
<style>input {
|
|
37
37
|
width: 100%;
|
|
38
38
|
padding: 0.5rem 1rem;
|
|
@@ -50,4 +50,4 @@ export let capture = void 0;
|
|
|
50
50
|
input::placeholder {
|
|
51
51
|
color: var(--form-input-placeholder, #888);
|
|
52
52
|
font-style: italic;
|
|
53
|
-
}</style>
|
|
53
|
+
}</style>
|
|
@@ -10,13 +10,13 @@ $:
|
|
|
10
10
|
displayType = ["xl", "full"].includes(size) ? "block" : "inline-block";
|
|
11
11
|
$:
|
|
12
12
|
maxWidth = maxWidthMap[size];
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<div style={`display: ${displayType}; width: 100%; min-width: 10rem; max-width: ${maxWidth}`}>
|
|
16
|
-
<slot />
|
|
17
|
-
</div>
|
|
18
|
-
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<div style={`display: ${displayType}; width: 100%; min-width: 10rem; max-width: ${maxWidth}`}>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
19
|
<style>div {
|
|
20
20
|
margin-bottom: 1rem;
|
|
21
21
|
margin-right: 1rem;
|
|
22
|
-
}</style>
|
|
22
|
+
}</style>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import FlexRow from '../layout/flex-row.svelte';
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<div>
|
|
6
|
-
<FlexRow layout="stretch">
|
|
7
|
-
<slot />
|
|
8
|
-
</FlexRow>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<style>
|
|
12
|
-
div {
|
|
13
|
-
margin-top: 1.5rem;
|
|
14
|
-
}
|
|
15
|
-
</style>
|
|
1
|
+
<script>
|
|
2
|
+
import FlexRow from '../layout/flex-row.svelte';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div>
|
|
6
|
+
<FlexRow layout="stretch">
|
|
7
|
+
<slot />
|
|
8
|
+
</FlexRow>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
div {
|
|
13
|
+
margin-top: 1.5rem;
|
|
14
|
+
}
|
|
15
|
+
</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
<script>import Headline from "../typography/headline.svelte";
|
|
2
2
|
export let level = 4;
|
|
3
3
|
export let underline = true;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<div class:underline>
|
|
7
|
-
<Headline {level}>
|
|
8
|
-
<slot />
|
|
9
|
-
</Headline>
|
|
10
|
-
</div>
|
|
11
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div class:underline>
|
|
7
|
+
<Headline {level}>
|
|
8
|
+
<slot />
|
|
9
|
+
</Headline>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
12
|
<style>div {
|
|
13
13
|
margin-bottom: 1rem;
|
|
14
14
|
}
|
|
15
15
|
div.underline {
|
|
16
16
|
padding-bottom: 0.5rem;
|
|
17
17
|
border-bottom: solid 1px var(--divider-color, rgba(127, 127, 127, 0.5));
|
|
18
|
-
}</style>
|
|
18
|
+
}</style>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>export let id = void 0;
|
|
2
2
|
export let required = false;
|
|
3
3
|
export let disabled = false;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<label for={id} class:required class:disabled><slot /></label>
|
|
7
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<label for={id} class:required class:disabled><slot /></label>
|
|
7
|
+
|
|
8
8
|
<style>label {
|
|
9
9
|
display: block;
|
|
10
10
|
margin-bottom: 0.5rem;
|
|
@@ -16,4 +16,4 @@ label.required::after {
|
|
|
16
16
|
label.disabled {
|
|
17
17
|
opacity: 0.5;
|
|
18
18
|
cursor: not-allowed;
|
|
19
|
-
}</style>
|
|
19
|
+
}</style>
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script>import FormHeader from "./form-header.svelte";
|
|
2
2
|
export let title = void 0;
|
|
3
3
|
export let level = 4;
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
|
-
<section>
|
|
7
|
-
{#if title}
|
|
8
|
-
<FormHeader {level}>{title}</FormHeader>
|
|
9
|
-
{/if}
|
|
10
|
-
<slot />
|
|
11
|
-
</section>
|
|
12
|
-
|
|
13
|
-
<style>
|
|
14
|
-
section {
|
|
15
|
-
margin-bottom: 1rem;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<section>
|
|
7
|
+
{#if title}
|
|
8
|
+
<FormHeader {level}>{title}</FormHeader>
|
|
9
|
+
{/if}
|
|
10
|
+
<slot />
|
|
11
|
+
</section>
|
|
12
|
+
|
|
13
|
+
<style>
|
|
14
|
+
section {
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
}
|
|
17
|
+
</style>
|