@chekinapp/ui 0.0.8 → 0.0.11

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.d.cts CHANGED
@@ -163,8 +163,8 @@ type BreadcrumbsProps = {
163
163
  declare function Breadcrumbs({ className, children }: BreadcrumbsProps): react_jsx_runtime.JSX.Element;
164
164
 
165
165
  declare const buttonVariants: (props?: ({
166
- variant?: "link" | "default" | "secondary" | "destructive" | "primary" | "ghost" | "tertiary" | null | undefined;
167
- size?: "s" | "default" | "sm" | "lg" | "icon" | "m" | "xs" | null | undefined;
166
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "primary" | "ghost" | "tertiary" | null | undefined;
167
+ size?: "s" | "default" | "sm" | "md" | "lg" | "icon" | "m" | "xs" | null | undefined;
168
168
  shape?: "rounded" | "pill" | null | undefined;
169
169
  readOnly?: boolean | null | undefined;
170
170
  } & class_variance_authority_types.ClassProp) | undefined) => string;
package/dist/index.d.ts CHANGED
@@ -163,8 +163,8 @@ type BreadcrumbsProps = {
163
163
  declare function Breadcrumbs({ className, children }: BreadcrumbsProps): react_jsx_runtime.JSX.Element;
164
164
 
165
165
  declare const buttonVariants: (props?: ({
166
- variant?: "link" | "default" | "secondary" | "destructive" | "primary" | "ghost" | "tertiary" | null | undefined;
167
- size?: "s" | "default" | "sm" | "lg" | "icon" | "m" | "xs" | null | undefined;
166
+ variant?: "link" | "default" | "secondary" | "destructive" | "outline" | "primary" | "ghost" | "tertiary" | null | undefined;
167
+ size?: "s" | "default" | "sm" | "md" | "lg" | "icon" | "m" | "xs" | null | undefined;
168
168
  shape?: "rounded" | "pill" | null | undefined;
169
169
  readOnly?: boolean | null | undefined;
170
170
  } & class_variance_authority_types.ClassProp) | undefined) => string;
package/dist/index.js CHANGED
@@ -627,10 +627,12 @@ import { useTranslation as useTranslation3 } from "react-i18next";
627
627
  import { cva as cva3 } from "class-variance-authority";
628
628
  var buttonVariants = cva3(
629
629
  [
630
- "relative inline-flex items-center justify-center gap-2 whitespace-nowrap font-sans font-semibold",
631
- "transition-colors duration-150 ease-out outline-none",
632
- "focus-visible:shadow-chekin-focus disabled:pointer-events-none disabled:opacity-50",
633
- "[&_svg]:pointer-events-none [&_svg]:shrink-0",
630
+ "button relative inline-flex items-center justify-center gap-2 whitespace-nowrap",
631
+ "[font-family:var(--button-font-family)] [font-weight:var(--button-font-weight)]",
632
+ "transition-all duration-150 ease-out outline-none",
633
+ "focus-visible:shadow-[var(--button-focus-shadow)]",
634
+ "disabled:pointer-events-none disabled:opacity-50",
635
+ "[&_svg]:pointer-events-none [&_svg]:size-[var(--button-icon-size)] [&_svg]:shrink-0",
634
636
  'before:absolute before:inset-0 before:rounded-[inherit] before:content-[""]',
635
637
  "before:bg-transparent before:transition-colors before:duration-150",
636
638
  "[&>*]:relative [&>*]:z-[1]"
@@ -639,51 +641,73 @@ var buttonVariants = cva3(
639
641
  variants: {
640
642
  variant: {
641
643
  default: [
642
- "bg-chekin-blue text-white",
643
- "hover:before:bg-white/10 active:before:bg-black/10",
644
- "focus-visible:ring-1 focus-visible:ring-chekin-navy focus-visible:ring-inset"
644
+ "button_default",
645
+ "bg-[var(--button-primary-bg)] text-[color:var(--button-primary-text)]",
646
+ "hover:before:bg-[var(--button-primary-hover-overlay)] active:before:bg-[var(--button-primary-active-overlay)]",
647
+ "disabled:hover:before:bg-transparent"
645
648
  ],
646
649
  primary: [
647
- "bg-chekin-blue text-white",
648
- "hover:before:bg-white/10 active:before:bg-black/10",
649
- "focus-visible:ring-1 focus-visible:ring-chekin-navy focus-visible:ring-inset"
650
+ "button_default",
651
+ "bg-[var(--button-primary-bg)] text-[color:var(--button-primary-text)]",
652
+ "hover:before:bg-[var(--button-primary-hover-overlay)] active:before:bg-[var(--button-primary-active-overlay)]",
653
+ "disabled:hover:before:bg-transparent"
650
654
  ],
651
655
  destructive: [
652
- "border border-chekin-red bg-white text-chekin-red shadow-chekin-subtle-outline",
653
- "hover:bg-chekin-surface-input-empty"
656
+ "button_destructive",
657
+ "border border-[var(--button-destructive-border)] bg-[var(--button-destructive-bg)] text-[color:var(--button-destructive-text)]",
658
+ "shadow-[var(--button-shadow)]",
659
+ "hover:bg-[var(--button-destructive-hover-bg)]",
660
+ "disabled:hover:bg-[var(--button-destructive-bg)]"
654
661
  ],
655
662
  secondary: [
656
- "bg-white/30 text-chekin-navy shadow-chekin-subtle-outline",
657
- "hover:before:bg-black/5 active:before:bg-black/10"
663
+ "button_secondary",
664
+ "border border-[var(--button-secondary-border)] bg-[var(--button-secondary-bg)] text-[color:var(--button-secondary-text)]",
665
+ "shadow-[var(--button-shadow)]",
666
+ "hover:before:bg-[var(--button-secondary-hover-overlay)] active:before:bg-[var(--button-secondary-active-overlay)]",
667
+ "disabled:hover:before:bg-transparent"
658
668
  ],
659
669
  ghost: [
660
- "bg-transparent text-chekin-navy",
661
- "hover:bg-chekin-surface-input-empty active:bg-chekin-gray-3"
670
+ "button_ghost",
671
+ "bg-[var(--button-ghost-bg)] text-[color:var(--button-ghost-text)]",
672
+ "hover:bg-[var(--button-ghost-hover-bg)] active:bg-[var(--button-ghost-active-bg)]",
673
+ "disabled:hover:bg-[var(--button-ghost-bg)]"
662
674
  ],
663
675
  link: [
664
- "h-auto rounded-none bg-transparent px-0 py-0 text-chekin-blue underline-offset-4",
665
- "hover:underline active:opacity-80 before:hidden"
676
+ "button_link",
677
+ "h-auto rounded-none bg-[var(--button-link-bg)] px-0 py-0 text-[color:var(--button-link-text)]",
678
+ "underline-offset-4",
679
+ "hover:underline active:opacity-80 before:hidden",
680
+ "disabled:hover:no-underline"
666
681
  ],
667
682
  tertiary: [
668
- "border border-white bg-transparent text-white shadow-chekin-subtle-outline",
669
- "hover:before:bg-white/10 active:before:bg-black/10"
683
+ "button_tertiary",
684
+ "border border-[var(--button-tertiary-border)] bg-[var(--button-tertiary-bg)] text-[color:var(--button-tertiary-text)]",
685
+ "shadow-[var(--button-shadow)]",
686
+ "hover:before:bg-[var(--button-tertiary-hover-overlay)] active:before:bg-[var(--button-tertiary-active-overlay)]",
687
+ "disabled:hover:before:bg-transparent"
688
+ ],
689
+ outline: [
690
+ "border border-[var(--button-outline-border)] bg-[var(--button-outline-bg)] text-[color:var(--button-outline-text)]",
691
+ "hover:bg-[var(--button-outline-hover-bg)]",
692
+ "disabled:hover:bg-[var(--button-outline-bg)]"
670
693
  ]
671
694
  },
672
695
  size: {
673
- default: "h-10 px-4 py-2 text-[14px]",
674
- m: "h-12 min-w-[160px] rounded-xl px-4 text-[14px]",
675
- s: "h-8 px-[12px] text-[13px]",
676
- sm: "h-9 rounded-md px-3 text-[14px]",
677
- lg: "h-11 rounded-md px-8 text-[15px]",
678
- xs: "h-6 px-[10px] text-[12px]",
679
- icon: "h-8 w-8 p-0"
696
+ default: "button_size_default h-[var(--button-height-default)] min-w-[var(--button-min-width-default)] px-4 py-2 text-[length:var(--button-font-size)]",
697
+ m: "button_size_m h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
698
+ md: "button_size_m h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
699
+ s: "button_size_sm h-[var(--button-height-s)] px-[12px] text-[13px]",
700
+ sm: "button_size_sm h-[var(--button-height-sm)] px-3 text-[length:var(--button-font-size)]",
701
+ lg: "button_size_lg h-[var(--button-height-lg)] px-8 text-[15px]",
702
+ xs: "button_size_xs h-[var(--button-height-xs)] px-[10px] text-[12px]",
703
+ icon: "button_size_icon h-[var(--button-height-icon)] w-[var(--button-height-icon)] p-0"
680
704
  },
681
705
  shape: {
682
- rounded: "rounded-chekin-input",
706
+ rounded: "rounded-[var(--button-radius)]",
683
707
  pill: "rounded-full"
684
708
  },
685
709
  readOnly: {
686
- true: "pointer-events-none cursor-not-allowed !opacity-100",
710
+ true: "button_readonly pointer-events-none cursor-not-allowed !opacity-100",
687
711
  false: ""
688
712
  }
689
713
  },
@@ -733,15 +757,28 @@ var Button = React4.forwardRef(
733
757
  ...props
734
758
  }, ref) => {
735
759
  const { t } = useTranslation3();
736
- const Comp = asChild ? Slot2 : "button";
737
760
  const showLoadingLabel = size !== "icon";
761
+ const isDisabled = readOnly || disabled || loading;
762
+ const classNames = cn(buttonVariants({ variant, size, shape, readOnly }), className);
763
+ if (asChild) {
764
+ return /* @__PURE__ */ jsx10(
765
+ Slot2,
766
+ {
767
+ ref,
768
+ "aria-disabled": isDisabled || void 0,
769
+ className: classNames,
770
+ ...props,
771
+ children
772
+ }
773
+ );
774
+ }
738
775
  return /* @__PURE__ */ jsx10(
739
- Comp,
776
+ "button",
740
777
  {
741
778
  ref,
742
- type: Comp === "button" ? type ?? "button" : void 0,
743
- disabled: readOnly || disabled || loading,
744
- className: cn(buttonVariants({ variant, size, shape, readOnly }), className),
779
+ type: type ?? "button",
780
+ disabled: isDisabled,
781
+ className: classNames,
745
782
  ...props,
746
783
  children: loading ? /* @__PURE__ */ jsxs9("span", { className: "inline-flex items-center gap-1.5", children: [
747
784
  /* @__PURE__ */ jsx10(Spinner, {}),
@@ -6104,7 +6141,10 @@ function Skeleton({ className, ...props }) {
6104
6141
  "div",
6105
6142
  {
6106
6143
  "data-slot": "skeleton",
6107
- className: cn("animate-pulse rounded-md bg-chekin-gray-3", className),
6144
+ className: cn(
6145
+ "animate-pulse rounded-md bg-[var(--chekin-color-gray-3)]",
6146
+ className
6147
+ ),
6108
6148
  ...props
6109
6149
  }
6110
6150
  );
@@ -9135,7 +9175,7 @@ function ResponsiveSheet({
9135
9175
  closeOnOverlayClick = true,
9136
9176
  closeOnEscape = true
9137
9177
  }) {
9138
- const { isMatch: isMobile } = useScreenResize(DEVICE.laptop);
9178
+ const { isMatch: isMobile } = useScreenResize(DEVICE.tablet);
9139
9179
  const isMobileMode = isMobile && isMobileModalModeAvailable();
9140
9180
  const handleOpenChange = (nextOpen) => {
9141
9181
  if (!nextOpen) {