@schandlergarcia/sf-web-components 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/library/heroui/Accordion.d.ts +6 -5
- package/dist/components/library/heroui/Accordion.js +7 -8
- package/dist/components/library/heroui/Accordion.js.map +1 -1
- package/dist/components/library/heroui/Breadcrumbs.d.ts +5 -2
- package/dist/components/library/heroui/Breadcrumbs.js +4 -5
- package/dist/components/library/heroui/Breadcrumbs.js.map +1 -1
- package/dist/components/library/heroui/Collapsible.d.ts +19 -30
- package/dist/components/library/heroui/Collapsible.js +13 -13
- package/dist/components/library/heroui/Collapsible.js.map +1 -1
- package/dist/components/library/heroui/DatePicker.d.ts +24 -52
- package/dist/components/library/heroui/DatePicker.js +5 -6
- package/dist/components/library/heroui/DatePicker.js.map +1 -1
- package/dist/components/library/heroui/Dialog.d.ts +18 -32
- package/dist/components/library/heroui/Dialog.js +6 -7
- package/dist/components/library/heroui/Dialog.js.map +1 -1
- package/dist/components/library/heroui/Drawer.d.ts +6 -2
- package/dist/components/library/heroui/Drawer.js +2 -3
- package/dist/components/library/heroui/Drawer.js.map +1 -1
- package/dist/components/library/heroui/Dropdown.d.ts +6 -2
- package/dist/components/library/heroui/Dropdown.js +2 -3
- package/dist/components/library/heroui/Dropdown.js.map +1 -1
- package/dist/components/library/heroui/Field.d.ts +19 -38
- package/dist/components/library/heroui/Field.js +9 -10
- package/dist/components/library/heroui/Field.js.map +1 -1
- package/dist/components/library/heroui/Meter.d.ts +7 -5
- package/dist/components/library/heroui/Meter.js +4 -5
- package/dist/components/library/heroui/Meter.js.map +1 -1
- package/dist/components/library/heroui/Popover.d.ts +23 -38
- package/dist/components/library/heroui/Popover.js +12 -12
- package/dist/components/library/heroui/Popover.js.map +1 -1
- package/dist/components/library/heroui/Select.d.ts +31 -37
- package/dist/components/library/heroui/Select.js +3 -4
- package/dist/components/library/heroui/Select.js.map +1 -1
- package/package.json +1 -1
- package/src/components/library/heroui/{Accordion.jsx → Accordion.tsx} +8 -3
- package/src/components/library/heroui/{Breadcrumbs.jsx → Breadcrumbs.tsx} +5 -2
- package/src/components/library/heroui/Collapsible.tsx +62 -0
- package/src/components/library/heroui/{DatePicker.jsx → DatePicker.tsx} +28 -4
- package/src/components/library/heroui/Dialog.tsx +43 -0
- package/src/components/library/heroui/{Drawer.jsx → Drawer.tsx} +6 -2
- package/src/components/library/heroui/{Dropdown.jsx → Dropdown.tsx} +6 -2
- package/src/components/library/heroui/{Field.jsx → Field.tsx} +23 -6
- package/src/components/library/heroui/Meter.tsx +13 -0
- package/src/components/library/heroui/{Popover.jsx → Popover.tsx} +29 -8
- package/src/components/library/heroui/Select.tsx +73 -0
- package/src/components/library/heroui/Collapsible.jsx +0 -42
- package/src/components/library/heroui/Dialog.jsx +0 -37
- package/src/components/library/heroui/Meter.jsx +0 -8
- package/src/components/library/heroui/Select.jsx +0 -37
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
function n({ className: e = "", children: t, ...l }) {
|
|
2
|
+
function r({ className: e = "", children: t, ...l }) {
|
|
4
3
|
return /* @__PURE__ */ s("div", { className: `flex flex-col gap-1.5 ${e}`, ...l, children: t });
|
|
5
4
|
}
|
|
6
|
-
const x =
|
|
5
|
+
const x = r, d = ({ className: e = "", htmlFor: t, children: l, ...a }) => /* @__PURE__ */ s(
|
|
7
6
|
"label",
|
|
8
7
|
{
|
|
9
8
|
htmlFor: t,
|
|
10
9
|
className: `text-sm font-medium text-slate-700 dark:text-slate-200 ${e}`,
|
|
11
|
-
...
|
|
10
|
+
...a,
|
|
12
11
|
children: l
|
|
13
12
|
}
|
|
14
|
-
),
|
|
15
|
-
const
|
|
16
|
-
return
|
|
13
|
+
), i = ({ className: e = "", children: t, ...l }) => /* @__PURE__ */ s("p", { className: `text-xs text-slate-500 dark:text-slate-400 ${e}`, ...l, children: t }), c = ({ className: e = "", errors: t, children: l, ...a }) => {
|
|
14
|
+
const n = t && t.length > 0 ? t.join(", ") : l;
|
|
15
|
+
return n ? /* @__PURE__ */ s("p", { className: `text-xs text-red-600 dark:text-red-400 ${e}`, ...a, children: n }) : null;
|
|
17
16
|
};
|
|
18
17
|
export {
|
|
19
18
|
x as Field,
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
i as FieldDescription,
|
|
20
|
+
c as FieldError,
|
|
22
21
|
d as FieldLabel,
|
|
23
|
-
|
|
22
|
+
r as default
|
|
24
23
|
};
|
|
25
24
|
//# sourceMappingURL=Field.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Field.js","sources":["../../../../src/components/library/heroui/Field.
|
|
1
|
+
{"version":3,"file":"Field.js","sources":["../../../../src/components/library/heroui/Field.tsx"],"sourcesContent":["import * as React from \"react\";\n\n/**\n * HeroUI v3 Field components — simple wrappers for form field layout.\n *\n * @example\n * import { Field, FieldLabel, FieldError } from \"@/components/library\";\n * <Field>\n * <FieldLabel>Name</FieldLabel>\n * <Input />\n * <FieldError>Required</FieldError>\n * </Field>\n */\nexport interface HeroUIFieldProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n}\n\nexport default function HeroUIField({ className = \"\", children, ...props }: HeroUIFieldProps) {\n return (\n <div className={`flex flex-col gap-1.5 ${className}`} {...props}>\n {children}\n </div>\n );\n}\n\nexport const Field = HeroUIField;\n\nexport interface FieldLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n children?: React.ReactNode;\n}\n\nexport const FieldLabel = ({ className = \"\", htmlFor, children, ...props }: FieldLabelProps) => (\n <label\n htmlFor={htmlFor}\n className={`text-sm font-medium text-slate-700 dark:text-slate-200 ${className}`}\n {...props}\n >\n {children}\n </label>\n);\n\nexport interface FieldDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {\n children?: React.ReactNode;\n}\n\nexport const FieldDescription = ({ className = \"\", children, ...props }: FieldDescriptionProps) => (\n <p className={`text-xs text-slate-500 dark:text-slate-400 ${className}`} {...props}>\n {children}\n </p>\n);\n\nexport interface FieldErrorProps extends React.HTMLAttributes<HTMLParagraphElement> {\n errors?: string[];\n children?: React.ReactNode;\n}\n\nexport const FieldError = ({ className = \"\", errors, children, ...props }: FieldErrorProps) => {\n // Support both children and errors prop\n const errorContent = errors && errors.length > 0 ? errors.join(\", \") : children;\n\n if (!errorContent) return null;\n\n return (\n <p className={`text-xs text-red-600 dark:text-red-400 ${className}`} {...props}>\n {errorContent}\n </p>\n );\n};\n"],"names":["HeroUIField","className","children","props","jsx","Field","FieldLabel","htmlFor","FieldDescription","FieldError","errors","errorContent"],"mappings":";AAiBA,SAAwBA,EAAY,EAAE,WAAAC,IAAY,IAAI,UAAAC,GAAU,GAAGC,KAA2B;AAC5F,SACE,gBAAAC,EAAC,SAAI,WAAW,yBAAyBH,CAAS,IAAK,GAAGE,GACvD,UAAAD,GACH;AAEJ;AAEO,MAAMG,IAAQL,GAMRM,IAAa,CAAC,EAAE,WAAAL,IAAY,IAAI,SAAAM,GAAS,UAAAL,GAAU,GAAGC,EAAA,MACjE,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,SAAAG;AAAA,IACA,WAAW,0DAA0DN,CAAS;AAAA,IAC7E,GAAGE;AAAA,IAEH,UAAAD;AAAA,EAAA;AACH,GAOWM,IAAmB,CAAC,EAAE,WAAAP,IAAY,IAAI,UAAAC,GAAU,GAAGC,EAAA,MAC9D,gBAAAC,EAAC,OAAE,WAAW,8CAA8CH,CAAS,IAAK,GAAGE,GAC1E,UAAAD,EAAA,CACH,GAQWO,IAAa,CAAC,EAAE,WAAAR,IAAY,IAAI,QAAAS,GAAQ,UAAAR,GAAU,GAAGC,QAA6B;AAE7F,QAAMQ,IAAeD,KAAUA,EAAO,SAAS,IAAIA,EAAO,KAAK,IAAI,IAAIR;AAEvE,SAAKS,IAGH,gBAAAP,EAAC,OAAE,WAAW,0CAA0CH,CAAS,IAAK,GAAGE,GACtE,UAAAQ,EAAA,CACH,IALwB;AAO5B;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
[x: string]: any;
|
|
3
|
-
children: any;
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export { Meter };
|
|
1
|
+
import * as React from "react";
|
|
6
2
|
import { Meter } from "@heroui/react";
|
|
3
|
+
export interface HeroUIMeterProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export default function HeroUIMeter({ children, ...props }: HeroUIMeterProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { Meter };
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import { Meter as o } from "@heroui/react";
|
|
4
|
-
import { Meter as
|
|
5
|
-
function
|
|
3
|
+
import { Meter as u } from "@heroui/react";
|
|
4
|
+
function p({ children: r, ...e }) {
|
|
6
5
|
return /* @__PURE__ */ t(o, { ...e, children: r });
|
|
7
6
|
}
|
|
8
7
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
u as Meter,
|
|
9
|
+
p as default
|
|
11
10
|
};
|
|
12
11
|
//# sourceMappingURL=Meter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meter.js","sources":["../../../../src/components/library/heroui/Meter.
|
|
1
|
+
{"version":3,"file":"Meter.js","sources":["../../../../src/components/library/heroui/Meter.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Meter } from \"@heroui/react\";\n\nexport interface HeroUIMeterProps {\n children?: React.ReactNode;\n [key: string]: any;\n}\n\nexport default function HeroUIMeter({ children, ...props }: HeroUIMeterProps) {\n return <Meter {...props}>{children}</Meter>;\n}\n\nexport { Meter };\n"],"names":["HeroUIMeter","children","props","jsx","Meter"],"mappings":";;;AAQA,SAAwBA,EAAY,EAAE,UAAAC,GAAU,GAAGC,KAA2B;AAC5E,SAAO,gBAAAC,EAACC,GAAA,EAAO,GAAGF,GAAQ,UAAAD,EAAA,CAAS;AACrC;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* HeroUI v3 Popover — simple popover for shadcn compatibility.
|
|
3
4
|
* Using native HTML/CSS since HeroUI v3 doesn't have a Popover component.
|
|
@@ -9,41 +10,25 @@
|
|
|
9
10
|
* <PopoverContent>Content</PopoverContent>
|
|
10
11
|
* </Popover>
|
|
11
12
|
*/
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
open:
|
|
16
|
-
|
|
17
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export function PopoverTrigger({ children, open, onOpenChange, asChild, ...props }: {
|
|
36
|
-
[x: string]: any;
|
|
37
|
-
children: any;
|
|
38
|
-
open: any;
|
|
39
|
-
onOpenChange: any;
|
|
40
|
-
asChild: any;
|
|
41
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
42
|
-
export function PopoverContent({ children, open, className, align, sideOffset, ...props }: {
|
|
43
|
-
[x: string]: any;
|
|
44
|
-
children: any;
|
|
45
|
-
open: any;
|
|
46
|
-
className?: string | undefined;
|
|
47
|
-
align?: string | undefined;
|
|
48
|
-
sideOffset?: number | undefined;
|
|
49
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export interface HeroUIPopoverProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
open?: boolean;
|
|
16
|
+
onOpenChange?: (open: boolean) => void;
|
|
17
|
+
}
|
|
18
|
+
export default function HeroUIPopover({ children, open, onOpenChange, ...props }: HeroUIPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const Popover: typeof HeroUIPopover;
|
|
20
|
+
export interface PopoverTriggerProps {
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
onOpenChange?: (open: boolean) => void;
|
|
24
|
+
asChild?: boolean;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export declare const PopoverTrigger: ({ children, open, onOpenChange, asChild, ...props }: PopoverTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
open?: boolean;
|
|
31
|
+
align?: "start" | "center" | "end";
|
|
32
|
+
sideOffset?: number;
|
|
33
|
+
}
|
|
34
|
+
export declare const PopoverContent: ({ children, open, className, align, sideOffset, ...props }: PopoverContentProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import a from "react";
|
|
3
|
-
function m({ children: e, open: t, onOpenChange:
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
function m({ children: e, open: t, onOpenChange: s, ...l }) {
|
|
4
4
|
const [n, r] = a.useState(!1), i = t !== void 0, d = i ? t : n, u = (o) => {
|
|
5
|
-
i || r(o),
|
|
5
|
+
i || r(o), s?.(o);
|
|
6
6
|
};
|
|
7
|
-
return /* @__PURE__ */ c("div", { className: "relative inline-block", ...
|
|
7
|
+
return /* @__PURE__ */ c("div", { className: "relative inline-block", ...l, children: a.Children.map(e, (o) => a.isValidElement(o) ? a.cloneElement(o, { open: d, onOpenChange: u }) : o) });
|
|
8
8
|
}
|
|
9
|
-
const
|
|
10
|
-
const r = () =>
|
|
11
|
-
return
|
|
9
|
+
const f = m, b = ({ children: e, open: t, onOpenChange: s, asChild: l, ...n }) => {
|
|
10
|
+
const r = () => s?.(!t);
|
|
11
|
+
return l && a.isValidElement(e) ? a.cloneElement(e, {
|
|
12
12
|
...n,
|
|
13
13
|
onClick: r
|
|
14
14
|
}) : /* @__PURE__ */ c("button", { type: "button", onClick: r, ...n, children: e });
|
|
15
|
-
},
|
|
15
|
+
}, C = ({ children: e, open: t, className: s = "", align: l = "center", sideOffset: n = 4, ...r }) => {
|
|
16
16
|
if (!t) return null;
|
|
17
17
|
const i = {
|
|
18
18
|
start: "left-0",
|
|
@@ -22,16 +22,16 @@ const b = m, C = ({ children: e, open: t, onOpenChange: l, asChild: s, ...n }) =
|
|
|
22
22
|
return /* @__PURE__ */ c(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
-
className: `absolute z-50 mt-${n} w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-900 shadow-md dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 ${i[
|
|
25
|
+
className: `absolute z-50 mt-${n} w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-900 shadow-md dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 ${i[l] || i.center} ${s}`,
|
|
26
26
|
...r,
|
|
27
27
|
children: e
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
f as Popover,
|
|
33
|
+
C as PopoverContent,
|
|
34
|
+
b as PopoverTrigger,
|
|
35
35
|
m as default
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=Popover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.js","sources":["../../../../src/components/library/heroui/Popover.
|
|
1
|
+
{"version":3,"file":"Popover.js","sources":["../../../../src/components/library/heroui/Popover.tsx"],"sourcesContent":["import * as React from \"react\";\n\n/**\n * HeroUI v3 Popover — simple popover for shadcn compatibility.\n * Using native HTML/CSS since HeroUI v3 doesn't have a Popover component.\n *\n * @example\n * import { Popover, PopoverTrigger, PopoverContent } from \"@/components/library\";\n * <Popover>\n * <PopoverTrigger>Open</PopoverTrigger>\n * <PopoverContent>Content</PopoverContent>\n * </Popover>\n */\nexport interface HeroUIPopoverProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n}\n\nexport default function HeroUIPopover({ children, open, onOpenChange, ...props }: HeroUIPopoverProps) {\n const [isOpen, setIsOpen] = React.useState(false);\n const isControlled = open !== undefined;\n const actualOpen = isControlled ? open : isOpen;\n\n const handleOpenChange = (newOpen: boolean) => {\n if (!isControlled) setIsOpen(newOpen);\n onOpenChange?.(newOpen);\n };\n\n return (\n <div className=\"relative inline-block\" {...props}>\n {React.Children.map(children, (child) => {\n if (React.isValidElement(child)) {\n return React.cloneElement(child, { open: actualOpen, onOpenChange: handleOpenChange } as any);\n }\n return child;\n })}\n </div>\n );\n}\n\nexport const Popover = HeroUIPopover;\n\nexport interface PopoverTriggerProps {\n children?: React.ReactNode;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n asChild?: boolean;\n [key: string]: any;\n}\n\nexport const PopoverTrigger = ({ children, open, onOpenChange, asChild, ...props }: PopoverTriggerProps) => {\n const handleClick = () => onOpenChange?.(!open);\n\n // If asChild is true, clone the child element with the props\n if (asChild && React.isValidElement(children)) {\n return React.cloneElement(children, {\n ...props,\n onClick: handleClick,\n } as any);\n }\n\n // Otherwise, wrap in a button\n return (\n <button type=\"button\" onClick={handleClick} {...props}>\n {children}\n </button>\n );\n};\n\nexport interface PopoverContentProps extends React.HTMLAttributes<HTMLDivElement> {\n children?: React.ReactNode;\n open?: boolean;\n align?: \"start\" | \"center\" | \"end\";\n sideOffset?: number;\n}\n\nexport const PopoverContent = ({ children, open, className = \"\", align = \"center\", sideOffset = 4, ...props }: PopoverContentProps) => {\n if (!open) return null;\n\n const alignClasses: Record<string, string> = {\n start: \"left-0\",\n center: \"left-1/2 -translate-x-1/2\",\n end: \"right-0\"\n };\n\n return (\n <div\n className={`absolute z-50 mt-${sideOffset} w-72 rounded-md border border-slate-200 bg-white p-4 text-slate-900 shadow-md dark:border-slate-800 dark:bg-slate-900 dark:text-slate-50 ${alignClasses[align] || alignClasses.center} ${className}`}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["HeroUIPopover","children","open","onOpenChange","props","isOpen","setIsOpen","React","isControlled","actualOpen","handleOpenChange","newOpen","jsx","child","Popover","PopoverTrigger","asChild","handleClick","PopoverContent","className","align","sideOffset","alignClasses"],"mappings":";;AAmBA,SAAwBA,EAAc,EAAE,UAAAC,GAAU,MAAAC,GAAM,cAAAC,GAAc,GAAGC,KAA6B;AACpG,QAAM,CAACC,GAAQC,CAAS,IAAIC,EAAM,SAAS,EAAK,GAC1CC,IAAeN,MAAS,QACxBO,IAAaD,IAAeN,IAAOG,GAEnCK,IAAmB,CAACC,MAAqB;AAC7C,IAAKH,KAAcF,EAAUK,CAAO,GACpCR,IAAeQ,CAAO;AAAA,EACxB;AAEA,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAU,yBAAyB,GAAGR,GACxC,UAAAG,EAAM,SAAS,IAAIN,GAAU,CAACY,MACzBN,EAAM,eAAeM,CAAK,IACrBN,EAAM,aAAaM,GAAO,EAAE,MAAMJ,GAAY,cAAcC,GAAyB,IAEvFG,CACR,EAAA,CACH;AAEJ;AAEO,MAAMC,IAAUd,GAUVe,IAAiB,CAAC,EAAE,UAAAd,GAAU,MAAAC,GAAM,cAAAC,GAAc,SAAAa,GAAS,GAAGZ,QAAiC;AAC1G,QAAMa,IAAc,MAAMd,IAAe,CAACD,CAAI;AAG9C,SAAIc,KAAWT,EAAM,eAAeN,CAAQ,IACnCM,EAAM,aAAaN,GAAU;AAAA,IAClC,GAAGG;AAAA,IACH,SAASa;AAAA,EAAA,CACH,IAKR,gBAAAL,EAAC,YAAO,MAAK,UAAS,SAASK,GAAc,GAAGb,GAC7C,UAAAH,GACH;AAEJ,GASaiB,IAAiB,CAAC,EAAE,UAAAjB,GAAU,MAAAC,GAAM,WAAAiB,IAAY,IAAI,OAAAC,IAAQ,UAAU,YAAAC,IAAa,GAAG,GAAGjB,QAAiC;AACrI,MAAI,CAACF,EAAM,QAAO;AAElB,QAAMoB,IAAuC;AAAA,IAC3C,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,EAAA;AAGP,SACE,gBAAAV;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,oBAAoBS,CAAU,6IAA6IC,EAAaF,CAAK,KAAKE,EAAa,MAAM,IAAIH,CAAS;AAAA,MAC5O,GAAGf;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from "react";
|
|
1
2
|
/**
|
|
2
3
|
* HeroUI v3 Select wrapper with shadcn compatibility.
|
|
3
4
|
*
|
|
@@ -5,40 +6,33 @@
|
|
|
5
6
|
* - onValueChange -> onSelectionChange
|
|
6
7
|
* - value -> selectedKeys
|
|
7
8
|
*/
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
value:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
export
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children: any;
|
|
39
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
export function SelectItem({ value, children, ...props }: {
|
|
41
|
-
[x: string]: any;
|
|
42
|
-
value: any;
|
|
43
|
-
children: any;
|
|
44
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface HeroUISelectProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
children?: React.ReactNode;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
export default function HeroUISelect({ value, onValueChange, children, ...props }: HeroUISelectProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Select: typeof HeroUISelect;
|
|
17
|
+
export interface SelectTriggerProps {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
size?: string;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}
|
|
22
|
+
export declare const SelectTrigger: ({ children }: SelectTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export interface SelectValueProps {
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
export declare const SelectValue: ({ placeholder }: SelectValueProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export interface SelectContentProps {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
export declare const SelectContent: ({ children }: SelectContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export interface SelectItemProps {
|
|
34
|
+
value: string;
|
|
35
|
+
children?: React.ReactNode;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
export declare const SelectItem: ({ value, children, ...props }: SelectItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import { Select as s } from "@heroui/react";
|
|
4
|
-
function h({ value: e, onValueChange: t, children:
|
|
3
|
+
function h({ value: e, onValueChange: t, children: n, ...o }) {
|
|
5
4
|
return /* @__PURE__ */ l(
|
|
6
5
|
s,
|
|
7
6
|
{
|
|
@@ -10,8 +9,8 @@ function h({ value: e, onValueChange: t, children: o, ...n }) {
|
|
|
10
9
|
const r = Array.from(c)[0];
|
|
11
10
|
t?.(r || "");
|
|
12
11
|
},
|
|
13
|
-
...
|
|
14
|
-
children:
|
|
12
|
+
...o,
|
|
13
|
+
children: n
|
|
15
14
|
}
|
|
16
15
|
);
|
|
17
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../src/components/library/heroui/Select.
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../../src/components/library/heroui/Select.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Select as HeroSelect } from \"@heroui/react\";\n\n/**\n * HeroUI v3 Select wrapper with shadcn compatibility.\n *\n * Translates shadcn API to HeroUI:\n * - onValueChange -> onSelectionChange\n * - value -> selectedKeys\n */\nexport interface HeroUISelectProps {\n value?: string;\n onValueChange?: (value: string) => void;\n children?: React.ReactNode;\n [key: string]: any;\n}\n\nexport default function HeroUISelect({ value, onValueChange, children, ...props }: HeroUISelectProps) {\n // Translate shadcn API to HeroUI API\n const selectedKeys = value ? [value] : [];\n const handleSelectionChange = (keys: any) => {\n const selected = Array.from(keys)[0] as string;\n onValueChange?.(selected || \"\");\n };\n\n const HeroSelectAny = HeroSelect as any;\n return (\n <HeroSelectAny\n selectedKeys={selectedKeys}\n onSelectionChange={handleSelectionChange}\n {...props}\n >\n {children}\n </HeroSelectAny>\n );\n}\n\n// For direct HeroUI usage\nexport const Select = HeroUISelect;\n\n// Shadcn-compatible subcomponents that just pass through children\nexport interface SelectTriggerProps {\n children?: React.ReactNode;\n size?: string;\n [key: string]: any;\n}\n\nexport const SelectTrigger = ({ children }: SelectTriggerProps) => <>{children}</>;\n\nexport interface SelectValueProps {\n placeholder?: string;\n [key: string]: any;\n}\n\nexport const SelectValue = ({ placeholder }: SelectValueProps) => <span>{placeholder}</span>;\n\nexport interface SelectContentProps {\n children?: React.ReactNode;\n [key: string]: any;\n}\n\nexport const SelectContent = ({ children }: SelectContentProps) => <>{children}</>;\n\nexport interface SelectItemProps {\n value: string;\n children?: React.ReactNode;\n [key: string]: any;\n}\n\nexport const SelectItem = ({ value, children, ...props }: SelectItemProps) => {\n const HeroSelectAny = HeroSelect as any;\n return <HeroSelectAny.Item key={value} {...props}>{children}</HeroSelectAny.Item>;\n};\n"],"names":["HeroUISelect","value","onValueChange","children","props","jsx","HeroSelect","keys","selected"],"mappings":";;AAiBA,SAAwBA,EAAa,EAAE,OAAAC,GAAO,eAAAC,GAAe,UAAAC,GAAU,GAAGC,KAA4B;AASpG,SACE,gBAAAC;AAAA,IAFoBC;AAAAA,IAEnB;AAAA,MACC,cATiBL,IAAQ,CAACA,CAAK,IAAI,CAAA;AAAA,MAUnC,mBAT0B,CAACM,MAAc;AAC3C,cAAMC,IAAW,MAAM,KAAKD,CAAI,EAAE,CAAC;AACnC,QAAAL,IAAgBM,KAAY,EAAE;AAAA,MAChC;AAAA,MAOK,GAAGJ;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP;"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Accordion } from "@heroui/react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -19,8 +18,14 @@ import { Accordion } from "@heroui/react";
|
|
|
19
18
|
* </Accordion.Item>
|
|
20
19
|
* </Accordion>
|
|
21
20
|
*/
|
|
22
|
-
export
|
|
23
|
-
|
|
21
|
+
export interface HeroUIAccordionProps {
|
|
22
|
+
variant?: string;
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default function HeroUIAccordion({ variant = "default", ...props }: HeroUIAccordionProps) {
|
|
27
|
+
const AccordionAny = Accordion as any;
|
|
28
|
+
return <AccordionAny variant={variant} {...props} />;
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export { Accordion };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Breadcrumbs } from "@heroui/react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -15,7 +14,11 @@ import { Breadcrumbs } from "@heroui/react";
|
|
|
15
14
|
* <Breadcrumbs.Item>Profile</Breadcrumbs.Item>
|
|
16
15
|
* </Breadcrumbs>
|
|
17
16
|
*/
|
|
18
|
-
export
|
|
17
|
+
export interface HeroUIBreadcrumbsProps {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function HeroUIBreadcrumbs(props: HeroUIBreadcrumbsProps) {
|
|
19
22
|
return <Breadcrumbs {...props} />;
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Accordion } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HeroUI v3 Collapsible — maps to Accordion for shadcn compatibility.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* import { Collapsible, CollapsibleTrigger, CollapsibleContent } from "@/components/library";
|
|
9
|
+
* <Collapsible open={isOpen} onOpenChange={setIsOpen}>
|
|
10
|
+
* <CollapsibleTrigger>Toggle</CollapsibleTrigger>
|
|
11
|
+
* <CollapsibleContent>Content</CollapsibleContent>
|
|
12
|
+
* </Collapsible>
|
|
13
|
+
*/
|
|
14
|
+
export interface HeroUICollapsibleProps {
|
|
15
|
+
open?: boolean;
|
|
16
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default function HeroUICollapsible({ open, onOpenChange, children, ...props }: HeroUICollapsibleProps) {
|
|
22
|
+
// Map shadcn props to HeroUI Accordion
|
|
23
|
+
const selectedKeys = open ? ["item"] : [];
|
|
24
|
+
const AccordionAny = Accordion as any;
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<AccordionAny
|
|
28
|
+
selectedKeys={selectedKeys}
|
|
29
|
+
onSelectionChange={(keys: any) => {
|
|
30
|
+
const isOpen = Array.from(keys).includes("item");
|
|
31
|
+
onOpenChange?.(isOpen);
|
|
32
|
+
}}
|
|
33
|
+
{...props}
|
|
34
|
+
>
|
|
35
|
+
<AccordionAny.Item key="item" aria-label="Collapsible content">
|
|
36
|
+
{children}
|
|
37
|
+
</AccordionAny.Item>
|
|
38
|
+
</AccordionAny>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const Collapsible = HeroUICollapsible;
|
|
43
|
+
|
|
44
|
+
export interface CollapsibleTriggerProps {
|
|
45
|
+
children?: React.ReactNode;
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const CollapsibleTrigger = ({ children, ...props }: CollapsibleTriggerProps) => {
|
|
50
|
+
const AccordionAny = Accordion as any;
|
|
51
|
+
return <AccordionAny.Trigger {...props}>{children}</AccordionAny.Trigger>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export interface CollapsibleContentProps {
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export const CollapsibleContent = ({ children, ...props }: CollapsibleContentProps) => {
|
|
60
|
+
const AccordionAny = Accordion as any;
|
|
61
|
+
return <AccordionAny.Panel {...props}>{children}</AccordionAny.Panel>;
|
|
62
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -16,19 +16,43 @@ import { Popover, PopoverTrigger, PopoverContent } from "./Popover";
|
|
|
16
16
|
* </DatePickerContent>
|
|
17
17
|
* </DatePicker>
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export interface HeroUIDatePickerProps {
|
|
20
|
+
children?: React.ReactNode;
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function HeroUIDatePicker({ children, ...props }: HeroUIDatePickerProps) {
|
|
20
25
|
return <Popover {...props}>{children}</Popover>;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
export const DatePicker = HeroUIDatePicker;
|
|
24
|
-
|
|
29
|
+
|
|
30
|
+
export interface DatePickerTriggerProps {
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
date?: Date;
|
|
33
|
+
dateFormat?: string;
|
|
34
|
+
placeholder?: string;
|
|
35
|
+
className?: string;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const DatePickerTrigger = ({ children, date, dateFormat, placeholder, className = "", ...props }: DatePickerTriggerProps) => {
|
|
25
40
|
// Accept shadcn DatePicker props but just pass through as trigger
|
|
26
41
|
return <PopoverTrigger {...props}>{children}</PopoverTrigger>;
|
|
27
42
|
};
|
|
43
|
+
|
|
28
44
|
export const DatePickerContent = PopoverContent;
|
|
29
|
-
|
|
45
|
+
|
|
46
|
+
export interface DatePickerCalendarProps {
|
|
47
|
+
date?: Date;
|
|
48
|
+
onSelect?: (date: Date) => void;
|
|
49
|
+
[key: string]: any;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const DatePickerCalendar = ({ date, onSelect, ...props }: DatePickerCalendarProps) => (
|
|
30
53
|
<div className="p-4" {...props}>
|
|
31
54
|
<p className="text-sm text-slate-500">Calendar placeholder - integrate react-day-picker here</p>
|
|
32
55
|
</div>
|
|
33
56
|
);
|
|
57
|
+
|
|
34
58
|
export const DatePickerRangeTrigger = DatePickerTrigger;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Modal } from "@heroui/react";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* HeroUI v3 Dialog — maps to Modal for shadcn compatibility.
|
|
6
|
+
*
|
|
7
|
+
* Sub-components via dot notation on the named `Modal` export:
|
|
8
|
+
* Modal.Backdrop, Modal.Container, Modal.Dialog,
|
|
9
|
+
* Modal.CloseTrigger, Modal.Header, Modal.Icon,
|
|
10
|
+
* Modal.Heading, Modal.Body, Modal.Footer
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* import { Dialog, DialogTrigger, DialogContent } from "@/components/library";
|
|
14
|
+
* <Dialog>
|
|
15
|
+
* <DialogTrigger>Open</DialogTrigger>
|
|
16
|
+
* <DialogContent>
|
|
17
|
+
* <DialogHeader><DialogTitle>Title</DialogTitle></DialogHeader>
|
|
18
|
+
* <DialogDescription>Content</DialogDescription>
|
|
19
|
+
* <DialogFooter>Actions</DialogFooter>
|
|
20
|
+
* </DialogContent>
|
|
21
|
+
* </Dialog>
|
|
22
|
+
*/
|
|
23
|
+
export interface HeroUIDialogProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function HeroUIDialog(props: HeroUIDialogProps) {
|
|
29
|
+
return <Modal {...props} />;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Shadcn-compatible exports
|
|
33
|
+
export const Dialog = HeroUIDialog;
|
|
34
|
+
const ModalAny = Modal as any;
|
|
35
|
+
export const DialogTrigger = ModalAny.Trigger || ((props: any) => <button {...props} />);
|
|
36
|
+
export const DialogPortal = ({ children }: { children: React.ReactNode }) => <>{children}</>;
|
|
37
|
+
export const DialogClose = ModalAny.CloseTrigger || ((props: any) => <button {...props} />);
|
|
38
|
+
export const DialogOverlay = ModalAny.Backdrop || ((props: any) => <div {...props} />);
|
|
39
|
+
export const DialogContent = ModalAny.Dialog || ModalAny.Container || ((props: any) => <div {...props} />);
|
|
40
|
+
export const DialogHeader = ModalAny.Header || ((props: any) => <div {...props} />);
|
|
41
|
+
export const DialogFooter = ModalAny.Footer || ((props: any) => <div {...props} />);
|
|
42
|
+
export const DialogTitle = ModalAny.Heading || ((props: any) => <h2 {...props} />);
|
|
43
|
+
export const DialogDescription = (props: any) => <p {...props} />;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Drawer } from "@heroui/react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -25,7 +24,12 @@ import { Drawer } from "@heroui/react";
|
|
|
25
24
|
* </Drawer.Backdrop>
|
|
26
25
|
* </Drawer>
|
|
27
26
|
*/
|
|
28
|
-
export
|
|
27
|
+
export interface HeroUIDrawerProps {
|
|
28
|
+
children: React.ReactNode;
|
|
29
|
+
[key: string]: any;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default function HeroUIDrawer(props: HeroUIDrawerProps) {
|
|
29
33
|
return <Drawer {...props} />;
|
|
30
34
|
}
|
|
31
35
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { Dropdown } from "@heroui/react";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -21,7 +20,12 @@ import { Dropdown } from "@heroui/react";
|
|
|
21
20
|
* </Dropdown.Popover>
|
|
22
21
|
* </Dropdown>
|
|
23
22
|
*/
|
|
24
|
-
export
|
|
23
|
+
export interface HeroUIDropdownProps {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default function HeroUIDropdown(props: HeroUIDropdownProps) {
|
|
25
29
|
return <Dropdown {...props} />;
|
|
26
30
|
}
|
|
27
31
|
|