@chekinapp/ui 0.0.58 → 0.0.60
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 +79 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -8
- package/dist/index.d.ts +32 -8
- package/dist/index.js +81 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -519,6 +519,7 @@ __export(index_exports, {
|
|
|
519
519
|
tabsTriggerVariants: () => tabsTriggerVariants,
|
|
520
520
|
toCssSize: () => toCssSize,
|
|
521
521
|
toast: () => import_sonner2.toast,
|
|
522
|
+
toastResponseError: () => toastResponseError,
|
|
522
523
|
toggleVariants: () => toggleVariants,
|
|
523
524
|
uiKitI18nResources: () => uiKitI18nResources,
|
|
524
525
|
uiKitTranslations: () => uiKitTranslations,
|
|
@@ -9612,12 +9613,12 @@ var Tabs = TabsPrimitive2.Root;
|
|
|
9612
9613
|
var tabsListVariants = (0, import_class_variance_authority13.cva)("inline-flex items-center", {
|
|
9613
9614
|
variants: {
|
|
9614
9615
|
variant: {
|
|
9615
|
-
|
|
9616
|
-
underlined: "gap-6 border-b border-[var(--chekin-color-gray-3)]"
|
|
9616
|
+
button: 'tab-list h-[42px] justify-center gap-[7px] rounded-md border border-[var(--chekin-color-gray-3)] bg-[var(--chekin-color-surface-input-empty)] p-[3px] [&>*:not(:last-child)]:after:content-[""] [&>*:not(:last-child)]:after:absolute [&>*:not(:last-child)]:after:right-[-4px] [&>*:not(:last-child)]:after:h-6 [&>*:not(:last-child)]:after:w-px [&>*:not(:last-child)]:after:bg-[var(--chekin-color-gray-3)]',
|
|
9617
|
+
underlined: "tab-list mb-8 flex-wrap gap-x-6 gap-y-3 border-b border-[var(--chekin-color-gray-3)]"
|
|
9617
9618
|
}
|
|
9618
9619
|
},
|
|
9619
9620
|
defaultVariants: {
|
|
9620
|
-
variant: "
|
|
9621
|
+
variant: "button"
|
|
9621
9622
|
}
|
|
9622
9623
|
});
|
|
9623
9624
|
var TabsList = (0, import_react73.forwardRef)(
|
|
@@ -9632,29 +9633,68 @@ var TabsList = (0, import_react73.forwardRef)(
|
|
|
9632
9633
|
);
|
|
9633
9634
|
TabsList.displayName = TabsPrimitive2.List.displayName;
|
|
9634
9635
|
var tabsTriggerVariants = (0, import_class_variance_authority13.cva)(
|
|
9635
|
-
"inline-flex items-center justify-center whitespace-nowrap transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
|
|
9636
|
+
"inline-flex items-center justify-center whitespace-nowrap transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 cursor-pointer select-none",
|
|
9636
9637
|
{
|
|
9637
9638
|
variants: {
|
|
9638
9639
|
variant: {
|
|
9639
|
-
|
|
9640
|
-
underlined: "-
|
|
9640
|
+
button: "h-full flex-1 rounded-md px-4 text-center text-[15px] font-medium relative text-[var(--chekin-color-gray-1)] hover:bg-[var(--chekin-color-brand-blue)] hover:text-white data-[state=active]:bg-[var(--chekin-color-brand-blue)] data-[state=active]:font-bold data-[state=active]:text-white data-[state=active]:shadow-sm [&.active]:bg-[var(--chekin-color-brand-blue)] [&.active]:font-bold [&.active]:text-white [&.active]:shadow-sm",
|
|
9641
|
+
underlined: "h-full relative top-px pb-[15px] text-base font-medium leading-5 text-[var(--chekin-color-gray-1)] border-b-2 border-transparent -mb-px data-[state=active]:text-[var(--chekin-color-brand-blue)] data-[state=active]:border-[var(--chekin-color-brand-blue)] hover:border-[var(--chekin-color-brand-blue)]/30 [&.active]:border-[var(--chekin-color-brand-blue)]"
|
|
9641
9642
|
}
|
|
9642
9643
|
},
|
|
9643
9644
|
defaultVariants: {
|
|
9644
|
-
variant: "
|
|
9645
|
+
variant: "button"
|
|
9645
9646
|
}
|
|
9646
9647
|
}
|
|
9647
9648
|
);
|
|
9648
|
-
var TabsTrigger = (0, import_react73.forwardRef)(({ className, variant, ...props }, ref) =>
|
|
9649
|
-
|
|
9649
|
+
var TabsTrigger = (0, import_react73.forwardRef)(({ className, variant = "button", hidden, ...props }, ref) => {
|
|
9650
|
+
if (hidden) {
|
|
9651
|
+
return null;
|
|
9652
|
+
}
|
|
9653
|
+
if (props.asLink) {
|
|
9654
|
+
const { asLink: Link2, value, end, onClick: onClick2, children: children2, ...linkProps } = props;
|
|
9655
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
9656
|
+
Link2,
|
|
9657
|
+
{
|
|
9658
|
+
relative: "route",
|
|
9659
|
+
end,
|
|
9660
|
+
to: value,
|
|
9661
|
+
onClick: (event) => onClick2?.(event, value),
|
|
9662
|
+
className: cn(
|
|
9663
|
+
tabsTriggerVariants({ variant }),
|
|
9664
|
+
variant === "button" ? "tabs__btn-item tabs__btn-item_link" : "tabs__item tabs__item_link",
|
|
9665
|
+
className
|
|
9666
|
+
),
|
|
9667
|
+
...linkProps,
|
|
9668
|
+
children: children2
|
|
9669
|
+
}
|
|
9670
|
+
);
|
|
9671
|
+
}
|
|
9672
|
+
const { children, onClick, end: _end, ...triggerProps } = props;
|
|
9673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
9674
|
+
TabsPrimitive2.Trigger,
|
|
9675
|
+
{
|
|
9676
|
+
ref,
|
|
9677
|
+
className: cn(
|
|
9678
|
+
tabsTriggerVariants({ variant }),
|
|
9679
|
+
variant === "button" ? "tabs__btn-item" : "tabs__item",
|
|
9680
|
+
className
|
|
9681
|
+
),
|
|
9682
|
+
onClick,
|
|
9683
|
+
...triggerProps,
|
|
9684
|
+
children
|
|
9685
|
+
}
|
|
9686
|
+
);
|
|
9687
|
+
});
|
|
9688
|
+
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
9689
|
+
var TabsContent = (0, import_react73.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
|
|
9690
|
+
TabsPrimitive2.Content,
|
|
9650
9691
|
{
|
|
9651
9692
|
ref,
|
|
9652
|
-
className: cn(
|
|
9693
|
+
className: cn("tabs__header-item", className),
|
|
9694
|
+
tabIndex: -1,
|
|
9653
9695
|
...props
|
|
9654
9696
|
}
|
|
9655
9697
|
));
|
|
9656
|
-
TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
|
|
9657
|
-
var TabsContent = (0, import_react73.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(TabsPrimitive2.Content, { ref, className, tabIndex: -1, ...props }));
|
|
9658
9698
|
TabsContent.displayName = TabsPrimitive2.Content.displayName;
|
|
9659
9699
|
|
|
9660
9700
|
// src/tabbed-section/TabbedSection.tsx
|
|
@@ -14472,6 +14512,9 @@ var DEVICE_BREAKPOINTS = {
|
|
|
14472
14512
|
desktop: "2560px"
|
|
14473
14513
|
};
|
|
14474
14514
|
|
|
14515
|
+
// src/lib/toastResponseError.tsx
|
|
14516
|
+
var import_sonner3 = require("sonner");
|
|
14517
|
+
|
|
14475
14518
|
// src/lib/getErrorMessage.ts
|
|
14476
14519
|
function getErrorMessage(error) {
|
|
14477
14520
|
let message = "";
|
|
@@ -14509,6 +14552,29 @@ function getErrorMessage(error) {
|
|
|
14509
14552
|
}
|
|
14510
14553
|
return message;
|
|
14511
14554
|
}
|
|
14555
|
+
|
|
14556
|
+
// src/lib/toastResponseError.tsx
|
|
14557
|
+
var import_i18next = __toESM(require("i18next"), 1);
|
|
14558
|
+
var import_jsx_runtime156 = require("react/jsx-runtime");
|
|
14559
|
+
function addSupportEmailToMessage(message, prefixText) {
|
|
14560
|
+
if (typeof message !== "string") {
|
|
14561
|
+
return message;
|
|
14562
|
+
}
|
|
14563
|
+
const builtMessage = `${prefixText ? `${prefixText} ` : ""}${message}`;
|
|
14564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime156.jsxs)("div", { children: [
|
|
14565
|
+
/* @__PURE__ */ (0, import_jsx_runtime156.jsx)("div", { children: builtMessage }),
|
|
14566
|
+
import_i18next.default.t("reach_us_at_email")
|
|
14567
|
+
] });
|
|
14568
|
+
}
|
|
14569
|
+
function toastResponseError(error, options = {}) {
|
|
14570
|
+
const message = typeof error === "string" ? error : addSupportEmailToMessage(getErrorMessage(error), options?.prefixText);
|
|
14571
|
+
const toastId = error?.message || typeof error === "string" && error || "toastId";
|
|
14572
|
+
import_sonner3.toast.error(message, {
|
|
14573
|
+
id: toastId,
|
|
14574
|
+
duration: options?.autoClose || Infinity,
|
|
14575
|
+
...options
|
|
14576
|
+
});
|
|
14577
|
+
}
|
|
14512
14578
|
// Annotate the CommonJS export names for ESM import in node:
|
|
14513
14579
|
0 && (module.exports = {
|
|
14514
14580
|
Accordion,
|
|
@@ -14810,6 +14876,7 @@ function getErrorMessage(error) {
|
|
|
14810
14876
|
tabsTriggerVariants,
|
|
14811
14877
|
toCssSize,
|
|
14812
14878
|
toast,
|
|
14879
|
+
toastResponseError,
|
|
14813
14880
|
toggleVariants,
|
|
14814
14881
|
uiKitI18nResources,
|
|
14815
14882
|
uiKitTranslations,
|