@meistrari/tela-build 1.78.0 → 1.79.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
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
+
5
9
  ## September 30, 2026
6
10
 
7
11
  - [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).
@@ -11,6 +15,54 @@ Latest updates and announcements.
11
15
 
12
16
  - `TelaTransparentInput` only emits `blur` on an outside click when its input has focus. Without `displayIcon`, the first click anywhere on the page used to emit `blur`, so title fields saved an unchanged value on every visit.
13
17
 
18
+ ### Modal: new design, action required
19
+
20
+ [Modal](/components/modal) has a new design: a built-in header (title, description, close button), a body that scrolls between a pinned header and footer, and a right-aligned footer. **Your existing modals don't change until you update them.** Without `size`, `TelaModal` keeps rendering the legacy layout, which is now deprecated and will be removed in a future major version.
21
+
22
+ **What you need to do.** For each `TelaModal` in your app:
23
+
24
+ 1. Add `size`, chosen by content: `sm` (320px) for confirmations, single-field prompts and create modals; `md` (480px) for forms and share panels; `lg` (840px) for tables, galleries and previews.
25
+ 2. Move the title and subtitle into the `title` and `description` props, and delete any hand-built header and close button: the modal renders both.
26
+ 3. Move the action buttons into the `footer` slot, without a wrapper `div`. Drop Cancel/Back buttons that only close the modal, since the close button does that. Footer buttons use the default size: never `size="lg"`, `size="sm"` or a custom `class`.
27
+ 4. Remove the legacy props: `modal-width`, `compact`, `hide-dividers`, `small-title`, `is-close-icon-absolute`, `:is-close-icon="false"`, and width or padding overrides such as `class="w-420px!"` or `dialog-content-class="!p-20px"`. Your editor shows these as deprecated.
28
+
29
+ ```vue
30
+ <!-- Before -->
31
+ <TelaModal v-model="isOpen" modal-width="md" :compact="true" :hide-dividers="true" :is-close-icon="false">
32
+ <div flex="~ col" w-full gap-16px>
33
+ <div flex="~ row justify-between" items-start>
34
+ <h4 heading-h4-semibold text-primary>Create project</h4>
35
+ <TelaIconButton icon="i-ph-x" size="md" color="secondary" p-8px mt--12px mr--16px @click="isOpen = false" />
36
+ </div>
37
+ <TelaInput v-model="name" label="Name" w-full />
38
+ <div flex gap-8px justify-end>
39
+ <TelaButton variant="secondary" @click="isOpen = false">Cancel</TelaButton>
40
+ <TelaButton @click="create">Create</TelaButton>
41
+ </div>
42
+ </div>
43
+ </TelaModal>
44
+
45
+ <!-- After -->
46
+ <TelaModal v-model="isOpen" size="sm" title="Create project">
47
+ <TelaInput v-model="name" label="Name" w-full />
48
+ <template #footer>
49
+ <TelaButton @click="create">Create</TelaButton>
50
+ </template>
51
+ </TelaModal>
52
+ ```
53
+
54
+ Full-bleed viewers that draw their own header (file previews, detail pages) use `size="lg"` (or `fullscreen`) with `hide-header`, and put their content in the unpadded `content` slot. See [Modal](/components/modal) for every example.
55
+
56
+ **What changes without any action:**
57
+
58
+ - Every modal, in both layouts, now opens and closes with the same scale-and-fade as popovers, selects and dropdowns (`popover-enter-exit`), and its backdrop fades on the same timing (`overlay-enter-exit`, also in `css/animations.css`).
59
+ - `TelaConfirmationModal` already uses the new design. Its props and events are unchanged; its message renders under the title in the scrollable body, so long messages never push the buttons out of view.
60
+ - `preventClose` now works: it blocks Escape, outside clicks and the close button while set (e.g. during a save). Some apps already passed it, but it had no effect until now.
61
+ - The close button has an accessible label, `closeLabel` (default `'Close'`). Pass a translated string in localized apps.
62
+ - Modals with a hidden header no longer point `aria-describedby` at a missing description, which silences radix-vue's dev warning.
63
+
64
+ **Also new:** every slot receives a `close` function; `title` and `description` slots take rich content; `content-class`, `header-class`, `title-class`, `dialog-content-class` and `class` merge with the defaults, so `content-class="p-0"` gives an edge-to-edge body. Hairline dividers appear only while content scrolls under the header or footer.
65
+
14
66
  ## September 25, 2026
