@yunlefun/vue 0.7.0 → 0.8.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 (74) hide show
  1. package/README.md +5 -6
  2. package/components/YlfAccordion.vue +30 -29
  3. package/components/YlfAgentCard.vue +4 -4
  4. package/components/YlfAgentStatus.vue +1 -1
  5. package/components/YlfAgentTask.vue +4 -4
  6. package/components/YlfAiPromptLauncher.vue +18 -8
  7. package/components/YlfAvatar.vue +30 -30
  8. package/components/YlfBadge.vue +92 -73
  9. package/components/YlfBottomMenu.vue +5 -5
  10. package/components/YlfBottomMenuItem.vue +15 -15
  11. package/components/YlfButton.vue +300 -265
  12. package/components/YlfCard.vue +32 -32
  13. package/components/YlfCheckbox.vue +61 -54
  14. package/components/YlfCloud.vue +5 -18
  15. package/components/YlfDialog.vue +47 -46
  16. package/components/YlfDropdownMenu.vue +55 -57
  17. package/components/YlfInput.vue +22 -15
  18. package/components/YlfLogo.vue +58 -42
  19. package/components/YlfNavigation.vue +24 -24
  20. package/components/YlfNavigationLink.vue +58 -25
  21. package/components/YlfNavigationTrigger.vue +49 -21
  22. package/components/YlfPopover.vue +34 -31
  23. package/components/YlfProgress.vue +10 -6
  24. package/components/YlfRadioGroup.vue +73 -58
  25. package/components/YlfScrollFade.vue +1 -1
  26. package/components/YlfSegmentedControl.vue +21 -15
  27. package/components/YlfSelect.vue +81 -77
  28. package/components/YlfSeparator.vue +31 -26
  29. package/components/YlfSlider.vue +49 -46
  30. package/components/YlfSwitch.vue +67 -64
  31. package/components/YlfTabs.vue +30 -28
  32. package/components/YlfTooltip.vue +30 -27
  33. package/components/ai-prompt.ts +33 -6
  34. package/components/cloud.ts +21 -1
  35. package/components/navigation-indicator.ts +9 -3
  36. package/components/scroll-fade.ts +3 -1
  37. package/components/segmented-control/demo.vue +9 -2
  38. package/dist/ag-ui.cjs +11 -2
  39. package/dist/ag-ui.mjs +11 -2
  40. package/dist/ai-prompt.cjs +30 -5
  41. package/dist/ai-prompt.mjs +30 -5
  42. package/dist/components/YlfAccordion.vue.d.ts +5 -3
  43. package/dist/components/YlfAgentCard.vue.d.ts +9 -7
  44. package/dist/components/YlfAgentTask.vue.d.ts +7 -5
  45. package/dist/components/YlfBadge.vue.d.ts +5 -4
  46. package/dist/components/YlfBottomMenu.vue.d.ts +5 -3
  47. package/dist/components/YlfBottomMenuItem.vue.d.ts +5 -3
  48. package/dist/components/YlfButton.vue.d.ts +7 -6
  49. package/dist/components/YlfCard.vue.d.ts +5 -4
  50. package/dist/components/YlfDialog.vue.d.ts +11 -9
  51. package/dist/components/YlfDropdownMenu.vue.d.ts +5 -3
  52. package/dist/components/YlfNavigation.vue.d.ts +5 -3
  53. package/dist/components/YlfNavigationLink.vue.d.ts +5 -3
  54. package/dist/components/YlfNavigationTrigger.vue.d.ts +5 -3
  55. package/dist/components/YlfPopover.vue.d.ts +7 -5
  56. package/dist/components/YlfProgress.vue.d.ts +0 -1
  57. package/dist/components/YlfScrollFade.vue.d.ts +5 -3
  58. package/dist/components/YlfSeparator.vue.d.ts +0 -1
  59. package/dist/components/YlfSwitch.vue.d.ts +0 -1
  60. package/dist/components/YlfTabs.vue.d.ts +5 -3
  61. package/dist/components/YlfTooltip.vue.d.ts +7 -5
  62. package/dist/components/cloud.d.ts +2 -0
  63. package/dist/index.cjs +20 -10
  64. package/dist/index.d.cts +3 -4
  65. package/dist/index.d.mts +3 -4
  66. package/dist/index.d.ts +3 -4
  67. package/dist/index.mjs +20 -8
  68. package/dist/node.cjs +11 -0
  69. package/dist/node.d.cts +4 -0
  70. package/dist/node.d.mts +4 -0
  71. package/dist/node.d.ts +4 -0
  72. package/dist/node.mjs +7 -0
  73. package/package.json +6 -3
  74. package/components/_navigation.scss +0 -38
