@cdx-ui/components 0.0.1-beta.79 → 0.0.1-beta.80
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/lib/commonjs/animation/hooks/index.js +17 -0
- package/lib/commonjs/animation/hooks/index.js.map +1 -0
- package/lib/commonjs/animation/hooks/useCombinedAnimationDisabledState.js +50 -0
- package/lib/commonjs/animation/hooks/useCombinedAnimationDisabledState.js.map +1 -0
- package/lib/commonjs/animation/index.js +39 -0
- package/lib/commonjs/animation/index.js.map +1 -0
- package/lib/commonjs/animation/types.js +6 -0
- package/lib/commonjs/animation/types.js.map +1 -0
- package/lib/commonjs/animation/utils.js +223 -0
- package/lib/commonjs/animation/utils.js.map +1 -0
- package/lib/commonjs/components/CLAUDE.md +1 -1
- package/lib/commonjs/components/Card/index.js +45 -17
- package/lib/commonjs/components/Card/index.js.map +1 -1
- package/lib/commonjs/components/Toast/animation.js +329 -0
- package/lib/commonjs/components/Toast/animation.js.map +1 -0
- package/lib/commonjs/components/Toast/hooks.js +66 -0
- package/lib/commonjs/components/Toast/hooks.js.map +1 -0
- package/lib/commonjs/components/Toast/index.js +493 -0
- package/lib/commonjs/components/Toast/index.js.map +1 -0
- package/lib/commonjs/components/Toast/styles.js +141 -0
- package/lib/commonjs/components/Toast/styles.js.map +1 -0
- package/lib/commonjs/components/Toast/types.js +6 -0
- package/lib/commonjs/components/Toast/types.js.map +1 -0
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/index.js +15 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/providers/animation-settings/index.js +31 -0
- package/lib/commonjs/providers/animation-settings/index.js.map +1 -0
- package/lib/commonjs/providers/animation-settings/provider.js +59 -0
- package/lib/commonjs/providers/animation-settings/provider.js.map +1 -0
- package/lib/commonjs/providers/animation-settings/types.js +6 -0
- package/lib/commonjs/providers/animation-settings/types.js.map +1 -0
- package/lib/commonjs/providers/forge-design/index.js +29 -0
- package/lib/commonjs/providers/forge-design/index.js.map +1 -0
- package/lib/commonjs/providers/forge-design/provider.js +71 -0
- package/lib/commonjs/providers/forge-design/provider.js.map +1 -0
- package/lib/commonjs/providers/forge-design/types.js +6 -0
- package/lib/commonjs/providers/forge-design/types.js.map +1 -0
- package/lib/commonjs/providers/text-component/index.js +28 -0
- package/lib/commonjs/providers/text-component/index.js.map +1 -0
- package/lib/commonjs/providers/text-component/provider.js +11 -0
- package/lib/commonjs/providers/text-component/provider.js.map +1 -0
- package/lib/commonjs/providers/text-component/types.js +6 -0
- package/lib/commonjs/providers/text-component/types.js.map +1 -0
- package/lib/commonjs/providers/toast/index.js +33 -0
- package/lib/commonjs/providers/toast/index.js.map +1 -0
- package/lib/commonjs/providers/toast/insets-container.js +160 -0
- package/lib/commonjs/providers/toast/insets-container.js.map +1 -0
- package/lib/commonjs/providers/toast/lifecycle.context.js +36 -0
- package/lib/commonjs/providers/toast/lifecycle.context.js.map +1 -0
- package/lib/commonjs/providers/toast/provider.js +508 -0
- package/lib/commonjs/providers/toast/provider.js.map +1 -0
- package/lib/commonjs/providers/toast/reducer.js +46 -0
- package/lib/commonjs/providers/toast/reducer.js.map +1 -0
- package/lib/commonjs/providers/toast/toast-config.context.js +29 -0
- package/lib/commonjs/providers/toast/toast-config.context.js.map +1 -0
- package/lib/commonjs/providers/toast/toast-item-renderer.js +43 -0
- package/lib/commonjs/providers/toast/toast-item-renderer.js.map +1 -0
- package/lib/commonjs/providers/toast/types.js +6 -0
- package/lib/commonjs/providers/toast/types.js.map +1 -0
- package/lib/module/animation/hooks/index.js +4 -0
- package/lib/module/animation/hooks/index.js.map +1 -0
- package/lib/module/animation/hooks/useCombinedAnimationDisabledState.js +47 -0
- package/lib/module/animation/hooks/useCombinedAnimationDisabledState.js.map +1 -0
- package/lib/module/animation/index.js +6 -0
- package/lib/module/animation/index.js.map +1 -0
- package/lib/module/animation/types.js +4 -0
- package/lib/module/animation/types.js.map +1 -0
- package/lib/module/animation/utils.js +212 -0
- package/lib/module/animation/utils.js.map +1 -0
- package/lib/module/components/CLAUDE.md +1 -1
- package/lib/module/components/Card/index.js +47 -19
- package/lib/module/components/Card/index.js.map +1 -1
- package/lib/module/components/Toast/animation.js +324 -0
- package/lib/module/components/Toast/animation.js.map +1 -0
- package/lib/module/components/Toast/hooks.js +61 -0
- package/lib/module/components/Toast/hooks.js.map +1 -0
- package/lib/module/components/Toast/index.js +487 -0
- package/lib/module/components/Toast/index.js.map +1 -0
- package/lib/module/components/Toast/styles.js +138 -0
- package/lib/module/components/Toast/styles.js.map +1 -0
- package/lib/module/components/Toast/types.js +4 -0
- package/lib/module/components/Toast/types.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/providers/animation-settings/index.js +4 -0
- package/lib/module/providers/animation-settings/index.js.map +1 -0
- package/lib/module/providers/animation-settings/provider.js +52 -0
- package/lib/module/providers/animation-settings/provider.js.map +1 -0
- package/lib/module/providers/animation-settings/types.js +4 -0
- package/lib/module/providers/animation-settings/types.js.map +1 -0
- package/lib/module/providers/forge-design/index.js +5 -0
- package/lib/module/providers/forge-design/index.js.map +1 -0
- package/lib/module/providers/forge-design/provider.js +66 -0
- package/lib/module/providers/forge-design/provider.js.map +1 -0
- package/lib/module/providers/forge-design/types.js +4 -0
- package/lib/module/providers/forge-design/types.js.map +1 -0
- package/lib/module/providers/text-component/index.js +5 -0
- package/lib/module/providers/text-component/index.js.map +1 -0
- package/lib/module/providers/text-component/provider.js +6 -0
- package/lib/module/providers/text-component/provider.js.map +1 -0
- package/lib/module/providers/text-component/types.js +4 -0
- package/lib/module/providers/text-component/types.js.map +1 -0
- package/lib/module/providers/toast/index.js +6 -0
- package/lib/module/providers/toast/index.js.map +1 -0
- package/lib/module/providers/toast/insets-container.js +156 -0
- package/lib/module/providers/toast/insets-container.js.map +1 -0
- package/lib/module/providers/toast/lifecycle.context.js +32 -0
- package/lib/module/providers/toast/lifecycle.context.js.map +1 -0
- package/lib/module/providers/toast/provider.js +503 -0
- package/lib/module/providers/toast/provider.js.map +1 -0
- package/lib/module/providers/toast/reducer.js +42 -0
- package/lib/module/providers/toast/reducer.js.map +1 -0
- package/lib/module/providers/toast/toast-config.context.js +25 -0
- package/lib/module/providers/toast/toast-config.context.js.map +1 -0
- package/lib/module/providers/toast/toast-item-renderer.js +39 -0
- package/lib/module/providers/toast/toast-item-renderer.js.map +1 -0
- package/lib/module/providers/toast/types.js +4 -0
- package/lib/module/providers/toast/types.js.map +1 -0
- package/lib/typescript/animation/hooks/index.d.ts +2 -0
- package/lib/typescript/animation/hooks/index.d.ts.map +1 -0
- package/lib/typescript/animation/hooks/useCombinedAnimationDisabledState.d.ts +22 -0
- package/lib/typescript/animation/hooks/useCombinedAnimationDisabledState.d.ts.map +1 -0
- package/lib/typescript/animation/index.d.ts +4 -0
- package/lib/typescript/animation/index.d.ts.map +1 -0
- package/lib/typescript/animation/types.d.ts +105 -0
- package/lib/typescript/animation/types.d.ts.map +1 -0
- package/lib/typescript/animation/utils.d.ts +120 -0
- package/lib/typescript/animation/utils.d.ts.map +1 -0
- package/lib/typescript/components/Card/index.d.ts +4 -0
- package/lib/typescript/components/Card/index.d.ts.map +1 -1
- package/lib/typescript/components/Toast/animation.d.ts +21 -0
- package/lib/typescript/components/Toast/animation.d.ts.map +1 -0
- package/lib/typescript/components/Toast/hooks.d.ts +17 -0
- package/lib/typescript/components/Toast/hooks.d.ts.map +1 -0
- package/lib/typescript/components/Toast/index.d.ts +28 -0
- package/lib/typescript/components/Toast/index.d.ts.map +1 -0
- package/lib/typescript/components/Toast/styles.d.ts +73 -0
- package/lib/typescript/components/Toast/styles.d.ts.map +1 -0
- package/lib/typescript/components/Toast/types.d.ts +303 -0
- package/lib/typescript/components/Toast/types.d.ts.map +1 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/providers/animation-settings/index.d.ts +3 -0
- package/lib/typescript/providers/animation-settings/index.d.ts.map +1 -0
- package/lib/typescript/providers/animation-settings/provider.d.ts +28 -0
- package/lib/typescript/providers/animation-settings/provider.d.ts.map +1 -0
- package/lib/typescript/providers/animation-settings/types.d.ts +35 -0
- package/lib/typescript/providers/animation-settings/types.d.ts.map +1 -0
- package/lib/typescript/providers/forge-design/index.d.ts +3 -0
- package/lib/typescript/providers/forge-design/index.d.ts.map +1 -0
- package/lib/typescript/providers/forge-design/provider.d.ts +24 -0
- package/lib/typescript/providers/forge-design/provider.d.ts.map +1 -0
- package/lib/typescript/providers/forge-design/types.d.ts +82 -0
- package/lib/typescript/providers/forge-design/types.d.ts.map +1 -0
- package/lib/typescript/providers/text-component/index.d.ts +3 -0
- package/lib/typescript/providers/text-component/index.d.ts.map +1 -0
- package/lib/typescript/providers/text-component/provider.d.ts +7 -0
- package/lib/typescript/providers/text-component/provider.d.ts.map +1 -0
- package/lib/typescript/providers/text-component/types.d.ts +51 -0
- package/lib/typescript/providers/text-component/types.d.ts.map +1 -0
- package/lib/typescript/providers/toast/index.d.ts +5 -0
- package/lib/typescript/providers/toast/index.d.ts.map +1 -0
- package/lib/typescript/providers/toast/insets-container.d.ts +72 -0
- package/lib/typescript/providers/toast/insets-container.d.ts.map +1 -0
- package/lib/typescript/providers/toast/lifecycle.context.d.ts +32 -0
- package/lib/typescript/providers/toast/lifecycle.context.d.ts.map +1 -0
- package/lib/typescript/providers/toast/provider.d.ts +32 -0
- package/lib/typescript/providers/toast/provider.d.ts.map +1 -0
- package/lib/typescript/providers/toast/reducer.d.ts +14 -0
- package/lib/typescript/providers/toast/reducer.d.ts.map +1 -0
- package/lib/typescript/providers/toast/toast-config.context.d.ts +20 -0
- package/lib/typescript/providers/toast/toast-config.context.d.ts.map +1 -0
- package/lib/typescript/providers/toast/toast-item-renderer.d.ts +7 -0
- package/lib/typescript/providers/toast/toast-item-renderer.d.ts.map +1 -0
- package/lib/typescript/providers/toast/types.d.ts +422 -0
- package/lib/typescript/providers/toast/types.d.ts.map +1 -0
- package/package.json +4 -4
- package/src/animation/hooks/index.ts +1 -0
- package/src/animation/hooks/useCombinedAnimationDisabledState.ts +46 -0
- package/src/animation/index.ts +3 -0
- package/src/animation/types.ts +128 -0
- package/src/animation/utils.ts +249 -0
- package/src/components/CLAUDE.md +1 -1
- package/src/components/Card/index.tsx +58 -28
- package/src/components/Toast/animation.ts +387 -0
- package/src/components/Toast/hooks.ts +92 -0
- package/src/components/Toast/index.tsx +520 -0
- package/src/components/Toast/styles.ts +186 -0
- package/src/components/Toast/types.ts +332 -0
- package/src/components/index.ts +1 -0
- package/src/index.ts +2 -0
- package/src/providers/animation-settings/index.ts +11 -0
- package/src/providers/animation-settings/provider.tsx +54 -0
- package/src/providers/animation-settings/types.ts +37 -0
- package/src/providers/forge-design/index.ts +2 -0
- package/src/providers/forge-design/provider.tsx +61 -0
- package/src/providers/forge-design/types.ts +84 -0
- package/src/providers/text-component/index.ts +2 -0
- package/src/providers/text-component/provider.tsx +7 -0
- package/src/providers/text-component/types.ts +52 -0
- package/src/providers/toast/index.ts +4 -0
- package/src/providers/toast/insets-container.tsx +230 -0
- package/src/providers/toast/lifecycle.context.tsx +37 -0
- package/src/providers/toast/provider.tsx +567 -0
- package/src/providers/toast/reducer.ts +40 -0
- package/src/providers/toast/toast-config.context.ts +25 -0
- package/src/providers/toast/toast-item-renderer.tsx +40 -0
- package/src/providers/toast/types.ts +431 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AnimationRoot } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to combine global, parent, and own animation disabled states
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* This hook combines three sources of animation disabled state:
|
|
7
|
+
* 1. Global state from GlobalAnimationSettingsProvider
|
|
8
|
+
* 2. Parent state from AnimationSettingsContext (component tree cascading)
|
|
9
|
+
* 3. Own state from the component's animation prop
|
|
10
|
+
*
|
|
11
|
+
* Priority: Global > Parent > Own (global wins if enabled)
|
|
12
|
+
*
|
|
13
|
+
* @param animation - Root animation configuration for the component
|
|
14
|
+
* @returns Combined isAllAnimationsDisabled value
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* const isAllAnimationsDisabled = useCombinedAnimationDisabledState(animation);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function useCombinedAnimationDisabledState<TConfig extends Record<string, any>>(animation: AnimationRoot<TConfig> | undefined): boolean;
|
|
22
|
+
//# sourceMappingURL=useCombinedAnimationDisabledState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCombinedAnimationDisabledState.d.ts","sourceRoot":"","sources":["../../../../src/animation/hooks/useCombinedAnimationDisabledState.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnF,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,GAC5C,OAAO,CAiBT"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/animation/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { BaseAnimationBuilder, EntryOrExitLayoutType, LayoutAnimationFunction, WithSpringConfig, WithTimingConfig } from 'react-native-reanimated';
|
|
2
|
+
/**
|
|
3
|
+
* Universal animation prop type
|
|
4
|
+
* - `true` or `undefined`: Use default animations
|
|
5
|
+
* - `false` or `"disabled"`: Disable all animations
|
|
6
|
+
* - `object`: Custom animation configuration
|
|
7
|
+
* - Can include `state?: 'disabled' | boolean | undefined` to disable animations while customizing properties
|
|
8
|
+
*/
|
|
9
|
+
export type Animation<TConfig extends Record<string, any> = Record<string, any>> = boolean | 'disabled' | (TConfig & {
|
|
10
|
+
state?: 'disabled' | boolean;
|
|
11
|
+
});
|
|
12
|
+
export type AnimationDisabled = 'disabled' | false;
|
|
13
|
+
/**
|
|
14
|
+
* Root-level animation prop type with cascading control
|
|
15
|
+
* - `true` or `undefined`: Use default animations
|
|
16
|
+
* - `false` or `"disabled"`: Disable only root animations (children can still animate)
|
|
17
|
+
* - `"disable-all"`: Disable all animations including children (cascades down)
|
|
18
|
+
* - `object`: Custom animation configuration
|
|
19
|
+
* - Can include `state?: 'disabled' | 'disable-all' | boolean` to disable animations while customizing properties
|
|
20
|
+
*/
|
|
21
|
+
export type AnimationRoot<TConfig extends Record<string, any> = Record<string, any>> = boolean | 'disabled' | 'disable-all' | (TConfig & {
|
|
22
|
+
state?: 'disabled' | 'disable-all' | boolean;
|
|
23
|
+
});
|
|
24
|
+
export type AnimationRootDisableAll = Extract<AnimationRoot, 'disable-all'>;
|
|
25
|
+
/**
|
|
26
|
+
* Animation value that can be a custom config
|
|
27
|
+
* Used for granular animation control within a component
|
|
28
|
+
*/
|
|
29
|
+
export type AnimationValue<TConfig extends Record<string, any> = Record<string, any>> = TConfig;
|
|
30
|
+
export type LayoutTransition = BaseAnimationBuilder | LayoutAnimationFunction | typeof BaseAnimationBuilder | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Spring animation configuration
|
|
33
|
+
*/
|
|
34
|
+
export interface SpringAnimationConfig {
|
|
35
|
+
type: 'spring';
|
|
36
|
+
config?: WithSpringConfig;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Timing animation configuration
|
|
40
|
+
*/
|
|
41
|
+
export interface TimingAnimationConfig {
|
|
42
|
+
type: 'timing';
|
|
43
|
+
config?: WithTimingConfig;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Animation configuration for popup overlay components (Dialog, Select, BottomSheet, Popover, etc.)
|
|
47
|
+
* Supports both progress-based opacity animation and entering/exiting animations
|
|
48
|
+
*/
|
|
49
|
+
export type PopupOverlayAnimation = Animation<{
|
|
50
|
+
/**
|
|
51
|
+
* Opacity animation configuration (progress-based)
|
|
52
|
+
* Takes effect for bottom-sheet/dialog presentation
|
|
53
|
+
* @default [0, 1, 0] - opacity values for [idle, open, close] states
|
|
54
|
+
*/
|
|
55
|
+
opacity?: AnimationValue<{
|
|
56
|
+
/**
|
|
57
|
+
* Opacity values [idle, open, close]
|
|
58
|
+
* @default [0, 1, 0]
|
|
59
|
+
*/
|
|
60
|
+
value?: [number, number, number];
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Takes effect for popover presentation
|
|
64
|
+
* @default FadeIn with duration 200ms
|
|
65
|
+
*/
|
|
66
|
+
entering?: EntryOrExitLayoutType;
|
|
67
|
+
/**
|
|
68
|
+
* Takes effect for popover presentation
|
|
69
|
+
* @default FadeOut with duration 150ms
|
|
70
|
+
*/
|
|
71
|
+
exiting?: EntryOrExitLayoutType;
|
|
72
|
+
}>;
|
|
73
|
+
/**
|
|
74
|
+
* Animation configuration for popup dialog content components (Dialog, Select dialog presentation)
|
|
75
|
+
* Supports opacity and scale animations
|
|
76
|
+
*/
|
|
77
|
+
export type PopupDialogContentAnimation = Animation<{
|
|
78
|
+
/**
|
|
79
|
+
* Custom Keyframe animation for entering transition
|
|
80
|
+
* @default Keyframe with scale, and opacity (200ms)
|
|
81
|
+
*/
|
|
82
|
+
entering?: EntryOrExitLayoutType;
|
|
83
|
+
/**
|
|
84
|
+
* Custom Keyframe animation for exiting transition
|
|
85
|
+
* @default Keyframe mirroring entering animation (150ms)
|
|
86
|
+
*/
|
|
87
|
+
exiting?: EntryOrExitLayoutType;
|
|
88
|
+
}>;
|
|
89
|
+
/**
|
|
90
|
+
* Animation configuration for popup popover content components (Popover, Select popover presentation)
|
|
91
|
+
* Supports custom Keyframe animations for entering and exiting transitions
|
|
92
|
+
*/
|
|
93
|
+
export type PopupPopoverContentAnimation = Animation<{
|
|
94
|
+
/**
|
|
95
|
+
* Custom Keyframe animation for entering transition
|
|
96
|
+
* @default Keyframe with translateY/translateX, scale, and opacity (200ms)
|
|
97
|
+
*/
|
|
98
|
+
entering?: EntryOrExitLayoutType;
|
|
99
|
+
/**
|
|
100
|
+
* Custom Keyframe animation for exiting transition
|
|
101
|
+
* @default Keyframe mirroring entering animation (150ms)
|
|
102
|
+
*/
|
|
103
|
+
exiting?: EntryOrExitLayoutType;
|
|
104
|
+
}>;
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/animation/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAC3E,OAAO,GACP,UAAU,GACV,CAAC,OAAO,GAAG;IAAE,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAA;CAAE,CAAC,CAAC;AAEjD,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,KAAK,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAC/E,OAAO,GACP,UAAU,GACV,aAAa,GACb,CAAC,OAAO,GAAG;IAAE,KAAK,CAAC,EAAE,UAAU,GAAG,aAAa,GAAG,OAAO,CAAA;CAAE,CAAC,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE5E;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,OAAO,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,oBAAoB,GACpB,uBAAuB,GACvB,OAAO,oBAAoB,GAC3B,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,SAAS,CAAC;IAC5C;;;;OAIG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;QACvB;;;WAGG;QACH,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC,CAAC;IACH;;;OAGG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,SAAS,CAAC;IAClD;;;OAGG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,SAAS,CAAC;IACnD;;;OAGG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAC;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { Animation, AnimationRoot, AnimationValue } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if the entire animation is disabled
|
|
4
|
+
* @param animation - Animation configuration
|
|
5
|
+
* @returns true if animation is disabled
|
|
6
|
+
*/
|
|
7
|
+
export declare function isAnimationDisabled<TConfig extends Record<string, any>>(animation: Animation<TConfig> | AnimationRoot<TConfig> | undefined): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Check if root animation should cascade disable to all children
|
|
10
|
+
* @param animation - Root animation configuration
|
|
11
|
+
* @returns true if all animations should be disabled (including children)
|
|
12
|
+
*/
|
|
13
|
+
export declare function shouldDisableAll<TConfig extends Record<string, any>>(animation: AnimationRoot<TConfig> | undefined): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Get animation state including config and disabled status
|
|
16
|
+
* @param animation - Animation configuration
|
|
17
|
+
* @returns Object with animationConfig and isAnimationDisabled
|
|
18
|
+
*/
|
|
19
|
+
export declare function getAnimationState<TConfig extends Record<string, any>>(animation: Animation<TConfig> | undefined): {
|
|
20
|
+
animationConfig: TConfig | undefined;
|
|
21
|
+
isAnimationDisabled: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Get root animation state including config, disabled status, and cascade flag
|
|
25
|
+
* @param animation - Root animation configuration
|
|
26
|
+
* @returns Object with animationConfig, isAnimationDisabled, and isAllAnimationsDisabled
|
|
27
|
+
*/
|
|
28
|
+
export declare function getRootAnimationState<TConfig extends Record<string, any>>(animation: AnimationRoot<TConfig> | undefined): {
|
|
29
|
+
animationConfig: TConfig | undefined;
|
|
30
|
+
isAnimationDisabled: boolean;
|
|
31
|
+
isAllAnimationsDisabled: boolean;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Get animation value property or return default
|
|
35
|
+
* Extracts a property from the animation value config object
|
|
36
|
+
*
|
|
37
|
+
* @param options - Object containing animationValue, property, and defaultValue
|
|
38
|
+
* @param options.animationValue - The animation value configuration
|
|
39
|
+
* @param options.property - Property name to extract
|
|
40
|
+
* @param options.defaultValue - Default value if property is not found
|
|
41
|
+
* @returns The property value or default (never undefined)
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* const scaleValue = getAnimationValueProperty({
|
|
45
|
+
* animationValue: animation?.scale,
|
|
46
|
+
* property: 'value',
|
|
47
|
+
* defaultValue: 0.95
|
|
48
|
+
* });
|
|
49
|
+
*/
|
|
50
|
+
export declare function getAnimationValueProperty<TConfig extends Record<string, any>, K extends keyof TConfig, D extends NonNullable<TConfig[K]>>(options: {
|
|
51
|
+
animationValue: AnimationValue<TConfig> | undefined;
|
|
52
|
+
property: K;
|
|
53
|
+
defaultValue: D;
|
|
54
|
+
}): D;
|
|
55
|
+
/**
|
|
56
|
+
* Get animation value merged config or return default
|
|
57
|
+
* Merges the animation value config with defaults, useful when you need multiple properties
|
|
58
|
+
*
|
|
59
|
+
* @param options - Object containing animationValue, property, and defaultValue
|
|
60
|
+
* @param options.animationValue - The animation value configuration
|
|
61
|
+
* @param options.property - Property name to extract from the config
|
|
62
|
+
* @param options.defaultValue - Default configuration object
|
|
63
|
+
* @returns The merged config object or default
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* const scaleConfig = getAnimationValueMergedConfig({
|
|
67
|
+
* animationValue: animation?.scale,
|
|
68
|
+
* property: 'timingConfig',
|
|
69
|
+
* defaultValue: { duration: 150 }
|
|
70
|
+
* });
|
|
71
|
+
*/
|
|
72
|
+
export declare function getAnimationValueMergedConfig<TConfig extends Record<string, any>, K extends keyof TConfig>(options: {
|
|
73
|
+
animationValue: AnimationValue<TConfig> | undefined;
|
|
74
|
+
property: K;
|
|
75
|
+
defaultValue: TConfig[K];
|
|
76
|
+
}): TConfig[K];
|
|
77
|
+
/**
|
|
78
|
+
* Determine if animations should be disabled based on disabled flags
|
|
79
|
+
* Priority: isAllAnimationsDisabled > isAnimationDisabled
|
|
80
|
+
*
|
|
81
|
+
* @param options - Object containing isAnimationDisabled and isAllAnimationsDisabled
|
|
82
|
+
* @param options.isAnimationDisabled - Whether animation is explicitly disabled
|
|
83
|
+
* @param options.isAllAnimationsDisabled - Whether all animations should be disabled (cascading from root/global)
|
|
84
|
+
* @returns true if animations should be disabled, false otherwise
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* const isDisabled = getIsAnimationDisabledValue({
|
|
88
|
+
* isAnimationDisabled: false,
|
|
89
|
+
* isAllAnimationsDisabled: true
|
|
90
|
+
* });
|
|
91
|
+
* // Returns: true (all animations disabled takes priority)
|
|
92
|
+
*/
|
|
93
|
+
export declare function getIsAnimationDisabledValue(options: {
|
|
94
|
+
isAnimationDisabled: boolean;
|
|
95
|
+
isAllAnimationsDisabled: boolean | undefined;
|
|
96
|
+
}): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Combine global, parent, and own animation disabled states
|
|
99
|
+
* Priority: Global > Parent > Own (global wins if enabled)
|
|
100
|
+
*
|
|
101
|
+
* @param options - Object containing globalIsAllAnimationsDisabled, parentIsAllAnimationsDisabled, and ownIsAllAnimationsDisabled
|
|
102
|
+
* @param options.globalIsAllAnimationsDisabled - Whether global provider has disable-all (from GlobalAnimationSettingsProvider)
|
|
103
|
+
* @param options.parentIsAllAnimationsDisabled - Whether parent context has disable-all (from AnimationSettingsContext)
|
|
104
|
+
* @param options.ownIsAllAnimationsDisabled - Whether own animation prop has disable-all
|
|
105
|
+
* @returns Combined isAllAnimationsDisabled value (global || parent || own)
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* const combined = getCombinedAnimationDisabledState({
|
|
109
|
+
* globalIsAllAnimationsDisabled: true,
|
|
110
|
+
* parentIsAllAnimationsDisabled: false,
|
|
111
|
+
* ownIsAllAnimationsDisabled: false
|
|
112
|
+
* });
|
|
113
|
+
* // Returns: true (global wins)
|
|
114
|
+
*/
|
|
115
|
+
export declare function getCombinedAnimationDisabledState(options: {
|
|
116
|
+
globalIsAllAnimationsDisabled?: boolean;
|
|
117
|
+
parentIsAllAnimationsDisabled: boolean | undefined;
|
|
118
|
+
ownIsAllAnimationsDisabled: boolean;
|
|
119
|
+
}): boolean;
|
|
120
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/animation/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACrE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,GACjE,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClE,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,GAC5C,OAAO,CAaT;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnE,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,GACxC;IACD,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,CAAC;CAC9B,CAWA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvE,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,GAC5C;IACD,eAAe,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uBAAuB,EAAE,OAAO,CAAC;CAClC,CAaA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,CAAC,SAAS,MAAM,OAAO,EACvB,CAAC,SAAS,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EACjC,OAAO,EAAE;IACT,cAAc,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC;IACZ,YAAY,EAAE,CAAC,CAAC;CACjB,GAAG,CAAC,CAQJ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACnC,CAAC,SAAS,MAAM,OAAO,EACvB,OAAO,EAAE;IACT,cAAc,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,QAAQ,EAAE,CAAC,CAAC;IACZ,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAC1B,GAAG,OAAO,CAAC,CAAC,CAAC,CAeb;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE;IACnD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,uBAAuB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9C,GAAG,OAAO,CAeV;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,EAAE;IACzD,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,6BAA6B,EAAE,OAAO,GAAG,SAAS,CAAC;IACnD,0BAA0B,EAAE,OAAO,CAAC;CACrC,GAAG,OAAO,CAmBV"}
|
|
@@ -2,21 +2,25 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import { View, type ViewProps } from 'react-native';
|
|
3
3
|
import { type CardContentVariantProps, type CardFooterVariantProps, type CardVariantProps } from './styles';
|
|
4
4
|
export interface CardProps extends ViewProps, CardVariantProps {
|
|
5
|
+
asChild?: boolean;
|
|
5
6
|
className?: string;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
}
|
|
8
9
|
declare const CardRoot: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<View>>;
|
|
9
10
|
export interface CardHeaderProps extends ViewProps {
|
|
11
|
+
asChild?: boolean;
|
|
10
12
|
className?: string;
|
|
11
13
|
children?: ReactNode;
|
|
12
14
|
}
|
|
13
15
|
declare const CardHeader: import("react").ForwardRefExoticComponent<CardHeaderProps & import("react").RefAttributes<View>>;
|
|
14
16
|
export interface CardContentProps extends ViewProps, CardContentVariantProps {
|
|
17
|
+
asChild?: boolean;
|
|
15
18
|
className?: string;
|
|
16
19
|
children?: ReactNode;
|
|
17
20
|
}
|
|
18
21
|
declare const CardContent: import("react").ForwardRefExoticComponent<CardContentProps & import("react").RefAttributes<View>>;
|
|
19
22
|
export interface CardFooterProps extends ViewProps, CardFooterVariantProps {
|
|
23
|
+
asChild?: boolean;
|
|
20
24
|
className?: string;
|
|
21
25
|
children?: ReactNode;
|
|
22
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Card/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACtB,MAAM,UAAU,CAAC;AAUlB,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,gBAAgB;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,4FAsBb,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,SAAS;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,kGAiBf,CAAC;AAQF,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,uBAAuB;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,WAAW,mGAqBhB,CAAC;AAQF,MAAM,WAAW,eAAgB,SAAQ,SAAS,EAAE,sBAAsB;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,QAAA,MAAM,UAAU,kGAqBf,CAAC;AAQF,KAAK,qBAAqB,GAAG,OAAO,QAAQ,GAAG;IAC7C,MAAM,EAAE,OAAO,UAAU,CAAC;IAC1B,OAAO,EAAE,OAAO,WAAW,CAAC;IAC5B,MAAM,EAAE,OAAO,UAAU,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,IAAI,EAIX,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Gesture } from 'react-native-gesture-handler';
|
|
2
|
+
import { EntryOrExitLayoutType, useAnimatedStyle } from 'react-native-reanimated';
|
|
3
|
+
import type { UseToastRootAnimationOptions } from './types';
|
|
4
|
+
export declare const enteringTop: import("react-native-reanimated").ComplexAnimationBuilder;
|
|
5
|
+
export declare const exitingTop: import("react-native-reanimated").ReanimatedKeyframe;
|
|
6
|
+
export declare const enteringBottom: import("react-native-reanimated").ComplexAnimationBuilder;
|
|
7
|
+
export declare const exitingBottom: import("react-native-reanimated").ReanimatedKeyframe;
|
|
8
|
+
export interface UseToastRootAnimationResult {
|
|
9
|
+
rContainerStyle: ReturnType<typeof useAnimatedStyle>;
|
|
10
|
+
isAllAnimationsDisabled: boolean;
|
|
11
|
+
entering: EntryOrExitLayoutType | undefined;
|
|
12
|
+
exiting: EntryOrExitLayoutType | undefined;
|
|
13
|
+
panGesture: ReturnType<typeof Gesture.Pan>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Animation hook for Toast root component
|
|
17
|
+
* Handles opacity, translateY, and scale animations based on toast index and placement
|
|
18
|
+
* Also handles gesture-based swipe to dismiss and rubber-band drag effects
|
|
19
|
+
*/
|
|
20
|
+
export declare function useToastRootAnimation(options: UseToastRootAnimationOptions): UseToastRootAnimationResult;
|
|
21
|
+
//# sourceMappingURL=animation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAEL,qBAAqB,EAMrB,gBAAgB,EAKjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAI5D,eAAO,MAAM,WAAW,2DAKd,CAAC;AAEX,eAAO,MAAM,UAAU,sDAUP,CAAC;AAEjB,eAAO,MAAM,cAAc,2DAKjB,CAAC;AAEX,eAAO,MAAM,aAAa,sDAUV,CAAC;AAEjB,MAAM,WAAW,2BAA2B;IAC1C,eAAe,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;IACrD,uBAAuB,EAAE,OAAO,CAAC;IACjC,QAAQ,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC5C,OAAO,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAC3C,UAAU,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;CAC5C;AAID;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,4BAA4B,GACpC,2BAA2B,CA+S7B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
|
+
import type { ButtonProps } from '../Button';
|
|
3
|
+
import { ToastColor } from './types';
|
|
4
|
+
export declare function useButtonColor({ color, toastColor, }: {
|
|
5
|
+
color: ButtonProps['color'];
|
|
6
|
+
toastColor: ToastColor;
|
|
7
|
+
}): "danger" | "warning" | "success" | "info" | "action";
|
|
8
|
+
interface UseVerticalPlaceholderStylesParams {
|
|
9
|
+
rootClassName?: string;
|
|
10
|
+
style?: StyleProp<ViewStyle>;
|
|
11
|
+
}
|
|
12
|
+
export declare function useVerticalPlaceholderStyles({ rootClassName, style, }: UseVerticalPlaceholderStylesParams): {
|
|
13
|
+
topStyle: ViewStyle;
|
|
14
|
+
bottomStyle: ViewStyle;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=hooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/hooks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,wBAAgB,cAAc,CAAC,EAC7B,KAAK,EACL,UAAU,GACX,EAAE;IACD,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,wDAkBA;AAED,UAAU,kCAAkC;IAC1C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,aAAa,EACb,KAAK,GACN,EAAE,kCAAkC;;;EAkDpC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { View } from 'react-native';
|
|
2
|
+
import type { DefaultToastProps, ToastDescriptionProps, ToastIconProps, ToastProps, ToastTitleProps } from './types';
|
|
3
|
+
declare const ToastRoot: import("react").ForwardRefExoticComponent<ToastProps & import("react").RefAttributes<View>>;
|
|
4
|
+
declare const ToastTitle: import("react").ForwardRefExoticComponent<ToastTitleProps & import("react").RefAttributes<View>>;
|
|
5
|
+
declare const ToastDescription: import("react").ForwardRefExoticComponent<ToastDescriptionProps & import("react").RefAttributes<View>>;
|
|
6
|
+
declare const ToastIcon: {
|
|
7
|
+
({ asChild, className, style, as, ...props }: ToastIconProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
10
|
+
declare const ToastAction: import("react").ForwardRefExoticComponent<import("..").ButtonProps & import("react").RefAttributes<View>>;
|
|
11
|
+
declare const ToastClose: import("react").ForwardRefExoticComponent<Omit<import("..").IconButtonProps, "as"> & {
|
|
12
|
+
as?: import("@cdx-ui/icons").ForgeIcon;
|
|
13
|
+
} & import("react").RefAttributes<View>>;
|
|
14
|
+
/**
|
|
15
|
+
* Default styled toast component for simplified toast.show() API
|
|
16
|
+
* Used internally when showing toasts with string or config object (without component)
|
|
17
|
+
*/
|
|
18
|
+
export declare function DefaultToast(props: DefaultToastProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
type ToastCompoundComponent = typeof ToastRoot & {
|
|
20
|
+
Title: typeof ToastTitle;
|
|
21
|
+
Description: typeof ToastDescription;
|
|
22
|
+
Icon: typeof ToastIcon;
|
|
23
|
+
Action: typeof ToastAction;
|
|
24
|
+
Close: typeof ToastClose;
|
|
25
|
+
};
|
|
26
|
+
export declare const Toast: ToastCompoundComponent;
|
|
27
|
+
export type { ToastColor, ToastPlacement, ToastRootAnimation, ToastProps, ToastTitleProps, ToastDescriptionProps, ToastIconProps, ToastActionProps, ToastCloseProps, ToastContextValue, ToastRootRef, DefaultToastProps, } from './types';
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAY,IAAI,EAAE,MAAM,cAAc,CAAC;AA8B9C,OAAO,KAAK,EACV,iBAAiB,EAIjB,qBAAqB,EACrB,cAAc,EACd,UAAU,EACV,eAAe,EAChB,MAAM,SAAS,CAAC;AAuBjB,QAAA,MAAM,SAAS,6FAwNb,CAAC;AAIH,QAAA,MAAM,UAAU,kGAoBd,CAAC;AAIH,QAAA,MAAM,gBAAgB,wGAiBpB,CAAC;AAIH,QAAA,MAAM,SAAS;kDAAiD,cAAc;;CA4B7E,CAAC;AAMF,QAAA,MAAM,WAAW,2GAqBf,CAAC;AAIH,QAAA,MAAM,UAAU;;wCA8Bd,CAAC;AAIH;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAsDpD;AAWD,KAAK,sBAAsB,GAAG,OAAO,SAAS,GAAG;IAC/C,KAAK,EAAE,OAAO,UAAU,CAAC;IACzB,WAAW,EAAE,OAAO,gBAAgB,CAAC;IACrC,IAAI,EAAE,OAAO,SAAS,CAAC;IACvB,MAAM,EAAE,OAAO,WAAW,CAAC;IAC3B,KAAK,EAAE,OAAO,UAAU,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,KAAK,EAMZ,sBAAsB,CAAC;AAE7B,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
/**
|
|
3
|
+
* Toast root styles
|
|
4
|
+
*
|
|
5
|
+
* @note ANIMATED PROPERTIES (cannot be set via className):
|
|
6
|
+
* The following properties are animated and cannot be overridden using Tailwind classes:
|
|
7
|
+
* - `opacity` - Animated for visibility transitions when toasts are pushed beyond visible stack limits
|
|
8
|
+
* - `transform` (translateY) - Animated for vertical position transitions when toasts are stacked, and for swipe-to-dismiss gestures
|
|
9
|
+
* - `transform` (scale) - Animated for size scaling transitions when toasts are stacked (toasts behind active one are scaled down)
|
|
10
|
+
* - `height` - Animated for height transitions when toast content changes
|
|
11
|
+
*
|
|
12
|
+
* To customize these properties, use the `animation` prop on `Toast.Root`:
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Toast.Root
|
|
15
|
+
* animation={{
|
|
16
|
+
* opacity: {
|
|
17
|
+
* value: [1, 0],
|
|
18
|
+
* timingConfig: { duration: 300 }
|
|
19
|
+
* },
|
|
20
|
+
* translateY: {
|
|
21
|
+
* value: [0, 10],
|
|
22
|
+
* timingConfig: { duration: 300 }
|
|
23
|
+
* },
|
|
24
|
+
* scale: {
|
|
25
|
+
* value: [1, 0.97],
|
|
26
|
+
* timingConfig: { duration: 300 }
|
|
27
|
+
* }
|
|
28
|
+
* }}
|
|
29
|
+
* />
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* To completely disable animated styles and apply your own via className or style prop,
|
|
33
|
+
* set `isAnimatedStyleActive={false}` on `Toast.Root`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const toastRootVariants: (props?: ({
|
|
36
|
+
color?: "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
37
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
38
|
+
/**
|
|
39
|
+
* Toast wrapper variants
|
|
40
|
+
*
|
|
41
|
+
* Applied to the outer `Animated.View` that carries `data-state="entering|open|closed"`.
|
|
42
|
+
* On web the CSS engine drives the enter/exit animation via `data-state` transitions —
|
|
43
|
+
* fade + short translate — replacing the Reanimated layout animations that ran on
|
|
44
|
+
* the same element on native. Native ignores these classes (no `web:` prefix hits).
|
|
45
|
+
*
|
|
46
|
+
* `placement` picks the slide direction so top-placed toasts translate up on close and
|
|
47
|
+
* bottom-placed toasts translate down. The unprefixed `-translate-y-2` / `translate-y-2`
|
|
48
|
+
* on the `top-*` / `bottom-*` variants also seeds the entering-state offset synchronously
|
|
49
|
+
* — CSS transitions to `translate-y-0` when `data-state` flips to `open`.
|
|
50
|
+
*
|
|
51
|
+
* `motion-reduce:transition-none` collapses the transition for users with
|
|
52
|
+
* `prefers-reduced-motion: reduce`. In that case `transitionend` may never fire, so
|
|
53
|
+
* the Toast component's safety timeout handles removal.
|
|
54
|
+
*/
|
|
55
|
+
export declare const toastWrapperVariants: (props?: ({
|
|
56
|
+
placement?: "bottom" | "top" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | null | undefined;
|
|
57
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
58
|
+
export declare const toastLabelVariants: (props?: ({
|
|
59
|
+
color?: "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
60
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
61
|
+
export declare const toastDescriptionVariants: (props?: ({
|
|
62
|
+
color?: "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
63
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
64
|
+
export declare const toastIconVariants: (props?: ({
|
|
65
|
+
color?: "danger" | "warning" | "success" | "info" | "default" | null | undefined;
|
|
66
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
67
|
+
export declare const toastStyleSheet: {
|
|
68
|
+
root: {
|
|
69
|
+
borderCurve: "continuous";
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export type ToastColorProps = VariantProps<typeof toastRootVariants>;
|
|
73
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Toast/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,iBAAiB;;8EAuB7B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,oBAAoB;;8EAsDhC,CAAC;AAEF,eAAO,MAAM,kBAAkB;;8EAa7B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;8EAanC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;8EAa5B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;CAI1B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|