fluekit 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 (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/dist/Align.d.ts +25 -0
  4. package/dist/AnimatedContainer.d.ts +41 -0
  5. package/dist/AnimatedOpacity.d.ts +25 -0
  6. package/dist/Border.d.ts +16 -0
  7. package/dist/BorderRadius.d.ts +12 -0
  8. package/dist/BoxConstraints.d.ts +9 -0
  9. package/dist/BoxDecoration.d.ts +89 -0
  10. package/dist/Center.d.ts +29 -0
  11. package/dist/Column.d.ts +18 -0
  12. package/dist/Container.d.ts +37 -0
  13. package/dist/EdgeInsets.d.ts +19 -0
  14. package/dist/Expanded.d.ts +26 -0
  15. package/dist/Fixed.d.ts +20 -0
  16. package/dist/FlexBox.d.ts +26 -0
  17. package/dist/FlexItem.d.ts +30 -0
  18. package/dist/FlexProps.d.ts +131 -0
  19. package/dist/GestureDetector.d.ts +20 -0
  20. package/dist/GridView.d.ts +42 -0
  21. package/dist/IgnorePointer.d.ts +50 -0
  22. package/dist/ListView.d.ts +40 -0
  23. package/dist/Opacity.d.ts +28 -0
  24. package/dist/Padding.d.ts +11 -0
  25. package/dist/Positioned.d.ts +19 -0
  26. package/dist/Row.d.ts +23 -0
  27. package/dist/SafeArea.d.ts +32 -0
  28. package/dist/ScrollView.d.ts +60 -0
  29. package/dist/Size.d.ts +9 -0
  30. package/dist/SizedBox.d.ts +21 -0
  31. package/dist/Stack.d.ts +32 -0
  32. package/dist/Sticky.d.ts +20 -0
  33. package/dist/Text.d.ts +41 -0
  34. package/dist/TextStyle.d.ts +121 -0
  35. package/dist/Transform.d.ts +38 -0
  36. package/dist/Wrap.d.ts +36 -0
  37. package/dist/__tests__/Container.spec.d.ts +1 -0
  38. package/dist/__tests__/normalizeSrc.spec.d.ts +1 -0
  39. package/dist/index.css +2 -0
  40. package/dist/index.d.ts +34 -0
  41. package/dist/index.js +1457 -0
  42. package/dist/px2vw.d.ts +3 -0
  43. package/dist/useChildren.d.ts +3 -0
  44. package/dist/useGesture.d.ts +37 -0
  45. package/dist/useOpacity.d.ts +4 -0
  46. package/dist/usePosition.d.ts +19 -0
  47. package/dist/useSafeAttrs.d.ts +3 -0
  48. package/dist/useStack.d.ts +2 -0
  49. package/dist/utils.d.ts +5 -0
  50. package/package.json +40 -0
@@ -0,0 +1,3 @@
1
+ export declare function setTransform(value: boolean): void;
2
+ export declare function setDefaultVW(value: number): void;
3
+ export declare function px2vw(px: string | number | undefined | null, designWidth?: number): string;
@@ -0,0 +1,3 @@
1
+ import { Slot, VNode } from 'vue';
2
+ export declare function useChildren<T extends unknown = any>(slot?: Slot<T>): VNode[];
3
+ export declare function useChild<T extends unknown = any>(slot?: Slot<T>): VNode | null;
@@ -0,0 +1,37 @@
1
+ import { CSSProperties, PropType, SetupContext } from 'vue';
2
+ export interface GestureDetail {
3
+ globalPosition: {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ delta?: {
8
+ x: number;
9
+ y: number;
10
+ };
11
+ }
12
+ export interface GestureCallbacks {
13
+ onTap?: () => void;
14
+ onClick?: (event: MouseEvent) => void;
15
+ onDbClick?: (event: MouseEvent) => void;
16
+ onDoubleTap?: () => void;
17
+ onLongPress?: () => void;
18
+ onPanStart?: (detail: GestureDetail) => void;
19
+ onPanUpdate?: (detail: Required<GestureDetail>) => void;
20
+ onPanEnd?: () => void;
21
+ }
22
+ export type Behavior = "deferToChild" | "opaque" | "translucent";
23
+ type Events = Record<string, (e: any) => void>;
24
+ export declare const events: string[];
25
+ export type GestureBehavior = PropType<Behavior>;
26
+ export declare function useGestures({ emit }: SetupContext): {
27
+ onClick: (e: MouseEvent) => void;
28
+ onMousedown: (e: MouseEvent) => void;
29
+ onTouchstart: (e: TouchEvent) => void;
30
+ onTouchmove: (e: TouchEvent) => void;
31
+ onTouchend: (e: TouchEvent) => void;
32
+ onTouchcancel: (e: TouchEvent) => void;
33
+ };
34
+ export declare function useGestureStyle(): CSSProperties;
35
+ export declare function useGestureEvents(): any;
36
+ export declare function provideGesture(events: Events, behavior: Behavior): void;
37
+ export {};
@@ -0,0 +1,4 @@
1
+ import { InjectionKey, Ref } from 'vue';
2
+ export declare const OpacityKey: InjectionKey<Ref<number>>;
3
+ export declare function useOpacity(): Ref<number, number>;
4
+ export declare function provideOpacity(opacity: number | Ref<number>): import('vue').ComputedRef<number>;
@@ -0,0 +1,19 @@
1
+ import { CSSProperties } from 'vue';
2
+ export interface Props {
3
+ /** 距离顶部的距离 */
4
+ top?: number | string;
5
+ /** 距离底部的距离 */
6
+ bottom?: number | string;
7
+ /** 距离左侧的距离 */
8
+ left?: number | string;
9
+ /** 距离右侧的距离 */
10
+ right?: number | string;
11
+ /** 宽度 */
12
+ width?: number | string;
13
+ /** 高度 */
14
+ height?: number | string;
15
+ /** z-index 层级 */
16
+ zIndex?: number | string;
17
+ }
18
+ export declare function positionToStyle(props: Props, position?: "absolute" | "fixed" | "sticky" | "relative"): CSSProperties;
19
+ export declare function usePositionStyle(props: Props, position?: "absolute" | "fixed" | "sticky" | "relative"): import('vue').ComputedRef<CSSProperties>;
@@ -0,0 +1,3 @@
1
+ export declare function useSafeAttrs(): import('vue').ComputedRef<{
2
+ [x: string]: unknown;
3
+ }>;
@@ -0,0 +1,2 @@
1
+ export declare function useStackContext(): {};
2
+ export declare const provideStackContext: () => void;
@@ -0,0 +1,5 @@
1
+ export declare function isNumber(value: any): value is number;
2
+ export declare function isUndefined(value: any): value is undefined;
3
+ export declare function isSymbol(value: any): value is symbol;
4
+ export declare function isPureNumber(value: string): boolean;
5
+ export declare function isNumberPx(value: string): boolean;
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "fluekit",
3
+ "version": "1.0.0",
4
+ "description": "A Flutter-style Layout UI kit for Vue",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git@github.com:Fi2zz/fluekit.git"
8
+ },
9
+ "type": "module",
10
+ "main": "./dist/index.js",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "peerDependencies": {
23
+ "vue": "^3.5.0"
24
+ },
25
+ "devDependencies": {
26
+ "@vitejs/plugin-vue": "^6.0.1",
27
+ "@vue/test-utils": "^2.4.6",
28
+ "@vue/tsconfig": "^0.8.1",
29
+ "jsdom": "^27.3.0",
30
+ "typescript": "~5.9.3",
31
+ "vite": "npm:rolldown-vite@7.2.5",
32
+ "vite-plugin-dts": "^4.5.4",
33
+ "vitest": "^4.0.16",
34
+ "vue-tsc": "^3.1.4"
35
+ },
36
+ "scripts": {
37
+ "build": "vite build",
38
+ "test": "vitest"
39
+ }
40
+ }