@djcali570/component-lib 0.0.5 → 0.0.7
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 +23 -5
- package/dist/Accordion5.svelte +3 -13
- package/dist/Accordion5.svelte.d.ts +1 -5
- package/dist/DropDown5.svelte +3 -16
- package/dist/DropDown5.svelte.d.ts +2 -13
- package/dist/index.d.ts +3 -0
- package/dist/types.d.ts +14 -0
- package/dist/types.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,8 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
Components:
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
## Accordion
|
|
6
|
+
|
|
7
|
+
Customize the accordion color scheme
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
import { Accordion5 } from '@djcali570/component-lib';
|
|
11
|
+
import type { Accordion5ColorScheme } from '@djcali570/component-lib';
|
|
12
|
+
|
|
13
|
+
let acs: Accordion5ColorScheme = {
|
|
14
|
+
bgColor: '#121212',
|
|
15
|
+
textColor: '#D6D6D6',
|
|
16
|
+
triggerColor: '#D6D6D6'
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Use of the Accordion component
|
|
21
|
+
```
|
|
22
|
+
<Accordion5 colorScheme={acs} title='My Title'>
|
|
23
|
+
{#snippet panel()}
|
|
24
|
+
<p>Accordion Contents</p>
|
|
25
|
+
{/Snippet}
|
|
26
|
+
</Accordion5>
|
|
27
|
+
```
|
package/dist/Accordion5.svelte
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
|
-
|
|
4
|
-
// Define colorScheme type
|
|
5
|
-
interface Accordion5ColorScheme {
|
|
6
|
-
bgColor: string;
|
|
7
|
-
textColor: string;
|
|
8
|
-
triggerColor: string;
|
|
9
|
-
}
|
|
3
|
+
import type { Accordion5ColorScheme } from './types.js';
|
|
10
4
|
|
|
11
5
|
// Props with typed colorScheme
|
|
12
6
|
let {
|
|
@@ -96,7 +90,7 @@
|
|
|
96
90
|
|
|
97
91
|
button {
|
|
98
92
|
width: 100%;
|
|
99
|
-
padding: 0.5rem;
|
|
93
|
+
padding-block: 0.5rem;
|
|
100
94
|
font-size: 1rem;
|
|
101
95
|
cursor: pointer;
|
|
102
96
|
border: none;
|
|
@@ -120,7 +114,7 @@
|
|
|
120
114
|
|
|
121
115
|
.panel-head-icon-container {
|
|
122
116
|
display: flex;
|
|
123
|
-
justify-content:
|
|
117
|
+
justify-content: flex-end;
|
|
124
118
|
align-items: center;
|
|
125
119
|
width: 1.5rem;
|
|
126
120
|
height: 1.5rem;
|
|
@@ -137,10 +131,6 @@
|
|
|
137
131
|
max-height: 0;
|
|
138
132
|
transition: max-height 400ms ease-in-out;
|
|
139
133
|
}
|
|
140
|
-
|
|
141
|
-
.accPanel-inner {
|
|
142
|
-
padding: 1rem;
|
|
143
|
-
}
|
|
144
134
|
.panel-head-icon.open {
|
|
145
135
|
transform: rotate(180deg);
|
|
146
136
|
}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
|
-
|
|
3
|
-
bgColor: string;
|
|
4
|
-
textColor: string;
|
|
5
|
-
triggerColor: string;
|
|
6
|
-
}
|
|
2
|
+
import type { Accordion5ColorScheme } from './types.js';
|
|
7
3
|
type $$ComponentProps = {
|
|
8
4
|
colorScheme?: Partial<Accordion5ColorScheme>;
|
|
9
5
|
title?: string;
|
package/dist/DropDown5.svelte
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
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 { DropDownItem } from './types.js';
|
|
19
6
|
|
|
20
7
|
let {
|
|
21
8
|
colorScheme = {
|
|
@@ -271,7 +258,7 @@
|
|
|
271
258
|
padding-top: 0.5rem;
|
|
272
259
|
}
|
|
273
260
|
.dropdown5__input {
|
|
274
|
-
display: flex;
|
|
261
|
+
display: flex;
|
|
275
262
|
padding-inline: 0.75rem;
|
|
276
263
|
color: var(--dropdown5__textColor);
|
|
277
264
|
}
|
|
@@ -1,15 +1,4 @@
|
|
|
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 { DropDownItem } from './types.js';
|
|
13
2
|
type $$ComponentProps = {
|
|
14
3
|
colorScheme?: any;
|
|
15
4
|
name?: string;
|
|
@@ -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/index.d.ts
CHANGED
|
@@ -3,4 +3,7 @@ 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
8
|
export { DatePicker5, Input5, DropDown5, TimePicker5, Accordion5 };
|
|
9
|
+
export type { Accordion5ColorScheme, DropDownItem };
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
export interface Accordion5ColorScheme {
|
|
3
|
+
bgColor?: string;
|
|
4
|
+
textColor?: string;
|
|
5
|
+
triggerColor?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DropDownItem<TProps extends Record<string, any> = {}> {
|
|
8
|
+
id?: string;
|
|
9
|
+
value: string;
|
|
10
|
+
extraValue?: string;
|
|
11
|
+
component?: Component<TProps>;
|
|
12
|
+
componentStyles?: string;
|
|
13
|
+
props?: TProps;
|
|
14
|
+
}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|