@yunlefun/vue 0.3.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 (60) 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 +1 -1
  10. package/components/YlfSelect.vue +8 -2
  11. package/components/YlfSlider.vue +32 -2
  12. package/components/YlfTabs.vue +1 -1
  13. package/components/YlfTooltip.vue +5 -2
  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/index.md +1 -1
  27. package/components/select/index.md +6 -0
  28. package/components/slider/demo.vue +2 -2
  29. package/components/slider/index.md +15 -7
  30. package/components/switch/index.md +2 -0
  31. package/components/tabs/index.md +2 -0
  32. package/components/tooltip/index.md +9 -5
  33. package/dist/components/YlfAccordion.vue.d.ts +35 -0
  34. package/dist/components/YlfAiPromptLauncher.vue.d.ts +25 -0
  35. package/dist/components/YlfAvatar.vue.d.ts +14 -0
  36. package/dist/components/YlfBadge.vue.d.ts +29 -0
  37. package/dist/components/YlfBottomMenu.vue.d.ts +19 -0
  38. package/dist/components/YlfBottomMenuItem.vue.d.ts +22 -0
  39. package/dist/components/YlfButton.vue.d.ts +48 -0
  40. package/dist/components/YlfCard.vue.d.ts +28 -0
  41. package/dist/components/YlfCheckbox.vue.d.ts +18 -0
  42. package/dist/components/YlfDialog.vue.d.ts +37 -0
  43. package/dist/components/YlfDropdownMenu.vue.d.ts +34 -0
  44. package/dist/components/YlfLogo.vue.d.ts +13 -0
  45. package/dist/components/YlfPopover.vue.d.ts +31 -0
  46. package/dist/components/YlfProgress.vue.d.ts +17 -0
  47. package/dist/components/YlfRadioGroup.vue.d.ts +24 -0
  48. package/dist/components/YlfSegmentedControl.vue.d.ts +35 -0
  49. package/dist/components/YlfSelect.vue.d.ts +43 -0
  50. package/dist/components/YlfSeparator.vue.d.ts +16 -0
  51. package/dist/components/YlfSlider.vue.d.ts +29 -0
  52. package/dist/components/YlfSwitch.vue.d.ts +24 -0
  53. package/dist/components/YlfTabs.vue.d.ts +32 -0
  54. package/dist/components/YlfTooltip.vue.d.ts +26 -0
  55. package/dist/components/ai-prompt.d.ts +33 -0
  56. package/dist/components/ai-provider-logos.d.ts +3 -0
  57. package/dist/components/bottom-menu/index.d.ts +20 -0
  58. package/dist/components/segmented-control.d.ts +8 -0
  59. package/dist/components/theme.d.ts +4 -0
  60. package/package.json +6 -2
