@meistrari/tela-build 1.25.2 → 1.26.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/components/tela/badge/badge.vue +3 -3
- package/components/tela/button/button.vue +1 -1
- package/components/tela/icon/custom.vue +6 -0
- package/components/tela/icon-button/icon-button.vue +2 -2
- package/components/tela/preview/preview-content.vue +5 -4
- package/components/tela/star-button.vue +1 -1
- package/components/tela/transparent-input.vue +18 -7
- package/package.json +1 -1
- package/types/custom-icon.ts +1 -1
- package/utils/design-tokens.ts +5 -5
|
@@ -20,15 +20,15 @@ const tag = computed(() => props.to ? NuxtLink : 'div')
|
|
|
20
20
|
<component
|
|
21
21
|
:is="tag"
|
|
22
22
|
:class="cn(
|
|
23
|
-
'inline-block px-[5px] rounded-[5px] select-none',
|
|
24
|
-
variant === 'outline' && 'border-[0.5px]
|
|
23
|
+
'inline-block px-[5px] py-[3px] rounded-[5px] select-none',
|
|
24
|
+
variant === 'outline' && 'border-[0.5px] border-border',
|
|
25
25
|
variant === 'filled' && 'bg-lowered',
|
|
26
26
|
props.class,
|
|
27
27
|
)"
|
|
28
28
|
>
|
|
29
29
|
<span
|
|
30
30
|
:class="cn(
|
|
31
|
-
'flex items-center gap-[4px] text-[9px] whitespace-nowrap font-580 leading-[
|
|
31
|
+
'flex items-center gap-[4px] text-[9px] whitespace-nowrap font-580 leading-[10px] tracking-0.2px uppercase',
|
|
32
32
|
variant === 'outline' && 'text-tertiary',
|
|
33
33
|
variant === 'filled' && 'text-secondary tracking-normal',
|
|
34
34
|
textClass,
|
|
@@ -100,7 +100,7 @@ const iconSize = computed(() => {
|
|
|
100
100
|
<component
|
|
101
101
|
:is="tag"
|
|
102
102
|
:to="to"
|
|
103
|
-
:class="resolvedStyle"
|
|
103
|
+
:class="resolvedStyle" ease-out duration-40 flex items-center justify-center gap-6px
|
|
104
104
|
:disabled="disabled"
|
|
105
105
|
:cursor="disabled ? 'not-allowed' : 'pointer'"
|
|
106
106
|
:target="target"
|
|
@@ -354,5 +354,11 @@ const colorValue = computed(() => {
|
|
|
354
354
|
<template v-if="name === 'timeline-start'">
|
|
355
355
|
<circle cx="4.5" cy="4.5" r="4" fill="white" stroke="currentColor" />
|
|
356
356
|
</template>
|
|
357
|
+
|
|
358
|
+
<template v-if="name === 'level-right'">
|
|
359
|
+
<g transform="translate(3.3, 0.2)">
|
|
360
|
+
<path d="M0.805054 0.805054L3.34137 3.34137C4.54019 4.54019 4.60421 6.46316 3.4878 7.73906L0.805054 10.8051" stroke="currentColor" stroke-width="1.61015" stroke-linecap="round" />
|
|
361
|
+
</g>
|
|
362
|
+
</template>
|
|
357
363
|
</svg>
|
|
358
364
|
</template>
|
|
@@ -29,7 +29,7 @@ const emit = defineEmits<{
|
|
|
29
29
|
}>()
|
|
30
30
|
|
|
31
31
|
const style = computed(() => {
|
|
32
|
-
const base = 'cursor-pointer flex items-center justify-center rounded-lg p-0.5em
|
|
32
|
+
const base = 'cursor-pointer flex items-center justify-center rounded-lg p-0.5em ease-out duration-40'
|
|
33
33
|
const size = ({
|
|
34
34
|
'3xs': 'text-6px p-1',
|
|
35
35
|
'2xs': 'text-8px p-4px', // 16px
|
|
@@ -40,7 +40,7 @@ const style = computed(() => {
|
|
|
40
40
|
|
|
41
41
|
const color = ({
|
|
42
42
|
primary: 'bg-#01292F !text-white hover:bg-#153A40 b-#011D21 hover:b-#123137',
|
|
43
|
-
secondary: 'bg-transparent text-icon hover:bg-
|
|
43
|
+
secondary: 'bg-transparent text-icon-tertiary hover:bg-muted hover:text-gray-950 active:text-gray-800 disabled:bg-gray-100 disabled:!text-gray-300',
|
|
44
44
|
} as Record<typeof props.color, string>)[props.color]
|
|
45
45
|
|
|
46
46
|
const disabled = props.disabled && 'cursor-not-allowed !bg-#ECF0F2 !text-#617275 !b-0'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useEventListener, useScroll } from '@vueuse/core'
|
|
2
|
+
import { useThrottleFn, useEventListener, useScroll } from '@vueuse/core'
|
|
3
3
|
import { cn } from '@/lib/utils'
|
|
4
4
|
import type { PreviewFile, PreviewContentLabels, PdfDocumentHandle } from './types'
|
|
5
5
|
|
|
@@ -116,12 +116,14 @@ let isRendering = false
|
|
|
116
116
|
let pendingReRender = false
|
|
117
117
|
let pendingScrollPage: number | null = null
|
|
118
118
|
|
|
119
|
+
const throttledReRender = useThrottleFn(reRenderAllPdfPages, 150, true)
|
|
120
|
+
|
|
119
121
|
function zoomIn() {
|
|
120
122
|
if (scale.value < 3) {
|
|
121
123
|
scale.value = Math.min(scale.value + 0.25, 3)
|
|
122
124
|
|
|
123
125
|
if (props.file.fileType === 'application/pdf') {
|
|
124
|
-
|
|
126
|
+
throttledReRender()
|
|
125
127
|
}
|
|
126
128
|
}
|
|
127
129
|
}
|
|
@@ -131,11 +133,10 @@ function zoomOut() {
|
|
|
131
133
|
scale.value = Math.max(scale.value - 0.25, 0.5)
|
|
132
134
|
|
|
133
135
|
if (props.file.fileType === 'application/pdf') {
|
|
134
|
-
|
|
136
|
+
throttledReRender()
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
}
|
|
138
|
-
|
|
139
140
|
function clearCanvasElement(canvas: HTMLCanvasElement | null | undefined) {
|
|
140
141
|
if (!canvas)
|
|
141
142
|
return
|
|
@@ -32,7 +32,7 @@ watch(() => props.modelValue, (newValue, oldValue) => {
|
|
|
32
32
|
:icon="modelValue ? 'i-ph-star-fill' : 'i-ph-star-light'"
|
|
33
33
|
color="secondary"
|
|
34
34
|
:size="size"
|
|
35
|
-
:class="cn(props.class)"
|
|
35
|
+
:class="cn(modelValue && 'hover:bg-amber-100!', props.class)"
|
|
36
36
|
:icon-class="cn('relative z-1', modelValue ? 'text-amber-400!' : 'text-neutral-400!')"
|
|
37
37
|
@click.stop.prevent="emit('update:modelValue', !modelValue)"
|
|
38
38
|
/>
|
|
@@ -23,6 +23,16 @@ const initialValue = ref(props.modelValue)
|
|
|
23
23
|
|
|
24
24
|
const isEditing = ref(!props.displayIcon)
|
|
25
25
|
|
|
26
|
+
const autowidthOptions = computed(() => ({
|
|
27
|
+
comfortZone: props.displayIcon ? '2px' : '0px',
|
|
28
|
+
}))
|
|
29
|
+
|
|
30
|
+
function recalcAutowidth() {
|
|
31
|
+
nextTick(() => {
|
|
32
|
+
inputRef.value?.dispatchEvent(new Event('input', { bubbles: true }))
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
26
36
|
function onFocus() {
|
|
27
37
|
if (props.modelValue === props.defaultValue) {
|
|
28
38
|
emit('update:modelValue', '')
|
|
@@ -83,6 +93,9 @@ function handleClickOutside(event: Event) {
|
|
|
83
93
|
|
|
84
94
|
onMounted(() => {
|
|
85
95
|
document.addEventListener('mousedown', handleClickOutside)
|
|
96
|
+
void document.fonts?.ready?.then(() => {
|
|
97
|
+
recalcAutowidth()
|
|
98
|
+
})
|
|
86
99
|
})
|
|
87
100
|
|
|
88
101
|
onUnmounted(() => {
|
|
@@ -93,26 +106,24 @@ onUnmounted(() => {
|
|
|
93
106
|
<template>
|
|
94
107
|
<div
|
|
95
108
|
ref="containerRef"
|
|
96
|
-
flex relative
|
|
109
|
+
flex relative min-w-0
|
|
97
110
|
:class="cn('group', containerClass, { 'font-580 text-18px': !disableDefaultStyling })"
|
|
98
111
|
outline-none
|
|
99
112
|
text="textcolor"
|
|
100
113
|
items-center
|
|
101
|
-
cursor-text
|
|
102
114
|
@click="onStartEditing"
|
|
103
115
|
>
|
|
104
116
|
<input
|
|
105
117
|
ref="inputRef"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
v-autowidth="autowidthOptions"
|
|
119
|
+
w-fit
|
|
120
|
+
shrink-0
|
|
121
|
+
max-w-full
|
|
110
122
|
p-0
|
|
111
123
|
transition
|
|
112
124
|
:value="modelValue"
|
|
113
125
|
:placeholder="placeholder"
|
|
114
126
|
:disabled="disabled || (displayIcon && !isEditing)"
|
|
115
|
-
truncate
|
|
116
127
|
bg-transparent
|
|
117
128
|
:class="[
|
|
118
129
|
{ 'font-580 text-18px': !disableDefaultStyling },
|
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'
|
|
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'
|
package/utils/design-tokens.ts
CHANGED
|
@@ -304,11 +304,11 @@ export const DT = {
|
|
|
304
304
|
warning: BASE_COLORS.amber[200],
|
|
305
305
|
},
|
|
306
306
|
text: {
|
|
307
|
-
primary: BASE_COLORS.
|
|
308
|
-
secondary: BASE_COLORS.
|
|
309
|
-
tertiary: BASE_COLORS.
|
|
310
|
-
subtle: BASE_COLORS.
|
|
311
|
-
contrast: BASE_COLORS.
|
|
307
|
+
primary: BASE_COLORS.neutral[800],
|
|
308
|
+
secondary: BASE_COLORS.neutral[500],
|
|
309
|
+
tertiary: BASE_COLORS.neutral[400],
|
|
310
|
+
subtle: BASE_COLORS.neutral[300],
|
|
311
|
+
contrast: BASE_COLORS.neutral[900],
|
|
312
312
|
success: BASE_COLORS.green[600],
|
|
313
313
|
error: BASE_COLORS.red[600],
|
|
314
314
|
warning: BASE_COLORS.amber[600],
|