@meistrari/tela-build 1.77.3 → 1.77.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -11,6 +11,10 @@ Latest updates and announcements.
11
11
 
12
12
  - `TelaTransparentInput` only emits `blur` on an outside click when its input has focus. Without `displayIcon`, the first click anywhere on the page used to emit `blur`, so title fields saved an unchanged value on every visit.
13
13
 
14
+ ## September 25, 2026
15
+
16
+ - [Radio Group](/components/radio-group) and `TelaRadioButton` share one look: `border-strong` border on `bg` (hover `border-accent` on `bg-subtle`), a 5px `neutral-900` border that pops in with a scale animation when checked, and `border`/`bg-muted` when disabled. `TelaRadioButton` now styles its `disabled` state, and `TelaRadioGroup` generates unique ids with `useId()`.
17
+
14
18
  ## September 24, 2026
15
19
 
16
20
  - [Floating chat](/templates/chat#floating): Escape now closes the topmost overlay before the chat. `TelaDialog`, `TelaModal`, `TelaSheet` and `TelaSideSheet` overlays carry `data-tela-escape-layer`, and [Dropdown Menu](/components/dropdown-menu) content has a new `escapeLayer` prop that adds the marker (`TelaDropdownMenu` sets it).
@@ -179,7 +179,6 @@ onClickOutside(dropdownRef, () => {
179
179
  </span>
180
180
  <TelaRadioButton
181
181
  :model-value="selectedDateValue === option.value"
182
- class="border border-gray-300!"
183
182
  @update:model-value="handleDateValueSelect(option.value)"
184
183
  @click.stop
185
184
  />
@@ -1,4 +1,8 @@
1
1
  <script setup lang="ts">
2
+ import type { ComponentPublicInstance } from 'vue'
3
+ import { useReducedMotion } from 'motion-v'
4
+ import { radioMotionVariants, radioVariants } from './radio-group/radio-variants'
5
+
2
6
  const props = defineProps<{
3
7
  autoFocus?: boolean
4
8
  disabled?: boolean
@@ -7,53 +11,42 @@ const props = defineProps<{
7
11
 
8
12
  const checked = defineModel<boolean>()
9
13
 
10
- const radioEl = ref<HTMLInputElement | null>(null)
14
+ const radioEl = ref<ComponentPublicInstance | null>(null)
11
15
  onMounted(() => {
12
16
  if (props.autoFocus) {
13
- radioEl.value?.focus()
17
+ radioEl.value?.$el.focus()
14
18
  }
15
19
  })
16
20
 
21
+ const prefersReducedMotion = useReducedMotion()
22
+
17
23
  function toggle() {
18
24
  checked.value = !checked.value
19
25
  }
20
26
  </script>
21
27
 
22
28
  <template>
23
- <input
29
+ <Motion
24
30
  ref="radioEl"
31
+ as="input"
25
32
  type="radio"
26
33
  :checked="checked"
27
34
  :disabled="disabled"
28
- b="1px gray-900"
29
- cursor-pointer
30
- :class="[checked ? 'bg-gray-900' : 'bg-white hover:bg-gray-200']"
31
- class="form-radio focus:ring-1 focus:ring-gray-200 text-gray-900"
35
+ :data-state="checked ? 'checked' : 'unchecked'"
36
+ :class="cn('form-radio', radioVariants())"
37
+ :variants="radioMotionVariants"
38
+ :initial="false"
39
+ :animate="checked && !prefersReducedMotion ? 'checked' : 'unchecked'"
32
40
  @change="toggle"
33
- >
41
+ />
34
42
  </template>
35
43
 
36
44
  <style>
37
- .form-radio:checked {
38
- background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")
39
- }
40
-
41
- .form-radio:checked {
42
- background-color: currentColor;
43
- background-position: 50%;
44
- background-repeat: no-repeat;
45
- background-size: 100% 100%;
46
- border-color: transparent;
47
- }
48
-
49
45
  .form-radio {
50
- border-radius: 100%;
51
46
  -webkit-appearance: none;
52
47
  -moz-appearance: none;
53
48
  appearance: none;
54
49
  display: inline-block;
55
- flex-shrink: 0;
56
- height: 1rem;
57
50
  padding: 0;
58
51
  -webkit-print-color-adjust: exact;
59
52
  print-color-adjust: exact;
@@ -61,6 +54,5 @@ function toggle() {
61
54
  -moz-user-select: none;
62
55
  user-select: none;
63
56
  vertical-align: middle;
64
- width: 1rem;
65
57
  }
66
58
  </style>
@@ -2,11 +2,12 @@
2
2
  import type { RadioGroupItemProps } from 'reka-ui'
3
3
  import type { HTMLAttributes } from 'vue'
4
4
  import {
5
- RadioGroupIndicator,
5
+ injectRadioGroupRootContext,
6
6
  RadioGroupItem,
7
7
  useForwardProps,
8
8
  } from 'reka-ui'
9
- import { computed } from 'vue'
9
+ import { useReducedMotion } from 'motion-v'
10
+ import { radioMotionVariants, radioVariants } from './radio-variants'
10
11
 
11
12
  const props = defineProps<RadioGroupItemProps & { class?: HTMLAttributes['class'] }>()
12
13
 
@@ -17,24 +18,20 @@ const delegatedProps = computed(() => {
17
18
  })
18
19
 
19
20
  const forwardedProps = useForwardProps(delegatedProps)
21
+
22
+ const rootContext = injectRadioGroupRootContext()
23
+ const checked = computed(() => rootContext.modelValue?.value === props.value)
24
+ const prefersReducedMotion = useReducedMotion()
20
25
  </script>
21
26
 
22
27
  <template>
23
- <RadioGroupItem
24
- v-bind="forwardedProps"
25
- :class="
26
- cn(
27
- 'peer aspect-square w-16px h-16px rounded-full border-[1px] border-gray-300 bg-white-1000 hover:bg-gray-50 hover:border-gray-400 disabled:border-gray-200 disabled:bg-gray-100',
28
- 'data-[state=checked]:bg-gray-700 data-[state=checked]:hover:bg-gray-950 disabled:data-[state=checked]:bg-gray-400 data-[state=checked]:!border-transparent',
29
- 'focus:outline-none focus-visible:ring-1 focus-visible:ring-cyan-600 focus-visible:ring-offset-2 disabled:cursor-not-allowed',
30
- props.class,
31
- )
32
- "
33
- >
34
- <RadioGroupIndicator
35
- class="flex items-center justify-center"
36
- >
37
- <TelaIcon name="i-ph-circle-fill" color="white-1000" size="6px" />
38
- </RadioGroupIndicator>
28
+ <RadioGroupItem v-bind="forwardedProps" as-child>
29
+ <Motion
30
+ as="button"
31
+ :class="cn(radioVariants(), props.class)"
32
+ :variants="radioMotionVariants"
33
+ :initial="false"
34
+ :animate="checked && !prefersReducedMotion ? 'checked' : 'unchecked'"
35
+ />
39
36
  </RadioGroupItem>
40
37
  </template>
@@ -7,6 +7,22 @@ import * as RadioGroupStories from './radio-group.stories';
7
7
 
8
8
  Radio group component for selecting one option from mutually exclusive choices.
9
9
 
10
+ ## Rules
11
+
12
+ `TelaRadioGroupItem` and `TelaRadioButton` share one look from `radio-variants.ts`:
13
+
14
+ | State | Style |
15
+ |-------|-------|
16
+ | Default | `bg` with a 1px `border-strong` border |
17
+ | Hover | `bg-subtle` with a `border-accent` border |
18
+ | Checked | 5px `neutral-900` border on `bg`, popping in with a 200ms scale when selected (not on first render or under reduced motion) |
19
+ | Disabled | `bg-muted` with a `border` border; checked uses a `neutral-400` border |
20
+ | Focus (keyboard) | 1px `cyan-600` ring with a 2px offset |
21
+
22
+ The unchecked border matches the filter controls (`border-strong`). Its contrast against white is about 1.4:1, below the 3:1 that WCAG 1.4.11 asks for non-text UI; this is a deliberate design decision.
23
+
24
+ Use `TelaRadioGroup` (or `TelaRadioGroupRoot` + `TelaRadioGroupItem`) for a group with keyboard navigation. Use `TelaRadioButton` for a single radio controlled by its own boolean `v-model`, usually inside a clickable row.
25
+
10
26
  ## Examples
11
27
 
12
28
  ### With Label
@@ -46,13 +62,13 @@ Radio group component for selecting one option from mutually exclusive choices.
46
62
  <TelaRadioGroupRoot default-value="comfortable">
47
63
  <div class="flex items-center">
48
64
  <TelaRadioGroupItem id="default" value="default" />
49
- <label for="default" class="text-black-900 text-[14px] pl-2 cursor-pointer">
65
+ <label for="default" class="text-primary text-[14px] pl-2 cursor-pointer">
50
66
  Default
51
67
  </label>
52
68
  </div>
53
69
  <div class="flex items-center">
54
70
  <TelaRadioGroupItem id="comfortable" value="comfortable" />
55
- <label for="comfortable" class="text-black-900 text-[14px] pl-2 cursor-pointer">
71
+ <label for="comfortable" class="text-primary text-[14px] pl-2 cursor-pointer">
56
72
  Comfortable
57
73
  </label>
58
74
  </div>
@@ -7,6 +7,8 @@ type Option = {
7
7
  }
8
8
 
9
9
  defineProps<{ class?: HTMLAttributes['class'], options: Option[], defaultValue?: string, orientation?: 'vertical' | 'horizontal' }>()
10
+
11
+ const id = useId()
10
12
  </script>
11
13
 
12
14
  <template>
@@ -16,8 +18,8 @@ defineProps<{ class?: HTMLAttributes['class'], options: Option[], defaultValue?:
16
18
  :key="option.value"
17
19
  class="flex items-center"
18
20
  >
19
- <TelaRadioGroupItem :id="option.value" :value="option.value" />
20
- <label :for="option.value" class="text-gray-900 text-[14px] pl-2 cursor-pointer">{{ option.label }}</label>
21
+ <TelaRadioGroupItem :id="`${id}-${option.value}`" :value="option.value" />
22
+ <label :for="`${id}-${option.value}`" class="text-gray-900 text-[14px] pl-2 cursor-pointer">{{ option.label }}</label>
21
23
  </div>
22
24
  </TelaRadioGroupRoot>
23
25
  </template>
@@ -0,0 +1,15 @@
1
+ import type { VariantType } from 'motion-v'
2
+ import { cva } from 'class-variance-authority'
3
+
4
+ export const radioVariants = cva([
5
+ 'peer aspect-square size-16px shrink-0 rounded-full border-[1px] border-strong bg',
6
+ 'enabled:cursor-pointer enabled:hover:bg-subtle enabled:hover:border-accent',
7
+ 'data-[state=checked]:border-[5px] data-[state=checked]:border-neutral-900 data-[state=checked]:bg enabled:data-[state=checked]:hover:border-neutral-900',
8
+ 'disabled:cursor-not-allowed disabled:border disabled:bg-muted disabled:data-[state=checked]:border-neutral-400',
9
+ 'focus:outline-none focus-visible:ring-1 focus-visible:ring-cyan-600 focus-visible:ring-offset-2',
10
+ ])
11
+
12
+ export const radioMotionVariants: Record<'checked' | 'unchecked', VariantType> = {
13
+ unchecked: { scale: 1, transition: { duration: 0 } },
14
+ checked: { scale: [0.4, 1.1, 1], transition: { duration: 0.2, times: [0, 0.6, 1], ease: 'easeOut' } },
15
+ }
@@ -4,32 +4,32 @@
4
4
  * element with an `origin-[var(--reka-*-content-transform-origin)]` class so
5
5
  * the scale animates from the anchor side.
6
6
  */
7
- .popover-enter-exit[data-state='open'] {
8
- animation: slideDownAndFade 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
7
+ .popover-enter-exit[data-state="open"] {
8
+ animation: slideDownAndFade 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
9
9
  }
10
10
 
11
- .popover-enter-exit[data-state='closed'] {
12
- animation: slideUpAndFade 0.16s cubic-bezier(0.25, 0.46, 0.45, 0.94);
11
+ .popover-enter-exit[data-state="closed"] {
12
+ animation: slideUpAndFade 0.16s cubic-bezier(0.25, 0.46, 0.45, 0.94);
13
13
  }
14
14
 
15
15
  @keyframes slideDownAndFade {
16
- from {
17
- opacity: 0;
18
- transform: scale(0.97);
19
- }
20
- to {
21
- opacity: 1;
22
- transform: scale(1);
23
- }
16
+ from {
17
+ opacity: 0;
18
+ transform: scale(0.97);
19
+ }
20
+ to {
21
+ opacity: 1;
22
+ transform: scale(1);
23
+ }
24
24
  }
25
25
 
26
26
  @keyframes slideUpAndFade {
27
- from {
28
- opacity: 1;
29
- transform: scale(1);
30
- }
31
- to {
32
- opacity: 0;
33
- transform: scale(0.97);
34
- }
27
+ from {
28
+ opacity: 1;
29
+ transform: scale(1);
30
+ }
31
+ to {
32
+ opacity: 0;
33
+ transform: scale(0.97);
34
+ }
35
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.77.3",
3
+ "version": "1.77.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",
package/unocss.config.ts CHANGED
@@ -96,8 +96,8 @@ export default defineConfig({
96
96
  // Catch for `bg-(subtle|muted|lowered|btn-*|success|error|warning)`
97
97
  // Handle bg, bg-subtle, etc. Use bg-background if just 'bg'
98
98
  [/^bg(?:-(subtle|muted|lowered|btn(?:-[a-z]+)*|success|error|warning))?$/, ([_, v]) => v ? `bg-background-${v}` : 'bg-background'],
99
- // Catch for `border-(subtle|strong)`
100
- [/^border(?:-(subtle|strong))?$/, ([_, v]) => v ? `border-border-${v.toLowerCase()}` : 'border-border'],
99
+ // Catch for `border-(subtle|strong|accent)`
100
+ [/^border(?:-(subtle|strong|accent))?$/, ([_, v]) => v ? `border-border-${v.toLowerCase()}` : 'border-border'],
101
101
  ],
102
102
  rules: [
103
103
  [/bg-gradient-(\d+)/, ([_, v]) => ({