@choice-ui/react 1.5.4 → 1.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/components/calendar/dist/index.js +2 -2
  2. package/dist/components/calendar/src/time-calendar/time-calendar.js +2 -2
  3. package/dist/components/code-block/dist/index.js +13 -13
  4. package/dist/components/code-block/src/code-block.js +11 -11
  5. package/dist/components/code-block/src/hooks/use-line-count.js +3 -3
  6. package/dist/components/command/src/components/command-group.js +2 -2
  7. package/dist/components/command/src/components/command-item.js +3 -3
  8. package/dist/components/command/src/hooks/index.js +2 -2
  9. package/dist/components/command/src/hooks/use-command-state.js +3 -3
  10. package/dist/components/command/src/hooks/use-command.js +2 -2
  11. package/dist/components/command/src/utils/helpers.js +4 -4
  12. package/dist/components/comments/src/comment-item/comment-item.js +2 -2
  13. package/dist/components/comments/src/comment-item/components/comment-item-reactions.js +2 -2
  14. package/dist/components/conditions/src/hooks/use-drag-and-drop.js +3 -3
  15. package/dist/components/context-input/src/components/copy-button.js +2 -2
  16. package/dist/components/context-input/src/components/mention.js +2 -2
  17. package/dist/components/context-input/src/components/slate-editor.js +3 -3
  18. package/dist/components/context-input/src/context-input.js +5 -5
  19. package/dist/components/context-menu/src/context-menu.js +6 -6
  20. package/dist/components/dialog/dist/index.js +2 -2
  21. package/dist/components/dialog/src/dialog.js +2 -2
  22. package/dist/components/index.d.ts +1 -0
  23. package/dist/components/md-input/src/components/toolbar/toolbar.js +2 -2
  24. package/dist/components/md-input/src/md-input.js +3 -3
  25. package/dist/components/menus/dist/index.js +2 -2
  26. package/dist/components/menus/src/menus.js +2 -2
  27. package/dist/components/multi-select/dist/index.js +2 -2
  28. package/dist/components/multi-select/src/utils/extract-options.js +2 -2
  29. package/dist/components/otp-input/dist/index.d.ts +30 -0
  30. package/dist/components/otp-input/src/index.d.ts +2 -0
  31. package/dist/components/otp-input/src/otp-input.d.ts +27 -0
  32. package/dist/components/otp-input/src/otp-input.js +115 -0
  33. package/dist/components/otp-input/src/otp-input.module.css +15 -0
  34. package/dist/components/otp-input/src/otp-input.module.css.js +8 -0
  35. package/dist/components/otp-input/src/tv.d.ts +121 -0
  36. package/dist/components/otp-input/src/tv.js +150 -0
  37. package/dist/components/otp-input/tsup.config.d.ts +2 -0
  38. package/dist/components/panel/src/components/panel-sortable.js +3 -3
  39. package/dist/components/rich-input/src/hooks/use-editor-config.js +3 -3
  40. package/dist/components/rich-input/src/utils/custom-options.js +15 -15
  41. package/dist/components/select/dist/index.js +19 -3
  42. package/dist/components/select/src/select.js +19 -3
  43. package/dist/components/slot/dist/index.d.ts +10 -10
  44. package/dist/components/slot/dist/index.js +7 -15
  45. package/dist/components/slot/src/slot.d.ts +12 -12
  46. package/dist/components/slot/src/slot.js +10 -18
  47. package/dist/components/textarea/dist/index.js +14 -14
  48. package/dist/components/textarea/src/components/autosize/hooks.js +5 -5
  49. package/dist/components/textarea/src/components/autosize/index.js +10 -10
  50. package/dist/components/tree-list/src/tree-list.js +3 -3
  51. package/dist/components/virtualized-grid/src/error-boundary.js +2 -2
  52. package/dist/index.js +2 -0
  53. 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
  54. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { OTPInput } from 'input-otp';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type OTPInputVariant = "default" | "light" | "dark";
