@fulate/components 1.0.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 (34) hide show
  1. package/README.md +37 -0
  2. package/dist/components/button/button.d.ts +81 -0
  3. package/dist/components/button/style.d.ts +18 -0
  4. package/dist/components/button/types.d.ts +1 -0
  5. package/dist/components/checkbox/checkbox.d.ts +106 -0
  6. package/dist/components/dialog/dialog.d.ts +64 -0
  7. package/dist/components/field/border.d.ts +9 -0
  8. package/dist/components/field/field.d.ts +149 -0
  9. package/dist/components/field/style.d.ts +18 -0
  10. package/dist/components/input/input.d.ts +80 -0
  11. package/dist/components/message/message.d.ts +44 -0
  12. package/dist/components/message/types.d.ts +19 -0
  13. package/dist/components/popover/popover.d.ts +114 -0
  14. package/dist/components/popover/types.d.ts +1 -0
  15. package/dist/components/radio/radio.d.ts +105 -0
  16. package/dist/components/select/select.d.ts +91 -0
  17. package/dist/components/select/types.d.ts +4 -0
  18. package/dist/components/switch/switch.d.ts +52 -0
  19. package/dist/components/tooltip/tooltip.d.ts +58 -0
  20. package/dist/composables/context.d.ts +9 -0
  21. package/dist/composables/index.d.ts +3 -0
  22. package/dist/composables/outside-click.d.ts +6 -0
  23. package/dist/composables/overlay-position.d.ts +10 -0
  24. package/dist/index.d.ts +19 -0
  25. package/dist/index.js +2263 -0
  26. package/dist/internal/control-size.d.ts +14 -0
  27. package/dist/internal/interaction.d.ts +14 -0
  28. package/dist/internal/ripple.d.ts +5 -0
  29. package/dist/internal/state-layer.d.ts +9 -0
  30. package/dist/theme/index.d.ts +1 -0
  31. package/dist/theme/md3.d.ts +25 -0
  32. package/dist/types/control.d.ts +1 -0
  33. package/dist/types/floating.d.ts +4 -0
  34. package/package.json +31 -0
