@codapet/design-system 0.2.2 → 0.2.4

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
@@ -487,7 +487,10 @@ declare function TabsList({ className, ...props }: React$1.ComponentProps<typeof
487
487
  declare function TabsTrigger({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
488
488
  declare function TabsContent({ className, ...props }: React$1.ComponentProps<typeof TabsPrimitive.Content>): react_jsx_runtime.JSX.Element;
489
489
 
490
- declare function Textarea({ className, ...props }: React$1.ComponentProps<"textarea">): react_jsx_runtime.JSX.Element;
490
+ interface TextareaProps extends Omit<React$1.ComponentProps<'textarea'>, 'size'> {
491
+ error?: boolean;
492
+ }
493
+ declare const Textarea: React$1.ForwardRefExoticComponent<Omit<TextareaProps, "ref"> & React$1.RefAttributes<HTMLTextAreaElement>>;
491
494
 
492
495
  declare const toggleVariants: (props?: ({
493
496
  variant?: "default" | "outline" | null | undefined;
package/dist/index.mjs CHANGED
@@ -137,19 +137,19 @@ import "react";
137
137
  import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
138
138
 
139
139
  // src/components/ui/button.tsx
140
- import "react";
141
140
  import { Slot } from "@radix-ui/react-slot";
142
141
  import { cva as cva2 } from "class-variance-authority";
142
+ import "react";
143
143
  import { jsx as jsx3 } from "react/jsx-runtime";
144
144
  var buttonVariants = cva2(
145
- "cursor-pointer active:opacity-70 inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-semibold transition-colors transition-opacity disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none relative select-none will-change-auto focus-visible:before:absolute focus-visible:before:-inset-[3px] focus-visible:before:rounded-lg focus-visible:before:ring-2 focus-visible:before:ring-blue-500/80 focus-visible:before:pointer-events-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
145
+ "cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md font-semibold transition-colors transition-opacity disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none relative select-none will-change-auto focus-visible:before:absolute focus-visible:before:-inset-[3px] focus-visible:before:rounded-lg focus-visible:before:ring-2 focus-visible:before:ring-blue-500/80 focus-visible:before:pointer-events-none aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
146
146
  {
147
147
  variants: {
148
148
  variant: {
149
- primary: "bg-primary text-primary-foreground hover:bg-brand-dark",
150
- secondary: "bg-brand-subtle text-brand-vibrant hover:bg-brand-light border border-brand-light",
151
- tertiary: "bg-zinc-100 text-zinc-700 hover:bg-zinc-300 hover:border-zinc-300 border border-zinc-200",
152
- outline: "text-zinc-800 border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
149
+ primary: "bg-primary text-primary-foreground hover:bg-brand-dark active:bg-slate-800 ",
150
+ secondary: "bg-brand-subtle text-brand-vibrant hover:bg-brand-light border border-brand-light active:bg-icon-disabled",
151
+ tertiary: "bg-zinc-100 text-zinc-700 hover:bg-zinc-300 hover:border-zinc-300 border border-zinc-200 active:bg-zinc-400",
152
+ outline: "text-zinc-800 border bg-background hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 active:bg-surface-default",
153
153
  ghost: "text-zinc-800 hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
154
154
  link: "text-primary underline-offset-4 hover:underline",
155
155
  destructive: "bg-red-400 text-white hover:bg-red-900 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
@@ -2331,7 +2331,7 @@ var Input = React21.forwardRef(
2331
2331
  error,
2332
2332
  ...props
2333
2333
  }, ref) => {
2334
- const errorStyles = error ? [
2334
+ const errorStyles2 = error ? [
2335
2335
  "border-destructive bg-red-subtle",
2336
2336
  "focus:border-destructive focus:ring-destructive/20",
2337
2337
  "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
@@ -2345,7 +2345,7 @@ var Input = React21.forwardRef(
2345
2345
  "data-slot": "input",
2346
2346
  className: cn(
2347
2347
  inputVariants({ size }),
2348
- errorStyles,
2348
+ errorStyles2,
2349
2349
  "peer",
2350
2350
  leftIcon && "pl-10",
2351
2351
  rightIcon && "pr-10",
@@ -2396,7 +2396,7 @@ var Input = React21.forwardRef(
2396
2396
  {
2397
2397
  type,
2398
2398
  "data-slot": "input",
2399
- className: cn(inputVariants({ size }), errorStyles, className),
2399
+ className: cn(inputVariants({ size }), errorStyles2, className),
2400
2400
  ref,
2401
2401
  "aria-invalid": error,
2402
2402
  ...props
@@ -4466,21 +4466,46 @@ function TabsContent({
4466
4466
  }
4467
4467
 
4468
4468
  // src/components/ui/textarea.tsx
4469
- import "react";
4469
+ import * as React41 from "react";
4470
4470
  import { jsx as jsx44 } from "react/jsx-runtime";
4471
- function Textarea({ className, ...props }) {
4472
- return /* @__PURE__ */ jsx44(
4473
- "textarea",
4474
- {
4475
- "data-slot": "textarea",
4476
- className: cn(
4477
- "border-input placeholder:text-muted-foreground 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 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
4478
- className
4479
- ),
4480
- ...props
4481
- }
4482
- );
4483
- }
4471
+ var textareaBaseStyles = [
4472
+ // Base styles aligned with Input
4473
+ "placeholder:text-gray-subtle selection:bg-primary selection:text-primary-foreground",
4474
+ "flex w-full min-w-0 rounded-md border bg-transparent text-base shadow-xs transition-all duration-200",
4475
+ "outline-none font-sans",
4476
+ // Disabled
4477
+ "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
4478
+ // Responsive text size
4479
+ "md:text-sm",
4480
+ // Default state
4481
+ "border-zinc-300 bg-background",
4482
+ // Hover/Focus/Active states
4483
+ "hover:border-brand-normal",
4484
+ "focus:border-blue-500",
4485
+ "active:border-brand-normal",
4486
+ // Textarea specific
4487
+ "field-sizing-content min-h-16 resize-y px-3 py-2"
4488
+ ].join(" ");
4489
+ var errorStyles = [
4490
+ "border-destructive bg-red-subtle",
4491
+ "focus:border-destructive focus:ring-destructive/20",
4492
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
4493
+ ].join(" ");
4494
+ var Textarea = React41.forwardRef(
4495
+ ({ className, error, ...props }, ref) => {
4496
+ return /* @__PURE__ */ jsx44(
4497
+ "textarea",
4498
+ {
4499
+ "data-slot": "textarea",
4500
+ className: cn(textareaBaseStyles, error && errorStyles, className),
4501
+ "aria-invalid": error,
4502
+ ref,
4503
+ ...props
4504
+ }
4505
+ );
4506
+ }
4507
+ );
4508
+ Textarea.displayName = "Textarea";
4484
4509
 
4485
4510
  // src/components/ui/toggle.tsx
4486
4511
  import "react";