@chekinapp/ui 0.0.10 → 0.0.13
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.cjs +38 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +38 -35
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -924,7 +924,7 @@ var import_react_i18next3 = require("react-i18next");
|
|
|
924
924
|
var import_class_variance_authority3 = require("class-variance-authority");
|
|
925
925
|
var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
926
926
|
[
|
|
927
|
-
"relative inline-flex items-center justify-center gap-2 whitespace-nowrap",
|
|
927
|
+
"button relative inline-flex items-center justify-center gap-2 whitespace-nowrap",
|
|
928
928
|
"[font-family:var(--button-font-family)] [font-weight:var(--button-font-weight)]",
|
|
929
929
|
"transition-all duration-150 ease-out outline-none",
|
|
930
930
|
"focus-visible:shadow-[var(--button-focus-shadow)]",
|
|
@@ -938,39 +938,45 @@ var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
|
938
938
|
variants: {
|
|
939
939
|
variant: {
|
|
940
940
|
default: [
|
|
941
|
+
"button_default",
|
|
941
942
|
"bg-[var(--button-primary-bg)] text-[color:var(--button-primary-text)]",
|
|
942
943
|
"hover:before:bg-[var(--button-primary-hover-overlay)] active:before:bg-[var(--button-primary-active-overlay)]",
|
|
943
944
|
"disabled:hover:before:bg-transparent"
|
|
944
945
|
],
|
|
945
946
|
primary: [
|
|
947
|
+
"button_default",
|
|
946
948
|
"bg-[var(--button-primary-bg)] text-[color:var(--button-primary-text)]",
|
|
947
949
|
"hover:before:bg-[var(--button-primary-hover-overlay)] active:before:bg-[var(--button-primary-active-overlay)]",
|
|
948
950
|
"disabled:hover:before:bg-transparent"
|
|
949
951
|
],
|
|
950
952
|
destructive: [
|
|
953
|
+
"button_destructive",
|
|
951
954
|
"border border-[var(--button-destructive-border)] bg-[var(--button-destructive-bg)] text-[color:var(--button-destructive-text)]",
|
|
952
955
|
"shadow-[var(--button-shadow)]",
|
|
953
956
|
"hover:bg-[var(--button-destructive-hover-bg)]",
|
|
954
957
|
"disabled:hover:bg-[var(--button-destructive-bg)]"
|
|
955
958
|
],
|
|
956
959
|
secondary: [
|
|
960
|
+
"button_secondary",
|
|
957
961
|
"border border-[var(--button-secondary-border)] bg-[var(--button-secondary-bg)] text-[color:var(--button-secondary-text)]",
|
|
958
962
|
"shadow-[var(--button-shadow)]",
|
|
959
963
|
"hover:before:bg-[var(--button-secondary-hover-overlay)] active:before:bg-[var(--button-secondary-active-overlay)]",
|
|
960
964
|
"disabled:hover:before:bg-transparent"
|
|
961
965
|
],
|
|
962
966
|
ghost: [
|
|
967
|
+
"button_ghost",
|
|
963
968
|
"bg-[var(--button-ghost-bg)] text-[color:var(--button-ghost-text)]",
|
|
964
969
|
"hover:bg-[var(--button-ghost-hover-bg)] active:bg-[var(--button-ghost-active-bg)]",
|
|
965
970
|
"disabled:hover:bg-[var(--button-ghost-bg)]"
|
|
966
971
|
],
|
|
967
972
|
link: [
|
|
968
|
-
"
|
|
969
|
-
"
|
|
970
|
-
"hover:
|
|
971
|
-
"disabled:hover:no-
|
|
973
|
+
"button_link",
|
|
974
|
+
"h-auto [font-weight:var(--button-link-font-weight)] rounded-none bg-[var(--button-link-bg)] px-0 py-0 text-[color:var(--button-link-text)]",
|
|
975
|
+
"hover:opacity-80 active:opacity-80 before:hidden",
|
|
976
|
+
"disabled:hover:no-opacity-80"
|
|
972
977
|
],
|
|
973
978
|
tertiary: [
|
|
979
|
+
"button_tertiary",
|
|
974
980
|
"border border-[var(--button-tertiary-border)] bg-[var(--button-tertiary-bg)] text-[color:var(--button-tertiary-text)]",
|
|
975
981
|
"shadow-[var(--button-shadow)]",
|
|
976
982
|
"hover:before:bg-[var(--button-tertiary-hover-overlay)] active:before:bg-[var(--button-tertiary-active-overlay)]",
|
|
@@ -983,21 +989,21 @@ var buttonVariants = (0, import_class_variance_authority3.cva)(
|
|
|
983
989
|
]
|
|
984
990
|
},
|
|
985
991
|
size: {
|
|
986
|
-
default: "h-[var(--button-height-default)] min-w-[var(--button-min-width-default)] px-4 py-2 text-[length:var(--button-font-size)]",
|
|
987
|
-
m: "h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
|
|
988
|
-
md: "h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
|
|
989
|
-
s: "h-[var(--button-height-s)] px-[12px] text-[13px]",
|
|
990
|
-
sm: "h-[var(--button-height-sm)] px-3 text-[length:var(--button-font-size)]",
|
|
991
|
-
lg: "h-[var(--button-height-lg)] px-8 text-[15px]",
|
|
992
|
-
xs: "h-[var(--button-height-xs)] px-[10px] text-[12px]",
|
|
993
|
-
icon: "h-[var(--button-height-icon)] w-[var(--button-height-icon)] p-0"
|
|
992
|
+
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)]",
|
|
993
|
+
m: "button_size_m h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
|
|
994
|
+
md: "button_size_m h-[var(--button-height-m)] min-w-[var(--button-min-width-m)] px-4 text-[length:var(--button-font-size)]",
|
|
995
|
+
s: "button_size_sm h-[var(--button-height-s)] px-[12px] text-[13px]",
|
|
996
|
+
sm: "button_size_sm h-[var(--button-height-sm)] px-3 text-[length:var(--button-font-size)]",
|
|
997
|
+
lg: "button_size_lg h-[var(--button-height-lg)] px-8 text-[15px]",
|
|
998
|
+
xs: "button_size_xs h-[var(--button-height-xs)] px-[10px] text-[12px]",
|
|
999
|
+
icon: "button_size_icon h-[var(--button-height-icon)] w-[var(--button-height-icon)] p-0"
|
|
994
1000
|
},
|
|
995
1001
|
shape: {
|
|
996
1002
|
rounded: "rounded-[var(--button-radius)]",
|
|
997
1003
|
pill: "rounded-full"
|
|
998
1004
|
},
|
|
999
1005
|
readOnly: {
|
|
1000
|
-
true: "pointer-events-none cursor-not-allowed !opacity-100",
|
|
1006
|
+
true: "button_readonly pointer-events-none cursor-not-allowed !opacity-100",
|
|
1001
1007
|
false: ""
|
|
1002
1008
|
}
|
|
1003
1009
|
},
|
|
@@ -1037,8 +1043,6 @@ var Button = React4.forwardRef(
|
|
|
1037
1043
|
shape,
|
|
1038
1044
|
asChild = false,
|
|
1039
1045
|
readOnly = false,
|
|
1040
|
-
leftIcon,
|
|
1041
|
-
rightIcon,
|
|
1042
1046
|
loading = false,
|
|
1043
1047
|
loadingText,
|
|
1044
1048
|
disabled,
|
|
@@ -1073,11 +1077,7 @@ var Button = React4.forwardRef(
|
|
|
1073
1077
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
1074
1078
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Spinner, {}),
|
|
1075
1079
|
showLoadingLabel ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: loadingText || t("please_wait") }) : null
|
|
1076
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
1077
|
-
leftIcon,
|
|
1078
|
-
children,
|
|
1079
|
-
rightIcon
|
|
1080
|
-
] })
|
|
1080
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "inline-flex items-center gap-2", children })
|
|
1081
1081
|
}
|
|
1082
1082
|
);
|
|
1083
1083
|
}
|
|
@@ -6400,7 +6400,10 @@ function Skeleton({ className, ...props }) {
|
|
|
6400
6400
|
"div",
|
|
6401
6401
|
{
|
|
6402
6402
|
"data-slot": "skeleton",
|
|
6403
|
-
className: cn(
|
|
6403
|
+
className: cn(
|
|
6404
|
+
"animate-pulse rounded-md bg-[var(--chekin-color-gray-3)]",
|
|
6405
|
+
className
|
|
6406
|
+
),
|
|
6404
6407
|
...props
|
|
6405
6408
|
}
|
|
6406
6409
|
);
|
|
@@ -9505,11 +9508,7 @@ function ResponsiveSheet({
|
|
|
9505
9508
|
onPointerDownOutside: handleInteractOutside,
|
|
9506
9509
|
onInteractOutside: handleInteractOutside,
|
|
9507
9510
|
onEscapeKeyDown: handleEscapeKeyDown,
|
|
9508
|
-
className: cn(
|
|
9509
|
-
"max-w-[560px] rounded-[28px] border-0 p-0 shadow-xl",
|
|
9510
|
-
className,
|
|
9511
|
-
dialogClassName
|
|
9512
|
-
),
|
|
9511
|
+
className: cn("max-w-[560px] border-0 p-0 shadow-xl", className, dialogClassName),
|
|
9513
9512
|
lockScroll: false,
|
|
9514
9513
|
children: [
|
|
9515
9514
|
title ? /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(DialogTitle, { className: "sr-only", children: title }) : null,
|
|
@@ -11002,6 +11001,7 @@ AirbnbSearchInput.displayName = "SearchInput";
|
|
|
11002
11001
|
var React39 = __toESM(require("react"), 1);
|
|
11003
11002
|
var import_lucide_react46 = require("lucide-react");
|
|
11004
11003
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
11004
|
+
var import_react46 = require("react");
|
|
11005
11005
|
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
11006
11006
|
var ROW_HEIGHT = 48;
|
|
11007
11007
|
var DESKTOP_LIST_HEIGHT = 280;
|
|
@@ -11075,6 +11075,16 @@ var SearchableSelectInternal = ({
|
|
|
11075
11075
|
const describedBy = error && !hideErrorMessage ? errorId : void 0;
|
|
11076
11076
|
const activeOptionId = highlightedIndex >= 0 ? getOptionId(reactId, highlightedIndex) : void 0;
|
|
11077
11077
|
useOutsideClick(containerRef, open && !isMobile ? () => closeSelect() : null);
|
|
11078
|
+
const setSelectOpen = (0, import_react46.useCallback)(
|
|
11079
|
+
(nextOpen, options2) => {
|
|
11080
|
+
setOpen(nextOpen);
|
|
11081
|
+
onOpenChange?.(nextOpen);
|
|
11082
|
+
if (!nextOpen && options2?.restoreFocus) {
|
|
11083
|
+
triggerRef.current?.focus();
|
|
11084
|
+
}
|
|
11085
|
+
},
|
|
11086
|
+
[]
|
|
11087
|
+
);
|
|
11078
11088
|
React39.useEffect(() => {
|
|
11079
11089
|
if (isBlocked) {
|
|
11080
11090
|
setSelectOpen(false);
|
|
@@ -11087,7 +11097,7 @@ var SearchableSelectInternal = ({
|
|
|
11087
11097
|
return () => {
|
|
11088
11098
|
window.cancelAnimationFrame(frameId);
|
|
11089
11099
|
};
|
|
11090
|
-
}, [isBlocked, open]);
|
|
11100
|
+
}, [isBlocked, open, setSelectOpen]);
|
|
11091
11101
|
React39.useEffect(() => {
|
|
11092
11102
|
if (!open) {
|
|
11093
11103
|
setHighlightedIndex(-1);
|
|
@@ -11100,13 +11110,6 @@ var SearchableSelectInternal = ({
|
|
|
11100
11110
|
return selectedIndex >= 0 ? selectedIndex : getFirstEnabledIndex(visibleOptions);
|
|
11101
11111
|
});
|
|
11102
11112
|
}, [open, selectedIndex, visibleOptions]);
|
|
11103
|
-
function setSelectOpen(nextOpen, options2) {
|
|
11104
|
-
setOpen(nextOpen);
|
|
11105
|
-
onOpenChange?.(nextOpen);
|
|
11106
|
-
if (!nextOpen && options2?.restoreFocus) {
|
|
11107
|
-
triggerRef.current?.focus();
|
|
11108
|
-
}
|
|
11109
|
-
}
|
|
11110
11113
|
function openSelect() {
|
|
11111
11114
|
if (isBlocked) return;
|
|
11112
11115
|
setSelectOpen(true);
|