@yunlefun/vue 0.4.2 → 0.6.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.
Files changed (75) hide show
  1. package/README.md +6 -0
  2. package/components/YlfAccordion.vue +12 -7
  3. package/components/YlfAgentCard.vue +108 -0
  4. package/components/YlfAgentStatus.vue +69 -0
  5. package/components/YlfAgentTask.vue +85 -0
  6. package/components/YlfButton.vue +145 -28
  7. package/components/YlfCard.vue +10 -4
  8. package/components/YlfCheckbox.vue +70 -7
  9. package/components/YlfCloud.vue +193 -0
  10. package/components/YlfDialog.vue +53 -21
  11. package/components/YlfDropdownMenu.vue +41 -5
  12. package/components/YlfInput.vue +67 -0
  13. package/components/YlfLogo.vue +7 -5
  14. package/components/YlfNavigation.vue +84 -0
  15. package/components/YlfNavigationLink.vue +59 -0
  16. package/components/YlfNavigationTrigger.vue +53 -0
  17. package/components/YlfPopover.vue +43 -7
  18. package/components/YlfRadioGroup.vue +41 -6
  19. package/components/YlfSegmentedControl.vue +80 -10
  20. package/components/YlfSelect.vue +43 -12
  21. package/components/YlfSlider.vue +16 -5
  22. package/components/YlfSwitch.vue +30 -4
  23. package/components/YlfTabs.vue +12 -4
  24. package/components/YlfTooltip.vue +29 -4
  25. package/components/_navigation.scss +38 -0
  26. package/components/accordion/demo.vue +1 -1
  27. package/components/agent-card/demo.vue +17 -0
  28. package/components/agent-card/index.md +25 -0
  29. package/components/agent-status/demo.vue +38 -0
  30. package/components/agent-status/index.md +20 -0
  31. package/components/agent-task/demo.vue +15 -0
  32. package/components/agent-task/index.md +25 -0
  33. package/components/agent.ts +2 -0
  34. package/components/button/demo.vue +21 -0
  35. package/components/button/index.md +20 -11
  36. package/components/cloud/demo.vue +92 -0
  37. package/components/cloud/index.md +66 -0
  38. package/components/cloud.ts +4 -0
  39. package/components/input/demo.vue +22 -0
  40. package/components/input/index.md +19 -0
  41. package/components/navigation/demo.vue +104 -0
  42. package/components/navigation/index.md +90 -0
  43. package/components/navigation-indicator.ts +114 -0
  44. package/dist/ag-ui.cjs +132 -0
  45. package/dist/ag-ui.d.cts +25 -0
  46. package/dist/ag-ui.d.mts +25 -0
  47. package/dist/ag-ui.d.ts +25 -0
  48. package/dist/ag-ui.mjs +130 -0
  49. package/dist/components/YlfAgentCard.vue.d.ts +24 -0
  50. package/dist/components/YlfAgentStatus.vue.d.ts +13 -0
  51. package/dist/components/YlfAgentTask.vue.d.ts +23 -0
  52. package/dist/components/YlfAvatar.vue.d.ts +1 -1
  53. package/dist/components/YlfButton.vue.d.ts +8 -5
  54. package/dist/components/YlfCloud.vue.d.ts +15 -0
  55. package/dist/components/YlfDialog.vue.d.ts +5 -5
  56. package/dist/components/YlfDropdownMenu.vue.d.ts +2 -2
  57. package/dist/components/YlfInput.vue.d.ts +18 -0
  58. package/dist/components/YlfNavigation.vue.d.ts +23 -0
  59. package/dist/components/YlfNavigationLink.vue.d.ts +21 -0
  60. package/dist/components/YlfNavigationTrigger.vue.d.ts +18 -0
  61. package/dist/components/YlfPopover.vue.d.ts +3 -3
  62. package/dist/components/YlfProgress.vue.d.ts +1 -1
  63. package/dist/components/YlfSeparator.vue.d.ts +2 -2
  64. package/dist/components/YlfSwitch.vue.d.ts +1 -1
  65. package/dist/components/YlfTabs.vue.d.ts +3 -3
  66. package/dist/components/YlfTooltip.vue.d.ts +3 -3
  67. package/dist/components/agent.d.ts +2 -0
  68. package/dist/components/cloud.d.ts +3 -0
  69. package/dist/components/navigation-indicator.d.ts +14 -0
  70. package/dist/index.cjs +3 -0
  71. package/dist/index.d.cts +9 -2
  72. package/dist/index.d.mts +9 -2
  73. package/dist/index.d.ts +9 -2
  74. package/dist/index.mjs +3 -1
  75. package/package.json +16 -6
