@ims360/svelte-ivory 0.4.3 → 0.4.4
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Popover } from '../../layout';
|
|
3
3
|
import { ChevronDown } from '@lucide/svelte';
|
|
4
4
|
import { createContext, type Snippet } from 'svelte';
|
|
5
|
+
import type { ClassValue } from 'svelte/elements';
|
|
5
6
|
import Input, { type InputProps } from '../Input.svelte';
|
|
6
7
|
|
|
7
8
|
export interface SelectContext {
|
|
@@ -16,9 +17,15 @@
|
|
|
16
17
|
interface Props extends InputProps<string> {
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
children: Snippet;
|
|
20
|
+
popoverClass?: ClassValue;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
let {
|
|
23
|
+
let {
|
|
24
|
+
placeholder = 'bg-surface-50-950 flex flex-col gap-2 rounded-container p-2 shadow',
|
|
25
|
+
children,
|
|
26
|
+
popoverClass,
|
|
27
|
+
...props
|
|
28
|
+
}: Props = $props();
|
|
22
29
|
|
|
23
30
|
let button = $state<HTMLButtonElement | undefined>();
|
|
24
31
|
let buttonWidth = $state<number>(200);
|
|
@@ -62,7 +69,7 @@
|
|
|
62
69
|
|
|
63
70
|
<Popover
|
|
64
71
|
bind:this={popover}
|
|
65
|
-
class=
|
|
72
|
+
class={popoverClass}
|
|
66
73
|
style={`min-width: ${buttonWidth}px`}
|
|
67
74
|
target={button}
|
|
68
75
|
>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { ClassValue } from 'svelte/elements';
|
|
2
3
|
import { type InputProps } from '../Input.svelte';
|
|
3
4
|
export interface SelectContext {
|
|
4
5
|
select: (value: string, snippet: Snippet) => void;
|
|
@@ -8,6 +9,7 @@ export declare const getSelectContext: () => SelectContext, setSelectContext: (c
|
|
|
8
9
|
interface Props extends InputProps<string> {
|
|
9
10
|
placeholder?: string;
|
|
10
11
|
children: Snippet;
|
|
12
|
+
popoverClass?: ClassValue;
|
|
11
13
|
}
|
|
12
14
|
declare const Select: import("svelte").Component<Props, {}, "">;
|
|
13
15
|
type Select = ReturnType<typeof Select>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/inputs/select/Select.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CACpC;AAED,eAAO,MAAO,gBAAgB,uBAAE,gBAAgB,2CAAkC,CAAC;AAEnF,UAAU,KAAM,SAAQ,UAAU,CAAC,MAAM,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/inputs/select/Select.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAiB,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAc,EAAE,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CACpC;AAED,eAAO,MAAO,gBAAgB,uBAAE,gBAAgB,2CAAkC,CAAC;AAEnF,UAAU,KAAM,SAAQ,UAAU,CAAC,MAAM,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,UAAU,CAAC;CAC7B;AAqDL,QAAA,MAAM,MAAM,2CAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Popover } from '$lib/components/layout';
|
|
3
3
|
import { ChevronDown } from '@lucide/svelte';
|
|
4
4
|
import { createContext, type Snippet } from 'svelte';
|
|
5
|
+
import type { ClassValue } from 'svelte/elements';
|
|
5
6
|
import Input, { type InputProps } from '../Input.svelte';
|
|
6
7
|
|
|
7
8
|
export interface SelectContext {
|
|
@@ -16,9 +17,15 @@
|
|
|
16
17
|
interface Props extends InputProps<string> {
|
|
17
18
|
placeholder?: string;
|
|
18
19
|
children: Snippet;
|
|
20
|
+
popoverClass?: ClassValue;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
let {
|
|
23
|
+
let {
|
|
24
|
+
placeholder = 'bg-surface-50-950 flex flex-col gap-2 rounded-container p-2 shadow',
|
|
25
|
+
children,
|
|
26
|
+
popoverClass,
|
|
27
|
+
...props
|
|
28
|
+
}: Props = $props();
|
|
22
29
|
|
|
23
30
|
let button = $state<HTMLButtonElement | undefined>();
|
|
24
31
|
let buttonWidth = $state<number>(200);
|
|
@@ -62,7 +69,7 @@
|
|
|
62
69
|
|
|
63
70
|
<Popover
|
|
64
71
|
bind:this={popover}
|
|
65
|
-
class=
|
|
72
|
+
class={popoverClass}
|
|
66
73
|
style={`min-width: ${buttonWidth}px`}
|
|
67
74
|
target={button}
|
|
68
75
|
>
|