@lyeve-labs/ui-kit 0.35.1 → 0.35.2
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/Autocomplete.svelte +6 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/motion.js +18 -1
- package/package.json +1 -1
|
@@ -181,10 +181,15 @@
|
|
|
181
181
|
{/if}
|
|
182
182
|
|
|
183
183
|
<div class="relative" bind:this={fieldEl} use:anchor>
|
|
184
|
+
<!-- The form posts the chosen option's value. The visible input holds the
|
|
185
|
+
label, or the words being typed, so it carries no name: a form read it
|
|
186
|
+
as the value and posted "Alpha" where the option was "a". -->
|
|
187
|
+
{#if name}
|
|
188
|
+
<input type="hidden" {name} {disabled} value={value ?? ''} />
|
|
189
|
+
{/if}
|
|
184
190
|
<input
|
|
185
191
|
bind:this={inputEl}
|
|
186
192
|
id={fieldId}
|
|
187
|
-
{name}
|
|
188
193
|
{placeholder}
|
|
189
194
|
{disabled}
|
|
190
195
|
{required}
|
package/dist/index.d.ts
CHANGED
|
@@ -100,4 +100,4 @@ export { cn, type ClassValue } from './utils/cn.js';
|
|
|
100
100
|
export { getTheme, getThemePreference, nextThemePreference, resolveTheme, setTheme, setThemePreference, systemTheme, themeBootScript, watchThemePreference, toggleTheme, watchSystemTheme, THEME_PREFERENCES, type Theme, type ThemePreference, } from './utils/theme.js';
|
|
101
101
|
export * as motion from './motion.js';
|
|
102
102
|
export type { Rung as MotionRung, Curve as MotionCurve } from './motion.js';
|
|
103
|
-
export declare const VERSION = "0.35.
|
|
103
|
+
export declare const VERSION = "0.35.2";
|
package/dist/index.js
CHANGED
|
@@ -108,4 +108,4 @@ export * as motion from './motion.js';
|
|
|
108
108
|
// ── Version ────────────────────────────────────────────────────────────────
|
|
109
109
|
// Generated from package.json by `pnpm version:sync`. Bump package.json, never
|
|
110
110
|
// this line. The build and the test suite fail when the two disagree.
|
|
111
|
-
export const VERSION = '0.35.
|
|
111
|
+
export const VERSION = '0.35.2';
|
package/dist/motion.js
CHANGED
|
@@ -125,9 +125,25 @@ export function still(node) {
|
|
|
125
125
|
return true;
|
|
126
126
|
return typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
127
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* A frame with the element's own transform put in front of the preset's.
|
|
130
|
+
*
|
|
131
|
+
* An animation replaces the inline style it animates, it does not add to it.
|
|
132
|
+
* Under `animate:`, Svelte holds a leaving item where it stood with an inline
|
|
133
|
+
* `translate(...)` set just before the exit starts. An exit that animates
|
|
134
|
+
* `transform` alone would replace that and draw the item from the list's
|
|
135
|
+
* corner. A frame that does not move `transform` is returned as it is.
|
|
136
|
+
*/
|
|
137
|
+
function composeTransform(frame, own) {
|
|
138
|
+
if (!own || own === 'none')
|
|
139
|
+
return frame;
|
|
140
|
+
return frame.replace(/transform:\s*([^;]+)/, (_match, preset) => `transform: ${own} ${preset}`);
|
|
141
|
+
}
|
|
128
142
|
/**
|
|
129
143
|
* One transition from the rung its entrance runs at and the frame it draws.
|
|
130
144
|
* The exit is derived, never chosen: one rung faster, on the exit curve.
|
|
145
|
+
* The element's inline transform is read when the transition starts, after
|
|
146
|
+
* Svelte has pinned a leaving list item, and kept in every frame.
|
|
131
147
|
*/
|
|
132
148
|
function surface(rung, css) {
|
|
133
149
|
return (node) => {
|
|
@@ -135,10 +151,11 @@ function surface(rung, css) {
|
|
|
135
151
|
return { duration: 0 };
|
|
136
152
|
return ({ direction } = { direction: 'in' }) => {
|
|
137
153
|
const leaving = direction === 'out';
|
|
154
|
+
const own = node.style?.transform ?? '';
|
|
138
155
|
return {
|
|
139
156
|
duration: duration(leaving ? EXIT_RUNG[rung] : rung),
|
|
140
157
|
easing: easing(leaving ? 'exit' : 'enter'),
|
|
141
|
-
css,
|
|
158
|
+
css: own ? (t, u) => composeTransform(css(t, u), own) : css,
|
|
142
159
|
};
|
|
143
160
|
};
|
|
144
161
|
};
|
package/package.json
CHANGED