@djcali570/component-lib 0.0.6 → 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/Accordion5.svelte +2 -6
- package/dist/DatePicker5.svelte +26 -20
- package/dist/DatePicker5.svelte.d.ts +2 -1
- package/dist/DropDown5.svelte +20 -28
- package/dist/DropDown5.svelte.d.ts +3 -14
- 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 -2
- package/dist/types.d.ts +63 -3
- package/package.json +1 -1
package/dist/Accordion5.svelte
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
|
|
91
91
|
button {
|
|
92
92
|
width: 100%;
|
|
93
|
-
padding: 0.5rem;
|
|
93
|
+
padding-block: 0.5rem;
|
|
94
94
|
font-size: 1rem;
|
|
95
95
|
cursor: pointer;
|
|
96
96
|
border: none;
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
|
|
115
115
|
.panel-head-icon-container {
|
|
116
116
|
display: flex;
|
|
117
|
-
justify-content:
|
|
117
|
+
justify-content: flex-end;
|
|
118
118
|
align-items: center;
|
|
119
119
|
width: 1.5rem;
|
|
120
120
|
height: 1.5rem;
|
|
@@ -131,10 +131,6 @@
|
|
|
131
131
|
max-height: 0;
|
|
132
132
|
transition: max-height 400ms ease-in-out;
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
.accPanel-inner {
|
|
136
|
-
padding: 1rem;
|
|
137
|
-
}
|
|
138
134
|
.panel-head-icon.open {
|
|
139
135
|
transform: rotate(180deg);
|
|
140
136
|
}
|
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
|
@@ -1,34 +1,11 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
/**
|
|
3
|
-
* Dropdown5 v0.0.1
|
|
4
|
-
*/
|
|
5
|
-
export interface DropDownItem<TProps extends Record<string, any> = {}> {
|
|
6
|
-
id?: string;
|
|
7
|
-
value: string;
|
|
8
|
-
extraValue?: string;
|
|
9
|
-
component?: Component<TProps>;
|
|
10
|
-
componentStyles?: string;
|
|
11
|
-
props?: TProps;
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
1
|
<script lang="ts">
|
|
16
2
|
import { browser } from '$app/environment';
|
|
17
|
-
import { onDestroy, onMount
|
|
3
|
+
import { onDestroy, onMount } from 'svelte';
|
|
18
4
|
import { fly } from 'svelte/transition';
|
|
5
|
+
import type { DropDown5ColorScheme, DropDownItem } from './types.js';
|
|
19
6
|
|
|
20
7
|
let {
|
|
21
|
-
colorScheme = {
|
|
22
|
-
textColor: '#D6D6D6',
|
|
23
|
-
bgColor: '#121212',
|
|
24
|
-
borderColor: '#262626',
|
|
25
|
-
titleColor: '#989A9A',
|
|
26
|
-
dropdownBgColor: '#141414',
|
|
27
|
-
focusedColor: '#4787ac',
|
|
28
|
-
itemTextColor: '#D6D6D6',
|
|
29
|
-
itemHoverBgColor: '#4787ac',
|
|
30
|
-
itemHoverTextColor: '#121212'
|
|
31
|
-
},
|
|
8
|
+
colorScheme: partialColorScheme = {},
|
|
32
9
|
name = 'dropdown',
|
|
33
10
|
title = 'Title',
|
|
34
11
|
value = $bindable(),
|
|
@@ -38,7 +15,7 @@
|
|
|
38
15
|
disabled = false,
|
|
39
16
|
dropdownItems = [] as DropDownItem[]
|
|
40
17
|
}: {
|
|
41
|
-
colorScheme?:
|
|
18
|
+
colorScheme?: Partial<DropDown5ColorScheme>;
|
|
42
19
|
name?: string;
|
|
43
20
|
title?: string;
|
|
44
21
|
value: any;
|
|
@@ -49,6 +26,21 @@
|
|
|
49
26
|
dropdownItems?: DropDownItem[];
|
|
50
27
|
} = $props();
|
|
51
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
|
+
|
|
52
44
|
const id = generateRandomString();
|
|
53
45
|
let showDropdown = $state(false);
|
|
54
46
|
let dropdownRef: HTMLDivElement | null = $state(null);
|
|
@@ -271,7 +263,7 @@
|
|
|
271
263
|
padding-top: 0.5rem;
|
|
272
264
|
}
|
|
273
265
|
.dropdown5__input {
|
|
274
|
-
display: flex;
|
|
266
|
+
display: flex;
|
|
275
267
|
padding-inline: 0.75rem;
|
|
276
268
|
color: var(--dropdown5__textColor);
|
|
277
269
|
}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
* Dropdown5 v0.0.1
|
|
3
|
-
*/
|
|
4
|
-
export interface DropDownItem<TProps extends Record<string, any> = {}> {
|
|
5
|
-
id?: string;
|
|
6
|
-
value: string;
|
|
7
|
-
extraValue?: string;
|
|
8
|
-
component?: Component<TProps>;
|
|
9
|
-
componentStyles?: string;
|
|
10
|
-
props?: TProps;
|
|
11
|
-
}
|
|
12
|
-
import { type Component } from 'svelte';
|
|
1
|
+
import type { DropDown5ColorScheme, DropDownItem } from './types.js';
|
|
13
2
|
type $$ComponentProps = {
|
|
14
|
-
colorScheme?:
|
|
3
|
+
colorScheme?: Partial<DropDown5ColorScheme>;
|
|
15
4
|
name?: string;
|
|
16
5
|
title?: string;
|
|
17
6
|
value: any;
|
|
@@ -21,6 +10,6 @@ type $$ComponentProps = {
|
|
|
21
10
|
disabled?: boolean;
|
|
22
11
|
dropdownItems?: DropDownItem[];
|
|
23
12
|
};
|
|
24
|
-
declare const DropDown5: Component<$$ComponentProps, {}, "value" | "valueKey" | "extraValue">;
|
|
13
|
+
declare const DropDown5: import("svelte").Component<$$ComponentProps, {}, "value" | "valueKey" | "extraValue">;
|
|
25
14
|
type DropDown5 = ReturnType<typeof DropDown5>;
|
|
26
15
|
export default DropDown5;
|
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,6 +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";
|
|
6
|
+
import type { Input5ColorScheme, DatePicker5ColorScheme, TimePicker5ColorScheme, DropDownItem, DropDown5ColorScheme, Accordion5ColorScheme } from "./types.js";
|
|
7
7
|
export { DatePicker5, Input5, DropDown5, TimePicker5, Accordion5 };
|
|
8
|
-
export type { Accordion5ColorScheme };
|
|
8
|
+
export type { Input5ColorScheme, DatePicker5ColorScheme, TimePicker5ColorScheme, Accordion5ColorScheme, DropDown5ColorScheme, DropDownItem };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 {
|
|
3
33
|
textColor: string;
|
|
4
|
-
|
|
34
|
+
bgColor: string;
|
|
35
|
+
borderColor: string;
|
|
36
|
+
focusedColor: string;
|
|
37
|
+
titleColor: string;
|
|
38
|
+
clearColor: string;
|
|
39
|
+
clearHoverColor: string;
|
|
40
|
+
dropdownBgColor: string;
|
|
41
|
+
}
|
|
42
|
+
export interface Accordion5ColorScheme {
|
|
43
|
+
bgColor?: string;
|
|
44
|
+
textColor?: string;
|
|
45
|
+
triggerColor?: string;
|
|
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
|
+
}
|
|
58
|
+
export interface DropDownItem<TProps extends Record<string, any> = {}> {
|
|
59
|
+
id?: string;
|
|
60
|
+
value: string;
|
|
61
|
+
extraValue?: string;
|
|
62
|
+
component?: Component<TProps>;
|
|
63
|
+
componentStyles?: string;
|
|
64
|
+
props?: TProps;
|
|
5
65
|
}
|