@yunlefun/vue 0.1.1 → 0.1.2
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/README.md +26 -37
- package/components/YlfAccordion.vue +165 -0
- package/components/YlfAvatar.vue +70 -0
- package/components/YlfBadge.vue +142 -0
- package/components/YlfBottomMenu.vue +23 -6
- package/components/YlfBottomMenuItem.vue +41 -21
- package/components/YlfButton.vue +290 -7
- package/components/YlfCard.vue +74 -3
- package/components/YlfCheckbox.vue +84 -0
- package/components/YlfDialog.vue +174 -0
- package/components/YlfDropdownMenu.vue +98 -0
- package/components/YlfLogo.vue +83 -7
- package/components/YlfPopover.vue +64 -0
- package/components/YlfProgress.vue +65 -0
- package/components/YlfRadioGroup.vue +120 -0
- package/components/YlfSelect.vue +195 -0
- package/components/YlfSeparator.vue +68 -0
- package/components/YlfSlider.vue +89 -0
- package/components/YlfSwitch.vue +111 -0
- package/components/YlfTabs.vue +117 -0
- package/components/YlfTooltip.vue +67 -0
- package/components/accordion/demo.vue +11 -0
- package/components/accordion/index.md +19 -0
- package/components/avatar/demo.vue +9 -0
- package/components/avatar/index.md +15 -0
- package/components/badge/demo.vue +84 -0
- package/components/badge/index.md +41 -0
- package/components/bottom-menu/demo.vue +19 -10
- package/components/bottom-menu/index.md +25 -0
- package/components/button/demo.vue +101 -3
- package/components/button/index.md +41 -0
- package/components/card/demo.vue +76 -3
- package/components/card/index.md +19 -0
- package/components/checkbox/demo.vue +28 -0
- package/components/checkbox/index.md +14 -0
- package/components/common/demo.vue +7 -1
- package/components/common/index.md +10 -0
- package/components/dialog/demo.vue +33 -0
- package/components/dialog/index.md +30 -0
- package/components/dropdown-menu/demo.vue +27 -0
- package/components/dropdown-menu/index.md +27 -0
- package/components/popover/demo.vue +18 -0
- package/components/popover/index.md +21 -0
- package/components/progress/demo.vue +24 -0
- package/components/progress/index.md +17 -0
- package/components/radio/demo.vue +20 -0
- package/components/radio/index.md +23 -0
- package/components/select/demo.vue +20 -0
- package/components/select/index.md +41 -0
- package/components/separator/demo.vue +52 -0
- package/components/separator/index.md +19 -0
- package/components/slider/demo.vue +23 -0
- package/components/slider/index.md +16 -0
- package/components/switch/demo.vue +33 -0
- package/components/switch/index.md +18 -0
- package/components/tabs/demo.vue +30 -0
- package/components/tabs/index.md +18 -0
- package/components/theme.ts +5 -0
- package/components/tooltip/demo.vue +19 -0
- package/components/tooltip/index.md +21 -0
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/package.json +18 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ylf-separator-demo">
|
|
3
|
+
<div>
|
|
4
|
+
<h3>给生活一点颜色</h3>
|
|
5
|
+
<p>六段纯色,连接云乐坊的每一份好奇。</p>
|
|
6
|
+
<YlfSeparator variant="spectrum" class="my-4" />
|
|
7
|
+
<div class="flex flex-wrap gap-2">
|
|
8
|
+
<YlfBadge variant="accent" tone="cyan" appearance="soft">
|
|
9
|
+
探索工具
|
|
10
|
+
</YlfBadge>
|
|
11
|
+
<YlfBadge variant="accent" tone="pink" appearance="soft">
|
|
12
|
+
记录灵感
|
|
13
|
+
</YlfBadge>
|
|
14
|
+
<YlfBadge variant="accent" tone="coral" appearance="soft">
|
|
15
|
+
参加活动
|
|
16
|
+
</YlfBadge>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="text-sm">
|
|
20
|
+
<p>正文分节保持安静</p>
|
|
21
|
+
<YlfSeparator class="my-3" />
|
|
22
|
+
<p>中性细线负责结构,彩色线用于品牌或分类。</p>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex items-center gap-3 text-sm">
|
|
25
|
+
<span>探索</span>
|
|
26
|
+
<YlfSeparator orientation="vertical" variant="accent" tone="cyan" class="h-4!" />
|
|
27
|
+
<span>创作</span>
|
|
28
|
+
<YlfSeparator orientation="vertical" variant="accent" tone="pink" class="h-4!" />
|
|
29
|
+
<span>分享</span>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<style scoped>
|
|
35
|
+
.ylf-separator-demo {
|
|
36
|
+
display: grid;
|
|
37
|
+
gap: var(--ylf-space-8);
|
|
38
|
+
width: 100%;
|
|
39
|
+
max-width: 560px;
|
|
40
|
+
}
|
|
41
|
+
.ylf-separator-demo h3 {
|
|
42
|
+
margin: 0 0 var(--ylf-space-2);
|
|
43
|
+
font-size: var(--ylf-text-lg);
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
.ylf-separator-demo p {
|
|
47
|
+
margin: 0;
|
|
48
|
+
color: var(--ylf-c-text-2);
|
|
49
|
+
font-size: var(--ylf-text-sm);
|
|
50
|
+
line-height: var(--ylf-leading-body);
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Separator
|
|
3
|
+
title_zh: 分隔线
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
分隔线:基于 [reka-ui](https://reka-ui.com),支持水平 / 垂直与语义化(`decorative` 控制是否对屏幕阅读器可见)。
|
|
7
|
+
|
|
8
|
+
正文默认使用中性细线。`brand` 使用晴空蓝;`accent` 配合 `tone` 区分内容;`spectrum` 用六段纯色拼接,适合页头、品牌区或活动入口。彩色拼接不铺在正文下方,也不作为唯一的状态提示。
|
|
9
|
+
|
|
10
|
+
垂直分隔线需要父布局或调用方提供高度,例如 `style="height: 24px"`。
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
15
|
+
| ------------- | ----------------------- | ----------------------------------------------- | ------------ |
|
|
16
|
+
| `orientation` | 方向 | `horizontal \| vertical` | `horizontal` |
|
|
17
|
+
| `decorative` | 仅装饰 | `boolean` | `true` |
|
|
18
|
+
| `variant` | 视觉角色 | `neutral \| brand \| accent \| spectrum` | `neutral` |
|
|
19
|
+
| `tone` | 强调色,仅用于 `accent` | `blue \| sun \| cyan \| coral \| pink \| green` | `blue` |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const single = ref([40])
|
|
5
|
+
const range = ref([20, 70])
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div class="flex flex-col gap-6">
|
|
10
|
+
<div class="flex flex-col gap-2">
|
|
11
|
+
<YlfSlider v-model="single" />
|
|
12
|
+
<p class="m-0 text-sm op-70">
|
|
13
|
+
单值:{{ single[0] }}
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="flex flex-col gap-2">
|
|
17
|
+
<YlfSlider v-model="range" />
|
|
18
|
+
<p class="m-0 text-sm op-70">
|
|
19
|
+
区间:{{ range[0] }} – {{ range[1] }}
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Slider
|
|
3
|
+
title_zh: 滑块
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
滑块:拖拽、键盘步进、多滑块区间基于 [reka-ui](https://reka-ui.com),外观走 token。`v-model` 为数组,单值传 `[n]`、区间传 `[a, b]`。
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
|
|
10
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
11
|
+
| ---------- | ------ | ---------- | ------- |
|
|
12
|
+
| `v-model` | 当前值 | `number[]` | `[50]` |
|
|
13
|
+
| `min` | 最小值 | `number` | `0` |
|
|
14
|
+
| `max` | 最大值 | `number` | `100` |
|
|
15
|
+
| `step` | 步长 | `number` | `1` |
|
|
16
|
+
| `disabled` | 禁用 | `boolean` | `false` |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const brand = ref(true)
|
|
5
|
+
const accent = ref(true)
|
|
6
|
+
const small = ref(false)
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="flex flex-col gap-5">
|
|
11
|
+
<div class="flex flex-wrap items-center gap-6">
|
|
12
|
+
<div class="flex items-center gap-2">
|
|
13
|
+
<YlfSwitch v-model="brand" aria-label="主色开关" />
|
|
14
|
+
<span class="text-sm">brand 实色</span>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="flex items-center gap-2">
|
|
17
|
+
<YlfSwitch v-model="accent" aria-label="青色开关" variant="accent" tone="cyan" />
|
|
18
|
+
<span class="text-sm">accent 青色</span>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="flex items-center gap-2">
|
|
21
|
+
<YlfSwitch v-model="small" aria-label="小号开关" size="sm" />
|
|
22
|
+
<span class="text-sm">small</span>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="flex items-center gap-2 op-60">
|
|
25
|
+
<YlfSwitch :model-value="true" aria-label="禁用开关" disabled />
|
|
26
|
+
<span class="text-sm">disabled</span>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<p class="text-sm op-70">
|
|
30
|
+
当前:brand = {{ brand }} · accent = {{ accent }}
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Switch
|
|
3
|
+
title_zh: 开关
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
开关:行为与可访问性基于 [reka-ui](https://reka-ui.com)(`role="switch"`、键盘 Space / Enter、焦点管理),外观使用共享主题 token —— reka 管行为,我们管皮肤。
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
|
|
10
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
11
|
+
| ---------- | ------------------------- | ----------------------------------------------- | ------- |
|
|
12
|
+
| `v-model` | 开关状态 | `boolean` | `false` |
|
|
13
|
+
| `variant` | on 态轨道 | `brand \| accent` | `brand` |
|
|
14
|
+
| `tone` | 强调色,仅作用于 `accent` | `blue \| sun \| cyan \| coral \| pink \| green` | `blue` |
|
|
15
|
+
| `size` | 尺寸 | `sm \| md` | `md` |
|
|
16
|
+
| `disabled` | 禁用 | `boolean` | `false` |
|
|
17
|
+
|
|
18
|
+
`tone` 接受 `blue | sun | cyan | coral | pink | green`,默认 `blue`(晴空蓝),只在 `accent` 下生效。旧 `aurora` 值映射到 `accent`。同一流程中的同类状态使用同一种颜色。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const tab = ref('cloud')
|
|
5
|
+
const items = [
|
|
6
|
+
{ label: '云', value: 'cloud' },
|
|
7
|
+
{ label: '乐', value: 'fun' },
|
|
8
|
+
{ label: '坊', value: 'studio' },
|
|
9
|
+
]
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<YlfTabs v-model="tab" :items="items">
|
|
14
|
+
<template #cloud>
|
|
15
|
+
<p class="m-0 text-sm">
|
|
16
|
+
云:一片属于云乐坊的天空。
|
|
17
|
+
</p>
|
|
18
|
+
</template>
|
|
19
|
+
<template #fun>
|
|
20
|
+
<p class="m-0 text-sm">
|
|
21
|
+
乐:缤纷多彩,明快而笃定。
|
|
22
|
+
</p>
|
|
23
|
+
</template>
|
|
24
|
+
<template #studio>
|
|
25
|
+
<p class="m-0 text-sm">
|
|
26
|
+
坊:一套统一的组件工坊。
|
|
27
|
+
</p>
|
|
28
|
+
</template>
|
|
29
|
+
</YlfTabs>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tabs
|
|
3
|
+
title_zh: 标签页
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
标签页:键盘导航(方向键 / Home / End)、roving focus 基于 [reka-ui](https://reka-ui.com),滑动指示条与外观走 token。
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
|
|
10
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
11
|
+
| ------------- | ------------------------------------ | ------------------------ | ------------ |
|
|
12
|
+
| `v-model` | 当前标签 | `string` | — |
|
|
13
|
+
| `items` | 标签项 `{ label, value, disabled? }` | `TabItem[]` | — |
|
|
14
|
+
| `orientation` | 方向 | `horizontal \| vertical` | `horizontal` |
|
|
15
|
+
|
|
16
|
+
## Slots
|
|
17
|
+
|
|
18
|
+
每个标签的内容用 `value` 同名插槽提供,如 `#cloud`、`#fun`。
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shared accents, defaulting to sky blue. Status colors use their own semantic variants. */
|
|
2
|
+
export type YlfAccentTone = 'blue' | 'sun' | 'cyan' | 'coral' | 'pink' | 'green'
|
|
3
|
+
|
|
4
|
+
/** Visual emphasis for accent and status buttons/badges. */
|
|
5
|
+
export type YlfColorAppearance = 'solid' | 'soft' | 'outline'
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-wrap items-center gap-3">
|
|
3
|
+
<YlfTooltip content="悬停在云端之上 ☁️" side="top">
|
|
4
|
+
<YlfButton variant="secondary">
|
|
5
|
+
上方提示
|
|
6
|
+
</YlfButton>
|
|
7
|
+
</YlfTooltip>
|
|
8
|
+
<YlfTooltip content="行为与定位都来自 reka-ui" side="bottom">
|
|
9
|
+
<YlfButton variant="secondary">
|
|
10
|
+
下方提示
|
|
11
|
+
</YlfButton>
|
|
12
|
+
</YlfTooltip>
|
|
13
|
+
<YlfTooltip content="皮肤是云乐坊 token" side="right">
|
|
14
|
+
<YlfButton variant="soft">
|
|
15
|
+
右侧提示
|
|
16
|
+
</YlfButton>
|
|
17
|
+
</YlfTooltip>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Tooltip
|
|
3
|
+
title_zh: 文字提示
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
文字提示:定位与可访问性基于 [reka-ui](https://reka-ui.com)(floating 定位、延迟、`aria-describedby`),外观走 token。
|
|
7
|
+
|
|
8
|
+
## Props
|
|
9
|
+
|
|
10
|
+
| 属性 | 说明 | 类型 | 默认值 |
|
|
11
|
+
| --------- | ---------- | -------------------------------- | ------ |
|
|
12
|
+
| `content` | 提示文字 | `string` | — |
|
|
13
|
+
| `side` | 方向 | `top \| right \| bottom \| left` | `top` |
|
|
14
|
+
| `delay` | 延迟(ms) | `number` | `300` |
|
|
15
|
+
|
|
16
|
+
## Slots
|
|
17
|
+
|
|
18
|
+
| 名称 | 说明 |
|
|
19
|
+
| --------- | ---------------------- |
|
|
20
|
+
| `default` | 触发元素(`as-child`) |
|
|
21
|
+
| `content` | 自定义提示内容 |
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
const node_path = require('node:path');
|
|
4
4
|
const node_url = require('node:url');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
7
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
7
8
|
const componentsDir = node_path.resolve(_dirname, "../components");
|
|
8
9
|
|
|
9
10
|
exports._dirname = _dirname;
|
package/dist/index.d.cts
CHANGED
|
@@ -19,7 +19,13 @@ interface BottomMenuItem {
|
|
|
19
19
|
onClick?: (...args: any[]) => void;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** Shared accents, defaulting to sky blue. Status colors use their own semantic variants. */
|
|
23
|
+
type YlfAccentTone = 'blue' | 'sun' | 'cyan' | 'coral' | 'pink' | 'green';
|
|
24
|
+
/** Visual emphasis for accent and status buttons/badges. */
|
|
25
|
+
type YlfColorAppearance = 'solid' | 'soft' | 'outline';
|
|
26
|
+
|
|
22
27
|
declare const _dirname: string;
|
|
23
28
|
declare const componentsDir: string;
|
|
24
29
|
|
|
25
|
-
export {
|
|
30
|
+
export { _dirname, componentsDir };
|
|
31
|
+
export type { BottomMenuItem, YlfAccentTone, YlfColorAppearance };
|
package/dist/index.d.mts
CHANGED
|
@@ -19,7 +19,13 @@ interface BottomMenuItem {
|
|
|
19
19
|
onClick?: (...args: any[]) => void;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** Shared accents, defaulting to sky blue. Status colors use their own semantic variants. */
|
|
23
|
+
type YlfAccentTone = 'blue' | 'sun' | 'cyan' | 'coral' | 'pink' | 'green';
|
|
24
|
+
/** Visual emphasis for accent and status buttons/badges. */
|
|
25
|
+
type YlfColorAppearance = 'solid' | 'soft' | 'outline';
|
|
26
|
+
|
|
22
27
|
declare const _dirname: string;
|
|
23
28
|
declare const componentsDir: string;
|
|
24
29
|
|
|
25
|
-
export {
|
|
30
|
+
export { _dirname, componentsDir };
|
|
31
|
+
export type { BottomMenuItem, YlfAccentTone, YlfColorAppearance };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,13 @@ interface BottomMenuItem {
|
|
|
19
19
|
onClick?: (...args: any[]) => void;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/** Shared accents, defaulting to sky blue. Status colors use their own semantic variants. */
|
|
23
|
+
type YlfAccentTone = 'blue' | 'sun' | 'cyan' | 'coral' | 'pink' | 'green';
|
|
24
|
+
/** Visual emphasis for accent and status buttons/badges. */
|
|
25
|
+
type YlfColorAppearance = 'solid' | 'soft' | 'outline';
|
|
26
|
+
|
|
22
27
|
declare const _dirname: string;
|
|
23
28
|
declare const componentsDir: string;
|
|
24
29
|
|
|
25
|
-
export {
|
|
30
|
+
export { _dirname, componentsDir };
|
|
31
|
+
export type { BottomMenuItem, YlfAccentTone, YlfColorAppearance };
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yunlefun/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.1.2",
|
|
5
|
+
"description": "Vue components and Nuxt integration for YunLeFun Design",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./components/*": "./components/*",
|
|
8
8
|
"./nuxt": "./nuxt.mjs",
|
|
@@ -27,7 +27,22 @@
|
|
|
27
27
|
"release": "bumpp --no-commit --no-tag --no-push && npm publish",
|
|
28
28
|
"typecheck": "vue-tsc --noEmit"
|
|
29
29
|
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"nuxt": "^4.0.0",
|
|
32
|
+
"sass": "^1.101.0",
|
|
33
|
+
"vue": "^3.5.0"
|
|
34
|
+
},
|
|
35
|
+
"peerDependenciesMeta": {
|
|
36
|
+
"nuxt": {
|
|
37
|
+
"optional": true
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"reka-ui": "^2.10.1"
|
|
42
|
+
},
|
|
30
43
|
"devDependencies": {
|
|
31
|
-
"nuxt": "^
|
|
44
|
+
"nuxt": "^4.5.2",
|
|
45
|
+
"sass": "^1.101.0",
|
|
46
|
+
"typescript": "5.9.3"
|
|
32
47
|
}
|
|
33
48
|
}
|