luan-ui 0.6.1 → 0.7.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.
Files changed (35) hide show
  1. package/dist/components/accordion/accordion.d.ts +1 -1
  2. package/dist/components/alert/alert.d.ts +1 -1
  3. package/dist/components/alert/alert.js.map +1 -1
  4. package/dist/components/alert-dialog/alert-dialog.d.ts +1 -1
  5. package/dist/components/alert-dialog/alert-dialog.js +1 -1
  6. package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
  7. package/dist/components/drawer/drawer.d.ts +16 -13
  8. package/dist/components/drawer/drawer.js +15 -34
  9. package/dist/components/drawer/drawer.js.map +1 -1
  10. package/dist/components/dropdown-menu/dropdown-menu.d.ts +2 -2
  11. package/dist/components/dropdown-menu/dropdown-menu.js +1 -1
  12. package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
  13. package/dist/components/pagination/pagination.d.ts +1 -1
  14. package/dist/components/pagination/pagination.js +1 -1
  15. package/dist/components/pagination/pagination.js.map +1 -1
  16. package/dist/components/popover/popover.d.ts +1 -1
  17. package/dist/components/popover/popover.js +1 -1
  18. package/dist/components/popover/popover.js.map +1 -1
  19. package/dist/components/select/select.d.ts +1 -1
  20. package/dist/components/select/select.js +1 -1
  21. package/dist/components/select/select.js.map +1 -1
  22. package/dist/components/table/table.d.ts +1 -1
  23. package/dist/components/table/table.js +1 -1
  24. package/dist/components/table/table.js.map +1 -1
  25. package/dist/components/tabs/tabs.d.ts +1 -1
  26. package/dist/components/tabs/tabs.js +1 -1
  27. package/dist/components/tabs/tabs.js.map +1 -1
  28. package/dist/components/toast/toast.d.ts +1 -1
  29. package/dist/components/toast/toast.js +1 -1
  30. package/dist/components/toast/toast.js.map +1 -1
  31. package/dist/components/tooltip/tooltip.d.ts +1 -1
  32. package/dist/components/tooltip/tooltip.js +1 -1
  33. package/dist/components/tooltip/tooltip.js.map +1 -1
  34. package/dist/utilities/responsive/responsive.d.ts +6 -33
  35. package/package.json +20 -20
@@ -23,7 +23,7 @@ import type { ComponentProps } from "react";
23
23
  * @returns {React.ReactNode} The rendered accordion component
24
24
  */
25
25
  export type AccordionProps = ComponentProps<typeof BaseAccordion.Root>;
26
- declare const Accordion: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").AccordionRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
26
+ declare const Accordion: <Value = any>(props: BaseAccordion.Root.Props<Value>) => React.JSX.Element;
27
27
  export type AccordionItemProps = ComponentProps<typeof BaseAccordion.Item>;
