@wealthx/shadcn 1.5.28 → 1.5.30

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 (53) hide show
  1. package/.turbo/turbo-build.log +134 -134
  2. package/CHANGELOG.md +12 -0
  3. package/dist/{chunk-DWJHPNFL.mjs → chunk-4UT3RZ2D.mjs} +32 -16
  4. package/dist/{chunk-CE2WONIY.mjs → chunk-AE4JKISB.mjs} +27 -31
  5. package/dist/chunk-BZWQU52U.mjs +1025 -0
  6. package/dist/{chunk-RNLIZRAK.mjs → chunk-C6R42PCL.mjs} +1 -1
  7. package/dist/{chunk-EVUY67CY.mjs → chunk-FTQ2AKZ2.mjs} +1 -1
  8. package/dist/{chunk-7T4TYUO3.mjs → chunk-H5ZD63NT.mjs} +31 -16
  9. package/dist/{chunk-SO4RB3XB.mjs → chunk-IEQX4UVP.mjs} +2 -2
  10. package/dist/chunk-IKVF4XE2.mjs +94 -0
  11. package/dist/{chunk-KPGARKFC.mjs → chunk-MS3GNXMB.mjs} +1 -1
  12. package/dist/{chunk-M32QNCD3.mjs → chunk-OSSS56CB.mjs} +1 -1
  13. package/dist/{chunk-36IN7YRM.mjs → chunk-SCGCGVDN.mjs} +1 -1
  14. package/dist/{chunk-KJQ3BVTB.mjs → chunk-X2NIDXFB.mjs} +1 -1
  15. package/dist/components/ui/ai-builder/index.js +993 -12
  16. package/dist/components/ui/ai-builder/index.mjs +27 -3
  17. package/dist/components/ui/ai-conversations/index.js +27 -31
  18. package/dist/components/ui/ai-conversations/index.mjs +1 -1
  19. package/dist/components/ui/backoffice-signup-steps.js +98 -48
  20. package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
  21. package/dist/components/ui/bank-statement-generate-dialog.mjs +2 -2
  22. package/dist/components/ui/chat-widget.js +1 -1
  23. package/dist/components/ui/chat-widget.mjs +2 -2
  24. package/dist/components/ui/contact-alert-dialog/index.mjs +2 -2
  25. package/dist/components/ui/field.js +1 -1
  26. package/dist/components/ui/field.mjs +1 -1
  27. package/dist/components/ui/frontend-signup-steps.js +166 -90
  28. package/dist/components/ui/frontend-signup-steps.mjs +4 -5
  29. package/dist/components/ui/password-strength-tooltip.js +81 -107
  30. package/dist/components/ui/password-strength-tooltip.mjs +3 -2
  31. package/dist/components/ui/property-report-dialog.mjs +2 -2
  32. package/dist/components/ui/signup-form-primitives.js +117 -114
  33. package/dist/components/ui/signup-form-primitives.mjs +3 -4
  34. package/dist/components/ui/two-fa-setup-form.js +31 -16
  35. package/dist/components/ui/two-fa-setup-form.mjs +2 -2
  36. package/dist/index.js +5061 -4992
  37. package/dist/index.mjs +12 -12
  38. package/dist/styles.css +1 -1
  39. package/package.json +4 -1
  40. package/src/components/index.tsx +0 -2
  41. package/src/components/ui/ai-builder/agent-card.tsx +7 -5
  42. package/src/components/ui/ai-builder/agent-settings.tsx +709 -0
  43. package/src/components/ui/ai-builder/index.tsx +27 -2
  44. package/src/components/ui/ai-builder/service-config-modal.tsx +11 -11
  45. package/src/components/ui/ai-builder/types.ts +27 -15
  46. package/src/components/ui/ai-conversations/thread.tsx +9 -11
  47. package/src/components/ui/field.tsx +12 -12
  48. package/src/components/ui/password-strength-tooltip.tsx +89 -47
  49. package/src/components/ui/signup-form-primitives.tsx +34 -16
  50. package/src/components/ui/two-fa-setup-form.tsx +41 -31
  51. package/src/styles/styles-css.ts +1 -1
  52. package/dist/chunk-T5PGVLMR.mjs +0 -479
  53. package/dist/chunk-WHIW6KOB.mjs +0 -57
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @wealthx/shadcn
2
2
 
3
+ ## 1.5.30
4
+
5
+ ### Patch Changes
6
+
7
+ - 1d11862: Fix password tooltip and update 2fa layout
8
+
9
+ ## 1.5.29
10
+
11
+ ### Patch Changes
12
+
13
+ - 115a671: Update to ai conversation and integration
14
+
3
15
  ## 1.5.28
