@modul/mbui 0.0.23 → 0.0.24
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/dist/Drawer/Drawer.d.ts +4 -6
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/FavoritePyments/FavoritePaymentsList.js +3 -3
- package/dist/Swipe2Show/Swipe2Show.d.ts +6 -0
- package/dist/Swipe2Show/Swipe2Show.js +53 -0
- package/dist/Swipe2Show/Swipe2Show.js.map +1 -0
- package/dist/Swipe2Show/index.d.ts +1 -0
- package/dist/Swipe2Show/index.js +6 -0
- package/dist/Swipe2Show/index.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/Drawer/Drawer.tsx +6 -6
- package/src/FavoritePyments/FavoritePaymentsList.tsx +3 -3
- package/src/Swipe2Show/Swipe2Show.tsx +67 -0
- package/src/Swipe2Show/index.ts +1 -0
- package/src/assets/css/global.css +8 -0
- package/src/index.ts +2 -1
package/dist/Drawer/Drawer.d.ts
CHANGED
|
@@ -4,10 +4,8 @@ declare const Drawer: {
|
|
|
4
4
|
({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
|
-
declare const DrawerTrigger:
|
|
8
|
-
declare const DrawerClose:
|
|
9
|
-
declare const DrawerTitle:
|
|
10
|
-
declare const DrawerContent:
|
|
11
|
-
onAnimationEnd?: (open: boolean) => void;
|
|
12
|
-
} & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const DrawerTrigger: typeof DrawerPrimitive.Trigger;
|
|
8
|
+
declare const DrawerClose: typeof DrawerPrimitive.Close;
|
|
9
|
+
declare const DrawerTitle: typeof DrawerPrimitive.Title;
|
|
10
|
+
declare const DrawerContent: typeof DrawerPrimitive.Content;
|
|
13
11
|
export { Drawer, DrawerTrigger, DrawerContent, DrawerTitle, DrawerClose };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,+BAAgD;AAChD,0CAAmC;AACnC,iCAAkC;AAElC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAA;AAE9E,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,EAAqD,EAAE,EAAE;IAClF,OAAO,CACN,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAC;QAC9E,oBAAC,aAAe,CAAC,IAAI,OAAK,KAAK,GAAI,CACX,CACzB,CAAA;AACF,CAAC,CAAA;AA2EQ,wBAAM;AAzEf,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAA;AAE7B,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/Drawer/Drawer.tsx"],"names":[],"mappings":";;;;AAAA,0DAA8B;AAC9B,+BAAgD;AAChD,0CAAmC;AACnC,iCAAkC;AAElC,MAAM,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC,EAAC,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC,CAAA;AAE9E,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,EAAqD,EAAE,EAAE;IAClF,OAAO,CACN,oBAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAC;QAC9E,oBAAC,aAAe,CAAC,IAAI,OAAK,KAAK,GAAI,CACX,CACz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,CACvB,6BAAK,SAAS,EAAC,oBAAoB;gBAClC,8BAAM,SAAS,EAAC,kEAAkE,GAAG,CAChF,CACN;YAEA,QAAQ;YAER,SAAS,KAAK,KAAK,IAAI,CACvB,6BAAK,SAAS,EAAC,qBAAqB;gBACnC,6BACC,SAAS,EAAC,SAAS,EACnB,KAAK,EAAC,IAAI,EACV,MAAM,EAAC,IAAI,EACX,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,KAAK,EAAC,4BAA4B;oBAElC,8BACC,CAAC,EAAC,+UAA+U,EACjV,IAAI,EAAC,sBAAsB,GAC1B,CACG,CACD,CACN,CACwB,CACZ,CACf,CAAA;AACF,CAAC,CAAC,CAAA;AAI8B,sCAAa;AAF7C,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
|
@@ -7,9 +7,9 @@ const farvoriteLinkClasses = `
|
|
|
7
7
|
block
|
|
8
8
|
px-[20px]
|
|
9
9
|
py-[8px]
|
|
10
|
-
hover:bg-
|
|
11
|
-
focus:bg-
|
|
12
|
-
active:bg-
|
|
10
|
+
hover:bg-[--payments-list-item-hover]
|
|
11
|
+
focus:bg-[--payments-list-item-focus]
|
|
12
|
+
active:bg-[--payments-list-item-active]
|
|
13
13
|
`;
|
|
14
14
|
exports.farvoriteLinkClasses = farvoriteLinkClasses;
|
|
15
15
|
const FavoritePaymentsList = ({ children }) => {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Swipe2Show = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
const react_swipeable_1 = require("react-swipeable");
|
|
7
|
+
const Swipe2Show = ({ children, contentToShowRight }) => {
|
|
8
|
+
const wrapperRef = (0, react_1.useRef)(null);
|
|
9
|
+
const actionRef = (0, react_1.useRef)(null);
|
|
10
|
+
const [showRight, setShowRight] = (0, react_1.useState)(false);
|
|
11
|
+
const translateX = actionRef.current?.offsetWidth;
|
|
12
|
+
const handlers = (0, react_swipeable_1.useSwipeable)({
|
|
13
|
+
onSwipedLeft: () => setShowRight(true),
|
|
14
|
+
onSwipedRight: () => setShowRight(false),
|
|
15
|
+
swipeDuration: 500,
|
|
16
|
+
preventScrollOnSwipe: true,
|
|
17
|
+
trackMouse: true,
|
|
18
|
+
});
|
|
19
|
+
const checkClickOutside = (evt) => {
|
|
20
|
+
if (showRight && wrapperRef.current && !wrapperRef.current.contains(evt.target)) {
|
|
21
|
+
setShowRight(false);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
(0, react_1.useEffect)(() => {
|
|
25
|
+
document.addEventListener("mousedown", checkClickOutside);
|
|
26
|
+
document.addEventListener("touchstart", checkClickOutside);
|
|
27
|
+
return () => {
|
|
28
|
+
document.removeEventListener("mousedown", checkClickOutside);
|
|
29
|
+
document.removeEventListener("touchstart", checkClickOutside);
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
return (react_1.default.createElement("div", { style: { position: "relative" }, ref: wrapperRef },
|
|
33
|
+
(0, react_1.cloneElement)(children, {
|
|
34
|
+
style: {
|
|
35
|
+
transform: showRight && `translateX(-${translateX}px)`,
|
|
36
|
+
transition: "transform .15s ease-in-out",
|
|
37
|
+
width: "100%",
|
|
38
|
+
zIndex: "1",
|
|
39
|
+
touchAction: 'pan-x',
|
|
40
|
+
},
|
|
41
|
+
...handlers,
|
|
42
|
+
}),
|
|
43
|
+
react_1.default.createElement("div", { ref: actionRef, style: {
|
|
44
|
+
position: "absolute",
|
|
45
|
+
top: ".5px",
|
|
46
|
+
right: "0",
|
|
47
|
+
bottom: ".5px",
|
|
48
|
+
opacity: `${showRight ? '1' : '0'}`,
|
|
49
|
+
transition: 'opacity .15s ease-in-out'
|
|
50
|
+
} }, contentToShowRight)));
|
|
51
|
+
};
|
|
52
|
+
exports.Swipe2Show = Swipe2Show;
|
|
53
|
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C,mBAAmB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAA;YAC5D,QAAQ,CAAC,mBAAmB,CAAC,YAAY,EAAE,iBAAiB,CAAC,CAAA;QACjE,CAAC,CAAA;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,CACH,uCAAK,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,GAAG,EAAE,UAAU;QAChD,IAAA,oBAAY,EAAC,QAAmC,EAAE;YAC/C,KAAK,EAAE;gBACH,SAAS,EAAE,SAAS,IAAI,eAAe,UAAU,KAAK;gBACtD,UAAU,EAAE,4BAA4B;gBACxC,KAAK,EAAE,MAAM;gBACb,MAAM,EAAE,GAAG;gBAC1B,WAAW,EAAE,OAAO;aACR;YACD,GAAG,QAAQ;SACd,CAAC;QACF,uCACI,GAAG,EAAE,SAAS,EACd,KAAK,EAAE;gBACH,QAAQ,EAAE,UAAU;gBACpB,GAAG,EAAE,MAAM;gBACX,KAAK,EAAE,GAAG;gBACV,MAAM,EAAE,MAAM;gBAC7B,OAAO,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,GAAG,EAAE;gBAClC,UAAU,EAAE,0BAA0B;aAC1B,IAEA,kBAAkB,CACjB,CACJ,CACT,CAAA;AACL,CAAC,CAAA;AAEQ,gCAAU"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Swipe2Show } from './Swipe2Show';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Swipe2Show = void 0;
|
|
4
|
+
var Swipe2Show_1 = require("./Swipe2Show");
|
|
5
|
+
Object.defineProperty(exports, "Swipe2Show", { enumerable: true, get: function () { return Swipe2Show_1.Swipe2Show; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Swipe2Show/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAAhC,wGAAA,UAAU,OAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ import { DigitKeyPad } from "./DigitKeyPad";
|
|
|
30
30
|
import { Badge, badgeVariants } from './Badge';
|
|
31
31
|
import { Toaster, toast } from './Toaster';
|
|
32
32
|
import { Checkbox } from './Checkbox';
|
|
33
|
-
|
|
33
|
+
import { Swipe2Show } from './Swipe2Show';
|
|
34
|
+
export { Tabs, Slider, Popover, Logo, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Collapsible, CollapsibleTrigger, CollapsibleContent, AccountCollapsible, AccountCollapsibleHeader, AccountCollapsibleTrigger, AccountCollapsibleContent, AccountCollapsibleContentItem, Button, buttonVariants, InputField, InputLabel, Audio, cn, Icon, Drawer, DrawerTrigger, DrawerTitle, DrawerClose, DrawerContent, BottomNavigation, BottomNavigationList, BottomNavigationListItem, BottomNavigationLink, Page, Chip, Progress, Alert, Switch, Label, Textarea, SelectAccountCard, SelectAccount, SelectAsync, Select, Form, FormLabel, FormField, FormItem, FormControl, FormDescription, FormMessage, Calendar, DatePicker, InputMask, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogFooter, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, MessageTyping, FavoritePaymentsList, FavoritePaymentsItem, FarvoritePaymentDescription, farvoriteLinkClasses, Badge, badgeVariants, DigitKeyPad, ButtonWidget, Toaster, toast, Checkbox, Swipe2Show, };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FormMessage = exports.FormDescription = exports.FormControl = exports.FormItem = exports.FormField = exports.FormLabel = exports.Form = exports.Select = exports.SelectAsync = exports.SelectAccount = exports.SelectAccountCard = exports.Textarea = exports.Label = exports.Switch = exports.Alert = exports.Progress = exports.Chip = exports.Page = exports.BottomNavigationLink = exports.BottomNavigationListItem = exports.BottomNavigationList = exports.BottomNavigation = exports.DrawerContent = exports.DrawerClose = exports.DrawerTitle = exports.DrawerTrigger = exports.Drawer = exports.Icon = exports.cn = exports.Audio = exports.InputLabel = exports.InputField = exports.buttonVariants = exports.Button = exports.AccountCollapsibleContentItem = exports.AccountCollapsibleContent = exports.AccountCollapsibleTrigger = exports.AccountCollapsibleHeader = exports.AccountCollapsible = exports.CollapsibleContent = exports.CollapsibleTrigger = exports.Collapsible = exports.InputOTPSeparator = exports.InputOTPSlot = exports.InputOTPGroup = exports.InputOTP = exports.Logo = exports.Popover = exports.Slider = exports.Tabs = void 0;
|
|
4
|
-
exports.Checkbox = exports.toast = exports.Toaster = exports.ButtonWidget = exports.DigitKeyPad = exports.badgeVariants = exports.Badge = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.InputMask = exports.DatePicker = exports.Calendar = void 0;
|
|
4
|
+
exports.Swipe2Show = exports.Checkbox = exports.toast = exports.Toaster = exports.ButtonWidget = exports.DigitKeyPad = exports.badgeVariants = exports.Badge = exports.farvoriteLinkClasses = exports.FarvoritePaymentDescription = exports.FavoritePaymentsItem = exports.FavoritePaymentsList = exports.MessageTyping = exports.AlertDialogCancel = exports.AlertDialogAction = exports.AlertDialogDescription = exports.AlertDialogTitle = exports.AlertDialogFooter = exports.AlertDialogHeader = exports.AlertDialogContent = exports.AlertDialogTrigger = exports.AlertDialog = exports.InputMask = exports.DatePicker = exports.Calendar = void 0;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const Tabs_1 = require("./Tabs");
|
|
7
7
|
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return Tabs_1.Tabs; } });
|
|
@@ -109,4 +109,6 @@ Object.defineProperty(exports, "Toaster", { enumerable: true, get: function () {
|
|
|
109
109
|
Object.defineProperty(exports, "toast", { enumerable: true, get: function () { return Toaster_1.toast; } });
|
|
110
110
|
const Checkbox_1 = require("./Checkbox");
|
|
111
111
|
Object.defineProperty(exports, "Checkbox", { enumerable: true, get: function () { return Checkbox_1.Checkbox; } });
|
|
112
|
+
const Swipe2Show_1 = require("./Swipe2Show");
|
|
113
|
+
Object.defineProperty(exports, "Swipe2Show", { enumerable: true, get: function () { return Swipe2Show_1.Swipe2Show; } });
|
|
112
114
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,iCAA6B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,iCAA6B;AAwD5B,qFAxDQ,WAAI,OAwDR;AAvDL,qCAAiC;AAwDhC,uFAxDQ,eAAM,OAwDR;AAvDP,uCAAmC;AAwDlC,wFAxDQ,iBAAO,OAwDR;AAvDR,+DAAyB;AAwDxB,eAxDM,cAAI,CAwDN;AAvDL,2CAAsF;AAwDrF,yFAxDQ,oBAAQ,OAwDR;AACR,8FAzDkB,yBAAa,OAyDlB;AACb,6FA1DiC,wBAAY,OA0DjC;AACZ,kGA3D+C,6BAAiB,OA2D/C;AA1DlB,yDAK2B;AA0E1B,iGA9EA,mCAAgB,OA8EA;AAChB,qGA9EA,uCAAoB,OA8EA;AACpB,yGA9EA,2CAAwB,OA8EA;AACxB,qGA9EA,uCAAoB,OA8EA;AA5ErB,0DAA8B;AAmE7B,oBAAI;AAlEL,+CAAmF;AAoDlF,4FApDQ,yBAAW,OAoDR;AACX,mGArDqB,gCAAkB,OAqDrB;AAClB,mGAtDyC,g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45,7 @@
|
|
|
45
45
|
"react-hook-form": "7.53.0",
|
|
46
46
|
"react-imask": "7.6.1",
|
|
47
47
|
"react-select": "5.8.0",
|
|
48
|
+
"react-swipeable": "7.0.1",
|
|
48
49
|
"sonner": "^1.5.0",
|
|
49
50
|
"tailwind-merge": "^2.3.0",
|
|
50
51
|
"tailwindcss": "^3.4.4",
|
package/src/Drawer/Drawer.tsx
CHANGED
|
@@ -15,15 +15,15 @@ const Drawer = ({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>)
|
|
|
15
15
|
|
|
16
16
|
Drawer.displayName = 'Drawer'
|
|
17
17
|
|
|
18
|
-
const DrawerTrigger = DrawerPrimitive.Trigger
|
|
18
|
+
const DrawerTrigger: typeof DrawerPrimitive.Trigger = DrawerPrimitive.Trigger
|
|
19
19
|
|
|
20
|
-
const DrawerPortal = DrawerPrimitive.Portal
|
|
20
|
+
const DrawerPortal: typeof DrawerPrimitive.Portal = DrawerPrimitive.Portal
|
|
21
21
|
|
|
22
|
-
const DrawerClose = DrawerPrimitive.Close
|
|
22
|
+
const DrawerClose : typeof DrawerPrimitive.Close = DrawerPrimitive.Close
|
|
23
23
|
|
|
24
|
-
const DrawerOverlay = DrawerPrimitive.Overlay
|
|
24
|
+
const DrawerOverlay: typeof DrawerPrimitive.Overlay = DrawerPrimitive.Overlay
|
|
25
25
|
|
|
26
|
-
const DrawerTitle = React.forwardRef<
|
|
26
|
+
const DrawerTitle: typeof DrawerPrimitive.Title = React.forwardRef<
|
|
27
27
|
React.ElementRef<typeof DrawerPrimitive.Title>,
|
|
28
28
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>
|
|
29
29
|
>(({ className, ...props }, ref) => (
|
|
@@ -36,7 +36,7 @@ const DrawerTitle = React.forwardRef<
|
|
|
36
36
|
|
|
37
37
|
DrawerTitle.displayName = DrawerPrimitive.Title.displayName
|
|
38
38
|
|
|
39
|
-
const DrawerContent = React.forwardRef<
|
|
39
|
+
const DrawerContent: typeof DrawerPrimitive.Content = React.forwardRef<
|
|
40
40
|
React.ElementRef<typeof DrawerPrimitive.Content>,
|
|
41
41
|
React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>
|
|
42
42
|
>(({ className, children, ...props }, ref) => {
|
|
@@ -4,9 +4,9 @@ const farvoriteLinkClasses: string = `
|
|
|
4
4
|
block
|
|
5
5
|
px-[20px]
|
|
6
6
|
py-[8px]
|
|
7
|
-
hover:bg-
|
|
8
|
-
focus:bg-
|
|
9
|
-
active:bg-
|
|
7
|
+
hover:bg-[--payments-list-item-hover]
|
|
8
|
+
focus:bg-[--payments-list-item-focus]
|
|
9
|
+
active:bg-[--payments-list-item-active]
|
|
10
10
|
`
|
|
11
11
|
|
|
12
12
|
const FavoritePaymentsList: FC<{children: React.ReactNode}> = ({children}) => {
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import React, { cloneElement, FC, useCallback, useEffect, useRef, useState } from "react"
|
|
2
|
+
import { useSwipeable } from "react-swipeable"
|
|
3
|
+
|
|
4
|
+
interface IProps extends React.PropsWithChildren {
|
|
5
|
+
contentToShowRight: React.ReactNode
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const Swipe2Show: FC<IProps> = ({ children, contentToShowRight }) => {
|
|
9
|
+
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
10
|
+
const actionRef = useRef<HTMLDivElement>(null)
|
|
11
|
+
const [showRight, setShowRight] = useState(false)
|
|
12
|
+
const translateX = actionRef.current?.offsetWidth
|
|
13
|
+
|
|
14
|
+
const handlers = useSwipeable({
|
|
15
|
+
onSwipedLeft: () => setShowRight(true),
|
|
16
|
+
onSwipedRight: () => setShowRight(false),
|
|
17
|
+
swipeDuration: 500,
|
|
18
|
+
preventScrollOnSwipe: true,
|
|
19
|
+
trackMouse: true,
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
const checkClickOutside = (evt) => {
|
|
23
|
+
if (showRight && wrapperRef.current && !wrapperRef.current.contains(evt.target)) {
|
|
24
|
+
setShowRight(false)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
document.addEventListener("mousedown", checkClickOutside)
|
|
30
|
+
document.addEventListener("touchstart", checkClickOutside)
|
|
31
|
+
|
|
32
|
+
return () => {
|
|
33
|
+
document.removeEventListener("mousedown", checkClickOutside)
|
|
34
|
+
document.removeEventListener("touchstart", checkClickOutside)
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div style={{ position: "relative" }} ref={wrapperRef}>
|
|
40
|
+
{cloneElement(children as React.ReactElement<any>, {
|
|
41
|
+
style: {
|
|
42
|
+
transform: showRight && `translateX(-${translateX}px)`,
|
|
43
|
+
transition: "transform .15s ease-in-out",
|
|
44
|
+
width: "100%",
|
|
45
|
+
zIndex: "1",
|
|
46
|
+
touchAction: 'pan-x',
|
|
47
|
+
},
|
|
48
|
+
...handlers,
|
|
49
|
+
})}
|
|
50
|
+
<div
|
|
51
|
+
ref={actionRef}
|
|
52
|
+
style={{
|
|
53
|
+
position: "absolute",
|
|
54
|
+
top: ".5px",
|
|
55
|
+
right: "0",
|
|
56
|
+
bottom: ".5px",
|
|
57
|
+
opacity: `${showRight ? '1': '0'}`,
|
|
58
|
+
transition: 'opacity .15s ease-in-out'
|
|
59
|
+
}}
|
|
60
|
+
>
|
|
61
|
+
{contentToShowRight}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { Swipe2Show }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Swipe2Show } from './Swipe2Show'
|
|
@@ -185,7 +185,15 @@
|
|
|
185
185
|
--drawer-overlay-bg: rgba(34, 39, 51, .5);
|
|
186
186
|
--drawer-shadow: 0 0 20px 44px rgba(36, 48, 54, 0.12);
|
|
187
187
|
|
|
188
|
+
/* =========================================== */
|
|
189
|
+
/* DRAWER */
|
|
188
190
|
|
|
191
|
+
/* DRAWER */
|
|
192
|
+
/* =========================================== */
|
|
193
|
+
--payments-list-item-hover: var(--cl-graphite-5);
|
|
194
|
+
--payments-list-item-focus: var(--cl-graphite-5);
|
|
195
|
+
--payments-list-item-active: var(--cl-graphite-7);
|
|
196
|
+
|
|
189
197
|
/* =========================================== */
|
|
190
198
|
/* DRAWER */
|
|
191
199
|
|
package/src/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ import { DigitKeyPad } from "./DigitKeyPad"
|
|
|
51
51
|
import { Badge, badgeVariants } from './Badge'
|
|
52
52
|
import { Toaster, toast } from './Toaster'
|
|
53
53
|
import { Checkbox } from './Checkbox'
|
|
54
|
+
import { Swipe2Show } from './Swipe2Show'
|
|
54
55
|
|
|
55
56
|
export {
|
|
56
57
|
Tabs,
|
|
@@ -127,5 +128,5 @@ export {
|
|
|
127
128
|
Toaster,
|
|
128
129
|
toast,
|
|
129
130
|
Checkbox,
|
|
130
|
-
|
|
131
|
+
Swipe2Show,
|
|
131
132
|
}
|