@yunlefun/vue 0.2.0 → 0.4.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 (65) hide show
  1. package/README.md +2 -0
  2. package/components/YlfAccordion.vue +1 -1
  3. package/components/YlfAvatar.vue +2 -1
  4. package/components/YlfDialog.vue +23 -2
  5. package/components/YlfDropdownMenu.vue +20 -9
  6. package/components/YlfPopover.vue +5 -2
  7. package/components/YlfProgress.vue +29 -5
  8. package/components/YlfRadioGroup.vue +20 -2
  9. package/components/YlfSegmentedControl.vue +180 -0
  10. package/components/YlfSelect.vue +47 -13
  11. package/components/YlfSlider.vue +32 -2
  12. package/components/YlfTabs.vue +1 -1
  13. package/components/YlfTooltip.vue +8 -3
  14. package/components/accordion/demo.vue +1 -1
  15. package/components/accordion/index.md +2 -0
  16. package/components/avatar/index.md +3 -1
  17. package/components/checkbox/demo.vue +10 -9
  18. package/components/checkbox/index.md +2 -0
  19. package/components/dialog/index.md +9 -6
  20. package/components/dropdown-menu/index.md +9 -3
  21. package/components/popover/demo.vue +1 -1
  22. package/components/popover/index.md +8 -5
  23. package/components/progress/index.md +3 -1
  24. package/components/radio/demo.vue +1 -1
  25. package/components/radio/index.md +2 -0
  26. package/components/segmented-control/demo.vue +21 -0
  27. package/components/segmented-control/index.md +41 -0
  28. package/components/segmented-control.ts +8 -0
  29. package/components/select/index.md +10 -0
  30. package/components/slider/demo.vue +2 -2
  31. package/components/slider/index.md +15 -7
  32. package/components/switch/index.md +2 -0
  33. package/components/tabs/index.md +2 -0
  34. package/components/tooltip/index.md +11 -5
  35. package/dist/components/YlfAccordion.vue.d.ts +35 -0
  36. package/dist/components/YlfAiPromptLauncher.vue.d.ts +25 -0
  37. package/dist/components/YlfAvatar.vue.d.ts +14 -0
  38. package/dist/components/YlfBadge.vue.d.ts +29 -0
  39. package/dist/components/YlfBottomMenu.vue.d.ts +19 -0
  40. package/dist/components/YlfBottomMenuItem.vue.d.ts +22 -0
  41. package/dist/components/YlfButton.vue.d.ts +48 -0
  42. package/dist/components/YlfCard.vue.d.ts +28 -0
  43. package/dist/components/YlfCheckbox.vue.d.ts +18 -0
  44. package/dist/components/YlfDialog.vue.d.ts +37 -0
  45. package/dist/components/YlfDropdownMenu.vue.d.ts +34 -0
  46. package/dist/components/YlfLogo.vue.d.ts +13 -0
  47. package/dist/components/YlfPopover.vue.d.ts +31 -0
  48. package/dist/components/YlfProgress.vue.d.ts +17 -0
  49. package/dist/components/YlfRadioGroup.vue.d.ts +24 -0
  50. package/dist/components/YlfSegmentedControl.vue.d.ts +35 -0
  51. package/dist/components/YlfSelect.vue.d.ts +43 -0
  52. package/dist/components/YlfSeparator.vue.d.ts +16 -0
  53. package/dist/components/YlfSlider.vue.d.ts +29 -0
  54. package/dist/components/YlfSwitch.vue.d.ts +24 -0
  55. package/dist/components/YlfTabs.vue.d.ts +32 -0
  56. package/dist/components/YlfTooltip.vue.d.ts +26 -0
  57. package/dist/components/ai-prompt.d.ts +33 -0
  58. package/dist/components/ai-provider-logos.d.ts +3 -0
  59. package/dist/components/bottom-menu/index.d.ts +20 -0
  60. package/dist/components/segmented-control.d.ts +8 -0
  61. package/dist/components/theme.d.ts +4 -0
  62. package/dist/index.d.cts +10 -1
  63. package/dist/index.d.mts +10 -1
  64. package/dist/index.d.ts +10 -1
  65. package/package.json +6 -2
@@ -2,23 +2,28 @@
2
2
  // 行为 / 定位 / a11y 由 reka-ui 提供;皮肤走 token。
3
3
  import { TooltipArrow, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger } from 'reka-ui'
4
4
 
