@klu_dev/ui-klu-green 1.2.22 → 1.2.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/index.css CHANGED
@@ -306,6 +306,10 @@ button,
306
306
  .uiklu-z-\[100\]{
307
307
  z-index: 100;
308
308
 
309
+ }
310
+ .uiklu-z-\[1\]{
311
+ z-index: 1;
312
+
309
313
  }
310
314
  .uiklu-z-\[200\]{
311
315
  z-index: 200;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
  import * as SelectPrimitive from '@radix-ui/react-select';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
  import * as ToastPrimitives from '@radix-ui/react-toast';
8
+ import * as SwitchPrimitives from '@radix-ui/react-switch';
8
9
 
9
10
  type InputSize = "sm" | "md" | "lg" | "full";
10
11
  interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size"> {
@@ -348,6 +349,21 @@ interface PhoneFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
348
349
  }
349
350
  declare const PhoneField: React.ForwardRefExoticComponent<PhoneFieldProps & React.RefAttributes<HTMLInputElement>>;
350
351
 
352
+ interface CardData {
353
+ title: string;
354
+ balance: string;
355
+ cardNumber: string;
356
+ clabe: string;
357
+ accountNumber: string;
358
+ last4: string;
359
+ }
360
+ interface CorporateCardProps {
361
+ isBlocked?: boolean;
362
+ onToggleBlock: (checked: boolean) => void;
363
+ cardData?: CardData;
364
+ }
365
+ declare function CorporateCard({ isBlocked, onToggleBlock, cardData }: CorporateCardProps): react_jsx_runtime.JSX.Element;
366
+
351
367
  interface StatusCardSummaryItem {
352
368
  label: string;
353
369
  value: string;
@@ -369,4 +385,12 @@ interface StatusCardProps {
369
385
  }
370
386
  declare const StatusCard: React__default.FC<StatusCardProps>;
371
387
 
372
- export { BackButton, BalanceInfo, Button, Checkbox, type CheckboxProps, DetailCard, type DetailCardItem, type DetailCardProps, GridCard, IconBadge, type IconBadgeProps, Icons, Input, InputCode, type LadaOption, LoadingScreen, MobileMenuDrawer, Modal, PhoneField, type PhoneFieldProps, PromoBanner, SearchSelect, SearchSelectField, type SearchSelectFieldProps, Select, SelectContent, SelectField, type SelectFieldProps, SelectGroup, SelectItem, SelectValue, SidebarTabs, StatusCard, type StatusCardProps, type StatusCardSummaryItem, TextField, type TextFieldProps, ToastAction, Toaster, Typography, useToast };
388
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
389
+
390
+ interface PlasticCardProps {
391
+ isBlocked?: boolean;
392
+ last4?: string;
393
+ }
394
+ declare const PlasticCard: ({ isBlocked, last4, }: PlasticCardProps) => react_jsx_runtime.JSX.Element;
395
+
396
+ export { BackButton, BalanceInfo, Button, Checkbox, type CheckboxProps, CorporateCard, DetailCard, type DetailCardItem, type DetailCardProps, GridCard, IconBadge, type IconBadgeProps, Icons, Input, InputCode, type LadaOption, LoadingScreen, MobileMenuDrawer, Modal, PhoneField, type PhoneFieldProps, PlasticCard, PromoBanner, SearchSelect, SearchSelectField, type SearchSelectFieldProps, Select, SelectContent, SelectField, type SelectFieldProps, SelectGroup, SelectItem, SelectValue, SidebarTabs, StatusCard, type StatusCardProps, type StatusCardSummaryItem, Switch, TextField, type TextFieldProps, ToastAction, Toaster, Typography, useToast };
package/dist/index.js CHANGED
@@ -3552,10 +3552,289 @@ var Switch = React19.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
3552
3552
  Switch.displayName = SwitchPrimitives.Root.displayName;
3553
3553
 
3554
3554
  // src/components/ui/card/card.tsx
3555
+ import { useId as useId2 } from "react";
3555
3556
  import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
3557
+ var PlasticCard = ({
3558
+ isBlocked = false,
3559
+ last4 = "0000"
3560
+ }) => {
3561
+ const gradientId = useId2();
3562
+ return /* @__PURE__ */ jsxs25(
3563
+ "div",
3564
+ {
3565
+ className: "\n uiklu-relative \n uiklu-w-full \n uiklu-h-full \n uiklu-min-w-[186px] \n uiklu-min-h-[114px]\n uiklu-rounded-xl \n uiklu-overflow-hidden \n uiklu-shrink-0\n uiklu-shadow-[0_2.467px_2.467px_0_rgba(0,0,0,0.25)]\n uiklu-transition-opacity \n uiklu-duration-300\n ",
3566
+ children: [
3567
+ /* @__PURE__ */ jsx30("div", { className: "uiklu-absolute uiklu-inset-0 uiklu-z-0", children: /* @__PURE__ */ jsxs25(
3568
+ "svg",
3569
+ {
3570
+ className: "uiklu-w-full uiklu-h-full",
3571
+ viewBox: "0 0 185 111",
3572
+ preserveAspectRatio: "none",
3573
+ fill: "none",
3574
+ xmlns: "http://www.w3.org/2000/svg",
3575
+ children: [
3576
+ /* @__PURE__ */ jsx30(
3577
+ "path",
3578
+ {
3579
+ d: "M185 0H0V111H185V0Z",
3580
+ fill: `url(#${gradientId})`
3581
+ }
3582
+ ),
3583
+ /* @__PURE__ */ jsx30("defs", { children: /* @__PURE__ */ jsxs25(
3584
+ "linearGradient",
3585
+ {
3586
+ id: gradientId,
3587
+ x1: "-0.00289658",
3588
+ y1: "113.999",
3589
+ x2: "101.58",
3590
+ y2: "-51.7413",
3591
+ gradientUnits: "userSpaceOnUse",
3592
+ children: [
3593
+ /* @__PURE__ */ jsx30("stop", { stopColor: "#0A2D27" }),
3594
+ /* @__PURE__ */ jsx30("stop", { offset: "1", stopColor: "#096761" })
3595
+ ]
3596
+ }
3597
+ ) })
3598
+ ]
3599
+ }
3600
+ ) }),
3601
+ /* @__PURE__ */ jsx30(
3602
+ "div",
3603
+ {
3604
+ className: `
3605
+ uiklu-absolute
3606
+ uiklu-inset-0
3607
+ uiklu-z-[1]
3608
+ uiklu-bg-basewhite/40
3609
+ uiklu-transition-opacity
3610
+ uiklu-duration-300
3611
+ ${isBlocked ? "uiklu-opacity-100" : "uiklu-opacity-0"}
3612
+ `
3613
+ }
3614
+ ),
3615
+ /* @__PURE__ */ jsxs25(
3616
+ "div",
3617
+ {
3618
+ className: "\n uiklu-absolute \n uiklu-inset-0 \n uiklu-z-10\n uiklu-h-full \n uiklu-w-full\n uiklu-p-3\n uiklu-flex \n uiklu-flex-col \n uiklu-justify-between\n uiklu-box-border\n ",
3619
+ children: [
3620
+ /* @__PURE__ */ jsxs25(
3621
+ "div",
3622
+ {
3623
+ className: "\n uiklu-flex \n uiklu-justify-between \n uiklu-items-start \n uiklu-w-full\n ",
3624
+ children: [
3625
+ /* @__PURE__ */ jsxs25("div", { className: "uiklu-flex uiklu-flex-col", children: [
3626
+ /* @__PURE__ */ jsx30(
3627
+ "div",
3628
+ {
3629
+ className: "\n uiklu-flex \n uiklu-items-center\n uiklu-w-[29px]\n uiklu-h-[14px]\n uiklu-text-basewhite\n uiklu-mb-[16px]\n ",
3630
+ children: Icons.KLUWHITE
3631
+ }
3632
+ ),
3633
+ /* @__PURE__ */ jsxs25(
3634
+ "span",
3635
+ {
3636
+ className: "\n uiklu-text-basewhite\n uiklu-text-[13px]\n uiklu-font-sans\n uiklu-font-semibold\n uiklu-tracking-wider\n uiklu-leading-normal\n ",
3637
+ children: [
3638
+ "**** ",
3639
+ last4
3640
+ ]
3641
+ }
3642
+ )
3643
+ ] }),
3644
+ /* @__PURE__ */ jsx30("div", { className: "uiklu-text-basewhite uiklu-pt-0.5", children: isBlocked ? Icons.LOCK : Icons.LOCKOPEN })
3645
+ ]
3646
+ }
3647
+ ),
3648
+ /* @__PURE__ */ jsx30(
3649
+ "div",
3650
+ {
3651
+ className: `
3652
+ uiklu-flex
3653
+ uiklu-justify-end
3654
+ uiklu-w-full
3655
+ uiklu-mt-auto
3656
+ ${isBlocked ? "uiklu-opacity-70" : "uiklu-opacity-100"}
3657
+ `,
3658
+ children: /* @__PURE__ */ jsx30("div", { className: "uiklu-flex uiklu-items-center uiklu-shrink-0", children: Icons.MASTERCARD })
3659
+ }
3660
+ )
3661
+ ]
3662
+ }
3663
+ )
3664
+ ]
3665
+ }
3666
+ );
3667
+ };
3556
3668
 
3557
3669
  // src/components/ui/corporateCard/corporateCard.tsx
3558
3670
  import { jsx as jsx31, jsxs as jsxs26 } from "react/jsx-runtime";
3671
+ function CorporateCard({
3672
+ isBlocked = false,
3673
+ onToggleBlock,
3674
+ cardData = {
3675
+ title: "Mi Tarjeta",
3676
+ balance: "000,000.00",
3677
+ cardNumber: "0000 0000 0000 0000",
3678
+ clabe: "000 000 000 000 000 000",
3679
+ accountNumber: "0000 0000",
3680
+ last4: "0000"
3681
+ }
3682
+ }) {
3683
+ const [showBalance, setShowBalance] = useState12(true);
3684
+ const [copiedField, setCopiedField] = useState12(null);
3685
+ const [showTooltip, setShowTooltip] = useState12(false);
3686
+ const handleCopy = (text, field) => {
3687
+ navigator.clipboard.writeText(text).then(() => {
3688
+ setCopiedField(field);
3689
+ setShowTooltip(true);
3690
+ setTimeout(() => {
3691
+ setCopiedField(null);
3692
+ setShowTooltip(false);
3693
+ }, 1500);
3694
+ }).catch((err) => {
3695
+ console.error("Error al copiar al portapapeles: ", err);
3696
+ });
3697
+ };
3698
+ const CopyButton = ({
3699
+ text,
3700
+ field,
3701
+ className = ""
3702
+ }) => /* @__PURE__ */ jsxs26(
3703
+ "button",
3704
+ {
3705
+ onClick: () => handleCopy(text, field),
3706
+ className: `uiklu-relative uiklu-text-outlinesecondary
3707
+ uiklu-hover:text-primary
3708
+ uiklu-transition-colors
3709
+ uiklu-flex
3710
+ uiklu-justify-center
3711
+ uiklu-items-center
3712
+ uiklu-bg-transparent
3713
+ uiklu-shrink-0 ${className}`,
3714
+ children: [
3715
+ Icons.COPY,
3716
+ showTooltip && copiedField === field && /* @__PURE__ */ jsx31(
3717
+ "div",
3718
+ {
3719
+ className: "uiklu-absolute\n uiklu-bottom-full\n uiklu-left-1/2\n uiklu--translate-x-1/2\n uiklu-mb-2\n uiklu-z-[9999]\n uiklu-pointer-events-none",
3720
+ children: /* @__PURE__ */ jsxs26(
3721
+ "div",
3722
+ {
3723
+ className: "uiklu-relative\n uiklu-bg-gray900\n uiklu-text-white\n uiklu-text-[11px]\n uiklu-px-2\n uiklu-py-1\n uiklu-rounded-md\n uiklu-whitespace-nowrap\n uiklu-shadow-xl",
3724
+ children: [
3725
+ "Copiado",
3726
+ /* @__PURE__ */ jsx31(
3727
+ "div",
3728
+ {
3729
+ className: "uiklu-absolute\n uiklu-top-full\n uiklu-left-1/2\n uiklu--translate-x-1/2\n uiklu-border-4\n uiklu-border-transparent\n uiklu-border-t-gray900"
3730
+ }
3731
+ )
3732
+ ]
3733
+ }
3734
+ )
3735
+ }
3736
+ )
3737
+ ]
3738
+ }
3739
+ );
3740
+ return /* @__PURE__ */ jsxs26("div", { className: "uiklu-font-sans uiklu-max-w-[569px] lg:uiklu-max-w-full uiklu-bg-basewhite\n uiklu-border uiklu-border-gray200 uiklu-rounded-2xl uiklu-p-[16px] uiklu-shadow-sm uiklu-w-full", children: [
3741
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-hidden lg:uiklu-flex lg:uiklu-justify-between lg:uiklu-items-center uiklu-mb-4", children: [
3742
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center ", children: [
3743
+ /* @__PURE__ */ jsx31("div", { className: "uiklu-w-[24px] uiklu-h-[24px] uiklu-flex \n uiklu-items-center uiklu-justify-center uiklu-text-primary700 uiklu-mr-[10px]", children: Icons.CARDCIRCLE }),
3744
+ /* @__PURE__ */ jsx31("span", { className: "uiklu-font-medium uiklu-text-primary900 uiklu-text-[16px]", children: cardData.title })
3745
+ ] }),
3746
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center uiklu-justify-between", children: [
3747
+ /* @__PURE__ */ jsx31("span", { className: "uiklu-font-sans uiklu-text-[24px] uiklu-font-bold uiklu-text-gray900 ", children: showBalance ? `$${cardData.balance}` : "$ ******" }),
3748
+ /* @__PURE__ */ jsx31(
3749
+ "button",
3750
+ {
3751
+ onClick: () => setShowBalance(!showBalance),
3752
+ className: "uiklu-text-primary500 uiklu-hover:opacity-80 uiklu-transition-opacity\n uiklu-bg-transparent uiklu-ml-[10px] uiklu-p-0",
3753
+ children: showBalance ? Icons.EYE_OPEN : Icons.EYE_MASKED
3754
+ }
3755
+ )
3756
+ ] })
3757
+ ] }),
3758
+ /* @__PURE__ */ jsx31("hr", { className: "uiklu-hidden lg:uiklu-block uiklu-border-[1px] uiklu-border-gray300 uiklu-mb-5" }),
3759
+ /* @__PURE__ */ jsxs26("div", { className: "lg:uiklu-hidden uiklu-flex uiklu-flex-col", children: [
3760
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center", children: [
3761
+ /* @__PURE__ */ jsx31("div", { className: "uiklu-w-[24px] uiklu-h-[24px] uiklu-flex \n uiklu-items-center uiklu-justify-center uiklu-text-primary700 uiklu-mr-[10px]", children: Icons.CARDCIRCLE }),
3762
+ /* @__PURE__ */ jsx31("span", { className: " uiklu-font-medium uiklu-text-primary900 uiklu-text-[16px]", children: cardData.title })
3763
+ ] }),
3764
+ /* @__PURE__ */ jsx31("div", { className: "uiklu-w-full uiklu-h-[1px] uiklu-bg-gray300 uiklu-mt-[20px] uiklu-mb-[20px]" }),
3765
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center uiklu-justify-center uiklu-mb-[20px]", children: [
3766
+ /* @__PURE__ */ jsx31("span", { className: "uiklu-font-sans uiklu-text-[24px] uiklu-font-bold uiklu-text-gray900 ", children: showBalance ? `$${cardData.balance}` : "$ ******" }),
3767
+ /* @__PURE__ */ jsx31(
3768
+ "button",
3769
+ {
3770
+ onClick: () => setShowBalance(!showBalance),
3771
+ className: "uiklu-text-primary500 uiklu-hover:opacity-80 uiklu-transition-opacity\n uiklu-bg-transparent uiklu-ml-[10px] uiklu-p-0",
3772
+ children: showBalance ? Icons.EYE_OPEN : Icons.EYE_MASKED
3773
+ }
3774
+ )
3775
+ ] })
3776
+ ] }),
3777
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-flex-col lg:uiklu-flex-row uiklu-items-center \n lg:uiklu-items-stretch uiklu-justify-between lg:uiklu-h-[114px] uiklu-w-full", children: [
3778
+ /* @__PURE__ */ jsx31("div", { className: "uiklu-w-[186px] uiklu-shrink-0 lg:uiklu-mr-[20px] uiklu-flex \n uiklu-justify-center uiklu-mb-[20px] lg:uiklu-mb-0", children: /* @__PURE__ */ jsx31(
3779
+ PlasticCard,
3780
+ {
3781
+ isBlocked,
3782
+ last4: cardData.last4
3783
+ }
3784
+ ) }),
3785
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-flex-col uiklu-flex-grow uiklu-justify-between uiklu-w-full \n uiklu-items-center lg:uiklu-items-stretch", children: [
3786
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center uiklu-justify-center lg:uiklu-justify-start \n uiklu-mb-[20px] lg:uiklu-mb-0 lg:uiklu-mt-[10px] uiklu-relative", children: [
3787
+ /* @__PURE__ */ jsx31("span", { className: "uiklu-font-sans uiklu-text-[20px] uiklu-font-bold uiklu-text-gray900 \n uiklu-tracking-wide uiklu-text-center lg:uiklu-text-left", children: cardData.cardNumber }),
3788
+ /* @__PURE__ */ jsx31(
3789
+ CopyButton,
3790
+ {
3791
+ text: cardData.cardNumber,
3792
+ field: "card"
3793
+ }
3794
+ )
3795
+ ] }),
3796
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-w-full lg:uiklu-min-w-[331px] uiklu-box-border uiklu-bg-primarylight\n uiklu-border uiklu-border-primary50 uiklu-rounded-[10px] uiklu-p-[10px] uiklu-flex \n uiklu-flex-col ", children: [
3797
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center \n uiklu-flex-wrap lg:uiklu-flex-nowrap lg:uiklu-justify-start", children: [
3798
+ /* @__PURE__ */ jsxs26("span", { className: "uiklu-text-[14px] uiklu-text-gray700 uiklu-font-light \n uiklu-break-all sm:uiklu-break-normal", children: [
3799
+ "Cuenta Clabe: ",
3800
+ /* @__PURE__ */ jsx31("strong", { className: "uiklu-text-gray800 uiklu-font-sans\n uiklu-font-medium uiklu-text-[14px]", children: cardData.clabe })
3801
+ ] }),
3802
+ /* @__PURE__ */ jsx31(
3803
+ CopyButton,
3804
+ {
3805
+ text: cardData.clabe,
3806
+ field: "clabe"
3807
+ }
3808
+ )
3809
+ ] }),
3810
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-items-center uiklu-flex-wrap lg:uiklu-flex-nowrap \n lg:uiklu-justify-start", children: [
3811
+ /* @__PURE__ */ jsxs26("span", { className: "uiklu-text-[14px] uiklu-text-gray700 uiklu-font-light", children: [
3812
+ "No. de cuenta: ",
3813
+ /* @__PURE__ */ jsx31("strong", { className: "uiklu-text-gray800 uiklu-font-sans\n uiklu-font-medium uiklu-text-[14px]", children: cardData.accountNumber })
3814
+ ] }),
3815
+ /* @__PURE__ */ jsx31(
3816
+ CopyButton,
3817
+ {
3818
+ text: cardData.accountNumber,
3819
+ field: "account"
3820
+ }
3821
+ )
3822
+ ] })
3823
+ ] })
3824
+ ] })
3825
+ ] }),
3826
+ /* @__PURE__ */ jsxs26("div", { className: "uiklu-flex uiklu-justify-center lg:uiklu-justify-end uiklu-items-center \n uiklu-gap-3 uiklu-mt-[20px] lg:uiklu-mt-4", children: [
3827
+ /* @__PURE__ */ jsx31(
3828
+ Switch,
3829
+ {
3830
+ checked: isBlocked,
3831
+ onCheckedChange: onToggleBlock
3832
+ }
3833
+ ),
3834
+ /* @__PURE__ */ jsx31("span", { className: "uiklu-text-[14px] uiklu-font-medium uiklu-text-gray900", children: "Bloquear tarjeta" })
3835
+ ] })
3836
+ ] });
3837
+ }
3559
3838
 
3560
3839
  // src/components/ui/statusCard/statusCard.tsx
3561
3840
  import { jsx as jsx32, jsxs as jsxs27 } from "react/jsx-runtime";
@@ -3647,6 +3926,7 @@ export {
3647
3926
  BalanceInfo,
3648
3927
  Button,
3649
3928
  Checkbox,
3929
+ CorporateCard,
3650
3930
  DetailCard,
3651
3931
  GridCard,
3652
3932
  IconBadge,
@@ -3657,6 +3937,7 @@ export {
3657
3937
  MobileMenuDrawer,
3658
3938
  Modal,
3659
3939
  PhoneField,
3940
+ PlasticCard,
3660
3941
  PromoBanner,
3661
3942
  SearchSelect,
3662
3943
  SearchSelectField,
@@ -3668,6 +3949,7 @@ export {
3668
3949
  SelectValue,
3669
3950
  SidebarTabs,
3670
3951
  StatusCard,
3952
+ Switch,
3671
3953
  TextField,
3672
3954
  ToastAction,
3673
3955
  Toaster,