@codapet/design-system 0.5.1 → 0.5.2
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 +15 -9
- package/dist/index.mjs +53 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
|
15
15
|
import { Command as Command$1 } from 'cmdk';
|
|
16
16
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
17
17
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
18
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
18
19
|
import { Drawer as Drawer$1 } from 'vaul';
|
|
19
20
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
20
21
|
import * as react_hook_form from 'react-hook-form';
|
|
@@ -25,7 +26,6 @@ import * as HoverCardPrimitive from '@radix-ui/react-hover-card';
|
|
|
25
26
|
import { OTPInput } from 'input-otp';
|
|
26
27
|
import * as MenubarPrimitive from '@radix-ui/react-menubar';
|
|
27
28
|
import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu';
|
|
28
|
-
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
29
29
|
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
30
30
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
31
31
|
import * as ResizablePrimitive from 'react-resizable-panels';
|
|
@@ -250,6 +250,11 @@ interface InputProps extends Omit<React$1.ComponentProps<'input'>, 'size'>, Vari
|
|
|
250
250
|
}
|
|
251
251
|
declare const Input: React$1.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React$1.RefAttributes<HTMLInputElement>>;
|
|
252
252
|
|
|
253
|
+
declare function Popover({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
254
|
+
declare function PopoverTrigger({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
255
|
+
declare function PopoverContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
256
|
+
declare function PopoverAnchor({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
|
|
257
|
+
|
|
253
258
|
type DateFormat = 'MM/DD/YYYY' | 'DD/MM/YYYY' | 'YYYY-MM-DD' | 'DD-MM-YYYY' | 'MM-DD-YYYY' | 'DD.MM.YYYY' | 'MMMM D, YYYY' | 'D MMMM YYYY';
|
|
254
259
|
type NativeInputProps = Omit<React$1.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'min' | 'max' | 'size' | 'disabled' | 'onSelect'>;
|
|
255
260
|
type FlattenedCalendarProps$1 = Omit<React$1.ComponentProps<typeof Calendar>, keyof React$1.InputHTMLAttributes<HTMLInputElement> | 'className' | 'mode' | 'selected' | 'onSelect' | 'month' | 'onMonthChange' | 'disabled' | 'captionLayout' | 'showOutsideDays' | 'classNames' | 'components' | 'formatters' | 'buttonVariant'>;
|
|
@@ -263,6 +268,8 @@ interface DateInputProps extends NativeInputProps, FlattenedCalendarProps$1 {
|
|
|
263
268
|
size?: VariantProps<typeof inputVariants>['size'];
|
|
264
269
|
inputClassName?: string;
|
|
265
270
|
calendarClassName?: string;
|
|
271
|
+
popoverContentClassName?: string;
|
|
272
|
+
popoverContentProps?: Omit<React$1.ComponentProps<typeof PopoverContent>, 'children' | 'className'>;
|
|
266
273
|
dateFormat?: DateFormat;
|
|
267
274
|
mode?: React$1.ComponentProps<typeof Calendar>['mode'];
|
|
268
275
|
selected?: Date;
|
|
@@ -277,7 +284,7 @@ interface DateInputProps extends NativeInputProps, FlattenedCalendarProps$1 {
|
|
|
277
284
|
formatters?: React$1.ComponentProps<typeof Calendar>['formatters'];
|
|
278
285
|
buttonVariant?: React$1.ComponentProps<typeof Calendar>['buttonVariant'];
|
|
279
286
|
}
|
|
280
|
-
declare function DateInput({ date, setDate, maxDate, minDate, disableFuture, className, inputClassName, calendarClassName, inputDisabled, dateFormat, mode, selected, onSelect, month, onMonthChange, disabled: calendarDisabled, captionLayout, showOutsideDays, classNames, components, formatters, buttonVariant, placeholder, onBlur, ...restProps }: DateInputProps): react_jsx_runtime.JSX.Element;
|
|
287
|
+
declare function DateInput({ date, setDate, maxDate, minDate, disableFuture, className, inputClassName, calendarClassName, popoverContentClassName, popoverContentProps, inputDisabled, dateFormat, mode, selected, onSelect, month, onMonthChange, disabled: calendarDisabled, captionLayout, showOutsideDays, classNames, components, formatters, buttonVariant, placeholder, onBlur, ...restProps }: DateInputProps): react_jsx_runtime.JSX.Element;
|
|
281
288
|
|
|
282
289
|
type FlattenedCalendarProps = Omit<React$1.ComponentProps<typeof Calendar>, keyof React$1.InputHTMLAttributes<HTMLInputElement> | 'className' | 'mode' | 'selected' | 'onSelect' | 'month' | 'onMonthChange' | 'disabled' | 'captionLayout' | 'showOutsideDays' | 'classNames' | 'components' | 'formatters' | 'buttonVariant'>;
|
|
283
290
|
interface DateRangeInputProps extends FlattenedCalendarProps {
|
|
@@ -291,6 +298,8 @@ interface DateRangeInputProps extends FlattenedCalendarProps {
|
|
|
291
298
|
className?: string;
|
|
292
299
|
inputClassName?: string;
|
|
293
300
|
calendarClassName?: string;
|
|
301
|
+
popoverContentClassName?: string;
|
|
302
|
+
popoverContentProps?: Omit<React$1.ComponentProps<typeof PopoverContent>, 'children' | 'className'>;
|
|
294
303
|
dateFormat?: DateFormat;
|
|
295
304
|
placeholder?: string;
|
|
296
305
|
selected?: DateRange;
|
|
@@ -305,7 +314,7 @@ interface DateRangeInputProps extends FlattenedCalendarProps {
|
|
|
305
314
|
formatters?: React$1.ComponentProps<typeof Calendar>['formatters'];
|
|
306
315
|
buttonVariant?: React$1.ComponentProps<typeof Calendar>['buttonVariant'];
|
|
307
316
|
}
|
|
308
|
-
declare function DateRangeInput({ dateRange, setDateRange, maxDate, minDate, disableFuture, className, inputClassName, calendarClassName, inputDisabled, dateFormat, selected, onSelect, month, onMonthChange, disabled: calendarDisabled, captionLayout, showOutsideDays, classNames, components, formatters, buttonVariant, placeholder, size, ...restProps }: DateRangeInputProps): react_jsx_runtime.JSX.Element;
|
|
317
|
+
declare function DateRangeInput({ dateRange, setDateRange, maxDate, minDate, disableFuture, className, inputClassName, calendarClassName, popoverContentClassName, popoverContentProps, inputDisabled, dateFormat, selected, onSelect, month, onMonthChange, disabled: calendarDisabled, captionLayout, showOutsideDays, classNames, components, formatters, buttonVariant, placeholder, size, ...restProps }: DateRangeInputProps): react_jsx_runtime.JSX.Element;
|
|
309
318
|
|
|
310
319
|
declare function Drawer({ ...props }: React$1.ComponentProps<typeof Drawer$1.Root>): react_jsx_runtime.JSX.Element;
|
|
311
320
|
declare function DrawerTrigger({ ...props }: React$1.ComponentProps<typeof Drawer$1.Trigger>): react_jsx_runtime.JSX.Element;
|
|
@@ -430,11 +439,6 @@ declare function PaginationPrevious({ className, ...props }: React$1.ComponentPr
|
|
|
430
439
|
declare function PaginationNext({ className, ...props }: React$1.ComponentProps<typeof PaginationLink>): react_jsx_runtime.JSX.Element;
|
|
431
440
|
declare function PaginationEllipsis({ className, ...props }: React$1.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
432
441
|
|
|
433
|
-
declare function Popover({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
434
|
-
declare function PopoverTrigger({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Trigger>): react_jsx_runtime.JSX.Element;
|
|
435
|
-
declare function PopoverContent({ className, align, sideOffset, ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Content>): react_jsx_runtime.JSX.Element;
|
|
436
|
-
declare function PopoverAnchor({ ...props }: React$1.ComponentProps<typeof PopoverPrimitive.Anchor>): react_jsx_runtime.JSX.Element;
|
|
437
|
-
|
|
438
442
|
declare function Progress({ className, value, ...props }: React$1.ComponentProps<typeof ProgressPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
439
443
|
|
|
440
444
|
declare function RadioGroup({ className, ...props }: React$1.ComponentProps<typeof RadioGroupPrimitive.Root>): react_jsx_runtime.JSX.Element;
|
|
@@ -597,11 +601,13 @@ interface TimeInputProps {
|
|
|
597
601
|
size?: VariantProps<typeof inputVariants>['size'];
|
|
598
602
|
className?: string;
|
|
599
603
|
inputClassName?: string;
|
|
604
|
+
popoverContentClassName?: string;
|
|
605
|
+
popoverContentProps?: Omit<React$1.ComponentProps<typeof PopoverContent>, 'children' | 'className'>;
|
|
600
606
|
placeholder?: string;
|
|
601
607
|
icon?: React$1.ReactNode;
|
|
602
608
|
formatDisplay?: (time: TimeValue) => string;
|
|
603
609
|
}
|
|
604
|
-
declare function TimeInput({ time, setTime, timeFormat, minuteStep, inputDisabled, className, inputClassName, size, placeholder, icon, formatDisplay }: TimeInputProps): react_jsx_runtime.JSX.Element;
|
|
610
|
+
declare function TimeInput({ time, setTime, timeFormat, minuteStep, inputDisabled, className, inputClassName, popoverContentClassName, popoverContentProps, size, placeholder, icon, formatDisplay }: TimeInputProps): react_jsx_runtime.JSX.Element;
|
|
605
611
|
|
|
606
612
|
declare const toggleVariants: (props?: ({
|
|
607
613
|
variant?: "default" | "outline" | null | undefined;
|
package/dist/index.mjs
CHANGED
|
@@ -2167,6 +2167,8 @@ function DateInput({
|
|
|
2167
2167
|
className,
|
|
2168
2168
|
inputClassName,
|
|
2169
2169
|
calendarClassName,
|
|
2170
|
+
popoverContentClassName,
|
|
2171
|
+
popoverContentProps,
|
|
2170
2172
|
inputDisabled,
|
|
2171
2173
|
dateFormat = "MM/DD/YYYY",
|
|
2172
2174
|
mode,
|
|
@@ -2349,7 +2351,17 @@ function DateInput({
|
|
|
2349
2351
|
...inputProps
|
|
2350
2352
|
}
|
|
2351
2353
|
) }) }),
|
|
2352
|
-
/* @__PURE__ */ jsx22(
|
|
2354
|
+
/* @__PURE__ */ jsx22(
|
|
2355
|
+
PopoverContent,
|
|
2356
|
+
{
|
|
2357
|
+
className: cn(
|
|
2358
|
+
"p-0 overflow-y-auto h-[400px] md:h-auto md:w-[350px]",
|
|
2359
|
+
popoverContentClassName
|
|
2360
|
+
),
|
|
2361
|
+
...popoverContentProps,
|
|
2362
|
+
children: /* @__PURE__ */ jsx22("div", { className: "border border-blue-500 h-full w-full rounded-md", children: /* @__PURE__ */ jsx22(Calendar, { ...resolvedCalendarProps }) })
|
|
2363
|
+
}
|
|
2364
|
+
)
|
|
2353
2365
|
] }) });
|
|
2354
2366
|
}
|
|
2355
2367
|
|
|
@@ -2406,6 +2418,8 @@ function DateRangeInput({
|
|
|
2406
2418
|
className,
|
|
2407
2419
|
inputClassName,
|
|
2408
2420
|
calendarClassName,
|
|
2421
|
+
popoverContentClassName,
|
|
2422
|
+
popoverContentProps,
|
|
2409
2423
|
inputDisabled,
|
|
2410
2424
|
dateFormat = "MM/DD/YYYY",
|
|
2411
2425
|
selected,
|
|
@@ -2528,31 +2542,41 @@ function DateRangeInput({
|
|
|
2528
2542
|
]
|
|
2529
2543
|
}
|
|
2530
2544
|
) }),
|
|
2531
|
-
/* @__PURE__ */ jsx23(
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
variant: "ghost-secondary",
|
|
2538
|
-
size: "sm",
|
|
2539
|
-
onClick: handleClear,
|
|
2540
|
-
type: "button",
|
|
2541
|
-
children: "Clear"
|
|
2542
|
-
}
|
|
2545
|
+
/* @__PURE__ */ jsx23(
|
|
2546
|
+
PopoverContent,
|
|
2547
|
+
{
|
|
2548
|
+
className: cn(
|
|
2549
|
+
"p-0 h-[400px] w-[var(--radix-popper-anchor-width)] md:h-auto md:w-[350px]",
|
|
2550
|
+
popoverContentClassName
|
|
2543
2551
|
),
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
{
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2552
|
+
...popoverContentProps,
|
|
2553
|
+
children: /* @__PURE__ */ jsxs11("div", { className: "border border-blue-500 h-full w-full rounded-md flex flex-col overflow-y-auto", children: [
|
|
2554
|
+
/* @__PURE__ */ jsx23(Calendar, { ...resolvedCalendarProps }),
|
|
2555
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 px-2 py-2 shrink-0", children: [
|
|
2556
|
+
/* @__PURE__ */ jsx23(
|
|
2557
|
+
Button,
|
|
2558
|
+
{
|
|
2559
|
+
variant: "ghost-secondary",
|
|
2560
|
+
size: "sm",
|
|
2561
|
+
onClick: handleClear,
|
|
2562
|
+
type: "button",
|
|
2563
|
+
children: "Clear"
|
|
2564
|
+
}
|
|
2565
|
+
),
|
|
2566
|
+
/* @__PURE__ */ jsx23(
|
|
2567
|
+
Button,
|
|
2568
|
+
{
|
|
2569
|
+
variant: "primary",
|
|
2570
|
+
size: "sm",
|
|
2571
|
+
onClick: handleAdd,
|
|
2572
|
+
type: "button",
|
|
2573
|
+
children: "Add"
|
|
2574
|
+
}
|
|
2575
|
+
)
|
|
2576
|
+
] })
|
|
2577
|
+
] })
|
|
2578
|
+
}
|
|
2579
|
+
)
|
|
2556
2580
|
] }) });
|
|
2557
2581
|
}
|
|
2558
2582
|
|
|
@@ -5241,6 +5265,8 @@ function TimeInput({
|
|
|
5241
5265
|
inputDisabled,
|
|
5242
5266
|
className,
|
|
5243
5267
|
inputClassName,
|
|
5268
|
+
popoverContentClassName,
|
|
5269
|
+
popoverContentProps,
|
|
5244
5270
|
size,
|
|
5245
5271
|
placeholder,
|
|
5246
5272
|
icon,
|
|
@@ -5327,8 +5353,9 @@ function TimeInput({
|
|
|
5327
5353
|
/* @__PURE__ */ jsx49(
|
|
5328
5354
|
PopoverContent,
|
|
5329
5355
|
{
|
|
5330
|
-
className: "w-auto p-0
|
|
5356
|
+
className: cn("w-auto p-0", popoverContentClassName),
|
|
5331
5357
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
5358
|
+
...popoverContentProps,
|
|
5332
5359
|
children: /* @__PURE__ */ jsxs24("div", { className: "flex divide-x border border-blue-500 rounded-md", children: [
|
|
5333
5360
|
/* @__PURE__ */ jsx49("div", { className: "h-56 w-16 overflow-y-auto overscroll-y-contain [-webkit-overflow-scrolling:touch]", children: /* @__PURE__ */ jsx49("div", { ref: hoursRef, className: "flex flex-col p-1 ", children: hoursList.map((h) => /* @__PURE__ */ jsx49(
|
|
5334
5361
|
Button,
|