@meistrari/tela-build 1.78.1 → 1.79.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  Latest updates and announcements.
4
4
 
5
+ ## October 5, 2026
6
+
7
+ - [Floating chat](/templates/chat#floating) adds `position="left" | "right"` (default `right`) to place the launcher and panel in either bottom corner, with matching alignment and mirrored open/close animations.
8
+ - [Kbd](/components/kbd) icon keys render a 12px icon inside the 16×16 key, and Enter is now `TelaKbd icon="i-ph-arrow-bend-down-left"`. `TelaKbdReturn` is deprecated and logs a warning in development.
9
+
5
10
  ## September 30, 2026
6
11
 
7
12
  - [Switch](/components/switch) thumb stretches iOS-style: pressing widens it toward the opposite side (16 → 18px on `sm`, 18 → 20px on `md`), and on release it slides over while settling back to a circle. The stretch is a `scaleX` on the thumb background, so it animates smoothly between pixels and leaves `#thumb` slot content undistorted. Respects `prefers-reduced-motion`. The `md` thumb is now 18px with a 3px inset on every side (was 20px, 2px inset).
@@ -5,6 +5,8 @@ import { floatingWindowContextKey } from './floating-window-context'
5
5
 
6
6
  const props = withDefaults(defineProps<{
7
7
  open: boolean
8
+ /** Corner used by the launcher and the window's open/close animation. */
9
+ position?: 'left' | 'right'
8
10
  /** Close on outside clicks. Disable to keep the chat open while interacting with the page. */
9
11
  closeOnOutsideClick?: boolean
10
12
  /** Anchors the launcher to the nearest positioned ancestor instead of the viewport (docs/embedded previews). */
@@ -15,6 +17,7 @@ const props = withDefaults(defineProps<{
15
17
  keepMounted?: boolean
16
18
  }>(), {
17
19
  closeOnOutsideClick: true,
20
+ position: 'right',
18
21
  })
19
22
 
20
23
  const emit = defineEmits<{
@@ -284,7 +287,13 @@ function focusEditorIn(content: HTMLElement) {
284
287
 
285
288
  <template>
286
289
  <TelaPopover :open="open" @update:open="handleOpenUpdate">
287
- <div ref="launcher" :class="cn('bottom-16px z-599', contained ? 'absolute right-16px' : 'fixed right-[calc(16px+var(--scrollbar-width,0px))]')">
290
+ <div
291
+ ref="launcher" :class="cn(
292
+ 'bottom-16px z-599',
293
+ contained ? 'absolute' : 'fixed',
294
+ position === 'left' ? 'left-16px' : contained ? 'right-16px' : 'right-[calc(16px+var(--scrollbar-width,0px))]',
295
+ )"
296
+ >
288
297
  <div :class="cn('transition-opacity', open ? 'opacity-0 duration-100' : 'duration-160 delay-160')">
289
298
  <TelaPopoverTrigger as-child>
290
299
  <slot name="launcher">
@@ -295,7 +304,7 @@ function focusEditorIn(content: HTMLElement) {
295
304
  </div>
296
305
  <TelaPopoverContent
297
306
  side="top"
298
- align="end"
307
+ :align="position === 'left' ? 'start' : 'end'"
299
308
  :side-offset="sideOffset"
300
309
  :force-mount="forceMountContent"
301
310
  :data-content-hidden="contentHidden || undefined"
@@ -316,14 +325,16 @@ function focusEditorIn(content: HTMLElement) {
316
325
  :initial="launcherBox"
317
326
  :animate="surfaceAnimate"
318
327
  :transition="surfaceTransition"
319
- class="absolute bottom-0 right-0 w-full h-full overflow-hidden bg rounded-12px border-0.5px border-black/12 [box-shadow:-24px_-24px_249px_0_rgba(0,0,0,0.08),-12px_-8px_48px_0_rgba(0,0,0,0.03)]"
328
+ :class="position === 'left' ? 'left-0' : 'right-0'"
329
+ class="absolute bottom-0 w-full h-full overflow-hidden bg rounded-12px border-0.5px border-black/12 [box-shadow:-24px_-24px_249px_0_rgba(0,0,0,0.08),-12px_-8px_48px_0_rgba(0,0,0,0.03)]"
320
330
  >
321
331
  <Motion
322
332
  :initial="contentInitial"
323
333
  :animate="contentAnimate"
324
334
  :transition="contentTransition"
325
- :style="{ originX: 1, originY: 1, height: shellHeight ? `${shellHeight}px` : '100%' }"
326
- class="absolute bottom-0 right-0 w-[min(480px,calc(100vw-32px))] flex flex-col"
335
+ :style="{ originX: position === 'left' ? 0 : 1, originY: 1, height: shellHeight ? `${shellHeight}px` : '100%' }"
336
+ :class="position === 'left' ? 'left-0' : 'right-0'"
337
+ class="absolute bottom-0 w-[min(480px,calc(100vw-32px))] flex flex-col"
327
338
  >
328
339
  <slot />
329
340
  </Motion>
@@ -1,3 +1,11 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * @deprecated Use `<TelaKbd icon="i-ph-arrow-bend-down-left" />` instead. Kept for apps that still render it.
4
+ */
5
+ if (import.meta.dev)
6
+ warnOnce('[tela-build] TelaKbdReturn is deprecated. Use <TelaKbd icon="i-ph-arrow-bend-down-left" /> instead.')
7
+ </script>
8
+
1
9
  <template>
2
10
  <div h-20px w-20px bg="#EFF0F3" rounded-4px relative>
3
11
  <div h-10px w-12px bg="#60798F" rounded-4px absolute class="top-50% translate-y--50% left-50% translate-x--50%" />
@@ -55,6 +55,19 @@ type KbdProps = {
55
55
  </div>
56
56
  ```
57
57
 
58
+ ### Icon Keys
59
+
60
+ Pass `icon` for modifier and special keys. Icon keys are 16×16 with a 12px Phosphor icon, the same height as text keys. Enter uses `i-ph-arrow-bend-down-left` (`TelaKbdReturn` is deprecated).
61
+
62
+ ```vue
63
+ <div class="flex gap-1">
64
+ <TelaKbd icon="i-ph-command" />
65
+ <TelaKbd>K</TelaKbd>
66
+ <TelaKbd icon="i-ph-option" />
67
+ <TelaKbd icon="i-ph-arrow-bend-down-left" />
68
+ </div>
69
+ ```
70
+
58
71
  ### Arrow Keys
59
72
 
60
73
  ```vue
@@ -17,7 +17,7 @@ const variantClasses = computed(() => (({
17
17
  flex items-center justify-center w-16px h-16px text-10px leading-none tracking-normal rounded-5px
18
18
  :class="cn(variantClasses)"
19
19
  >
20
- <TelaIcon v-if="icon" :name="icon" class="h-14px! w-14px!" />
20
+ <TelaIcon v-if="icon" :name="icon" class="h-12px! w-12px!" />
21
21
  <span v-else class="translate-0.25px"><slot /></span>
22
22
  </code>
23
23
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.78.1",
3
+ "version": "1.79.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",
@@ -1,4 +1,5 @@
1
- import { type ClassValue, clsx } from 'clsx'
1
+ import { clsx } from 'clsx'
2
+ import type { ClassValue } from 'clsx'
2
3
  import { twMerge } from 'tailwind-merge'
3
4
  import { camelize, getCurrentInstance, toHandlerKey } from 'vue'
4
5
 
@@ -28,3 +29,12 @@ export function useEmitAsProps<Name extends string>(
28
29
  })
29
30
  return result
30
31
  }
32
+
33
+ const warnedMessages = new Set<string>()
34
+
35
+ export function warnOnce(message: string) {
36
+ if (warnedMessages.has(message))
37
+ return
38
+ warnedMessages.add(message)
39
+ console.warn(message)
40
+ }