nucleus-core-ts 0.8.6 → 0.8.8

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 (209) hide show
  1. package/dist/client.js +1 -1
  2. package/dist/dist/index.d.ts +475 -12
  3. package/dist/fe/components/AbstractAnimatedBackground/index.js +437 -0
  4. package/dist/fe/components/AuthorizationPage/components/AuthorizationPage.js +841 -0
  5. package/dist/fe/components/AuthorizationPage/components/ClaimList.js +100 -0
  6. package/dist/fe/components/AuthorizationPage/components/RoleClaimEditor.js +232 -0
  7. package/dist/fe/components/AuthorizationPage/components/RoleList.js +115 -0
  8. package/dist/fe/components/AuthorizationPage/index.js +6 -0
  9. package/dist/fe/components/AuthorizationPage/store/index.js +117 -0
  10. package/dist/fe/components/AuthorizationPage/theme/index.js +137 -0
  11. package/dist/fe/components/AuthorizationPage/types/index.js +1 -0
  12. package/dist/fe/components/Button/components/Button.js +158 -0
  13. package/dist/fe/components/Button/components/ButtonSpinner.js +52 -0
  14. package/dist/fe/components/Button/index.js +3 -0
  15. package/dist/fe/components/Button/theme/index.js +186 -0
  16. package/dist/fe/components/Button/types/index.js +1 -0
  17. package/dist/fe/components/Button/utils/cn.js +5 -0
  18. package/dist/fe/components/Captcha/components/Captcha.js +311 -0
  19. package/dist/fe/components/Captcha/index.js +2 -0
  20. package/dist/fe/components/Captcha/theme.js +52 -0
  21. package/dist/fe/components/Captcha/types.js +1 -0
  22. package/dist/fe/components/ChangePasswordPage/components/ChangePasswordForm.js +242 -0
  23. package/dist/fe/components/ChangePasswordPage/components/ChangePasswordHeader.js +39 -0
  24. package/dist/fe/components/ChangePasswordPage/components/ChangePasswordPage.js +60 -0
  25. package/dist/fe/components/ChangePasswordPage/index.js +5 -0
  26. package/dist/fe/components/ChangePasswordPage/store/index.js +44 -0
  27. package/dist/fe/components/ChangePasswordPage/theme/index.js +87 -0
  28. package/dist/fe/components/ChangePasswordPage/types/index.js +1 -0
  29. package/dist/fe/components/Checkbox/components/Checkbox.js +115 -0
  30. package/dist/fe/components/Checkbox/components/CheckboxIcon.js +119 -0
  31. package/dist/fe/components/Checkbox/components/SwitchTrack.js +178 -0
  32. package/dist/fe/components/Checkbox/index.js +4 -0
  33. package/dist/fe/components/Checkbox/theme/index.js +221 -0
  34. package/dist/fe/components/Checkbox/types/index.js +1 -0
  35. package/dist/fe/components/Checkbox/utils/cn.js +5 -0
  36. package/dist/fe/components/DataTable/DataTable.js +225 -0
  37. package/dist/fe/components/DataTable/components/ActionCell.js +26 -0
  38. package/dist/fe/components/DataTable/components/DataCell.js +76 -0
  39. package/dist/fe/components/DataTable/components/EditableCell.js +221 -0
  40. package/dist/fe/components/DataTable/components/EmptyState.js +29 -0
  41. package/dist/fe/components/DataTable/components/HeaderCell.js +64 -0
  42. package/dist/fe/components/DataTable/components/InfiniteScrollTrigger.js +66 -0
  43. package/dist/fe/components/DataTable/components/LoadingSpinner.js +19 -0
  44. package/dist/fe/components/DataTable/components/ResizeHandle.js +41 -0
  45. package/dist/fe/components/DataTable/components/SelectionCell.js +105 -0
  46. package/dist/fe/components/DataTable/components/SkeletonRow.js +56 -0
  47. package/dist/fe/components/DataTable/components/SkeletonTable.js +83 -0
  48. package/dist/fe/components/DataTable/components/SortIcon.js +39 -0
  49. package/dist/fe/components/DataTable/components/TableHeader.js +49 -0
  50. package/dist/fe/components/DataTable/components/TableRow.js +118 -0
  51. package/dist/fe/components/DataTable/components/index.js +14 -0
  52. package/dist/fe/components/DataTable/hooks/index.js +2 -0
  53. package/dist/fe/components/DataTable/hooks/useAutoFitColumn.js +23 -0
  54. package/dist/fe/components/DataTable/hooks/useResizeColumn.js +122 -0
  55. package/dist/fe/components/DataTable/index.js +3 -0
  56. package/dist/fe/components/DataTable/store/index.js +97 -0
  57. package/dist/fe/components/DataTable/theme/index.js +144 -0
  58. package/dist/fe/components/DataTable/types/index.js +1 -0
  59. package/dist/fe/components/DataTable/utils/cn.js +5 -0
  60. package/dist/fe/components/DatePicker/components/CalendarGrid.js +95 -0
  61. package/dist/fe/components/DatePicker/components/CalendarHeader.js +152 -0
  62. package/dist/fe/components/DatePicker/components/DatePicker.js +381 -0
  63. package/dist/fe/components/DatePicker/components/MonthYearSelector.js +93 -0
  64. package/dist/fe/components/DatePicker/index.js +7 -0
  65. package/dist/fe/components/DatePicker/locales/index.js +1113 -0
  66. package/dist/fe/components/DatePicker/theme/index.js +315 -0
  67. package/dist/fe/components/DatePicker/types/index.js +1 -0
  68. package/dist/fe/components/DatePicker/utils/cn.js +5 -0
  69. package/dist/fe/components/DatePicker/utils/date.js +132 -0
  70. package/dist/fe/components/DevicesPage/components/DeviceCard.js +251 -0
  71. package/dist/fe/components/DevicesPage/components/DevicesHeader.js +42 -0
  72. package/dist/fe/components/DevicesPage/components/DevicesPage.js +450 -0
  73. package/dist/fe/components/DevicesPage/index.js +5 -0
  74. package/dist/fe/components/DevicesPage/store/index.js +55 -0
  75. package/dist/fe/components/DevicesPage/theme/index.js +131 -0
  76. package/dist/fe/components/DevicesPage/types/index.js +1 -0
  77. package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordForm.js +214 -0
  78. package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordHeader.js +42 -0
  79. package/dist/fe/components/ForgotPasswordPage/components/ForgotPasswordPage.js +59 -0
  80. package/dist/fe/components/ForgotPasswordPage/index.js +5 -0
  81. package/dist/fe/components/ForgotPasswordPage/store/index.js +28 -0
  82. package/dist/fe/components/ForgotPasswordPage/theme/index.js +87 -0
  83. package/dist/fe/components/ForgotPasswordPage/types/index.js +1 -0
  84. package/dist/fe/components/FormBuilder/components/FormBuilder.js +156 -0
  85. package/dist/fe/components/FormBuilder/components/FormField.js +218 -0
  86. package/dist/fe/components/FormBuilder/hooks/useFormBuilder.js +152 -0
  87. package/dist/fe/components/FormBuilder/index.js +4 -0
  88. package/dist/fe/components/FormBuilder/theme/index.js +134 -0
  89. package/dist/fe/components/FormBuilder/types/index.js +1 -0
  90. package/dist/fe/components/FormBuilder/utils/cn.js +5 -0
  91. package/dist/fe/components/FormBuilder/utils/fieldMapping.js +216 -0
  92. package/dist/fe/components/FormBuilder/utils/validation.js +78 -0
  93. package/dist/fe/components/LoginPage/components/LoginForm.js +214 -0
  94. package/dist/fe/components/LoginPage/components/LoginHeader.js +24 -0
  95. package/dist/fe/components/LoginPage/components/LoginPage.js +138 -0
  96. package/dist/fe/components/LoginPage/index.js +5 -0
  97. package/dist/fe/components/LoginPage/store/index.js +59 -0
  98. package/dist/fe/components/LoginPage/theme/index.js +98 -0
  99. package/dist/fe/components/LoginPage/types/index.js +1 -0
  100. package/dist/fe/components/MagicLinkVerifyPage/components/MagicLinkVerifyPage.js +200 -0
  101. package/dist/fe/components/MagicLinkVerifyPage/index.js +3 -0
  102. package/dist/fe/components/MagicLinkVerifyPage/store.js +20 -0
  103. package/dist/fe/components/MagicLinkVerifyPage/theme.js +36 -0
  104. package/dist/fe/components/MagicLinkVerifyPage/types.js +1 -0
  105. package/dist/fe/components/NucleusEntityShowcase.js +1409 -0
  106. package/dist/fe/components/NucleusTextInput/components/FloatingLabel.js +56 -0
  107. package/dist/fe/components/NucleusTextInput/components/InputIcons.js +258 -0
  108. package/dist/fe/components/NucleusTextInput/components/NucleusTextInput.js +321 -0
  109. package/dist/fe/components/NucleusTextInput/components/PasswordStrengthIndicator.js +104 -0
  110. package/dist/fe/components/NucleusTextInput/components/TypewriterText.js +56 -0
  111. package/dist/fe/components/NucleusTextInput/index.js +7 -0
  112. package/dist/fe/components/NucleusTextInput/theme/index.js +121 -0
  113. package/dist/fe/components/NucleusTextInput/types/index.js +1 -0
  114. package/dist/fe/components/NucleusTextInput/utils/cn.js +5 -0
  115. package/dist/fe/components/NucleusTextInput/utils/format.js +62 -0
  116. package/dist/fe/components/NucleusTextInput/utils/validation.js +191 -0
  117. package/dist/fe/components/ProfilePage/components/AddressCard.js +196 -0
  118. package/dist/fe/components/ProfilePage/components/PhoneCard.js +206 -0
  119. package/dist/fe/components/ProfilePage/components/ProfileHeader.js +150 -0
  120. package/dist/fe/components/ProfilePage/components/ProfilePage.js +1336 -0
  121. package/dist/fe/components/ProfilePage/index.js +6 -0
  122. package/dist/fe/components/ProfilePage/store/index.js +115 -0
  123. package/dist/fe/components/ProfilePage/theme/index.js +168 -0
  124. package/dist/fe/components/ProfilePage/types/index.js +1 -0
  125. package/dist/fe/components/RangePicker/components/RangePicker.js +338 -0
  126. package/dist/fe/components/RangePicker/components/RangeThumb.js +68 -0
  127. package/dist/fe/components/RangePicker/components/RangeTooltip.js +45 -0
  128. package/dist/fe/components/RangePicker/components/RangeTrack.js +32 -0
  129. package/dist/fe/components/RangePicker/index.js +5 -0
  130. package/dist/fe/components/RangePicker/theme/index.js +88 -0
  131. package/dist/fe/components/RangePicker/types/index.js +1 -0
  132. package/dist/fe/components/RangePicker/utils/cn.js +3 -0
  133. package/dist/fe/components/RegisterPage/components/PasswordStrengthIndicator.js +107 -0
  134. package/dist/fe/components/RegisterPage/components/RegisterForm.js +322 -0
  135. package/dist/fe/components/RegisterPage/components/RegisterHeader.js +23 -0
  136. package/dist/fe/components/RegisterPage/components/RegisterPage.js +85 -0
  137. package/dist/fe/components/RegisterPage/index.js +6 -0
  138. package/dist/fe/components/RegisterPage/store/index.js +106 -0
  139. package/dist/fe/components/RegisterPage/theme/index.js +128 -0
  140. package/dist/fe/components/RegisterPage/types/index.js +1 -0
  141. package/dist/fe/components/ResetPasswordPage/components/ResetPasswordForm.js +347 -0
  142. package/dist/fe/components/ResetPasswordPage/components/ResetPasswordHeader.js +42 -0
  143. package/dist/fe/components/ResetPasswordPage/components/ResetPasswordPage.js +61 -0
  144. package/dist/fe/components/ResetPasswordPage/index.js +5 -0
  145. package/dist/fe/components/ResetPasswordPage/store/index.js +36 -0
  146. package/dist/fe/components/ResetPasswordPage/theme/index.js +99 -0
  147. package/dist/fe/components/ResetPasswordPage/types/index.js +1 -0
  148. package/dist/fe/components/SearchBox/components/SearchBox.js +271 -0
  149. package/dist/fe/components/SearchBox/components/SearchBoxDropdown.js +87 -0
  150. package/dist/fe/components/SearchBox/index.js +5 -0
  151. package/dist/fe/components/SearchBox/theme/index.js +184 -0
  152. package/dist/fe/components/SearchBox/types/index.js +1 -0
  153. package/dist/fe/components/SearchBox/utils/cn.js +5 -0
  154. package/dist/fe/components/SearchBox/utils/debounce.js +22 -0
  155. package/dist/fe/components/SearchBox/utils/sanitize.js +48 -0
  156. package/dist/fe/components/SelectBox/components/SelectBox.js +364 -0
  157. package/dist/fe/components/SelectBox/components/SelectDropdown.js +92 -0
  158. package/dist/fe/components/SelectBox/components/SelectOptionItem.js +43 -0
  159. package/dist/fe/components/SelectBox/components/SelectTrigger.js +22 -0
  160. package/dist/fe/components/SelectBox/index.js +5 -0
  161. package/dist/fe/components/SelectBox/theme/index.js +98 -0
  162. package/dist/fe/components/SelectBox/types/index.js +1 -0
  163. package/dist/fe/components/SelectBox/utils/cn.js +3 -0
  164. package/dist/fe/components/SetPasswordPage/components/PasswordStrengthIndicator.js +107 -0
  165. package/dist/fe/components/SetPasswordPage/components/SetPasswordForm.js +142 -0
  166. package/dist/fe/components/SetPasswordPage/components/SetPasswordHeader.js +23 -0
  167. package/dist/fe/components/SetPasswordPage/components/SetPasswordPage.js +263 -0
  168. package/dist/fe/components/SetPasswordPage/index.js +7 -0
  169. package/dist/fe/components/SetPasswordPage/store/index.js +79 -0
  170. package/dist/fe/components/SetPasswordPage/theme/index.js +98 -0
  171. package/dist/fe/components/SetPasswordPage/types/index.js +12 -0
  172. package/dist/fe/components/UsersPage/components/InviteUserModal.js +262 -0
  173. package/dist/fe/components/UsersPage/components/Pagination.js +147 -0
  174. package/dist/fe/components/UsersPage/components/RoleAssignmentModal.js +186 -0
  175. package/dist/fe/components/UsersPage/components/StatsCards.js +124 -0
  176. package/dist/fe/components/UsersPage/components/UserDetailDrawer.js +444 -0
  177. package/dist/fe/components/UsersPage/components/UserFilters.js +142 -0
  178. package/dist/fe/components/UsersPage/components/UserListItem.js +125 -0
  179. package/dist/fe/components/UsersPage/components/UserListSkeleton.js +40 -0
  180. package/dist/fe/components/UsersPage/components/UsersPage.js +556 -0
  181. package/dist/fe/components/UsersPage/index.js +10 -0
  182. package/dist/fe/components/UsersPage/store/index.js +151 -0
  183. package/dist/fe/components/UsersPage/theme/index.js +231 -0
  184. package/dist/fe/components/UsersPage/types/index.js +1 -0
  185. package/dist/fe/components/VerifyEmailPage/components/VerifyEmailPage.js +290 -0
  186. package/dist/fe/components/VerifyEmailPage/index.js +3 -0
  187. package/dist/fe/components/VerifyEmailPage/store/index.js +45 -0
  188. package/dist/fe/components/VerifyEmailPage/theme/index.js +52 -0
  189. package/dist/fe/components/VerifyEmailPage/types/index.js +1 -0
  190. package/dist/fe/hooks/useNucleusEntity.js +247 -0
  191. package/dist/fe/index.js +28 -110
  192. package/dist/fe/types/index.js +1 -0
  193. package/dist/fe/utils/cn.js +5 -0
  194. package/dist/fe/utils/columnUtils.js +189 -0
  195. package/dist/fe/utils/endpointKeys.js +44 -0
  196. package/dist/index.js +1 -1
  197. package/dist/nucleus.config.d.ts +3 -0
  198. package/dist/src/Client/Proxy/httpProxy.js +1 -0
  199. package/dist/src/Client/Proxy/index.js +1 -1
  200. package/dist/src/Client/Proxy/server.js +1 -0
  201. package/dist/src/Client/Proxy/types.js +1 -0
  202. package/dist/src/Client/Proxy/utils.js +1 -0
  203. package/dist/src/Client/Proxy/wsProxy.js +1 -0
  204. package/package.json +1 -1
  205. package/scripts/build.ts +78 -8
  206. package/dist/dist/index-0yyw12k6.d.ts +0 -8
  207. package/dist/dist/index-tv67j5qd.d.ts +0 -488
  208. package/dist/index-0yyw12k6.js +0 -1
  209. package/dist/index-tv67j5qd.js +0 -1
