@elliemae/ds-swipe-card 3.53.0-alpha.2

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 (48) hide show
  1. package/dist/cjs/DSSwipeCard.js +99 -0
  2. package/dist/cjs/DSSwipeCard.js.map +7 -0
  3. package/dist/cjs/config/slidePositionHelpers.js +44 -0
  4. package/dist/cjs/config/slidePositionHelpers.js.map +7 -0
  5. package/dist/cjs/config/touchHandlers.js +77 -0
  6. package/dist/cjs/config/touchHandlers.js.map +7 -0
  7. package/dist/cjs/config/useSwipeCard.js +91 -0
  8. package/dist/cjs/config/useSwipeCard.js.map +7 -0
  9. package/dist/cjs/config/useValidateProps.js +40 -0
  10. package/dist/cjs/config/useValidateProps.js.map +7 -0
  11. package/dist/cjs/constants/index.js +45 -0
  12. package/dist/cjs/constants/index.js.map +7 -0
  13. package/dist/cjs/index.js +42 -0
  14. package/dist/cjs/index.js.map +7 -0
  15. package/dist/cjs/package.json +7 -0
  16. package/dist/cjs/react-desc-prop-types.js +69 -0
  17. package/dist/cjs/react-desc-prop-types.js.map +7 -0
  18. package/dist/cjs/styled.js +108 -0
  19. package/dist/cjs/styled.js.map +7 -0
  20. package/dist/esm/DSSwipeCard.js +69 -0
  21. package/dist/esm/DSSwipeCard.js.map +7 -0
  22. package/dist/esm/config/slidePositionHelpers.js +14 -0
  23. package/dist/esm/config/slidePositionHelpers.js.map +7 -0
  24. package/dist/esm/config/touchHandlers.js +47 -0
  25. package/dist/esm/config/touchHandlers.js.map +7 -0
  26. package/dist/esm/config/useSwipeCard.js +61 -0
  27. package/dist/esm/config/useSwipeCard.js.map +7 -0
  28. package/dist/esm/config/useValidateProps.js +10 -0
  29. package/dist/esm/config/useValidateProps.js.map +7 -0
  30. package/dist/esm/constants/index.js +15 -0
  31. package/dist/esm/constants/index.js.map +7 -0
  32. package/dist/esm/index.js +12 -0
  33. package/dist/esm/index.js.map +7 -0
  34. package/dist/esm/package.json +7 -0
  35. package/dist/esm/react-desc-prop-types.js +44 -0
  36. package/dist/esm/react-desc-prop-types.js.map +7 -0
  37. package/dist/esm/styled.js +78 -0
  38. package/dist/esm/styled.js.map +7 -0
  39. package/dist/types/DSSwipeCard.d.ts +7 -0
  40. package/dist/types/config/slidePositionHelpers.d.ts +8 -0
  41. package/dist/types/config/touchHandlers.d.ts +23 -0
  42. package/dist/types/config/useSwipeCard.d.ts +22 -0
  43. package/dist/types/config/useValidateProps.d.ts +3 -0
  44. package/dist/types/constants/index.d.ts +11 -0
  45. package/dist/types/index.d.ts +3 -0
  46. package/dist/types/react-desc-prop-types.d.ts +31 -0
  47. package/dist/types/styled.d.ts +28 -0
  48. package/package.json +73 -0
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var DSSwipeCard_exports = {};
30
+ __export(DSSwipeCard_exports, {
31
+ DSSwipeCard: () => DSSwipeCard,
32
+ DSSwipeCardWithSchema: () => DSSwipeCardWithSchema
33
+ });
34
+ module.exports = __toCommonJS(DSSwipeCard_exports);
35
+ var React = __toESM(require("react"));
36
+ var import_jsx_runtime = require("react/jsx-runtime");
37
+ var import_react = __toESM(require("react"));
38
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
39
+ var import_uid = require("uid");
40
+ var import_useSwipeCard = require("./config/useSwipeCard.js");
41
+ var import_constants = require("./constants/index.js");
42
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
43
+ var import_styled = require("./styled.js");
44
+ const DSSwipeCard = (props) => {
45
+ const {
46
+ propsWithDefault,
47
+ xstyledProps,
48
+ instanceUid,
49
+ isFirstRender,
50
+ onTouchStart,
51
+ onTouchMove,
52
+ onTouchEnd,
53
+ globalAttributes
54
+ } = (0, import_useSwipeCard.useSwipeCard)(props);
55
+ const { wrap, ...restGlobalAttributes } = globalAttributes;
56
+ const { disabled, animationDuration, enableTouch, CardRender, slidesProps, enableAnimation } = propsWithDefault;
57
+ const ownerPropsConfig = (0, import_ds_props_helpers.useOwnerProps)(propsWithDefault);
58
+ const [renderKey, setRenderKey] = import_react.default.useState(`render-key-${(0, import_uid.uid)(5)}`);
59
+ const handleAnimationStart = import_react.default.useCallback(() => {
60
+ requestAnimationFrame(() => setRenderKey(`render-key-${(0, import_uid.uid)(5)}`));
61
+ }, [setRenderKey]);
62
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_styled.StyledWrapper, { ...ownerPropsConfig, ...xstyledProps, ...restGlobalAttributes, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ import_styled.StyledScrollContainer,
64
+ {
65
+ $disabled: disabled,
66
+ $enableTouch: enableTouch,
67
+ onTouchStart,
68
+ onTouchMove,
69
+ onTouchEnd,
70
+ ...ownerPropsConfig,
71
+ children: slidesProps.map((slide, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ import_styled.StyledSlide,
73
+ {
74
+ ...ownerPropsConfig,
75
+ $animationDuration: animationDuration,
76
+ $isFirstRender: isFirstRender,
77
+ $enableAnimation: enableAnimation,
78
+ $isActive: i === propsWithDefault.activeSlide,
79
+ "aria-hidden": i !== propsWithDefault.activeSlide,
80
+ onAnimationStart: isFirstRender ? void 0 : handleAnimationStart,
81
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
82
+ CardRender,
83
+ {
84
+ dsIndex: i,
85
+ ...slide,
86
+ renderKey
87
+ },
88
+ `slide-${instanceUid}-${i === propsWithDefault.activeSlide}`
89
+ )
90
+ },
91
+ `slide-${instanceUid}-${i}`
92
+ ))
93
+ }
94
+ ) });
95
+ };
96
+ DSSwipeCard.displayName = import_constants.DSSwipeCardName;
97
+ const DSSwipeCardWithSchema = (0, import_ds_props_helpers.describe)(DSSwipeCard);
98
+ DSSwipeCardWithSchema.propTypes = import_react_desc_prop_types.DSSwipeCardPropTypesSchema;
99
+ //# sourceMappingURL=DSSwipeCard.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/DSSwipeCard.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { describe, useOwnerProps } from '@elliemae/ds-props-helpers';\nimport { uid } from 'uid';\nimport { useSwipeCard } from './config/useSwipeCard.js';\nimport { DSSwipeCardName } from './constants/index.js';\nimport { type DSSwipeCardT, DSSwipeCardPropTypesSchema } from './react-desc-prop-types.js';\nimport { StyledScrollContainer, StyledSlide, StyledWrapper } from './styled.js';\n\nconst DSSwipeCard = <T extends DSSwipeCardT.CustomInterface>(props: DSSwipeCardT.Props<T>) => {\n const {\n propsWithDefault,\n xstyledProps,\n instanceUid,\n isFirstRender,\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n globalAttributes,\n } = useSwipeCard(props);\n\n const { wrap, ...restGlobalAttributes } = globalAttributes;\n const { disabled, animationDuration, enableTouch, CardRender, slidesProps, enableAnimation } = propsWithDefault;\n const ownerPropsConfig = useOwnerProps(propsWithDefault);\n const [renderKey, setRenderKey] = React.useState(`render-key-${uid(5)}`);\n const handleAnimationStart = React.useCallback(() => {\n // we change the key to force RENDERING of slides, to avoid wrong calculations of width/height on virtualization\n requestAnimationFrame(() => setRenderKey(`render-key-${uid(5)}`));\n }, [setRenderKey]);\n return (\n <StyledWrapper {...ownerPropsConfig} {...xstyledProps} {...restGlobalAttributes}>\n <StyledScrollContainer\n $disabled={disabled}\n $enableTouch={enableTouch}\n onTouchStart={onTouchStart}\n onTouchMove={onTouchMove}\n onTouchEnd={onTouchEnd}\n {...ownerPropsConfig}\n >\n {slidesProps.map((slide, i) => (\n <StyledSlide\n // we can use the i as a key BECAUSE WE ALSO ADD THE ${instanceUid}\n // the eslint rule is to avoid repeated keys in the VDOM, but we are not repeating it thanks to UID\n // eslint-disable-next-line react/no-array-index-key\n key={`slide-${instanceUid}-${i}`}\n {...ownerPropsConfig}\n $animationDuration={animationDuration}\n $isFirstRender={isFirstRender}\n $enableAnimation={enableAnimation}\n $isActive={i === propsWithDefault.activeSlide}\n aria-hidden={i !== propsWithDefault.activeSlide}\n onAnimationStart={isFirstRender ? undefined : handleAnimationStart}\n >\n <CardRender\n key={`slide-${instanceUid}-${i === propsWithDefault.activeSlide}`}\n dsIndex={i}\n {...slide}\n renderKey={renderKey}\n />\n </StyledSlide>\n ))}\n </StyledScrollContainer>\n </StyledWrapper>\n );\n};\n\nDSSwipeCard.displayName = DSSwipeCardName;\nconst DSSwipeCardWithSchema = describe(DSSwipeCard);\nDSSwipeCardWithSchema.propTypes = DSSwipeCardPropTypesSchema;\n\nexport { DSSwipeCard, DSSwipeCardWithSchema };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADoDX;AApDZ,mBAAkB;AAClB,8BAAwC;AACxC,iBAAoB;AACpB,0BAA6B;AAC7B,uBAAgC;AAChC,mCAA8D;AAC9D,oBAAkE;AAElE,MAAM,cAAc,CAAyC,UAAiC;AAC5F,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,kCAAa,KAAK;AAEtB,QAAM,EAAE,MAAM,GAAG,qBAAqB,IAAI;AAC1C,QAAM,EAAE,UAAU,mBAAmB,aAAa,YAAY,aAAa,gBAAgB,IAAI;AAC/F,QAAM,uBAAmB,uCAAc,gBAAgB;AACvD,QAAM,CAAC,WAAW,YAAY,IAAI,aAAAA,QAAM,SAAS,kBAAc,gBAAI,CAAC,CAAC,EAAE;AACvE,QAAM,uBAAuB,aAAAA,QAAM,YAAY,MAAM;AAEnD,0BAAsB,MAAM,aAAa,kBAAc,gBAAI,CAAC,CAAC,EAAE,CAAC;AAAA,EAClE,GAAG,CAAC,YAAY,CAAC;AACjB,SACE,4CAAC,+BAAe,GAAG,kBAAmB,GAAG,cAAe,GAAG,sBACzD;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,MACX,cAAc;AAAA,MACd;AAAA,MACA;AAAA,MACA;AAAA,MACC,GAAG;AAAA,MAEH,sBAAY,IAAI,CAAC,OAAO,MACvB;AAAA,QAAC;AAAA;AAAA,UAKE,GAAG;AAAA,UACJ,oBAAoB;AAAA,UACpB,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,UAClB,WAAW,MAAM,iBAAiB;AAAA,UAClC,eAAa,MAAM,iBAAiB;AAAA,UACpC,kBAAkB,gBAAgB,SAAY;AAAA,UAE9C;AAAA,YAAC;AAAA;AAAA,cAEC,SAAS;AAAA,cACR,GAAG;AAAA,cACJ;AAAA;AAAA,YAHK,SAAS,WAAW,IAAI,MAAM,iBAAiB,WAAW;AAAA,UAIjE;AAAA;AAAA,QAdK,SAAS,WAAW,IAAI,CAAC;AAAA,MAehC,CACD;AAAA;AAAA,EACH,GACF;AAEJ;AAEA,YAAY,cAAc;AAC1B,MAAM,4BAAwB,kCAAS,WAAW;AAClD,sBAAsB,YAAY;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var slidePositionHelpers_exports = {};
30
+ __export(slidePositionHelpers_exports, {
31
+ calculateSwipeTarget: () => calculateSwipeTarget
32
+ });
33
+ module.exports = __toCommonJS(slidePositionHelpers_exports);
34
+ var React = __toESM(require("react"));
35
+ const calculateSwipeTarget = (deltaX, currentSlide, totalSlides) => {
36
+ if (deltaX > 0 && currentSlide > 0) {
37
+ return { targetSlide: currentSlide - 1, direction: "right" };
38
+ }
39
+ if (deltaX < 0 && currentSlide < totalSlides - 1) {
40
+ return { targetSlide: currentSlide + 1, direction: "left" };
41
+ }
42
+ return null;
43
+ };
44
+ //# sourceMappingURL=slidePositionHelpers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/slidePositionHelpers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["export interface SwipeTarget {\n targetSlide: number;\n direction: 'left' | 'right';\n}\n\n/**\n * Calculate swipe target slide based on gesture\n */\nexport const calculateSwipeTarget = (deltaX: number, currentSlide: number, totalSlides: number): SwipeTarget | null => {\n if (deltaX > 0 && currentSlide > 0) {\n return { targetSlide: currentSlide - 1, direction: 'right' };\n }\n if (deltaX < 0 && currentSlide < totalSlides - 1) {\n return { targetSlide: currentSlide + 1, direction: 'left' };\n }\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADQhB,MAAM,uBAAuB,CAAC,QAAgB,cAAsB,gBAA4C;AACrH,MAAI,SAAS,KAAK,eAAe,GAAG;AAClC,WAAO,EAAE,aAAa,eAAe,GAAG,WAAW,QAAQ;AAAA,EAC7D;AACA,MAAI,SAAS,KAAK,eAAe,cAAc,GAAG;AAChD,WAAO,EAAE,aAAa,eAAe,GAAG,WAAW,OAAO;AAAA,EAC5D;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var touchHandlers_exports = {};
30
+ __export(touchHandlers_exports, {
31
+ useTouchHandlers: () => useTouchHandlers
32
+ });
33
+ module.exports = __toCommonJS(touchHandlers_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_slidePositionHelpers = require("./slidePositionHelpers.js");
37
+ const useTouchHandlers = (options) => {
38
+ const { enableTouch, disabled, activeSlide, totalSlides, onSwipe } = options;
39
+ const startXRef = import_react.default.useRef(0);
40
+ const startYRef = import_react.default.useRef(0);
41
+ const isDraggingRef = import_react.default.useRef(false);
42
+ const onTouchStart = import_react.default.useCallback((e) => {
43
+ const touch = e.touches[0];
44
+ startXRef.current = touch.clientX;
45
+ startYRef.current = touch.clientY;
46
+ isDraggingRef.current = true;
47
+ }, []);
48
+ const onTouchMove = import_react.default.useCallback(() => {
49
+ }, []);
50
+ const onTouchEnd = import_react.default.useCallback(
51
+ (e) => {
52
+ if (!isDraggingRef.current) {
53
+ return;
54
+ }
55
+ const touch = e.changedTouches[0];
56
+ const deltaX = touch.clientX - startXRef.current;
57
+ const deltaY = touch.clientY - startYRef.current;
58
+ if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 50) {
59
+ const swipeResult = (0, import_slidePositionHelpers.calculateSwipeTarget)(deltaX, activeSlide, totalSlides);
60
+ if (swipeResult) {
61
+ onSwipe(swipeResult.targetSlide, swipeResult.direction);
62
+ }
63
+ }
64
+ isDraggingRef.current = false;
65
+ },
66
+ [activeSlide, totalSlides, onSwipe]
67
+ );
68
+ if (!enableTouch || disabled) {
69
+ return {
70
+ onTouchStart: void 0,
71
+ onTouchMove: void 0,
72
+ onTouchEnd: void 0
73
+ };
74
+ }
75
+ return { onTouchStart, onTouchMove, onTouchEnd };
76
+ };
77
+ //# sourceMappingURL=touchHandlers.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/touchHandlers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\nimport { calculateSwipeTarget } from './slidePositionHelpers.js';\n\nexport interface TouchHandlerOptions {\n enableTouch: boolean;\n disabled: boolean;\n activeSlide: number;\n totalSlides: number;\n onSwipe: (targetSlide: number, direction: 'left' | 'right') => void;\n}\n\n/**\n * useTouchHandlers\n *\n * Provides touch event handlers for swipe detection using React refs for mutable state\n * and React.useCallback for stable handler identities.\n */\nexport const useTouchHandlers = (options: TouchHandlerOptions) => {\n const { enableTouch, disabled, activeSlide, totalSlides, onSwipe } = options;\n\n // Mutable refs for gesture tracking to avoid re-renders\n const startXRef = React.useRef<number>(0);\n const startYRef = React.useRef<number>(0);\n const isDraggingRef = React.useRef<boolean>(false);\n\n const onTouchStart = React.useCallback((e: React.TouchEvent<HTMLDivElement>) => {\n const touch = e.touches[0];\n startXRef.current = touch.clientX;\n startYRef.current = touch.clientY;\n isDraggingRef.current = true;\n }, []);\n\n const onTouchMove = React.useCallback(() => {\n // We don't need to handle move for swipe detection\n }, []);\n\n const onTouchEnd = React.useCallback(\n (e: React.TouchEvent<HTMLDivElement>) => {\n if (!isDraggingRef.current) {\n return;\n }\n const touch = e.changedTouches[0];\n const deltaX = touch.clientX - startXRef.current;\n const deltaY = touch.clientY - startYRef.current;\n\n // Trigger swipe only for significant horizontal movement\n if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > 50) {\n const swipeResult = calculateSwipeTarget(deltaX, activeSlide, totalSlides);\n if (swipeResult) {\n onSwipe(swipeResult.targetSlide, swipeResult.direction);\n }\n }\n\n isDraggingRef.current = false;\n },\n [activeSlide, totalSlides, onSwipe],\n );\n\n // If touch is disabled, expose null so consumers can skip attaching handlers\n if (!enableTouch || disabled) {\n return {\n onTouchStart: undefined,\n onTouchMove: undefined,\n onTouchEnd: undefined,\n };\n }\n\n return { onTouchStart, onTouchMove, onTouchEnd };\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAClB,kCAAqC;AAgB9B,MAAM,mBAAmB,CAAC,YAAiC;AAChE,QAAM,EAAE,aAAa,UAAU,aAAa,aAAa,QAAQ,IAAI;AAGrE,QAAM,YAAY,aAAAA,QAAM,OAAe,CAAC;AACxC,QAAM,YAAY,aAAAA,QAAM,OAAe,CAAC;AACxC,QAAM,gBAAgB,aAAAA,QAAM,OAAgB,KAAK;AAEjD,QAAM,eAAe,aAAAA,QAAM,YAAY,CAAC,MAAwC;AAC9E,UAAM,QAAQ,EAAE,QAAQ,CAAC;AACzB,cAAU,UAAU,MAAM;AAC1B,cAAU,UAAU,MAAM;AAC1B,kBAAc,UAAU;AAAA,EAC1B,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,aAAAA,QAAM,YAAY,MAAM;AAAA,EAE5C,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa,aAAAA,QAAM;AAAA,IACvB,CAAC,MAAwC;AACvC,UAAI,CAAC,cAAc,SAAS;AAC1B;AAAA,MACF;AACA,YAAM,QAAQ,EAAE,eAAe,CAAC;AAChC,YAAM,SAAS,MAAM,UAAU,UAAU;AACzC,YAAM,SAAS,MAAM,UAAU,UAAU;AAGzC,UAAI,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,IAAI,IAAI;AAChE,cAAM,kBAAc,kDAAqB,QAAQ,aAAa,WAAW;AACzE,YAAI,aAAa;AACf,kBAAQ,YAAY,aAAa,YAAY,SAAS;AAAA,QACxD;AAAA,MACF;AAEA,oBAAc,UAAU;AAAA,IAC1B;AAAA,IACA,CAAC,aAAa,aAAa,OAAO;AAAA,EACpC;AAGA,MAAI,CAAC,eAAe,UAAU;AAC5B,WAAO;AAAA,MACL,cAAc;AAAA,MACd,aAAa;AAAA,MACb,YAAY;AAAA,IACd;AAAA,EACF;AAEA,SAAO,EAAE,cAAc,aAAa,WAAW;AACjD;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useSwipeCard_exports = {};
30
+ __export(useSwipeCard_exports, {
31
+ useSwipeCard: () => useSwipeCard
32
+ });
33
+ module.exports = __toCommonJS(useSwipeCard_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_react = __toESM(require("react"));
37
+ var import_uid = require("uid");
38
+ var import_react_desc_prop_types = require("../react-desc-prop-types.js");
39
+ var import_useValidateProps = require("./useValidateProps.js");
40
+ var import_touchHandlers = require("./touchHandlers.js");
41
+ const useFirstRender = () => {
42
+ const ref = import_react.default.useRef(true);
43
+ const firstRender = ref.current;
44
+ ref.current = false;
45
+ return firstRender;
46
+ };
47
+ const useSwipeCard = (propsFromUser) => {
48
+ const propsWithDefault = (0, import_ds_props_helpers.useMemoMergePropsWithDefault)(
49
+ propsFromUser,
50
+ import_react_desc_prop_types.DSSwipeCardDefaultProps
51
+ );
52
+ (0, import_useValidateProps.useValidateProps)(propsWithDefault, import_react_desc_prop_types.DSSwipeCardPropTypes);
53
+ const xstyledProps = (0, import_ds_props_helpers.useGetXstyledProps)(propsWithDefault);
54
+ const instanceUid = import_react.default.useMemo(() => `swipe-card-${(0, import_uid.uid)(5)}`, []);
55
+ const globalAttributes = (0, import_ds_props_helpers.useGetGlobalAttributes)(propsWithDefault);
56
+ const { activeSlide, slidesProps, enableTouch, disabled, onSwipe } = propsWithDefault;
57
+ const isFirstRender = useFirstRender();
58
+ const totalSlides = slidesProps.length;
59
+ const touchHandlers = (0, import_touchHandlers.useTouchHandlers)({
60
+ enableTouch,
61
+ disabled: disabled ?? false,
62
+ activeSlide,
63
+ totalSlides,
64
+ onSwipe
65
+ });
66
+ const { onTouchStart, onTouchMove, onTouchEnd } = touchHandlers;
67
+ return import_react.default.useMemo(
68
+ () => ({
69
+ propsWithDefault,
70
+ xstyledProps,
71
+ globalAttributes,
72
+ instanceUid,
73
+ isFirstRender,
74
+ // handlers to attach directly to the element to avoid extra effects
75
+ onTouchStart,
76
+ onTouchMove,
77
+ onTouchEnd
78
+ }),
79
+ [
80
+ propsWithDefault,
81
+ xstyledProps,
82
+ instanceUid,
83
+ isFirstRender,
84
+ onTouchStart,
85
+ onTouchMove,
86
+ onTouchEnd,
87
+ globalAttributes
88
+ ]
89
+ );
90
+ };
91
+ //# sourceMappingURL=useSwipeCard.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useSwipeCard.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useGetGlobalAttributes, useGetXstyledProps, useMemoMergePropsWithDefault } from '@elliemae/ds-props-helpers';\nimport React from 'react';\nimport { uid } from 'uid';\nimport { DSSwipeCardPropTypes, DSSwipeCardDefaultProps, type DSSwipeCardT } from '../react-desc-prop-types.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport { useTouchHandlers } from './touchHandlers.js';\n\nconst useFirstRender = () => {\n const ref = React.useRef(true);\n const firstRender = ref.current;\n ref.current = false;\n return firstRender;\n};\n\ninterface SwipeCardCTX<T extends DSSwipeCardT.CustomInterface> {\n propsWithDefault: DSSwipeCardT.InternalProps<T>;\n xstyledProps: ReturnType<typeof useGetXstyledProps>;\n globalAttributes: ReturnType<typeof useGetGlobalAttributes>;\n instanceUid: string;\n isFirstRender: boolean;\n // React touch handlers (no effects needed)\n onTouchStart?: (e: React.TouchEvent<HTMLDivElement>) => void;\n onTouchMove?: (e: React.TouchEvent<HTMLDivElement>) => void;\n onTouchEnd?: (e: React.TouchEvent<HTMLDivElement>) => void;\n}\n/**\n * useSwipeCard\n *\n * Orchestrates the controlled carousel behavior:\n * - It validates and merges props with defaults\n * - exposes touch handlers\n */\nexport const useSwipeCard = <T extends DSSwipeCardT.CustomInterface>(\n propsFromUser: DSSwipeCardT.Props<T>,\n): SwipeCardCTX<T> => {\n // =============================================================================\n // MERGE WITH DEFAULT AND VALIDATE PROPS\n // =============================================================================\n const propsWithDefault = useMemoMergePropsWithDefault<DSSwipeCardT.InternalProps<T>>(\n propsFromUser,\n DSSwipeCardDefaultProps,\n );\n useValidateProps(propsWithDefault, DSSwipeCardPropTypes);\n\n // =============================================================================\n // XSTYLED PROPS AND INSTANCE UID\n // =============================================================================\n const xstyledProps = useGetXstyledProps(propsWithDefault);\n const instanceUid = React.useMemo(() => `swipe-card-${uid(5)}`, []);\n // =============================================================================\n // GLOBAL ATTRIBUTES\n // =============================================================================\n const globalAttributes = useGetGlobalAttributes(propsWithDefault);\n\n // =============================================================================\n // AD HOC PER COMPONENT LOGIC\n // =============================================================================\n const { activeSlide, slidesProps, enableTouch, disabled, onSwipe } = propsWithDefault;\n\n const isFirstRender = useFirstRender();\n const totalSlides = slidesProps.length;\n\n // =============================================================================\n // TOUCH/SWIPE DETECTION\n // =============================================================================\n const touchHandlers = useTouchHandlers({\n enableTouch,\n disabled: disabled ?? false,\n activeSlide,\n totalSlides,\n onSwipe,\n });\n const { onTouchStart, onTouchMove, onTouchEnd } = touchHandlers;\n\n return React.useMemo(\n () => ({\n propsWithDefault,\n xstyledProps,\n globalAttributes,\n instanceUid,\n isFirstRender,\n // handlers to attach directly to the element to avoid extra effects\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n }),\n [\n propsWithDefault,\n xstyledProps,\n instanceUid,\n isFirstRender,\n onTouchStart,\n onTouchMove,\n onTouchEnd,\n globalAttributes,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAyF;AACzF,mBAAkB;AAClB,iBAAoB;AACpB,mCAAiF;AACjF,8BAAiC;AACjC,2BAAiC;AAEjC,MAAM,iBAAiB,MAAM;AAC3B,QAAM,MAAM,aAAAA,QAAM,OAAO,IAAI;AAC7B,QAAM,cAAc,IAAI;AACxB,MAAI,UAAU;AACd,SAAO;AACT;AAoBO,MAAM,eAAe,CAC1B,kBACoB;AAIpB,QAAM,uBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AACA,gDAAiB,kBAAkB,iDAAoB;AAKvD,QAAM,mBAAe,4CAAmB,gBAAgB;AACxD,QAAM,cAAc,aAAAA,QAAM,QAAQ,MAAM,kBAAc,gBAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAIlE,QAAM,uBAAmB,gDAAuB,gBAAgB;AAKhE,QAAM,EAAE,aAAa,aAAa,aAAa,UAAU,QAAQ,IAAI;AAErE,QAAM,gBAAgB,eAAe;AACrC,QAAM,cAAc,YAAY;AAKhC,QAAM,oBAAgB,uCAAiB;AAAA,IACrC;AAAA,IACA,UAAU,YAAY;AAAA,IACtB;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,EAAE,cAAc,aAAa,WAAW,IAAI;AAElD,SAAO,aAAAA,QAAM;AAAA,IACX,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["React"]
7
+ }
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var useValidateProps_exports = {};
30
+ __export(useValidateProps_exports, {
31
+ useValidateProps: () => useValidateProps
32
+ });
33
+ module.exports = __toCommonJS(useValidateProps_exports);
34
+ var React = __toESM(require("react"));
35
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
36
+ var import_constants = require("../constants/index.js");
37
+ const useValidateProps = (props, propTypes) => {
38
+ (0, import_ds_props_helpers.useValidateTypescriptPropTypes)(props, propTypes, import_constants.DSSwipeCardName);
39
+ };
40
+ //# sourceMappingURL=useValidateProps.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/config/useValidateProps.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport type { ValidationMap } from '@elliemae/ds-props-helpers';\nimport { type DSSwipeCardT } from '../react-desc-prop-types.js';\nimport { DSSwipeCardName } from '../constants/index.js';\n\nexport const useValidateProps = <T extends DSSwipeCardT.CustomInterface>(\n props: DSSwipeCardT.InternalProps<T>,\n propTypes: ValidationMap<unknown>,\n): void => {\n // we validate the \"required if\" via 'isRequiredIf from our custom PropTypes\n useValidateTypescriptPropTypes(props, propTypes, DSSwipeCardName);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAA+C;AAG/C,uBAAgC;AAEzB,MAAM,mBAAmB,CAC9B,OACA,cACS;AAET,8DAA+B,OAAO,WAAW,gCAAe;AAClE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var constants_exports = {};
30
+ __export(constants_exports, {
31
+ DSSwipeCardName: () => DSSwipeCardName,
32
+ SWIPE_CARD_DATA_TESTID: () => SWIPE_CARD_DATA_TESTID,
33
+ SWIPE_CARD_SLOTS: () => SWIPE_CARD_SLOTS
34
+ });
35
+ module.exports = __toCommonJS(constants_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_system = require("@elliemae/ds-system");
38
+ const DSSwipeCardName = "DSSwipecard";
39
+ const SWIPE_CARD_SLOTS = {
40
+ ROOT: "root",
41
+ SCROLL_CONTAINER: "scroll-container",
42
+ SLIDE: "slide"
43
+ };
44
+ const SWIPE_CARD_DATA_TESTID = (0, import_ds_system.slotObjectToDataTestIds)(DSSwipeCardName, SWIPE_CARD_SLOTS);
45
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/constants/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { slotObjectToDataTestIds } from '@elliemae/ds-system';\n\nexport const DSSwipeCardName = 'DSSwipecard';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const SWIPE_CARD_SLOTS = {\n ROOT: 'root',\n SCROLL_CONTAINER: 'scroll-container',\n SLIDE: 'slide',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const SWIPE_CARD_DATA_TESTID = slotObjectToDataTestIds(DSSwipeCardName, SWIPE_CARD_SLOTS);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAwC;AAEjC,MAAM,kBAAkB;AAGxB,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,kBAAkB;AAAA,EAClB,OAAO;AACT;AAGO,MAAM,6BAAyB,0CAAwB,iBAAiB,gBAAgB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
+ DSSwipeCard: () => import_DSSwipeCard.DSSwipeCard,
32
+ DSSwipeCardPropTypes: () => import_react_desc_prop_types.DSSwipeCardPropTypes,
33
+ DSSwipeCardWithSchema: () => import_DSSwipeCard.DSSwipeCardWithSchema,
34
+ SWIPE_CARD_DATA_TESTID: () => import_constants.SWIPE_CARD_DATA_TESTID,
35
+ SWIPE_CARD_SLOTS: () => import_constants.SWIPE_CARD_SLOTS
36
+ });
37
+ module.exports = __toCommonJS(index_exports);
38
+ var React = __toESM(require("react"));
39
+ var import_DSSwipeCard = require("./DSSwipeCard.js");
40
+ var import_react_desc_prop_types = require("./react-desc-prop-types.js");
41
+ var import_constants = require("./constants/index.js");
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["// this is a workaround to typescript error TS2742\n// https://github.com/microsoft/TypeScript/issues/47663\nimport type {} from '@xstyled/system';\nexport { DSSwipeCard, DSSwipeCardWithSchema } from './DSSwipeCard.js';\nexport { type DSSwipeCardT, DSSwipeCardPropTypes } from './react-desc-prop-types.js';\nexport { SWIPE_CARD_SLOTS, SWIPE_CARD_DATA_TESTID } from './constants/index.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,yBAAmD;AACnD,mCAAwD;AACxD,uBAAyD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "type": "commonjs",
3
+ "sideEffects": [
4
+ "*.css",
5
+ "*.scss"
6
+ ]
7
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var react_desc_prop_types_exports = {};
30
+ __export(react_desc_prop_types_exports, {
31
+ DSSwipeCardDefaultProps: () => DSSwipeCardDefaultProps,
32
+ DSSwipeCardPropTypes: () => DSSwipeCardPropTypes,
33
+ DSSwipeCardPropTypesSchema: () => DSSwipeCardPropTypesSchema
34
+ });
35
+ module.exports = __toCommonJS(react_desc_prop_types_exports);
36
+ var React = __toESM(require("react"));
37
+ var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
38
+ var import_constants = require("./constants/index.js");
39
+ const noop = () => {
40
+ };
41
+ const DSSwipeCardDefaultProps = {
42
+ enableAnimation: true,
43
+ enableTouch: true,
44
+ animationDuration: 300,
45
+ onSwipe: noop
46
+ };
47
+ const DSSwipeCardPropTypes = {
48
+ ...(0, import_ds_props_helpers.getPropsPerSlotPropTypes)(import_constants.DSSwipeCardName, import_constants.SWIPE_CARD_SLOTS),
49
+ ...import_ds_props_helpers.globalAttributesPropTypes,
50
+ ...import_ds_props_helpers.xstyledPropTypes,
51
+ slidesProps: import_ds_props_helpers.PropTypes.arrayOf(
52
+ import_ds_props_helpers.PropTypes.shape({
53
+ userRenderProps: import_ds_props_helpers.PropTypes.object
54
+ })
55
+ ).description("An array of props that your CardRender will receive, one object per slide").isRequired,
56
+ CardRender: import_ds_props_helpers.PropTypes.func.description(
57
+ "The react component that will be used to render slides, receiving your slide props + dsIndex that indicates the position of the slide in the array"
58
+ ).isRequired,
59
+ activeSlide: import_ds_props_helpers.PropTypes.number.description(
60
+ "Controlled props that allows application to declare which slide needs to be displayed right now"
61
+ ).isRequired,
62
+ onSwipe: import_ds_props_helpers.PropTypes.func.description("When in touch screens and enabling touch/swipe gestures, this callback is fired on swipe").defaultValue("(()=>{})"),
63
+ enableAnimation: import_ds_props_helpers.PropTypes.bool.description("When the the active slide changes, should an animation happens?").defaultValue(true),
64
+ enableTouch: import_ds_props_helpers.PropTypes.bool.description("Should touch/swipe gestures be enabled?").defaultValue(true),
65
+ animationDuration: import_ds_props_helpers.PropTypes.number.description("If an animation is enabled, this prop controls the duration in milliseconds").defaultValue(300),
66
+ disabled: import_ds_props_helpers.PropTypes.bool.description("Whether the swipe card is disabled")
67
+ };
68
+ const DSSwipeCardPropTypesSchema = DSSwipeCardPropTypes;
69
+ //# sourceMappingURL=react-desc-prop-types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/react-desc-prop-types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-empty-interface */\nimport type { DSPropTypesSchema, GlobalAttributesT, ValidationMap, XstyledProps } from '@elliemae/ds-props-helpers';\nimport {\n PropTypes,\n getPropsPerSlotPropTypes,\n globalAttributesPropTypes,\n xstyledPropTypes,\n} from '@elliemae/ds-props-helpers';\nimport type { TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport type React from 'react';\nimport { DSSwipeCardName, SWIPE_CARD_SLOTS } from './constants/index.js';\n\nconst noop = (): void => {};\n\nexport declare namespace DSSwipeCardT {\n export type CustomInterface<T extends Record<string, unknown> = Record<string, unknown>> = T;\n export type CardRenderProps<T extends Record<string, unknown> = Record<string, unknown>> = T & {\n dsIndex: number;\n renderKey: string;\n };\n\n export interface RequiredProps<T extends Record<string, unknown> = Record<string, unknown>> {\n slidesProps: CustomInterface<T>[];\n CardRender: React.ComponentType<CardRenderProps<T>>;\n activeSlide: number;\n }\n\n export interface DefaultProps {\n onSwipe: (newActiveSlide: number, direction: 'left' | 'right') => void;\n enableTouch: boolean;\n animationDuration: number;\n enableAnimation: boolean;\n }\n\n export interface OptionalProps\n extends TypescriptHelpersT.PropsForGlobalOnSlots<typeof DSSwipeCardName, typeof SWIPE_CARD_SLOTS> {}\n\n export interface Props<T extends CustomInterface = CustomInterface>\n extends RequiredProps<T>,\n Partial<DefaultProps>,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n\n export interface InternalProps<T extends CustomInterface = CustomInterface>\n extends RequiredProps<T>,\n DefaultProps,\n OptionalProps,\n Omit<GlobalAttributesT<HTMLDivElement>, keyof RequiredProps | keyof DefaultProps | keyof OptionalProps>,\n XstyledProps {}\n}\n\nexport const DSSwipeCardDefaultProps: DSSwipeCardT.DefaultProps = {\n enableAnimation: true,\n enableTouch: true,\n animationDuration: 300,\n onSwipe: noop,\n};\n\nexport const DSSwipeCardPropTypes: DSPropTypesSchema<DSSwipeCardT.Props> = {\n ...getPropsPerSlotPropTypes(DSSwipeCardName, SWIPE_CARD_SLOTS),\n ...globalAttributesPropTypes,\n ...xstyledPropTypes,\n slidesProps: PropTypes.arrayOf(\n PropTypes.shape({\n userRenderProps: PropTypes.object,\n }),\n ).description('An array of props that your CardRender will receive, one object per slide').isRequired,\n CardRender: PropTypes.func.description(\n 'The react component that will be used to render slides, receiving your slide props + dsIndex that indicates the position of the slide in the array',\n ).isRequired,\n activeSlide: PropTypes.number.description(\n 'Controlled props that allows application to declare which slide needs to be displayed right now',\n ).isRequired,\n onSwipe: PropTypes.func\n .description('When in touch screens and enabling touch/swipe gestures, this callback is fired on swipe')\n .defaultValue('(()=>{})'),\n enableAnimation: PropTypes.bool\n .description('When the the active slide changes, should an animation happens?')\n .defaultValue(true),\n enableTouch: PropTypes.bool.description('Should touch/swipe gestures be enabled?').defaultValue(true),\n animationDuration: PropTypes.number\n .description('If an animation is enabled, this prop controls the duration in milliseconds')\n .defaultValue(300),\n disabled: PropTypes.bool.description('Whether the swipe card is disabled'),\n};\n\nexport const DSSwipeCardPropTypesSchema = DSSwipeCardPropTypes as unknown as ValidationMap<DSSwipeCardT.Props>;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,8BAKO;AAGP,uBAAkD;AAElD,MAAM,OAAO,MAAY;AAAC;AAwCnB,MAAM,0BAAqD;AAAA,EAChE,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,mBAAmB;AAAA,EACnB,SAAS;AACX;AAEO,MAAM,uBAA8D;AAAA,EACzE,OAAG,kDAAyB,kCAAiB,iCAAgB;AAAA,EAC7D,GAAG;AAAA,EACH,GAAG;AAAA,EACH,aAAa,kCAAU;AAAA,IACrB,kCAAU,MAAM;AAAA,MACd,iBAAiB,kCAAU;AAAA,IAC7B,CAAC;AAAA,EACH,EAAE,YAAY,2EAA2E,EAAE;AAAA,EAC3F,YAAY,kCAAU,KAAK;AAAA,IACzB;AAAA,EACF,EAAE;AAAA,EACF,aAAa,kCAAU,OAAO;AAAA,IAC5B;AAAA,EACF,EAAE;AAAA,EACF,SAAS,kCAAU,KAChB,YAAY,0FAA0F,EACtG,aAAa,UAAU;AAAA,EAC1B,iBAAiB,kCAAU,KACxB,YAAY,iEAAiE,EAC7E,aAAa,IAAI;AAAA,EACpB,aAAa,kCAAU,KAAK,YAAY,yCAAyC,EAAE,aAAa,IAAI;AAAA,EACpG,mBAAmB,kCAAU,OAC1B,YAAY,6EAA6E,EACzF,aAAa,GAAG;AAAA,EACnB,UAAU,kCAAU,KAAK,YAAY,oCAAoC;AAC3E;AAEO,MAAM,6BAA6B;",
6
+ "names": []
7
+ }