@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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _useCombinedAnimationDisabledState = require("./useCombinedAnimationDisabledState");
|
|
7
|
+
Object.keys(_useCombinedAnimationDisabledState).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _useCombinedAnimationDisabledState[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _useCombinedAnimationDisabledState[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_useCombinedAnimationDisabledState","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../../src","sources":["animation/hooks/index.ts"],"mappings":";;;;;AAAA,IAAAA,kCAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kCAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kCAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kCAAA,CAAAK,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useCombinedAnimationDisabledState = useCombinedAnimationDisabledState;
|
|
7
|
+
var _animationSettings = require("../../providers/animation-settings");
|
|
8
|
+
var _utils = require("../utils");
|
|
9
|
+
/**
|
|
10
|
+
* Hook to combine global, parent, and own animation disabled states
|
|
11
|
+
*
|
|
12
|
+
* @description
|
|
13
|
+
* This hook combines three sources of animation disabled state:
|
|
14
|
+
* 1. Global state from GlobalAnimationSettingsProvider
|
|
15
|
+
* 2. Parent state from AnimationSettingsContext (component tree cascading)
|
|
16
|
+
* 3. Own state from the component's animation prop
|
|
17
|
+
*
|
|
18
|
+
* Priority: Global > Parent > Own (global wins if enabled)
|
|
19
|
+
*
|
|
20
|
+
* @param animation - Root animation configuration for the component
|
|
21
|
+
* @returns Combined isAllAnimationsDisabled value
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```tsx
|
|
25
|
+
* const isAllAnimationsDisabled = useCombinedAnimationDisabledState(animation);
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
function useCombinedAnimationDisabledState(animation) {
|
|
29
|
+
// Get global animation disabled state
|
|
30
|
+
const {
|
|
31
|
+
globalIsAllAnimationsDisabled
|
|
32
|
+
} = (0, _animationSettings.useGlobalAnimationSettings)();
|
|
33
|
+
|
|
34
|
+
// Read parent animation disabled state from global context
|
|
35
|
+
const parentAnimationSettingsContext = (0, _animationSettings.useAnimationSettings)();
|
|
36
|
+
const parentIsAllAnimationsDisabled = parentAnimationSettingsContext?.isAllAnimationsDisabled;
|
|
37
|
+
|
|
38
|
+
// Get own animation disabled state
|
|
39
|
+
const {
|
|
40
|
+
isAllAnimationsDisabled: ownIsAllAnimationsDisabled
|
|
41
|
+
} = (0, _utils.getRootAnimationState)(animation);
|
|
42
|
+
|
|
43
|
+
// Combine global, parent, and own disable-all states (global > parent > own)
|
|
44
|
+
return (0, _utils.getCombinedAnimationDisabledState)({
|
|
45
|
+
globalIsAllAnimationsDisabled,
|
|
46
|
+
parentIsAllAnimationsDisabled,
|
|
47
|
+
ownIsAllAnimationsDisabled
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=useCombinedAnimationDisabledState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_animationSettings","require","_utils","useCombinedAnimationDisabledState","animation","globalIsAllAnimationsDisabled","useGlobalAnimationSettings","parentAnimationSettingsContext","useAnimationSettings","parentIsAllAnimationsDisabled","isAllAnimationsDisabled","ownIsAllAnimationsDisabled","getRootAnimationState","getCombinedAnimationDisabledState"],"sourceRoot":"../../../../src","sources":["animation/hooks/useCombinedAnimationDisabledState.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,iCAAiCA,CAC/CC,SAA6C,EACpC;EACT;EACA,MAAM;IAAEC;EAA8B,CAAC,GAAG,IAAAC,6CAA0B,EAAC,CAAC;;EAEtE;EACA,MAAMC,8BAA8B,GAAG,IAAAC,uCAAoB,EAAC,CAAC;EAC7D,MAAMC,6BAA6B,GAAGF,8BAA8B,EAAEG,uBAAuB;;EAE7F;EACA,MAAM;IAAEA,uBAAuB,EAAEC;EAA2B,CAAC,GAAG,IAAAC,4BAAqB,EAACR,SAAS,CAAC;;EAEhG;EACA,OAAO,IAAAS,wCAAiC,EAAC;IACvCR,6BAA6B;IAC7BI,6BAA6B;IAC7BE;EACF,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _types = require("./types");
|
|
7
|
+
Object.keys(_types).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _types[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _types[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _hooks = require("./hooks");
|
|
18
|
+
Object.keys(_hooks).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _hooks[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _hooks[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _utils = require("./utils");
|
|
29
|
+
Object.keys(_utils).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _utils[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _utils[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_types","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_hooks","_utils"],"sourceRoot":"../../../src","sources":["animation/index.ts"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,MAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,MAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,MAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,MAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["animation/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getAnimationState = getAnimationState;
|
|
7
|
+
exports.getAnimationValueMergedConfig = getAnimationValueMergedConfig;
|
|
8
|
+
exports.getAnimationValueProperty = getAnimationValueProperty;
|
|
9
|
+
exports.getCombinedAnimationDisabledState = getCombinedAnimationDisabledState;
|
|
10
|
+
exports.getIsAnimationDisabledValue = getIsAnimationDisabledValue;
|
|
11
|
+
exports.getRootAnimationState = getRootAnimationState;
|
|
12
|
+
exports.isAnimationDisabled = isAnimationDisabled;
|
|
13
|
+
exports.shouldDisableAll = shouldDisableAll;
|
|
14
|
+
/**
|
|
15
|
+
* Check if the entire animation is disabled
|
|
16
|
+
* @param animation - Animation configuration
|
|
17
|
+
* @returns true if animation is disabled
|
|
18
|
+
*/
|
|
19
|
+
function isAnimationDisabled(animation) {
|
|
20
|
+
// Check top-level disabled values
|
|
21
|
+
if (animation === false || animation === 'disabled') {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Check state property in config objects
|
|
26
|
+
if (typeof animation === 'object' && animation !== null && 'state' in animation) {
|
|
27
|
+
const state = animation.state;
|
|
28
|
+
return state === false || state === 'disabled';
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Check if root animation should cascade disable to all children
|
|
35
|
+
* @param animation - Root animation configuration
|
|
36
|
+
* @returns true if all animations should be disabled (including children)
|
|
37
|
+
*/
|
|
38
|
+
function shouldDisableAll(animation) {
|
|
39
|
+
// Check top-level disable-all value
|
|
40
|
+
if (animation === 'disable-all') {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Check state property in config objects
|
|
45
|
+
if (typeof animation === 'object' && animation !== null && 'state' in animation) {
|
|
46
|
+
const state = animation.state;
|
|
47
|
+
return state === 'disable-all';
|
|
48
|
+
}
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get animation state including config and disabled status
|
|
54
|
+
* @param animation - Animation configuration
|
|
55
|
+
* @returns Object with animationConfig and isAnimationDisabled
|
|
56
|
+
*/
|
|
57
|
+
function getAnimationState(animation) {
|
|
58
|
+
const isDisabled = isAnimationDisabled(animation);
|
|
59
|
+
// Always extract config when it's an object, regardless of disabled state
|
|
60
|
+
// This allows users to customize colors/properties even when animations are disabled
|
|
61
|
+
const config = typeof animation === 'object' && animation !== null ? animation : undefined;
|
|
62
|
+
return {
|
|
63
|
+
animationConfig: config,
|
|
64
|
+
isAnimationDisabled: isDisabled
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Get root animation state including config, disabled status, and cascade flag
|
|
70
|
+
* @param animation - Root animation configuration
|
|
71
|
+
* @returns Object with animationConfig, isAnimationDisabled, and isAllAnimationsDisabled
|
|
72
|
+
*/
|
|
73
|
+
function getRootAnimationState(animation) {
|
|
74
|
+
const shouldCascade = shouldDisableAll(animation);
|
|
75
|
+
const isDisabled = isAnimationDisabled(animation) || shouldCascade;
|
|
76
|
+
// Always extract config when it's an object, regardless of disabled state
|
|
77
|
+
// This allows users to customize colors/properties even when animations are disabled
|
|
78
|
+
const config = typeof animation === 'object' && animation !== null ? animation : undefined;
|
|
79
|
+
return {
|
|
80
|
+
animationConfig: config,
|
|
81
|
+
isAnimationDisabled: isDisabled,
|
|
82
|
+
isAllAnimationsDisabled: shouldCascade
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Get animation value property or return default
|
|
88
|
+
* Extracts a property from the animation value config object
|
|
89
|
+
*
|
|
90
|
+
* @param options - Object containing animationValue, property, and defaultValue
|
|
91
|
+
* @param options.animationValue - The animation value configuration
|
|
92
|
+
* @param options.property - Property name to extract
|
|
93
|
+
* @param options.defaultValue - Default value if property is not found
|
|
94
|
+
* @returns The property value or default (never undefined)
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const scaleValue = getAnimationValueProperty({
|
|
98
|
+
* animationValue: animation?.scale,
|
|
99
|
+
* property: 'value',
|
|
100
|
+
* defaultValue: 0.95
|
|
101
|
+
* });
|
|
102
|
+
*/
|
|
103
|
+
function getAnimationValueProperty(options) {
|
|
104
|
+
// If animation value is undefined, return default
|
|
105
|
+
if (options.animationValue === undefined) {
|
|
106
|
+
return options.defaultValue;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Return the property value if it exists, otherwise return default
|
|
110
|
+
return options.animationValue[options.property] ?? options.defaultValue;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Get animation value merged config or return default
|
|
115
|
+
* Merges the animation value config with defaults, useful when you need multiple properties
|
|
116
|
+
*
|
|
117
|
+
* @param options - Object containing animationValue, property, and defaultValue
|
|
118
|
+
* @param options.animationValue - The animation value configuration
|
|
119
|
+
* @param options.property - Property name to extract from the config
|
|
120
|
+
* @param options.defaultValue - Default configuration object
|
|
121
|
+
* @returns The merged config object or default
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const scaleConfig = getAnimationValueMergedConfig({
|
|
125
|
+
* animationValue: animation?.scale,
|
|
126
|
+
* property: 'timingConfig',
|
|
127
|
+
* defaultValue: { duration: 150 }
|
|
128
|
+
* });
|
|
129
|
+
*/
|
|
130
|
+
function getAnimationValueMergedConfig(options) {
|
|
131
|
+
// If animation value is undefined, return default
|
|
132
|
+
if (options.animationValue === undefined) {
|
|
133
|
+
return options.defaultValue;
|
|
134
|
+
}
|
|
135
|
+
const value = options.animationValue[options.property];
|
|
136
|
+
|
|
137
|
+
// If the specific property value is undefined or not an object, return default
|
|
138
|
+
if (value === undefined || typeof value !== 'object') {
|
|
139
|
+
return options.defaultValue;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Merge with defaults to ensure all properties exist
|
|
143
|
+
return {
|
|
144
|
+
...options.defaultValue,
|
|
145
|
+
...value
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Determine if animations should be disabled based on disabled flags
|
|
151
|
+
* Priority: isAllAnimationsDisabled > isAnimationDisabled
|
|
152
|
+
*
|
|
153
|
+
* @param options - Object containing isAnimationDisabled and isAllAnimationsDisabled
|
|
154
|
+
* @param options.isAnimationDisabled - Whether animation is explicitly disabled
|
|
155
|
+
* @param options.isAllAnimationsDisabled - Whether all animations should be disabled (cascading from root/global)
|
|
156
|
+
* @returns true if animations should be disabled, false otherwise
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* const isDisabled = getIsAnimationDisabledValue({
|
|
160
|
+
* isAnimationDisabled: false,
|
|
161
|
+
* isAllAnimationsDisabled: true
|
|
162
|
+
* });
|
|
163
|
+
* // Returns: true (all animations disabled takes priority)
|
|
164
|
+
*/
|
|
165
|
+
function getIsAnimationDisabledValue(options) {
|
|
166
|
+
const {
|
|
167
|
+
isAnimationDisabled: isDisabled,
|
|
168
|
+
isAllAnimationsDisabled
|
|
169
|
+
} = options;
|
|
170
|
+
|
|
171
|
+
// First priority: if all animations are disabled, return true
|
|
172
|
+
if (isAllAnimationsDisabled === true) {
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// Second priority: if this animation is disabled, return true
|
|
177
|
+
if (isDisabled) {
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Default: animations are enabled
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Combine global, parent, and own animation disabled states
|
|
187
|
+
* Priority: Global > Parent > Own (global wins if enabled)
|
|
188
|
+
*
|
|
189
|
+
* @param options - Object containing globalIsAllAnimationsDisabled, parentIsAllAnimationsDisabled, and ownIsAllAnimationsDisabled
|
|
190
|
+
* @param options.globalIsAllAnimationsDisabled - Whether global provider has disable-all (from GlobalAnimationSettingsProvider)
|
|
191
|
+
* @param options.parentIsAllAnimationsDisabled - Whether parent context has disable-all (from AnimationSettingsContext)
|
|
192
|
+
* @param options.ownIsAllAnimationsDisabled - Whether own animation prop has disable-all
|
|
193
|
+
* @returns Combined isAllAnimationsDisabled value (global || parent || own)
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* const combined = getCombinedAnimationDisabledState({
|
|
197
|
+
* globalIsAllAnimationsDisabled: true,
|
|
198
|
+
* parentIsAllAnimationsDisabled: false,
|
|
199
|
+
* ownIsAllAnimationsDisabled: false
|
|
200
|
+
* });
|
|
201
|
+
* // Returns: true (global wins)
|
|
202
|
+
*/
|
|
203
|
+
function getCombinedAnimationDisabledState(options) {
|
|
204
|
+
const {
|
|
205
|
+
globalIsAllAnimationsDisabled,
|
|
206
|
+
parentIsAllAnimationsDisabled,
|
|
207
|
+
ownIsAllAnimationsDisabled
|
|
208
|
+
} = options;
|
|
209
|
+
|
|
210
|
+
// Global always wins if it has disable-all
|
|
211
|
+
if (globalIsAllAnimationsDisabled === true) {
|
|
212
|
+
return true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Parent wins if it has disable-all
|
|
216
|
+
if (parentIsAllAnimationsDisabled === true) {
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Otherwise use own value
|
|
221
|
+
return ownIsAllAnimationsDisabled;
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isAnimationDisabled","animation","state","shouldDisableAll","getAnimationState","isDisabled","config","undefined","animationConfig","getRootAnimationState","shouldCascade","isAllAnimationsDisabled","getAnimationValueProperty","options","animationValue","defaultValue","property","getAnimationValueMergedConfig","value","getIsAnimationDisabledValue","getCombinedAnimationDisabledState","globalIsAllAnimationsDisabled","parentIsAllAnimationsDisabled","ownIsAllAnimationsDisabled"],"sourceRoot":"../../../src","sources":["animation/utils.ts"],"mappings":";;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASA,mBAAmBA,CACjCC,SAAkE,EACzD;EACT;EACA,IAAIA,SAAS,KAAK,KAAK,IAAIA,SAAS,KAAK,UAAU,EAAE;IACnD,OAAO,IAAI;EACb;;EAEA;EACA,IAAI,OAAOA,SAAS,KAAK,QAAQ,IAAIA,SAAS,KAAK,IAAI,IAAI,OAAO,IAAIA,SAAS,EAAE;IAC/E,MAAMC,KAAK,GAAGD,SAAS,CAACC,KAAK;IAC7B,OAAOA,KAAK,KAAK,KAAK,IAAIA,KAAK,KAAK,UAAU;EAChD;EAEA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,gBAAgBA,CAC9BF,SAA6C,EACpC;EACT;EACA,IAAIA,SAAS,KAAK,aAAa,EAAE;IAC/B,OAAO,IAAI;EACb;;EAEA;EACA,IAAI,O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,7 +120,7 @@ Where: **styled layer.** Pure styling hint with no behavior or a11y semantics
|
|
|
120
120
|
Each component follows this structure (see `Button/index.tsx`):
|
|
121
121
|
|
|
122
122
|
1. **Imports** — RN base components, primitive `Root` and `Slot` from `@cdx-ui/primitives`, `cn` + style context from `@cdx-ui/utils`, variant functions from `./styles`
|
|
123
|
-
2. **Scope constant** — `const SCOPE = 'COMPONENT_NAME'` for `
|
|
123
|
+
2. **Scope constant** — `const SCOPE = 'COMPONENT_NAME'` for `useStyleContext` with a `ParentContext.Provider` wrapper for static variant context
|
|
124
124
|
3. **Root component** — renders the primitive Root (or a host element directly when no primitive exists), spreads `dataAttributes({ slot: '<component>' })`
|
|
125
125
|
4. **Sub-slots** — each accepts `asChild`, renders a host element via `const Comp = asChild ? Slot : DefaultElement`, spreads `dataAttributes({ slot: '<component>-<slot>' })`. Sub-slots **do not** call `useButtonContext()` (or its equivalent) unless their own styling reacts to interaction state.
|
|
126
126
|
5. **Position-aware sub-slots** — icon/spinner-style slots accept `position?: 'leading' | 'trailing'` and emit `data-icon` via `dataAttributes({ icon: '...' })`.
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Card = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _primitives = require("@cdx-ui/primitives");
|
|
9
10
|
var _utils = require("@cdx-ui/utils");
|
|
10
11
|
var _styles = require("./styles");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -13,25 +14,36 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
13
14
|
// STYLED ROOT COMPONENT
|
|
14
15
|
// =============================================================================
|
|
15
16
|
const SCOPE = 'CARD';
|
|
16
|
-
const Root = (0, _utils.withStyleContext)(_reactNative.View, SCOPE);
|
|
17
17
|
const useCardStyleContext = () => (0, _utils.useStyleContext)(SCOPE);
|
|
18
18
|
const CardRoot = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
19
|
+
asChild,
|
|
19
20
|
className,
|
|
20
21
|
children,
|
|
21
22
|
style,
|
|
22
23
|
fullBleed,
|
|
23
24
|
...props
|
|
24
25
|
}, ref) => {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
style: style,
|
|
30
|
-
context: {
|
|
26
|
+
const parent = (0, _utils.useParentContext)();
|
|
27
|
+
const ctx = (0, _react.useMemo)(() => ({
|
|
28
|
+
...parent,
|
|
29
|
+
[SCOPE]: {
|
|
31
30
|
fullBleed
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
}
|
|
32
|
+
}), [parent, fullBleed]);
|
|
33
|
+
const computedClassName = (0, _utils.cn)((0, _styles.cardRootVariants)(), className);
|
|
34
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.ParentContext.Provider, {
|
|
36
|
+
value: ctx,
|
|
37
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
38
|
+
ref: ref,
|
|
39
|
+
className: computedClassName,
|
|
40
|
+
style: style,
|
|
41
|
+
...props,
|
|
42
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
43
|
+
slot: 'card'
|
|
44
|
+
})),
|
|
45
|
+
children: children
|
|
46
|
+
})
|
|
35
47
|
});
|
|
36
48
|
});
|
|
37
49
|
CardRoot.displayName = 'Card';
|
|
@@ -41,17 +53,22 @@ CardRoot.displayName = 'Card';
|
|
|
41
53
|
// =============================================================================
|
|
42
54
|
|
|
43
55
|
const CardHeader = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
56
|
+
asChild,
|
|
44
57
|
className,
|
|
45
58
|
children,
|
|
46
59
|
style,
|
|
47
60
|
...props
|
|
48
61
|
}, ref) => {
|
|
49
62
|
const computedClassName = (0, _utils.cn)((0, _styles.cardHeaderVariants)(), className);
|
|
50
|
-
|
|
63
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
64
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
51
65
|
ref: ref,
|
|
52
66
|
className: computedClassName,
|
|
53
67
|
style: style,
|
|
54
68
|
...props,
|
|
69
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
70
|
+
slot: 'card-header'
|
|
71
|
+
})),
|
|
55
72
|
children: children
|
|
56
73
|
});
|
|
57
74
|
});
|
|
@@ -62,6 +79,7 @@ CardHeader.displayName = 'Card.Header';
|
|
|
62
79
|
// =============================================================================
|
|
63
80
|
|
|
64
81
|
const CardContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
82
|
+
asChild,
|
|
65
83
|
className,
|
|
66
84
|
children,
|
|
67
85
|
style,
|
|
@@ -74,11 +92,15 @@ const CardContent = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
74
92
|
const computedClassName = (0, _utils.cn)((0, _styles.cardContentVariants)({
|
|
75
93
|
fullBleed: fullBleed ?? fullBleedFromContext
|
|
76
94
|
}), className);
|
|
77
|
-
|
|
95
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
96
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
78
97
|
ref: ref,
|
|
79
98
|
className: computedClassName,
|
|
80
99
|
style: style,
|
|
81
100
|
...props,
|
|
101
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
102
|
+
slot: 'card-content'
|
|
103
|
+
})),
|
|
82
104
|
children: children
|
|
83
105
|
});
|
|
84
106
|
});
|
|
@@ -89,6 +111,7 @@ CardContent.displayName = 'Card.Content';
|
|
|
89
111
|
// =============================================================================
|
|
90
112
|
|
|
91
113
|
const CardFooter = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
114
|
+
asChild,
|
|
92
115
|
className,
|
|
93
116
|
children,
|
|
94
117
|
style,
|
|
@@ -101,11 +124,15 @@ const CardFooter = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
101
124
|
const computedClassName = (0, _utils.cn)((0, _styles.cardFooterVariants)({
|
|
102
125
|
fullBleed: fullBleed ?? fullBleedFromContext
|
|
103
126
|
}), className);
|
|
104
|
-
|
|
127
|
+
const Comp = asChild ? _primitives.Slot : _reactNative.View;
|
|
128
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Comp, {
|
|
105
129
|
ref: ref,
|
|
106
130
|
className: computedClassName,
|
|
107
131
|
style: style,
|
|
108
132
|
...props,
|
|
133
|
+
...(0, _primitives.mergeDataAttributes)(props, (0, _primitives.dataAttributes)({
|
|
134
|
+
slot: 'card-footer'
|
|
135
|
+
})),
|
|
109
136
|
children: children
|
|
110
137
|
});
|
|
111
138
|
});
|
|
@@ -115,8 +142,9 @@ CardFooter.displayName = 'Card.Footer';
|
|
|
115
142
|
// COMPOUND COMPONENT
|
|
116
143
|
// =============================================================================
|
|
117
144
|
|
|
118
|
-
const Card = exports.Card = CardRoot
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
145
|
+
const Card = exports.Card = Object.assign(CardRoot, {
|
|
146
|
+
Header: CardHeader,
|
|
147
|
+
Content: CardContent,
|
|
148
|
+
Footer: CardFooter
|
|
149
|
+
});
|
|
122
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_utils","_styles","_jsxRuntime","SCOPE","
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_primitives","_utils","_styles","_jsxRuntime","SCOPE","useCardStyleContext","useStyleContext","CardRoot","forwardRef","asChild","className","children","style","fullBleed","props","ref","parent","useParentContext","ctx","useMemo","computedClassName","cn","cardRootVariants","Comp","Slot","View","jsx","ParentContext","Provider","value","mergeDataAttributes","dataAttributes","slot","displayName","CardHeader","cardHeaderVariants","CardContent","fullBleedFromContext","cardContentVariants","CardFooter","cardFooterVariants","Card","exports","Object","assign","Header","Content","Footer"],"sourceRoot":"../../../../src","sources":["components/Card/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAQkB,IAAAK,WAAA,GAAAL,OAAA;AAElB;AACA;AACA;AAEA,MAAMM,KAAK,GAAG,MAAM;AAEpB,MAAMC,mBAAmB,GAAGA,CAAA,KAAM,IAAAC,sBAAe,EAACF,KAAK,CAAqB;AAQ5E,MAAMG,QAAQ,gBAAG,IAAAC,iBAAU,EACzB,CAAC;EAAEC,OAAO;EAAEC,SAAS;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,KAAK;EACrE,MAAMC,MAAM,GAAG,IAAAC,uBAAgB,EAAC,CAAC;EACjC,MAAMC,GAAG,GAAG,IAAAC,cAAO,EAAC,OAAO;IAAE,GAAGH,MAAM;IAAE,CAACZ,KAAK,GAAG;MAAES;IAAU;EAAE,CAAC,CAAC,EAAE,CAACG,MAAM,EAAEH,SAAS,CAAC,CAAC;EAEvF,MAAMO,iBAAiB,GAAG,IAAAC,SAAE,EAAC,IAAAC,wBAAgB,EAAC,CAAC,EAAEZ,SAAS,CAAC;EAC3D,MAAMa,IAAI,GAAGd,OAAO,GAAGe,gBAAI,GAAGC,iBAAI;EAElC,oBACE,IAAAtB,WAAA,CAAAuB,GAAA,EAACzB,MAAA,CAAA0B,aAAa,CAACC,QAAQ;IAACC,KAAK,EAAEX,GAAI;IAAAP,QAAA,eACjC,IAAAR,WAAA,CAAAuB,GAAA,EAACH,IAAI;MACHR,GAAG,EAAEA,GAAI;MACTL,SAAS,EAAEU,iBAAkB;MAC7BR,KAAK,EAAEA,KAAM;MAAA,GACTE,KAAK;MAAA,GACL,IAAAg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