@meistrari/tela-build 1.106.0 → 2.0.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 +20 -0
- package/components/tela/avatar/avatar-fallback.vue +28 -0
- package/components/tela/avatar/avatar.mdx +12 -0
- package/components/tela/avatar/avatar.vue +4 -2
- package/components/tela/button/button.mdx +1 -1
- package/components/tela/card/card.mdx +15 -11
- package/components/tela/chat/chat-empty-state.vue +16 -13
- package/components/tela/chat/chat-widget-header.vue +6 -5
- package/components/tela/chat/chat.mdx +6 -6
- package/components/tela/chat/sidepanel/sidepanel-window.vue +2 -2
- package/components/tela/dropdown-menu/dropdown-menu.mdx +1 -1
- package/components/tela/file-upload/file-upload.mdx +1 -2
- package/components/tela/filter/filter-content.vue +27 -3
- package/components/tela/filter/filter-trigger.vue +6 -6
- package/components/tela/filter/filter.mdx +31 -4
- package/components/tela/filter/filter.vue +4 -0
- package/components/tela/modal/modal.mdx +8 -5
- package/components/tela/popover/popover.mdx +9 -3
- package/components/tela/side-sheet/side-sheet.mdx +4 -2
- package/components/tela/sidebar/sidebar-logo.vue +1 -3
- package/components/tela/sidebar/sidebar.mdx +3 -3
- package/docs/animations.md +58 -120
- package/docs/design-review.md +79 -0
- package/docs/index.md +258 -0
- package/docs/sounds.md +1 -1
- package/docs/spacing-and-surfaces.md +116 -0
- package/docs/tokens.md +64 -73
- package/docs/typography.md +63 -53
- package/lib/__tests__/doc-generator.test.ts +86 -6
- package/lib/doc-generator.ts +160 -72
- package/lib/extractors/volar-extract.ts +12 -1
- package/lib/tela-build-skill.ts +46 -1
- package/package.json +1 -1
- package/components/tela/collapsible-section/collapsible-section.mdx +0 -180
- package/components/tela/collapsible-section/collapsible-section.vue +0 -51
- package/components/tela/collapsible-section-with-actions.vue +0 -60
- package/components/tela/confirm-button/confirm-button.vue +0 -141
- package/components/tela/date-range-picker.vue +0 -223
- package/components/tela/dialog/dialog.mdx +0 -170
- package/components/tela/dialog/dialog.vue +0 -186
- package/components/tela/expandable-input.vue +0 -96
- package/components/tela/filter/filter-content.test.ts +0 -60
- package/components/tela/filters/checkbox-filter.vue +0 -165
- package/components/tela/filters/date-filter.vue +0 -209
- package/components/tela/filters/user-filter.vue +0 -271
- package/components/tela/initials.vue +0 -33
- package/components/tela/inline-input.vue +0 -77
- package/components/tela/live-label.vue +0 -48
- package/components/tela/long-press-button.vue +0 -98
- package/components/tela/multiple-select/multiple-select.mdx +0 -310
- package/components/tela/multiple-select/multiple-select.vue +0 -652
- package/components/tela/pane.vue +0 -118
- package/components/tela/popover-list/popover-list-nested.vue +0 -108
- package/components/tela/popover-list/popover-list.vue +0 -193
- package/components/tela/selector/selector.vue +0 -47
- package/components/tela/sheet/sheet-close.vue +0 -12
- package/components/tela/sheet/sheet-content.vue +0 -61
- package/components/tela/sheet/sheet-description.vue +0 -23
- package/components/tela/sheet/sheet-footer.vue +0 -18
- package/components/tela/sheet/sheet-header.vue +0 -15
- package/components/tela/sheet/sheet-root.vue +0 -18
- package/components/tela/sheet/sheet-title.vue +0 -23
- package/components/tela/sheet/sheet-trigger.vue +0 -12
- package/components/tela/sheet/sheet.client.vue +0 -154
- package/components/tela/sheet/sheet.mdx +0 -176
- package/components/tela/sheet/variants.ts +0 -22
- package/components/tela/skeleton-icon.vue +0 -24
- package/components/tela/span.vue +0 -24
- package/components/tela/variable-input.vue +0 -104
- package/components/tela/wide-button/wide-button.vue +0 -40
- package/docs/interfaces.md +0 -467
- package/docs/surfaces.md +0 -127
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ Latest updates and announcements.
|
|
|
4
4
|
|
|
5
5
|
## November 18, 2026
|
|
6
6
|
|
|
7
|
+
- [Chat → Empty State](/templates/chat#empty-state) `TelaChatEmptyState` has a `#header` slot that replaces the title and description, so a host can render its own greeting, such as a logo above a custom title.
|
|
8
|
+
- [Chat → Widget Header](/templates/chat#widget-header--history) `TelaChatWidgetHeader` is 56px tall with no bottom border. In a sidepanel whose host provides only `close` under `chatShellControlsKey`, the button that calls `close` is a collapse button (arrows pointing in) instead of minimize.
|
|
9
|
+
- [Chat → Sidepanel](/templates/chat#sidepanel) `TelaChatSidepanelWindow` opens at and resizes down to 346px (was 440px).
|
|
7
10
|
- [Chat → Model Selector](/templates/chat#model-selector) New provider icons `TelaChatIconsGrok` (xAI's Grok mark) and `TelaChatIconsKimi` (Moonshot AI's Kimi mark), drawn like `TelaChatIconsGemini`: one color (`currentColor`) on a 16px, 24-unit box, so Grok and Kimi models line up with the others in the model list.
|
|
8
11
|
- Icons: `i-custom:assistantAvatar` is the Tela Assistant avatar: the Tela logomark in white on a 48% black rounded tile, drawn at 16×16. The assistant onboarding card uses it.
|
|
9
12
|
- [Animated Number](/components/animated-number) spaces its digits with the font's own tabular figures (`tabular-nums`) instead of padding each digit to the width of the widest one, which left wide gaps around narrow digits such as `1`. Digits still keep a steady width while they change, and the spacing now follows the typeface at every text size.
|
|
@@ -11,6 +14,23 @@ Latest updates and announcements.
|
|
|
11
14
|
|
|
12
15
|
## November 17, 2026
|
|
13
16
|
|
|
17
|
+
- **Breaking (2.0.0):** removed 20 outdated components, so an app that still renders one of them gets an unresolved tag after upgrading to 2.0.0. Apps on a `^1.x` range stay on 1.x until they bump. Each has a replacement:
|
|
18
|
+
- `TelaDialog`: [Modal](/components/modal). For a yes-or-no question, use `TelaConfirmationModal`, which stays.
|
|
19
|
+
- `TelaSheet` and its parts (`TelaSheetRoot`, `TelaSheetContent`, `TelaSheetHeader`, `TelaSheetFooter`, `TelaSheetTitle`, `TelaSheetDescription`, `TelaSheetTrigger`, `TelaSheetClose`): [Side Sheet](/components/side-sheet) for a panel on the side, or [Modal](/components/modal) for content that needs the whole screen.
|
|
20
|
+
- `TelaCollapsibleSection` and `TelaCollapsibleSectionWithActions`: [Collapsible](/components/collapsible).
|
|
21
|
+
- `TelaMultipleSelect` and `TelaPopoverList`: [Dropdown Menu](/components/dropdown-menu) with `TelaDropdownMenuCheckboxItem`.
|
|
22
|
+
- `TelaInitials`: [Avatar](/components/avatar), which renders the initial of `alt` with the new `TelaAvatarFallback`. Override it through the avatar's `fallback` slot.
|
|
23
|
+
- `TelaFiltersCheckboxFilter`, `TelaFiltersDateFilter`, `TelaFiltersUserFilter` and `TelaDateRangePicker`: [Filter](/components/filter), with [Range Calendar](/components/range-calendar) in a filter's `#footer-{key}` slot for a custom date range.
|
|
24
|
+
- `TelaConfirmButton`, `TelaWideButton` and `TelaLongPressButton`: [Button](/components/button).
|
|
25
|
+
- `TelaInlineInput`, `TelaExpandableInput` and `TelaVariableInput`: [Input](/components/input) and [Textarea](/components/textarea).
|
|
26
|
+
- `TelaLiveLabel`: [Status](/components/status).
|
|
27
|
+
- `TelaSkeletonIcon`: [Skeleton](/components/skeleton).
|
|
28
|
+
- `TelaSpan`, `TelaPane` and `TelaSelector`: plain markup with the design tokens.
|
|
29
|
+
- [Filter](/components/filter#apply-button) The `header-{key}` and `footer-{key}` slots receive `close`, and `TelaFilter` emits `openChange` with the open filter's key (or `null` when it closes). Together they let a filter apply its selection from an Apply button instead of on every click.
|
|
30
|
+
- [Filter](/components/filter) The popover animates its size only when it opens or moves to another filter. Inside one filter its height follows the content in the same frame, so content that animates itself (a calendar revealed in a `TelaCollapsible`) no longer leaves the content and the popover out of step, and a list filtered by a search no longer animates on each keystroke.
|
|
31
|
+
- [Filter](/components/filter) Home and End in a search input inside a filter's header move the caret again, instead of jumping focus to the first or last option.
|
|
32
|
+
- [Filter](/components/filter#scrollable-options) A long option list still scrolls, but its scrollbar is now transparent.
|
|
33
|
+
- [Filter](/components/filter) The selected-count badge on a trigger is 12px tall and centered with the label. It was 20px: its 8px digit lost the badge's own line height and took the label's 18px. The digit now uses the badge's 9px text.
|
|
14
34
|
- [Onboarding Card](/components/onboarding-card) is a new component for short, step-by-step feature introductions: a 280px card with an illustration from the `#thumb` slot, a title and a description per step, step dots that double as navigation, and "Skip" with a next arrow, or "Got it" on the last step. The current step is bound with `v-model:step`, and `skip` and `finish` leave dismissing to the host. All copy comes from `steps` and `labels`. The card has no entrance of its own, so the host animates it in (the docs show a `Motion` with `as-child`), and each step advances by itself after `duration` (default 5000ms, `0` turns it off) while the current dot fills like a progress bar. Hovering or keyboard focus pauses it, and the last step waits for the user. Between steps the illustration fades out and the next one remounts, so `#thumb` content can play its own entrance. Going to the last step, "Skip" fades out and the arrow widens into the finish button. Under `prefers-reduced-motion`, only the progress fill still moves.
|
|
15
35
|
- [Chat → Model Selector](/templates/chat#model-selector) When `reasoning-options` changes and no longer includes the selected level, `v-model:reasoning` is cleared, so the menu and the parent agree.
|
|
16
36
|
- [Combobox](/components/combobox) Table layout matches the design specs: group headings and the Cost / Input / Output headers are 10px semibold, provider icons are 15px inside their 20px box, and token limits are 11px uppercase on every row, in primary text on the selected and highlighted rows. The trigger drops the `Claude ` prefix (`Claude Opus 5` reads `Opus 5`).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AvatarSize } from './avatar.vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
/** The word whose first letter is shown, usually the person's or workspace's name. */
|
|
6
|
+
word: string
|
|
7
|
+
size?: AvatarSize
|
|
8
|
+
class?: string
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const initial = computed(() => props.word.charAt(0).toUpperCase())
|
|
12
|
+
|
|
13
|
+
const textSizes: Record<AvatarSize | 'default', string> = {
|
|
14
|
+
'2xs': 'text-11px',
|
|
15
|
+
'xs': 'text-12px',
|
|
16
|
+
'sm': 'text-16px',
|
|
17
|
+
'md': 'text-20px',
|
|
18
|
+
'lg': 'text-28px',
|
|
19
|
+
'xl': 'text-32px',
|
|
20
|
+
'default': 'text-18px',
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div :class="cn('flex size-full items-center justify-center bg-neutral-950', textSizes[props.size ?? 'default'], props.class)">
|
|
26
|
+
<TelaAnimatedValue :value="initial" class="text-center font-540 leading-18px text-inverse" />
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
@@ -38,6 +38,18 @@ A flexible avatar component that displays user images with fallback support. Aut
|
|
|
38
38
|
|
|
39
39
|
The component automatically generates initials from the `alt` text when no image is provided.
|
|
40
40
|
|
|
41
|
+
### Custom Fallback
|
|
42
|
+
|
|
43
|
+
The initial is `TelaAvatarFallback`. Override it through the `fallback` slot, for example to show the initial of a different word:
|
|
44
|
+
|
|
45
|
+
```vue
|
|
46
|
+
<TelaAvatar size="sm">
|
|
47
|
+
<template #fallback>
|
|
48
|
+
<TelaAvatarFallback word="Workspace" size="sm" />
|
|
49
|
+
</template>
|
|
50
|
+
</TelaAvatar>
|
|
51
|
+
```
|
|
52
|
+
|
|
41
53
|
### Different Sizes
|
|
42
54
|
|
|
43
55
|
```vue
|
|
@@ -71,7 +71,7 @@ watch(() => props.image, () => {
|
|
|
71
71
|
:class="[radiusClass, props.class]"
|
|
72
72
|
bg-cover
|
|
73
73
|
bg-center
|
|
74
|
-
overflow-hidden
|
|
74
|
+
overflow-hidden select-none
|
|
75
75
|
flex items-center justify-center
|
|
76
76
|
:style="style"
|
|
77
77
|
>
|
|
@@ -91,6 +91,8 @@ watch(() => props.image, () => {
|
|
|
91
91
|
</template>
|
|
92
92
|
</ClientOnly>
|
|
93
93
|
<TelaIcon v-else-if="errorLoadingImage" name="i-ph-image-broken" text="icon-tertiary" size="lg" />
|
|
94
|
-
<
|
|
94
|
+
<slot v-else-if="alt || $slots.fallback" name="fallback">
|
|
95
|
+
<TelaAvatarFallback :word="alt ?? ''" :size="size" />
|
|
96
|
+
</slot>
|
|
95
97
|
</div>
|
|
96
98
|
</template>
|
|
@@ -116,7 +116,7 @@ Three sizes, `md` by default. Each one sets its own text, padding, radius and ic
|
|
|
116
116
|
Go to Home
|
|
117
117
|
</TelaButton>
|
|
118
118
|
|
|
119
|
-
<TelaButton to="https://example.com" target="_blank" variant="
|
|
119
|
+
<TelaButton to="https://example.com" target="_blank" variant="secondary">
|
|
120
120
|
External Link
|
|
121
121
|
</TelaButton>
|
|
122
122
|
```
|
|
@@ -8,7 +8,7 @@ A surface container component used to group related content with consistent visu
|
|
|
8
8
|
- Attributify spacing/radius props (`p-*`, `px-*`, `py-*`, `rounded-*`) are intentionally ignored on `<TelaCard>` to keep `size` deterministic. If you need a forced override, use `class` with the important modifier (e.g. `class="!p-0"`).
|
|
9
9
|
- Cards in grids must use `h-full` for consistent heights.
|
|
10
10
|
- **Never** wrap `TelaTable` in `TelaCard` — tables are their own surface.
|
|
11
|
-
-
|
|
11
|
+
- A label and the large value it names are one unit: keep them tight (0–4px), and separate that unit from the rest of the card with a clearly larger gap. `TelaHomeMetricsCard` uses no gap inside the pair and 36px below it; use it for metric cards.
|
|
12
12
|
|
|
13
13
|
## Size Prop
|
|
14
14
|
|
|
@@ -63,22 +63,26 @@ Cards in grids must use `h-full` for consistent heights.
|
|
|
63
63
|
</div>
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
###
|
|
66
|
+
### Label and value
|
|
67
67
|
|
|
68
68
|
```vue
|
|
69
|
-
<!-- Wrong —
|
|
70
|
-
<TelaCard size="
|
|
71
|
-
<div flex flex-col gap-
|
|
72
|
-
<span body-12-
|
|
69
|
+
<!-- Wrong — one gap for everything, so the value floats between the label and the chart -->
|
|
70
|
+
<TelaCard size="xs" h-full>
|
|
71
|
+
<div flex flex-col gap-16px>
|
|
72
|
+
<span body-12-regular text-secondary>Total Requests</span>
|
|
73
73
|
<span heading-h2-semibold text-primary>128,430</span>
|
|
74
|
+
<RequestsChart />
|
|
74
75
|
</div>
|
|
75
76
|
</TelaCard>
|
|
76
77
|
|
|
77
|
-
<!-- Correct -->
|
|
78
|
-
<TelaCard size="
|
|
79
|
-
<div flex flex-col gap-
|
|
80
|
-
<
|
|
81
|
-
|
|
78
|
+
<!-- Correct — the label and value are one unit, set apart from the rest -->
|
|
79
|
+
<TelaCard size="xs" h-full>
|
|
80
|
+
<div flex flex-col gap-36px>
|
|
81
|
+
<div flex flex-col>
|
|
82
|
+
<span body-12-regular text-secondary>Total Requests</span>
|
|
83
|
+
<h2 heading-h2-semibold text-primary>128,430</h2>
|
|
84
|
+
</div>
|
|
85
|
+
<RequestsChart />
|
|
82
86
|
</div>
|
|
83
87
|
</TelaCard>
|
|
84
88
|
```
|
|
@@ -15,19 +15,22 @@ defineProps<{
|
|
|
15
15
|
:class="compact ? 'gap-24px px-12px pt-16px' : 'gap-40px px-24px'"
|
|
16
16
|
>
|
|
17
17
|
<div flex="~ col" gap-32px :class="compact ? 'mt-auto' : ''">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
<!-- Replaces the title and description, e.g. a logo above a custom greeting. -->
|
|
19
|
+
<slot name="header">
|
|
20
|
+
<div v-if="title || description" flex="~ col" items-center gap-4px text-center>
|
|
21
|
+
<component
|
|
22
|
+
:is="compact ? 'h5' : 'h1'"
|
|
23
|
+
v-if="title"
|
|
24
|
+
text-primary
|
|
25
|
+
:class="compact ? 'heading-h4-semibold' : 'heading-h3-semibold'"
|
|
26
|
+
>
|
|
27
|
+
{{ title }}
|
|
28
|
+
</component>
|
|
29
|
+
<p v-if="description" text-secondary body-14-regular>
|
|
30
|
+
{{ description }}
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
</slot>
|
|
31
34
|
|
|
32
35
|
<!-- Suggestions, hints, or any other content under the greeting. -->
|
|
33
36
|
<slot />
|
|
@@ -8,7 +8,7 @@ const props = withDefaults(defineProps<{
|
|
|
8
8
|
expandable?: boolean
|
|
9
9
|
/** Expanded state for the standalone toggle; ignored inside a floating window. */
|
|
10
10
|
expanded?: boolean
|
|
11
|
-
/** Show the minimize button outside a floating window (inside one it is always shown). */
|
|
11
|
+
/** Show the minimize button outside a floating window (inside one it is always shown). A sidepanel whose host provides only `close` shows it as collapse. */
|
|
12
12
|
closable?: boolean
|
|
13
13
|
newConversationLabel?: string
|
|
14
14
|
historyLabel?: string
|
|
@@ -37,6 +37,7 @@ const shellControls = shell ? inject(chatShellControlsKey, null) : null
|
|
|
37
37
|
const showExpand = computed(() => Boolean(floatingWindow || shellControls?.toggleExpanded) || props.expandable)
|
|
38
38
|
const showClose = computed(() => Boolean(floatingWindow || shellControls) || props.closable)
|
|
39
39
|
const isExpanded = computed(() => (Boolean(shellControls?.toggleExpanded) && shell === 'sidepanel') || (floatingWindow ? floatingWindow.expanded.value : props.expanded))
|
|
40
|
+
const closeCollapsesSidepanel = shell === 'sidepanel' && !!shellControls && !shellControls.toggleExpanded
|
|
40
41
|
|
|
41
42
|
const historyOpen = ref(false)
|
|
42
43
|
const historySelection = ref('')
|
|
@@ -74,8 +75,8 @@ function selectConversation(id: unknown) {
|
|
|
74
75
|
<div
|
|
75
76
|
data-widget-header
|
|
76
77
|
flex items-center justify-between gap-8px
|
|
77
|
-
h-
|
|
78
|
-
bg
|
|
78
|
+
h-56px pl-18px pr-10px flex-shrink-0
|
|
79
|
+
bg
|
|
79
80
|
>
|
|
80
81
|
<h5 v-if="title" heading-h5-semibold text-primary truncate>
|
|
81
82
|
{{ title }}
|
|
@@ -128,10 +129,10 @@ function selectConversation(id: unknown) {
|
|
|
128
129
|
/>
|
|
129
130
|
<TelaIconButton
|
|
130
131
|
v-if="showClose"
|
|
131
|
-
icon="i-ph-minus"
|
|
132
|
+
:icon="closeCollapsesSidepanel ? 'i-ph-arrows-in-simple' : 'i-ph-minus'"
|
|
132
133
|
size="sm"
|
|
133
134
|
color="secondary"
|
|
134
|
-
:aria-label="closeLabel"
|
|
135
|
+
:aria-label="closeCollapsesSidepanel ? collapseLabel : closeLabel"
|
|
135
136
|
@click.stop.prevent="close"
|
|
136
137
|
/>
|
|
137
138
|
</div>
|
|
@@ -271,9 +271,9 @@ const conversations = [
|
|
|
271
271
|
|
|
272
272
|
An always-open, docked chat column. It has no launcher and no `open` state: render it when the panel should exist.
|
|
273
273
|
|
|
274
|
-
To let users close the sidepanel, provide `{ close }` under `chatShellControlsKey` (exported from `chat-shell-context`) above the shell and stop rendering it when `close` is called. The widget header then shows a
|
|
274
|
+
To let users close the sidepanel, provide `{ close }` under `chatShellControlsKey` (exported from `chat-shell-context`) above the shell and stop rendering it when `close` is called. The widget header then shows a collapse button (arrows pointing in) that calls `close` (a minimize button once `toggleExpanded` is also provided), and Escape pressed inside the panel calls `close` once no menu or overlay is open. Add `toggleExpanded` to also move between the floating window and the sidepanel: the header shows its expand toggle in both shells and calls `toggleExpanded` instead of growing the floating window.
|
|
275
275
|
|
|
276
|
-
`TelaChatSidepanelWindow` is **in-flow** (`position: sticky`, full viewport height,
|
|
276
|
+
`TelaChatSidepanelWindow` is **in-flow** (`position: sticky`, full viewport height, 346px wide by default), so the page layout reserves its width instead of being overlapped. Its surface is `bg-subtle` with no border of its own, so it reads as part of a `bg-subtle` app shell. Users can drag its left edge to widen it up to 45% of the viewport; the width resets when the panel unmounts. Place it as the **last item of a flex row**:
|
|
277
277
|
|
|
278
278
|
```vue
|
|
279
279
|
<script setup lang="ts">
|
|
@@ -379,7 +379,7 @@ The same header fill rule applies: the frame stretches every child except `[data
|
|
|
379
379
|
|
|
380
380
|
### Empty State
|
|
381
381
|
|
|
382
|
-
`TelaChatEmptyState` replaces the conversation while there are no messages: greeting on top, anything you want under it (suggestions, hints), and the prompt input in the bottom slot. In `compact` mode (widgets) the greeting and input push to opposite edges.
|
|
382
|
+
`TelaChatEmptyState` replaces the conversation while there are no messages: greeting on top, anything you want under it (suggestions, hints), and the prompt input in the bottom slot. In `compact` mode (widgets) the greeting and input push to opposite edges. Fill the `#header` slot to replace the title and description with your own greeting, such as a logo above a custom title.
|
|
383
383
|
|
|
384
384
|
```vue
|
|
385
385
|
<script setup lang="ts">
|
|
@@ -1716,11 +1716,11 @@ type WidgetHeaderProps = {
|
|
|
1716
1716
|
title?: string
|
|
1717
1717
|
expandable?: boolean // show the expand toggle outside a floating window
|
|
1718
1718
|
expanded?: boolean // standalone toggle state; ignored inside a floating window
|
|
1719
|
-
closable?: boolean // show the minimize button outside a floating window
|
|
1719
|
+
closable?: boolean // show the minimize button outside a floating window (collapse in a sidepanel whose host provides only `close`)
|
|
1720
1720
|
newConversationLabel?: string // default: 'New conversation'
|
|
1721
1721
|
historyLabel?: string // default: 'Conversation history'
|
|
1722
1722
|
expandLabel?: string // default: 'Expand'
|
|
1723
|
-
collapseLabel?: string // default: 'Collapse'
|
|
1723
|
+
collapseLabel?: string // default: 'Collapse'; also labels the sidepanel's collapse button
|
|
1724
1724
|
closeLabel?: string // default: 'Close'
|
|
1725
1725
|
}
|
|
1726
1726
|
// Inside TelaChatFloatingWindow the header also renders an expand toggle that grows the window up to 8px from the top of the viewport, and a minus button that closes the window (emits `close` and sets `open` to false).
|
|
@@ -1966,7 +1966,7 @@ type TextShimmerProps = {
|
|
|
1966
1966
|
|
|
1967
1967
|
## Slots
|
|
1968
1968
|
|
|
1969
|
-
- `TelaChatEmptyState`: `default` (content under the greeting: suggestions, hints), `input` (prompt input pinned to the bottom).
|
|
1969
|
+
- `TelaChatEmptyState`: `header` (replaces the title and description), `default` (content under the greeting: suggestions, hints), `input` (prompt input pinned to the bottom).
|
|
1970
1970
|
- `TelaChatFloatingWindow`: `launcher` (optional; defaults to `TelaChatFloatingWindowTrigger`), `default` (header + chat surface).
|
|
1971
1971
|
- `TelaChatSidepanelWindow`: `default`.
|
|
1972
1972
|
- `TelaChatWidgetHeader`: `history` (rendered only while the history panel is open).
|
|
@@ -11,7 +11,7 @@ function closeOnEscape() {
|
|
|
11
11
|
shellControls.close()
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const minWidth =
|
|
14
|
+
const minWidth = 346
|
|
15
15
|
const maxViewportShare = 0.45
|
|
16
16
|
|
|
17
17
|
const panel = ref<HTMLElement | null>(null)
|
|
@@ -40,7 +40,7 @@ function startResize(event: PointerEvent) {
|
|
|
40
40
|
<aside
|
|
41
41
|
ref="panel"
|
|
42
42
|
sticky top-0 flex flex-col h-100dvh overflow-hidden shrink-0 bg-subtle p-8px
|
|
43
|
-
class="w-[min(
|
|
43
|
+
class="w-[min(346px,100vw)]"
|
|
44
44
|
@keydown.esc="closeOnEscape"
|
|
45
45
|
>
|
|
46
46
|
<div
|
|
@@ -30,6 +30,20 @@ const fadeTransition = {
|
|
|
30
30
|
const contentMeasure = useTemplateRef<HTMLElement>('contentMeasure')
|
|
31
31
|
const { height: heightContent } = useElementSize(contentMeasure)
|
|
32
32
|
|
|
33
|
+
// The popover animates its size only while it opens or moves to another filter. Inside one filter its height is
|
|
34
|
+
// left to layout, so it follows its content in the same frame: content that animates itself (a calendar in a
|
|
35
|
+
// collapsible) drives the height without two animations fighting, and a list shrinking as the user types a search
|
|
36
|
+
// doesn't animate on keystrokes.
|
|
37
|
+
const isChangingFilter = ref(false)
|
|
38
|
+
const { start: startFilterChange } = useTimeoutFn(() => {
|
|
39
|
+
isChangingFilter.value = false
|
|
40
|
+
}, 300, { immediate: false })
|
|
41
|
+
|
|
42
|
+
watch(() => props.configs.map(config => config.key).join('|'), () => {
|
|
43
|
+
isChangingFilter.value = true
|
|
44
|
+
startFilterChange()
|
|
45
|
+
}, { immediate: true })
|
|
46
|
+
|
|
33
47
|
const computedHeightContent = computed(() => {
|
|
34
48
|
if (heightContent.value > 0) {
|
|
35
49
|
return `${heightContent.value}px`
|
|
@@ -114,6 +128,13 @@ function onItemsKeydown(event: KeyboardEvent) {
|
|
|
114
128
|
return
|
|
115
129
|
}
|
|
116
130
|
|
|
131
|
+
// Home and End move the caret in a search input in the header; don't take them over for the list
|
|
132
|
+
const target = event.target as HTMLElement | null
|
|
133
|
+
const isEditing = Boolean(target?.closest('input, textarea, [contenteditable="true"]'))
|
|
134
|
+
if (isEditing && (event.key === 'Home' || event.key === 'End')) {
|
|
135
|
+
return
|
|
136
|
+
}
|
|
137
|
+
|
|
117
138
|
const currentIndex = buttons.indexOf(document.activeElement as HTMLButtonElement)
|
|
118
139
|
|
|
119
140
|
switch (event.key) {
|
|
@@ -201,8 +222,8 @@ function getSlideMotionVariants(index: number, closingState: boolean) {
|
|
|
201
222
|
@pointer-down-outside="emit('pointerDownOutside', $event)"
|
|
202
223
|
>
|
|
203
224
|
<div
|
|
204
|
-
class="[transition:height_0.25s_ease-out,width_0.25s_ease-out]"
|
|
205
|
-
:style="{ width, ...(computedHeightContent ? { height: computedHeightContent } : {}) }"
|
|
225
|
+
:class="isChangingFilter ? '[transition:height_0.25s_ease-out,width_0.25s_ease-out]' : '[transition:width_0.25s_ease-out]'"
|
|
226
|
+
:style="{ width, ...(isChangingFilter && computedHeightContent ? { height: computedHeightContent } : {}) }"
|
|
206
227
|
>
|
|
207
228
|
<div ref="contentMeasure" @keydown="onItemsKeydown" @pointerover="onItemsPointerOver">
|
|
208
229
|
<AnimatePresence mode="popLayout" :initial="false">
|
|
@@ -218,10 +239,12 @@ function getSlideMotionVariants(index: number, closingState: boolean) {
|
|
|
218
239
|
:filter="cfg.config"
|
|
219
240
|
:selected="props.modelValue[cfg.config.key] ?? []"
|
|
220
241
|
:toggle="(value: string) => toggleOption(cfg.config.key, value, cfg.config.selectionMode)"
|
|
242
|
+
:close="() => emit('select')"
|
|
221
243
|
/>
|
|
222
244
|
|
|
223
245
|
<div mx--4px>
|
|
224
|
-
|
|
246
|
+
<!-- the list still scrolls; its scrollbar is transparent -->
|
|
247
|
+
<TelaScrollArea :class="cn('flex flex-col', cfg.config.optionsClass)" scroll-thumb-class="opacity-0" tabindex="-1">
|
|
225
248
|
<div px-4px>
|
|
226
249
|
<component
|
|
227
250
|
:is="cfg.config.selectionMode === 'single' ? TelaRadioGroupRoot : 'div'"
|
|
@@ -272,6 +295,7 @@ function getSlideMotionVariants(index: number, closingState: boolean) {
|
|
|
272
295
|
:filter="cfg.config"
|
|
273
296
|
:selected="props.modelValue[cfg.config.key] ?? []"
|
|
274
297
|
:toggle="(value: string) => toggleOption(cfg.config.key, value, cfg.config.selectionMode)"
|
|
298
|
+
:close="() => emit('select')"
|
|
275
299
|
/>
|
|
276
300
|
</Motion>
|
|
277
301
|
</AnimatePresence>
|
|
@@ -19,7 +19,7 @@ defineEmits<{
|
|
|
19
19
|
type="button"
|
|
20
20
|
:data-active="isActive || undefined"
|
|
21
21
|
:class="cn(
|
|
22
|
-
'group inline-flex h-[32px] items-center gap-[7px] px-[12px] border-l-[0.5px] border-y-[0.5px] border-strong bg-background outline-none transition-
|
|
22
|
+
'group inline-flex h-[32px] items-center gap-[7px] px-[12px] border-l-[0.5px] border-y-[0.5px] border-strong bg-background outline-none transition-colors duration-150',
|
|
23
23
|
'text-[14px] leading-[18px] -tracking-[0.15px] font-540 text-primary',
|
|
24
24
|
'focus-visible:ring-2 focus-visible:ring-border [&:not([data-active])]:hover:bg-subtle data-[active]:bg-muted first:rounded-l-[10px] last:rounded-r-[10px] last:border-r-[0.5px]',
|
|
25
25
|
triggerClass,
|
|
@@ -27,19 +27,19 @@ defineEmits<{
|
|
|
27
27
|
:aria-label="filter.showCount && count ? `${filter.label}, ${count} selected` : undefined"
|
|
28
28
|
@click="$emit('click')"
|
|
29
29
|
>
|
|
30
|
-
<div inline-flex items-center>
|
|
31
|
-
<span button-14-semibold text-primary>{{ filter.label }}</span>
|
|
30
|
+
<div class="inline-flex items-center">
|
|
31
|
+
<span class="button-14-semibold text-primary">{{ filter.label }}</span>
|
|
32
32
|
|
|
33
33
|
<AnimatePresence>
|
|
34
34
|
<Motion
|
|
35
35
|
v-if="count && (filter.selectionMode === 'multiple' || filter.showCount)"
|
|
36
|
-
|
|
36
|
+
class="ml-[5px] flex items-center"
|
|
37
37
|
:initial="{ width: 0, x: -20, scale: 0, opacity: 0 }"
|
|
38
38
|
:animate="{ width: 'auto', x: 0, scale: 1, opacity: 1 }"
|
|
39
39
|
:exit="{ width: 0, x: -20, scale: 0, opacity: 0 }"
|
|
40
40
|
:transition="{ duration: 0.15, ease: 'easeOut' }"
|
|
41
41
|
>
|
|
42
|
-
<TelaBadge variant="filled" class="py-[
|
|
42
|
+
<TelaBadge variant="filled" class="py-[2px] px-[4px] rounded-[4px]">
|
|
43
43
|
<TelaAnimatedNumber :value="count || 0" />
|
|
44
44
|
</TelaBadge>
|
|
45
45
|
</Motion>
|
|
@@ -49,7 +49,7 @@ defineEmits<{
|
|
|
49
49
|
name="i-ph-caret-down-bold"
|
|
50
50
|
size="12px"
|
|
51
51
|
color="icon-secondary"
|
|
52
|
-
class="shrink-0 transition-
|
|
52
|
+
class="shrink-0 transition-transform ease-out duration-150 group-data-[active]:rotate-180"
|
|
53
53
|
/>
|
|
54
54
|
</button>
|
|
55
55
|
</template>
|
|
@@ -99,7 +99,7 @@ Each filter can declare its own `popoverWidth`. When the filter is active, the p
|
|
|
99
99
|
|
|
100
100
|
### Scrollable Options
|
|
101
101
|
|
|
102
|
-
For long option lists, set `optionsClass` to cap the height. The options render inside a `TelaScrollArea`, so the
|
|
102
|
+
For long option lists, set `optionsClass` to cap the height. The options render inside a `TelaScrollArea`, so the list scrolls when content overflows. Its scrollbar is transparent. No need to set `overflow-y-auto` yourself.
|
|
103
103
|
|
|
104
104
|
```vue
|
|
105
105
|
const filters = [
|
|
@@ -129,7 +129,7 @@ Use the scoped `option-{label}` slot to override the default option button. The
|
|
|
129
129
|
<template #option-users="{ option, checked, toggle }">
|
|
130
130
|
<button @click="toggle" class="flex justify-between items-center w-full px-8px h-32px rounded-8px hover:bg-muted">
|
|
131
131
|
<div class="flex items-center gap-6px min-w-0">
|
|
132
|
-
<
|
|
132
|
+
<TelaAvatar :alt="option.label" size="2xs" />
|
|
133
133
|
<span class="text-primary body-14-medium truncate">{{ option.label }}</span>
|
|
134
134
|
</div>
|
|
135
135
|
<TelaCheckbox :model-value="checked" @click.stop @update:model-value="toggle" />
|
|
@@ -201,6 +201,31 @@ Or use the footer for related toggles independent of the option list:
|
|
|
201
201
|
</template>
|
|
202
202
|
```
|
|
203
203
|
|
|
204
|
+
### Apply Button
|
|
205
|
+
|
|
206
|
+
By default every toggle updates `modelValue` at once. To apply a selection only when the user confirms it, bind `TelaFilter` to a draft, commit the draft from an Apply button in the footer, and reset the draft whenever the open filter changes, so a pick that wasn't applied is dropped.
|
|
207
|
+
|
|
208
|
+
```vue
|
|
209
|
+
<script setup>
|
|
210
|
+
const applied = ref({ status: [] })
|
|
211
|
+
const draft = ref({ ...applied.value })
|
|
212
|
+
|
|
213
|
+
// runs when the popover opens, switches to another filter, or closes:
|
|
214
|
+
// unapplied picks never carry over to another filter
|
|
215
|
+
function onOpenChange() {
|
|
216
|
+
draft.value = { ...applied.value }
|
|
217
|
+
}
|
|
218
|
+
</script>
|
|
219
|
+
|
|
220
|
+
<template>
|
|
221
|
+
<TelaFilter v-model="draft" :filters="filters" @open-change="onOpenChange">
|
|
222
|
+
<template #footer-status="{ close }">
|
|
223
|
+
<TelaButton size="sm" class="w-full mt-4px" @click="applied = { ...draft }; close()">Apply</TelaButton>
|
|
224
|
+
</template>
|
|
225
|
+
</TelaFilter>
|
|
226
|
+
</template>
|
|
227
|
+
```
|
|
228
|
+
|
|
204
229
|
### Custom Styling
|
|
205
230
|
|
|
206
231
|
```vue
|
|
@@ -260,9 +285,9 @@ The popover content is fully composable via three scoped slots per filter. The s
|
|
|
260
285
|
|
|
261
286
|
| Name | Scope | Description |
|
|
262
287
|
|------|-------|-------------|
|
|
263
|
-
| `header-{filter.key}` | `{ filter, selected, toggle }` | Rendered above the options list. Use for search inputs, descriptions, dividers. |
|
|
288
|
+
| `header-{filter.key}` | `{ filter, selected, toggle, close }` | Rendered above the options list. Use for search inputs, descriptions, dividers. |
|
|
264
289
|
| `option-{filter.key}` | `{ option, filter, checked, toggle, mode }` | Replaces the default option button. Falls back to the standard label + checkbox/radio when not provided. |
|
|
265
|
-
| `footer-{filter.key}` | `{ filter, selected, toggle }` | Rendered below the options list. Use for calendars, secondary toggles, action rows. |
|
|
290
|
+
| `footer-{filter.key}` | `{ filter, selected, toggle, close }` | Rendered below the options list. Use for calendars, secondary toggles, action rows. |
|
|
266
291
|
|
|
267
292
|
Scope props:
|
|
268
293
|
|
|
@@ -271,11 +296,13 @@ Scope props:
|
|
|
271
296
|
- `selected` — the current selections for this filter (string array).
|
|
272
297
|
- `checked` — boolean indicating whether `option` is selected (only on `option-*`).
|
|
273
298
|
- `toggle` — function. On `option-*` it toggles the current option (no args). On `header-*` / `footer-*` it takes a `value: string` arg and toggles that value.
|
|
299
|
+
- `close` — function (only on `header-*` / `footer-*`). Closes the popover, e.g. after an Apply button commits the selection.
|
|
274
300
|
- `mode` — the filter's `selectionMode` (only on `option-*`).
|
|
275
301
|
|
|
276
302
|
## Events
|
|
277
303
|
|
|
278
304
|
- `update:modelValue` — emitted whenever an option is toggled, with the full updated `FilterSelections` record.
|
|
305
|
+
- `openChange` — emitted with the key of the filter whose popover opens (or that the popover switches to), and with `null` when it closes.
|
|
279
306
|
|
|
280
307
|
## Behavior
|
|
281
308
|
|
|
@@ -21,6 +21,8 @@ const props = withDefaults(defineProps<{
|
|
|
21
21
|
|
|
22
22
|
const emit = defineEmits<{
|
|
23
23
|
'update:modelValue': [value: FilterSelections]
|
|
24
|
+
/** The key of the filter whose popover is open, or `null` once it closes. */
|
|
25
|
+
'openChange': [key: string | null]
|
|
24
26
|
}>()
|
|
25
27
|
|
|
26
28
|
const SPRING_CONFIG = {
|
|
@@ -100,6 +102,8 @@ function setTriggerRef(key: string, el: any) {
|
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
|
|
105
|
+
watch(() => (isOpen.value ? activeFilter.value : null), key => emit('openChange', key))
|
|
106
|
+
|
|
103
107
|
function closeFilter() {
|
|
104
108
|
phase.value = 'closing'
|
|
105
109
|
}
|
|
@@ -6,7 +6,7 @@ import { Meta, ArgTypes } from '@storybook/blocks';
|
|
|
6
6
|
|
|
7
7
|
A modal dialog that displays content in a centered overlay. Use it for confirmations, forms, and content that needs the user's full attention.
|
|
8
8
|
|
|
9
|
-
Pass `size` to get the modal layout: a header with title, description and close button, a body that scrolls on its own, and a right-aligned footer.
|
|
9
|
+
Pass `size` to get the modal layout: a header with title, description and close button, a body that scrolls on its own, and a right-aligned footer.
|
|
10
10
|
|
|
11
11
|
```vue
|
|
12
12
|
<script setup lang="ts">
|
|
@@ -107,7 +107,10 @@ const name = ref('')
|
|
|
107
107
|
title="Create project"
|
|
108
108
|
description="Projects group workflows, agents and their shared credentials."
|
|
109
109
|
>
|
|
110
|
-
<
|
|
110
|
+
<div flex="~ col" gap-8px>
|
|
111
|
+
<TelaLabel for="project-name">Name</TelaLabel>
|
|
112
|
+
<TelaInput id="project-name" v-model="name" placeholder="Acme onboarding" w-full />
|
|
113
|
+
</div>
|
|
111
114
|
|
|
112
115
|
<template #footer="{ close }">
|
|
113
116
|
<TelaButton variant="secondary" @click="close">
|
|
@@ -313,7 +316,7 @@ To migrate a modal, replace `modal-width` with `size`, drop `compact`, `hide-div
|
|
|
313
316
|
</div>
|
|
314
317
|
<TelaIconButton icon="i-ph-x" size="md" color="secondary" p-8px mt--12px mr--16px @click="isOpen = false" />
|
|
315
318
|
</div>
|
|
316
|
-
<TelaInput v-model="name"
|
|
319
|
+
<TelaInput v-model="name" placeholder="Name" w-full />
|
|
317
320
|
<div flex gap-8px justify-end>
|
|
318
321
|
<TelaButton variant="secondary" @click="isOpen = false">Cancel</TelaButton>
|
|
319
322
|
<TelaButton>Submit</TelaButton>
|
|
@@ -323,7 +326,7 @@ To migrate a modal, replace `modal-width` with `size`, drop `compact`, `hide-div
|
|
|
323
326
|
|
|
324
327
|
<!-- After -->
|
|
325
328
|
<TelaModal v-model="isOpen" size="sm" title="Dialog Title" description="Dialog description.">
|
|
326
|
-
<TelaInput v-model="name"
|
|
329
|
+
<TelaInput v-model="name" placeholder="Name" w-full />
|
|
327
330
|
<template #footer="{ close }">
|
|
328
331
|
<TelaButton variant="secondary" @click="close">Cancel</TelaButton>
|
|
329
332
|
<TelaButton>Submit</TelaButton>
|
|
@@ -342,7 +345,7 @@ To migrate a modal, replace `modal-width` with `size`, drop `compact`, `hide-div
|
|
|
342
345
|
|
|
343
346
|
```vue
|
|
344
347
|
<!-- Correct -->
|
|
345
|
-
<TelaInput v-model="val"
|
|
348
|
+
<TelaInput v-model="val" w-full />
|
|
346
349
|
<TelaTextarea v-model="val" w-full />
|
|
347
350
|
<TelaToggleGroup v-model="val" :options="opts" w-full />
|
|
348
351
|
<TelaSelectMenu v-model="val" :options="opts" trigger-class="w-full" />
|
|
@@ -166,9 +166,15 @@ const isOpen = ref(false)
|
|
|
166
166
|
</TelaPopoverTrigger>
|
|
167
167
|
<TelaPopoverContent>
|
|
168
168
|
<form @submit.prevent="onSubmit" class="p-4 w-300px">
|
|
169
|
-
<h3 class="
|
|
170
|
-
<
|
|
171
|
-
|
|
169
|
+
<h3 class="heading-h5-semibold text-primary mb-16px">Add New Item</h3>
|
|
170
|
+
<div class="flex flex-col gap-8px mb-16px">
|
|
171
|
+
<TelaLabel for="item-name">Name</TelaLabel>
|
|
172
|
+
<TelaInput id="item-name" v-model="name" />
|
|
173
|
+
</div>
|
|
174
|
+
<div class="flex flex-col gap-8px mb-16px">
|
|
175
|
+
<TelaLabel for="item-description">Description</TelaLabel>
|
|
176
|
+
<TelaTextarea id="item-description" v-model="description" />
|
|
177
|
+
</div>
|
|
172
178
|
<div class="flex gap-2 justify-end">
|
|
173
179
|
<TelaButton variant="secondary" @click="isOpen = false">
|
|
174
180
|
Cancel
|
|
@@ -73,8 +73,10 @@ const isOpen = ref(false)
|
|
|
73
73
|
<TelaSideSheet v-model="isOpen" title="Form">
|
|
74
74
|
<div class="p-4">
|
|
75
75
|
<form>
|
|
76
|
-
<
|
|
77
|
-
<
|
|
76
|
+
<TelaLabel for="form-name">Name</TelaLabel>
|
|
77
|
+
<TelaInput id="form-name" v-model="name" />
|
|
78
|
+
<TelaLabel for="form-message">Message</TelaLabel>
|
|
79
|
+
<TelaTextarea id="form-message" v-model="message" />
|
|
78
80
|
<TelaButton type="submit">Submit</TelaButton>
|
|
79
81
|
</form>
|
|
80
82
|
</div>
|
|
@@ -20,9 +20,7 @@ defineProps<{
|
|
|
20
20
|
)"
|
|
21
21
|
>
|
|
22
22
|
<div :class="cn('size-40px origin-top-left transition-transform group-data-[variant=minimized]/sidebar:scale-60', sidebarTransition)">
|
|
23
|
-
<
|
|
24
|
-
<TelaInitials v-else-if="alt" size="md" :word="alt" />
|
|
25
|
-
<div v-else class="size-40px bg-black" />
|
|
23
|
+
<TelaAvatar size="md" :image="src ?? undefined" :alt="alt" />
|
|
26
24
|
</div>
|
|
27
25
|
</component>
|
|
28
26
|
</template>
|