@lyeve-labs/ui-kit 0.35.0 → 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.
@@ -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}
@@ -93,7 +93,13 @@
93
93
  // is what stops a real click, and it is the only thing that does, so a
94
94
  // change arriving any other way (a synthetic event, a script driving the
95
95
  // node) would still move the bound value with nothing on screen to say so.
96
- if (disabled) return;
96
+ // bind:checked has already taken the input's new state, so a disabled box
97
+ // puts the input and the value back.
98
+ if (disabled) {
99
+ e.currentTarget.checked = !e.currentTarget.checked;
100
+ checked = e.currentTarget.checked;
101
+ return;
102
+ }
97
103
  // The DOM clears indeterminate on the first click. Leaving the prop set
98
104
  // would repaint the mixed bar over a box the user has just ticked.
99
105
  indeterminate = false;
@@ -102,6 +108,10 @@
102
108
  }
103
109
  </script>
104
110
 
111
+ <!-- bind:checked and not {checked}: a visitor can tick the box before the
112
+ page hydrates. A one-way prop is written over the input when the page
113
+ hydrates and clears that tick. The binding reads the input's live state
114
+ instead, the same way the browser kept it. -->
105
115
  {#snippet control()}
106
116
  <input
107
117
  type="checkbox"
@@ -110,7 +120,7 @@
110
120
  {value}
111
121
  {required}
112
122
  {disabled}
113
- {checked}
123
+ bind:checked
114
124
  {indeterminate}
115
125
  aria-checked={indeterminate ? 'mixed' : undefined}
116
126
  aria-invalid={error ? 'true' : undefined}
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.0";
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.0';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyeve-labs/ui-kit",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
4
4
  "description": "A clean, accessible, palette-aware Svelte 5 component library. The design system behind LyEve.",
5
5
  "license": "MIT",
6
6
  "author": "LyEve Labs <hello@lyeve.com>",