@hexdspace/react 0.1.9 → 0.1.10
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/index.d.ts +11 -1
- package/dist/index.js +48 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -468,4 +468,14 @@ interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement
|
|
|
468
468
|
}
|
|
469
469
|
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
470
470
|
|
|
471
|
-
|
|
471
|
+
type Props = {
|
|
472
|
+
children: React.ReactElement;
|
|
473
|
+
content: React.ReactNode;
|
|
474
|
+
delayMs?: number;
|
|
475
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
476
|
+
sideOffset?: number;
|
|
477
|
+
maxWidthPx?: number;
|
|
478
|
+
};
|
|
479
|
+
declare function Tooltip({ children, content, delayMs, side, sideOffset, maxWidthPx, }: Props): react_jsx_runtime.JSX.Element;
|
|
480
|
+
|
|
481
|
+
export { AuthController, AuthControllerCtx, type AuthControllerDeps, AuthControllerProvider, AuthDispatchCtx, AuthProvider, type AuthState, AuthStateCtx, Button, type ButtonProps, type CacheInstruction, type CustomInstruction, DEFAULT_NOTIFICATION_CHANNEL, type ErrorResponse, Field, type FieldProps, type GenericResponse, type HttpClient, HttpError, type HttpMethod, type HttpResponse, Input, type InputProps, type Instruction, type InstructionContext, MockAuthHttpClient, MockHttpClient, type MutationFn, type Notification, type NotificationAction, NotificationHost, type NotificationInstruction, type NotificationVariant, NotifierController, type OnSuccessFn, type OptimisticSnapshot, type OptimisticUpdateFn, RedirectIfAuthed, type RedirectIfAuthedProps, type RequestConfig, RequireAuth, type RequireAuthProps, type ResolvedToastTheme, type ResponsiveMutation, Skeleton, type SkeletonProps, Textarea, type TextareaProps, type ToastActionTheme, type ToastTheme, type ToastTransition, type ToastifyCSSVars, Tooltip, type UIFail, type UIOk, type UIResult, type User, authController, controllerFactory, createAuthController, httpClient as fetchHttpClient, notifierController, resolveToastTheme, ui, useAuth, useAuthActions, useAuthController, useAuthDispatch, useAuthedUser, useResponsiveMutation };
|
package/dist/index.js
CHANGED
|
@@ -1915,6 +1915,53 @@ var Textarea = React6.forwardRef(
|
|
|
1915
1915
|
}
|
|
1916
1916
|
);
|
|
1917
1917
|
Textarea.displayName = "Textarea";
|
|
1918
|
+
|
|
1919
|
+
// src/ui/components/Tooltip.tsx
|
|
1920
|
+
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
1921
|
+
import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1922
|
+
var tooltipContentBase = cn(
|
|
1923
|
+
"panel shadow-none px-4 py-2.5 text-xs z-5000 select-none",
|
|
1924
|
+
"origin-center will-change-[transform,opacity]",
|
|
1925
|
+
"[--tooltip-x:0px] [--tooltip-y:4px]",
|
|
1926
|
+
"data-[side=bottom]:[--tooltip-y:-4px]",
|
|
1927
|
+
"data-[side=left]:[--tooltip-x:4px] data-[side=left]:[--tooltip-y:0px]",
|
|
1928
|
+
"data-[side=right]:[--tooltip-x:-4px] data-[side=right]:[--tooltip-y:0px]",
|
|
1929
|
+
"data-[state=delayed-open]:animate-[tooltip-in_140ms_ease-out]",
|
|
1930
|
+
"data-[state=instant-open]:animate-[tooltip-in_140ms_ease-out]",
|
|
1931
|
+
"data-[state=closed]:animate-[tooltip-out_120ms_ease-in]",
|
|
1932
|
+
"motion-reduce:animate-none"
|
|
1933
|
+
);
|
|
1934
|
+
function Tooltip({
|
|
1935
|
+
children,
|
|
1936
|
+
content,
|
|
1937
|
+
delayMs = 300,
|
|
1938
|
+
side = "top",
|
|
1939
|
+
sideOffset = 12,
|
|
1940
|
+
maxWidthPx = 240
|
|
1941
|
+
}) {
|
|
1942
|
+
return /* @__PURE__ */ jsx12(TooltipPrimitive.Provider, { delayDuration: delayMs, children: /* @__PURE__ */ jsxs5(TooltipPrimitive.Root, { children: [
|
|
1943
|
+
/* @__PURE__ */ jsx12(TooltipPrimitive.Trigger, { asChild: true, children }),
|
|
1944
|
+
/* @__PURE__ */ jsx12(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs5(
|
|
1945
|
+
TooltipPrimitive.Content,
|
|
1946
|
+
{
|
|
1947
|
+
side,
|
|
1948
|
+
sideOffset,
|
|
1949
|
+
className: tooltipContentBase,
|
|
1950
|
+
style: {
|
|
1951
|
+
width: "max-content",
|
|
1952
|
+
maxWidth: `min(${maxWidthPx}px, 90vw)`,
|
|
1953
|
+
whiteSpace: "normal",
|
|
1954
|
+
overflowWrap: "break-word",
|
|
1955
|
+
hyphens: "auto"
|
|
1956
|
+
},
|
|
1957
|
+
children: [
|
|
1958
|
+
content,
|
|
1959
|
+
/* @__PURE__ */ jsx12(TooltipPrimitive.Arrow, { style: { fill: "var(--surface-2)" } })
|
|
1960
|
+
]
|
|
1961
|
+
}
|
|
1962
|
+
) })
|
|
1963
|
+
] }) });
|
|
1964
|
+
}
|
|
1918
1965
|
export {
|
|
1919
1966
|
AuthController,
|
|
1920
1967
|
AuthControllerCtx,
|
|
@@ -1935,6 +1982,7 @@ export {
|
|
|
1935
1982
|
RequireAuth,
|
|
1936
1983
|
Skeleton,
|
|
1937
1984
|
Textarea,
|
|
1985
|
+
Tooltip,
|
|
1938
1986
|
authController,
|
|
1939
1987
|
controllerFactory,
|
|
1940
1988
|
createAuthController,
|