@@ -0,0 +1,24 @@
1
+ import type { YlfAccentTone } from './theme';
2
+ type __VLS_Props = {
3
+ /** on 态轨道:brand 主色(默认)或 accent 纯色;aurora 是 accent 的旧别名 */
4
+ variant?: 'brand' | 'accent' | 'aurora';
5
+ tone?: YlfAccentTone;
6
+ size?: 'sm' | 'md';
7
+ disabled?: boolean;
8
+ };
9
+ type __VLS_ModelProps = {
10
+ modelValue?: boolean;
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
13
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
14
+ "update:modelValue": (value: boolean) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
16
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
17
+ }>, {
18
+ disabled: boolean;
19
+ size: "sm" | "md";
20
+ variant: "brand" | "accent" | "aurora";
21
+ tone: YlfAccentTone;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
@@ -0,0 +1,32 @@
1
+ interface TabItem {
2
+ label: string;
3
+ value: string;
4
+ disabled?: boolean;
5
+ }
6
+ type __VLS_Props = {
7
+ items: readonly TabItem[];
8
+ orientation?: 'horizontal' | 'vertical';
9
+ };
10
+ type __VLS_ModelProps = {
11
+ modelValue?: string;
12
+ };
13
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
14
+ declare var __VLS_32: string, __VLS_33: {};
15
+ type __VLS_Slots = {} & {
16
+ [K in NonNullable<typeof __VLS_32>]?: (props: typeof __VLS_33) => any;
17
+ };
18
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ "update:modelValue": (value: string | undefined) => any;
20
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
21
+ "onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
22
+ }>, {
23
+ orientation: "horizontal" | "vertical";
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -0,0 +1,26 @@
1
+ type __VLS_Props = {
2
+ content?: string;
3
+ side?: 'top' | 'right' | 'bottom' | 'left';
4
+ delay?: number;
5
+ disabled?: boolean;
6
+ portalTo?: string | HTMLElement;
7
+ };
8
+ declare var __VLS_20: {}, __VLS_34: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_20) => any;
11
+ } & {
12
+ content?: (props: typeof __VLS_34) => any;
13
+ };
14
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ disabled: boolean;
16
+ side: "top" | "right" | "bottom" | "left";
17
+ delay: number;
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,33 @@
1
+ /** Services supported by the shared AI prompt launcher. */
2
+ export type AiProviderId = 'yuanbao' | 'doubao' | 'deepseek' | 'chatgpt' | 'claude' | 'cursor';
3
+ export interface AiProvider {
4
+ readonly id: AiProviderId;
5
+ readonly name: string;
6
+ readonly url: string;
7
+ readonly promptParameter?: 'q' | 'text';
8
+ }
9
+ /** Only public entry points belong here; never accept an arbitrary destination URL. */
10
+ export declare const aiProviders: readonly AiProvider[];
11
+ export interface AiPromptOptions {
12
+ /** Optional ChatGPT search hint. Ordinary creative/editorial prompts leave this off. */
13
+ chatgptSearch?: boolean;
14
+ /** Conservative encoded URL budget; Cursor also has a hard 10,000-character limit. */
15
+ maxUrlLength?: number;
16
+ }
17
+ export interface AiPromptTarget {
18
+ provider: AiProvider;
19
+ url: string;
20
+ mode: 'link' | 'copy';
21
+ reason?: 'unsupported' | 'too-long' | 'empty';
22
+ }
23
+ /** Build a lossless handoff. Long prompts use the clipboard, never truncated query text. */
24
+ export declare function buildAiPromptTarget(id: AiProviderId, prompt: string, options?: AiPromptOptions): AiPromptTarget;
25
+ export type AiPromptLaunchStatus = 'opened' | 'copied' | 'copy-failed' | 'open-failed';
26
+ export interface AiPromptLaunchResult {
27
+ target: AiPromptTarget;
28
+ status: AiPromptLaunchStatus;
29
+ }
30
+ /** A desktop host can supply an IPC-backed launcher without exposing Electron to this package. */
31
+ export type AiPromptLaunch = (target: AiPromptTarget, prompt: string) => Promise<AiPromptLaunchStatus>;
32
+ /** Browser fallback. Call synchronously from a click to retain clipboard and popup activation. */
33
+ export declare function copyAndOpenAiPrompt(target: AiPromptTarget, prompt: string): Promise<AiPromptLaunchStatus>;
@@ -0,0 +1,3 @@
1
+ import type { AiProviderId } from './ai-prompt';
2
+ /** Bundled assets: no favicon service or third-party image requests. */
3
+ export declare const aiProviderLogos: Record<AiProviderId, string>;
@@ -0,0 +1,20 @@
1
+ export interface BottomMenuItem {
2
+ title: string;
3
+ /**
4
+ * @description icon class
5
+ */
6
+ icon: string;
7
+ /**
8
+ * @description active icon class
9
+ */
10
+ activeIcon?: string;
11
+ /**
12
+ * @description RouterLink to
13
+ */
14
+ to?: string;
15
+ /**
16
+ * onClick
17
+ * @returns
18
+ */
19
+ onClick?: (...args: any[]) => void;
20
+ }
@@ -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
+ }
@@ -0,0 +1,4 @@
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
+ /** Visual emphasis for accent and status buttons/badges. */
4
+ export type YlfColorAppearance = 'solid' | 'soft' | 'outline';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yunlefun/vue",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "Vue components and Nuxt integration for YunLeFun Design",
6
6
  "author": "YunLeFun",
7
7
  "license": "MIT",
@@ -15,6 +15,10 @@
15
15
  "url": "https://github.com/YunLeFun/design/issues"
16
16
  },
17
17
  "exports": {
18
+ "./components/*.vue": {
19
+ "types": "./dist/components/*.vue.d.ts",
20
+ "default": "./components/*.vue"
21
+ },
18
22
  "./components/*": "./components/*",
19
23
  "./nuxt": "./nuxt.mjs",
20
24
  ".": {
@@ -41,7 +45,7 @@
41
45
  "access": "public"
42
46
  },
43
47
  "scripts": {
44
- "build": "unbuild",
48
+ "build": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\" && vue-tsc --project tsconfig.build.json && unbuild",
45
49
  "prepublishOnly": "npm run build",
46
50
  "release": "bumpp --no-commit --no-tag --no-push && npm publish",
47
51
  "typecheck": "vue-tsc --noEmit"