6
+ interface OTPInputRootProps extends Omit<ComponentProps<typeof OTPInput>, "disabled" | "containerClassName" | "render"> {
7
+ variant?: OTPInputVariant;
8
+ disabled?: boolean;
9
+ isInvalid?: boolean;
10
+ inputClassName?: string;
11
+ children: ReactNode;
12
+ }
13
+ declare function OTPInputRoot({ className, inputClassName, variant, disabled, isInvalid, children, ...props }: OTPInputRootProps): react_jsx_runtime.JSX.Element;
14
+ interface OTPInputGroupProps extends ComponentProps<"div"> {
15
+ }
16
+ declare function OTPInputGroup({ className, ...props }: OTPInputGroupProps): react_jsx_runtime.JSX.Element;
17
+ interface OTPInputSlotProps extends ComponentProps<"div"> {
18
+ index: number;
19
+ }
20
+ declare function OTPInputSlot({ className, index, ...props }: OTPInputSlotProps): react_jsx_runtime.JSX.Element;
21
+ interface OTPInputSeparatorProps extends ComponentProps<"div"> {
22
+ }
23
+ declare function OTPInputSeparator({ className, children, ...props }: OTPInputSeparatorProps): react_jsx_runtime.JSX.Element;
24
+ declare const OtpInput: typeof OTPInputRoot & {
25
+ Group: typeof OTPInputGroup;
26
+ Slot: typeof OTPInputSlot;
27
+ Separator: typeof OTPInputSeparator;
28
+ };
29
+
30
+ export { type OTPInputGroupProps, type OTPInputRootProps, type OTPInputSeparatorProps, type OTPInputSlotProps, OtpInput };
@@ -0,0 +1,2 @@
1
+ export { OtpInput } from './otp-input';
2
+ export type { OTPInputRootProps, OTPInputGroupProps, OTPInputSlotProps, OTPInputSeparatorProps, } from './otp-input';
@@ -0,0 +1,27 @@
1
+ import { OTPInput } from 'input-otp';
2
+ import { ComponentProps, ReactNode } from 'react';
3
+ type OTPInputVariant = "default" | "light" | "dark";
4
+ export interface OTPInputRootProps extends Omit<ComponentProps<typeof OTPInput>, "disabled" | "containerClassName" | "render"> {
5
+ variant?: OTPInputVariant;
6
+ disabled?: boolean;
7
+ isInvalid?: boolean;
8
+ inputClassName?: string;
9
+ children: ReactNode;
10
+ }
11
+ declare function OTPInputRoot({ className, inputClassName, variant, disabled, isInvalid, children, ...props }: OTPInputRootProps): import("react/jsx-runtime").JSX.Element;
12
+ export interface OTPInputGroupProps extends ComponentProps<"div"> {
13
+ }
14
+ declare function OTPInputGroup({ className, ...props }: OTPInputGroupProps): import("react/jsx-runtime").JSX.Element;
15
+ export interface OTPInputSlotProps extends ComponentProps<"div"> {
16
+ index: number;
17
+ }
18
+ declare function OTPInputSlot({ className, index, ...props }: OTPInputSlotProps): import("react/jsx-runtime").JSX.Element;
19
+ export interface OTPInputSeparatorProps extends ComponentProps<"div"> {
20
+ }
21
+ declare function OTPInputSeparator({ className, children, ...props }: OTPInputSeparatorProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare const OtpInput: typeof OTPInputRoot & {
23
+ Group: typeof OTPInputGroup;
24
+ Slot: typeof OTPInputSlot;
25
+ Separator: typeof OTPInputSeparator;
26
+ };
27
+ export {};
@@ -0,0 +1,115 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { OTPInput as Lt } from "../../../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";
3
+ import { useMemo, createContext, useContext } from "react";
4
+ import { otpInputTv } from "./tv.js";
5
+ import css from "./otp-input.module.css.js";
6
+ import { tcx } from "../../../shared/utils/tcx/tcx.js";
7
+ const OTPInputCtx = createContext({
8
+ styles: otpInputTv({}),
9
+ slotProps: [],
10
+ variant: "default",
11
+ disabled: false,
12
+ isInvalid: false
13
+ });
14
+ function OTPInputRoot({
15
+ className,
16
+ inputClassName,
17
+ variant = "default",
18
+ disabled = false,
19
+ isInvalid = false,
20
+ children,
21
+ ...props
22
+ }) {
23
+ const tv = useMemo(
24
+ () => otpInputTv({ variant, disabled, isInvalid }),
25
+ [variant, disabled, isInvalid]
26
+ );
27
+ return /* @__PURE__ */ jsx(
28
+ Lt,
29
+ {
30
+ className: tv.input({ className: inputClassName }),
31
+ containerClassName: tv.base({ className }),
32
+ spellCheck: false,
33
+ autoComplete: "off",
34
+ "data-disabled": disabled || void 0,
35
+ "data-invalid": isInvalid || void 0,
36
+ "data-slot": "otp-input",
37
+ disabled,
38
+ render: ({ slots: slotProps }) => /* @__PURE__ */ jsx(OTPInputCtx.Provider, { value: { styles: tv, slotProps, variant, disabled, isInvalid }, children }),
39
+ ...props
40
+ }
41
+ );
42
+ }
43
+ function OTPInputGroup({ className, ...props }) {
44
+ var _a;
45
+ const { styles } = useContext(OTPInputCtx);
46
+ return /* @__PURE__ */ jsx(
47
+ "div",
48
+ {
49
+ className: (_a = styles == null ? void 0 : styles.group) == null ? void 0 : _a.call(styles, { className }),
50
+ "data-slot": "otp-input-group",
51
+ ...props
52
+ }
53
+ );
54
+ }
55
+ function OTPInputSlot({ className, index, ...props }) {
56
+ var _a, _b, _c, _d;
57
+ const { styles, slotProps, variant, disabled, isInvalid } = useContext(OTPInputCtx);
58
+ const { char, hasFakeCaret, isActive } = (slotProps == null ? void 0 : slotProps[index]) ?? {};
59
+ const slotStyles = otpInputTv({
60
+ variant,
61
+ selected: isActive,
62
+ disabled,
63
+ isInvalid
64
+ });
65
+ return /* @__PURE__ */ jsxs(
66
+ "div",
67
+ {
68
+ ...props,
69
+ className: tcx((_a = styles == null ? void 0 : styles.slot) == null ? void 0 : _a.call(styles, { className }), (_b = slotStyles == null ? void 0 : slotStyles.slot) == null ? void 0 : _b.call(slotStyles)),
70
+ "data-active": isActive || void 0,
71
+ "data-disabled": disabled || void 0,
72
+ "data-filled": !!char || void 0,
73
+ "data-invalid": isInvalid || void 0,
74
+ "data-slot": "otp-input-slot",
75
+ children: [
76
+ char ? /* @__PURE__ */ jsx(
77
+ "div",
78
+ {
79
+ className: (_c = styles == null ? void 0 : styles.slotValue) == null ? void 0 : _c.call(styles),
80
+ "data-slot": "otp-input-slot-value",
81
+ children: char
82
+ }
83
+ ) : null,
84
+ hasFakeCaret && isActive ? /* @__PURE__ */ jsx(
85
+ "div",
86
+ {
87
+ className: tcx((_d = styles == null ? void 0 : styles.caret) == null ? void 0 : _d.call(styles), css.caret),
88
+ "data-slot": "otp-input-caret"
89
+ }
90
+ ) : null
91
+ ]
92
+ }
93
+ );
94
+ }
95
+ function OTPInputSeparator({ className, children, ...props }) {
96
+ var _a;
97
+ const { styles } = useContext(OTPInputCtx);
98
+ return /* @__PURE__ */ jsx(
99
+ "div",
100
+ {
101
+ className: (_a = styles == null ? void 0 : styles.separator) == null ? void 0 : _a.call(styles, { className }),
102
+ "data-slot": "otp-input-separator",
103
+ ...props,
104
+ children: children ?? /* @__PURE__ */ jsx("span", { children: "-" })
105
+ }
106
+ );
107
+ }
108
+ const OtpInput = Object.assign(OTPInputRoot, {
109
+ Group: OTPInputGroup,
110
+ Slot: OTPInputSlot,
111
+ Separator: OTPInputSeparator
112
+ });
113
+ export {
114
+ OtpInput
115
+ };
@@ -0,0 +1,15 @@
1
+ ._caret_7qdip_1 {
2
+ animation: _caret-blink_7qdip_1 1s ease-out infinite;
3
+ }
4
+
5
+ @keyframes _caret-blink_7qdip_1 {
6
+ 0%,
7
+ 70%,
8
+ 100% {
9
+ opacity: 1;
10
+ }
11
+ 20%,
12
+ 50% {
13
+ opacity: 0;
14
+ }
15
+ }
@@ -0,0 +1,8 @@
1
+ import './otp-input.module.css';const caret = "_caret_7qdip_1";
2
+ const css = {
3
+ caret
4
+ };
5
+ export {
6
+ caret,
7
+ css as default
8
+ };
@@ -0,0 +1,121 @@
1
+ export declare const otpInputTv: import('tailwind-variants').TVReturnType<{
2
+ variant: {
3
+ default: {
4
+ slot: string;
5
+ slotValue: string;
6
+ caret: string;
7
+ };
8
+ light: {
9
+ slot: string;
10
+ slotValue: string;
11
+ caret: string;
12
+ };
13
+ dark: {
14
+ slot: string;
15
+ slotValue: string;
16
+ caret: string;
17
+ };
18
+ };
19
+ selected: {
20
+ true: {};
21
+ false: {};
22
+ };
23
+ disabled: {
24
+ true: {
25
+ slot: string;
26
+ };
27
+ false: {};
28
+ };
29
+ isInvalid: {
30
+ true: {};
31
+ false: {};
32
+ };
33
+ }, {
34
+ base: string;
35
+ input: string;
36
+ group: string;
37
+ slot: string[];
38
+ slotValue: string;
39
+ caret: string;
40
+ separator: string;
41
+ }, undefined, {
42
+ variant: {
43
+ default: {
44
+ slot: string;
45
+ slotValue: string;
46
+ caret: string;
47
+ };
48
+ light: {
49
+ slot: string;
50
+ slotValue: string;
51
+ caret: string;
52
+ };
53
+ dark: {
54
+ slot: string;
55
+ slotValue: string;
56
+ caret: string;
57
+ };
58
+ };
59
+ selected: {
60
+ true: {};
61
+ false: {};
62
+ };
63
+ disabled: {
64
+ true: {
65
+ slot: string;
66
+ };
67
+ false: {};
68
+ };
69
+ isInvalid: {
70
+ true: {};
71
+ false: {};
72
+ };
73
+ }, {
74
+ base: string;
75
+ input: string;
76
+ group: string;
77
+ slot: string[];
78
+ slotValue: string;
79
+ caret: string;
80
+ separator: string;
81
+ }, import('tailwind-variants').TVReturnType<{
82
+ variant: {
83
+ default: {
84
+ slot: string;
85
+ slotValue: string;
86
+ caret: string;
87
+ };
88
+ light: {
89
+ slot: string;
90
+ slotValue: string;
91
+ caret: string;
92
+ };
93
+ dark: {
94
+ slot: string;
95
+ slotValue: string;
96
+ caret: string;
97
+ };
98
+ };
99
+ selected: {
100
+ true: {};
101
+ false: {};
102
+ };
103
+ disabled: {
104
+ true: {
105
+ slot: string;
106
+ };
107
+ false: {};
108
+ };
109
+ isInvalid: {
110
+ true: {};
111
+ false: {};
112
+ };
113
+ }, {
114
+ base: string;
115
+ input: string;
116
+ group: string;
117
+ slot: string[];
118
+ slotValue: string;
119
+ caret: string;
120
+ separator: string;
121
+ }, undefined, unknown, unknown, undefined>>;
@@ -0,0 +1,150 @@
1
+ import { tcv } from "../../../shared/utils/tcx/tcx.js";
2
+ const otpInputTv = tcv({
3
+ slots: {
4
+ base: "relative flex items-center gap-2",
5
+ input: "!absolute inset-0 w-full h-full opacity-0 cursor-text",
6
+ group: "flex items-center gap-1.5",
7
+ slot: [
8
+ "relative flex items-center justify-center",
9
+ "h-8 w-8",
10
+ "rounded-md",
11
+ "text-body-large",
12
+ "border border-solid border-transparent"
13
+ ],
14
+ slotValue: "",
15
+ caret: "absolute inset-y-2 left-1/2 w-px -translate-x-1/2",
16
+ separator: "text-secondary-foreground mx-1"
17
+ },
18
+ variants: {
19
+ variant: {
20
+ default: {
21
+ slot: "bg-secondary-background",
22
+ slotValue: "text-default-foreground",
23
+ caret: "bg-default-foreground"
24
+ },
25
+ light: {
26
+ slot: "bg-gray-100",
27
+ slotValue: "text-gray-900",
28
+ caret: "bg-gray-900"
29
+ },
30
+ dark: {
31
+ slot: "bg-gray-700",
32
+ slotValue: "text-white",
33
+ caret: "bg-white"
34
+ }
35
+ },
36
+ selected: {
37
+ true: {},
38
+ false: {}
39
+ },
40
+ disabled: {
41
+ true: {
42
+ slot: "cursor-not-allowed"
43
+ },
44
+ false: {}
45
+ },
46
+ isInvalid: {
47
+ true: {},
48
+ false: {}
49
+ }
50
+ },
51
+ compoundVariants: [
52
+ {
53
+ variant: "default",
54
+ selected: true,
55
+ disabled: false,
56
+ class: {
57
+ slot: "bg-default-background border-selected-boundary"
58
+ }
59
+ },
60
+ {
61
+ variant: "default",
62
+ selected: false,
63
+ disabled: false,
64
+ class: {
65
+ slot: "hover:border-default-boundary"
66
+ }
67
+ },
68
+ {
69
+ variant: "light",
70
+ selected: false,
71
+ disabled: false,
72
+ class: {
73
+ slot: "hover:border-gray-200"
74
+ }
75
+ },
76
+ {
77
+ variant: "dark",
78
+ selected: false,
79
+ disabled: false,
80
+ class: {
81
+ slot: "hover:border-gray-600"
82
+ }
83
+ },
84
+ {
85
+ variant: ["default", "light", "dark"],
86
+ selected: true,
87
+ disabled: false,
88
+ class: {
89
+ slot: "border-selected-boundary"
90
+ }
91
+ },
92
+ {
93
+ variant: "default",
94
+ disabled: true,
95
+ class: {
96
+ slot: "bg-secondary-background",
97
+ slotValue: "text-disabled-foreground"
98
+ }
99
+ },
100
+ {
101
+ variant: "light",
102
+ disabled: true,
103
+ class: {
104
+ slot: "bg-gray-100",
105
+ slotValue: "text-black/30"
106
+ }
107
+ },
108
+ {
109
+ variant: "dark",
110
+ disabled: true,
111
+ class: {
112
+ slot: "bg-gray-700",
113
+ slotValue: "text-white/40"
114
+ }
115
+ },
116
+ {
117
+ variant: "default",
118
+ isInvalid: true,
119
+ disabled: false,
120
+ class: {
121
+ slot: "border-danger-boundary"
122
+ }
123
+ },
124
+ {
125
+ variant: "light",
126
+ isInvalid: true,
127
+ disabled: false,
128
+ class: {
129
+ slot: "border-danger-boundary"
130
+ }
131
+ },
132
+ {
133
+ variant: "dark",
134
+ isInvalid: true,
135
+ disabled: false,
136
+ class: {
137
+ slot: "border-danger-boundary"
138
+ }
139
+ }
140
+ ],
141
+ defaultVariants: {
142
+ variant: "default",
143
+ selected: false,
144
+ disabled: false,
145
+ isInvalid: false
146
+ }
147
+ });
148
+ export {
149
+ otpInputTv
150
+ };
@@ -0,0 +1,2 @@
1
+ declare const _default: import('tsup').Options | import('tsup').Options[] | ((overrideOptions: import('tsup').Options) => import('tsup').Options | import('tsup').Options[] | Promise<import('tsup').Options | import('tsup').Options[]>);
2
+ export default _default;
@@ -1,5 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import React, { forwardRef, useRef, useCallback, useEffect, useMemo, memo } from "react";
2
+ import React__default, { forwardRef, useRef, useCallback, useEffect, useMemo, memo } from "react";
3
3
  import { usePanelDragDrop } from "../hooks/use-panel-drag-drop.js";
4
4
  import { SortablePaneContext, SortableRowDataContext, useSortableRowItem, useSortablePane } from "../context/sortable-context.js";
5
5
  import { tcx } from "../../../../shared/utils/tcx/tcx.js";
@@ -93,8 +93,8 @@ const PanelSortable = forwardRef(function PanelSortable2(props, ref) {
93
93
  SortableRowDataContext.Provider,
94
94
  {
95
95
  value: { item },
96
- children: /* @__PURE__ */ jsx(RowContainer, { children: React.Children.map(props.children, (child) => {
97
- if (React.isValidElement(child)) {
96
+ children: /* @__PURE__ */ jsx(RowContainer, { children: React__default.Children.map(props.children, (child) => {
97
+ if (React__default.isValidElement(child)) {
98
98
  return child;
99
99
  }
100
100
  return null;
@@ -1,4 +1,4 @@
1
- import React, { useMemo, useCallback } from "react";
1
+ import React__default, { useMemo, useCallback } from "react";
2
2
  import { createEditor } from "slate";
3
3
  import { withHistory } from "slate-history";
4
4
  import { withReact } from "slate-react";
@@ -16,10 +16,10 @@ const useEditorConfig = (props) => {
16
16
  disableTabFocus
17
17
  });
18
18
  const renderElement = useCallback((props2) => {
19
- return React.createElement(ElementRender, props2);
19
+ return React__default.createElement(ElementRender, props2);
20
20
  }, []);
21
21
  const renderLeaf = useCallback((props2) => {
22
- return React.createElement(LeafRender, props2);
22
+ return React__default.createElement(LeafRender, props2);
23
23
  }, []);
24
24
  return {
25
25
  editor,
@@ -1,63 +1,63 @@
1
1
  import { ParagraphPilcrow, ParagraphQuote, ParagraphCode, ParagraphHeading1, ParagraphHeading2, ParagraphHeading3, ParagraphListOrdered, ParagraphList, ParagraphListTodo, ParagraphBold, ParagraphItalic, ParagraphUnderline, ParagraphStrikethrough } from "@choiceform/icons-react";
2
- import React from "react";
2
+ import React__default from "react";
3
3
  const charactersOptions = [
4
4
  {
5
5
  format: "bold",
6
- icon: React.createElement(ParagraphBold)
6
+ icon: React__default.createElement(ParagraphBold)
7
7
  },
8
8
  {
9
9
  format: "italic",
10
- icon: React.createElement(ParagraphItalic)
10
+ icon: React__default.createElement(ParagraphItalic)
11
11
  },
12
12
  {
13
13
  format: "underlined",
14
- icon: React.createElement(ParagraphUnderline)
14
+ icon: React__default.createElement(ParagraphUnderline)
15
15
  },
16
16
  {
17
17
  format: "strikethrough",
18
- icon: React.createElement(ParagraphStrikethrough)
18
+ icon: React__default.createElement(ParagraphStrikethrough)
19
19
  },
20
20
  {
21
21
  format: "code",
22
- icon: React.createElement(ParagraphCode)
22
+ icon: React__default.createElement(ParagraphCode)
23
23
  }
24
24
  ];
25
25
  const paragraphOptions = [
26
26
  {
27
27
  format: "paragraph",
28
- icon: React.createElement(ParagraphPilcrow)
28
+ icon: React__default.createElement(ParagraphPilcrow)
29
29
  },
30
30
  {
31
31
  format: "block_quote",
32
- icon: React.createElement(ParagraphQuote)
32
+ icon: React__default.createElement(ParagraphQuote)
33
33
  },
34
34
  {
35
35
  format: "code",
36
- icon: React.createElement(ParagraphCode)
36
+ icon: React__default.createElement(ParagraphCode)
37
37
  },
38
38
  {
39
39
  format: "h1",
40
- icon: React.createElement(ParagraphHeading1)
40
+ icon: React__default.createElement(ParagraphHeading1)
41
41
  },
42
42
  {
43
43
  format: "h2",
44
- icon: React.createElement(ParagraphHeading2)
44
+ icon: React__default.createElement(ParagraphHeading2)
45
45
  },
46
46
  {
47
47
  format: "h3",
48
- icon: React.createElement(ParagraphHeading3)
48
+ icon: React__default.createElement(ParagraphHeading3)
49
49
  },
50
50
  {
51
51
  format: "numbered_list",
52
- icon: React.createElement(ParagraphListOrdered)
52
+ icon: React__default.createElement(ParagraphListOrdered)
53
53
  },
54
54
  {
55
55
  format: "bulleted_list",
56
- icon: React.createElement(ParagraphList)
56
+ icon: React__default.createElement(ParagraphList)
57
57
  },
58
58
  {
59
59
  format: "check_list",
60
- icon: React.createElement(ParagraphListTodo)
60
+ icon: React__default.createElement(ParagraphListTodo)
61
61
  }
62
62
  ];
63
63
  export {
@@ -1,7 +1,7 @@
1
1
  import { Slot } from "../../slot/dist/index.js";
2
2
  import { MenuValue, MenuTrigger, MenuContextLabel, MenuContextItem, MenuEmpty, MenuDivider, MenuContextContent, useMenuScroll, MenuContext, MenuScrollArrow } from "../../menus/dist/index.js";
3
3
  import { useFloatingParentNodeId, FloatingTree, useFloatingNodeId, useFloating, offset, shift, flip, size, inner, autoUpdate, useClick, useDismiss, useRole, useInnerOffset, useListNavigation, useTypeahead, useInteractions, FloatingNode, FloatingPortal, FloatingOverlay, FloatingFocusManager, FloatingList } from "@floating-ui/react";
4
- import React, { memo, useMemo, Children, isValidElement, useRef, useState, useId, useEffect, cloneElement } from "react";
4
+ import React__default, { memo, useMemo, Children, isValidElement, useRef, useState, useId, useEffect, cloneElement } from "react";
5
5
  import { useEventCallback } from "usehooks-ts";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { tcx } from "../../../shared/utils/tcx/tcx.js";
@@ -47,7 +47,7 @@ var SelectComponent = memo(function SelectComponent2(props) {
47
47
  if (!isValidElement(child)) return;
48
48
  if (child.type === MenuContextItem || child.type === MenuDivider || child.type === MenuContextLabel || child.type === MenuEmpty) {
49
49
  result.push(child);
50
- } else if (child.type === React.Fragment && child.props.children) {
50
+ } else if (child.type === React__default.Fragment && child.props.children) {
51
51
  const fragmentChildren = Children.toArray(child.props.children);
52
52
  result.push(...extractSelectItems(fragmentChildren));
53
53
  }
@@ -94,6 +94,7 @@ var SelectComponent = memo(function SelectComponent2(props) {
94
94
  const allowMouseUpRef = useRef(true);
95
95
  const selectTimeoutRef = useRef();
96
96
  const scrollRef = useRef(null);
97
+ const isMouseDownFromTriggerRef = useRef(false);
97
98
  const refs = useMemo(
98
99
  () => ({
99
100
  list: listRef,
@@ -102,7 +103,8 @@ var SelectComponent = memo(function SelectComponent2(props) {
102
103
  allowSelect: allowSelectRef,
103
104
  allowMouseUp: allowMouseUpRef,
104
105
  selectTimeout: selectTimeoutRef,
105
- scroll: scrollRef
106
+ scroll: scrollRef,
107
+ isMouseDownFromTrigger: isMouseDownFromTriggerRef
106
108
  }),
107
109
  []
108
110
  // refs are stable references, no dependencies needed
@@ -232,6 +234,7 @@ var SelectComponent = memo(function SelectComponent2(props) {
232
234
  } else {
233
235
  refs.allowSelect.current = false;
234
236
  refs.allowMouseUp.current = true;
237
+ refs.isMouseDownFromTrigger.current = false;
235
238
  }
236
239
  }, [isControlledOpen]);
237
240
  const { handleArrowScroll, handleArrowHide, scrollProps } = useMenuScroll({
@@ -319,6 +322,13 @@ var SelectComponent = memo(function SelectComponent2(props) {
319
322
  },
320
323
  onMouseUp: () => {
321
324
  if (!refs.allowMouseUp.current || customActive) return;
325
+ if (refs.isMouseDownFromTrigger.current) {
326
+ refs.isMouseDownFromTrigger.current = false;
327
+ if (!isDisabled) {
328
+ handleSelect(currentSelectableIndex);
329
+ }
330
+ return;
331
+ }
322
332
  if (refs.allowSelect.current) {
323
333
  handleSelect(currentSelectableIndex);
324
334
  }
@@ -380,6 +390,9 @@ var SelectComponent = memo(function SelectComponent2(props) {
380
390
  onTouchStart() {
381
391
  setTouch(true);
382
392
  },
393
+ onMouseDown() {
394
+ refs.isMouseDownFromTrigger.current = true;
395
+ },
383
396
  onPointerMove({ pointerType }) {
384
397
  if (pointerType !== "touch") {
385
398
  setTouch(false);
@@ -399,6 +412,9 @@ var SelectComponent = memo(function SelectComponent2(props) {
399
412
  {
400
413
  lockScroll: !touch,
401
414
  className: tcx("z-menu", focusManagerProps.modal ? "" : "pointer-events-none"),
415
+ onMouseUp: () => {
416
+ refs.isMouseDownFromTrigger.current = false;
417
+ },
402
418
  children: /* @__PURE__ */ jsx(
403
419
  FloatingFocusManager,
404
420
  {