pixelize-design-library 2.2.17 → 2.2.19

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.
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
2
  import { ButtonProps } from "./ButtonProps";
3
- declare function Button({ label, children, onClick, opacity, variant, leftIcon, rightIcon, size, isDisabled, isLoading, loadingText, type, width, sx, colorScheme, ref, border, borderRadius, }: ButtonProps): React.JSX.Element;
3
+ declare function Button({ label, children, onClick, opacity, variant, leftIcon, rightIcon, size, isDisabled, isLoading, loadingText, type, width, sx, colorScheme, ref, border, borderRadius, onMouseEnter, onMouseLeave, }: ButtonProps): React.JSX.Element;
4
4
  declare const _default: React.MemoExoticComponent<typeof Button>;
5
5
  export default _default;
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  var react_1 = __importStar(require("react"));
27
27
  var react_2 = require("@chakra-ui/react");
28
28
  function Button(_a) {
29
- var label = _a.label, children = _a.children, onClick = _a.onClick, opacity = _a.opacity, _b = _a.variant, variant = _b === void 0 ? "solid" : _b, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, size = _a.size, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.loadingText, loadingText = _e === void 0 ? "Loading" : _e, type = _a.type, width = _a.width, sx = _a.sx, colorScheme = _a.colorScheme, ref = _a.ref, border = _a.border, borderRadius = _a.borderRadius;
30
- return (react_1.default.createElement(react_2.Button, { type: type, onClick: onClick, width: width || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius }, children !== null && children !== void 0 ? children : label));
29
+ var label = _a.label, children = _a.children, onClick = _a.onClick, opacity = _a.opacity, _b = _a.variant, variant = _b === void 0 ? "solid" : _b, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, size = _a.size, _c = _a.isDisabled, isDisabled = _c === void 0 ? false : _c, _d = _a.isLoading, isLoading = _d === void 0 ? false : _d, _e = _a.loadingText, loadingText = _e === void 0 ? "Loading" : _e, type = _a.type, width = _a.width, sx = _a.sx, colorScheme = _a.colorScheme, ref = _a.ref, border = _a.border, borderRadius = _a.borderRadius, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
30
+ return (react_1.default.createElement(react_2.Button, { type: type, onClick: onClick, width: width || "fit-content", variant: variant, size: size, isLoading: isLoading, isDisabled: isDisabled, loadingText: loadingText, leftIcon: leftIcon, rightIcon: rightIcon, ref: ref, colorScheme: colorScheme, sx: sx, opacity: opacity, border: border, borderRadius: borderRadius, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave }, children !== null && children !== void 0 ? children : label));
31
31
  }