5
+ defineOptions({ inheritAttrs: false })
6
+
5
7
  withDefaults(defineProps<{
6
8
  content?: string
7
9
  side?: 'top' | 'right' | 'bottom' | 'left'
8
10
  delay?: number
11
+ disabled?: boolean
12
+ portalTo?: string | HTMLElement
9
13
  }>(), {
10
14
  side: 'top',
11
15
  delay: 300,
16
+ disabled: false,
12
17
  })
13
18
  </script>
14
19
 
15
20
  <template>
16
21
  <TooltipProvider :delay-duration="delay">
17
- <TooltipRoot>
18
- <TooltipTrigger as-child>
22
+ <TooltipRoot :disabled="disabled">
23
+ <TooltipTrigger as-child v-bind="$attrs">
19
24
  <slot />
20
25
  </TooltipTrigger>
21
- <TooltipPortal>
26
+ <TooltipPortal :to="portalTo">
22
27
  <TooltipContent :side="side" :side-offset="6" class="ylf-tooltip">
23
28
  <slot name="content">
24
29
  {{ content }}
@@ -1,7 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  const items = [
3
3
  { value: 'a', title: '什么是 YunLeFun Design?', content: '云乐坊设计系统,统一设计规范、品牌视觉与 UI 实现;默认晴空蓝为主,高饱和纯色点缀。' },
4
- { value: 'b', title: '为什么基于 reka-ui?', content: 'reka 管行为与可访问性,我们只管皮肤——省心,且无障碍达标。' },
4
+ { value: 'b', title: '为什么基于 reka-ui?', content: 'Reka UI 提供键盘、焦点和 ARIA 行为,云乐坊提供产品接口与主题;封装后的场景仍需逐项验收。' },
5
5
  { value: 'c', title: '支持暗色吗?', content: '晴空白与深蓝夜空两套中性色,token 驱动,零配置随主题切换。' },
6
6
  ]
7
7
  </script>
@@ -17,3 +17,5 @@ title_zh: 手风琴
17
17
  ## Slots
18
18
 
19
19
  每项内容可用 `value` 同名插槽覆盖 `content`。
20
+
21
+ `items` 支持只读数组。单开模式全部收起时值为 `undefined`,多开模式为字符串数组;调用方应允许收起状态。方向键、Home / End 在标题间移动焦点,跳过禁用项。
@@ -10,6 +10,8 @@ title_zh: 头像
10
10
  | 属性 | 说明 | 类型 | 默认值 |
11
11
  | ---------- | ---------------------- | ---------------- | ------ |
12
12
  | `src` | 图片地址 | `string` | — |
13
- | `alt` | 替代文字 | `string` | — |
13
+ | `alt` | 替代文字 | `string` | `''` |
14
14
  | `fallback` | 回退文字(如姓名首字) | `string` | — |
15
15
  | `size` | 尺寸 | `sm \| md \| lg` | `md` |
16
+
17
+ 有意义的头像使用完整 `alt`(例如用户姓名);图片缺失时,回退图像也使用该名称。没有 `alt` 时回退文字作为名称;仅装饰的图片可保留空 `alt`。`fallback` 决定显示的文字,不会从图片地址自动推断姓名。
@@ -1,28 +1,29 @@
1
1
  <script setup lang="ts">
2
- import { ref } from 'vue'
2
+ import { ref, useId } from 'vue'
3
3
 
4
4
  const a = ref(true)
5
5
  const b = ref(false)
6
6
  const c = ref<boolean | 'indeterminate'>('indeterminate')
7
+ const id = useId()
7
8
  </script>
8
9
 
9
10
  <template>
10
11
  <div class="flex flex-col gap-4">
11
12
  <div class="flex items-center gap-2">
12
- <YlfCheckbox v-model="a" />
13
- <span class="text-sm">已勾选</span>
13
+ <YlfCheckbox :id="`${id}-checked`" v-model="a" />
14
+ <label :for="`${id}-checked`" class="text-sm">已勾选</label>
14
15
  </div>
15
16
  <div class="flex items-center gap-2">
16
- <YlfCheckbox v-model="b" />
17
- <span class="text-sm">未勾选</span>
17
+ <YlfCheckbox :id="`${id}-unchecked`" v-model="b" />
18
+ <label :for="`${id}-unchecked`" class="text-sm">未勾选</label>
18
19
  </div>
19
20
  <div class="flex items-center gap-2">
