@tapcart/mobile-components 0.7.72 → 0.7.74
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/components/ui/chip.d.ts +0 -2
- package/dist/components/ui/chip.d.ts.map +1 -1
- package/dist/components/ui/chip.js +2 -5
- package/dist/components/ui/quantity-picker.d.ts +0 -1
- package/dist/components/ui/quantity-picker.d.ts.map +1 -1
- package/dist/components/ui/quantity-picker.js +8 -9
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/lib/cart.util.d.ts.map +1 -1
- package/dist/lib/cart.util.js +2 -2
- package/dist/styles.css +0 -24
- package/package.json +5 -1
- package/dist/components/ui/loading-dots.d.ts +0 -9
- package/dist/components/ui/loading-dots.d.ts.map +0 -1
- package/dist/components/ui/loading-dots.js +0 -22
|
@@ -12,7 +12,6 @@ type ChipProps = React.ComponentPropsWithoutRef<"div"> & VariantProps<typeof chi
|
|
|
12
12
|
iconUrl?: string;
|
|
13
13
|
onChipClick?: () => void;
|
|
14
14
|
onIconClick?: () => void;
|
|
15
|
-
loading?: boolean;
|
|
16
15
|
};
|
|
17
16
|
declare const Chip: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & VariantProps<(props?: ({
|
|
18
17
|
variant?: "secondary" | "primary" | null | undefined;
|
|
@@ -25,7 +24,6 @@ declare const Chip: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps
|
|
|
25
24
|
iconUrl?: string | undefined;
|
|
26
25
|
onChipClick?: (() => void) | undefined;
|
|
27
26
|
onIconClick?: (() => void) | undefined;
|
|
28
|
-
loading?: boolean | undefined;
|
|
29
27
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
30
28
|
type MultipleChipsProps = {
|
|
31
29
|
children: React.ReactElement<ChipProps>[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAsC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../components/ui/chip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAsC,MAAM,OAAO,CAAA;AAG1D,QAAA,MAAM,YAAY;;;;mFAwBjB,CAAA;AAED,KAAK,SAAS,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,GACpD,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG;IAClC,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,IAAI,CAAA;CACzB,CAAA;AAEH,QAAA,MAAM,IAAI;;;;;;;;;yBAJc,IAAI;yBACJ,IAAI;wCAgE3B,CAAA;AAGD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAA;IACzC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAA;CAC9C,CAAA;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAoD/C,CAAA;AAED,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,CAAA"}
|
|
@@ -15,7 +15,6 @@ import { cva } from "class-variance-authority";
|
|
|
15
15
|
import { cn } from "../../lib/utils";
|
|
16
16
|
import React, { useState, useEffect } from "react";
|
|
17
17
|
import { Icon } from "./icon";
|
|
18
|
-
import { LoadingDots } from "./loading-dots";
|
|
19
18
|
const chipVariants = cva("inline-flex items-center justify-center rounded border border-coreColors-dividingLines text-[12px] transition-colors h-8 active:opacity-70", {
|
|
20
19
|
variants: {
|
|
21
20
|
variant: {
|
|
@@ -39,7 +38,7 @@ const chipVariants = cva("inline-flex items-center justify-center rounded border
|
|
|
39
38
|
},
|
|
40
39
|
});
|
|
41
40
|
const Chip = React.forwardRef((_a, ref) => {
|
|
42
|
-
var { className, variant, direction, children, iconPosition, iconColor = "coreColors-secondaryIcon", iconUrl,
|
|
41
|
+
var { className, variant, direction, children, iconPosition, iconColor = "coreColors-secondaryIcon", iconUrl, onChipClick, onIconClick } = _a, props = __rest(_a, ["className", "variant", "direction", "children", "iconPosition", "iconColor", "iconUrl", "onChipClick", "onIconClick"]);
|
|
43
42
|
const handleOnClick = () => {
|
|
44
43
|
onChipClick === null || onChipClick === void 0 ? void 0 : onChipClick();
|
|
45
44
|
};
|
|
@@ -47,9 +46,7 @@ const Chip = React.forwardRef((_a, ref) => {
|
|
|
47
46
|
onIconClick === null || onIconClick === void 0 ? void 0 : onIconClick();
|
|
48
47
|
};
|
|
49
48
|
const ChipIcon = ({ className }) => iconUrl ? (_jsx(Icon, { url: iconUrl, size: "xs", color: iconColor, className: className })) : (_jsx(Icon, { name: "square-x-filled", color: iconColor, className: className }));
|
|
50
|
-
return (_jsxs("div", Object.assign({ onClick:
|
|
51
|
-
relative: loading,
|
|
52
|
-
}) }, props, { children: [iconPosition === "left" && (_jsx("button", Object.assign({ onClick: loading ? undefined : handleIconClick, className: "h-full flex items-center justify-center pl-2" }, { children: _jsx(ChipIcon, { className: "mr-2 h-4 w-4 cursor-pointer" }) }))), children, iconPosition === "right" && (_jsx("button", Object.assign({ onClick: loading ? undefined : handleIconClick, className: "h-full flex items-center justify-center pr-2" }, { children: _jsx(ChipIcon, { className: "ml-2 h-4 w-4 cursor-pointer" }) }))), _jsx(LoadingDots, { show: loading, size: 1, iconColor: iconColor })] })));
|
|
49
|
+
return (_jsxs("div", Object.assign({ onClick: handleOnClick, ref: ref, className: cn(chipVariants({ variant, direction, iconPosition }), className) }, props, { children: [iconPosition === "left" && (_jsx("button", Object.assign({ onClick: handleIconClick, className: "h-full flex items-center justify-center pl-2" }, { children: _jsx(ChipIcon, { className: "mr-2 h-4 w-4 cursor-pointer" }) }))), children, iconPosition === "right" && (_jsx("button", Object.assign({ onClick: handleIconClick, className: "h-full flex items-center justify-center pr-2" }, { children: _jsx(ChipIcon, { className: "ml-2 h-4 w-4 cursor-pointer" }) })))] })));
|
|
53
50
|
});
|
|
54
51
|
Chip.displayName = "Chip";
|
|
55
52
|
const MultipleChips = ({ children, containerRef, style, }) => {
|
|
@@ -9,7 +9,6 @@ export interface QuantityPickerProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
9
9
|
onIncreaseClick: React.ReactEventHandler;
|
|
10
10
|
isDecreaseDisabled?: boolean;
|
|
11
11
|
isIncreaseDisabled?: boolean;
|
|
12
|
-
loading?: boolean;
|
|
13
12
|
value: number;
|
|
14
13
|
setValue: (_: number) => void;
|
|
15
14
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"quantity-picker.d.ts","sourceRoot":"","sources":["../../../components/ui/quantity-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC5C,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,OAAO,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACxC,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAChC,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACjC,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAmCD,QAAA,MAAM,cAAc,4FAoGnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -15,7 +15,6 @@ import * as React from "react";
|
|
|
15
15
|
import { cn } from "../../lib/utils";
|
|
16
16
|
import { Icon } from "./icon";
|
|
17
17
|
import { useTap } from "./tap";
|
|
18
|
-
import { LoadingDots } from "./loading-dots";
|
|
19
18
|
const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled }) => {
|
|
20
19
|
const { onTap, isPressed, ref: tapRef } = useTap();
|
|
21
20
|
return (_jsx("button", Object.assign({ onClick: onTap(handler), ref: tapRef, className: cn("flex items-center justify-center h-7 w-7 bg-stateColors-skeleton border border-coreColors-dividingLines", className), style: style, disabled: disabled }, { children: _jsx(Icon, { url: iconUrl, size: "sm", strokeColor: iconColor, strokeWidth: 4, style: {
|
|
@@ -23,7 +22,7 @@ const IconButton = ({ iconUrl, iconColor, handler, className, style, disabled })
|
|
|
23
22
|
} }) })));
|
|
24
23
|
};
|
|
25
24
|
const QuantityPicker = React.forwardRef((_a, ref) => {
|
|
26
|
-
var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, setValue, inputStyle, buttonStyle, buttonCornerRadius = 4, max = 99
|
|
25
|
+
var { className, decreaseIconUrl, increaseIconUrl, deleteIconUrl, isDeleteOnly = false, iconColor, onDecreaseClick, onIncreaseClick, isDecreaseDisabled, isIncreaseDisabled, value, setValue, inputStyle, buttonStyle, buttonCornerRadius = 4, max = 99 } = _a, props = __rest(_a, ["className", "decreaseIconUrl", "increaseIconUrl", "deleteIconUrl", "isDeleteOnly", "iconColor", "onDecreaseClick", "onIncreaseClick", "isDecreaseDisabled", "isIncreaseDisabled", "value", "setValue", "inputStyle", "buttonStyle", "buttonCornerRadius", "max"]);
|
|
27
26
|
const [isFocused, setIsFocused] = React.useState(false);
|
|
28
27
|
const [localValue, setLocalValue] = React.useState(value);
|
|
29
28
|
const leftButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderTopLeftRadius: buttonCornerRadius
|
|
@@ -37,13 +36,13 @@ const QuantityPicker = React.forwardRef((_a, ref) => {
|
|
|
37
36
|
? `${buttonCornerRadius}px`
|
|
38
37
|
: undefined });
|
|
39
38
|
const singleButtonStyle = Object.assign(Object.assign({}, buttonStyle), { borderRadius: buttonCornerRadius ? `${buttonCornerRadius}px` : undefined });
|
|
40
|
-
return (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
return (_jsx("div", Object.assign({ className: cn("flex", className), ref: ref }, props, { children: isDeleteOnly ? (_jsx(IconButton, { handler: onDecreaseClick, iconUrl: deleteIconUrl, iconColor: iconColor, style: singleButtonStyle })) : (_jsxs(_Fragment, { children: [_jsx(IconButton, { handler: onDecreaseClick, iconUrl: value === 1 ? deleteIconUrl : decreaseIconUrl, iconColor: iconColor, style: leftButtonStyle, disabled: isDecreaseDisabled }), _jsx("input", { type: "number", pattern: "[0-9]*", max: max, value: isFocused ? localValue : value, onBlur: (e) => {
|
|
40
|
+
setIsFocused(false);
|
|
41
|
+
setValue(Math.min(parseInt(e.target.value) || 0, max));
|
|
42
|
+
}, onFocus: (e) => {
|
|
43
|
+
setIsFocused(true);
|
|
44
|
+
setLocalValue(value);
|
|
45
|
+
}, onChange: (e) => setLocalValue(Math.min(parseInt(e.target.value), max)), className: "w-8 h-7 focus-visible:outline-none text-center bg-coreColors-inputBackground text-textColors-primaryColor border-t border-b border-coreColors-dividingLines", style: inputStyle, inputMode: "numeric" }), _jsx(IconButton, { handler: onIncreaseClick, iconUrl: increaseIconUrl, iconColor: iconColor, style: rightButtonStyle, disabled: isIncreaseDisabled })] })) })));
|
|
47
46
|
});
|
|
48
47
|
QuantityPicker.displayName = "QuantityPicker";
|
|
49
48
|
export { QuantityPicker };
|
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,6 @@ export * from "./components/ui/image";
|
|
|
34
34
|
export * from "./components/ui/Input/input";
|
|
35
35
|
export * from "./components/ui/label";
|
|
36
36
|
export * from "./components/ui/line-item-text-icons";
|
|
37
|
-
export * from "./components/ui/loading-dots";
|
|
38
37
|
export * from "./components/ui/money";
|
|
39
38
|
export * from "./components/ui/price";
|
|
40
39
|
export * from "./components/ui/product-card";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,EAAE,EACF,GAAG,EACH,QAAQ,EACR,4BAA4B,EAC5B,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,w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,uBAAuB,CAAA;AACrC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA;AACzC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,uBAAuB,CAAA;AACrC,cAAc,yBAAyB,CAAA;AACvC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0BAA0B,CAAA;AACxC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kDAAkD,CAAA;AAChE,cAAc,gCAAgC,CAAA;AAC9C,cAAc,oCAAoC,CAAA;AAClD,cAAc,mCAAmC,CAAA;AACjD,cAAc,aAAa,CAAA;AAC3B,cAAc,6CAA6C,CAAA;AAC3D,cAAc,kDAAkD,CAAA;AAChE,cAAc,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ export * from "./components/ui/image";
|
|
|
35
35
|
export * from "./components/ui/Input/input";
|
|
36
36
|
export * from "./components/ui/label";
|
|
37
37
|
export * from "./components/ui/line-item-text-icons";
|
|
38
|
-
export * from "./components/ui/loading-dots";
|
|
39
38
|
export * from "./components/ui/money";
|
|
40
39
|
export * from "./components/ui/price";
|
|
41
40
|
export * from "./components/ui/product-card";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cart.util.d.ts","sourceRoot":"","sources":["../../lib/cart.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AA2CzB,eAAO,MAAM,oBAAoB,SAAU,MAAM,QAAQ,YAAY,
|
|
1
|
+
{"version":3,"file":"cart.util.d.ts","sourceRoot":"","sources":["../../lib/cart.util.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,6BAA6B,EAC9B,MAAM,kBAAkB,CAAA;AA2CzB,eAAO,MAAM,oBAAoB,SAAU,MAAM,QAAQ,YAAY,YAGpE,CAAA;AAED,eAAO,MAAM,kBAAkB,SAAU,MAAM,QAAQ,YAAY,YAGlE,CAAA;AAqGD,MAAM,MAAM,cAAc,GAAG;IAC3B,yBAAyB,EAAE,sBAAsB,EAAE,CAAA;IACnD,gBAAgB,EAAE,6BAA6B,EAAE,CAAA;IACjD,cAAc,EAAE,OAAO,CAAA;IACvB,oBAAoB,EAAE,MAAM,CAAA;IAC5B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,oBAAoB,EAAE,MAAM,CAAA;CAC7B,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,cASrC,CAAA;AAED,eAAO,MAAM,qBAAqB,SAAU,YAAY,KAAG,cA4B1D,CAAA"}
|
package/dist/lib/cart.util.js
CHANGED
|
@@ -34,11 +34,11 @@ const getShippingDiscounts = (cart) => {
|
|
|
34
34
|
};
|
|
35
35
|
export const isOrderLevelDiscount = (code, cart) => {
|
|
36
36
|
const orderLevelDiscounts = getOrderLevelDiscounts(cart);
|
|
37
|
-
return orderLevelDiscounts.some((discount) =>
|
|
37
|
+
return orderLevelDiscounts.some((discount) => discount.id === code);
|
|
38
38
|
};
|
|
39
39
|
export const isLineItemDiscount = (code, cart) => {
|
|
40
40
|
const lineItemDiscounts = getLineItemDiscounts(cart);
|
|
41
|
-
return lineItemDiscounts.some((discount) =>
|
|
41
|
+
return lineItemDiscounts.some((discount) => discount.id === code);
|
|
42
42
|
};
|
|
43
43
|
const getAppliedGiftCards = (cart) => {
|
|
44
44
|
var _a;
|
package/dist/styles.css
CHANGED
|
@@ -1209,21 +1209,6 @@ video {
|
|
|
1209
1209
|
.transform {
|
|
1210
1210
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1211
1211
|
}
|
|
1212
|
-
@keyframes bounce {
|
|
1213
|
-
|
|
1214
|
-
0%, 100% {
|
|
1215
|
-
transform: translateY(-25%);
|
|
1216
|
-
animation-timing-function: cubic-bezier(0.8,0,1,1);
|
|
1217
|
-
}
|
|
1218
|
-
|
|
1219
|
-
50% {
|
|
1220
|
-
transform: none;
|
|
1221
|
-
animation-timing-function: cubic-bezier(0,0,0.2,1);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
.animate-bounce {
|
|
1225
|
-
animation: bounce 1s infinite;
|
|
1226
|
-
}
|
|
1227
1212
|
@keyframes pulse {
|
|
1228
1213
|
|
|
1229
1214
|
50% {
|
|
@@ -1647,9 +1632,6 @@ video {
|
|
|
1647
1632
|
--tw-bg-opacity: 1;
|
|
1648
1633
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
1649
1634
|
}
|
|
1650
|
-
.bg-opacity-70 {
|
|
1651
|
-
--tw-bg-opacity: 0.7;
|
|
1652
|
-
}
|
|
1653
1635
|
.bg-fade-left {
|
|
1654
1636
|
background-image: linear-gradient(to right, var(--coreColors-pageColor) 0%, #ffffff00 100%);;
|
|
1655
1637
|
}
|
|
@@ -2222,12 +2204,6 @@ video {
|
|
|
2222
2204
|
.\[-ms-overflow-style\:none\] {
|
|
2223
2205
|
-ms-overflow-style: none;
|
|
2224
2206
|
}
|
|
2225
|
-
.\[animation-delay\:-0\.15s\] {
|
|
2226
|
-
animation-delay: -0.15s;
|
|
2227
|
-
}
|
|
2228
|
-
.\[animation-delay\:-0\.3s\] {
|
|
2229
|
-
animation-delay: -0.3s;
|
|
2230
|
-
}
|
|
2231
2207
|
.\[scrollbar-width\:none\] {
|
|
2232
2208
|
scrollbar-width: none;
|
|
2233
2209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapcart/mobile-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.74",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"style": "dist/styles.css",
|
|
@@ -90,5 +90,9 @@
|
|
|
90
90
|
"tailwind-merge": "^1.13.2",
|
|
91
91
|
"tailwindcss-animate": "^1.0.6",
|
|
92
92
|
"vaul": "0.9.1"
|
|
93
|
+
},
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public",
|
|
96
|
+
"registry": "https://registry.npmjs.org/"
|
|
93
97
|
}
|
|
94
98
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export interface LoadingDotsProps {
|
|
2
|
-
iconColor: string;
|
|
3
|
-
size?: number;
|
|
4
|
-
spacing?: 0 | 1 | 2 | 4;
|
|
5
|
-
opacity?: number;
|
|
6
|
-
show?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const LoadingDots: ({ iconColor, size, spacing, opacity, show, }: LoadingDotsProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
-
//# sourceMappingURL=loading-dots.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"loading-dots.d.ts","sourceRoot":"","sources":["../../../components/ui/loading-dots.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,WAAW,iDAMrB,gBAAgB,mDAyClB,CAAA"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
3
|
-
export const LoadingDots = ({ iconColor, size = 4, spacing = 1, opacity = 0.8, show = false, }) => {
|
|
4
|
-
const [showLoadingDots, setShowLoadingDots] = React.useState(show);
|
|
5
|
-
const [isAnimatingOut, setIsAnimatingOut] = React.useState(false);
|
|
6
|
-
React.useEffect(() => {
|
|
7
|
-
if (!show) {
|
|
8
|
-
setIsAnimatingOut(true);
|
|
9
|
-
setTimeout(() => {
|
|
10
|
-
setShowLoadingDots(false);
|
|
11
|
-
setIsAnimatingOut(false);
|
|
12
|
-
}, 300); // Match animation duration
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
setShowLoadingDots(true);
|
|
16
|
-
setIsAnimatingOut(false);
|
|
17
|
-
}
|
|
18
|
-
}, [show]);
|
|
19
|
-
if (!showLoadingDots)
|
|
20
|
-
return null;
|
|
21
|
-
return (_jsx("div", Object.assign({ className: `absolute inset-0 flex items-center justify-center bg-white bg-opacity-70 ${isAnimatingOut ? "animate-fadeOut" : "animate-fadeIn"}` }, { children: _jsxs("div", Object.assign({ className: `flex space-x-${spacing}` }, { children: [_jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.3s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce [animation-delay:-0.15s]` }), _jsx("div", { style: { backgroundColor: iconColor, opacity: opacity }, className: `h-${size} w-${size} bg-black rounded-full animate-bounce` })] })) })));
|
|
22
|
-
};
|