@djcali570/component-lib 0.0.7 → 0.0.8
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/DatePicker5.svelte +26 -20
- package/dist/DatePicker5.svelte.d.ts +2 -1
- package/dist/DropDown5.svelte +18 -13
- package/dist/DropDown5.svelte.d.ts +2 -2
- package/dist/Input5.svelte +20 -13
- package/dist/Input5.svelte.d.ts +2 -1
- package/dist/TimePicker5.svelte +17 -11
- package/dist/TimePicker5.svelte.d.ts +2 -1
- package/dist/index.d.ts +2 -3
- package/dist/types.d.ts +51 -0
- package/package.json +1 -1
package/dist/DatePicker5.svelte
CHANGED
|
@@ -1,31 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { browser } from '$app/environment';
|
|
3
3
|
import { fly } from 'svelte/transition';
|
|
4
|
+
import type { DatePicker5ColorScheme } from './types.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Date Picker 5 v0.0.1
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
|
-
colorScheme = {
|
|
11
|
-
labelTextColor: '#989A9A',
|
|
12
|
-
inputTextColor: '#D6D6D6',
|
|
13
|
-
inputBgColor: '#121212',
|
|
14
|
-
inputBorderColor: '#262626',
|
|
15
|
-
inputFocusedBorderColor: '#4787ac',
|
|
16
|
-
inputClearColor: '#989A9A',
|
|
17
|
-
inputClearHoverColor: '#1F2023',
|
|
18
|
-
placeholderColor: '#46464A',
|
|
19
|
-
pickerBgColor: '#121212',
|
|
20
|
-
pickerMonthBgColor: '#121212',
|
|
21
|
-
pickerTextColor: '#D6D6D6',
|
|
22
|
-
pickerInactiveDayColor: '#46464A',
|
|
23
|
-
pickerTodayColor: '#BF3131',
|
|
24
|
-
pickerSelectedDayBgColor: '#4787ac',
|
|
25
|
-
pickerSelectedDayTextColor: '#121212',
|
|
26
|
-
pickerChevronHoverColor: '#1F2023',
|
|
27
|
-
pickerMaxHeight: '340px'
|
|
28
|
-
},
|
|
11
|
+
colorScheme: partialColorScheme = {},
|
|
29
12
|
title = '',
|
|
30
13
|
name = '',
|
|
31
14
|
dateText = $bindable(),
|
|
@@ -38,6 +21,7 @@
|
|
|
38
21
|
disabled = false,
|
|
39
22
|
onDateUpdate = (date: string) => {}
|
|
40
23
|
}: {
|
|
24
|
+
colorScheme?: Partial<DatePicker5ColorScheme>;
|
|
41
25
|
title: string;
|
|
42
26
|
name: string;
|
|
43
27
|
dateText?: string;
|
|
@@ -48,10 +32,32 @@
|
|
|
48
32
|
radius?: 'right' | 'left' | 'full';
|
|
49
33
|
position?: 'left-0' | 'right-0';
|
|
50
34
|
disabled?: boolean;
|
|
51
|
-
colorScheme?: Record<string, string>;
|
|
52
35
|
onDateUpdate?: (date: string) => void;
|
|
53
36
|
} = $props();
|
|
54
37
|
|
|
38
|
+
const defaultColorScheme: DatePicker5ColorScheme = {
|
|
39
|
+
labelTextColor: '#989A9A',
|
|
40
|
+
inputTextColor: '#D6D6D6',
|
|
41
|
+
inputBgColor: '#121212',
|
|
42
|
+
inputBorderColor: '#262626',
|
|
43
|
+
inputFocusedBorderColor: '#4787ac',
|
|
44
|
+
inputClearColor: '#989A9A',
|
|
45
|
+
inputClearHoverColor: '#1F2023',
|
|
46
|
+
placeholderColor: '#46464A',
|
|
47
|
+
pickerBgColor: '#121212',
|
|
48
|
+
pickerMonthBgColor: '#121212',
|
|
49
|
+
pickerTextColor: '#D6D6D6',
|
|
50
|
+
pickerInactiveDayColor: '#46464A',
|
|
51
|
+
pickerTodayColor: '#BF3131',
|
|
52
|
+
pickerSelectedDayBgColor: '#4787ac',
|
|
53
|
+
pickerSelectedDayTextColor: '#121212',
|
|
54
|
+
pickerChevronHoverColor: '#1F2023',
|
|
55
|
+
pickerMaxHeight: '340px'
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// Merge partial colorScheme with defaults
|
|
59
|
+
const colorScheme = { ...defaultColorScheme, ...partialColorScheme };
|
|
60
|
+
|
|
55
61
|
// Normalize minDate to start of day
|
|
56
62
|
minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
|
|
57
63
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { DatePicker5ColorScheme } from './types.js';
|
|
1
2
|
type $$ComponentProps = {
|
|
3
|
+
colorScheme?: Partial<DatePicker5ColorScheme>;
|
|
2
4
|
title: string;
|
|
3
5
|
name: string;
|
|
4
6
|
dateText?: string;
|
|
@@ -9,7 +11,6 @@ type $$ComponentProps = {
|
|
|
9
11
|
radius?: 'right' | 'left' | 'full';
|
|
10
12
|
position?: 'left-0' | 'right-0';
|
|
11
13
|
disabled?: boolean;
|
|
12
|
-
colorScheme?: Record<string, string>;
|
|
13
14
|
onDateUpdate?: (date: string) => void;
|
|
14
15
|
};
|
|
15
16
|
declare const DatePicker5: import("svelte").Component<$$ComponentProps, {}, "dateText">;
|
package/dist/DropDown5.svelte
CHANGED
|
@@ -2,20 +2,10 @@
|
|
|
2
2
|
import { browser } from '$app/environment';
|
|
3
3
|
import { onDestroy, onMount } from 'svelte';
|
|
4
4
|
import { fly } from 'svelte/transition';
|
|
5
|
-
import type { DropDownItem } from './types.js';
|
|
5
|
+
import type { DropDown5ColorScheme, DropDownItem } from './types.js';
|
|
6
6
|
|
|
7
7
|
let {
|
|
8
|
-
colorScheme = {
|
|
9
|
-
textColor: '#D6D6D6',
|
|
10
|
-
bgColor: '#121212',
|
|
11
|
-
borderColor: '#262626',
|
|
12
|
-
titleColor: '#989A9A',
|
|
13
|
-
dropdownBgColor: '#141414',
|
|
14
|
-
focusedColor: '#4787ac',
|
|
15
|
-
itemTextColor: '#D6D6D6',
|
|
16
|
-
itemHoverBgColor: '#4787ac',
|
|
17
|
-
itemHoverTextColor: '#121212'
|
|
18
|
-
},
|
|
8
|
+
colorScheme: partialColorScheme = {},
|
|
19
9
|
name = 'dropdown',
|
|
20
10
|
title = 'Title',
|
|
21
11
|
value = $bindable(),
|
|
@@ -25,7 +15,7 @@
|
|
|
25
15
|
disabled = false,
|
|
26
16
|
dropdownItems = [] as DropDownItem[]
|
|
27
17
|
}: {
|
|
28
|
-
colorScheme?:
|
|
18
|
+
colorScheme?: Partial<DropDown5ColorScheme>;
|
|
29
19
|
name?: string;
|
|
30
20
|
title?: string;
|
|
31
21
|
value: any;
|
|
@@ -36,6 +26,21 @@
|
|
|
36
26
|
dropdownItems?: DropDownItem[];
|
|
37
27
|
} = $props();
|
|
38
28
|
|
|
29
|
+
const defaultColorScheme: DropDown5ColorScheme = {
|
|
30
|
+
textColor: '#D6D6D6',
|
|
31
|
+
bgColor: '#121212',
|
|
32
|
+
borderColor: '#262626',
|
|
33
|
+
titleColor: '#989A9A',
|
|
34
|
+
dropdownBgColor: '#141414',
|
|
35
|
+
focusedColor: '#4787ac',
|
|
36
|
+
itemTextColor: '#D6D6D6',
|
|
37
|
+
itemHoverBgColor: '#4787ac',
|
|
38
|
+
itemHoverTextColor: '#121212'
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// Merge partial colorScheme with defaults
|
|
42
|
+
const colorScheme = { ...defaultColorScheme, ...partialColorScheme };
|
|
43
|
+
|
|
39
44
|
const id = generateRandomString();
|
|
40
45
|
let showDropdown = $state(false);
|
|
41
46
|
let dropdownRef: HTMLDivElement | null = $state(null);
|
package/dist/Input5.svelte
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
|
+
import type { Input5ColorScheme } from './types.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* Input5 v0.0.
|
|
6
|
+
* Input5 v0.0.2
|
|
6
7
|
*
|
|
8
|
+
* Added color scheme partials
|
|
7
9
|
* Added read only option
|
|
8
10
|
* Allow 4 digits after decimal for floats
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
let {
|
|
12
|
-
colorScheme = {
|
|
13
|
-
mainTextColor: '#D6D6D6',
|
|
14
|
-
mainBgColor: '#121212',
|
|
15
|
-
titleColor: '#989A9A',
|
|
16
|
-
borderColor: '#262626',
|
|
17
|
-
focusedColor: '#4787ac',
|
|
18
|
-
clearColor: '#989A9A',
|
|
19
|
-
clearHoverColor: '#1F2023',
|
|
20
|
-
counterTextColor: '#4787ac',
|
|
21
|
-
counterBgColor: '#1F2023'
|
|
22
|
-
},
|
|
14
|
+
colorScheme: partialColorScheme = {},
|
|
23
15
|
name = 'input',
|
|
24
16
|
title = 'Title',
|
|
25
17
|
value = $bindable(),
|
|
@@ -35,7 +27,7 @@
|
|
|
35
27
|
readonly = false,
|
|
36
28
|
onUpdate = (value) => {}
|
|
37
29
|
}: {
|
|
38
|
-
colorScheme?:
|
|
30
|
+
colorScheme?: Partial<Input5ColorScheme>;
|
|
39
31
|
name?: string;
|
|
40
32
|
title?: string;
|
|
41
33
|
value?: any;
|
|
@@ -52,6 +44,21 @@
|
|
|
52
44
|
onUpdate?: (value: string) => void;
|
|
53
45
|
} = $props();
|
|
54
46
|
|
|
47
|
+
const defaultColorScheme: Input5ColorScheme = {
|
|
48
|
+
mainTextColor: '#D6D6D6',
|
|
49
|
+
mainBgColor: '#121212',
|
|
50
|
+
titleColor: '#989A9A',
|
|
51
|
+
borderColor: '#262626',
|
|
52
|
+
focusedColor: '#4787ac',
|
|
53
|
+
clearColor: '#989A9A',
|
|
54
|
+
clearHoverColor: '#1F2023',
|
|
55
|
+
counterTextColor: '#4787ac',
|
|
56
|
+
counterBgColor: '#1F2023'
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Merge partial colorScheme with defaults
|
|
60
|
+
const colorScheme = { ...defaultColorScheme, ...partialColorScheme };
|
|
61
|
+
|
|
55
62
|
const id = generateRandomString();
|
|
56
63
|
let count = $state(0);
|
|
57
64
|
let inputOldValue: string = $state('');
|
package/dist/Input5.svelte.d.ts
CHANGED
package/dist/TimePicker5.svelte
CHANGED
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import { fly } from 'svelte/transition';
|
|
4
|
+
import type { TimePicker5ColorScheme } from './types.js';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Time Picker 5 v.0.0.1
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
let {
|
|
10
|
-
colorScheme = {
|
|
11
|
-
textColor: '#D6D6D6',
|
|
12
|
-
bgColor: '#121212',
|
|
13
|
-
borderColor: '#262626',
|
|
14
|
-
focusedColor: '#4787ac',
|
|
15
|
-
titleColor: '#989A9A',
|
|
16
|
-
clearColor: '#989A9A',
|
|
17
|
-
clearHoverColor: '#1F2023',
|
|
18
|
-
dropdownBgColor: '#141414'
|
|
19
|
-
},
|
|
11
|
+
colorScheme: partialColorScheme = {},
|
|
20
12
|
timeText = '',
|
|
21
13
|
name = 'timePicker',
|
|
22
14
|
title = 'Title',
|
|
@@ -26,7 +18,7 @@
|
|
|
26
18
|
radius = 'full',
|
|
27
19
|
onTimePicked = (value) => {}
|
|
28
20
|
}: {
|
|
29
|
-
colorScheme?:
|
|
21
|
+
colorScheme?: Partial<TimePicker5ColorScheme>;
|
|
30
22
|
timeText?: string;
|
|
31
23
|
name?: string;
|
|
32
24
|
title?: string;
|
|
@@ -37,6 +29,20 @@
|
|
|
37
29
|
onTimePicked?: (value: string) => void;
|
|
38
30
|
} = $props();
|
|
39
31
|
|
|
32
|
+
const defaultColorScheme: TimePicker5ColorScheme = {
|
|
33
|
+
textColor: '#D6D6D6',
|
|
34
|
+
bgColor: '#121212',
|
|
35
|
+
borderColor: '#262626',
|
|
36
|
+
focusedColor: '#4787ac',
|
|
37
|
+
titleColor: '#989A9A',
|
|
38
|
+
clearColor: '#989A9A',
|
|
39
|
+
clearHoverColor: '#1F2023',
|
|
40
|
+
dropdownBgColor: '#141414'
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// Merge partial colorScheme with defaults
|
|
44
|
+
const colorScheme = { ...defaultColorScheme, ...partialColorScheme };
|
|
45
|
+
|
|
40
46
|
/**
|
|
41
47
|
* Variables, arrays
|
|
42
48
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import DropDown5 from "./DropDown5.svelte";
|
|
|
3
3
|
import Input5 from "./Input5.svelte";
|
|
4
4
|
import TimePicker5 from "./TimePicker5.svelte";
|
|
5
5
|
import Accordion5 from "./Accordion5.svelte";
|
|
6
|
-
import type { Accordion5ColorScheme } from "./types.js";
|
|
7
|
-
import type { DropDownItem } from "./types.js";
|
|
6
|
+
import type { Input5ColorScheme, DatePicker5ColorScheme, TimePicker5ColorScheme, DropDownItem, DropDown5ColorScheme, Accordion5ColorScheme } from "./types.js";
|
|
8
7
|
export { DatePicker5, Input5, DropDown5, TimePicker5, Accordion5 };
|
|
9
|
-
export type { Accordion5ColorScheme, DropDownItem };
|
|
8
|
+
export type { Input5ColorScheme, DatePicker5ColorScheme, TimePicker5ColorScheme, Accordion5ColorScheme, DropDown5ColorScheme, DropDownItem };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,60 @@
|
|
|
1
1
|
import type { Component } from "svelte";
|
|
2
|
+
export interface Input5ColorScheme {
|
|
3
|
+
mainTextColor: string;
|
|
4
|
+
mainBgColor: string;
|
|
5
|
+
titleColor: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
focusedColor: string;
|
|
8
|
+
clearColor: string;
|
|
9
|
+
clearHoverColor: string;
|
|
10
|
+
counterTextColor: string;
|
|
11
|
+
counterBgColor: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DatePicker5ColorScheme {
|
|
14
|
+
labelTextColor: string;
|
|
15
|
+
inputTextColor: string;
|
|
16
|
+
inputBgColor: string;
|
|
17
|
+
inputBorderColor: string;
|
|
18
|
+
inputFocusedBorderColor: string;
|
|
19
|
+
inputClearColor: string;
|
|
20
|
+
inputClearHoverColor: string;
|
|
21
|
+
placeholderColor: string;
|
|
22
|
+
pickerBgColor: string;
|
|
23
|
+
pickerMonthBgColor: string;
|
|
24
|
+
pickerTextColor: string;
|
|
25
|
+
pickerInactiveDayColor: string;
|
|
26
|
+
pickerTodayColor: string;
|
|
27
|
+
pickerSelectedDayBgColor: string;
|
|
28
|
+
pickerSelectedDayTextColor: string;
|
|
29
|
+
pickerChevronHoverColor: string;
|
|
30
|
+
pickerMaxHeight: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TimePicker5ColorScheme {
|
|
33
|
+
textColor: string;
|
|
34
|
+
bgColor: string;
|
|
35
|
+
borderColor: string;
|
|
36
|
+
focusedColor: string;
|
|
37
|
+
titleColor: string;
|
|
38
|
+
clearColor: string;
|
|
39
|
+
clearHoverColor: string;
|
|
40
|
+
dropdownBgColor: string;
|
|
41
|
+
}
|
|
2
42
|
export interface Accordion5ColorScheme {
|
|
3
43
|
bgColor?: string;
|
|
4
44
|
textColor?: string;
|
|
5
45
|
triggerColor?: string;
|
|
6
46
|
}
|
|
47
|
+
export interface DropDown5ColorScheme {
|
|
48
|
+
bgColor?: string;
|
|
49
|
+
textColor?: string;
|
|
50
|
+
borderColor?: string;
|
|
51
|
+
titleColor: string;
|
|
52
|
+
dropdownBgColor: string;
|
|
53
|
+
focusedColor: string;
|
|
54
|
+
itemTextColor: string;
|
|
55
|
+
itemHoverBgColor: string;
|
|
56
|
+
itemHoverTextColor: string;
|
|
57
|
+
}
|
|
7
58
|
export interface DropDownItem<TProps extends Record<string, any> = {}> {
|
|
8
59
|
id?: string;
|
|
9
60
|
value: string;
|