lithesome 0.13.2 → 0.13.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/Accordion/Accordion.svelte +14 -14
- package/dist/components/Accordion/AccordionButton.svelte +18 -18
- package/dist/components/Accordion/AccordionContent.svelte +13 -13
- package/dist/components/Accordion/AccordionHeading.svelte +13 -13
- package/dist/components/Accordion/AccordionItem.svelte +14 -14
- package/dist/components/Checkbox/Checkbox.svelte +18 -18
- package/dist/components/Combobox/Combobox.svelte +15 -15
- package/dist/components/Combobox/ComboboxArrow.svelte +10 -10
- package/dist/components/Combobox/ComboboxContent.svelte +21 -21
- package/dist/components/Combobox/ComboboxInput.svelte +13 -13
- package/dist/components/Combobox/ComboboxOption.svelte +25 -25
- package/dist/components/Hovercard/Hovercard.svelte +15 -15
- package/dist/components/Hovercard/HovercardArrow.svelte +10 -10
- package/dist/components/Hovercard/HovercardContent.svelte +22 -22
- package/dist/components/Hovercard/HovercardTrigger.svelte +11 -11
- package/dist/components/Menu/Menu.svelte +15 -15
- package/dist/components/Menu/MenuArrow.svelte +3 -3
- package/dist/components/Menu/MenuContent.svelte +19 -19
- package/dist/components/Menu/MenuItem.svelte +21 -21
- package/dist/components/Menu/MenuTrigger.svelte +11 -11
- package/dist/components/Modal/Modal.svelte +18 -18
- package/dist/components/Modal/ModalContent.svelte +22 -22
- package/dist/components/Modal/ModalDescription.svelte +12 -12
- package/dist/components/Modal/ModalOverlay.svelte +9 -9
- package/dist/components/Modal/ModalTitle.svelte +5 -5
- package/dist/components/Pin/Pin.svelte +17 -17
- package/dist/components/Pin/PinInput.svelte +19 -19
- package/dist/components/Pin/PinValue.svelte +16 -16
- package/dist/components/Popover/Popover.svelte +15 -15
- package/dist/components/Popover/PopoverArrow.svelte +10 -10
- package/dist/components/Popover/PopoverContent.svelte +31 -31
- package/dist/components/Popover/PopoverTrigger.svelte +11 -11
- package/dist/components/Portal/Portal.svelte +6 -6
- package/dist/components/RadioGroup/RadioGroup.svelte +16 -16
- package/dist/components/RadioGroup/RadioGroupItem.svelte +20 -20
- package/dist/components/Select/Select.svelte +15 -15
- package/dist/components/Select/SelectArrow.svelte +10 -10
- package/dist/components/Select/SelectContent.svelte +20 -20
- package/dist/components/Select/SelectOption.svelte +25 -25
- package/dist/components/Select/SelectTrigger.svelte +12 -12
- package/dist/components/Select/SelectValue.svelte +13 -13
- package/dist/components/Slider/Slider.svelte +22 -22
- package/dist/components/Slider/SliderRange.svelte +17 -17
- package/dist/components/Slider/SliderThumb.svelte +18 -18
- package/dist/components/Slider/SliderValue.svelte +17 -17
- package/dist/components/Switch/Switch.svelte +19 -19
- package/dist/components/Tabs/Tabs.svelte +16 -16
- package/dist/components/Tabs/TabsButton.svelte +18 -18
- package/dist/components/Tabs/TabsContent.svelte +17 -17
- package/dist/components/Tabs/TabsList.svelte +14 -14
- package/dist/components/Toast/Toast.svelte +18 -18
- package/dist/components/Toast/ToastMessage.svelte +12 -12
- package/dist/components/Toast/ToastTitle.svelte +5 -5
- package/dist/components/Toast/Toaster.svelte +13 -13
- package/dist/internal/components/FloatingArrow.svelte +3 -3
- package/dist/internal/components/FloatingContent.svelte +32 -32
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts" context="module">import { setupContext } from "../../internal/index.js";
|
|
2
2
|
import { AccordionContext } from "./context.svelte.js";
|
|
3
3
|
export const { context, contextName } = setupContext();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
6
|
<script lang="ts">import { useActions, classProp } from "../../internal/index.js";
|
|
7
7
|
import { setContext } from "svelte";
|
|
8
8
|
let {
|
|
@@ -19,15 +19,15 @@ setContext(contextName, ctx);
|
|
|
19
19
|
$effect(() => {
|
|
20
20
|
ctx.single = single;
|
|
21
21
|
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<div
|
|
25
|
-
bind:this={self}
|
|
26
|
-
use:useActions={use}
|
|
27
|
-
id={ctx.uid()}
|
|
28
|
-
class={classProp(klass, { active })}
|
|
29
|
-
data-accordion=""
|
|
30
|
-
{...props}
|
|
31
|
-
>
|
|
32
|
-
{@render children({ active })}
|
|
33
|
-
</div>
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div
|
|
25
|
+
bind:this={self}
|
|
26
|
+
use:useActions={use}
|
|
27
|
+
id={ctx.uid()}
|
|
28
|
+
class={classProp(klass, { active })}
|
|
29
|
+
data-accordion=""
|
|
30
|
+
{...props}
|
|
31
|
+
>
|
|
32
|
+
{@render children({ active })}
|
|
33
|
+
</div>
|
|
@@ -11,21 +11,21 @@ const handleClick = (e) => {
|
|
|
11
11
|
if (!item?.disabled)
|
|
12
12
|
ctx.toggle(itemId);
|
|
13
13
|
};
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<button
|
|
17
|
-
type="button"
|
|
18
|
-
bind:this={self}
|
|
19
|
-
use:useActions={use}
|
|
20
|
-
class={classProp(klass, { active, disabled: item?.disabled || false })}
|
|
21
|
-
aria-expanded={active}
|
|
22
|
-
aria-disabled={item?.disabled}
|
|
23
|
-
aria-controls={active ? ctx.uid('content') : undefined}
|
|
24
|
-
tabindex={item?.disabled ? -1 : 0}
|
|
25
|
-
data-accordionbutton=""
|
|
26
|
-
data-active={active || undefined}
|
|
27
|
-
onclick={handleClick}
|
|
28
|
-
{...props}
|
|
29
|
-
>
|
|
30
|
-
{@render children({ active, disabled: item?.disabled || false })}
|
|
31
|
-
</button>
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<button
|
|
17
|
+
type="button"
|
|
18
|
+
bind:this={self}
|
|
19
|
+
use:useActions={use}
|
|
20
|
+
class={classProp(klass, { active, disabled: item?.disabled || false })}
|
|
21
|
+
aria-expanded={active}
|
|
22
|
+
aria-disabled={item?.disabled}
|
|
23
|
+
aria-controls={active ? ctx.uid('content') : undefined}
|
|
24
|
+
tabindex={item?.disabled ? -1 : 0}
|
|
25
|
+
data-accordionbutton=""
|
|
26
|
+
data-active={active || undefined}
|
|
27
|
+
onclick={handleClick}
|
|
28
|
+
{...props}
|
|
29
|
+
>
|
|
30
|
+
{@render children({ active, disabled: item?.disabled || false })}
|
|
31
|
+
</button>
|
|
@@ -12,16 +12,16 @@ const attrs = $derived({
|
|
|
12
12
|
"data-active": active || void 0,
|
|
13
13
|
class: classProp(klass, { active })
|
|
14
14
|
});
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
{#if inTransition && outTransition && active}
|
|
18
|
-
{@const { config: inConf, transition: inFn } = inTransition}
|
|
19
|
-
{@const { config: outConf, transition: outFn } = outTransition}
|
|
20
|
-
<div bind:this={self} use:useActions={use} in:inFn={inConf} out:outFn={outConf} {...attrs} {...props}>
|
|
21
|
-
{@render children({ active })}
|
|
22
|
-
</div>
|
|
23
|
-
{:else if active}
|
|
24
|
-
<div bind:this={self} use:useActions={use} {...attrs} {...props}>
|
|
25
|
-
{@render children({ active })}
|
|
26
|
-
</div>
|
|
27
|
-
{/if}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if inTransition && outTransition && active}
|
|
18
|
+
{@const { config: inConf, transition: inFn } = inTransition}
|
|
19
|
+
{@const { config: outConf, transition: outFn } = outTransition}
|
|
20
|
+
<div bind:this={self} use:useActions={use} in:inFn={inConf} out:outFn={outConf} {...attrs} {...props}>
|
|
21
|
+
{@render children({ active })}
|
|
22
|
+
</div>
|
|
23
|
+
{:else if active}
|
|
24
|
+
<div bind:this={self} use:useActions={use} {...attrs} {...props}>
|
|
25
|
+
{@render children({ active })}
|
|
26
|
+
</div>
|
|
27
|
+
{/if}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script lang="ts">import { useActions, classProp } from "../../internal/index.js";
|
|
2
2
|
let { children, class: klass, use = [], level = 3, self = $bindable(), ...props } = $props();
|
|
3
|
-
</script>
|
|
4
|
-
|
|
5
|
-
<div
|
|
6
|
-
bind:this={self}
|
|
7
|
-
use:useActions={use}
|
|
8
|
-
class={classProp(klass)}
|
|
9
|
-
role="heading"
|
|
10
|
-
aria-level={level}
|
|
11
|
-
data-accordionheading=""
|
|
12
|
-
{...props}
|
|
13
|
-
>
|
|
14
|
-
{@render children({})}
|
|
15
|
-
</div>
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div
|
|
6
|
+
bind:this={self}
|
|
7
|
+
use:useActions={use}
|
|
8
|
+
class={classProp(klass)}
|
|
9
|
+
role="heading"
|
|
10
|
+
aria-level={level}
|
|
11
|
+
data-accordionheading=""
|
|
12
|
+
{...props}
|
|
13
|
+
>
|
|
14
|
+
{@render children({})}
|
|
15
|
+
</div>
|
|
@@ -24,17 +24,17 @@ onMount(() => {
|
|
|
24
24
|
$effect(() => {
|
|
25
25
|
ctx.setDisabled(uid(), disabled);
|
|
26
26
|
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<div
|
|
30
|
-
bind:this={self}
|
|
31
|
-
use:useActions={use}
|
|
32
|
-
id={uid()}
|
|
33
|
-
class={classProp(klass, { active, disabled })}
|
|
34
|
-
data-accordionitem=""
|
|
35
|
-
data-disabled={disabled || undefined}
|
|
36
|
-
data-state={active ? 'opened' : 'closed'}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
{@render children({ active, disabled })}
|
|
40
|
-
</div>
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<div
|
|
30
|
+
bind:this={self}
|
|
31
|
+
use:useActions={use}
|
|
32
|
+
id={uid()}
|
|
33
|
+
class={classProp(klass, { active, disabled })}
|
|
34
|
+
data-accordionitem=""
|
|
35
|
+
data-disabled={disabled || undefined}
|
|
36
|
+
data-state={active ? 'opened' : 'closed'}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{@render children({ active, disabled })}
|
|
40
|
+
</div>
|
|
@@ -16,21 +16,21 @@ const handleClick = (e) => {
|
|
|
16
16
|
return;
|
|
17
17
|
checked = checked === "mixed" ? true : !checked;
|
|
18
18
|
};
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<button
|
|
22
|
-
type="button"
|
|
23
|
-
bind:this={self}
|
|
24
|
-
use:useActions={use}
|
|
25
|
-
class={classProp(klass, { checked })}
|
|
26
|
-
role="checkbox"
|
|
27
|
-
aria-checked={checked}
|
|
28
|
-
aria-required={required}
|
|
29
|
-
disabled={disabled || undefined}
|
|
30
|
-
data-state={checked ? 'checked' : 'unchecked'}
|
|
31
|
-
data-checkbox=""
|
|
32
|
-
onclick={handleClick}
|
|
33
|
-
{...props}
|
|
34
|
-
>
|
|
35
|
-
{@render children?.({ checked })}
|
|
36
|
-
</button>
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<button
|
|
22
|
+
type="button"
|
|
23
|
+
bind:this={self}
|
|
24
|
+
use:useActions={use}
|
|
25
|
+
class={classProp(klass, { checked })}
|
|
26
|
+
role="checkbox"
|
|
27
|
+
aria-checked={checked}
|
|
28
|
+
aria-required={required}
|
|
29
|
+
disabled={disabled || undefined}
|
|
30
|
+
data-state={checked ? 'checked' : 'unchecked'}
|
|
31
|
+
data-checkbox=""
|
|
32
|
+
onclick={handleClick}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
{@render children?.({ checked })}
|
|
36
|
+
</button>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script lang="ts" context="module">import { setupContext } from "../../internal/index.js";
|
|
2
2
|
import { ComboboxContext } from "./context.svelte.js";
|
|
3
3
|
export const { context, contextName } = setupContext();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
6
|
<script lang="ts" generics="ValueType">import { useActions, classProp } from "../../internal/index.js";
|
|
7
7
|
import { setContext, onMount, tick } from "svelte";
|
|
8
8
|
let {
|
|
@@ -41,16 +41,16 @@ onMount(async () => {
|
|
|
41
41
|
ctx.close();
|
|
42
42
|
ctx.mounted = true;
|
|
43
43
|
});
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<div
|
|
47
|
-
bind:this={self}
|
|
48
|
-
use:useActions={use}
|
|
49
|
-
id={ctx.uid()}
|
|
50
|
-
class={classProp(klass, { visible: ctx.visible && ctx.mounted })}
|
|
51
|
-
data-select=""
|
|
52
|
-
data-state={ctx.visible && ctx.mounted ? 'opened' : 'closed'}
|
|
53
|
-
{...props}
|
|
54
|
-
>
|
|
55
|
-
{@render children({ visible: ctx.visible && ctx.mounted })}
|
|
56
|
-
</div>
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<div
|
|
47
|
+
bind:this={self}
|
|
48
|
+
use:useActions={use}
|
|
49
|
+
id={ctx.uid()}
|
|
50
|
+
class={classProp(klass, { visible: ctx.visible && ctx.mounted })}
|
|
51
|
+
data-select=""
|
|
52
|
+
data-state={ctx.visible && ctx.mounted ? 'opened' : 'closed'}
|
|
53
|
+
{...props}
|
|
54
|
+
>
|
|
55
|
+
{@render children({ visible: ctx.visible && ctx.mounted })}
|
|
56
|
+
</div>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { FloatingArrow } from "../../internal/index.js";
|
|
3
3
|
let { class: klass, use = [], self = $bindable(), ...props } = $props();
|
|
4
4
|
const ctx = context();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<FloatingArrow
|
|
8
|
-
{ctx}
|
|
9
|
-
component="Combobox"
|
|
10
|
-
state={{ visible: ctx.visible }}
|
|
11
|
-
class={klass}
|
|
12
|
-
id={ctx.uid('arrow')}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<FloatingArrow
|
|
8
|
+
{ctx}
|
|
9
|
+
component="Combobox"
|
|
10
|
+
state={{ visible: ctx.visible }}
|
|
11
|
+
class={klass}
|
|
12
|
+
id={ctx.uid('arrow')}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
@@ -14,24 +14,24 @@ let {
|
|
|
14
14
|
} = $props();
|
|
15
15
|
const ctx = context();
|
|
16
16
|
const state = $derived({ visible: ctx.visible });
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<FloatingContent
|
|
20
|
-
{children}
|
|
21
|
-
componentName="Select"
|
|
22
|
-
visible={ctx.visible}
|
|
23
|
-
bind:self
|
|
24
|
-
{state}
|
|
25
|
-
{ctx}
|
|
26
|
-
{transition}
|
|
27
|
-
{use}
|
|
28
|
-
{sameWidth}
|
|
29
|
-
{constrainViewport}
|
|
30
|
-
{placement}
|
|
31
|
-
{portalTarget}
|
|
32
|
-
outsideCallback={() => ctx.close()}
|
|
33
|
-
role="listbox"
|
|
34
|
-
class={classProp(klass, state)}
|
|
35
|
-
hidden={!ctx.mounted || undefined}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<FloatingContent
|
|
20
|
+
{children}
|
|
21
|
+
componentName="Select"
|
|
22
|
+
visible={ctx.visible}
|
|
23
|
+
bind:self
|
|
24
|
+
{state}
|
|
25
|
+
{ctx}
|
|
26
|
+
{transition}
|
|
27
|
+
{use}
|
|
28
|
+
{sameWidth}
|
|
29
|
+
{constrainViewport}
|
|
30
|
+
{placement}
|
|
31
|
+
{portalTarget}
|
|
32
|
+
outsideCallback={() => ctx.close()}
|
|
33
|
+
role="listbox"
|
|
34
|
+
class={classProp(klass, state)}
|
|
35
|
+
hidden={!ctx.mounted || undefined}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
@@ -62,16 +62,16 @@ const handleKeydown = (e) => {
|
|
|
62
62
|
if (key === "Tab")
|
|
63
63
|
ctx.close();
|
|
64
64
|
};
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<input
|
|
68
|
-
type="text"
|
|
69
|
-
bind:this={self}
|
|
70
|
-
use:useActions={use}
|
|
71
|
-
id={ctx.uid('input')}
|
|
72
|
-
class={classProp(klass, { visible: ctx.visible })}
|
|
73
|
-
onclick={handleClick}
|
|
74
|
-
onkeydown={handleKeydown}
|
|
75
|
-
bind:value
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<input
|
|
68
|
+
type="text"
|
|
69
|
+
bind:this={self}
|
|
70
|
+
use:useActions={use}
|
|
71
|
+
id={ctx.uid('input')}
|
|
72
|
+
class={classProp(klass, { visible: ctx.visible })}
|
|
73
|
+
onclick={handleClick}
|
|
74
|
+
onkeydown={handleKeydown}
|
|
75
|
+
bind:value
|
|
76
|
+
{...props}
|
|
77
|
+
/>
|
|
@@ -44,28 +44,28 @@ onMount(() => {
|
|
|
44
44
|
ctx.queryElements();
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
</script>
|
|
48
|
-
|
|
49
|
-
<button
|
|
50
|
-
bind:this={self}
|
|
51
|
-
bind:this={optionEl}
|
|
52
|
-
use:useActions={use}
|
|
53
|
-
id={uid()}
|
|
54
|
-
class={classProp(klass, { hovered, selected })}
|
|
55
|
-
type="button"
|
|
56
|
-
{disabled}
|
|
57
|
-
role="option"
|
|
58
|
-
tabindex="0"
|
|
59
|
-
aria-selected={selected}
|
|
60
|
-
data-hovered={hovered ? '' : undefined}
|
|
61
|
-
data-selected={selected ? '' : undefined}
|
|
62
|
-
data-comboboxoption=""
|
|
63
|
-
data-value={value}
|
|
64
|
-
data-label={label}
|
|
65
|
-
onmouseover={handleMouseover}
|
|
66
|
-
onfocus={handleFocus}
|
|
67
|
-
onclick={handleClick}
|
|
68
|
-
{...props}
|
|
69
|
-
>
|
|
70
|
-
{@render children({ hovered, selected })}
|
|
71
|
-
</button>
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<button
|
|
50
|
+
bind:this={self}
|
|
51
|
+
bind:this={optionEl}
|
|
52
|
+
use:useActions={use}
|
|
53
|
+
id={uid()}
|
|
54
|
+
class={classProp(klass, { hovered, selected })}
|
|
55
|
+
type="button"
|
|
56
|
+
{disabled}
|
|
57
|
+
role="option"
|
|
58
|
+
tabindex="0"
|
|
59
|
+
aria-selected={selected}
|
|
60
|
+
data-hovered={hovered ? '' : undefined}
|
|
61
|
+
data-selected={selected ? '' : undefined}
|
|
62
|
+
data-comboboxoption=""
|
|
63
|
+
data-value={value}
|
|
64
|
+
data-label={label}
|
|
65
|
+
onmouseover={handleMouseover}
|
|
66
|
+
onfocus={handleFocus}
|
|
67
|
+
onclick={handleClick}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{@render children({ hovered, selected })}
|
|
71
|
+
</button>
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
<script lang="ts" context="module">import { setupContext } from "../../internal/index.js";
|
|
2
2
|
import { HovercardContext } from "./context.svelte.js";
|
|
3
3
|
export const { context, contextName } = setupContext();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
6
|
<script lang="ts">import { useActions, classProp, parseDelay } from "../../internal/index.js";
|
|
7
7
|
import { setContext } from "svelte";
|
|
8
8
|
let { children, use = [], class: klass, self = $bindable(), delay = 700, ...props } = $props();
|
|
9
9
|
const delays = parseDelay(delay);
|
|
10
10
|
const ctx = new HovercardContext({ delays });
|
|
11
11
|
setContext(contextName, ctx);
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<div
|
|
15
|
-
bind:this={self}
|
|
16
|
-
use:useActions={use}
|
|
17
|
-
id={ctx.uid()}
|
|
18
|
-
class={classProp(klass, { visible: ctx.visible })}
|
|
19
|
-
data-hovercard=""
|
|
20
|
-
data-state={ctx.visible ? 'opened' : 'closed'}
|
|
21
|
-
{...props}
|
|
22
|
-
>
|
|
23
|
-
{@render children({ visible: ctx.visible })}
|
|
24
|
-
</div>
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div
|
|
15
|
+
bind:this={self}
|
|
16
|
+
use:useActions={use}
|
|
17
|
+
id={ctx.uid()}
|
|
18
|
+
class={classProp(klass, { visible: ctx.visible })}
|
|
19
|
+
data-hovercard=""
|
|
20
|
+
data-state={ctx.visible ? 'opened' : 'closed'}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{@render children({ visible: ctx.visible })}
|
|
24
|
+
</div>
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { FloatingArrow } from "../../internal/index.js";
|
|
3
3
|
let { class: klass, use = [], self = $bindable(), ...props } = $props();
|
|
4
4
|
const ctx = context();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<FloatingArrow
|
|
8
|
-
{ctx}
|
|
9
|
-
component="Hovercard"
|
|
10
|
-
state={{ visible: ctx.visible }}
|
|
11
|
-
class={klass}
|
|
12
|
-
id={ctx.uid('arrow')}
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<FloatingArrow
|
|
8
|
+
{ctx}
|
|
9
|
+
component="Hovercard"
|
|
10
|
+
state={{ visible: ctx.visible }}
|
|
11
|
+
class={klass}
|
|
12
|
+
id={ctx.uid('arrow')}
|
|
13
|
+
{...props}
|
|
14
|
+
/>
|
|
@@ -26,25 +26,25 @@ const handleMouseleave = (e) => {
|
|
|
26
26
|
ctx.hovered = false;
|
|
27
27
|
ctx.close();
|
|
28
28
|
};
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
<FloatingContent
|
|
32
|
-
{children}
|
|
33
|
-
componentName="Hovercard"
|
|
34
|
-
visible={ctx.visible}
|
|
35
|
-
bind:self
|
|
36
|
-
bind:sameWidth
|
|
37
|
-
bind:transition
|
|
38
|
-
bind:constrainViewport
|
|
39
|
-
bind:placement
|
|
40
|
-
bind:portalTarget
|
|
41
|
-
{state}
|
|
42
|
-
{ctx}
|
|
43
|
-
{use}
|
|
44
|
-
outsideCallback={() => ctx.forceClose()}
|
|
45
|
-
role="listbox"
|
|
46
|
-
class={classProp(klass, state)}
|
|
47
|
-
onmouseenter={handleMouseenter}
|
|
48
|
-
onmouseleave={handleMouseleave}
|
|
49
|
-
{...props}
|
|
50
|
-
/>
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<FloatingContent
|
|
32
|
+
{children}
|
|
33
|
+
componentName="Hovercard"
|
|
34
|
+
visible={ctx.visible}
|
|
35
|
+
bind:self
|
|
36
|
+
bind:sameWidth
|
|
37
|
+
bind:transition
|
|
38
|
+
bind:constrainViewport
|
|
39
|
+
bind:placement
|
|
40
|
+
bind:portalTarget
|
|
41
|
+
{state}
|
|
42
|
+
{ctx}
|
|
43
|
+
{use}
|
|
44
|
+
outsideCallback={() => ctx.forceClose()}
|
|
45
|
+
role="listbox"
|
|
46
|
+
class={classProp(klass, state)}
|
|
47
|
+
onmouseenter={handleMouseenter}
|
|
48
|
+
onmouseleave={handleMouseleave}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
@@ -37,14 +37,14 @@ $effect(() => {
|
|
|
37
37
|
removeNodeProps(target, "aria-controls");
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<div
|
|
43
|
-
bind:this={self}
|
|
44
|
-
use:useActions={use}
|
|
45
|
-
class={classProp(klass, { visible: ctx.visible })}
|
|
46
|
-
data-hovercardtrigger=""
|
|
47
|
-
{...props}
|
|
48
|
-
>
|
|
49
|
-
{@render children({ visible: ctx.visible })}
|
|
50
|
-
</div>
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div
|
|
43
|
+
bind:this={self}
|
|
44
|
+
use:useActions={use}
|
|
45
|
+
class={classProp(klass, { visible: ctx.visible })}
|
|
46
|
+
data-hovercardtrigger=""
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{@render children({ visible: ctx.visible })}
|
|
50
|
+
</div>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<script lang="ts" context="module">import { setupContext } from "../../internal/index.js";
|
|
2
2
|
import { MenuContext } from "./context.svelte.js";
|
|
3
3
|
export const { context, contextName } = setupContext();
|
|
4
|
-
</script>
|
|
5
|
-
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
6
|
<script lang="ts">import { useActions, classProp } from "../../internal/index.js";
|
|
7
7
|
import { setContext } from "svelte";
|
|
8
8
|
let { children, use = [], class: klass, self = $bindable(), ...props } = $props();
|
|
9
9
|
const ctx = new MenuContext();
|
|
10
10
|
setContext(contextName, ctx);
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<div
|
|
14
|
-
bind:this={self}
|
|
15
|
-
use:useActions={use}
|
|
16
|
-
id={ctx.uid()}
|
|
17
|
-
class={classProp(klass, { visible: ctx.visible })}
|
|
18
|
-
data-menu=""
|
|
19
|
-
data-state={ctx.visible ? 'opened' : 'closed'}
|
|
20
|
-
{...props}
|
|
21
|
-
>
|
|
22
|
-
{@render children({ visible: ctx.visible })}
|
|
23
|
-
</div>
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={self}
|
|
15
|
+
use:useActions={use}
|
|
16
|
+
id={ctx.uid()}
|
|
17
|
+
class={classProp(klass, { visible: ctx.visible })}
|
|
18
|
+
data-menu=""
|
|
19
|
+
data-state={ctx.visible ? 'opened' : 'closed'}
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
{@render children({ visible: ctx.visible })}
|
|
23
|
+
</div>
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import { FloatingArrow } from "../../internal/index.js";
|
|
3
3
|
let { class: klass, use = [], self = $bindable(), ...props } = $props();
|
|
4
4
|
const ctx = context();
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<FloatingArrow {ctx} component="Menu" state={{ visible: ctx.visible }} class={klass} id={ctx.uid('arrow')} {...props} />
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<FloatingArrow {ctx} component="Menu" state={{ visible: ctx.visible }} class={klass} id={ctx.uid('arrow')} {...props} />
|
|
@@ -14,22 +14,22 @@ let {
|
|
|
14
14
|
} = $props();
|
|
15
15
|
const ctx = context();
|
|
16
16
|
const state = $derived({ visible: ctx.visible });
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<FloatingContent
|
|
20
|
-
{children}
|
|
21
|
-
componentName="Menu"
|
|
22
|
-
visible={ctx.visible}
|
|
23
|
-
{state}
|
|
24
|
-
{ctx}
|
|
25
|
-
{transition}
|
|
26
|
-
{use}
|
|
27
|
-
{sameWidth}
|
|
28
|
-
{constrainViewport}
|
|
29
|
-
{placement}
|
|
30
|
-
{portalTarget}
|
|
31
|
-
outsideCallback={() => ctx.close()}
|
|
32
|
-
role="listbox"
|
|
33
|
-
class={klass}
|
|
34
|
-
{...props}
|
|
35
|
-
/>
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<FloatingContent
|
|
20
|
+
{children}
|
|
21
|
+
componentName="Menu"
|
|
22
|
+
visible={ctx.visible}
|
|
23
|
+
{state}
|
|
24
|
+
{ctx}
|
|
25
|
+
{transition}
|
|
26
|
+
{use}
|
|
27
|
+
{sameWidth}
|
|
28
|
+
{constrainViewport}
|
|
29
|
+
{placement}
|
|
30
|
+
{portalTarget}
|
|
31
|
+
outsideCallback={() => ctx.close()}
|
|
32
|
+
role="listbox"
|
|
33
|
+
class={klass}
|
|
34
|
+
{...props}
|
|
35
|
+
/>
|