@jamsrui/tooltip 0.0.19 → 0.1.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/README.md +1 -3
- package/dist/index.d.mts +5 -9
- package/dist/index.mjs +1 -1
- package/dist/tooltip-content.d.mts +4 -4
- package/dist/tooltip-content.mjs +1 -1
- package/dist/tooltip-context.d.mts +0 -2
- package/dist/tooltip-portal.d.mts +10 -0
- package/dist/tooltip-portal.mjs +1 -0
- package/dist/tooltip-trigger.mjs +1 -1
- package/dist/tooltip.d.mts +1 -2
- package/dist/use-tooltip.d.mts +296 -6
- package/dist/use-tooltip.mjs +1 -1
- package/package.json +4 -4
- package/dist/styles.d.mts +0 -50
- package/dist/styles.mjs +0 -1
- package/dist/tooltip-config.d.mts +0 -21
- package/dist/tooltip-config.mjs +0 -1
package/README.md
CHANGED
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
**A comprehensive React UI component library designed for developers, with Tailwind CSS integration for seamless styling.**
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## 📖 **Overview**
|
|
7
6
|
|
|
8
7
|
[JamsrUI](https://jamsr-ui.jamsrworld.com) is designed to help developers build modern, fast and visually appealing web applications with ease.
|
|
9
8
|
|
|
10
|
-
## 🚀 Getting Started
|
|
9
|
+
## 🚀 Getting Started
|
|
11
10
|
|
|
12
11
|
Boost & Build your websites using [JamsrUI](https://jamsr-ui.jamsrworld.com).
|
|
13
12
|
|
|
@@ -37,4 +36,3 @@ We welcome contributions from developers of all skill levels!
|
|
|
37
36
|
## ⭐ Support the Project
|
|
38
37
|
|
|
39
38
|
If you find **JamsrUI** helpful, consider giving it a ⭐ on [GitHub](https://github.com/jamsrworld/jamsr-ui).
|
|
40
|
-
|
package/dist/index.d.mts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
1
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
import { Tooltip as Tooltip$1 } from './tooltip.mjs';
|
|
3
4
|
import { TooltipArrow } from './tooltip-arrow.mjs';
|
|
4
|
-
import { TooltipConfig } from './tooltip-config.mjs';
|
|
5
|
-
export { useTooltipConfig } from './tooltip-config.mjs';
|
|
6
5
|
import { TooltipContent } from './tooltip-content.mjs';
|
|
6
|
+
import { TooltipPortal } from './tooltip-portal.mjs';
|
|
7
7
|
import { TooltipTrigger } from './tooltip-trigger.mjs';
|
|
8
8
|
export { FloatingDelayGroup as TooltipGroup } from '@floating-ui/react';
|
|
9
9
|
import './use-tooltip.mjs';
|
|
10
10
|
import '@jamsrui/utils';
|
|
11
|
-
import 'react';
|
|
12
|
-
import './styles.mjs';
|
|
13
|
-
import '@jamsrui/core';
|
|
14
11
|
|
|
15
12
|
declare const Tooltip: ((props: Tooltip$1.Props) => react_jsx_runtime.JSX.Element) & {
|
|
16
13
|
Trigger: (props: TooltipTrigger.Props) => react_jsx_runtime.JSX.Element;
|
|
17
|
-
Content: (props: TooltipContent.Props) =>
|
|
14
|
+
Content: (props: TooltipContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
18
15
|
Arrow: (props: TooltipArrow.Props) => react_jsx_runtime.JSX.Element | null;
|
|
16
|
+
Portal: (props: TooltipPortal.Props) => react_jsx_runtime.JSX.Element | null;
|
|
19
17
|
};
|
|
20
18
|
declare namespace Tooltip {
|
|
21
19
|
interface Props extends Tooltip$1.Props {
|
|
22
20
|
}
|
|
23
|
-
interface Config extends TooltipConfig.Props {
|
|
24
|
-
}
|
|
25
21
|
interface Trigger extends TooltipTrigger.Props {
|
|
26
22
|
}
|
|
27
23
|
interface Content extends TooltipContent.Props {
|
|
@@ -30,4 +26,4 @@ declare namespace Tooltip {
|
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
28
|
|
|
33
|
-
export { Tooltip
|
|
29
|
+
export { Tooltip };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{TooltipGroup as
|
|
1
|
+
import{TooltipGroup as o,Tooltip as t}from"./tooltip.mjs";import{TooltipArrow as r}from"./tooltip-arrow.mjs";import{TooltipContent as e}from"./tooltip-content.mjs";import{TooltipPortal as p}from"./tooltip-portal.mjs";import{TooltipTrigger as i}from"./tooltip-trigger.mjs";const x=Object.assign(t,{Trigger:i,Content:e,Arrow:r,Portal:p});export{x as Tooltip,o as TooltipGroup};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { UIProps } from '@jamsrui/utils';
|
|
3
3
|
|
|
4
|
-
declare const TooltipContent: (props: TooltipContent.Props) =>
|
|
4
|
+
declare const TooltipContent: (props: TooltipContent.Props) => react.ReactElement<unknown, string | react.JSXElementConstructor<any>>;
|
|
5
5
|
declare namespace TooltipContent {
|
|
6
|
-
interface Props extends
|
|
6
|
+
interface Props extends UIProps<"div"> {
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
package/dist/tooltip-content.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useRenderElement as t}from"@jamsrui/hooks";import{useTooltipContext as n}from"./tooltip-context.mjs";const l=e=>{const{getContentProps:o}=n();return t("div",{props:[o(e)]})};export{l as TooltipContent};
|
|
@@ -2,9 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { useTooltip } from './use-tooltip.mjs';
|
|
3
3
|
import '@floating-ui/react';
|
|
4
4
|
import '@jamsrui/utils';
|
|
5
|
-
import './styles.mjs';
|
|
6
5
|
import './tooltip-content.mjs';
|
|
7
|
-
import 'react/jsx-runtime';
|
|
8
6
|
|
|
9
7
|
declare const useTooltipContext: () => TooltipContext.Props;
|
|
10
8
|
declare const TooltipContext: react.Context<TooltipContext.Props | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FloatingPortalProps } from '@floating-ui/react';
|
|
3
|
+
|
|
4
|
+
declare const TooltipPortal: (props: TooltipPortal.Props) => react_jsx_runtime.JSX.Element | null;
|
|
5
|
+
declare namespace TooltipPortal {
|
|
6
|
+
interface Props extends FloatingPortalProps {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { TooltipPortal };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as p}from"react/jsx-runtime";import{useTooltipContext as r}from"./tooltip-context.mjs";import{FloatingPortal as l}from"@floating-ui/react";const a=o=>{const{isOpen:t}=r();return t?p(l,{...o}):null};export{a as TooltipPortal};
|
package/dist/tooltip-trigger.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{Fragment as
|
|
1
|
+
"use client";import{Fragment as s,jsx as l}from"react/jsx-runtime";import{cloneElement as n}from"react";import{useTooltipContext as p}from"./tooltip-context.mjs";const T=r=>{const{children:e}=r,{getTriggerProps:o,isDisabled:t}=p();if(t)return e;const i=n(e,o(e.props));return l(s,{children:i})};export{T as TooltipTrigger};
|
package/dist/tooltip.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { useTooltip } from './use-tooltip.mjs';
|
|
3
3
|
export { FloatingDelayGroup as TooltipGroup } from '@floating-ui/react';
|
|
4
|
-
import '@jamsrui/utils';
|
|
5
4
|
import 'react';
|
|
6
|
-
import '
|
|
5
|
+
import '@jamsrui/utils';
|
|
7
6
|
import './tooltip-content.mjs';
|
|
8
7
|
|
|
9
8
|
declare const Tooltip: (props: Tooltip.Props) => react_jsx_runtime.JSX.Element;
|
package/dist/use-tooltip.d.mts
CHANGED
|
@@ -1,22 +1,312 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ComponentProps, PropsWithChildren } from 'react';
|
|
1
3
|
import { FloatingArrowProps, Placement, Delay } from '@floating-ui/react';
|
|
2
4
|
import { PropGetter } from '@jamsrui/utils';
|
|
3
|
-
import { PropsWithChildren } from 'react';
|
|
4
|
-
import { TooltipVariants } from './styles.mjs';
|
|
5
5
|
import { TooltipContent } from './tooltip-content.mjs';
|
|
6
|
-
import 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
declare const useTooltip: (props: useTooltip.Props) => {
|
|
9
8
|
getContentProps: PropGetter<TooltipContent.Props>;
|
|
10
9
|
getArrowProps: (props: Partial<FloatingArrowProps>) => FloatingArrowProps;
|
|
11
10
|
isOpen: boolean;
|
|
12
11
|
showArrow: boolean;
|
|
13
|
-
getTriggerProps: () => {
|
|
14
|
-
|
|
12
|
+
getTriggerProps: (props: ComponentProps<"button">) => {
|
|
13
|
+
ref?: react.Ref<HTMLButtonElement> | undefined;
|
|
14
|
+
key?: react.Key | null | undefined;
|
|
15
|
+
disabled?: boolean | undefined;
|
|
16
|
+
form?: string | undefined;
|
|
17
|
+
formAction?: string | ((formData: FormData) => void | Promise<void>) | react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof react.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
|
|
18
|
+
formEncType?: string | undefined;
|
|
19
|
+
formMethod?: string | undefined;
|
|
20
|
+
formNoValidate?: boolean | undefined;
|
|
21
|
+
formTarget?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
type?: "submit" | "reset" | "button" | undefined;
|
|
24
|
+
value?: string | readonly string[] | number | undefined;
|
|
25
|
+
defaultChecked?: boolean | undefined;
|
|
26
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
27
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
28
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
29
|
+
accessKey?: string | undefined;
|
|
30
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
31
|
+
autoFocus?: boolean | undefined;
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
34
|
+
contextMenu?: string | undefined;
|
|
35
|
+
dir?: string | undefined;
|
|
36
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
37
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
38
|
+
hidden?: boolean | undefined;
|
|
39
|
+
id?: string | undefined;
|
|
40
|
+
lang?: string | undefined;
|
|
41
|
+
nonce?: string | undefined;
|
|
42
|
+
slot?: string | undefined;
|
|
43
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
44
|
+
style?: react.CSSProperties | undefined;
|
|
45
|
+
tabIndex?: number | undefined;
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
translate?: "yes" | "no" | undefined;
|
|
48
|
+
radioGroup?: string | undefined;
|
|
49
|
+
role?: react.AriaRole | undefined;
|
|
50
|
+
about?: string | undefined;
|
|
51
|
+
content?: string | undefined;
|
|
52
|
+
datatype?: string | undefined;
|
|
53
|
+
inlist?: any;
|
|
54
|
+
prefix?: string | undefined;
|
|
55
|
+
property?: string | undefined;
|
|
56
|
+
rel?: string | undefined;
|
|
57
|
+
resource?: string | undefined;
|
|
58
|
+
rev?: string | undefined;
|
|
59
|
+
typeof?: string | undefined;
|
|
60
|
+
vocab?: string | undefined;
|
|
61
|
+
autoCorrect?: string | undefined;
|
|
62
|
+
autoSave?: string | undefined;
|
|
63
|
+
color?: string | undefined;
|
|
64
|
+
itemProp?: string | undefined;
|
|
65
|
+
itemScope?: boolean | undefined;
|
|
66
|
+
itemType?: string | undefined;
|
|
67
|
+
itemID?: string | undefined;
|
|
68
|
+
itemRef?: string | undefined;
|
|
69
|
+
results?: number | undefined;
|
|
70
|
+
security?: string | undefined;
|
|
71
|
+
unselectable?: "on" | "off" | undefined;
|
|
72
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
73
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
74
|
+
popoverTarget?: string | undefined;
|
|
75
|
+
inert?: boolean | undefined;
|
|
76
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
77
|
+
is?: string | undefined;
|
|
78
|
+
exportparts?: string | undefined;
|
|
79
|
+
part?: string | undefined;
|
|
80
|
+
"aria-activedescendant"?: string | undefined;
|
|
81
|
+
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
82
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
83
|
+
"aria-braillelabel"?: string | undefined;
|
|
84
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
85
|
+
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
86
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
87
|
+
"aria-colcount"?: number | undefined;
|
|
88
|
+
"aria-colindex"?: number | undefined;
|
|
89
|
+
"aria-colindextext"?: string | undefined;
|
|
90
|
+
"aria-colspan"?: number | undefined;
|
|
91
|
+
"aria-controls"?: string | undefined;
|
|
92
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
93
|
+
"aria-describedby"?: string | undefined;
|
|
94
|
+
"aria-description"?: string | undefined;
|
|
95
|
+
"aria-details"?: string | undefined;
|
|
96
|
+
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
97
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
98
|
+
"aria-errormessage"?: string | undefined;
|
|
99
|
+
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
100
|
+
"aria-flowto"?: string | undefined;
|
|
101
|
+
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
102
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
103
|
+
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
104
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
105
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
106
|
+
"aria-label"?: string | undefined;
|
|
107
|
+
"aria-labelledby"?: string | undefined;
|
|
108
|
+
"aria-level"?: number | undefined;
|
|
109
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
110
|
+
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
111
|
+
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
112
|
+
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
113
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
114
|
+
"aria-owns"?: string | undefined;
|
|
115
|
+
"aria-placeholder"?: string | undefined;
|
|
116
|
+
"aria-posinset"?: number | undefined;
|
|
117
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
118
|
+
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
119
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
120
|
+
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
121
|
+
"aria-roledescription"?: string | undefined;
|
|
122
|
+
"aria-rowcount"?: number | undefined;
|
|
123
|
+
"aria-rowindex"?: number | undefined;
|
|
124
|
+
"aria-rowindextext"?: string | undefined;
|
|
125
|
+
"aria-rowspan"?: number | undefined;
|
|
126
|
+
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
127
|
+
"aria-setsize"?: number | undefined;
|
|
128
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
129
|
+
"aria-valuemax"?: number | undefined;
|
|
130
|
+
"aria-valuemin"?: number | undefined;
|
|
131
|
+
"aria-valuenow"?: number | undefined;
|
|
132
|
+
"aria-valuetext"?: string | undefined;
|
|
133
|
+
children?: react.ReactNode | undefined;
|
|
134
|
+
dangerouslySetInnerHTML?: {
|
|
135
|
+
__html: string | TrustedHTML;
|
|
136
|
+
} | undefined;
|
|
137
|
+
onCopy?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
138
|
+
onCopyCapture?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
139
|
+
onCut?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
140
|
+
onCutCapture?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
141
|
+
onPaste?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
142
|
+
onPasteCapture?: react.ClipboardEventHandler<HTMLButtonElement> | undefined;
|
|
143
|
+
onCompositionEnd?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
144
|
+
onCompositionEndCapture?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
145
|
+
onCompositionStart?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
146
|
+
onCompositionStartCapture?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
147
|
+
onCompositionUpdate?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
148
|
+
onCompositionUpdateCapture?: react.CompositionEventHandler<HTMLButtonElement> | undefined;
|
|
149
|
+
onFocus?: react.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
150
|
+
onFocusCapture?: react.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
151
|
+
onBlur?: react.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
152
|
+
onBlurCapture?: react.FocusEventHandler<HTMLButtonElement> | undefined;
|
|
153
|
+
onChange?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
154
|
+
onChangeCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
155
|
+
onBeforeInput?: react.InputEventHandler<HTMLButtonElement> | undefined;
|
|
156
|
+
onBeforeInputCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
157
|
+
onInput?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
158
|
+
onInputCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
159
|
+
onReset?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
160
|
+
onResetCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
161
|
+
onSubmit?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
162
|
+
onSubmitCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
163
|
+
onInvalid?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
164
|
+
onInvalidCapture?: react.FormEventHandler<HTMLButtonElement> | undefined;
|
|
165
|
+
onLoad?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
166
|
+
onLoadCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
167
|
+
onError?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
168
|
+
onErrorCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
169
|
+
onKeyDown?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
170
|
+
onKeyDownCapture?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
171
|
+
onKeyPress?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
172
|
+
onKeyPressCapture?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
173
|
+
onKeyUp?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
174
|
+
onKeyUpCapture?: react.KeyboardEventHandler<HTMLButtonElement> | undefined;
|
|
175
|
+
onAbort?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
176
|
+
onAbortCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
177
|
+
onCanPlay?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
178
|
+
onCanPlayCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
179
|
+
onCanPlayThrough?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
180
|
+
onCanPlayThroughCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
181
|
+
onDurationChange?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
182
|
+
onDurationChangeCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
183
|
+
onEmptied?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
184
|
+
onEmptiedCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
185
|
+
onEncrypted?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
186
|
+
onEncryptedCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
187
|
+
onEnded?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
188
|
+
onEndedCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
189
|
+
onLoadedData?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
190
|
+
onLoadedDataCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
191
|
+
onLoadedMetadata?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
192
|
+
onLoadedMetadataCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
193
|
+
onLoadStart?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
194
|
+
onLoadStartCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
195
|
+
onPause?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
196
|
+
onPauseCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
197
|
+
onPlay?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
198
|
+
onPlayCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
199
|
+
onPlaying?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
200
|
+
onPlayingCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
201
|
+
onProgress?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
202
|
+
onProgressCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
203
|
+
onRateChange?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
204
|
+
onRateChangeCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
205
|
+
onSeeked?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
206
|
+
onSeekedCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
207
|
+
onSeeking?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
208
|
+
onSeekingCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
209
|
+
onStalled?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
210
|
+
onStalledCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
211
|
+
onSuspend?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
212
|
+
onSuspendCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
213
|
+
onTimeUpdate?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
214
|
+
onTimeUpdateCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
215
|
+
onVolumeChange?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
216
|
+
onVolumeChangeCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
217
|
+
onWaiting?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
218
|
+
onWaitingCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
219
|
+
onAuxClick?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
220
|
+
onAuxClickCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
221
|
+
onClick?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
222
|
+
onClickCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
223
|
+
onContextMenu?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
224
|
+
onContextMenuCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
225
|
+
onDoubleClick?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
226
|
+
onDoubleClickCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
227
|
+
onDrag?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
228
|
+
onDragCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
229
|
+
onDragEnd?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
230
|
+
onDragEndCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
231
|
+
onDragEnter?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
232
|
+
onDragEnterCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
233
|
+
onDragExit?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
234
|
+
onDragExitCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
235
|
+
onDragLeave?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
236
|
+
onDragLeaveCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
237
|
+
onDragOver?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
238
|
+
onDragOverCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
239
|
+
onDragStart?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
240
|
+
onDragStartCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
241
|
+
onDrop?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
242
|
+
onDropCapture?: react.DragEventHandler<HTMLButtonElement> | undefined;
|
|
243
|
+
onMouseDown?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
244
|
+
onMouseDownCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
245
|
+
onMouseEnter?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
246
|
+
onMouseLeave?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
247
|
+
onMouseMove?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
248
|
+
onMouseMoveCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
249
|
+
onMouseOut?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
250
|
+
onMouseOutCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
251
|
+
onMouseOver?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
252
|
+
onMouseOverCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
253
|
+
onMouseUp?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
254
|
+
onMouseUpCapture?: react.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
255
|
+
onSelect?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
256
|
+
onSelectCapture?: react.ReactEventHandler<HTMLButtonElement> | undefined;
|
|
257
|
+
onTouchCancel?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
258
|
+
onTouchCancelCapture?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
259
|
+
onTouchEnd?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
260
|
+
onTouchEndCapture?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
261
|
+
onTouchMove?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
262
|
+
onTouchMoveCapture?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
263
|
+
onTouchStart?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
264
|
+
onTouchStartCapture?: react.TouchEventHandler<HTMLButtonElement> | undefined;
|
|
265
|
+
onPointerDown?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
266
|
+
onPointerDownCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
267
|
+
onPointerMove?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
268
|
+
onPointerMoveCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
269
|
+
onPointerUp?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
270
|
+
onPointerUpCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
271
|
+
onPointerCancel?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
272
|
+
onPointerCancelCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
273
|
+
onPointerEnter?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
274
|
+
onPointerLeave?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
275
|
+
onPointerOver?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
276
|
+
onPointerOverCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
277
|
+
onPointerOut?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
278
|
+
onPointerOutCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
279
|
+
onGotPointerCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
280
|
+
onGotPointerCaptureCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
281
|
+
onLostPointerCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
282
|
+
onLostPointerCaptureCapture?: react.PointerEventHandler<HTMLButtonElement> | undefined;
|
|
283
|
+
onScroll?: react.UIEventHandler<HTMLButtonElement> | undefined;
|
|
284
|
+
onScrollCapture?: react.UIEventHandler<HTMLButtonElement> | undefined;
|
|
285
|
+
onScrollEnd?: react.UIEventHandler<HTMLButtonElement> | undefined;
|
|
286
|
+
onScrollEndCapture?: react.UIEventHandler<HTMLButtonElement> | undefined;
|
|
287
|
+
onWheel?: react.WheelEventHandler<HTMLButtonElement> | undefined;
|
|
288
|
+
onWheelCapture?: react.WheelEventHandler<HTMLButtonElement> | undefined;
|
|
289
|
+
onAnimationStart?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
290
|
+
onAnimationStartCapture?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
291
|
+
onAnimationEnd?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
292
|
+
onAnimationEndCapture?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
293
|
+
onAnimationIteration?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
294
|
+
onAnimationIterationCapture?: react.AnimationEventHandler<HTMLButtonElement> | undefined;
|
|
295
|
+
onToggle?: react.ToggleEventHandler<HTMLButtonElement> | undefined;
|
|
296
|
+
onBeforeToggle?: react.ToggleEventHandler<HTMLButtonElement> | undefined;
|
|
297
|
+
onTransitionCancel?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
298
|
+
onTransitionCancelCapture?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
299
|
+
onTransitionEnd?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
300
|
+
onTransitionEndCapture?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
301
|
+
onTransitionRun?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
302
|
+
onTransitionRunCapture?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
303
|
+
onTransitionStart?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
304
|
+
onTransitionStartCapture?: react.TransitionEventHandler<HTMLButtonElement> | undefined;
|
|
15
305
|
};
|
|
16
306
|
isDisabled: boolean;
|
|
17
307
|
};
|
|
18
308
|
declare namespace useTooltip {
|
|
19
|
-
interface Props extends PropsWithChildren
|
|
309
|
+
interface Props extends PropsWithChildren {
|
|
20
310
|
placement?: Placement;
|
|
21
311
|
disabled?: boolean;
|
|
22
312
|
offset?: number;
|
package/dist/use-tooltip.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useCallback as
|
|
1
|
+
"use client";import{useCallback as i,useMemo as E,useState as R}from"react";import{arrow as j,autoUpdate as k,flip as H,offset as I,safePolygon as M,shift as V,useDelayGroup as W,useDismiss as U,useFloating as q,useFocus as z,useHover as B,useInteractions as J,useRole as K}from"@floating-ui/react";import{useControlledState as L}from"@jamsrui/hooks";const Z=b=>{const{delay:n,offset:h=4,placement:C="top",defaultOpen:w,isOpen:O,onOpenChange:D,disabled:c=!1,...N}=b,[p,F]=L({defaultProp:w,onChange:D,prop:O}),[f,A]=R(null),a=!!f,x=a?7:0,{refs:l,floatingStyles:u,context:e}=q({open:p,onOpenChange:F,placement:C,whileElementsMounted:k,middleware:[I(h+x),H({fallbackAxisSideDirection:"start"}),V(),j({element:f})]}),{delay:o}=W(e);let t=400,s=100;typeof n=="number"?(t=n,s=n):typeof n=="object"&&(t=n.open??t,s=n.close??s),typeof o=="number"&&o>0?(t=o,s=o):typeof o=="object"&&(t=o.open??t,s=o.close??s);const G=B(e,{move:!1,handleClose:M({blockPointerEvents:!0}),delay:{close:s,open:t}}),S=z(e),T=U(e),v=K(e,{role:"tooltip"}),{getReferenceProps:m,getFloatingProps:d}=J([G,S,T,v]),P=i(r=>({...r,style:u,ref:l.setFloating,...d()}),[u,d,l.setFloating]),g=i(r=>({tipRadius:4,...r,context:e,ref:A}),[e]),y=i(r=>({...r,...m({ref:l.setReference})}),[m,l.setReference]);return E(()=>({getContentProps:P,getArrowProps:g,isOpen:p,showArrow:a,getTriggerProps:y,isDisabled:c}),[P,g,p,a,y,c])};export{Z as useTooltip};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jamsrui/tooltip",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=19"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@floating-ui/react": ">=0.27",
|
|
9
|
-
"@jamsrui/hooks": "^0.0
|
|
10
|
-
"@jamsrui/core": "^0.0
|
|
11
|
-
"@jamsrui/utils": "^0.0
|
|
9
|
+
"@jamsrui/hooks": "^0.1.0",
|
|
10
|
+
"@jamsrui/core": "^0.1.0",
|
|
11
|
+
"@jamsrui/utils": "^0.1.0"
|
|
12
12
|
},
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
package/dist/styles.d.mts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as _jamsrui_utils from '@jamsrui/utils';
|
|
2
|
-
import { VariantProps } from '@jamsrui/utils';
|
|
3
|
-
|
|
4
|
-
declare const tooltipVariants: _jamsrui_utils.TVReturnType<{
|
|
5
|
-
radius: {
|
|
6
|
-
sm: {};
|
|
7
|
-
md: {};
|
|
8
|
-
lg: {};
|
|
9
|
-
xl: {};
|
|
10
|
-
"2xl": {};
|
|
11
|
-
"3xl": {};
|
|
12
|
-
full: {};
|
|
13
|
-
none: {};
|
|
14
|
-
};
|
|
15
|
-
}, {
|
|
16
|
-
content: string;
|
|
17
|
-
arrow: string;
|
|
18
|
-
}, undefined, {
|
|
19
|
-
radius: {
|
|
20
|
-
sm: {};
|
|
21
|
-
md: {};
|
|
22
|
-
lg: {};
|
|
23
|
-
xl: {};
|
|
24
|
-
"2xl": {};
|
|
25
|
-
"3xl": {};
|
|
26
|
-
full: {};
|
|
27
|
-
none: {};
|
|
28
|
-
};
|
|
29
|
-
}, {
|
|
30
|
-
content: string;
|
|
31
|
-
arrow: string;
|
|
32
|
-
}, _jamsrui_utils.TVReturnType<{
|
|
33
|
-
radius: {
|
|
34
|
-
sm: {};
|
|
35
|
-
md: {};
|
|
36
|
-
lg: {};
|
|
37
|
-
xl: {};
|
|
38
|
-
"2xl": {};
|
|
39
|
-
"3xl": {};
|
|
40
|
-
full: {};
|
|
41
|
-
none: {};
|
|
42
|
-
};
|
|
43
|
-
}, {
|
|
44
|
-
content: string;
|
|
45
|
-
arrow: string;
|
|
46
|
-
}, undefined, unknown, unknown, undefined>>;
|
|
47
|
-
type TooltipVariants = VariantProps<typeof tooltipVariants>;
|
|
48
|
-
type TooltipSlots = keyof ReturnType<typeof tooltipVariants>;
|
|
49
|
-
|
|
50
|
-
export { type TooltipSlots, type TooltipVariants, tooltipVariants };
|
package/dist/styles.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{radiusVariant as t,tv as o}from"@jamsrui/utils";const a=o({slots:{content:"bg-surface inline-flex px-3 py-1 text-sm font-medium text-foreground",arrow:"fill-background-secondary"},variants:{radius:t("content")},defaultVariants:{radius:"md"}});export{a as tooltipVariants};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { WithGlobalConfig } from '@jamsrui/core';
|
|
3
|
-
import { Tooltip } from './tooltip.mjs';
|
|
4
|
-
import './use-tooltip.mjs';
|
|
5
|
-
import '@floating-ui/react';
|
|
6
|
-
import '@jamsrui/utils';
|
|
7
|
-
import 'react';
|
|
8
|
-
import './styles.mjs';
|
|
9
|
-
import './tooltip-content.mjs';
|
|
10
|
-
|
|
11
|
-
declare const useTooltipConfig: () => TooltipConfig.Props;
|
|
12
|
-
declare const TooltipConfig: (props: Omit<Partial<TooltipConfig.Props>, "children"> & {
|
|
13
|
-
merge?: boolean;
|
|
14
|
-
children: React.ReactNode;
|
|
15
|
-
}) => react_jsx_runtime.JSX.Element;
|
|
16
|
-
declare namespace TooltipConfig {
|
|
17
|
-
interface Props extends WithGlobalConfig<Tooltip.Props> {
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export { TooltipConfig, useTooltipConfig };
|
package/dist/tooltip-config.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{createConfigContext as o}from"@jamsrui/utils";const[i,p]=o({displayName:"TooltipConfigContext"});export{i as TooltipConfig,p as useTooltipConfig};
|