4
16
 
5
17
  ### Patch Changes
@@ -1,11 +1,12 @@
1
1
  import {
2
+ PASSWORD_STRENGTH_RULES,
2
3
  PasswordStrengthTooltip
3
- } from "./chunk-WHIW6KOB.mjs";
4
+ } from "./chunk-IKVF4XE2.mjs";
4
5
  import {
5
6
  Field,
6
7
  FieldError,
7
8
  FieldLabel
8
- } from "./chunk-KPGARKFC.mjs";
9
+ } from "./chunk-MS3GNXMB.mjs";
9
10
  import {
10
11
  Select,
11
12
  SelectContent,
@@ -21,7 +22,7 @@ import {
21
22
  } from "./chunk-NOOEKOWY.mjs";
22
23
 
23
24
  // src/components/ui/signup-form-primitives.tsx
24
- import { useState } from "react";
25
+ import { useEffect, useRef, useState } from "react";
25
26
  import { EyeIcon, EyeOffIcon, Trash2Icon } from "lucide-react";
26
27
  import { jsx, jsxs } from "react/jsx-runtime";
27
28
  function SectionHeading({ children }) {
@@ -36,13 +37,6 @@ function FormField({ label, required, children }) {
36
37
  children
37
38
  ] });
38
39
  }
39
- var STRENGTH_RULES = [
40
- { test: (p) => p.length >= 8 },
41
- { test: (p) => /[A-Z]/.test(p) },
42
- { test: (p) => /[a-z]/.test(p) },
43
- { test: (p) => /\d/.test(p) },
44
- { test: (p) => /[^A-Za-z0-9]/.test(p) }
45
- ];
46
40
  function PasswordField({
47
41
  label,
48
42
  placeholder,
@@ -54,13 +48,26 @@ function PasswordField({
54
48
  const [error, setError] = useState("");
55
49
  const [touched, setTouched] = useState(false);
56
50
  const [value, setValue] = useState("");
57
- const [typingStarted, setTypingStarted] = useState(false);
58
- const allRulesPass = STRENGTH_RULES.every((r) => r.test(value));
59
- const isPopoverOpen = !!showStrengthPopover && typingStarted && !allRulesPass;
51
+ const [dismissed, setDismissed] = useState(false);
52
+ const wrapperRef = useRef(null);
53
+ const allRulesPass = PASSWORD_STRENGTH_RULES.every((r) => r.test(value));
54
+ const isPopoverOpen = !!showStrengthPopover && !dismissed && value.length > 0 && !allRulesPass;
60
55
  const validate = (v) => {
61
- if (v.length > 0 && v.length < 8) return "Min. 8 characters required";
56
+ if (!v) return "";
57
+ if (v.length < 8) return "Min. 8 characters required";
58
+ if (!PASSWORD_STRENGTH_RULES.every((r) => r.test(v)))
59
+ return "Password doesn't meet all requirements";
62
60
  return "";
63
61
  };
62
+ useEffect(() => {
63
+ if (!isPopoverOpen) return;
64
+ const onMouseDown = (e) => {
65
+ var _a;
66
+ if (!((_a = wrapperRef.current) == null ? void 0 : _a.contains(e.target))) setDismissed(true);
67
+ };
68
+ document.addEventListener("mousedown", onMouseDown, true);
69
+ return () => document.removeEventListener("mousedown", onMouseDown, true);
70
+ }, [isPopoverOpen]);
64
71
  const inputEl = /* @__PURE__ */ jsxs("div", { className: "relative", children: [
65
72
  /* @__PURE__ */ jsx(
66
73
  Input,
@@ -73,8 +80,16 @@ function PasswordField({
73
80
  const v = e.target.value;
74
81
  setValue(v);
75
82
  onValueChange == null ? void 0 : onValueChange(v);
76
- if (!typingStarted && v.length > 0) setTypingStarted(true);
77
83
  if (touched) setError(validate(v));
84
+ setDismissed(false);
85
+ },
86
+ onFocus: () => setDismissed(false),
87
+ onKeyDown: (e) => {
88
+ if (e.key === "Tab") {
89
+ setTouched(true);
90
+ setError(validate(value));
91
+ setDismissed(true);
92
+ }
78
93
  },
79
94
  onBlur: () => {
80
95
  setTouched(true);
@@ -101,13 +116,14 @@ function PasswordField({
101
116
  showStrengthPopover ? /* @__PURE__ */ jsx(
102
117
  PasswordStrengthTooltip,
103
118
  {
119
+ ref: wrapperRef,
104
120
  open: isPopoverOpen,
105
121
  password: value,
106
122
  side: "right",
107
123
  children: inputEl
108
124
  }
109
125
  ) : inputEl,
110
- /* @__PURE__ */ jsx("div", { className: "min-h-5", children: touched && error && /* @__PURE__ */ jsx(FieldError, { children: error }) })
126
+ /* @__PURE__ */ jsx("div", { className: "min-h-5", children: touched && error && !isPopoverOpen && /* @__PURE__ */ jsx(FieldError, { children: error }) })
111
127
  ] });
112
128
  }
113
129
  var DEFAULT_ROLE_OPTIONS = ["Admin", "Broker", "Support"];
@@ -534,6 +534,7 @@ function ChatComposer({
534
534
  emailReplySubject,
535
535
  className
536
536
  }) {
537
+ const initialChannelRef = React.useRef(channelProp);
537
538
  const [channel, setChannel] = React.useState(
538
539
  isEmailIntegrated ? channelProp : "chat"
539
540
  );
@@ -731,35 +732,29 @@ function ChatComposer({
731
732
  /* @__PURE__ */ jsx3(ComposerLinkPopover, { editor }),
732
733
  /* @__PURE__ */ jsx3(ComposerToolbarButton, { label: "Attach file", icon: Paperclip })
733
734
  ] }),
734
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
735
- onLetAiHandle && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
736
- /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
737
- "Let AI Handle"
738
- ] }),
739
- /* @__PURE__ */ jsxs2(
740
- Button,
741
- {
742
- size: "sm",
743
- onClick: () => {
744
- var _a;
745
- const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
746
- onSendEmail == null ? void 0 : onSendEmail({
747
- content: html,
748
- to: emailTo,
749
- cc: emailCc,
750
- subject: emailSubject,
751
- isReply: emailMode === "reply"
752
- });
753
- editor == null ? void 0 : editor.commands.clearContent();
754
- },
755
- disabled: !editor || editor.isEmpty || !emailTo.trim(),
756
- children: [
757
- /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
758
- "Send Email"
759
- ]
760
- }
761
- )
762
- ] })
735
+ /* @__PURE__ */ jsx3("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxs2(
736
+ Button,
737
+ {
738
+ size: "sm",
739
+ onClick: () => {
740
+ var _a;
741
+ const html = (_a = editor == null ? void 0 : editor.getHTML()) != null ? _a : "";
742
+ onSendEmail == null ? void 0 : onSendEmail({
743
+ content: html,
744
+ to: emailTo,
745
+ cc: emailCc,
746
+ subject: emailSubject,
747
+ isReply: emailMode === "reply"
748
+ });
749
+ editor == null ? void 0 : editor.commands.clearContent();
750
+ },
751
+ disabled: !editor || editor.isEmpty || !emailTo.trim(),
752
+ children: [
753
+ /* @__PURE__ */ jsx3(Send, { className: "mr-1.5 size-3.5" }),
754
+ "Send Email"
755
+ ]
756
+ }
757
+ ) })
763
758
  ] })
