@docubook/ui-react 2.1.0 → 2.2.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumbs.js","names":[],"sources":["../src/base/breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface BreadcrumbProps {\n children: ReactNode;\n className?: string;\n}\nexport interface BreadcrumbItemProps {\n children: ReactNode;\n className?: string;\n}\n\nexport function Breadcrumb({ children, className }: BreadcrumbProps) {\n return (\n <div className={cn(\"breadcrumbs text-sm\", className)}>\n <ul>{children}</ul>\n </div>\n );\n}\n\nexport function BreadcrumbItem({ children, className }: BreadcrumbItemProps) {\n return <li className={cn(className)}>{children}</li>;\n}\n\nexport function BreadcrumbPage({ children, className }: BreadcrumbItemProps) {\n return <span className={cn(className)}>{children}</span>;\n}\n\nexport function BreadcrumbList({ children }: { children: React.ReactNode }) {\n return <>{children}</>;\n}\n"],"mappings":";;;AAYA,SAAgB,EAAW,EAAE,aAAU,gBAA8B;CACnE,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,uBAAuB,CAAS;EACjD,UAAA,kBAAC,MAAD,EAAK,YAAa,CAAA;CACf,CAAA;AAET;AAEA,SAAgB,EAAe,EAAE,aAAU,gBAAkC;CAC3E,OAAO,kBAAC,MAAD;EAAI,WAAW,EAAG,CAAS;EAAI;CAAa,CAAA;AACrD;AAEA,SAAgB,EAAe,EAAE,aAAU,gBAAkC;CAC3E,OAAO,kBAAC,QAAD;EAAM,WAAW,EAAG,CAAS;EAAI;CAAe,CAAA;AACzD;AAEA,SAAgB,EAAe,EAAE,eAA2C;CAC1E,OAAO,kBAAA,GAAA,EAAG,YAAW,CAAA;AACvB"}
1
+ {"version":3,"file":"breadcrumbs.js","names":["_Fragment","Breadcrumb","cn","className","BreadcrumbItem","BreadcrumbPage","BreadcrumbList","Fragment"],"sources":["../src/base/breadcrumbs.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface BreadcrumbProps {\n children: ReactNode;\n className?: string;\n}\nexport interface BreadcrumbItemProps {\n children: ReactNode;\n className?: string;\n}\n\nexport function Breadcrumb({ children, className }: BreadcrumbProps) {\n return (\n <div className={cn(\"breadcrumbs text-sm\", className)}>\n <ul>{children}</ul>\n </div>\n );\n}\n\nexport function BreadcrumbItem({ children, className }: BreadcrumbItemProps) {\n return <li className={cn(className)}>{children}</li>;\n}\n\nexport function BreadcrumbPage({ children, className }: BreadcrumbItemProps) {\n return <span className={cn(className)}>{children}</span>;\n}\n\nexport function BreadcrumbList({ children }: { children: React.ReactNode }) {\n return <>{children}</>;\n}\n"],"mappings":";;;AAYA,SAAgBC,EAAW,EAAE,aAAU,gBAA8B;CACnE,OACE,kBAAC,OAAD;EAAK,WAAWC,EAAG,uBAAuBC,CAAS;EACjD,UAAA,kBAAC,MAAD,EAAK,YAAa,CAAA;CACf,CAAA;AAET;AAEA,SAAgBC,EAAe,EAAE,aAAU,gBAAkC;CAC3E,OAAO,kBAAC,MAAD;EAAI,WAAWF,EAAGC,CAAS;EAAI;CAAa,CAAA;AACrD;AAEA,SAAgBE,EAAe,EAAE,aAAU,gBAAkC;CAC3E,OAAO,kBAAC,QAAD;EAAM,WAAWH,EAAGC,CAAS;EAAI;CAAe,CAAA;AACzD;AAEA,SAAgBG,EAAe,EAAE,eAA2C;CAC1E,OAAO,kBAAAN,GAAA,EAAG,YAAW,CAAA;AACvB"}
package/dist/cn.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cn.js","names":[],"sources":["../src/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAGA,SAAgB,EAAG,GAAG,GAA8B;CAClD,OAAO,EAAQ,EAAK,CAAM,CAAC;AAC7B"}
1
+ {"version":3,"file":"cn.js","names":["cn","inputs","twMerge","clsx"],"sources":["../src/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAGA,SAAgBA,EAAG,GAAGC,GAA8B;CAClD,OAAOC,EAAQC,EAAKF,CAAM,CAAC;AAC7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"collapse.js","names":[],"sources":["../src/base/collapse.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport { useState, type ReactNode } from \"react\";\n\ntype CollapseVariant = \"arrow\" | \"plus\";\n\ninterface CollapseProps {\n title: ReactNode;\n children: ReactNode;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n variant?: CollapseVariant;\n className?: string;\n titleClassName?: string;\n contentClassName?: string;\n disabled?: boolean;\n}\n\nexport function Collapse({\n title,\n children,\n defaultOpen = false,\n onOpenChange,\n variant = \"arrow\",\n className,\n titleClassName,\n contentClassName,\n disabled = false,\n}: CollapseProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n\n const handleToggle = () => {\n if (disabled) return;\n const next = !isOpen;\n setIsOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <div\n className={cn(\n \"bg-base-100 border-base-200 collapse rounded-lg border\",\n isOpen && \"collapse-open\",\n !isOpen && \"collapse-close\",\n variant === \"arrow\" ? \"collapse-arrow\" : \"collapse-plus\",\n disabled && \"cursor-not-allowed opacity-50\",\n className\n )}\n >\n <input\n type=\"checkbox\"\n checked={isOpen}\n onChange={handleToggle}\n disabled={disabled}\n aria-expanded={isOpen}\n />\n <div\n className={cn(\n \"collapse-title text-base-content cursor-pointer font-medium\",\n titleClassName\n )}\n onClick={handleToggle}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (!disabled && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n handleToggle();\n }\n }}\n >\n {title}\n </div>\n <div className={cn(\"collapse-content text-base-content/80\", contentClassName)}>\n {children}\n </div>\n </div>\n );\n}\n\ninterface AccordionItem {\n id: string;\n title: ReactNode;\n content: ReactNode;\n}\n\ninterface AccordionProps {\n items: AccordionItem[];\n defaultOpen?: string;\n variant?: CollapseVariant;\n className?: string;\n allowMultiple?: boolean;\n}\n\nexport function Accordion({\n items,\n defaultOpen,\n variant = \"arrow\",\n className,\n allowMultiple = false,\n}: AccordionProps) {\n const [openIds, setOpenIds] = useState<Set<string>>(\n defaultOpen ? new Set([defaultOpen]) : new Set()\n );\n\n const toggle = (id: string) => {\n setOpenIds((prev) => {\n const next = new Set(prev);\n if (next.has(id)) {\n next.delete(id);\n } else {\n if (!allowMultiple) next.clear();\n next.add(id);\n }\n return next;\n });\n };\n\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((item) => (\n <div\n key={item.id}\n className={cn(\n \"bg-base-100 border-base-200 collapse rounded-lg border\",\n openIds.has(item.id) && \"collapse-open\",\n !openIds.has(item.id) && \"collapse-close\",\n variant === \"arrow\" ? \"collapse-arrow\" : \"collapse-plus\"\n )}\n >\n <input type=\"checkbox\" checked={openIds.has(item.id)} onChange={() => toggle(item.id)} />\n <div\n className=\"collapse-title text-base-content cursor-pointer font-medium\"\n onClick={() => toggle(item.id)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n >\n {item.title}\n </div>\n <div className=\"collapse-content text-base-content/80\">{item.content}</div>\n </div>\n ))}\n </div>\n );\n}\n\nexport type { CollapseProps, CollapseVariant, AccordionItem, AccordionProps };\nexport default Collapse;\n"],"mappings":";;;;;AAmBA,SAAgB,EAAS,EACvB,UACA,aACA,iBAAc,IACd,iBACA,aAAU,SACV,cACA,mBACA,qBACA,cAAW,MACK;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AY,UAAU,mBAAmB,eAC3C;GAPF,UAAA;IASE,kBAAC,SAAD;KAAO,MAAK;KAAW,SAAS,EAAQ,IAAI,EAAK,EAAE;KAAG,gBAAgB,EAAO,EAAK,EAAE;IAAI,CAAA;IACxF,kBAAC,OAAD;KACE,WAAU;KACV,eAAe,EAAO,EAAK,EAAE;KAC7B,MAAK;KACL,UAAU;KACV,YAAY,MAAM;MAChB,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAe,GACjB,EAAO,EAAK,EAAE;KAElB;KAEC,UAAA,EAAK;IACH,CAAA;IACL,kBAAC,OAAD;KAAK,WAAU;KAAyC,UAAA,EAAK;IAAa,CAAA;GACvE;EAxBE,GAAA,EAAK,EAwBP,CACN;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"collapse.js","names":["Collapse","isOpen","setIsOpen","useState","defaultOpen","handleToggle","disabled","next","onOpenChange","cn","variant","className","titleClassName","title","contentClassName","Accordion","openIds","setOpenIds","toggle","prev","id","allowMultiple","items","item"],"sources":["../src/base/collapse.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport { useState, type ReactNode } from \"react\";\n\ntype CollapseVariant = \"arrow\" | \"plus\";\n\ninterface CollapseProps {\n title: ReactNode;\n children: ReactNode;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n variant?: CollapseVariant;\n className?: string;\n titleClassName?: string;\n contentClassName?: string;\n disabled?: boolean;\n}\n\nexport function Collapse({\n title,\n children,\n defaultOpen = false,\n onOpenChange,\n variant = \"arrow\",\n className,\n titleClassName,\n contentClassName,\n disabled = false,\n}: CollapseProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n\n const handleToggle = () => {\n if (disabled) return;\n const next = !isOpen;\n setIsOpen(next);\n onOpenChange?.(next);\n };\n\n return (\n <div\n className={cn(\n \"bg-base-100 border-base-200 collapse rounded-lg border\",\n isOpen && \"collapse-open\",\n !isOpen && \"collapse-close\",\n variant === \"arrow\" ? \"collapse-arrow\" : \"collapse-plus\",\n disabled && \"cursor-not-allowed opacity-50\",\n className\n )}\n >\n <input\n type=\"checkbox\"\n checked={isOpen}\n onChange={handleToggle}\n disabled={disabled}\n aria-expanded={isOpen}\n />\n <div\n className={cn(\n \"collapse-title text-base-content cursor-pointer font-medium\",\n titleClassName\n )}\n onClick={handleToggle}\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n onKeyDown={(e) => {\n if (!disabled && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n handleToggle();\n }\n }}\n >\n {title}\n </div>\n <div className={cn(\"collapse-content text-base-content/80\", contentClassName)}>\n {children}\n </div>\n </div>\n );\n}\n\ninterface AccordionItem {\n id: string;\n title: ReactNode;\n content: ReactNode;\n}\n\ninterface AccordionProps {\n items: AccordionItem[];\n defaultOpen?: string;\n variant?: CollapseVariant;\n className?: string;\n allowMultiple?: boolean;\n}\n\nexport function Accordion({\n items,\n defaultOpen,\n variant = \"arrow\",\n className,\n allowMultiple = false,\n}: AccordionProps) {\n const [openIds, setOpenIds] = useState<Set<string>>(\n defaultOpen ? new Set([defaultOpen]) : new Set()\n );\n\n const toggle = (id: string) => {\n setOpenIds((prev) => {\n const next = new Set(prev);\n if (next.has(id)) {\n next.delete(id);\n } else {\n if (!allowMultiple) next.clear();\n next.add(id);\n }\n return next;\n });\n };\n\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((item) => (\n <div\n key={item.id}\n className={cn(\n \"bg-base-100 border-base-200 collapse rounded-lg border\",\n openIds.has(item.id) && \"collapse-open\",\n !openIds.has(item.id) && \"collapse-close\",\n variant === \"arrow\" ? \"collapse-arrow\" : \"collapse-plus\"\n )}\n >\n <input type=\"checkbox\" checked={openIds.has(item.id)} onChange={() => toggle(item.id)} />\n <div\n className=\"collapse-title text-base-content cursor-pointer font-medium\"\n onClick={() => toggle(item.id)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n toggle(item.id);\n }\n }}\n >\n {item.title}\n </div>\n <div className=\"collapse-content text-base-content/80\">{item.content}</div>\n </div>\n ))}\n </div>\n );\n}\n\nexport type { CollapseProps, CollapseVariant, AccordionItem, AccordionProps };\nexport default Collapse;\n"],"mappings":";;;;;AAmBA,SAAgBA,EAAS,EACvB,UACA,aACA,iBAAc,IACd,iBACA,aAAU,SACV,cACA,mBACA,qBACA,cAAW,MACK;CAChB,IAAM,CAACC,GAAQC,KAAaC,EAASC,CAAW,GAE1CC,UAAqB;EACzB,IAAIC,GAAU;EACd,IAAMC,IAAO,CAACN;EAEd,AADAC,EAAUK,CAAI,GACdC,IAAeD,CAAI;CACrB;CAEA,OACE,kBAAC,OAAD;EACE,WAAWE,EACT,0DACAR,KAAU,iBACV,CAACA,KAAU,kBACXS,MAAY,UAAU,mBAAmB,iBACzCJ,KAAY,iCACZK,CACF;EARF,UAAA;GAUE,kBAAC,SAAD;IACE,MAAK;IACL,SAASV;IACT,UAAUI;IACA;IACV,iBAAeJ;GAChB,CAAA;GACD,kBAAC,OAAD;IACE,WAAWQ,EACT,+DACAG,CACF;IACA,SAASP;IACT,MAAK;IACL,UAAUC,IAAW,KAAK;IAC1B,YAAY,MAAM;KAChB,AAAI,CAACA,MAAa,EAAE,QAAQ,WAAW,EAAE,QAAQ,SAC/C,EAAE,eAAe,GACjBD,EAAa;IAEjB;IAEC,UAAAQ;GACE,CAAA;GACL,kBAAC,OAAD;IAAK,WAAWJ,EAAG,yCAAyCK,CAAgB;IACzE;GACE,CAAA;EACF;;AAET;AAgBA,SAAgBC,EAAU,EACxB,UACA,gBACA,aAAU,SACV,cACA,mBAAgB,MACC;CACjB,IAAM,CAACC,GAASC,KAAcd,EAC5BC,oBAAc,IAAI,IAAI,CAACA,CAAW,CAAC,oBAAI,IAAI,IAAI,CACjD,GAEMc,KAAU,MAAe;EAC7B,GAAY,MAAS;GACnB,IAAMX,IAAO,IAAI,IAAIY,CAAI;GAOzB,OANIZ,EAAK,IAAIa,CAAE,IACbb,EAAK,OAAOa,CAAE,KAETC,KAAed,EAAK,MAAM,GAC/BA,EAAK,IAAIa,CAAE,IAENb;EACT,CAAC;CACH;CAEA,OACE,kBAAC,OAAD;EAAK,WAAWE,EAAG,uBAAuBE,CAAS;EAChD,UAAAW,EAAM,KAAK,MACV,kBAAC,OAAD;GAEE,WAAWb,EACT,0DACAO,EAAQ,IAAIO,EAAK,EAAE,KAAK,iBACxB,CAACP,EAAQ,IAAIO,EAAK,EAAE,KAAK,kBACzBb,MAAY,UAAU,mBAAmB,eAC3C;GAPF,UAAA;IASE,kBAAC,SAAD;KAAO,MAAK;KAAW,SAASM,EAAQ,IAAIO,EAAK,EAAE;KAAG,gBAAgBL,EAAOK,EAAK,EAAE;IAAI,CAAA;IACxF,kBAAC,OAAD;KACE,WAAU;KACV,eAAeL,EAAOK,EAAK,EAAE;KAC7B,MAAK;KACL,UAAU;KACV,YAAY,MAAM;MAChB,CAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,eAAe,GACjBL,EAAOK,EAAK,EAAE;KAElB;KAEC,UAAAA,EAAK;IACH,CAAA;IACL,kBAAC,OAAD;KAAK,WAAU;KAAyC,UAAAA,EAAK;IAAa,CAAA;GACvE;EAxBE,GAAAA,EAAK,EAwBP,CACN;CACE,CAAA;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","names":[],"sources":["../src/base/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport { useState, type ReactNode } from \"react\";\nimport type { Side } from \"../utils/types\";\n\ninterface DrawerProps {\n id: string;\n children: ReactNode;\n defaultOpen?: boolean;\n side?: Side;\n breakpoint?: string;\n withOverlay?: boolean;\n overlayClassName?: string;\n sideClassName?: string;\n contentClassName?: string;\n className?: string;\n}\n\nexport function Drawer({\n id,\n children,\n defaultOpen = false,\n side = \"left\",\n breakpoint = \"lg\",\n withOverlay = true,\n overlayClassName,\n sideClassName,\n contentClassName,\n className,\n}: DrawerProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n return (\n <div\n className={cn(\n \"drawer\",\n breakpoint && `${breakpoint}:drawer-open`,\n side === \"right\" && \"drawer-end\",\n className\n )}\n >\n <input\n id={id}\n type=\"checkbox\"\n className=\"drawer-toggle\"\n checked={isOpen}\n onChange={() => setIsOpen(!isOpen)}\n aria-label=\"Toggle drawer\"\n />\n <div className={cn(\"drawer-content flex flex-col\", contentClassName)}>{children}</div>\n <div className={cn(\"drawer-side\", sideClassName)}>\n {withOverlay && (\n <label\n htmlFor={id}\n aria-label=\"Close sidebar\"\n className={cn(\"drawer-overlay\", overlayClassName)}\n onClick={() => setIsOpen(false)}\n />\n )}\n </div>\n </div>\n );\n}\n\nexport function useDrawerState(initialState = false) {\n const [isOpen, setIsOpen] = useState(initialState);\n return {\n isOpen,\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n toggle: () => setIsOpen((prev) => !prev),\n };\n}\n\ninterface DrawerTriggerProps {\n drawerId: string;\n children: ReactNode;\n className?: string;\n}\n\nexport function DrawerTrigger({ drawerId, children, className }: DrawerTriggerProps) {\n return (\n <label htmlFor={drawerId} className={cn(\"label cursor-pointer\", className)}>\n {children}\n </label>\n );\n}\n\ninterface DrawerSidePanelProps {\n id: string;\n children: ReactNode;\n side?: Side;\n withOverlay?: boolean;\n overlayClassName?: string;\n className?: string;\n}\n\nexport function DrawerSidePanel({\n id,\n children,\n side = \"left\",\n withOverlay = true,\n overlayClassName,\n className,\n}: DrawerSidePanelProps) {\n return (\n <div className={cn(\"drawer-side\", side === \"right\" && \"drawer-end\", className)}>\n {withOverlay && (\n <label\n htmlFor={id}\n aria-label=\"Close sidebar\"\n className={cn(\"drawer-overlay\", overlayClassName)}\n />\n )}\n {children}\n </div>\n );\n}\n\nexport function DrawerContent({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) {\n return <div className={cn(\"drawer-content\", className)}>{children}</div>;\n}\n\nexport type { DrawerProps, DrawerTriggerProps, DrawerSidePanelProps };\n"],"mappings":";;;;;AAmBA,SAAgB,EAAO,EACrB,OACA,aACA,iBAAc,IACd,UAAO,QACP,gBAAa,MACb,iBAAc,IACd,qBACA,kBACA,qBACA,gBACc;CACd,IAAM,CAAC,GAAQ,KAAa,EAAS,CAAW;CAChD,OACE,kBAAC,OAAD;EACE,WAAW,EACT,UACA,KAAc,GAAG,EAAW,eAC5B,MAAS,WAAW,cACpB,CACF;EANF,UAAA;GAQE,kBAAC,SAAD;IACM;IACJ,MAAK;IACL,WAAU;IACV,SAAS;IACT,gBAAgB,EAAU,CAAC,CAAM;IACjC,cAAW;GACZ,CAAA;GACD,kBAAC,OAAD;IAAK,WAAW,EAAG,gCAAgC,CAAgB;IAAI;GAAc,CAAA;GACrF,kBAAC,OAAD;IAAK,WAAW,EAAG,eAAe,CAAa;IAC5C,UAAA,KACC,kBAAC,SAAD;KACE,SAAS;KACT,cAAW;KACX,WAAW,EAAG,kBAAkB,CAAgB;KAChD,eAAe,EAAU,EAAK;IAC/B,CAAA;GAEA,CAAA;EACF;;AAET;AAEA,SAAgB,EAAe,IAAe,IAAO;CACnD,IAAM,CAAC,GAAQ,KAAa,EAAS,CAAY;CACjD,OAAO;EACL;EACA,YAAY,EAAU,EAAI;EAC1B,aAAa,EAAU,EAAK;EAC5B,cAAc,GAAW,MAAS,CAAC,CAAI;CACzC;AACF;AAQA,SAAgB,EAAc,EAAE,aAAU,aAAU,gBAAiC;CACnF,OACE,kBAAC,SAAD;EAAO,SAAS;EAAU,WAAW,EAAG,wBAAwB,CAAS;EACtE;CACI,CAAA;AAEX;AAWA,SAAgB,EAAgB,EAC9B,OACA,aACA,UAAO,QACP,iBAAc,IACd,qBACA,gBACuB;CACvB,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,eAAe,MAAS,WAAW,cAAc,CAAS;EAA7E,UAAA,CACG,KACC,kBAAC,SAAD;GACE,SAAS;GACT,cAAW;GACX,WAAW,EAAG,kBAAkB,CAAgB;EACjD,CAAA,GAEF,CACE;;AAET;AAEA,SAAgB,EAAc,EAC5B,aACA,gBAIC;CACD,OAAO,kBAAC,OAAD;EAAK,WAAW,EAAG,kBAAkB,CAAS;EAAI;CAAc,CAAA;AACzE"}
1
+ {"version":3,"file":"drawer.js","names":["Drawer","isOpen","setIsOpen","useState","defaultOpen","cn","breakpoint","side","className","contentClassName","sideClassName","withOverlay","id","overlayClassName","useDrawerState","initialState","prev","DrawerTrigger","drawerId","DrawerSidePanel","children","DrawerContent"],"sources":["../src/base/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport { useState, type ReactNode } from \"react\";\nimport type { Side } from \"../utils/types\";\n\ninterface DrawerProps {\n id: string;\n children: ReactNode;\n defaultOpen?: boolean;\n side?: Side;\n breakpoint?: string;\n withOverlay?: boolean;\n overlayClassName?: string;\n sideClassName?: string;\n contentClassName?: string;\n className?: string;\n}\n\nexport function Drawer({\n id,\n children,\n defaultOpen = false,\n side = \"left\",\n breakpoint = \"lg\",\n withOverlay = true,\n overlayClassName,\n sideClassName,\n contentClassName,\n className,\n}: DrawerProps) {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n return (\n <div\n className={cn(\n \"drawer\",\n breakpoint && `${breakpoint}:drawer-open`,\n side === \"right\" && \"drawer-end\",\n className\n )}\n >\n <input\n id={id}\n type=\"checkbox\"\n className=\"drawer-toggle\"\n checked={isOpen}\n onChange={() => setIsOpen(!isOpen)}\n aria-label=\"Toggle drawer\"\n />\n <div className={cn(\"drawer-content flex flex-col\", contentClassName)}>{children}</div>\n <div className={cn(\"drawer-side\", sideClassName)}>\n {withOverlay && (\n <label\n htmlFor={id}\n aria-label=\"Close sidebar\"\n className={cn(\"drawer-overlay\", overlayClassName)}\n onClick={() => setIsOpen(false)}\n />\n )}\n </div>\n </div>\n );\n}\n\nexport function useDrawerState(initialState = false) {\n const [isOpen, setIsOpen] = useState(initialState);\n return {\n isOpen,\n open: () => setIsOpen(true),\n close: () => setIsOpen(false),\n toggle: () => setIsOpen((prev) => !prev),\n };\n}\n\ninterface DrawerTriggerProps {\n drawerId: string;\n children: ReactNode;\n className?: string;\n}\n\nexport function DrawerTrigger({ drawerId, children, className }: DrawerTriggerProps) {\n return (\n <label htmlFor={drawerId} className={cn(\"label cursor-pointer\", className)}>\n {children}\n </label>\n );\n}\n\ninterface DrawerSidePanelProps {\n id: string;\n children: ReactNode;\n side?: Side;\n withOverlay?: boolean;\n overlayClassName?: string;\n className?: string;\n}\n\nexport function DrawerSidePanel({\n id,\n children,\n side = \"left\",\n withOverlay = true,\n overlayClassName,\n className,\n}: DrawerSidePanelProps) {\n return (\n <div className={cn(\"drawer-side\", side === \"right\" && \"drawer-end\", className)}>\n {withOverlay && (\n <label\n htmlFor={id}\n aria-label=\"Close sidebar\"\n className={cn(\"drawer-overlay\", overlayClassName)}\n />\n )}\n {children}\n </div>\n );\n}\n\nexport function DrawerContent({\n children,\n className,\n}: {\n children: React.ReactNode;\n className?: string;\n}) {\n return <div className={cn(\"drawer-content\", className)}>{children}</div>;\n}\n\nexport type { DrawerProps, DrawerTriggerProps, DrawerSidePanelProps };\n"],"mappings":";;;;;AAmBA,SAAgBA,EAAO,EACrB,OACA,aACA,iBAAc,IACd,UAAO,QACP,gBAAa,MACb,iBAAc,IACd,qBACA,kBACA,qBACA,gBACc;CACd,IAAM,CAACC,GAAQC,KAAaC,EAASC,CAAW;CAChD,OACE,kBAAC,OAAD;EACE,WAAWC,EACT,UACAC,KAAc,GAAGA,EAAW,eAC5BC,MAAS,WAAW,cACpBC,CACF;EANF,UAAA;GAQE,kBAAC,SAAD;IACM;IACJ,MAAK;IACL,WAAU;IACV,SAASP;IACT,gBAAgBC,EAAU,CAACD,CAAM;IACjC,cAAW;GACZ,CAAA;GACD,kBAAC,OAAD;IAAK,WAAWI,EAAG,gCAAgCI,CAAgB;IAAI;GAAc,CAAA;GACrF,kBAAC,OAAD;IAAK,WAAWJ,EAAG,eAAeK,CAAa;IAC5C,UAAAC,KACC,kBAAC,SAAD;KACE,SAASC;KACT,cAAW;KACX,WAAWP,EAAG,kBAAkBQ,CAAgB;KAChD,eAAeX,EAAU,EAAK;IAC/B,CAAA;GAEA,CAAA;EACF;;AAET;AAEA,SAAgBY,EAAe,IAAe,IAAO;CACnD,IAAM,CAACb,GAAQC,KAAaC,EAASY,CAAY;CACjD,OAAO;EACL;EACA,YAAYb,EAAU,EAAI;EAC1B,aAAaA,EAAU,EAAK;EAC5B,cAAcA,GAAW,MAAS,CAACc,CAAI;CACzC;AACF;AAQA,SAAgBC,EAAc,EAAE,aAAU,aAAU,gBAAiC;CACnF,OACE,kBAAC,SAAD;EAAO,SAASC;EAAU,WAAWb,EAAG,wBAAwBG,CAAS;EACtE;CACI,CAAA;AAEX;AAWA,SAAgBW,EAAgB,EAC9B,OACA,aACA,UAAO,QACP,iBAAc,IACd,qBACA,gBACuB;CACvB,OACE,kBAAC,OAAD;EAAK,WAAWd,EAAG,eAAeE,MAAS,WAAW,cAAcC,CAAS;EAA7E,UAAA,CACGG,KACC,kBAAC,SAAD;GACE,SAASC;GACT,cAAW;GACX,WAAWP,EAAG,kBAAkBQ,CAAgB;EACjD,CAAA,GAEFO,CACE;;AAET;AAEA,SAAgBC,EAAc,EAC5B,aACA,gBAIC;CACD,OAAO,kBAAC,OAAD;EAAK,WAAWhB,EAAG,kBAAkBG,CAAS;EAAI;CAAc,CAAA;AACzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.js","names":[],"sources":["../src/base/dropdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef, useRef, useEffect } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface DropdownProps extends HTMLAttributes<HTMLDetailsElement> {\n align?: \"start\" | \"end\";\n disabled?: boolean;\n trigger?: ReactNode;\n children?: ReactNode;\n menuClassName?: string;\n}\n\nexport const Dropdown = forwardRef<HTMLDetailsElement, DropdownProps>(\n (\n { className, align = \"start\", disabled = false, trigger, children, menuClassName, ...props },\n ref\n ) => {\n const detailsRef = useRef<HTMLDetailsElement>(null);\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (detailsRef.current && !detailsRef.current.contains(e.target as Node)) {\n detailsRef.current.open = false;\n }\n };\n document.addEventListener(\"click\", handler);\n return () => document.removeEventListener(\"click\", handler);\n }, []);\n\n return (\n <details\n ref={(el) => {\n (detailsRef as React.MutableRefObject<HTMLDetailsElement | null>).current = el;\n if (typeof ref === \"function\") ref(el);\n else if (ref) ref.current = el;\n }}\n className={cn(\"relative\", disabled && \"pointer-events-none opacity-50\", className)}\n {...props}\n >\n <summary className=\"cursor-pointer\" style={{ listStyle: \"none\" }}>\n {trigger}\n </summary>\n <ul\n className={cn(\n \"bg-base-100 rounded-box border-base-300 absolute z-50 mt-1 min-w-[240px] space-y-1 border p-2 shadow-lg\",\n align === \"end\" ? \"right-0\" : \"left-0\",\n menuClassName\n )}\n >\n {children}\n </ul>\n </details>\n );\n }\n);\nDropdown.displayName = \"Dropdown\";\n\nexport interface DropdownItemProps extends Omit<\n HTMLAttributes<HTMLLIElement>,\n \"onClick\" | \"onKeyDown\"\n> {\n children?: ReactNode;\n onSelect?: () => void;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;\n}\n\nexport const DropdownItem = forwardRef<HTMLLIElement, DropdownItemProps>(\n ({ className, children, onSelect, onClick, onKeyDown, ...props }, ref) => (\n <li ref={ref} role=\"none\" {...props}>\n <button\n type=\"button\"\n role=\"menuitem\"\n onClick={(e) => {\n onClick?.(e);\n onSelect?.();\n }}\n onKeyDown={onKeyDown}\n className={cn(\n \"hover:bg-base-200 text-base-content/80 hover:text-base-content relative flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm transition-colors outline-none focus-visible:ring-2\",\n className\n )}\n >\n {children}\n </button>\n </li>\n )\n);\nDropdownItem.displayName = \"DropdownItem\";\n\nexport const DropdownLink = forwardRef<\n HTMLAnchorElement,\n HTMLAttributes<HTMLAnchorElement> & { href?: string }\n>(({ className, children, href, ...props }, ref) => (\n <li role=\"none\" className=\"relative flex rounded outline-none\">\n <a\n ref={ref}\n href={href}\n role=\"menuitem\"\n className={cn(\n \"hover:bg-base-200 text-base-content/80 hover:text-base-content flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-sm text-inherit no-underline transition-colors focus-visible:ring-2\",\n className\n )}\n {...props}\n >\n {children}\n </a>\n </li>\n));\nDropdownLink.displayName = \"DropdownLink\";\n"],"mappings":";;;;;AAaA,IAAa,IAAW,GAEpB,EAAE,cAAW,WAAQ,SAAS,cAAW,IAAO,YAAS,aAAU,kBAAe,GAAG,KACrF,MACG;CACH,IAAM,IAAa,EAA2B,IAAI;CAYlD,OAVA,QAAgB;EACd,IAAM,KAAW,MAAkB;GACjC,AAAI,EAAW,WAAW,CAAC,EAAW,QAAQ,SAAS,EAAE,MAAc,MACrE,EAAW,QAAQ,OAAO;EAE9B;EAEA,OADA,SAAS,iBAAiB,SAAS,CAAO,SAC7B,SAAS,oBAAoB,SAAS,CAAO;CAC5D,GAAG,CAAC,CAAC,GAGH,kBAAC,WAAD;EACE,MAAM,MAAO;GAEX,AADA,EAAkE,UAAU,GACxE,OAAO,KAAQ,aAAY,EAAI,CAAE,IAC5B,MAAK,EAAI,UAAU;EAC9B;EACA,WAAW,EAAG,YAAY,KAAY,kCAAkC,CAAS;EACjF,GAAI;EAPN,UAAA,CASE,kBAAC,WAAD;GAAS,WAAU;GAAiB,OAAO,EAAE,WAAW,OAAO;GAC5D,UAAA;EACM,CAAA,GACT,kBAAC,MAAD;GACE,WAAW,EACT,2GACA,MAAU,QAAQ,YAAY,UAC9B,CACF;GAEC;EACC,CAAA,CACG;;AAEb,CACF;AACA,EAAS,cAAc;AAYvB,IAAa,IAAe,GACzB,EAAE,cAAW,aAAU,aAAU,YAAS,cAAW,GAAG,KAAS,MAChE,kBAAC,MAAD;CAAS;CAAK,MAAK;CAAO,GAAI;CAC5B,UAAA,kBAAC,UAAD;EACE,MAAK;EACL,MAAK;EACL,UAAU,MAAM;GAEd,AADA,IAAU,CAAC,GACX,IAAW;EACb;EACW;EACX,WAAW,EACT,iNACA,CACF;EAEC;CACK,CAAA;AACN,CAAA,CAER;AACA,EAAa,cAAc;AAE3B,IAAa,IAAe,GAGzB,EAAE,cAAW,aAAU,SAAM,GAAG,KAAS,MAC1C,kBAAC,MAAD;CAAI,MAAK;CAAO,WAAU;CACxB,UAAA,kBAAC,KAAD;EACO;EACC;EACN,MAAK;EACL,WAAW,EACT,2MACA,CACF;EACA,GAAI;EAEH;CACA,CAAA;AACD,CAAA,CACL;AACD,EAAa,cAAc"}
1
+ {"version":3,"file":"dropdown.js","names":["Dropdown","forwardRef","props","detailsRef","useRef","useEffect","handler","el","ref","cn","disabled","className","trigger","align","menuClassName","DropdownItem","onClick","onSelect","DropdownLink"],"sources":["../src/base/dropdown.tsx"],"sourcesContent":["\"use client\";\n\nimport { type HTMLAttributes, type ReactNode, forwardRef, useRef, useEffect } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface DropdownProps extends HTMLAttributes<HTMLDetailsElement> {\n align?: \"start\" | \"end\";\n disabled?: boolean;\n trigger?: ReactNode;\n children?: ReactNode;\n menuClassName?: string;\n}\n\nexport const Dropdown = forwardRef<HTMLDetailsElement, DropdownProps>(\n (\n { className, align = \"start\", disabled = false, trigger, children, menuClassName, ...props },\n ref\n ) => {\n const detailsRef = useRef<HTMLDetailsElement>(null);\n\n useEffect(() => {\n const handler = (e: MouseEvent) => {\n if (detailsRef.current && !detailsRef.current.contains(e.target as Node)) {\n detailsRef.current.open = false;\n }\n };\n document.addEventListener(\"click\", handler);\n return () => document.removeEventListener(\"click\", handler);\n }, []);\n\n return (\n <details\n ref={(el) => {\n (detailsRef as React.MutableRefObject<HTMLDetailsElement | null>).current = el;\n if (typeof ref === \"function\") ref(el);\n else if (ref) ref.current = el;\n }}\n className={cn(\"relative\", disabled && \"pointer-events-none opacity-50\", className)}\n {...props}\n >\n <summary className=\"cursor-pointer\" style={{ listStyle: \"none\" }}>\n {trigger}\n </summary>\n <ul\n className={cn(\n \"bg-base-100 rounded-box border-base-300 absolute z-50 mt-1 min-w-[240px] space-y-1 border p-2 shadow-lg\",\n align === \"end\" ? \"right-0\" : \"left-0\",\n menuClassName\n )}\n >\n {children}\n </ul>\n </details>\n );\n }\n);\nDropdown.displayName = \"Dropdown\";\n\nexport interface DropdownItemProps extends Omit<\n HTMLAttributes<HTMLLIElement>,\n \"onClick\" | \"onKeyDown\"\n> {\n children?: ReactNode;\n onSelect?: () => void;\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n onKeyDown?: React.KeyboardEventHandler<HTMLButtonElement>;\n}\n\nexport const DropdownItem = forwardRef<HTMLLIElement, DropdownItemProps>(\n ({ className, children, onSelect, onClick, onKeyDown, ...props }, ref) => (\n <li ref={ref} role=\"none\" {...props}>\n <button\n type=\"button\"\n role=\"menuitem\"\n onClick={(e) => {\n onClick?.(e);\n onSelect?.();\n }}\n onKeyDown={onKeyDown}\n className={cn(\n \"hover:bg-base-200 text-base-content/80 hover:text-base-content relative flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-left text-sm transition-colors outline-none focus-visible:ring-2\",\n className\n )}\n >\n {children}\n </button>\n </li>\n )\n);\nDropdownItem.displayName = \"DropdownItem\";\n\nexport const DropdownLink = forwardRef<\n HTMLAnchorElement,\n HTMLAttributes<HTMLAnchorElement> & { href?: string }\n>(({ className, children, href, ...props }, ref) => (\n <li role=\"none\" className=\"relative flex rounded outline-none\">\n <a\n ref={ref}\n href={href}\n role=\"menuitem\"\n className={cn(\n \"hover:bg-base-200 text-base-content/80 hover:text-base-content flex w-full cursor-pointer items-center gap-2 rounded px-2 py-2 text-sm text-inherit no-underline transition-colors focus-visible:ring-2\",\n className\n )}\n {...props}\n >\n {children}\n </a>\n </li>\n));\nD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AD;CAAI,MAAK;CAAO,WAAU;CACxB,UAAA,kBAAC,KAAD;EACO;EACC;EACN,MAAK;EACL,WAAWO,EACT,2MACAE,CACF;EACA,GAAIT;EAEH;CACA,CAAA;AACD,CAAA,CACL;AACD,EAAa,cAAc"}
package/dist/input.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","names":[],"sources":["../src/base/input.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Color, Size } from \"../utils/types\";\n\ntype InputColor = Color;\ntype InputSize = Size | \"xl\";\n\ninterface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n color?: InputColor;\n inputSize?: InputSize;\n ghost?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, color, inputSize, ghost, ...props }, ref) => (\n <input\n ref={ref}\n className={cn(\n \"input\",\n ghost && \"input-ghost\",\n color && `input-${color}`,\n inputSize && `input-${inputSize}`,\n className\n )}\n {...props}\n />\n )\n);\nInput.displayName = \"Input\";\n\ninterface InputGroupProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode;\n}\n\nexport const InputGroup = forwardRef<HTMLLabelElement, InputGroupProps>(\n ({ children, className, ...props }, ref) => (\n <label ref={ref} className={cn(\"input\", className)} {...props}>\n {children}\n </label>\n )\n);\nInputGroup.displayName = \"InputGroup\";\n\nexport type { InputProps, InputGroupProps, InputColor, InputSize };\n"],"mappings":";;;;;AAcA,IAAa,IAAQ,GAClB,EAAE,cAAW,UAAO,cAAW,UAAO,GAAG,KAAS,MACjD,kBAAC,SAAD;CACO;CACL,WAAW,EACT,SACA,KAAS,eACT,KAAS,SAAS,KAClB,KAAa,SAAS,KACtB,CACF;CACA,GAAI;AACL,CAAA,CAEL;AACA,EAAM,cAAc;AAMpB,IAAa,IAAa,GACvB,EAAE,aAAU,cAAW,GAAG,KAAS,MAClC,kBAAC,SAAD;CAAY;CAAK,WAAW,EAAG,SAAS,CAAS;CAAG,GAAI;CACrD;AACI,CAAA,CAEX;AACA,EAAW,cAAc"}
1
+ {"version":3,"file":"input.js","names":["Input","forwardRef","props","cn","ghost","color","inputSize","className","InputGroup"],"sources":["../src/base/input.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Color, Size } from \"../utils/types\";\n\ntype InputColor = Color;\ntype InputSize = Size | \"xl\";\n\ninterface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {\n color?: InputColor;\n inputSize?: InputSize;\n ghost?: boolean;\n}\n\nexport const Input = forwardRef<HTMLInputElement, InputProps>(\n ({ className, color, inputSize, ghost, ...props }, ref) => (\n <input\n ref={ref}\n className={cn(\n \"input\",\n ghost && \"input-ghost\",\n color && `input-${color}`,\n inputSize && `input-${inputSize}`,\n className\n )}\n {...props}\n />\n )\n);\nInput.displayName = \"Input\";\n\ninterface InputGroupProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children: React.ReactNode;\n}\n\nexport const InputGroup = forwardRef<HTMLLabelElement, InputGroupProps>(\n ({ children, className, ...props }, ref) => (\n <label ref={ref} className={cn(\"input\", className)} {...props}>\n {children}\n </label>\n )\n);\nInputGroup.displayName = \"InputGroup\";\n\nexport type { InputProps, InputGroupProps, InputColor, InputSize };\n"],"mappings":";;;;;AAcA,IAAaA,IAAQC,GAClB,EAAE,cAAW,UAAO,cAAW,UAAO,GAAGC,KAAS,MACjD,kBAAC,SAAD;CACO;CACL,WAAWC,EACT,SACAC,KAAS,eACTC,KAAS,SAASA,KAClBC,KAAa,SAASA,KACtBC,CACF;CACA,GAAIL;AACL,CAAA,CAEL;AACA,EAAM,cAAc;AAMpB,IAAaM,IAAaP,GACvB,EAAE,aAAU,cAAW,GAAGC,KAAS,MAClC,kBAAC,SAAD;CAAY;CAAK,WAAWC,EAAG,SAASI,CAAS;CAAG,GAAIL;CACrD;AACI,CAAA,CAEX;AACA,EAAW,cAAc"}
package/dist/kbd.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"kbd.js","names":[],"sources":["../src/base/kbd.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Size } from \"../utils/types\";\n\ntype KbdSize = Size | \"xl\";\n\ninterface KbdProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n size?: KbdSize;\n}\n\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(\n ({ children, className, size, ...props }, ref) => (\n <kbd ref={ref} className={cn(\"kbd\", size && `kbd-${size}`, className)} {...props}>\n {children}\n </kbd>\n )\n);\nKbd.displayName = \"Kbd\";\n\nexport type { KbdProps, KbdSize };\n\ntype IconComponent = React.ComponentType<{ size?: number }>;\n\nexport interface FnKeyIcons {\n Command?: IconComponent;\n Option?: IconComponent;\n ArrowBigUp?: IconComponent;\n CircleArrowOutUpLeft?: IconComponent;\n Space?: IconComponent;\n Delete?: IconComponent;\n ArrowRightToLine?: IconComponent;\n ChevronUp?: IconComponent;\n ChevronDown?: IconComponent;\n ChevronLeft?: IconComponent;\n ChevronRight?: IconComponent;\n}\n\nlet _icons: FnKeyIcons = {};\n\nconst iconSize = 12;\n\nfunction Key({ icon: Icon, entity }: { icon?: IconComponent; entity: string }): React.ReactElement {\n if (Icon) return <Icon size={iconSize} />;\n return <span style={{ fontSize: iconSize }}>{entity}</span>;\n}\n\nexport const FnKey = {\n configure(icons: FnKeyIcons): void {\n _icons = icons;\n },\n Cmd: () => <Key icon={_icons.Command} entity=\"⌘\" />,\n Option: () => <Key icon={_icons.Option} entity=\"⌥\" />,\n Ctrl: () => <Key icon={_icons.ChevronUp} entity=\"⌃\" />,\n Shift: () => <Key icon={_icons.ArrowBigUp} entity=\"⇧\" />,\n Esc: () => <Key icon={_icons.CircleArrowOutUpLeft} entity=\"⎋\" />,\n Space: () => <Key icon={_icons.Space} entity=\"␣\" />,\n Delete: () => <Key icon={_icons.Delete} entity=\"⌫\" />,\n Tab: () => <Key icon={_icons.ArrowRightToLine} entity=\"⇥\" />,\n Up: () => <Key icon={_icons.ChevronUp} entity=\"↑\" />,\n Down: () => <Key icon={_icons.ChevronDown} entity=\"↓\" />,\n Left: () => <Key icon={_icons.ChevronLeft} entity=\"←\" />,\n Right: () => <Key icon={_icons.ChevronRight} entity=\"→\" />,\n};\n"],"mappings":";;;;;AAYA,IAAa,IAAM,GAChB,EAAE,aAAU,cAAW,SAAM,GAAG,KAAS,MACxC,kBAAC,OAAD;CAAU;CAAK,WAAW,EAAG,OAAO,KAAQ,OAAO,KAAQ,CAAS;CAAG,GAAI;CACxE;AACE,CAAA,CAET;AACA,EAAI,cAAc;AAoBlB,IAAI,IAAqB,CAAC,GAEpB,IAAW;AAEjB,SAAS,EAAI,EAAE,MAAM,GAAM,aAAwE;CAEjG,OADI,IAAa,kBAAC,GAAD,EAAM,MAAM,EAAW,CAAA,IACjC,kBAAC,QAAD;EAAM,OAAO,EAAE,UAAU,EAAS;EAAI,UAAA;CAAa,CAAA;AAC5D;AAEA,IAAa,IAAQ;CACnB,UAAU,GAAyB;EACjC,IAAS;CACX;CACA,WAAW,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAS,QAAO;CAAK,CAAA;CAClD,cAAc,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAQ,QAAO;CAAK,CAAA;CACpD,YAAY,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAW,QAAO;CAAK,CAAA;CACrD,aAAa,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAY,QAAO;CAAK,CAAA;CACvD,WAAW,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAsB,QAAO;CAAK,CAAA;CAC/D,aAAa,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAO,QAAO;CAAK,CAAA;CAClD,cAAc,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAQ,QAAO;CAAK,CAAA;CACpD,WAAW,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAkB,QAAO;CAAK,CAAA;CAC3D,UAAU,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAW,QAAO;CAAK,CAAA;CACnD,YAAY,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAa,QAAO;CAAK,CAAA;CACvD,YAAY,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAa,QAAO;CAAK,CAAA;CACvD,aAAa,kBAAC,GAAD;EAAK,MAAM,EAAO;EAAc,QAAO;CAAK,CAAA;AAC3D"}
1
+ {"version":3,"file":"kbd.js","names":["Kbd","forwardRef","props","cn","size","className","_icons","iconSize","Key","Icon","entity","FnKey","icons"],"sources":["../src/base/kbd.tsx"],"sourcesContent":["\"use client\";\nimport { forwardRef } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Size } from \"../utils/types\";\n\ntype KbdSize = Size | \"xl\";\n\ninterface KbdProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode;\n size?: KbdSize;\n}\n\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(\n ({ children, className, size, ...props }, ref) => (\n <kbd ref={ref} className={cn(\"kbd\", size && `kbd-${size}`, className)} {...props}>\n {children}\n </kbd>\n )\n);\nKbd.displayName = \"Kbd\";\n\nexport type { KbdProps, KbdSize };\n\ntype IconComponent = React.ComponentType<{ size?: number }>;\n\nexport interface FnKeyIcons {\n Command?: IconComponent;\n Option?: IconComponent;\n ArrowBigUp?: IconComponent;\n CircleArrowOutUpLeft?: IconComponent;\n Space?: IconComponent;\n Delete?: IconComponent;\n ArrowRightToLine?: IconComponent;\n ChevronUp?: IconComponent;\n ChevronDown?: IconComponent;\n ChevronLeft?: IconComponent;\n ChevronRight?: IconComponent;\n}\n\nlet _icons: FnKeyIcons = {};\n\nconst iconSize = 12;\n\nfunction Key({ icon: Icon, entity }: { icon?: IconComponent; entity: string }): React.ReactElement {\n if (Icon) return <Icon size={iconSize} />;\n return <span style={{ fontSize: iconSize }}>{entity}</span>;\n}\n\nexport const FnKey = {\n configure(icons: FnKeyIcons): void {\n _icons = icons;\n },\n Cmd: () => <Key icon={_icons.Command} entity=\"⌘\" />,\n Option: () => <Key icon={_icons.Option} entity=\"⌥\" />,\n Ctrl: () => <Key icon={_icons.ChevronUp} entity=\"⌃\" />,\n Shift: () => <Key icon={_icons.ArrowBigUp} entity=\"⇧\" />,\n Esc: () => <Key icon={_icons.CircleArrowOutUpLeft} entity=\"⎋\" />,\n Space: () => <Key icon={_icons.Space} entity=\"␣\" />,\n Delete: () => <Key icon={_icons.Delete} entity=\"⌫\" />,\n Tab: () => <Key icon={_icons.ArrowRightToLine} entity=\"⇥\" />,\n Up: () => <Key icon={_icons.ChevronUp} entity=\"↑\" />,\n Down: () => <Key icon={_icons.ChevronDown} entity=\"↓\" />,\n Left: () => <Key icon={_icons.ChevronLeft} entity=\"←\" />,\n Right: () => <Key icon={_icons.ChevronRight} entity=\"→\" />,\n};\n"],"mappings":";;;;;AAYA,IAAaA,IAAMC,GAChB,EAAE,aAAU,cAAW,SAAM,GAAGC,KAAS,MACxC,kBAAC,OAAD;CAAU;CAAK,WAAWC,EAAG,OAAOC,KAAQ,OAAOA,KAAQC,CAAS;CAAG,GAAIH;CACxE;AACE,CAAA,CAET;AACA,EAAI,cAAc;AAoBlB,IAAII,IAAqB,CAAC,GAEpBC,IAAW;AAEjB,SAASC,EAAI,EAAE,MAAMC,GAAM,aAAwE;CAEjG,OADIA,IAAa,kBAACA,GAAD,EAAM,MAAMF,EAAW,CAAA,IACjC,kBAAC,QAAD;EAAM,OAAO,EAAE,UAAUA,EAAS;EAAI,UAAAG;CAAa,CAAA;AAC5D;AAEA,IAAaC,IAAQ;CACnB,UAAU,GAAyB;EACjC,IAASC;CACX;CACA,WAAW,kBAACJ,GAAD;EAAK,MAAMF,EAAO;EAAS,QAAO;CAAK,CAAA;CAClD,cAAc,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAQ,QAAO;CAAK,CAAA;CACpD,YAAY,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAW,QAAO;CAAK,CAAA;CACrD,aAAa,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAY,QAAO;CAAK,CAAA;CACvD,WAAW,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAsB,QAAO;CAAK,CAAA;CAC/D,aAAa,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAO,QAAO;CAAK,CAAA;CAClD,cAAc,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAQ,QAAO;CAAK,CAAA;CACpD,WAAW,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAkB,QAAO;CAAK,CAAA;CAC3D,UAAU,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAW,QAAO;CAAK,CAAA;CACnD,YAAY,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAa,QAAO;CAAK,CAAA;CACvD,YAAY,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAa,QAAO;CAAK,CAAA;CACvD,aAAa,kBAACE,GAAD;EAAK,MAAMF,EAAO;EAAc,QAAO;CAAK,CAAA;AAC3D"}
package/dist/modal.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","names":[],"sources":["../src/base/modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useRef, useCallback } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Placement } from \"../utils/types\";\n\ninterface ModalProps extends React.DialogHTMLAttributes<HTMLDialogElement> {\n children: React.ReactNode;\n closeOnBackdrop?: boolean;\n placement?: Placement;\n boxClassName?: string;\n}\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalProps>(\n ({ children, className, closeOnBackdrop = true, placement, boxClassName, ...props }, ref) => (\n <dialog\n ref={ref}\n className={cn(\"modal\", placement && `modal-${placement}`, className)}\n {...props}\n >\n <div className={cn(\"modal-box\", boxClassName)}>{children}</div>\n {closeOnBackdrop && (\n <form method=\"dialog\" className=\"modal-backdrop\">\n <button>esc</button>\n </form>\n )}\n </dialog>\n )\n);\nModal.displayName = \"Modal\";\n\nexport function useModal() {\n const ref = useRef<HTMLDialogElement>(null);\n const open = useCallback(() => {\n ref.current?.showModal();\n setTimeout(() => {\n ref.current?.querySelector<HTMLElement>(\"input, [autofocus]\")?.focus();\n }, 0);\n }, []);\n const close = useCallback(() => ref.current?.close(), []);\n return { ref, open, close };\n}\n\nexport type { ModalProps };\n"],"mappings":";;;;;AAaA,IAAa,IAAQ,GAClB,EAAE,aAAU,cAAW,qBAAkB,IAAM,cAAW,iBAAc,GAAG,KAAS,MACnF,kBAAC,UAAD;CACO;CACL,WAAW,EAAG,SAAS,KAAa,SAAS,KAAa,CAAS;CACnE,GAAI;CAHN,UAAA,CAKE,kBAAC,OAAD;EAAK,WAAW,EAAG,aAAa,CAAY;EAAI;CAAc,CAAA,GAC7D,KACC,kBAAC,QAAD;EAAM,QAAO;EAAS,WAAU;EAC9B,UAAA,kBAAC,UAAD,EAAA,UAAQ,MAAW,CAAA;CACf,CAAA,CAEF;AAEZ,CAAA,CAAA;AACA,EAAM,cAAc;AAEpB,SAAgB,IAAW;CACzB,IAAM,IAAM,EAA0B,IAAI;CAQ1C,OAAO;EAAE;EAAK,MAPD,QAAkB;GAE7B,AADA,EAAI,SAAS,UAAU,GACvB,iBAAiB;IACf,EAAI,SAAS,cAA2B,oBAAoB,CAAC,EAAE,MAAM;GACvE,GAAG,CAAC;EACN,GAAG,CAAC,CAEU;EAAM,OADN,QAAkB,EAAI,SAAS,MAAM,GAAG,CAAC,CACnC;CAAM;AAC5B"}
1
+ {"version":3,"file":"modal.js","names":["Modal","forwardRef","props","cn","placement","className","boxClassName","closeOnBackdrop","useModal","ref","useRef","useCallback"],"sources":["../src/base/modal.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, useRef, useCallback } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Placement } from \"../utils/types\";\n\ninterface ModalProps extends React.DialogHTMLAttributes<HTMLDialogElement> {\n children: React.ReactNode;\n closeOnBackdrop?: boolean;\n placement?: Placement;\n boxClassName?: string;\n}\n\nexport const Modal = forwardRef<HTMLDialogElement, ModalProps>(\n ({ children, className, closeOnBackdrop = true, placement, boxClassName, ...props }, ref) => (\n <dialog\n ref={ref}\n className={cn(\"modal\", placement && `modal-${placement}`, className)}\n {...props}\n >\n <div className={cn(\"modal-box\", boxClassName)}>{children}</div>\n {closeOnBackdrop && (\n <form method=\"dialog\" className=\"modal-backdrop\">\n <button>esc</button>\n </form>\n )}\n </dialog>\n )\n);\nModal.displayName = \"Modal\";\n\nexport function useModal() {\n const ref = useRef<HTMLDialogElement>(null);\n const open = useCallback(() => {\n ref.current?.showModal();\n setTimeout(() => {\n ref.current?.querySelector<HTMLElement>(\"input, [autofocus]\")?.focus();\n }, 0);\n }, []);\n const close = useCallback(() => ref.current?.close(), []);\n return { ref, open, close };\n}\n\nexport type { ModalProps };\n"],"mappings":";;;;;AAaA,IAAaA,IAAQC,GAClB,EAAE,aAAU,cAAW,qBAAkB,IAAM,cAAW,iBAAc,GAAGC,KAAS,MACnF,kBAAC,UAAD;CACO;CACL,WAAWC,EAAG,SAASC,KAAa,SAASA,KAAaC,CAAS;CACnE,GAAIH;CAHN,UAAA,CAKE,kBAAC,OAAD;EAAK,WAAWC,EAAG,aAAaG,CAAY;EAAI;CAAc,CAAA,GAC7DC,KACC,kBAAC,QAAD;EAAM,QAAO;EAAS,WAAU;EAC9B,UAAA,kBAAC,UAAD,EAAA,UAAQ,MAAW,CAAA;CACf,CAAA,CAEF;AAEZ,CAAA,CAAA;AACA,EAAM,cAAc;AAEpB,SAAgBC,IAAW;CACzB,IAAMC,IAAMC,EAA0B,IAAI;CAQ1C,OAAO;EAAE;EAAK,MAPDC,QAAkB;GAE7B,AADAF,EAAI,SAAS,UAAU,GACvB,iBAAiB;IACf,EAAI,SAAS,cAA2B,oBAAoB,CAAC,EAAE,MAAM;GACvE,GAAG,CAAC;EACN,GAAG,CAAC,CAEU;EAAM,OADNE,QAAkBF,EAAI,SAAS,MAAM,GAAG,CAAC,CACnC;CAAM;AAC5B"}
@@ -1 +1 @@
1
- {"version":3,"file":"navbar.js","names":[],"sources":["../src/base/navbar.tsx"],"sourcesContent":["import type { ReactNode, CSSProperties } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface NavbarProps {\n id?: string;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\nexport interface LogoProps {\n src?: string;\n alt?: string;\n text?: string;\n href?: string;\n className?: string;\n}\nexport interface NavMenuItem {\n title: string;\n href: string;\n isExternal?: boolean;\n}\nexport interface NavMenuProps {\n items: NavMenuItem[];\n activePath?: string;\n className?: string;\n}\n\nexport function Navbar({ id, children, className, style }: NavbarProps) {\n return (\n <nav id={id} className={cn(\"navbar\", className)} style={style}>\n {children}\n </nav>\n );\n}\n\nexport function Logo({ src, alt, text, href = \"/\", className }: LogoProps) {\n return (\n <a href={href} className={cn(\"flex items-center gap-2\", className)}>\n {src ? <img src={src} alt={alt || text || \"Logo\"} className=\"h-8 w-8\" /> : null}\n {text && <span className=\"text-xl font-bold\">{text}</span>}\n </a>\n );\n}\n\nexport function NavMenu({ items, activePath, className }: NavMenuProps) {\n return (\n <ul className={cn(\"menu menu-horizontal gap-1\", className)}>\n {items.map((item) => {\n const isActive = activePath\n ? item.href === \"/\"\n ? activePath === \"/\"\n : activePath === item.href || activePath.startsWith(item.href + \"/\")\n : false;\n return (\n <li key={item.href}>\n <a\n href={item.href}\n className={cn(isActive && \"active\")}\n target={item.isExternal ? \"_blank\" : undefined}\n rel={item.isExternal ? \"noopener noreferrer\" : undefined}\n >\n {item.title}\n </a>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport function NavMenuLink({\n item,\n isActive,\n className,\n}: {\n item: NavMenuItem;\n isActive?: boolean;\n className?: string;\n}) {\n return (\n <a\n href={item.href}\n className={cn(isActive && \"active\", className)}\n target={item.isExternal ? \"_blank\" : undefined}\n rel={item.isExternal ? \"noopener noreferrer\" : undefined}\n >\n {item.title}\n </a>\n );\n}\n"],"mappings":";;;A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activePath","item","NavMenuLink"],"sources":["../src/base/navbar.tsx"],"sourcesContent":["import type { ReactNode, CSSProperties } from \"react\";\nimport { cn } from \"../utils/cn\";\n\nexport interface NavbarProps {\n id?: string;\n children?: ReactNode;\n className?: string;\n style?: CSSProperties;\n}\nexport interface LogoProps {\n src?: string;\n alt?: string;\n text?: string;\n href?: string;\n className?: string;\n}\nexport interface NavMenuItem {\n title: string;\n href: string;\n isExternal?: boolean;\n}\nexport interface NavMenuProps {\n items: NavMenuItem[];\n activePath?: string;\n className?: string;\n}\n\nexport function Navbar({ id, children, className, style }: NavbarProps) {\n return (\n <nav id={id} className={cn(\"navbar\", className)} style={style}>\n {children}\n </nav>\n );\n}\n\nexport function Logo({ src, alt, text, href = \"/\", className }: LogoProps) {\n return (\n <a href={href} className={cn(\"flex items-center gap-2\", className)}>\n {src ? <img src={src} alt={alt || text || \"Logo\"} className=\"h-8 w-8\" /> : null}\n {text && <span className=\"text-xl font-bold\">{text}</span>}\n </a>\n );\n}\n\nexport function NavMenu({ items, activePath, className }: NavMenuProps) {\n return (\n <ul className={cn(\"menu menu-horizontal gap-1\", className)}>\n {items.map((item) => {\n const isActive = activePath\n ? item.href === \"/\"\n ? activePath === \"/\"\n : activePath === item.href || activePath.startsWith(item.href + \"/\")\n : false;\n return (\n <li key={item.href}>\n <a\n href={item.href}\n className={cn(isActive && \"active\")}\n target={item.isExternal ? \"_blank\" : undefined}\n rel={item.isExternal ? \"noopener noreferrer\" : undefined}\n >\n {item.title}\n </a>\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport function NavMenuLink({\n item,\n isActive,\n className,\n}: {\n item: NavMenuItem;\n isActive?: boolean;\n className?: string;\n}) {\n return (\n <a\n href={item.href}\n className={cn(isActive && \"active\", className)}\n target={item.isExternal ? \"_blank\" : undefined}\n rel={item.isExternal ? \"noopener noreferrer\" : undefined}\n >\n {item.title}\n </a>\n );\n}\n"],"mappings":";;;AA2BA,SAAgBA,EAAO,EAAE,OAAI,aAAU,cAA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sourcesContent":["import { cn } from \"../utils/cn\";\nimport type { ReactNode } from \"react\";\n\nexport interface PaginationDocsProps {\n prev?: { href: string; title: string; description?: string };\n next?: { href: string; title: string; description?: string };\n className?: string;\n prevIcon?: ReactNode;\n nextIcon?: ReactNode;\n linkClassName?: string;\n}\n\ninterface PaginationCardProps {\n direction: \"prev\" | \"next\";\n label: string;\n title: string;\n description?: string;\n icon?: ReactNode;\n}\n\nfunction PaginationCard({ direction, label, title, description, icon }: PaginationCardProps) {\n const isPrevious = direction === \"prev\";\n\n const labelNode = (\n <div\n className={cn(\n \"text-primary/75 flex items-center gap-1.5 text-sm\",\n isPrevious ? \"pr-5 pl-3\" : \"pr-3 pl-5\",\n isPrevious && \"shrink-0\"\n )}\n >\n {isPrevious && icon && <span className=\"flex shrink-0 items-center\">{icon}</span>}\n <span data-component-part=\"pagination-label\">{label}</span>\n {!isPrevious && icon && <span className=\"flex shrink-0 items-center\">{icon}</span>}\n </div>\n );\n\n const metaNode = (\n <div\n className={cn(\n \"flex min-w-0 flex-col justify-center px-5\",\n isPrevious ? \"items-start text-left\" : \"items-end text-right\"\n )}\n >\n <div\n data-component-part=\"pagination-title\"\n className=\"text-primary w-full truncate text-sm font-semibold\"\n >\n {title}\n </div>\n {description && (\n <span\n data-component-part=\"pagination-description\"\n className=\"text-primary/75 hidden w-full max-w-72 truncate text-xs sm:block\"\n >\n {description}\n </span>\n )}\n </div>\n );\n\n return (\n <div\n className={cn(\n \"bg-primary/15 hover:bg-primary/20 hover:ring-primary/30 flex h-16 flex-1 items-center rounded-xl transition-shadow hover:ring-1\",\n isPrevious ? \"justify-start\" : \"justify-end\"\n )}\n >\n {isPrevious ? (\n <>\n {labelNode}\n <div className=\"bg-primary/20 h-8 w-px shrink-0\" />\n {metaNode}\n </>\n ) : (\n <>\n {metaNode}\n <div className=\"bg-primary/20 h-8 w-px\" />\n {labelNode}\n </>\n )}\n </div>\n );\n}\n\nexport function PaginationDocs({\n prev,\n next,\n className,\n prevIcon,\n nextIcon,\n linkClassName,\n}: PaginationDocsProps) {\n return (\n <nav\n id=\"pagination\"\n aria-label=\"Pagination\"\n className={cn(\"bg-base-200/50 flex w-full gap-1 rounded-2xl p-1\", className)}\n >\n {prev && (\n <a\n href={prev.href}\n rel=\"prev\"\n data-component-part=\"pagination-prev\"\n className={cn(\n \"group min-w-0 rounded-xl no-underline\",\n next\n ? // Paired with next: minimal link by design (30% of the pill).\n \"text-muted-foreground hover:bg-base-200/60 hover:text-base-content flex w-[calc(30%-2px)] items-center justify-start gap-1.5 rounded-xl px-3 py-3 text-sm transition-colors\"\n : // Alone (last page, no next): rich card mirroring the next-only\n // variant — full width on mobile, half the container above\n // 640px, pushed left like a back button.\n \"w-full sm:mr-auto sm:w-1/2\",\n linkClassName\n )}\n >\n {next ? (\n <>\n {prevIcon && <span className=\"flex shrink-0 items-center\">{prevIcon}</span>}\n <span data-component-part=\"pagination-label\">Previous</span>\n </>\n ) : (\n <PaginationCard\n direction=\"prev\"\n label=\"Previous\"\n title={prev.title}\n description={prev.description}\n icon={prevIcon}\n />\n )}\n </a>\n )}\n {next && (\n <a\n href={next.href}\n rel=\"next\"\n data-component-part=\"pagination-next\"\n className={cn(\n \"group min-w-0 rounded-xl no-underline\",\n // Next-only (e.g. docs index): full width on mobile, half the\n // container above 640px — pushed right like a forward button.\n // With prev: calc-based 70% (minus half the gap) so the pair\n // always fills the pill without overlapping.\n prev ? \"w-[calc(70%-2px)]\" : \"w-full sm:ml-auto sm:w-1/2\",\n linkClassName\n )}\n >\n <PaginationCard\n direction=\"next\"\n label=\"Next\"\n title={next.title}\n description={next.description}\n icon={nextIcon}\n />\n </a>\n )}\n </nav>\n );\n}\n"],"mappings":";;;AAoBA,SAAS,EAAe,EAAE,cAAW,UAAO,UAAO,gBAAa,WAA6B;CAC3F,IAAM,IAAa,MAAc,QAE3B,IACJ,kBAAC,OAAD;EACE,WAAW,EACT,qDACA,IAAa,cAAc,aAC3B,KAAc,UAChB;EALF,UAAA;GAOG,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IACZ,aAAa,EAAK;IAClB,MAAM;GACP,CAAA;EAEF,CAAA,GAEJ,KACC,kBAAC,KAAD;GACE,MAAM,EAAK;GACX,KAAI;GACJ,uBAAoB;GACpB,WAAW,EACT,yCAKA,IAAO,sBAAsB,8BAC7B,CACF;GAEA,UAAA,kBAAC,GAAD;IACE,WAAU;IACV,OAAM;IACN,OAAO,EAAK;IACZ,aAAa,EAAK;IAClB,MAAM;GACP,CAAA;EACA,CAAA,CAEF;;AAET"}
1
+ {"version":3,"file":"pagination.js","names":["_Fragment","PaginationCard","isPrevious","direction","labelNode","cn","icon","label","metaNode","title","description","Fragment","PaginationDocs","className","prev","next","linkClassName","prevIcon","nextIcon"],"sources":["../src/base/pagination.tsx"],"sourcesContent":["import { cn } from \"../utils/cn\";\nimport type { ReactNode } from \"react\";\n\nexport interface PaginationDocsProps {\n prev?: { href: string; title: string; description?: string };\n next?: { href: string; title: string; description?: string };\n className?: string;\n prevIcon?: ReactNode;\n nextIcon?: ReactNode;\n linkClassName?: string;\n}\n\ninterface PaginationCardProps {\n direction: \"prev\" | \"next\";\n label: string;\n title: string;\n description?: string;\n icon?: ReactNode;\n}\n\nfunction PaginationCard({ direction, label, title, description, icon }: PaginationCardProps) {\n const isPrevious = direction === \"prev\";\n\n const labelNode = (\n <div\n className={cn(\n \"text-primary/75 flex items-center gap-1.5 text-sm\",\n isPrevious ? \"pr-5 pl-3\" : \"pr-3 pl-5\",\n isPrevious && \"shrink-0\"\n )}\n >\n {isPrevious && icon && <span className=\"flex shrink-0 items-center\">{icon}</span>}\n <span data-component-part=\"pagination-label\">{label}</span>\n {!isPrevious && icon && <span className=\"flex shrink-0 items-center\">{icon}</span>}\n </div>\n );\n\n const metaNode = (\n <div\n className={cn(\n \"flex min-w-0 flex-col justify-center px-5\",\n isPrevious ? \"items-start text-left\" : \"items-end text-right\"\n )}\n >\n <div\n data-component-part=\"pagination-title\"\n className=\"text-primary w-full truncate text-sm font-semibold\"\n >\n {title}\n </div>\n {description && (\n <span\n data-component-part=\"pagination-description\"\n className=\"text-primary/75 hidden w-full max-w-72 truncate text-xs sm:block\"\n >\n {description}\n </span>\n )}\n </div>\n );\n\n return (\n <div\n className={cn(\n \"bg-primary/15 hover:bg-primary/20 hover:ring-primary/30 flex h-16 flex-1 items-center rounded-xl transition-shadow hover:ring-1\",\n isPrevious ? \"justify-start\" : \"justify-end\"\n )}\n >\n {isPrevious ? (\n <>\n {labelNode}\n <div className=\"bg-primary/20 h-8 w-px shrink-0\" />\n {metaNode}\n </>\n ) : (\n <>\n {metaNode}\n <div className=\"bg-primary/20 h-8 w-px\" />\n {labelNode}\n </>\n )}\n </div>\n );\n}\n\nexport function PaginationDocs({\n prev,\n next,\n className,\n prevIcon,\n nextIcon,\n linkClassName,\n}: PaginationDocsProps) {\n return (\n <nav\n id=\"pagination\"\n aria-label=\"Pagination\"\n className={cn(\"bg-base-200/50 flex w-full gap-1 rounded-2xl p-1\", className)}\n >\n {prev && (\n <a\n href={prev.href}\n rel=\"prev\"\n data-component-part=\"pagination-prev\"\n className={cn(\n \"group min-w-0 rounded-xl no-underline\",\n next\n ? // Paired with next: minimal link by design (30% of the pill).\n \"text-muted-foreground hover:bg-base-200/60 hover:text-base-content flex w-[calc(30%-2px)] items-center justify-start gap-1.5 rounded-xl px-3 py-3 text-sm transition-colors\"\n : // Alone (last page, no next): rich card mirroring the next-only\n // variant — full width on mobile, half the container above\n // 640px, pushed left like a back button.\n \"w-full sm:mr-auto sm:w-1/2\",\n linkClassName\n )}\n >\n {next ? (\n <>\n {prevIcon && <span className=\"flex shrink-0 items-center\">{prevIcon}</span>}\n <span data-component-part=\"pagination-label\">Previous</span>\n </>\n ) : (\n <PaginationCard\n direction=\"prev\"\n label=\"Previous\"\n title={prev.title}\n description={prev.description}\n icon={prevIcon}\n />\n )}\n </a>\n )}\n {next && (\n <a\n href={next.href}\n rel=\"next\"\n data-component-part=\"pagination-next\"\n className={cn(\n \"group min-w-0 rounded-xl no-underline\",\n // Next-only (e.g. docs index): full width on mobile, half the\n // container above 640px — pushed right like a forward button.\n // With prev: calc-based 70% (minus half the gap) so the pair\n // always fills the pill without overlapping.\n prev ? \"w-[calc(70%-2px)]\" : \"w-full sm:ml-auto sm:w-1/2\",\n linkClassName\n )}\n >\n <PaginationCard\n direction=\"next\"\n label=\"Next\"\n title={next.title}\n description={next.description}\n icon={nextIcon}\n />\n </a>\n )}\n </nav>\n );\n}\n"],"mappings":";;;AAoBA,SAASC,EAAe,EAAE,cAAW,UAAO,UAAO,gBAAa,WAA6B;CAC3F,IAAMC,IAAaC,MAAc,QAE3BC,IACJ,kBAAC,OAAD;EACE,WAAWC,EACT,qDACAH,IAAa,cAAc,aAC3BA,KAAc,UAChB;EALF,UAAA;GAOGA,KAAcI,KAAQ,kBAAC,QAAD;IAAM,WAAU;IAA8B,UAAAA;GAAW,CAAA;GAChF,kBAAC,QAAD;IAAM,uBAAoB;IAAoB,UAAAC;GAAY,CAAA;GACzD,CAACL,KAAcI,KAAQ,kBAAC,QAAD;IAAM,WAAU;IAA8B,UAAAA;GAAW,CAAA;EAC9E;KAGDE,IACJ,kBAAC,OAAD;EACE,WAAWH,EACT,6CACAH,IAAa,0BAA0B,sBACzC;EAJF,UAAA,CAME,kBAAC,OAAD;GACE,uBAAoB;GACpB,WAAU;GAET,UAAAO;EACE,CAAA,GACJC,KACC,kBAAC,QAAD;GACE,uBAAoB;GACpB,WAAU;GAET,UAAAA;EACG,CAAA,CAEL;;CAGP,OACE,kBAAC,OAAD;EACE,WAAWL,EACT,mIACAH,IAAa,kBAAkB,aACjC;EAEC,UAAAA,IACC,kBAAAF,GAAA,EAAA,UAAA;GACGI;GACD,kBAAC,OAAD,EAAK,WAAU,kCAAmC,CAAA;GACjDI;EACD,EAAA,CAAA,IAEF,kBAAAR,GAAA,EAAA,UAAA;GACGQ;GACD,kBAAC,OAAD,EAAK,WAAU,yBAA0B,CAAA;GACxCJ;EACD,EAAA,CAAA;CAED,CAAA;AAET;AAEA,SAAgBQ,EAAe,EAC7B,SACA,SACA,cACA,aACA,aACA,oBACsB;CACtB,OACE,kBAAC,OAAD;EACE,IAAG;EACH,cAAW;EACX,WAAWP,EAAG,oDAAoDQ,CAAS;EAH7E,UAAA,CAKGC,KACC,kBAAC,KAAD;GACE,MAAMA,EAAK;GACX,KAAI;GACJ,uBAAoB;GACpB,WAAWT,EACT,yCACAU,IAEI,gLAIA,8BACJC,CACF;GAEC,UAAAD,IACC,kBAAAf,GAAA,EAAA,UAAA,CACGiB,KAAY,kBAAC,QAAD;IAAM,WAAU;IAA8B,UAAAA;GAAe,CAAA,GAC1E,kBAAC,QAAD;IAAM,uBAAoB;IAAmB,UAAA;GAAc,CAAA,CAC3D,EAAA,CAAA,IAEF,kBAAChB,GAAD;IACE,WAAU;IACV,OAAM;IACN,OAAOa,EAAK;IACZ,aAAaA,EAAK;IAClB,MAAMG;GACP,CAAA;EAEF,CAAA,GAEJF,KACC,kBAAC,KAAD;GACE,MAAMA,EAAK;GACX,KAAI;GACJ,uBAAoB;GACpB,WAAWV,EACT,yCAKAS,IAAO,sBAAsB,8BAC7BE,CACF;GAEA,UAAA,kBAACf,GAAD;IACE,WAAU;IACV,OAAM;IACN,OAAOc,EAAK;IACZ,aAAaA,EAAK;IAClB,MAAMG;GACP,CAAA;EACA,CAAA,CAEF;;AAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"theme-controller.js","names":[],"sources":["../src/base/theme-controller.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Size } from \"../utils/types\";\n\nfunction readStoredTheme(): string | null {\n try {\n if (typeof window === \"undefined\") return null;\n return window.localStorage.getItem(\"theme\");\n } catch {\n return null;\n }\n}\n\nfunction applyTheme(isDark: boolean) {\n if (typeof document !== \"undefined\") {\n document.documentElement.classList.toggle(\"dark\", isDark);\n }\n}\n\nfunction writeStoredTheme(theme: string) {\n try {\n if (typeof window !== \"undefined\") {\n window.localStorage.setItem(\"theme\", theme);\n }\n } catch {\n // Storage can be unavailable (private mode, blocked cookies); theme still applies in-memory.\n }\n}\n\n// --- ThemeControllerToggle ---\n\nexport interface ThemeControllerToggleProps {\n defaultTheme?: string;\n lightTheme?: string;\n darkTheme?: string;\n ariaLabel?: string;\n inputProps?: Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"checked\" | \"onChange\" | \"value\"\n >;\n onThemeChange?: (theme: string) => void;\n className?: string;\n label?: ReactNode;\n size?: Size;\n children?: (state: {\n isDark: boolean;\n checked: boolean;\n toggle: (checked: boolean) => void;\n }) => ReactNode;\n}\n\nexport function ThemeControllerToggle({\n defaultTheme = \"light\",\n lightTheme = \"light\",\n darkTheme = \"dark\",\n ariaLabel = \"Toggle dark mode\",\n inputProps,\n onThemeChange,\n className,\n label,\n size = \"md\",\n children,\n}: ThemeControllerToggleProps) {\n // Deterministic initial render so SSR and hydration match. Stored theme syncs after mount.\n const [checked, setChecked] = useState(() => defaultTheme === darkTheme);\n\n useEffect(() => {\n const storedTheme = readStoredTheme() ?? defaultTheme;\n const isDark = storedTheme === darkTheme;\n setChecked(isDark);\n applyTheme(isDark);\n }, [defaultTheme, darkTheme]);\n\n const handleChange = (newChecked: boolean) => {\n const newTheme = newChecked ? darkTheme : lightTheme;\n setChecked(newChecked);\n applyTheme(newChecked);\n writeStoredTheme(newTheme);\n onThemeChange?.(newTheme);\n };\n\n if (children) {\n return (\n <div className={className}>\n {children({ isDark: checked, checked, toggle: handleChange })}\n </div>\n );\n }\n\n const toggleEl = (\n <input\n type=\"checkbox\"\n className={cn(\"toggle theme-controller\", `toggle-${size}`)}\n checked={checked}\n value={darkTheme}\n aria-label={ariaLabel}\n onChange={(e) => handleChange(e.target.checked)}\n {...inputProps}\n />\n );\n\n if (!label) return <div className={className}>{toggleEl}</div>;\n return (\n <label className={cn(\"flex cursor-pointer items-center gap-3\", className)}>\n {toggleEl}\n <span className=\"text-base-content\">{label}</span>\n </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A;EAAY,CAAA,CAC5C;MALU,kBAAC,OAAD;EAAgB;EAAY,UAAA;CAAc,CAAA;AAO/D"}
1
+ {"version":3,"file":"theme-controller.js","names":["readStoredTheme","applyTheme","isDark","writeStoredTheme","theme","ThemeControllerToggle","checked","setChecked","useState","defaultTheme","darkTheme","handleChange","newTheme","newChecked","lightTheme","onThemeChange","children","toggleEl","cn","size","ariaLabel","inputProps","label","className"],"sources":["../src/base/theme-controller.tsx"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState, type InputHTMLAttributes, type ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport type { Size } from \"../utils/types\";\n\nfunction readStoredTheme(): string | null {\n try {\n if (typeof window === \"undefined\") return null;\n return window.localStorage.getItem(\"theme\");\n } catch {\n return null;\n }\n}\n\nfunction applyTheme(isDark: boolean) {\n if (typeof document !== \"undefined\") {\n document.documentElement.classList.toggle(\"dark\", isDark);\n }\n}\n\nfunction writeStoredTheme(theme: string) {\n try {\n if (typeof window !== \"undefined\") {\n window.localStorage.setItem(\"theme\", theme);\n }\n } catch {\n // Storage can be unavailable (private mode, blocked cookies); theme still applies in-memory.\n }\n}\n\n// --- ThemeControllerToggle ---\n\nexport interface ThemeControllerToggleProps {\n defaultTheme?: string;\n lightTheme?: string;\n darkTheme?: string;\n ariaLabel?: string;\n inputProps?: Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"checked\" | \"onChange\" | \"value\"\n >;\n onThemeChange?: (theme: string) => void;\n className?: string;\n label?: ReactNode;\n size?: Size;\n children?: (state: {\n isDark: boolean;\n checked: boolean;\n toggle: (checked: boolean) => void;\n }) => ReactNode;\n}\n\nexport function ThemeControllerToggle({\n defaultTheme = \"light\",\n lightTheme = \"light\",\n darkTheme = \"dark\",\n ariaLabel = \"Toggle dark mode\",\n inputProps,\n onThemeChange,\n className,\n label,\n size = \"md\",\n children,\n}: ThemeControllerToggleProps) {\n // Deterministic initial render so SSR and hydration match. Stored theme syncs after mount.\n const [checked, setChecked] = useState(() => defaultTheme === darkTheme);\n\n useEffect(() => {\n const storedTheme = readStoredTheme() ?? defaultTheme;\n const isDark = storedTheme === darkTheme;\n setChecked(isDark);\n applyTheme(isDark);\n }, [defaultTheme, darkTheme]);\n\n const handleChange = (newChecked: boolean) => {\n const newTheme = newChecked ? darkTheme : lightTheme;\n setChecked(newChecked);\n applyTheme(newChecked);\n writeStoredTheme(newTheme);\n onThemeChange?.(newTheme);\n };\n\n if (children) {\n return (\n <div className={className}>\n {children({ isDark: checked, checked, toggle: handleChange })}\n </div>\n );\n }\n\n const toggleEl = (\n <input\n type=\"checkbox\"\n className={cn(\"toggle theme-controller\", `toggle-${size}`)}\n checked={checked}\n value={darkTheme}\n aria-label={ariaLabel}\n onChange={(e) => handleChange(e.target.checked)}\n {...inputProps}\n />\n );\n\n if (!label) return <div className={className}>{toggleEl}</div>;\n return (\n <label className={cn(\"flex cursor-pointer items-center gap-3\", className)}>\n {toggleEl}\n <span className=\"text-base-content\">{label}</span>\n </label>\n );\n}\n"],"mappings":";;;;;AAMA,SAASA,IAAiC;CACxC,IAAI;EAEF,OADI,OAAO,SAAW,MAAoB,OACnC,OAAO,aAAa,QAAQ,OAAO;CAC5C,QAAQ;EACN,OAAO;CACT;AACF;AAEA,SAASC,EAAW,GAAiB;CACnC,AAAI,OAAO,WAAa,OACtB,SAAS,gBAAgB,UAAU,OAAO,QAAQC,CAAM;AAE5D;AAEA,SAASC,EAAiB,GAAe;CACvC,IAAI;EACF,AAAI,OAAO,SAAW,OACpB,OAAO,aAAa,QAAQ,SAASC,CAAK;CAE9C,QAAQ,CAER;AACF;AAwBA,SAAgBC,EAAsB,EACpC,kBAAe,SACf,gBAAa,SACb,eAAY,QACZ,eAAY,oBACZ,eACA,kBACA,cACA,UACA,UAAO,MACP,eAC6B;CAE7B,IAAM,CAACC,GAASC,KAAcC,QAAeC,MAAiBC,CAAS;CAEvE,QAAgB;EAEd,IAAMR,KADcF,EAAgB,KAAKS,OACVC;EAE/B,AADAH,EAAWL,CAAM,GACjBD,EAAWC,CAAM;CACnB,GAAG,CAACO,GAAcC,CAAS,CAAC;CAE5B,IAAMC,KAAgB,MAAwB;EAC5C,IAAMC,IAAWC,IAAaH,IAAYI;EAI1C,AAHAP,EAAWM,CAAU,GACrBZ,EAAWY,CAAU,GACrBV,EAAiBS,CAAQ,GACzBG,IAAgBH,CAAQ;CAC1B;CAEA,IAAII,GACF,OACE,kBAAC,OAAD;EAAgB;EACb,UAAAA,EAAS;GAAE,QAAQV;GAAS;GAAS,QAAQK;EAAa,CAAC;CACzD,CAAA;CAIT,IAAMM,IACJ,kBAAC,SAAD;EACE,MAAK;EACL,WAAWC,EAAG,2BAA2B,UAAUC,GAAM;EAChD;EACT,OAAOT;EACP,cAAYU;EACZ,WAAW,MAAMT,EAAa,EAAE,OAAO,OAAO;EAC9C,GAAIU;CACL,CAAA;CAIH,OADKC,IAEH,kBAAC,SAAD;EAAO,WAAWJ,EAAG,0CAA0CK,CAAS;EAAxE,UAAA,CACGN,GACD,kBAAC,QAAD;GAAM,WAAU;GAAqB,UAAAK;EAAY,CAAA,CAC5C;MALU,kBAAC,OAAD;EAAgB;EAAY,UAAAL;CAAc,CAAA;AAO/D"}
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.js","names":[],"sources":["../src/base/toggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useState, useEffect, useRef, useCallback } from \"react\";\nimport type { Color, Size } from \"../utils/types\";\n\ntype ToggleColor = Color;\ntype ToggleSize = Size;\n\ninterface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n color?: ToggleColor;\n size?: ToggleSize;\n label?: ReactNode;\n description?: ReactNode;\n indeterminate?: boolean;\n containerClassName?: string;\n labelClassName?: string;\n descriptionClassName?: string;\n}\n\nconst Toggle = forwardRef<HTMLInputElement, ToggleProps>(function Toggle(\n {\n color = \"primary\",\n size = \"md\",\n label,\n description,\n indeterminate = false,\n containerClassName,\n labelClassName,\n descriptionClassName,\n className,\n disabled,\n checked,\n defaultChecked,\n onChange,\n ...props\n },\n ref\n) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const setInputRef = useCallback(\n (el: HTMLInputElement | null) => {\n inputRef.current = el;\n if (typeof ref === \"function\") ref(el);\n else if (ref) ref.current = el;\n },\n [ref]\n );\n\n useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const toggleEl = (\n <input\n ref={setInputRef}\n type=\"checkbox\"\n className={cn(\"toggle\", `toggle-${color}`, `toggle-${size}`, className)}\n disabled={disabled}\n checked={checked}\n defaultChecked={defaultChecked}\n onChange={onChange}\n data-indeterminate={indeterminate}\n {...props}\n />\n );\n\n if (!label) return toggleEl;\n\n return (\n <label\n className={cn(\n \"flex items-start gap-3\",\n disabled && \"cursor-not-allowed opacity-50\",\n containerClassName\n )}\n >\n <div className=\"flex items-center pt-0.5\">{toggleEl}</div>\n <div className=\"flex flex-col gap-0.5\">\n <span className={cn(\"text-base-content cursor-pointer\", labelClassName)}>{label}</span>\n {description && (\n <span className={cn(\"text-base-content/60 text-sm\", descriptionClassName)}>\n {description}\n </span>\n )}\n </div>\n </label>\n );\n});\n\ninterface ToggleGroupItem {\n value: string;\n label: ReactNode;\n disabled?: boolean;\n}\n\ninterface ToggleGroupProps {\n items: ToggleGroupItem[];\n value?: string[];\n defaultValue?: string[];\n onChange?: (value: string[]) => void;\n color?: ToggleColor;\n size?: ToggleSize;\n controlled?: boolean;\n className?: string;\n}\n\nexport function ToggleGroup({\n items,\n value,\n defaultValue = [],\n onChange,\n color = \"primary\",\n size = \"md\",\n controlled = false,\n className,\n}: ToggleGroupProps) {\n const [internalValue, setInternalValue] = useState<string[]>(defaultValue);\n const selectedValues = controlled ? (value ?? internalValue) : internalValue;\n\n const toggle = (itemValue: string) => {\n const next = selectedValues.includes(itemValue)\n ? selectedValues.filter((v) => v !== itemValue)\n : [...selectedValues, itemValue];\n if (!controlled) setInternalValue(next);\n onChange?.(next);\n };\n\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((item) => (\n <label\n key={item.value}\n className={cn(\n \"flex items-center gap-3\",\n item.disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <input\n type=\"checkbox\"\n className={cn(\"toggle\", `toggle-${color}`, `toggle-${size}`)}\n checked={selectedValues.includes(item.value)}\n disabled={item.disabled}\n onChange={() => !item.disabled && toggle(item.value)}\n />\n <span className=\"text-base-content cursor-pointer\">{item.label}</span>\n </label>\n ))}\n </div>\n );\n}\n\nexport { Toggle };\nexport type { ToggleProps, ToggleGroupProps, ToggleGroupItem, ToggleColor, ToggleSize };\n"],"mappings":";;;;;AAqBA,IAAM,IAAS,EAA0C,SACvD,EACE,WAAQ,WACR,UAAO,MACP,UACA,gBACA,mBAAgB,IAChB,uBACA,mBACA,yBACA,cACA,aACA,YACA,mBACA,aACA,GAAG,KAEL,GACA;CACA,IAAM,IAAW,EAAgC,IAAI,GAE/C,IAAc,GACjB,MAAgC;EAE/B,AADA,EAAS,UAAU,GACf,OAAO,KAAQ,aAAY,EAAI,CAAE,IAC5B,MAAK,EAAI,UAAU;CAC9B,GACA,CAAC,CAAG,CACN;CAEA,QAAgB;EACd,AAAI,EAAS,YAAS,EAAS,QAAQ,gBAAgB;CACzD,GAAG,CAAC,CAAa,CAAC;CAElB,IAAM,IACJ,kBAAC,SAAD;EACE,KAAK;EACL,MAAK;EACL,WAAW,EAAG,UAAU,UAAU,KAAS,UAAU,KAAQ,CAAS;EAC5D;EACD;EACO;EACN;EACV,sBAAoB;EACpB,GAAI;CACL,CAAA;CAKH,OAFK,IAGH,kBAAC,SAAD;EACE,WAAW,EACT,0BACA,KAAY,iCACZ,CACF;EALF,UAAA,CAOE,kBAAC,OAAD;GAAK,WAAU;GAA4B,UAAA;EAAc,CAAA,GACzD,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,QAAD;IAAM,WAAW,EAAG,oCAAoC,CAAc;IAAI,UAAA;GAAY,CAAA,GACrF,KACC,kBAAC,QAAD;IAAM,WAAW,EAAG,gCAAgC,CAAoB;IACrE,UAAA;GACG,CAAA,CAEL;EACA,CAAA,CAAA;MAnBU;AAqBrB,CAAC;AAmBD,SAAgB,EAAY,EAC1B,UACA,UACA,kBAAe,CAAC,GAChB,aACA,WAAQ,WACR,UAAO,MACP,gBAAa,IACb,gBACmB;CACnB,IAAM,CAAC,GAAe,KAAoB,EAAmB,CAAY,GACnE,IAAiB,IAAc,KAAS,IAAiB,GAEzD,KAAU,MAAsB;EACpC,IAAM,IAAO,EAAe,SAAS,CAAS,IAC1C,EAAe,QAAQ,MAAM,MAAM,CAAS,IAC5C,CAAC,GAAG,GAAgB,CAAS;EAEjC,AADK,KAAY,EAAiB,CAAI,GACtC,IAAW,CAAI;CACjB;CAEA,OACE,kBAAC,OAAD;EAAK,WAAW,EAAG,uBAAuB,CAAS;EAChD,UAAA,EAAM,KAAK,MACV,kBAAC,SAAD;GAEE,WAAW,EACT,2BACA,EAAK,YAAY,+BACnB;GALF,UAAA,CAOE,kBAAC,SAAD;IACE,MAAK;IACL,WAAW,EAAG,UAAU,UAAU,KAAS,UAAU,GAAM;IAC3D,SAAS,EAAe,SAAS,EAAK,KAAK;IAC3C,UAAU,EAAK;IACf,gBAAgB,CAAC,EAAK,YAAY,EAAO,EAAK,KAAK;GACpD,CAAA,GACD,kBAAC,QAAD;IAAM,WAAU;IAAoC,UAAA,EAAK;GAAY,CAAA,CAChE;EAdA,GAAA,EAAK,KAcL,CACR;CACE,CAAA;AAET"}
1
+ {"version":3,"file":"toggle.js","names":["Toggle","forwardRef","props","inputRef","useRef","setInputRef","useCallback","el","ref","indeterminate","toggleEl","cn","color","size","className","label","disabled","containerClassName","labelClassName","description","descriptionClassName","ToggleGroup","internalValue","setInternalValue","useState","defaultValue","selectedValues","controlled","value","toggle","next","itemValue","v","onChange","items","item"],"sources":["../src/base/toggle.tsx"],"sourcesContent":["\"use client\";\n\nimport { cn } from \"../utils/cn\";\nimport type { InputHTMLAttributes, ReactNode } from \"react\";\nimport { forwardRef, useState, useEffect, useRef, useCallback } from \"react\";\nimport type { Color, Size } from \"../utils/types\";\n\ntype ToggleColor = Color;\ntype ToggleSize = Size;\n\ninterface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, \"type\" | \"size\"> {\n color?: ToggleColor;\n size?: ToggleSize;\n label?: ReactNode;\n description?: ReactNode;\n indeterminate?: boolean;\n containerClassName?: string;\n labelClassName?: string;\n descriptionClassName?: string;\n}\n\nconst Toggle = forwardRef<HTMLInputElement, ToggleProps>(function Toggle(\n {\n color = \"primary\",\n size = \"md\",\n label,\n description,\n indeterminate = false,\n containerClassName,\n labelClassName,\n descriptionClassName,\n className,\n disabled,\n checked,\n defaultChecked,\n onChange,\n ...props\n },\n ref\n) {\n const inputRef = useRef<HTMLInputElement | null>(null);\n\n const setInputRef = useCallback(\n (el: HTMLInputElement | null) => {\n inputRef.current = el;\n if (typeof ref === \"function\") ref(el);\n else if (ref) ref.current = el;\n },\n [ref]\n );\n\n useEffect(() => {\n if (inputRef.current) inputRef.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const toggleEl = (\n <input\n ref={setInputRef}\n type=\"checkbox\"\n className={cn(\"toggle\", `toggle-${color}`, `toggle-${size}`, className)}\n disabled={disabled}\n checked={checked}\n defaultChecked={defaultChecked}\n onChange={onChange}\n data-indeterminate={indeterminate}\n {...props}\n />\n );\n\n if (!label) return toggleEl;\n\n return (\n <label\n className={cn(\n \"flex items-start gap-3\",\n disabled && \"cursor-not-allowed opacity-50\",\n containerClassName\n )}\n >\n <div className=\"flex items-center pt-0.5\">{toggleEl}</div>\n <div className=\"flex flex-col gap-0.5\">\n <span className={cn(\"text-base-content cursor-pointer\", labelClassName)}>{label}</span>\n {description && (\n <span className={cn(\"text-base-content/60 text-sm\", descriptionClassName)}>\n {description}\n </span>\n )}\n </div>\n </label>\n );\n});\n\ninterface ToggleGroupItem {\n value: string;\n label: ReactNode;\n disabled?: boolean;\n}\n\ninterface ToggleGroupProps {\n items: ToggleGroupItem[];\n value?: string[];\n defaultValue?: string[];\n onChange?: (value: string[]) => void;\n color?: ToggleColor;\n size?: ToggleSize;\n controlled?: boolean;\n className?: string;\n}\n\nexport function ToggleGroup({\n items,\n value,\n defaultValue = [],\n onChange,\n color = \"primary\",\n size = \"md\",\n controlled = false,\n className,\n}: ToggleGroupProps) {\n const [internalValue, setInternalValue] = useState<string[]>(defaultValue);\n const selectedValues = controlled ? (value ?? internalValue) : internalValue;\n\n const toggle = (itemValue: string) => {\n const next = selectedValues.includes(itemValue)\n ? selectedValues.filter((v) => v !== itemValue)\n : [...selectedValues, itemValue];\n if (!controlled) setInternalValue(next);\n onChange?.(next);\n };\n\n return (\n <div className={cn(\"flex flex-col gap-3\", className)}>\n {items.map((item) => (\n <label\n key={item.value}\n className={cn(\n \"flex items-center gap-3\",\n item.disabled && \"cursor-not-allowed opacity-50\"\n )}\n >\n <input\n type=\"checkbox\"\n className={cn(\"toggle\", `toggle-${color}`, `toggle-${size}`)}\n checked={selectedValues.includes(item.value)}\n disabled={item.disabled}\n onChange={() => !item.disabled && toggle(item.value)}\n />\n <span className=\"text-base-content cursor-pointer\">{item.label}</span>\n </label>\n ))}\n </div>\n );\n}\n\nexport { Toggle };\nexport type { ToggleProps, ToggleGroupProps, ToggleGroupItem, ToggleColor, ToggleSize };\n"],"mappings":";;;;;AAqBA,IAAMA,IAASC,EAA0C,SACvD,EACE,WAAQ,WACR,UAAO,MACP,UACA,gBACA,mBAAgB,IAChB,uBACA,mBACA,yBACA,cACA,aACA,YACA,mBACA,aACA,GAAGC,KAEL,GACA;CACA,IAAMC,IAAWC,EAAgC,IAAI,GAE/CC,IAAcC,GACjB,MAAgC;EAE/B,AADA,EAAS,UAAUC,GACf,OAAOC,KAAQ,aAAYA,EAAID,CAAE,IA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BACAwB,EAAK,YAAY,+BACnB;GALF,UAAA,CAOE,kBAAC,SAAD;IACE,MAAK;IACL,WAAWxB,EAAG,UAAU,UAAUC,KAAS,UAAUC,GAAM;IAC3D,SAASa,EAAe,SAASS,EAAK,KAAK;IAC3C,UAAUA,EAAK;IACf,gBAAgB,CAACA,EAAK,YAAYN,EAAOM,EAAK,KAAK;GACpD,CAAA,GACD,kBAAC,QAAD;IAAM,WAAU;IAAoC,UAAAA,EAAK;GAAY,CAAA,CAChE;EAdA,GAAAA,EAAK,KAcL,CACR;CACE,CAAA;AAET"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/ui-react",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "React + DaisyUI component library for documentation sites",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -92,14 +92,14 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@testing-library/jest-dom": "^6.9.1",
96
- "@testing-library/react": "^16.3.0",
97
- "@types/react": "^19.2.0",
95
+ "@testing-library/jest-dom": "^6.10.0",
96
+ "@testing-library/react": "^16.3.3",
97
+ "@types/react": "^19.3.0",
98
98
  "jsdom": "^26.1.0",
99
- "react": "^19.2.0",
100
- "react-dom": "^19.2.0",
101
- "vite": "^8.2.1",
102
- "typescript": "^7.0.2"
99
+ "react": "^19.3.0",
100
+ "react-dom": "^19.3.0",
101
+ "typescript": "^7.0.2",
102
+ "vite": "^8.3.2"
103
103
  },
104
104
  "publishConfig": {
105
105
  "access": "public"