20
- <YlfCheckbox v-model="c" />
21
- <span class="text-sm">半选 indeterminate</span>
21
+ <YlfCheckbox :id="`${id}-mixed`" v-model="c" />
22
+ <label :for="`${id}-mixed`" class="text-sm">半选 indeterminate</label>
22
23
  </div>
23
24
  <div class="flex items-center gap-2 op-60">
24
- <YlfCheckbox :model-value="true" disabled />
25
- <span class="text-sm">禁用</span>
25
+ <YlfCheckbox :id="`${id}-disabled`" :model-value="true" disabled />
26
+ <label :for="`${id}-disabled`" class="text-sm">禁用</label>
26
27
  </div>
27
28
  </div>
28
29
  </template>
@@ -12,3 +12,5 @@ title_zh: 复选框
12
12
  | `v-model` | 勾选状态 | `boolean \| 'indeterminate'` | `false` |
13
13
  | `value` | 表单提交值 | `string` | — |
14
14
  | `disabled` | 禁用 | `boolean` | `false` |
15
+
16
+ 每个复选框必须有可访问名称:传入 `aria-label="同意服务条款"`,或通过 `id` 与 `<label for>` 关联。旁边的普通 `<span>` 不会自动成为标签。`name` 和 `required` 透传给 Reka UI;置于原生表单时,勾选值进入 `FormData`,禁用项不提交。
@@ -7,15 +7,18 @@ title_zh: 对话框
7
7
 
8
8
  ## Props
9
9
 
10
- | 属性 | 说明 | 类型 | 默认值 |
11
- | ----------------- | -------------------------------- | --------- | ---------- |
12
- | `v-model:open` | 显隐状态 | `boolean` | `false` |
13
- | `title` | 可见标题 | `string` | — |
14
- | `description` | 描述 | `string` | — |
15
- | `accessibleTitle` | 无可见标题时供辅助技术读取的标题 | `string` | `'对话框'` |
10
+ | 属性 | 说明 | 类型 | 默认值 |
11
+ | ----------------- | -------------------------------- | ----------------------- | ----------------------- |
12
+ | `v-model:open` | 显隐状态 | `boolean` | `false` |
13
+ | `title` | 可见标题 | `string` | — |
14
+ | `description` | 描述 | `string` | — |
15
+ | `accessibleTitle` | 无可见标题时供辅助技术读取的标题 | `string` | `'对话框'` |
16
+ | `portalTo` | 已存在的主题内浮层容器 | `string \| HTMLElement` | ConfigProvider / `body` |
16
17
 
17
18
  建议始终提供 `title`。只有视觉设计明确隐藏标题时,才改用描述场景的 `accessible-title`。
18
19
 
20
+ `class`、`id`、`data-*` 和事件传给对话框内容;显式的 `aria-describedby` 可关联调用方的说明。焦点陷阱、Escape 关闭和关闭后回到触发器仍由 Reka UI 管理。局部主题中把 `portal-to` 指向同一主题边界内的容器。长标题会换行并为关闭按钮保留空间。
21
+
19
22
  ## Registry
20
23
 
21
24
  Dialog 可通过 [Registry 分发](/guide/registry)复制源码;安装时会自动带入 `reka-ui`、Sass 与共享 token。
@@ -7,9 +7,13 @@ title_zh: 下拉菜单
7
7
 
8
8
  ## Props
9
9
 
10
- | 属性 | 说明 | 类型 | 默认值 |
11
- | ------- | ------ | ------------ | ------ |
12
- | `items` | 菜单项 | `MenuItem[]` | — |
10
+ | 属性 | 说明 | 类型 | 默认值 |
11
+ | -------------- | ---------------------- | ----------------------- | ----------------------- |
12
+ | `items` | 菜单项 | `readonly MenuItem[]` | — |
13
+ | `v-model:open` | 显隐状态 | `boolean` | `false` |
14
+ | `portalTo` | 已存在的主题内浮层容器 | `string \| HTMLElement` | ConfigProvider / `body` |
15
+
16
+ `class`、`data-*`、ARIA 属性和事件传给菜单内容。`portal-to` 可把菜单放入已有的局部主题容器;未传时继续使用 ConfigProvider 或 `body`。支持方向键、Home / End、Enter 选择和 Escape 关闭;禁用项会被跳过。
13
17
 
14
18
  ### MenuItem
15
19
 
@@ -25,3 +29,5 @@ title_zh: 下拉菜单
25
29
  | 名称 | 说明 |
26
30
  | -------- | ---------------------------- |
27
31
  | `select` | 选中某项时触发,回传 `value` |
