@timmbr/ui 1.1.0 → 1.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/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Alert/Alert.types.d.ts +2 -4
- package/dist/components/Alert/Alert.types.d.ts.map +1 -1
- package/dist/components/AlertDialog/AlertDialog.d.ts +16 -0
- package/dist/components/AlertDialog/AlertDialog.d.ts.map +1 -0
- package/dist/components/AlertDialog/AlertDialog.js +94 -0
- package/dist/components/AlertDialog/AlertDialog.styles.d.ts +8 -0
- package/dist/components/AlertDialog/AlertDialog.styles.d.ts.map +1 -0
- package/dist/components/AlertDialog/AlertDialog.styles.js +25 -0
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +16 -0
- package/dist/components/AlertDialog/AlertDialog.types.d.ts.map +1 -0
- package/dist/components/AlertDialog/index.d.ts +4 -0
- package/dist/components/AlertDialog/index.d.ts.map +1 -0
- package/dist/components/Avatar/Avatar.styles.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +2 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.js +8 -6
- package/dist/components/Dialog/Dialog.styles.d.ts +1 -0
- package/dist/components/Dialog/Dialog.styles.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.styles.js +7 -4
- package/dist/components/Dialog/Dialog.types.d.ts +4 -6
- package/dist/components/Dialog/Dialog.types.d.ts.map +1 -1
- package/dist/components/Drawer/Drawer.types.d.ts +3 -6
- package/dist/components/Drawer/Drawer.types.d.ts.map +1 -1
- package/dist/components/Dropdown/Dropdown.types.d.ts +1 -2
- package/dist/components/Dropdown/Dropdown.types.d.ts.map +1 -1
- package/dist/components/FormField/FormField.js +3 -3
- package/dist/components/ImageUpload/ImageUpload.d.ts +4 -0
- package/dist/components/ImageUpload/ImageUpload.d.ts.map +1 -0
- package/dist/components/ImageUpload/ImageUpload.helpers.d.ts +30 -0
- package/dist/components/ImageUpload/ImageUpload.helpers.d.ts.map +1 -0
- package/dist/components/ImageUpload/ImageUpload.helpers.js +95 -0
- package/dist/components/ImageUpload/ImageUpload.js +365 -0
- package/dist/components/ImageUpload/ImageUpload.styles.d.ts +17 -0
- package/dist/components/ImageUpload/ImageUpload.styles.d.ts.map +1 -0
- package/dist/components/ImageUpload/ImageUpload.styles.js +72 -0
- package/dist/components/ImageUpload/ImageUpload.types.d.ts +112 -0
- package/dist/components/ImageUpload/ImageUpload.types.d.ts.map +1 -0
- package/dist/components/ImageUpload/index.d.ts +6 -0
- package/dist/components/ImageUpload/index.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.d.ts +25 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadDropzone.js +106 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadIcons.d.ts +6 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadIcons.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadIcons.js +61 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadModal.d.ts +12 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadModal.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadModal.js +137 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadSinglePreview.d.ts +14 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadSinglePreview.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadSinglePreview.js +142 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.d.ts +23 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.d.ts.map +1 -0
- package/dist/components/ImageUpload/subcomponents/ImageUploadThumbnailCard.js +139 -0
- package/dist/components/ImageUpload/subcomponents/index.d.ts +6 -0
- package/dist/components/ImageUpload/subcomponents/index.d.ts.map +1 -0
- package/dist/components/Input/Input.js +3 -3
- package/dist/components/List/List.types.d.ts +2 -4
- package/dist/components/List/List.types.d.ts.map +1 -1
- package/dist/components/NavHeader/NavHeader.context.d.ts +20 -0
- package/dist/components/NavHeader/NavHeader.context.d.ts.map +1 -0
- package/dist/components/NavHeader/NavHeader.context.js +13 -0
- package/dist/components/NavHeader/NavHeader.d.ts +8 -0
- package/dist/components/NavHeader/NavHeader.d.ts.map +1 -0
- package/dist/components/NavHeader/NavHeader.helpers.d.ts +13 -0
- package/dist/components/NavHeader/NavHeader.helpers.d.ts.map +1 -0
- package/dist/components/NavHeader/NavHeader.helpers.js +14 -0
- package/dist/components/NavHeader/NavHeader.js +532 -0
- package/dist/components/NavHeader/NavHeader.styles.d.ts +67 -0
- package/dist/components/NavHeader/NavHeader.styles.d.ts.map +1 -0
- package/dist/components/NavHeader/NavHeader.styles.js +123 -0
- package/dist/components/NavHeader/NavHeader.types.d.ts +321 -0
- package/dist/components/NavHeader/NavHeader.types.d.ts.map +1 -0
- package/dist/components/NavHeader/index.d.ts +11 -0
- package/dist/components/NavHeader/index.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.d.ts +13 -0
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavActionOverflow.js +169 -0
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts +22 -0
- package/dist/components/NavHeader/subcomponents/NavActions.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavActions.js +228 -0
- package/dist/components/NavHeader/subcomponents/NavBrand.d.ts +12 -0
- package/dist/components/NavHeader/subcomponents/NavBrand.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavBrand.js +96 -0
- package/dist/components/NavHeader/subcomponents/NavItems.d.ts +15 -0
- package/dist/components/NavHeader/subcomponents/NavItems.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavItems.js +141 -0
- package/dist/components/NavHeader/subcomponents/NavItemsOverflow.d.ts +13 -0
- package/dist/components/NavHeader/subcomponents/NavItemsOverflow.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavItemsOverflow.js +165 -0
- package/dist/components/NavHeader/subcomponents/NavMegaMenu.d.ts +12 -0
- package/dist/components/NavHeader/subcomponents/NavMegaMenu.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavMegaMenu.js +73 -0
- package/dist/components/NavHeader/subcomponents/NavMobileSearchDrawer.d.ts +16 -0
- package/dist/components/NavHeader/subcomponents/NavMobileSearchDrawer.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavMobileSearchDrawer.js +149 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabContent.d.ts +11 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabContent.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabContent.js +40 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabSlider.d.ts +13 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabSlider.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavMobileTabSlider.js +111 -0
- package/dist/components/NavHeader/subcomponents/NavSearch.d.ts +15 -0
- package/dist/components/NavHeader/subcomponents/NavSearch.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/NavSearch.js +222 -0
- package/dist/components/NavHeader/subcomponents/OfferBanner.d.ts +11 -0
- package/dist/components/NavHeader/subcomponents/OfferBanner.d.ts.map +1 -0
- package/dist/components/NavHeader/subcomponents/OfferBanner.js +92 -0
- package/dist/components/Popover/Popover.types.d.ts +1 -2
- package/dist/components/Popover/Popover.types.d.ts.map +1 -1
- package/dist/components/Radio/Radio.js +3 -3
- package/dist/components/Select/Select.js +3 -3
- package/dist/components/Stat/Stat.types.d.ts +3 -6
- package/dist/components/Stat/Stat.types.d.ts.map +1 -1
- package/dist/components/Table/Table.types.d.ts +7 -14
- package/dist/components/Table/Table.types.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.js +3 -3
- package/dist/components/Toast/Toast.js +1 -1
- package/dist/components/Toast/Toast.types.d.ts +1 -2
- package/dist/components/Toast/Toast.types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -2
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,kBAAkB,MAAM,2BAA2B,CAAC;AAShE,OAAO,KAAK,EAGV,qBAAqB,EACtB,MAAM,mBAAmB,CAAC;AAE3B,eAAO,MAAM,SAAS,8JAA0B,CAAC;AAEjD,eAAO,MAAM,aAAa,iKASxB,CAAC;AAGH,eAAO,MAAM,gBAAgB,0KAc3B,CAAC;AAGH,eAAO,MAAM,gBAAgB,8FAoB3B,CAAC"}
|
|
@@ -23,8 +23,6 @@ export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
23
23
|
*/
|
|
24
24
|
motion?: MotionProp;
|
|
25
25
|
}
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
export interface AlertDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {
|
|
29
|
-
}
|
|
26
|
+
export type AlertTitleProps = React.HTMLAttributes<HTMLHeadingElement>;
|
|
27
|
+
export type AlertDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;
|
|
30
28
|
//# sourceMappingURL=Alert.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,aAAa;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,
|
|
1
|
+
{"version":3,"file":"Alert.types.d.ts","sourceRoot":"","sources":["../../../src/components/Alert/Alert.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,CAAC,EACzD,aAAa;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
+
import type { AlertDialogProps, AlertDialogContentProps, AlertDialogHeaderProps, AlertDialogBodyProps, AlertDialogFooterProps } from './AlertDialog.types';
|
|
4
|
+
export declare const AlertDialog: React.FC<AlertDialogProps>;
|
|
5
|
+
export declare const AlertDialogTrigger: React.ForwardRefExoticComponent<AlertDialogPrimitive.AlertDialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortalProps>;
|
|
7
|
+
export declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare const AlertDialogContent: React.ForwardRefExoticComponent<AlertDialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const AlertDialogHeader: React.FC<AlertDialogHeaderProps>;
|
|
10
|
+
export declare const AlertDialogBody: React.FC<AlertDialogBodyProps>;
|
|
11
|
+
export declare const AlertDialogFooter: React.FC<AlertDialogFooterProps>;
|
|
12
|
+
export declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
|
+
export declare const AlertDialogDescription: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
14
|
+
export declare const AlertDialogAction: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogActionProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
15
|
+
export declare const AlertDialogCancel: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogCancelProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
16
|
+
//# sourceMappingURL=AlertDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAarE,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EAGvB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAA6B,CAAC;AACjF,eAAO,MAAM,kBAAkB,wHAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,uDAA8B,CAAC;AAE7D,eAAO,MAAM,kBAAkB,wKAU7B,CAAC;AAGH,eAAO,MAAM,kBAAkB,gGA4B7B,CAAC;AAGH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAE9D,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAE1D,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAE9D,CAAC;AAGF,eAAO,MAAM,gBAAgB,8KAU3B,CAAC;AAGH,eAAO,MAAM,sBAAsB,wLAUjC,CAAC;AAGH,eAAO,MAAM,iBAAiB,6KAU5B,CAAC;AAGH,eAAO,MAAM,iBAAiB,6KAU5B,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
5
|
+
import { cn } from '@timmbr/utils';
|
|
6
|
+
import { resolveMotion } from '../../types/motion.js';
|
|
7
|
+
import { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogOverlayVariants, alertDialogTitleVariants } from './AlertDialog.styles.js';
|
|
8
|
+
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
9
|
+
|
|
10
|
+
const AlertDialog = AlertDialogPrimitive.Root;
|
|
11
|
+
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
|
|
12
|
+
const AlertDialogPortal = AlertDialogPrimitive.Portal;
|
|
13
|
+
const AlertDialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
14
|
+
AlertDialogPrimitive.Overlay,
|
|
15
|
+
{
|
|
16
|
+
ref,
|
|
17
|
+
"data-slot": "alert-dialog-overlay",
|
|
18
|
+
className: cn(alertDialogOverlayVariants(), className),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
));
|
|
22
|
+
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
23
|
+
const AlertDialogContent = React.forwardRef(({ className, children, motion, ...props }, ref) => {
|
|
24
|
+
const globalMotion = useGlobalAnimation();
|
|
25
|
+
const { shouldAnimate, motionClass } = resolveMotion(motion, globalMotion);
|
|
26
|
+
return /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
|
|
27
|
+
/* @__PURE__ */ jsx(AlertDialogOverlay, {}),
|
|
28
|
+
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none", children: /* @__PURE__ */ jsx(
|
|
29
|
+
AlertDialogPrimitive.Content,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
"data-slot": "alert-dialog-content",
|
|
33
|
+
role: "alertdialog",
|
|
34
|
+
className: cn(
|
|
35
|
+
alertDialogContentVariants(),
|
|
36
|
+
!shouldAnimate && "transition-none animate-none",
|
|
37
|
+
motionClass,
|
|
38
|
+
className
|
|
39
|
+
),
|
|
40
|
+
...props,
|
|
41
|
+
children
|
|
42
|
+
}
|
|
43
|
+
) })
|
|
44
|
+
] });
|
|
45
|
+
});
|
|
46
|
+
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
47
|
+
const AlertDialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-header", className: cn(alertDialogHeaderVariants(), className), ...props });
|
|
48
|
+
AlertDialogHeader.displayName = "AlertDialogHeader";
|
|
49
|
+
const AlertDialogBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-body", className: cn(alertDialogBodyVariants(), className), ...props });
|
|
50
|
+
AlertDialogBody.displayName = "AlertDialogBody";
|
|
51
|
+
const AlertDialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "alert-dialog-footer", className: cn(alertDialogFooterVariants(), className), ...props });
|
|
52
|
+
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
53
|
+
const AlertDialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
54
|
+
AlertDialogPrimitive.Title,
|
|
55
|
+
{
|
|
56
|
+
ref,
|
|
57
|
+
"data-slot": "alert-dialog-title",
|
|
58
|
+
className: cn(alertDialogTitleVariants(), className),
|
|
59
|
+
...props
|
|
60
|
+
}
|
|
61
|
+
));
|
|
62
|
+
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
|
|
63
|
+
const AlertDialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
64
|
+
AlertDialogPrimitive.Description,
|
|
65
|
+
{
|
|
66
|
+
ref,
|
|
67
|
+
"data-slot": "alert-dialog-description",
|
|
68
|
+
className: cn(alertDialogDescriptionVariants(), className),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
));
|
|
72
|
+
AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
|
|
73
|
+
const AlertDialogAction = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
74
|
+
AlertDialogPrimitive.Action,
|
|
75
|
+
{
|
|
76
|
+
ref,
|
|
77
|
+
"data-slot": "alert-dialog-action",
|
|
78
|
+
className: cn(className),
|
|
79
|
+
...props
|
|
80
|
+
}
|
|
81
|
+
));
|
|
82
|
+
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
|
|
83
|
+
const AlertDialogCancel = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
84
|
+
AlertDialogPrimitive.Cancel,
|
|
85
|
+
{
|
|
86
|
+
ref,
|
|
87
|
+
"data-slot": "alert-dialog-cancel",
|
|
88
|
+
className: cn(className),
|
|
89
|
+
...props
|
|
90
|
+
}
|
|
91
|
+
));
|
|
92
|
+
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
|
|
93
|
+
|
|
94
|
+
export { AlertDialog, AlertDialogAction, AlertDialogBody, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const alertDialogOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
|
+
export declare const alertDialogContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
|
+
export declare const alertDialogHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const alertDialogBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
|
+
export declare const alertDialogFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
|
+
export declare const alertDialogTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
7
|
+
export declare const alertDialogDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
8
|
+
//# sourceMappingURL=AlertDialog.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,0BAA0B,oFAEtC,CAAC;AAEF,eAAO,MAAM,0BAA0B,oFAEtC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAErC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oFAEnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAErC,CAAC;AAEF,eAAO,MAAM,wBAAwB,oFAEpC,CAAC;AAEF,eAAO,MAAM,8BAA8B,oFAE1C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { cva } from 'class-variance-authority';
|
|
2
|
+
|
|
3
|
+
const alertDialogOverlayVariants = cva(
|
|
4
|
+
"fixed inset-0 z-50 bg-black/60 backdrop-blur-xs transition-opacity duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
|
|
5
|
+
);
|
|
6
|
+
const alertDialogContentVariants = cva(
|
|
7
|
+
"relative pointer-events-auto flex flex-col w-full max-w-lg rounded-xl border border-grey-200 dark:border-grey-800 bg-white dark:bg-grey-900 shadow-xl font-sans text-foreground overflow-hidden p-6 gap-4 data-[state=open]:animate-dialog-scale-in data-[state=closed]:animate-dialog-scale-out"
|
|
8
|
+
);
|
|
9
|
+
const alertDialogHeaderVariants = cva(
|
|
10
|
+
"flex flex-col space-y-1.5 text-left"
|
|
11
|
+
);
|
|
12
|
+
const alertDialogBodyVariants = cva(
|
|
13
|
+
"flex flex-col space-y-3 min-h-0"
|
|
14
|
+
);
|
|
15
|
+
const alertDialogFooterVariants = cva(
|
|
16
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end gap-2.5 pt-2"
|
|
17
|
+
);
|
|
18
|
+
const alertDialogTitleVariants = cva(
|
|
19
|
+
"text-lg font-display font-semibold leading-none tracking-tight text-foreground"
|
|
20
|
+
);
|
|
21
|
+
const alertDialogDescriptionVariants = cva(
|
|
22
|
+
"text-sm text-muted-foreground font-sans leading-relaxed"
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export { alertDialogBodyVariants, alertDialogContentVariants, alertDialogDescriptionVariants, alertDialogFooterVariants, alertDialogHeaderVariants, alertDialogOverlayVariants, alertDialogTitleVariants };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
|
|
3
|
+
import type { MotionProp } from '../../types/motion';
|
|
4
|
+
export type AlertDialogProps = AlertDialogPrimitive.AlertDialogProps;
|
|
5
|
+
export interface AlertDialogContentProps extends React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content> {
|
|
6
|
+
/**
|
|
7
|
+
* Motion transition control.
|
|
8
|
+
*/
|
|
9
|
+
motion?: MotionProp;
|
|
10
|
+
}
|
|
11
|
+
export type AlertDialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
12
|
+
export type AlertDialogBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
export type AlertDialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
14
|
+
export type AlertDialogActionProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>;
|
|
15
|
+
export type AlertDialogCancelProps = React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>;
|
|
16
|
+
//# sourceMappingURL=AlertDialog.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertDialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/AlertDialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,oBAAoB,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,gBAAgB,CAAC;AAErE,MAAM,WAAW,uBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,OAAO,CAAC;IAC3E;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAC1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACxE,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AAE1E,MAAM,MAAM,sBAAsB,GAChC,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAChC,KAAK,CAAC,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AlertDialog/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare const avatarRootVariants: (props?: ({
|
|
|
4
4
|
variant?: "grey" | "outline" | "subtle" | "primary" | "secondary" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export declare const avatarStatusVariants: (props?: ({
|
|
7
|
-
status?: "
|
|
7
|
+
status?: "offline" | "online" | "busy" | "away" | null | undefined;
|
|
8
8
|
size?: "sm" | "lg" | "md" | "xl" | "2xl" | "xs" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
export type AvatarVariants = VariantProps<typeof avatarRootVariants>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
-
import type { DialogProps, DialogContentProps, DialogHeaderProps, DialogFooterProps } from './Dialog.types';
|
|
3
|
+
import type { DialogProps, DialogContentProps, DialogHeaderProps, DialogBodyProps, DialogFooterProps } from './Dialog.types';
|
|
4
4
|
export declare const Dialog: React.FC<DialogProps>;
|
|
5
5
|
export declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
export declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
@@ -8,6 +8,7 @@ export declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitiv
|
|
|
8
8
|
export declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export declare const DialogHeader: React.FC<DialogHeaderProps>;
|
|
11
|
+
export declare const DialogBody: React.FC<DialogBodyProps>;
|
|
11
12
|
export declare const DialogFooter: React.FC<DialogFooterProps>;
|
|
12
13
|
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
13
14
|
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAc1D,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AAExB,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAAwB,CAAC;AAClE,eAAO,MAAM,aAAa,8GAA0B,CAAC;AACrD,eAAO,MAAM,YAAY,6CAAyB,CAAC;AACnD,eAAO,MAAM,WAAW,4GAAwB,CAAC;AAEjD,eAAO,MAAM,aAAa,8JAUxB,CAAC;AAGH,eAAO,MAAM,aAAa,2FAkCxB,CAAC;AAGH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAEhD,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAEpD,CAAC;AAGF,eAAO,MAAM,WAAW,oKAUtB,CAAC;AAGH,eAAO,MAAM,iBAAiB,8KAU5B,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
5
5
|
import { cn } from '@timmbr/utils';
|
|
6
6
|
import { X } from '@timmbr/icons';
|
|
7
7
|
import { resolveMotion } from '../../types/motion.js';
|
|
8
|
-
import { dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants } from './Dialog.styles.js';
|
|
8
|
+
import { dialogBodyVariants, dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants } from './Dialog.styles.js';
|
|
9
9
|
import { useGlobalAnimation } from '../../providers/AnimationProvider.js';
|
|
10
10
|
|
|
11
11
|
const Dialog = DialogPrimitive.Root;
|
|
@@ -45,7 +45,7 @@ const DialogContent = React.forwardRef(({ className, children, motion, ...props
|
|
|
45
45
|
DialogPrimitive.Close,
|
|
46
46
|
{
|
|
47
47
|
"data-slot": "dialog-close",
|
|
48
|
-
className: "absolute right-4 top-4 rounded-sm p-1 text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-primary cursor-pointer",
|
|
48
|
+
className: "absolute right-4 top-4 z-20 rounded-sm p-1 text-muted hover:text-foreground opacity-70 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-primary cursor-pointer",
|
|
49
49
|
children: [
|
|
50
50
|
/* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
|
|
51
51
|
/* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
|
|
@@ -58,9 +58,11 @@ const DialogContent = React.forwardRef(({ className, children, motion, ...props
|
|
|
58
58
|
] });
|
|
59
59
|
});
|
|
60
60
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
61
|
-
const DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: cn(dialogHeaderVariants(), className), ...props });
|
|
61
|
+
const DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-header", className: cn(dialogHeaderVariants(), className), ...props });
|
|
62
62
|
DialogHeader.displayName = "DialogHeader";
|
|
63
|
-
const
|
|
63
|
+
const DialogBody = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-body", className: cn(dialogBodyVariants(), className), ...props });
|
|
64
|
+
DialogBody.displayName = "DialogBody";
|
|
65
|
+
const DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx("div", { "data-slot": "dialog-footer", className: cn(dialogFooterVariants(), className), ...props });
|
|
64
66
|
DialogFooter.displayName = "DialogFooter";
|
|
65
67
|
const DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
66
68
|
DialogPrimitive.Title,
|
|
@@ -83,4 +85,4 @@ const DialogDescription = React.forwardRef(({ className, ...props }, ref) => /*
|
|
|
83
85
|
));
|
|
84
86
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
85
87
|
|
|
86
|
-
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
88
|
+
export { Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const dialogOverlayVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
2
2
|
export declare const dialogContentVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
3
3
|
export declare const dialogHeaderVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
|
+
export declare const dialogBodyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
4
5
|
export declare const dialogFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
5
6
|
export declare const dialogTitleVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
6
7
|
export declare const dialogDescriptionVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oFAE/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAErC,CAAC"}
|
|
1
|
+
{"version":3,"file":"Dialog.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,oFAEjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,oFAE9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,oFAEhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,oFAE/B,CAAC;AAEF,eAAO,MAAM,yBAAyB,oFAErC,CAAC"}
|
|
@@ -4,13 +4,16 @@ const dialogOverlayVariants = cva(
|
|
|
4
4
|
"fixed inset-0 z-50 bg-black/60 backdrop-blur-xs transition-opacity duration-200 data-[state=open]:animate-fade-in data-[state=closed]:animate-fade-out"
|
|
5
5
|
);
|
|
6
6
|
const dialogContentVariants = cva(
|
|
7
|
-
"relative pointer-events-auto
|
|
7
|
+
"relative pointer-events-auto flex flex-col w-full max-w-lg max-h-[calc(100vh-2rem)] sm:max-h-[calc(100vh-4rem)] rounded-xl border border-grey-200 dark:border-grey-800 bg-white dark:bg-grey-900 shadow-xl font-sans text-foreground overflow-hidden data-[state=open]:animate-dialog-scale-in data-[state=closed]:animate-dialog-scale-out"
|
|
8
8
|
);
|
|
9
9
|
const dialogHeaderVariants = cva(
|
|
10
|
-
"flex flex-col space-y-1.5 text-left"
|
|
10
|
+
"flex flex-col space-y-1.5 text-left p-6 pb-4 border-b border-grey-100 dark:border-grey-800/60 shrink-0 bg-white dark:bg-grey-900 pr-12"
|
|
11
|
+
);
|
|
12
|
+
const dialogBodyVariants = cva(
|
|
13
|
+
"flex-1 overflow-y-auto p-6 min-h-0"
|
|
11
14
|
);
|
|
12
15
|
const dialogFooterVariants = cva(
|
|
13
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-2
|
|
16
|
+
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 gap-2 p-6 pt-4 border-t border-grey-100 dark:border-grey-800/60 shrink-0 bg-white dark:bg-grey-900"
|
|
14
17
|
);
|
|
15
18
|
const dialogTitleVariants = cva(
|
|
16
19
|
"text-xl font-display font-semibold leading-none tracking-tight text-foreground"
|
|
@@ -19,4 +22,4 @@ const dialogDescriptionVariants = cva(
|
|
|
19
22
|
"text-sm text-muted-foreground font-sans leading-relaxed"
|
|
20
23
|
);
|
|
21
24
|
|
|
22
|
-
export { dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants };
|
|
25
|
+
export { dialogBodyVariants, dialogContentVariants, dialogDescriptionVariants, dialogFooterVariants, dialogHeaderVariants, dialogOverlayVariants, dialogTitleVariants };
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
import type { MotionProp } from '../../types/motion';
|
|
4
|
-
export
|
|
5
|
-
}
|
|
4
|
+
export type DialogProps = DialogPrimitive.DialogProps;
|
|
6
5
|
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
7
6
|
/**
|
|
8
7
|
* Motion transition control.
|
|
9
8
|
*/
|
|
10
9
|
motion?: MotionProp;
|
|
11
10
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
}
|
|
11
|
+
export type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
12
|
+
export type DialogBodyProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
export type DialogFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
16
14
|
//# sourceMappingURL=Dialog.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Dialog.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dialog/Dialog.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC;IACtE;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -2,16 +2,13 @@ import type * as React from 'react';
|
|
|
2
2
|
import type * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
3
|
import type { DrawerContentVariants } from './Drawer.styles';
|
|
4
4
|
import type { MotionProp } from '../../types/motion';
|
|
5
|
-
export
|
|
6
|
-
}
|
|
5
|
+
export type DrawerProps = DialogPrimitive.DialogProps;
|
|
7
6
|
export interface DrawerContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, DrawerContentVariants {
|
|
8
7
|
/**
|
|
9
8
|
* Motion transition control.
|
|
10
9
|
*/
|
|
11
10
|
motion?: MotionProp;
|
|
12
11
|
}
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
export interface DrawerFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
16
|
-
}
|
|
12
|
+
export type DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;
|
|
13
|
+
export type DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;
|
|
17
14
|
//# sourceMappingURL=Drawer.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Drawer.types.d.ts","sourceRoot":"","sources":["../../../src/components/Drawer/Drawer.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,WAAW,CAAC;AAEtD,MAAM,WAAW,kBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,EACpE,qBAAqB;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type * as React from 'react';
|
|
2
2
|
import type * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
import type { MotionProp } from '../../types/motion';
|
|
4
|
-
export
|
|
5
|
-
}
|
|
4
|
+
export type DropdownMenuProps = DropdownMenuPrimitive.DropdownMenuProps;
|
|
6
5
|
export interface DropdownMenuContentProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {
|
|
7
6
|
/**
|
|
8
7
|
* Motion transition control.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,
|
|
1
|
+
{"version":3,"file":"Dropdown.types.d.ts","sourceRoot":"","sources":["../../../src/components/Dropdown/Dropdown.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,iBAAiB,CAAC;AAExE,MAAM,WAAW,wBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC;IAC5E;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,WAAW,qBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -39,12 +39,12 @@ const FormField = React.forwardRef(
|
|
|
39
39
|
{
|
|
40
40
|
id: `${id}-desc`,
|
|
41
41
|
className: cn(
|
|
42
|
-
"text-xs mt-
|
|
42
|
+
"text-xs mt-1 flex items-center gap-1.5",
|
|
43
43
|
isError ? "text-destructive font-medium" : "text-muted"
|
|
44
44
|
),
|
|
45
45
|
children: [
|
|
46
|
-
isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0
|
|
47
|
-
/* @__PURE__ */ jsx("span", { className: "leading-
|
|
46
|
+
isError ? /* @__PURE__ */ jsx(AlertCircle, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Info, { className: "w-3.5 h-3.5 shrink-0", "aria-hidden": "true" }),
|
|
47
|
+
/* @__PURE__ */ jsx("span", { className: "leading-normal", children: errorMessage || helperText })
|
|
48
48
|
]
|
|
49
49
|
}
|
|
50
50
|
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUpload.d.ts","sourceRoot":"","sources":["../../../src/components/ImageUpload/ImageUpload.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwB/B,OAAO,KAAK,EACV,gBAAgB,EAEjB,MAAM,qBAAqB,CAAC;AAS7B,eAAO,MAAM,WAAW,yFAoZvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ImageUploadItem, ImageUploadValue } from './ImageUpload.types';
|
|
2
|
+
export declare const DEFAULT_IMAGE_ACCEPT = "image/png, image/jpeg, image/webp, image/gif";
|
|
3
|
+
export declare const DEFAULT_VIDEO_ACCEPT = "video/mp4, video/webm, video/quicktime, video/ogg";
|
|
4
|
+
export declare const DEFAULT_ALL_ACCEPT = "image/png, image/jpeg, image/webp, image/gif, video/mp4, video/webm, video/quicktime, video/ogg";
|
|
5
|
+
export declare const DEFAULT_IMAGE_MAX_SIZE: number;
|
|
6
|
+
export declare const DEFAULT_VIDEO_MAX_SIZE: number;
|
|
7
|
+
export declare const VIDEO_EXTENSIONS: RegExp;
|
|
8
|
+
export declare const GRID_COLS_MAP: Record<number, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Checks whether an item, URL, or filename corresponds to a video file.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isVideoMedia(item?: ImageUploadItem | string | null): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Normalizes single or array value props into an array of ImageUploadItem.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeUploadItems(value?: ImageUploadValue | ImageUploadValue[] | null): ImageUploadItem[];
|
|
17
|
+
/**
|
|
18
|
+
* Validates files against acceptance criteria (MIME/ext, max files, and size).
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateUploadFiles({ files, accept, maxSizeBytes, maxFiles, currentCount, }: {
|
|
21
|
+
files: File[];
|
|
22
|
+
accept: string;
|
|
23
|
+
maxSizeBytes: number;
|
|
24
|
+
maxFiles?: number;
|
|
25
|
+
currentCount: number;
|
|
26
|
+
}): {
|
|
27
|
+
validFiles: File[];
|
|
28
|
+
errorMessage: string | null;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ImageUpload.helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageUpload.helpers.d.ts","sourceRoot":"","sources":["../../../src/components/ImageUpload/ImageUpload.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,qBAAqB,CAAC;AAE7B,eAAO,MAAM,oBAAoB,iDAAiD,CAAC;AACnF,eAAO,MAAM,oBAAoB,sDAAsD,CAAC;AACxF,eAAO,MAAM,kBAAkB,oGAAqD,CAAC;AAErF,eAAO,MAAM,sBAAsB,QAAkB,CAAC;AACtD,eAAO,MAAM,sBAAsB,QAAmB,CAAC;AAEvD,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AAEzE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAKhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAS5E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,GAAG,IAAI,GACnD,eAAe,EAAE,CAenB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,MAAM,EACN,YAAY,EACZ,QAAQ,EACR,YAAY,GACb,EAAE;IACD,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB,GAAG;IAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CA0DtD"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const DEFAULT_IMAGE_ACCEPT = "image/png, image/jpeg, image/webp, image/gif";
|
|
2
|
+
const DEFAULT_VIDEO_ACCEPT = "video/mp4, video/webm, video/quicktime, video/ogg";
|
|
3
|
+
const DEFAULT_ALL_ACCEPT = `${DEFAULT_IMAGE_ACCEPT}, ${DEFAULT_VIDEO_ACCEPT}`;
|
|
4
|
+
const DEFAULT_IMAGE_MAX_SIZE = 5 * 1024 * 1024;
|
|
5
|
+
const DEFAULT_VIDEO_MAX_SIZE = 50 * 1024 * 1024;
|
|
6
|
+
const VIDEO_EXTENSIONS = /\.(mp4|webm|mov|m4v|ogg|ogv|avi|mkv)$/i;
|
|
7
|
+
const GRID_COLS_MAP = {
|
|
8
|
+
2: "grid-cols-2",
|
|
9
|
+
3: "grid-cols-2 sm:grid-cols-3",
|
|
10
|
+
4: "grid-cols-2 sm:grid-cols-3 md:grid-cols-4",
|
|
11
|
+
5: "grid-cols-2 sm:grid-cols-3 md:grid-cols-5"
|
|
12
|
+
};
|
|
13
|
+
function isVideoMedia(item) {
|
|
14
|
+
if (!item) return false;
|
|
15
|
+
if (typeof item === "string") {
|
|
16
|
+
return VIDEO_EXTENSIONS.test(item) || item.startsWith("data:video/");
|
|
17
|
+
}
|
|
18
|
+
if (item.type === "video" || item.type && item.type.startsWith("video/")) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
return VIDEO_EXTENSIONS.test(item.url || "") || VIDEO_EXTENSIONS.test(item.name || "");
|
|
22
|
+
}
|
|
23
|
+
function normalizeUploadItems(value) {
|
|
24
|
+
if (!value) return [];
|
|
25
|
+
const rawArray = Array.isArray(value) ? value : [value];
|
|
26
|
+
return rawArray.map((v) => {
|
|
27
|
+
if (typeof v === "string") {
|
|
28
|
+
return {
|
|
29
|
+
url: v,
|
|
30
|
+
type: isVideoMedia(v) ? "video" : "image"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
...v,
|
|
35
|
+
type: v.type || (isVideoMedia(v) ? "video" : "image")
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function validateUploadFiles({
|
|
40
|
+
files,
|
|
41
|
+
accept,
|
|
42
|
+
maxSizeBytes,
|
|
43
|
+
maxFiles,
|
|
44
|
+
currentCount
|
|
45
|
+
}) {
|
|
46
|
+
if (files.length === 0) {
|
|
47
|
+
return { validFiles: [], errorMessage: null };
|
|
48
|
+
}
|
|
49
|
+
if (maxFiles) {
|
|
50
|
+
const availableSlots = Math.max(0, maxFiles - currentCount);
|
|
51
|
+
if (availableSlots <= 0) {
|
|
52
|
+
return {
|
|
53
|
+
validFiles: [],
|
|
54
|
+
errorMessage: `Maximum limit of ${maxFiles} item${maxFiles > 1 ? "s" : ""} already reached.`
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (files.length > availableSlots) {
|
|
58
|
+
return {
|
|
59
|
+
validFiles: [],
|
|
60
|
+
errorMessage: `You can only upload up to ${maxFiles} items. Selected ${files.length} files (${availableSlots} slot${availableSlots > 1 ? "s" : ""} available).`
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const acceptedTypes = accept.split(",").map((t) => t.trim().toLowerCase());
|
|
65
|
+
const validFiles = [];
|
|
66
|
+
for (const file of files) {
|
|
67
|
+
const fileExt = `.${file.name.split(".").pop()?.toLowerCase()}`;
|
|
68
|
+
const isValidType = acceptedTypes.some((type) => {
|
|
69
|
+
if (type.startsWith(".")) {
|
|
70
|
+
return fileExt === type;
|
|
71
|
+
}
|
|
72
|
+
if (type.endsWith("/*")) {
|
|
73
|
+
return file.type.startsWith(type.replace("/*", ""));
|
|
74
|
+
}
|
|
75
|
+
return file.type.toLowerCase() === type;
|
|
76
|
+
});
|
|
77
|
+
if (!isValidType) {
|
|
78
|
+
return {
|
|
79
|
+
validFiles: [],
|
|
80
|
+
errorMessage: `File "${file.name}" has an unsupported format. Accepted: ${accept}.`
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (file.size > maxSizeBytes) {
|
|
84
|
+
const maxMb = Math.round(maxSizeBytes / (1024 * 1024));
|
|
85
|
+
return {
|
|
86
|
+
validFiles: [],
|
|
87
|
+
errorMessage: `File "${file.name}" exceeds the ${maxMb}MB size limit.`
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
validFiles.push(file);
|
|
91
|
+
}
|
|
92
|
+
return { validFiles, errorMessage: null };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export { DEFAULT_ALL_ACCEPT, DEFAULT_IMAGE_ACCEPT, DEFAULT_IMAGE_MAX_SIZE, DEFAULT_VIDEO_ACCEPT, DEFAULT_VIDEO_MAX_SIZE, GRID_COLS_MAP, VIDEO_EXTENSIONS, isVideoMedia, normalizeUploadItems, validateUploadFiles };
|