@acrool/react-picker 1.1.5 → 2.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.
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,7 +1,22 @@
1
1
  import { default as CSS } from 'csstype';
2
- import { Transition, Variant } from 'framer-motion';
3
- type TVariantKey = 'initial' | 'animate' | 'exit';
4
- export type TAnimationVariants = Record<TVariantKey, Variant>;
2
+ /**
3
+ * 動畫曲線: 具名曲線,或貝茲曲線的四個數值
4
+ */
5
+ export type TPickerEase = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | [number, number, number, number];
6
+ type TKeyframeValue = string | number;
7
+ /**
8
+ * 一段動畫 (由 Web Animations API 播放)
9
+ * keyframes: CSS 屬性對應的影格,單一值代表「由目前狀態到該值」,陣列代表完整影格
10
+ * 位移、縮放請寫成 transform 字串,例如 {transform: ['translateY(100%)', 'translateY(0%)']}
11
+ */
12
+ export interface IPickerAnimation {
13
+ keyframes: Record<string, TKeyframeValue | TKeyframeValue[]>;
14
+ options?: {
15
+ duration?: number;
16
+ delay?: number;
17
+ ease?: TPickerEase;
18
+ };
19
+ }
5
20
  export declare enum EVertical {
6
21
  bottom = "bottom",
7
22
  top = "top"
@@ -15,9 +30,15 @@ export interface IPosition {
15
30
  vertical: EVertical;
16
31
  horizontal: EHorizontal;
17
32
  }
33
+ /**
34
+ * 選單內容的動畫設定
35
+ * style: 不參與動畫的固定樣式 (例如定位)
36
+ * enter: 進場動畫
37
+ * exit: 離場動畫
38
+ */
18
39
  export interface IMotionOptions {
19
- variants?: TAnimationVariants;
20
- transition?: Transition;
40
+ enter?: IPickerAnimation;
41
+ exit?: IPickerAnimation;
21
42
  className?: string;
22
43
  style?: CSS.Properties;
23
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acrool/react-picker",
3
- "version": "1.1.5",
3
+ "version": "2.0.0",
4
4
  "description": "This is a react method to quickly combine buttons with Picker",
5
5
  "keywords": [
6
6
  "acrool",
@@ -56,7 +56,7 @@
56
56
  "@acrool/js-logger": "^1.0.26",
57
57
  "@acrool/react-portal": "^1.1.2",
58
58
  "clsx": "^2.1.1",
59
- "framer-motion": "^11.18.2",
59
+ "motion": "^14.14.0",
60
60
  "ulid": "^2.3.0"
61
61
  },
62
62
  "devDependencies": {