@olwiba/cn 0.1.19 → 0.1.20

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.ts CHANGED
@@ -120,8 +120,9 @@ declare const badgeVariants: (props?: ({
120
120
  } & class_variance_authority_types.ClassProp) | undefined) => string;
121
121
  interface BadgeProps extends React$1.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
122
122
  disabled?: boolean;
123
+ mode?: "playful" | "smooth";
123
124
  }
124
- declare function Badge({ className, variant, size, disabled, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
125
+ declare function Badge({ className, variant, size, disabled, mode: modeProp, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
125
126
 
126
127
  declare const Breadcrumb: React$1.ForwardRefExoticComponent<Omit<React$1.DetailedHTMLProps<React$1.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
127
128
  separator?: React$1.ReactNode;
package/dist/index.js CHANGED
@@ -57,7 +57,11 @@ function useUIVariant() {
57
57
  return React37.useContext(UIVariantContext);
58
58
  }
59
59
  var AccordionContext = React37.createContext({});
60
- var Accordion = React37.forwardRef(({ mode, size, ...props }, ref) => /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { mode, size }, children: /* @__PURE__ */ jsx(AccordionPrimitive.Root, { ref, ...props }) }));
60
+ var Accordion = React37.forwardRef(({ mode: modeProp, size, ...props }, ref) => {
61
+ const inheritedMode = useUIVariant();
62
+ const mode = modeProp ?? inheritedMode;
63
+ return /* @__PURE__ */ jsx(AccordionContext.Provider, { value: { mode, size }, children: /* @__PURE__ */ jsx(AccordionPrimitive.Root, { ref, ...props }) });
64
+ });
61
65
  Accordion.displayName = "Accordion";
62
66
  var AccordionItem = React37.forwardRef(({ className, ...props }, ref) => {
63
67
  const { mode } = React37.useContext(AccordionContext);
@@ -471,11 +475,18 @@ var badgeVariants = cva(
471
475
  }
472
476
  }
473
477
  );
474
- function Badge({ className, variant, size, disabled = false, ...props }) {
478
+ function Badge({ className, variant, size, disabled = false, mode: modeProp, ...props }) {
479
+ const mode = modeProp ?? useUIVariant();
475
480
  return /* @__PURE__ */ jsx(
476
481
  "div",
477
482
  {
478
- className: cn(badgeVariants({ variant, size }), disabled && "opacity-50 pointer-events-none", className),
483
+ className: cn(
484
+ badgeVariants({ variant, size }),
485
+ disabled && "opacity-50 pointer-events-none",
486
+ mode === "smooth" && "shadow-sm",
487
+ mode === "playful" && "rotate-[0.5deg] [box-shadow:2px_2px_0px_0px_color-mix(in_srgb,currentColor_15%,transparent)]",
488
+ className
489
+ ),
479
490
  ...props
480
491
  }
481
492
  );