@chekinapp/ui 0.0.58 → 0.0.59

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
@@ -2325,21 +2325,39 @@ type TablePlaceholderProps = {
2325
2325
  };
2326
2326
  declare function TablePlaceholder({ children, text, title, className, visible, iconSlot, insideTable, }: TablePlaceholderProps): react_jsx_runtime.JSX.Element | null;
2327
2327
 
2328
+ type PathType = string | {
2329
+ pathname: string;
2330
+ search?: string;
2331
+ hash?: string;
2332
+ };
2328
2333
  declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
2329
2334
  declare const tabsListVariants: (props?: ({
2330
- variant?: "default" | "underlined" | null | undefined;
2335
+ variant?: "button" | "underlined" | null | undefined;
2331
2336
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2332
2337
  type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>;
2333
2338
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
2334
- variant?: "default" | "underlined" | null | undefined;
2339
+ variant?: "button" | "underlined" | null | undefined;
2335
2340
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLDivElement>>;
2336
2341
  declare const tabsTriggerVariants: (props?: ({
2337
- variant?: "default" | "underlined" | null | undefined;
2342
+ variant?: "button" | "underlined" | null | undefined;
2338
2343
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2339
- type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & VariantProps<typeof tabsTriggerVariants>;
2340
- declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
2341
- variant?: "default" | "underlined" | null | undefined;
2342
- } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLButtonElement>>;
2344
+ type BaseTabsTriggerProps = Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, 'value' | 'onClick'> & VariantProps<typeof tabsTriggerVariants> & {
2345
+ value: string;
2346
+ hidden?: boolean;
2347
+ end?: boolean;
2348
+ };
2349
+ type LinkTabsTriggerProps = Omit<BaseTabsTriggerProps, 'value'> & {
2350
+ value: PathType;
2351
+ end?: boolean;
2352
+ asLink: ElementType;
2353
+ onClick?: (event: MouseEvent<HTMLElement>, pathName?: PathType) => void;
2354
+ };
2355
+ type ButtonTabsTriggerProps = BaseTabsTriggerProps & {
2356
+ asLink?: undefined;
2357
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
2358
+ };
2359
+ type TabsTriggerProps = ButtonTabsTriggerProps | LinkTabsTriggerProps;
2360
+ declare const TabsTrigger: React$1.ForwardRefExoticComponent<TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
2343
2361
  declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
2344
2362
 
2345
2363
  interface TimelineProps extends React$1.ComponentPropsWithoutRef<'ol'> {
package/dist/index.d.ts CHANGED
@@ -2325,21 +2325,39 @@ type TablePlaceholderProps = {
2325
2325
  };
2326
2326
  declare function TablePlaceholder({ children, text, title, className, visible, iconSlot, insideTable, }: TablePlaceholderProps): react_jsx_runtime.JSX.Element | null;
2327
2327
 
2328
+ type PathType = string | {
2329
+ pathname: string;
2330
+ search?: string;
2331
+ hash?: string;
2332
+ };
2328
2333
  declare const Tabs: React$1.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React$1.RefAttributes<HTMLDivElement>>;
2329
2334
  declare const tabsListVariants: (props?: ({
2330
- variant?: "default" | "underlined" | null | undefined;
2335
+ variant?: "button" | "underlined" | null | undefined;
2331
2336
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2332
2337
  type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>;
2333
2338
  declare const TabsList: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & VariantProps<(props?: ({
2334
- variant?: "default" | "underlined" | null | undefined;
2339
+ variant?: "button" | "underlined" | null | undefined;
2335
2340
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLDivElement>>;
2336
2341
  declare const tabsTriggerVariants: (props?: ({
2337
- variant?: "default" | "underlined" | null | undefined;
2342
+ variant?: "button" | "underlined" | null | undefined;
2338
2343
  } & class_variance_authority_types.ClassProp) | undefined) => string;
2339
- type TabsTriggerProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & VariantProps<typeof tabsTriggerVariants>;
2340
- declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
2341
- variant?: "default" | "underlined" | null | undefined;
2342
- } & class_variance_authority_types.ClassProp) | undefined) => string> & React$1.RefAttributes<HTMLButtonElement>>;
2344
+ type BaseTabsTriggerProps = Omit<ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>, 'value' | 'onClick'> & VariantProps<typeof tabsTriggerVariants> & {
2345
+ value: string;
2346
+ hidden?: boolean;
2347
+ end?: boolean;
2348
+ };
2349
+ type LinkTabsTriggerProps = Omit<BaseTabsTriggerProps, 'value'> & {
2350
+ value: PathType;
2351
+ end?: boolean;
2352
+ asLink: ElementType;
2353
+ onClick?: (event: MouseEvent<HTMLElement>, pathName?: PathType) => void;
2354
+ };
2355
+ type ButtonTabsTriggerProps = BaseTabsTriggerProps & {
2356
+ asLink?: undefined;
2357
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
2358
+ };
2359
+ type TabsTriggerProps = ButtonTabsTriggerProps | LinkTabsTriggerProps;
2360
+ declare const TabsTrigger: React$1.ForwardRefExoticComponent<TabsTriggerProps & React$1.RefAttributes<HTMLButtonElement>>;
2343
2361
  declare const TabsContent: React$1.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
2344
2362
 
2345
2363
  interface TimelineProps extends React$1.ComponentPropsWithoutRef<'ol'> {
package/dist/index.js CHANGED
@@ -9070,7 +9070,9 @@ var SwitchGroup = React35.forwardRef(
9070
9070
  SwitchGroup.displayName = "SwitchGroup";
9071
9071
 
9072
9072
  // src/tabs/Tabs.tsx
9073
- import { forwardRef as forwardRef48 } from "react";
9073
+ import {
9074
+ forwardRef as forwardRef48
9075
+ } from "react";
9074
9076
  import * as TabsPrimitive2 from "@radix-ui/react-tabs";
9075
9077
  import { cva as cva13 } from "class-variance-authority";
9076
9078
  import { jsx as jsx117 } from "react/jsx-runtime";
@@ -9078,12 +9080,12 @@ var Tabs = TabsPrimitive2.Root;
9078
9080
  var tabsListVariants = cva13("inline-flex items-center", {
9079
9081
  variants: {
9080
9082
  variant: {
9081
- default: "h-10 justify-center rounded-md bg-[var(--chekin-color-surface-input-empty)] p-1 text-[var(--chekin-color-gray-1)]",
9082
- underlined: "gap-6 border-b border-[var(--chekin-color-gray-3)]"
9083
+ 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)]',
9084
+ underlined: "tab-list mb-8 flex-wrap gap-x-6 gap-y-3 border-b border-[var(--chekin-color-gray-3)]"
9083
9085
  }
9084
9086
  },
9085
9087
  defaultVariants: {
9086
- variant: "default"
9088
+ variant: "button"
9087
9089
  }
9088
9090
  });
9089
9091
  var TabsList = forwardRef48(
@@ -9098,29 +9100,68 @@ var TabsList = forwardRef48(
9098
9100
  );
9099
9101
  TabsList.displayName = TabsPrimitive2.List.displayName;
9100
9102
  var tabsTriggerVariants = cva13(
9101
- "inline-flex items-center justify-center whitespace-nowrap transition-all focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50",
9103
+ "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",
9102
9104
  {
9103
9105
  variants: {
9104
9106
  variant: {
9105
- default: "rounded-sm px-3 py-1.5 text-sm font-medium focus-visible:shadow-[var(--chekin-shadow-focus)] data-[state=active]:bg-[var(--chekin-color-white)] data-[state=active]:text-[var(--chekin-color-brand-navy)] data-[state=active]:shadow-sm",
9106
- underlined: "-mb-px border-b-[3px] border-transparent py-2 text-base font-medium text-[var(--chekin-color-gray-1)] data-[state=active]:border-[var(--chekin-color-brand-blue)] data-[state=active]:font-semibold data-[state=active]:text-[var(--chekin-color-brand-blue)]"
9107
+ 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",
9108
+ 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)]"
9107
9109
  }
9108
9110
  },
9109
9111
  defaultVariants: {
9110
- variant: "default"
9112
+ variant: "button"
9111
9113
  }
9112
9114
  }
9113
9115
  );
9114
- var TabsTrigger = forwardRef48(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx117(
9115
- TabsPrimitive2.Trigger,
9116
+ var TabsTrigger = forwardRef48(({ className, variant = "button", hidden, ...props }, ref) => {
9117
+ if (hidden) {
9118
+ return null;
9119
+ }
9120
+ if (props.asLink) {
9121
+ const { asLink: Link2, value, end, onClick: onClick2, children: children2, ...linkProps } = props;
9122
+ return /* @__PURE__ */ jsx117(
9123
+ Link2,
9124
+ {
9125
+ relative: "route",
9126
+ end,
9127
+ to: value,
9128
+ onClick: (event) => onClick2?.(event, value),
9129
+ className: cn(
9130
+ tabsTriggerVariants({ variant }),
9131
+ variant === "button" ? "tabs__btn-item tabs__btn-item_link" : "tabs__item tabs__item_link",
9132
+ className
9133
+ ),
9134
+ ...linkProps,
9135
+ children: children2
9136
+ }
9137
+ );
9138
+ }
9139
+ const { children, onClick, end: _end, ...triggerProps } = props;
9140
+ return /* @__PURE__ */ jsx117(
9141
+ TabsPrimitive2.Trigger,
9142
+ {
9143
+ ref,
9144
+ className: cn(
9145
+ tabsTriggerVariants({ variant }),
9146
+ variant === "button" ? "tabs__btn-item" : "tabs__item",
9147
+ className
9148
+ ),
9149
+ onClick,
9150
+ ...triggerProps,
9151
+ children
9152
+ }
9153
+ );
9154
+ });
9155
+ TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
9156
+ var TabsContent = forwardRef48(({ className, ...props }, ref) => /* @__PURE__ */ jsx117(
9157
+ TabsPrimitive2.Content,
9116
9158
  {
9117
9159
  ref,
9118
- className: cn(tabsTriggerVariants({ variant }), className),
9160
+ className: cn("tabs__header-item", className),
9161
+ tabIndex: -1,
9119
9162
  ...props
9120
9163
  }
9121
9164
  ));
9122
- TabsTrigger.displayName = TabsPrimitive2.Trigger.displayName;
9123
- var TabsContent = forwardRef48(({ className, ...props }, ref) => /* @__PURE__ */ jsx117(TabsPrimitive2.Content, { ref, className, tabIndex: -1, ...props }));
9124
9165
  TabsContent.displayName = TabsPrimitive2.Content.displayName;
9125
9166
 
9126
9167
  // src/tabbed-section/TabbedSection.tsx