15
67
 
16
68
  - [Radio Group](/components/radio-group) and `TelaRadioButton` share one look: `border-strong` border on `bg` (hover `border-accent` on `bg-subtle`), a 5px `neutral-900` border that pops in with a scale animation when checked, and `border`/`bg-muted` when disabled. `TelaRadioButton` now styles its `disabled` state, and `TelaRadioGroup` generates unique ids with `useId()`.
@@ -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>
@@ -4,6 +4,7 @@ import TelaButton from '../button/button.vue'
4
4
 
5
5
  const props = defineProps<{
6
6
  title: string
7
+ /** @deprecated No effect: the modal uses the sized layout. */
7
8
  compact?: boolean
8
9
  variant?: 'primary' | 'danger'
9
10
  confirmButtonText?: string
@@ -19,6 +20,7 @@ const emit = defineEmits<{
19
20
  }>()
20
21
 
21
22
  const open = defineModel<boolean>('open')
23
+ const messageId = useId()
22
24
 
23
25
  const confirmButtonVariant = computed(() => {
24
26
  return props.variant === 'danger' ? 'danger' : 'primary'
@@ -28,30 +30,26 @@ const confirmButtonVariant = computed(() => {
28
30
  <template>
29
31
  <TelaModal
30
32
  v-model:model-value="open"
31
- :compact="props.compact ?? true"
32
- hide-dividers
33
+ size="sm"
34
+ :title="props.title"
35
+ :header-class="$slots.default ? 'pb-[4px]' : undefined"
33
36
  :overlay-class="props.overlayClass"
34
- :is-close-icon="false"
35
- :style="{ paddingBlock: '20px' }"
37
+ :prevent-close="props.loading"
38
+ :aria-describedby="$slots.default ? messageId : undefined"
36
39
  @close="emit('cancel')"
37
40
  >
38
- <div flex="~ col" w-400px>
39
- <h6 body-20-semibold text-gray-900>
40
- {{ props.title }}
41
- </h6>
42
- <div body-16-regular text-gray-700 mt-4px>
43
- <slot />
44
- </div>
41
+ <!-- the message lives in the scrollable body, not the fixed header, so long text never pushes the buttons out -->
42
+ <div v-if="$slots.default" :id="messageId" class="body-14-regular text-secondary">
43
+ <slot />
45
44
  </div>
45
+
46
46
  <template #footer>
47
- <div flex="~" gap-8px w-full justify-between>
48
- <TelaButton :disabled="props.loading" size="lg" variant="secondary" flex-1 whitespace-nowrap @click="emit('cancel')">
49
- {{ props.cancelButtonText ?? 'Cancel' }}
50
- </TelaButton>
51
- <TelaButton :loading="props.loading" size="lg" :variant="confirmButtonVariant" :data-testid="props.confirmButtonTestId" flex-1 whitespace-nowrap @click="emit('confirm')">
52
- {{ props.confirmButtonText ?? 'Confirm' }}
53
- </TelaButton>
54
- </div>
47
+ <TelaButton :disabled="props.loading" variant="secondary" @click="emit('cancel')">
48
+ {{ props.cancelButtonText ?? 'Cancel' }}
49
+ </TelaButton>
50
+ <TelaButton :loading="props.loading" :variant="confirmButtonVariant" :data-testid="props.confirmButtonTestId" @click="emit('confirm')">
51
+ {{ props.confirmButtonText ?? 'Confirm' }}
52
+ </TelaButton>
55
53
  </template>
56
54
  </TelaModal>
57
55
  </template>