32
+
33
+ `value=""` 可表示“全部”或“清除筛选”,仍会触发 `select`。没有 `value` 的项不触发选值事件。
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <YlfPopover side="bottom" align="start">
2
+ <YlfPopover side="bottom" align="start" aria-label="云乐坊介绍">
3
3
  <template #trigger>
4
4
  <YlfButton variant="primary">
5
5
  打开浮层
@@ -7,11 +7,14 @@ title_zh: 浮层
7
7
 
8
8
  ## Props
9
9
 
10
- | 属性 | 说明 | 类型 | 默认值 |
11
- | -------------- | -------- | -------------------------------- | -------- |
12
- | `v-model:open` | 显隐状态 | `boolean` | `false` |
13
- | `side` | 方向 | `top \| right \| bottom \| left` | `bottom` |
14
- | `align` | 对齐 | `start \| center \| end` | `center` |
10
+ | 属性 | 说明 | 类型 | 默认值 |
11
+ | -------------- | ---------------------- | -------------------------------- | ----------------------- |
12
+ | `v-model:open` | 显隐状态 | `boolean` | `false` |
13
+ | `side` | 方向 | `top \| right \| bottom \| left` | `bottom` |
14
+ | `align` | 对齐 | `start \| center \| end` | `center` |
15
+ | `portalTo` | 已存在的主题内浮层容器 | `string \| HTMLElement` | ConfigProvider / `body` |
16
+
17
+ `class`、`data-*`、ARIA 属性和事件传给浮层内容,内部关联 ID 由 Reka UI 管理。默认可访问名称与触发器关联;触发器应使用说明用途的文字。局部主题的 `portal-to` 容器应处于相同主题边界。
15
18
 
16
19
  ## Slots
17
20
 
@@ -9,9 +9,11 @@ title_zh: 进度条
9
9
 
10
10
  | 属性 | 说明 | 类型 | 默认值 |
11
11
  | --------- | ------------------------- | ----------------------------------------------- | ------- |
12
- | `value` | 当前进度 | `number` | `0` |
12
+ | `value` | 当前进度;`null` 表示未知 | `number \| null` | `0` |
13
13
  | `max` | 最大值 | `number` | `100` |
14
14
  | `variant` | 填充 | `brand \| accent` | `brand` |
15
15
  | `tone` | 强调色,仅作用于 `accent` | `blue \| sun \| cyan \| coral \| pink \| green` | `blue` |
16
16
 
17
17
  `tone` 接受 `blue | sun | cyan | coral | pink | green`,默认 `blue`(晴空蓝),只在 `accent` 下生效。旧 `aurora` 值映射到 `accent`。同一流程中的同类状态使用同一种颜色。
