luan-ui 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Icon } from "../icon/icon";
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
5
  import { Popover as RadixPopover } from "radix-ui";
7
6
  import { createContext, forwardRef, useContext, useMemo, } from "react";
8
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","sourceRoot":"/","sources":["components/popover/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAEN,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,GACP,MAAM,OAAO,CAAC;AAEf;;GAEG;AAEH,MAAM,cAAc,GAAG,aAAa,CAA2B,SAAS,CAAC,CAAC;AAE1E,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;AAaF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAG,CAAC,EAChB,QAAQ,EACR,SAAS,GAAG,IAAI,EAChB,oBAAoB,GAAG,OAAO,EAC9B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;AAEH,MAAM,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC;AAExC;;GAEG;AAEH,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC;AAE1C;;GAEG;AAEH,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC;AAE1C,OAAO,EACN,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,GACb,CAAC","sourcesContent":["import { Icon } from \"@components/icon/icon\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { getVariants } from \"@utilities/responsive/responsive\";\nimport { Popover as RadixPopover } from \"radix-ui\";\nimport {\n\ttype ComponentRef,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\n\n/**\n * Popover Context\n */\n\nconst PopoverContext = createContext<PopoverProps | undefined>(undefined);\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} & RadixPopover.PopoverProps &\n\tPick<RadixPopover.PopoverContentProps, \"side\">;\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 {RadixPopover.PopoverContentProps[\"side\"]} [props.side] - The preferred side to show the popover\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 */\nconst Popover = ({\n\tchildren,\n\tshowArrow = true,\n\tcloseButtonAriaLabel = \"Close\",\n\tshowCloseButton = true,\n\tside,\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}),\n\t\t[showArrow, closeButtonAriaLabel, side, showCloseButton],\n\t);\n\treturn (\n\t\t<PopoverContext.Provider value={contextValue}>\n\t\t\t<RadixPopover.Root {...props}>{children}</RadixPopover.Root>\n\t\t</PopoverContext.Provider>\n\t);\n};\n\nconst PopoverTrigger = RadixPopover.Trigger;\n\nexport type PopoverContentProps = RadixPopover.PopoverContentProps & {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\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 */\nconst PopoverContent = forwardRef<\n\tComponentRef<typeof RadixPopover.Content>,\n\tPopoverContentProps\n>(({ children, className, sideOffset = 4, ...props }, ref) => {\n\tconst { showArrow, closeButtonAriaLabel, side, showCloseButton } =\n\t\tusePopoverContext();\n\treturn (\n\t\t<RadixPopover.Content\n\t\t\tclassName={cn(\n\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\tclassName,\n\t\t\t)}\n\t\t\tsideOffset={sideOffset}\n\t\t\tside={side}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t>\n\t\t\t{showCloseButton && (\n\t\t\t\t<PopoverClose\n\t\t\t\t\tclassName=\"absolute top-4 right-4\"\n\t\t\t\t\taria-label={closeButtonAriaLabel}\n\t\t\t\t>\n\t\t\t\t\t<Icon asChild size=\"small\">\n\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t</Icon>\n\t\t\t\t</PopoverClose>\n\t\t\t)}\n\t\t\t{children}\n\t\t\t{showArrow && <RadixPopover.Arrow className=\"fill-gray-700\" />}\n\t\t</RadixPopover.Content>\n\t);\n});\n\n/**\n * Popover Close\n */\n\nconst PopoverClose = RadixPopover.Close;\n\n/**\n * Popover Portal\n */\n\nconst PopoverPortal = RadixPopover.Portal;\n\n/**\n * Popover Anchor\n */\n\nconst PopoverAnchor = RadixPopover.Anchor;\n\nexport {\n\tPopover,\n\tPopoverTrigger,\n\tPopoverContent,\n\tPopoverClose,\n\tPopoverPortal,\n\tPopoverAnchor,\n};\n"]}
1
+ {"version":3,"file":"popover.js","sourceRoot":"/","sources":["components/popover/popover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAEN,aAAa,EACb,UAAU,EACV,UAAU,EACV,OAAO,GACP,MAAM,OAAO,CAAC;AAEf;;GAEG;AAEH,MAAM,cAAc,GAAG,aAAa,CAA2B,SAAS,CAAC,CAAC;AAE1E,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;AAaF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,GAAG,CAAC,EAChB,QAAQ,EACR,SAAS,GAAG,IAAI,EAChB,oBAAoB,GAAG,OAAO,EAC9B,eAAe,GAAG,IAAI,EACtB,IAAI,EACJ,GAAG,KAAK,EACM,EAAE,EAAE;IAClB,MAAM,YAAY,GAAG,OAAO,CAC3B,GAAG,EA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AE1C;;GAEG;AAEH,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC;AAE1C,OAAO,EACN,OAAO,EACP,cAAc,EACd,cAAc,EACd,YAAY,EACZ,aAAa,EACb,aAAa,GACb,CAAC","sourcesContent":["import { Icon } from \"@components/icon/icon\";\nimport { Cross1Icon } from \"@radix-ui/react-icons\";\nimport { cn } from \"@utilities/cn/cn\";\nimport { Popover as RadixPopover } from \"radix-ui\";\nimport {\n\ttype ComponentRef,\n\tcreateContext,\n\tforwardRef,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\n\n/**\n * Popover Context\n */\n\nconst PopoverContext = createContext<PopoverProps | undefined>(undefined);\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} & RadixPopover.PopoverProps &\n\tPick<RadixPopover.PopoverContentProps, \"side\">;\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 {RadixPopover.PopoverContentProps[\"side\"]} [props.side] - The preferred side to show the popover\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 */\nconst Popover = ({\n\tchildren,\n\tshowArrow = true,\n\tcloseButtonAriaLabel = \"Close\",\n\tshowCloseButton = true,\n\tside,\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}),\n\t\t[showArrow, closeButtonAriaLabel, side, showCloseButton],\n\t);\n\treturn (\n\t\t<PopoverContext.Provider value={contextValue}>\n\t\t\t<RadixPopover.Root {...props}>{children}</RadixPopover.Root>\n\t\t</PopoverContext.Provider>\n\t);\n};\n\nconst PopoverTrigger = RadixPopover.Trigger;\n\nexport type PopoverContentProps = RadixPopover.PopoverContentProps & {\n\tshowArrow?: boolean;\n\tcloseButtonAriaLabel?: string;\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 */\nconst PopoverContent = forwardRef<\n\tComponentRef<typeof RadixPopover.Content>,\n\tPopoverContentProps\n>(({ children, className, sideOffset = 4, ...props }, ref) => {\n\tconst { showArrow, closeButtonAriaLabel, side, showCloseButton } =\n\t\tusePopoverContext();\n\treturn (\n\t\t<RadixPopover.Content\n\t\t\tclassName={cn(\n\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\tclassName,\n\t\t\t)}\n\t\t\tsideOffset={sideOffset}\n\t\t\tside={side}\n\t\t\t{...props}\n\t\t\tref={ref}\n\t\t>\n\t\t\t{showCloseButton && (\n\t\t\t\t<PopoverClose\n\t\t\t\t\tclassName=\"absolute top-4 right-4\"\n\t\t\t\t\taria-label={closeButtonAriaLabel}\n\t\t\t\t>\n\t\t\t\t\t<Icon asChild size=\"small\">\n\t\t\t\t\t\t<Cross1Icon />\n\t\t\t\t\t</Icon>\n\t\t\t\t</PopoverClose>\n\t\t\t)}\n\t\t\t{children}\n\t\t\t{showArrow && <RadixPopover.Arrow className=\"fill-gray-700\" />}\n\t\t</RadixPopover.Content>\n\t);\n});\n\n/**\n * Popover Close\n */\n\nconst PopoverClose = RadixPopover.Close;\n\n/**\n * Popover Portal\n */\n\nconst PopoverPortal = RadixPopover.Portal;\n\n/**\n * Popover Anchor\n */\n\nconst PopoverAnchor = RadixPopover.Anchor;\n\nexport {\n\tPopover,\n\tPopoverTrigger,\n\tPopoverContent,\n\tPopoverClose,\n\tPopoverPortal,\n\tPopoverAnchor,\n};\n"]}
@@ -7,7 +7,7 @@ export type ToastProps = {
7
7
  label: string;
8
8
  onClick: () => void;
9
9
  };
10
- } & ToasterProps;
10
+ } & Omit<ToasterProps, "id">;
11
11
  /**
12
12
  * Creates a custom toast notification using the sonner toast library
13
13
  * @param toast - The toast configuration object without an ID
@@ -29,5 +29,5 @@ declare const Toast: import("react").ForwardRefExoticComponent<{
29
29
  label: string;
30
30
  onClick: () => void;
31
31
  };
32
- } & ToasterProps & import("react").RefAttributes<HTMLDivElement>>;
32
+ } & Omit<ToasterProps, "id"> & import("react").RefAttributes<HTMLDivElement>>;
33
33
  export { toast, Toast, Toaster };
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"/","sources":["components/toast/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EACN,OAAO,IAAI,aAAa,EACxB,KAAK,IAAI,WAAW,GAEpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAY1C;;;;;;;;;GASG;AACH,MAAM,KAAK,GAAG,CAAC,KAA6B,EAAE,EAAE;IAC/C,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,CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,mDAAmD;AACnD,MAAM,KAAK,GAAG,UAAU,CACvB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3C,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,CACD,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { forwardRef } 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} & ToasterProps;\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 */\nconst 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\nToaster.displayName = \"Toaster\";\n\n/** A fully custom toast built on top of sonner. */\nconst Toast = forwardRef<HTMLDivElement, ToastProps>(\n\t({ title, description, button, id }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\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\t\tref={ref}\n\t\t\t>\n\t\t\t\t<div className=\"flex flex-1 items-center\">\n\t\t\t\t\t<div className=\"w-full gap-1\">\n\t\t\t\t\t\t<p className=\"font-medium text-gray-900 text-sm\">{title}</p>\n\t\t\t\t\t\t<p className=\"text-gray-500 text-sm\">{description}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"shrink-0 rounded-md font-medium text-sm\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tbutton.onClick();\n\t\t\t\t\t\t\tsonnerToast.dismiss(id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{button.label}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nToast.displayName = \"Toast\";\n\nexport { toast, Toast, Toaster };\n"]}
1
+ {"version":3,"file":"toast.js","sourceRoot":"/","sources":["components/toast/toast.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EACN,OAAO,IAAI,aAAa,EACxB,KAAK,IAAI,WAAW,GAEpB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAY1C;;;;;;;;;GASG;AACH,MAAM,KAAK,GAAG,CAAC,KAA6B,EAAE,EAAE;IAC/C,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,CAAC;AAEF,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEhC,mDAAmD;AACnD,MAAM,KAAK,GAAG,UAAU,CACvB,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3C,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,CACD,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { forwardRef } 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} & 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 */\nconst 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\nToaster.displayName = \"Toaster\";\n\n/** A fully custom toast built on top of sonner. */\nconst Toast = forwardRef<HTMLDivElement, ToastProps>(\n\t({ title, description, button, id }, ref) => {\n\t\treturn (\n\t\t\t<div\n\t\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\t\tref={ref}\n\t\t\t>\n\t\t\t\t<div className=\"flex flex-1 items-center\">\n\t\t\t\t\t<div className=\"w-full gap-1\">\n\t\t\t\t\t\t<p className=\"font-medium text-gray-900 text-sm\">{title}</p>\n\t\t\t\t\t\t<p className=\"text-gray-500 text-sm\">{description}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"shrink-0 rounded-md font-medium text-sm\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tbutton.onClick();\n\t\t\t\t\t\t\tsonnerToast.dismiss(id);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{button.label}\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t);\n\t},\n);\n\nToast.displayName = \"Toast\";\n\nexport { toast, Toast, Toaster };\n"]}
@@ -1,3 +1,4 @@
1
+ /** biome-ignore-all lint/suspicious/noUnknownAtRules: <tailwind specific syntax included> */
1
2
  @import "tailwindcss";
