@svelte-atoms/core 1.0.0-alpha.24 → 1.0.0-alpha.25
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 +645 -645
- package/dist/components/accordion/accordion-root.svelte.d.ts +2 -2
- package/dist/components/alert/alert-actions.svelte.d.ts +1 -0
- package/dist/components/alert/alert-close-button.svelte.d.ts +1 -0
- package/dist/components/alert/alert-content.svelte.d.ts +1 -0
- package/dist/components/atom/html-atom.svelte +217 -70
- package/dist/components/atom/html-atom.svelte.d.ts +4 -2
- package/dist/components/atom/types.d.ts +7 -0
- package/dist/components/button/button.stories.svelte +57 -17
- package/dist/components/button/button.stories.svelte.d.ts +6 -14
- package/dist/components/checkbox/checkbox.svelte.d.ts +1 -1
- package/dist/components/combobox/combobox-root.svelte.d.ts +2 -2
- package/dist/components/datagrid/datagrid.stories.svelte +75 -75
- package/dist/components/drawer/drawer-backdrop.svelte.d.ts +1 -0
- package/dist/components/icon/icon.svelte.d.ts +1 -0
- package/dist/components/input/input-placeholder.svelte +56 -56
- package/dist/components/input/input-placeholder.svelte.d.ts +1 -0
- package/dist/components/input/input-root.svelte.d.ts +1 -0
- package/dist/components/input/input-value.svelte +113 -113
- package/dist/components/input/input-value.svelte.d.ts +1 -1
- package/dist/components/label/label.svelte.d.ts +1 -0
- package/dist/components/layer/layer-inner.svelte.d.ts +1 -0
- package/dist/components/layer/layer-root.svelte.d.ts +1 -0
- package/dist/components/popover/popover-arrow.svelte.d.ts +1 -0
- package/dist/components/portal/portal-inner.svelte.d.ts +1 -0
- package/dist/components/portal/portal-root.svelte.d.ts +1 -0
- package/dist/components/portal/teleport.svelte.d.ts +1 -0
- package/dist/components/radio/radio.svelte.d.ts +2 -2
- package/dist/components/stack/stack-root.svelte.d.ts +1 -0
- package/dist/components/toast/toast-description.svelte.d.ts +1 -0
- package/dist/components/toast/toast-root.svelte.d.ts +1 -0
- package/dist/components/toast/toast-title.svelte.d.ts +1 -0
- package/dist/components/tree/tree-header.svelte.d.ts +1 -0
- package/dist/context/preset.svelte.d.ts +3 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/variant.d.ts +213 -0
- package/dist/utils/variant.js +137 -0
- package/llm/composition.md +395 -0
- package/llm/crafting.md +838 -0
- package/llm/motion.md +970 -0
- package/llm/philosophy.md +23 -0
- package/llm/preset-variant-integration.md +516 -0
- package/llm/preset.md +383 -0
- package/llm/styling.md +216 -0
- package/llm/usage.md +46 -0
- package/llm/variants.md +712 -0
- package/package.json +437 -436
|
@@ -21,6 +21,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
21
21
|
bond?: import("../..").Bond;
|
|
22
22
|
base?: B | undefined;
|
|
23
23
|
preset?: import("../..").ModuleName | (string & {});
|
|
24
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
24
25
|
} & {
|
|
25
26
|
as?: E | undefined;
|
|
26
27
|
class?: string;
|
|
@@ -28,6 +28,7 @@ declare function $$render<Src extends Component = Component, E extends HtmlEleme
|
|
|
28
28
|
bond?: import("../..").Bond;
|
|
29
29
|
base?: B | undefined;
|
|
30
30
|
preset?: import("../..").ModuleName | (string & {});
|
|
31
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
31
32
|
} & HTMLAttributes<HTMLDivElement>;
|
|
32
33
|
exports: {};
|
|
33
34
|
bindings: "";
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
<script lang="ts" generics="E extends keyof HTMLElementTagNameMap = 'div', B extends Base = Base">
|
|
2
|
-
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
-
import { InputBond } from './bond.svelte';
|
|
4
|
-
import {
|
|
5
|
-
HtmlAtom,
|
|
6
|
-
type ElementType,
|
|
7
|
-
type HtmlAtomProps,
|
|
8
|
-
type Base
|
|
9
|
-
} from '../atom';
|
|
10
|
-
|
|
11
|
-
type Element = ElementType<E>;
|
|
12
|
-
|
|
13
|
-
const bond = InputBond.get();
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
class: klass = '',
|
|
17
|
-
children = undefined,
|
|
18
|
-
...restProps
|
|
19
|
-
}: HtmlAtomProps<E, B> & HTMLAttributes<Element> = $props();
|
|
20
|
-
|
|
21
|
-
const placeholderProps = $derived({
|
|
22
|
-
...bond?.placeholder(),
|
|
23
|
-
...restProps
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const shouldShowPlaceholder = $derived.by(() => {
|
|
27
|
-
const type = bond?.elements?.input?.type ?? '';
|
|
28
|
-
|
|
29
|
-
if (['radio', 'checkbox'].includes(type)) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
if (['files'].includes(type)) {
|
|
34
|
-
return !bond?.state.props.files?.length;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
console.log(!bond?.state.props.value);
|
|
38
|
-
|
|
39
|
-
return !bond?.state.props.value;
|
|
40
|
-
});
|
|
41
|
-
</script>
|
|
42
|
-
|
|
43
|
-
{#if shouldShowPlaceholder}
|
|
44
|
-
<HtmlAtom
|
|
45
|
-
preset="input.placeholder"
|
|
46
|
-
class={[
|
|
47
|
-
'pointer-events-none absolute inset-0 flex h-full w-full items-center px-1 leading-1 outline-none',
|
|
48
|
-
'$preset',
|
|
49
|
-
klass
|
|
50
|
-
]}
|
|
51
|
-
style="left:{bond?.elements?.input?.offsetLeft ?? 0}px"
|
|
52
|
-
{...placeholderProps}
|
|
53
|
-
>
|
|
54
|
-
{@render children?.()}
|
|
55
|
-
</HtmlAtom>
|
|
56
|
-
{/if}
|
|
1
|
+
<script lang="ts" generics="E extends keyof HTMLElementTagNameMap = 'div', B extends Base = Base">
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
import { InputBond } from './bond.svelte';
|
|
4
|
+
import {
|
|
5
|
+
HtmlAtom,
|
|
6
|
+
type ElementType,
|
|
7
|
+
type HtmlAtomProps,
|
|
8
|
+
type Base
|
|
9
|
+
} from '../atom';
|
|
10
|
+
|
|
11
|
+
type Element = ElementType<E>;
|
|
12
|
+
|
|
13
|
+
const bond = InputBond.get();
|
|
14
|
+
|
|
15
|
+
let {
|
|
16
|
+
class: klass = '',
|
|
17
|
+
children = undefined,
|
|
18
|
+
...restProps
|
|
19
|
+
}: HtmlAtomProps<E, B> & HTMLAttributes<Element> = $props();
|
|
20
|
+
|
|
21
|
+
const placeholderProps = $derived({
|
|
22
|
+
...bond?.placeholder(),
|
|
23
|
+
...restProps
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const shouldShowPlaceholder = $derived.by(() => {
|
|
27
|
+
const type = bond?.elements?.input?.type ?? '';
|
|
28
|
+
|
|
29
|
+
if (['radio', 'checkbox'].includes(type)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (['files'].includes(type)) {
|
|
34
|
+
return !bond?.state.props.files?.length;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.log(!bond?.state.props.value);
|
|
38
|
+
|
|
39
|
+
return !bond?.state.props.value;
|
|
40
|
+
});
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
{#if shouldShowPlaceholder}
|
|
44
|
+
<HtmlAtom
|
|
45
|
+
preset="input.placeholder"
|
|
46
|
+
class={[
|
|
47
|
+
'pointer-events-none absolute inset-0 flex h-full w-full items-center px-1 leading-1 outline-none',
|
|
48
|
+
'$preset',
|
|
49
|
+
klass
|
|
50
|
+
]}
|
|
51
|
+
style="left:{bond?.elements?.input?.offsetLeft ?? 0}px"
|
|
52
|
+
{...placeholderProps}
|
|
53
|
+
>
|
|
54
|
+
{@render children?.()}
|
|
55
|
+
</HtmlAtom>
|
|
56
|
+
{/if}
|
|
@@ -17,6 +17,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
17
17
|
bond?: import("../..").Bond;
|
|
18
18
|
base?: B | undefined;
|
|
19
19
|
preset?: import("../..").ModuleName | (string & {});
|
|
20
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
20
21
|
} & HTMLAttributes<ElementType<E>>;
|
|
21
22
|
exports: {};
|
|
22
23
|
bindings: "";
|
|
@@ -18,6 +18,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
18
18
|
bond?: import("../..").Bond;
|
|
19
19
|
base?: B | undefined;
|
|
20
20
|
preset?: import("../..").ModuleName | (string & {});
|
|
21
|
+
variants?: import("../../utils").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
21
22
|
} & HTMLAttributes<ElementType<E>>;
|
|
22
23
|
exports: {
|
|
23
24
|
getBond: () => InputBond;
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
<script module lang="ts">
|
|
2
|
-
export type InputPortals = 'input.l0' | 'input.l1' | 'input.l2' | 'input.l3';
|
|
3
|
-
|
|
4
|
-
export type InputProps = {
|
|
5
|
-
value?: ClassValue;
|
|
6
|
-
files?: File[];
|
|
7
|
-
date?: Date | null;
|
|
8
|
-
number?: number;
|
|
9
|
-
checked?: boolean;
|
|
10
|
-
class?: string;
|
|
11
|
-
type?: HTMLInputTypeAttribute | null;
|
|
12
|
-
preset?: PresetModuleName | (string & {});
|
|
13
|
-
children?: Snippet<[]>;
|
|
14
|
-
};
|
|
15
|
-
</script>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
import type { Snippet } from 'svelte';
|
|
19
|
-
import type { HTMLInputTypeAttribute } from 'svelte/elements';
|
|
20
|
-
import { on } from '../../attachments/event.svelte';
|
|
21
|
-
import { getPreset } from '../../context';
|
|
22
|
-
import { cn, toClassValue, type ClassValue } from '../../utils';
|
|
23
|
-
import type { PresetModuleName } from '../../context/preset.svelte';
|
|
24
|
-
import { InputBond } from './bond.svelte';
|
|
25
|
-
|
|
26
|
-
const bond = InputBond.get();
|
|
27
|
-
|
|
28
|
-
let {
|
|
29
|
-
value = $bindable(),
|
|
30
|
-
files = $bindable(),
|
|
31
|
-
date = $bindable(),
|
|
32
|
-
number = $bindable(),
|
|
33
|
-
checked = $bindable(),
|
|
34
|
-
class: klass = '',
|
|
35
|
-
type = 'text',
|
|
36
|
-
preset: presetKey = 'input.value',
|
|
37
|
-
onchange = undefined,
|
|
38
|
-
oninput = undefined,
|
|
39
|
-
...restProps
|
|
40
|
-
}: InputProps = $props();
|
|
41
|
-
|
|
42
|
-
const preset = getPreset(presetKey as PresetModuleName)?.apply(bond, [bond]);
|
|
43
|
-
|
|
44
|
-
const valueProps = $derived({
|
|
45
|
-
...(bond?.input?.() ?? {}),
|
|
46
|
-
...restProps
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
function handleChange(ev: CustomEvent) {
|
|
50
|
-
if (!onchange) return;
|
|
51
|
-
|
|
52
|
-
onchange?.(ev, {
|
|
53
|
-
value: value,
|
|
54
|
-
files: files,
|
|
55
|
-
date: date,
|
|
56
|
-
number: number,
|
|
57
|
-
checked: checked,
|
|
58
|
-
event: ev
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function handleInput(ev: InputEvent) {
|
|
63
|
-
if (!oninput) return;
|
|
64
|
-
|
|
65
|
-
const currentTarget = ev.currentTarget as HTMLInputElement;
|
|
66
|
-
|
|
67
|
-
if (type === 'number') {
|
|
68
|
-
number = currentTarget.valueAsNumber;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (type === 'date' || type == 'time' || type === 'datetime-local' || type === 'date-local') {
|
|
72
|
-
date = currentTarget.valueAsDate;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
oninput?.(ev, {
|
|
76
|
-
value: value,
|
|
77
|
-
files: files,
|
|
78
|
-
date: date,
|
|
79
|
-
number: number,
|
|
80
|
-
checked: checked,
|
|
81
|
-
event: ev
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
</script>
|
|
85
|
-
|
|
86
|
-
<input
|
|
87
|
-
{type}
|
|
88
|
-
bind:value={
|
|
89
|
-
() => value,
|
|
90
|
-
(v) => {
|
|
91
|
-
value = v;
|
|
92
|
-
if (bond) {
|
|
93
|
-
bond.state.props.value = v;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
class={cn(
|
|
98
|
-
'h-full w-full flex-1 bg-transparent px-2 leading-1 outline-none',
|
|
99
|
-
preset?.class,
|
|
100
|
-
toClassValue(klass, bond)
|
|
101
|
-
)}
|
|
102
|
-
onchange={handleChange}
|
|
103
|
-
oninput={handleInput}
|
|
104
|
-
{...valueProps}
|
|
105
|
-
{@attach (node) => {
|
|
106
|
-
if (type === 'file') {
|
|
107
|
-
return on('input', () => {
|
|
108
|
-
files = Array.from(node.files || []);
|
|
109
|
-
bond!.state.props.files = files;
|
|
110
|
-
})(node);
|
|
111
|
-
}
|
|
112
|
-
}}
|
|
113
|
-
/>
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export type InputPortals = 'input.l0' | 'input.l1' | 'input.l2' | 'input.l3';
|
|
3
|
+
|
|
4
|
+
export type InputProps = {
|
|
5
|
+
value?: ClassValue;
|
|
6
|
+
files?: File[];
|
|
7
|
+
date?: Date | null;
|
|
8
|
+
number?: number;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
class?: string;
|
|
11
|
+
type?: HTMLInputTypeAttribute | null;
|
|
12
|
+
preset?: PresetModuleName | (string & {});
|
|
13
|
+
children?: Snippet<[]>;
|
|
14
|
+
};
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import type { Snippet } from 'svelte';
|
|
19
|
+
import type { HTMLInputTypeAttribute } from 'svelte/elements';
|
|
20
|
+
import { on } from '../../attachments/event.svelte';
|
|
21
|
+
import { getPreset } from '../../context';
|
|
22
|
+
import { cn, toClassValue, type ClassValue } from '../../utils';
|
|
23
|
+
import type { PresetModuleName } from '../../context/preset.svelte';
|
|
24
|
+
import { InputBond } from './bond.svelte';
|
|
25
|
+
|
|
26
|
+
const bond = InputBond.get();
|
|
27
|
+
|
|
28
|
+
let {
|
|
29
|
+
value = $bindable(),
|
|
30
|
+
files = $bindable(),
|
|
31
|
+
date = $bindable(),
|
|
32
|
+
number = $bindable(),
|
|
33
|
+
checked = $bindable(),
|
|
34
|
+
class: klass = '',
|
|
35
|
+
type = 'text',
|
|
36
|
+
preset: presetKey = 'input.value',
|
|
37
|
+
onchange = undefined,
|
|
38
|
+
oninput = undefined,
|
|
39
|
+
...restProps
|
|
40
|
+
}: InputProps = $props();
|
|
41
|
+
|
|
42
|
+
const preset = getPreset(presetKey as PresetModuleName)?.apply(bond, [bond]);
|
|
43
|
+
|
|
44
|
+
const valueProps = $derived({
|
|
45
|
+
...(bond?.input?.() ?? {}),
|
|
46
|
+
...restProps
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
function handleChange(ev: CustomEvent) {
|
|
50
|
+
if (!onchange) return;
|
|
51
|
+
|
|
52
|
+
onchange?.(ev, {
|
|
53
|
+
value: value,
|
|
54
|
+
files: files,
|
|
55
|
+
date: date,
|
|
56
|
+
number: number,
|
|
57
|
+
checked: checked,
|
|
58
|
+
event: ev
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function handleInput(ev: InputEvent) {
|
|
63
|
+
if (!oninput) return;
|
|
64
|
+
|
|
65
|
+
const currentTarget = ev.currentTarget as HTMLInputElement;
|
|
66
|
+
|
|
67
|
+
if (type === 'number') {
|
|
68
|
+
number = currentTarget.valueAsNumber;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (type === 'date' || type == 'time' || type === 'datetime-local' || type === 'date-local') {
|
|
72
|
+
date = currentTarget.valueAsDate;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
oninput?.(ev, {
|
|
76
|
+
value: value,
|
|
77
|
+
files: files,
|
|
78
|
+
date: date,
|
|
79
|
+
number: number,
|
|
80
|
+
checked: checked,
|
|
81
|
+
event: ev
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<input
|
|
87
|
+
{type}
|
|
88
|
+
bind:value={
|
|
89
|
+
() => value,
|
|
90
|
+
(v) => {
|
|
91
|
+
value = v;
|
|
92
|
+
if (bond) {
|
|
93
|
+
bond.state.props.value = v;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
class={cn(
|
|
98
|
+
'h-full w-full flex-1 bg-transparent px-2 leading-1 outline-none',
|
|
99
|
+
preset?.class,
|
|
100
|
+
toClassValue(klass, bond)
|
|
101
|
+
)}
|
|
102
|
+
onchange={handleChange}
|
|
103
|
+
oninput={handleInput}
|
|
104
|
+
{...valueProps}
|
|
105
|
+
{@attach (node) => {
|
|
106
|
+
if (type === 'file') {
|
|
107
|
+
return on('input', () => {
|
|
108
|
+
files = Array.from(node.files || []);
|
|
109
|
+
bond!.state.props.files = files;
|
|
110
|
+
})(node);
|
|
111
|
+
}
|
|
112
|
+
}}
|
|
113
|
+
/>
|
|
@@ -14,6 +14,6 @@ import type { Snippet } from 'svelte';
|
|
|
14
14
|
import type { HTMLInputTypeAttribute } from 'svelte/elements';
|
|
15
15
|
import { type ClassValue } from '../../utils';
|
|
16
16
|
import type { PresetModuleName } from '../../context/preset.svelte';
|
|
17
|
-
declare const InputValue: import("svelte").Component<InputProps, {}, "number" | "
|
|
17
|
+
declare const InputValue: import("svelte").Component<InputProps, {}, "number" | "value" | "date" | "checked" | "files">;
|
|
18
18
|
type InputValue = ReturnType<typeof InputValue>;
|
|
19
19
|
export default InputValue;
|
|
@@ -22,6 +22,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'label', B ext
|
|
|
22
22
|
bond?: import("../..").Bond;
|
|
23
23
|
base?: B | undefined;
|
|
24
24
|
preset?: import("../..").ModuleName | (string & {});
|
|
25
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
25
26
|
} & {
|
|
26
27
|
for?: string | null;
|
|
27
28
|
children?: Snippet<[]>;
|
|
@@ -17,6 +17,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
17
17
|
bond?: import("../..").Bond;
|
|
18
18
|
base?: B | undefined;
|
|
19
19
|
preset?: import("../..").ModuleName | (string & {});
|
|
20
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
20
21
|
} & HTMLAttributes<ElementType<E>>;
|
|
21
22
|
exports: {};
|
|
22
23
|
bindings: "";
|
|
@@ -17,6 +17,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
17
17
|
bond?: import("../..").Bond;
|
|
18
18
|
base?: B | undefined;
|
|
19
19
|
preset?: import("../..").ModuleName | (string & {});
|
|
20
|
+
variants?: import("../../utils").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
20
21
|
} & HTMLAttributes<ElementType<E>>;
|
|
21
22
|
exports: {
|
|
22
23
|
getBond: () => any;
|
|
@@ -18,6 +18,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
18
18
|
bond?: import("../..").Bond;
|
|
19
19
|
base?: B | undefined;
|
|
20
20
|
preset?: import("../..").ModuleName | (string & {});
|
|
21
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
21
22
|
} & HTMLAttributes<HTMLElementTagNameMap[E]>;
|
|
22
23
|
exports: {};
|
|
23
24
|
bindings: "";
|
|
@@ -17,6 +17,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
17
17
|
bond?: import("../..").Bond;
|
|
18
18
|
base?: B | undefined;
|
|
19
19
|
preset?: import("../..").ModuleName | (string & {});
|
|
20
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
20
21
|
} & HTMLAttributes<ElementType<E>>;
|
|
21
22
|
exports: {};
|
|
22
23
|
bindings: "";
|
|
@@ -24,6 +24,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
24
24
|
bond?: import("../..").Bond;
|
|
25
25
|
base?: B | undefined;
|
|
26
26
|
preset?: import("../..").ModuleName | (string & {});
|
|
27
|
+
variants?: import("../../utils").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
27
28
|
} & {
|
|
28
29
|
id: RootPortals | (string & {});
|
|
29
30
|
children?: Snippet;
|
|
@@ -21,6 +21,7 @@ declare function $$render<E extends HtmlElementTagName = 'div', B extends Base =
|
|
|
21
21
|
bond?: import("../..").Bond;
|
|
22
22
|
base?: B | undefined;
|
|
23
23
|
preset?: import("../..").ModuleName | (string & {});
|
|
24
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
24
25
|
} & {
|
|
25
26
|
portal?: string;
|
|
26
27
|
} & HTMLAttributes<HtmlElementType<E>>;
|
|
@@ -14,7 +14,7 @@ declare function $$render<B extends Base = Base>(): {
|
|
|
14
14
|
checkedContent?: any;
|
|
15
15
|
} & Record<string, any>;
|
|
16
16
|
exports: {};
|
|
17
|
-
bindings: "
|
|
17
|
+
bindings: "value" | "group";
|
|
18
18
|
slots: {};
|
|
19
19
|
events: {};
|
|
20
20
|
};
|
|
@@ -22,7 +22,7 @@ declare class __sveltets_Render<B extends Base = Base> {
|
|
|
22
22
|
props(): ReturnType<typeof $$render<B>>['props'];
|
|
23
23
|
events(): ReturnType<typeof $$render<B>>['events'];
|
|
24
24
|
slots(): ReturnType<typeof $$render<B>>['slots'];
|
|
25
|
-
bindings(): "
|
|
25
|
+
bindings(): "value" | "group";
|
|
26
26
|
exports(): {};
|
|
27
27
|
}
|
|
28
28
|
interface $$IsomorphicComponent {
|
|
@@ -18,6 +18,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
18
18
|
bond?: import("../..").Bond;
|
|
19
19
|
base?: B | undefined;
|
|
20
20
|
preset?: import("../..").ModuleName | (string & {});
|
|
21
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
21
22
|
} & HTMLAttributes<ElementType<E>>;
|
|
22
23
|
exports: {};
|
|
23
24
|
bindings: "";
|
|
@@ -25,6 +25,7 @@ declare function $$render<T extends keyof HTMLElementTagNameMap>(): {
|
|
|
25
25
|
bond?: import("../..").Bond;
|
|
26
26
|
base?: import("../atom").ComponentBase | import("../atom").SnippetBase | undefined;
|
|
27
27
|
preset?: import("../..").ModuleName | (string & {});
|
|
28
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
28
29
|
} & {
|
|
29
30
|
as?: T | undefined;
|
|
30
31
|
children?: Snippet<[{
|
|
@@ -30,6 +30,7 @@ declare function $$render<T extends keyof HTMLElementTagNameMap>(): {
|
|
|
30
30
|
bond?: import("../..").Bond;
|
|
31
31
|
base?: import("../atom").ComponentBase | import("../atom").SnippetBase | undefined;
|
|
32
32
|
preset?: import("../..").ModuleName | (string & {});
|
|
33
|
+
variants?: import("../../utils").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
33
34
|
} & {
|
|
34
35
|
as?: T | undefined;
|
|
35
36
|
open?: boolean;
|
|
@@ -26,6 +26,7 @@ declare function $$render<T extends keyof HTMLElementTagNameMap>(): {
|
|
|
26
26
|
bond?: import("../..").Bond;
|
|
27
27
|
base?: import("../atom").ComponentBase | import("../atom").SnippetBase | undefined;
|
|
28
28
|
preset?: import("../..").ModuleName | (string & {});
|
|
29
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
29
30
|
} & {
|
|
30
31
|
as?: T | undefined;
|
|
31
32
|
class?: string;
|
|
@@ -27,6 +27,7 @@ declare function $$render<E extends keyof HTMLElementTagNameMap = 'div', B exten
|
|
|
27
27
|
bond?: import("../..").Bond;
|
|
28
28
|
base?: B | undefined;
|
|
29
29
|
preset?: import("../..").ModuleName | (string & {});
|
|
30
|
+
variants?: import("../..").VariantDefinition<any> | ((bond: import("../..").Bond, variantProps: Record<string, any>) => Record<string, any>);
|
|
30
31
|
} & {
|
|
31
32
|
class?: string;
|
|
32
33
|
open?: boolean;
|
|
@@ -7,6 +7,9 @@ export type PresetEntryRecord = {
|
|
|
7
7
|
class?: ClassValue;
|
|
8
8
|
as?: string;
|
|
9
9
|
base?: Base;
|
|
10
|
+
variants?: Record<string, Record<string, any>>;
|
|
11
|
+
compounds?: Array<Record<string, any>>;
|
|
12
|
+
defaults?: Record<string, any>;
|
|
10
13
|
};
|
|
11
14
|
export type PresetEntry = (this: Bond | undefined | null, bond: Bond | undefined | null, ...args: any[]) => PresetEntryRecord;
|
|
12
15
|
export type Preset = Record<PresetModuleName, PresetEntry>;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { type StateDefiner, defineProperty, defineState } from './state';
|
|
2
|
+
export { defineVariants, type VariantDefinition, type VariantProps, type VariantValue, type ExtractVariants, type VariantPropsType } from './variant';
|
|
2
3
|
import type { ClassValue as SvelteClassValue } from 'svelte/elements';
|
|
3
4
|
export type ClassValueFunction = <T = unknown>(bond: T, ...args: unknown[]) => SvelteClassValue;
|
|
4
5
|
export type ClassValue = SvelteClassValue | ClassValueFunction | undefined;
|