18
+
19
+ 提供用途名称,例如 `aria-label="文件上传进度"`。有限数值会限制在 `0…max`,无效的 `max` 回退到 `100`,确保显示与 ARIA 值一致。`null`、NaN 或无限值按未知进度显示,不输出 `aria-valuenow`;减少动态效果时显示静态进度段。
@@ -12,7 +12,7 @@ const options = [
12
12
 
13
13
  <template>
14
14
  <div class="flex flex-col gap-4">
15
- <YlfRadioGroup v-model="picked" :options="options" orientation="horizontal" />
15
+ <YlfRadioGroup v-model="picked" :options="options" orientation="horizontal" aria-label="主题颜色" />
16
16
  <p class="text-sm op-70">
17
17
  当前:{{ picked }}
18
18
  </p>
@@ -21,3 +21,5 @@ title_zh: 单选框
21
21
  | `label` | 文案 | `string` |
22
22
  | `value` | 值 | `string` |
23
23
  | `disabled` | 禁用该项 | `boolean?` |
24
+
25
+ `options` 支持只读数组。通过 `aria-label` 或 `aria-labelledby` 指定整组名称,单项名称来自 `label`。方向键跳过禁用项;`name` / `required` 透传给 Reka UI,可用于原生表单。
@@ -0,0 +1,21 @@
1
+ <script setup lang="ts">
2
+ import { shallowRef } from 'vue'
3
+ import YlfSegmentedControl from '../YlfSegmentedControl.vue'
4
+
5
+ const view = shallowRef<'grid' | 'list'>('grid')
6
+ const kind = shallowRef('all')
7
+ const options = [{ value: 'grid', label: '网格视图' }, { value: 'list', label: '列表视图' }] as const
8
+ const icons = { grid: 'i-ri-grid-line', list: 'i-ri-list-check' }
9
+ const kinds = [{ value: 'all', label: '全部', count: 24 }, { value: 'image', label: '图片', count: 18 }, { value: 'video', label: '视频', count: 6 }]
10
+ </script>
11
+
12
+ <template>
13
+ <div class="flex flex-wrap items-center gap-4">
14
+ <YlfSegmentedControl v-model="kind" :options="kinds" label="素材类型" size="sm" />
15
+ <YlfSegmentedControl v-model="view" :options="options" label="资源视图" size="sm" icon-only>
16
+ <template #icon="{ option }">
17
+ <i :class="icons[option.value]" />
18
+ </template>
19
+ </YlfSegmentedControl>
20
+ </div>
21
+ </template>
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: Segmented Control
3
+ title_zh: 分段选择器
4
+ ---
5
+
6
+ 单选视图与筛选控件,基于 [Reka UI ToggleGroup](https://reka-ui.com/docs/components/toggle-group)。保留方向键、Home / End 和禁用项处理,再次点击当前项不会清空选择。切换独立内容面板请使用 Tabs。
7
+
8
+ | 属性 | 说明 | 默认值 |
9
+ | ----------- | ----------------------------------------------------------------- | ------- |
10
+ | `v-model` | 当前选项,支持字符串联合类型 | 必填 |
11
+ | `options` | `{ value, label, disabled?, count?, ariaLabel? }[]`,支持只读数组 | 必填 |
12
+ | `label` | 组合控件的无障碍名称 | 必填 |
13
+ | `size` | `sm`:34px 工作台;`md`:44px 常规界面 | `md` |
14
+ | `icon-only` | 仅显示图标,并提供文字 Tooltip | `false` |
15
+ | `disabled` | 禁用全部选项 | `false` |
16
+
17
+ `#icon="{ option, selected }"` 插槽接收当前项及选中状态。应用通过完整的 UnoCSS / Iconify 类名映射渲染图标,公共组件不依赖应用的图标构建方式。没有图标插槽时仍显示标签。
18
+
19
+ ```vue
20
+ <script setup lang="ts">
21
+ import YlfSegmentedControl from '@yunlefun/vue/components/YlfSegmentedControl.vue'
22
+ import { shallowRef } from 'vue'
23
+
24
+ const view = shallowRef<'grid' | 'list'>('grid')
25
+ const options = [
26
+ { value: 'grid', label: '网格视图' },
27
+ { value: 'list', label: '列表视图' },
28
+ ] as const
29
+ const icons = { grid: 'i-ri-grid-line', list: 'i-ri-list-check' }
30
+ </script>
31
+
32
+ <template>
33
+ <YlfSegmentedControl v-model="view" :options="options" label="资源视图" size="sm" icon-only>
34
+ <template #icon="{ option }">
35
+ <i :class="icons[option.value]" />
36
+ </template>
37
+ </YlfSegmentedControl>
38
+ </template>
39
+ ```
40
+
41
+ 样式统一来自 `--ylf-*`:轻灰底座、表面色选中项、品牌色文字、细边框与焦点环。`sm` 与 `YlfSelect size="sm"` 对齐。触摸设备中选项至少 44px;减少动态效果时禁用过渡。不需要在业务页面覆盖选中态或圆角。
@@ -0,0 +1,8 @@
1
+ /** One choice in a single-selection segmented control. */
2
+ export interface YlfSegmentedOption<T extends string = string> {
3
+ value: T
4
+ label: string
5
+ disabled?: boolean
6
+ count?: number
7
+ ariaLabel?: string
8
+ }
@@ -39,3 +39,13 @@ const options = [
39
39
  ```
40
40
 
41
41
  使用 token 时,色点会随所在主题更新;页面和浮层需处于同一主题范围。
42
+
43
+ ## 工作台密度与图标
44
+
45
+ `size="sm"` 使用 34px 高度、紧凑文字与 10px 圆角,适合排序、项目范围等工具栏控件;默认 `md` 保持 44px 表单尺寸。触摸设备中紧凑选择器与选项仍至少 44px。`#icon` 和 `#indicator` 可传入应用已有的 UnoCSS / Iconify 图标;未提供时保留内置 SVG。
46
+
47
+ ## 表单与局部主题
48
+
49
+ `name?: string` 和 `required?: boolean`(默认 `false`)传给底层表单控件。放在 `<form>` 内时,选择值进入原生 `FormData`;禁用字段不提交。`id`、`aria-label`、`aria-labelledby`、`class` 和事件传给触发按钮。使用实际字段名称作为可访问名称,例如 `aria-label="主题颜色"` 或关联的 `<label for>`。
50
+
51
+ `portalTo?: string | HTMLElement` 指定已存在的浮层容器,例如 `portal-to="#settings-portals"`。容器应位于页面相同的 `.ylf-theme-light` / `.ylf-theme-dark` 边界中。不传时保留 Reka UI 的 ConfigProvider 配置,最终回退到 `body`。
@@ -8,13 +8,13 @@ const range = ref([20, 70])
8
8
  <template>
9
9
  <div class="flex flex-col gap-6">
10
10
  <div class="flex flex-col gap-2">
11
- <YlfSlider v-model="single" />
11
+ <YlfSlider v-model="single" label="音量" />
12
12
  <p class="m-0 text-sm op-70">
13
13
  单值:{{ single[0] }}
14
14
  </p>
15
15
  </div>
16
16
  <div class="flex flex-col gap-2">
17
- <YlfSlider v-model="range" />
17
+ <YlfSlider v-model="range" label="价格区间" :thumb-labels="['最低价格', '最高价格']" />
18
18
  <p class="m-0 text-sm op-70">
19
19
  区间:{{ range[0] }} – {{ range[1] }}
20
20
  </p>
@@ -7,10 +7,18 @@ title_zh: 滑块
7
7
 
8
8
  ## Props
9
9
 
10
- | 属性 | 说明 | 类型 | 默认值 |
11
- | ---------- | ------ | ---------- | ------- |
12
- | `v-model` | 当前值 | `number[]` | `[50]` |
13
- | `min` | 最小值 | `number` | `0` |
14
- | `max` | 最大值 | `number` | `100` |
15
- | `step` | 步长 | `number` | `1` |
16
- | `disabled` | 禁用 | `boolean` | `false` |
10
+ | 属性 | 说明 | 类型 | 默认值 |
11
+ | ------------- | ------------------------ | ------------------- | ------- |
12
+ | `v-model` | 当前值 | `number[]` | `[50]` |
13
+ | `min` | 最小值 | `number` | `0` |
14
+ | `max` | 最大值 | `number` | `100` |
15
+ | `step` | 步长 | `number` | `1` |
16
+ | `disabled` | 禁用 | `boolean` | `false` |
17
+ | `label` | 单值或整组用途名称 | `string` | `数值` |
18
+ | `thumbLabels` | 按顺序指定每个滑块的名称 | `readonly string[]` | — |
19
+
20
+ 单值使用 `label="音量"`;区间使用 `:thumb-labels="['最低价格', '最高价格']"`。未指定端点名称时,使用 `label` 和顺序编号。方向键按 `step` 调整,Home / End 到达边界;禁用时滑块不进入键盘焦点顺序。触摸设备提供至少 44px 的操作区域,减少动态效果时关闭过渡。
21
+
22
+ ## Events
23
+
24
+ `valueCommit` 在一次拖动或键盘调整完成时回传 `number[]`。需要在交互完成后保存数据时,使用 `@value-commit`;界面状态继续使用 `v-model`。
@@ -16,3 +16,5 @@ title_zh: 开关
16
16
  | `disabled` | 禁用 | `boolean` | `false` |
17
17
 
18
18
  `tone` 接受 `blue | sun | cyan | coral | pink | green`,默认 `blue`(晴空蓝),只在 `accent` 下生效。旧 `aurora` 值映射到 `accent`。同一流程中的同类状态使用同一种颜色。
19
+
20
+ 通过 `aria-label` 或关联的 `<label for>` 提供用途名称。Space / Enter 切换状态,禁用时不响应操作。`name`、`value` 和 `required` 透传给 Reka UI,用于原生表单提交。
@@ -16,3 +16,5 @@ title_zh: 标签页
16
16
  ## Slots
17
17
 
18
18
  每个标签的内容用 `value` 同名插槽提供,如 `#cloud`、`#fun`。
19
+
20
+ `items` 支持只读数组。标签和内容面板的 ARIA 关联由 Reka UI 管理;方向键、Home / End 改变焦点并自动选中,跳过禁用项。切换普通筛选条件而不展示关联面板时使用 Segmented Control。
@@ -7,11 +7,15 @@ title_zh: 文字提示
7
7
 
8
8
  ## Props
9
9
 
10
- | 属性 | 说明 | 类型 | 默认值 |
11
- | --------- | ---------- | -------------------------------- | ------ |
12
- | `content` | 提示文字 | `string` | — |
13
- | `side` | 方向 | `top \| right \| bottom \| left` | `top` |
14
- | `delay` | 延迟(ms) | `number` | `300` |
10
+ | 属性 | 说明 | 类型 | 默认值 |
11
+ | ---------- | ---------------------- | -------------------------------- | ----------------------- |
12
+ | `content` | 提示文字 | `string` | — |
13
+ | `side` | 方向 | `top \| right \| bottom \| left` | `top` |
14
+ | `delay` | 延迟(ms) | `number` | `300` |
15
+ | `disabled` | 关闭提示 | `boolean` | `false` |
16
+ | `portalTo` | 已存在的主题内浮层容器 | `string \| HTMLElement` | ConfigProvider / `body` |
17
+
18
+ `id`、`class`、`aria-label`、`data-*` 和事件传给触发元素。仅图标按钮仍需可访问名称,不能只依赖 Tooltip 内容。局部主题中使用 `portal-to` 保持提示与触发器处于同一主题。
15
19
 
16
20
  ## Slots
17
21
 
@@ -19,3 +23,5 @@ title_zh: 文字提示
19
23
  | --------- | ---------------------- |
20
24
  | `default` | 触发元素(`as-child`) |
21
25
  | `content` | 自定义提示内容 |
26
+
27
+ `disabled` 可关闭 Tooltip;例如分段选择器显示文字时不重复提示,仅图标模式下再启用。
@@ -0,0 +1,35 @@
1
+ interface AccordionItemData {
2
+ value: string;
3
+ title: string;
4
+ content?: string;
5
+ disabled?: boolean;
6
+ }
7
+ type __VLS_Props = {
8
+ items: readonly AccordionItemData[];
9
+ type?: 'single' | 'multiple';
10
+ collapsible?: boolean;
11
+ };
12
+ type __VLS_ModelProps = {
13
+ modelValue?: string | string[];
14
+ };
15
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
16
+ declare var __VLS_33: string, __VLS_34: {};
17
+ type __VLS_Slots = {} & {
18
+ [K in NonNullable<typeof __VLS_33>]?: (props: typeof __VLS_34) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
+ "update:modelValue": (value: string | string[] | undefined) => any;
22
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
23
+ "onUpdate:modelValue"?: ((value: string | string[] | undefined) => any) | undefined;
24
+ }>, {
25
+ type: "single" | "multiple";
26
+ collapsible: boolean;
27
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,25 @@
1
+ import type { AiPromptLaunch, AiPromptLaunchResult, AiPromptOptions, AiProviderId } from './ai-prompt';
2
+ type __VLS_Props = {
3
+ prompt: string;
4
+ providers?: readonly AiProviderId[];
5
+ disabled?: boolean;
6
+ locale?: 'zh-CN' | 'en';
7
+ options?: AiPromptOptions;
8
+ /** Optional host adapter, e.g. a validated desktop IPC call. */
9
+ launch?: AiPromptLaunch;
10
+ /** Optional native clipboard adapter. */
11
+ copyText?: (text: string) => Promise<void>;
12
+ };
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ result: (result: AiPromptLaunchResult) => any;
15
+ busy: (value: boolean) => any;
16
+ manualCopy: (prompt: string) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onResult?: ((result: AiPromptLaunchResult) => any) | undefined;
19
+ onBusy?: ((value: boolean) => any) | undefined;
20
+ onManualCopy?: ((prompt: string) => any) | undefined;
21
+ }>, {
22
+ locale: "zh-CN" | "en";
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,14 @@
1
+ type __VLS_Props = {
2
+ src?: string;
3
+ alt?: string;
4
+ /** 图片加载失败/缺省时显示的文字(如姓名首字) */
5
+ fallback?: string;
6
+ size?: 'sm' | 'md' | 'lg';
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ fallback: string;
10
+ alt: string;
11
+ size: "sm" | "md" | "lg";
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
@@ -0,0 +1,29 @@
1
+ import type { YlfAccentTone, YlfColorAppearance } from './theme';
2
+ type BadgeVariant = 'featured' | 'accent' | 'aurora' | 'brand' | 'neutral' | 'success' | 'warning' | 'danger' | 'info';
3
+ type __VLS_Props = {
4
+ variant?: BadgeVariant;
5
+ /** 仅 accent 变体使用 */
6
+ tone?: YlfAccentTone;
7
+ /** accent 与状态变体的强调程度 */
8
+ appearance?: YlfColorAppearance;
9
+ /** 胶囊圆角 */
10
+ round?: boolean;
11
+ };
12
+ declare var __VLS_1: {};
13
+ type __VLS_Slots = {} & {
14
+ default?: (props: typeof __VLS_1) => any;
15
+ };
16
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
17
+ round: boolean;
18
+ variant: BadgeVariant;
19
+ tone: YlfAccentTone;
20
+ appearance: YlfColorAppearance;
21
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -0,0 +1,19 @@
1
+ type __VLS_Props = {
2
+ /** 浮起阴影 */
3
+ shadow?: boolean;
4
+ };
5
+ declare var __VLS_1: {};
6
+ type __VLS_Slots = {} & {
7
+ default?: (props: typeof __VLS_1) => any;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
+ shadow: boolean;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ type __VLS_WithSlots<T, S> = T & {
16
+ new (): {
17
+ $slots: S;
18
+ };
19
+ };
@@ -0,0 +1,22 @@
1
+ import type { BottomMenuItem } from './bottom-menu';
2
+ type __VLS_Props = {
3
+ active: boolean;
4
+ item: BottomMenuItem;
5
+ };
6
+ declare var __VLS_1: {};
7
+ type __VLS_Slots = {} & {
8
+ default?: (props: typeof __VLS_1) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ click: (...args: any[]) => void;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ onClick?: ((...args: any[]) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,48 @@
1
+ import type { YlfAccentTone, YlfColorAppearance } from './theme';
2
+ type ButtonVariant = 'primary' | 'accent' | 'aurora' | 'secondary' | 'soft' | 'ghost' | 'success' | 'warning' | 'danger';
3
+ type ButtonSize = 'sm' | 'md' | 'lg';
4
+ type __VLS_Props = {
5
+ variant?: ButtonVariant;
6
+ /** 仅 accent 变体使用,默认晴空蓝 */
7
+ tone?: YlfAccentTone;
8
+ /** accent 与状态变体的强调程度 */
9
+ appearance?: YlfColorAppearance;
10
+ size?: ButtonSize;
11
+ /** 胶囊圆角,默认开启(云是软的) */
12
+ round?: boolean;
13
+ /** 占满整行宽度 */
14
+ block?: boolean;
15
+ disabled?: boolean;
16
+ loading?: boolean;
17
+ /** 渲染标签,如 'a' */
18
+ tag?: string;
19
+ };
20
+ declare var __VLS_10: {}, __VLS_12: {};
21
+ type __VLS_Slots = {} & {
22
+ icon?: (props: typeof __VLS_10) => any;
23
+ } & {
24
+ default?: (props: typeof __VLS_12) => any;
25
+ };
26
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ click: (e: MouseEvent) => any;
28
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
29
+ onClick?: ((e: MouseEvent) => any) | undefined;
30
+ }>, {
31
+ disabled: boolean;
32
+ round: boolean;
33
+ size: ButtonSize;
34
+ variant: ButtonVariant;
35
+ tone: YlfAccentTone;
36
+ appearance: YlfColorAppearance;
37
+ block: boolean;
38
+ loading: boolean;
39
+ tag: string;
40
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
42
+ declare const _default: typeof __VLS_export;
43
+ export default _default;
44
+ type __VLS_WithSlots<T, S> = T & {
45
+ new (): {
46
+ $slots: S;
47
+ };
48
+ };
@@ -0,0 +1,28 @@
1
+ import type { YlfAccentTone } from './theme';
2
+ type CardVariant = 'soft' | 'glass' | 'accent' | 'tinted' | 'gradient';
3
+ type __VLS_Props = {
4
+ variant?: CardVariant;
5
+ tone?: YlfAccentTone;
6
+ /** 悬停时轻轻抬升 */
7
+ hoverable?: boolean;
8
+ /** 内边距,接受任意 CSS 值 */
9
+ padding?: string;
10
+ };
11
+ declare var __VLS_1: {};
12
+ type __VLS_Slots = {} & {
13
+ default?: (props: typeof __VLS_1) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
16
+ variant: CardVariant;
17
+ tone: YlfAccentTone;
18
+ hoverable: boolean;
19
+ padding: string;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
22
+ declare const _default: typeof __VLS_export;
23
+ export default _default;
24
+ type __VLS_WithSlots<T, S> = T & {
25
+ new (): {
26
+ $slots: S;
27
+ };
28
+ };