@@ -0,0 +1,196 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../../utils/cn";
4
+ import { Button } from "../../Button";
5
+ import { profilePageTheme } from "../theme";
6
+ export function AddressCard({ address, onEdit, onDelete, isUpdating, isDeleting, allowEdit = true }) {
7
+ const theme = profilePageTheme;
8
+ const isPending = address.id.startsWith("temp-");
9
+ const formatAddress = ()=>{
10
+ const parts = [
11
+ address.street,
12
+ address.apartment,
13
+ address.neighborhood,
14
+ address.district,
15
+ address.city,
16
+ address.state,
17
+ address.province,
18
+ address.zip,
19
+ address.country
20
+ ].filter(Boolean);
21
+ return parts.join(", ") || "No address details";
22
+ };
23
+ const getTypeIcon = ()=>{
24
+ if (address.type === "home" || address.type === "residential") {
25
+ return /*#__PURE__*/ _jsxs("svg", {
26
+ className: "w-5 h-5",
27
+ viewBox: "0 0 24 24",
28
+ fill: "none",
29
+ stroke: "currentColor",
30
+ strokeWidth: "2",
31
+ children: [
32
+ /*#__PURE__*/ _jsx("title", {
33
+ children: "Home"
34
+ }),
35
+ /*#__PURE__*/ _jsx("path", {
36
+ strokeLinecap: "round",
37
+ strokeLinejoin: "round",
38
+ d: "M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"
39
+ })
40
+ ]
41
+ });
42
+ }
43
+ if (address.type === "work" || address.type === "office") {
44
+ return /*#__PURE__*/ _jsxs("svg", {
45
+ className: "w-5 h-5",
46
+ viewBox: "0 0 24 24",
47
+ fill: "none",
48
+ stroke: "currentColor",
49
+ strokeWidth: "2",
50
+ children: [
51
+ /*#__PURE__*/ _jsx("title", {
52
+ children: "Work"
53
+ }),
54
+ /*#__PURE__*/ _jsx("path", {
55
+ strokeLinecap: "round",
56
+ strokeLinejoin: "round",
57
+ d: "M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21"
58
+ })
59
+ ]
60
+ });
61
+ }
62
+ return /*#__PURE__*/ _jsxs("svg", {
63
+ className: "w-5 h-5",
64
+ viewBox: "0 0 24 24",
65
+ fill: "none",
66
+ stroke: "currentColor",
67
+ strokeWidth: "2",
68
+ children: [
69
+ /*#__PURE__*/ _jsx("title", {
70
+ children: "Location"
71
+ }),
72
+ /*#__PURE__*/ _jsx("path", {
73
+ strokeLinecap: "round",
74
+ strokeLinejoin: "round",
75
+ d: "M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"
76
+ }),
77
+ /*#__PURE__*/ _jsx("path", {
78
+ strokeLinecap: "round",
79
+ strokeLinejoin: "round",
80
+ d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"
81
+ })
82
+ ]
83
+ });
84
+ };
85
+ return /*#__PURE__*/ _jsxs("article", {
86
+ className: cn(theme.itemCard.base, theme.itemCard.padding, theme.itemCard.background, theme.itemCard.border, theme.itemCard.rounded, theme.itemCard.hover),
87
+ children: [
88
+ /*#__PURE__*/ _jsxs("div", {
89
+ className: theme.itemCard.header.container,
90
+ children: [
91
+ /*#__PURE__*/ _jsx("div", {
92
+ className: theme.itemCard.header.icon,
93
+ children: getTypeIcon()
94
+ }),
95
+ /*#__PURE__*/ _jsxs("div", {
96
+ className: "flex-1 min-w-0",
97
+ children: [
98
+ /*#__PURE__*/ _jsx("h3", {
99
+ className: theme.itemCard.header.title,
100
+ children: address.name
101
+ }),
102
+ /*#__PURE__*/ _jsx("p", {
103
+ className: theme.itemCard.header.subtitle,
104
+ children: address.type || "Address"
105
+ })
106
+ ]
107
+ }),
108
+ allowEdit && /*#__PURE__*/ _jsxs("div", {
109
+ className: theme.itemCard.header.actions,
110
+ children: [
111
+ /*#__PURE__*/ _jsx(Button, {
112
+ variant: "ghost",
113
+ size: "sm",
114
+ onClick: ()=>onEdit(address),
115
+ disabled: isUpdating || isDeleting || isPending,
116
+ className: "p-1.5",
117
+ "aria-label": "Edit address",
118
+ children: /*#__PURE__*/ _jsxs("svg", {
119
+ className: "w-4 h-4",
120
+ viewBox: "0 0 24 24",
121
+ fill: "none",
122
+ stroke: "currentColor",
123
+ strokeWidth: "2",
124
+ children: [
125
+ /*#__PURE__*/ _jsx("title", {
126
+ children: "Edit"
127
+ }),
128
+ /*#__PURE__*/ _jsx("path", {
129
+ strokeLinecap: "round",
130
+ strokeLinejoin: "round",
131
+ d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
132
+ })
133
+ ]
134
+ })
135
+ }),
136
+ /*#__PURE__*/ _jsx(Button, {
137
+ variant: "ghost",
138
+ size: "sm",
139
+ onClick: ()=>onDelete(address.id),
140
+ disabled: isUpdating || isDeleting || isPending,
141
+ className: "p-1.5 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20",
142
+ "aria-label": "Delete address",
143
+ children: isDeleting ? /*#__PURE__*/ _jsxs("svg", {
144
+ className: "w-4 h-4 animate-spin",
145
+ viewBox: "0 0 24 24",
146
+ fill: "none",
147
+ children: [
148
+ /*#__PURE__*/ _jsx("title", {
149
+ children: "Deleting"
150
+ }),
151
+ /*#__PURE__*/ _jsx("circle", {
152
+ className: "opacity-25",
153
+ cx: "12",
154
+ cy: "12",
155
+ r: "10",
156
+ stroke: "currentColor",
157
+ strokeWidth: "4"
158
+ }),
159
+ /*#__PURE__*/ _jsx("path", {
160
+ className: "opacity-75",
161
+ fill: "currentColor",
162
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
163
+ })
164
+ ]
165
+ }) : /*#__PURE__*/ _jsxs("svg", {
166
+ className: "w-4 h-4",
167
+ viewBox: "0 0 24 24",
168
+ fill: "none",
169
+ stroke: "currentColor",
170
+ strokeWidth: "2",
171
+ children: [
172
+ /*#__PURE__*/ _jsx("title", {
173
+ children: "Delete"
174
+ }),
175
+ /*#__PURE__*/ _jsx("path", {
176
+ strokeLinecap: "round",
177
+ strokeLinejoin: "round",
178
+ d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
179
+ })
180
+ ]
181
+ })
182
+ })
183
+ ]
184
+ })
185
+ ]
186
+ }),
187
+ /*#__PURE__*/ _jsx("div", {
188
+ className: theme.itemCard.details.container,
189
+ children: /*#__PURE__*/ _jsx("p", {
190
+ className: "text-zinc-600 dark:text-zinc-400 text-sm leading-relaxed",
191
+ children: formatAddress()
192
+ })
193
+ })
194
+ ]
195
+ });
196
+ }
@@ -0,0 +1,206 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../../utils/cn";
4
+ import { Button } from "../../Button";
5
+ import { profilePageTheme } from "../theme";
6
+ export function PhoneCard({ phone, onEdit, onDelete, isUpdating, isDeleting, allowEdit = true }) {
7
+ const theme = profilePageTheme;
8
+ const isPending = phone.id.startsWith("temp-");
9
+ const formatPhoneNumber = ()=>{
10
+ const parts = [
11
+ phone.countryCode,
12
+ phone.number
13
+ ];
14
+ if (phone.extension) {
15
+ parts.push(`ext. ${phone.extension}`);
16
+ }
17
+ return parts.join(" ");
18
+ };
19
+ const getTypeIcon = ()=>{
20
+ if (phone.type === "mobile") {
21
+ return /*#__PURE__*/ _jsxs("svg", {
22
+ className: "w-5 h-5",
23
+ viewBox: "0 0 24 24",
24
+ fill: "none",
25
+ stroke: "currentColor",
26
+ strokeWidth: "2",
27
+ children: [
28
+ /*#__PURE__*/ _jsx("title", {
29
+ children: "Mobile"
30
+ }),
31
+ /*#__PURE__*/ _jsx("path", {
32
+ strokeLinecap: "round",
33
+ strokeLinejoin: "round",
34
+ d: "M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V3.75a2.25 2.25 0 00-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"
35
+ })
36
+ ]
37
+ });
38
+ }
39
+ if (phone.type === "office") {
40
+ return /*#__PURE__*/ _jsxs("svg", {
41
+ className: "w-5 h-5",
42
+ viewBox: "0 0 24 24",
43
+ fill: "none",
44
+ stroke: "currentColor",
45
+ strokeWidth: "2",
46
+ children: [
47
+ /*#__PURE__*/ _jsx("title", {
48
+ children: "Office"
49
+ }),
50
+ /*#__PURE__*/ _jsx("path", {
51
+ strokeLinecap: "round",
52
+ strokeLinejoin: "round",
53
+ d: "M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"
54
+ })
55
+ ]
56
+ });
57
+ }
58
+ if (phone.type === "fax") {
59
+ return /*#__PURE__*/ _jsxs("svg", {
60
+ className: "w-5 h-5",
61
+ viewBox: "0 0 24 24",
62
+ fill: "none",
63
+ stroke: "currentColor",
64
+ strokeWidth: "2",
65
+ children: [
66
+ /*#__PURE__*/ _jsx("title", {
67
+ children: "Fax"
68
+ }),
69
+ /*#__PURE__*/ _jsx("path", {
70
+ strokeLinecap: "round",
71
+ strokeLinejoin: "round",
72
+ d: "M6.72 13.829c-.24.03-.48.062-.72.096m.72-.096a42.415 42.415 0 0110.56 0m-10.56 0L6.34 18m10.94-4.171c.24.03.48.062.72.096m-.72-.096L17.66 18m0 0l.229 2.523a1.125 1.125 0 01-1.12 1.227H7.231c-.662 0-1.18-.568-1.12-1.227L6.34 18m11.318 0h1.091A2.25 2.25 0 0021 15.75V9.456c0-1.081-.768-2.015-1.837-2.175a48.055 48.055 0 00-1.913-.247M6.34 18H5.25A2.25 2.25 0 013 15.75V9.456c0-1.081.768-2.015 1.837-2.175a48.041 48.041 0 011.913-.247m10.5 0a48.536 48.536 0 00-10.5 0m10.5 0V3.375c0-.621-.504-1.125-1.125-1.125h-8.25c-.621 0-1.125.504-1.125 1.125v3.659M18 10.5h.008v.008H18V10.5zm-3 0h.008v.008H15V10.5z"
73
+ })
74
+ ]
75
+ });
76
+ }
77
+ return /*#__PURE__*/ _jsxs("svg", {
78
+ className: "w-5 h-5",
79
+ viewBox: "0 0 24 24",
80
+ fill: "none",
81
+ stroke: "currentColor",
82
+ strokeWidth: "2",
83
+ children: [
84
+ /*#__PURE__*/ _jsx("title", {
85
+ children: "Phone"
86
+ }),
87
+ /*#__PURE__*/ _jsx("path", {
88
+ strokeLinecap: "round",
89
+ strokeLinejoin: "round",
90
+ d: "M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 002.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 01-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 00-1.091-.852H4.5A2.25 2.25 0 002.25 4.5v2.25z"
91
+ })
92
+ ]
93
+ });
94
+ };
95
+ return /*#__PURE__*/ _jsxs("article", {
96
+ className: cn(theme.itemCard.base, theme.itemCard.padding, theme.itemCard.background, theme.itemCard.border, theme.itemCard.rounded, theme.itemCard.hover),
97
+ children: [
98
+ /*#__PURE__*/ _jsxs("div", {
99
+ className: theme.itemCard.header.container,
100
+ children: [
101
+ /*#__PURE__*/ _jsx("div", {
102
+ className: theme.itemCard.header.icon,
103
+ children: getTypeIcon()
104
+ }),
105
+ /*#__PURE__*/ _jsxs("div", {
106
+ className: "flex-1 min-w-0",
107
+ children: [
108
+ /*#__PURE__*/ _jsx("h3", {
109
+ className: theme.itemCard.header.title,
110
+ children: phone.name
111
+ }),
112
+ /*#__PURE__*/ _jsx("p", {
113
+ className: theme.itemCard.header.subtitle,
114
+ children: phone.type || "Phone"
115
+ })
116
+ ]
117
+ }),
118
+ allowEdit && /*#__PURE__*/ _jsxs("div", {
119
+ className: theme.itemCard.header.actions,
120
+ children: [
121
+ /*#__PURE__*/ _jsx(Button, {
122
+ variant: "ghost",
123
+ size: "sm",
124
+ onClick: ()=>onEdit(phone),
125
+ disabled: isUpdating || isDeleting || isPending,
126
+ className: "p-1.5",
127
+ "aria-label": "Edit phone",
128
+ children: /*#__PURE__*/ _jsxs("svg", {
129
+ className: "w-4 h-4",
130
+ viewBox: "0 0 24 24",
131
+ fill: "none",
132
+ stroke: "currentColor",
133
+ strokeWidth: "2",
134
+ children: [
135
+ /*#__PURE__*/ _jsx("title", {
136
+ children: "Edit"
137
+ }),
138
+ /*#__PURE__*/ _jsx("path", {
139
+ strokeLinecap: "round",
140
+ strokeLinejoin: "round",
141
+ d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10"
142
+ })
143
+ ]
144
+ })
145
+ }),
146
+ /*#__PURE__*/ _jsx(Button, {
147
+ variant: "ghost",
148
+ size: "sm",
149
+ onClick: ()=>onDelete(phone.id),
150
+ disabled: isUpdating || isDeleting || isPending,
151
+ className: "p-1.5 text-red-500 hover:text-red-600 hover:bg-red-50 dark:hover:bg-red-900/20",
152
+ "aria-label": "Delete phone",
153
+ children: isDeleting ? /*#__PURE__*/ _jsxs("svg", {
154
+ className: "w-4 h-4 animate-spin",
155
+ viewBox: "0 0 24 24",
156
+ fill: "none",
157
+ children: [
158
+ /*#__PURE__*/ _jsx("title", {
159
+ children: "Deleting"
160
+ }),
161
+ /*#__PURE__*/ _jsx("circle", {
162
+ className: "opacity-25",
163
+ cx: "12",
164
+ cy: "12",
165
+ r: "10",
166
+ stroke: "currentColor",
167
+ strokeWidth: "4"
168
+ }),
169
+ /*#__PURE__*/ _jsx("path", {
170
+ className: "opacity-75",
171
+ fill: "currentColor",
172
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
173
+ })
174
+ ]
175
+ }) : /*#__PURE__*/ _jsxs("svg", {
176
+ className: "w-4 h-4",
177
+ viewBox: "0 0 24 24",
178
+ fill: "none",
179
+ stroke: "currentColor",
180
+ strokeWidth: "2",
181
+ children: [
182
+ /*#__PURE__*/ _jsx("title", {
183
+ children: "Delete"
184
+ }),
185
+ /*#__PURE__*/ _jsx("path", {
186
+ strokeLinecap: "round",
187
+ strokeLinejoin: "round",
188
+ d: "M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0"
189
+ })
190
+ ]
191
+ })
192
+ })
193
+ ]
194
+ })
195
+ ]
196
+ }),
197
+ /*#__PURE__*/ _jsx("div", {
198
+ className: theme.itemCard.details.container,
199
+ children: /*#__PURE__*/ _jsx("p", {
200
+ className: "text-zinc-900 dark:text-white font-medium",
201
+ children: formatPhoneNumber()
202
+ })
203
+ })
204
+ ]
205
+ });
206
+ }
@@ -0,0 +1,150 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { profilePageTheme } from "../theme";
4
+ export function ProfileHeader({ user, profile, profilePicture, fileProxyBasePath = "/file-proxy", onUploadPicture, isUploading = false }) {
5
+ const theme = profilePageTheme;
6
+ const getInitials = ()=>{
7
+ if (profile?.firstName && profile?.lastName) {
8
+ return `${profile.firstName[0]}${profile.lastName[0]}`.toUpperCase();
9
+ }
10
+ if (user?.email && user.email.length > 0) {
11
+ return user.email[0]?.toUpperCase() || "?";
12
+ }
13
+ return "?";
14
+ };
15
+ const getFullName = ()=>{
16
+ if (profile?.firstName && profile?.lastName) {
17
+ return `${profile.firstName} ${profile.lastName}`;
18
+ }
19
+ return "No name set";
20
+ };
21
+ const formatDate = (dateStr)=>{
22
+ if (!dateStr) return "N/A";
23
+ const date = typeof dateStr === "string" ? new Date(dateStr) : dateStr;
24
+ return date.toLocaleDateString(undefined, {
25
+ year: "numeric",
26
+ month: "short",
27
+ day: "numeric"
28
+ });
29
+ };
30
+ return /*#__PURE__*/ _jsxs("header", {
31
+ className: theme.header.container,
32
+ children: [
33
+ /*#__PURE__*/ _jsxs("div", {
34
+ className: theme.header.avatar.wrapper,
35
+ children: [
36
+ profilePicture?.id ? /*#__PURE__*/ _jsx("img", {
37
+ src: `${fileProxyBasePath}/${profilePicture.id}`,
38
+ alt: getFullName(),
39
+ className: theme.header.avatar.image
40
+ }) : /*#__PURE__*/ _jsx("div", {
41
+ className: theme.header.avatar.placeholder,
42
+ children: getInitials()
43
+ }),
44
+ onUploadPicture && /*#__PURE__*/ _jsx("button", {
45
+ type: "button",
46
+ onClick: onUploadPicture,
47
+ disabled: isUploading,
48
+ className: theme.header.avatar.uploadButton,
49
+ "aria-label": "Upload profile picture",
50
+ children: isUploading ? /*#__PURE__*/ _jsxs("svg", {
51
+ className: "w-4 h-4 animate-spin text-zinc-500",
52
+ viewBox: "0 0 24 24",
53
+ fill: "none",
54
+ children: [
55
+ /*#__PURE__*/ _jsx("title", {
56
+ children: "Uploading"
57
+ }),
58
+ /*#__PURE__*/ _jsx("circle", {
59
+ className: "opacity-25",
60
+ cx: "12",
61
+ cy: "12",
62
+ r: "10",
63
+ stroke: "currentColor",
64
+ strokeWidth: "4"
65
+ }),
66
+ /*#__PURE__*/ _jsx("path", {
67
+ className: "opacity-75",
68
+ fill: "currentColor",
69
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
70
+ })
71
+ ]
72
+ }) : /*#__PURE__*/ _jsxs("svg", {
73
+ className: "w-4 h-4 text-zinc-500",
74
+ viewBox: "0 0 24 24",
75
+ fill: "none",
76
+ stroke: "currentColor",
77
+ strokeWidth: "2",
78
+ children: [
79
+ /*#__PURE__*/ _jsx("title", {
80
+ children: "Upload"
81
+ }),
82
+ /*#__PURE__*/ _jsx("path", {
83
+ strokeLinecap: "round",
84
+ strokeLinejoin: "round",
85
+ d: "M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"
86
+ }),
87
+ /*#__PURE__*/ _jsx("path", {
88
+ strokeLinecap: "round",
89
+ strokeLinejoin: "round",
90
+ d: "M15 13a3 3 0 11-6 0 3 3 0 016 0z"
91
+ })
92
+ ]
93
+ })
94
+ })
95
+ ]
96
+ }),
97
+ /*#__PURE__*/ _jsxs("div", {
98
+ className: theme.header.info.container,
99
+ children: [
100
+ /*#__PURE__*/ _jsx("h1", {
101
+ className: theme.header.info.name,
102
+ children: getFullName()
103
+ }),
104
+ /*#__PURE__*/ _jsx("p", {
105
+ className: theme.header.info.email,
106
+ children: user?.email || "No email"
107
+ }),
108
+ /*#__PURE__*/ _jsxs("div", {
109
+ className: theme.header.info.meta,
110
+ children: [
111
+ user?.verifiedAt && /*#__PURE__*/ _jsxs("span", {
112
+ className: "flex items-center gap-1",
113
+ children: [
114
+ /*#__PURE__*/ _jsxs("svg", {
115
+ className: "w-3.5 h-3.5 text-green-500",
116
+ viewBox: "0 0 24 24",
117
+ fill: "currentColor",
118
+ children: [
119
+ /*#__PURE__*/ _jsx("title", {
120
+ children: "Verified"
121
+ }),
122
+ /*#__PURE__*/ _jsx("path", {
123
+ fillRule: "evenodd",
124
+ d: "M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z",
125
+ clipRule: "evenodd"
126
+ })
127
+ ]
128
+ }),
129
+ "Verified"
130
+ ]
131
+ }),
132
+ user?.lastLoginAt && /*#__PURE__*/ _jsxs("span", {
133
+ children: [
134
+ "Last login: ",
135
+ formatDate(user.lastLoginAt)
136
+ ]
137
+ }),
138
+ user?.createdAt && /*#__PURE__*/ _jsxs("span", {
139
+ children: [
140
+ "Member since: ",
141
+ formatDate(user.createdAt)
142
+ ]
143
+ })
144
+ ]
145
+ })
146
+ ]
147
+ })
148
+ ]
149
+ });
150
+ }