uisv 0.0.21 → 0.0.22
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.svelte +20 -21
- package/dist/components/accordion.svelte.d.ts +10 -10
- package/dist/components/alert.svelte +22 -28
- package/dist/components/alert.svelte.d.ts +5 -5
- package/dist/components/app.svelte +57 -0
- package/dist/components/app.svelte.d.ts +15 -0
- package/dist/components/badge.svelte +18 -23
- package/dist/components/badge.svelte.d.ts +3 -3
- package/dist/components/banner.svelte +18 -24
- package/dist/components/banner.svelte.d.ts +5 -5
- package/dist/components/breadcrumb.svelte +6 -6
- package/dist/components/breadcrumb.svelte.d.ts +4 -25
- package/dist/components/button.svelte +36 -44
- package/dist/components/button.svelte.d.ts +12 -11
- package/dist/components/calendar.svelte +6 -7
- package/dist/components/calendar.svelte.d.ts +3 -3
- package/dist/components/card.svelte +11 -12
- package/dist/components/card.svelte.d.ts +5 -5
- package/dist/components/checkbox-group.svelte +12 -13
- package/dist/components/checkbox-group.svelte.d.ts +4 -4
- package/dist/components/checkbox.svelte +39 -38
- package/dist/components/checkbox.svelte.d.ts +6 -6
- package/dist/components/chip.svelte +7 -8
- package/dist/components/chip.svelte.d.ts +3 -3
- package/dist/components/collapsible.svelte +4 -5
- package/dist/components/collapsible.svelte.d.ts +4 -4
- package/dist/components/color-picker.svelte +1 -1
- package/dist/components/h1.svelte +8 -7
- package/dist/components/h2.svelte +12 -11
- package/dist/components/h3.svelte +9 -8
- package/dist/components/h4.svelte +12 -11
- package/dist/components/h5.svelte +12 -11
- package/dist/components/h6.svelte +12 -11
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +6 -0
- package/dist/components/input-number.svelte +5 -7
- package/dist/components/input-number.svelte.d.ts +5 -5
- package/dist/components/input-time.svelte +11 -12
- package/dist/components/input-time.svelte.d.ts +6 -6
- package/dist/components/input.svelte +11 -12
- package/dist/components/input.svelte.d.ts +6 -6
- package/dist/components/kbd.svelte +6 -7
- package/dist/components/kbd.svelte.d.ts +2 -2
- package/dist/components/modal.svelte +189 -0
- package/dist/components/modal.svelte.d.ts +33 -0
- package/dist/components/p.svelte +3 -1
- package/dist/components/pin-input.svelte +10 -11
- package/dist/components/pin-input.svelte.d.ts +3 -3
- package/dist/components/placeholder.svelte +4 -4
- package/dist/components/popover.svelte +33 -61
- package/dist/components/popover.svelte.d.ts +8 -30
- package/dist/components/progress.svelte +22 -21
- package/dist/components/progress.svelte.d.ts +5 -5
- package/dist/components/select.svelte +48 -53
- package/dist/components/select.svelte.d.ts +22 -29
- package/dist/components/seperator.svelte +6 -7
- package/dist/components/seperator.svelte.d.ts +6 -6
- package/dist/components/slider.svelte +13 -14
- package/dist/components/slider.svelte.d.ts +4 -4
- package/dist/components/switch.svelte +17 -22
- package/dist/components/switch.svelte.d.ts +6 -6
- package/dist/components/tabs.svelte +19 -20
- package/dist/components/tabs.svelte.d.ts +7 -7
- package/dist/components/tooltip.svelte +94 -0
- package/dist/components/tooltip.svelte.d.ts +24 -0
- package/dist/contexts.d.ts +47 -0
- package/dist/contexts.js +46 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mode.d.ts +89 -0
- package/dist/mode.js +1 -0
- package/dist/utilities.svelte.d.ts +1 -1
- package/dist/vite.js +30 -35
- package/package.json +31 -26
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import { type PropColor, Icon } from '../index.js';
|
|
3
3
|
import type { Snippet, Component } from 'svelte';
|
|
4
|
-
import type
|
|
5
|
-
import { tv } from 'tailwind-variants';
|
|
4
|
+
import { tv, type ClassValue } from 'tailwind-variants';
|
|
6
5
|
|
|
7
6
|
export type SwitchProps = {
|
|
8
7
|
value?: boolean;
|
|
@@ -17,11 +16,11 @@
|
|
|
17
16
|
description?: string | Snippet;
|
|
18
17
|
required?: boolean;
|
|
19
18
|
ui?: {
|
|
20
|
-
root?:
|
|
21
|
-
container?:
|
|
22
|
-
thumb?:
|
|
23
|
-
label?:
|
|
24
|
-
description?:
|
|
19
|
+
root?: ClassValue;
|
|
20
|
+
container?: ClassValue;
|
|
21
|
+
thumb?: ClassValue;
|
|
22
|
+
label?: ClassValue;
|
|
23
|
+
description?: ClassValue;
|
|
25
24
|
};
|
|
26
25
|
};
|
|
27
26
|
</script>
|
|
@@ -42,18 +41,18 @@
|
|
|
42
41
|
ui = {},
|
|
43
42
|
}: SwitchProps = $props();
|
|
44
43
|
|
|
45
|
-
const
|
|
44
|
+
const variants = $derived.by(() =>
|
|
46
45
|
tv({
|
|
47
46
|
slots: {
|
|
48
47
|
root: 'flex-inline gap-2',
|
|
49
|
-
container: 'rounded-full bg-
|
|
48
|
+
container: 'rounded-full bg-surface-accented p-0.5 relative transition',
|
|
50
49
|
thumb: [
|
|
51
50
|
'bg-white block rounded-full absolute top-0.5 transition grid place-items-center',
|
|
52
|
-
value ? 'translate-x-full' : 'text-
|
|
51
|
+
value ? 'translate-x-full' : 'text-label-muted',
|
|
53
52
|
],
|
|
54
53
|
icon: 'pi',
|
|
55
54
|
label: 'text-sm',
|
|
56
|
-
description: 'text-sm text-
|
|
55
|
+
description: 'text-sm text-label-muted',
|
|
57
56
|
},
|
|
58
57
|
variants: {
|
|
59
58
|
color: {
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
container: ['', value && 'bg-primary-500 text-primary-500'],
|
|
62
61
|
},
|
|
63
62
|
surface: {
|
|
64
|
-
container: ['', value && 'bg-
|
|
63
|
+
container: ['', value && 'bg-surface-inverted text-surface-inverted'],
|
|
65
64
|
},
|
|
66
65
|
info: {
|
|
67
66
|
container: ['', value && 'bg-info-500 text-info-500'],
|
|
@@ -111,23 +110,23 @@
|
|
|
111
110
|
|
|
112
111
|
<div
|
|
113
112
|
data-state={value ? 'checked' : 'unchecked'}
|
|
114
|
-
class={
|
|
113
|
+
class={variants.root({
|
|
115
114
|
class: [(loading || disabled) && 'opacity-50', ui.thumb],
|
|
116
115
|
})}
|
|
117
116
|
>
|
|
118
117
|
<button
|
|
119
118
|
aria-label="switch"
|
|
120
119
|
data-state={value ? 'checked' : 'unchecked'}
|
|
121
|
-
class={
|
|
120
|
+
class={variants.container({ class: [loading && 'cursor-not-allowed', ui.thumb] })}
|
|
122
121
|
onclick={() => {
|
|
123
122
|
if (loading || disabled) return;
|
|
124
123
|
value = !value;
|
|
125
124
|
}}
|
|
126
125
|
>
|
|
127
|
-
<span data-state={value ? 'checked' : 'unchecked'} class={
|
|
126
|
+
<span data-state={value ? 'checked' : 'unchecked'} class={variants.thumb({ class: ui.thumb })}>
|
|
128
127
|
<Icon
|
|
129
128
|
name={loading ? loadingicon : value ? checkedicon : uncheckedicon}
|
|
130
|
-
class={
|
|
129
|
+
class={variants.icon({ class: [loading && 'animate-spin'] })}
|
|
131
130
|
/>
|
|
132
131
|
</span>
|
|
133
132
|
</button>
|
|
@@ -135,7 +134,7 @@
|
|
|
135
134
|
{#if label}
|
|
136
135
|
<span>
|
|
137
136
|
<div
|
|
138
|
-
class={
|
|
137
|
+
class={variants.label({
|
|
139
138
|
class: [required ? 'after:content-["*"] after:text-error-500' : '', ui.thumb],
|
|
140
139
|
})}
|
|
141
140
|
>
|
|
@@ -147,7 +146,7 @@
|
|
|
147
146
|
</div>
|
|
148
147
|
|
|
149
148
|
{#if description}
|
|
150
|
-
<div class={
|
|
149
|
+
<div class={variants.description({ class: ui.thumb })}>
|
|
151
150
|
{#if typeof description === 'string'}
|
|
152
151
|
{description}
|
|
153
152
|
{:else}
|
|
@@ -158,7 +157,3 @@
|
|
|
158
157
|
</span>
|
|
159
158
|
{/if}
|
|
160
159
|
</div>
|
|
161
|
-
|
|
162
|
-
{#snippet icon(ico?: SwitchProps['checkedicon'], icon_class?: ClassNameValue)}
|
|
163
|
-
<div class={['absolute', icon_class]}></div>
|
|
164
|
-
{/snippet}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropColor } from '../index.js';
|
|
2
2
|
import type { Snippet, Component } from 'svelte';
|
|
3
|
-
import type
|
|
3
|
+
import { type ClassValue } from 'tailwind-variants';
|
|
4
4
|
export type SwitchProps = {
|
|
5
5
|
value?: boolean;
|
|
6
6
|
color?: PropColor;
|
|
@@ -14,11 +14,11 @@ export type SwitchProps = {
|
|
|
14
14
|
description?: string | Snippet;
|
|
15
15
|
required?: boolean;
|
|
16
16
|
ui?: {
|
|
17
|
-
root?:
|
|
18
|
-
container?:
|
|
19
|
-
thumb?:
|
|
20
|
-
label?:
|
|
21
|
-
description?:
|
|
17
|
+
root?: ClassValue;
|
|
18
|
+
container?: ClassValue;
|
|
19
|
+
thumb?: ClassValue;
|
|
20
|
+
label?: ClassValue;
|
|
21
|
+
description?: ClassValue;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
declare const Switch: Component<SwitchProps, {}, "value">;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script module lang="ts">
|
|
2
2
|
import { Tabs } from 'bits-ui';
|
|
3
3
|
import { isComponent, isSnippet, useElementRects, type PropColor } from '../index.js';
|
|
4
|
-
import type
|
|
5
|
-
import { tv } from 'tailwind-variants';
|
|
4
|
+
import { tv, type ClassValue } from 'tailwind-variants';
|
|
6
5
|
import { type Component, type Snippet } from 'svelte';
|
|
7
6
|
import { ElementRect } from 'runed';
|
|
8
7
|
|
|
@@ -24,12 +23,12 @@
|
|
|
24
23
|
disabled?: boolean;
|
|
25
24
|
orientation?: 'vertical' | 'horizontal';
|
|
26
25
|
ui?: {
|
|
27
|
-
root?:
|
|
28
|
-
item?:
|
|
29
|
-
list?:
|
|
30
|
-
content?:
|
|
31
|
-
icon?:
|
|
32
|
-
indicator?:
|
|
26
|
+
root?: ClassValue;
|
|
27
|
+
item?: ClassValue;
|
|
28
|
+
list?: ClassValue;
|
|
29
|
+
content?: ClassValue;
|
|
30
|
+
icon?: ClassValue;
|
|
31
|
+
indicator?: ClassValue;
|
|
33
32
|
};
|
|
34
33
|
[k: `content_${string}`]: Snippet<[{ item: TabItem; value: number }]>;
|
|
35
34
|
};
|
|
@@ -65,12 +64,12 @@
|
|
|
65
64
|
return result;
|
|
66
65
|
});
|
|
67
66
|
|
|
68
|
-
const
|
|
67
|
+
const variants = $derived.by(() =>
|
|
69
68
|
tv({
|
|
70
69
|
slots: {
|
|
71
70
|
root: '',
|
|
72
71
|
list: 'flex relative p-1',
|
|
73
|
-
item: 'flex items-center justify-center text-muted data-[state="inactive"]:hover:text-highlighted font-medium z-1 transition-all',
|
|
72
|
+
item: 'flex items-center justify-center text-label-muted data-[state="inactive"]:hover:text-label-highlighted font-medium z-1 transition-all',
|
|
74
73
|
icon: '',
|
|
75
74
|
content: 'mt-2',
|
|
76
75
|
indicator: 'absolute z-0 transition-all duration-200 rounded-md w---width',
|
|
@@ -79,7 +78,7 @@
|
|
|
79
78
|
variant: {
|
|
80
79
|
pill: {
|
|
81
80
|
list: 'bg-surface-elevated rounded-lg',
|
|
82
|
-
item: 'flex-1 data-[state="active"]:text-inverted',
|
|
81
|
+
item: 'flex-1 data-[state="active"]:text-label-inverted',
|
|
83
82
|
trigger: 'flex-1',
|
|
84
83
|
indicator: 'rounded-md shadow-xs',
|
|
85
84
|
},
|
|
@@ -96,8 +95,8 @@
|
|
|
96
95
|
indicator: 'bg-primary-500',
|
|
97
96
|
},
|
|
98
97
|
surface: {
|
|
99
|
-
item: 'data-[variant="link"]:data-[state="active"]:text-
|
|
100
|
-
indicator: 'bg-surface-
|
|
98
|
+
item: 'data-[variant="link"]:data-[state="active"]:text-label-muted',
|
|
99
|
+
indicator: 'bg-surface-inverted',
|
|
101
100
|
},
|
|
102
101
|
info: {
|
|
103
102
|
item: 'data-[variant="link"]:data-[state="active"]:text-info-500',
|
|
@@ -183,10 +182,10 @@
|
|
|
183
182
|
<Tabs.Root
|
|
184
183
|
{disabled}
|
|
185
184
|
bind:value={() => value.toString(), (v) => (value = parseInt(v))}
|
|
186
|
-
class={
|
|
185
|
+
class={variants.root({ class: ui.root })}
|
|
187
186
|
{orientation}
|
|
188
187
|
>
|
|
189
|
-
<Tabs.List bind:ref={container_el} class={
|
|
188
|
+
<Tabs.List bind:ref={container_el} class={variants.list({ class: ui.list })}>
|
|
190
189
|
{#each items as item, idx (idx)}
|
|
191
190
|
{@const label = typeof item === 'string' ? item : item.label}
|
|
192
191
|
|
|
@@ -201,7 +200,7 @@
|
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
value={idx.toString()}
|
|
204
|
-
class={
|
|
203
|
+
class={variants.item({ class: ui.item })}
|
|
205
204
|
data-variant={variant}
|
|
206
205
|
>
|
|
207
206
|
{@render RenderIcon(typeof item === 'string' ? undefined : item.icon)}
|
|
@@ -211,7 +210,7 @@
|
|
|
211
210
|
{/each}
|
|
212
211
|
|
|
213
212
|
<span
|
|
214
|
-
class={
|
|
213
|
+
class={variants.indicator({ class: ui.indicator })}
|
|
215
214
|
style:--width="{rect.w}px"
|
|
216
215
|
style:--left="{rect.l}px"
|
|
217
216
|
style:--height="{rect.w}px"
|
|
@@ -221,7 +220,7 @@
|
|
|
221
220
|
{#each items as item, idx (idx)}
|
|
222
221
|
{#if typeof item === 'object' && item.content}
|
|
223
222
|
{@const Content = item.content}
|
|
224
|
-
<Tabs.Content value={idx.toString()} class={
|
|
223
|
+
<Tabs.Content value={idx.toString()} class={variants.content({ class: ui.content })}>
|
|
225
224
|
{#if `content_${idx}` in rest}
|
|
226
225
|
{@render rest[`content_${idx}`]({ item, value: idx })}
|
|
227
226
|
{:else if typeof Content === 'string'}
|
|
@@ -238,8 +237,8 @@
|
|
|
238
237
|
{#if isSnippet(IconProp)}
|
|
239
238
|
{@render IconProp()}
|
|
240
239
|
{:else if isComponent(IconProp)}
|
|
241
|
-
<IconProp class={
|
|
240
|
+
<IconProp class={variants.icon({ class: ui.icon })} />
|
|
242
241
|
{:else if typeof IconProp === 'string'}
|
|
243
|
-
<div class={
|
|
242
|
+
<div class={variants.icon({ class: [IconProp, ui.icon] })}></div>
|
|
244
243
|
{/if}
|
|
245
244
|
{/snippet}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Tabs } from 'bits-ui';
|
|
2
2
|
import { type PropColor } from '../index.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ClassValue } from 'tailwind-variants';
|
|
4
4
|
import { type Component, type Snippet } from 'svelte';
|
|
5
5
|
export type TabItem = string | {
|
|
6
6
|
label: string;
|
|
@@ -17,12 +17,12 @@ export type TabsProps = {
|
|
|
17
17
|
disabled?: boolean;
|
|
18
18
|
orientation?: 'vertical' | 'horizontal';
|
|
19
19
|
ui?: {
|
|
20
|
-
root?:
|
|
21
|
-
item?:
|
|
22
|
-
list?:
|
|
23
|
-
content?:
|
|
24
|
-
icon?:
|
|
25
|
-
indicator?:
|
|
20
|
+
root?: ClassValue;
|
|
21
|
+
item?: ClassValue;
|
|
22
|
+
list?: ClassValue;
|
|
23
|
+
content?: ClassValue;
|
|
24
|
+
icon?: ClassValue;
|
|
25
|
+
indicator?: ClassValue;
|
|
26
26
|
};
|
|
27
27
|
[k: `content_${string}`]: Snippet<[{
|
|
28
28
|
item: TabItem;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
import type { TooltipContentProps, TooltipArrowProps, PortalProps } from 'bits-ui';
|
|
3
|
+
import { Tooltip } from 'bits-ui';
|
|
4
|
+
import { type KbdProps, type ButtonProps, isSnippet, Button, Kbd } from '../index.js';
|
|
5
|
+
import type { Snippet } from 'svelte';
|
|
6
|
+
import { fly } from 'svelte/transition';
|
|
7
|
+
import { tv, type ClassValue } from 'tailwind-variants';
|
|
8
|
+
|
|
9
|
+
export type TooltipProps = {
|
|
10
|
+
children?: Snippet;
|
|
11
|
+
open?: boolean;
|
|
12
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
13
|
+
trigger?: ButtonProps | Snippet<[Record<string, unknown>]>;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
portal?: PortalProps;
|
|
16
|
+
content?: TooltipContentProps;
|
|
17
|
+
ui?: {
|
|
18
|
+
content?: ClassValue;
|
|
19
|
+
wrapper?: ClassValue;
|
|
20
|
+
kbds?: ClassValue;
|
|
21
|
+
arrow?: ClassValue;
|
|
22
|
+
};
|
|
23
|
+
arrow?: boolean | TooltipArrowProps;
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
let {
|
|
29
|
+
children,
|
|
30
|
+
open = $bindable(false),
|
|
31
|
+
kbds,
|
|
32
|
+
trigger,
|
|
33
|
+
disabled,
|
|
34
|
+
portal,
|
|
35
|
+
content,
|
|
36
|
+
ui = {},
|
|
37
|
+
arrow,
|
|
38
|
+
...rest
|
|
39
|
+
}: TooltipProps = $props();
|
|
40
|
+
|
|
41
|
+
const variants = $derived(
|
|
42
|
+
tv({
|
|
43
|
+
slots: {
|
|
44
|
+
content: '',
|
|
45
|
+
wrapper: '',
|
|
46
|
+
kbds: '',
|
|
47
|
+
kbdsize: '',
|
|
48
|
+
arrow: '',
|
|
49
|
+
},
|
|
50
|
+
})(),
|
|
51
|
+
);
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<Tooltip.Root bind:open disabled={!(children || kbds?.length) || disabled}>
|
|
55
|
+
{#if !!trigger}
|
|
56
|
+
<Tooltip.Trigger {...rest}>
|
|
57
|
+
{#snippet child({ props })}
|
|
58
|
+
{#if isSnippet(trigger)}
|
|
59
|
+
{@render trigger(props)}
|
|
60
|
+
{:else}
|
|
61
|
+
<Button {...props} {...trigger} />
|
|
62
|
+
{/if}
|
|
63
|
+
{/snippet}
|
|
64
|
+
</Tooltip.Trigger>
|
|
65
|
+
{/if}
|
|
66
|
+
|
|
67
|
+
<Tooltip.Portal {...portal}>
|
|
68
|
+
<Tooltip.Content {...content} forceMount>
|
|
69
|
+
{#snippet child({ props, wrapperProps })}
|
|
70
|
+
<div {...wrapperProps} class={variants.wrapper({ class: [ui.wrapper] })}>
|
|
71
|
+
<div {...props} class={variants.content({ class: [ui.content] })} transition:fly>
|
|
72
|
+
{@render children?.()}
|
|
73
|
+
|
|
74
|
+
{#if kbds?.length}
|
|
75
|
+
<span class={variants.kbds({ class: ui.kbds })}>
|
|
76
|
+
{#each kbds as kbd, idx (idx)}
|
|
77
|
+
<Kbd {...typeof kbd === 'string' ? { value: kbd } : kbd} />
|
|
78
|
+
{/each}
|
|
79
|
+
</span>
|
|
80
|
+
{/if}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
{/snippet}
|
|
84
|
+
children
|
|
85
|
+
|
|
86
|
+
{#if arrow}
|
|
87
|
+
<Tooltip.Arrow
|
|
88
|
+
{...typeof arrow === 'boolean' ? {} : arrow}
|
|
89
|
+
class={variants.arrow({ class: ui.arrow })}
|
|
90
|
+
/>
|
|
91
|
+
{/if}
|
|
92
|
+
</Tooltip.Content>
|
|
93
|
+
</Tooltip.Portal>
|
|
94
|
+
</Tooltip.Root>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TooltipContentProps, TooltipArrowProps, PortalProps } from 'bits-ui';
|
|
2
|
+
import { Tooltip } from 'bits-ui';
|
|
3
|
+
import { type KbdProps, type ButtonProps } from '../index.js';
|
|
4
|
+
import type { Snippet } from 'svelte';
|
|
5
|
+
import { type ClassValue } from 'tailwind-variants';
|
|
6
|
+
export type TooltipProps = {
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
open?: boolean;
|
|
9
|
+
kbds?: KbdProps['value'][] | KbdProps[];
|
|
10
|
+
trigger?: ButtonProps | Snippet<[Record<string, unknown>]>;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
portal?: PortalProps;
|
|
13
|
+
content?: TooltipContentProps;
|
|
14
|
+
ui?: {
|
|
15
|
+
content?: ClassValue;
|
|
16
|
+
wrapper?: ClassValue;
|
|
17
|
+
kbds?: ClassValue;
|
|
18
|
+
arrow?: ClassValue;
|
|
19
|
+
};
|
|
20
|
+
arrow?: boolean | TooltipArrowProps;
|
|
21
|
+
};
|
|
22
|
+
declare const Tooltip: import("svelte").Component<TooltipProps, {}, "open">;
|
|
23
|
+
type Tooltip = ReturnType<typeof Tooltip>;
|
|
24
|
+
export default Tooltip;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Context } from 'runed';
|
|
2
|
+
export declare const app_icons: Context<Record<"arrowdown" | "arrowleft" | "arrowright" | "arrowup" | "caution" | "check" | "chevrondoubleleft" | "chevrondoubleright" | "chevrondown" | "chevronleft" | "chevronright" | "chevronup" | "close" | "copy" | "copycheck" | "dark" | "drag" | "ellipsis" | "error" | "external" | "eye" | "eyeoff" | "file" | "folder" | "folderopen" | "hash" | "info" | "light" | "loading" | "menu" | "minus" | "panelclose" | "panelopen" | "plus" | "reload" | "search" | "stop" | "success" | "system" | "tip" | "upload" | "warning", string>>;
|
|
3
|
+
export type AppIcons = keyof typeof DEFAULT_ICONS;
|
|
4
|
+
export declare const DEFAULT_ICONS: {
|
|
5
|
+
arrowdown: string;
|
|
6
|
+
arrowleft: string;
|
|
7
|
+
arrowright: string;
|
|
8
|
+
arrowup: string;
|
|
9
|
+
caution: string;
|
|
10
|
+
check: string;
|
|
11
|
+
chevrondoubleleft: string;
|
|
12
|
+
chevrondoubleright: string;
|
|
13
|
+
chevrondown: string;
|
|
14
|
+
chevronleft: string;
|
|
15
|
+
chevronright: string;
|
|
16
|
+
chevronup: string;
|
|
17
|
+
close: string;
|
|
18
|
+
copy: string;
|
|
19
|
+
copycheck: string;
|
|
20
|
+
dark: string;
|
|
21
|
+
drag: string;
|
|
22
|
+
ellipsis: string;
|
|
23
|
+
error: string;
|
|
24
|
+
external: string;
|
|
25
|
+
eye: string;
|
|
26
|
+
eyeoff: string;
|
|
27
|
+
file: string;
|
|
28
|
+
folder: string;
|
|
29
|
+
folderopen: string;
|
|
30
|
+
hash: string;
|
|
31
|
+
info: string;
|
|
32
|
+
light: string;
|
|
33
|
+
loading: string;
|
|
34
|
+
menu: string;
|
|
35
|
+
minus: string;
|
|
36
|
+
panelclose: string;
|
|
37
|
+
panelopen: string;
|
|
38
|
+
plus: string;
|
|
39
|
+
reload: string;
|
|
40
|
+
search: string;
|
|
41
|
+
stop: string;
|
|
42
|
+
success: string;
|
|
43
|
+
system: string;
|
|
44
|
+
tip: string;
|
|
45
|
+
upload: string;
|
|
46
|
+
warning: string;
|
|
47
|
+
};
|
package/dist/contexts.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Context } from 'runed';
|
|
2
|
+
export const app_icons = new Context('app-config');
|
|
3
|
+
export const DEFAULT_ICONS = {
|
|
4
|
+
arrowdown: 'i-lucide:arrow-down',
|
|
5
|
+
arrowleft: 'i-lucide:arrow-left',
|
|
6
|
+
arrowright: 'i-lucide:arrow-right',
|
|
7
|
+
arrowup: 'i-lucide:arrow-up',
|
|
8
|
+
caution: 'i-lucide:circle-alert',
|
|
9
|
+
check: 'i-lucide:check',
|
|
10
|
+
chevrondoubleleft: 'i-lucide:chevron-double-left',
|
|
11
|
+
chevrondoubleright: 'i-lucide:chevron-double-right',
|
|
12
|
+
chevrondown: 'i-lucide:chevron-down',
|
|
13
|
+
chevronleft: 'i-lucide:chevron-left',
|
|
14
|
+
chevronright: 'i-lucide:chevron-right',
|
|
15
|
+
chevronup: 'i-lucide:chevron-up',
|
|
16
|
+
close: 'i-lucide:x',
|
|
17
|
+
copy: 'i-lucide:copy',
|
|
18
|
+
copycheck: 'i-lucide:circle-check',
|
|
19
|
+
dark: 'i-lucide:moon',
|
|
20
|
+
drag: 'i-lucide:grip-vertical',
|
|
21
|
+
ellipsis: 'i-lucide:ellipsis',
|
|
22
|
+
error: 'i-lucide:circle-x',
|
|
23
|
+
external: 'i-lucide:arrow-up-right',
|
|
24
|
+
eye: 'i-lucide:eye',
|
|
25
|
+
eyeoff: 'i-lucide:eye-slash',
|
|
26
|
+
file: 'i-lucide:file',
|
|
27
|
+
folder: 'i-lucide:folder',
|
|
28
|
+
folderopen: 'i-lucide:folder-open',
|
|
29
|
+
hash: 'i-lucide:hash',
|
|
30
|
+
info: 'i-lucide:info',
|
|
31
|
+
light: 'i-lucide:sun',
|
|
32
|
+
loading: 'i-lucide:loader-circle',
|
|
33
|
+
menu: 'i-lucide:list',
|
|
34
|
+
minus: 'i-lucide:minus',
|
|
35
|
+
panelclose: 'i-lucide:caret-left',
|
|
36
|
+
panelopen: 'i-lucide:caret-right',
|
|
37
|
+
plus: 'i-lucide:plus',
|
|
38
|
+
reload: 'i-lucide:arrow-counter-clockwise',
|
|
39
|
+
search: 'i-lucide:magnifying-glass',
|
|
40
|
+
stop: 'i-lucide:square',
|
|
41
|
+
success: 'i-lucide:check-circle',
|
|
42
|
+
system: 'i-lucide:monitor',
|
|
43
|
+
tip: 'i-lucide:lightbulb',
|
|
44
|
+
upload: 'i-lucide:upload',
|
|
45
|
+
warning: 'i-lucide:warning',
|
|
46
|
+
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/mode.d.ts
CHANGED
|
@@ -1 +1,90 @@
|
|
|
1
|
+
import { setMode } from 'mode-watcher';
|
|
2
|
+
export type Mode = Parameters<typeof setMode>['0'];
|
|
3
|
+
export type ThemeColors = {
|
|
4
|
+
dark: string;
|
|
5
|
+
light: string;
|
|
6
|
+
} | undefined;
|
|
7
|
+
export type ModeWatcherProps = {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to automatically track operating system preferences
|
|
10
|
+
* and update the mode accordingly.
|
|
11
|
+
*
|
|
12
|
+
* @default `true`
|
|
13
|
+
*/
|
|
14
|
+
track?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The default mode to use instead of the user's preference.
|
|
17
|
+
*
|
|
18
|
+
* @default `"system"`
|
|
19
|
+
*/
|
|
20
|
+
defaultMode?: Mode;
|
|
21
|
+
/**
|
|
22
|
+
* The default theme to use, which will be applied to the root `html` element
|
|
23
|
+
* and can be managed with the `setTheme` function.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```html
|
|
27
|
+
* <html data-theme="your-custom-theme"></html>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @default `undefined`
|
|
31
|
+
*/
|
|
32
|
+
defaultTheme?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The theme colors to use for each mode.
|
|
35
|
+
*/
|
|
36
|
+
themeColors?: ThemeColors;
|
|
37
|
+
/**
|
|
38
|
+
* Whether to disable transitions when updating the mode.
|
|
39
|
+
*/
|
|
40
|
+
disableTransitions?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The classname to add to the root `html` element when the mode is dark.
|
|
43
|
+
*
|
|
44
|
+
* @default `["dark"]`
|
|
45
|
+
*/
|
|
46
|
+
darkClassNames?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* The classname to add to the root `html` element when the mode is light.
|
|
49
|
+
*
|
|
50
|
+
* @default `[]`
|
|
51
|
+
*/
|
|
52
|
+
lightClassNames?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Optionally provide a custom local storage key to use for storing the mode.
|
|
55
|
+
*
|
|
56
|
+
* @default `'mode-watcher-mode'`
|
|
57
|
+
*/
|
|
58
|
+
modeStorageKey?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Optionally provide a custom local storage key to use for storing the theme.
|
|
61
|
+
*
|
|
62
|
+
* @default `'mode-watcher-theme'`
|
|
63
|
+
*/
|
|
64
|
+
themeStorageKey?: string;
|
|
65
|
+
/**
|
|
66
|
+
* An optional nonce to use for the injected script tag to allow-list mode-watcher
|
|
67
|
+
* if you are using a Content Security Policy.
|
|
68
|
+
*
|
|
69
|
+
* @default `undefined`
|
|
70
|
+
*/
|
|
71
|
+
nonce?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Whether to disable the injected script tag that sets the initial mode.
|
|
74
|
+
* Set this if you are manually injecting the script using a hook.
|
|
75
|
+
*
|
|
76
|
+
* @default `false`
|
|
77
|
+
*/
|
|
78
|
+
disableHeadScriptInjection?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Whether to run the mode changes synchronously instead of using
|
|
81
|
+
* an animation frame. If true, will have an impact on blocking performance
|
|
82
|
+
* due to blocking the main thread.
|
|
83
|
+
*
|
|
84
|
+
* Only applicable if `disableTransitions` is set to `true`.
|
|
85
|
+
*
|
|
86
|
+
* @default `false`
|
|
87
|
+
*/
|
|
88
|
+
synchronousModeChanges?: boolean;
|
|
89
|
+
};
|
|
1
90
|
export * from 'mode-watcher';
|
package/dist/mode.js
CHANGED
|
@@ -11,7 +11,7 @@ export declare function isComponent(v: unknown): v is Component;
|
|
|
11
11
|
* @param v - The value to check
|
|
12
12
|
* @returns true if the value is a snippet, false otherwise
|
|
13
13
|
*/
|
|
14
|
-
export declare function isSnippet(v: unknown): v is Snippet
|
|
14
|
+
export declare function isSnippet<T>(v: unknown): v is Snippet<[T]>;
|
|
15
15
|
/**
|
|
16
16
|
* Returns a reactive value holding the dom rect of `node`s.
|
|
17
17
|
*
|