32
32
  exports.default = (0, react_1.memo)(Button);
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ButtonProps as ChakraButtonProps } from "@chakra-ui/react";
3
- export type ButtonProps = Pick<ChakraButtonProps, "onClick" | "leftIcon" | "rightIcon" | "isDisabled" | "isLoading" | "loadingText" | "spinner" | "sx" | "border" | "borderRadius"> & {
3
+ export type ButtonProps = Pick<ChakraButtonProps, "onClick" | "leftIcon" | "rightIcon" | "isDisabled" | "isLoading" | "loadingText" | "spinner" | "sx" | "border" | "borderRadius" | "onMouseEnter" | "onMouseLeave"> & {
4
4
  label?: string;
5
5
  width?: string | number;
6
6
  size?: "lg" | "md" | "sm" | "xs" | "xl";
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { PaymentCardProps } from "./PaymentCardProps";
3
- declare const PaymentCard: ({ plan, isActive, isNextUpgrade, billingCycle, onSelect, onHover, }: PaymentCardProps) => React.JSX.Element;
3
+ declare const PaymentCard: ({ plan, isActive, isNextUpgrade, billingCycle, onSelect, onHover, buttonLoading, }: PaymentCardProps) => React.JSX.Element;
4
4
  export default PaymentCard;
@@ -18,6 +18,7 @@ var react_1 = __importDefault(require("react"));
18
18
  var react_2 = require("@chakra-ui/react");
19
19
  var lucide_react_1 = require("lucide-react");
20
20
  var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
21
+ var Button_1 = __importDefault(require("../../Button/Button"));
21
22
  var getCardStyles = function (isActive, isNextUpgrade, popular, theme) {
22
23
  if (isActive) {
23
24
  return {
@@ -51,7 +52,7 @@ var getCardStyles = function (isActive, isNextUpgrade, popular, theme) {
51
52
  };
52
53
  };
53
54
  var PaymentCard = function (_a) {
54
- var plan = _a.plan, _b = _a.isActive, isActive = _b === void 0 ? false : _b, _c = _a.isNextUpgrade, isNextUpgrade = _c === void 0 ? false : _c, billingCycle = _a.billingCycle, onSelect = _a.onSelect, onHover = _a.onHover;
55
+ var plan = _a.plan, _b = _a.isActive, isActive = _b === void 0 ? false : _b, _c = _a.isNextUpgrade, isNextUpgrade = _c === void 0 ? false : _c, billingCycle = _a.billingCycle, onSelect = _a.onSelect, onHover = _a.onHover, buttonLoading = _a.buttonLoading;
55
56
  var theme = (0, useCustomTheme_1.useCustomTheme)();
56
57
  var _d = getCardStyles(isActive, isNextUpgrade, !!plan.popular, theme), badgeText = _d.badgeText, badgeColor = _d.badgeColor, buttonColor = _d.buttonColor, buttonColor50 = _d.buttonColor50;
57
58
  var variantStyles = plan.buttonVariant === "outline"
@@ -78,8 +79,8 @@ var PaymentCard = function (_a) {
78
79
  react_1.default.createElement(react_2.Text, { fontSize: "0.9rem", fontWeight: "normal", color: theme.colors.gray[600] }, plan.billing),
79
80
  react_1.default.createElement(react_2.Text, { fontSize: "0.7rem", fontWeight: "normal", color: theme.colors.gray[600] }, plan.tax))),
80
81
  react_1.default.createElement(react_2.Text, { color: theme.colors.gray[600], mt: 3 }, plan.description)),
81
- !isActive && (react_1.default.createElement(react_2.Button, __assign({ w: "full", variant: plan.buttonVariant, mb: 6, onClick: function () { return onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id); }, onMouseEnter: function () { return onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true); }, onMouseLeave: function () { return onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false); } }, variantStyles), plan.buttonText)),
82
- react_1.default.createElement(react_2.VStack, { align: "start", spacing: 3 }, plan.features.map(function (feature, i) { return (react_1.default.createElement(react_2.Flex, { key: i, align: "center" },
82
+ !isActive && (react_1.default.createElement(Button_1.default, __assign({ isLoading: plan.plan_id === buttonLoading, loadingText: plan.buttonLoadingText, width: "full", variant: plan.buttonVariant, size: "lg", onClick: function () { return onSelect === null || onSelect === void 0 ? void 0 : onSelect(plan.plan_id); }, onMouseEnter: function () { return onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", true); }, onMouseLeave: function () { return onHover === null || onHover === void 0 ? void 0 : onHover(plan.plan_id, "button", false); } }, variantStyles), plan.buttonText)),
83
+ react_1.default.createElement(react_2.VStack, { align: "start", spacing: 3, mt: 6 }, plan.features.map(function (feature, i) { return (react_1.default.createElement(react_2.Flex, { key: i, align: "center" },
83
84
  react_1.default.createElement(react_2.Icon, { as: lucide_react_1.Check, color: theme.colors.green[500], mr: 2 }),
84
85
  react_1.default.createElement(react_2.Text, { fontSize: "sm" }, feature))); })))));
85
86
  };
@@ -6,6 +6,7 @@ export type PaymentCardProps = {
6
6
  billingCycle: "monthly" | "yearly";
7
7
  onSelect?: (planId: number) => void;
8
8
  onHover?: (planId: number, type: "card" | "button", state: boolean) => void;
9
+ buttonLoading?: number;
9
10
  };
10
11
  export type Plan = {
11
12
  plan_id: number;
@@ -20,4 +21,5 @@ export type Plan = {
20
21
  buttonText: string;
21
22
  buttonVariant: "solid" | "outline" | "link";
22
23
  popular?: boolean;
24
+ buttonLoadingText?: string;
23
25
  };
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- // import React, { useRef, useLayoutEffect } from "react";
3
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
3
  if (k2 === undefined) k2 = k;
5
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -24,52 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
23
  return result;
25
24
  };
26
25
  Object.defineProperty(exports, "__esModule", { value: true });
27
- // type MeasuredItemProps = {
28
- // index: number;
29
- // setSize: (index: number, size: number) => void;
30
- // children: React.ReactNode;
31
- // };
32
- // const MeasuredItem: React.FC<MeasuredItemProps> = ({
33
- // index,
34
- // setSize,
35
- // children,
36
- // }) => {
37
- // const ref = useRef<HTMLDivElement | null>(null);
38
- // const prevHeight = useRef<number | null>(null);
39
- // // measure function
40
- // const measure = () => {
41
- // if (ref.current) {
42
- // const height = Math.round(ref.current.getBoundingClientRect().height);
43
- // if (prevHeight.current !== height) {
44
- // prevHeight.current = height;
45
- // setSize(index, height);
46
- // }
47
- // }
48
- // };
49
- // useLayoutEffect(() => {
50
- // // initial measure
51
- // measure();
52
- // // ResizeObserver to capture any content changes (collapse/expand)
53
- // let ro: ResizeObserver | undefined;
54
- // if (typeof ResizeObserver !== "undefined") {
55
- // ro = new ResizeObserver(() => {
56
- // measure();
57
- // });
58
- // if (ref.current) ro.observe(ref.current);
59
- // } else {
60
- // // fallback: window resize
61
- // window.addEventListener("resize", measure);
62
- // }
63
- // return () => {
64
- // if (ro && ref.current) ro.unobserve(ref.current);
65
- // if (!ro) window.removeEventListener("resize", measure);
66
- // };
67
- // // We intentionally do not add children to deps to avoid extra runs; ResizeObserver catches updates.
68
- // // eslint-disable-next-line react-hooks/exhaustive-deps
69
- // }, [index, setSize]);
70
- // return <div ref={ref}>{children}</div>;
71
- // };
72
- // export default MeasuredItem;
73
26
  var react_1 = __importStar(require("react"));
74
27
  var MeasuredItem = function (_a) {
75
28
  var index = _a.index, setSize = _a.setSize, children = _a.children;
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- // import React, { useEffect, useRef, useState } from "react";
3
- // import { Box, Flex, IconButton, Image } from "@chakra-ui/react";
4
- // import { ChevronLeft, ChevronRight } from "lucide-react";
5
- // import { useCustomTheme } from "../../Theme/useCustomTheme";
6
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
3
  if (k2 === undefined) k2 = k;
8
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -36,123 +32,6 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
36
32
  return to.concat(ar || Array.prototype.slice.call(from));
37
33
  };
38
34
  Object.defineProperty(exports, "__esModule", { value: true });
39
- // type ImageSliderProps = {
40
- // images: SliderImage[];
41
- // interval?: number;
42
- // isArrow?: boolean;
43
- // };
44
- // type SliderImage = {
45
- // id: string | number;
46
- // label?: string;
47
- // previewUrl: string;
48
- // order: number;
49
- // };
50
- // const Slider: React.FC<ImageSliderProps> = ({
51
- // images,
52
- // interval = 5000,
53
- // isArrow = false,
54
- // }) => {
55
- // const { colors } = useCustomTheme();
56
- // const [currentIndex, setCurrentIndex] = useState(0);
57
- // const timeoutRef = useRef<NodeJS.Timeout | null>(null);
58
- // const nextSlide = () => setCurrentIndex((prev) => (prev + 1) % images.length);
59
- // const prevSlide = () =>
60
- // setCurrentIndex((prev) => (prev - 1 + images.length) % images.length);
61
- // useEffect(() => {
62
- // if (interval > 0) {
63
- // timeoutRef.current = setTimeout(nextSlide, interval);
64
- // }
65
- // return () => {
66
- // if (timeoutRef.current) clearTimeout(timeoutRef.current);
67
- // };
68
- // }, [currentIndex, interval]);
69
- // return (
70
- // <Box
71
- // position="relative"
72
- // w="100%"
73
- // h="30rem"
74
- // overflow="hidden"
75
- // >
76
- // <Flex
77
- // w={`${images.length * 100}vw`}
78
- // transform={`translateX(-${currentIndex * 100}vw)`}
79
- // transition="transform 0.5s ease"
80
- // >
81
- // {[...images]
82
- // .sort((a, b) => a.order - b.order)
83
- // .map((image, idx) => (
84
- // <Box
85
- // key={image.id}
86
- // w="100vw"
87
- // h="30rem"
88
- // flexShrink={0}
89
- // display="flex"
90
- // justifyContent="center"
91
- // alignItems="center"
92
- // >
93
- // <Image
94
- // src={image.previewUrl}
95
- // alt={`Slide ${idx + 1}`}
96
- // objectFit="cover"
97
- // w="100vw"
98
- // h="100%"
99
- // />
100
- // </Box>
101
- // ))}
102
- // </Flex>
103
- // {isArrow && (
104
- // <>
105
- // <IconButton
106
- // icon={<ChevronLeft color={colors?.gray?.[800]} />}
107
- // aria-label="Previous Slide"
108
- // onClick={prevSlide}
109
- // position="absolute"
110
- // top="50%"
111
- // left="1rem"
112
- // transform="translateY(-50%)"
113
- // zIndex={2}
114
- // variant="ghost"
115
- // _hover={{ bg: colors?.gray?.[200] }}
116
- // />
117
- // <IconButton
118
- // icon={<ChevronRight color={colors?.gray?.[800]} />}
119
- // aria-label="Next Slide"
120
- // onClick={nextSlide}
121
- // position="absolute"
122
- // top="50%"
123
- // right="1rem"
124
- // transform="translateY(-50%)"
125
- // zIndex={2}
126
- // variant="ghost"
127
- // _hover={{ bg: colors?.gray?.[200] }}
128
- // />
129
- // </>
130
- // )}
131
- // <Flex
132
- // position="absolute"
133
- // bottom="1rem"
134
- // left="50%"
135
- // transform="translateX(-50%)"
136
- // gap="0.5rem"
137
- // zIndex={2}
138
- // >
139
- // {images.map((_, idx) => (
140
- // <Box
141
- // key={idx}
142
- // w="0.8rem"
143
- // h="0.8rem"
144
- // bg={idx === currentIndex ? "white" : "whiteAlpha.600"}
145
- // borderRadius="full"
146
- // cursor="pointer"
147
- // onClick={() => setCurrentIndex(idx)}
148
- // transition="all 0.3s"
149
- // />
150
- // ))}
151
- // </Flex>
152
- // </Box>
153
- // );
154
- // };
155
- // export default Slider;
156
35
  var react_1 = __importStar(require("react"));
157
36
  var react_2 = require("@chakra-ui/react");
158
37
  var lucide_react_1 = require("lucide-react");
@@ -90,8 +90,6 @@ var Timeline = function (_a) {
90
90
  react_1.default.createElement(react_2.Box, { fontSize: "1rem", fontWeight: "400", color: theme.colors.black, bg: theme.colors.gray[50], border: "0.063rem solid ".concat(theme.colors.gray[300]), borderRadius: "0.313rem", px: { base: 3, md: 6 }, py: 1, textAlign: "center", zIndex: 1 }, date)),
91
91
  groupedEvents[date].map(function (event, index) {
92
92
  var isLeft = index % 2 === 0 && !isMobile;
93
- // const title = event.title; /* "Updated" | "Created" | Delete*/
94
- console.log(event, "event");
95
93
  return (react_1.default.createElement(react_2.Flex, { key: index, justify: isLeft ? "flex-end" : "flex-start", flexDir: { base: "column", md: "row" }, align: "center", mb: 6, position: "relative", textAlign: { base: "left", md: isLeft ? "left" : "right" } },
96
94
  react_1.default.createElement(react_2.Box, { position: "absolute", left: { base: "1.25rem", md: "50%" }, transform: { base: "none", md: "translateX(-50%)" }, w: "1.875rem", h: "1.875rem", bg: theme.colors.gray[50], borderRadius: "full", border: "0.063rem solid ".concat(theme.colors.gray[300]), display: "flex", alignItems: "center", justifyContent: "center", zIndex: 1 }, getIcon(event)),
97
95
  react_1.default.createElement(react_2.Text, { position: { base: "relative", md: "absolute" }, left: { md: isLeft ? "38%" : "53%" }, ml: { base: "3.125rem", md: 0 }, color: theme.colors.gray[500] }, formatTimestamp(event.created_at, "time")),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.2.17",
3
+ "version": "2.2.19",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import { useCustomTheme } from "../Theme/useCustomTheme";
3
-
4
- const DefaultLogo = () => {
5
- const theme = useCustomTheme();
6
- return (
7
- <svg
8
- width="12.09"
9
- height="15.95"
10
- viewBox="0 0 31 29"
11
- fill="none"
12
- xmlns="http://www.w3.org/2000/svg"
13
- >
14
- <path
15
- d="M30.4999 6.26137V7.81058H15.9761H14.8787V22.8508V28.8862H12.5226C9.6824 28.8862 7.32632 26.4656 7.06812 23.3995C7.06812 23.2381 7.06812 23.0444 7.06812 22.8508V18.3323C7.06812 18.2677 7.06812 18.2032 7.06812 18.1063V15.5889V6.2291C7.06812 2.80793 9.84378 -5.72205e-06 13.2972 -5.72205e-06H24.8517C28.0147 0.355021 30.4676 3.00158 30.4676 6.2291L30.4999 6.26137Z"
16
- fill={theme.colors.black}
17
- />
18
- <path
19
- d="M7.10053 23.3672H7.03598C5.16402 23.2381 3.48571 22.4635 2.25926 21.3338C0.871428 20.0428 0 18.2677 0 16.3312V15.6211H7.06825V18.1386C7.06825 18.2032 7.06825 18.2677 7.06825 18.3645V22.883C7.06825 23.0767 7.06825 23.2381 7.06825 23.4317L7.10053 23.3672Z"
20
- fill={theme.colors.black}
21
- />
22
- <path
23
- d="M30.4678 12.0063V15.6211V17.1703C30.4678 20.6238 26.272 23.3994 21.0757 23.3994H14.8789V22.8508V15.6211H22.6572V7.81056C22.6895 7.81056 30.5001 7.81056 30.5001 7.81056V11.5868C30.5001 11.7159 30.5001 11.8772 30.5001 12.0063H30.4678Z"
24
- fill={theme.colors.black}
25
- />
26
- </svg>
27
-
28
- )
29
- };
30
-
31
- export default DefaultLogo;