2
3
 
3
4
  @source "../components";
@@ -15,7 +15,7 @@ export declare const getVariants: {
15
15
  className?: string;
16
16
  })[] | undefined;
17
17
  onComplete?: (classes: string) => string;
18
- }): { [K_1 in keyof S]: (props?: ({ [K in keyof T]?: (T[K] extends infer T_2 ? T_2 extends T[K] ? T_2 extends Partial<Record<"true" | "false", string | Record<string, string>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_2 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_2, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
18
+ }): { [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 | Record<string, 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; } & {
19
19
  className?: string;
20
20
  }) | undefined) => string; };
21
21
  <T extends {
@@ -29,7 +29,7 @@ export declare const getVariants: {
29
29
  className?: string;
30
30
  }>[] | undefined;
31
31
  onComplete?: (classes: string) => string;
32
- }): (props: { [K in keyof T]?: (T[K] extends infer T_2 ? T_2 extends T[K] ? T_2 extends Partial<Record<"true" | "false", string | Record<string, string>>> ? RcvResponsiveValue<boolean, "sm" | "md" | "lg" | "xl"> | undefined : T_2 extends Record<string, unknown> ? RcvResponsiveValue<keyof T_2, "sm" | "md" | "lg" | "xl"> : never : never : never) | undefined; } & {
32
+ }): (props: { [K in keyof T]?: (T[K] extends infer T_1 ? T_1 extends T[K] ? T_1 extends Partial<Record<"true" | "false", string | Record<string, 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; } & {
33
33
  className?: string;
34
34
  }) => string;
35
35
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "luan-ui",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
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,29 +33,29 @@
33
33
  },
