@codapet/design-system 0.2.8 → 0.3.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
@@ -88,7 +88,7 @@ declare function BreadcrumbSeparator({ children, className, ...props }: React$1.
88
88
  declare function BreadcrumbEllipsis({ className, ...props }: React$1.ComponentProps<"span">): react_jsx_runtime.JSX.Element;
89
89
 
90
90
  declare const buttonVariants: (props?: ({
91
- variant?: "link" | "destructive" | "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "destructive-secondary" | "destructive-tertiary" | null | undefined;
91
+ variant?: "link" | "destructive" | "primary" | "secondary" | "tertiary" | "outline" | "ghost" | "ghost-secondary" | "ghost-destructive" | "destructive-secondary" | "destructive-tertiary" | null | undefined;
92
92
  size?: "md" | "sm" | "lg" | "icon" | null | undefined;
93
93
  } & class_variance_authority_types.ClassProp) | undefined) => string;
94
94
  declare function Button({ className, variant, size, asChild, ...props }: React$1.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
@@ -285,6 +285,8 @@ interface InputProps extends Omit<React$1.ComponentProps<'input'>, 'size'>, Vari
285
285
  rightIcon?: React$1.ReactNode;
286
286
  leftIconClassName?: string;
287
287
  rightIconClassName?: string;
288
+ rightIconOnClick?: () => void;
289
+ rightIconButtonProps?: React$1.ButtonHTMLAttributes<HTMLButtonElement>;
288
290
  error?: boolean;
289
291
  }
290
292
  declare const Input: React$1.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
package/dist/index.mjs CHANGED
@@ -150,8 +150,10 @@ var buttonVariants = cva2(
150
150
  secondary: "bg-brand-subtle text-brand-vibrant hover:bg-primary-surface-light border border-brand-light active:bg-icon-disabled hover:border-transparent active:border-transparent",
151
151
  tertiary: "bg-gray-surface-light text-zinc-700 hover:bg-gray-surface-default border border-gray-stroke-light active:bg-zinc-400",
152
152
  outline: "text-zinc-800 border border-gray-surface-default bg-background hover:bg-gray-surface-light hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 active:bg-gray-surface-default",
153
- ghost: "text-zinc-800 hover:bg-gray-surface-light hover:text-accent-foreground dark:hover:bg-accent/50 active:bg-gray-surface-default",
154
- link: "text-primary underline-offset-4 hover:underline hover:bg-primary-surface-subtle active:bg-primary-surface-light",
153
+ ghost: "text-brand-vibrant hover:bg-primary-surface-subtle dark:hover:bg-accent/50 active:bg-primary-surface-light",
154
+ "ghost-secondary": "text-zinc-800 hover:bg-gray-surface-light hover:text-accent-foreground dark:hover:bg-accent/50 active:bg-gray-surface-default",
155
+ "ghost-destructive": "bg-transparent text-red-400 hover:bg-red-50 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 active:bg-red-100",
156
+ link: "text-zinc-800 underline-offset-4 underline hover:bg-none active:bg-none hover:text-brand-vibrant ",
155
157
  destructive: "bg-error-surface-default text-white hover:bg-red-800 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 active:bg-error-surface-dark",
156
158
  "destructive-secondary": "bg-error-surface-light border border-error-stroke-light text-red-400 hover:border-error-surface-default focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 active:bg-red-100",
157
159
  "destructive-tertiary": "bg-transparent border border-error-stroke-light text-red-400 hover:bg-red-50 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60 active:bg-red-100"
@@ -1208,9 +1210,9 @@ function getPayloadConfigFromPayload(config, payload, key) {
1208
1210
  }
1209
1211
 
1210
1212
  // src/components/ui/checkbox.tsx
1211
- import "react";
1212
1213
  import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
1213
- import { CheckIcon } from "lucide-react";
1214
+ import { Check } from "lucide-react";
1215
+ import "react";
1214
1216
  import { jsx as jsx13 } from "react/jsx-runtime";
1215
1217
  function Checkbox({
1216
1218
  className,
@@ -1221,7 +1223,7 @@ function Checkbox({
1221
1223
  {
1222
1224
  "data-slot": "checkbox",
1223
1225
  className: cn(
1224
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
1226
+ "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-brand-text-vibrant aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border transition-shadow outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:before:absolute focus-visible:before:-inset-[3px] focus:ring-offset-1 focus:ring-offset-brand-text-vibrant",
1225
1227
  className
1226
1228
  ),
1227
1229
  ...props,
@@ -1230,7 +1232,7 @@ function Checkbox({
1230
1232
  {
1231
1233
  "data-slot": "checkbox-indicator",
1232
1234
  className: "flex items-center justify-center text-current transition-none",
1233
- children: /* @__PURE__ */ jsx13(CheckIcon, { className: "size-3.5" })
1235
+ children: /* @__PURE__ */ jsx13(Check, { className: "size-3.5" })
1234
1236
  }
1235
1237
  )
1236
1238
  }
@@ -1559,7 +1561,7 @@ function CommandShortcut({
1559
1561
  // src/components/ui/context-menu.tsx
1560
1562
  import "react";
1561
1563
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
1562
- import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon2, CircleIcon } from "lucide-react";
1564
+ import { CheckIcon, ChevronRightIcon as ChevronRightIcon2, CircleIcon } from "lucide-react";
1563
1565
  import { jsx as jsx17, jsxs as jsxs8 } from "react/jsx-runtime";
1564
1566
  function ContextMenu({
1565
1567
  ...props
@@ -1689,7 +1691,7 @@ function ContextMenuCheckboxItem({
1689
1691
  checked,
1690
1692
  ...props,
1691
1693
  children: [
1692
- /* @__PURE__ */ jsx17("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx17(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx17(CheckIcon2, { className: "size-4" }) }) }),
1694
+ /* @__PURE__ */ jsx17("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx17(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx17(CheckIcon, { className: "size-4" }) }) }),
1693
1695
  children
1694
1696
  ]
1695
1697
  }
@@ -1885,7 +1887,7 @@ function DrawerDescription({
1885
1887
  // src/components/ui/dropdown-menu.tsx
1886
1888
  import "react";
1887
1889
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
1888
- import { CheckIcon as CheckIcon3, ChevronRightIcon as ChevronRightIcon3, CircleIcon as CircleIcon2 } from "lucide-react";
1890
+ import { CheckIcon as CheckIcon2, ChevronRightIcon as ChevronRightIcon3, CircleIcon as CircleIcon2 } from "lucide-react";
1889
1891
  import { jsx as jsx19, jsxs as jsxs10 } from "react/jsx-runtime";
1890
1892
  function DropdownMenu({
1891
1893
  ...props
@@ -1968,7 +1970,7 @@ function DropdownMenuCheckboxItem({
1968
1970
  checked,
1969
1971
  ...props,
1970
1972
  children: [
1971
- /* @__PURE__ */ jsx19("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(CheckIcon3, { className: "size-4" }) }) }),
1973
+ /* @__PURE__ */ jsx19("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx19(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx19(CheckIcon2, { className: "size-4" }) }) }),
1972
1974
  children
1973
1975
  ]
1974
1976
  }
@@ -2290,7 +2292,7 @@ var inputVariants = cva5(
2290
2292
  [
2291
2293
  // Base styles
2292
2294
  "file:text-zinc-800 placeholder:text-gray-subtle selection:bg-primary selection:text-primary-foreground",
2293
- "flex w-full min-w-0 rounded-md border bg-transparent text-base shadow-xs transition-all duration-200",
2295
+ "flex w-full min-w-0 rounded-md border bg-transparent text-base transition-all duration-200",
2294
2296
  "outline-none font-sans",
2295
2297
  // File input styles
2296
2298
  "file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium",
@@ -2301,7 +2303,7 @@ var inputVariants = cva5(
2301
2303
  // Default state
2302
2304
  "border-zinc-300 bg-background",
2303
2305
  // Hover state
2304
- "hover:border-brand-normal",
2306
+ "hover:border-primary-stroke-default",
2305
2307
  // Focus state
2306
2308
  "focus:border-blue-500",
2307
2309
  "active:border-brand-normal"
@@ -2328,6 +2330,8 @@ var Input = React21.forwardRef(
2328
2330
  rightIcon,
2329
2331
  leftIconClassName,
2330
2332
  rightIconClassName,
2333
+ rightIconOnClick,
2334
+ rightIconButtonProps,
2331
2335
  error,
2332
2336
  ...props
2333
2337
  }, ref) => {
@@ -2347,7 +2351,7 @@ var Input = React21.forwardRef(
2347
2351
  inputVariants({ size }),
2348
2352
  errorStyles2,
2349
2353
  "peer",
2350
- leftIcon && "pl-10",
2354
+ leftIcon && "pl-8",
2351
2355
  rightIcon && "pr-10",
2352
2356
  className
2353
2357
  ),
@@ -2361,7 +2365,7 @@ var Input = React21.forwardRef(
2361
2365
  {
2362
2366
  className: cn(
2363
2367
  "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 flex items-center justify-center",
2364
- "transition-colors",
2368
+ "transition-colors stroke-[1.5px]",
2365
2369
  error ? "text-destructive peer-hover:text-destructive peer-focus:text-destructive peer-active:text-destructive" : "text-muted-foreground peer-hover:text-brand-normal peer-focus:text-blue-500 peer-active:text-brand-normal",
2366
2370
  leftIconClassName
2367
2371
  ),
@@ -2374,13 +2378,19 @@ var Input = React21.forwardRef(
2374
2378
  }
2375
2379
  ),
2376
2380
  rightIcon && /* @__PURE__ */ jsx23(
2377
- "div",
2381
+ Button,
2378
2382
  {
2383
+ onClick: rightIconOnClick,
2384
+ variant: "ghost",
2385
+ size: "icon",
2379
2386
  className: cn(
2380
- "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center",
2381
- "transition-colors",
2387
+ "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center",
2388
+ "h-6 w-6 rounded-sm transition-colors",
2389
+ error ? "text-destructive hover:text-destructive focus:text-destructive" : "text-muted-foreground hover:text-brand-normal focus:text-blue-500",
2382
2390
  rightIconClassName
2383
2391
  ),
2392
+ "aria-label": "Input action",
2393
+ ...rightIconButtonProps,
2384
2394
  children: React21.isValidElement(rightIcon) ? (() => {
2385
2395
  const iconEl = rightIcon;
2386
2396
  return React21.cloneElement(iconEl, {
@@ -2470,7 +2480,7 @@ function InputOTPSeparator({ ...props }) {
2470
2480
  // src/components/ui/menubar.tsx
2471
2481
  import "react";
2472
2482
  import * as MenubarPrimitive from "@radix-ui/react-menubar";
2473
- import { CheckIcon as CheckIcon4, ChevronRightIcon as ChevronRightIcon4, CircleIcon as CircleIcon3 } from "lucide-react";
2483
+ import { CheckIcon as CheckIcon3, ChevronRightIcon as ChevronRightIcon4, CircleIcon as CircleIcon3 } from "lucide-react";
2474
2484
  import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
2475
2485
  function Menubar({
2476
2486
  className,
@@ -2583,7 +2593,7 @@ function MenubarCheckboxItem({
2583
2593
  checked,
2584
2594
  ...props,
2585
2595
  children: [
2586
- /* @__PURE__ */ jsx25("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx25(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx25(CheckIcon4, { className: "size-4" }) }) }),
2596
+ /* @__PURE__ */ jsx25("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx25(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx25(CheckIcon3, { className: "size-4" }) }) }),
2587
2597
  children
2588
2598
  ]
2589
2599
  }
@@ -3018,8 +3028,8 @@ function PopoverAnchor({
3018
3028
  }
3019
3029
 
3020
3030
  // src/components/ui/progress.tsx
3021
- import "react";
3022
3031
  import * as ProgressPrimitive from "@radix-ui/react-progress";
3032
+ import "react";
3023
3033
  import { jsx as jsx29 } from "react/jsx-runtime";
3024
3034
  function Progress({
3025
3035
  className,
@@ -3039,7 +3049,7 @@ function Progress({
3039
3049
  ProgressPrimitive.Indicator,
3040
3050
  {
3041
3051
  "data-slot": "progress-indicator",
3042
- className: "bg-primary h-full w-full flex-1 transition-all",
3052
+ className: "bg-primary h-full w-full flex-1 transition-all rounded-full",
3043
3053
  style: { transform: `translateX(-${100 - (value || 0)}%)` }
3044
3054
  }
3045
3055
  )
@@ -3048,9 +3058,9 @@ function Progress({
3048
3058
  }
3049
3059
 
3050
3060
  // src/components/ui/radio-group.tsx
3051
- import "react";
3052
3061
  import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
3053
3062
  import { CircleIcon as CircleIcon4 } from "lucide-react";
3063
+ import "react";
3054
3064
  import { jsx as jsx30 } from "react/jsx-runtime";
3055
3065
  function RadioGroup4({
3056
3066
  className,
@@ -3074,7 +3084,7 @@ function RadioGroupItem({
3074
3084
  {
3075
3085
  "data-slot": "radio-group-item",
3076
3086
  className: cn(
3077
- "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
3087
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-brand-text-vibrant aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-[color,box-shadow] outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:border-primary",
3078
3088
  className
3079
3089
  ),
3080
3090
  ...props,
@@ -3082,8 +3092,8 @@ function RadioGroupItem({
3082
3092
  RadioGroupPrimitive.Indicator,
3083
3093
  {
3084
3094
  "data-slot": "radio-group-indicator",
3085
- className: "relative flex items-center justify-center",
3086
- children: /* @__PURE__ */ jsx30(CircleIcon4, { className: "fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" })
3095
+ className: "relative flex items-center justify-center ",
3096
+ children: /* @__PURE__ */ jsx30(CircleIcon4, { className: "fill-white absolute top-1/2 left-1/2 size-1.5 -translate-x-1/2 -translate-y-1/2 " })
3087
3097
  }
3088
3098
  )
3089
3099
  }
@@ -3196,7 +3206,7 @@ function ScrollBar({
3196
3206
  // src/components/ui/select.tsx
3197
3207
  import "react";
3198
3208
  import * as SelectPrimitive from "@radix-ui/react-select";
3199
- import { CheckIcon as CheckIcon5, ChevronDownIcon as ChevronDownIcon4, ChevronUpIcon } from "lucide-react";
3209
+ import { CheckIcon as CheckIcon4, ChevronDownIcon as ChevronDownIcon4, ChevronUpIcon } from "lucide-react";
3200
3210
  import { jsx as jsx33, jsxs as jsxs17 } from "react/jsx-runtime";
3201
3211
  function Select({
3202
3212
  ...props
@@ -3298,7 +3308,7 @@ function SelectItem({
3298
3308
  ),
3299
3309
  ...props,
3300
3310
  children: [
3301
- /* @__PURE__ */ jsx33("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx33(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx33(CheckIcon5, { className: "size-4" }) }) }),
3311
+ /* @__PURE__ */ jsx33("span", { className: "absolute right-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx33(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx33(CheckIcon4, { className: "size-4" }) }) }),
3302
3312
  /* @__PURE__ */ jsx33(SelectPrimitive.ItemText, { children })
3303
3313
  ]
3304
3314
  }
@@ -4267,8 +4277,8 @@ var Toaster = ({ ...props }) => {
4267
4277
  };
4268
4278
 
4269
4279
  // src/components/ui/switch.tsx
4270
- import "react";
4271
4280
  import * as SwitchPrimitive from "@radix-ui/react-switch";
4281
+ import "react";
4272
4282
  import { jsx as jsx41 } from "react/jsx-runtime";
4273
4283
  function Switch({
4274
4284
  className,
@@ -4279,7 +4289,7 @@ function Switch({
4279
4289
  {
4280
4290
  "data-slot": "switch",
4281
4291
  className: cn(
4282
- "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
4292
+ "peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-brand-text-vibrant dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.25rem] w-[2.1rem] shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:ring-offset-1 ",
4283
4293
  className
4284
4294
  ),
4285
4295
  ...props,
@@ -4288,7 +4298,7 @@ function Switch({
4288
4298
  {
4289
4299
  "data-slot": "switch-thumb",
4290
4300
  className: cn(
4291
- "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
4301
+ "bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0.5"
4292
4302
  )
4293
4303
  }
4294
4304
  )