764
759
  ]
765
760
  }
@@ -775,7 +770,7 @@ function ChatComposer({
775
770
  }
776
771
  ),
777
772
  /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between", children: [
778
- /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
773
+ initialChannelRef.current !== "email" && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
779
774
  /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
780
775
  "Let AI Handle"
781
776
  ] }),
@@ -783,6 +778,7 @@ function ChatComposer({
783
778
  Button,
784
779
  {
785
780
  size: "sm",
781
+ className: "ml-auto",
786
782
  onClick: () => onSend == null ? void 0 : onSend(inputValue),
787
783
  disabled: !inputValue.trim(),
788
784
  children: [
@@ -899,7 +895,7 @@ function ChatThread({
899
895
  /* @__PURE__ */ jsxs2("div", { className: "hidden items-center gap-2 md:flex", children: [
900
896
  isClosed && /* @__PURE__ */ jsx3(Button, { variant: "outline", size: "sm", onClick: onReopen, children: "Reopen" }),
901
897
  !isClosed && aiIsHandling && /* @__PURE__ */ jsx3(Button, { size: "sm", onClick: onTakeOver, children: "Take Over" }),
902
- !isClosed && !aiIsHandling && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
898
+ !isClosed && !aiIsHandling && channel !== "email" && /* @__PURE__ */ jsxs2(Button, { variant: "outline", size: "sm", onClick: onLetAiHandle, children: [
903
899
  /* @__PURE__ */ jsx3(Bot, { className: "mr-1.5 size-3.5" }),
904
900
  "Let AI Handle"
905
901
  ] })