@@ -0,0 +1,114 @@
1
+ import { type PropType } from "@vue/runtime-core";
2
+ import type { Placement } from "@fulate/ui";
3
+ import type { ElementReference } from "../../types/floating";
4
+ import type { PopoverTrigger } from "./types";
5
+ /** A popover surface anchored by its reference slot or an external Element. */
6
+ export declare const FPopover: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
7
+ modelValue: {
8
+ type: BooleanConstructor;
9
+ default: any;
10
+ };
11
+ visible: {
12
+ type: BooleanConstructor;
13
+ default: any;
14
+ };
15
+ triggerRef: {
16
+ type: PropType<ElementReference | null>;
17
+ default: any;
18
+ };
19
+ trigger: {
20
+ type: PropType<PopoverTrigger>;
21
+ default: string;
22
+ };
23
+ placement: {
24
+ type: PropType<Placement>;
25
+ default: string;
26
+ };
27
+ title: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ content: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ width: {
36
+ type: NumberConstructor;
37
+ default: any;
38
+ };
39
+ gap: {
40
+ type: NumberConstructor;
41
+ default: number;
42
+ };
43
+ disabled: {
44
+ type: BooleanConstructor;
45
+ default: boolean;
46
+ };
47
+ closeOnEscape: {
48
+ type: BooleanConstructor;
49
+ default: boolean;
50
+ };
51
+ }>, () => import("vue/jsx-runtime").JSX.Element | import("@vue/runtime-core").VNode<import("@vue/runtime-core").RendererNode, import("@vue/runtime-core").RendererElement, {
52
+ [key: string]: any;
53
+ }>[], {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("update:modelValue" | "update:visible" | "clickOutside")[], "update:modelValue" | "update:visible" | "clickOutside", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
54
+ modelValue: {
55
+ type: BooleanConstructor;
56
+ default: any;
57
+ };
58
+ visible: {
59
+ type: BooleanConstructor;
60
+ default: any;
61
+ };
62
+ triggerRef: {
63
+ type: PropType<ElementReference | null>;
64
+ default: any;
65
+ };
66
+ trigger: {
67
+ type: PropType<PopoverTrigger>;
68
+ default: string;
69
+ };
70
+ placement: {
71
+ type: PropType<Placement>;
72
+ default: string;
73
+ };
74
+ title: {
75
+ type: StringConstructor;
76
+ default: string;
77
+ };
78
+ content: {
79
+ type: StringConstructor;
80
+ default: string;
81
+ };
82
+ width: {
83
+ type: NumberConstructor;
84
+ default: any;
85
+ };
86
+ gap: {
87
+ type: NumberConstructor;
88
+ default: number;
89
+ };
90
+ disabled: {
91
+ type: BooleanConstructor;
92
+ default: boolean;
93
+ };
94
+ closeOnEscape: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
98
+ }>> & Readonly<{
99
+ "onUpdate:modelValue"?: (...args: any[]) => any;
100
+ "onUpdate:visible"?: (...args: any[]) => any;
101
+ onClickOutside?: (...args: any[]) => any;
102
+ }>, {
103
+ visible: boolean;
104
+ width: number;
105
+ placement: Placement;
106
+ disabled: boolean;
107
+ trigger: PopoverTrigger;
108
+ title: string;
109
+ modelValue: boolean;
110
+ triggerRef: ElementReference;
111
+ gap: number;
112
+ content: string;
113
+ closeOnEscape: boolean;
114
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1 @@
1
+ export type PopoverTrigger = "click" | "hover" | "focus" | "contextmenu" | "manual";
@@ -0,0 +1,105 @@
1
+ import { type PropType } from "@vue/runtime-core";
2
+ import type { ControlSize } from "../../types/control";
3
+ export declare const FRadioGroup: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
4
+ modelValue: {
5
+ type: StringConstructor;
6
+ default: string;
7
+ };
8
+ disabled: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ size: {
13
+ type: PropType<ControlSize>;
14
+ default: ControlSize;
15
+ };
16
+ direction: {
17
+ type: PropType<"row" | "column">;
18
+ default: string;
19
+ };
20
+ gap: {
21
+ type: NumberConstructor;
22
+ default: any;
23
+ };
24
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
25
+ modelValue: {
26
+ type: StringConstructor;
27
+ default: string;
28
+ };
29
+ disabled: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ size: {
34
+ type: PropType<ControlSize>;
35
+ default: ControlSize;
36
+ };
37
+ direction: {
38
+ type: PropType<"row" | "column">;
39
+ default: string;
40
+ };
41
+ gap: {
42
+ type: NumberConstructor;
43
+ default: any;
44
+ };
45
+ }>> & Readonly<{
46
+ onChange?: (...args: any[]) => any;
47
+ "onUpdate:modelValue"?: (...args: any[]) => any;
48
+ }>, {
49
+ size: ControlSize;
50
+ disabled: boolean;
51
+ modelValue: string;
52
+ gap: number;
53
+ direction: "row" | "column";
54
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
55
+ export declare const FRadio: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
56
+ value: {
57
+ type: StringConstructor;
58
+ required: true;
59
+ };
60
+ label: {
61
+ type: StringConstructor;
62
+ default: string;
63
+ };
64
+ disabled: {
65
+ type: BooleanConstructor;
66
+ default: boolean;
67
+ };
68
+ size: {
69
+ type: PropType<ControlSize>;
70
+ default: any;
71
+ };
72
+ modelValue: {
73
+ type: BooleanConstructor;
74
+ default: any;
75
+ };
76
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
77
+ value: {
78
+ type: StringConstructor;
79
+ required: true;
80
+ };
81
+ label: {
82
+ type: StringConstructor;
83
+ default: string;
84
+ };
85
+ disabled: {
86
+ type: BooleanConstructor;
87
+ default: boolean;
88
+ };
89
+ size: {
90
+ type: PropType<ControlSize>;
91
+ default: any;
92
+ };
93
+ modelValue: {
94
+ type: BooleanConstructor;
95
+ default: any;
96
+ };
97
+ }>> & Readonly<{
98
+ onChange?: (...args: any[]) => any;
99
+ "onUpdate:modelValue"?: (...args: any[]) => any;
100
+ }>, {
101
+ size: ControlSize;
102
+ label: string;
103
+ disabled: boolean;
104
+ modelValue: boolean;
105
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,91 @@
1
+ import { type PropType } from "@vue/runtime-core";
2
+ import type { SelectOption } from "./types";
3
+ export declare const FSelect: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
4
+ modelValue: {
5
+ type: StringConstructor;
6
+ default: string;
7
+ };
8
+ label: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ options: {
13
+ type: PropType<readonly SelectOption[]>;
14
+ default: () => any[];
15
+ };
16
+ placeholder: {
17
+ type: StringConstructor;
18
+ default: string;
19
+ };
20
+ disabled: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
24
+ size: {
25
+ type: PropType<import("../..").ControlSize>;
26
+ default: import("../..").ControlSize;
27
+ };
28
+ width: {
29
+ type: NumberConstructor;
30
+ default: number;
31
+ };
32
+ height: {
33
+ type: NumberConstructor;
34
+ default: any;
35
+ };
36
+ fontSize: {
37
+ type: NumberConstructor;
38
+ default: any;
39
+ };
40
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "update:modelValue" | "visibleChange")[], "change" | "update:modelValue" | "visibleChange", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
41
+ modelValue: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ label: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ options: {
50
+ type: PropType<readonly SelectOption[]>;
51
+ default: () => any[];
52
+ };
53
+ placeholder: {
54
+ type: StringConstructor;
55
+ default: string;
56
+ };
57
+ disabled: {
58
+ type: BooleanConstructor;
59
+ default: boolean;
60
+ };
61
+ size: {
62
+ type: PropType<import("../..").ControlSize>;
63
+ default: import("../..").ControlSize;
64
+ };
65
+ width: {
66
+ type: NumberConstructor;
67
+ default: number;
68
+ };
69
+ height: {
70
+ type: NumberConstructor;
71
+ default: any;
72
+ };
73
+ fontSize: {
74
+ type: NumberConstructor;
75
+ default: any;
76
+ };
77
+ }>> & Readonly<{
78
+ onChange?: (...args: any[]) => any;
79
+ "onUpdate:modelValue"?: (...args: any[]) => any;
80
+ onVisibleChange?: (...args: any[]) => any;
81
+ }>, {
82
+ width: number;
83
+ height: number;
84
+ fontSize: number;
85
+ size: import("../..").ControlSize;
86
+ label: string;
87
+ disabled: boolean;
88
+ placeholder: string;
89
+ modelValue: string;
90
+ options: readonly SelectOption[];
91
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,4 @@
1
+ export interface SelectOption {
2
+ label: string;
3
+ value: string;
4
+ }
@@ -0,0 +1,52 @@
1
+ export declare const FSwitch: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
2
+ modelValue: {
3
+ type: BooleanConstructor;
4
+ default: boolean;
5
+ };
6
+ disabled: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ activeColor: {
11
+ type: StringConstructor;
12
+ default: string;
13
+ };
14
+ size: {
15
+ type: import("@vue/runtime-core").PropType<import("../..").ControlSize>;
16
+ default: import("../..").ControlSize;
17
+ };
18
+ label: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("change" | "update:modelValue")[], "change" | "update:modelValue", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
23
+ modelValue: {
24
+ type: BooleanConstructor;
25
+ default: boolean;
26
+ };
27
+ disabled: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ activeColor: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ size: {
36
+ type: import("@vue/runtime-core").PropType<import("../..").ControlSize>;
37
+ default: import("../..").ControlSize;
38
+ };
39
+ label: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ }>> & Readonly<{
44
+ onChange?: (...args: any[]) => any;
45
+ "onUpdate:modelValue"?: (...args: any[]) => any;
46
+ }>, {
47
+ size: import("../..").ControlSize;
48
+ label: string;
49
+ disabled: boolean;
50
+ modelValue: boolean;
51
+ activeColor: string;
52
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,58 @@
1
+ import { type PropType } from "@vue/runtime-core";
2
+ import { type Placement } from "@fulate/ui";
3
+ import type { ElementReference } from "../../types/floating";
4
+ /** 由所属 Root 的唯一 completion 路径定位的受控 Canvas tooltip。 */
5
+ export declare const FTooltip: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ExtractPropTypes<{
6
+ visible: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ triggerRef: {
11
+ type: PropType<ElementReference | null>;
12
+ default: any;
13
+ };
14
+ placement: {
15
+ type: PropType<Placement>;
16
+ default: string;
17
+ };
18
+ width: {
19
+ type: NumberConstructor;
20
+ default: any;
21
+ };
22
+ gap: {
23
+ type: NumberConstructor;
24
+ default: number;
25
+ };
26
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, ("mouseenter" | "mouseleave" | "update:visible" | "clickOutside")[], "mouseenter" | "mouseleave" | "update:visible" | "clickOutside", import("@vue/runtime-core").PublicProps, Readonly<import("@vue/runtime-core").ExtractPropTypes<{
27
+ visible: {
28
+ type: BooleanConstructor;
29
+ default: boolean;
30
+ };
31
+ triggerRef: {
32
+ type: PropType<ElementReference | null>;
33
+ default: any;
34
+ };
35
+ placement: {
36
+ type: PropType<Placement>;
37
+ default: string;
38
+ };
39
+ width: {
40
+ type: NumberConstructor;
41
+ default: any;
42
+ };
43
+ gap: {
44
+ type: NumberConstructor;
45
+ default: number;
46
+ };
47
+ }>> & Readonly<{
48
+ onMouseenter?: (...args: any[]) => any;
49
+ onMouseleave?: (...args: any[]) => any;
50
+ "onUpdate:visible"?: (...args: any[]) => any;
51
+ onClickOutside?: (...args: any[]) => any;
52
+ }>, {
53
+ visible: boolean;
54
+ width: number;
55
+ placement: Placement;
56
+ triggerRef: ElementReference;
57
+ gap: number;
58
+ }, {}, {}, {}, string, import("@vue/runtime-core").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,9 @@
1
+ import type { Layer, Root } from "@fulate/core";
2
+ export declare function useOverlay(): {
3
+ overlay: Layer<import("@fulate/core").LayerProperties, import("@fulate/core").LayerOption>;
4
+ fulateRoot: Root;
5
+ };
6
+ export declare function useVueShapeSize(): {
7
+ width: number;
8
+ height: number;
9
+ };
@@ -0,0 +1,3 @@
1
+ export { useOverlay, useVueShapeSize } from "./context";
2
+ export { isDescendantOf, useOutsideClick } from "./outside-click";
3
+ export { useOverlayPosition } from "./overlay-position";
@@ -0,0 +1,6 @@
1
+ import { type MaybeRefOrGetter, type Ref } from "@vue/runtime-core";
2
+ import type { Element, Node } from "@fulate/core";
3
+ type ElementRef = Readonly<Ref<Element | null | undefined>>;
4
+ export declare function isDescendantOf(node: Node | null | undefined, ancestor: Node | null | undefined): boolean;
5
+ export declare function useOutsideClick(open: MaybeRefOrGetter<boolean>, excludeRefs: readonly ElementRef[], onClose: () => void): void;
6
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type MaybeRefOrGetter, type Ref } from "@vue/runtime-core";
2
+ import { Element } from "@fulate/core";
3
+ import { type ComputePositionOptions } from "@fulate/ui";
4
+ type ElementRef = Readonly<Ref<Element | null | undefined>>;
5
+ /**
6
+ * 把 open/ref/options 与场景、viewport、scroll、resize 的定位失效合并到所属
7
+ * Root 的 frame-final completion;每次只安装仍由当前 task/refs 拥有的结果。
8
+ */
9
+ export declare function useOverlayPosition(open: MaybeRefOrGetter<boolean>, triggerRef: ElementRef, floatingRef: ElementRef, options?: MaybeRefOrGetter<ComputePositionOptions>): void;
10
+ export {};
@@ -0,0 +1,19 @@
1
+ import "@fulate/yoga";
2
+ export { isDescendantOf, useOutsideClick, useOverlay, useOverlayPosition, useVueShapeSize } from "./composables";
3
+ export { FButton } from "./components/button/button";
4
+ export type { ButtonVariant } from "./components/button/types";
5
+ export { FInput } from "./components/input/input";
6
+ export { FSelect } from "./components/select/select";
7
+ export type { SelectOption } from "./components/select/types";
8
+ export { FTooltip } from "./components/tooltip/tooltip";
9
+ export { FPopover } from "./components/popover/popover";
10
+ export type { ElementReference } from "./types/floating";
11
+ export type { PopoverTrigger } from "./components/popover/types";
12
+ export { FRadio, FRadioGroup } from "./components/radio/radio";
13
+ export { FCheckbox, FCheckboxGroup } from "./components/checkbox/checkbox";
14
+ export { FSwitch } from "./components/switch/switch";
15
+ export { FDialog } from "./components/dialog/dialog";
16
+ export { FMessage, useMessage } from "./components/message/message";
17
+ export type { MessageApi, MessageHandle, MessageInput, MessageOptions, MessageType } from "./components/message/types";
18
+ export { MD3 } from "./theme";
19
+ export type { ControlSize } from "./types/control";