@codapet/design-system 0.3.7 → 0.4.0

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.mts CHANGED
@@ -42,7 +42,10 @@ import { ClassValue } from 'clsx';
42
42
 
43
43
  declare function Accordion({ ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Root>): react_jsx_runtime.JSX.Element;
44
44
  declare function AccordionItem({ className, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Item>): react_jsx_runtime.JSX.Element;
45
- declare function AccordionTrigger({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
45
+ declare function AccordionTrigger({ className, children, expandedIcon, collapsedIcon, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Trigger> & {
46
+ expandedIcon?: React$1.ReactNode;
47
+ collapsedIcon?: React$1.ReactNode;
48
+ }): react_jsx_runtime.JSX.Element;
46
49
  declare function AccordionContent({ className, children, ...props }: React$1.ComponentProps<typeof AccordionPrimitive.Content>): react_jsx_runtime.JSX.Element;
47
50
 
48
51
  declare const alertVariants: (props?: ({
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ function cn(...inputs) {
13
13
  }
14
14
 
15
15
  // src/components/ui/accordion.tsx
16
- import { jsx, jsxs } from "react/jsx-runtime";
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
17
  function Accordion({
18
18
  ...props
19
19
  }) {
@@ -35,20 +35,27 @@ function AccordionItem({
35
35
  function AccordionTrigger({
36
36
  className,
37
37
  children,
38
+ expandedIcon,
39
+ collapsedIcon,
38
40
  ...props
39
41
  }) {
42
+ const hasCustomIcon = expandedIcon !== void 0 || collapsedIcon !== void 0;
40
43
  return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
41
44
  AccordionPrimitive.Trigger,
42
45
  {
43
46
  "data-slot": "accordion-trigger",
44
47
  className: cn(
45
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
48
+ "group focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50",
49
+ !hasCustomIcon && "[&[data-state=open]>svg]:rotate-180",
46
50
  className
47
51
  ),
48
52
  ...props,
49
53
  children: [
50
54
  children,
51
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-400" })
55
+ hasCustomIcon ? /* @__PURE__ */ jsxs(Fragment, { children: [
56
+ collapsedIcon !== void 0 && /* @__PURE__ */ jsx("span", { className: "group-data-[state=open]:hidden pointer-events-none shrink-0 text-muted-foreground", children: collapsedIcon }),
57
+ expandedIcon !== void 0 && /* @__PURE__ */ jsx("span", { className: "group-data-[state=closed]:hidden pointer-events-none shrink-0 text-muted-foreground", children: expandedIcon })
58
+ ] }) : /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-400" })
52
59
  ]
53
60
  }
54
61
  ) });
@@ -1086,7 +1093,7 @@ function CarouselNext({
1086
1093
  // src/components/ui/chart.tsx
1087
1094
  import * as React13 from "react";
1088
1095
  import * as RechartsPrimitive from "recharts";
1089
- import { Fragment, jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
1096
+ import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs5 } from "react/jsx-runtime";
1090
1097
  var THEMES = { light: "", dark: ".dark" };
1091
1098
  var ChartContext = React13.createContext(null);
1092
1099
  function useChart() {
@@ -1212,7 +1219,7 @@ function ChartTooltipContent({
1212
1219
  "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
1213
1220
  indicator === "dot" && "items-center"
1214
1221
  ),
1215
- children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs5(Fragment, { children: [
1222
+ children: formatter && item?.value !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
1216
1223
  itemConfig?.icon ? /* @__PURE__ */ jsx14(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsx14(
1217
1224
  "div",
1218
1225
  {
@@ -4679,7 +4686,7 @@ function useMediaQuery(query) {
4679
4686
  }
4680
4687
 
4681
4688
  // src/components/ui/smart-dialog-drawer.tsx
4682
- import { Fragment as Fragment2, jsx as jsx43 } from "react/jsx-runtime";
4689
+ import { Fragment as Fragment3, jsx as jsx43 } from "react/jsx-runtime";
4683
4690
  var SmartDialog = ({ children, ...props }) => {
4684
4691
  const isMobile = useMediaQuery("(max-width: 600px)");
4685
4692
  return isMobile ? /* @__PURE__ */ jsx43(Drawer, { ...props, children }) : /* @__PURE__ */ jsx43(Dialog, { ...props, children });
@@ -4737,7 +4744,7 @@ var SmartDialogFooter = ({ children, ...props }) => {
4737
4744
  };
4738
4745
  var SmartDialogClose = ({ children, ...props }) => {
4739
4746
  const isMobile = useMediaQuery("(max-width: 600px)");
4740
- return isMobile ? /* @__PURE__ */ jsx43(Fragment2, { children: /* @__PURE__ */ jsx43(DrawerClose, { ...props, children }) }) : /* @__PURE__ */ jsx43(DialogClose, { ...props, children });
4747
+ return isMobile ? /* @__PURE__ */ jsx43(Fragment3, { children: /* @__PURE__ */ jsx43(DrawerClose, { ...props, children }) }) : /* @__PURE__ */ jsx43(DialogClose, { ...props, children });
4741
4748
  };
4742
4749
 
4743
4750
  // src/components/ui/sonner.tsx