@meistrari/tela-build 1.93.3 → 1.95.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 +29 -0
- package/components/tela/chat/chat-shell-context.ts +8 -0
- package/components/tela/chat/chat-widget-header.vue +14 -5
- package/components/tela/chat/chat.mdx +3 -1
- package/components/tela/chat/sidepanel/sidepanel-window.vue +46 -2
- package/components/tela/code-block/code-block.vue +1 -5
- package/components/tela/combobox/combobox-module-selector.vue +5 -7
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +6 -1
- package/components/tela/dropdown-menu/DropdownMenuItem.vue +18 -58
- package/components/tela/dropdown-menu/DropdownMenuLabel.vue +1 -1
- package/components/tela/dropdown-menu/DropdownMenuSeparator.vue +1 -1
- package/components/tela/dropdown-menu/dropdown-menu-variants.ts +24 -0
- package/components/tela/filter/filter-trigger.vue +2 -2
- package/components/tela/icon/custom.vue +6 -0
- package/components/tela/menubar/menubar-content.vue +4 -2
- package/components/tela/menubar/menubar-item.vue +2 -1
- package/components/tela/menubar/menubar-separator.vue +1 -1
- package/components/tela/menubar/menubar-sub-content.vue +3 -2
- package/components/tela/menubar/menubar-variants.ts +32 -0
- package/components/tela/menubar/menubar.vue +2 -0
- package/components/tela/preview/preview-floating-bar.vue +6 -6
- package/components/tela/rfc/rfc.mdx +2 -2
- package/components/tela/rfc/rfc.vue +7 -1
- package/components/tela/select-menu/select-menu-content.vue +10 -22
- package/components/tela/select-menu/select-menu-item.vue +2 -1
- package/components/tela/select-menu/select-menu-variants.ts +9 -0
- package/components/tela/select-menu/select-menu.vue +12 -1
- package/components/tela/sidebar/sidebar-user.vue +3 -3
- package/components/tela/status/status.vue +2 -1
- package/components/tela/table-of-contents/table-of-contents.mdx +3 -2
- package/components/tela/table-of-contents/table-of-contents.vue +9 -1
- package/docs/interfaces.md +1 -1
- package/package.json +1 -1
- package/types/custom-icon.ts +1 -1
- package/utils/select-menu.ts +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## October 26, 2026
|
|
6
|
+
|
|
7
|
+
- [Sidebar](/patterns/sidebar#telasidebaruser) `TelaSidebarUser` menu opens at a 242px minimum width (was 200px), with the name in 14px semibold and the email in `text-tertiary`.
|
|
8
|
+
- The [Combobox](/components/combobox) module selector shows module names in `heading-h6-semibold`, descriptions in 12px `text-secondary` with balanced wrapping, and the "coming soon" tag as a [Badge](/components/badge).
|
|
9
|
+
- [Filter](/components/filter) trigger labels use the `button-14-semibold` type style, and keyboard focus shows a `border`-colored ring instead of `gray-200`.
|
|
10
|
+
- [Preview](/patterns/preview) floating bar buttons show the default single-line tooltip instead of the multiline one.
|
|
11
|
+
- [Code Block](/components/code-block) line numbers use `text-tertiary` instead of `neutral-400`.
|
|
12
|
+
- Menubar menus match [Dropdown Menu](/components/dropdown-menu): 6px padding, a 0.5px `border` on top-level menus, and separators that span the menu's full width with 6px spacing in `bg-border`.
|
|
13
|
+
|
|
14
|
+
## October 23, 2026
|
|
15
|
+
|
|
16
|
+
- [Status](/components/status) accepts a `backgroundClass` prop that replaces the variant's background, for statuses shown on surfaces where the default background blends in.
|
|
17
|
+
- `TelaIconCustom` has a new `divider` icon: a thin diagonal stroke for breadcrumb separators, drawn in `currentColor`.
|
|
18
|
+
- [Chat → Sidepanel](/templates/chat#sidepanel) can be swapped with the floating window: provide `{ toggleExpanded, close }` under `chatShellControlsKey` (from `components/tela/chat/chat-shell-context`) above the shell. The widget header's expand toggle then calls `toggleExpanded` instead of growing the floating window. Inside the sidepanel the header shows it as collapse, adds a minimize button that calls `close`, and Escape pressed inside the panel calls `close` once no menu or overlay is open.
|
|
19
|
+
- [Chat → Sidepanel](/templates/chat#sidepanel) can be resized by dragging its left edge, from its 440px default up to 45% of the viewport. The width resets to 440px when the panel unmounts.
|
|
20
|
+
|
|
5
21
|
## October 22, 2026
|
|
6
22
|
|
|
7
23
|
- `TelaAnimatedValue` now animates the incoming value: vertical slides in from 10px above with a fade over 100ms, horizontal from `enterOffset` (default 20px) over 200ms. The enter styles used the Vue 2 `.slide-fade-enter` class, which Vue 3 never applies, so the new value used to appear instantly after the old one left. This also reaches the letter change in the [Avatar](/components/avatar#with-initials-fallback) initials fallback (`TelaInitials`) and `TelaAnimatedCalculatingNumber`.
|
|
@@ -17,6 +33,14 @@ Latest updates and announcements.
|
|
|
17
33
|
- [Toggle Group](/components/toggle-group) options accept `disabled`, and the `option` slot also receives `active`.
|
|
18
34
|
- [Toggle Group](/components/toggle-group) is built on Reka UI instead of Radix Vue, so arrow keys move focus between options.
|
|
19
35
|
- [Toggle Group](/components/toggle-group) has a showcase page.
|
|
36
|
+
- [RFC](/templates/rfc) centers the document column in the space left of the table of contents, instead of across the whole viewport, with equal gaps on both sides that grow with the window. On wide screens the column sat far from the left edge and almost touched the table of contents; the column keeps its 760px width.
|
|
37
|
+
- [RFC](/templates/rfc) shows the table of contents from 1336px instead of 1511px, the narrowest width that keeps at least 88px on each side of the column.
|
|
38
|
+
- [RFC](/templates/rfc) leaves 48px above each H2 instead of 32px, so sections like Resumo, Contexto and Proposta read as separate blocks. An H2 that opens the document gets no top margin.
|
|
39
|
+
- [Table of Contents](/components/table-of-contents) accepts `hideBelow` (`1336` or `1511`, default `1511`) to choose the width below which it hides.
|
|
40
|
+
|
|
41
|
+
## October 19, 2026
|
|
42
|
+
|
|
43
|
+
- [Select Menu](/components/select-menu) options list opens at the same width as its trigger. It used to be 13px wider, because the trigger width was applied inside the list's padding and border.
|
|
20
44
|
|
|
21
45
|
## October 16, 2026
|
|
22
46
|
|
|
@@ -53,6 +77,11 @@ Latest updates and announcements.
|
|
|
53
77
|
- [Modal](/components/modal#below-the-floating-chat) keeps the floating chat open when Escape dismisses a higher-priority layer.
|
|
54
78
|
- [Avatar](/components/avatar) corner radius now scales with `size` to match Figma instead of a flat 6px: `2xs` 6px, `xs` 8px, `sm` 10px, `md` (and the default) 12px, `lg` 20px, `xl` 22px. The radius is still a class, so a `class` like `rounded-full` overrides it. The switch-workspace modal drops its `!rounded-[10px]` avatar override, and its selection ring follows the 12px radius with a transparent 2px gap, so the hovered row background shows through instead of a white band.
|
|
55
79
|
|
|
80
|
+
## October 13, 2026
|
|
81
|
+
|
|
82
|
+
- [Dropdown Menu](/components/dropdown-menu) items with a `tooltip` now support `iconSide="right"` and `trailingIcon`, and `caution`/`negative` items get their colored focus background, the same as items without a tooltip.
|
|
83
|
+
- [Dropdown Menu](/components/dropdown-menu) and [Select Menu](/components/select-menu) share one menu style: 16px rounded surface with a 0.5px border and soft shadow, 6px padding, and 10px rounded items with 10px × 7px padding. Disabled Select Menu items are 40% opacity (was 50%), and Select Menu's 6px padding sits on the menu instead of its scroll area, matching Dropdown Menu.
|
|
84
|
+
|
|
56
85
|
## October 9, 2026
|
|
57
86
|
|
|
58
87
|
- New [Chat Task Review](/templates/chat#task-review) (`TelaChatTaskReview`): a controlled card for reviewing an extracted output field by field, with the [Answer](/templates/chat#answer) card's header, lettered options and footer, plus a value preview, a correction input, summary counts and editable item rows (with optional placeholders). It emits `draft` with the text being typed so hosts can preview it.
|
|
@@ -4,3 +4,11 @@ export type ChatShell = 'floating' | 'sidepanel'
|
|
|
4
4
|
|
|
5
5
|
/** Provided by `TelaChatFloatingWindow` and `TelaChatSidepanelWindow` so nested primitives can adapt to the shell. */
|
|
6
6
|
export const chatShellContextKey: InjectionKey<ChatShell> = Symbol('tela-chat-shell')
|
|
7
|
+
|
|
8
|
+
export type ChatShellControls = {
|
|
9
|
+
toggleExpanded: () => void
|
|
10
|
+
close: () => void
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Provide above a widget shell to let the widget header switch between the floating and sidepanel shells, and close the sidepanel. */
|
|
14
|
+
export const chatShellControlsKey: InjectionKey<ChatShellControls> = Symbol('tela-chat-shell-controls')
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { chatShellContextKey, chatShellControlsKey } from './chat-shell-context'
|
|
2
3
|
import { floatingWindowContextKey } from './floating/floating-window-context'
|
|
3
4
|
|
|
4
5
|
const props = withDefaults(defineProps<{
|
|
@@ -30,22 +31,30 @@ const emit = defineEmits<{
|
|
|
30
31
|
}>()
|
|
31
32
|
|
|
32
33
|
const floatingWindow = inject(floatingWindowContextKey, null)
|
|
34
|
+
const shell = inject(chatShellContextKey, null)
|
|
35
|
+
const shellControls = shell ? inject(chatShellControlsKey, null) : null
|
|
33
36
|
|
|
34
|
-
const showExpand = computed(() => Boolean(floatingWindow) || props.expandable)
|
|
35
|
-
const showClose = computed(() => Boolean(floatingWindow) || props.closable)
|
|
36
|
-
const isExpanded = computed(() => floatingWindow ? floatingWindow.expanded.value : props.expanded)
|
|
37
|
+
const showExpand = computed(() => Boolean(floatingWindow || shellControls) || props.expandable)
|
|
38
|
+
const showClose = computed(() => Boolean(floatingWindow || shellControls) || props.closable)
|
|
39
|
+
const isExpanded = computed(() => (Boolean(shellControls) && shell === 'sidepanel') || (floatingWindow ? floatingWindow.expanded.value : props.expanded))
|
|
37
40
|
|
|
38
41
|
const historyOpen = ref(false)
|
|
39
42
|
const historySelection = ref('')
|
|
40
43
|
|
|
41
44
|
function close() {
|
|
42
45
|
emit('close')
|
|
43
|
-
floatingWindow
|
|
46
|
+
if (floatingWindow)
|
|
47
|
+
floatingWindow.close()
|
|
48
|
+
else
|
|
49
|
+
shellControls?.close()
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
function toggleExpanded() {
|
|
47
53
|
emit('toggleExpanded')
|
|
48
|
-
|
|
54
|
+
if (shellControls)
|
|
55
|
+
shellControls.toggleExpanded()
|
|
56
|
+
else
|
|
57
|
+
floatingWindow?.toggleExpanded()
|
|
49
58
|
}
|
|
50
59
|
|
|
51
60
|
function selectConversation(id: unknown) {
|
|
@@ -256,7 +256,9 @@ const conversations = [
|
|
|
256
256
|
|
|
257
257
|
An always-open, docked chat column. It has no launcher and no `open` state: render it when the panel should exist.
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
To let users move between the floating window and the sidepanel, provide `{ toggleExpanded, close }` under `chatShellControlsKey` (exported from `chat-shell-context`) above the shell and swap the shell when they are called. The widget header shows its expand toggle in both shells and calls `toggleExpanded` instead of growing the floating window. Inside the sidepanel it also shows a minimize button that calls `close`, and Escape pressed inside the panel calls `close` once no menu or overlay is open.
|
|
260
|
+
|
|
261
|
+
`TelaChatSidepanelWindow` is **in-flow** (`position: sticky`, full viewport height, 440px wide by default), so the page layout reserves its width instead of being overlapped. 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**:
|
|
260
262
|
|
|
261
263
|
```vue
|
|
262
264
|
<script setup lang="ts">
|
|
@@ -1,11 +1,55 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { chatShellContextKey } from '../chat-shell-context'
|
|
2
|
+
import { chatShellContextKey, chatShellControlsKey } from '../chat-shell-context'
|
|
3
|
+
import { hasOpenEscapeLayer } from '../floating/escape-layer'
|
|
3
4
|
|
|
4
5
|
provide(chatShellContextKey, 'sidepanel')
|
|
6
|
+
|
|
7
|
+
const shellControls = inject(chatShellControlsKey, null)
|
|
8
|
+
|
|
9
|
+
function closeOnEscape() {
|
|
10
|
+
if (shellControls && !hasOpenEscapeLayer() && !document.querySelector('[data-dismissable-layer]'))
|
|
11
|
+
shellControls.close()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const minWidth = 440
|
|
15
|
+
const maxViewportShare = 0.45
|
|
16
|
+
|
|
17
|
+
const panel = ref<HTMLElement | null>(null)
|
|
18
|
+
|
|
19
|
+
// Writes the width straight to the element: re-rendering this shell re-renders the whole chat inside it.
|
|
20
|
+
function startResize(event: PointerEvent) {
|
|
21
|
+
const aside = panel.value
|
|
22
|
+
if (!aside || event.button !== 0)
|
|
23
|
+
return
|
|
24
|
+
|
|
25
|
+
const startX = event.clientX
|
|
26
|
+
const startWidth = aside.getBoundingClientRect().width
|
|
27
|
+
const maxWidth = Math.max(minWidth, window.innerWidth * maxViewportShare)
|
|
28
|
+
const drag = new AbortController()
|
|
29
|
+
|
|
30
|
+
aside.setPointerCapture(event.pointerId)
|
|
31
|
+
aside.addEventListener('pointermove', (moveEvent) => {
|
|
32
|
+
const width = Math.min(maxWidth, Math.max(minWidth, startWidth + startX - moveEvent.clientX))
|
|
33
|
+
aside.style.width = `clamp(min(${minWidth}px, 100vw), ${width}px, ${maxViewportShare * 100}vw)`
|
|
34
|
+
}, { signal: drag.signal })
|
|
35
|
+
aside.addEventListener('lostpointercapture', () => drag.abort(), { signal: drag.signal })
|
|
36
|
+
}
|
|
5
37
|
</script>
|
|
6
38
|
|
|
7
39
|
<template>
|
|
8
|
-
<aside
|
|
40
|
+
<aside
|
|
41
|
+
ref="panel"
|
|
42
|
+
sticky top-0 flex flex-col h-100dvh overflow-hidden shrink-0 border-l-0.5px border bg-muted p-8px
|
|
43
|
+
class="w-[min(440px,100vw)]"
|
|
44
|
+
@keydown.esc="closeOnEscape"
|
|
45
|
+
>
|
|
46
|
+
<div
|
|
47
|
+
absolute inset-y-0 left-0 z-1 w-8px cursor-col-resize touch-none
|
|
48
|
+
class="group"
|
|
49
|
+
@pointerdown.prevent="startResize"
|
|
50
|
+
>
|
|
51
|
+
<div h-full w-2px transition-colors class="group-hover:bg-black/12 group-active:bg-black/12" />
|
|
52
|
+
</div>
|
|
9
53
|
<div data-widget-frame class="flex-1 min-h-0 flex flex-col border-0.5px rounded-12px overflow-hidden bg">
|
|
10
54
|
<slot />
|
|
11
55
|
</div>
|
|
@@ -84,7 +84,7 @@ watchEffect((onCleanup) => {
|
|
|
84
84
|
>
|
|
85
85
|
<span
|
|
86
86
|
v-if="!props.hideLineNumbers"
|
|
87
|
-
class="w-2.75rem shrink-0 pr-1rem text-right font-mono text-
|
|
87
|
+
class="w-2.75rem shrink-0 pr-1rem text-right font-mono text-tertiary text-13px"
|
|
88
88
|
>{{ i }}</span>
|
|
89
89
|
<TelaSkeleton
|
|
90
90
|
class="h-14px rounded-2px bg-neutral-200"
|
|
@@ -129,10 +129,6 @@ pre.shiki {
|
|
|
129
129
|
width: fit-content;
|
|
130
130
|
min-width: 100%;
|
|
131
131
|
counter-reset: line;
|
|
132
|
-
/* collapse the \n text nodes shiki emits between .line spans — each
|
|
133
|
-
block .line below already breaks the line, and Nuxt Content's
|
|
134
|
-
ProsePre leaks a global `pre code .line { display: block }` that
|
|
135
|
-
would otherwise double every line break */
|
|
136
132
|
white-space: normal;
|
|
137
133
|
}
|
|
138
134
|
|
|
@@ -363,14 +363,12 @@ watch(innerValue, (value) => {
|
|
|
363
363
|
</div>
|
|
364
364
|
<div class="flex flex-col w-full">
|
|
365
365
|
<div class="flex flex-col">
|
|
366
|
-
<div v-if="!item.enabled?.()" class="flex items-center gap-
|
|
367
|
-
<span class="
|
|
368
|
-
<
|
|
369
|
-
class="font-semibold uppercase text-9px tracking-wider text-gray-700 bg-gray-100 rounded leading-none py-2px px-1"
|
|
370
|
-
>{{ labelComingSoon }}</span>
|
|
366
|
+
<div v-if="!item.enabled?.()" class="flex items-center gap-6px">
|
|
367
|
+
<span class="heading-h6-semibold text-primary truncate w-full">{{ item.label }}</span>
|
|
368
|
+
<TelaBadge>{{ labelComingSoon }}</TelaBadge>
|
|
371
369
|
</div>
|
|
372
|
-
<span v-else class="
|
|
373
|
-
<span v-if="item.description" class="
|
|
370
|
+
<span v-else class="heading-h6-semibold text-primary truncate w-full">{{ item.label }}</span>
|
|
371
|
+
<span v-if="item.description" class="body-12-regular text-secondary text-balance">
|
|
374
372
|
{{ item.description }}
|
|
375
373
|
</span>
|
|
376
374
|
</div>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
import type { DropdownMenuContentEmits, DropdownMenuContentProps } from 'radix-vue'
|
|
8
8
|
import { computed } from 'vue'
|
|
9
9
|
import type { HTMLAttributes } from 'vue'
|
|
10
|
+
import { menuContentVariants } from './dropdown-menu-variants'
|
|
10
11
|
|
|
11
12
|
const props = withDefaults(
|
|
12
13
|
defineProps<DropdownMenuContentProps & { class?: HTMLAttributes['class'], escapeLayer?: boolean }>(),
|
|
@@ -30,7 +31,11 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
30
31
|
<DropdownMenuContent
|
|
31
32
|
:data-tela-escape-layer="escapeLayer ? '' : undefined"
|
|
32
33
|
v-bind="forwarded"
|
|
33
|
-
:class="cn(
|
|
34
|
+
:class="cn(
|
|
35
|
+
'DropdownMenuContent popover-enter-exit origin-[var(--radix-dropdown-menu-content-transform-origin)] z-50 min-w-60 overflow-hidden',
|
|
36
|
+
menuContentVariants(),
|
|
37
|
+
props.class,
|
|
38
|
+
)"
|
|
34
39
|
>
|
|
35
40
|
<slot />
|
|
36
41
|
</DropdownMenuContent>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue'
|
|
2
|
+
import type { FunctionalComponent, HTMLAttributes } from 'vue'
|
|
3
3
|
import { DropdownMenuItem } from 'radix-vue'
|
|
4
4
|
import type { DropdownMenuItemProps } from 'radix-vue'
|
|
5
5
|
import Tooltip from '../tooltip/tooltip.vue'
|
|
6
6
|
import type { TooltipProps } from '../tooltip/tooltip.vue'
|
|
7
|
+
import { menuItemVariants } from './dropdown-menu-variants'
|
|
7
8
|
|
|
8
9
|
// The tooltip branch's root is the tooltip, so listeners must be forwarded to the item itself
|
|
9
10
|
defineOptions({ inheritAttrs: false })
|
|
@@ -28,16 +29,6 @@ const props = defineProps<DropdownMenuItemProps & {
|
|
|
28
29
|
tooltip?: string | TooltipProps
|
|
29
30
|
}>()
|
|
30
31
|
|
|
31
|
-
function getItemClasses(color?: typeof props.color) {
|
|
32
|
-
const itemClasses: Record<string, string> = {
|
|
33
|
-
default: 'focus:bg-muted text-primary',
|
|
34
|
-
caution: 'focus:bg-amber-50 text-amber-500',
|
|
35
|
-
negative: 'focus:bg-red-100 text-red-500',
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return itemClasses[color ?? 'default']
|
|
39
|
-
}
|
|
40
|
-
|
|
41
32
|
function getIconClasses(color?: typeof props.color) {
|
|
42
33
|
const iconClasses: Record<string, string> = {
|
|
43
34
|
default: 'text-icon-secondary',
|
|
@@ -80,7 +71,12 @@ const tooltipConfig = computed(() => {
|
|
|
80
71
|
return null
|
|
81
72
|
})
|
|
82
73
|
|
|
83
|
-
const
|
|
74
|
+
const tooltipBindings = computed(() => tooltipConfig.value
|
|
75
|
+
? { ...tooltipConfig.value, delayDuration: tooltipConfig.value.delayDuration ?? 100, triggerClass: 'w-full' }
|
|
76
|
+
: {},
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
const Passthrough: FunctionalComponent = (_, { slots }) => slots.default?.()
|
|
84
80
|
|
|
85
81
|
const isIconImage = computed(() => {
|
|
86
82
|
if (!props.icon)
|
|
@@ -90,61 +86,25 @@ const isIconImage = computed(() => {
|
|
|
90
86
|
</script>
|
|
91
87
|
|
|
92
88
|
<template>
|
|
93
|
-
<Tooltip
|
|
94
|
-
v-if="shouldShowTooltip"
|
|
95
|
-
:content="tooltipConfig?.content"
|
|
96
|
-
:side="tooltipConfig?.side"
|
|
97
|
-
:align="tooltipConfig?.align"
|
|
98
|
-
:variant="tooltipConfig?.variant"
|
|
99
|
-
:align-offset="tooltipConfig?.alignOffset"
|
|
100
|
-
:arrow-offset="tooltipConfig?.arrowOffset"
|
|
101
|
-
:title="tooltipConfig?.title"
|
|
102
|
-
:description="tooltipConfig?.description"
|
|
103
|
-
:delay-duration="tooltipConfig?.delayDuration ?? 100"
|
|
104
|
-
:open="tooltipConfig?.open"
|
|
105
|
-
trigger-class="w-full"
|
|
106
|
-
>
|
|
89
|
+
<component :is="tooltipConfig ? Tooltip : Passthrough" v-bind="tooltipBindings">
|
|
107
90
|
<DropdownMenuItem
|
|
108
91
|
v-bind="{ ...props, ...$attrs }"
|
|
109
92
|
:class="cn(
|
|
110
|
-
'group
|
|
111
|
-
|
|
112
|
-
'text-body-14-medium font-460 outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
113
|
-
inset && 'pl-8',
|
|
93
|
+
'group',
|
|
94
|
+
menuItemVariants({ color: props.color, inset: props.inset }),
|
|
114
95
|
props.class,
|
|
115
96
|
)"
|
|
116
97
|
>
|
|
117
|
-
<img v-if="icon && isIconImage" :src="icon" :class="cn('size-16px', getIconClasses(props.color))">
|
|
118
|
-
<TelaIcon v-else-if="icon" :name="icon" :class="getIconClasses(props.color)" />
|
|
98
|
+
<img v-if="icon && (!iconSide || iconSide === 'left') && isIconImage" :src="icon" :class="cn('size-16px', getIconClasses(props.color))">
|
|
99
|
+
<TelaIcon v-else-if="icon && (!iconSide || iconSide === 'left')" :name="icon" :class="getIconClasses(props.color)" />
|
|
119
100
|
<TelaIcon v-else-if="iconWithBackground" :name="iconWithBackground.name" :size="iconWithBackground.size" :background-class="iconWithBackground.backgroundClass" :class="getIconClasses(props.color)" />
|
|
120
101
|
<TelaCheckbox v-else-if="checkbox" :model-value="checkbox?.modelValue" @update:model-value="(value) => checkbox?.onChange(value === true)" />
|
|
121
|
-
<span
|
|
102
|
+
<span :class="labelClass">
|
|
122
103
|
<slot />
|
|
123
104
|
</span>
|
|
105
|
+
<img v-if="icon && iconSide === 'right' && isIconImage" :src="icon" :class="cn('size-16px')">
|
|
106
|
+
<TelaIcon v-else-if="icon && iconSide === 'right'" :name="icon" />
|
|
107
|
+
<TelaIcon v-else-if="trailingIcon" :name="trailingIcon" color="gray-400" size="14px" class="ml-auto" />
|
|
124
108
|
</DropdownMenuItem>
|
|
125
|
-
</
|
|
126
|
-
|
|
127
|
-
<DropdownMenuItem
|
|
128
|
-
v-else
|
|
129
|
-
v-bind="{ ...props, ...$attrs }"
|
|
130
|
-
:class="cn(
|
|
131
|
-
'group outline-none',
|
|
132
|
-
'relative flex gap-10px cursor-pointer select-none items-center rounded-xl px-3 py-1.5',
|
|
133
|
-
'outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
134
|
-
getItemClasses(props.color),
|
|
135
|
-
inset && 'pl-8',
|
|
136
|
-
props.class,
|
|
137
|
-
)"
|
|
138
|
-
>
|
|
139
|
-
<img v-if="icon && (!iconSide || iconSide === 'left') && isIconImage" :src="icon" :class="cn('size-16px', getIconClasses(props.color))">
|
|
140
|
-
<TelaIcon v-else-if="icon && (!iconSide || iconSide === 'left')" :name="icon" :class="getIconClasses(props.color)" />
|
|
141
|
-
<TelaIcon v-else-if="iconWithBackground" :name="iconWithBackground.name" :size="iconWithBackground.size" :background-class="iconWithBackground.backgroundClass" :class="getIconClasses(props.color)" />
|
|
142
|
-
<TelaCheckbox v-else-if="checkbox" :model-value="checkbox?.modelValue" @update:model-value="(value) => checkbox?.onChange(value === true)" />
|
|
143
|
-
<span text-body-14-medium font-460 :class="cn(getItemClasses(props.color), labelClass)">
|
|
144
|
-
<slot />
|
|
145
|
-
</span>
|
|
146
|
-
<img v-if="icon && iconSide === 'right' && isIconImage" :src="icon" :class="cn('size-16px')">
|
|
147
|
-
<TelaIcon v-else-if="icon && iconSide === 'right'" :name="icon" />
|
|
148
|
-
<TelaIcon v-else-if="trailingIcon" :name="trailingIcon" color="gray-400" size="14px" ml-auto />
|
|
149
|
-
</DropdownMenuItem>
|
|
109
|
+
</component>
|
|
150
110
|
</template>
|
|
@@ -4,7 +4,7 @@ import type { DropdownMenuLabelProps } from 'radix-vue'
|
|
|
4
4
|
import { computed } from 'vue'
|
|
5
5
|
import type { HTMLAttributes } from 'vue'
|
|
6
6
|
|
|
7
|
-
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class']
|
|
7
|
+
const props = defineProps<DropdownMenuLabelProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
|
|
8
8
|
|
|
9
9
|
const delegatedProps = computed(() => {
|
|
10
10
|
const { class: _, ...delegated } = props
|
|
@@ -16,5 +16,5 @@ const delegatedProps = computed(() => {
|
|
|
16
16
|
</script>
|
|
17
17
|
|
|
18
18
|
<template>
|
|
19
|
-
<DropdownMenuSeparator v-bind="delegatedProps" :class="cn('-mx-
|
|
19
|
+
<DropdownMenuSeparator v-bind="delegatedProps" :class="cn('-mx-6px my-6px h-px bg-muted', props.class)" />
|
|
20
20
|
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export const menuContentVariants = cva(
|
|
4
|
+
'rounded-16px border-0.5px border bg p-6px [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]',
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
export const menuItemVariants = cva(
|
|
8
|
+
'relative flex cursor-pointer select-none items-center gap-8px rounded-10px px-10px py-7px body-14-medium outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
9
|
+
{
|
|
10
|
+
variants: {
|
|
11
|
+
color: {
|
|
12
|
+
default: 'focus:bg-muted text-primary',
|
|
13
|
+
caution: 'focus:bg-amber-50 text-amber-500',
|
|
14
|
+
negative: 'focus:bg-red-100 text-red-500',
|
|
15
|
+
},
|
|
16
|
+
inset: {
|
|
17
|
+
true: 'pl-8',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
defaultVariants: {
|
|
21
|
+
color: 'default',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
)
|
|
@@ -21,14 +21,14 @@ defineEmits<{
|
|
|
21
21
|
:class="cn(
|
|
22
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-all duration-150',
|
|
23
23
|
'text-[14px] leading-[18px] -tracking-[0.15px] font-540 text-primary',
|
|
24
|
-
'focus-visible:ring-2 focus-visible:ring-
|
|
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,
|
|
26
26
|
)"
|
|
27
27
|
:aria-label="filter.showCount && count ? `${filter.label}, ${count} selected` : undefined"
|
|
28
28
|
@click="$emit('click')"
|
|
29
29
|
>
|
|
30
30
|
<div inline-flex items-center>
|
|
31
|
-
<span
|
|
31
|
+
<span button-14-semibold text-primary>{{ filter.label }}</span>
|
|
32
32
|
|
|
33
33
|
<AnimatePresence>
|
|
34
34
|
<Motion
|
|
@@ -380,6 +380,12 @@ const colorValue = computed(() => {
|
|
|
380
380
|
</g>
|
|
381
381
|
</template>
|
|
382
382
|
|
|
383
|
+
<template v-if="name === 'divider'">
|
|
384
|
+
<g transform="translate(3.5, 2)">
|
|
385
|
+
<path d="M0.21206 6.91684L4.45141 0.132452" stroke="currentColor" stroke-width="0.5" />
|
|
386
|
+
</g>
|
|
387
|
+
</template>
|
|
388
|
+
|
|
383
389
|
<template v-if="name === 'quarter-slice'">
|
|
384
390
|
<path d="M12 6C12 9.31371 9.31371 12 6 12C2.68629 12 0 9.31371 0 6C0 2.68629 2.68629 0 6 0C9.31371 0 12 2.68629 12 6ZM1.2 6C1.2 8.65097 3.34903 10.8 6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 3.34903 8.65097 1.2 6 1.2C3.34903 1.2 1.2 3.34903 1.2 6Z" fill="currentColor" />
|
|
385
391
|
<path d="M2.5 6C2.5 6.69223 2.70527 7.36892 3.08986 7.9445C3.47444 8.52007 4.02107 8.96867 4.66061 9.23358C5.30015 9.49848 6.00388 9.5678 6.68282 9.43275C7.36175 9.2977 7.98539 8.96436 8.47487 8.47487C8.96436 7.98539 9.2977 7.36175 9.43275 6.68282C9.5678 6.00388 9.49849 5.30015 9.23358 4.66061C8.96867 4.02107 8.52007 3.47444 7.9445 3.08986C7.36892 2.70527 6.69224 2.5 6 2.5L6 6L2.5 6Z" fill="currentColor" />
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
MenubarPortal,
|
|
8
8
|
useForwardProps,
|
|
9
9
|
} from 'reka-ui'
|
|
10
|
+
import { menubarContentPaddingVariants, menubarContentVariants } from './menubar-variants'
|
|
10
11
|
|
|
11
12
|
const props = withDefaults(
|
|
12
13
|
defineProps<MenubarContentProps & { class?: HTMLAttributes['class'], disablePortal?: boolean }>(),
|
|
@@ -29,8 +30,9 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
29
30
|
v-bind="forwardedProps"
|
|
30
31
|
:class="
|
|
31
32
|
cn(
|
|
32
|
-
'MenubarContent popover-enter-exit origin-[var(--reka-menubar-content-transform-origin)]
|
|
33
|
-
|
|
33
|
+
'MenubarContent popover-enter-exit origin-[var(--reka-menubar-content-transform-origin)]',
|
|
34
|
+
menubarContentVariants(),
|
|
35
|
+
menubarContentPaddingVariants(),
|
|
34
36
|
props.class,
|
|
35
37
|
)
|
|
36
38
|
"
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
MenubarItem,
|
|
7
7
|
useForwardPropsEmits,
|
|
8
8
|
} from 'reka-ui'
|
|
9
|
+
import { menubarItemVariants } from './menubar-variants'
|
|
9
10
|
|
|
10
11
|
const props = defineProps<MenubarItemProps & { class?: HTMLAttributes['class'], inset?: boolean }>()
|
|
11
12
|
|
|
@@ -20,7 +21,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
20
21
|
<MenubarItem
|
|
21
22
|
v-bind="forwarded"
|
|
22
23
|
:class="cn(
|
|
23
|
-
|
|
24
|
+
menubarItemVariants(),
|
|
24
25
|
inset && 'pl-8',
|
|
25
26
|
props.class,
|
|
26
27
|
)"
|
|
@@ -12,5 +12,5 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
12
12
|
</script>
|
|
13
13
|
|
|
14
14
|
<template>
|
|
15
|
-
<MenubarSeparator :class=" cn('-mx-
|
|
15
|
+
<MenubarSeparator :class=" cn('-mx-6px my-6px h-[0.5px] bg-border', props.class)" v-bind="forwardedProps" />
|
|
16
16
|
</template>
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
MenubarSubContent,
|
|
8
8
|
useForwardPropsEmits,
|
|
9
9
|
} from 'reka-ui'
|
|
10
|
+
import { menubarContentPaddingVariants, menubarContentVariants } from './menubar-variants'
|
|
10
11
|
|
|
11
12
|
const props = defineProps<MenubarSubContentProps & { class?: HTMLAttributes['class'] }>()
|
|
12
13
|
|
|
@@ -23,8 +24,8 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
23
24
|
v-bind="forwarded"
|
|
24
25
|
:class="
|
|
25
26
|
cn(
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
menubarContentVariants({ sub: true }),
|
|
28
|
+
menubarContentPaddingVariants({ sub: true }),
|
|
28
29
|
props.class,
|
|
29
30
|
)
|
|
30
31
|
"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export const menubarContentVariants = cva(
|
|
4
|
+
'z-50 min-w-60 overflow-hidden rounded-2xl bg [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]',
|
|
5
|
+
{
|
|
6
|
+
variants: {
|
|
7
|
+
sub: {
|
|
8
|
+
false: 'border-0.5px border',
|
|
9
|
+
true: 'mt--5px border-[0.5px] border-strong',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
defaultVariants: {
|
|
13
|
+
sub: false,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
export const menubarContentPaddingVariants = cva('', {
|
|
19
|
+
variants: {
|
|
20
|
+
sub: {
|
|
21
|
+
false: 'p-6px',
|
|
22
|
+
true: 'p-6px',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
defaultVariants: {
|
|
26
|
+
sub: false,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
export const menubarItemVariants = cva(
|
|
31
|
+
'group relative flex cursor-pointer select-none items-center rounded-xl px-12px py-6px body-14-medium text-primary outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
32
|
+
)
|
|
@@ -133,7 +133,7 @@ const computedWidthContent = computed(() => {
|
|
|
133
133
|
<TelaTooltipGroup>
|
|
134
134
|
<div flex items-center justify-center gap-2px>
|
|
135
135
|
<template v-if="variant === 'minimal'">
|
|
136
|
-
<TelaTooltipGroupTrigger
|
|
136
|
+
<TelaTooltipGroupTrigger>
|
|
137
137
|
<button
|
|
138
138
|
:aria-label="barLabels.download"
|
|
139
139
|
w-40px h-40px
|
|
@@ -162,7 +162,7 @@ const computedWidthContent = computed(() => {
|
|
|
162
162
|
</TelaTooltipGroupTrigger>
|
|
163
163
|
</template>
|
|
164
164
|
<template v-if="actions.zoomOut">
|
|
165
|
-
<TelaTooltipGroupTrigger
|
|
165
|
+
<TelaTooltipGroupTrigger>
|
|
166
166
|
<button
|
|
167
167
|
w-40px h-40px
|
|
168
168
|
flex
|
|
@@ -190,7 +190,7 @@ const computedWidthContent = computed(() => {
|
|
|
190
190
|
</TelaTooltipGroupTrigger>
|
|
191
191
|
</template>
|
|
192
192
|
<template v-if="actions.zoomIn">
|
|
193
|
-
<TelaTooltipGroupTrigger
|
|
193
|
+
<TelaTooltipGroupTrigger>
|
|
194
194
|
<button
|
|
195
195
|
w-40px h-40px
|
|
196
196
|
flex
|
|
@@ -218,7 +218,7 @@ const computedWidthContent = computed(() => {
|
|
|
218
218
|
</TelaTooltipGroupTrigger>
|
|
219
219
|
</template>
|
|
220
220
|
<template v-if="actions.handMode">
|
|
221
|
-
<TelaTooltipGroupTrigger
|
|
221
|
+
<TelaTooltipGroupTrigger>
|
|
222
222
|
<button
|
|
223
223
|
:aria-label="barLabels.handMode"
|
|
224
224
|
w-40px h-40px
|
|
@@ -246,7 +246,7 @@ const computedWidthContent = computed(() => {
|
|
|
246
246
|
</template>
|
|
247
247
|
</TelaTooltipGroupTrigger>
|
|
248
248
|
</template>
|
|
249
|
-
<TelaTooltipGroupTrigger v-if="actions.fullscreen"
|
|
249
|
+
<TelaTooltipGroupTrigger v-if="actions.fullscreen">
|
|
250
250
|
<button
|
|
251
251
|
:aria-label="barLabels.fullscreen"
|
|
252
252
|
w-40px h-40px
|
|
@@ -312,7 +312,7 @@ const computedWidthContent = computed(() => {
|
|
|
312
312
|
<div aria-hidden h-24px w-0.5px class="bg-white/16" />
|
|
313
313
|
|
|
314
314
|
<div px-8px>
|
|
315
|
-
<TelaTooltipGroupTrigger
|
|
315
|
+
<TelaTooltipGroupTrigger>
|
|
316
316
|
<TelaButton size="sm" variant="dark" :disabled="!fileUrl" @click="fileUrl && download(fileUrl)">
|
|
317
317
|
{{ barLabels.download }}
|
|
318
318
|
</TelaButton>
|
|
@@ -15,7 +15,7 @@ Fenced code blocks render through `TelaCodeBlock` (line numbers and copy action)
|
|
|
15
15
|
- **Signature:** the table of contents stays fixed at the right of the viewport, tracks the active heading, and surfaces the document title once it scrolls away.
|
|
16
16
|
- **Depth:** borders-only, matching a technical document rather than a card dashboard.
|
|
17
17
|
- **Typography:** the same prose scale as the Tela Build docs site — `heading-h2/h3/h4-semibold` titles, `body-16-regular` secondary prose — on a centered 760px reading column.
|
|
18
|
-
- **Spacing:**
|
|
18
|
+
- **Spacing:** 48px before each H2 (none when it opens the document), 28px before H3, and 12px between paragraphs and list groups.
|
|
19
19
|
|
|
20
20
|
## Basic usage
|
|
21
21
|
|
|
@@ -96,7 +96,7 @@ TelaRfc ← full-viewport scroll container
|
|
|
96
96
|
└─ TelaRfcFlowchart
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
Below
|
|
99
|
+
From 1336px the column centers in the space left of the table of contents, with equal gaps on both sides that never drop below 88px. Below 1336px the table of contents is hidden and the document keeps the full reading column; headings remain addressable through their native fragment anchors.
|
|
100
100
|
|
|
101
101
|
## Props
|
|
102
102
|
|
|
@@ -113,6 +113,7 @@ watch(() => props.markdown, updateMarkdown, { immediate: true })
|
|
|
113
113
|
ref="scrollContainerRef"
|
|
114
114
|
data-tela-rfc
|
|
115
115
|
h-dvh w-full overflow-y-auto bg
|
|
116
|
+
:class="{ 'min-[1336px]:pr-[calc(400px+var(--scrollbar-width,0px))] min-[1336px]:[scrollbar-gutter:stable_both-edges]': tocItems.length }"
|
|
116
117
|
>
|
|
117
118
|
<div
|
|
118
119
|
:aria-busy="isParsing"
|
|
@@ -124,6 +125,7 @@ watch(() => props.markdown, updateMarkdown, { immediate: true })
|
|
|
124
125
|
:label="tocLabel"
|
|
125
126
|
:content-root="articleRef"
|
|
126
127
|
:scroll-root="scrollContainerRef"
|
|
128
|
+
:hide-below="1336"
|
|
127
129
|
/>
|
|
128
130
|
|
|
129
131
|
<article ref="articleRef" data-rfc-document min-w-0>
|
|
@@ -177,7 +179,11 @@ watch(() => props.markdown, updateMarkdown, { immediate: true })
|
|
|
177
179
|
|
|
178
180
|
[data-rfc-document] :deep(h2) {
|
|
179
181
|
--at-apply: 'heading-h3-semibold';
|
|
180
|
-
margin:
|
|
182
|
+
margin: 48px 0 8px;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
[data-rfc-document] :deep(h2:first-child) {
|
|
186
|
+
margin-top: 0;
|
|
181
187
|
}
|
|
182
188
|
|
|
183
189
|
[data-rfc-document] :deep(h3) {
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
|
|
8
8
|
} from 'reka-ui'
|
|
9
9
|
import type { SelectContentEmits, SelectContentProps } from 'reka-ui'
|
|
10
|
-
import type { HTMLAttributes } from 'vue'
|
|
10
|
+
import type { FunctionalComponent, HTMLAttributes } from 'vue'
|
|
11
|
+
import { selectMenuContentVariants } from './select-menu-variants'
|
|
11
12
|
import { reactiveOmit } from '@vueuse/core'
|
|
12
13
|
|
|
13
14
|
defineOptions({
|
|
@@ -23,43 +24,30 @@ const props = withDefaults(
|
|
|
23
24
|
)
|
|
24
25
|
const emits = defineEmits<SelectContentEmits>()
|
|
25
26
|
|
|
26
|
-
const delegatedProps = reactiveOmit(props, 'class')
|
|
27
|
+
const delegatedProps = reactiveOmit(props, 'class', 'enablePortal')
|
|
27
28
|
|
|
28
29
|
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
30
|
+
|
|
31
|
+
const Passthrough: FunctionalComponent = (_, { slots }) => slots.default?.()
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<template>
|
|
32
|
-
<
|
|
35
|
+
<component :is="enablePortal ? SelectPortal : Passthrough">
|
|
33
36
|
<SelectContent
|
|
34
37
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
35
38
|
:class="cn(
|
|
36
|
-
'SelectContent popover-enter-exit origin-[var(--reka-select-content-transform-origin)] relative z-999 max-h-80 overflow-hidden
|
|
39
|
+
'SelectContent popover-enter-exit origin-[var(--reka-select-content-transform-origin)] relative z-999 max-h-80 overflow-hidden',
|
|
40
|
+
selectMenuContentVariants(),
|
|
37
41
|
props.class,
|
|
38
42
|
)"
|
|
39
43
|
:side-offset="4"
|
|
40
|
-
shadow="0 4px 16px 0 rgba(85, 91, 98, 0.14)"
|
|
41
44
|
avoid-collisions
|
|
42
45
|
>
|
|
43
|
-
<SelectViewport :class="cn(
|
|
46
|
+
<SelectViewport :class="cn(position === 'popper' && 'h-[--reka-select-trigger-height] w-full')">
|
|
44
47
|
<slot />
|
|
45
48
|
</SelectViewport>
|
|
46
49
|
</SelectContent>
|
|
47
|
-
</
|
|
48
|
-
<SelectContent
|
|
49
|
-
v-else
|
|
50
|
-
v-bind="{ ...forwarded, ...$attrs }"
|
|
51
|
-
:class="cn(
|
|
52
|
-
'SelectContent popover-enter-exit origin-[var(--reka-select-content-transform-origin)] relative z-999 max-h-80 overflow-hidden rounded-[16px] border-0.5px border bg',
|
|
53
|
-
props.class,
|
|
54
|
-
)"
|
|
55
|
-
:side-offset="4"
|
|
56
|
-
shadow="0 4px 16px 0 rgba(85, 91, 98, 0.14)"
|
|
57
|
-
avoid-collisions
|
|
58
|
-
>
|
|
59
|
-
<SelectViewport :class="cn('p-1', position === 'popper' && 'h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]')">
|
|
60
|
-
<slot />
|
|
61
|
-
</SelectViewport>
|
|
62
|
-
</SelectContent>
|
|
50
|
+
</component>
|
|
63
51
|
</template>
|
|
64
52
|
|
|
65
53
|
<style>
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
SelectItemText,
|
|
9
9
|
useForwardProps,
|
|
10
10
|
} from 'reka-ui'
|
|
11
|
+
import { selectMenuItemVariants } from './select-menu-variants'
|
|
11
12
|
|
|
12
13
|
const props = defineProps<SelectItemProps & { class?: HTMLAttributes['class'] }>()
|
|
13
14
|
|
|
@@ -21,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
21
22
|
v-bind="forwardedProps"
|
|
22
23
|
:class="
|
|
23
24
|
cn(
|
|
24
|
-
|
|
25
|
+
selectMenuItemVariants(),
|
|
25
26
|
props.class,
|
|
26
27
|
)
|
|
27
28
|
"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority'
|
|
2
|
+
|
|
3
|
+
export const selectMenuContentVariants = cva(
|
|
4
|
+
'rounded-16px border-0.5px border bg p-6px [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]',
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
export const selectMenuItemVariants = cva(
|
|
8
|
+
'relative flex w-full cursor-pointer select-none items-center justify-between gap-8px rounded-10px pl-10px pr-8px py-7px body-14-medium outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
|
|
9
|
+
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { ComponentPublicInstance, HTMLAttributes } from 'vue'
|
|
2
|
+
import type { Component, ComponentPublicInstance, HTMLAttributes } from 'vue'
|
|
3
3
|
import type { AcceptableValue } from 'reka-ui'
|
|
4
4
|
|
|
5
5
|
import SelectMenuRoot from './select-menu-root.vue'
|
|
@@ -9,6 +9,17 @@ import SelectMenuContent from './select-menu-content.vue'
|
|
|
9
9
|
import SelectMenuGroup from './select-menu-group.vue'
|
|
10
10
|
import SelectMenuItem from './select-menu-item.vue'
|
|
11
11
|
|
|
12
|
+
export type SelectMenuOptions = Array<{
|
|
13
|
+
value: string
|
|
14
|
+
label: string
|
|
15
|
+
description?: string
|
|
16
|
+
icon?: string | any
|
|
17
|
+
group?: string
|
|
18
|
+
to?: string
|
|
19
|
+
externalIconSrc?: string
|
|
20
|
+
tooltipContent?: Component
|
|
21
|
+
}>
|
|
22
|
+
|
|
12
23
|
const props = defineProps<{
|
|
13
24
|
modelValue?: string
|
|
14
25
|
options: SelectMenuOptions
|
|
@@ -33,12 +33,12 @@ const labels = useTelaLabels()
|
|
|
33
33
|
<div v-else w-32px h-32px bg />
|
|
34
34
|
</button>
|
|
35
35
|
</TelaDropdownMenuTrigger>
|
|
36
|
-
<TelaDropdownMenuContent align="start" side="top" class="min-w-
|
|
36
|
+
<TelaDropdownMenuContent align="start" side="top" class="min-w-242px!">
|
|
37
37
|
<div px-12px py-8px>
|
|
38
|
-
<h5
|
|
38
|
+
<h5 body-14-semibold text-primary>
|
|
39
39
|
{{ name }}
|
|
40
40
|
</h5>
|
|
41
|
-
<p body-12-regular text-
|
|
41
|
+
<p body-12-regular text-tertiary>
|
|
42
42
|
{{ email }}
|
|
43
43
|
</p>
|
|
44
44
|
</div>
|
|
@@ -21,6 +21,7 @@ const props = withDefaults(defineProps<{
|
|
|
21
21
|
isIconAnimated?: boolean
|
|
22
22
|
isIconHidden?: boolean
|
|
23
23
|
labelClass?: HTMLAttributes['class']
|
|
24
|
+
backgroundClass?: string
|
|
24
25
|
}>(), {
|
|
25
26
|
variant: 'running',
|
|
26
27
|
size: 'md',
|
|
@@ -306,7 +307,7 @@ const currentStatus = computed<StatusConfig>(() => {
|
|
|
306
307
|
return variantConfig[variant] ?? variantConfig.running
|
|
307
308
|
})
|
|
308
309
|
|
|
309
|
-
const backgroundColor = computed(() => currentStatus.value.backgroundColor)
|
|
310
|
+
const backgroundColor = computed(() => props.backgroundClass ?? currentStatus.value.backgroundColor)
|
|
310
311
|
const textColor = computed(() => currentStatus.value.textColor)
|
|
311
312
|
const iconName = computed(() => currentStatus.value.iconName)
|
|
312
313
|
const iconColor = computed(() => currentStatus.value.iconColor)
|
|
@@ -4,7 +4,7 @@ import { Meta } from '@storybook/blocks';
|
|
|
4
4
|
|
|
5
5
|
# TelaTableOfContents
|
|
6
6
|
|
|
7
|
-
A viewport-fixed in-page table of contents (the same one used by the Tela Build docs site) that tracks the current heading and scrolls to native fragment targets. It can discover headings from an article or receive an explicit item list, and it hides itself below 1511px.
|
|
7
|
+
A viewport-fixed in-page table of contents (the same one used by the Tela Build docs site) that tracks the current heading and scrolls to native fragment targets. It can discover headings from an article or receive an explicit item list, and it hides itself below 1511px by default (`hideBelow`).
|
|
8
8
|
|
|
9
9
|
## Basic usage
|
|
10
10
|
|
|
@@ -66,6 +66,7 @@ const items = [
|
|
|
66
66
|
| `articleSelector` | `string` | `'article'` | Fallback selector used when `contentRoot` is not supplied. |
|
|
67
67
|
| `headingSelector` | `string` | `'h2[id], h3[id]'` | Headings discovered when `items` is not supplied. |
|
|
68
68
|
| `titleSelector` | `string` | `'h1[id]'` | Title shown above the list after the document title scrolls away. |
|
|
69
|
+
| `hideBelow` | `1336 \| 1511` | `1511` | Viewport width in pixels below which the navigation is hidden. |
|
|
69
70
|
|
|
70
71
|
## Events
|
|
71
72
|
|
|
@@ -78,4 +79,4 @@ const items = [
|
|
|
78
79
|
- Links retain native fragment URLs and expose the tracked section with `aria-current="location"`.
|
|
79
80
|
- Selecting a link scrolls smoothly and updates the URL hash without adding history entries.
|
|
80
81
|
- The title control leaves the tab order while hidden and returns to the top of the current scroll root.
|
|
81
|
-
- The navigation is hidden below 1511px; the document keeps its native heading anchors.
|
|
82
|
+
- The navigation is hidden below `hideBelow` (1511px by default, or 1336px for layouts with a narrower reserved column such as `TelaRfc`); the document keeps its native heading anchors.
|
|
@@ -13,10 +13,12 @@ const props = withDefaults(defineProps<{
|
|
|
13
13
|
articleSelector?: string
|
|
14
14
|
headingSelector?: string
|
|
15
15
|
titleSelector?: string
|
|
16
|
+
hideBelow?: 1336 | 1511
|
|
16
17
|
}>(), {
|
|
17
18
|
articleSelector: 'article',
|
|
18
19
|
headingSelector: 'h2[id], h3[id]',
|
|
19
20
|
titleSelector: 'h1[id]',
|
|
21
|
+
hideBelow: 1511,
|
|
20
22
|
})
|
|
21
23
|
|
|
22
24
|
const emit = defineEmits<{
|
|
@@ -34,6 +36,11 @@ const minimumLevel = computed(() => Math.min(...displayedItems.value.map(item =>
|
|
|
34
36
|
|
|
35
37
|
const indentClasses = ['', 'pl-12px', 'pl-24px', 'pl-36px']
|
|
36
38
|
|
|
39
|
+
const hideBelowClasses = {
|
|
40
|
+
1336: 'hidden min-[1336px]:flex',
|
|
41
|
+
1511: 'hidden min-[1511px]:flex',
|
|
42
|
+
}
|
|
43
|
+
|
|
37
44
|
let headingObserver: IntersectionObserver | undefined
|
|
38
45
|
let titleObserver: IntersectionObserver | undefined
|
|
39
46
|
let manualClickId: string | undefined
|
|
@@ -201,7 +208,8 @@ watch([
|
|
|
201
208
|
<template>
|
|
202
209
|
<aside
|
|
203
210
|
v-if="displayedItems.length"
|
|
204
|
-
class="fixed top-0 w-340px h-screen overflow-y-auto no-scrollbar py-80px pr-48px pl-16px flex
|
|
211
|
+
class="fixed top-0 w-340px h-screen overflow-y-auto no-scrollbar py-80px pr-48px pl-16px flex-col gap-12px select-none right-[calc(60px+var(--scrollbar-width,0px))]"
|
|
212
|
+
:class="hideBelowClasses[hideBelow]"
|
|
205
213
|
>
|
|
206
214
|
<Motion
|
|
207
215
|
as="button"
|
package/docs/interfaces.md
CHANGED
|
@@ -193,7 +193,7 @@ Before building a new page from scratch, check for an existing **layout template
|
|
|
193
193
|
|
|
194
194
|
**`TelaDetails`** — a sticky `TelaHeader` + a single scroll container + a primary content column beside a sticky context column, with an optional confirm footer. Two documented variants — a two-column body, and a hero header above the body.
|
|
195
195
|
|
|
196
|
-
**`TelaRfc`** — a centered long-form reading column with a built-in fixed `TelaTableOfContents` (H2–H4) at the right. It accepts plain Markdown directly, renders fenced code through `TelaCodeBlock`, renders fenced Mermaid flowcharts, and hides the TOC below
|
|
196
|
+
**`TelaRfc`** — a centered long-form reading column with a built-in fixed `TelaTableOfContents` (H2–H4) at the right. It accepts plain Markdown directly, renders fenced code through `TelaCodeBlock`, renders fenced Mermaid flowcharts, and hides the TOC below 1336px, the narrowest width that keeps at least 88px on each side of the column.
|
|
197
197
|
|
|
198
198
|
This table is the source of truth for layout templates. Rules:
|
|
199
199
|
|
package/package.json
CHANGED
package/types/custom-icon.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type TelaCustomIconName = 'circle' | 'pause' | 'queued' | 'close' | 'circle-notch' | 'circle-minus' | 'stop' | 'circle-dashed' | 'warning' | 'check' | 'check-dashed' | 'semi-circle' | 'arrow-down' | 'reported' | 'circle-warning' | 'slice' | 'half-slice' | 'knot' | 'timeline-dot' | 'timeline-start' | 'level-right' | 'quarter-slice'
|
|
1
|
+
export type TelaCustomIconName = 'circle' | 'pause' | 'queued' | 'close' | 'circle-notch' | 'circle-minus' | 'stop' | 'circle-dashed' | 'warning' | 'check' | 'check-dashed' | 'semi-circle' | 'arrow-down' | 'reported' | 'circle-warning' | 'slice' | 'half-slice' | 'knot' | 'timeline-dot' | 'timeline-start' | 'level-right' | 'divider' | 'quarter-slice'
|
package/utils/select-menu.ts
DELETED