@hexclave/ui 1.0.3 → 1.0.6
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/copy-button.d.ts +1 -1
- package/dist/components/simple-tooltip.js +2 -2
- package/dist/components/simple-tooltip.js.map +1 -1
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/form.d.ts +1 -1
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/resizable.d.ts +1 -1
- package/dist/components/ui/resizable.d.ts.map +1 -1
- package/dist/components/ui/typography.d.ts +1 -1
- package/dist/esm/components/copy-button.d.ts +1 -1
- package/dist/esm/components/simple-tooltip.js +3 -3
- package/dist/esm/components/simple-tooltip.js.map +1 -1
- package/dist/esm/components/ui/button.d.ts +2 -2
- package/dist/esm/components/ui/form.d.ts +1 -1
- package/dist/esm/components/ui/form.d.ts.map +1 -1
- package/dist/esm/components/ui/resizable.d.ts +1 -1
- package/dist/esm/components/ui/resizable.d.ts.map +1 -1
- package/dist/esm/components/ui/typography.d.ts +1 -1
- package/package.json +3 -2
- package/src/components/action-dialog.tsx +135 -0
- package/src/components/brand-icons.tsx +276 -0
- package/src/components/browser-frame/LICENSE +3 -0
- package/src/components/browser-frame/index.tsx +51 -0
- package/src/components/copy-button.tsx +36 -0
- package/src/components/copy-field.tsx +52 -0
- package/src/components/data-table/cells.tsx +133 -0
- package/src/components/data-table/column-header.tsx +52 -0
- package/src/components/data-table/data-table.tsx +318 -0
- package/src/components/data-table/faceted-filter.tsx +138 -0
- package/src/components/data-table/index.tsx +9 -0
- package/src/components/data-table/pagination.tsx +76 -0
- package/src/components/data-table/toolbar-items.tsx +13 -0
- package/src/components/data-table/toolbar.tsx +100 -0
- package/src/components/data-table/utils.tsx +7 -0
- package/src/components/data-table/view-options.tsx +64 -0
- package/src/components/simple-tooltip.tsx +48 -0
- package/src/components/ui/accordion.tsx +58 -0
- package/src/components/ui/alert.tsx +60 -0
- package/src/components/ui/aspect-ratio.tsx +7 -0
- package/src/components/ui/avatar.tsx +51 -0
- package/src/components/ui/badge.tsx +36 -0
- package/src/components/ui/breadcrumb.tsx +116 -0
- package/src/components/ui/button.tsx +95 -0
- package/src/components/ui/calendar.tsx +77 -0
- package/src/components/ui/card.tsx +88 -0
- package/src/components/ui/checkbox.tsx +31 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +159 -0
- package/src/components/ui/context-menu.tsx +205 -0
- package/src/components/ui/dialog.tsx +135 -0
- package/src/components/ui/dropdown-menu.tsx +245 -0
- package/src/components/ui/form.tsx +173 -0
- package/src/components/ui/hover-card.tsx +30 -0
- package/src/components/ui/inline-code.tsx +40 -0
- package/src/components/ui/input-otp.tsx +73 -0
- package/src/components/ui/input.tsx +68 -0
- package/src/components/ui/label.tsx +40 -0
- package/src/components/ui/menubar.tsx +241 -0
- package/src/components/ui/navigation-menu.tsx +131 -0
- package/src/components/ui/password-input.tsx +50 -0
- package/src/components/ui/popover.tsx +34 -0
- package/src/components/ui/progress.tsx +29 -0
- package/src/components/ui/radio-group.tsx +45 -0
- package/src/components/ui/resizable.tsx +45 -0
- package/src/components/ui/scroll-area.tsx +49 -0
- package/src/components/ui/select.tsx +162 -0
- package/src/components/ui/separator.tsx +32 -0
- package/src/components/ui/sheet.tsx +139 -0
- package/src/components/ui/skeleton.tsx +23 -0
- package/src/components/ui/slider.tsx +29 -0
- package/src/components/ui/spinner.tsx +18 -0
- package/src/components/ui/switch.tsx +75 -0
- package/src/components/ui/table.tsx +117 -0
- package/src/components/ui/tabs.tsx +56 -0
- package/src/components/ui/textarea.tsx +24 -0
- package/src/components/ui/toast.tsx +135 -0
- package/src/components/ui/toaster.tsx +35 -0
- package/src/components/ui/toggle-group.tsx +62 -0
- package/src/components/ui/toggle.tsx +46 -0
- package/src/components/ui/tooltip.tsx +40 -0
- package/src/components/ui/typography.tsx +47 -0
- package/src/components/ui/use-toast.tsx +195 -0
- package/src/index.ts +54 -0
- package/src/lib/utils.tsx +6 -0
|
@@ -10,7 +10,7 @@ declare const CopyButton: React.FC<{
|
|
|
10
10
|
} & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & class_variance_authority0.VariantProps<(props?: ({
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
14
14
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
16
16
|
content: string;
|
|
@@ -9,7 +9,7 @@ let _radix_ui_react_tooltip = require("@radix-ui/react-tooltip");
|
|
|
9
9
|
function SimpleTooltip(props) {
|
|
10
10
|
const iconClassName = (0, ___index_js.cn)("w-4 h-4 text-muted-foreground", props.inline && "inline");
|
|
11
11
|
const trigger = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [props.type === "warning" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.CircleAlert, { className: iconClassName }) : props.type === "info" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Info, { className: iconClassName }) : null, props.children] });
|
|
12
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(___index_js.Tooltip, {
|
|
12
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___index_js.TooltipProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(___index_js.Tooltip, {
|
|
13
13
|
open: props.disabled ? false : void 0,
|
|
14
14
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___index_js.TooltipTrigger, {
|
|
15
15
|
asChild: true,
|
|
@@ -24,7 +24,7 @@ function SimpleTooltip(props) {
|
|
|
24
24
|
className: "max-w-60 text-center text-wrap whitespace-pre-wrap",
|
|
25
25
|
children: props.tooltip
|
|
26
26
|
}) }) })]
|
|
27
|
-
});
|
|
27
|
+
}) });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-tooltip.js","names":["CircleAlert","Info","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent"],"sources":["../../src/components/simple-tooltip.tsx"],"sourcesContent":["import { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { CircleAlert, Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from \"..\";\n\nexport function SimpleTooltip(props: {\n tooltip: React.ReactNode,\n children?: React.ReactNode,\n type?: 'info' | 'warning',\n inline?: boolean,\n className?: string,\n disabled?: boolean,\n}) {\n const iconClassName = cn(\"w-4 h-4 text-muted-foreground\", props.inline && \"inline\");\n const icon = props.type === 'warning' ?\n <CircleAlert className={iconClassName} /> :\n props.type === 'info' ?\n <Info className={iconClassName} /> :\n null;\n\n const trigger = (\n <>{icon}{props.children}</>\n );\n\n return (\n <Tooltip open={props.disabled ? false : undefined}>\n
|
|
1
|
+
{"version":3,"file":"simple-tooltip.js","names":["CircleAlert","Info","TooltipProvider","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent"],"sources":["../../src/components/simple-tooltip.tsx"],"sourcesContent":["import { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { CircleAlert, Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn } from \"..\";\n\nexport function SimpleTooltip(props: {\n tooltip: React.ReactNode,\n children?: React.ReactNode,\n type?: 'info' | 'warning',\n inline?: boolean,\n className?: string,\n disabled?: boolean,\n}) {\n const iconClassName = cn(\"w-4 h-4 text-muted-foreground\", props.inline && \"inline\");\n const icon = props.type === 'warning' ?\n <CircleAlert className={iconClassName} /> :\n props.type === 'info' ?\n <Info className={iconClassName} /> :\n null;\n\n const trigger = (\n <>{icon}{props.children}</>\n );\n\n return (\n <TooltipProvider>\n <Tooltip open={props.disabled ? false : undefined}>\n <TooltipTrigger asChild>\n {props.inline ? (\n <span className={cn(props.className)}>\n {trigger}\n </span>\n ) : (\n <div className={cn(\"flex items-center gap-1\", props.className)}>\n {trigger}\n </div>\n )}\n </TooltipTrigger>\n {props.tooltip && <TooltipPortal>\n <TooltipContent>\n <div className=\"max-w-60 text-center text-wrap whitespace-pre-wrap\">\n {props.tooltip}\n </div>\n </TooltipContent>\n </TooltipPortal>}\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,cAAc,OAO3B;CACD,MAAM,oCAAmB,iCAAiC,MAAM,UAAU,SAAS;CAOnF,MAAM,UACJ,qFAPW,MAAM,SAAS,YAC1B,2CAACA,4BAAY,WAAW,gBAAiB,GACzC,MAAM,SAAS,SACb,2CAACC,qBAAK,WAAW,gBAAiB,GAClC,MAGO,MAAM,YAAY;AAG7B,QACE,2CAACC,yCACC,4CAACC;EAAQ,MAAM,MAAM,WAAW,QAAQ;aACtC,2CAACC;GAAe;aACb,MAAM,SACL,2CAAC;IAAK,+BAAc,MAAM,UAAU;cACjC;KACI,GAEP,2CAAC;IAAI,+BAAc,2BAA2B,MAAM,UAAU;cAC3D;KACG;IAEO,EAChB,MAAM,WAAW,2CAACC,mDACjB,2CAACC,wCACC,2CAAC;GAAI,WAAU;aACZ,MAAM;IACH,GACS,GACH;GACR,GACM"}
|
|
@@ -4,7 +4,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/button.d.ts
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
8
8
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
type OriginalButtonProps = {
|
|
@@ -22,7 +22,7 @@ declare const Button: React.FC<{
|
|
|
22
22
|
} & {
|
|
23
23
|
asChild?: boolean;
|
|
24
24
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
25
|
-
variant?: "
|
|
25
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
26
26
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
27
27
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
28
28
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
@@ -6,7 +6,7 @@ import * as _radix_ui_react_slot0 from "@radix-ui/react-slot";
|
|
|
6
6
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7
7
|
|
|
8
8
|
//#region src/components/ui/form.d.ts
|
|
9
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues
|
|
9
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form0.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
10
10
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
11
11
|
...props
|
|
12
12
|
}: ControllerProps<TFieldValues, TName>) => react_jsx_runtime0.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","names":[],"sources":["../../../src/components/ui/form.tsx"],"mappings":";;;;;;;;cAmBM,IAAA,wBAAI,WAAA,
|
|
1
|
+
{"version":3,"file":"form.d.ts","names":[],"sources":["../../../src/components/ui/form.tsx"],"mappings":";;;;;;;;cAmBM,IAAA,wBAAI,WAAA,uCAAA,YAAA,EAAA,KAAA,EAAA,gBAAA,CAAA,iBAAA,CAAA,YAAA,EAAA,QAAA,EAAA,kBAAA,MAAA,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAWJ,SAAA,wBACiB,WAAA,GAAc,WAAA,gBACrB,SAAA,CAAU,YAAA,IAAgB,SAAA,CAAU,YAAA;EAAA,GAClD;AAAA,GAEG,eAAA,CAAgB,YAAA,EAAc,KAAA,MAAM,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAQnC,YAAA;;;;;UAsBL,gBAAA,CAAA,UAAA;;;;;;;cAUK,QAAA,EAAQ,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,cAAA;;;cAcR,SAAA,EAAS,KAAA,CAAA,EAAA,CAAA,IAAA,CAAA,cAAA,CAAA,UAAA,GAAA,KAAA,CAAA,aAAA,CAAA,gBAAA;;;cAgBT,WAAA,EAAW,KAAA,CAAA,EAAA,CAAA,IAAA,CAmBf,qBAAA,CAnBe,SAAA,GAAA,KAAA,CAAA,aAAA,CAAA,WAAA;;;cAsBX,eAAA,EAAe,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,oBAAA;;;cAiBf,WAAA,EAAW,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,oBAAA"}
|
|
@@ -7,7 +7,7 @@ declare const ResizablePanelGroup: ({
|
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => react_jsx_runtime0.JSX.Element;
|
|
10
|
-
declare const ResizablePanel: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<
|
|
10
|
+
declare const ResizablePanel: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLImageElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLParagraphElement | HTMLHeadingElement | HTMLInputElement | HTMLLabelElement | HTMLUListElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
11
11
|
className?: string | undefined;
|
|
12
12
|
collapsedSize?: number | undefined;
|
|
13
13
|
collapsible?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../../../src/components/ui/resizable.tsx"],"mappings":";;;;;cAOM,mBAAA;EAAuB,SAAA;EAAA,GAAA;AAAA,GAG1B,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,UAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAUvD,cAAA,QAAc,yBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../../../src/components/ui/resizable.tsx"],"mappings":";;;;;cAOM,mBAAA;EAAuB,SAAA;EAAA,GAAA;AAAA,GAG1B,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,UAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAUvD,cAAA,QAAc,yBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,iBAAA,GAAA,WAAA,GAAA,cAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,aAAA,GAAA,iBAAA,GAAA,oBAAA,GAAA,kBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,iBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,aAAA,GAAA,iBAAA,GAAA,uBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,mBAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,iBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,eAAA,GAAA,aAAA,GAAA,eAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,eAAA,GAAA,cAAA,GAAA,eAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,mBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,kBAAA,GAAA,cAAA,GAAA,mBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,gBAAA,GAAA,uBAAA,GAAA,oBAAA,GAAA,mBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,mBAAA,GAAA,gBAAA,GAAA,gBAAA;;;;;;;;;;;;;;;;;cAEd,eAAA;EAAmB,UAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAItB,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,iBAAA;EAChD,UAAA;AAAA,MACD,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -5,7 +5,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
5
5
|
//#region src/components/ui/typography.d.ts
|
|
6
6
|
declare const Typography: React.FC<React.HTMLAttributes<HTMLHeadingElement> & VariantProps<(props?: ({
|
|
7
7
|
type?: "div" | "h2" | "h3" | "label" | "p" | "h1" | "h4" | "footnote" | null | undefined;
|
|
8
|
-
variant?: "destructive" | "
|
|
8
|
+
variant?: "destructive" | "secondary" | "success" | "primary" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
10
10
|
ref?: React.Ref<HTMLHeadingElement> | undefined;
|
|
11
11
|
}>;
|
|
@@ -10,7 +10,7 @@ declare const CopyButton: React.FC<{
|
|
|
10
10
|
} & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & class_variance_authority0.VariantProps<(props?: ({
|
|
13
|
-
variant?: "
|
|
13
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
14
14
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
15
15
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
16
16
|
content: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CircleAlert, Info } from "lucide-react";
|
|
2
|
-
import { Tooltip, TooltipContent, TooltipTrigger, cn } from "../index.js";
|
|
2
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn } from "../index.js";
|
|
3
3
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { TooltipPortal } from "@radix-ui/react-tooltip";
|
|
5
5
|
|
|
@@ -7,7 +7,7 @@ import { TooltipPortal } from "@radix-ui/react-tooltip";
|
|
|
7
7
|
function SimpleTooltip(props) {
|
|
8
8
|
const iconClassName = cn("w-4 h-4 text-muted-foreground", props.inline && "inline");
|
|
9
9
|
const trigger = /* @__PURE__ */ jsxs(Fragment, { children: [props.type === "warning" ? /* @__PURE__ */ jsx(CircleAlert, { className: iconClassName }) : props.type === "info" ? /* @__PURE__ */ jsx(Info, { className: iconClassName }) : null, props.children] });
|
|
10
|
-
return /* @__PURE__ */ jsxs(Tooltip, {
|
|
10
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, {
|
|
11
11
|
open: props.disabled ? false : void 0,
|
|
12
12
|
children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
13
13
|
asChild: true,
|
|
@@ -22,7 +22,7 @@ function SimpleTooltip(props) {
|
|
|
22
22
|
className: "max-w-60 text-center text-wrap whitespace-pre-wrap",
|
|
23
23
|
children: props.tooltip
|
|
24
24
|
}) }) })]
|
|
25
|
-
});
|
|
25
|
+
}) });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple-tooltip.js","names":[],"sources":["../../../src/components/simple-tooltip.tsx"],"sourcesContent":["import { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { CircleAlert, Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from \"..\";\n\nexport function SimpleTooltip(props: {\n tooltip: React.ReactNode,\n children?: React.ReactNode,\n type?: 'info' | 'warning',\n inline?: boolean,\n className?: string,\n disabled?: boolean,\n}) {\n const iconClassName = cn(\"w-4 h-4 text-muted-foreground\", props.inline && \"inline\");\n const icon = props.type === 'warning' ?\n <CircleAlert className={iconClassName} /> :\n props.type === 'info' ?\n <Info className={iconClassName} /> :\n null;\n\n const trigger = (\n <>{icon}{props.children}</>\n );\n\n return (\n <Tooltip open={props.disabled ? false : undefined}>\n
|
|
1
|
+
{"version":3,"file":"simple-tooltip.js","names":[],"sources":["../../../src/components/simple-tooltip.tsx"],"sourcesContent":["import { TooltipPortal } from \"@radix-ui/react-tooltip\";\nimport { CircleAlert, Info } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, cn } from \"..\";\n\nexport function SimpleTooltip(props: {\n tooltip: React.ReactNode,\n children?: React.ReactNode,\n type?: 'info' | 'warning',\n inline?: boolean,\n className?: string,\n disabled?: boolean,\n}) {\n const iconClassName = cn(\"w-4 h-4 text-muted-foreground\", props.inline && \"inline\");\n const icon = props.type === 'warning' ?\n <CircleAlert className={iconClassName} /> :\n props.type === 'info' ?\n <Info className={iconClassName} /> :\n null;\n\n const trigger = (\n <>{icon}{props.children}</>\n );\n\n return (\n <TooltipProvider>\n <Tooltip open={props.disabled ? false : undefined}>\n <TooltipTrigger asChild>\n {props.inline ? (\n <span className={cn(props.className)}>\n {trigger}\n </span>\n ) : (\n <div className={cn(\"flex items-center gap-1\", props.className)}>\n {trigger}\n </div>\n )}\n </TooltipTrigger>\n {props.tooltip && <TooltipPortal>\n <TooltipContent>\n <div className=\"max-w-60 text-center text-wrap whitespace-pre-wrap\">\n {props.tooltip}\n </div>\n </TooltipContent>\n </TooltipPortal>}\n </Tooltip>\n </TooltipProvider>\n );\n}\n"],"mappings":";;;;;;AAIA,SAAgB,cAAc,OAO3B;CACD,MAAM,gBAAgB,GAAG,iCAAiC,MAAM,UAAU,SAAS;CAOnF,MAAM,UACJ,4CAPW,MAAM,SAAS,YAC1B,oBAAC,eAAY,WAAW,gBAAiB,GACzC,MAAM,SAAS,SACb,oBAAC,QAAK,WAAW,gBAAiB,GAClC,MAGO,MAAM,YAAY;AAG7B,QACE,oBAAC,6BACC,qBAAC;EAAQ,MAAM,MAAM,WAAW,QAAQ;aACtC,oBAAC;GAAe;aACb,MAAM,SACL,oBAAC;IAAK,WAAW,GAAG,MAAM,UAAU;cACjC;KACI,GAEP,oBAAC;IAAI,WAAW,GAAG,2BAA2B,MAAM,UAAU;cAC3D;KACG;IAEO,EAChB,MAAM,WAAW,oBAAC,2BACjB,oBAAC,4BACC,oBAAC;GAAI,WAAU;aACZ,MAAM;IACH,GACS,GACH;GACR,GACM"}
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/button.d.ts
|
|
6
6
|
declare const buttonVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
7
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
8
8
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
type OriginalButtonProps = {
|
|
@@ -22,7 +22,7 @@ declare const Button: React.FC<{
|
|
|
22
22
|
} & {
|
|
23
23
|
asChild?: boolean;
|
|
24
24
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<(props?: ({
|
|
25
|
-
variant?: "
|
|
25
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "plain" | null | undefined;
|
|
26
26
|
size?: "default" | "plain" | "sm" | "lg" | "icon" | null | undefined;
|
|
27
27
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
28
28
|
ref?: React.Ref<HTMLButtonElement> | undefined;
|
|
@@ -6,7 +6,7 @@ import { ControllerProps, FieldPath, FieldValues } from "react-hook-form";
|
|
|
6
6
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7
7
|
|
|
8
8
|
//#region src/components/ui/form.d.ts
|
|
9
|
-
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues
|
|
9
|
+
declare const Form: <TFieldValues extends FieldValues, TContext = any, TTransformedValues = TFieldValues>(props: react_hook_form0.FormProviderProps<TFieldValues, TContext, TTransformedValues>) => React.JSX.Element;
|
|
10
10
|
declare const FormField: <TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>({
|
|
11
11
|
...props
|
|
12
12
|
}: ControllerProps<TFieldValues, TName>) => react_jsx_runtime0.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","names":[],"sources":["../../../../src/components/ui/form.tsx"],"mappings":";;;;;;;;cAmBM,IAAA,wBAAI,WAAA,
|
|
1
|
+
{"version":3,"file":"form.d.ts","names":[],"sources":["../../../../src/components/ui/form.tsx"],"mappings":";;;;;;;;cAmBM,IAAA,wBAAI,WAAA,uCAAA,YAAA,EAAA,KAAA,EAAA,gBAAA,CAAA,iBAAA,CAAA,YAAA,EAAA,QAAA,EAAA,kBAAA,MAAA,KAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAWJ,SAAA,wBACiB,WAAA,GAAc,WAAA,gBACrB,SAAA,CAAU,YAAA,IAAgB,SAAA,CAAU,YAAA;EAAA,GAClD;AAAA,GAEG,eAAA,CAAgB,YAAA,EAAc,KAAA,MAAM,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAQnC,YAAA;;;;;UAsBL,gBAAA,CAAA,UAAA;;;;;;;cAUK,QAAA,EAAQ,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,cAAA;;;cAcR,SAAA,EAAS,KAAA,CAAA,EAAA,CAAA,IAAA,CAAA,cAAA,CAAA,UAAA,GAAA,KAAA,CAAA,aAAA,CAAA,gBAAA;;;cAgBT,WAAA,EAAW,KAAA,CAAA,EAAA,CAAA,IAAA,CAmBf,qBAAA,CAnBe,SAAA,GAAA,KAAA,CAAA,aAAA,CAAA,WAAA;;;cAsBX,eAAA,EAAe,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,oBAAA;;;cAiBf,WAAA,EAAW,KAAA,CAAA,EAAA,CAAA,KAAA,CAAA,cAAA,CAAA,oBAAA"}
|
|
@@ -7,7 +7,7 @@ declare const ResizablePanelGroup: ({
|
|
|
7
7
|
className,
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => react_jsx_runtime0.JSX.Element;
|
|
10
|
-
declare const ResizablePanel: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<
|
|
10
|
+
declare const ResizablePanel: react.ForwardRefExoticComponent<Omit<react.HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLDivElement | HTMLSpanElement | HTMLImageElement | HTMLOListElement | HTMLLIElement | HTMLAnchorElement | HTMLParagraphElement | HTMLHeadingElement | HTMLInputElement | HTMLLabelElement | HTMLUListElement | HTMLObjectElement | HTMLSlotElement | HTMLStyleElement | HTMLTitleElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLCanvasElement | HTMLTableCaptionElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDialogElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLLinkElement | HTMLMapElement | HTMLMenuElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLPictureElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLTableElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTemplateElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement>, "id" | "onResize"> & {
|
|
11
11
|
className?: string | undefined;
|
|
12
12
|
collapsedSize?: number | undefined;
|
|
13
13
|
collapsible?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../../../../src/components/ui/resizable.tsx"],"mappings":";;;;;cAOM,mBAAA;EAAuB,SAAA;EAAA,GAAA;AAAA,GAG1B,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,UAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAUvD,cAAA,QAAc,yBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"resizable.d.ts","names":[],"sources":["../../../../src/components/ui/resizable.tsx"],"mappings":";;;;;cAOM,mBAAA;EAAuB,SAAA;EAAA,GAAA;AAAA,GAG1B,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,UAAA,MAAW,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAUvD,cAAA,QAAc,yBAAA,CAAA,IAAA,CAAA,KAAA,CAAA,cAAA,CAAA,iBAAA,GAAA,WAAA,GAAA,cAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,aAAA,GAAA,iBAAA,GAAA,oBAAA,GAAA,kBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,iBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,eAAA,GAAA,aAAA,GAAA,iBAAA,GAAA,uBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,mBAAA,GAAA,cAAA,GAAA,kBAAA,GAAA,iBAAA,GAAA,gBAAA,GAAA,gBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,eAAA,GAAA,aAAA,GAAA,eAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,eAAA,GAAA,cAAA,GAAA,eAAA,GAAA,eAAA,GAAA,gBAAA,GAAA,mBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,kBAAA,GAAA,cAAA,GAAA,mBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,iBAAA,GAAA,gBAAA,GAAA,uBAAA,GAAA,oBAAA,GAAA,mBAAA,GAAA,mBAAA,GAAA,eAAA,GAAA,mBAAA,GAAA,gBAAA,GAAA,gBAAA;;;;;;;;;;;;;;;;;cAEd,eAAA;EAAmB,UAAA;EAAA,SAAA;EAAA,GAAA;AAAA,GAItB,KAAA,CAAM,cAAA,QAAsB,kBAAA,CAAmB,iBAAA;EAChD,UAAA;AAAA,MACD,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -5,7 +5,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
5
5
|
//#region src/components/ui/typography.d.ts
|
|
6
6
|
declare const Typography: React.FC<React.HTMLAttributes<HTMLHeadingElement> & VariantProps<(props?: ({
|
|
7
7
|
type?: "div" | "h2" | "h3" | "label" | "p" | "h1" | "h4" | "footnote" | null | undefined;
|
|
8
|
-
variant?: "destructive" | "
|
|
8
|
+
variant?: "destructive" | "secondary" | "success" | "primary" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string> & {
|
|
10
10
|
ref?: React.Ref<HTMLHeadingElement> | undefined;
|
|
11
11
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hexclave/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"repository": "https://github.com/hexclave/hexclave",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"README.md",
|
|
10
10
|
"dist",
|
|
11
|
+
"src",
|
|
11
12
|
"CHANGELOG.md",
|
|
12
13
|
"LICENSE"
|
|
13
14
|
],
|
|
@@ -82,7 +83,7 @@
|
|
|
82
83
|
"react-hook-form": "^7.53.1",
|
|
83
84
|
"react-resizable-panels": "^2.1.6",
|
|
84
85
|
"tailwind-merge": "^2.5.4",
|
|
85
|
-
"@hexclave/shared": "1.0.
|
|
86
|
+
"@hexclave/shared": "1.0.6"
|
|
86
87
|
},
|
|
87
88
|
"devDependencies": {
|
|
88
89
|
"@types/react": "^19.0.0",
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { CircleAlert, Info, LucideIcon } from "lucide-react";
|
|
4
|
+
import React, { Suspense, useId } from "react";
|
|
5
|
+
import { Alert, Button, type ButtonProps, Checkbox, Dialog, DialogBody, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, Label, Skeleton } from '..';
|
|
6
|
+
|
|
7
|
+
export type ActionDialogProps = {
|
|
8
|
+
trigger?: React.ReactNode,
|
|
9
|
+
open?: boolean,
|
|
10
|
+
onClose?: () => void,
|
|
11
|
+
onOpenChange?: (open: boolean) => void,
|
|
12
|
+
titleIcon?: LucideIcon,
|
|
13
|
+
title: boolean | React.ReactNode,
|
|
14
|
+
description?: React.ReactNode,
|
|
15
|
+
danger?: boolean,
|
|
16
|
+
okButton?: boolean | Readonly<{
|
|
17
|
+
label?: string,
|
|
18
|
+
onClick?: () => Promise<"prevent-close" | undefined | void>,
|
|
19
|
+
props?: Partial<ButtonProps>,
|
|
20
|
+
}>,
|
|
21
|
+
cancelButton?: boolean | Readonly<{
|
|
22
|
+
label?: string,
|
|
23
|
+
onClick?: () => Promise<"prevent-close" | undefined | void>,
|
|
24
|
+
props?: Partial<ButtonProps>,
|
|
25
|
+
}>,
|
|
26
|
+
confirmText?: string,
|
|
27
|
+
children?: React.ReactNode,
|
|
28
|
+
preventClose?: boolean,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function ActionDialog(props: ActionDialogProps) {
|
|
32
|
+
const okButton = props.okButton === true ? {} : props.okButton;
|
|
33
|
+
const cancelButton = props.cancelButton === true ? {} : props.cancelButton;
|
|
34
|
+
const anyButton = !!(okButton || cancelButton);
|
|
35
|
+
const title = props.title === true ? (props.cancelButton ? "Confirmation" : "Alert") : props.title;
|
|
36
|
+
const TitleIcon = props.titleIcon || (props.danger ? CircleAlert : Info);
|
|
37
|
+
const [openState, setOpenState] = React.useState(!!props.open);
|
|
38
|
+
const open = props.open ?? openState;
|
|
39
|
+
const [confirmed, setConfirmed] = React.useState(false);
|
|
40
|
+
const confirmId = useId();
|
|
41
|
+
const [invalidationCount, setInvalidationCount] = React.useState(0);
|
|
42
|
+
|
|
43
|
+
const onOpenChange = (open: boolean) => {
|
|
44
|
+
if (!open) {
|
|
45
|
+
props.onClose?.();
|
|
46
|
+
setConfirmed(false);
|
|
47
|
+
} else {
|
|
48
|
+
setInvalidationCount(invalidationCount + 1);
|
|
49
|
+
}
|
|
50
|
+
setOpenState(open);
|
|
51
|
+
props.onOpenChange?.(open);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Dialog open={open} onOpenChange={onOpenChange} key={invalidationCount}>
|
|
56
|
+
{props.trigger && <DialogTrigger asChild>
|
|
57
|
+
{props.trigger}
|
|
58
|
+
</DialogTrigger>}
|
|
59
|
+
|
|
60
|
+
<DialogContent
|
|
61
|
+
onInteractOutside={props.preventClose ? (e) => e.preventDefault() : undefined}
|
|
62
|
+
className={props.preventClose ? "[&>button]:hidden" : ""}
|
|
63
|
+
>
|
|
64
|
+
<DialogHeader>
|
|
65
|
+
<DialogTitle className="flex items-center">
|
|
66
|
+
<TitleIcon className="h-4 w-4 mr-2"/>
|
|
67
|
+
{title}
|
|
68
|
+
</DialogTitle>
|
|
69
|
+
<DialogDescription>
|
|
70
|
+
{props.description}
|
|
71
|
+
</DialogDescription>
|
|
72
|
+
</DialogHeader>
|
|
73
|
+
|
|
74
|
+
<DialogBody className="pb-2">
|
|
75
|
+
<div>
|
|
76
|
+
<Suspense fallback={
|
|
77
|
+
<>
|
|
78
|
+
<Skeleton className='h-9 w-2/3 self-center' />
|
|
79
|
+
|
|
80
|
+
<Skeleton className='h-3 w-16 mt-8' />
|
|
81
|
+
<Skeleton className='h-9 w-full mt-1' />
|
|
82
|
+
|
|
83
|
+
<Skeleton className='h-3 w-24 mt-2' />
|
|
84
|
+
<Skeleton className='h-9 w-full mt-1' />
|
|
85
|
+
|
|
86
|
+
<Skeleton className='h-9 w-full mt-6' />
|
|
87
|
+
</>
|
|
88
|
+
}>
|
|
89
|
+
{props.children}
|
|
90
|
+
</Suspense>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
{props.confirmText && <Alert>
|
|
94
|
+
<Label className="flex gap-4 items-center">
|
|
95
|
+
<Checkbox id={confirmId} checked={confirmed} onCheckedChange={(v) => setConfirmed(!!v)}/>
|
|
96
|
+
{props.confirmText}
|
|
97
|
+
</Label>
|
|
98
|
+
</Alert>}
|
|
99
|
+
</DialogBody>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
{anyButton && <DialogFooter className="gap-2">
|
|
103
|
+
{cancelButton && (
|
|
104
|
+
<Button
|
|
105
|
+
variant="secondary"
|
|
106
|
+
color="neutral"
|
|
107
|
+
onClick={async () => {
|
|
108
|
+
if (await cancelButton.onClick?.() !== "prevent-close") {
|
|
109
|
+
onOpenChange(false);
|
|
110
|
+
}
|
|
111
|
+
}}
|
|
112
|
+
{...cancelButton.props}
|
|
113
|
+
>
|
|
114
|
+
{cancelButton.label ?? "Cancel"}
|
|
115
|
+
</Button>
|
|
116
|
+
)}
|
|
117
|
+
{okButton && (
|
|
118
|
+
<Button
|
|
119
|
+
disabled={!!props.confirmText && !confirmed}
|
|
120
|
+
variant={props.danger ? "destructive" : "default"}
|
|
121
|
+
onClick={async () => {
|
|
122
|
+
if (await okButton.onClick?.() !== "prevent-close") {
|
|
123
|
+
onOpenChange(false);
|
|
124
|
+
}
|
|
125
|
+
}}
|
|
126
|
+
{...okButton.props}
|
|
127
|
+
>
|
|
128
|
+
{okButton.label ?? "OK"}
|
|
129
|
+
</Button>
|
|
130
|
+
)}
|
|
131
|
+
</DialogFooter>}
|
|
132
|
+
</DialogContent>
|
|
133
|
+
</Dialog>
|
|
134
|
+
);
|
|
135
|
+
}
|