@meistrari/tela-build 1.77.2 → 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 +17 -0
- package/components/tela/checkbox/checkbox.vue +12 -5
- package/components/tela/combobox/combobox-list.vue +1 -2
- package/components/tela/date-range-picker.vue +1 -2
- package/components/tela/dropdown-menu/DropdownMenuContent.vue +1 -7
- package/components/tela/filter/filter-content.vue +1 -5
- package/components/tela/filters/date-filter.vue +0 -1
- package/components/tela/menubar/menubar-content.vue +1 -7
- package/components/tela/multiple-select/multiple-select.vue +1 -7
- package/components/tela/radio-button.vue +16 -24
- package/components/tela/radio-group/radio-group-item.vue +15 -18
- package/components/tela/radio-group/radio-group.mdx +18 -2
- package/components/tela/radio-group/radio-group.vue +4 -2
- package/components/tela/radio-group/radio-variants.ts +15 -0
- package/components/tela/select-menu/select-menu-content.vue +2 -3
- package/components/tela/switch/switch.vue +8 -6
- package/components/tela/tags/tags-select.vue +1 -5
- package/components/tela/tooltip/tooltip-content.vue +1 -2
- package/css/animations.css +22 -23
- package/package.json +1 -1
- package/unocss.config.ts +8 -3
- package/utils/design-tokens.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
Latest updates and announcements.
|
|
4
4
|
|
|
5
|
+
## September 30, 2026
|
|
6
|
+
|
|
7
|
+
- [Switch](/components/switch) thumb stretches iOS-style: pressing widens it toward the opposite side (16 → 18px on `sm`, 18 → 20px on `md`), and on release it slides over while settling back to a circle. The stretch is a `scaleX` on the thumb background, so it animates smoothly between pixels and leaves `#thumb` slot content undistorted. Respects `prefers-reduced-motion`. The `md` thumb is now 18px with a 3px inset on every side (was 20px, 2px inset).
|
|
8
|
+
- [Dropdown Menu](/components/dropdown-menu) content now scales in from its trigger. It read the unset `--radix-dropdown-menu-content-transform-origin` variable, so it animated from its center.
|
|
9
|
+
|
|
5
10
|
## September 29, 2026
|
|
6
11
|
|
|
7
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.
|
|
8
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
|
+
|
|
9
18
|
## September 24, 2026
|
|
10
19
|
|
|
11
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).
|
|
@@ -35,6 +44,14 @@ Latest updates and announcements.
|
|
|
35
44
|
|
|
36
45
|
## September 17, 2026
|
|
37
46
|
|
|
47
|
+
### Typography
|
|
48
|
+
|
|
49
|
+
- **Heading semibold is now 520.** `heading-*-semibold` utilities render at font-weight 520 through the new `DT.fontWeight.headingSemibold` token. `body-*-semibold` and `font-semibold` stay at 540. See [Typography](/typography).
|
|
50
|
+
|
|
51
|
+
### Checkbox
|
|
52
|
+
|
|
53
|
+
- **Exit animation.** `TelaCheckbox` now animates when unchecked: the check mark fades out (opacity 1 → 0) while the background and border fade back to the unchecked state. The draw-in animation on check is unchanged. See [Checkbox](/components/checkbox).
|
|
54
|
+
|
|
38
55
|
### Tags
|
|
39
56
|
|
|
40
57
|
- **Delete is an icon button.** In `TelaTagsSelect`'s edit view, delete is now a trash icon button in the header instead of a labeled button, so the `deleteTagLabel` prop was removed. See [Tags Select](/components/tags-select).
|
|
@@ -16,9 +16,9 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
16
16
|
<CheckboxRoot
|
|
17
17
|
v-bind="forwarded"
|
|
18
18
|
:class="cn(
|
|
19
|
-
'grid place-content-center peer w-16px h-16px shrink-0 rounded-5px border-[1px] border-
|
|
20
|
-
'hover:data-[state=unchecked]:bg-
|
|
21
|
-
'disabled:cursor-not-allowed disabled:bg-
|
|
19
|
+
'checkbox grid place-content-center peer w-16px h-16px shrink-0 rounded-5px border-[1px] border-strong bg focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-cyan-600',
|
|
20
|
+
'hover:data-[state=unchecked]:bg-muted data-[state=checked]:border-transparent data-[state=checked]:bg-btn-primary hover:data-[state=checked]:bg-btn-primary-active',
|
|
21
|
+
'disabled:cursor-not-allowed disabled:bg-muted disabled:border disabled:data-[state=checked]:bg-neutral-300',
|
|
22
22
|
props.class,
|
|
23
23
|
)"
|
|
24
24
|
>
|
|
@@ -28,7 +28,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
28
28
|
fill="none"
|
|
29
29
|
stroke-linecap="round"
|
|
30
30
|
stroke-linejoin="round"
|
|
31
|
-
class="shrink-0 stroke-3 stroke-white
|
|
31
|
+
class="shrink-0 stroke-3 stroke-white w-14px h-11px"
|
|
32
32
|
>
|
|
33
33
|
<path
|
|
34
34
|
data-show-icon="true"
|
|
@@ -44,10 +44,17 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
44
44
|
[data-show-icon="true"] {
|
|
45
45
|
stroke-dasharray: 1;
|
|
46
46
|
stroke-dashoffset: 1;
|
|
47
|
-
|
|
47
|
+
opacity: 0;
|
|
48
|
+
transition: opacity 125ms ease-out, stroke-dashoffset 0s linear 125ms;
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
[data-state="checked"] [data-show-icon="true"] {
|
|
51
52
|
stroke-dashoffset: 0;
|
|
53
|
+
opacity: 1;
|
|
54
|
+
transition: stroke-dashoffset 150ms cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.checkbox {
|
|
58
|
+
transition: background-color 125ms ease-out, border-color 125ms ease-out;
|
|
52
59
|
}
|
|
53
60
|
</style>
|
|
@@ -31,7 +31,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
31
31
|
<ComboboxPortal :disabled="props.disablePortal">
|
|
32
32
|
<ComboboxContent
|
|
33
33
|
v-bind="forwarded"
|
|
34
|
-
:class="cn('ComboboxContent popover-enter-exit z-[9999] [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)] overflow-hidden outline-none rounded-[16px] bg border-0.5px border pointer-events-auto', props.class)"
|
|
34
|
+
:class="cn('ComboboxContent popover-enter-exit origin-[var(--reka-combobox-content-transform-origin)] z-[9999] [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)] overflow-hidden outline-none rounded-[16px] bg border-0.5px border pointer-events-auto', props.class)"
|
|
35
35
|
>
|
|
36
36
|
<ComboboxViewport>
|
|
37
37
|
<slot />
|
|
@@ -43,6 +43,5 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
43
43
|
<style>
|
|
44
44
|
.ComboboxContent {
|
|
45
45
|
min-width: var(--reka-combobox-trigger-width);
|
|
46
|
-
transform-origin: var(--reka-combobox-content-transform-origin);
|
|
47
46
|
}
|
|
48
47
|
</style>
|
|
@@ -115,8 +115,7 @@ const defaultLabel = computed(() => {
|
|
|
115
115
|
rounded-xl
|
|
116
116
|
bg-white
|
|
117
117
|
shadow-lg
|
|
118
|
-
class="popover-enter-exit will-change-[transform,opacity]"
|
|
119
|
-
style="transform-origin: var(--reka-date-range-picker-content-transform-origin)"
|
|
118
|
+
class="popover-enter-exit origin-[var(--reka-date-range-picker-content-transform-origin)] will-change-[transform,opacity]"
|
|
120
119
|
>
|
|
121
120
|
<DateRangePickerArrow fill-white />
|
|
122
121
|
<DateRangePickerCalendar
|
|
@@ -30,15 +30,9 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
30
30
|
<DropdownMenuContent
|
|
31
31
|
:data-tela-escape-layer="escapeLayer ? '' : undefined"
|
|
32
32
|
v-bind="forwarded"
|
|
33
|
-
:class="cn('DropdownMenuContent popover-enter-exit z-50 min-w-60 overflow-hidden rounded-2xl border-[0.5px] border-gray-300 bg-white-1000 p-1 shadow-sm', props.class)"
|
|
33
|
+
:class="cn('DropdownMenuContent popover-enter-exit origin-[var(--reka-dropdown-menu-content-transform-origin)] z-50 min-w-60 overflow-hidden rounded-2xl border-[0.5px] border-gray-300 bg-white-1000 p-1 shadow-sm', props.class)"
|
|
34
34
|
>
|
|
35
35
|
<slot />
|
|
36
36
|
</DropdownMenuContent>
|
|
37
37
|
</DropdownMenuPortal>
|
|
38
38
|
</template>
|
|
39
|
-
|
|
40
|
-
<style>
|
|
41
|
-
.DropdownMenuContent {
|
|
42
|
-
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
43
|
-
}
|
|
44
|
-
</style>
|
|
@@ -193,7 +193,7 @@ function getSlideMotionVariants(index: number, closingState: boolean) {
|
|
|
193
193
|
data-popover-content
|
|
194
194
|
:data-settled="settled || undefined"
|
|
195
195
|
:class="cn(
|
|
196
|
-
'relative select-none z-99999 p-4px bg-background border-[0.5px] border-border rounded-12px overflow-hidden',
|
|
196
|
+
'relative origin-[var(--reka-popover-content-transform-origin)] select-none z-99999 p-4px bg-background border-[0.5px] border-border rounded-12px overflow-hidden',
|
|
197
197
|
'[box-shadow:0_3px_10px_0_rgba(163,163,163,0.08),0_12px_20px_0_rgba(163,163,163,0.06)]',
|
|
198
198
|
contentClass,
|
|
199
199
|
)"
|
|
@@ -281,10 +281,6 @@ function getSlideMotionVariants(index: number, closingState: boolean) {
|
|
|
281
281
|
</template>
|
|
282
282
|
|
|
283
283
|
<style>
|
|
284
|
-
[data-popover-content] {
|
|
285
|
-
transform-origin: var(--reka-popover-content-transform-origin);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
284
|
[data-popover-content][data-state="open"] {
|
|
289
285
|
animation: enter 0.12s ease-out forwards;
|
|
290
286
|
}
|
|
@@ -29,7 +29,7 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
29
29
|
v-bind="forwardedProps"
|
|
30
30
|
:class="
|
|
31
31
|
cn(
|
|
32
|
-
'MenubarContent popover-enter-exit z-50 min-w-60 overflow-hidden rounded-2xl border-[0.5px] border-strong bg p-4px',
|
|
32
|
+
'MenubarContent popover-enter-exit origin-[var(--reka-menubar-content-transform-origin)] z-50 min-w-60 overflow-hidden rounded-2xl border-[0.5px] border-strong bg p-4px',
|
|
33
33
|
'[box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]',
|
|
34
34
|
props.class,
|
|
35
35
|
)
|
|
@@ -39,9 +39,3 @@ const forwardedProps = useForwardProps(delegatedProps)
|
|
|
39
39
|
</MenubarContent>
|
|
40
40
|
</Component>
|
|
41
41
|
</template>
|
|
42
|
-
|
|
43
|
-
<style>
|
|
44
|
-
.MenubarContent {
|
|
45
|
-
transform-origin: var(--reka-menubar-content-transform-origin);
|
|
46
|
-
}
|
|
47
|
-
</style>
|
|
@@ -484,7 +484,7 @@ function handleSearchKeydown(e: KeyboardEvent) {
|
|
|
484
484
|
|
|
485
485
|
<SelectPortal>
|
|
486
486
|
<SelectContent
|
|
487
|
-
class="SelectContent popover-enter-exit bg-white rounded-10px"
|
|
487
|
+
class="SelectContent popover-enter-exit origin-[var(--reka-select-content-transform-origin)] bg-white rounded-10px"
|
|
488
488
|
flying-shadow
|
|
489
489
|
b="0.5px border" overflow-hidden
|
|
490
490
|
:side-offset="4"
|
|
@@ -647,9 +647,3 @@ function handleSearchKeydown(e: KeyboardEvent) {
|
|
|
647
647
|
</SelectRoot>
|
|
648
648
|
</div>
|
|
649
649
|
</template>
|
|
650
|
-
|
|
651
|
-
<style>
|
|
652
|
-
.SelectContent {
|
|
653
|
-
transform-origin: var(--reka-select-content-transform-origin);
|
|
654
|
-
}
|
|
655
|
-
</style>
|
|
@@ -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<
|
|
14
|
+
const radioEl = ref<ComponentPublicInstance | null>(null)
|
|
11
15
|
onMounted(() => {
|
|
12
16
|
if (props.autoFocus) {
|
|
13
|
-
radioEl.value
|
|
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
|
-
<
|
|
29
|
+
<Motion
|
|
24
30
|
ref="radioEl"
|
|
31
|
+
as="input"
|
|
25
32
|
type="radio"
|
|
26
33
|
:checked="checked"
|
|
27
34
|
:disabled="disabled"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
:
|
|
31
|
-
|
|
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
|
-
|
|
5
|
+
injectRadioGroupRootContext,
|
|
6
6
|
RadioGroupItem,
|
|
7
7
|
useForwardProps,
|
|
8
8
|
} from 'reka-ui'
|
|
9
|
-
import {
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
cn(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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-
|
|
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-
|
|
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
|
+
}
|
|
@@ -33,7 +33,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
33
33
|
<SelectContent
|
|
34
34
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
35
35
|
:class="cn(
|
|
36
|
-
'SelectContent popover-enter-exit relative z-999 max-h-80 overflow-hidden rounded-[10px] border-0.5px border bg',
|
|
36
|
+
'SelectContent popover-enter-exit origin-[var(--reka-select-content-transform-origin)] relative z-999 max-h-80 overflow-hidden rounded-[10px] border-0.5px border bg',
|
|
37
37
|
props.class,
|
|
38
38
|
)"
|
|
39
39
|
:side-offset="4"
|
|
@@ -49,7 +49,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
49
49
|
v-else
|
|
50
50
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
51
51
|
:class="cn(
|
|
52
|
-
'SelectContent popover-enter-exit relative z-999 max-h-80 overflow-hidden rounded-[16px] border-0.5px border bg',
|
|
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
53
|
props.class,
|
|
54
54
|
)"
|
|
55
55
|
:side-offset="4"
|
|
@@ -65,6 +65,5 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
|
65
65
|
<style>
|
|
66
66
|
.SelectContent {
|
|
67
67
|
min-width: var(--reka-select-trigger-width);
|
|
68
|
-
transform-origin: var(--reka-select-content-transform-origin);
|
|
69
68
|
}
|
|
70
69
|
</style>
|
|
@@ -23,12 +23,12 @@ const resolvedSize = computed(() => props.size || 'sm')
|
|
|
23
23
|
|
|
24
24
|
const sizeStyle = computed(() => (({
|
|
25
25
|
sm: 'w-32px h-20px',
|
|
26
|
-
md: 'w-40px h-24px',
|
|
26
|
+
md: 'w-40px h-24px px-1px',
|
|
27
27
|
}) as Record<SwitchSize, string>)[resolvedSize.value] ?? '')
|
|
28
28
|
|
|
29
29
|
const thumbSizeStyle = computed(() => (({
|
|
30
|
-
sm: 'w-16px h-16px data-[state=checked]:translate-x-3',
|
|
31
|
-
md: 'w-
|
|
30
|
+
sm: 'w-16px h-16px data-[state=checked]:translate-x-3 group-enabled:group-active:before:scale-x-[1.125]',
|
|
31
|
+
md: 'w-18px h-18px data-[state=checked]:translate-x-4 group-enabled:group-active:before:scale-x-[1.111]',
|
|
32
32
|
}) as Record<SwitchSize, string>)[resolvedSize.value] ?? '')
|
|
33
33
|
</script>
|
|
34
34
|
|
|
@@ -36,15 +36,17 @@ const thumbSizeStyle = computed(() => (({
|
|
|
36
36
|
<SwitchRoot
|
|
37
37
|
v-bind="forwarded"
|
|
38
38
|
:class="cn(
|
|
39
|
-
'peer inline-flex w-32px h-20px shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-cyan-600 disabled:cursor-not-allowed disabled:opacity-50',
|
|
40
|
-
'data-[state=unchecked]:bg-
|
|
39
|
+
'group peer inline-flex w-32px h-20px shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-cyan-600 disabled:cursor-not-allowed disabled:opacity-50',
|
|
40
|
+
'data-[state=unchecked]:bg-neutral-200 not-disabled:data-[state=unchecked]:hover:bg-neutral-300 data-[state=checked]:bg-green-500 not-disabled:data-[state=checked]:hover:bg-green-600',
|
|
41
41
|
sizeStyle,
|
|
42
42
|
props.class,
|
|
43
43
|
)"
|
|
44
44
|
>
|
|
45
45
|
<SwitchThumb
|
|
46
46
|
:class="cn(
|
|
47
|
-
'flex items-center justify-center rounded-full
|
|
47
|
+
'relative isolate flex items-center justify-center rounded-full ring-0 transition-[transform,filter] duration-350 ease-[cubic-bezier(0.22,1,0.36,1)] motion-reduce:transition-none data-[state=checked]:drop-shadow-md',
|
|
48
|
+
'before:content-empty before:absolute before:inset-0 before:-z-1 before:rounded-full before:bg before:origin-left data-[state=checked]:before:origin-right',
|
|
49
|
+
'before:transition-[transform,background-color] before:duration-350 before:ease-[cubic-bezier(0.22,1,0.36,1)] group-enabled:group-active:before:duration-160 group-enabled:group-active:before:ease-out motion-reduce:before:transition-none hover:before:bg-muted',
|
|
48
50
|
thumbSizeStyle,
|
|
49
51
|
)"
|
|
50
52
|
>
|
|
@@ -522,7 +522,7 @@ updateAllCreatedTags()
|
|
|
522
522
|
</span>
|
|
523
523
|
</PopoverTrigger>
|
|
524
524
|
<PopoverPortal>
|
|
525
|
-
<PopoverContent class="TagsSelectContent popover-enter-exit z-[99999] relative [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]" :side-offset="4" w-220px pt-12px px-16px bg border-0.5px border rounded-12px overflow-hidden>
|
|
525
|
+
<PopoverContent class="TagsSelectContent popover-enter-exit origin-[var(--reka-popover-content-transform-origin)] z-[99999] relative [box-shadow:0_4px_16px_0_rgba(85,91,98,0.14)]" :side-offset="4" w-220px pt-12px px-16px bg border-0.5px border rounded-12px overflow-hidden>
|
|
526
526
|
<div
|
|
527
527
|
class="[transition:height_0.25s_ease-out]"
|
|
528
528
|
:style="computedHeightContent ? { height: computedHeightContent } : {}"
|
|
@@ -679,8 +679,4 @@ updateAllCreatedTags()
|
|
|
679
679
|
.tags-select-dot-mask:not(:last-child) {
|
|
680
680
|
mask-image: radial-gradient(circle 8px at calc(100% + 2px) center, transparent 8px, #fff 8px);
|
|
681
681
|
}
|
|
682
|
-
|
|
683
|
-
.TagsSelectContent {
|
|
684
|
-
transform-origin: var(--reka-popover-content-transform-origin);
|
|
685
|
-
}
|
|
686
682
|
</style>
|
|
@@ -46,7 +46,7 @@ const isGrouped = computed(() => activeId !== null && activeId.value !== null &&
|
|
|
46
46
|
<TooltipPortal :disabled="disablePortal">
|
|
47
47
|
<TooltipContent
|
|
48
48
|
v-bind="{ ...forwarded, ...$attrs }"
|
|
49
|
-
:class="cn('tooltip-content z-1000 relative rounded-[8px] py-[5px] px-[10px] pointer-events-auto body-12-semibold text-white bg-neutral-800', props.class)"
|
|
49
|
+
:class="cn('tooltip-content origin-[var(--reka-tooltip-content-transform-origin)] z-1000 relative rounded-[8px] py-[5px] px-[10px] pointer-events-auto body-12-semibold text-white bg-neutral-800', props.class)"
|
|
50
50
|
:data-grouped="isGrouped || undefined"
|
|
51
51
|
@click="$emit('click', $event)"
|
|
52
52
|
>
|
|
@@ -57,7 +57,6 @@ const isGrouped = computed(() => activeId !== null && activeId.value !== null &&
|
|
|
57
57
|
|
|
58
58
|
<style>
|
|
59
59
|
.tooltip-content {
|
|
60
|
-
transform-origin: var(--reka-tooltip-content-transform-origin);
|
|
61
60
|
animation: tooltip-in 0.125s ease-out;
|
|
62
61
|
|
|
63
62
|
&[data-state='closed'] {
|
package/css/animations.css
CHANGED
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Shared enter/exit animation for anchored overlay content (popover, combobox,
|
|
3
3
|
* select menu, dropdown, menubar). Add `popover-enter-exit` to the content
|
|
4
|
-
* element
|
|
5
|
-
*
|
|
6
|
-
* anchor side.
|
|
4
|
+
* element with an `origin-[var(--reka-*-content-transform-origin)]` class so
|
|
5
|
+
* the scale animates from the anchor side.
|
|
7
6
|
*/
|
|
8
|
-
.popover-enter-exit[data-state=
|
|
9
|
-
|
|
7
|
+
.popover-enter-exit[data-state="open"] {
|
|
8
|
+
animation: slideDownAndFade 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
.popover-enter-exit[data-state=
|
|
13
|
-
|
|
11
|
+
.popover-enter-exit[data-state="closed"] {
|
|
12
|
+
animation: slideUpAndFade 0.16s cubic-bezier(0.25, 0.46, 0.45, 0.94);
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
@keyframes slideDownAndFade {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
from {
|
|
17
|
+
opacity: 0;
|
|
18
|
+
transform: scale(0.97);
|
|
19
|
+
}
|
|
20
|
+
to {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
transform: scale(1);
|
|
23
|
+
}
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
@keyframes slideUpAndFade {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
from {
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: scale(1);
|
|
30
|
+
}
|
|
31
|
+
to {
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transform: scale(0.97);
|
|
34
|
+
}
|
|
36
35
|
}
|
package/package.json
CHANGED
package/unocss.config.ts
CHANGED
|
@@ -84,15 +84,20 @@ export default defineConfig({
|
|
|
84
84
|
const sizeStyle = `text-size-[${sizeFontSpecs[0]}] leading-${sizeFontSpecs[1]['line-height']} tracking-[${sizeFontSpecs[1]['letter-spacing']}]`
|
|
85
85
|
const isCaption = type === '-caption'
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
// Headings use a lighter semibold than body text
|
|
88
|
+
const fontWeight = tag?.toLowerCase() === 'heading' && weight?.toLowerCase() === 'semibold'
|
|
89
|
+
? DT.fontWeight.headingSemibold
|
|
90
|
+
: weight
|
|
91
|
+
|
|
92
|
+
return `${sizeStyle} font-${fontWeight} ${isCaption ? 'uppercase tracking-0.05em!' : ''}`
|
|
88
93
|
}],
|
|
89
94
|
// Catch for `text-(primary|secondary|tertiary|subtle|contrast|inverse|success|error|warning|pending)`
|
|
90
95
|
[/text-(primary|secondary|tertiary|subtle|contrast|inverse|success|error|warning|pending)/, ([_, v]) => `text-text-${v}`],
|
|
91
96
|
// Catch for `bg-(subtle|muted|lowered|btn-*|success|error|warning)`
|
|
92
97
|
// Handle bg, bg-subtle, etc. Use bg-background if just 'bg'
|
|
93
98
|
[/^bg(?:-(subtle|muted|lowered|btn(?:-[a-z]+)*|success|error|warning))?$/, ([_, v]) => v ? `bg-background-${v}` : 'bg-background'],
|
|
94
|
-
// Catch for `border-(subtle|strong)`
|
|
95
|
-
[/^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'],
|
|
96
101
|
],
|
|
97
102
|
rules: [
|
|
98
103
|
[/bg-gradient-(\d+)/, ([_, v]) => ({
|