sveltacular 1.0.36 → 1.0.38
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/forms/bool-box/bool-box.svelte +3 -3
- package/dist/forms/bool-box/bool-box.svelte.d.ts +2 -2
- package/dist/forms/button/button.svelte +30 -10
- package/dist/forms/button/button.svelte.d.ts +3 -4
- package/dist/forms/check-box/check-box-group.svelte +3 -3
- package/dist/forms/check-box/check-box-group.svelte.d.ts +2 -2
- package/dist/forms/check-box/check-box.svelte +3 -3
- package/dist/forms/check-box/check-box.svelte.d.ts +2 -2
- package/dist/forms/combo/new-or-existing-combo.svelte +3 -3
- package/dist/forms/combo/new-or-existing-combo.svelte.d.ts +2 -2
- package/dist/forms/date-box/date-box.svelte +8 -8
- package/dist/forms/date-box/date-box.svelte.d.ts +2 -2
- package/dist/forms/dimension-box/dimension-box.svelte +3 -3
- package/dist/forms/dimension-box/dimension-box.svelte.d.ts +2 -2
- package/dist/forms/file-box/file-box.svelte +3 -3
- package/dist/forms/file-box/file-box.svelte.d.ts +2 -2
- package/dist/forms/form-field/form-field.svelte +5 -4
- package/dist/forms/form.svelte +3 -3
- package/dist/forms/form.svelte.d.ts +2 -2
- package/dist/forms/index.d.ts +1 -1
- package/dist/forms/index.js +1 -1
- package/dist/forms/info-box/info-box.svelte +3 -3
- package/dist/forms/info-box/info-box.svelte.d.ts +2 -2
- package/dist/forms/list-box/list-box.svelte +3 -3
- package/dist/forms/list-box/list-box.svelte.d.ts +2 -2
- package/dist/forms/money-box/money-box.svelte +3 -3
- package/dist/forms/money-box/money-box.svelte.d.ts +2 -2
- package/dist/forms/number-box/number-box.svelte +3 -3
- package/dist/forms/number-box/number-box.svelte.d.ts +2 -2
- package/dist/forms/number-range-box/number-range-box.svelte +3 -3
- package/dist/forms/number-range-box/number-range-box.svelte.d.ts +2 -2
- package/dist/forms/phone-box/phone-box.svelte +3 -3
- package/dist/forms/phone-box/phone-box.svelte.d.ts +2 -2
- package/dist/forms/radio-group/radio-group.svelte +3 -3
- package/dist/forms/radio-group/radio-group.svelte.d.ts +2 -2
- package/dist/forms/reference-box/reference-box.svelte +3 -3
- package/dist/forms/reference-box/reference-box.svelte.d.ts +2 -2
- package/dist/forms/slider/slider.svelte +3 -3
- package/dist/forms/slider/slider.svelte.d.ts +2 -2
- package/dist/forms/tag-box/tag-box.svelte +3 -3
- package/dist/forms/tag-box/tag-box.svelte.d.ts +2 -2
- package/dist/forms/text-area/text-area.svelte +4 -3
- package/dist/forms/text-area/text-area.svelte.d.ts +2 -2
- package/dist/forms/text-box/text-box.svelte +2 -2
- package/dist/forms/text-box/text-box.svelte.d.ts +2 -2
- package/dist/forms/time-box/time-box.svelte +3 -3
- package/dist/forms/time-box/time-box.svelte.d.ts +2 -2
- package/dist/forms/url-box/url-box.svelte +3 -3
- package/dist/forms/url-box/url-box.svelte.d.ts +2 -2
- package/dist/generic/card/card.svelte +3 -3
- package/dist/generic/card/card.svelte.d.ts +2 -2
- package/dist/generic/dot/dot.svelte +3 -3
- package/dist/generic/dot/dot.svelte.d.ts +2 -2
- package/dist/generic/empty/empty.svelte +4 -2
- package/dist/generic/empty/empty.svelte.d.ts +1 -1
- package/dist/generic/menu/menu.svelte +3 -3
- package/dist/generic/menu/menu.svelte.d.ts +2 -2
- package/dist/generic/pill/pill.svelte +3 -3
- package/dist/generic/pill/pill.svelte.d.ts +2 -2
- package/dist/generic/section/section.svelte +9 -3
- package/dist/generic/section/section.svelte.d.ts +2 -2
- package/dist/modals/alert.svelte +4 -9
- package/dist/modals/alert.svelte.d.ts +2 -2
- package/dist/modals/confirm.svelte +4 -9
- package/dist/modals/confirm.svelte.d.ts +2 -2
- package/dist/modals/dialog-window.svelte +21 -9
- package/dist/modals/dialog-window.svelte.d.ts +5 -3
- package/dist/modals/modal.svelte +11 -6
- package/dist/modals/modal.svelte.d.ts +2 -2
- package/dist/modals/prompt.svelte +4 -9
- package/dist/modals/prompt.svelte.d.ts +2 -2
- package/dist/navigation/app-bar/app-bar.svelte +5 -5
- package/dist/navigation/app-bar/app-bar.svelte.d.ts +3 -3
- package/dist/placeholders/loading.svelte +37 -4
- package/dist/placeholders/loading.svelte.d.ts +1 -1
- package/dist/placeholders/progress.svelte +71 -9
- package/dist/placeholders/progress.svelte.d.ts +2 -0
- package/dist/tables/data-grid-actions-cell.svelte +2 -2
- package/dist/tables/data-grid-actions-cell.svelte.d.ts +2 -2
- package/dist/tables/data-grid-row.svelte +2 -2
- package/dist/tables/data-grid-row.svelte.d.ts +2 -2
- package/dist/tables/data-grid.svelte +2 -4
- package/dist/types/data.d.ts +2 -2
- package/dist/types/form.d.ts +1 -1
- package/dist/types/size.d.ts +3 -33
- package/dist/types/size.js +2 -32
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import ListBox from '../list-box/list-box.svelte';
|
|
3
3
|
import FormField from '../form-field/form-field.svelte';
|
|
4
4
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ComponentSize } from '../../index.js';
|
|
6
6
|
import type { FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
7
7
|
|
|
8
8
|
type BoolBoxVariant = 'dropdown' | 'switch' | 'checkbox' | 'radio';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
let {
|
|
11
11
|
value = $bindable(false),
|
|
12
12
|
options = ['Yes', 'No'] as [yes: string, no: string],
|
|
13
|
-
size = 'md' as
|
|
13
|
+
size = 'md' as ComponentSize,
|
|
14
14
|
onChange = undefined,
|
|
15
15
|
label = undefined,
|
|
16
16
|
helperText = undefined,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}: {
|
|
22
22
|
value?: boolean;
|
|
23
23
|
options?: [yes: string, no: string];
|
|
24
|
-
size?:
|
|
24
|
+
size?: ComponentSize;
|
|
25
25
|
onChange?: ((value: boolean) => void) | undefined;
|
|
26
26
|
label?: string;
|
|
27
27
|
helperText?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentSize } from '../../index.js';
|
|
2
2
|
import type { FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
3
3
|
type BoolBoxVariant = 'dropdown' | 'switch' | 'checkbox' | 'radio';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
value?: boolean;
|
|
6
6
|
options?: [yes: string, no: string];
|
|
7
|
-
size?:
|
|
7
|
+
size?: ComponentSize;
|
|
8
8
|
onChange?: ((value: boolean) => void) | undefined;
|
|
9
9
|
label?: string;
|
|
10
10
|
helperText?: string;
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { Snippet } from 'svelte';
|
|
7
7
|
import { navigateTo } from '../../helpers/navigate-to.js';
|
|
8
|
-
import type { ButtonVariant, ComponentWidth,
|
|
8
|
+
import type { ButtonVariant, ComponentWidth, ComponentSize } from '../../types/form.js';
|
|
9
9
|
import type { IconType } from '../../icons/types.js';
|
|
10
10
|
import Spinner from '../../generic/spinner/spinner.svelte';
|
|
11
11
|
import Icon from '../../icons/icon.svelte';
|
|
12
|
-
import type { ComponentSize } from '../../types';
|
|
13
12
|
|
|
14
13
|
let {
|
|
15
14
|
/** Optional href for navigation */
|
|
@@ -32,8 +31,6 @@
|
|
|
32
31
|
loading = false,
|
|
33
32
|
/** ARIA label for accessibility (required if button content is not text) */
|
|
34
33
|
ariaLabel = undefined,
|
|
35
|
-
/** Remove margins */
|
|
36
|
-
noMargin = false,
|
|
37
34
|
/** Collapse padding */
|
|
38
35
|
collapse = false,
|
|
39
36
|
/** Delay before re-enabling after click (prevents double-clicks) */
|
|
@@ -45,11 +42,13 @@
|
|
|
45
42
|
iconSize = 'default',
|
|
46
43
|
/** Click handler */
|
|
47
44
|
onClick = undefined,
|
|
45
|
+
/** Margin around button */
|
|
46
|
+
margin = 'sm',
|
|
48
47
|
/** Button content */
|
|
49
48
|
children
|
|
50
49
|
}: {
|
|
51
50
|
href?: string | undefined;
|
|
52
|
-
size?:
|
|
51
|
+
size?: ComponentSize;
|
|
53
52
|
width?: ComponentWidth;
|
|
54
53
|
variant?: ButtonVariant;
|
|
55
54
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -58,12 +57,12 @@
|
|
|
58
57
|
disabled?: boolean;
|
|
59
58
|
loading?: boolean;
|
|
60
59
|
ariaLabel?: string | undefined;
|
|
61
|
-
noMargin?: boolean;
|
|
62
60
|
collapse?: boolean;
|
|
63
61
|
repeatSubmitDelay?: number | 'infinite';
|
|
64
62
|
icon?: IconType | undefined;
|
|
65
63
|
iconAlign?: 'left' | 'right' | 'above' | 'below';
|
|
66
64
|
iconSize?: 'default' | ComponentSize;
|
|
65
|
+
margin?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
67
66
|
onClick?: ((e?: Event) => void) | undefined;
|
|
68
67
|
children?: Snippet;
|
|
69
68
|
} = $props();
|
|
@@ -88,15 +87,16 @@
|
|
|
88
87
|
}
|
|
89
88
|
};
|
|
90
89
|
|
|
91
|
-
const _iconSize = $derived<ComponentSize>(
|
|
90
|
+
const _iconSize = $derived<ComponentSize>(
|
|
91
|
+
iconSize === 'default' ? (size as ComponentSize) : iconSize
|
|
92
|
+
);
|
|
92
93
|
</script>
|
|
93
94
|
|
|
94
95
|
<button
|
|
95
96
|
{type}
|
|
96
97
|
onclick={handleClick}
|
|
97
|
-
class="{size} w-{width} {variant} {flex ? 'flex' : ''} icon-{iconAlign}"
|
|
98
|
+
class="{size} w-{width} {variant} {flex ? 'flex' : ''} icon-{iconAlign} margin-{margin}"
|
|
98
99
|
class:block
|
|
99
|
-
class:noMargin
|
|
100
100
|
class:collapse
|
|
101
101
|
class:loading
|
|
102
102
|
class:has-icon={!!icon}
|
|
@@ -155,9 +155,29 @@ button[disabled] {
|
|
|
155
155
|
opacity: 0.5;
|
|
156
156
|
cursor: not-allowed;
|
|
157
157
|
}
|
|
158
|
-
button.
|
|
158
|
+
button.margin-none {
|
|
159
159
|
margin: 0;
|
|
160
160
|
}
|
|
161
|
+
button.margin-xs {
|
|
162
|
+
margin-top: var(--spacing-xs);
|
|
163
|
+
margin-bottom: var(--spacing-xs);
|
|
164
|
+
}
|
|
165
|
+
button.margin-sm {
|
|
166
|
+
margin-top: var(--spacing-sm);
|
|
167
|
+
margin-bottom: var(--spacing-sm);
|
|
168
|
+
}
|
|
169
|
+
button.margin-md {
|
|
170
|
+
margin-top: var(--spacing-md);
|
|
171
|
+
margin-bottom: var(--spacing-md);
|
|
172
|
+
}
|
|
173
|
+
button.margin-lg {
|
|
174
|
+
margin-top: var(--spacing-lg);
|
|
175
|
+
margin-bottom: var(--spacing-lg);
|
|
176
|
+
}
|
|
177
|
+
button.margin-xl {
|
|
178
|
+
margin-top: var(--spacing-xl);
|
|
179
|
+
margin-bottom: var(--spacing-xl);
|
|
180
|
+
}
|
|
161
181
|
button.collapse {
|
|
162
182
|
min-width: auto;
|
|
163
183
|
padding: var(--spacing-sm);
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* @component
|
|
4
4
|
*/
|
|
5
5
|
import type { Snippet } from 'svelte';
|
|
6
|
-
import type { ButtonVariant, ComponentWidth,
|
|
6
|
+
import type { ButtonVariant, ComponentWidth, ComponentSize } from '../../types/form.js';
|
|
7
7
|
import type { IconType } from '../../icons/types.js';
|
|
8
|
-
import type { ComponentSize } from '../../types';
|
|
9
8
|
type $$ComponentProps = {
|
|
10
9
|
href?: string | undefined;
|
|
11
|
-
size?:
|
|
10
|
+
size?: ComponentSize;
|
|
12
11
|
width?: ComponentWidth;
|
|
13
12
|
variant?: ButtonVariant;
|
|
14
13
|
type?: 'button' | 'submit' | 'reset';
|
|
@@ -17,12 +16,12 @@ type $$ComponentProps = {
|
|
|
17
16
|
disabled?: boolean;
|
|
18
17
|
loading?: boolean;
|
|
19
18
|
ariaLabel?: string | undefined;
|
|
20
|
-
noMargin?: boolean;
|
|
21
19
|
collapse?: boolean;
|
|
22
20
|
repeatSubmitDelay?: number | 'infinite';
|
|
23
21
|
icon?: IconType | undefined;
|
|
24
22
|
iconAlign?: 'left' | 'right' | 'above' | 'below';
|
|
25
23
|
iconSize?: 'default' | ComponentSize;
|
|
24
|
+
margin?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
26
25
|
onClick?: ((e?: Event) => void) | undefined;
|
|
27
26
|
children?: Snippet;
|
|
28
27
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { untrack } from 'svelte';
|
|
3
|
-
import type { DropdownOption,
|
|
3
|
+
import type { DropdownOption, ComponentSize } from '../../types/form.js';
|
|
4
4
|
import FormField from '../form-field/form-field.svelte';
|
|
5
5
|
import CheckBox from './check-box.svelte';
|
|
6
6
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
let {
|
|
11
11
|
group = $bindable([] as string[]),
|
|
12
12
|
items = [],
|
|
13
|
-
size = '
|
|
13
|
+
size = 'md' as ComponentSize,
|
|
14
14
|
disabled = false,
|
|
15
15
|
required = false,
|
|
16
16
|
onChange,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}: {
|
|
19
19
|
group?: string[];
|
|
20
20
|
items?: DropdownOption[];
|
|
21
|
-
size?:
|
|
21
|
+
size?: ComponentSize;
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
required?: boolean;
|
|
24
24
|
onChange?: ((selected: string[]) => void) | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { DropdownOption,
|
|
1
|
+
import type { DropdownOption, ComponentSize } from '../../types/form.js';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
group?: string[];
|
|
4
4
|
items?: DropdownOption[];
|
|
5
|
-
size?:
|
|
5
|
+
size?: ComponentSize;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
onChange?: ((selected: string[]) => void) | undefined;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
4
|
import Icon from '../../icons/icon.svelte';
|
|
5
5
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
value = '',
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
label,
|
|
15
15
|
ariaLabel,
|
|
16
16
|
children,
|
|
17
|
-
size = '
|
|
17
|
+
size = 'md' as ComponentSize,
|
|
18
18
|
helperText = undefined,
|
|
19
19
|
feedback = undefined,
|
|
20
20
|
required = false,
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
label?: string;
|
|
29
29
|
ariaLabel?: string;
|
|
30
30
|
children?: Snippet;
|
|
31
|
-
size?:
|
|
31
|
+
size?: ComponentSize;
|
|
32
32
|
helperText?: string;
|
|
33
33
|
feedback?: FormFieldFeedback;
|
|
34
34
|
required?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
value?: string;
|
|
6
6
|
isChecked?: boolean;
|
|
@@ -13,7 +13,7 @@ type $$ComponentProps = {
|
|
|
13
13
|
label?: string;
|
|
14
14
|
ariaLabel?: string;
|
|
15
15
|
children?: Snippet;
|
|
16
|
-
size?:
|
|
16
|
+
size?: ComponentSize;
|
|
17
17
|
helperText?: string;
|
|
18
18
|
feedback?: FormFieldFeedback;
|
|
19
19
|
required?: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
ListBox,
|
|
5
5
|
RadioBox,
|
|
6
6
|
type DropdownOption,
|
|
7
|
-
type
|
|
7
|
+
type ComponentSize,
|
|
8
8
|
TextBox
|
|
9
9
|
} from '../../index.js';
|
|
10
10
|
import FlexCol from '../../layout/flex-col.svelte';
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
newValue = $bindable('' as string | null),
|
|
16
16
|
existingValue = $bindable('' as string | null),
|
|
17
17
|
items = [] as DropdownOption[],
|
|
18
|
-
size = '
|
|
18
|
+
size = 'md' as ComponentSize,
|
|
19
19
|
disabled = false,
|
|
20
20
|
required = false,
|
|
21
21
|
searchable = false,
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
newValue?: string | null;
|
|
28
28
|
existingValue?: string | null;
|
|
29
29
|
items?: DropdownOption[];
|
|
30
|
-
size?:
|
|
30
|
+
size?: ComponentSize;
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
required?: boolean;
|
|
33
33
|
searchable?: boolean;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type DropdownOption, type
|
|
1
|
+
import { type DropdownOption, type ComponentSize } from '../../index.js';
|
|
2
2
|
import type { SearchFunction } from '../../types/form.js';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
mode?: 'new' | 'existing';
|
|
5
5
|
newValue?: string | null;
|
|
6
6
|
existingValue?: string | null;
|
|
7
7
|
items?: DropdownOption[];
|
|
8
|
-
size?:
|
|
8
|
+
size?: ComponentSize;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
searchable?: boolean;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
11
11
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
12
12
|
import FormInputWrapper from '../form-input-wrapper';
|
|
13
|
-
import type { DateUnit,
|
|
13
|
+
import type { DateUnit, ComponentSize } from '../../index.js';
|
|
14
14
|
import Button from '../button/button.svelte';
|
|
15
15
|
|
|
16
16
|
type DateIncrementStep = { label: string; value: number; unit: DateUnit };
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
let {
|
|
21
21
|
value = $bindable(undefined as string | undefined | null),
|
|
22
22
|
defaultValue = undefined,
|
|
23
|
-
size = '
|
|
23
|
+
size = 'md' as ComponentSize,
|
|
24
24
|
placeholder = '',
|
|
25
25
|
nullable = false,
|
|
26
26
|
disabled = false,
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}: {
|
|
41
41
|
value?: string | undefined | null;
|
|
42
42
|
defaultValue?: string | undefined;
|
|
43
|
-
size?:
|
|
43
|
+
size?: ComponentSize;
|
|
44
44
|
placeholder?: string;
|
|
45
45
|
nullable?: boolean;
|
|
46
46
|
disabled?: boolean;
|
|
@@ -152,11 +152,11 @@
|
|
|
152
152
|
</FormInputWrapper>
|
|
153
153
|
{#if steps.length > 0}
|
|
154
154
|
<span class="steps">
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
155
|
+
{#each steps as step}
|
|
156
|
+
<Button noMargin={true} collapse={true} onClick={() => incrementValue(step)}>
|
|
157
|
+
{step.label}
|
|
158
|
+
</Button>
|
|
159
|
+
{/each}
|
|
160
160
|
</span>
|
|
161
161
|
{/if}
|
|
162
162
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
2
|
-
import type { DateUnit,
|
|
2
|
+
import type { DateUnit, ComponentSize } from '../../index.js';
|
|
3
3
|
type DateIncrementStep = {
|
|
4
4
|
label: string;
|
|
5
5
|
value: number;
|
|
@@ -8,7 +8,7 @@ type DateIncrementStep = {
|
|
|
8
8
|
type $$ComponentProps = {
|
|
9
9
|
value?: string | undefined | null;
|
|
10
10
|
defaultValue?: string | undefined;
|
|
11
|
-
size?:
|
|
11
|
+
size?: ComponentSize;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
nullable?: boolean;
|
|
14
14
|
disabled?: boolean;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
4
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
5
5
|
import FormInputWrapper from '../form-input-wrapper';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
7
7
|
|
|
8
8
|
const baseId = uniqueId();
|
|
9
9
|
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
prefix = null as string | null,
|
|
23
23
|
suffix = null as string | null,
|
|
24
24
|
required = false,
|
|
25
|
-
size = '
|
|
25
|
+
size = 'md' as ComponentSize,
|
|
26
26
|
label = undefined as string | undefined,
|
|
27
27
|
helperText = undefined as string | undefined,
|
|
28
28
|
feedback = undefined as FormFieldFeedback | undefined,
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
prefix?: string | null;
|
|
39
39
|
suffix?: string | null;
|
|
40
40
|
required?: boolean;
|
|
41
|
-
size?:
|
|
41
|
+
size?: ComponentSize;
|
|
42
42
|
label?: string;
|
|
43
43
|
helperText?: string;
|
|
44
44
|
feedback?: FormFieldFeedback;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
dimensions?: string[];
|
|
5
5
|
value?: (number | null)[];
|
|
@@ -10,7 +10,7 @@ type $$ComponentProps = {
|
|
|
10
10
|
prefix?: string | null;
|
|
11
11
|
suffix?: string | null;
|
|
12
12
|
required?: boolean;
|
|
13
|
-
size?:
|
|
13
|
+
size?: ComponentSize;
|
|
14
14
|
label?: string;
|
|
15
15
|
helperText?: string;
|
|
16
16
|
feedback?: FormFieldFeedback;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
4
4
|
import FormField from '../form-field/form-field.svelte';
|
|
5
5
|
import FormInputWrapper from '../form-input-wrapper';
|
|
6
|
-
import type {
|
|
6
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
7
7
|
|
|
8
8
|
const id = uniqueId();
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
value = $bindable(''),
|
|
12
12
|
placeholder = '',
|
|
13
|
-
size = '
|
|
13
|
+
size = 'md' as ComponentSize,
|
|
14
14
|
disabled = false,
|
|
15
15
|
required = false,
|
|
16
16
|
readonly = false,
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}: {
|
|
22
22
|
value?: string;
|
|
23
23
|
placeholder?: string;
|
|
24
|
-
size?:
|
|
24
|
+
size?: ComponentSize;
|
|
25
25
|
disabled?: boolean;
|
|
26
26
|
required?: boolean;
|
|
27
27
|
readonly?: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
2
2
|
type $$ComponentProps = {
|
|
3
3
|
value?: string;
|
|
4
4
|
placeholder?: string;
|
|
5
|
-
size?:
|
|
5
|
+
size?: ComponentSize;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
readonly?: boolean;
|
package/dist/forms/form.svelte
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import Section from '../generic/section/section.svelte';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ComponentWidth } from '../index.js';
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
method = 'get',
|
|
8
8
|
title = undefined,
|
|
9
9
|
action = undefined,
|
|
10
|
-
size = '
|
|
10
|
+
size = 'full',
|
|
11
11
|
onSubmit = undefined,
|
|
12
12
|
children
|
|
13
13
|
}: {
|
|
14
14
|
method?: 'get' | 'post' | 'put' | 'delete';
|
|
15
15
|
title?: string | undefined;
|
|
16
16
|
action?: string | undefined;
|
|
17
|
-
size?:
|
|
17
|
+
size?: ComponentWidth;
|
|
18
18
|
onSubmit?: (() => void) | undefined;
|
|
19
19
|
children: Snippet;
|
|
20
20
|
} = $props();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ComponentWidth } from '../index.js';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
method?: 'get' | 'post' | 'put' | 'delete';
|
|
5
5
|
title?: string | undefined;
|
|
6
6
|
action?: string | undefined;
|
|
7
|
-
size?:
|
|
7
|
+
size?: ComponentWidth;
|
|
8
8
|
onSubmit?: (() => void) | undefined;
|
|
9
9
|
children: Snippet;
|
|
10
10
|
};
|
package/dist/forms/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export { default as NewOrExistingCombo } from './combo/new-or-existing-combo.sve
|
|
|
10
10
|
export { default as NumberBox } from './number-box/number-box.svelte';
|
|
11
11
|
export { default as NumberRangeBox } from './number-range-box/number-range-box.svelte';
|
|
12
12
|
export { default as PhoneBox } from './phone-box/phone-box.svelte';
|
|
13
|
-
export { default as ReferenceBox } from './reference-box/reference-box.svelte';
|
|
14
13
|
export { default as Slider } from './slider/slider.svelte';
|
|
15
14
|
export { default as TagBox } from './tag-box/tag-box.svelte';
|
|
16
15
|
export { default as TextArea } from './text-area/text-area.svelte';
|
|
@@ -30,4 +29,5 @@ export type { AdditionalButton } from './form-actions/form-actions.svelte';
|
|
|
30
29
|
export * from './check-box/index.js';
|
|
31
30
|
export * from './phone-box/index.js';
|
|
32
31
|
export * from './radio-group/index.js';
|
|
32
|
+
export * from './reference-box/index.js';
|
|
33
33
|
export * from './validation.js';
|
package/dist/forms/index.js
CHANGED
|
@@ -11,7 +11,6 @@ export { default as NewOrExistingCombo } from './combo/new-or-existing-combo.sve
|
|
|
11
11
|
export { default as NumberBox } from './number-box/number-box.svelte';
|
|
12
12
|
export { default as NumberRangeBox } from './number-range-box/number-range-box.svelte';
|
|
13
13
|
export { default as PhoneBox } from './phone-box/phone-box.svelte';
|
|
14
|
-
export { default as ReferenceBox } from './reference-box/reference-box.svelte';
|
|
15
14
|
export { default as Slider } from './slider/slider.svelte';
|
|
16
15
|
export { default as TagBox } from './tag-box/tag-box.svelte';
|
|
17
16
|
export { default as TextArea } from './text-area/text-area.svelte';
|
|
@@ -32,5 +31,6 @@ export { default as FormRow } from './form-row/form-row.svelte';
|
|
|
32
31
|
export * from './check-box/index.js';
|
|
33
32
|
export * from './phone-box/index.js';
|
|
34
33
|
export * from './radio-group/index.js';
|
|
34
|
+
export * from './reference-box/index.js';
|
|
35
35
|
// Validation utilities
|
|
36
36
|
export * from './validation.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import Icon from '../../icons/icon.svelte';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ComponentSize } from '../../index.js';
|
|
4
4
|
import FormField from '../form-field/form-field.svelte';
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
|
-
size = 'md' as
|
|
7
|
+
size = 'md' as ComponentSize,
|
|
8
8
|
value,
|
|
9
9
|
href = undefined,
|
|
10
10
|
label = undefined
|
|
11
11
|
}: {
|
|
12
|
-
size?:
|
|
12
|
+
size?: ComponentSize;
|
|
13
13
|
value: string | null;
|
|
14
14
|
href?: string;
|
|
15
15
|
label?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { DropdownOption,
|
|
2
|
+
import type { DropdownOption, ComponentSize, MenuOption } from '../../types/form.js';
|
|
3
3
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
4
4
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
5
5
|
import Menu from '../../generic/menu/menu.svelte';
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
let {
|
|
15
15
|
value = $bindable(null as string | null),
|
|
16
16
|
items = [] as DropdownOption[],
|
|
17
|
-
size = '
|
|
17
|
+
size = 'md',
|
|
18
18
|
disabled = false,
|
|
19
19
|
required = false,
|
|
20
20
|
readonly = false,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}: {
|
|
35
35
|
value?: string | null;
|
|
36
36
|
items?: DropdownOption[];
|
|
37
|
-
size?:
|
|
37
|
+
size?: ComponentSize;
|
|
38
38
|
disabled?: boolean;
|
|
39
39
|
required?: boolean;
|
|
40
40
|
readonly?: boolean;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { DropdownOption,
|
|
1
|
+
import type { DropdownOption, ComponentSize } from '../../types/form.js';
|
|
2
2
|
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
3
3
|
import type { CreateNewFunction, SearchFunction } from '../../types/form.js';
|
|
4
4
|
type $$ComponentProps = {
|
|
5
5
|
value?: string | null;
|
|
6
6
|
items?: DropdownOption[];
|
|
7
|
-
size?:
|
|
7
|
+
size?: ComponentSize;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
required?: boolean;
|
|
10
10
|
readonly?: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { uniqueId, type
|
|
2
|
+
import { uniqueId, type ComponentSize } from '../../index.js';
|
|
3
3
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
4
4
|
import FormInputWrapper from '../form-input-wrapper';
|
|
5
5
|
import { untrack } from 'svelte';
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
currency = 'USD',
|
|
14
14
|
allowCents = true,
|
|
15
15
|
placeholder = '',
|
|
16
|
-
size = '
|
|
16
|
+
size = 'md' as ComponentSize,
|
|
17
17
|
units = 'ones' as 'ones' | 'cents',
|
|
18
18
|
min = 0,
|
|
19
19
|
max = null as number | null,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
currency?: string;
|
|
37
37
|
allowCents?: boolean;
|
|
38
38
|
placeholder?: string;
|
|
39
|
-
size?:
|
|
39
|
+
size?: ComponentSize;
|
|
40
40
|
units?: 'ones' | 'cents';
|
|
41
41
|
min?: number;
|
|
42
42
|
max?: number | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentSize } from '../../index.js';
|
|
2
2
|
import { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
value?: number | null;
|
|
@@ -7,7 +7,7 @@ type $$ComponentProps = {
|
|
|
7
7
|
currency?: string;
|
|
8
8
|
allowCents?: boolean;
|
|
9
9
|
placeholder?: string;
|
|
10
|
-
size?:
|
|
10
|
+
size?: ComponentSize;
|
|
11
11
|
units?: 'ones' | 'cents';
|
|
12
12
|
min?: number;
|
|
13
13
|
max?: number | null;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { uniqueId } from '../../helpers/unique-id.js';
|
|
5
5
|
import FormField, { type FormFieldFeedback } from '../form-field/form-field.svelte';
|
|
6
6
|
import FormInputWrapper from '../form-input-wrapper';
|
|
7
|
-
import type {
|
|
7
|
+
import type { ComponentSize } from '../../types/form.js';
|
|
8
8
|
const id = uniqueId();
|
|
9
9
|
|
|
10
10
|
type AllowedInputTypes = 'number' | 'currency';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
let {
|
|
13
13
|
value = $bindable(0 as number | null),
|
|
14
14
|
placeholder = '',
|
|
15
|
-
size = '
|
|
15
|
+
size = 'md' as ComponentSize,
|
|
16
16
|
type = 'number' as AllowedInputTypes,
|
|
17
17
|
min = 0,
|
|
18
18
|
max = 1000000,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}: {
|
|
37
37
|
value?: number | null;
|
|
38
38
|
placeholder?: string;
|
|
39
|
-
size?:
|
|
39
|
+
size?: ComponentSize;
|
|
40
40
|
type?: AllowedInputTypes;
|
|
41
41
|
min?: number;
|
|
42
42
|
max?: number;
|