@expcat/tigercat-react 2.1.4 → 2.2.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/chunk-2MV3F7WP.mjs +56 -0
- package/dist/{chunk-SUHSOVWP.mjs → chunk-6T5AEQJV.mjs} +1 -1
- package/dist/{chunk-R2VBVZIH.mjs → chunk-75SQCTLC.mjs} +4 -4
- package/dist/{chunk-73OFTRG5.mjs → chunk-AHQR57Z4.mjs} +1 -1
- package/dist/{chunk-2STETY2J.mjs → chunk-CCFKRKGJ.mjs} +12 -6
- package/dist/{chunk-UNT7WJ2M.mjs → chunk-DNRLMEKE.mjs} +10 -3
- package/dist/chunk-F4XF5CGQ.mjs +72 -0
- package/dist/chunk-FZQUUTWN.mjs +145 -0
- package/dist/{chunk-NPXT436C.mjs → chunk-MMDVFCCL.mjs} +1 -1
- package/dist/{chunk-25BKSXTX.mjs → chunk-NMRCBGFP.mjs} +1 -1
- package/dist/chunk-REHHFHZ3.mjs +67 -0
- package/dist/{chunk-XI6KQAHW.mjs → chunk-RJ2FJXHT.mjs} +5 -6
- package/dist/{chunk-WN6ZHQTI.mjs → chunk-SIBNSFVR.mjs} +10 -4
- package/dist/{chunk-3WP4PGHF.mjs → chunk-TFHQODGK.mjs} +7 -1
- package/dist/{chunk-IR45LOEZ.mjs → chunk-UGKTSPS4.mjs} +38 -4
- package/dist/components/ActivityFeed.mjs +2 -2
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/BackTop.mjs +1 -1
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Code.mjs +1 -1
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/DataTableWithToolbar.mjs +1 -1
- package/dist/components/DatePicker.mjs +2 -2
- package/dist/components/Drag.d.mts +17 -0
- package/dist/components/Drag.mjs +9 -0
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/FullscreenButton.d.mts +8 -0
- package/dist/components/FullscreenButton.mjs +10 -0
- package/dist/components/Menu.mjs +1 -1
- package/dist/components/NotificationCenter.mjs +2 -2
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Text.d.mts +5 -1
- package/dist/components/Text.mjs +2 -1
- package/dist/hooks/useFullscreen.d.mts +13 -0
- package/dist/hooks/useFullscreen.mjs +6 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +37 -0
- package/package.json +17 -2
- package/dist/chunk-VDBLI5Y3.mjs +0 -33
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/hooks/useFullscreen.ts
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import {
|
|
4
|
+
exitElementFullscreen,
|
|
5
|
+
getFullscreenElement,
|
|
6
|
+
isElementFullscreen,
|
|
7
|
+
isFullscreenSupported,
|
|
8
|
+
requestElementFullscreen,
|
|
9
|
+
resolveFullscreenTarget,
|
|
10
|
+
subscribeFullscreenChange
|
|
11
|
+
} from "@expcat/tigercat-core";
|
|
12
|
+
function useFullscreen(options = {}) {
|
|
13
|
+
const optionsRef = useRef(options);
|
|
14
|
+
optionsRef.current = options;
|
|
15
|
+
const [supported] = useState(() => isFullscreenSupported());
|
|
16
|
+
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
17
|
+
const sync = useCallback(() => {
|
|
18
|
+
const target = resolveFullscreenTarget(optionsRef.current.target);
|
|
19
|
+
const next = isElementFullscreen(target);
|
|
20
|
+
setIsFullscreen(next);
|
|
21
|
+
optionsRef.current.onChange?.(next);
|
|
22
|
+
}, []);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
sync();
|
|
25
|
+
return subscribeFullscreenChange(sync);
|
|
26
|
+
}, [sync]);
|
|
27
|
+
const enter = useCallback(async () => {
|
|
28
|
+
const target = resolveFullscreenTarget(optionsRef.current.target);
|
|
29
|
+
if (!target) return;
|
|
30
|
+
if (isElementFullscreen(target)) return;
|
|
31
|
+
try {
|
|
32
|
+
await requestElementFullscreen(target);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
const err = error instanceof Error ? error : new Error("Fullscreen request failed");
|
|
35
|
+
optionsRef.current.onError?.(err);
|
|
36
|
+
}
|
|
37
|
+
}, []);
|
|
38
|
+
const exit = useCallback(async () => {
|
|
39
|
+
if (!getFullscreenElement()) return;
|
|
40
|
+
try {
|
|
41
|
+
await exitElementFullscreen();
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const err = error instanceof Error ? error : new Error("Fullscreen exit failed");
|
|
44
|
+
optionsRef.current.onError?.(err);
|
|
45
|
+
}
|
|
46
|
+
}, []);
|
|
47
|
+
const toggle = useCallback(async () => {
|
|
48
|
+
if (isFullscreen) await exit();
|
|
49
|
+
else await enter();
|
|
50
|
+
}, [enter, exit, isFullscreen]);
|
|
51
|
+
return { isFullscreen, supported, enter, exit, toggle };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export {
|
|
55
|
+
useFullscreen
|
|
56
|
+
};
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import {
|
|
4
4
|
classNames,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
getLayoutFooterClasses,
|
|
6
|
+
injectLayoutGridStyles
|
|
7
7
|
} from "@expcat/tigercat-core";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
var Footer = forwardRef(function Footer2({ className, height, style, as = "footer", children, ...props }, ref) {
|
|
9
|
+
var Footer = forwardRef(function Footer2({ className, height, size = "default", style, as = "footer", children, ...props }, ref) {
|
|
10
10
|
injectLayoutGridStyles();
|
|
11
|
-
const footerClasses = classNames(
|
|
11
|
+
const footerClasses = classNames(getLayoutFooterClasses(size), className);
|
|
12
12
|
const footerStyle = height ? { ...style, height } : style;
|
|
13
13
|
const Tag = as;
|
|
14
14
|
return /* @__PURE__ */ jsx(Tag, { ref, className: footerClasses, style: footerStyle, ...props, children });
|
|
@@ -65,13 +65,18 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
65
65
|
const flatItems = useMemo(() => flattenScrollSpyItems(items), [items]);
|
|
66
66
|
const activeKeyRef = useRef(currentActiveKey);
|
|
67
67
|
activeKeyRef.current = currentActiveKey;
|
|
68
|
-
const
|
|
68
|
+
const hostRef = useRef(null);
|
|
69
|
+
const setHostRef = (node) => {
|
|
70
|
+
hostRef.current = node;
|
|
71
|
+
if (typeof ref === "function") ref(node);
|
|
72
|
+
else if (ref) ref.current = node;
|
|
73
|
+
};
|
|
74
|
+
const resolvedContainer = resolveScrollSpyContainer(getContainer, hostRef.current);
|
|
69
75
|
const containerKey = resolvedContainer === window ? "window" : resolvedContainer;
|
|
70
76
|
const getContainerRef = useRef(getContainer);
|
|
71
77
|
getContainerRef.current = getContainer;
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
);
|
|
78
|
+
const resolveContainer = () => resolveScrollSpyContainer(getContainerRef.current, hostRef.current);
|
|
79
|
+
const scrollLockRef = useRef(createProgrammaticScrollLock(() => resolveContainer()));
|
|
75
80
|
const emitActive = useCallback(
|
|
76
81
|
(item, source) => {
|
|
77
82
|
const nextKeyString = getScrollSpyKeyString(item.key);
|
|
@@ -85,6 +90,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
85
90
|
useEffect(() => {
|
|
86
91
|
return createScrollSpyObserver(items, {
|
|
87
92
|
container: getContainerRef.current,
|
|
93
|
+
from: hostRef.current,
|
|
88
94
|
offsetTop: offset,
|
|
89
95
|
bounds,
|
|
90
96
|
onChange: (item) => {
|
|
@@ -110,7 +116,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
110
116
|
onClick?.(item, event);
|
|
111
117
|
emitActive(item, "click");
|
|
112
118
|
scrollLockRef.current.lock();
|
|
113
|
-
activateScrollSpyClick(item,
|
|
119
|
+
activateScrollSpyClick(item, resolveContainer(), offset);
|
|
114
120
|
},
|
|
115
121
|
[emitActive, offset, onClick]
|
|
116
122
|
);
|
|
@@ -144,7 +150,7 @@ var ScrollSpy = forwardRef(function ScrollSpy2({
|
|
|
144
150
|
"nav",
|
|
145
151
|
{
|
|
146
152
|
...rest,
|
|
147
|
-
ref,
|
|
153
|
+
ref: setHostRef,
|
|
148
154
|
className: classNames(getScrollSpyRootClasses(sticky, className)),
|
|
149
155
|
style: getScrollSpyRootStyle(sticky, offset, style),
|
|
150
156
|
"aria-label": ariaLabel ?? labels.ariaLabel,
|
|
@@ -50,7 +50,9 @@ import {
|
|
|
50
50
|
reconcileSearchOpenKeys,
|
|
51
51
|
resolveMenuCollapsed,
|
|
52
52
|
resolveMenuMode,
|
|
53
|
+
resolveMenuSearchQuery,
|
|
53
54
|
resolveSearchFilter,
|
|
55
|
+
shouldShowMenuSearch,
|
|
54
56
|
warnControlledSearchOpenKeys
|
|
55
57
|
} from "@expcat/tigercat-core";
|
|
56
58
|
|
|
@@ -201,9 +203,14 @@ function useMenuRootState(props) {
|
|
|
201
203
|
},
|
|
202
204
|
[setSearchValue]
|
|
203
205
|
);
|
|
206
|
+
const showSearch = shouldShowMenuSearch(searchable, collapsed);
|
|
204
207
|
const { filtered: filteredItems, expandKeys } = useMemo(
|
|
205
|
-
() => resolveSearchFilter({
|
|
206
|
-
|
|
208
|
+
() => resolveSearchFilter({
|
|
209
|
+
items,
|
|
210
|
+
query: resolveMenuSearchQuery(searchable, collapsed, searchValue),
|
|
211
|
+
filterMode
|
|
212
|
+
}),
|
|
213
|
+
[items, searchValue, filterMode, searchable, collapsed]
|
|
207
214
|
);
|
|
208
215
|
useEffect(() => {
|
|
209
216
|
const current = openKeysRef.current;
|
|
@@ -285,7 +292,7 @@ function useMenuRootState(props) {
|
|
|
285
292
|
resolvedMode,
|
|
286
293
|
mode,
|
|
287
294
|
contextValue,
|
|
288
|
-
searchable,
|
|
295
|
+
searchable: showSearch,
|
|
289
296
|
searchValue,
|
|
290
297
|
searchPlaceholder: searchPlaceholder ?? locale?.common?.searchPlaceholder ?? "Search",
|
|
291
298
|
emptyText: emptyText ?? locale?.common?.emptyText ?? "No data",
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDrag
|
|
3
|
+
} from "./chunk-REJVXLW5.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Drag.tsx
|
|
6
|
+
import React from "react";
|
|
7
|
+
import {
|
|
8
|
+
classNames,
|
|
9
|
+
reorderSequence
|
|
10
|
+
} from "@expcat/tigercat-core";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
function Drag({
|
|
13
|
+
items = [],
|
|
14
|
+
onItemsChange,
|
|
15
|
+
config,
|
|
16
|
+
containerId,
|
|
17
|
+
onDragStart,
|
|
18
|
+
onDragOver,
|
|
19
|
+
onDrop,
|
|
20
|
+
onDragEnd,
|
|
21
|
+
className,
|
|
22
|
+
children,
|
|
23
|
+
renderItem
|
|
24
|
+
}) {
|
|
25
|
+
const itemsRef = React.useRef(items);
|
|
26
|
+
itemsRef.current = items;
|
|
27
|
+
const onItemsChangeRef = React.useRef(onItemsChange);
|
|
28
|
+
onItemsChangeRef.current = onItemsChange;
|
|
29
|
+
const onDropRef = React.useRef(onDrop);
|
|
30
|
+
onDropRef.current = onDrop;
|
|
31
|
+
const drag = useDrag({
|
|
32
|
+
config,
|
|
33
|
+
containerId,
|
|
34
|
+
onDragStart,
|
|
35
|
+
onDragOver,
|
|
36
|
+
onDragEnd,
|
|
37
|
+
onDrop: (event) => {
|
|
38
|
+
onDropRef.current?.(event);
|
|
39
|
+
if (event.fromIndex === event.toIndex) return;
|
|
40
|
+
const next = reorderSequence(itemsRef.current, event.fromIndex, event.toIndex).map(
|
|
41
|
+
(item, index) => ({ ...item, index })
|
|
42
|
+
);
|
|
43
|
+
onItemsChangeRef.current?.(next);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
const render = children ?? renderItem;
|
|
47
|
+
const zoneProps = drag.getDropZoneProps();
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
|
+
"ul",
|
|
50
|
+
{
|
|
51
|
+
...zoneProps,
|
|
52
|
+
className: classNames("m-0 list-none p-0", className),
|
|
53
|
+
"data-tiger-drag": "",
|
|
54
|
+
role: "list",
|
|
55
|
+
children: items.map((item) => {
|
|
56
|
+
const itemProps = drag.getDragItemProps(item);
|
|
57
|
+
const node = render?.(item, {
|
|
58
|
+
dragItemProps: itemProps,
|
|
59
|
+
isDragging: drag.draggedItem?.id === item.id
|
|
60
|
+
});
|
|
61
|
+
return /* @__PURE__ */ jsx(React.Fragment, { children: node ?? /* @__PURE__ */ jsx("li", { ...itemProps, role: "listitem", children: String(item.id) }) }, item.id);
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
Drag.displayName = "Drag";
|
|
67
|
+
var Drag_default = Drag;
|
|
68
|
+
|
|
69
|
+
export {
|
|
70
|
+
Drag,
|
|
71
|
+
Drag_default
|
|
72
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useTigerConfig
|
|
3
|
+
} from "./chunk-RUIFGSVN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/Text.tsx
|
|
6
|
+
import React, { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import {
|
|
8
|
+
classNames,
|
|
9
|
+
copyTextToClipboard,
|
|
10
|
+
createCopyStatusReset,
|
|
11
|
+
getCodeLabels,
|
|
12
|
+
getIconDefinition,
|
|
13
|
+
getTextClasses,
|
|
14
|
+
isTextCopyable,
|
|
15
|
+
mergeTigerLocale,
|
|
16
|
+
resolveLocaleText,
|
|
17
|
+
resolveTextCopyableOptions,
|
|
18
|
+
resolveTextCopyContent,
|
|
19
|
+
resolveTextTag,
|
|
20
|
+
textCopyableBodyClasses,
|
|
21
|
+
textCopyableButtonClasses,
|
|
22
|
+
textCopyableLiveClasses,
|
|
23
|
+
textCopyableRootClasses
|
|
24
|
+
} from "@expcat/tigercat-core";
|
|
25
|
+
import { jsx } from "react/jsx-runtime";
|
|
26
|
+
var copyIcon = getIconDefinition("copy");
|
|
27
|
+
function CopyGlyph() {
|
|
28
|
+
if (!copyIcon) return null;
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
33
|
+
viewBox: copyIcon.viewBox,
|
|
34
|
+
fill: "none",
|
|
35
|
+
stroke: "currentColor",
|
|
36
|
+
strokeWidth: "1.5",
|
|
37
|
+
strokeLinecap: "round",
|
|
38
|
+
strokeLinejoin: "round",
|
|
39
|
+
className: "h-3.5 w-3.5",
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
children: copyIcon.paths.map((d, i) => /* @__PURE__ */ jsx("path", { d }, i))
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
var Text = forwardRef(function Text2({
|
|
46
|
+
tag = "p",
|
|
47
|
+
size,
|
|
48
|
+
weight,
|
|
49
|
+
align,
|
|
50
|
+
color,
|
|
51
|
+
truncate,
|
|
52
|
+
italic,
|
|
53
|
+
underline,
|
|
54
|
+
lineThrough,
|
|
55
|
+
copyable,
|
|
56
|
+
locale,
|
|
57
|
+
children,
|
|
58
|
+
className,
|
|
59
|
+
onCopy,
|
|
60
|
+
...props
|
|
61
|
+
}, ref) {
|
|
62
|
+
const resolvedTag = resolveTextTag(tag);
|
|
63
|
+
const copyEnabled = isTextCopyable(copyable);
|
|
64
|
+
const copyOptions = resolveTextCopyableOptions(copyable);
|
|
65
|
+
const textClasses = classNames(
|
|
66
|
+
getTextClasses({
|
|
67
|
+
size,
|
|
68
|
+
weight,
|
|
69
|
+
align,
|
|
70
|
+
color,
|
|
71
|
+
truncate,
|
|
72
|
+
italic,
|
|
73
|
+
underline,
|
|
74
|
+
lineThrough,
|
|
75
|
+
copyable
|
|
76
|
+
}),
|
|
77
|
+
!copyEnabled && className
|
|
78
|
+
);
|
|
79
|
+
const config = useTigerConfig();
|
|
80
|
+
const mergedLocale = useMemo(
|
|
81
|
+
() => mergeTigerLocale(config.locale, locale),
|
|
82
|
+
[config.locale, locale]
|
|
83
|
+
);
|
|
84
|
+
const labels = useMemo(() => getCodeLabels(mergedLocale), [mergedLocale]);
|
|
85
|
+
const idleLabel = resolveLocaleText(labels.copyLabel, copyOptions?.tooltip);
|
|
86
|
+
const [copyStatus, setCopyStatus] = useState("idle");
|
|
87
|
+
const resetRef = useRef(null);
|
|
88
|
+
if (resetRef.current == null) {
|
|
89
|
+
resetRef.current = createCopyStatusReset(setCopyStatus);
|
|
90
|
+
}
|
|
91
|
+
useEffect(() => {
|
|
92
|
+
const machine = resetRef.current;
|
|
93
|
+
return () => machine?.dispose();
|
|
94
|
+
}, []);
|
|
95
|
+
const bodyRef = useRef(null);
|
|
96
|
+
const buttonLabel = copyStatus === "failed" ? labels.copyFailedLabel : copyStatus === "copied" ? labels.copiedLabel : idleLabel;
|
|
97
|
+
const liveText = copyStatus === "idle" ? "" : buttonLabel;
|
|
98
|
+
const handleCopy = async () => {
|
|
99
|
+
if (!copyOptions) return;
|
|
100
|
+
const fallback = bodyRef.current?.textContent ?? "";
|
|
101
|
+
const text = resolveTextCopyContent(copyOptions, fallback);
|
|
102
|
+
const ok = await copyTextToClipboard(text);
|
|
103
|
+
if (ok) {
|
|
104
|
+
resetRef.current?.schedule("copied");
|
|
105
|
+
copyOptions.onCopy?.(text);
|
|
106
|
+
onCopy?.(text);
|
|
107
|
+
} else {
|
|
108
|
+
resetRef.current?.schedule("failed");
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
if (!copyEnabled) {
|
|
112
|
+
return React.createElement(resolvedTag, { ...props, ref, className: textClasses }, children);
|
|
113
|
+
}
|
|
114
|
+
return React.createElement(
|
|
115
|
+
resolvedTag,
|
|
116
|
+
{ ...props, ref, className: classNames(textCopyableRootClasses, className) },
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
"span",
|
|
119
|
+
{
|
|
120
|
+
ref: bodyRef,
|
|
121
|
+
className: classNames(textCopyableBodyClasses, truncate && "truncate", textClasses),
|
|
122
|
+
children
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
type: "button",
|
|
129
|
+
className: textCopyableButtonClasses,
|
|
130
|
+
"aria-label": buttonLabel,
|
|
131
|
+
title: buttonLabel,
|
|
132
|
+
onClick: () => {
|
|
133
|
+
void handleCopy();
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ jsx(CopyGlyph, {})
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ jsx("span", { className: textCopyableLiveClasses, "aria-live": "polite", children: liveText })
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
Text.displayName = "Text";
|
|
142
|
+
|
|
143
|
+
export {
|
|
144
|
+
Text
|
|
145
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFullscreen
|
|
3
|
+
} from "./chunk-2MV3F7WP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useTigerConfig
|
|
6
|
+
} from "./chunk-RUIFGSVN.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/FullscreenButton.tsx
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import {
|
|
11
|
+
classNames,
|
|
12
|
+
fullscreenButtonClasses,
|
|
13
|
+
getFullscreenLabels,
|
|
14
|
+
getIconDefinition,
|
|
15
|
+
mergeTigerLocale
|
|
16
|
+
} from "@expcat/tigercat-core";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
function Glyph({ name }) {
|
|
19
|
+
const definition = getIconDefinition(name);
|
|
20
|
+
if (!definition) return null;
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: definition.viewBox,
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "1.5",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
className: "h-5 w-5",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: definition.paths.map((d, i) => /* @__PURE__ */ jsx("path", { d }, i))
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
var FullscreenButton = forwardRef(
|
|
38
|
+
function FullscreenButton2({ target, locale, labels, className, onChange, onError, ...props }, ref) {
|
|
39
|
+
const config = useTigerConfig();
|
|
40
|
+
const labelSet = getFullscreenLabels(mergeTigerLocale(config.locale, locale), labels);
|
|
41
|
+
const fullscreen = useFullscreen({ target, onChange, onError });
|
|
42
|
+
const label = fullscreen.isFullscreen ? labelSet.exitAriaLabel : labelSet.enterAriaLabel;
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
...props,
|
|
47
|
+
ref,
|
|
48
|
+
type: "button",
|
|
49
|
+
className: classNames(fullscreenButtonClasses, className),
|
|
50
|
+
"aria-label": label,
|
|
51
|
+
"aria-pressed": fullscreen.isFullscreen,
|
|
52
|
+
disabled: !fullscreen.supported,
|
|
53
|
+
onClick: () => {
|
|
54
|
+
void fullscreen.toggle();
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(Glyph, { name: fullscreen.isFullscreen ? "fullscreen-exit" : "fullscreen" })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
FullscreenButton.displayName = "FullscreenButton";
|
|
62
|
+
var FullscreenButton_default = FullscreenButton;
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
FullscreenButton,
|
|
66
|
+
FullscreenButton_default
|
|
67
|
+
};
|
|
@@ -122,9 +122,8 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
122
122
|
getCurrentAnchorRef.current = getCurrentAnchor;
|
|
123
123
|
const onChangeRef = useRef(onChange);
|
|
124
124
|
onChangeRef.current = onChange;
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
);
|
|
125
|
+
const resolveContainer = () => resolveAnchorScrollContainer(getContainerRef.current, anchorRef.current);
|
|
126
|
+
const scrollLockRef = useRef(createProgrammaticScrollLock(() => resolveContainer()));
|
|
128
127
|
const config = useTigerConfig();
|
|
129
128
|
const mergedLocale = useMemo(
|
|
130
129
|
() => mergeTigerLocale(config.locale, locale),
|
|
@@ -158,7 +157,7 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
158
157
|
}, []);
|
|
159
158
|
const scrollTo = useCallback(
|
|
160
159
|
(href) => {
|
|
161
|
-
const container =
|
|
160
|
+
const container = resolveContainer();
|
|
162
161
|
scrollToAnchor(href, container, scrollOffset);
|
|
163
162
|
},
|
|
164
163
|
[scrollOffset]
|
|
@@ -182,10 +181,10 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
182
181
|
},
|
|
183
182
|
[applyActive, onClick, scrollTo]
|
|
184
183
|
);
|
|
185
|
-
const resolved = resolveScrollRoot(getContainer);
|
|
184
|
+
const resolved = resolveScrollRoot(getContainer, { from: anchorRef.current });
|
|
186
185
|
const resolvedKey = resolved.isWindow ? "window" : resolved.target;
|
|
187
186
|
useEffect(() => {
|
|
188
|
-
const container =
|
|
187
|
+
const container = resolveContainer();
|
|
189
188
|
const root = container === window ? null : container;
|
|
190
189
|
const stop = createAnchorObserver(links, {
|
|
191
190
|
offsetTop: scrollOffset,
|
|
@@ -54,7 +54,13 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
54
54
|
[config.locale, locale]
|
|
55
55
|
);
|
|
56
56
|
const labelSet = getBackTopLabels(mergedLocale, labels);
|
|
57
|
-
const
|
|
57
|
+
const hostRef = useRef(null);
|
|
58
|
+
const setHostRef = (node) => {
|
|
59
|
+
hostRef.current = node;
|
|
60
|
+
if (typeof ref === "function") ref(node);
|
|
61
|
+
else if (ref) ref.current = node;
|
|
62
|
+
};
|
|
63
|
+
const resolved = resolveScrollRoot(target, { from: hostRef.current });
|
|
58
64
|
const resolvedKey = resolved.isWindow ? "window" : resolved.target;
|
|
59
65
|
const visibilityHeightRef = useRef(visibilityHeight);
|
|
60
66
|
visibilityHeightRef.current = visibilityHeight;
|
|
@@ -62,7 +68,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
62
68
|
void 0
|
|
63
69
|
);
|
|
64
70
|
useEffect(() => {
|
|
65
|
-
const root = resolveScrollRoot(target);
|
|
71
|
+
const root = resolveScrollRoot(target, { from: hostRef.current });
|
|
66
72
|
const eventTarget = getScrollRootEventTarget(root);
|
|
67
73
|
const scrollNode = root.target;
|
|
68
74
|
if (!eventTarget || !scrollNode) return void 0;
|
|
@@ -85,7 +91,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
85
91
|
}, [visibilityHeight]);
|
|
86
92
|
const handleClick = useCallback(
|
|
87
93
|
(event) => {
|
|
88
|
-
const root = resolveScrollRoot(target);
|
|
94
|
+
const root = resolveScrollRoot(target, { from: hostRef.current });
|
|
89
95
|
if (root.target) scrollToTop(root.target, duration);
|
|
90
96
|
onClick?.(event);
|
|
91
97
|
},
|
|
@@ -108,7 +114,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
108
114
|
"button",
|
|
109
115
|
{
|
|
110
116
|
...props,
|
|
111
|
-
ref,
|
|
117
|
+
ref: setHostRef,
|
|
112
118
|
type: "button",
|
|
113
119
|
className: buttonClasses,
|
|
114
120
|
style: buttonStyle,
|
|
@@ -13,12 +13,15 @@ import {
|
|
|
13
13
|
getCodeBlockCopyButtonClasses,
|
|
14
14
|
getCodeLabels,
|
|
15
15
|
mergeTigerLocale,
|
|
16
|
+
renderCodeHighlightHtml,
|
|
16
17
|
resolveLocaleText
|
|
17
18
|
} from "@expcat/tigercat-core";
|
|
18
19
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
var Code = forwardRef(function Code2({
|
|
20
21
|
code,
|
|
21
22
|
copyable = true,
|
|
23
|
+
language,
|
|
24
|
+
highlighter,
|
|
22
25
|
copyLabel,
|
|
23
26
|
copiedLabel,
|
|
24
27
|
copyFailedLabel,
|
|
@@ -64,7 +67,10 @@ var Code = forwardRef(function Code2({
|
|
|
64
67
|
const buttonLabel = copyStatus === "failed" ? resolvedCopyFailedLabel : copyStatus === "copied" ? resolvedCopiedLabel : resolvedCopyLabel;
|
|
65
68
|
const liveText = copyStatus === "idle" ? "" : buttonLabel;
|
|
66
69
|
return /* @__PURE__ */ jsxs("div", { ref, className: containerClasses, ...props, children: [
|
|
67
|
-
/* @__PURE__ */ jsx("pre", { className: codeBlockPreClasses, children:
|
|
70
|
+
/* @__PURE__ */ jsx("pre", { className: codeBlockPreClasses, children: (() => {
|
|
71
|
+
const highlighted = renderCodeHighlightHtml(code, language, highlighter);
|
|
72
|
+
return highlighted == null ? /* @__PURE__ */ jsx("code", { className: "block", children: code }) : /* @__PURE__ */ jsx("code", { className: "block", dangerouslySetInnerHTML: { __html: highlighted } });
|
|
73
|
+
})() }),
|
|
68
74
|
copyable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
75
|
/* @__PURE__ */ jsx("button", { type: "button", className: copyButtonClasses, onClick: handleCopy, children: buttonLabel }),
|
|
70
76
|
/* @__PURE__ */ jsx("span", { className: codeBlockCopyStatusLiveClasses, "aria-live": "polite", children: liveText })
|
|
@@ -9,6 +9,10 @@ import {
|
|
|
9
9
|
import { forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
10
10
|
import { classNames } from "@expcat/tigercat-core";
|
|
11
11
|
import {
|
|
12
|
+
appendCalendarEventCountLabel,
|
|
13
|
+
buildCalendarDateCellExtra,
|
|
14
|
+
calendarDateCellDotClasses,
|
|
15
|
+
calendarDateCellExtraClasses,
|
|
12
16
|
calendarGridClasses,
|
|
13
17
|
calendarHeaderClasses,
|
|
14
18
|
calendarNavButtonClasses,
|
|
@@ -19,6 +23,7 @@ import {
|
|
|
19
23
|
followCalendarValue,
|
|
20
24
|
formatCalendarDayLabel,
|
|
21
25
|
formatCalendarDayNumber,
|
|
26
|
+
getCalendarEventDotStyle,
|
|
22
27
|
formatMonthYear,
|
|
23
28
|
getCalendarContainerClasses,
|
|
24
29
|
getCalendarDayClasses,
|
|
@@ -61,6 +66,8 @@ function splitCalendarDomProps(props) {
|
|
|
61
66
|
now: _now,
|
|
62
67
|
rangeValue: _rangeValue,
|
|
63
68
|
locale: _locale,
|
|
69
|
+
events: _events,
|
|
70
|
+
dateCellRender: _dateCellRender,
|
|
64
71
|
onChange: _onChange,
|
|
65
72
|
onPanelChange: _onPanelChange,
|
|
66
73
|
className: _className,
|
|
@@ -80,6 +87,8 @@ var Calendar = forwardRef(function Calendar2(props, ref) {
|
|
|
80
87
|
now: nowProp,
|
|
81
88
|
rangeValue,
|
|
82
89
|
locale,
|
|
90
|
+
events,
|
|
91
|
+
dateCellRender,
|
|
83
92
|
onChange,
|
|
84
93
|
onPanelChange,
|
|
85
94
|
className
|
|
@@ -332,13 +341,27 @@ var Calendar = forwardRef(function Calendar2(props, ref) {
|
|
|
332
341
|
);
|
|
333
342
|
const isTodayDate = today ? isSameDay(date, today) : false;
|
|
334
343
|
const isDisabled = isCalendarDateDisabled(date, disabledDate);
|
|
335
|
-
|
|
344
|
+
const extra = buildCalendarDateCellExtra({
|
|
345
|
+
date,
|
|
346
|
+
events,
|
|
347
|
+
inCurrentMonth: isCurrentMonth,
|
|
348
|
+
today: isTodayDate,
|
|
349
|
+
selected: isSelected,
|
|
350
|
+
disabled: isDisabled
|
|
351
|
+
});
|
|
352
|
+
const customCell = dateCellRender?.(date, extra);
|
|
353
|
+
const hasExtra = Boolean(customCell) || extra.events.length > 0;
|
|
354
|
+
return /* @__PURE__ */ jsxs(
|
|
336
355
|
"button",
|
|
337
356
|
{
|
|
338
357
|
type: "button",
|
|
339
358
|
role: "gridcell",
|
|
340
359
|
"data-date": iso,
|
|
341
|
-
"aria-label":
|
|
360
|
+
"aria-label": appendCalendarEventCountLabel(
|
|
361
|
+
formatCalendarDayLabel(date, localeCode),
|
|
362
|
+
extra.events.length,
|
|
363
|
+
labels.eventCountText
|
|
364
|
+
),
|
|
342
365
|
"aria-selected": isSelected || isRangeStart || isRangeEnd,
|
|
343
366
|
"aria-current": isTodayDate ? "date" : void 0,
|
|
344
367
|
disabled: isDisabled,
|
|
@@ -351,11 +374,22 @@ var Calendar = forwardRef(function Calendar2(props, ref) {
|
|
|
351
374
|
isActive: activeIso === iso,
|
|
352
375
|
isInRange,
|
|
353
376
|
isRangeStart,
|
|
354
|
-
isRangeEnd
|
|
377
|
+
isRangeEnd,
|
|
378
|
+
hasExtra
|
|
355
379
|
}),
|
|
356
380
|
onClick: () => selectDay(date),
|
|
357
381
|
onFocus: () => setActiveIso(iso),
|
|
358
|
-
children:
|
|
382
|
+
children: [
|
|
383
|
+
formatCalendarDayNumber(date, localeCode),
|
|
384
|
+
customCell ?? (extra.events.length > 0 ? /* @__PURE__ */ jsx("span", { className: calendarDateCellExtraClasses, "aria-hidden": "true", children: extra.events.map((event, index) => /* @__PURE__ */ jsx(
|
|
385
|
+
"span",
|
|
386
|
+
{
|
|
387
|
+
className: calendarDateCellDotClasses,
|
|
388
|
+
style: getCalendarEventDotStyle(event.color)
|
|
389
|
+
},
|
|
390
|
+
event.key ?? `${extra.iso}-${index}`
|
|
391
|
+
)) }) : null)
|
|
392
|
+
]
|
|
359
393
|
},
|
|
360
394
|
iso
|
|
361
395
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ActivityFeed,
|
|
3
3
|
ActivityFeed_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-6T5AEQJV.mjs";
|
|
5
5
|
import "../chunk-4DFN6RZ4.mjs";
|
|
6
6
|
import "../chunk-WQMOFDAY.mjs";
|
|
7
7
|
import "../chunk-VW6RNQK4.mjs";
|
|
8
8
|
import "../chunk-FVA5VKN2.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-FZQUUTWN.mjs";
|
|
10
10
|
import "../chunk-WCIUNNIN.mjs";
|
|
11
11
|
import "../chunk-3KBFOO2E.mjs";
|
|
12
12
|
import "../chunk-IELUUOM4.mjs";
|
package/dist/components/Code.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CommentThread,
|
|
3
3
|
CommentThread_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NMRCBGFP.mjs";
|
|
5
5
|
import "../chunk-ZG6WST55.mjs";
|
|
6
6
|
import "../chunk-FVA5VKN2.mjs";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-FZQUUTWN.mjs";
|
|
8
8
|
import "../chunk-3KBFOO2E.mjs";
|
|
9
9
|
import "../chunk-IELUUOM4.mjs";
|
|
10
10
|
import "../chunk-WFLXJOFU.mjs";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
} from "../chunk-IXMQQ6PV.mjs";
|
|
5
5
|
import "../chunk-FTLA6FRU.mjs";
|
|
6
6
|
import "../chunk-A2PQJEII.mjs";
|
|
7
|
+
import "../chunk-CQGDJU2H.mjs";
|
|
7
8
|
import "../chunk-4KZETZUH.mjs";
|
|
8
9
|
import "../chunk-MADQ6KHD.mjs";
|
|
9
|
-
import "../chunk-CQGDJU2H.mjs";
|
|
10
10
|
import "../chunk-XAYOEQGB.mjs";
|
|
11
11
|
import "../chunk-S37KEELR.mjs";
|
|
12
12
|
import "../chunk-WWZZRB7H.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { DragItem, DragProps as DragProps$1 } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface DragRenderContext {
|
|
5
|
+
dragItemProps: Record<string, unknown>;
|
|
6
|
+
isDragging: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface DragProps<T extends DragItem = DragItem> extends DragProps$1<T> {
|
|
9
|
+
children?: (item: T, context: DragRenderContext) => React__default.ReactNode;
|
|
10
|
+
renderItem?: (item: T, context: DragRenderContext) => React__default.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function Drag<T extends DragItem = DragItem>({ items, onItemsChange, config, containerId, onDragStart, onDragOver, onDrop, onDragEnd, className, children, renderItem }: DragProps<T>): React__default.JSX.Element;
|
|
13
|
+
declare namespace Drag {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { Drag, type DragProps, type DragRenderContext, Drag as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { FullscreenProps } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface FullscreenButtonProps extends FullscreenProps, Omit<React__default.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'onError'> {
|
|
5
|
+
}
|
|
6
|
+
declare const FullscreenButton: React__default.ForwardRefExoticComponent<FullscreenButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
|
|
8
|
+
export { FullscreenButton, type FullscreenButtonProps, FullscreenButton as default };
|
package/dist/components/Menu.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NotificationCenter,
|
|
3
3
|
NotificationCenter_default
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-MMDVFCCL.mjs";
|
|
5
5
|
import "../chunk-4BJCH6FI.mjs";
|
|
6
6
|
import "../chunk-YDIEWFBM.mjs";
|
|
7
7
|
import "../chunk-REJVXLW5.mjs";
|
|
@@ -9,7 +9,7 @@ import "../chunk-XAYOEQGB.mjs";
|
|
|
9
9
|
import "../chunk-NTCVAVYZ.mjs";
|
|
10
10
|
import "../chunk-RLUBTLOT.mjs";
|
|
11
11
|
import "../chunk-VW6RNQK4.mjs";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-FZQUUTWN.mjs";
|
|
13
13
|
import "../chunk-WCIUNNIN.mjs";
|
|
14
14
|
import "../chunk-WFLXJOFU.mjs";
|
|
15
15
|
import "../chunk-G5NPND2T.mjs";
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import { TextProps as TextProps$1 } from '@expcat/tigercat-core';
|
|
2
|
+
import { TextProps as TextProps$1, TigerLocale } from '@expcat/tigercat-core';
|
|
3
3
|
|
|
4
4
|
type TextProps = TextProps$1 & Omit<React__default.HTMLAttributes<HTMLElement>, 'color' | 'children'> & Pick<React__default.LabelHTMLAttributes<HTMLLabelElement>, 'htmlFor'> & {
|
|
5
5
|
children?: React__default.ReactNode;
|
|
6
|
+
locale?: Partial<TigerLocale>;
|
|
7
|
+
onCopy?: (text: string) => void;
|
|
6
8
|
};
|
|
7
9
|
declare const Text: React__default.ForwardRefExoticComponent<TextProps$1 & Omit<React__default.HTMLAttributes<HTMLElement>, "children" | "color"> & Pick<React__default.LabelHTMLAttributes<HTMLLabelElement>, "htmlFor"> & {
|
|
8
10
|
children?: React__default.ReactNode;
|
|
11
|
+
locale?: Partial<TigerLocale>;
|
|
12
|
+
onCopy?: (text: string) => void;
|
|
9
13
|
} & React__default.RefAttributes<HTMLElement>>;
|
|
10
14
|
|
|
11
15
|
export { Text, type TextProps };
|
package/dist/components/Text.mjs
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseFullscreenOptions } from '@expcat/tigercat-core';
|
|
2
|
+
export { UseFullscreenOptions } from '@expcat/tigercat-core';
|
|
3
|
+
|
|
4
|
+
interface UseFullscreenReturn {
|
|
5
|
+
isFullscreen: boolean;
|
|
6
|
+
supported: boolean;
|
|
7
|
+
enter: () => Promise<void>;
|
|
8
|
+
exit: () => Promise<void>;
|
|
9
|
+
toggle: () => Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
declare function useFullscreen(options?: UseFullscreenOptions): UseFullscreenReturn;
|
|
12
|
+
|
|
13
|
+
export { type UseFullscreenReturn, useFullscreen };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from '@expcat/tigercat-core';
|
|
2
|
-
export { AutoCompleteOption, CascaderModelValue, CascaderOption, CascaderValue, ChatWindowHandle, ColorFormat, FormHandle, FormSubmitEvent, LoadingBarOptions, LoadingBarProps, MasonryInstance, MessageOptions, MessageProps, NotificationOptions, NotificationProps, PrintLayoutInstance, ScrollAreaInstance, SelectOption, SelectOptions, TigerConfig, TreeSelectValue, UseDragOptions, VirtualListHandle, VirtualTableHandle, WizardStep } from '@expcat/tigercat-core';
|
|
2
|
+
export { AutoCompleteOption, CascaderModelValue, CascaderOption, CascaderValue, ChatWindowHandle, ColorFormat, FormHandle, FormSubmitEvent, LoadingBarOptions, LoadingBarProps, MasonryInstance, MessageOptions, MessageProps, NotificationOptions, NotificationProps, PrintLayoutInstance, ScrollAreaInstance, SelectOption, SelectOptions, TigerConfig, TreeSelectValue, UseDragOptions, UseFullscreenOptions, VirtualListHandle, VirtualTableHandle, WizardStep } from '@expcat/tigercat-core';
|
|
3
3
|
export { ConfigProvider, ConfigProviderProps, useTigerConfig } from './components/ConfigProvider.mjs';
|
|
4
4
|
export { Button, ButtonProps } from './components/Button.mjs';
|
|
5
5
|
export { ButtonGroup, ButtonGroupProps } from './components/ButtonGroup.mjs';
|
|
@@ -142,6 +142,9 @@ export { Affix, AffixProps } from './components/Affix.mjs';
|
|
|
142
142
|
export { UseChartInteractionOptions, UseChartInteractionReturn, useChartInteraction } from './hooks/useChartInteraction.mjs';
|
|
143
143
|
export { ResponsiveChartLayout, useResponsiveChartSize } from './hooks/useResponsiveChartSize.mjs';
|
|
144
144
|
export { UseDragReturn, useDrag } from './hooks/useDrag.mjs';
|
|
145
|
+
export { UseFullscreenReturn, useFullscreen } from './hooks/useFullscreen.mjs';
|
|
146
|
+
export { FullscreenButton as Fullscreen, FullscreenButton, FullscreenButtonProps } from './components/FullscreenButton.mjs';
|
|
147
|
+
export { Drag, DragProps, DragRenderContext } from './components/Drag.mjs';
|
|
145
148
|
export { SetControlledState, UseControlledStateOptions, useControlledState } from './hooks/useControlledState.mjs';
|
|
146
149
|
export { Splitter, SplitterProps, SplitterResizeEvent } from './components/Splitter.mjs';
|
|
147
150
|
export { Resizable, ResizableProps } from './components/Resizable.mjs';
|
|
@@ -169,6 +172,6 @@ import 'react';
|
|
|
169
172
|
* React components for Tigercat UI library
|
|
170
173
|
*/
|
|
171
174
|
|
|
172
|
-
declare const version = "2.
|
|
175
|
+
declare const version = "2.2.0";
|
|
173
176
|
|
|
174
177
|
export { version };
|
package/dist/index.mjs
CHANGED
|
@@ -323,6 +323,7 @@ export {
|
|
|
323
323
|
anchorNestedListClasses,
|
|
324
324
|
animationDelayClasses,
|
|
325
325
|
announceToScreenReader,
|
|
326
|
+
appendCalendarEventCountLabel,
|
|
326
327
|
appendDefaultTaskBoardCard,
|
|
327
328
|
appendDefaultTaskBoardColumn,
|
|
328
329
|
appendSignaturePoint,
|
|
@@ -417,6 +418,7 @@ export {
|
|
|
417
418
|
buildAffixPlaceholderStyle,
|
|
418
419
|
buildAffixRootMargin,
|
|
419
420
|
buildAffixStyle,
|
|
421
|
+
buildCalendarDateCellExtra,
|
|
420
422
|
buildChartLegendItems,
|
|
421
423
|
buildChartSeriesKeys,
|
|
422
424
|
buildChatMessageStatusInfo,
|
|
@@ -455,6 +457,8 @@ export {
|
|
|
455
457
|
calculateTransform,
|
|
456
458
|
calculateVirtualColumnRange,
|
|
457
459
|
calculateVirtualRange,
|
|
460
|
+
calendarDateCellDotClasses,
|
|
461
|
+
calendarDateCellExtraClasses,
|
|
458
462
|
calendarGridClasses,
|
|
459
463
|
calendarHeaderClasses,
|
|
460
464
|
calendarNavButtonClasses,
|
|
@@ -594,6 +598,7 @@ export {
|
|
|
594
598
|
clearChartAxisTickCache,
|
|
595
599
|
clearFieldErrors,
|
|
596
600
|
clearPieArcCache,
|
|
601
|
+
clearRegisteredIcons,
|
|
597
602
|
clearSelectValue,
|
|
598
603
|
clearSignatureStrokes,
|
|
599
604
|
clearTextareaAutoResize,
|
|
@@ -954,6 +959,7 @@ export {
|
|
|
954
959
|
evaluateFormConditions,
|
|
955
960
|
exclamationCircleIcon,
|
|
956
961
|
exclusiveRangeToInclusive,
|
|
962
|
+
exitElementFullscreen,
|
|
957
963
|
expandChevronIcon16PathD,
|
|
958
964
|
exportChartPng,
|
|
959
965
|
exportSignatureDataUrl,
|
|
@@ -1011,6 +1017,7 @@ export {
|
|
|
1011
1017
|
findHotkeyMatch,
|
|
1012
1018
|
findLastEnabledIndex,
|
|
1013
1019
|
findMarkdownHotkeyMatch,
|
|
1020
|
+
findNearestOverflowAncestor,
|
|
1014
1021
|
findNearestPointIndex,
|
|
1015
1022
|
findNearestSeriesPoint,
|
|
1016
1023
|
findNextEnabledIndex,
|
|
@@ -1059,6 +1066,7 @@ export {
|
|
|
1059
1066
|
formatBytes,
|
|
1060
1067
|
formatCalendarDayLabel,
|
|
1061
1068
|
formatCalendarDayNumber,
|
|
1069
|
+
formatCalendarEventCountLabel,
|
|
1062
1070
|
formatChartTemplate,
|
|
1063
1071
|
formatChatTime,
|
|
1064
1072
|
formatColorPickerSelectPreset,
|
|
@@ -1110,6 +1118,7 @@ export {
|
|
|
1110
1118
|
formatTimePickerDisplay,
|
|
1111
1119
|
formatTreeSelectNodeLabel,
|
|
1112
1120
|
freezeTableColumnWidths,
|
|
1121
|
+
fullscreenButtonClasses,
|
|
1113
1122
|
fullscreenExitIcon,
|
|
1114
1123
|
fullscreenIcon,
|
|
1115
1124
|
funnelSegmentTransitionClasses,
|
|
@@ -1199,6 +1208,8 @@ export {
|
|
|
1199
1208
|
getCalendarDayClasses,
|
|
1200
1209
|
getCalendarDayKeyAction,
|
|
1201
1210
|
getCalendarDays,
|
|
1211
|
+
getCalendarEventDotStyle,
|
|
1212
|
+
getCalendarEventsForDate,
|
|
1202
1213
|
getCalendarLabels,
|
|
1203
1214
|
getCalendarMonthClasses,
|
|
1204
1215
|
getCalendarMonthDaysCacheSize,
|
|
@@ -1434,6 +1445,8 @@ export {
|
|
|
1434
1445
|
getFormWizardHeaderClasses,
|
|
1435
1446
|
getFormWizardLabels,
|
|
1436
1447
|
getFormWizardWrapperClasses,
|
|
1448
|
+
getFullscreenElement,
|
|
1449
|
+
getFullscreenLabels,
|
|
1437
1450
|
getFunnelGradientPrefix,
|
|
1438
1451
|
getGanttDependencyPath,
|
|
1439
1452
|
getGanttTaskAriaLabel,
|
|
@@ -1522,6 +1535,7 @@ export {
|
|
|
1522
1535
|
getKbdVariantClasses,
|
|
1523
1536
|
getLastEnabledFileIndex,
|
|
1524
1537
|
getLayoutContentClasses,
|
|
1538
|
+
getLayoutFooterClasses,
|
|
1525
1539
|
getLayoutHeaderClasses,
|
|
1526
1540
|
getLayoutRootClasses,
|
|
1527
1541
|
getLayoutSidebarClasses,
|
|
@@ -2195,6 +2209,7 @@ export {
|
|
|
2195
2209
|
isDividerHorizontal,
|
|
2196
2210
|
isDragEnabled,
|
|
2197
2211
|
isDrawerSwipeCloseGesture,
|
|
2212
|
+
isElementFullscreen,
|
|
2198
2213
|
isEnterKey,
|
|
2199
2214
|
isEscapeKey,
|
|
2200
2215
|
isEventOutside,
|
|
@@ -2203,6 +2218,7 @@ export {
|
|
|
2203
2218
|
isFocusInsideNavigationMenu,
|
|
2204
2219
|
isFormItemGroupControl,
|
|
2205
2220
|
isFormValidationCancelled,
|
|
2221
|
+
isFullscreenSupported,
|
|
2206
2222
|
isHTMLElement,
|
|
2207
2223
|
isHourOptionDisabled,
|
|
2208
2224
|
isHttpResultStatus,
|
|
@@ -2279,6 +2295,7 @@ export {
|
|
|
2279
2295
|
isTabPaneType,
|
|
2280
2296
|
isTableCellEditable,
|
|
2281
2297
|
isTablet,
|
|
2298
|
+
isTextCopyable,
|
|
2282
2299
|
isTimeInRange,
|
|
2283
2300
|
isTimePickerDesktopLayout,
|
|
2284
2301
|
isTimePickerRangeComplete,
|
|
@@ -2313,6 +2330,7 @@ export {
|
|
|
2313
2330
|
layoutBarRects,
|
|
2314
2331
|
layoutContentClasses,
|
|
2315
2332
|
layoutFooterClasses,
|
|
2333
|
+
layoutFooterCompactClasses,
|
|
2316
2334
|
layoutFunnel,
|
|
2317
2335
|
layoutGantt,
|
|
2318
2336
|
layoutGauge,
|
|
@@ -2752,13 +2770,17 @@ export {
|
|
|
2752
2770
|
redoFormHistory,
|
|
2753
2771
|
registerBuiltInThemes,
|
|
2754
2772
|
registerEscapeDismiss,
|
|
2773
|
+
registerIcon,
|
|
2774
|
+
registerIcons,
|
|
2755
2775
|
registerImageGroupItem,
|
|
2776
|
+
registeredIconNames,
|
|
2756
2777
|
remapCropRect,
|
|
2757
2778
|
rememberCascaderLabel,
|
|
2758
2779
|
rememberSelectOptions,
|
|
2759
2780
|
rememberTreeSelectLabel,
|
|
2760
2781
|
removeCssVarsCached,
|
|
2761
2782
|
removeTagAt,
|
|
2783
|
+
renderCodeHighlightHtml,
|
|
2762
2784
|
renderMarkdownInline,
|
|
2763
2785
|
renderMarkdownToHtml,
|
|
2764
2786
|
renderTokenHtml,
|
|
@@ -2773,6 +2795,7 @@ export {
|
|
|
2773
2795
|
reorderTableRowsByKey,
|
|
2774
2796
|
replaceAnchorHash,
|
|
2775
2797
|
replaceKeys,
|
|
2798
|
+
requestElementFullscreen,
|
|
2776
2799
|
resetAreaGradientCounter,
|
|
2777
2800
|
resetAriaIdCounter,
|
|
2778
2801
|
resetBarGradientCounter,
|
|
@@ -2863,6 +2886,7 @@ export {
|
|
|
2863
2886
|
resolveFormConditionState,
|
|
2864
2887
|
resolveFormFieldConditionState,
|
|
2865
2888
|
resolveFormLabelAlign,
|
|
2889
|
+
resolveFullscreenTarget,
|
|
2866
2890
|
resolveGutter,
|
|
2867
2891
|
resolveHeatmapRenderMode,
|
|
2868
2892
|
resolveHighlightCaseSensitive,
|
|
@@ -2923,6 +2947,7 @@ export {
|
|
|
2923
2947
|
resolveMenuCollapsed,
|
|
2924
2948
|
resolveMenuIconKind,
|
|
2925
2949
|
resolveMenuMode,
|
|
2950
|
+
resolveMenuSearchQuery,
|
|
2926
2951
|
resolveMenuTabStopKey,
|
|
2927
2952
|
resolveMessageDuration,
|
|
2928
2953
|
resolveMotionDuration,
|
|
@@ -2983,6 +3008,8 @@ export {
|
|
|
2983
3008
|
resolveTaskBoardView,
|
|
2984
3009
|
resolveTextAlign,
|
|
2985
3010
|
resolveTextColor,
|
|
3011
|
+
resolveTextCopyContent,
|
|
3012
|
+
resolveTextCopyableOptions,
|
|
2986
3013
|
resolveTextSize,
|
|
2987
3014
|
resolveTextTag,
|
|
2988
3015
|
resolveTextWeight,
|
|
@@ -3139,6 +3166,7 @@ export {
|
|
|
3139
3166
|
shouldShowAutoCompleteClear,
|
|
3140
3167
|
shouldShowBackTop,
|
|
3141
3168
|
shouldShowCascaderClear,
|
|
3169
|
+
shouldShowMenuSearch,
|
|
3142
3170
|
shouldShowSelectClear,
|
|
3143
3171
|
shouldShowTreeSelectClear,
|
|
3144
3172
|
shouldSkipNavigationMenuOpenDelay,
|
|
@@ -3263,6 +3291,7 @@ export {
|
|
|
3263
3291
|
submenuExpandIconPopupClasses,
|
|
3264
3292
|
submenuHeightTransitionClasses,
|
|
3265
3293
|
submenuTitleClasses,
|
|
3294
|
+
subscribeFullscreenChange,
|
|
3266
3295
|
subscribeTableCardViewport,
|
|
3267
3296
|
successCircleSolidIcon20PathD,
|
|
3268
3297
|
sunIcon,
|
|
@@ -3347,6 +3376,10 @@ export {
|
|
|
3347
3376
|
terminalIcon,
|
|
3348
3377
|
textAlignClasses,
|
|
3349
3378
|
textColorClasses,
|
|
3379
|
+
textCopyableBodyClasses,
|
|
3380
|
+
textCopyableButtonClasses,
|
|
3381
|
+
textCopyableLiveClasses,
|
|
3382
|
+
textCopyableRootClasses,
|
|
3350
3383
|
textDecorationClasses,
|
|
3351
3384
|
textSizeClasses,
|
|
3352
3385
|
textWeightClasses,
|
|
@@ -3468,6 +3501,7 @@ export {
|
|
|
3468
3501
|
uniqueMenuKeys,
|
|
3469
3502
|
uniqueTreeKeys,
|
|
3470
3503
|
unlockIcon,
|
|
3504
|
+
unregisterIcon,
|
|
3471
3505
|
unregisterImageGroupItem,
|
|
3472
3506
|
updateCronExpressionField,
|
|
3473
3507
|
updateDragOffset,
|
|
@@ -3845,6 +3879,9 @@ export { Affix } from './components/Affix.mjs';
|
|
|
3845
3879
|
export { useChartInteraction } from './hooks/useChartInteraction.mjs';
|
|
3846
3880
|
export { useResponsiveChartSize } from './hooks/useResponsiveChartSize.mjs';
|
|
3847
3881
|
export { useDrag } from './hooks/useDrag.mjs';
|
|
3882
|
+
export { useFullscreen } from './hooks/useFullscreen.mjs';
|
|
3883
|
+
export { FullscreenButton, FullscreenButton as Fullscreen } from './components/FullscreenButton.mjs';
|
|
3884
|
+
export { Drag } from './components/Drag.mjs';
|
|
3848
3885
|
export { useControlledState } from './hooks/useControlledState.mjs';
|
|
3849
3886
|
export { Splitter } from './components/Splitter.mjs';
|
|
3850
3887
|
export { Resizable } from './components/Resizable.mjs';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expcat/tigercat-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "React components for Tigercat UI library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Yizhe Wang",
|
|
@@ -299,6 +299,11 @@
|
|
|
299
299
|
"import": "./dist/components/DonutChart.mjs",
|
|
300
300
|
"default": "./dist/components/DonutChart.mjs"
|
|
301
301
|
},
|
|
302
|
+
"./Drag": {
|
|
303
|
+
"types": "./dist/components/Drag.d.mts",
|
|
304
|
+
"import": "./dist/components/Drag.mjs",
|
|
305
|
+
"default": "./dist/components/Drag.mjs"
|
|
306
|
+
},
|
|
302
307
|
"./Drawer": {
|
|
303
308
|
"types": "./dist/components/Drawer.d.mts",
|
|
304
309
|
"import": "./dist/components/Drawer.mjs",
|
|
@@ -359,6 +364,11 @@
|
|
|
359
364
|
"import": "./dist/components/FormWizard.mjs",
|
|
360
365
|
"default": "./dist/components/FormWizard.mjs"
|
|
361
366
|
},
|
|
367
|
+
"./FullscreenButton": {
|
|
368
|
+
"types": "./dist/components/FullscreenButton.d.mts",
|
|
369
|
+
"import": "./dist/components/FullscreenButton.mjs",
|
|
370
|
+
"default": "./dist/components/FullscreenButton.mjs"
|
|
371
|
+
},
|
|
362
372
|
"./FunnelChart": {
|
|
363
373
|
"types": "./dist/components/FunnelChart.d.mts",
|
|
364
374
|
"import": "./dist/components/FunnelChart.mjs",
|
|
@@ -899,6 +909,11 @@
|
|
|
899
909
|
"import": "./dist/hooks/useDrag.mjs",
|
|
900
910
|
"default": "./dist/hooks/useDrag.mjs"
|
|
901
911
|
},
|
|
912
|
+
"./useFullscreen": {
|
|
913
|
+
"types": "./dist/hooks/useFullscreen.d.mts",
|
|
914
|
+
"import": "./dist/hooks/useFullscreen.mjs",
|
|
915
|
+
"default": "./dist/hooks/useFullscreen.mjs"
|
|
916
|
+
},
|
|
902
917
|
"./useControlledState": {
|
|
903
918
|
"types": "./dist/hooks/useControlledState.d.mts",
|
|
904
919
|
"import": "./dist/hooks/useControlledState.mjs",
|
|
@@ -912,7 +927,7 @@
|
|
|
912
927
|
"access": "public"
|
|
913
928
|
},
|
|
914
929
|
"dependencies": {
|
|
915
|
-
"@expcat/tigercat-core": "2.
|
|
930
|
+
"@expcat/tigercat-core": "2.2.0"
|
|
916
931
|
},
|
|
917
932
|
"devDependencies": {
|
|
918
933
|
"@types/node": "^26.1.1",
|
package/dist/chunk-VDBLI5Y3.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// src/components/Text.tsx
|
|
2
|
-
import React, { forwardRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
classNames,
|
|
5
|
-
getTextClasses,
|
|
6
|
-
resolveTextTag
|
|
7
|
-
} from "@expcat/tigercat-core";
|
|
8
|
-
var Text = forwardRef(function Text2({
|
|
9
|
-
tag = "p",
|
|
10
|
-
size,
|
|
11
|
-
weight,
|
|
12
|
-
align,
|
|
13
|
-
color,
|
|
14
|
-
truncate,
|
|
15
|
-
italic,
|
|
16
|
-
underline,
|
|
17
|
-
lineThrough,
|
|
18
|
-
children,
|
|
19
|
-
className,
|
|
20
|
-
...props
|
|
21
|
-
}, ref) {
|
|
22
|
-
const resolvedTag = resolveTextTag(tag);
|
|
23
|
-
const textClasses = classNames(
|
|
24
|
-
getTextClasses({ size, weight, align, color, truncate, italic, underline, lineThrough }),
|
|
25
|
-
className
|
|
26
|
-
);
|
|
27
|
-
return React.createElement(resolvedTag, { ...props, ref, className: textClasses }, children);
|
|
28
|
-
});
|
|
29
|
-
Text.displayName = "Text";
|
|
30
|
-
|
|
31
|
-
export {
|
|
32
|
-
Text
|
|
33
|
-
};
|