@meistrari/tela-build 1.32.0 → 1.33.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.
@@ -1,12 +1,15 @@
1
1
  <script setup lang="ts">
2
+ import type { HTMLAttributes } from 'vue'
3
+ import type { TooltipProps } from '../tooltip/tooltip.vue'
4
+
2
5
  import { VisuallyHidden } from 'radix-vue'
6
+
3
7
  import DropdownMenuRoot from './DropdownMenuRoot.vue'
4
8
  import DropdownMenuContent from './DropdownMenuContent.vue'
5
9
  import DropdownMenuGroup from './DropdownMenuGroup.vue'
6
10
  import DropdownMenuItem from './DropdownMenuItem.vue'
7
11
  import DropdownMenuLabel from './DropdownMenuLabel.vue'
8
12
  import DropdownMenuTrigger from './DropdownMenuTrigger.vue'
9
- import type { TooltipProps } from '../tooltip/tooltip.vue'
10
13
 
11
14
  const props = withDefaults(defineProps<{
12
15
  items: {
@@ -27,7 +30,8 @@ const props = withDefaults(defineProps<{
27
30
  allowSearch?: boolean
28
31
  searchPlaceholder?: string
29
32
  shouldBeModal?: boolean
30
- contentClass?: string
33
+ triggerClass?: HTMLAttributes['class']
34
+ contentClass?: HTMLAttributes['class']
31
35
  align?: 'start' | 'end' | 'center'
32
36
  }>(), {
33
37
  align: 'start',
@@ -66,7 +70,7 @@ function onToggle(open: boolean) {
66
70
  <template>
67
71
  <div data-allow-mismatch @click.stop>
68
72
  <DropdownMenuRoot :modal="shouldBeModal" :default-open="isStorybook" @update:open="onToggle">
69
- <DropdownMenuTrigger as-child class="data-[state=open]:bg-gray-100" @click.prevent.stop>
73
+ <DropdownMenuTrigger as-child :class="cn('data-[state=open]:bg-muted', triggerClass)" @click.prevent.stop>
70
74
  <slot />
71
75
  <VisuallyHidden v-if="isStorybook" as-child>
72
76
  <button />
@@ -14,7 +14,7 @@ const emit = defineEmits<{
14
14
  size="md"
15
15
  color="secondary"
16
16
  :icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
17
- button-class="!disabled:bg-transparent"
17
+ button-class="!rounded-12px !disabled:bg-transparent"
18
18
  :disabled="disabled"
19
19
  @click="emit('click')"
20
20
  />
@@ -14,7 +14,7 @@ const emit = defineEmits<{
14
14
  size="md"
15
15
  color="secondary"
16
16
  :icon-class="disabled ? 'text-icon-subtle' : 'text-icon'"
17
- button-class="!disabled:bg-transparent"
17
+ button-class="!rounded-12px !disabled:bg-transparent"
18
18
  :disabled="disabled"
19
19
  @click="emit('click')"
20
20
  />
@@ -18,6 +18,7 @@ defineProps<{
18
18
  size="md"
19
19
  color="secondary"
20
20
  icon="i-ph-dots-three-bold"
21
+ button-class="!rounded-12px"
21
22
  icon-class="text-neutral-950"
22
23
  />
23
24
  </TelaDropdownMenu>
@@ -15,7 +15,7 @@ const sizeStyles = computed(() => {
15
15
  case 'sm':
16
16
  return 'w-32px h-32px text-16px'
17
17
  case 'md':
18
- return 'w-40px h-40px text-18px'
18
+ return 'w-40px h-40px text-20px'
19
19
  case 'lg':
20
20
  return 'w-64px h-64px text-28px'
21
21
  case 'xl':
@@ -123,10 +123,10 @@ defineExpose({
123
123
  transition
124
124
  cursor-text
125
125
  overflow-hidden
126
- px-3 py-8px
127
- b="0.5px border-strong"
126
+ px-10px py-4px
127
+ b="0.5px border"
128
128
  rounded-10px bg-white
129
- class="focus-within-b-gray-400 focus-within-ring-2 focus-within-ring-gray-100"
129
+ class="focus-within-border-strong focus-within-ring-2 focus-within-ring-gray-100 [box-shadow:0_1px_4px_0_rgba(103,127,148,0.03)]"
130
130
  :class="[
131
131
  size === 'sm' && 'py-7px !px-12px',
132
132
  disabled && '!bg-gray-50 cursor-not-allowed color-gray-600',
@@ -137,8 +137,8 @@ defineExpose({
137
137
  flex items-center
138
138
  @click="$el.querySelector(isTextarea ? 'textarea' : 'input')?.focus()"
139
139
  >
140
- <div v-if="icon" flex mr-6px>
141
- <TelaIcon :name="icon" size="sm" text="gray-400" />
140
+ <div v-if="icon" flex mr-8px>
141
+ <TelaIcon :name="icon" size="13px" text="icon-tertiary" />
142
142
  </div>
143
143
  <div
144
144
  flex="~ col" grow align-center h-full
@@ -155,7 +155,6 @@ defineExpose({
155
155
  align-center
156
156
  :class="[disabled && 'cursor-not-allowed', props.labelClass]"
157
157
  >
158
-
159
158
  <slot name="label-leading" />
160
159
  {{ label }}
161
160
  </label>
@@ -175,13 +174,13 @@ defineExpose({
175
174
  bg-transparent
176
175
  z-0
177
176
  h-full
178
- class="placeholder-gray-300 focus-visible:outline-none! leading-170% tracking-.01em"
177
+ body-14-regular
178
+ class="placeholder-text-tertiary focus-visible:outline-none!"
179
179
  resize-none
180
180
  :disabled="disabled"
181
181
  :tabindex="tabindex"
182
182
  :class="[
183
183
  disabled && 'cursor-not-allowed',
184
- size === 'sm' && 'leading-20px body-14-regular placeholder:body-14-regular',
185
184
  props.inputFontClass ? props.inputFontClass : 'text-14px',
186
185
  !isTextarea && '!h-1.7em',
187
186
  ]"
@@ -14,7 +14,7 @@ const props = withDefaults(
14
14
  {
15
15
  align: 'start',
16
16
  alignOffset: 0,
17
- sideOffset: 8,
17
+ sideOffset: 4,
18
18
  disablePortal: false,
19
19
  },
20
20
  )
@@ -22,7 +22,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
22
22
  <MenubarItem
23
23
  v-bind="forwarded"
24
24
  :class="cn(
25
- 'relative flex cursor-pointer select-none items-center rounded-xl px-3 py-1.5 text-body-14-medium font-460 outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
25
+ 'relative flex cursor-pointer select-none items-center rounded-xl px-3 py-1.5 body-14-medium text-primary outline-none focus:bg-muted data-[disabled]:pointer-events-none data-[disabled]:opacity-40',
26
26
  inset && 'pl-8',
27
27
  props.class,
28
28
  )"
@@ -17,7 +17,7 @@ const forwardedProps = useForwardProps(delegatedProps)
17
17
  v-bind="forwardedProps"
18
18
  :class="
19
19
  cn(
20
- 'flex items-center gap-2 cursor-pointer select-none px-2 py-1.5 text-sm font-medium outline-none rounded-lg hover:bg-lowered data-[state=open]:bg-lowered',
20
+ 'flex items-center gap-2 cursor-pointer select-none px-2 py-1.5 text-sm font-medium outline-none rounded-lg hover:bg-muted data-[state=open]:bg-muted',
21
21
  props.class,
22
22
  )
23
23
  "
@@ -1,34 +1,43 @@
1
1
  <script setup lang="ts">
2
+ import type { ScrollAreaRootProps } from 'reka-ui'
3
+ import type { HTMLAttributes } from 'vue'
4
+
5
+ import { computed, onMounted, useTemplateRef } from 'vue'
6
+
2
7
  import {
3
8
  ScrollAreaCorner,
4
9
  ScrollAreaRoot,
5
-
6
10
  ScrollAreaViewport,
7
11
  } from 'reka-ui'
8
- import type { ScrollAreaRootProps } from 'reka-ui'
9
- import { computed } from 'vue'
10
- import type { HTMLAttributes } from 'vue'
12
+
11
13
  import ScrollBar from './scroll-bar.vue'
12
14
 
13
15
  const props = withDefaults(
14
16
  defineProps<ScrollAreaRootProps
15
- & { class?: HTMLAttributes['class'], orientation?: 'vertical' | 'horizontal' | 'both', scrollThumbClass?: HTMLAttributes['class'] }>(),
17
+ & { class?: HTMLAttributes['class'], orientation?: 'vertical' | 'horizontal' | 'both', scrollThumbClass?: HTMLAttributes['class'], disableViewportFocus?: boolean }>(),
16
18
  {
17
19
  orientation: 'vertical',
18
- scrollThumbClass: '',
20
+ disableViewportFocus: false,
19
21
  },
20
22
  )
21
23
 
22
24
  const delegatedProps = computed(() => {
23
- const { class: _, ...delegated } = props
25
+ const { class: _, disableViewportFocus: __, ...delegated } = props
24
26
 
25
27
  return delegated
26
28
  })
29
+
30
+ const viewportRef = useTemplateRef<InstanceType<typeof ScrollAreaViewport>>('viewportRef')
31
+
32
+ onMounted(() => {
33
+ if (props.disableViewportFocus)
34
+ viewportRef.value?.viewportElement?.setAttribute('tabindex', '-1')
35
+ })
27
36
  </script>
28
37
 
29
38
  <template>
30
39
  <ScrollAreaRoot v-bind="delegatedProps" :class="cn('relative overflow-hidden', props.class)">
31
- <ScrollAreaViewport class="h-full w-full rounded-[inherit]">
40
+ <ScrollAreaViewport ref="viewportRef" class="size-full rounded-[inherit] focus-visible:outline-border-strong">
32
41
  <slot />
33
42
  </ScrollAreaViewport>
34
43
  <ScrollBar v-if="props.orientation === 'vertical' || props.orientation === 'both'" orientation="vertical" :class="props.scrollThumbClass" />
@@ -2,7 +2,7 @@
2
2
  import { NuxtLink } from '#components'
3
3
 
4
4
  defineProps<{
5
- src?: string
5
+ src?: string | null
6
6
  alt: string
7
7
  to?: string
8
8
  }>()
@@ -1,8 +1,8 @@
1
1
  <script setup lang="ts">
2
2
  defineProps<{
3
3
  image?: string
4
- name: string
5
- email: string
4
+ name?: string
5
+ email?: string
6
6
  actions: {
7
7
  label: string
8
8
  icon: string
package/css/reset.css CHANGED
@@ -383,4 +383,12 @@ Make all headers have regular font weight by default
383
383
 
384
384
  h1, h1, h2, h3, h4, h5, h6 {
385
385
  --at-apply: 'font-regular'
386
- }
386
+ }
387
+
388
+ /*
389
+ Reset user-select from images
390
+ */
391
+
392
+ img {
393
+ user-select: none;
394
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",