@choice-ui/react 1.5.4 → 1.5.5
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/calendar/dist/index.js +2 -2
- package/dist/components/calendar/src/time-calendar/time-calendar.js +2 -2
- package/dist/components/code-block/dist/index.js +13 -13
- package/dist/components/code-block/src/code-block.js +11 -11
- package/dist/components/code-block/src/hooks/use-line-count.js +3 -3
- package/dist/components/command/src/components/command-group.js +2 -2
- package/dist/components/command/src/components/command-item.js +3 -3
- package/dist/components/command/src/hooks/index.js +2 -2
- package/dist/components/command/src/hooks/use-command-state.js +3 -3
- package/dist/components/command/src/hooks/use-command.js +2 -2
- package/dist/components/command/src/utils/helpers.js +4 -4
- package/dist/components/comments/src/comment-item/comment-item.js +2 -2
- package/dist/components/comments/src/comment-item/components/comment-item-reactions.js +2 -2
- package/dist/components/conditions/src/hooks/use-drag-and-drop.js +3 -3
- package/dist/components/context-input/src/components/copy-button.js +2 -2
- package/dist/components/context-input/src/components/mention.js +2 -2
- package/dist/components/context-input/src/components/slate-editor.js +3 -3
- package/dist/components/context-input/src/context-input.js +5 -5
- package/dist/components/context-menu/src/context-menu.js +6 -6
- package/dist/components/dialog/dist/index.js +2 -2
- package/dist/components/dialog/src/dialog.js +2 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/md-input/src/components/toolbar/toolbar.js +2 -2
- package/dist/components/md-input/src/md-input.js +3 -3
- package/dist/components/menus/dist/index.js +2 -2
- package/dist/components/menus/src/menus.js +2 -2
- package/dist/components/multi-select/dist/index.js +2 -2
- package/dist/components/multi-select/src/utils/extract-options.js +2 -2
- package/dist/components/otp-input/dist/index.d.ts +30 -0
- package/dist/components/otp-input/src/index.d.ts +2 -0
- package/dist/components/otp-input/src/otp-input.d.ts +27 -0
- package/dist/components/otp-input/src/otp-input.js +115 -0
- package/dist/components/otp-input/src/otp-input.module.css +15 -0
- package/dist/components/otp-input/src/otp-input.module.css.js +8 -0
- package/dist/components/otp-input/src/tv.d.ts +121 -0
- package/dist/components/otp-input/src/tv.js +150 -0
- package/dist/components/otp-input/tsup.config.d.ts +2 -0
- package/dist/components/panel/src/components/panel-sortable.js +3 -3
- package/dist/components/rich-input/src/hooks/use-editor-config.js +3 -3
- package/dist/components/rich-input/src/utils/custom-options.js +15 -15
- package/dist/components/select/dist/index.js +2 -2
- package/dist/components/select/src/select.js +2 -2
- package/dist/components/slot/dist/index.d.ts +10 -10
- package/dist/components/slot/dist/index.js +7 -15
- package/dist/components/slot/src/slot.d.ts +12 -12
- package/dist/components/slot/src/slot.js +10 -18
- package/dist/components/textarea/dist/index.js +14 -14
- package/dist/components/textarea/src/components/autosize/hooks.js +5 -5
- package/dist/components/textarea/src/components/autosize/index.js +10 -10
- package/dist/components/tree-list/src/tree-list.js +3 -3
- package/dist/components/virtualized-grid/src/error-boundary.js +2 -2
- package/dist/index.js +2 -0
- package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-otp/dist/index.js +200 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { enUS, zhCN, es, fr, de, ko, ja } from "date-fns/locale";
|
|
5
|
-
import
|
|
5
|
+
import React__default, { forwardRef, memo, useState, useMemo, useEffect, useRef, useCallback } from "react";
|
|
6
6
|
import { useEventCallback } from "usehooks-ts";
|
|
7
7
|
import { isThisYear, isSameDay, endOfWeek, startOfWeek, endOfMonth, startOfMonth, addMonths, isSameYear, isSameMonth, isValid, format, addDays, addWeeks, eachDayOfInterval, getWeek, isWithinInterval, startOfDay, endOfDay, parse, subDays, subWeeks, subMonths, addYears, subYears, startOfYear, getDaysInMonth, isDate, setMinutes, setHours, addMinutes } from "date-fns";
|
|
8
8
|
import { tz } from "@date-fns/tz";
|
|
@@ -3286,7 +3286,7 @@ var TimeCalendar = memo(function TimeCalendar2(props) {
|
|
|
3286
3286
|
const isAmToPmTransition = needsDivider(index);
|
|
3287
3287
|
const isItemSelected = selectedIndex === index;
|
|
3288
3288
|
const isItemActive = !isScrolling && activeIndex === index;
|
|
3289
|
-
return /* @__PURE__ */ jsxs(
|
|
3289
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
3290
3290
|
isAmToPmTransition && /* @__PURE__ */ jsx(Menus.Divider, { "data-testid": "ampm-divider" }),
|
|
3291
3291
|
/* @__PURE__ */ jsx(
|
|
3292
3292
|
Menus.Item,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Check } from "@choiceform/icons-react";
|
|
3
3
|
import { Menus } from "../../../menus/dist/index.js";
|
|
4
|
-
import
|
|
4
|
+
import React__default, { memo, useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
5
5
|
import { useEventCallback } from "usehooks-ts";
|
|
6
6
|
import { generateTimeOptions, normalizeTimeValue, timeStringToDate } from "../utils/time.js";
|
|
7
7
|
import { useMergedValue } from "../../../../shared/hooks/use-merged-value/use-merged-value.js";
|
|
@@ -257,7 +257,7 @@ const TimeCalendar = memo(function TimeCalendar2(props) {
|
|
|
257
257
|
const isAmToPmTransition = needsDivider(index);
|
|
258
258
|
const isItemSelected = selectedIndex === index;
|
|
259
259
|
const isItemActive = !isScrolling && activeIndex === index;
|
|
260
|
-
return /* @__PURE__ */ jsxs(
|
|
260
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
261
261
|
isAmToPmTransition && /* @__PURE__ */ jsx(Menus.Divider, { "data-testid": "ampm-divider" }),
|
|
262
262
|
/* @__PURE__ */ jsx(
|
|
263
263
|
Menus.Item,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { memo, useState, useEffect } from "react";
|
|
2
2
|
import { useStickToBottom } from "use-stick-to-bottom";
|
|
3
3
|
import { codeToHtml } from "shiki";
|
|
4
4
|
import { useEventCallback } from "usehooks-ts";
|
|
@@ -96,9 +96,9 @@ function useLineCount(children) {
|
|
|
96
96
|
const [lineCount, setLineCount] = useState(0);
|
|
97
97
|
useEffect(() => {
|
|
98
98
|
try {
|
|
99
|
-
const codeContent =
|
|
99
|
+
const codeContent = React__default.Children.toArray(children).map((child) => {
|
|
100
100
|
var _a;
|
|
101
|
-
if (
|
|
101
|
+
if (React__default.isValidElement(child) && ((_a = child.props) == null ? void 0 : _a.code) && typeof child.props.code === "string") {
|
|
102
102
|
return child.props.code;
|
|
103
103
|
}
|
|
104
104
|
return "";
|
|
@@ -1077,7 +1077,7 @@ var CodeBlockRoot = memo(function CodeBlock(props) {
|
|
|
1077
1077
|
resize: "smooth",
|
|
1078
1078
|
initial: "smooth"
|
|
1079
1079
|
});
|
|
1080
|
-
const codeContentRef =
|
|
1080
|
+
const codeContentRef = React__default.useRef("");
|
|
1081
1081
|
const {
|
|
1082
1082
|
isExpanded,
|
|
1083
1083
|
codeExpanded,
|
|
@@ -1092,7 +1092,7 @@ var CodeBlockRoot = memo(function CodeBlock(props) {
|
|
|
1092
1092
|
onCodeExpandChange,
|
|
1093
1093
|
scrollToBottom
|
|
1094
1094
|
});
|
|
1095
|
-
const handleCopy =
|
|
1095
|
+
const handleCopy = React__default.useCallback(
|
|
1096
1096
|
(code) => {
|
|
1097
1097
|
const codeToUse = code || codeContentRef.current;
|
|
1098
1098
|
if (codeToUse) {
|
|
@@ -1101,10 +1101,10 @@ var CodeBlockRoot = memo(function CodeBlock(props) {
|
|
|
1101
1101
|
},
|
|
1102
1102
|
[originalHandleCopy]
|
|
1103
1103
|
);
|
|
1104
|
-
|
|
1104
|
+
React__default.useEffect(() => {
|
|
1105
1105
|
try {
|
|
1106
|
-
|
|
1107
|
-
if (
|
|
1106
|
+
React__default.Children.forEach(children, (child) => {
|
|
1107
|
+
if (React__default.isValidElement(child) && child.props) {
|
|
1108
1108
|
if (child.props.code && typeof child.props.code === "string") {
|
|
1109
1109
|
codeContentRef.current = child.props.code;
|
|
1110
1110
|
}
|
|
@@ -1121,7 +1121,7 @@ var CodeBlockRoot = memo(function CodeBlock(props) {
|
|
|
1121
1121
|
codeExpanded,
|
|
1122
1122
|
children
|
|
1123
1123
|
});
|
|
1124
|
-
const contextValue =
|
|
1124
|
+
const contextValue = React__default.useMemo(
|
|
1125
1125
|
() => ({
|
|
1126
1126
|
language,
|
|
1127
1127
|
filename,
|
|
@@ -1157,11 +1157,11 @@ var CodeBlockRoot = memo(function CodeBlock(props) {
|
|
|
1157
1157
|
variant
|
|
1158
1158
|
]
|
|
1159
1159
|
);
|
|
1160
|
-
const injectedChildren =
|
|
1160
|
+
const injectedChildren = React__default.useMemo(() => {
|
|
1161
1161
|
try {
|
|
1162
|
-
return
|
|
1163
|
-
if (
|
|
1164
|
-
return
|
|
1162
|
+
return React__default.Children.map(children, (child) => {
|
|
1163
|
+
if (React__default.isValidElement(child)) {
|
|
1164
|
+
return React__default.cloneElement(
|
|
1165
1165
|
child,
|
|
1166
1166
|
{
|
|
1167
1167
|
codeBlock: contextValue
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { memo } from "react";
|
|
3
3
|
import { useStickToBottom } from "use-stick-to-bottom";
|
|
4
4
|
import { CodeBlockHeader } from "./components/code-block-header.js";
|
|
5
5
|
import { CodeBlockFooter } from "./components/code-block-footer.js";
|
|
@@ -27,7 +27,7 @@ const CodeBlockRoot = memo(function CodeBlock2(props) {
|
|
|
27
27
|
resize: "smooth",
|
|
28
28
|
initial: "smooth"
|
|
29
29
|
});
|
|
30
|
-
const codeContentRef =
|
|
30
|
+
const codeContentRef = React__default.useRef("");
|
|
31
31
|
const {
|
|
32
32
|
isExpanded,
|
|
33
33
|
codeExpanded,
|
|
@@ -42,7 +42,7 @@ const CodeBlockRoot = memo(function CodeBlock2(props) {
|
|
|
42
42
|
onCodeExpandChange,
|
|
43
43
|
scrollToBottom
|
|
44
44
|
});
|
|
45
|
-
const handleCopy =
|
|
45
|
+
const handleCopy = React__default.useCallback(
|
|
46
46
|
(code) => {
|
|
47
47
|
const codeToUse = code || codeContentRef.current;
|
|
48
48
|
if (codeToUse) {
|
|
@@ -51,10 +51,10 @@ const CodeBlockRoot = memo(function CodeBlock2(props) {
|
|
|
51
51
|
},
|
|
52
52
|
[originalHandleCopy]
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
React__default.useEffect(() => {
|
|
55
55
|
try {
|
|
56
|
-
|
|
57
|
-
if (
|
|
56
|
+
React__default.Children.forEach(children, (child) => {
|
|
57
|
+
if (React__default.isValidElement(child) && child.props) {
|
|
58
58
|
if (child.props.code && typeof child.props.code === "string") {
|
|
59
59
|
codeContentRef.current = child.props.code;
|
|
60
60
|
}
|
|
@@ -71,7 +71,7 @@ const CodeBlockRoot = memo(function CodeBlock2(props) {
|
|
|
71
71
|
codeExpanded,
|
|
72
72
|
children
|
|
73
73
|
});
|
|
74
|
-
const contextValue =
|
|
74
|
+
const contextValue = React__default.useMemo(
|
|
75
75
|
() => ({
|
|
76
76
|
language,
|
|
77
77
|
filename,
|
|
@@ -107,11 +107,11 @@ const CodeBlockRoot = memo(function CodeBlock2(props) {
|
|
|
107
107
|
variant
|
|
108
108
|
]
|
|
109
109
|
);
|
|
110
|
-
const injectedChildren =
|
|
110
|
+
const injectedChildren = React__default.useMemo(() => {
|
|
111
111
|
try {
|
|
112
|
-
return
|
|
113
|
-
if (
|
|
114
|
-
return
|
|
112
|
+
return React__default.Children.map(children, (child) => {
|
|
113
|
+
if (React__default.isValidElement(child)) {
|
|
114
|
+
return React__default.cloneElement(
|
|
115
115
|
child,
|
|
116
116
|
{
|
|
117
117
|
codeBlock: contextValue
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState, useEffect } from "react";
|
|
2
2
|
function useLineCount(children) {
|
|
3
3
|
const [lineCount, setLineCount] = useState(0);
|
|
4
4
|
useEffect(() => {
|
|
5
5
|
try {
|
|
6
|
-
const codeContent =
|
|
6
|
+
const codeContent = React__default.Children.toArray(children).map((child) => {
|
|
7
7
|
var _a;
|
|
8
|
-
if (
|
|
8
|
+
if (React__default.isValidElement(child) && ((_a = child.props) == null ? void 0 : _a.code) && typeof child.props.code === "string") {
|
|
9
9
|
return child.props.code;
|
|
10
10
|
}
|
|
11
11
|
return "";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { memo, forwardRef, useId, useRef, useEffect, useMemo } from "react";
|
|
3
3
|
import { GroupContext } from "../hooks/index.js";
|
|
4
4
|
import { commandGroupTv } from "../tv.js";
|
|
5
5
|
import { useValue } from "../hooks/use-value.js";
|
|
@@ -12,7 +12,7 @@ const CommandGroup = memo(
|
|
|
12
12
|
const id = useId();
|
|
13
13
|
const ref = useRef(null);
|
|
14
14
|
const headingRef = useRef(null);
|
|
15
|
-
const headingId =
|
|
15
|
+
const headingId = React__default.useId();
|
|
16
16
|
const context = useCommand();
|
|
17
17
|
const render = useCommandState(
|
|
18
18
|
(state) => forceMount ? true : context.filter() === false ? true : !state.search ? true : state.filtered.groups.has(id)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Kbd } from "../../../kbd/dist/index.js";
|
|
3
|
-
import
|
|
3
|
+
import React__default, { memo, forwardRef, useRef, useEffect, useMemo } from "react";
|
|
4
4
|
import { useEventCallback } from "usehooks-ts";
|
|
5
5
|
import { GroupContext } from "../hooks/index.js";
|
|
6
6
|
import { commandItemTv } from "../tv.js";
|
|
@@ -24,9 +24,9 @@ const CommandItem = memo(
|
|
|
24
24
|
...rest
|
|
25
25
|
} = props;
|
|
26
26
|
const ref = useRef(null);
|
|
27
|
-
const id =
|
|
27
|
+
const id = React__default.useId();
|
|
28
28
|
const context = useCommand();
|
|
29
|
-
const groupContext =
|
|
29
|
+
const groupContext = React__default.useContext(GroupContext);
|
|
30
30
|
const propsRef = useRef({
|
|
31
31
|
disabled,
|
|
32
32
|
forceMount: forceMount ?? (groupContext == null ? void 0 : groupContext.forceMount),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from "react";
|
|
2
2
|
import { StoreContext } from "../context/command-context.js";
|
|
3
3
|
const useStore = () => {
|
|
4
|
-
const store =
|
|
4
|
+
const store = React__default.useContext(StoreContext);
|
|
5
5
|
if (!store) {
|
|
6
6
|
throw new Error("useStore must be used within a Command component");
|
|
7
7
|
}
|
|
@@ -10,7 +10,7 @@ const useStore = () => {
|
|
|
10
10
|
function useCommandState(selector) {
|
|
11
11
|
const store = useStore();
|
|
12
12
|
const cb = () => selector(store.snapshot());
|
|
13
|
-
return
|
|
13
|
+
return React__default.useSyncExternalStore(store.subscribe, cb, cb);
|
|
14
14
|
}
|
|
15
15
|
export {
|
|
16
16
|
useCommandState,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from "react";
|
|
2
2
|
import { CommandContext } from "../context/command-context.js";
|
|
3
3
|
const useCommand = () => {
|
|
4
|
-
const context =
|
|
4
|
+
const context = React__default.useContext(CommandContext);
|
|
5
5
|
if (!context) {
|
|
6
6
|
throw new Error("useCommand must be used within a Command component");
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default from "react";
|
|
2
2
|
function renderChildren(children) {
|
|
3
3
|
const childrenType = children.type;
|
|
4
4
|
if (typeof childrenType === "function") {
|
|
@@ -15,11 +15,11 @@ function renderChildren(children) {
|
|
|
15
15
|
return children;
|
|
16
16
|
}
|
|
17
17
|
function SlottableWithNestedChildren({ asChild, children }, render) {
|
|
18
|
-
if (asChild &&
|
|
18
|
+
if (asChild && React__default.isValidElement(children)) {
|
|
19
19
|
const renderedChild = renderChildren(children);
|
|
20
|
-
if (
|
|
20
|
+
if (React__default.isValidElement(renderedChild)) {
|
|
21
21
|
const childProps = children.props;
|
|
22
|
-
return
|
|
22
|
+
return React__default.cloneElement(renderedChild, {}, render(childProps.children));
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return render(children);
|
|
@@ -4,7 +4,7 @@ import { Dropdown as Dropdown2 } from "../../../dropdown/dist/index.js";
|
|
|
4
4
|
import { IconButton } from "../../../icon-button/dist/index.js";
|
|
5
5
|
import { EllipsisSmall } from "@choiceform/icons-react";
|
|
6
6
|
import { Tooltip } from "../../../tooltip/dist/index.js";
|
|
7
|
-
import
|
|
7
|
+
import React__default, { memo, forwardRef, useCallback } from "react";
|
|
8
8
|
import { createEditor } from "slate";
|
|
9
9
|
import { withHistory } from "slate-history";
|
|
10
10
|
import { withReact, Slate, Editable } from "slate-react";
|
|
@@ -36,7 +36,7 @@ const CommentItem = memo(
|
|
|
36
36
|
ADD_REACTIONS: "Add reaction"
|
|
37
37
|
}
|
|
38
38
|
} = props;
|
|
39
|
-
const editor =
|
|
39
|
+
const editor = React__default.useMemo(() => withHistory(withReact(createEditor())), []);
|
|
40
40
|
const styles = CommentItemTv({});
|
|
41
41
|
const { relative: relativeDate, full: fullDate } = useFormattedDate(created_at, locale);
|
|
42
42
|
const renderElementWithCallbacks = useCallback(
|
|
@@ -2,9 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { IconButton } from "../../../../icon-button/dist/index.js";
|
|
3
3
|
import { DeleteReaction } from "@choiceform/icons-react";
|
|
4
4
|
import { Tooltip } from "../../../../tooltip/dist/index.js";
|
|
5
|
-
import
|
|
5
|
+
import React__default, { memo, useMemo } from "react";
|
|
6
6
|
import { CommentItemReactionsTv } from "../tv.js";
|
|
7
|
-
const CommentItemReactions =
|
|
7
|
+
const CommentItemReactions = React__default.memo(function CommentItemReactions2(props) {
|
|
8
8
|
const {
|
|
9
9
|
reactions,
|
|
10
10
|
reactionsPopoverIsOpen,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React__default, { useState, useCallback } from "react";
|
|
2
2
|
function useDragAndDrop({
|
|
3
3
|
groupId,
|
|
4
4
|
onDragComplete,
|
|
@@ -11,7 +11,7 @@ function useDragAndDrop({
|
|
|
11
11
|
isValidDropTarget
|
|
12
12
|
}) {
|
|
13
13
|
const [dragGuideIndex, setDragGuideIndex] = useState(null);
|
|
14
|
-
const timeoutRef =
|
|
14
|
+
const timeoutRef = React__default.useRef(null);
|
|
15
15
|
const handleClearOtherGuides = useCallback(
|
|
16
16
|
(currentGroupId) => {
|
|
17
17
|
if (currentGroupId !== groupId) {
|
|
@@ -185,7 +185,7 @@ function useDragAndDrop({
|
|
|
185
185
|
const clearLocalGuide = useCallback(() => {
|
|
186
186
|
setDragGuideIndex(null);
|
|
187
187
|
}, []);
|
|
188
|
-
|
|
188
|
+
React__default.useEffect(() => {
|
|
189
189
|
if (onRegisterGuideClear) {
|
|
190
190
|
onRegisterGuideClear(groupId, clearLocalGuide);
|
|
191
191
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { IconButton } from "../../../icon-button/dist/index.js";
|
|
3
3
|
import { Check, CopySmall } from "@choiceform/icons-react";
|
|
4
|
-
import
|
|
4
|
+
import React__default, { useState, useContext } from "react";
|
|
5
5
|
import { ContextInputEditorContext } from "../hooks/use-context-input-editor.js";
|
|
6
6
|
import { convertSlateToText } from "../utils/slate-converters.js";
|
|
7
7
|
const CopyButtonComponent = function CopyButton2({
|
|
@@ -41,7 +41,7 @@ const CopyButtonComponent = function CopyButton2({
|
|
|
41
41
|
}
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
-
const CopyButton =
|
|
44
|
+
const CopyButton = React__default.memo(CopyButtonComponent);
|
|
45
45
|
export {
|
|
46
46
|
CopyButton
|
|
47
47
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { useMemo } from "react";
|
|
3
3
|
import { useSelected, useFocused } from "slate-react";
|
|
4
4
|
import { mentionElementTv } from "./tv.js";
|
|
5
5
|
const MentionComponent = (props) => {
|
|
@@ -57,7 +57,7 @@ const MentionComponent = (props) => {
|
|
|
57
57
|
}
|
|
58
58
|
);
|
|
59
59
|
};
|
|
60
|
-
const Mention =
|
|
60
|
+
const Mention = React__default.memo(MentionComponent, (prevProps, nextProps) => {
|
|
61
61
|
const prevElement = prevProps.element;
|
|
62
62
|
const nextElement = nextProps.element;
|
|
63
63
|
return prevProps.mentionPrefix === nextProps.mentionPrefix && prevProps.variant === nextProps.variant && prevProps.renderMention === nextProps.renderMention && prevElement.mentionId === nextElement.mentionId && prevElement.mentionType === nextElement.mentionType && prevElement.mentionLabel === nextElement.mentionLabel && prevElement.mentionPrefix === nextElement.mentionPrefix;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ScrollArea } from "../../../scroll-area/dist/index.js";
|
|
3
|
-
import
|
|
3
|
+
import React__default, { useMemo, useCallback } from "react";
|
|
4
4
|
import { Slate, Editable } from "slate-react";
|
|
5
5
|
import { contextInputTv } from "../tv.js";
|
|
6
6
|
import { Mention } from "./mention.js";
|
|
7
|
-
const SlateEditorComponent =
|
|
7
|
+
const SlateEditorComponent = React__default.forwardRef(
|
|
8
8
|
function SlateEditor2({
|
|
9
9
|
editor,
|
|
10
10
|
slateValue,
|
|
@@ -111,7 +111,7 @@ const SlateEditorComponent = React.forwardRef(
|
|
|
111
111
|
);
|
|
112
112
|
}
|
|
113
113
|
);
|
|
114
|
-
const SlateEditor =
|
|
114
|
+
const SlateEditor = React__default.memo(SlateEditorComponent, (prevProps, nextProps) => {
|
|
115
115
|
return prevProps.editor === nextProps.editor && // Don't compare slateValue - Slate manages state internally
|
|
116
116
|
prevProps.placeholder === nextProps.placeholder && prevProps.disabled === nextProps.disabled && prevProps.readOnly === nextProps.readOnly && prevProps.autoFocus === nextProps.autoFocus && prevProps.variant === nextProps.variant && prevProps.renderMention === nextProps.renderMention && prevProps.mentionPrefix === nextProps.mentionPrefix && prevProps.customMentionComponent === nextProps.customMentionComponent && prevProps.className === nextProps.className && prevProps.maxLength === nextProps.maxLength && prevProps.minHeight === nextProps.minHeight && prevProps.onChange === nextProps.onChange && prevProps.onKeyDown === nextProps.onKeyDown && prevProps.onCompositionStart === nextProps.onCompositionStart && prevProps.onCompositionEnd === nextProps.onCompositionEnd && prevProps.onFocus === nextProps.onFocus && prevProps.onBlur === nextProps.onBlur && prevProps.hasHeader === nextProps.hasHeader && prevProps.hasFooter === nextProps.hasFooter && prevProps.size === nextProps.size && prevProps.children === nextProps.children;
|
|
117
117
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef, useRef, useImperativeHandle, useMemo } from "react";
|
|
3
3
|
import { ReactEditor } from "slate-react";
|
|
4
4
|
import { useEventCallback } from "usehooks-ts";
|
|
5
5
|
import { contextInputTv } from "./tv.js";
|
|
@@ -65,16 +65,16 @@ const ContextInputBase = forwardRef(function ContextInputBase2({
|
|
|
65
65
|
let header2 = null;
|
|
66
66
|
let footer2 = null;
|
|
67
67
|
const otherChildren2 = [];
|
|
68
|
-
|
|
69
|
-
if (
|
|
68
|
+
React__default.Children.forEach(children, (child) => {
|
|
69
|
+
if (React__default.isValidElement(child)) {
|
|
70
70
|
if (child.type === ContextInputHeader) {
|
|
71
|
-
header2 =
|
|
71
|
+
header2 = React__default.cloneElement(child, {
|
|
72
72
|
...child.props,
|
|
73
73
|
size,
|
|
74
74
|
handleClick: handleFocusClick
|
|
75
75
|
});
|
|
76
76
|
} else if (child.type === ContextInputFooter) {
|
|
77
|
-
footer2 =
|
|
77
|
+
footer2 = React__default.cloneElement(child, {
|
|
78
78
|
...child.props,
|
|
79
79
|
size,
|
|
80
80
|
handleClick: handleFocusClick
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { MenuValue, MenuContextSubTrigger, MenuSearch, MenuContextLabel, MenuContextItem, MenuInput, MenuEmpty, MenuDivider, MenuContextContent, MenuButton, useMenuBaseRefs, useMenuTree, useMenuScrollHeight, useMenuScroll, MenuContext, MenuScrollArrow } from "../../menus/dist/index.js";
|
|
3
3
|
import { useFloatingParentNodeId, FloatingTree, offset, flip, shift, size, useFloating, autoUpdate, useHover, safePolygon, useClick, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingNode, FloatingList, FloatingPortal, FloatingOverlay, FloatingFocusManager } from "@floating-ui/react";
|
|
4
|
-
import
|
|
4
|
+
import React__default, { memo, useContext, useCallback, useRef, useState, useId, useMemo, useEffect, cloneElement } from "react";
|
|
5
5
|
import { useEventCallback } from "usehooks-ts";
|
|
6
6
|
const PORTAL_ROOT_ID = "floating-menu-root";
|
|
7
7
|
const DEFAULT_OFFSET = 4;
|
|
8
|
-
const ContextMenuContext =
|
|
8
|
+
const ContextMenuContext = React__default.createContext(null);
|
|
9
9
|
const ContextMenuTrigger = memo(function ContextMenuTrigger2({
|
|
10
10
|
children,
|
|
11
11
|
...props
|
|
@@ -242,15 +242,15 @@ const ContextMenuComponent = memo(function ContextMenuComponent2(props) {
|
|
|
242
242
|
handleOpenChange(false);
|
|
243
243
|
});
|
|
244
244
|
const { targetElement, subTriggerElement, contentElement } = useMemo(() => {
|
|
245
|
-
const childrenArray =
|
|
245
|
+
const childrenArray = React__default.Children.toArray(children);
|
|
246
246
|
const target = childrenArray.find(
|
|
247
|
-
(child) =>
|
|
247
|
+
(child) => React__default.isValidElement(child) && child.type === ContextMenuTrigger
|
|
248
248
|
);
|
|
249
249
|
const subTrigger = childrenArray.find(
|
|
250
|
-
(child) =>
|
|
250
|
+
(child) => React__default.isValidElement(child) && child.type === MenuContextSubTrigger
|
|
251
251
|
);
|
|
252
252
|
const content = childrenArray.find(
|
|
253
|
-
(child) =>
|
|
253
|
+
(child) => React__default.isValidElement(child) && child.type === MenuContextContent
|
|
254
254
|
);
|
|
255
255
|
return {
|
|
256
256
|
targetElement: target,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Slot } from "../../slot/dist/index.js";
|
|
2
2
|
import { ModalFooter, ModalBackdrop, ModalContent, Modal, ModalHeader } from "../../modal/dist/index.js";
|
|
3
3
|
import { FloatingPortal, FloatingOverlay, FloatingFocusManager, useFloating, autoUpdate, useTransitionStyles, useClick, useDismiss, useRole, useInteractions } from "@floating-ui/react";
|
|
4
|
-
import
|
|
4
|
+
import React__default, { memo, useRef, useId, useMemo, createContext, forwardRef, useState, useEffect, useCallback, useContext } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { useEventCallback } from "usehooks-ts";
|
|
7
7
|
import { findChildByType } from "../../../shared/utils/assertion.js";
|
|
@@ -765,7 +765,7 @@ var DialogComponent = memo(function DialogComponent2({
|
|
|
765
765
|
const backdropContent = useMemo(() => {
|
|
766
766
|
const backdropChild = findChildByType(children, ModalBackdrop);
|
|
767
767
|
if (!backdropChild) return null;
|
|
768
|
-
return
|
|
768
|
+
return React__default.cloneElement(backdropChild, {
|
|
769
769
|
isOpen: floating.innerOpen,
|
|
770
770
|
onClose: floating.handleClose,
|
|
771
771
|
...backdropChild.props
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Slot } from "../../slot/dist/index.js";
|
|
3
3
|
import { ModalFooter, ModalBackdrop, ModalContent, Modal } from "../../modal/dist/index.js";
|
|
4
4
|
import { FloatingPortal, FloatingOverlay, FloatingFocusManager } from "@floating-ui/react";
|
|
5
|
-
import
|
|
5
|
+
import React__default, { memo, useRef, useId, useMemo } from "react";
|
|
6
6
|
import { DialogContext } from "./dialog-context.js";
|
|
7
7
|
import { dragDialogTv } from "./tv.js";
|
|
8
8
|
import { DialogHeader } from "./components/dialog-header.js";
|
|
@@ -134,7 +134,7 @@ const DialogComponent = memo(function DialogComponent2({
|
|
|
134
134
|
const backdropContent = useMemo(() => {
|
|
135
135
|
const backdropChild = findChildByType(children, ModalBackdrop);
|
|
136
136
|
if (!backdropChild) return null;
|
|
137
|
-
return
|
|
137
|
+
return React__default.cloneElement(backdropChild, {
|
|
138
138
|
isOpen: floating.innerOpen,
|
|
139
139
|
onClose: floating.handleClose,
|
|
140
140
|
...backdropChild.props
|
|
@@ -36,6 +36,7 @@ export * from './modal/src';
|
|
|
36
36
|
export * from './multi-select/src';
|
|
37
37
|
export * from './notifications/src';
|
|
38
38
|
export * from './numeric-input/src';
|
|
39
|
+
export * from './otp-input/src';
|
|
39
40
|
export * from './pagination/src';
|
|
40
41
|
export * from './panel/src';
|
|
41
42
|
export * from './picture-preview/src';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { memo, forwardRef, useContext, useMemo } from "react";
|
|
3
3
|
import { useEventCallback } from "usehooks-ts";
|
|
4
4
|
import { DEFAULT_TOOLBAR_GROUPS } from "./default-actions.js";
|
|
5
5
|
import { ToolbarButton } from "./toolbar-button.js";
|
|
@@ -66,7 +66,7 @@ const Toolbar = memo(
|
|
|
66
66
|
...rest,
|
|
67
67
|
children: [
|
|
68
68
|
beforeElement,
|
|
69
|
-
filteredGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs(
|
|
69
|
+
filteredGroups.map((group, groupIndex) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
70
70
|
groupIndex > 0 && /* @__PURE__ */ jsx("div", { className: tcx(tv.divider()) }),
|
|
71
71
|
group.map((action) => /* @__PURE__ */ jsx(
|
|
72
72
|
ToolbarButton,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { memo, forwardRef, useState, useRef, useMemo } from "react";
|
|
3
3
|
import { useEventCallback } from "usehooks-ts";
|
|
4
4
|
import { MdInputContainer } from "./components/md-input-container.js";
|
|
5
5
|
import { MdInputEditor } from "./components/md-input-editor.js";
|
|
@@ -37,10 +37,10 @@ const MdInputRoot = memo(
|
|
|
37
37
|
const hasTabs = useMemo(() => {
|
|
38
38
|
const checkForTabs = (node) => {
|
|
39
39
|
let found = false;
|
|
40
|
-
|
|
40
|
+
React__default.Children.forEach(node, (child) => {
|
|
41
41
|
var _a;
|
|
42
42
|
if (found) return;
|
|
43
|
-
if (
|
|
43
|
+
if (React__default.isValidElement(child)) {
|
|
44
44
|
const type = child.type;
|
|
45
45
|
if (type.displayName === "MdInputTabs" || type === MdInputTabs) {
|
|
46
46
|
found = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button } from "../../button/dist/index.js";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef, memo, useContext, createContext, useMemo, startTransition, useCallback, useRef, Children, isValidElement, Fragment as Fragment$1, useState, useEffect } from "react";
|
|
3
3
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Check, ChevronRightSmall, ChevronDownSmall, ChevronUpSmall } from "@choiceform/icons-react";
|
|
5
5
|
import { Kbd } from "../../kbd/dist/index.js";
|
|
@@ -726,7 +726,7 @@ var MenusBase = forwardRef((props, ref) => {
|
|
|
726
726
|
return processChildren(child.props.children);
|
|
727
727
|
}
|
|
728
728
|
if (child.props.children) {
|
|
729
|
-
return
|
|
729
|
+
return React__default.cloneElement(child, {
|
|
730
730
|
...child.props,
|
|
731
731
|
children: processChildren(child.props.children)
|
|
732
732
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { forwardRef, Children, isValidElement, Fragment } from "react";
|
|
3
3
|
import { MenuButton } from "./components/menu-button.js";
|
|
4
4
|
import { MenuCheckbox } from "./components/menu-checkbox.js";
|
|
5
5
|
import { MenuDivider } from "./components/menu-divider.js";
|
|
@@ -20,7 +20,7 @@ const MenusBase = forwardRef((props, ref) => {
|
|
|
20
20
|
return processChildren(child.props.children);
|
|
21
21
|
}
|
|
22
22
|
if (child.props.children) {
|
|
23
|
-
return
|
|
23
|
+
return React__default.cloneElement(child, {
|
|
24
24
|
...child.props,
|
|
25
25
|
children: processChildren(child.props.children)
|
|
26
26
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Slot } from "../../slot/dist/index.js";
|
|
2
2
|
import { MenuValue, MenuContextLabel, MenuContextItem, MenuEmpty, MenuDivider, MenuContextContent, useMenuBaseRefs, useMenuScroll, useMenuScrollHeight, MenuContext, MenuScrollArrow } from "../../menus/dist/index.js";
|
|
3
3
|
import { useFloatingParentNodeId, FloatingTree, useFloatingNodeId, useFloatingTree, offset, flip, shift, size, useFloating, autoUpdate, useClick, useDismiss, useRole, useListNavigation, useTypeahead, useInteractions, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList } from "@floating-ui/react";
|
|
4
|
-
import
|
|
4
|
+
import React__default, { memo, forwardRef, useRef, useCallback, useMemo, Children, isValidElement, useId, useEffect, useState, cloneElement } from "react";
|
|
5
5
|
import { useEventCallback } from "usehooks-ts";
|
|
6
6
|
import { Chip } from "../../chip/dist/index.js";
|
|
7
7
|
import { ChevronDownSmall } from "@choiceform/icons-react";
|
|
@@ -356,7 +356,7 @@ function extractItemElements(children) {
|
|
|
356
356
|
if (!isValidElement(child)) return;
|
|
357
357
|
if (child.type === MenuContextItem || child.type === MenuDivider || child.type === MenuContextLabel || child.type === MenuEmpty) {
|
|
358
358
|
result.push(child);
|
|
359
|
-
} else if (child.type ===
|
|
359
|
+
} else if (child.type === React__default.Fragment && child.props.children) {
|
|
360
360
|
const fragmentChildren = Children.toArray(child.props.children);
|
|
361
361
|
result.push(...extractItems(fragmentChildren));
|
|
362
362
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MenuDivider, MenuContextLabel, MenuEmpty, MenuContextItem } from "../../../menus/dist/index.js";
|
|
2
|
-
import
|
|
2
|
+
import React__default, { Children, isValidElement } from "react";
|
|
3
3
|
function extractItemElements(children) {
|
|
4
4
|
if (!children) return [];
|
|
5
5
|
const childrenArray = Children.toArray(children);
|
|
@@ -9,7 +9,7 @@ function extractItemElements(children) {
|
|
|
9
9
|
if (!isValidElement(child)) return;
|
|
10
10
|
if (child.type === MenuContextItem || child.type === MenuDivider || child.type === MenuContextLabel || child.type === MenuEmpty) {
|
|
11
11
|
result.push(child);
|
|
12
|
-
} else if (child.type ===
|
|
12
|
+
} else if (child.type === React__default.Fragment && child.props.children) {
|
|
13
13
|
const fragmentChildren = Children.toArray(child.props.children);
|
|
14
14
|
result.push(...extractItems(fragmentChildren));
|
|
15
15
|
}
|