dialkit 1.0.0 → 1.1.0
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 +123 -2
- package/dist/index.cjs +42 -39
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +42 -39
- package/dist/index.js.map +1 -1
- package/dist/solid/index.cjs +97 -54
- package/dist/solid/index.cjs.map +1 -1
- package/dist/solid/index.d.cts +4 -1
- package/dist/solid/index.d.ts +4 -1
- package/dist/solid/index.js +96 -53
- package/dist/solid/index.js.map +1 -1
- package/dist/store/index.cjs +450 -0
- package/dist/store/index.cjs.map +1 -0
- package/dist/store/index.d.cts +124 -0
- package/dist/store/index.d.ts +124 -0
- package/dist/store/index.js +425 -0
- package/dist/store/index.js.map +1 -0
- package/dist/styles.css +31 -0
- package/dist/svelte/Portal.svelte +30 -0
- package/dist/svelte/Portal.svelte.d.ts +9 -0
- package/dist/svelte/Portal.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ButtonGroup.svelte +16 -0
- package/dist/svelte/components/ButtonGroup.svelte.d.ts +11 -0
- package/dist/svelte/components/ButtonGroup.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ColorControl.svelte +81 -0
- package/dist/svelte/components/ColorControl.svelte.d.ts +9 -0
- package/dist/svelte/components/ColorControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/ControlRenderer.svelte +84 -0
- package/dist/svelte/components/ControlRenderer.svelte.d.ts +11 -0
- package/dist/svelte/components/ControlRenderer.svelte.d.ts.map +1 -0
- package/dist/svelte/components/DialRoot.svelte +65 -0
- package/dist/svelte/components/DialRoot.svelte.d.ts +11 -0
- package/dist/svelte/components/DialRoot.svelte.d.ts.map +1 -0
- package/dist/svelte/components/EasingVisualization.svelte +50 -0
- package/dist/svelte/components/EasingVisualization.svelte.d.ts +10 -0
- package/dist/svelte/components/EasingVisualization.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Folder.svelte +204 -0
- package/dist/svelte/components/Folder.svelte.d.ts +14 -0
- package/dist/svelte/components/Folder.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Panel.svelte +144 -0
- package/dist/svelte/components/Panel.svelte.d.ts +10 -0
- package/dist/svelte/components/Panel.svelte.d.ts.map +1 -0
- package/dist/svelte/components/PresetManager.svelte +156 -0
- package/dist/svelte/components/PresetManager.svelte.d.ts +10 -0
- package/dist/svelte/components/PresetManager.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SegmentedControl.svelte +106 -0
- package/dist/svelte/components/SegmentedControl.svelte.d.ts +13 -0
- package/dist/svelte/components/SegmentedControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SelectControl.svelte +151 -0
- package/dist/svelte/components/SelectControl.svelte.d.ts +14 -0
- package/dist/svelte/components/SelectControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Slider.svelte +345 -0
- package/dist/svelte/components/Slider.svelte.d.ts +13 -0
- package/dist/svelte/components/Slider.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SpringControl.svelte +124 -0
- package/dist/svelte/components/SpringControl.svelte.d.ts +12 -0
- package/dist/svelte/components/SpringControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/SpringVisualization.svelte +115 -0
- package/dist/svelte/components/SpringVisualization.svelte.d.ts +9 -0
- package/dist/svelte/components/SpringVisualization.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TextControl.svelte +19 -0
- package/dist/svelte/components/TextControl.svelte.d.ts +10 -0
- package/dist/svelte/components/TextControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/Toggle.svelte +21 -0
- package/dist/svelte/components/Toggle.svelte.d.ts +9 -0
- package/dist/svelte/components/Toggle.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TransitionControl.svelte +200 -0
- package/dist/svelte/components/TransitionControl.svelte.d.ts +12 -0
- package/dist/svelte/components/TransitionControl.svelte.d.ts.map +1 -0
- package/dist/svelte/components/transitions.d.ts +6 -0
- package/dist/svelte/components/transitions.d.ts.map +1 -0
- package/dist/svelte/components/transitions.js +14 -0
- package/dist/svelte/createDialKit.svelte.d.ts +7 -0
- package/dist/svelte/createDialKit.svelte.d.ts.map +1 -0
- package/dist/svelte/createDialKit.svelte.js +82 -0
- package/dist/svelte/index.d.ts +19 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +19 -0
- package/dist/svelte/shims.d.ts +9 -0
- package/dist/svelte/theme-css.d.ts +2 -0
- package/dist/svelte/theme-css.d.ts.map +1 -0
- package/dist/svelte/theme-css.js +1097 -0
- package/package.json +29 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type $$ComponentProps = {
|
|
2
|
+
label: string;
|
|
3
|
+
checked: boolean;
|
|
4
|
+
onChange: (checked: boolean) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const Toggle: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type Toggle = ReturnType<typeof Toggle>;
|
|
8
|
+
export default Toggle;
|
|
9
|
+
//# sourceMappingURL=Toggle.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toggle.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/Toggle.svelte.ts"],"names":[],"mappings":"AAKC,KAAK,gBAAgB,GAAG;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACtC,CAAC;AAiBJ,QAAA,MAAM,MAAM,sDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DialStore } from 'dialkit/store';
|
|
3
|
+
import type { EasingConfig, SpringConfig, TransitionConfig } from 'dialkit/store';
|
|
4
|
+
import Folder from './Folder.svelte';
|
|
5
|
+
import Slider from './Slider.svelte';
|
|
6
|
+
import SegmentedControl from './SegmentedControl.svelte';
|
|
7
|
+
import SpringVisualization from './SpringVisualization.svelte';
|
|
8
|
+
import EasingVisualization from './EasingVisualization.svelte';
|
|
9
|
+
|
|
10
|
+
type CurveMode = 'easing' | 'simple' | 'advanced';
|
|
11
|
+
|
|
12
|
+
let { panelId, path, label, value, onChange } = $props<{
|
|
13
|
+
panelId: string;
|
|
14
|
+
path: string;
|
|
15
|
+
label: string;
|
|
16
|
+
value: TransitionConfig;
|
|
17
|
+
onChange: (value: TransitionConfig) => void;
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
let mode = $state<CurveMode>(DialStore.getTransitionMode(panelId, path));
|
|
21
|
+
let editingEase = $state(false);
|
|
22
|
+
let easeDraft = $state('');
|
|
23
|
+
|
|
24
|
+
$effect(() => {
|
|
25
|
+
const unsub = DialStore.subscribe(panelId, () => {
|
|
26
|
+
mode = DialStore.getTransitionMode(panelId, path);
|
|
27
|
+
});
|
|
28
|
+
return unsub;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const isEasing = $derived(mode === 'easing');
|
|
32
|
+
const isSimpleSpring = $derived(mode === 'simple');
|
|
33
|
+
|
|
34
|
+
const spring = $derived<SpringConfig>(
|
|
35
|
+
value.type === 'spring'
|
|
36
|
+
? value
|
|
37
|
+
: { type: 'spring', visualDuration: 0.3, bounce: 0.2 }
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const easing = $derived<EasingConfig>(
|
|
41
|
+
value.type === 'easing'
|
|
42
|
+
? value
|
|
43
|
+
: { type: 'easing', duration: 0.3, ease: [1, -0.4, 0.5, 1] }
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const formatEase = (ease: [number, number, number, number]) =>
|
|
47
|
+
ease.map((v) => Number(v.toFixed(2))).join(', ');
|
|
48
|
+
|
|
49
|
+
const parseEase = (text: string): [number, number, number, number] | null => {
|
|
50
|
+
const parts = text.split(',').map((s) => Number.parseFloat(s.trim()));
|
|
51
|
+
if (parts.length !== 4 || parts.some((n) => Number.isNaN(n))) return null;
|
|
52
|
+
return parts as [number, number, number, number];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const handleModeChange = (nextMode: string) => {
|
|
56
|
+
const typed = nextMode as CurveMode;
|
|
57
|
+
DialStore.updateTransitionMode(panelId, path, typed);
|
|
58
|
+
|
|
59
|
+
if (typed === 'easing') {
|
|
60
|
+
const duration = value.type === 'spring' ? (value.visualDuration ?? 0.3) : value.duration;
|
|
61
|
+
onChange({ type: 'easing', duration, ease: easing.ease });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (typed === 'simple') {
|
|
66
|
+
onChange({
|
|
67
|
+
type: 'spring',
|
|
68
|
+
visualDuration: spring.visualDuration ?? (value.type === 'easing' ? value.duration : 0.3),
|
|
69
|
+
bounce: spring.bounce ?? 0.2,
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
onChange({
|
|
75
|
+
type: 'spring',
|
|
76
|
+
stiffness: spring.stiffness ?? 200,
|
|
77
|
+
damping: spring.damping ?? 25,
|
|
78
|
+
mass: spring.mass ?? 1,
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleSpringUpdate = (key: keyof SpringConfig, val: number) => {
|
|
83
|
+
if (isSimpleSpring) {
|
|
84
|
+
const { stiffness, damping, mass, ...rest } = spring;
|
|
85
|
+
onChange({ ...rest, [key]: val });
|
|
86
|
+
} else {
|
|
87
|
+
const { visualDuration, bounce, ...rest } = spring;
|
|
88
|
+
onChange({ ...rest, [key]: val });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const updateEase = (index: number, val: number) => {
|
|
93
|
+
const next = [...easing.ease] as [number, number, number, number];
|
|
94
|
+
next[index] = val;
|
|
95
|
+
onChange({ ...easing, ease: next });
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const handleEaseFocus = () => {
|
|
99
|
+
easeDraft = formatEase(easing.ease);
|
|
100
|
+
editingEase = true;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const handleEaseBlur = () => {
|
|
104
|
+
const parsed = parseEase(easeDraft);
|
|
105
|
+
if (parsed) onChange({ ...easing, ease: parsed });
|
|
106
|
+
editingEase = false;
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<Folder title={label} defaultOpen={true}>
|
|
111
|
+
<div style="display: flex; flex-direction: column; gap: 6px;">
|
|
112
|
+
{#if isEasing}
|
|
113
|
+
<EasingVisualization {easing} />
|
|
114
|
+
{:else}
|
|
115
|
+
<SpringVisualization spring={spring} isSimpleMode={isSimpleSpring} />
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
118
|
+
<div class="dialkit-labeled-control">
|
|
119
|
+
<span class="dialkit-labeled-control-label">Type</span>
|
|
120
|
+
<SegmentedControl
|
|
121
|
+
options={[
|
|
122
|
+
{ value: 'easing', label: 'Easing' },
|
|
123
|
+
{ value: 'simple', label: 'Time' },
|
|
124
|
+
{ value: 'advanced', label: 'Physics' },
|
|
125
|
+
]}
|
|
126
|
+
value={mode}
|
|
127
|
+
onChange={handleModeChange}
|
|
128
|
+
/>
|
|
129
|
+
</div>
|
|
130
|
+
|
|
131
|
+
{#if isEasing}
|
|
132
|
+
<Slider label="x1" value={easing.ease[0]} onChange={(v) => updateEase(0, v)} min={0} max={1} step={0.01} />
|
|
133
|
+
<Slider label="y1" value={easing.ease[1]} onChange={(v) => updateEase(1, v)} min={-1} max={2} step={0.01} />
|
|
134
|
+
<Slider label="x2" value={easing.ease[2]} onChange={(v) => updateEase(2, v)} min={0} max={1} step={0.01} />
|
|
135
|
+
<Slider label="y2" value={easing.ease[3]} onChange={(v) => updateEase(3, v)} min={-1} max={2} step={0.01} />
|
|
136
|
+
<Slider label="Duration" value={easing.duration} onChange={(v) => onChange({ ...easing, duration: v })} min={0.1} max={2} step={0.05} unit="s" />
|
|
137
|
+
|
|
138
|
+
<div class="dialkit-labeled-control">
|
|
139
|
+
<span class="dialkit-labeled-control-label">Ease</span>
|
|
140
|
+
<input
|
|
141
|
+
type="text"
|
|
142
|
+
class="dialkit-text-input"
|
|
143
|
+
value={editingEase ? easeDraft : formatEase(easing.ease)}
|
|
144
|
+
oninput={(e) => (easeDraft = (e.currentTarget as HTMLInputElement).value)}
|
|
145
|
+
onfocus={handleEaseFocus}
|
|
146
|
+
onblur={handleEaseBlur}
|
|
147
|
+
onkeydown={(e) => {
|
|
148
|
+
if (e.key === 'Enter') {
|
|
149
|
+
(e.currentTarget as HTMLInputElement).blur();
|
|
150
|
+
}
|
|
151
|
+
}}
|
|
152
|
+
spellcheck={false}
|
|
153
|
+
/>
|
|
154
|
+
</div>
|
|
155
|
+
{:else if isSimpleSpring}
|
|
156
|
+
<Slider
|
|
157
|
+
label="Duration"
|
|
158
|
+
value={spring.visualDuration ?? 0.3}
|
|
159
|
+
onChange={(v) => handleSpringUpdate('visualDuration', v)}
|
|
160
|
+
min={0.1}
|
|
161
|
+
max={1}
|
|
162
|
+
step={0.05}
|
|
163
|
+
unit="s"
|
|
164
|
+
/>
|
|
165
|
+
<Slider
|
|
166
|
+
label="Bounce"
|
|
167
|
+
value={spring.bounce ?? 0.2}
|
|
168
|
+
onChange={(v) => handleSpringUpdate('bounce', v)}
|
|
169
|
+
min={0}
|
|
170
|
+
max={1}
|
|
171
|
+
step={0.05}
|
|
172
|
+
/>
|
|
173
|
+
{:else}
|
|
174
|
+
<Slider
|
|
175
|
+
label="Stiffness"
|
|
176
|
+
value={spring.stiffness ?? 400}
|
|
177
|
+
onChange={(v) => handleSpringUpdate('stiffness', v)}
|
|
178
|
+
min={1}
|
|
179
|
+
max={1000}
|
|
180
|
+
step={10}
|
|
181
|
+
/>
|
|
182
|
+
<Slider
|
|
183
|
+
label="Damping"
|
|
184
|
+
value={spring.damping ?? 17}
|
|
185
|
+
onChange={(v) => handleSpringUpdate('damping', v)}
|
|
186
|
+
min={1}
|
|
187
|
+
max={100}
|
|
188
|
+
step={1}
|
|
189
|
+
/>
|
|
190
|
+
<Slider
|
|
191
|
+
label="Mass"
|
|
192
|
+
value={spring.mass ?? 1}
|
|
193
|
+
onChange={(v) => handleSpringUpdate('mass', v)}
|
|
194
|
+
min={0.1}
|
|
195
|
+
max={10}
|
|
196
|
+
step={0.1}
|
|
197
|
+
/>
|
|
198
|
+
{/if}
|
|
199
|
+
</div>
|
|
200
|
+
</Folder>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TransitionConfig } from 'dialkit/store';
|
|
2
|
+
type $$ComponentProps = {
|
|
3
|
+
panelId: string;
|
|
4
|
+
path: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: TransitionConfig;
|
|
7
|
+
onChange: (value: TransitionConfig) => void;
|
|
8
|
+
};
|
|
9
|
+
declare const TransitionControl: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
10
|
+
type TransitionControl = ReturnType<typeof TransitionControl>;
|
|
11
|
+
export default TransitionControl;
|
|
12
|
+
//# sourceMappingURL=TransitionControl.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransitionControl.svelte.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/TransitionControl.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA8B,gBAAgB,EAAE,MAAM,eAAe,CAAC;AASjF,KAAK,gBAAgB,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC7C,CAAC;AAoJJ,QAAA,MAAM,iBAAiB,sDAAwC,CAAC;AAChE,KAAK,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC9D,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../src/svelte/components/transitions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,gBAAgB,CAcnH"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export function dropdownTransition(node, params) {
|
|
2
|
+
const above = params?.above ?? false;
|
|
3
|
+
const duration = params?.duration ?? 150;
|
|
4
|
+
const offset = above ? 8 : -8;
|
|
5
|
+
return {
|
|
6
|
+
duration,
|
|
7
|
+
css: (t) => {
|
|
8
|
+
const eased = t;
|
|
9
|
+
const y = (1 - eased) * offset;
|
|
10
|
+
const scale = 0.95 + 0.05 * eased;
|
|
11
|
+
return `opacity:${eased};transform:translateY(${y}px) scale(${scale});`;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DialConfig, ResolvedValues } from 'dialkit/store';
|
|
2
|
+
export interface CreateDialOptions {
|
|
3
|
+
onAction?: (action: string) => void;
|
|
4
|
+
}
|
|
5
|
+
export type DialKitValues<T> = T;
|
|
6
|
+
export declare function createDialKit<T extends DialConfig>(name: string, config: T, options?: CreateDialOptions): DialKitValues<ResolvedValues<T>>;
|
|
7
|
+
//# sourceMappingURL=createDialKit.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createDialKit.svelte.d.ts","sourceRoot":"","sources":["../../src/svelte/createDialKit.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,UAAU,EAGV,cAAc,EAIf,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC;AAIjC,wBAAgB,aAAa,CAAC,CAAC,SAAS,UAAU,EAChD,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,iBAAiB,GAC1B,aAAa,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CA0BlC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { DialStore } from 'dialkit/store';
|
|
2
|
+
let dialKitInstance = 0;
|
|
3
|
+
export function createDialKit(name, config, options) {
|
|
4
|
+
const panelId = `${name}-${++dialKitInstance}`;
|
|
5
|
+
const resolve = () => buildResolvedValues(config, DialStore.getValues(panelId), '');
|
|
6
|
+
let values = $state(resolve());
|
|
7
|
+
$effect(() => {
|
|
8
|
+
DialStore.registerPanel(panelId, name, config);
|
|
9
|
+
values = resolve();
|
|
10
|
+
const unsubValues = DialStore.subscribe(panelId, () => {
|
|
11
|
+
values = resolve();
|
|
12
|
+
});
|
|
13
|
+
const unsubActions = options?.onAction
|
|
14
|
+
? DialStore.subscribeActions(panelId, options.onAction)
|
|
15
|
+
: undefined;
|
|
16
|
+
return () => {
|
|
17
|
+
unsubValues();
|
|
18
|
+
unsubActions?.();
|
|
19
|
+
DialStore.unregisterPanel(panelId);
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return values;
|
|
23
|
+
}
|
|
24
|
+
function buildResolvedValues(config, flatValues, prefix) {
|
|
25
|
+
const result = {};
|
|
26
|
+
for (const [key, configValue] of Object.entries(config)) {
|
|
27
|
+
if (key === '_collapsed')
|
|
28
|
+
continue;
|
|
29
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
30
|
+
if (Array.isArray(configValue) && configValue.length <= 4 && typeof configValue[0] === 'number') {
|
|
31
|
+
result[key] = flatValues[path] ?? configValue[0];
|
|
32
|
+
}
|
|
33
|
+
else if (typeof configValue === 'number' || typeof configValue === 'boolean' || typeof configValue === 'string') {
|
|
34
|
+
result[key] = flatValues[path] ?? configValue;
|
|
35
|
+
}
|
|
36
|
+
else if (isSpringConfig(configValue) || isEasingConfig(configValue)) {
|
|
37
|
+
result[key] = flatValues[path] ?? configValue;
|
|
38
|
+
}
|
|
39
|
+
else if (isActionConfig(configValue)) {
|
|
40
|
+
result[key] = flatValues[path] ?? configValue;
|
|
41
|
+
}
|
|
42
|
+
else if (isSelectConfig(configValue)) {
|
|
43
|
+
const defaultValue = configValue.default ?? getFirstOptionValue(configValue.options);
|
|
44
|
+
result[key] = flatValues[path] ?? defaultValue;
|
|
45
|
+
}
|
|
46
|
+
else if (isColorConfig(configValue)) {
|
|
47
|
+
result[key] = flatValues[path] ?? configValue.default ?? '#000000';
|
|
48
|
+
}
|
|
49
|
+
else if (isTextConfig(configValue)) {
|
|
50
|
+
result[key] = flatValues[path] ?? configValue.default ?? '';
|
|
51
|
+
}
|
|
52
|
+
else if (typeof configValue === 'object' && configValue !== null) {
|
|
53
|
+
result[key] = buildResolvedValues(configValue, flatValues, path);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function hasType(value, type) {
|
|
59
|
+
return typeof value === 'object' && value !== null && 'type' in value && value.type === type;
|
|
60
|
+
}
|
|
61
|
+
function isSpringConfig(value) {
|
|
62
|
+
return hasType(value, 'spring');
|
|
63
|
+
}
|
|
64
|
+
function isEasingConfig(value) {
|
|
65
|
+
return hasType(value, 'easing');
|
|
66
|
+
}
|
|
67
|
+
function isActionConfig(value) {
|
|
68
|
+
return hasType(value, 'action');
|
|
69
|
+
}
|
|
70
|
+
function isSelectConfig(value) {
|
|
71
|
+
return hasType(value, 'select') && 'options' in value && Array.isArray(value.options);
|
|
72
|
+
}
|
|
73
|
+
function isColorConfig(value) {
|
|
74
|
+
return hasType(value, 'color');
|
|
75
|
+
}
|
|
76
|
+
function isTextConfig(value) {
|
|
77
|
+
return hasType(value, 'text');
|
|
78
|
+
}
|
|
79
|
+
function getFirstOptionValue(options) {
|
|
80
|
+
const first = options[0];
|
|
81
|
+
return typeof first === 'string' ? first : first.value;
|
|
82
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { createDialKit } from './createDialKit.svelte';
|
|
2
|
+
export type { CreateDialOptions, DialKitValues } from './createDialKit.svelte';
|
|
3
|
+
export { default as DialRoot } from './components/DialRoot.svelte';
|
|
4
|
+
export type { DialPosition, DialMode } from './components/DialRoot.svelte';
|
|
5
|
+
export { default as Slider } from './components/Slider.svelte';
|
|
6
|
+
export { default as Toggle } from './components/Toggle.svelte';
|
|
7
|
+
export { default as Folder } from './components/Folder.svelte';
|
|
8
|
+
export { default as ButtonGroup } from './components/ButtonGroup.svelte';
|
|
9
|
+
export { default as SpringControl } from './components/SpringControl.svelte';
|
|
10
|
+
export { default as SpringVisualization } from './components/SpringVisualization.svelte';
|
|
11
|
+
export { default as TransitionControl } from './components/TransitionControl.svelte';
|
|
12
|
+
export { default as EasingVisualization } from './components/EasingVisualization.svelte';
|
|
13
|
+
export { default as TextControl } from './components/TextControl.svelte';
|
|
14
|
+
export { default as SelectControl } from './components/SelectControl.svelte';
|
|
15
|
+
export { default as ColorControl } from './components/ColorControl.svelte';
|
|
16
|
+
export { default as PresetManager } from './components/PresetManager.svelte';
|
|
17
|
+
export { DialStore } from 'dialkit/store';
|
|
18
|
+
export type { SpringConfig, EasingConfig, TransitionConfig, ActionConfig, SelectConfig, ColorConfig, TextConfig, Preset, DialValue, DialConfig, ResolvedValues, ControlMeta, PanelConfig, } from 'dialkit/store';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svelte/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAG/E,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAG3E,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AACzF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAG7E,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,YAAY,EACV,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Core API
|
|
2
|
+
export { createDialKit } from './createDialKit.svelte';
|
|
3
|
+
// Root component
|
|
4
|
+
export { default as DialRoot } from './components/DialRoot.svelte';
|
|
5
|
+
// Component exports
|
|
6
|
+
export { default as Slider } from './components/Slider.svelte';
|
|
7
|
+
export { default as Toggle } from './components/Toggle.svelte';
|
|
8
|
+
export { default as Folder } from './components/Folder.svelte';
|
|
9
|
+
export { default as ButtonGroup } from './components/ButtonGroup.svelte';
|
|
10
|
+
export { default as SpringControl } from './components/SpringControl.svelte';
|
|
11
|
+
export { default as SpringVisualization } from './components/SpringVisualization.svelte';
|
|
12
|
+
export { default as TransitionControl } from './components/TransitionControl.svelte';
|
|
13
|
+
export { default as EasingVisualization } from './components/EasingVisualization.svelte';
|
|
14
|
+
export { default as TextControl } from './components/TextControl.svelte';
|
|
15
|
+
export { default as SelectControl } from './components/SelectControl.svelte';
|
|
16
|
+
export { default as ColorControl } from './components/ColorControl.svelte';
|
|
17
|
+
export { default as PresetManager } from './components/PresetManager.svelte';
|
|
18
|
+
// Store exports (via dialkit/store subpath — svelte-package doesn't bundle, so relative paths to src/store would break in dist)
|
|
19
|
+
export { DialStore } from 'dialkit/store';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare module '*.svelte' {
|
|
2
|
+
import { SvelteComponent } from 'svelte';
|
|
3
|
+
|
|
4
|
+
export default class Component<
|
|
5
|
+
Props extends Record<string, unknown> = Record<string, unknown>,
|
|
6
|
+
Events extends Record<string, unknown> = Record<string, unknown>,
|
|
7
|
+
Slots extends Record<string, unknown> = Record<string, unknown>
|
|
8
|
+
> extends SvelteComponent<Props, Events, Slots> {}
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const themeCSS = "/* Dialkit Theme - Dark glassmorphic design */\n.dialkit-root {\n /* Surfaces */\n --dial-surface: rgba(255, 255, 255, 0.05);\n --dial-surface-hover: rgba(255, 255, 255, 0.1);\n --dial-surface-active: rgba(255, 255, 255, 0.11);\n\n /* Text hierarchy - 3 levels */\n --dial-text-root: #FFFFFF; /* Root title */\n --dial-text-section: rgba(255, 255, 255, 0.7); /* Section titles + carets */\n --dial-text-label: rgba(255, 255, 255, 0.7); /* Input labels */\n\n /* Legacy aliases */\n --dial-text-primary: rgba(255, 255, 255, 0.95);\n --dial-text-secondary: rgba(255, 255, 255, 0.6);\n --dial-text-tertiary: rgba(255, 255, 255, 0.4);\n\n /* Borders */\n --dial-border: rgba(255, 255, 255, 0.1);\n --dial-border-hover: rgba(255, 255, 255, 0.15);\n\n /* Glassmorphic panel */\n --dial-glass-bg: #212121;\n --dial-backdrop-blur: 20px;\n --dial-radius: 8px;\n --dial-row-height: 36px;\n --dial-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);\n\n /* Fonts */\n font-family: system-ui, -apple-system, 'SF Pro Display', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.dialkit-panel {\n position: fixed;\n z-index: 9999;\n max-height: calc(100vh - 32px);\n overflow: visible;\n}\n\n/* Inline mode */\n.dialkit-root[data-mode=\"inline\"] {\n height: 100%;\n}\n\n.dialkit-panel[data-mode=\"inline\"] {\n position: static;\n z-index: auto;\n max-height: 100%;\n height: 100%;\n overflow: hidden;\n}\n\n.dialkit-panel-inner {\n background: var(--dial-glass-bg);\n border: 1px solid var(--dial-border);\n border-radius: 14px;\n backdrop-filter: blur(var(--dial-backdrop-blur));\n -webkit-backdrop-filter: blur(var(--dial-backdrop-blur));\n padding: 10px 12px 12px 12px;\n transform: translateZ(0);\n transform-origin: top right;\n max-height: calc(100vh - 80px);\n overflow-y: auto;\n}\n\n\n.dialkit-panel-inner[data-collapsed=\"true\"] {\n border-radius: 50%;\n padding: 12px;\n}\n\n.dialkit-panel-inner[data-collapsed=\"true\"] .dialkit-panel-header {\n padding-bottom: 0;\n margin-bottom: 0;\n border-bottom: none;\n}\n\n.dialkit-panel-inner[data-collapsed=\"true\"] .dialkit-folder-title-row {\n display: none;\n}\n\n.dialkit-panel-inner[data-collapsed=\"true\"] .dialkit-folder-header-top {\n justify-content: center;\n padding: 0;\n}\n\n.dialkit-panel-inner::-webkit-scrollbar {\n display: none;\n}\n\n.dialkit-panel-inner {\n -ms-overflow-style: none;\n scrollbar-width: none;\n}\n\n.dialkit-panel-inline {\n width: 100%;\n height: 100%;\n max-height: none;\n overflow-y: auto;\n box-shadow: none;\n border-radius: 0;\n border: none;\n box-sizing: border-box;\n}\n\n.dialkit-panel[data-mode=\"inline\"] .dialkit-panel-wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n}\n\n/* Position variants */\n.dialkit-panel[data-position=\"top-right\"] {\n top: 16px;\n right: 16px;\n}\n\n.dialkit-panel[data-position=\"top-left\"] {\n top: 16px;\n left: 16px;\n}\n\n.dialkit-panel[data-position=\"bottom-right\"] {\n bottom: 16px;\n right: 16px;\n}\n\n.dialkit-panel[data-position=\"bottom-left\"] {\n bottom: 16px;\n left: 16px;\n}\n\n/* Folder */\n.dialkit-folder {\n padding-bottom: 8px;\n margin-bottom: 8px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.dialkit-folder:last-child:not(.dialkit-folder-root) {\n padding-bottom: 0;\n margin-bottom: 0;\n}\n\n.dialkit-folder-root {\n padding-bottom: 0;\n margin-bottom: 0;\n border-bottom: none;\n}\n\n.dialkit-panel-header {\n padding-bottom: 6px;\n margin-bottom: 12px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n}\n\n.dialkit-folder-header {\n cursor: pointer;\n user-select: none;\n}\n\n.dialkit-folder-header-top {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 0 8px 0;\n}\n\n\n.dialkit-folder-title {\n font-size: 13px;\n font-weight: 600;\n color: var(--dial-text-section);\n letter-spacing: -0.01em;\n transform: translateY(-0.5px);\n transition: color 0.15s;\n}\n\n.dialkit-folder-title-root {\n font-size: 15px;\n font-weight: 600;\n color: var(--dial-text-root);\n transform: translateZ(0);\n}\n\n.dialkit-folder-title-row {\n display: flex;\n align-items: center;\n gap: 6px;\n flex: 1;\n white-space: nowrap;\n overflow: hidden;\n}\n\n.dialkit-folder-copy {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n padding: 0;\n background: transparent;\n border: none;\n cursor: pointer;\n}\n\n.dialkit-folder-copy svg {\n width: 14px;\n height: 14px;\n color: var(--dial-text-section);\n}\n\n.dialkit-folder-icon {\n width: 20px;\n height: 20px;\n padding: 2px;\n box-sizing: border-box;\n flex-shrink: 0;\n color: var(--dial-text-label);\n opacity: 0.6;\n}\n\n.dialkit-panel-icon {\n position: absolute;\n top: 12px;\n right: 12px;\n width: 16px;\n height: 16px;\n color: #fff;\n z-index: 1;\n}\n\n.dialkit-folder-content {\n will-change: transform;\n}\n\n.dialkit-folder-inner {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding-bottom: 10px;\n}\n\n/* Non-root folders - top & bottom HR dividers */\n.dialkit-folder:not(.dialkit-folder-root) {\n border-top: 1px solid rgba(255, 255, 255, 0.06);\n border-bottom: 1px solid rgba(255, 255, 255, 0.06);\n margin-top: 4px;\n margin-bottom: 4px;\n padding-bottom: 0;\n}\n\n/* Adjacent non-root folders collapse gap and share a single divider */\n.dialkit-folder:not(.dialkit-folder-root) + .dialkit-folder:not(.dialkit-folder-root) {\n margin-top: -10px;\n border-top: none;\n}\n\n/* Non-root folder header - match row height */\n.dialkit-folder:not(.dialkit-folder-root) > .dialkit-folder-header {\n height: var(--dial-row-height);\n padding: 0;\n}\n\n.dialkit-folder:not(.dialkit-folder-root) > .dialkit-folder-header > .dialkit-folder-header-top {\n padding: 0;\n height: 100%;\n}\n\n/* Root folder inner needs no extra bottom padding */\n.dialkit-folder-root > .dialkit-folder-content > .dialkit-folder-inner {\n padding-bottom: 0;\n}\n\n/* Content spacing handled by folder-inner gap */\n\n\n/* Slider */\n.dialkit-slider-wrapper {\n position: relative;\n height: var(--dial-row-height);\n}\n\n.dialkit-slider {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n user-select: none;\n overflow: hidden;\n background: var(--dial-surface);\n border-radius: var(--dial-radius);\n touch-action: none;\n}\n\n.dialkit-slider-hashmarks {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n\n.dialkit-slider-hashmark {\n position: absolute;\n top: 50%;\n width: 1px;\n height: 8px;\n border-radius: 999px;\n transform: translateX(-50%) translateY(-50%);\n background: rgba(255, 255, 255, 0);\n transition: background 200ms;\n}\n\n.dialkit-slider-active .dialkit-slider-hashmark {\n background: rgba(255, 255, 255, 0.15);\n}\n\n.dialkit-slider-active .dialkit-slider-value {\n color: #fff;\n}\n\n.dialkit-slider-fill {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n transition: background 0.15s;\n pointer-events: none;\n}\n\n.dialkit-slider-handle {\n position: absolute;\n top: 50%;\n width: 3px;\n height: 20px;\n border-radius: 999px;\n pointer-events: none;\n}\n\n.dialkit-slider-label {\n position: absolute;\n left: 10px;\n top: 50%;\n transform: translateY(calc(-50% - 0.5px));\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n pointer-events: none;\n transition: color 0.15s;\n}\n\n.dialkit-slider-value {\n position: absolute;\n right: 10px;\n top: 50%;\n transform: translateY(calc(-50% + 0.5px));\n font-size: 13px;\n font-weight: 500;\n font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;\n color: var(--dial-text-label);\n pointer-events: auto;\n transition: color 0.15s, border-color 0.15s;\n border-bottom: 1px solid transparent;\n padding-bottom: 1px;\n}\n\n.dialkit-slider-value-editable {\n border-bottom-color: var(--dial-text-label);\n}\n\n.dialkit-slider-input {\n position: absolute;\n right: 10px;\n top: 50%;\n transform: translateY(-50%);\n width: 4ch;\n min-width: 3ch;\n max-width: 6ch;\n font-size: 13px;\n font-weight: 500;\n font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;\n color: var(--dial-text-label);\n background: transparent;\n border: none;\n border-bottom: 1px solid var(--dial-text-label);\n padding: 0 0 1px 0;\n outline: none;\n text-align: right;\n}\n\n.dialkit-slider-input:focus {\n color: #fff;\n}\n\n/* Segmented Control */\n.dialkit-segmented {\n position: relative;\n display: flex;\n padding: 2px;\n background: transparent;\n border-radius: var(--dial-radius);\n}\n\n.dialkit-segmented-pill {\n position: absolute;\n top: 2px;\n bottom: 2px;\n background: var(--dial-surface-active);\n border-radius: 6px;\n z-index: 0;\n pointer-events: none;\n}\n\n.dialkit-segmented-button {\n position: relative;\n z-index: 1;\n flex: 1;\n padding: 8px 12px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n background: transparent;\n border: none;\n cursor: pointer;\n transition: color 0.15s;\n}\n\n.dialkit-segmented-button[data-active=\"true\"] {\n color: rgba(255, 255, 255, 0.8);\n}\n\n.dialkit-segmented-button[data-active=\"false\"] {\n color: var(--dial-text-label);\n}\n\n/* Toggle */\n.dialkit-toggle {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 16px;\n background: var(--dial-surface);\n border-radius: var(--dial-radius);\n cursor: pointer;\n user-select: none;\n transition: background 0.15s;\n}\n\n.dialkit-toggle:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-toggle-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n transition: color 0.15s;\n}\n\n.dialkit-toggle[data-checked=\"true\"] .dialkit-toggle-label {\n color: var(--dial-text-primary);\n}\n\n.dialkit-toggle-track {\n width: 36px;\n height: 20px;\n border-radius: 10px;\n background: var(--dial-surface-active);\n transition: background 0.2s;\n position: relative;\n}\n\n.dialkit-toggle[data-checked=\"true\"] .dialkit-toggle-track {\n background: rgba(255, 255, 255, 0.3);\n}\n\n.dialkit-toggle-thumb {\n position: absolute;\n top: 2px;\n width: 16px;\n height: 16px;\n border-radius: 8px;\n background: rgba(255, 255, 255, 0.8);\n}\n\n/* Button Group */\n.dialkit-button-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.dialkit-button {\n flex: 1;\n padding: 10px 16px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-secondary);\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.dialkit-button:hover {\n background: var(--dial-surface-hover);\n color: var(--dial-text-primary);\n}\n\n.dialkit-button:active {\n background: var(--dial-surface-active);\n}\n\n/* Labeled Control Row (label + control side by side) */\n.dialkit-labeled-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n height: var(--dial-row-height);\n padding: 2px 10px 2px 12px;\n background: var(--dial-surface);\n border-radius: var(--dial-radius);\n}\n\n.dialkit-labeled-control-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n flex-shrink: 0;\n line-height: 17px;\n}\n\n.dialkit-labeled-control .dialkit-segmented {\n flex-shrink: 0;\n}\n\n.dialkit-action-button {\n width: 160px;\n flex-shrink: 0;\n padding: 10px 16px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-secondary);\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.dialkit-action-button:hover {\n background: var(--dial-surface-hover);\n color: var(--dial-text-primary);\n}\n\n.dialkit-action-button:active {\n background: var(--dial-surface-active);\n}\n\n.dialkit-actions-group {\n align-items: flex-start;\n}\n\n.dialkit-actions-stack {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 160px;\n}\n\n/* Spring Visualization */\n.dialkit-spring-viz {\n width: 100%;\n border-radius: var(--dial-radius);\n background: var(--dial-surface);\n overflow: visible;\n}\n\n.dialkit-easing-viz {\n width: 100%;\n aspect-ratio: 256 / 140;\n}\n\n/* Panel Wrapper (contains panel + toolbar) */\n.dialkit-panel-wrapper {\n display: inline-flex;\n flex-direction: column;\n}\n\n/* Panel Toolbar */\n.dialkit-panel-toolbar {\n display: flex;\n align-items: center;\n gap: 6px;\n height: var(--dial-row-height);\n margin-bottom: 6px;\n}\n\n.dialkit-toolbar-add {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--dial-row-height);\n height: var(--dial-row-height);\n padding: 0;\n flex-shrink: 0;\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-toolbar-add:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-toolbar-add svg {\n width: 16px;\n height: 16px;\n color: var(--dial-text-label);\n}\n\n.dialkit-toolbar-copy {\n position: relative;\n display: flex;\n align-items: center;\n gap: 6px;\n height: var(--dial-row-height);\n padding: 0 12px;\n flex-shrink: 0;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-toolbar-copy:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-toolbar-copy-icon-wrap {\n position: relative;\n width: 16px;\n height: 16px;\n flex-shrink: 0;\n}\n\n.dialkit-toolbar-copy-icon {\n position: absolute;\n inset: 0;\n width: 16px;\n height: 16px;\n}\n\n/* Text Control */\n.dialkit-text-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n height: var(--dial-row-height);\n padding: 0 12px;\n background: var(--dial-surface);\n border-radius: var(--dial-radius);\n}\n\n.dialkit-text-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n flex-shrink: 0;\n}\n\n.dialkit-text-input {\n flex: 1;\n min-width: 0;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: transparent;\n border: none;\n padding: 0;\n outline: none;\n text-align: right;\n cursor: text;\n}\n\n.dialkit-text-input:focus {\n color: #fff;\n}\n\n.dialkit-text-input::placeholder {\n color: var(--dial-text-tertiary);\n}\n\n/* Select Control - Full-width row */\n.dialkit-select-row {\n}\n\n.dialkit-select-trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: var(--dial-row-height);\n padding: 0 12px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-select-trigger:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-select-trigger[data-open=\"true\"] {\n background: var(--dial-surface-active);\n}\n\n.dialkit-select-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n flex-shrink: 0;\n transform: translateY(-0.5px);\n}\n\n.dialkit-select-right {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.dialkit-select-value {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n transform: translateY(-0.5px);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.dialkit-select-chevron {\n width: 20px;\n height: 20px;\n padding: 2px;\n box-sizing: border-box;\n flex-shrink: 0;\n opacity: 0.6;\n}\n\n/* Select Dropdown (portaled to body) */\n.dialkit-select-dropdown {\n background: var(--dial-glass-bg);\n border: 1px solid var(--dial-border);\n border-radius: var(--dial-radius);\n padding: 4px;\n z-index: 10000;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);\n}\n\n.dialkit-select-option {\n display: block;\n width: 100%;\n padding: 8px 10px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n text-align: left;\n transition: background 0.15s, color 0.15s;\n}\n\n.dialkit-select-option:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-select-option[data-selected=\"true\"] {\n color: var(--dial-text-primary);\n background: var(--dial-surface-active);\n}\n\n/* Color Control */\n.dialkit-color-control {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n height: var(--dial-row-height);\n padding: 0 12px;\n background: var(--dial-surface);\n border-radius: var(--dial-radius);\n}\n\n.dialkit-color-label {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n flex-shrink: 0;\n transform: translateY(-0.5px);\n}\n\n.dialkit-color-inputs {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.dialkit-color-hex {\n font-size: 13px;\n font-weight: 500;\n font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;\n color: var(--dial-text-label);\n cursor: text;\n transform: translateY(-0.5px);\n}\n\n.dialkit-color-hex-input {\n width: 7ch;\n font-size: 13px;\n font-weight: 500;\n font-family: ui-monospace, 'SF Mono', 'Courier New', monospace;\n color: var(--dial-text-label);\n background: transparent;\n border: none;\n padding: 0;\n outline: none;\n text-transform: uppercase;\n transform: translateY(-0.5px);\n}\n\n.dialkit-color-hex-input:focus {\n color: #fff;\n}\n\n.dialkit-color-swatch {\n width: 20px;\n height: 20px;\n border-radius: 4px;\n border: 1px solid rgba(255, 255, 255, 0.2);\n cursor: pointer;\n transition: transform 0.15s;\n}\n\n.dialkit-color-swatch:hover {\n transform: scale(1.1);\n}\n\n.dialkit-color-picker-native {\n position: absolute;\n width: 0;\n height: 0;\n opacity: 0;\n pointer-events: none;\n}\n\n/* Preset Manager */\n.dialkit-preset-manager {\n position: relative;\n flex: 1;\n}\n\n.dialkit-preset-trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: var(--dial-row-height);\n padding: 0 12px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: var(--dial-surface);\n border: none;\n border-radius: var(--dial-radius);\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-preset-trigger:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-preset-trigger[data-disabled=\"true\"] {\n cursor: default;\n}\n\n.dialkit-preset-trigger[data-disabled=\"true\"]:hover {\n background: var(--dial-surface);\n}\n\n.dialkit-preset-trigger[data-open=\"true\"] {\n background: var(--dial-surface-active);\n}\n\n.dialkit-preset-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n\n.dialkit-preset-dropdown {\n width: max-content;\n background: #2a2a2a;\n border: 1px solid var(--dial-border);\n border-radius: 12px;\n padding: 4px;\n z-index: 10000;\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);\n}\n\n.dialkit-preset-list {\n display: flex;\n flex-direction: column;\n gap: 2px;\n margin-bottom: 4px;\n padding-bottom: 4px;\n border-bottom: 1px solid var(--dial-border);\n}\n\n.dialkit-preset-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 10px 8px 10px;\n gap: 8px;\n border-radius: 8px;\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-preset-item:hover {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-preset-item[data-active=\"true\"] {\n background: var(--dial-surface-active);\n}\n\n.dialkit-preset-name {\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.dialkit-preset-item[data-active=\"true\"] .dialkit-preset-name {\n color: var(--dial-text-primary);\n}\n\n.dialkit-preset-delete {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n padding: 0;\n background: transparent;\n border: none;\n cursor: pointer;\n opacity: 0;\n transition: opacity 0.15s;\n flex-shrink: 0;\n}\n\n.dialkit-preset-item:hover .dialkit-preset-delete {\n opacity: 0.6;\n}\n\n.dialkit-preset-delete:hover {\n opacity: 1 !important;\n}\n\n.dialkit-preset-delete svg {\n width: 14px;\n height: 14px;\n color: #fff;\n pointer-events: none;\n}\n\n.dialkit-preset-save-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n width: 100%;\n padding: 8px 10px;\n font-family: inherit;\n font-size: 13px;\n font-weight: 500;\n color: var(--dial-text-label);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: background 0.15s, color 0.15s;\n}\n\n.dialkit-preset-save-btn:hover {\n background: var(--dial-surface-hover);\n color: var(--dial-text-primary);\n}\n\n.dialkit-preset-save-btn svg {\n width: 12px;\n height: 12px;\n}\n\n.dialkit-preset-save-row {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px;\n}\n\n.dialkit-preset-input {\n flex: 1;\n min-width: 0;\n padding: 6px 8px;\n font-family: inherit;\n font-size: 13px;\n color: var(--dial-text-primary);\n background: var(--dial-surface);\n border: 1px solid var(--dial-border);\n border-radius: 6px;\n outline: none;\n}\n\n.dialkit-preset-input:focus {\n border-color: var(--dial-text-label);\n}\n\n.dialkit-preset-input::placeholder {\n color: var(--dial-text-tertiary);\n}\n\n.dialkit-preset-confirm {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n padding: 0;\n background: var(--dial-surface);\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: background 0.15s;\n}\n\n.dialkit-preset-confirm:hover:not(:disabled) {\n background: var(--dial-surface-hover);\n}\n\n.dialkit-preset-confirm:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.dialkit-preset-confirm svg {\n width: 14px;\n height: 14px;\n color: var(--dial-text-label);\n}\n";
|
|
2
|
+
//# sourceMappingURL=theme-css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-css.d.ts","sourceRoot":"","sources":["../../src/svelte/theme-css.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,QAAQ,kusBAukCpB,CAAC"}
|