lithesome 0.2.1 → 0.2.3
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/components/Pin/Pin.svelte +1 -1
- package/dist/components/Pin/Pin.svelte.d.ts +1 -1
- package/dist/components/Pin/PinInput.svelte +1 -2
- package/dist/components/Pin/PinInput.svelte.d.ts +0 -2
- package/dist/components/Popover/Popover.svelte +11 -3
- package/dist/components/Popover/Popover.svelte.d.ts +3 -1
- package/dist/components/RadioGroup/context.svelte.js +1 -0
- package/dist/components/Select/SelectValue.svelte +1 -1
- package/dist/components/Tabs/Tabs.svelte +3 -2
- package/dist/components/Tabs/Tabs.svelte.d.ts +3 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ declare const __propDef: {
|
|
|
18
18
|
props: BaseProps<HTMLDivElement, {
|
|
19
19
|
filled: boolean;
|
|
20
20
|
}> & {
|
|
21
|
-
value
|
|
21
|
+
value?: string[] | undefined;
|
|
22
22
|
disabled?: boolean | undefined;
|
|
23
23
|
type?: "text" | "password" | undefined;
|
|
24
24
|
placeholder?: string | undefined;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
KEYS
|
|
7
7
|
} from "../../internal/index.js";
|
|
8
8
|
import { onMount, tick } from "svelte";
|
|
9
|
-
let { class: klass, use = [], self,
|
|
9
|
+
let { class: klass, use = [], self, onKeydown, onInput, onFocus, onBlur, ...props } = $props();
|
|
10
10
|
let value = $state("");
|
|
11
11
|
const API = context();
|
|
12
12
|
const { uid } = createUID("input");
|
|
@@ -100,7 +100,6 @@ const moveFocus = (direction) => {
|
|
|
100
100
|
bind:value
|
|
101
101
|
id={uid()}
|
|
102
102
|
class={classProp}
|
|
103
|
-
{name}
|
|
104
103
|
disabled={API.disabled}
|
|
105
104
|
placeholder={focused ? '' : API.placeholder}
|
|
106
105
|
data-pininput=""
|
|
@@ -5,8 +5,6 @@ declare const __propDef: {
|
|
|
5
5
|
filled: boolean;
|
|
6
6
|
disabled: boolean;
|
|
7
7
|
}>, "children"> & {
|
|
8
|
-
/** The HTML Input element name attribute. */
|
|
9
|
-
name?: string | undefined;
|
|
10
8
|
onKeydown?: Handler<KeyboardEvent, HTMLInputElement> | undefined;
|
|
11
9
|
onInput?: Handler<Event, HTMLInputElement> | undefined;
|
|
12
10
|
onFocus?: Handler<FocusEvent, HTMLInputElement> | undefined;
|
|
@@ -13,7 +13,7 @@ const API = createContext(uid, visible, {
|
|
|
13
13
|
visible = val;
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
const classProp = $derived(typeof klass === "function" ? klass({}) : klass);
|
|
16
|
+
const classProp = $derived(typeof klass === "function" ? klass({ visible: API.visible }) : klass);
|
|
17
17
|
setContext(contextName, API);
|
|
18
18
|
const handleKeys = (e) => {
|
|
19
19
|
const { key } = e;
|
|
@@ -32,6 +32,14 @@ $effect(() => {
|
|
|
32
32
|
});
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
<div
|
|
36
|
-
{
|
|
35
|
+
<div
|
|
36
|
+
bind:this={self}
|
|
37
|
+
use:useActions={use}
|
|
38
|
+
id={uid()}
|
|
39
|
+
class={classProp}
|
|
40
|
+
data-popover=""
|
|
41
|
+
data-state={API.visible ? 'opened' : 'closed'}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
{@render children({ visible: API.visible })}
|
|
37
45
|
</div>
|
|
@@ -12,7 +12,9 @@ export declare const context: () => {
|
|
|
12
12
|
};
|
|
13
13
|
import { type BaseProps } from '../../internal/index.js';
|
|
14
14
|
declare const __propDef: {
|
|
15
|
-
props: BaseProps<HTMLDivElement,
|
|
15
|
+
props: BaseProps<HTMLDivElement, {
|
|
16
|
+
visible: boolean;
|
|
17
|
+
}> & {
|
|
16
18
|
visible?: boolean | undefined;
|
|
17
19
|
};
|
|
18
20
|
events: {
|
|
@@ -12,6 +12,7 @@ export const createContext = (uid, value, hooks) => {
|
|
|
12
12
|
},
|
|
13
13
|
navigateItems(action) {
|
|
14
14
|
selectedIndex = calculateIndex(action, items, selectedIndex);
|
|
15
|
+
document.querySelector(`[data-radiogroupitem][data-value="${selectedItem.value}"]`)?.focus();
|
|
15
16
|
},
|
|
16
17
|
setSelected(item) {
|
|
17
18
|
selectedIndex = items.findIndex((el) => el.value === item.value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { context } from "./Select.svelte";
|
|
2
2
|
import { useActions } from "../../internal/index.js";
|
|
3
|
-
let { class: klass, use = [], self, placeholder, ...props } = $props();
|
|
3
|
+
let { class: klass, use = [], self, placeholder = "Select an option...", ...props } = $props();
|
|
4
4
|
const API = context();
|
|
5
5
|
const placeholderVisible = $derived(API.selectedOptions.length === 0);
|
|
6
6
|
const classProp = $derived(typeof klass === "function" ? klass({ placeholderVisible }) : klass);
|
|
@@ -12,7 +12,7 @@ const API = createContext(uid, {
|
|
|
12
12
|
orientation,
|
|
13
13
|
value
|
|
14
14
|
});
|
|
15
|
-
const classProp = $derived(typeof klass === "function" ? klass({}) : klass);
|
|
15
|
+
const classProp = $derived(typeof klass === "function" ? klass({ active: API.activeTab }) : klass);
|
|
16
16
|
setContext(contextName, API);
|
|
17
17
|
$effect(() => {
|
|
18
18
|
API.setOrientation(orientation);
|
|
@@ -26,7 +26,8 @@ $effect(() => {
|
|
|
26
26
|
class={classProp}
|
|
27
27
|
data-tabs=""
|
|
28
28
|
data-orientation={orientation}
|
|
29
|
+
data-active={API.activeTab}
|
|
29
30
|
{...props}
|
|
30
31
|
>
|
|
31
|
-
{@render children({})}
|
|
32
|
+
{@render children({ active: API.activeTab })}
|
|
32
33
|
</div>
|
|
@@ -11,7 +11,9 @@ export declare const context: () => {
|
|
|
11
11
|
};
|
|
12
12
|
import { type BaseProps } from '../../internal/index.js';
|
|
13
13
|
declare const __propDef: {
|
|
14
|
-
props: BaseProps<HTMLDivElement,
|
|
14
|
+
props: BaseProps<HTMLDivElement, {
|
|
15
|
+
active: string;
|
|
16
|
+
}> & {
|
|
15
17
|
orientation?: "horizontal" | "vertical" | undefined;
|
|
16
18
|
value?: string | undefined;
|
|
17
19
|
};
|