@@ -26,63 +26,79 @@ const viewBox = `0 0 ${mark.width || icons.width || 16} ${mark.height || icons.h
26
26
  </div>
27
27
  </template>
28
28
 
29
- <style lang="scss">
29
+ <style>
30
30
  .ylf-logo {
31
31
  display: inline-flex;
32
32
  align-items: center;
33
33
  gap: 10px;
34
34
  cursor: default;
35
35
  line-height: 1;
36
+ }
36
37
 
37
- &--vertical {
38
- flex-direction: column;
39
- gap: 8px;
40
- }
38
+ .ylf-logo--vertical {
39
+ flex-direction: column;
40
+ gap: 8px;
41
+ }
41
42
 
42
- &__mark {
43
- flex: none;
44
- display: grid;
45
- place-items: center;
46
- color: var(--ylf-c-brand, #2563eb);
43
+ .ylf-logo__mark {
44
+ flex: none;
45
+ display: grid;
46
+ place-items: center;
47
+ color: var(--ylf-c-brand, #2563eb);
48
+ }
47
49
 
48
- svg {
49
- width: 100%;
50
- height: 100%;
51
- }
52
- }
50
+ .ylf-logo__mark svg {
51
+ width: 100%;
52
+ height: 100%;
53
+ }
53
54
 
54
- &__name {
55
- font-family: var(--ylf-font-wordmark, var(--ylf-font-display, sans-serif));
56
- font-weight: 700;
57
- color: var(--ylf-c-text, #0f172a);
58
- }
55
+ .ylf-logo__name {
56
+ font-family: var(
57
+ --ylf-font-wordmark,
58
+ var(
59
+ --ylf-font-display,
60
+ 'Baloo 2',
61
+ 'ZCOOL KuaiLe',
62
+ ui-rounded,
63
+ 'Hiragino Maru Gothic ProN',
64
+ 'Hiragino Maru Gothic Pro',
65
+ 'PingFang SC',
66
+ 'Hiragino Sans GB',
67
+ 'Microsoft YaHei',
68
+ '微软雅黑',
69
+ 'Source Han Sans SC',
70
+ sans-serif
71
+ )
72
+ );
73
+ font-weight: 700;
74
+ color: var(--ylf-c-text, #0f172a);
75
+ }
59
76
 
60
- // sizes
61
- &--sm &__mark {
62
- width: 36px;
63
- height: 25.2px;
64
- }
77
+ /* sizes */
78
+ .ylf-logo--sm .ylf-logo__mark {
79
+ width: 36px;
80
+ height: 25.2px;
81
+ }
65
82
 
66
- &--sm &__name {
67
- font-size: 18px;
68
- }
83
+ .ylf-logo--sm .ylf-logo__name {
84
+ font-size: 18px;
85
+ }
69
86
 
70
- &--md &__mark {
71
- width: 48px;
72
- height: 33.6px;
73
- }
87
+ .ylf-logo--md .ylf-logo__mark {
88
+ width: 48px;
89
+ height: 33.6px;
90
+ }
74
91
 
75
- &--md &__name {
76
- font-size: 24px;
77
- }
92
+ .ylf-logo--md .ylf-logo__name {
93
+ font-size: 24px;
94
+ }
78
95
 
79
- &--lg &__mark {
80
- width: 72px;
81
- height: 50.4px;
82
- }
96
+ .ylf-logo--lg .ylf-logo__mark {
97
+ width: 72px;
98
+ height: 50.4px;
99
+ }
83
100
 
84
- &--lg &__name {
85
- font-size: 34px;
86
- }
101
+ .ylf-logo--lg .ylf-logo__name {
102
+ font-size: 34px;
87
103
  }
88
104
  </style>
@@ -35,7 +35,7 @@ const indicator = useNavigationIndicator(root, {
35
35
  </nav>
36
36
  </template>
37
37
 
38
- <style lang="scss" scoped>
38
+ <style scoped>
39
39
  .ylf-navigation {
40
40
  --_ylf-nav-justify: center;
41
41
  --_ylf-nav-active-bg: transparent;
@@ -47,33 +47,33 @@ const indicator = useNavigationIndicator(root, {
47
47
  align-items: center;
48
48
  gap: var(--ylf-space-2, 8px);
49
49
  min-width: 0;
50
+ }
50
51
 
51
- &[data-indicator] {
52
- --_ylf-nav-indicator: none;
53
- }
52
+ .ylf-navigation[data-indicator] {
53
+ --_ylf-nav-indicator: none;
54
+ }
54
55
 
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
- }
56
+ .ylf-navigation__indicator {
57
+ position: absolute;
58
+ top: 0;
59
+ left: 0;
60
+ width: 16px;
61
+ height: 2px;
62
+ border-radius: var(--ylf-radius-pill, 999px);
63
+ background: var(--ylf-c-brand, #2563eb);
64
+ pointer-events: none;
65
+ transition: transform var(--ylf-duration-normal, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
66
+ }
66
67
 
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;
68
+ .ylf-navigation[data-orientation='vertical'] {
69
+ --_ylf-nav-justify: flex-start;
70
+ --_ylf-nav-active-bg: var(--ylf-c-brand-soft, #eff6ff);
71
+ --_ylf-nav-indicator: none;
71
72
 
72
- flex-direction: column;
73
- flex-wrap: nowrap;
74
- align-items: stretch;
75
- gap: var(--ylf-space-1, 4px);
76
- }
73
+ flex-direction: column;
74
+ flex-wrap: nowrap;
75
+ align-items: stretch;
76
+ gap: var(--ylf-space-1, 4px);
77
77
  }
78
78
 
79
79
  @media (prefers-reduced-motion: reduce) {
@@ -23,37 +23,70 @@ withDefaults(defineProps<{
23
23
  </Primitive>
24
24
  </template>
25
25
 
26
- <style lang="scss" scoped>
27
- @use './navigation' as navigation;
28
-
26
+ <style scoped>
29
27
  .ylf-navigation-link {
30
- @include navigation.control;
31
-
32
28
  position: relative;
29
+ box-sizing: border-box;
30
+ display: inline-flex;
31
+ align-items: center;
33
32
  justify-content: var(--_ylf-nav-justify, center);
34
33
  min-width: 60px;
34
+ min-height: var(--ylf-touch-target, 44px);
35
+ gap: var(--ylf-space-2, 8px);
35
36
  padding: var(--ylf-space-2, 8px) var(--ylf-space-4, 16px);
37
+ border: 1px solid transparent;
38
+ border-radius: var(--ylf-radius-sm, 10px);
39
+ background: transparent;
40
+ color: var(--ylf-c-text-2, #475569);
41
+ font-family: var(--ylf-font-body, inherit);
42
+ font-size: var(--ylf-text-sm, 0.875rem);
43
+ font-weight: 500;
44
+ line-height: 1.25rem;
45
+ text-decoration: none;
46
+ white-space: nowrap;
47
+ cursor: pointer;
48
+ transition:
49
+ background-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
50
+ color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
51
+ }
52
+
53
+ .ylf-navigation-link:hover:not(:disabled) {
54
+ background: var(--ylf-c-bg-soft, #f1f5f9);
55
+ color: var(--ylf-c-text, #0f172a);
56
+ }
57
+
58
+ /* Focus stays inside the target so it cannot overlap a neighboring state. */
59
+ .ylf-navigation-link:focus-visible {
60
+ outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
61
+ outline-offset: -2px;
62
+ box-shadow: none;
63
+ }
64
+
65
+ .ylf-navigation-link[data-active] {
66
+ background: var(--_ylf-nav-active-bg, transparent);
67
+ color: var(--ylf-c-brand, #2563eb);
68
+ }
69
+
70
+ .ylf-navigation-link[data-active]::after {
71
+ position: absolute;
72
+ display: var(--_ylf-nav-indicator, block);
73
+ bottom: 4px;
74
+ inset-inline-start: calc(50% - 8px);
75
+ width: 16px;
76
+ height: 2px;
77
+ border-radius: var(--ylf-radius-pill, 999px);
78
+ background: currentColor;
79
+ content: '';
80
+ }
81
+
82
+ .ylf-navigation-link[data-active]:hover {
83
+ background: var(--ylf-c-bg-soft, #f1f5f9);
84
+ color: var(--ylf-c-brand, #2563eb);
85
+ }
36
86
 
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
- }
87
+ @media (prefers-reduced-motion: reduce) {
88
+ .ylf-navigation-link {
89
+ transition: none;
57
90
  }
58
91
  }
59
92
  </style>
@@ -15,37 +15,65 @@ withDefaults(defineProps<{
15
15
  </button>
16
16
  </template>
17
17
 
18
- <style lang="scss" scoped>
19
- @use './navigation' as navigation;
20
-
18
+ <style scoped>
21
19
  .ylf-navigation-trigger {
22
- @include navigation.control;
23
-
20
+ box-sizing: border-box;
21
+ display: inline-flex;
22
+ align-items: center;
24
23
  justify-content: center;
24
+ min-height: var(--ylf-touch-target, 44px);
25
+ gap: var(--ylf-space-2, 8px);
25
26
  padding: var(--ylf-space-2, 8px) var(--ylf-space-3, 12px);
27
+ border: 1px solid transparent;
28
+ border-radius: var(--ylf-radius-sm, 10px);
29
+ background: transparent;
30
+ color: var(--ylf-c-text-2, #475569);
31
+ font-family: var(--ylf-font-body, inherit);
32
+ font-size: var(--ylf-text-sm, 0.875rem);
33
+ font-weight: 500;
34
+ line-height: 1.25rem;
35
+ text-decoration: none;
36
+ white-space: nowrap;
37
+ cursor: pointer;
38
+ transition:
39
+ background-color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1)),
40
+ color var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
41
+ }
26
42
 
27
- &[aria-expanded='true'] {
28
- background: var(--ylf-c-bg-soft, #f1f5f9);
29
- color: var(--ylf-c-text, #0f172a);
30
- }
43
+ .ylf-navigation-trigger:hover:not(:disabled) {
44
+ background: var(--ylf-c-bg-soft, #f1f5f9);
45
+ color: var(--ylf-c-text, #0f172a);
46
+ }
31
47
 
32
- &:disabled {
33
- opacity: 0.5;
34
- cursor: not-allowed;
35
- }
48
+ /* Focus stays inside the target so it cannot overlap a neighboring state. */
49
+ .ylf-navigation-trigger:focus-visible {
50
+ outline: var(--ylf-ring-width, 2px) solid var(--ylf-ring-color, var(--ylf-c-brand, #2563eb));
51
+ outline-offset: -2px;
52
+ box-shadow: none;
53
+ }
36
54
 
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
- }
55
+ .ylf-navigation-trigger[aria-expanded='true'] {
56
+ background: var(--ylf-c-bg-soft, #f1f5f9);
57
+ color: var(--ylf-c-text, #0f172a);
58
+ }
42
59
 
43
- &[aria-expanded='true'] &__chevron {
44
- transform: rotate(180deg);
45
- }
60
+ .ylf-navigation-trigger:disabled {
61
+ opacity: var(--ylf-disabled-opacity, 0.48);
62
+ cursor: not-allowed;
63
+ }
64
+
65
+ .ylf-navigation-trigger__chevron {
66
+ flex: none;
67
+ color: var(--ylf-c-text-3, #5a697e);
68
+ transition: transform var(--ylf-duration-fast, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
69
+ }
70
+
71
+ .ylf-navigation-trigger[aria-expanded='true'] .ylf-navigation-trigger__chevron {
72
+ transform: rotate(180deg);
46
73
  }
47
74
 
48
75
  @media (prefers-reduced-motion: reduce) {
76
+ .ylf-navigation-trigger,
49
77
  .ylf-navigation-trigger__chevron {
50
78
  transition: none;
51
79
  }
@@ -31,9 +31,9 @@ const open = defineModel<boolean>('open', { default: false })
31
31
  </PopoverRoot>
32
32
  </template>
33
33
 
34
- <style lang="scss">
34
+ <style>
35
35
  .ylf-popover {
36
- z-index: 105;
36
+ z-index: var(--ylf-z-popover, 105);
37
37
  box-sizing: border-box;
38
38
  min-width: min(180px, var(--reka-popover-content-available-width, 100vw));
39
39
  max-width: min(320px, var(--reka-popover-content-available-width, calc(100vw - 32px)));
@@ -45,41 +45,44 @@ const open = defineModel<boolean>('open', { default: false })
45
45
  background: var(--ylf-c-panel, var(--ylf-c-surface, #fff));
46
46
  border: 1px solid var(--ylf-c-border, #e2e8f0);
47
47
  border-radius: var(--ylf-radius, 14px);
48
- box-shadow: var(--ylf-shadow-panel, 0 22px 56px -14px rgba(15, 23, 42, 0.22));
49
- backdrop-filter: var(--ylf-glass-blur, blur(16px));
48
+ box-shadow: var(--ylf-shadow-panel, var(--ylf-shadow-lg, 0 22px 56px -14px rgba(15, 23, 42, 0.22)));
49
+ backdrop-filter: var(--ylf-glass-blur, saturate(160%) blur(16px));
50
50
  transform-origin: var(--reka-popover-content-transform-origin);
51
+ }
51
52
 
52
- &[data-state='open'] {
53
- animation: ylf-popover-in var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, ease);
54
- }
53
+ .ylf-popover[data-state='open'] {
54
+ animation: ylf-popover-in var(--ylf-duration-enter, 240ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
55
+ }
55
56
 
56
- &[data-state='closed'] {
57
- animation: ylf-popover-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, ease);
58
- }
57
+ .ylf-popover[data-state='closed'] {
58
+ animation: ylf-popover-out var(--ylf-duration-exit, 160ms) var(--ylf-ease-standard, cubic-bezier(0.2, 0, 0, 1));
59
+ }
59
60
 
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
- }
61
+ .ylf-popover[data-side='bottom'] {
62
+ --_enter-y: -4px;
63
+ }
72
64
 
73
- &__body {
74
- max-height: calc(var(--reka-popover-content-available-height, calc(100dvh - 32px)) - 34px);
75
- overflow: auto;
76
- overscroll-behavior: contain;
77
- }
65
+ .ylf-popover[data-side='top'] {
66
+ --_enter-y: 4px;
67
+ }
78
68
 
79
- &__arrow {
80
- fill: var(--ylf-c-surface, #fff);
81
- stroke: var(--ylf-c-border, #e2e8f0);
82
- }
69
+ .ylf-popover[data-side='left'] {
70
+ --_enter-x: 4px;
71
+ }
72
+
73
+ .ylf-popover[data-side='right'] {
74
+ --_enter-x: -4px;
75
+ }
76
+
77
+ .ylf-popover__body {
78
+ max-height: calc(var(--reka-popover-content-available-height, calc(100dvh - 32px)) - 34px);
79
+ overflow: auto;
80
+ overscroll-behavior: contain;
81
+ }
82
+
83
+ .ylf-popover__arrow {
84
+ fill: var(--ylf-c-surface, #fff);
85
+ stroke: var(--ylf-c-border, #e2e8f0);
83
86
  }
84
87
 
85
88
  @keyframes ylf-popover-in {
@@ -14,14 +14,17 @@ const props = withDefaults(defineProps<{
14
14
  value: 0,
15
15
  max: 100,
16
16
  variant: 'brand',
17
- tone: 'blue',
18
17
  })
19
18
 
20
- const safeMax = computed(() => Number.isFinite(props.max) && props.max > 0 ? props.max : 100)
19
+ const safeMax = computed(() => Number.isFinite(props.max) && props.max > 0
20
+ ? props.max
21
+ : 100)
21
22
  const safeValue = computed(() => props.value === null || !Number.isFinite(props.value)
22
23
  ? null
23
24
  : Math.max(0, Math.min(safeMax.value, props.value)))
24
- const percent = computed(() => safeValue.value === null ? null : safeValue.value / safeMax.value * 100)
25
+ const percent = computed(() => safeValue.value === null
26
+ ? null
27
+ : safeValue.value / safeMax.value * 100)
25
28
  </script>
26
29
 
27
30
  <template>
@@ -39,20 +42,20 @@ const percent = computed(() => safeValue.value === null ? null : safeValue.value
39
42
  </ProgressRoot>
40
43
  </template>
41
44
 
42
- <style lang="scss">
45
+ <style>
43
46
  .ylf-progress {
44
47
  position: relative;
45
48
  width: 100%;
46
49
  height: 8px;
47
50
  overflow: hidden;
48
- border-radius: 999px;
51
+ border-radius: var(--ylf-radius-pill, 999px);
49
52
  background: var(--ylf-c-bg-mute, #e2e8f0);
50
53
  }
51
54
 
52
55
  .ylf-progress__indicator {
53
56
  width: 100%;
54
57
  height: 100%;
55
- border-radius: 999px;
58
+ border-radius: var(--ylf-radius-pill, 999px);
56
59
  background: var(--ylf-c-brand, #2563eb);
57
60
  transition: transform 0.4s var(--ylf-ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
58
61
  }
@@ -66,6 +69,7 @@ const percent = computed(() => safeValue.value === null ? null : safeValue.value
66
69
  from {
67
70
  transform: translateX(-100%);
68
71
  }
72
+
69
73
  to {
70
74
  transform: translateX(250%);
71
75
  }