28
28
  declare function AccordionItem({ className, ref, ...props }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
29
29
  export type AccordionTriggerProps = ComponentProps<typeof BaseAccordion.Trigger>;
@@ -77,4 +77,4 @@ declare function AlertDescription({ className, render, ...props }: AlertDescript
77
77
  declare namespace AlertDescription {
78
78
  var displayName: string;
79
79
  }
80
- export { Alert, AlertDescription, AlertTitle, type AlertDescriptionProps, type AlertProps, type AlertTitleProps, };
80
+ export { Alert, AlertDescription, type AlertDescriptionProps, type AlertProps, AlertTitle, type AlertTitleProps, };
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","sourceRoot":"/","sources":["components/alert/alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOlD,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAE5E,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC3E,CAAC;IAC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AAE,EAAE;QACH,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,YAAY;KACpB;IACD,EAAE,EAAE;QACH,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,YAAY;KACpB;IACD,EAAE,EAAE;QACH,KAAK,EAAE,YAAY;QACnB,MAAM,EAAE,YAAY;KACpB;CACD,CAAC;AAEF,SAAS,gBAAgB,CAAC,EACzB,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACe;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,EAAE,CAAC;IAEnC,MAAM,YAAY,GAAkC;QACnD,SAAS,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC3C,CAAC;IAEF,OAAO,SAAS,CAAC;QAChB,cAAc,EAAE,KAAK;QACrB,MAAM;QACN,KAAK,EAAE,UAAU,CAAQ,YAAY,EAAE,KAAK,CAAC;KAC7C,CAAC,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EACN,KAAK,EACL,gBAAgB,EAChB,UAAU,GAIV,CAAC","sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { ResponsiveValue } from \"@utilities/responsive/responsive\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport { createContext, useContext } from \"react\";\n\ntype AlertContextType = {\n\tvariant: \"primary\" | \"secondary\" | \"error\";\n\tsize: ResponsiveValue<\"small\" | \"medium\">;\n};\n\nconst AlertContext = createContext<AlertContextType | undefined>(undefined);\n\nconst useAlertContext = () => {\n\tconst context = useContext(AlertContext);\n\tif (!context) {\n\t\tthrow new Error(\"useAlertContext must be used within an Alert component\");\n\t}\n\treturn context;\n};\n\ntype AlertProps = useRender.ComponentProps<\"div\"> & {\n\tvariant?: \"primary\" | \"secondary\" | \"error\";\n\tsize?: ResponsiveValue<\"small\" | \"medium\">;\n\tclassName?: string;\n};\n\nconst alertStyles = getVariants({\n\tslots: {\n\t\troot: \"grid w-fit grid-cols-[0_1fr] items-start gap-1 rounded-md border border-transparent has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] [&>svg]:translate-y-1\",\n\t\ttitle: \"col-start-2 font-bold\",\n\t\tdescription: \"col-start-2\",\n\t},\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: {\n\t\t\t\troot: \"bg-gray-700 text-white\",\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\troot: \"border-gray-700 text-gray-700\",\n\t\t\t},\n\t\t\terror: {\n\t\t\t\troot: \"bg-red-500 text-white\",\n\t\t\t},\n\t\t},\n\t\tsize: {\n\t\t\tsmall: {\n\t\t\t\troot: \"px-2 py-1 has-[>svg]:gap-x-2\",\n\t\t\t\ttitle: \"text-sm\",\n\t\t\t\tdescription: \"text-xs\",\n\t\t\t},\n\t\t\tmedium: {\n\t\t\t\troot: \"px-3 py-2 has-[>svg]:gap-x-3\",\n\t\t\t\ttitle: \"text-base\",\n\t\t\t\tdescription: \"text-sm\",\n\t\t\t},\n\t\t},\n\t},\n});\n\nconst { root, title, description } = alertStyles();\n\nexport const SIZES = {\n\tsm: {\n\t\tsmall: \"sm:px-2 sm:py-1 sm:has-[>svg]:gap-x-2\",\n\t\tmedium: \"sm:px-3 sm:py-2 sm:has-[>svg]:gap-x-3\",\n\t},\n\tmd: {\n\t\tsmall: \"md:px-2 md:py-1 md:has-[>svg]:gap-x-2\",\n\t\tmedium: \"md:px-3 md:py-2 md:has-[>svg]:gap-x-3\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:px-2 lg:py-1 lg:has-[>svg]:gap-x-2\",\n\t\tmedium: \"lg:px-3 lg:py-2 lg:has-[>svg]:gap-x-3\",\n\t},\n\txl: {\n\t\tsmall: \"xl:px-2 xl:py-1 xl:has-[>svg]:gap-x-2\",\n\t\tmedium: \"xl:px-3 xl:py-2 xl:has-[>svg]:gap-x-3\",\n\t},\n};\n\nfunction Alert({\n\tvariant = \"primary\",\n\tsize = \"medium\",\n\tclassName,\n\trender,\n\tchildren,\n\t...props\n}: AlertProps) {\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: root({ variant, size, className }),\n\t\tchildren: (\n\t\t\t<AlertContext.Provider value={{ variant, size }}>\n\t\t\t\t{children}\n\t\t\t</AlertContext.Provider>\n\t\t),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlert.displayName = \"Alert\";\n\ntype AlertTitleProps = useRender.ComponentProps<\"div\"> & {\n\tclassName?: string;\n};\n\nexport const TITLE_SIZES = {\n\tsm: {\n\t\tsmall: \"sm:text-sm\",\n\t\tmedium: \"sm:text-base\",\n\t},\n\tmd: {\n\t\tsmall: \"md:text-sm\",\n\t\tmedium: \"md:text-base\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:text-sm\",\n\t\tmedium: \"lg:text-base\",\n\t},\n\txl: {\n\t\tsmall: \"xl:text-sm\",\n\t\tmedium: \"xl:text-base\",\n\t},\n};\n\nfunction AlertTitle({ className, render, ...props }: AlertTitleProps) {\n\tconst { size } = useAlertContext();\n\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: title({ size, className }),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlertTitle.displayName = \"AlertTitle\";\n\ntype AlertDescriptionProps = useRender.ComponentProps<\"div\"> & {\n\tclassName?: string;\n};\n\nexport const DESCRIPTION_SIZES = {\n\tsm: {\n\t\tsmall: \"sm:text-xs\",\n\t\tmedium: \"sm:text-sm\",\n\t},\n\tmd: {\n\t\tsmall: \"md:text-xs\",\n\t\tmedium: \"md:text-sm\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:text-xs\",\n\t\tmedium: \"lg:text-sm\",\n\t},\n\txl: {\n\t\tsmall: \"xl:text-xs\",\n\t\tmedium: \"xl:text-sm\",\n\t},\n};\n\nfunction AlertDescription({\n\tclassName,\n\trender,\n\t...props\n}: AlertDescriptionProps) {\n\tconst { size } = useAlertContext();\n\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: description({ size, className }),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlertDescription.displayName = \"AlertDescription\";\n\nexport {\n\tAlert,\n\tAlertDescription,\n\tAlertTitle,\n\ttype AlertDescriptionProps,\n\ttype AlertProps,\n\ttype AlertTitleProps,\n};\n"]}
1
+ {"version":3,"file":"alert.js","sourceRoot":"/","sources":["components/alert/alert.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOlD,MAAM,YAAY,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAE5E,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,MAAM,OAAO,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACzC,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAQF,MAAM,WAAW,GAAG,WAAW,CAAC;IAC/B,KAAK,EAAE;QACN,IAAI,EAAE,6JAA6J;QACnK,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,aAAa;KAC1B;IACD,QAAQ,EAAE;QACT,OAAO,EAAE;YACR,OAAO,EAAE;gBACR,IAAI,EAAE,wBAAwB;aAC9B;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EACN,GAAG,KAAK,EACe;IACvB,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,EAAE,CAAC;IAEnC,MAAM,YAAY,GAAkC;QACnD,SAAS,EAAE,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;KAC3C,CAAC;IAEF,OAAO,SAAS,CAAC;QAChB,cAAc,EAAE,KAAK;QACrB,MAAM;QACN,KAAK,EAAE,UAAU,CAAQ,YAAY,EAAE,KAAK,CAAC;KAC7C,CAAC,CAAC;AACJ,CAAC;AAED,gBAAgB,CAAC,WAAW,GAAG,kBAAkB,CAAC;AAElD,OAAO,EACN,KAAK,EACL,gBAAgB,EAGhB,UAAU,GAEV,CAAC","sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport type { ResponsiveValue } from \"@utilities/responsive/responsive\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport { createContext, useContext } from \"react\";\n\ntype AlertContextType = {\n\tvariant: \"primary\" | \"secondary\" | \"error\";\n\tsize: ResponsiveValue<\"small\" | \"medium\">;\n};\n\nconst AlertContext = createContext<AlertContextType | undefined>(undefined);\n\nconst useAlertContext = () => {\n\tconst context = useContext(AlertContext);\n\tif (!context) {\n\t\tthrow new Error(\"useAlertContext must be used within an Alert component\");\n\t}\n\treturn context;\n};\n\ntype AlertProps = useRender.ComponentProps<\"div\"> & {\n\tvariant?: \"primary\" | \"secondary\" | \"error\";\n\tsize?: ResponsiveValue<\"small\" | \"medium\">;\n\tclassName?: string;\n};\n\nconst alertStyles = getVariants({\n\tslots: {\n\t\troot: \"grid w-fit grid-cols-[0_1fr] items-start gap-1 rounded-md border border-transparent has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] [&>svg]:translate-y-1\",\n\t\ttitle: \"col-start-2 font-bold\",\n\t\tdescription: \"col-start-2\",\n\t},\n\tvariants: {\n\t\tvariant: {\n\t\t\tprimary: {\n\t\t\t\troot: \"bg-gray-700 text-white\",\n\t\t\t},\n\t\t\tsecondary: {\n\t\t\t\troot: \"border-gray-700 text-gray-700\",\n\t\t\t},\n\t\t\terror: {\n\t\t\t\troot: \"bg-red-500 text-white\",\n\t\t\t},\n\t\t},\n\t\tsize: {\n\t\t\tsmall: {\n\t\t\t\troot: \"px-2 py-1 has-[>svg]:gap-x-2\",\n\t\t\t\ttitle: \"text-sm\",\n\t\t\t\tdescription: \"text-xs\",\n\t\t\t},\n\t\t\tmedium: {\n\t\t\t\troot: \"px-3 py-2 has-[>svg]:gap-x-3\",\n\t\t\t\ttitle: \"text-base\",\n\t\t\t\tdescription: \"text-sm\",\n\t\t\t},\n\t\t},\n\t},\n});\n\nconst { root, title, description } = alertStyles();\n\nexport const SIZES = {\n\tsm: {\n\t\tsmall: \"sm:px-2 sm:py-1 sm:has-[>svg]:gap-x-2\",\n\t\tmedium: \"sm:px-3 sm:py-2 sm:has-[>svg]:gap-x-3\",\n\t},\n\tmd: {\n\t\tsmall: \"md:px-2 md:py-1 md:has-[>svg]:gap-x-2\",\n\t\tmedium: \"md:px-3 md:py-2 md:has-[>svg]:gap-x-3\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:px-2 lg:py-1 lg:has-[>svg]:gap-x-2\",\n\t\tmedium: \"lg:px-3 lg:py-2 lg:has-[>svg]:gap-x-3\",\n\t},\n\txl: {\n\t\tsmall: \"xl:px-2 xl:py-1 xl:has-[>svg]:gap-x-2\",\n\t\tmedium: \"xl:px-3 xl:py-2 xl:has-[>svg]:gap-x-3\",\n\t},\n};\n\nfunction Alert({\n\tvariant = \"primary\",\n\tsize = \"medium\",\n\tclassName,\n\trender,\n\tchildren,\n\t...props\n}: AlertProps) {\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: root({ variant, size, className }),\n\t\tchildren: (\n\t\t\t<AlertContext.Provider value={{ variant, size }}>\n\t\t\t\t{children}\n\t\t\t</AlertContext.Provider>\n\t\t),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlert.displayName = \"Alert\";\n\ntype AlertTitleProps = useRender.ComponentProps<\"div\"> & {\n\tclassName?: string;\n};\n\nexport const TITLE_SIZES = {\n\tsm: {\n\t\tsmall: \"sm:text-sm\",\n\t\tmedium: \"sm:text-base\",\n\t},\n\tmd: {\n\t\tsmall: \"md:text-sm\",\n\t\tmedium: \"md:text-base\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:text-sm\",\n\t\tmedium: \"lg:text-base\",\n\t},\n\txl: {\n\t\tsmall: \"xl:text-sm\",\n\t\tmedium: \"xl:text-base\",\n\t},\n};\n\nfunction AlertTitle({ className, render, ...props }: AlertTitleProps) {\n\tconst { size } = useAlertContext();\n\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: title({ size, className }),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlertTitle.displayName = \"AlertTitle\";\n\ntype AlertDescriptionProps = useRender.ComponentProps<\"div\"> & {\n\tclassName?: string;\n};\n\nexport const DESCRIPTION_SIZES = {\n\tsm: {\n\t\tsmall: \"sm:text-xs\",\n\t\tmedium: \"sm:text-sm\",\n\t},\n\tmd: {\n\t\tsmall: \"md:text-xs\",\n\t\tmedium: \"md:text-sm\",\n\t},\n\tlg: {\n\t\tsmall: \"lg:text-xs\",\n\t\tmedium: \"lg:text-sm\",\n\t},\n\txl: {\n\t\tsmall: \"xl:text-xs\",\n\t\tmedium: \"xl:text-sm\",\n\t},\n};\n\nfunction AlertDescription({\n\tclassName,\n\trender,\n\t...props\n}: AlertDescriptionProps) {\n\tconst { size } = useAlertContext();\n\n\tconst defaultProps: useRender.ElementProps<\"div\"> = {\n\t\tclassName: description({ size, className }),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"div\",\n\t\trender,\n\t\tprops: mergeProps<\"div\">(defaultProps, props),\n\t});\n}\n\nAlertDescription.displayName = \"AlertDescription\";\n\nexport {\n\tAlert,\n\tAlertDescription,\n\ttype AlertDescriptionProps,\n\ttype AlertProps,\n\tAlertTitle,\n\ttype AlertTitleProps,\n};\n"]}
@@ -12,4 +12,4 @@ export type AlertDialogDescriptionProps = ComponentProps<typeof BaseAlertDialog.
12
12
  declare function AlertDialogDescription({ className, ref, ...props }: AlertDialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
13
13
  declare const AlertDialogAction: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
14
14
  declare const AlertDialogCancel: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
15
- export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogOverlay, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
15
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogTitle, AlertDialogTrigger, };
@@ -20,5 +20,5 @@ function AlertDialogDescription({ className, ref, ...props }) {
20
20
  // We export Close as both Action and Cancel for API compatibility
21
21
  const AlertDialogAction = BaseAlertDialog.Close;
22
22
  const AlertDialogCancel = BaseAlertDialog.Close;
23
- export { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogOverlay, AlertDialogTitle, AlertDialogDescription, AlertDialogAction, AlertDialogCancel, };
23
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogOverlay, AlertDialogTitle, AlertDialogTrigger, };
24
24
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","sourceRoot":"/","sources":["components/alert-dialog/alert-dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW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AAC;AAED,0EAA0E;AAC1E,kEAAkE;AAClE,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC;AAEhD,MAAM,iBAAiB,GAAG,eAAe,CAAC,KAAK,CAAC;AAEhD,OAAO,EACN,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,GACjB,CAAC","sourcesContent":["import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst AlertDialog = BaseAlertDialog.Root;\n\nconst AlertDialogTrigger = BaseAlertDialog.Trigger;\n\nconst AlertDialogPortal = BaseAlertDialog.Portal;\n\nexport type AlertDialogOverlayProps = ComponentProps<\n\ttypeof BaseAlertDialog.Backdrop\n>;\n\nfunction AlertDialogOverlay({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogOverlayProps) {\n\treturn (\n\t\t<BaseAlertDialog.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type AlertDialogContentProps = ComponentProps<\n\ttypeof BaseAlertDialog.Popup\n>;\n\nfunction AlertDialogContent({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogContentProps) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<BaseAlertDialog.Popup\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-lg bg-white p-4 transition-all duration-150 data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nexport type AlertDialogTitleProps = ComponentProps<\n\ttypeof BaseAlertDialog.Title\n>;\n\nfunction AlertDialogTitle({ className, ref, ...props }: AlertDialogTitleProps) {\n\treturn (\n\t\t<BaseAlertDialog.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-medium text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type AlertDialogDescriptionProps = ComponentProps<\n\ttypeof BaseAlertDialog.Description\n>;\n\nfunction AlertDialogDescription({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogDescriptionProps) {\n\treturn (\n\t\t<BaseAlertDialog.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Base UI doesn't have separate Action/Cancel components - both use Close\n// We export Close as both Action and Cancel for API compatibility\nconst AlertDialogAction = BaseAlertDialog.Close;\n\nconst AlertDialogCancel = BaseAlertDialog.Close;\n\nexport {\n\tAlertDialog,\n\tAlertDialogTrigger,\n\tAlertDialogContent,\n\tAlertDialogOverlay,\n\tAlertDialogTitle,\n\tAlertDialogDescription,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n};\n"]}
1
+ {"version":3,"file":"alert-dialog.js","sourceRoot":"/","sources":["components/alert-dialog/alert-dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC;AAEzC,MAAM,kBAAkB,GAAG,eAAe,CAAC,OAAO,CAAC;AAEnD,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,CAAC;AAMjD,SAAS,kBAA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ClB,CAAC","sourcesContent":["import { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst AlertDialog = BaseAlertDialog.Root;\n\nconst AlertDialogTrigger = BaseAlertDialog.Trigger;\n\nconst AlertDialogPortal = BaseAlertDialog.Portal;\n\nexport type AlertDialogOverlayProps = ComponentProps<\n\ttypeof BaseAlertDialog.Backdrop\n>;\n\nfunction AlertDialogOverlay({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogOverlayProps) {\n\treturn (\n\t\t<BaseAlertDialog.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type AlertDialogContentProps = ComponentProps<\n\ttypeof BaseAlertDialog.Popup\n>;\n\nfunction AlertDialogContent({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogContentProps) {\n\treturn (\n\t\t<AlertDialogPortal>\n\t\t\t<AlertDialogOverlay />\n\t\t\t<BaseAlertDialog.Popup\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"fixed top-1/2 left-1/2 z-50 flex w-fit max-w-xl -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-lg bg-white p-4 transition-all duration-150 data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</AlertDialogPortal>\n\t);\n}\n\nexport type AlertDialogTitleProps = ComponentProps<\n\ttypeof BaseAlertDialog.Title\n>;\n\nfunction AlertDialogTitle({ className, ref, ...props }: AlertDialogTitleProps) {\n\treturn (\n\t\t<BaseAlertDialog.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-medium text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type AlertDialogDescriptionProps = ComponentProps<\n\ttypeof BaseAlertDialog.Description\n>;\n\nfunction AlertDialogDescription({\n\tclassName,\n\tref,\n\t...props\n}: AlertDialogDescriptionProps) {\n\treturn (\n\t\t<BaseAlertDialog.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n// Base UI doesn't have separate Action/Cancel components - both use Close\n// We export Close as both Action and Cancel for API compatibility\nconst AlertDialogAction = BaseAlertDialog.Close;\n\nconst AlertDialogCancel = BaseAlertDialog.Close;\n\nexport {\n\tAlertDialog,\n\tAlertDialogAction,\n\tAlertDialogCancel,\n\tAlertDialogContent,\n\tAlertDialogDescription,\n\tAlertDialogOverlay,\n\tAlertDialogTitle,\n\tAlertDialogTrigger,\n};\n"]}
@@ -1,25 +1,28 @@
1
- import { Dialog as BaseDialog } from "@base-ui/react/dialog";
1
+ import { Drawer as BaseDrawer } from "@base-ui/react/drawer";
2
2
  import type { ComponentProps } from "react";
3
- /**
4
- * Drawer Context
5
- */
6
- type DrawerContextValue = {
7
- side?: "left" | "right" | "top" | "bottom";
3
+ declare const SIDE_TO_SWIPE_DIRECTION: {
4
+ readonly left: "left";
5
+ readonly right: "right";
6
+ readonly top: "up";
7
+ readonly bottom: "down";
8
+ };
9
+ type DrawerSide = keyof typeof SIDE_TO_SWIPE_DIRECTION;
10
+ export type DrawerProps = ComponentProps<typeof BaseDrawer.Root> & {
11
+ side?: DrawerSide;
8
12
  };
9
- type DrawerProps = ComponentProps<typeof BaseDialog.Root> & DrawerContextValue;
10
13
  declare function Drawer({ children, side, ...props }: DrawerProps): import("react/jsx-runtime").JSX.Element;
11
- declare const DrawerTrigger: BaseDialog.Trigger;
12
- declare const DrawerClose: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").DialogCloseProps, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
13
- export type DrawerOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;
14
- export type DrawerContentProps = Omit<ComponentProps<typeof BaseDialog.Popup>, "className"> & {
14
+ declare const DrawerTrigger: BaseDrawer.Trigger;
15
+ declare const DrawerClose: BaseDrawer.Close;
16
+ export type DrawerOverlayProps = ComponentProps<typeof BaseDrawer.Backdrop>;
17
+ export type DrawerContentProps = Omit<ComponentProps<typeof BaseDrawer.Popup>, "className"> & {
15
18
  className?: string;
16
19
  };
17
20
  declare function DrawerContent({ children, className, ref, ...props }: DrawerContentProps): import("react/jsx-runtime").JSX.Element;
18
21
  export type DrawerHeaderProps = ComponentProps<"div">;
19
22
  declare function DrawerHeader({ className, ref, ...props }: DrawerHeaderProps): import("react/jsx-runtime").JSX.Element;
20
- export type DrawerTitleProps = ComponentProps<typeof BaseDialog.Title>;
23
+ export type DrawerTitleProps = ComponentProps<typeof BaseDrawer.Title>;
21
24
  declare function DrawerTitle({ className, ref, ...props }: DrawerTitleProps): import("react/jsx-runtime").JSX.Element;
22
- export type DrawerDescriptionProps = ComponentProps<typeof BaseDialog.Description>;
25
+ export type DrawerDescriptionProps = ComponentProps<typeof BaseDrawer.Description>;
23
26
  declare function DrawerDescription({ className, ref, ...props }: DrawerDescriptionProps): import("react/jsx-runtime").JSX.Element;
24
27
  export type DrawerFooterProps = ComponentProps<"div">;
25
28
  declare function DrawerFooter({ className, ref, ...props }: DrawerFooterProps): import("react/jsx-runtime").JSX.Element;
@@ -1,52 +1,33 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Dialog as BaseDialog } from "@base-ui/react/dialog";
2
+ import { Drawer as BaseDrawer } from "@base-ui/react/drawer";
3
3
  import { Cross1Icon } from "@radix-ui/react-icons";
4
4
  import { cn } from "../../utilities/cn/cn";
5
- import { getVariants } from "../../utilities/responsive/responsive";
6
- import { createContext, useContext, useMemo } from "react";
7
- const DrawerContext = createContext(undefined);
8
- const useDrawerContext = () => {
9
- const context = useContext(DrawerContext);
10
- if (!context) {
11
- throw new Error("Drawer components must be used within a Drawer");
12
- }
13
- return context;
5
+ const SIDE_TO_SWIPE_DIRECTION = {
6
+ left: "left",
7
+ right: "right",
8
+ top: "up",
9
+ bottom: "down",
14
10
  };
15
- function Drawer({ children, side, ...props }) {
16
- const contextValue = useMemo(() => ({
17
- side,
18
- }), [side]);
19
- return (_jsx(DrawerContext.Provider, { value: contextValue, children: _jsx(BaseDialog.Root, { ...props, children: children }) }));
11
+ function Drawer({ children, side = "right", ...props }) {
12
+ const swipeDirection = SIDE_TO_SWIPE_DIRECTION[side];
13
+ return (_jsx(BaseDrawer.Root, { swipeDirection: swipeDirection, ...props, children: children }));
20
14
  }
21
- const DrawerTrigger = BaseDialog.Trigger;
22
- const DrawerClose = BaseDialog.Close;
23
- const DrawerPortal = BaseDialog.Portal;
15
+ const DrawerTrigger = BaseDrawer.Trigger;
16
+ const DrawerClose = BaseDrawer.Close;
24
17
  function DrawerOverlay({ className, ref, ...props }) {
25
- return (_jsx(BaseDialog.Backdrop, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", className), ...props }));
18
+ return (_jsx(BaseDrawer.Backdrop, { ref: ref, className: cn("fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0", className), ...props }));
26
19
  }
27
- const drawerContentStyles = getVariants({
28
- base: "fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300",
29
- variants: {
30
- side: {
31
- left: "top-0 left-0 h-screen w-fit rounded-r-lg data-ending-style:-translate-x-full data-starting-style:-translate-x-full",
32
- right: "top-0 right-0 h-screen w-fit rounded-l-lg data-ending-style:translate-x-full data-starting-style:translate-x-full",
33
- top: "top-0 left-0 h-fit w-screen rounded-b-lg data-ending-style:-translate-y-full data-starting-style:-translate-y-full",
34
- bottom: "bottom-0 left-0 h-fit w-screen rounded-t-lg data-ending-style:translate-y-full data-starting-style:translate-y-full",
35
- },
36
- },
37
- });
38
20
  function DrawerContent({ children, className, ref, ...props }) {
39
- const { side = "right" } = useDrawerContext();
40
- return (_jsxs(DrawerPortal, { children: [_jsx(DrawerOverlay, {}), _jsxs(BaseDialog.Popup, { className: drawerContentStyles({ side, className }), ...props, ref: ref, children: [_jsx(DrawerClose, { className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }), children] })] }));
21
+ return (_jsxs(BaseDrawer.Portal, { children: [_jsx(DrawerOverlay, {}), _jsx(BaseDrawer.Viewport, { children: _jsxs(BaseDrawer.Popup, { className: cn("fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300 data-swiping:duration-0", "data-[swipe-direction=right]:data-ending-style:translate-x-full data-[swipe-direction=right]:data-starting-style:translate-x-full data-[swipe-direction=right]:top-0 data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:h-screen data-[swipe-direction=right]:w-fit data-[swipe-direction=right]:translate-x-(--drawer-swipe-movement-x,0px) data-[swipe-direction=right]:rounded-l-lg", "data-[swipe-direction=left]:data-ending-style:-translate-x-full data-[swipe-direction=left]:data-starting-style:-translate-x-full data-[swipe-direction=left]:top-0 data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:h-screen data-[swipe-direction=left]:w-fit data-[swipe-direction=left]:translate-x-(--drawer-swipe-movement-x,0px) data-[swipe-direction=left]:rounded-r-lg", "data-[swipe-direction=up]:data-ending-style:-translate-y-full data-[swipe-direction=up]:data-starting-style:-translate-y-full data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:right-0 data-[swipe-direction=up]:left-0 data-[swipe-direction=up]:h-fit data-[swipe-direction=up]:w-screen data-[swipe-direction=up]:translate-y-(--drawer-swipe-movement-y,0px) data-[swipe-direction=up]:rounded-b-lg", "data-[swipe-direction=down]:data-ending-style:translate-y-full data-[swipe-direction=down]:data-starting-style:translate-y-full data-[swipe-direction=down]:right-0 data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:left-0 data-[swipe-direction=down]:h-fit data-[swipe-direction=down]:w-screen data-[swipe-direction=down]:translate-y-(--drawer-swipe-movement-y,0px) data-[swipe-direction=down]:rounded-t-lg", className), ref: ref, ...props, children: [_jsx(DrawerClose, { className: "absolute top-4 right-4", children: _jsx(Cross1Icon, { className: "h-4 w-4" }) }), children] }) })] }));
41
22
  }
42
23
  function DrawerHeader({ className, ref, ...props }) {
43
24
  return (_jsx("div", { ref: ref, className: cn("flex flex-col gap-1", className), ...props }));
44
25
  }
45
26
  function DrawerTitle({ className, ref, ...props }) {
46
- return (_jsx(BaseDialog.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props }));
27
+ return (_jsx(BaseDrawer.Title, { ref: ref, className: cn("font-semibold text-lg", className), ...props }));
47
28
  }
48
29
  function DrawerDescription({ className, ref, ...props }) {
49
- return (_jsx(BaseDialog.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props }));
30
+ return (_jsx(BaseDrawer.Description, { ref: ref, className: cn("text-gray-500 text-sm", className), ...props }));
50
31
  }
51
32
  function DrawerFooter({ className, ref, ...props }) {
52
33
  return (_jsx("div", { ref: ref, className: cn("flex justify-end gap-2", className), ...props }));
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sourceRoot":"/","sources":["components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAU3D,MAAM,aAAa,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAE/E,MAAM,gB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CAAC,wBAAwB,EAAE,SAAS,CAAC,KAC9C,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Drawer Context\n */\n\ntype DrawerContextValue = {\n\tside?: \"left\" | \"right\" | \"top\" | \"bottom\";\n};\n\nconst DrawerContext = createContext<DrawerContextValue | undefined>(undefined);\n\nconst useDrawerContext = () => {\n\tconst context = useContext(DrawerContext);\n\tif (!context) {\n\t\tthrow new Error(\"Drawer components must be used within a Drawer\");\n\t}\n\treturn context;\n};\n\ntype DrawerProps = ComponentProps<typeof BaseDialog.Root> & DrawerContextValue;\n\nfunction Drawer({ children, side, ...props }: DrawerProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tside,\n\t\t}),\n\t\t[side],\n\t);\n\treturn (\n\t\t<DrawerContext.Provider value={contextValue}>\n\t\t\t<BaseDialog.Root {...props}>{children}</BaseDialog.Root>\n\t\t</DrawerContext.Provider>\n\t);\n}\n\nconst DrawerTrigger = BaseDialog.Trigger;\n\nconst DrawerClose = BaseDialog.Close;\n\nconst DrawerPortal = BaseDialog.Portal;\n\nexport type DrawerOverlayProps = ComponentProps<typeof BaseDialog.Backdrop>;\n\nfunction DrawerOverlay({ className, ref, ...props }: DrawerOverlayProps) {\n\treturn (\n\t\t<BaseDialog.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nconst drawerContentStyles = getVariants({\n\tbase: \"fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300\",\n\tvariants: {\n\t\tside: {\n\t\t\tleft: \"top-0 left-0 h-screen w-fit rounded-r-lg data-ending-style:-translate-x-full data-starting-style:-translate-x-full\",\n\t\t\tright:\n\t\t\t\t\"top-0 right-0 h-screen w-fit rounded-l-lg data-ending-style:translate-x-full data-starting-style:translate-x-full\",\n\t\t\ttop: \"top-0 left-0 h-fit w-screen rounded-b-lg data-ending-style:-translate-y-full data-starting-style:-translate-y-full\",\n\t\t\tbottom:\n\t\t\t\t\"bottom-0 left-0 h-fit w-screen rounded-t-lg data-ending-style:translate-y-full data-starting-style:translate-y-full\",\n\t\t},\n\t},\n});\n\nexport type DrawerContentProps = Omit<\n\tComponentProps<typeof BaseDialog.Popup>,\n\t\"className\"\n> & {\n\tclassName?: string;\n};\n\nfunction DrawerContent({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: DrawerContentProps) {\n\tconst { side = \"right\" } = useDrawerContext();\n\treturn (\n\t\t<DrawerPortal>\n\t\t\t<DrawerOverlay />\n\t\t\t<BaseDialog.Popup\n\t\t\t\tclassName={drawerContentStyles({ side, className })}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<DrawerClose className=\"absolute top-4 right-4\">\n\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t</DrawerClose>\n\t\t\t\t{children}\n\t\t\t</BaseDialog.Popup>\n\t\t</DrawerPortal>\n\t);\n}\n\nexport type DrawerHeaderProps = ComponentProps<\"div\">;\n\nfunction DrawerHeader({ className, ref, ...props }: DrawerHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerTitleProps = ComponentProps<typeof BaseDialog.Title>;\n\nfunction DrawerTitle({ className, ref, ...props }: DrawerTitleProps) {\n\treturn (\n\t\t<BaseDialog.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerDescriptionProps = ComponentProps<\n\ttypeof BaseDialog.Description\n>;\n\nfunction DrawerDescription({\n\tclassName,\n\tref,\n\t...props\n}: DrawerDescriptionProps) {\n\treturn (\n\t\t<BaseDialog.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerFooterProps = ComponentProps<\"div\">;\n\nfunction DrawerFooter({ className, ref, ...props }: DrawerFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDrawer,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerDescription,\n\tDrawerFooter,\n\tDrawerHeader,\n\tDrawerTitle,\n\tDrawerTrigger,\n};\n"]}
1
+ {"version":3,"file":"drawer.js","sourceRoot":"/","sources":["components/drawer/drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,uBAAuB,GAAG;IAC/B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,MAAM;CACL,CAAC;AAQX,SAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,OAAO,EAAE,GAAG,KAAK,EAAe;IAClE,MAAM,cAAc,GAAG,uBAAuB,CAAC,I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G,KAAK,EAAoB;IAClE,OAAO,CACN,KAAC,UAAU,CAAC,KAAK,IAChB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAMD,SAAS,iBAAiB,CAAC,EAC1B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACgB;IACxB,OAAO,CACN,KAAC,UAAU,CAAC,WAAW,IACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAqB;IACpE,OAAO,CACN,cACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,wBAAwB,EAAE,SAAS,CAAC,KAC9C,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,aAAa,GACb,CAAC","sourcesContent":["import { Drawer as BaseDrawer } from \"@base-ui/react/drawer\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst SIDE_TO_SWIPE_DIRECTION = {\n\tleft: \"left\",\n\tright: \"right\",\n\ttop: \"up\",\n\tbottom: \"down\",\n} as const;\n\ntype DrawerSide = keyof typeof SIDE_TO_SWIPE_DIRECTION;\n\nexport type DrawerProps = ComponentProps<typeof BaseDrawer.Root> & {\n\tside?: DrawerSide;\n};\n\nfunction Drawer({ children, side = \"right\", ...props }: DrawerProps) {\n\tconst swipeDirection = SIDE_TO_SWIPE_DIRECTION[side];\n\treturn (\n\t\t<BaseDrawer.Root swipeDirection={swipeDirection} {...props}>\n\t\t\t{children}\n\t\t</BaseDrawer.Root>\n\t);\n}\n\nconst DrawerTrigger = BaseDrawer.Trigger;\n\nconst DrawerClose = BaseDrawer.Close;\n\nexport type DrawerOverlayProps = ComponentProps<typeof BaseDrawer.Backdrop>;\n\nfunction DrawerOverlay({ className, ref, ...props }: DrawerOverlayProps) {\n\treturn (\n\t\t<BaseDrawer.Backdrop\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"fixed inset-0 z-50 bg-black/50 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerContentProps = Omit<\n\tComponentProps<typeof BaseDrawer.Popup>,\n\t\"className\"\n> & {\n\tclassName?: string;\n};\n\nfunction DrawerContent({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: DrawerContentProps) {\n\treturn (\n\t\t<BaseDrawer.Portal>\n\t\t\t<DrawerOverlay />\n\t\t\t<BaseDrawer.Viewport>\n\t\t\t\t<BaseDrawer.Popup\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"fixed z-50 flex flex-col gap-4 bg-white p-4 transition-transform duration-300 data-swiping:duration-0\",\n\t\t\t\t\t\t\"data-[swipe-direction=right]:data-ending-style:translate-x-full data-[swipe-direction=right]:data-starting-style:translate-x-full data-[swipe-direction=right]:top-0 data-[swipe-direction=right]:right-0 data-[swipe-direction=right]:h-screen data-[swipe-direction=right]:w-fit data-[swipe-direction=right]:translate-x-(--drawer-swipe-movement-x,0px) data-[swipe-direction=right]:rounded-l-lg\",\n\t\t\t\t\t\t\"data-[swipe-direction=left]:data-ending-style:-translate-x-full data-[swipe-direction=left]:data-starting-style:-translate-x-full data-[swipe-direction=left]:top-0 data-[swipe-direction=left]:left-0 data-[swipe-direction=left]:h-screen data-[swipe-direction=left]:w-fit data-[swipe-direction=left]:translate-x-(--drawer-swipe-movement-x,0px) data-[swipe-direction=left]:rounded-r-lg\",\n\t\t\t\t\t\t\"data-[swipe-direction=up]:data-ending-style:-translate-y-full data-[swipe-direction=up]:data-starting-style:-translate-y-full data-[swipe-direction=up]:top-0 data-[swipe-direction=up]:right-0 data-[swipe-direction=up]:left-0 data-[swipe-direction=up]:h-fit data-[swipe-direction=up]:w-screen data-[swipe-direction=up]:translate-y-(--drawer-swipe-movement-y,0px) data-[swipe-direction=up]:rounded-b-lg\",\n\t\t\t\t\t\t\"data-[swipe-direction=down]:data-ending-style:translate-y-full data-[swipe-direction=down]:data-starting-style:translate-y-full data-[swipe-direction=down]:right-0 data-[swipe-direction=down]:bottom-0 data-[swipe-direction=down]:left-0 data-[swipe-direction=down]:h-fit data-[swipe-direction=down]:w-screen data-[swipe-direction=down]:translate-y-(--drawer-swipe-movement-y,0px) data-[swipe-direction=down]:rounded-t-lg\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\tref={ref}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t<DrawerClose className=\"absolute top-4 right-4\">\n\t\t\t\t\t\t<Cross1Icon className=\"h-4 w-4\" />\n\t\t\t\t\t</DrawerClose>\n\t\t\t\t\t{children}\n\t\t\t\t</BaseDrawer.Popup>\n\t\t\t</BaseDrawer.Viewport>\n\t\t</BaseDrawer.Portal>\n\t);\n}\n\nexport type DrawerHeaderProps = ComponentProps<\"div\">;\n\nfunction DrawerHeader({ className, ref, ...props }: DrawerHeaderProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex flex-col gap-1\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerTitleProps = ComponentProps<typeof BaseDrawer.Title>;\n\nfunction DrawerTitle({ className, ref, ...props }: DrawerTitleProps) {\n\treturn (\n\t\t<BaseDrawer.Title\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"font-semibold text-lg\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerDescriptionProps = ComponentProps<\n\ttypeof BaseDrawer.Description\n>;\n\nfunction DrawerDescription({\n\tclassName,\n\tref,\n\t...props\n}: DrawerDescriptionProps) {\n\treturn (\n\t\t<BaseDrawer.Description\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DrawerFooterProps = ComponentProps<\"div\">;\n\nfunction DrawerFooter({ className, ref, ...props }: DrawerFooterProps) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"flex justify-end gap-2\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDrawer,\n\tDrawerClose,\n\tDrawerContent,\n\tDrawerDescription,\n\tDrawerFooter,\n\tDrawerHeader,\n\tDrawerTitle,\n\tDrawerTrigger,\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import { Menu } from "@base-ui/react/menu";
2
2
  import type { ComponentProps } from "react";
3
- declare const DropdownMenu: typeof Menu.Root;
3
+ declare const DropdownMenu: <Payload>(props: Menu.Root.Props<Payload>) => import("react/jsx-runtime").JSX.Element;
4
4
  export type DropdownMenuTriggerProps = ComponentProps<typeof Menu.Trigger>;
5
5
  declare function DropdownMenuTrigger({ className, ref, ...props }: DropdownMenuTriggerProps): import("react/jsx-runtime").JSX.Element;
6
6
  declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").ContextMenuGroupProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
@@ -32,4 +32,4 @@ declare function DropdownMenuLabel({ className, inset, ref, ...props }: Dropdown
32
32
  export type DropdownMenuSeparatorProps = ComponentProps<typeof Menu.Separator>;
33
33
  declare function DropdownMenuSeparator({ className, ref, ...props }: DropdownMenuSeparatorProps): import("react/jsx-runtime").JSX.Element;
34
34
  declare function DropdownMenuShortcut({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
35
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
35
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
@@ -37,5 +37,5 @@ function DropdownMenuSeparator({ className, ref, ...props }) {
37
37
  function DropdownMenuShortcut({ className, ...props }) {
38
38
  return (_jsx("span", { className: cn("ml-auto text-xs tracking-widest opacity-60", className), ...props }));
39
39
  }
40
- export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
40
+ export { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, };
41
41
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","sourceRoot":"/","sources":["components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,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,KACG,KAAK,aAET,eAAM,SAAS,EAAC,8DAA8D,YAC7E,KAAC,IAAI,CAAC,kBAAkB,cACvB,KAAC,UAAU,IAAC,SAAS,EAAC,sBAAsB,GAAG,GACtB,GACpB,EACN,QAAQ,IACO,CACjB,CAAC;AACH,CAAC;AAMD,SAAS,iBAAiB,CAAC,EAC1B,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACgB;IACxB,OAAO,CACN,KAAC,IAAI,CAAC,KAAK,cACV,KAAC,IAAI,CAAC,UAAU,IACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mCAAmC,EACnC,KAAK,IAAI,MAAM,EACf,SAAS,CACT,KACG,KAAK,GACR,GACU,CACb,CAAC;AACH,CAAC;AAID,SAAS,qBAAqB,CAAC,EAC9B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACoB;IAC5B,OAAO,CACN,KAAC,IAAI,CAAC,SAAS,IACd,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,SAAS,CAAC,KACnD,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EAC+B;IACvC,OAAO,CACN,eACC,SAAS,EAAE,EAAE,CAAC,4CAA4C,EAAE,SAAS,CAAC,KAClE,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACtB,CAAC","sourcesContent":["import { Menu } from \"@base-ui/react/menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst DropdownMenu = Menu.Root;\n\nexport type DropdownMenuTriggerProps = ComponentProps<typeof Menu.Trigger>;\n\nfunction DropdownMenuTrigger({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuTriggerProps) {\n\treturn <Menu.Trigger ref={ref} className={className} {...props} />;\n}\n\nconst DropdownMenuGroup = Menu.Group;\n\nconst DropdownMenuPortal = Menu.Portal;\n\nconst DropdownMenuSub = Menu.SubmenuRoot;\n\nconst DropdownMenuRadioGroup = Menu.RadioGroup;\n\nexport type DropdownMenuSubTriggerProps = ComponentProps<\n\ttypeof Menu.SubmenuTrigger\n> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuSubTriggerProps) {\n\treturn (\n\t\t<Menu.SubmenuTrigger\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-highlighted:bg-gray-200 data-popup-open:bg-gray-200 data-highlighted:text-gray-700 data-popup-open:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</Menu.SubmenuTrigger>\n\t);\n}\n\nexport type DropdownMenuSubContentProps = ComponentProps<typeof Menu.Popup>;\n\nfunction DropdownMenuSubContent({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSubContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"data-[starting-style]:zoom-out-95 data-[ending-style]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-[--transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof Menu.Popup> & {\n\tsideOffset?: number;\n};\n\nfunction DropdownMenuContent({\n\tclassName,\n\tsideOffset = 4,\n\tref,\n\t...props\n}: DropdownMenuContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner sideOffset={sideOffset}>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 max-h-(--available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md\",\n\t\t\t\t\t\t\"data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--transform-origin] data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuItemProps = ComponentProps<typeof Menu.Item> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuItemProps) {\n\treturn (\n\t\t<Menu.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DropdownMenuCheckboxItemProps = ComponentProps<\n\ttypeof Menu.CheckboxItem\n>;\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tonCheckedChange,\n\tref,\n\t...props\n}: DropdownMenuCheckboxItemProps) {\n\treturn (\n\t\t<Menu.CheckboxItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon className=\"h-4 w-4\" />\n\t\t\t\t</Menu.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.CheckboxItem>\n\t);\n}\n\nexport type DropdownMenuRadioItemProps = ComponentProps<typeof Menu.RadioItem>;\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuRadioItemProps) {\n\treturn (\n\t\t<Menu.RadioItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-900 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.RadioItemIndicator>\n\t\t\t\t\t<CircleIcon className=\"h-2 w-2 fill-current\" />\n\t\t\t\t</Menu.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.RadioItem>\n\t);\n}\n\nexport type DropdownMenuLabelProps = ComponentProps<typeof Menu.GroupLabel> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuLabelProps) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t<Menu.GroupLabel\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"px-2 py-1.5 font-semibold text-sm\",\n\t\t\t\t\tinset && \"pl-8\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</Menu.Group>\n\t);\n}\n\nexport type DropdownMenuSeparatorProps = ComponentProps<typeof Menu.Separator>;\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSeparatorProps) {\n\treturn (\n\t\t<Menu.Separator\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"-mx-1 my-1 h-px bg-gray-200\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuTrigger,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuRadioItem,\n\tDropdownMenuLabel,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuGroup,\n\tDropdownMenuPortal,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuRadioGroup,\n};\n"]}
1
+ {"version":3,"file":"dropdown-menu.js","sourceRoot":"/","sources":["components/dropdown-menu/dropdown-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC;AAI/B,SAAS,mBAAmB,CAAC,EAC5B,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACkB;IAC1B,OAAO,KAAC,IAAI,CAAC,OAAO,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AACpE,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC;AAErC,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,CAAC;AAEvC,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,CAAC;AAEzC,MAAM,sBAAsB,GAAG,IAAI,CAAC,UAAU,CAAC;AAQ/C,SAAS,sBAAsB,CAAC,EAC/B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACqB;IAC7B,OAAO,CACN,MAAC,IAAI,CAAC,cAAc,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,kRAAkR,EAClR,KAAK,IAAI,MAAM,EACf,SAAS,CACT,KACG,KAAK,aAER,QAAQ,EACT,KAAC,gBAAgB,IAAC,SA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AClE,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,mBAAmB,GACnB,CAAC","sourcesContent":["import { Menu } from \"@base-ui/react/menu\";\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst DropdownMenu = Menu.Root;\n\nexport type DropdownMenuTriggerProps = ComponentProps<typeof Menu.Trigger>;\n\nfunction DropdownMenuTrigger({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuTriggerProps) {\n\treturn <Menu.Trigger ref={ref} className={className} {...props} />;\n}\n\nconst DropdownMenuGroup = Menu.Group;\n\nconst DropdownMenuPortal = Menu.Portal;\n\nconst DropdownMenuSub = Menu.SubmenuRoot;\n\nconst DropdownMenuRadioGroup = Menu.RadioGroup;\n\nexport type DropdownMenuSubTriggerProps = ComponentProps<\n\ttypeof Menu.SubmenuTrigger\n> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuSubTrigger({\n\tclassName,\n\tinset,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuSubTriggerProps) {\n\treturn (\n\t\t<Menu.SubmenuTrigger\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-highlighted:bg-gray-200 data-popup-open:bg-gray-200 data-highlighted:text-gray-700 data-popup-open:text-gray-900 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<ChevronRightIcon className=\"ml-auto\" />\n\t\t</Menu.SubmenuTrigger>\n\t);\n}\n\nexport type DropdownMenuSubContentProps = ComponentProps<typeof Menu.Popup>;\n\nfunction DropdownMenuSubContent({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSubContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"data-[starting-style]:zoom-out-95 data-[ending-style]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 origin-[--transform-origin] overflow-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-lg data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof Menu.Popup> & {\n\tsideOffset?: number;\n};\n\nfunction DropdownMenuContent({\n\tclassName,\n\tsideOffset = 4,\n\tref,\n\t...props\n}: DropdownMenuContentProps) {\n\treturn (\n\t\t<Menu.Portal>\n\t\t\t<Menu.Positioner sideOffset={sideOffset}>\n\t\t\t\t<Menu.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"z-50 max-h-(--available-height) min-w-32 overflow-y-auto overflow-x-hidden rounded-md border border-gray-200 bg-gray-50 p-1 text-gray-700 shadow-md\",\n\t\t\t\t\t\t\"data-[ending-style]:zoom-out-95 data-[starting-style]:zoom-out-95 data-[open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--transform-origin] data-ending-style:animate-fade-out data-starting-style:animate-fade-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</Menu.Positioner>\n\t\t</Menu.Portal>\n\t);\n}\n\nexport type DropdownMenuItemProps = ComponentProps<typeof Menu.Item> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuItem({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuItemProps) {\n\treturn (\n\t\t<Menu.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0\",\n\t\t\t\tinset && \"pl-8\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type DropdownMenuCheckboxItemProps = ComponentProps<\n\ttypeof Menu.CheckboxItem\n>;\n\nfunction DropdownMenuCheckboxItem({\n\tclassName,\n\tchildren,\n\tchecked,\n\tonCheckedChange,\n\tref,\n\t...props\n}: DropdownMenuCheckboxItemProps) {\n\treturn (\n\t\t<Menu.CheckboxItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-700 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tchecked={checked}\n\t\t\tonCheckedChange={onCheckedChange}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.CheckboxItemIndicator>\n\t\t\t\t\t<CheckIcon className=\"h-4 w-4\" />\n\t\t\t\t</Menu.CheckboxItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.CheckboxItem>\n\t);\n}\n\nexport type DropdownMenuRadioItemProps = ComponentProps<typeof Menu.RadioItem>;\n\nfunction DropdownMenuRadioItem({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: DropdownMenuRadioItemProps) {\n\treturn (\n\t\t<Menu.RadioItem\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex cursor-default select-none items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none transition-colors data-disabled:pointer-events-none data-highlighted:bg-gray-200 data-highlighted:text-gray-900 data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<Menu.RadioItemIndicator>\n\t\t\t\t\t<CircleIcon className=\"h-2 w-2 fill-current\" />\n\t\t\t\t</Menu.RadioItemIndicator>\n\t\t\t</span>\n\t\t\t{children}\n\t\t</Menu.RadioItem>\n\t);\n}\n\nexport type DropdownMenuLabelProps = ComponentProps<typeof Menu.GroupLabel> & {\n\tinset?: boolean;\n};\n\nfunction DropdownMenuLabel({\n\tclassName,\n\tinset,\n\tref,\n\t...props\n}: DropdownMenuLabelProps) {\n\treturn (\n\t\t<Menu.Group>\n\t\t\t<Menu.GroupLabel\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"px-2 py-1.5 font-semibold text-sm\",\n\t\t\t\t\tinset && \"pl-8\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</Menu.Group>\n\t);\n}\n\nexport type DropdownMenuSeparatorProps = ComponentProps<typeof Menu.Separator>;\n\nfunction DropdownMenuSeparator({\n\tclassName,\n\tref,\n\t...props\n}: DropdownMenuSeparatorProps) {\n\treturn (\n\t\t<Menu.Separator\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"-mx-1 my-1 h-px bg-gray-200\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction DropdownMenuShortcut({\n\tclassName,\n\t...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n\treturn (\n\t\t<span\n\t\t\tclassName={cn(\"ml-auto text-xs tracking-widest opacity-60\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tDropdownMenu,\n\tDropdownMenuCheckboxItem,\n\tDropdownMenuContent,\n\tDropdownMenuGroup,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuPortal,\n\tDropdownMenuRadioGroup,\n\tDropdownMenuRadioItem,\n\tDropdownMenuSeparator,\n\tDropdownMenuShortcut,\n\tDropdownMenuSub,\n\tDropdownMenuSubContent,\n\tDropdownMenuSubTrigger,\n\tDropdownMenuTrigger,\n};\n"]}
@@ -87,4 +87,4 @@ export type PaginationNextProps = PropsWithChildren<React.HTMLAttributes<HTMLBut
87
87
  * ```
88
88
  */
89
89
  declare function PaginationNext({ children, className, ref, ...props }: PaginationNextProps): import("react/jsx-runtime").JSX.Element;
90
- export { Pagination, PaginationItem, PaginationPrev, PaginationNext };
90
+ export { Pagination, PaginationItem, PaginationNext, PaginationPrev };
@@ -141,5 +141,5 @@ function PaginationNext({ children, className, ref, ...props }) {
141
141
  const { page, setPage, hasNextPage, registerRef, totalPages } = usePaginationContext();
142
142
  return (_jsx("button", { type: "button", className: cn("flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200 disabled:opacity-25", className), onClick: () => setPage(page + 1), disabled: !hasNextPage, ref: mergeRefs(ref, (el) => registerRef(totalPages + 1, el)), ...props, children: children }));
143
143
  }
144
- export { Pagination, PaginationItem, PaginationPrev, PaginationNext };
144
+ export { Pagination, PaginationItem, PaginationNext, PaginationPrev };
145
145
  //# sourceMappingURL=pagination.js.map
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ACN,iBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACZ,+FAA+F,EAC/F,SAAS,CACT,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,EAChC,QAAQ,EAAE,CAAC,WAAW,EACtB,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,KACxD,KAAK,YAER,QAAQ,GACD,CACT,CAAC;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { mergeRefs } from \"@utilities/merge-refs/merge-refs\";\nimport { getTruncatedElements } from \"@utilities/pagination/get-truncated-elements\";\nimport { handleKeyboardNavigation } from \"@utilities/pagination/keyboard-navigation\";\nimport clsx from \"clsx\";\nimport {\n\tcreateContext,\n\ttype PropsWithChildren,\n\ttype Ref,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\n/**\n * Pagination Context\n */\n\ntype PaginationContextValue = {\n\tpage: number;\n\ttotalPages: number;\n\thasNextPage: boolean;\n\thasPreviousPage: boolean;\n\tsetPage: (page: number) => void;\n\tregisterRef: (index: number, element: HTMLButtonElement | null) => void;\n};\n\nconst PaginationContext = createContext<PaginationContextValue | undefined>(\n\tundefined,\n);\n\nconst usePaginationContext = () => {\n\tconst context = useContext(PaginationContext);\n\tif (!context) {\n\t\tthrow new Error(\"Pagination components must be used within a Pagination\");\n\t}\n\treturn context;\n};\n\n/**\n * Pagination\n */\n\nexport type PaginationProps = useRender.ComponentProps<\"nav\"> & {\n\tchildren?: React.ReactNode;\n\tpage: number;\n\ttotalPages: number;\n\tonPageChange: (page: number) => void;\n\tclassName?: string;\n};\n\n/**\n * Pagination component that provides navigation controls for a set of pages.\n *\n * @param {number} props.page - The current active page number\n * @param {number} props.totalPages - The total number of pages\n * @param {(page: number) => void} props.onPageChange - Callback function called when page changes\n * @param {React.ReactElement | ((props, state) => React.ReactElement)} [props.render] - Custom element to render instead of nav\n * @param {React.ReactNode} [props.children] - The content to render within the pagination component\n * @param {string} [props.className] - Additional CSS classes to apply\n *\n * @example\n * ```tsx\n * <Pagination page={1} totalPages={10} onPageChange={(page) => console.log(page)}>\n * <PaginationPrev>Previous</PaginationPrev>\n * <PaginationItem index={1}>1</PaginationItem>\n * <PaginationItem index={2}>2</PaginationItem>\n * <PaginationNext>Next</PaginationNext>\n * </Pagination>\n * ```\n *\n * @example\n * // With render prop to change the element\n * ```tsx\n * <Pagination render={<div />} page={1} totalPages={10} onPageChange={handleChange}>\n * ...\n * </Pagination>\n * ```\n */\nfunction Pagination({\n\tchildren,\n\tpage: initialPage,\n\ttotalPages: initialTotalPages,\n\tonPageChange,\n\tclassName,\n\trender,\n\t...props\n}: PaginationProps) {\n\tconst [page, setPage] = useState(initialPage);\n\tconst [totalPages, setTotalPages] = useState(initialTotalPages);\n\tconst [hasNextPage, setHasNextPage] = useState(page < totalPages);\n\tconst [hasPreviousPage, setHasPreviousPage] = useState(page > 1);\n\n\tconst refs = useRef(new Map<number, HTMLButtonElement>());\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent) =>\n\t\t\thandleKeyboardNavigation(e, { current: refs.current }, totalPages),\n\t\t[totalPages],\n\t);\n\n\tconst registerRefWrapper = useCallback(\n\t\t(index: number, element: HTMLButtonElement | null) => {\n\t\t\tif (element) {\n\t\t\t\trefs.current.set(index, element);\n\t\t\t} else {\n\t\t\t\trefs.current.delete(index);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t};\n\t}, [handleKeyDown]);\n\n\tuseEffect(() => {\n\t\tsetHasNextPage(page < totalPages);\n\t\tsetHasPreviousPage(page > 1);\n\t}, [page, totalPages]);\n\n\tuseEffect(() => {\n\t\tsetPage(initialPage);\n\t\tsetTotalPages(initialTotalPages);\n\t}, [initialPage, initialTotalPages]);\n\n\tuseEffect(() => {\n\t\tif (onPageChange) {\n\t\t\tonPageChange(page);\n\t\t}\n\t}, [page, onPageChange]);\n\n\tconst memoContextValue = useMemo(\n\t\t() => ({\n\t\t\tpage,\n\t\t\tsetPage,\n\t\t\ttotalPages,\n\t\t\thasNextPage,\n\t\t\thasPreviousPage,\n\t\t\tregisterRef: registerRefWrapper,\n\t\t}),\n\t\t[page, totalPages, hasNextPage, hasPreviousPage, registerRefWrapper],\n\t);\n\n\tconst defaultProps: useRender.ElementProps<\"nav\"> = {\n\t\t\"aria-label\": \"Pagination\",\n\t\tclassName: clsx(\"flex items-center gap-1\", className),\n\t\tchildren: (\n\t\t\t<PaginationContext.Provider value={memoContextValue}>\n\t\t\t\t{getTruncatedElements({ page, children })}\n\t\t\t</PaginationContext.Provider>\n\t\t),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"nav\",\n\t\trender,\n\t\tprops: mergeProps<\"nav\">(defaultProps, props),\n\t});\n}\n\n/**\n * Pagination Item\n */\n\nexport type PaginationItemProps = {\n\tchildren?: React.ReactNode;\n\tindex?: number;\n\tref?: Ref<HTMLButtonElement>;\n} & React.HTMLAttributes<HTMLButtonElement>;\n\n/**\n * Individual page item within the Pagination component.\n *\n * @example\n * ```tsx\n * <PaginationItem index={1}>1</PaginationItem>\n */\nfunction PaginationItem({\n\tindex,\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationItemProps) {\n\tconst { registerRef, page, setPage } = usePaginationContext();\n\n\tconst isActive = page === index;\n\tconst handleClick = () => {\n\t\tif (index !== undefined) {\n\t\t\tsetPage(index);\n\t\t}\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={handleClick}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(index ?? 0, el))}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200\",\n\t\t\t\t{\n\t\t\t\t\t\"bg-gray-700 text-white hover:bg-gray-800\": isActive,\n\t\t\t\t},\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\taria-current={isActive ? \"page\" : undefined}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? index}\n\t\t</button>\n\t);\n}\n\n/**\n * Pagination Prev\n */\n\nexport type PaginationPrevProps = PropsWithChildren<\n\tReact.HTMLAttributes<HTMLButtonElement>\n> & {\n\tref?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Previous page button component for the Pagination.\n * Automatically disabled when on the first page.\n *\n * @example\n * ```tsx\n * <PaginationPrev>Previous</PaginationPrev>\n * ```\n */\nfunction PaginationPrev({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationPrevProps) {\n\tconst { registerRef, page, setPage, hasPreviousPage } =\n\t\tusePaginationContext();\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={() => setPage(page - 1)}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(0, el))}\n\t\t\tdisabled={!hasPreviousPage}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200 disabled:opacity-25\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n/**\n * Pagination Next\n */\n\nexport type PaginationNextProps = PropsWithChildren<\n\tReact.HTMLAttributes<HTMLButtonElement>\n> & {\n\tref?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Next page button component for the Pagination.\n * Automatically disabled when on the last page.\n *\n * @example\n * ```tsx\n * <PaginationNext>Next</PaginationNext>\n * ```\n */\nfunction PaginationNext({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationNextProps) {\n\tconst { page, setPage, hasNextPage, registerRef, totalPages } =\n\t\tusePaginationContext();\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200 disabled:opacity-25\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonClick={() => setPage(page + 1)}\n\t\t\tdisabled={!hasNextPage}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(totalPages + 1, el))}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { Pagination, PaginationItem, PaginationPrev, PaginationNext };\n"]}
1
+ {"version":3,"file":"pagination.js","sourceRoot":"/","sources":["components/pagination/pagination.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACN,aAAa,EAGb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GACR,MAAM,OAAO,CAAC;AAef,MAAM,iBAAiB,GAAG,aAAa,CACtC,SAAS,CACT,CAAC;AAEF,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACjC,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,EAAE,CAA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,CAAC,IAAI,GAAG,CAAC,CAAC,EAChC,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAC/C,QAAQ,EAAE,CAAC,eAAe,EAC1B,SAAS,EAAE,EAAE,CACZ,+FAA+F,EAC/F,SAAS,CACT,KACG,KAAK,YAER,QAAQ,GACD,CACT,CAAC;AACH,CAAC;AAYD;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,EACvB,QAAQ,EACR,SAAS,EACT,GAAG,EACH,GAAG,KAAK,EACa;IACrB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,GAC5D,oBAAoB,EAAE,CAAC;IACxB,OAAO,CACN,iBACC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACZ,+FAA+F,EAC/F,SAAS,CACT,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,EAChC,QAAQ,EAAE,CAAC,WAAW,EACtB,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,KACxD,KAAK,YAER,QAAQ,GACD,CACT,CAAC;AACH,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { mergeProps } from \"@base-ui/react/merge-props\";\nimport { useRender } from \"@base-ui/react/use-render\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { mergeRefs } from \"@utilities/merge-refs/merge-refs\";\nimport { getTruncatedElements } from \"@utilities/pagination/get-truncated-elements\";\nimport { handleKeyboardNavigation } from \"@utilities/pagination/keyboard-navigation\";\nimport clsx from \"clsx\";\nimport {\n\tcreateContext,\n\ttype PropsWithChildren,\n\ttype Ref,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\n/**\n * Pagination Context\n */\n\ntype PaginationContextValue = {\n\tpage: number;\n\ttotalPages: number;\n\thasNextPage: boolean;\n\thasPreviousPage: boolean;\n\tsetPage: (page: number) => void;\n\tregisterRef: (index: number, element: HTMLButtonElement | null) => void;\n};\n\nconst PaginationContext = createContext<PaginationContextValue | undefined>(\n\tundefined,\n);\n\nconst usePaginationContext = () => {\n\tconst context = useContext(PaginationContext);\n\tif (!context) {\n\t\tthrow new Error(\"Pagination components must be used within a Pagination\");\n\t}\n\treturn context;\n};\n\n/**\n * Pagination\n */\n\nexport type PaginationProps = useRender.ComponentProps<\"nav\"> & {\n\tchildren?: React.ReactNode;\n\tpage: number;\n\ttotalPages: number;\n\tonPageChange: (page: number) => void;\n\tclassName?: string;\n};\n\n/**\n * Pagination component that provides navigation controls for a set of pages.\n *\n * @param {number} props.page - The current active page number\n * @param {number} props.totalPages - The total number of pages\n * @param {(page: number) => void} props.onPageChange - Callback function called when page changes\n * @param {React.ReactElement | ((props, state) => React.ReactElement)} [props.render] - Custom element to render instead of nav\n * @param {React.ReactNode} [props.children] - The content to render within the pagination component\n * @param {string} [props.className] - Additional CSS classes to apply\n *\n * @example\n * ```tsx\n * <Pagination page={1} totalPages={10} onPageChange={(page) => console.log(page)}>\n * <PaginationPrev>Previous</PaginationPrev>\n * <PaginationItem index={1}>1</PaginationItem>\n * <PaginationItem index={2}>2</PaginationItem>\n * <PaginationNext>Next</PaginationNext>\n * </Pagination>\n * ```\n *\n * @example\n * // With render prop to change the element\n * ```tsx\n * <Pagination render={<div />} page={1} totalPages={10} onPageChange={handleChange}>\n * ...\n * </Pagination>\n * ```\n */\nfunction Pagination({\n\tchildren,\n\tpage: initialPage,\n\ttotalPages: initialTotalPages,\n\tonPageChange,\n\tclassName,\n\trender,\n\t...props\n}: PaginationProps) {\n\tconst [page, setPage] = useState(initialPage);\n\tconst [totalPages, setTotalPages] = useState(initialTotalPages);\n\tconst [hasNextPage, setHasNextPage] = useState(page < totalPages);\n\tconst [hasPreviousPage, setHasPreviousPage] = useState(page > 1);\n\n\tconst refs = useRef(new Map<number, HTMLButtonElement>());\n\n\tconst handleKeyDown = useCallback(\n\t\t(e: KeyboardEvent) =>\n\t\t\thandleKeyboardNavigation(e, { current: refs.current }, totalPages),\n\t\t[totalPages],\n\t);\n\n\tconst registerRefWrapper = useCallback(\n\t\t(index: number, element: HTMLButtonElement | null) => {\n\t\t\tif (element) {\n\t\t\t\trefs.current.set(index, element);\n\t\t\t} else {\n\t\t\t\trefs.current.delete(index);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tdocument.addEventListener(\"keydown\", handleKeyDown);\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"keydown\", handleKeyDown);\n\t\t};\n\t}, [handleKeyDown]);\n\n\tuseEffect(() => {\n\t\tsetHasNextPage(page < totalPages);\n\t\tsetHasPreviousPage(page > 1);\n\t}, [page, totalPages]);\n\n\tuseEffect(() => {\n\t\tsetPage(initialPage);\n\t\tsetTotalPages(initialTotalPages);\n\t}, [initialPage, initialTotalPages]);\n\n\tuseEffect(() => {\n\t\tif (onPageChange) {\n\t\t\tonPageChange(page);\n\t\t}\n\t}, [page, onPageChange]);\n\n\tconst memoContextValue = useMemo(\n\t\t() => ({\n\t\t\tpage,\n\t\t\tsetPage,\n\t\t\ttotalPages,\n\t\t\thasNextPage,\n\t\t\thasPreviousPage,\n\t\t\tregisterRef: registerRefWrapper,\n\t\t}),\n\t\t[page, totalPages, hasNextPage, hasPreviousPage, registerRefWrapper],\n\t);\n\n\tconst defaultProps: useRender.ElementProps<\"nav\"> = {\n\t\t\"aria-label\": \"Pagination\",\n\t\tclassName: clsx(\"flex items-center gap-1\", className),\n\t\tchildren: (\n\t\t\t<PaginationContext.Provider value={memoContextValue}>\n\t\t\t\t{getTruncatedElements({ page, children })}\n\t\t\t</PaginationContext.Provider>\n\t\t),\n\t};\n\n\treturn useRender({\n\t\tdefaultTagName: \"nav\",\n\t\trender,\n\t\tprops: mergeProps<\"nav\">(defaultProps, props),\n\t});\n}\n\n/**\n * Pagination Item\n */\n\nexport type PaginationItemProps = {\n\tchildren?: React.ReactNode;\n\tindex?: number;\n\tref?: Ref<HTMLButtonElement>;\n} & React.HTMLAttributes<HTMLButtonElement>;\n\n/**\n * Individual page item within the Pagination component.\n *\n * @example\n * ```tsx\n * <PaginationItem index={1}>1</PaginationItem>\n */\nfunction PaginationItem({\n\tindex,\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationItemProps) {\n\tconst { registerRef, page, setPage } = usePaginationContext();\n\n\tconst isActive = page === index;\n\tconst handleClick = () => {\n\t\tif (index !== undefined) {\n\t\t\tsetPage(index);\n\t\t}\n\t};\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={handleClick}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(index ?? 0, el))}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200\",\n\t\t\t\t{\n\t\t\t\t\t\"bg-gray-700 text-white hover:bg-gray-800\": isActive,\n\t\t\t\t},\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\taria-current={isActive ? \"page\" : undefined}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children ?? index}\n\t\t</button>\n\t);\n}\n\n/**\n * Pagination Prev\n */\n\nexport type PaginationPrevProps = PropsWithChildren<\n\tReact.HTMLAttributes<HTMLButtonElement>\n> & {\n\tref?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Previous page button component for the Pagination.\n * Automatically disabled when on the first page.\n *\n * @example\n * ```tsx\n * <PaginationPrev>Previous</PaginationPrev>\n * ```\n */\nfunction PaginationPrev({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationPrevProps) {\n\tconst { registerRef, page, setPage, hasPreviousPage } =\n\t\tusePaginationContext();\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={() => setPage(page - 1)}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(0, el))}\n\t\t\tdisabled={!hasPreviousPage}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200 disabled:opacity-25\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\n/**\n * Pagination Next\n */\n\nexport type PaginationNextProps = PropsWithChildren<\n\tReact.HTMLAttributes<HTMLButtonElement>\n> & {\n\tref?: Ref<HTMLButtonElement>;\n};\n\n/**\n * Next page button component for the Pagination.\n * Automatically disabled when on the last page.\n *\n * @example\n * ```tsx\n * <PaginationNext>Next</PaginationNext>\n * ```\n */\nfunction PaginationNext({\n\tchildren,\n\tclassName,\n\tref,\n\t...props\n}: PaginationNextProps) {\n\tconst { page, setPage, hasNextPage, registerRef, totalPages } =\n\t\tusePaginationContext();\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-10 w-10 items-center justify-center rounded-full hover:bg-gray-200 disabled:opacity-25\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonClick={() => setPage(page + 1)}\n\t\t\tdisabled={!hasNextPage}\n\t\t\tref={mergeRefs(ref, (el) => registerRef(totalPages + 1, el))}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { Pagination, PaginationItem, PaginationNext, PaginationPrev };\n"]}
@@ -77,4 +77,4 @@ declare const PopoverTitle: import("react").ForwardRefExoticComponent<Omit<impor
77
77
  * Popover Description
78
78
  */
79
79
  declare const PopoverDescription: import("react").ForwardRefExoticComponent<Omit<import("@base-ui/react").PopoverDescriptionProps, "ref"> & import("react").RefAttributes<HTMLParagraphElement>>;
80
- export { Popover, PopoverTrigger, PopoverContent, PopoverClose, PopoverPortal, PopoverAnchor, PopoverTitle, PopoverDescription, };
80
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverPortal, PopoverTitle, PopoverTrigger, };
@@ -81,5 +81,5 @@ const PopoverTitle = PopoverPrimitive.Title;
81
81
  * Popover Description
82
82
  */
83
83
  const PopoverDescription = PopoverPrimitive.Description;
84
- export { Popover, PopoverTrigger, PopoverContent, PopoverClose, PopoverPortal, PopoverAnchor, PopoverTitle, PopoverDescription, };
84
+ export { Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverPortal, PopoverTitle, PopoverTrigger, };
85
85
  //# sourceMappingURL=popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","sourceRoot":"/","sources":["components/popover/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAc3D,MAAM,cAAc,GAAG,aAAa,CACnC,SAAS,CACT,CAAC;AAEF,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACrE,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAeF;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAS,OAAO,CAAC,EAChB,QAAQ,EACR,SAAS,GAAG,IAAI,EAChB,oBAAoB,GAAG,OAAO,EAC9B,eAAe,G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e,IAAI,CACnB,KAAC,YAAY,IACZ,SAAS,EAAC,wBAAwB,gBACtB,oBAAoB,YAEhC,KAAC,IAAI,IAAC,MAAM,EAAE,KAAC,UAAU,KAAG,EAAE,IAAI,EAAC,OAAO,GAAG,GAC/B,CACf,EACA,QAAQ,EACR,SAAS,IAAI,CACb,KAAC,gBAAgB,CAAC,KAAK,IAAC,SAAS,EAAC,qHAAqH,YACtJ,cAAK,SAAS,EAAC,mCAAmC,GAAG,GAC7B,CACzB,IACuB,GACI,GACL,CAC1B,CAAC;AACH,CAAC;AAQD,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAqB;IACpE,OAAO,KAAC,gBAAgB,CAAC,KAAK,IAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,KAAM,KAAK,GAAI,CAAC;AAC9E,CAAC;AAED;;GAEG;AAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAY9C,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAsB;IACrE,OAAO,CACN,KAAC,gBAAgB,CAAC,UAAU,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YAC9C,QAAQ,GACoB,CAC9B,CAAC;AACH,CAAC;AAED;;GAEG;AAEH,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAE5C;;GAEG;AAEH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,WAAW,CAAC;AAExD,OAAO,EACN,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,kBAAkB,GAClB,CAAC","sourcesContent":["import { Popover as PopoverPrimitive } from \"@base-ui/react/popover\";\nimport { Icon } from \"@components/icon/icon\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Popover Context\n */\n\ntype PopoverContextValue = {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tshowCloseButton?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n};\n\nconst PopoverContext = createContext<PopoverContextValue | undefined>(\n\tundefined,\n);\n\nconst usePopoverContext = () => {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow new Error(\"Popover components must be used within a Popover\");\n\t}\n\treturn context;\n};\n\n/**\n * Popover\n */\n\nexport type PopoverProps = {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tshowCloseButton?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n\tchildren?: React.ReactNode;\n} & ComponentProps<typeof PopoverPrimitive.Root>;\n\n/**\n * Popover component that provides a popover container with a trigger and content.\n *\n * @param {boolean} [props.showArrow=true] - Whether to show the arrow pointing to the trigger\n * @param {string} [props.closeButtonAriaLabel=\"Close\"] - Aria label for the close button\n * @param {boolean} [props.showCloseButton=true] - Whether to show the close button\n * @param {\"top\" | \"right\" | \"bottom\" | \"left\"} [props.side] - The preferred side to show the popover\n * @param {number} [props.sideOffset=4] - The offset from the trigger\n *\n * @example\n * ```tsx\n * <Popover>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <PopoverContent>\n * <p>Popover content goes here</p>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nfunction Popover({\n\tchildren,\n\tshowArrow = true,\n\tcloseButtonAriaLabel = \"Close\",\n\tshowCloseButton = true,\n\tside,\n\tsideOffset = 10,\n\t...props\n}: PopoverProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tshowArrow,\n\t\t\tcloseButtonAriaLabel,\n\t\t\tside,\n\t\t\tshowCloseButton,\n\t\t\tsideOffset,\n\t\t}),\n\t\t[showArrow, closeButtonAriaLabel, side, showCloseButton, sideOffset],\n\t);\n\treturn (\n\t\t<PopoverContext.Provider value={contextValue}>\n\t\t\t<PopoverPrimitive.Root {...props}>{children}</PopoverPrimitive.Root>\n\t\t</PopoverContext.Provider>\n\t);\n}\n\nexport type PopoverTriggerProps = ComponentProps<\n\ttypeof PopoverPrimitive.Trigger\n>;\n\nfunction PopoverTrigger({ className, ref, ...props }: PopoverTriggerProps) {\n\treturn (\n\t\t<PopoverPrimitive.Trigger ref={ref} className={className} {...props} />\n\t);\n}\n\nexport type PopoverContentProps = ComponentProps<\n\ttypeof PopoverPrimitive.Popup\n> & {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tsideOffset?: number;\n};\n\n/**\n * Popover Content\n */\n\n/**\n * Popover Content component that provides the content area for the Popover.\n * Inherits size from parent Popover component.\n *\n * @example\n * ```tsx\n * <PopoverContent>\n * <p>Popover content goes here</p>\n * </PopoverContent>\n * ```\n */\nfunction PopoverContent({\n\tchildren,\n\tclassName,\n\tsideOffset: sideOffsetProp,\n\tref,\n\t...props\n}: PopoverContentProps) {\n\tconst {\n\t\tshowArrow,\n\t\tcloseButtonAriaLabel,\n\t\tside,\n\t\tshowCloseButton,\n\t\tsideOffset: sideOffsetContext,\n\t} = usePopoverContext();\n\tconst sideOffset = sideOffsetProp ?? sideOffsetContext ?? 10;\n\n\treturn (\n\t\t<PopoverPrimitive.Portal>\n\t\t\t<PopoverPrimitive.Positioner side={side} sideOffset={sideOffset}>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"relative z-50 w-fit max-w-72 rounded-md bg-gray-700 p-4 text-sm text-white shadow-md\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={ref}\n\t\t\t\t>\n\t\t\t\t\t{showCloseButton && (\n\t\t\t\t\t\t<PopoverClose\n\t\t\t\t\t\t\tclassName=\"absolute top-4 right-4\"\n\t\t\t\t\t\t\taria-label={closeButtonAriaLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon render={<Cross1Icon />} size=\"small\" />\n\t\t\t\t\t\t</PopoverClose>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className=\"data-[side=bottom]:-top-1.25 data-[side=left]:-right-1.25 data-[side=top]:-bottom-1.25 data-[side=right]:-left-1.25\">\n\t\t\t\t\t\t\t<div className=\"h-2.5 w-2.5 rotate-45 bg-gray-700\" />\n\t\t\t\t\t\t</PopoverPrimitive.Arrow>\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * Popover Close\n */\n\nexport type PopoverCloseProps = ComponentProps<typeof PopoverPrimitive.Close>;\n\nfunction PopoverClose({ className, ref, ...props }: PopoverCloseProps) {\n\treturn <PopoverPrimitive.Close ref={ref} className={className} {...props} />;\n}\n\n/**\n * Popover Portal\n */\n\nconst PopoverPortal = PopoverPrimitive.Portal;\n\n/**\n * Popover Anchor\n */\n\nexport type PopoverAnchorProps = ComponentProps<\n\ttypeof PopoverPrimitive.Positioner\n> & {\n\tchildren?: React.ReactNode;\n};\n\nfunction PopoverAnchor({ children, ref, ...props }: PopoverAnchorProps) {\n\treturn (\n\t\t<PopoverPrimitive.Positioner ref={ref} {...props}>\n\t\t\t{children}\n\t\t</PopoverPrimitive.Positioner>\n\t);\n}\n\n/**\n * Popover Title\n */\n\nconst PopoverTitle = PopoverPrimitive.Title;\n\n/**\n * Popover Description\n */\n\nconst PopoverDescription = PopoverPrimitive.Description;\n\nexport {\n\tPopover,\n\tPopoverTrigger,\n\tPopoverContent,\n\tPopoverClose,\n\tPopoverPortal,\n\tPopoverAnchor,\n\tPopoverTitle,\n\tPopoverDescription,\n};\n"]}
1
+ {"version":3,"file":"popover.js","sourceRoot":"/","sources":["components/popover/popover.tsx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,KAAM,KAAK,GAAI,CAAC;AAC9E,CAAC;AAED;;GAEG;AAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC;AAY9C,SAAS,aAAa,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAsB;IACrE,OAAO,CACN,KAAC,gBAAgB,CAAC,UAAU,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,YAC9C,QAAQ,GACoB,CAC9B,CAAC;AACH,CAAC;AAED;;GAEG;AAEH,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC;AAE5C;;GAEG;AAEH,MAAM,kBAAkB,GAAG,gBAAgB,CAAC,WAAW,CAAC;AAExD,OAAO,EACN,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,cAAc,GACd,CAAC","sourcesContent":["import { Popover as PopoverPrimitive } from \"@base-ui/react/popover\";\nimport { Icon } from \"@components/icon/icon\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Popover Context\n */\n\ntype PopoverContextValue = {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tshowCloseButton?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n};\n\nconst PopoverContext = createContext<PopoverContextValue | undefined>(\n\tundefined,\n);\n\nconst usePopoverContext = () => {\n\tconst context = useContext(PopoverContext);\n\tif (!context) {\n\t\tthrow new Error(\"Popover components must be used within a Popover\");\n\t}\n\treturn context;\n};\n\n/**\n * Popover\n */\n\nexport type PopoverProps = {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tshowCloseButton?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n\tchildren?: React.ReactNode;\n} & ComponentProps<typeof PopoverPrimitive.Root>;\n\n/**\n * Popover component that provides a popover container with a trigger and content.\n *\n * @param {boolean} [props.showArrow=true] - Whether to show the arrow pointing to the trigger\n * @param {string} [props.closeButtonAriaLabel=\"Close\"] - Aria label for the close button\n * @param {boolean} [props.showCloseButton=true] - Whether to show the close button\n * @param {\"top\" | \"right\" | \"bottom\" | \"left\"} [props.side] - The preferred side to show the popover\n * @param {number} [props.sideOffset=4] - The offset from the trigger\n *\n * @example\n * ```tsx\n * <Popover>\n * <PopoverTrigger>Open Popover</PopoverTrigger>\n * <PopoverContent>\n * <p>Popover content goes here</p>\n * </PopoverContent>\n * </Popover>\n * ```\n */\nfunction Popover({\n\tchildren,\n\tshowArrow = true,\n\tcloseButtonAriaLabel = \"Close\",\n\tshowCloseButton = true,\n\tside,\n\tsideOffset = 10,\n\t...props\n}: PopoverProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tshowArrow,\n\t\t\tcloseButtonAriaLabel,\n\t\t\tside,\n\t\t\tshowCloseButton,\n\t\t\tsideOffset,\n\t\t}),\n\t\t[showArrow, closeButtonAriaLabel, side, showCloseButton, sideOffset],\n\t);\n\treturn (\n\t\t<PopoverContext.Provider value={contextValue}>\n\t\t\t<PopoverPrimitive.Root {...props}>{children}</PopoverPrimitive.Root>\n\t\t</PopoverContext.Provider>\n\t);\n}\n\nexport type PopoverTriggerProps = ComponentProps<\n\ttypeof PopoverPrimitive.Trigger\n>;\n\nfunction PopoverTrigger({ className, ref, ...props }: PopoverTriggerProps) {\n\treturn (\n\t\t<PopoverPrimitive.Trigger ref={ref} className={className} {...props} />\n\t);\n}\n\nexport type PopoverContentProps = ComponentProps<\n\ttypeof PopoverPrimitive.Popup\n> & {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\n\tsideOffset?: number;\n};\n\n/**\n * Popover Content\n */\n\n/**\n * Popover Content component that provides the content area for the Popover.\n * Inherits size from parent Popover component.\n *\n * @example\n * ```tsx\n * <PopoverContent>\n * <p>Popover content goes here</p>\n * </PopoverContent>\n * ```\n */\nfunction PopoverContent({\n\tchildren,\n\tclassName,\n\tsideOffset: sideOffsetProp,\n\tref,\n\t...props\n}: PopoverContentProps) {\n\tconst {\n\t\tshowArrow,\n\t\tcloseButtonAriaLabel,\n\t\tside,\n\t\tshowCloseButton,\n\t\tsideOffset: sideOffsetContext,\n\t} = usePopoverContext();\n\tconst sideOffset = sideOffsetProp ?? sideOffsetContext ?? 10;\n\n\treturn (\n\t\t<PopoverPrimitive.Portal>\n\t\t\t<PopoverPrimitive.Positioner side={side} sideOffset={sideOffset}>\n\t\t\t\t<PopoverPrimitive.Popup\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"relative z-50 w-fit max-w-72 rounded-md bg-gray-700 p-4 text-sm text-white shadow-md\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={ref}\n\t\t\t\t>\n\t\t\t\t\t{showCloseButton && (\n\t\t\t\t\t\t<PopoverClose\n\t\t\t\t\t\t\tclassName=\"absolute top-4 right-4\"\n\t\t\t\t\t\t\taria-label={closeButtonAriaLabel}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon render={<Cross1Icon />} size=\"small\" />\n\t\t\t\t\t\t</PopoverClose>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<PopoverPrimitive.Arrow className=\"data-[side=bottom]:-top-1.25 data-[side=left]:-right-1.25 data-[side=top]:-bottom-1.25 data-[side=right]:-left-1.25\">\n\t\t\t\t\t\t\t<div className=\"h-2.5 w-2.5 rotate-45 bg-gray-700\" />\n\t\t\t\t\t\t</PopoverPrimitive.Arrow>\n\t\t\t\t\t)}\n\t\t\t\t</PopoverPrimitive.Popup>\n\t\t\t</PopoverPrimitive.Positioner>\n\t\t</PopoverPrimitive.Portal>\n\t);\n}\n\n/**\n * Popover Close\n */\n\nexport type PopoverCloseProps = ComponentProps<typeof PopoverPrimitive.Close>;\n\nfunction PopoverClose({ className, ref, ...props }: PopoverCloseProps) {\n\treturn <PopoverPrimitive.Close ref={ref} className={className} {...props} />;\n}\n\n/**\n * Popover Portal\n */\n\nconst PopoverPortal = PopoverPrimitive.Portal;\n\n/**\n * Popover Anchor\n */\n\nexport type PopoverAnchorProps = ComponentProps<\n\ttypeof PopoverPrimitive.Positioner\n> & {\n\tchildren?: React.ReactNode;\n};\n\nfunction PopoverAnchor({ children, ref, ...props }: PopoverAnchorProps) {\n\treturn (\n\t\t<PopoverPrimitive.Positioner ref={ref} {...props}>\n\t\t\t{children}\n\t\t</PopoverPrimitive.Positioner>\n\t);\n}\n\n/**\n * Popover Title\n */\n\nconst PopoverTitle = PopoverPrimitive.Title;\n\n/**\n * Popover Description\n */\n\nconst PopoverDescription = PopoverPrimitive.Description;\n\nexport {\n\tPopover,\n\tPopoverAnchor,\n\tPopoverClose,\n\tPopoverContent,\n\tPopoverDescription,\n\tPopoverPortal,\n\tPopoverTitle,\n\tPopoverTrigger,\n};\n"]}
@@ -51,4 +51,4 @@ declare function SelectItem({ className, children, ref, ...props }: SelectItemPr
51
51
  */
52
52
  export type SelectSeparatorProps = ComponentProps<typeof SelectPrimitive.Separator>;
53
53
  declare function SelectSeparator({ className, ref, ...props }: SelectSeparatorProps): import("react/jsx-runtime").JSX.Element;
54
- export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpArrow, SelectScrollDownArrow, };
54
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, };
@@ -39,5 +39,5 @@ function SelectItem({ className, children, ref, ...props }) {
39
39
  function SelectSeparator({ className, ref, ...props }) {
40
40
  return (_jsx(SelectPrimitive.Separator, { ref: ref, className: cn("my-2 h-px bg-gray-200", className), ...props }));
41
41
  }
42
- export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpArrow, SelectScrollDownArrow, };
42
+ export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, };
43
43
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"/","sources":["components/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EACN,SAAS,EACT,eAAe,EACf,aAAa,GACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAStC,SAAS,MAAM,CAAC,EACf,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,eAAe,EACzB,GAAG,KAAK,EACK;IACb,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,cAAc,CAAC;QAC7C,QAAQ,EAAE,eAAe;QACzB,QAAQ,EAAE,eAAe;KACzB,CAAC,CAAC;IACH,OAAO,CACN,KAAC,eAAe,CAAC,IAAI,IAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,KAAM,KAAK,GAAI,CAC3E,CAAC;AACH,CAAC;AAED;;GAEG;AAEH,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,CAAC;AAQ1C,SAAS,WAAW,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IACvD,OAAO,KAAC,eAAe,CAAC,KAAK,IAAC,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAAC;AACvD,CAAC;AAQD,SAAS,aAAa,CAAC,EACtB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,KAA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aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,qBAAqB,GACrB,CAAC","sourcesContent":["import { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { useFormContext } from \"@components/form-field/form-field-context\";\nimport { Icon } from \"@components/icon/icon\";\nimport {\n\tCheckIcon,\n\tChevronDownIcon,\n\tChevronUpIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\n/**\n * Select\n */\n\nexport type SelectProps = ComponentProps<typeof SelectPrimitive.Root>;\n\nfunction Select({\n\tdisabled: initialDisabled,\n\trequired: initialRequired,\n\t...props\n}: SelectProps) {\n\tconst { disabled, required } = useFormContext({\n\t\tdisabled: initialDisabled,\n\t\trequired: initialRequired,\n\t});\n\treturn (\n\t\t<SelectPrimitive.Root disabled={disabled} required={required} {...props} />\n\t);\n}\n\n/**\n * SelectGroup\n */\n\nconst SelectGroup = SelectPrimitive.Group;\n\n/**\n * SelectValue\n */\n\nexport type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value>;\n\nfunction SelectValue({ ref, ...props }: SelectValueProps) {\n\treturn <SelectPrimitive.Value ref={ref} {...props} />;\n}\n\n/**\n * SelectTrigger\n */\n\nexport type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger>;\n\nfunction SelectTrigger({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: SelectTriggerProps) {\n\treturn (\n\t\t<SelectPrimitive.Trigger\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-gray-400 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-gray-500 [&>span]:line-clamp-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<SelectPrimitive.Icon\n\t\t\t\trender={\n\t\t\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t</Icon>\n\t\t\t\t}\n\t\t\t/>\n\t\t</SelectPrimitive.Trigger>\n\t);\n}\n\n/**\n * SelectScrollUpArrow\n */\n\nexport type SelectScrollUpArrowProps = ComponentProps<\n\ttypeof SelectPrimitive.ScrollUpArrow\n>;\n\nfunction SelectScrollUpArrow({\n\tclassName,\n\tref,\n\t...props\n}: SelectScrollUpArrowProps) {\n\treturn (\n\t\t<SelectPrimitive.ScrollUpArrow\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t<ChevronUpIcon />\n\t\t\t</Icon>\n\t\t</SelectPrimitive.ScrollUpArrow>\n\t);\n}\n\n/**\n * SelectScrollDownArrow\n */\n\nexport type SelectScrollDownArrowProps = ComponentProps<\n\ttypeof SelectPrimitive.ScrollDownArrow\n>;\n\nfunction SelectScrollDownArrow({\n\tclassName,\n\tref,\n\t...props\n}: SelectScrollDownArrowProps) {\n\treturn (\n\t\t<SelectPrimitive.ScrollDownArrow\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t<ChevronDownIcon />\n\t\t\t</Icon>\n\t\t</SelectPrimitive.ScrollDownArrow>\n\t);\n}\n\n/**\n * SelectContent\n */\n\nexport type SelectContentProps = ComponentProps<\n\ttypeof SelectPrimitive.Popup\n> & {\n\tsideOffset?: number;\n};\n\nfunction SelectContent({\n\tclassName,\n\tchildren,\n\tsideOffset = 4,\n\tref,\n\t...props\n}: SelectContentProps) {\n\treturn (\n\t\t<SelectPrimitive.Portal>\n\t\t\t<SelectPrimitive.Positioner\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\talignItemWithTrigger={false}\n\t\t\t>\n\t\t\t\t<SelectScrollUpArrow />\n\t\t\t\t<SelectPrimitive.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-closed:fade-out data-closed:zoom-out-95 data-open:fade-in data-open:zoom-in-95 relative z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md border border-gray-400 bg-white text-gray-700 shadow-md transition-all data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1 data-closed:animate-out data-open:animate-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t<SelectPrimitive.List className=\"w-full min-w-(--anchor-width) p-1\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectPrimitive.List>\n\t\t\t\t</SelectPrimitive.Popup>\n\t\t\t\t<SelectScrollDownArrow />\n\t\t\t</SelectPrimitive.Positioner>\n\t\t</SelectPrimitive.Portal>\n\t);\n}\n\n/**\n * SelectLabel\n */\n\nexport type SelectLabelProps = ComponentProps<\n\ttypeof SelectPrimitive.GroupLabel\n>;\n\nfunction SelectLabel({ className, ref, ...props }: SelectLabelProps) {\n\treturn (\n\t\t<SelectPrimitive.GroupLabel\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"px-2 py-1.5 font-semibold text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * SelectItem\n */\n\nexport type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item>;\n\nfunction SelectItem({ className, children, ref, ...props }: SelectItemProps) {\n\treturn (\n\t\t<SelectPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none data-disabled:pointer-events-none data-highlighted:bg-gray-700 data-highlighted:text-white data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<SelectPrimitive.ItemIndicator>\n\t\t\t\t\t<Icon size=\"small\">\n\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t</Icon>\n\t\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t</SelectPrimitive.Item>\n\t);\n}\n\n/**\n * SelectSeparator\n */\n\nexport type SelectSeparatorProps = ComponentProps<\n\ttypeof SelectPrimitive.Separator\n>;\n\nfunction SelectSeparator({ className, ref, ...props }: SelectSeparatorProps) {\n\treturn (\n\t\t<SelectPrimitive.Separator\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"my-2 h-px bg-gray-200\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tSelect,\n\tSelectGroup,\n\tSelectValue,\n\tSelectTrigger,\n\tSelectContent,\n\tSelectLabel,\n\tSelectItem,\n\tSelectSeparator,\n\tSelectScrollUpArrow,\n\tSelectScrollDownArrow,\n};\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"/","sources":["components/select/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OA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AK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAmB;IAC1E,OAAO,CACN,MAAC,eAAe,CAAC,IAAI,IACpB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mOAAmO,EACnO,SAAS,CACT,KACG,KAAK,aAET,eAAM,SAAS,EAAC,+DAA+D,YAC9E,KAAC,eAAe,CAAC,aAAa,cAC7B,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YACjB,KAAC,SAAS,KAAG,GACP,GACwB,GAC1B,EACP,KAAC,eAAe,CAAC,QAAQ,cAAE,QAAQ,GAA4B,IACzC,CACvB,CAAC;AACH,CAAC;AAUD,SAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAwB;IAC1E,OAAO,CACN,KAAC,eAAe,CAAC,SAAS,IACzB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAC7C,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,EACf,aAAa,EACb,WAAW,GACX,CAAC","sourcesContent":["import { Select as SelectPrimitive } from \"@base-ui/react/select\";\nimport { useFormContext } from \"@components/form-field/form-field-context\";\nimport { Icon } from \"@components/icon/icon\";\nimport {\n\tCheckIcon,\n\tChevronDownIcon,\n\tChevronUpIcon,\n} from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\n/**\n * Select\n */\n\nexport type SelectProps = ComponentProps<typeof SelectPrimitive.Root>;\n\nfunction Select({\n\tdisabled: initialDisabled,\n\trequired: initialRequired,\n\t...props\n}: SelectProps) {\n\tconst { disabled, required } = useFormContext({\n\t\tdisabled: initialDisabled,\n\t\trequired: initialRequired,\n\t});\n\treturn (\n\t\t<SelectPrimitive.Root disabled={disabled} required={required} {...props} />\n\t);\n}\n\n/**\n * SelectGroup\n */\n\nconst SelectGroup = SelectPrimitive.Group;\n\n/**\n * SelectValue\n */\n\nexport type SelectValueProps = ComponentProps<typeof SelectPrimitive.Value>;\n\nfunction SelectValue({ ref, ...props }: SelectValueProps) {\n\treturn <SelectPrimitive.Value ref={ref} {...props} />;\n}\n\n/**\n * SelectTrigger\n */\n\nexport type SelectTriggerProps = ComponentProps<typeof SelectPrimitive.Trigger>;\n\nfunction SelectTrigger({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: SelectTriggerProps) {\n\treturn (\n\t\t<SelectPrimitive.Trigger\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-gray-400 bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-placeholder:text-gray-500 [&>span]:line-clamp-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<SelectPrimitive.Icon\n\t\t\t\trender={\n\t\t\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t\t\t<ChevronDownIcon />\n\t\t\t\t\t</Icon>\n\t\t\t\t}\n\t\t\t/>\n\t\t</SelectPrimitive.Trigger>\n\t);\n}\n\n/**\n * SelectScrollUpArrow\n */\n\nexport type SelectScrollUpArrowProps = ComponentProps<\n\ttypeof SelectPrimitive.ScrollUpArrow\n>;\n\nfunction SelectScrollUpArrow({\n\tclassName,\n\tref,\n\t...props\n}: SelectScrollUpArrowProps) {\n\treturn (\n\t\t<SelectPrimitive.ScrollUpArrow\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t<ChevronUpIcon />\n\t\t\t</Icon>\n\t\t</SelectPrimitive.ScrollUpArrow>\n\t);\n}\n\n/**\n * SelectScrollDownArrow\n */\n\nexport type SelectScrollDownArrowProps = ComponentProps<\n\ttypeof SelectPrimitive.ScrollDownArrow\n>;\n\nfunction SelectScrollDownArrow({\n\tclassName,\n\tref,\n\t...props\n}: SelectScrollDownArrowProps) {\n\treturn (\n\t\t<SelectPrimitive.ScrollDownArrow\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"flex cursor-default items-center justify-center py-1\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<Icon size=\"small\" className=\"opacity-50\">\n\t\t\t\t<ChevronDownIcon />\n\t\t\t</Icon>\n\t\t</SelectPrimitive.ScrollDownArrow>\n\t);\n}\n\n/**\n * SelectContent\n */\n\nexport type SelectContentProps = ComponentProps<\n\ttypeof SelectPrimitive.Popup\n> & {\n\tsideOffset?: number;\n};\n\nfunction SelectContent({\n\tclassName,\n\tchildren,\n\tsideOffset = 4,\n\tref,\n\t...props\n}: SelectContentProps) {\n\treturn (\n\t\t<SelectPrimitive.Portal>\n\t\t\t<SelectPrimitive.Positioner\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\talignItemWithTrigger={false}\n\t\t\t>\n\t\t\t\t<SelectScrollUpArrow />\n\t\t\t\t<SelectPrimitive.Popup\n\t\t\t\t\tref={ref}\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-closed:fade-out data-closed:zoom-out-95 data-open:fade-in data-open:zoom-in-95 relative z-50 max-h-(--available-height) min-w-32 origin-(--transform-origin) overflow-y-auto overflow-x-hidden rounded-md border border-gray-400 bg-white text-gray-700 shadow-md transition-all data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1 data-closed:animate-out data-open:animate-in\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t<SelectPrimitive.List className=\"w-full min-w-(--anchor-width) p-1\">\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</SelectPrimitive.List>\n\t\t\t\t</SelectPrimitive.Popup>\n\t\t\t\t<SelectScrollDownArrow />\n\t\t\t</SelectPrimitive.Positioner>\n\t\t</SelectPrimitive.Portal>\n\t);\n}\n\n/**\n * SelectLabel\n */\n\nexport type SelectLabelProps = ComponentProps<\n\ttypeof SelectPrimitive.GroupLabel\n>;\n\nfunction SelectLabel({ className, ref, ...props }: SelectLabelProps) {\n\treturn (\n\t\t<SelectPrimitive.GroupLabel\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"px-2 py-1.5 font-semibold text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * SelectItem\n */\n\nexport type SelectItemProps = ComponentProps<typeof SelectPrimitive.Item>;\n\nfunction SelectItem({ className, children, ref, ...props }: SelectItemProps) {\n\treturn (\n\t\t<SelectPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pr-8 pl-2 text-sm outline-none data-disabled:pointer-events-none data-highlighted:bg-gray-700 data-highlighted:text-white data-disabled:opacity-50\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<span className=\"absolute right-2 flex h-3.5 w-3.5 items-center justify-center\">\n\t\t\t\t<SelectPrimitive.ItemIndicator>\n\t\t\t\t\t<Icon size=\"small\">\n\t\t\t\t\t\t<CheckIcon />\n\t\t\t\t\t</Icon>\n\t\t\t\t</SelectPrimitive.ItemIndicator>\n\t\t\t</span>\n\t\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t</SelectPrimitive.Item>\n\t);\n}\n\n/**\n * SelectSeparator\n */\n\nexport type SelectSeparatorProps = ComponentProps<\n\ttypeof SelectPrimitive.Separator\n>;\n\nfunction SelectSeparator({ className, ref, ...props }: SelectSeparatorProps) {\n\treturn (\n\t\t<SelectPrimitive.Separator\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"my-2 h-px bg-gray-200\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tSelect,\n\tSelectContent,\n\tSelectGroup,\n\tSelectItem,\n\tSelectLabel,\n\tSelectScrollDownArrow,\n\tSelectScrollUpArrow,\n\tSelectSeparator,\n\tSelectTrigger,\n\tSelectValue,\n};\n"]}
@@ -39,4 +39,4 @@ declare function TableCell({ className, ref, ...props }: TableCellProps): import
39
39
  */
40
40
  export type TableCaptionProps = ComponentProps<"caption">;
41
41
  declare function TableCaption({ className, ref, ...props }: TableCaptionProps): import("react/jsx-runtime").JSX.Element;
42
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
42
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
@@ -24,5 +24,5 @@ function TableCell({ className, ref, ...props }) {
24
24
  function TableCaption({ className, ref, ...props }) {
25
25
  return (_jsx("caption", { ref: ref, className: cn("mt-4 text-start text-gray-500 text-sm", className), ...props }));
26
26
  }
27
- export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, };
27
+ export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, };
28
28
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","sourceRoot":"/","sources":["components/table/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAStC,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CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAkB;IAC9D,OAAO,CACN,aACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,sFAAsF,EACtF,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAqB;IACpE,OAAO,CACN,kBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,KAC7D,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACZ,CAAC","sourcesContent":["import { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\n/**\n * Table\n */\n\nexport type TableProps = ComponentProps<\"table\">;\n\nfunction Table({ className, ref, ...props }: TableProps) {\n\treturn (\n\t\t<div className=\"relative w-full overflow-auto\">\n\t\t\t<table\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\"w-full caption-bottom text-sm\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * TableHeader\n */\n\nexport type TableHeaderProps = ComponentProps<\"thead\">;\n\nfunction TableHeader({ className, ref, ...props }: TableHeaderProps) {\n\treturn (\n\t\t<thead\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"[&_tr]:border-b [&_tr]:bg-gray-700! [&_tr]:text-white [&_tr]:hover:bg-gray-700! [&_tr]:hover:text-white!\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableBody\n */\n\nexport type TableBodyProps = ComponentProps<\"tbody\">;\n\nfunction TableBody({ className, ref, ...props }: TableBodyProps) {\n\treturn (\n\t\t<tbody\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"[&_tr:last-child]:border-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableFooter\n */\n\nexport type TableFooterProps = ComponentProps<\"tfoot\">;\n\nfunction TableFooter({ className, ref, ...props }: TableFooterProps) {\n\treturn (\n\t\t<tfoot\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"border-t bg-gray-100 font-medium [&>tr]:bg-gray-100! [&>tr]:text-gray-700! [&>tr]:last:border-b-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableRow\n */\n\nexport type TableRowProps = ComponentProps<\"tr\">;\n\nfunction TableRow({ className, ref, ...props }: TableRowProps) {\n\treturn (\n\t\t<tr\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"border-b transition-colors hover:bg-gray-400 hover:text-white data-[state=selected]:bg-gray-500 data-[state=selected]:text-white\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableHead\n */\n\nexport type TableHeadProps = ComponentProps<\"th\">;\n\nfunction TableHead({ className, ref, ...props }: TableHeadProps) {\n\treturn (\n\t\t<th\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableCell\n */\n\nexport type TableCellProps = ComponentProps<\"td\">;\n\nfunction TableCell({ className, ref, ...props }: TableCellProps) {\n\treturn (\n\t\t<td\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableCaption\n */\n\nexport type TableCaptionProps = ComponentProps<\"caption\">;\n\nfunction TableCaption({ className, ref, ...props }: TableCaptionProps) {\n\treturn (\n\t\t<caption\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"mt-4 text-start text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableHeader,\n\tTableBody,\n\tTableFooter,\n\tTableHead,\n\tTableRow,\n\tTableCell,\n\tTableCaption,\n};\n"]}
1
+ {"version":3,"file":"table.js","sourceRoot":"/","sources":["components/table/table.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAStC,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAc;IACtD,OAAO,CACN,cAAK,SAAS,EAAC,+BAA+B,YAC7C,gBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,SAAS,CAAC,KACrD,KAAK,GACR,GACG,CACN,CAAC;AACH,CAAC;AAQD,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,gBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,0GAA0G,EAC1G,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAkB;IAC9D,OAAO,CACN,gBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,4BAA4B,EAAE,SAAS,CAAC,KAClD,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,gBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mGAAmG,EACnG,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAiB;IAC5D,OAAO,CACN,aACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,kIAAkI,EAClI,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAkB;IAC9D,OAAO,CACN,aACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,kHAAkH,EAClH,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAkB;IAC9D,OAAO,CACN,aACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,sFAAsF,EACtF,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAQD,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAqB;IACpE,OAAO,CACN,kBACC,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CAAC,uCAAuC,EAAE,SAAS,CAAC,KAC7D,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EACN,KAAK,EACL,SAAS,EACT,YAAY,EACZ,SAAS,EACT,WAAW,EACX,SAAS,EACT,WAAW,EACX,QAAQ,GACR,CAAC","sourcesContent":["import { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\n/**\n * Table\n */\n\nexport type TableProps = ComponentProps<\"table\">;\n\nfunction Table({ className, ref, ...props }: TableProps) {\n\treturn (\n\t\t<div className=\"relative w-full overflow-auto\">\n\t\t\t<table\n\t\t\t\tref={ref}\n\t\t\t\tclassName={cn(\"w-full caption-bottom text-sm\", className)}\n\t\t\t\t{...props}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\n/**\n * TableHeader\n */\n\nexport type TableHeaderProps = ComponentProps<\"thead\">;\n\nfunction TableHeader({ className, ref, ...props }: TableHeaderProps) {\n\treturn (\n\t\t<thead\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"[&_tr]:border-b [&_tr]:bg-gray-700! [&_tr]:text-white [&_tr]:hover:bg-gray-700! [&_tr]:hover:text-white!\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableBody\n */\n\nexport type TableBodyProps = ComponentProps<\"tbody\">;\n\nfunction TableBody({ className, ref, ...props }: TableBodyProps) {\n\treturn (\n\t\t<tbody\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"[&_tr:last-child]:border-0\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableFooter\n */\n\nexport type TableFooterProps = ComponentProps<\"tfoot\">;\n\nfunction TableFooter({ className, ref, ...props }: TableFooterProps) {\n\treturn (\n\t\t<tfoot\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"border-t bg-gray-100 font-medium [&>tr]:bg-gray-100! [&>tr]:text-gray-700! [&>tr]:last:border-b-0\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableRow\n */\n\nexport type TableRowProps = ComponentProps<\"tr\">;\n\nfunction TableRow({ className, ref, ...props }: TableRowProps) {\n\treturn (\n\t\t<tr\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"border-b transition-colors hover:bg-gray-400 hover:text-white data-[state=selected]:bg-gray-500 data-[state=selected]:text-white\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableHead\n */\n\nexport type TableHeadProps = ComponentProps<\"th\">;\n\nfunction TableHead({ className, ref, ...props }: TableHeadProps) {\n\treturn (\n\t\t<th\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"h-10 px-2 text-left align-middle font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableCell\n */\n\nexport type TableCellProps = ComponentProps<\"td\">;\n\nfunction TableCell({ className, ref, ...props }: TableCellProps) {\n\treturn (\n\t\t<td\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\n/**\n * TableCaption\n */\n\nexport type TableCaptionProps = ComponentProps<\"caption\">;\n\nfunction TableCaption({ className, ref, ...props }: TableCaptionProps) {\n\treturn (\n\t\t<caption\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"mt-4 text-start text-gray-500 text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tTable,\n\tTableBody,\n\tTableCaption,\n\tTableCell,\n\tTableFooter,\n\tTableHead,\n\tTableHeader,\n\tTableRow,\n};\n"]}
@@ -7,4 +7,4 @@ export type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Tab>;
7
7
  declare function TabsTrigger({ className, ref, ...props }: TabsTriggerProps): import("react/jsx-runtime").JSX.Element;
8
8
  export type TabsContentProps = ComponentProps<typeof TabsPrimitive.Panel>;
9
9
  declare function TabsContent({ className, ref, ...props }: TabsContentProps): import("react/jsx-runtime").JSX.Element;
10
- export { Tabs, TabsList, TabsTrigger, TabsContent };
10
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
@@ -11,5 +11,5 @@ function TabsTrigger({ className, ref, ...props }) {
11
11
  function TabsContent({ className, ref, ...props }) {
12
12
  return (_jsx(TabsPrimitive.Panel, { ref: ref, className: cn("mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-700 focus-visible:ring-offset-2", className), ...props }));
13
13
  }
14
- export { Tabs, TabsList, TabsTrigger, TabsContent };
14
+ export { Tabs, TabsContent, TabsList, TabsTrigger };
15
15
  //# sourceMappingURL=tabs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs.js","sourceRoot":"/","sources":["components/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AAIhC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAiB;IAC5D,OAAO,CACN,KAAC,aAAa,CAAC,IAAI,IAClB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mFAAmF,EACnF,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,KAAC,aAAa,CAAC,GAAG,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,yTAAyT,EACzT,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,KAAC,aAAa,CAAC,KAAK,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,8GAA8G,EAC9G,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { Tabs as TabsPrimitive } from \"@base-ui/react/tabs\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst Tabs = TabsPrimitive.Root;\n\nexport type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;\n\nfunction TabsList({ className, ref, ...props }: TabsListProps) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex h-10 items-center justify-center gap-2 bg-gray-100 px-1 text-gray-700\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Tab>;\n\nfunction TabsTrigger({ className, ref, ...props }: TabsTriggerProps) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-700 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-active:bg-white data-active:shadow-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type TabsContentProps = ComponentProps<typeof TabsPrimitive.Panel>;\n\nfunction TabsContent({ className, ref, ...props }: TabsContentProps) {\n\treturn (\n\t\t<TabsPrimitive.Panel\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-700 focus-visible:ring-offset-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n"]}
1
+ {"version":3,"file":"tabs.js","sourceRoot":"/","sources":["components/tabs/tabs.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAGtC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;AAIhC,SAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAiB;IAC5D,OAAO,CACN,KAAC,aAAa,CAAC,IAAI,IAClB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,mFAAmF,EACnF,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,KAAC,aAAa,CAAC,GAAG,IACjB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,yTAAyT,EACzT,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAID,SAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,KAAK,EAAoB;IAClE,OAAO,CACN,KAAC,aAAa,CAAC,KAAK,IACnB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,EAAE,CACZ,8GAA8G,EAC9G,SAAS,CACT,KACG,KAAK,GACR,CACF,CAAC;AACH,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC","sourcesContent":["import { Tabs as TabsPrimitive } from \"@base-ui/react/tabs\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\n\nconst Tabs = TabsPrimitive.Root;\n\nexport type TabsListProps = ComponentProps<typeof TabsPrimitive.List>;\n\nfunction TabsList({ className, ref, ...props }: TabsListProps) {\n\treturn (\n\t\t<TabsPrimitive.List\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex h-10 items-center justify-center gap-2 bg-gray-100 px-1 text-gray-700\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type TabsTriggerProps = ComponentProps<typeof TabsPrimitive.Tab>;\n\nfunction TabsTrigger({ className, ref, ...props }: TabsTriggerProps) {\n\treturn (\n\t\t<TabsPrimitive.Tab\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 font-medium text-sm transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-700 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-active:bg-white data-active:shadow-sm\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport type TabsContentProps = ComponentProps<typeof TabsPrimitive.Panel>;\n\nfunction TabsContent({ className, ref, ...props }: TabsContentProps) {\n\treturn (\n\t\t<TabsPrimitive.Panel\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-700 focus-visible:ring-offset-2\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Tabs, TabsContent, TabsList, TabsTrigger };\n"]}
@@ -24,4 +24,4 @@ declare function toast(toast: Omit<ToastProps, "id">): string | number;
24
24
  declare const Toaster: import("react").ForwardRefExoticComponent<ToasterProps & import("react").RefAttributes<HTMLElement>>;
25
25
  /** A fully custom toast built on top of sonner. */
26
26
  declare function Toast({ title, description, button, id, ref }: ToastProps): import("react/jsx-runtime").JSX.Element;
27
- export { toast, Toast, Toaster };
27
+ export { Toast, Toaster, toast };
@@ -26,5 +26,5 @@ function Toast({ title, description, button, id, ref }) {
26
26
  sonnerToast.dismiss(id);
27
27
  }, children: button.label }) })] }));
28
28
  }
29
- export { toast, Toast, Toaster };
29
+ export { Toast, Toaster, toast };
30
30
  //# sourceMappingURL=toast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"/","sources":["components/toast/toast.tsx"],"names":[],"mappings":";AACA,OAAO,EACN,OAAO,IAAI,aAAa,EACxB,KAAK,IAAI,WAAW,GAEpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAa1C;;;;;;;;;GASG;AACH,SAAS,KAAK,CAAC,KAA6B;IAC3C,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IAC9D,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CACjC,KAAC,KAAK,IACL,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE;YACP,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,KACG,YAAY,GACf,CACF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,mDAAmD;AACnD,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAc;IACjE,OAAO,CACN,eACC,SAAS,EAAC,kGAAkG,EAC5G,GAAG,EAAE,GAAG,aAER,cAAK,SAAS,EAAC,0BAA0B,YACxC,eAAK,SAAS,EAAC,cAAc,aAC5B,YAAG,SAAS,EAAC,mCAAmC,YAAE,KAAK,GAAK,EAC5D,YAAG,SAAS,EAAC,uBAAuB,YAAE,WAAW,GAAK,IACjD,GACD,EACN,cAAK,SAAS,EAAC,yCAAyC,YACvD,KAAC,MAAM,IACN,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE;wBACb,MAAM,CAAC,OAAO,EAAE,CAAC;wBACjB,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC,YAEA,MAAM,CAAC,KAAK,GACL,GACJ,IACD,CACN,CAAC;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { Ref } from \"react\";\nimport {\n\tToaster as SonnerToaster,\n\ttoast as sonnerToast,\n\ttype ToasterProps,\n} from \"sonner\";\nimport { Button } from \"../button/button\";\n\nexport type ToastProps = {\n\tid: string | number;\n\ttitle: string;\n\tdescription: string;\n\tbutton: {\n\t\tlabel: string;\n\t\tonClick: () => void;\n\t};\n\tref?: Ref<HTMLDivElement>;\n} & Omit<ToasterProps, \"id\">;\n\n/**\n * Creates a custom toast notification using the sonner toast library\n * @param toast - The toast configuration object without an ID\n * @param toast.title - The title text to display in the toast\n * @param toast.description - The description text to display in the toast\n * @param toast.button - Configuration for the toast's action button\n * @param toast.button.label - The text label for the action button\n * @param toast.button.onClick - Click handler function for the action button\n * @returns A unique identifier for the created toast\n */\nfunction toast(toast: Omit<ToastProps, \"id\">) {\n\tconst { title, description, button, ...toastOptions } = toast;\n\treturn sonnerToast.custom((id) => (\n\t\t<Toast\n\t\t\tid={id}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tbutton={{\n\t\t\t\tlabel: button.label,\n\t\t\t\tonClick: button.onClick,\n\t\t\t}}\n\t\t\t{...toastOptions}\n\t\t/>\n\t));\n}\n\nconst Toaster = SonnerToaster;\n\n/** A fully custom toast built on top of sonner. */\nfunction Toast({ title, description, button, id, ref }: ToastProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"flex w-full items-center gap-4 rounded-lg bg-white p-4 shadow-lg ring-1 ring-black/5 md:max-w-96\"\n\t\t\tref={ref}\n\t\t>\n\t\t\t<div className=\"flex flex-1 items-center\">\n\t\t\t\t<div className=\"w-full gap-1\">\n\t\t\t\t\t<p className=\"font-medium text-gray-900 text-sm\">{title}</p>\n\t\t\t\t\t<p className=\"text-gray-500 text-sm\">{description}</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"shrink-0 rounded-md font-medium text-sm\">\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tbutton.onClick();\n\t\t\t\t\t\tsonnerToast.dismiss(id);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{button.label}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { toast, Toast, Toaster };\n"]}
1
+ {"version":3,"file":"toast.js","sourceRoot":"/","sources":["components/toast/toast.tsx"],"names":[],"mappings":";AACA,OAAO,EACN,OAAO,IAAI,aAAa,EACxB,KAAK,IAAI,WAAW,GAEpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAa1C;;;;;;;;;GASG;AACH,SAAS,KAAK,CAAC,KAA6B;IAC3C,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,KAAK,CAAC;IAC9D,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CACjC,KAAC,KAAK,IACL,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE;YACP,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,MAAM,CAAC,OAAO;SACvB,KACG,YAAY,GACf,CACF,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,mDAAmD;AACnD,SAAS,KAAK,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAc;IACjE,OAAO,CACN,eACC,SAAS,EAAC,kGAAkG,EAC5G,GAAG,EAAE,GAAG,aAER,cAAK,SAAS,EAAC,0BAA0B,YACxC,eAAK,SAAS,EAAC,cAAc,aAC5B,YAAG,SAAS,EAAC,mCAAmC,YAAE,KAAK,GAAK,EAC5D,YAAG,SAAS,EAAC,uBAAuB,YAAE,WAAW,GAAK,IACjD,GACD,EACN,cAAK,SAAS,EAAC,yCAAyC,YACvD,KAAC,MAAM,IACN,IAAI,EAAC,OAAO,EACZ,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,GAAG,EAAE;wBACb,MAAM,CAAC,OAAO,EAAE,CAAC;wBACjB,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC,YAEA,MAAM,CAAC,KAAK,GACL,GACJ,IACD,CACN,CAAC;AACH,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC","sourcesContent":["import type { Ref } from \"react\";\nimport {\n\tToaster as SonnerToaster,\n\ttoast as sonnerToast,\n\ttype ToasterProps,\n} from \"sonner\";\nimport { Button } from \"../button/button\";\n\nexport type ToastProps = {\n\tid: string | number;\n\ttitle: string;\n\tdescription: string;\n\tbutton: {\n\t\tlabel: string;\n\t\tonClick: () => void;\n\t};\n\tref?: Ref<HTMLDivElement>;\n} & Omit<ToasterProps, \"id\">;\n\n/**\n * Creates a custom toast notification using the sonner toast library\n * @param toast - The toast configuration object without an ID\n * @param toast.title - The title text to display in the toast\n * @param toast.description - The description text to display in the toast\n * @param toast.button - Configuration for the toast's action button\n * @param toast.button.label - The text label for the action button\n * @param toast.button.onClick - Click handler function for the action button\n * @returns A unique identifier for the created toast\n */\nfunction toast(toast: Omit<ToastProps, \"id\">) {\n\tconst { title, description, button, ...toastOptions } = toast;\n\treturn sonnerToast.custom((id) => (\n\t\t<Toast\n\t\t\tid={id}\n\t\t\ttitle={title}\n\t\t\tdescription={description}\n\t\t\tbutton={{\n\t\t\t\tlabel: button.label,\n\t\t\t\tonClick: button.onClick,\n\t\t\t}}\n\t\t\t{...toastOptions}\n\t\t/>\n\t));\n}\n\nconst Toaster = SonnerToaster;\n\n/** A fully custom toast built on top of sonner. */\nfunction Toast({ title, description, button, id, ref }: ToastProps) {\n\treturn (\n\t\t<div\n\t\t\tclassName=\"flex w-full items-center gap-4 rounded-lg bg-white p-4 shadow-lg ring-1 ring-black/5 md:max-w-96\"\n\t\t\tref={ref}\n\t\t>\n\t\t\t<div className=\"flex flex-1 items-center\">\n\t\t\t\t<div className=\"w-full gap-1\">\n\t\t\t\t\t<p className=\"font-medium text-gray-900 text-sm\">{title}</p>\n\t\t\t\t\t<p className=\"text-gray-500 text-sm\">{description}</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div className=\"shrink-0 rounded-md font-medium text-sm\">\n\t\t\t\t<Button\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tbutton.onClick();\n\t\t\t\t\t\tsonnerToast.dismiss(id);\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{button.label}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { Toast, Toaster, toast };\n"]}
@@ -41,4 +41,4 @@ export type TooltipContentProps = ComponentProps<typeof TooltipPrimitive.Popup>
41
41
  showArrow?: boolean;
42
42
  };
43
43
  declare function TooltipContent({ className, children, ref, ...props }: TooltipContentProps): import("react/jsx-runtime").JSX.Element;
44
- export { Tooltip, TooltipTrigger, TooltipContent };
44
+ export { Tooltip, TooltipContent, TooltipTrigger };
@@ -45,5 +45,5 @@ function TooltipContent({ className, children, ref, ...props }) {
45
45
  const { showArrow, side, sideOffset } = useTooltipContext();
46
46
  return (_jsx(TooltipPrimitive.Portal, { children: _jsx(TooltipPrimitive.Positioner, { side: side, sideOffset: sideOffset ?? 10, children: _jsxs(TooltipPrimitive.Popup, { className: cn("relative z-50 w-fit max-w-72 rounded-md bg-gray-700 p-2 text-sm text-white shadow-md", className), ...props, ref: ref, children: [children, showArrow && (_jsx(TooltipPrimitive.Arrow, { className: "data-[side=bottom]:-top-1.25 data-[side=left]:-right-1.25 data-[side=top]:-bottom-1.25 data-[side=right]:-left-1.25", children: _jsx("div", { className: "h-2.5 w-2.5 rotate-45 bg-gray-700" }) }))] }) }) }));
47
47
  }
48
- export { Tooltip, TooltipTrigger, TooltipContent };
48
+ export { Tooltip, TooltipContent, TooltipTrigger };
49
49
  //# sourceMappingURL=tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","sourceRoot":"/","sources":["components/tooltip/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAY3D,MAAM,cAAc,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAEhF,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAaF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,OAAO,CAAC,EAChB,QAAQ,EACR,SAAS,GAAG,IAAI,EAChB,IAAI,EACJ,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,GAAG,EACnB,GAAG,KAAK,EACM;IACd,MA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,CAAC,KAAK,IAAC,SAAS,EAAC,qHAAqH,YACtJ,cAAK,SAAS,EAAC,mCAAmC,GAAG,GAC7B,CACzB,IACuB,GACI,GACL,CAC1B,CAAC;AACH,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Tooltip Context\n */\n\ntype TooltipContextType = {\n\tshowArrow?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n};\n\nconst TooltipContext = createContext<TooltipContextType | undefined>(undefined);\n\nconst useTooltipContext = () => {\n\tconst context = useContext(TooltipContext);\n\tif (!context) {\n\t\tthrow new Error(\"Tooltip components must be used within a TooltipProvider\");\n\t}\n\treturn context;\n};\n\n/**\n * Tooltip\n */\n\nexport type TooltipProps = ComponentProps<typeof TooltipPrimitive.Root> & {\n\tshowArrow?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n\tdelayDuration?: number;\n};\n\n/**\n * A tooltip component built on top of Base UI's tooltip primitive.\n *\n * @param {TooltipProps} props - The props for the Tooltip component\n * @param {boolean} [props.showArrow=true] - Whether to show the arrow pointing to the trigger\n * @param {\"top\" | \"right\" | \"bottom\" | \"left\"} [props.side] - The preferred side to show the tooltip\n * @param {number} [props.sideOffset=10] - Distance between the anchor and the popup\n * @param {number} [props.delayDuration=600] - How long to wait before opening the tooltip (in ms)\n *\n * @example\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger>Hover me</TooltipTrigger>\n * <TooltipContent>Tooltip content</TooltipContent>\n * </Tooltip>\n * ```\n */\nfunction Tooltip({\n\tchildren,\n\tshowArrow = true,\n\tside,\n\tsideOffset = 10,\n\tdelayDuration = 600,\n\t...props\n}: TooltipProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tshowArrow,\n\t\t\tside,\n\t\t\tsideOffset,\n\t\t}),\n\t\t[showArrow, side, sideOffset],\n\t);\n\treturn (\n\t\t<TooltipContext.Provider value={contextValue}>\n\t\t\t<TooltipPrimitive.Provider delay={delayDuration}>\n\t\t\t\t<TooltipPrimitive.Root {...props}>{children}</TooltipPrimitive.Root>\n\t\t\t</TooltipPrimitive.Provider>\n\t\t</TooltipContext.Provider>\n\t);\n}\n\n/**\n * Tooltip Trigger\n */\n\nexport type TooltipTriggerProps = ComponentProps<\n\ttypeof TooltipPrimitive.Trigger\n> & {\n\trender?: React.ReactElement;\n};\n\nfunction TooltipTrigger({\n\trender,\n\tchildren,\n\tref,\n\t...props\n}: TooltipTriggerProps) {\n\tif (render) {\n\t\treturn (\n\t\t\t<TooltipPrimitive.Trigger ref={ref} render={render} {...props}>\n\t\t\t\t{children}\n\t\t\t</TooltipPrimitive.Trigger>\n\t\t);\n\t}\n\treturn (\n\t\t<TooltipPrimitive.Trigger ref={ref} {...props}>\n\t\t\t{children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\n/**\n * Tooltip Content\n */\n\nexport type TooltipContentProps = ComponentProps<\n\ttypeof TooltipPrimitive.Popup\n> & {\n\tshowArrow?: boolean;\n};\n\nfunction TooltipContent({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: TooltipContentProps) {\n\tconst { showArrow, side, sideOffset } = useTooltipContext();\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Positioner side={side} sideOffset={sideOffset ?? 10}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"relative z-50 w-fit max-w-72 rounded-md bg-gray-700 p-2 text-sm text-white shadow-md\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={ref}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className=\"data-[side=bottom]:-top-1.25 data-[side=left]:-right-1.25 data-[side=top]:-bottom-1.25 data-[side=right]:-left-1.25\">\n\t\t\t\t\t\t\t<div className=\"h-2.5 w-2.5 rotate-45 bg-gray-700\" />\n\t\t\t\t\t\t</TooltipPrimitive.Arrow>\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent };\n"]}
1
+ {"version":3,"file":"tooltip.js","sourceRoot":"/","sources":["components/tooltip/tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAY3D,MAAM,cAAc,GAAG,aAAa,CAAiC,SAAS,CAAC,CAAC;AAEhF,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,UAAU,CAAC,cAAc,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,OAAO,CAAC;AAChB,CAAC,CAAC;AAaF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAS,OAAO,CAAC,EAChB,QAAQ,EACR,SAAS,GAAG,IAAI,EAChB,IAAI,EACJ,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,GAAG,EACnB,GAAG,KAAK,EACM;IACd,MAAM,YAAY,GAAG,OAAO,CAC3B,GAAG,EAAE,CAAC,CAAC;QACN,SAAS;QACT,IAAI;QACJ,UAAU;KACV,CAAC,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,GACI,GACL,CAC1B,CAAC;AACH,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC","sourcesContent":["import { Tooltip as TooltipPrimitive } from \"@base-ui/react/tooltip\";\nimport { cn } from \"@utilities/cn/cn\";\nimport type { ComponentProps } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\n/**\n * Tooltip Context\n */\n\ntype TooltipContextType = {\n\tshowArrow?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n};\n\nconst TooltipContext = createContext<TooltipContextType | undefined>(undefined);\n\nconst useTooltipContext = () => {\n\tconst context = useContext(TooltipContext);\n\tif (!context) {\n\t\tthrow new Error(\"Tooltip components must be used within a TooltipProvider\");\n\t}\n\treturn context;\n};\n\n/**\n * Tooltip\n */\n\nexport type TooltipProps = ComponentProps<typeof TooltipPrimitive.Root> & {\n\tshowArrow?: boolean;\n\tside?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\tsideOffset?: number;\n\tdelayDuration?: number;\n};\n\n/**\n * A tooltip component built on top of Base UI's tooltip primitive.\n *\n * @param {TooltipProps} props - The props for the Tooltip component\n * @param {boolean} [props.showArrow=true] - Whether to show the arrow pointing to the trigger\n * @param {\"top\" | \"right\" | \"bottom\" | \"left\"} [props.side] - The preferred side to show the tooltip\n * @param {number} [props.sideOffset=10] - Distance between the anchor and the popup\n * @param {number} [props.delayDuration=600] - How long to wait before opening the tooltip (in ms)\n *\n * @example\n * ```tsx\n * <Tooltip>\n * <TooltipTrigger>Hover me</TooltipTrigger>\n * <TooltipContent>Tooltip content</TooltipContent>\n * </Tooltip>\n * ```\n */\nfunction Tooltip({\n\tchildren,\n\tshowArrow = true,\n\tside,\n\tsideOffset = 10,\n\tdelayDuration = 600,\n\t...props\n}: TooltipProps) {\n\tconst contextValue = useMemo(\n\t\t() => ({\n\t\t\tshowArrow,\n\t\t\tside,\n\t\t\tsideOffset,\n\t\t}),\n\t\t[showArrow, side, sideOffset],\n\t);\n\treturn (\n\t\t<TooltipContext.Provider value={contextValue}>\n\t\t\t<TooltipPrimitive.Provider delay={delayDuration}>\n\t\t\t\t<TooltipPrimitive.Root {...props}>{children}</TooltipPrimitive.Root>\n\t\t\t</TooltipPrimitive.Provider>\n\t\t</TooltipContext.Provider>\n\t);\n}\n\n/**\n * Tooltip Trigger\n */\n\nexport type TooltipTriggerProps = ComponentProps<\n\ttypeof TooltipPrimitive.Trigger\n> & {\n\trender?: React.ReactElement;\n};\n\nfunction TooltipTrigger({\n\trender,\n\tchildren,\n\tref,\n\t...props\n}: TooltipTriggerProps) {\n\tif (render) {\n\t\treturn (\n\t\t\t<TooltipPrimitive.Trigger ref={ref} render={render} {...props}>\n\t\t\t\t{children}\n\t\t\t</TooltipPrimitive.Trigger>\n\t\t);\n\t}\n\treturn (\n\t\t<TooltipPrimitive.Trigger ref={ref} {...props}>\n\t\t\t{children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\n/**\n * Tooltip Content\n */\n\nexport type TooltipContentProps = ComponentProps<\n\ttypeof TooltipPrimitive.Popup\n> & {\n\tshowArrow?: boolean;\n};\n\nfunction TooltipContent({\n\tclassName,\n\tchildren,\n\tref,\n\t...props\n}: TooltipContentProps) {\n\tconst { showArrow, side, sideOffset } = useTooltipContext();\n\treturn (\n\t\t<TooltipPrimitive.Portal>\n\t\t\t<TooltipPrimitive.Positioner side={side} sideOffset={sideOffset ?? 10}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"relative z-50 w-fit max-w-72 rounded-md bg-gray-700 p-2 text-sm text-white shadow-md\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\tref={ref}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className=\"data-[side=bottom]:-top-1.25 data-[side=left]:-right-1.25 data-[side=top]:-bottom-1.25 data-[side=right]:-left-1.25\">\n\t\t\t\t\t\t\t<div className=\"h-2.5 w-2.5 rotate-45 bg-gray-700\" />\n\t\t\t\t\t\t</TooltipPrimitive.Arrow>\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipTrigger };\n"]}
@@ -1,45 +1,18 @@
1
1
  import { type BreakpointsMap as RcvBreakpointsMap, type ResponsiveValue as RcvResponsiveValue } from "responsive-class-variants";
2
2
  export declare const breakpoints: readonly ["sm", "md", "lg", "xl"];
3
3
  export declare const getVariants: {
4
- <T extends {
5
- [x: string]: {
6
- [x: string]: (string | readonly string[]) | Record<string, string | readonly string[]>;
7
- };
8
- } = Record<never, {
9
- [x: string]: (string | readonly string[]) | Record<string, string | readonly string[]>;
10
- }>, S extends Record<string, string | readonly string[]> = Record<string, string | readonly string[]>>(config: {
4
+ <T extends import("responsive-class-variants/dist/types").VariantConfig = Record<never, import("responsive-class-variants/dist/types").VariantValue>, S extends Record<string, import("responsive-class-variants/dist/types").SlotConfig> = Record<string, import("responsive-class-variants/dist/types").ClassValue>>(config: {
11
5
  slots: S;
12
6
  variants?: T | undefined;
13
- compoundVariants?: (Partial<Omit<{ [K in keyof T]?: (T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends Partial<Record<"true" | "false", (string | readonly string[]) | Record<string, string | readonly string[]>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_1 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_1, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
14
- className?: string;
15
- class?: string;
16
- }, "className" | "class">> & {
17
- class?: (string | Partial<Record<keyof S & string, string | readonly string[]>>) | undefined;
18
- className?: (string | Partial<Record<keyof S & string, string | readonly string[]>>) | undefined;
19
- })[] | undefined;
7
+ compoundVariants?: import("responsive-class-variants/dist/types").CompoundVariantWithSlots<T, keyof S & string, "sm" | "md" | "lg" | "xl">[] | undefined;
20
8
  onComplete?: (classes: string) => string;
21
- }): () => { [K_1 in keyof S]: (props?: ({ [K in keyof T]?: (T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends Partial<Record<"true" | "false", (string | readonly string[]) | Record<string, string | readonly string[]>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_1 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_1, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
22
- className?: string;
23
- class?: string;
24
- }) | undefined) => string; };
25
- <T extends {
26
- [x: string]: {
27
- [x: string]: (string | readonly string[]) | Record<string, string | readonly string[]>;
28
- };
29
- } = Record<never, {
30
- [x: string]: (string | readonly string[]) | Record<string, string | readonly string[]>;
31
- }>>(config: {
9
+ }): () => { [K in keyof S]: (props?: import("responsive-class-variants/dist/types").VariantProps<T, "sm" | "md" | "lg" | "xl"> | undefined) => string; };
10
+ <T extends import("responsive-class-variants/dist/types").VariantConfig = Record<never, import("responsive-class-variants/dist/types").VariantValue>>(config: {
32
11
  base: string;
33
12
  variants?: T | undefined;
34
- compoundVariants?: Partial<{ [K in keyof T]?: (T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends Partial<Record<"true" | "false", (string | readonly string[]) | Record<string, string | readonly string[]>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_1 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_1, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
35
- className?: string;
36
- class?: string;
37
- }>[] | undefined;
13
+ compoundVariants?: Partial<import("responsive-class-variants/dist/types").VariantProps<T, "sm" | "md" | "lg" | "xl">>[] | undefined;
38
14
  onComplete?: (classes: string) => string;
39
- }): (props?: ({ [K in keyof T]?: (T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends Partial<Record<"true" | "false", (string | readonly string[]) | Record<string, string | readonly string[]>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_1 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_1, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
40
- className?: string;
41
- class?: string;
42
- }) | undefined) => string;
15
+ }): (props?: import("responsive-class-variants/dist/types").VariantProps<T, "sm" | "md" | "lg" | "xl"> | undefined) => string;
43
16
  };
44
17
  export type Breakpoints = (typeof breakpoints)[number];
45
18
  export type ResponsiveValue<T> = RcvResponsiveValue<T, Breakpoints>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luan-ui",
3
- "version": "0.6.1",
3
+ "version": "0.7.0",
4
4
  "description": "A UI library for React",
5
5
  "author": "benebene84 <benedikt.sperl@gmail.com> (https://github.com/benebene84)",
6
6
  "main": "/dist/index.js",
@@ -33,41 +33,41 @@
33
33
  },
34
34
  "homepage": "https://github.com/benebene84/luan-ui#readme",
35
35
  "devDependencies": {
36
- "@biomejs/biome": "2.3.14",
37
- "@chromatic-com/storybook": "^5.0.0",
38
- "@storybook/addon-docs": "^10.2.4",
39
- "@storybook/addon-onboarding": "^10.2.4",
40
- "@storybook/react-vite": "^10.2.4",
41
- "@tailwindcss/postcss": "^4.1.18",
42
- "@tailwindcss/vite": "^4.1.18",
36
+ "@biomejs/biome": "2.4.7",
37
+ "@chromatic-com/storybook": "^5.0.1",
38
+ "@storybook/addon-docs": "^10.2.19",
39
+ "@storybook/addon-onboarding": "^10.2.19",
40
+ "@storybook/react-vite": "^10.2.19",
41
+ "@tailwindcss/postcss": "^4.2.1",
42
+ "@tailwindcss/vite": "^4.2.1",
43
43
  "@testing-library/dom": "^10.4.1",
44
44
  "@testing-library/jest-dom": "^6.9.1",
45
45
  "@testing-library/react": "^16.3.2",
46
46
  "@testing-library/user-event": "^14.6.1",
47
- "@types/node": "^25.2.0",
48
- "@types/react": "^19.2.10",
47
+ "@types/node": "^25.5.0",
48
+ "@types/react": "^19.2.14",
49
49
  "@types/react-dom": "^19.2.3",
50
- "@vitejs/plugin-react": "^5.1.3",
51
- "jsdom": "^28.0.0",
52
- "lefthook": "^2.1.0",
53
- "responsive-class-variants": "^1.3.1",
54
- "storybook": "^10.2.4",
55
- "tailwindcss": "^4.1.18",
50
+ "@vitejs/plugin-react": "^6.0.1",
51
+ "jsdom": "^29.0.0",
52
+ "lefthook": "^2.1.4",
53
+ "responsive-class-variants": "^1.3.2",
54
+ "storybook": "^10.2.19",
55
+ "tailwindcss": "^4.2.1",
56
56
  "tsc-alias": "^1.8.16",
57
57
  "typescript": "^5.9.3",
58
- "vite": "^7.3.1",
59
- "vitest": "^4.0.18"
58
+ "vite": "^8.0.0",
59
+ "vitest": "^4.1.0"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^19.0.0",
63
63
  "react-dom": "^19.0.0"
64
64
  },
65
65
  "dependencies": {
66
- "@base-ui/react": "^1.1.0",
66
+ "@base-ui/react": "^1.3.0",
67
67
  "@radix-ui/react-icons": "^1.3.2",
68
68
  "clsx": "^2.1.1",
69
69
  "sonner": "^2.0.7",
70
- "tailwind-merge": "^3.4.0"
70
+ "tailwind-merge": "^3.5.0"
71
71
  },
72
72
  "packageManager": "pnpm@10.26.2"
73
73
  }