@@ -0,0 +1,84 @@
1
+ <script setup lang="ts">
2
+ import { useTemplateRef } from 'vue'
3
+ import { useNavigationIndicator } from './navigation-indicator'
4
+
5
+ const props = withDefaults(defineProps<{
6
+ /** Accessible name; distinguish multiple navigation landmarks on one page. */
7
+ label: string
8
+ orientation?: 'horizontal' | 'vertical'
9
+ /** Move the shared underline between current links in horizontal navigation. */
10
+ animated?: boolean
11
+ }>(), {
12
+ orientation: 'horizontal',
13
+ animated: true,
14
+ })
15
+
16
+ const root = useTemplateRef<HTMLElement>('root')
17
+ const indicator = useNavigationIndicator(root, {
18
+ links: element => Array.from(element.querySelectorAll<HTMLElement>('.ylf-navigation-link'))
19
+ .filter(link => link.closest('.ylf-navigation') === element),
20
+ active: link => link.hasAttribute('data-active'),
21
+ attributes: ['data-active'],
22
+ enabled: () => props.animated && props.orientation === 'horizontal',
23
+ })
24
+ </script>
25
+
26
+ <template>
27
+ <nav ref="root" class="ylf-navigation" :aria-label="label" :data-orientation="orientation" :data-indicator="indicator ? '' : undefined">
28
+ <slot />
29
+ <span
30
+ v-if="indicator"
31
+ class="ylf-navigation__indicator"
32
+ aria-hidden="true"
33
+ :style="{ transform: `translate(${indicator.x}px, ${indicator.y}px)` }"
34
+ />
35
+ </nav>
36
+ </template>
37
+
38
+ <style lang="scss" scoped>
39
+ .ylf-navigation {
40
+ --_ylf-nav-justify: center;
41
+ --_ylf-nav-active-bg: transparent;
42
+ --_ylf-nav-indicator: block;
43
+
44
+ position: relative;
45
+ display: flex;
46
+ flex-wrap: wrap;
47
+ align-items: center;
48
+ gap: var(--ylf-space-2, 8px);
49
+ min-width: 0;
50
+
51
+ &[data-indicator] {
52
+ --_ylf-nav-indicator: none;
53
+ }
54
+
55
+ &__indicator {
56
+ position: absolute;
57
+ top: 0;
58
+ left: 0;
59
+ width: 16px;
60
+ height: 2px;
61
+ border-radius: var(--ylf-radius-pill, 999px);
62
+ background: var(--ylf-c-brand, #2563eb);
63
+ pointer-events: none;
64
+ transition: transform var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease);
65
+ }
66
+
67
+ &[data-orientation='vertical'] {
68
+ --_ylf-nav-justify: flex-start;
69
+ --_ylf-nav-active-bg: var(--ylf-c-brand-soft, #eff6ff);
70
+ --_ylf-nav-indicator: none;
71
+
72
+ flex-direction: column;
73
+ flex-wrap: nowrap;
74
+ align-items: stretch;
75
+ gap: var(--ylf-space-1, 4px);
76
+ }
77
+ }
78
+
79
+ @media (prefers-reduced-motion: reduce) {
80
+ .ylf-navigation__indicator {
81
+ transition: none;
82
+ }
83
+ }
84
+ </style>
@@ -0,0 +1,59 @@
1
+ <script setup lang="ts">
2
+ import { Primitive } from 'reka-ui'
3
+
4
+ withDefaults(defineProps<{
5
+ active?: boolean
6
+ /** Merge attributes onto one child anchor, e.g. NuxtLink or RouterLink. */
7
+ asChild?: boolean
8
+ }>(), {
9
+ active: false,
10
+ asChild: false,
11
+ })
12
+ </script>
13
+
14
+ <template>
15
+ <Primitive
16
+ as="a"
17
+ :as-child="asChild"
18
+ class="ylf-navigation-link"
19
+ :aria-current="active ? 'page' : undefined"
20
+ :data-active="active ? '' : undefined"
21
+ >
22
+ <slot />
23
+ </Primitive>
24
+ </template>
25
+
26
+ <style lang="scss" scoped>
27
+ @use './navigation' as navigation;
28
+
29
+ .ylf-navigation-link {
30
+ @include navigation.control;
31
+
32
+ position: relative;
33
+ justify-content: var(--_ylf-nav-justify, center);
34
+ min-width: 60px;
35
+ padding: var(--ylf-space-2, 8px) var(--ylf-space-4, 16px);
36
+
37
+ &[data-active] {
38
+ background: var(--_ylf-nav-active-bg, transparent);
39
+ color: var(--ylf-c-brand, #2563eb);
40
+
41
+ &::after {
42
+ position: absolute;
43
+ display: var(--_ylf-nav-indicator, block);
44
+ bottom: 4px;
45
+ inset-inline-start: calc(50% - 8px);
46
+ width: 16px;
47
+ height: 2px;
48
+ border-radius: var(--ylf-radius-pill, 999px);
49
+ background: currentColor;
50
+ content: '';
51
+ }
52
+
53
+ &:hover {
54
+ background: var(--ylf-c-bg-soft, #f1f5f9);
55
+ color: var(--ylf-c-brand, #2563eb);
56
+ }
57
+ }
58
+ }
59
+ </style>
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ withDefaults(defineProps<{
3
+ disabled?: boolean
4
+ }>(), {
5
+ disabled: false,
6
+ })
7
+ </script>
8
+
9
+ <template>
10
+ <button type="button" class="ylf-navigation-trigger" :disabled="disabled">
11
+ <slot />
12
+ <svg class="ylf-navigation-trigger__chevron" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
13
+ <path d="m6 9 6 6 6-6" />
14
+ </svg>
15
+ </button>
16
+ </template>
17
+
18
+ <style lang="scss" scoped>
19
+ @use './navigation' as navigation;
20
+
21
+ .ylf-navigation-trigger {
22
+ @include navigation.control;
23
+
24
+ justify-content: center;
25
+ padding: var(--ylf-space-2, 8px) var(--ylf-space-3, 12px);
26
+
27
+ &[aria-expanded='true'] {
28
+ background: var(--ylf-c-bg-soft, #f1f5f9);
29
+ color: var(--ylf-c-text, #0f172a);
30
+ }
31
+
32
+ &:disabled {
33
+ opacity: 0.5;
34
+ cursor: not-allowed;
35
+ }
36
+
37
+ &__chevron {
38
+ flex: none;
39
+ color: var(--ylf-c-text-3, #5c6b80);
40
+ transition: transform var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease);
41
+ }
42
+
43
+ &[aria-expanded='true'] &__chevron {
44
+ transform: rotate(180deg);
45
+ }
46
+ }
47
+
48
+ @media (prefers-reduced-motion: reduce) {
49
+ .ylf-navigation-trigger__chevron {
50
+ transition: none;
51
+ }
52
+ }
53
+ </style>
@@ -21,8 +21,10 @@ const open = defineModel<boolean>('open', { default: false })
21
21
  <slot name="trigger" />
22
22
  </PopoverTrigger>
23
23
  <PopoverPortal :to="portalTo">
24
- <PopoverContent v-bind="$attrs" :side="side" :align="align" :side-offset="8" class="ylf-popover">
25
- <slot />
24
+ <PopoverContent v-bind="$attrs" :side="side" :align="align" :side-offset="8" :collision-padding="16" class="ylf-popover">
25
+ <div class="ylf-popover__body">
26
+ <slot />
27
+ </div>
26
28
  <PopoverArrow class="ylf-popover__arrow" :width="12" :height="6" />
27
29
  </PopoverContent>
28
30
  </PopoverPortal>
@@ -32,8 +34,12 @@ const open = defineModel<boolean>('open', { default: false })
32
34
  <style lang="scss">
33
35
  .ylf-popover {
34
36
  z-index: 105;
35
- min-width: 180px;
36
- max-width: 320px;
37
+ box-sizing: border-box;
38
+ min-width: min(180px, var(--reka-popover-content-available-width, 100vw));
39
+ max-width: min(320px, var(--reka-popover-content-available-width, calc(100vw - 32px)));
40
+ max-height: var(--reka-popover-content-available-height, calc(100dvh - 32px));
41
+ overflow-wrap: anywhere;
42
+ overscroll-behavior: contain;
37
43
  padding: 16px;
38
44
  color: var(--ylf-c-text, #0f172a);
39
45
  background: var(--ylf-c-panel, var(--ylf-c-surface, #fff));
@@ -44,7 +50,30 @@ const open = defineModel<boolean>('open', { default: false })
44
50
  transform-origin: var(--reka-popover-content-transform-origin);
45
51
 
46
52
  &[data-state='open'] {
47
- animation: ylf-popover-in 0.18s var(--ylf-ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
53
+ animation: ylf-popover-in var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, ease);
54
+ }
55
+
56
+ &[data-state='closed'] {
57
+ animation: ylf-popover-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, ease);
58
+ }
59
+
60
+ &[data-side='bottom'] {
61
+ --_enter-y: -4px;
62
+ }
63
+ &[data-side='top'] {
64
+ --_enter-y: 4px;
65
+ }
66
+ &[data-side='left'] {
67
+ --_enter-x: 4px;
68
+ }
69
+ &[data-side='right'] {
70
+ --_enter-x: -4px;
71
+ }
72
+
73
+ &__body {
74
+ max-height: calc(var(--reka-popover-content-available-height, calc(100dvh - 32px)) - 34px);
75
+ overflow: auto;
76
+ overscroll-behavior: contain;
48
77
  }
49
78
 
50
79
  &__arrow {
@@ -56,12 +85,19 @@ const open = defineModel<boolean>('open', { default: false })
56
85
  @keyframes ylf-popover-in {
57
86
  from {
58
87
  opacity: 0;
59
- transform: scale(0.96);
88
+ transform: translate(var(--_enter-x, 0), var(--_enter-y, 0)) scale(0.96);
89
+ }
90
+ }
91
+
92
+ @keyframes ylf-popover-out {
93
+ to {
94
+ opacity: 0;
95
+ transform: scale(0.97);
60
96
  }
61
97
  }
62
98
 
63
99
  @media (prefers-reduced-motion: reduce) {
64
- .ylf-popover[data-state='open'] {
100
+ .ylf-popover[data-state] {
65
101
  animation: none;
66
102
  }
67
103
  }
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  // 行为 / 可访问性由 reka-ui 提供(role=radiogroup、方向键 roving focus);皮肤走 token。
3
3
  import { RadioGroupIndicator, RadioGroupItem, RadioGroupRoot } from 'reka-ui'
4
- import { nextTick } from 'vue'
4
+ import { nextTick, shallowRef, watch } from 'vue'
5
5
 
6
6
  interface RadioOption {
7
7
  label: string
@@ -19,6 +19,11 @@ const props = withDefaults(defineProps<{
19
19
  })
20
20
 
21
21
  const model = defineModel<string>()
22
+ // 只在选择变化后让圆点弹出,首屏默认选项保持静止。
23
+ const animated = shallowRef(false)
24
+ watch(model, () => {
25
+ animated.value = true
26
+ })
22
27
 
23
28
  function selectFocusedRadio(event: KeyboardEvent) {
24
29
  if (props.disabled || !event.defaultPrevented || !['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key))
@@ -43,7 +48,7 @@ function selectFocusedRadio(event: KeyboardEvent) {
43
48
  :disabled="disabled"
44
49
  :orientation="orientation"
45
50
  class="ylf-radio-group"
46
- :class="`ylf-radio-group--${orientation}`"
51
+ :class="[`ylf-radio-group--${orientation}`, { 'is-animated': animated }]"
47
52
  @keydown="selectFocusedRadio"
48
53
  >
49
54
  <RadioGroupItem
@@ -99,12 +104,15 @@ function selectFocusedRadio(event: KeyboardEvent) {
99
104
  background: var(--ylf-c-surface, #fff);
100
105
  box-shadow: var(--ylf-shadow-control);
101
106
  transition:
102
- border-color 0.18s ease,
103
- box-shadow 0.2s ease;
107
+ border-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease),
108
+ box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease),
109
+ transform var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease));
104
110
  }
105
111
 
106
- &:hover:not([data-disabled]) .ylf-radio__control {
107
- border-color: var(--ylf-c-brand, #2563eb);
112
+ @media (hover: hover) and (pointer: fine) {
113
+ &:hover:not([data-disabled]) .ylf-radio__control {
114
+ border-color: var(--ylf-c-brand, #2563eb);
115
+ }
108
116
  }
109
117
 
110
118
  &:focus-visible {
@@ -134,8 +142,35 @@ function selectFocusedRadio(event: KeyboardEvent) {
134
142
  background: var(--ylf-c-brand, #2563eb);
135
143
  }
136
144
 
145
+ &:active:not([data-disabled]) .ylf-radio__control {
146
+ transform: scale(0.9);
147
+ transition-duration: var(--ylf-duration-press, 100ms);
148
+ }
149
+
137
150
  &__label {
138
151
  font-size: 15px;
139
152
  }
140
153
  }
154
+ .ylf-radio-group.is-animated .ylf-radio__dot {
155
+ animation: ylf-radio-dot var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease));
156
+ }
157
+ @keyframes ylf-radio-dot {
158
+ from {
159
+ transform: scale(0);
160
+ }
161
+ }
162
+ @media (prefers-reduced-motion: reduce) {
163
+ .ylf-radio-group.is-animated .ylf-radio__dot {
164
+ animation: none;
165
+ }
166
+ .ylf-radio__control {
167
+ transition: none;
168
+ }
169
+ }
170
+ @media (pointer: coarse) {
171
+ .ylf-radio {
172
+ min-width: var(--ylf-touch-target, 44px);
173
+ min-height: var(--ylf-touch-target, 44px);
174
+ }
175
+ }
141
176
  </style>
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts" generic="T extends string = string">
2
2
  import type { YlfSegmentedOption } from './segmented-control'
3
3
  import { ToggleGroupItem, ToggleGroupRoot } from 'reka-ui'
4
+ import { nextTick, onBeforeUnmount, onMounted, shallowRef, useTemplateRef, watch } from 'vue'
4
5
  import YlfTooltip from './YlfTooltip.vue'
5
6
 
6
7
  const props = withDefaults(defineProps<{
@@ -26,11 +27,42 @@ function updateValue(value: unknown): void {
26
27
  if (!props.disabled && option && !option.disabled)
27
28
  model.value = option.value
28
29
  }
30
+
31
+ // 选中胶囊在选项间滑动;首次定位不带过渡,之后的切换才用弹簧。
32
+ const root = useTemplateRef<{ $el: HTMLElement }>('root')
33
+ const pill = shallowRef<{ x: number, y: number, width: number, height: number } | null>(null)
34
+ const pillAnimated = shallowRef(false)
35
+ let resizeObserver: ResizeObserver | undefined
36
+
37
+ function measurePill() {
38
+ const item = root.value?.$el?.querySelector<HTMLElement>('.ylf-segmented__item[aria-pressed="true"]')
39
+ pill.value = item?.offsetWidth
40
+ ? { x: item.offsetLeft, y: item.offsetTop, width: item.offsetWidth, height: item.offsetHeight }
41
+ : null
42
+ }
43
+
44
+ watch(model, async () => {
45
+ await nextTick()
46
+ measurePill()
47
+ })
48
+ onMounted(() => {
49
+ measurePill()
50
+ requestAnimationFrame(() => {
51
+ pillAnimated.value = true
52
+ })
53
+ if (typeof ResizeObserver !== 'undefined' && root.value?.$el) {
54
+ resizeObserver = new ResizeObserver(measurePill)
55
+ resizeObserver.observe(root.value.$el)
56
+ }
57
+ })
58
+ onBeforeUnmount(() => resizeObserver?.disconnect())
29
59
  </script>
30
60
 
31
61
  <template>
32
62
  <ToggleGroupRoot
63
+ ref="root"
33
64
  class="ylf-segmented"
65
+ :class="{ 'has-pill': pill, 'is-pill-animated': pillAnimated }"
34
66
  :data-size="size"
35
67
  :data-icon-only="iconOnly || undefined"
36
68
  type="single"
@@ -40,6 +72,12 @@ function updateValue(value: unknown): void {
40
72
  :model-value="model"
41
73
  @update:model-value="updateValue"
42
74
  >
75
+ <span
76
+ v-if="pill"
77
+ class="ylf-segmented__pill"
78
+ aria-hidden="true"
79
+ :style="{ width: `${pill.width}px`, height: `${pill.height}px`, transform: `translate(${pill.x}px, ${pill.y}px)` }"
80
+ />
43
81
  <YlfTooltip v-for="option in options" :key="option.value" :content="option.label" :disabled="!iconOnly || disabled || option.disabled">
44
82
  <ToggleGroupItem
45
83
  class="ylf-segmented__item"
@@ -60,6 +98,8 @@ function updateValue(value: unknown): void {
60
98
  <style>
61
99
  .ylf-segmented {
62
100
  --ylf-segmented-item-size: 36px;
101
+ position: relative;
102
+ isolation: isolate;
63
103
  display: inline-flex;
64
104
  align-items: center;
65
105
  flex: none;
@@ -82,10 +122,10 @@ function updateValue(value: unknown): void {
82
122
  display: inline-flex;
83
123
  align-items: center;
84
124
  justify-content: center;
85
- flex: 0 0 auto;
125
+ flex: 1 1 auto;
86
126
  box-sizing: border-box;
87
127
  min-width: var(--ylf-segmented-item-size);
88
- height: var(--ylf-segmented-item-size);
128
+ min-height: var(--ylf-segmented-item-size);
89
129
  gap: 6px;
90
130
  padding: 0 10px;
91
131
  border: 1px solid transparent;
@@ -95,8 +135,9 @@ function updateValue(value: unknown): void {
95
135
  font: inherit;
96
136
  font-size: var(--ylf-text-sm, 14px);
97
137
  font-weight: 500;
98
- line-height: 1;
99
- white-space: nowrap;
138
+ line-height: 1.4;
139
+ white-space: normal;
140
+ overflow-wrap: anywhere;
100
141
  cursor: pointer;
101
142
  transition:
102
143
  background var(--ylf-duration-fast, 160ms),
@@ -114,9 +155,11 @@ function updateValue(value: unknown): void {
114
155
  padding: 0;
115
156
  }
116
157
 
117
- .ylf-segmented__item:hover:not([data-disabled], [aria-pressed='true']) {
118
- color: var(--ylf-c-text, #0f172a);
119
- background: color-mix(in srgb, var(--ylf-c-surface, #fff) 60%, transparent);
158
+ @media (hover: hover) and (pointer: fine) {
159
+ .ylf-segmented__item:hover:not([data-disabled], [aria-pressed='true']) {
160
+ color: var(--ylf-c-text, #0f172a);
161
+ background: color-mix(in srgb, var(--ylf-c-surface, #fff) 60%, transparent);
162
+ }
120
163
  }
121
164
 
122
165
  .ylf-segmented__item[aria-pressed='true'] {
@@ -126,6 +169,32 @@ function updateValue(value: unknown): void {
126
169
  box-shadow: var(--ylf-shadow-control, var(--ylf-shadow-sm));
127
170
  }
128
171
 
172
+ .ylf-segmented__pill {
173
+ position: absolute;
174
+ top: 0;
175
+ left: 0;
176
+ z-index: -1;
177
+ box-sizing: border-box;
178
+ border: 1px solid var(--ylf-c-border, #e2e8f0);
179
+ border-radius: calc(var(--ylf-radius-sm, 10px) - 4px);
180
+ background: var(--ylf-c-surface, #fff);
181
+ box-shadow: var(--ylf-shadow-control, var(--ylf-shadow-sm));
182
+ pointer-events: none;
183
+ }
184
+
185
+ .ylf-segmented.is-pill-animated .ylf-segmented__pill {
186
+ transition:
187
+ transform var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease)),
188
+ width var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease),
189
+ height var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, ease);
190
+ }
191
+
192
+ .ylf-segmented.has-pill .ylf-segmented__item[aria-pressed='true'] {
193
+ border-color: transparent;
194
+ background: transparent;
195
+ box-shadow: none;
196
+ }
197
+
129
198
  .ylf-segmented__item:focus-visible {
130
199
  position: relative;
131
200
  z-index: 1;
@@ -168,13 +237,14 @@ function updateValue(value: unknown): void {
168
237
 
169
238
  @media (pointer: coarse) {
170
239
  .ylf-segmented .ylf-segmented__item {
171
- min-width: 44px;
172
- min-height: 44px;
240
+ min-width: var(--ylf-touch-target, 44px);
241
+ min-height: var(--ylf-touch-target, 44px);
173
242
  }
174
243
  }
175
244
 
176
245
  @media (prefers-reduced-motion: reduce) {
177
- .ylf-segmented__item {
246
+ .ylf-segmented__item,
247
+ .ylf-segmented.is-pill-animated .ylf-segmented__pill {
178
248
  transition: none;
179
249
  }
180
250
  }
@@ -43,7 +43,7 @@ const selectedOption = computed(() => props.options.find(option => option.value
43
43
  </SelectIcon>
44
44
  </SelectTrigger>
45
45
  <SelectPortal :to="portalTo">
46
- <SelectContent class="ylf-select__content" :data-size="size" position="popper" :side-offset="6">
46
+ <SelectContent class="ylf-select__content" :data-size="size" position="popper" :side-offset="6" :collision-padding="16">
47
47
  <SelectViewport class="ylf-select__viewport">
48
48
  <SelectItem
49
49
  v-for="o in options"
@@ -76,7 +76,9 @@ const selectedOption = computed(() => props.options.find(option => option.value
76
76
  align-items: center;
77
77
  justify-content: space-between;
78
78
  gap: 8px;
79
- min-width: 180px;
79
+ box-sizing: border-box;
80
+ max-width: 100%;
81
+ min-width: min(180px, 100%);
80
82
  min-height: 44px;
81
83
  padding: 10px 14px;
82
84
  font-family: inherit;
@@ -89,15 +91,17 @@ const selectedOption = computed(() => props.options.find(option => option.value
89
91
  box-shadow: var(--ylf-shadow-control);
90
92
  cursor: pointer;
91
93
  transition:
92
- border-color 0.18s ease,
93
- box-shadow 0.2s ease;
94
+ border-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease),
95
+ box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease);
94
96
 
95
97
  &[data-placeholder] {
96
98
  color: var(--ylf-c-text-3, #64748b);
97
99
  }
98
100
 
99
- &:hover:not([data-disabled]) {
100
- border-color: var(--ylf-c-brand, #2563eb);
101
+ @media (hover: hover) and (pointer: fine) {
102
+ &:hover:not([data-disabled]) {
103
+ border-color: var(--ylf-c-brand, #2563eb);
104
+ }
101
105
  }
102
106
 
103
107
  &[data-state='open'] {
@@ -124,6 +128,7 @@ const selectedOption = computed(() => props.options.find(option => option.value
124
128
  align-items: center;
125
129
  gap: 8px;
126
130
  min-width: 0;
131
+ overflow-wrap: anywhere;
127
132
  }
128
133
 
129
134
  .ylf-select__swatch {
@@ -166,7 +171,24 @@ const selectedOption = computed(() => props.options.find(option => option.value
166
171
  transform-origin: var(--reka-select-content-transform-origin);
167
172
 
168
173
  &[data-state='open'] {
169
- animation: ylf-select-in 0.16s ease;
174
+ animation: ylf-select-in var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, ease);
175
+ }
176
+
177
+ &[data-state='closed'] {
178
+ animation: ylf-select-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, ease);
179
+ }
180
+
181
+ &[data-side='bottom'] {
182
+ --_enter-y: -4px;
183
+ }
184
+ &[data-side='top'] {
185
+ --_enter-y: 4px;
186
+ }
187
+ &[data-side='left'] {
188
+ --_enter-x: 4px;
189
+ }
190
+ &[data-side='right'] {
191
+ --_enter-x: -4px;
170
192
  }
171
193
  }
172
194
 
@@ -225,24 +247,33 @@ const selectedOption = computed(() => props.options.find(option => option.value
225
247
  }
226
248
 
227
249
  @media (pointer: coarse) {
228
- .ylf-select__trigger[data-size='sm'],
229
- .ylf-select__content[data-size='sm'] .ylf-select__item {
230
- min-height: 44px;
250
+ .ylf-select__trigger[data-size],
251
+ .ylf-select__content[data-size] .ylf-select__item {
252
+ box-sizing: border-box;
253
+ min-height: var(--ylf-touch-target, 44px);
231
254
  }
232
255
  }
233
256
 
234
257
  @keyframes ylf-select-in {
235
258
  from {
236
259
  opacity: 0;
237
- transform: scale(0.96);
260
+ transform: translate(var(--_enter-x, 0), var(--_enter-y, 0)) scale(0.96);
261
+ }
262
+ }
263
+
264
+ @keyframes ylf-select-out {
265
+ to {
266
+ opacity: 0;
267
+ transform: scale(0.97);
238
268
  }
239
269
  }
240
270
 
241
271
  @media (prefers-reduced-motion: reduce) {
242
- .ylf-select__content[data-state='open'] {
272
+ .ylf-select__content[data-state] {
243
273
  animation: none;
244
274
  }
245
275
 
276
+ .ylf-select__trigger,
246
277
  .ylf-select__icon,
247
278
  .ylf-select__item {
248
279
  transition: none;
@@ -74,6 +74,7 @@ const model = defineModel<number[]>({ default: () => [50] })
74
74
  }
75
75
 
76
76
  &__thumb {
77
+ position: relative;
77
78
  display: block;
78
79
  width: 18px;
79
80
  height: 18px;
@@ -82,10 +83,14 @@ const model = defineModel<number[]>({ default: () => [50] })
82
83
  border: 2px solid var(--ylf-c-brand, #2563eb);
83
84
  box-shadow: var(--ylf-shadow-sm, 0 2px 8px -2px rgba(15, 23, 42, 0.12));
84
85
  cursor: grab;
85
- transition: box-shadow 0.2s ease;
86
+ transition:
87
+ box-shadow var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, ease),
88
+ scale var(--ylf-duration-slow, 480ms) var(--ylf-ease-spring, var(--ylf-ease-standard, ease));
86
89
 
87
- &:hover {
88
- box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #eff6ff);
90
+ @media (hover: hover) and (pointer: fine) {
91
+ &:hover {
92
+ box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #eff6ff);
93
+ }
89
94
  }
90
95
 
91
96
  &:focus-visible {
@@ -95,18 +100,24 @@ const model = defineModel<number[]>({ default: () => [50] })
95
100
 
96
101
  &:active {
97
102
  cursor: grabbing;
103
+ scale: 1.2;
104
+ box-shadow: 0 0 0 6px var(--ylf-c-brand-soft, #eff6ff);
98
105
  }
99
106
  }
100
107
  }
101
108
 
102
109
  @media (pointer: coarse) {
103
110
  .ylf-slider {
104
- height: 44px;
111
+ height: var(--ylf-touch-target, 44px);
105
112
  }
106
113
 
107
114
  .ylf-slider__thumb::before {
108
115
  position: absolute;
109
- inset: -13px;
116
+ top: 50%;
117
+ left: 50%;
118
+ width: max(100%, var(--ylf-touch-target, 44px));
119
+ height: max(100%, var(--ylf-touch-target, 44px));
120
+ transform: translate(-50%, -50%);
110
121
  content: '';
111
122
  }
112
123
  }