34
34
  "homepage": "https://github.com/benebene84/luan-ui#readme",
35
35
  "devDependencies": {
36
- "@biomejs/biome": "2.0.0",
37
- "@chromatic-com/storybook": "^4.0.0",
38
- "@storybook/addon-docs": "^9.0.12",
39
- "@storybook/addon-onboarding": "^9.0.10",
40
- "@storybook/react-vite": "^9.0.12",
41
- "@tailwindcss/postcss": "^4.1.10",
42
- "@tailwindcss/vite": "^4.1.10",
43
- "@testing-library/dom": "^10.4.0",
44
- "@testing-library/jest-dom": "^6.6.3",
36
+ "@biomejs/biome": "2.2.4",
37
+ "@chromatic-com/storybook": "^4.1.1",
38
+ "@storybook/addon-docs": "^9.1.6",
39
+ "@storybook/addon-onboarding": "^9.1.6",
40
+ "@storybook/react-vite": "^9.1.6",
41
+ "@tailwindcss/postcss": "^4.1.13",
42
+ "@tailwindcss/vite": "^4.1.13",
43
+ "@testing-library/dom": "^10.4.1",
44
+ "@testing-library/jest-dom": "^6.8.0",
45
45
  "@testing-library/react": "^16.3.0",
46
46
  "@testing-library/user-event": "^14.6.1",
47
- "@types/node": "^24.0.3",
48
- "@types/react": "^19.1.8",
49
- "@types/react-dom": "^19.1.6",
50
- "@vitejs/plugin-react": "^4.5.2",
51
- "jsdom": "^26.1.0",
52
- "lefthook": "^1.11.14",
47
+ "@types/node": "^24.5.0",
48
+ "@types/react": "^19.1.13",
49
+ "@types/react-dom": "^19.1.9",
50
+ "@vitejs/plugin-react": "^5.0.2",
51
+ "jsdom": "^27.0.0",
52
+ "lefthook": "^1.13.0",
53
53
  "responsive-class-variants": "^1.1.1",
54
- "storybook": "^9.0.12",
55
- "tailwindcss": "^4.1.10",
54
+ "storybook": "^9.1.6",
55
+ "tailwindcss": "^4.1.13",
56
56
  "tsc-alias": "^1.8.16",
57
- "typescript": "^5.8.3",
58
- "vite": "^6.3.5",
57
+ "typescript": "^5.9.2",
58
+ "vite": "^7.1.5",
59
59
  "vitest": "^3.2.4"
60
60
  },
61
61
  "peerDependencies": {
@@ -66,8 +66,8 @@
66
66
  "@radix-ui/react-compose-refs": "^1.1.2",
67
67
  "@radix-ui/react-icons": "^1.3.2",
68
68
  "clsx": "^2.1.1",
69
- "radix-ui": "^1.4.2",
70
- "sonner": "^2.0.5",
69
+ "radix-ui": "^1.4.3",
70
+ "sonner": "^2.0.7",
71
71
  "tailwind-merge": "^3.3.1"
72
72
  },
73
73
  "packageManager": "pnpm@9.14.2"