@myrjfa/ui 1.0.8 → 1.0.10

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 (161) hide show
  1. package/dist/chat/ChatMain.d.ts +9 -0
  2. package/dist/chat/ChatMain.d.ts.map +1 -0
  3. package/dist/chat/ChatMain.js +272 -0
  4. package/dist/chat/ChatSidebar.d.ts +13 -0
  5. package/dist/chat/ChatSidebar.d.ts.map +1 -0
  6. package/dist/chat/ChatSidebar.js +23 -0
  7. package/dist/chat/ConversationList.d.ts +12 -0
  8. package/dist/chat/ConversationList.d.ts.map +1 -0
  9. package/dist/chat/ConversationList.js +70 -0
  10. package/dist/chat/ExpensePanel.d.ts +11 -0
  11. package/dist/chat/ExpensePanel.d.ts.map +1 -0
  12. package/dist/chat/ExpensePanel.js +235 -0
  13. package/dist/chat/MessageBubble.d.ts +18 -0
  14. package/dist/chat/MessageBubble.d.ts.map +1 -0
  15. package/dist/chat/MessageBubble.js +284 -0
  16. package/dist/chat/MessageInput.d.ts +21 -0
  17. package/dist/chat/MessageInput.d.ts.map +1 -0
  18. package/dist/chat/MessageInput.js +252 -0
  19. package/dist/chat/MilestonePanel.d.ts +11 -0
  20. package/dist/chat/MilestonePanel.d.ts.map +1 -0
  21. package/dist/chat/MilestonePanel.js +173 -0
  22. package/dist/chat/components/ParticipantSelector.d.ts +11 -0
  23. package/dist/chat/components/ParticipantSelector.d.ts.map +1 -0
  24. package/dist/chat/components/ParticipantSelector.js +17 -0
  25. package/dist/chat/components/SplitInputs.d.ts +11 -0
  26. package/dist/chat/components/SplitInputs.d.ts.map +1 -0
  27. package/dist/chat/components/SplitInputs.js +83 -0
  28. package/dist/chat/components/SplitTypeSelector.d.ts +8 -0
  29. package/dist/chat/components/SplitTypeSelector.d.ts.map +1 -0
  30. package/dist/chat/components/SplitTypeSelector.js +13 -0
  31. package/dist/chat/dialogs/AddMemberDialog.d.ts +10 -0
  32. package/dist/chat/dialogs/AddMemberDialog.d.ts.map +1 -0
  33. package/dist/chat/dialogs/AddMemberDialog.js +50 -0
  34. package/dist/chat/dialogs/CameraDialog.d.ts +8 -0
  35. package/dist/chat/dialogs/CameraDialog.d.ts.map +1 -0
  36. package/dist/chat/dialogs/CameraDialog.js +80 -0
  37. package/dist/chat/dialogs/CreatePollDialog.d.ts +8 -0
  38. package/dist/chat/dialogs/CreatePollDialog.d.ts.map +1 -0
  39. package/dist/chat/dialogs/CreatePollDialog.js +38 -0
  40. package/dist/chat/dialogs/ExpenseAnalyticsDialog.d.ts +19 -0
  41. package/dist/chat/dialogs/ExpenseAnalyticsDialog.d.ts.map +1 -0
  42. package/dist/chat/dialogs/ExpenseAnalyticsDialog.js +52 -0
  43. package/dist/chat/dialogs/GroupInfoDialog.d.ts +10 -0
  44. package/dist/chat/dialogs/GroupInfoDialog.d.ts.map +1 -0
  45. package/dist/chat/dialogs/GroupInfoDialog.js +71 -0
  46. package/dist/chat/dialogs/GroupInfoViewDialog.d.ts +9 -0
  47. package/dist/chat/dialogs/GroupInfoViewDialog.d.ts.map +1 -0
  48. package/dist/chat/dialogs/GroupInfoViewDialog.js +15 -0
  49. package/dist/chat/dialogs/NewChatDialog.d.ts +2 -0
  50. package/dist/chat/dialogs/NewChatDialog.d.ts.map +1 -0
  51. package/dist/chat/dialogs/NewChatDialog.js +63 -0
  52. package/dist/chat/dialogs/NewGroupDialog.d.ts +2 -0
  53. package/dist/chat/dialogs/NewGroupDialog.d.ts.map +1 -0
  54. package/dist/chat/dialogs/NewGroupDialog.js +69 -0
  55. package/dist/chat/dialogs/ParticipantsDialog.d.ts +11 -0
  56. package/dist/chat/dialogs/ParticipantsDialog.d.ts.map +1 -0
  57. package/dist/chat/dialogs/ParticipantsDialog.js +93 -0
  58. package/dist/chat/dialogs/UserProfileDialog.d.ts +10 -0
  59. package/dist/chat/dialogs/UserProfileDialog.d.ts.map +1 -0
  60. package/dist/chat/dialogs/UserProfileDialog.js +100 -0
  61. package/dist/chat/index.d.ts +8 -0
  62. package/dist/chat/index.d.ts.map +1 -0
  63. package/dist/chat/index.js +7 -0
  64. package/dist/dashboard/action-buttons.js +4 -5
  65. package/dist/dashboard/app-sidebar.js +46 -128
  66. package/dist/dashboard/card-header.js +1 -2
  67. package/dist/dashboard/dashboard-components.js +3 -5
  68. package/dist/dashboard/data-table.d.ts +18 -18
  69. package/dist/dashboard/data-table.js +54 -66
  70. package/dist/dashboard/nav-main.js +4 -5
  71. package/dist/dashboard/nav-secondary.js +2 -25
  72. package/dist/dashboard/stats-card.js +1 -2
  73. package/dist/dashboard/table.js +8 -54
  74. package/dist/header/mobile-nav-item.js +1 -2
  75. package/dist/header/mobile-navbar.js +8 -9
  76. package/dist/header/nav-item.d.ts +2 -1
  77. package/dist/header/nav-item.d.ts.map +1 -1
  78. package/dist/header/nav-item.js +2 -3
  79. package/dist/index.d.ts +57 -56
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +57 -57
  82. package/dist/main/footer.js +5 -9
  83. package/dist/main/navbar.d.ts.map +1 -1
  84. package/dist/main/navbar.js +53 -136
  85. package/dist/main/paginationBar.js +12 -14
  86. package/dist/main/portfolio/portfolioItem.js +1 -2
  87. package/dist/main/portfolio/portfolioPopup.js +16 -17
  88. package/dist/main/review-page.d.ts.map +1 -1
  89. package/dist/main/review-page.js +131 -198
  90. package/dist/misc/accordion.js +8 -34
  91. package/dist/misc/alert-dialog.js +22 -55
  92. package/dist/misc/alert.js +7 -32
  93. package/dist/misc/alertdialogclaude.js +50 -125
  94. package/dist/misc/avatar.js +6 -31
  95. package/dist/misc/badge.d.ts +8 -8
  96. package/dist/misc/badge.js +4 -27
  97. package/dist/misc/button.d.ts +9 -9
  98. package/dist/misc/button.js +4 -27
  99. package/dist/misc/card.js +12 -40
  100. package/dist/misc/carousel.js +37 -61
  101. package/dist/misc/checkbox.js +2 -25
  102. package/dist/misc/command.d.ts +3 -1
  103. package/dist/misc/command.d.ts.map +1 -1
  104. package/dist/misc/command.js +18 -49
  105. package/dist/misc/datepicker.js +66 -76
  106. package/dist/misc/dialog.js +20 -52
  107. package/dist/misc/dropdown-menu.js +30 -67
  108. package/dist/misc/faq.js +2 -3
  109. package/dist/misc/file-preview.js +43 -97
  110. package/dist/misc/filter.d.ts.map +1 -1
  111. package/dist/misc/filter.js +18 -21
  112. package/dist/misc/filterBar.js +136 -160
  113. package/dist/misc/form.d.ts +1 -1
  114. package/dist/misc/form.d.ts.map +1 -1
  115. package/dist/misc/form.js +39 -60
  116. package/dist/misc/image-cropper.d.ts +10 -0
  117. package/dist/misc/image-cropper.d.ts.map +1 -0
  118. package/dist/misc/image-cropper.js +44 -0
  119. package/dist/misc/input.js +2 -25
  120. package/dist/misc/label.js +2 -25
  121. package/dist/misc/line-carousel.js +3 -13
  122. package/dist/misc/multiImageUploader.d.ts +8 -8
  123. package/dist/misc/multiImageUploader.js +10 -11
  124. package/dist/misc/newsLetter.js +18 -78
  125. package/dist/misc/notification.d.ts +1 -2
  126. package/dist/misc/notification.d.ts.map +1 -1
  127. package/dist/misc/notification.js +89 -125
  128. package/dist/misc/pagination.js +16 -45
  129. package/dist/misc/password-eye.js +2 -3
  130. package/dist/misc/popover.d.ts.map +1 -1
  131. package/dist/misc/popover.js +8 -34
  132. package/dist/misc/progress.js +2 -25
  133. package/dist/misc/scroll-area.js +5 -29
  134. package/dist/misc/searchBar.js +27 -31
  135. package/dist/misc/searchBox.js +18 -22
  136. package/dist/misc/select.d.ts.map +1 -1
  137. package/dist/misc/select.js +22 -54
  138. package/dist/misc/separator.js +2 -25
  139. package/dist/misc/share.js +48 -104
  140. package/dist/misc/sheet.js +21 -53
  141. package/dist/misc/sidebar.d.ts +69 -69
  142. package/dist/misc/sidebar.js +112 -153
  143. package/dist/misc/skeleton.d.ts +2 -2
  144. package/dist/misc/skeleton.js +6 -29
  145. package/dist/misc/slider.js +3 -26
  146. package/dist/misc/starRating.js +5 -15
  147. package/dist/misc/stateCard.js +7 -8
  148. package/dist/misc/switch.d.ts +5 -0
  149. package/dist/misc/switch.d.ts.map +1 -0
  150. package/dist/misc/switch.js +8 -0
  151. package/dist/misc/tabs.js +8 -34
  152. package/dist/misc/textarea.js +2 -25
  153. package/dist/misc/tile.js +31 -92
  154. package/dist/misc/tooltip.js +8 -34
  155. package/dist/profile/socialLink.d.ts +1 -1
  156. package/dist/profile/socialLink.d.ts.map +1 -1
  157. package/dist/profile/socialLink.js +53 -69
  158. package/dist/utils/permissions.d.ts +7 -0
  159. package/dist/utils/permissions.d.ts.map +1 -0
  160. package/dist/utils/permissions.js +38 -0
  161. package/package.json +8 -5
@@ -1,34 +1,11 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
3
  import * as React from "react";
26
4
  import * as SliderPrimitive from "@radix-ui/react-slider";
27
5
  import { cn } from "@myrjfa/state/dist/lib/utils";
28
- var Slider = React.forwardRef(function (_a, ref) {
29
- var _b;
30
- var className = _a.className, props = __rest(_a, ["className"]);
31
- return (_jsxs(SliderPrimitive.Root, __assign({ ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className) }, props, { children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), (_b = (props.value || props.defaultValue || [0])) === null || _b === void 0 ? void 0 : _b.map(function (_, index) { return (_jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" }, index)); })] })));
6
+ const Slider = React.forwardRef(({ className, ...props }, ref) => {
7
+ var _a;
8
+ return (_jsxs(SliderPrimitive.Root, { ref: ref, className: cn("relative flex w-full touch-none select-none items-center", className), ...props, children: [_jsx(SliderPrimitive.Track, { className: "relative h-2 w-full grow overflow-hidden rounded-full bg-secondary", children: _jsx(SliderPrimitive.Range, { className: "absolute h-full bg-primary" }) }), (_a = (props.value || props.defaultValue || [0])) === null || _a === void 0 ? void 0 : _a.map((_, index) => (_jsx(SliderPrimitive.Thumb, { className: "block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50" }, index)))] }));
32
9
  });
33
10
  Slider.displayName = SliderPrimitive.Root.displayName;
34
11
  export { Slider };
@@ -1,21 +1,11 @@
1
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
2
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
3
- if (ar || !(i in from)) {
4
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
5
- ar[i] = from[i];
6
- }
7
- }
8
- return to.concat(ar || Array.prototype.slice.call(from));
9
- };
10
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
2
  import { Star } from "lucide-react";
12
- export var StarRating = function (_a) {
13
- var rating = _a.rating;
14
- var fullStars = Math.floor(rating);
15
- var hasHalfStar = rating % 1 >= 0.5;
16
- return (_jsxs("div", { className: "flex items-center", children: [__spreadArray([], Array(5), true).map(function (_, i) { return (_jsx(Star, { className: "h-4 w-4 ".concat(i < fullStars
3
+ export const StarRating = ({ rating }) => {
4
+ const fullStars = Math.floor(rating);
5
+ const hasHalfStar = rating % 1 >= 0.5;
6
+ return (_jsxs("div", { className: "flex items-center", children: [[...Array(5)].map((_, i) => (_jsx(Star, { className: `h-4 w-4 ${i < fullStars
17
7
  ? "text-yellow-400 fill-yellow-400"
18
8
  : i === fullStars && hasHalfStar
19
9
  ? "text-yellow-400 fill-yellow-400"
20
- : "text-gray-300") }, i)); }), _jsx("span", { className: "ml-1 text-sm font-medium hidden md:block", children: rating.toFixed(1) })] }));
10
+ : "text-gray-300"}` }, i))), _jsx("span", { className: "ml-1 text-sm font-medium hidden md:block", children: rating.toFixed(1) })] }));
21
11
  };
@@ -6,17 +6,16 @@ import Image from 'next/image';
6
6
  import { useRouter } from 'next/navigation';
7
7
  import { useState } from 'react';
8
8
  import { Card, CardContent } from './card';
9
- export default function StateCard(_a) {
10
- var _b;
11
- var state = _a.state, index = _a.index, className = _a.className;
12
- var _c = useState(false), clicked = _c[0], setClicked = _c[1];
13
- var router = useRouter();
14
- var handleCardClick = function () {
9
+ export default function StateCard({ state, index, className }) {
10
+ var _a;
11
+ const [clicked, setClicked] = useState(false);
12
+ const router = useRouter();
13
+ const handleCardClick = () => {
15
14
  if (clicked)
16
15
  return; // prevent duplicate navigation
17
16
  setClicked(true);
18
- router.push("/opportunities?page=1&destination=".concat(state.title.toLowerCase()));
17
+ router.push(`/opportunities?page=1&destination=${state.title.toLowerCase()}`);
19
18
  };
20
19
  return (_jsx(Card, { className: cn("w-full h-auto p-3 shadow-lg cursor-pointer relative", className, clicked && "opacity-60 pointer-events-none" // visual cue + blocking
21
- ), onClick: handleCardClick, children: _jsxs(CardContent, { className: "flex flex-row px-0", children: [clicked && (_jsx("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/70 rounded-lg", children: _jsx(Loader2, { className: "animate-spin text-gray-600", size: 24 }) })), _jsx(Image, { src: (_b = state.image) !== null && _b !== void 0 ? _b : "", alt: state.title, className: "w-20 h-20 rounded-lg object-cover flex-1", width: 50, height: 50 }), _jsxs("div", { className: "flex-5 flex flex-col items-left text-left my-auto mx-5", children: [_jsx("h2", { className: "text-lg font-semibold", children: state.title }), _jsxs("p", { className: "text-sm text-gray-500", children: [state.count, " places"] })] })] }) }, index));
20
+ ), onClick: handleCardClick, children: _jsxs(CardContent, { className: "flex flex-row px-0", children: [clicked && (_jsx("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/70 rounded-lg", children: _jsx(Loader2, { className: "animate-spin text-gray-600", size: 24 }) })), _jsx(Image, { src: (_a = state.image) !== null && _a !== void 0 ? _a : "", alt: state.title, className: "w-20 h-20 rounded-lg object-cover flex-1", width: 50, height: 50 }), _jsxs("div", { className: "flex-5 flex flex-col items-left text-left my-auto mx-5", children: [_jsx("h2", { className: "text-lg font-semibold", children: state.title }), _jsxs("p", { className: "text-sm text-gray-500", children: [state.count, " places"] })] })] }) }, index));
22
21
  }
@@ -0,0 +1,5 @@
1
+ import * as React from "react";
2
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
3
+ declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
4
+ export { Switch };
5
+ //# sourceMappingURL=switch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/misc/switch.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAI3D,QAAA,MAAM,MAAM,8JAkBV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
5
+ import { cn } from "@myrjfa/state/dist/lib/utils";
6
+ const Switch = React.forwardRef(({ className, ...props }, ref) => (_jsx(SwitchPrimitives.Root, { className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className), ...props, ref: ref, children: _jsx(SwitchPrimitives.Thumb, { className: cn("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0") }) })));
7
+ Switch.displayName = SwitchPrimitives.Root.displayName;
8
+ export { Switch };
package/dist/misc/tabs.js CHANGED
@@ -1,43 +1,17 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  import { jsx as _jsx } from "react/jsx-runtime";
25
3
  import * as TabsPrimitive from "@radix-ui/react-tabs";
26
4
  import { cn } from "@myrjfa/state/dist/lib/utils";
27
- function Tabs(_a) {
28
- var className = _a.className, props = __rest(_a, ["className"]);
29
- return (_jsx(TabsPrimitive.Root, __assign({ "data-slot": "tabs", className: cn("flex flex-col gap-2", className) }, props)));
5
+ function Tabs({ className, ...props }) {
6
+ return (_jsx(TabsPrimitive.Root, { "data-slot": "tabs", className: cn("flex flex-col gap-2", className), ...props }));
30
7
  }
31
- function TabsList(_a) {
32
- var className = _a.className, props = __rest(_a, ["className"]);
33
- return (_jsx(TabsPrimitive.List, __assign({ "data-slot": "tabs-list", className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className) }, props)));
8
+ function TabsList({ className, ...props }) {
9
+ return (_jsx(TabsPrimitive.List, { "data-slot": "tabs-list", className: cn("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", className), ...props }));
34
10
  }
35
- function TabsTrigger(_a) {
36
- var className = _a.className, props = __rest(_a, ["className"]);
37
- return (_jsx(TabsPrimitive.Trigger, __assign({ "data-slot": "tabs-trigger", className: cn("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/50 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className) }, props)));
11
+ function TabsTrigger({ className, ...props }) {
12
+ return (_jsx(TabsPrimitive.Trigger, { "data-slot": "tabs-trigger", className: cn("data-[state=active]:bg-background data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/50 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props }));
38
13
  }
39
- function TabsContent(_a) {
40
- var className = _a.className, props = __rest(_a, ["className"]);
41
- return (_jsx(TabsPrimitive.Content, __assign({ "data-slot": "tabs-content", className: cn("flex-1 outline-none", className) }, props)));
14
+ function TabsContent({ className, ...props }) {
15
+ return (_jsx(TabsPrimitive.Content, { "data-slot": "tabs-content", className: cn("flex-1 outline-none", className), ...props }));
42
16
  }
43
17
  export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -1,29 +1,6 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
1
  import { jsx as _jsx } from "react/jsx-runtime";
24
2
  import { cn } from "@myrjfa/state/dist/lib/utils";
25
- function Textarea(_a) {
26
- var className = _a.className, props = __rest(_a, ["className"]);
27
- return (_jsx("textarea", __assign({ "data-slot": "textarea", className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className) }, props)));
3
+ function Textarea({ className, ...props }) {
4
+ return (_jsx("textarea", { "data-slot": "textarea", className: cn("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", className), ...props }));
28
5
  }
29
6
  export { Textarea };
package/dist/misc/tile.js CHANGED
@@ -1,51 +1,4 @@
1
1
  'use client';
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
- return new (P || (P = Promise))(function (resolve, reject) {
16
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
- step((generator = generator.apply(thisArg, _arguments || [])).next());
20
- });
21
- };
22
- var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
- function verb(n) { return function (v) { return step([n, v]); }; }
26
- function step(op) {
27
- if (f) throw new TypeError("Generator is already executing.");
28
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
- if (y = 0, t) op = [op[0] & 2, t.value];
31
- switch (op[0]) {
32
- case 0: case 1: t = op; break;
33
- case 4: _.label++; return { value: op[1], done: false };
34
- case 5: _.label++; y = op[1]; op = [0]; continue;
35
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
- default:
37
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
- if (t[2]) _.ops.pop();
42
- _.trys.pop(); continue;
43
- }
44
- op = body.call(thisArg, _);
45
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
- }
48
- };
49
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
50
3
  import { toggleUserWishlist } from "@myrjfa/state/dist/lib/actions";
51
4
  import { userAtom, userLoadingAtom } from "@myrjfa/state/dist/lib/userAtom";
@@ -59,21 +12,18 @@ import { showAlert } from "./alertdialogclaude";
59
12
  import { Badge } from "./badge";
60
13
  import { Button } from "./button";
61
14
  import { Card, CardContent } from "./card";
62
- function WishlistButton(_a) {
63
- var wishlisted = _a.wishlisted, handleWishlisted = _a.handleWishlisted;
15
+ function WishlistButton({ wishlisted, handleWishlisted }) {
64
16
  return _jsx(Button, { variant: "ghost", className: "absolute top-3 right-3 z-10 bg-white/70 hover:bg-white rounded-full transition", onClick: handleWishlisted, children: _jsx(Heart, { className: wishlisted ? "text-red-500 fill-red-500 drop-shadow" : "text-gray-400 fill-gray-400", size: 20 }) });
65
17
  }
66
18
  ;
67
- export function Tile(_a) {
68
- var _this = this;
69
- var _b, _c, _d, _e;
70
- var slug = _a.slug, image = _a.image, title = _a.title, description = _a.description, location = _a.location, rating = _a.rating, _f = _a.skills, skills = _f === void 0 ? [] : _f, _g = _a.tileType, tileType = _g === void 0 ? "opportunities" : _g, className = _a.className, date = _a.date, _h = _a.host, host = _h === void 0 ? undefined : _h, _j = _a.duration, duration = _j === void 0 ? 1 : _j, _k = _a.price, price = _k === void 0 ? 0.0 : _k, _l = _a.currency, currency = _l === void 0 ? "INR" : _l, _m = _a.includeHost, includeHost = _m === void 0 ? true : _m;
71
- var _o = useAtom(userAtom), user = _o[0], setUser = _o[1];
72
- var loading = useAtomValue(userLoadingAtom);
73
- var router = useRouter();
74
- var _p = useState(false), wishlisted = _p[0], setWishlisted = _p[1];
75
- var _q = useState(false), clicked = _q[0], setClicked = _q[1];
76
- useEffect(function () {
19
+ export function Tile({ slug, image, title, description, location, rating, skills = [], tileType = "opportunities", className, date, host = undefined, duration = 1, price = 0.0, currency = "INR", includeHost = true, }) {
20
+ var _a, _b, _c, _d;
21
+ const [user, setUser] = useAtom(userAtom);
22
+ const loading = useAtomValue(userLoadingAtom);
23
+ const router = useRouter();
24
+ const [wishlisted, setWishlisted] = useState(false);
25
+ const [clicked, setClicked] = useState(false);
26
+ useEffect(() => {
77
27
  var _a, _b, _c, _d;
78
28
  if (loading || !user)
79
29
  return;
@@ -84,41 +34,30 @@ export function Tile(_a) {
84
34
  setWishlisted((_d = (_c = user.favPackages) === null || _c === void 0 ? void 0 : _c.includes(slug)) !== null && _d !== void 0 ? _d : false);
85
35
  }
86
36
  }, [slug, loading, user]);
87
- var handleWishlisted = function (e) { return __awaiter(_this, void 0, void 0, function () {
88
- var response;
89
- return __generator(this, function (_a) {
90
- switch (_a.label) {
91
- case 0:
92
- e.stopPropagation();
93
- return [4 /*yield*/, toggleUserWishlist(slug, tileType)];
94
- case 1:
95
- response = _a.sent();
96
- if (!(response === null || response === void 0 ? void 0 : response.error)) return [3 /*break*/, 3];
97
- return [4 /*yield*/, showAlert(response.error)];
98
- case 2:
99
- _a.sent();
100
- return [2 /*return*/];
101
- case 3:
102
- if (tileType == "opportunities") {
103
- setUser(function (prev) { return prev ? __assign(__assign({}, prev), { wishlist: response.wishlist }) : prev; });
104
- }
105
- else if (tileType == "packages") {
106
- setUser(function (prev) { return prev ? __assign(__assign({}, prev), { favPackages: response.wishlist }) : prev; });
107
- }
108
- return [2 /*return*/];
109
- }
110
- });
111
- }); };
112
- var handleTileClick = function () {
37
+ const handleWishlisted = async (e) => {
38
+ e.stopPropagation();
39
+ const response = await toggleUserWishlist(slug, tileType);
40
+ if (response === null || response === void 0 ? void 0 : response.error) {
41
+ await showAlert(response.error);
42
+ return;
43
+ }
44
+ if (tileType == "opportunities") {
45
+ setUser((prev) => prev ? { ...prev, wishlist: response.wishlist } : prev);
46
+ }
47
+ else if (tileType == "packages") {
48
+ setUser((prev) => prev ? { ...prev, favPackages: response.wishlist } : prev);
49
+ }
50
+ };
51
+ const handleTileClick = () => {
113
52
  if (clicked)
114
53
  return; // prevent duplicate navigation
115
54
  setClicked(true);
116
- router.push("/".concat(tileType, "/").concat(slug));
55
+ router.push(`/${tileType}/${slug}`);
117
56
  };
118
- var formatPrice = function (price, currency) {
57
+ const formatPrice = (price, currency) => {
119
58
  return new Intl.NumberFormat('en-IN', {
120
59
  style: 'currency',
121
- currency: currency,
60
+ currency,
122
61
  maximumFractionDigits: 0
123
62
  }).format(price);
124
63
  };
@@ -127,11 +66,11 @@ export function Tile(_a) {
127
66
  WebkitMaskImage: "linear-gradient(to bottom, rgba(0,0,0,1) 90%, rgba(255, 255, 255, 0) 100%)",
128
67
  WebkitMaskRepeat: "no-repeat",
129
68
  WebkitMaskSize: "100% 100%",
130
- }, onError: function (e) { return console.error(e.target); } }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 h-5 pointer-events-none bg-gradient-to-b from-transparent to-white" }), user && user.role == "user" && tileType !== "blogs" && (_jsx(WishlistButton, { wishlisted: wishlisted, handleWishlisted: handleWishlisted })), tileType == "packages" && (_jsx("div", { className: "absolute top-4 left-4 bg-white/80 backdrop-blur px-3 py-1 rounded-full shadow text-gray-900 font-semibold text-base", children: formatPrice(price, currency) }))] }), _jsxs(CardContent, { className: "p-4 pt-0 flex flex-col gap-3 z-10", children: [tileType !== "blogs" && (_jsxs("div", { className: "flex justify-between text-sm text-muted-foreground", children: [location && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(MapPin, { size: 15 }), " ", truncateText(location, 30)] })), (rating && rating > 0) ? _jsxs("div", { className: "flex items-center gap-1 bg-green-50 px-2 py-1 rounded-full", children: [_jsx(Star, { className: "w-4 h-4 text-amber-400 fill-current" }), _jsx("span", { className: " font-semibold", children: rating })] })
69
+ }, onError: (e) => console.error(e.target) }), _jsx("div", { className: "absolute bottom-0 left-0 right-0 h-5 pointer-events-none bg-gradient-to-b from-transparent to-white" }), user && user.role == "user" && tileType !== "blogs" && (_jsx(WishlistButton, { wishlisted: wishlisted, handleWishlisted: handleWishlisted })), tileType == "packages" && (_jsx("div", { className: "absolute top-4 left-4 bg-white/80 backdrop-blur px-3 py-1 rounded-full shadow text-gray-900 font-semibold text-base", children: formatPrice(price, currency) }))] }), _jsxs(CardContent, { className: "p-4 pt-0 flex flex-col gap-3 z-10", children: [tileType !== "blogs" && (_jsxs("div", { className: "flex justify-between text-sm text-muted-foreground", children: [location && (_jsxs("span", { className: "flex items-center gap-1", children: [_jsx(MapPin, { size: 15 }), " ", truncateText(location, 30)] })), (rating && rating > 0) ? _jsxs("div", { className: "flex items-center gap-1 bg-green-50 px-2 py-1 rounded-full", children: [_jsx(Star, { className: "w-4 h-4 text-amber-400 fill-current" }), _jsx("span", { className: " font-semibold", children: rating })] })
131
70
  : null] })), _jsx("h4", { className: "text-lg font-semibold truncate-text", children: truncateText(title, 30) }), tileType !== "packages" &&
132
- _jsx("p", { className: "text-sm text-muted-foreground truncate-text-3", children: description }), tileType == "opportunities" && skills.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mt-2 truncate-text", children: skills.slice(0, 3).map(function (skill, index) { return (_jsx(Badge, { variant: "secondary", children: truncateText(skill, 10) }, index)); }) })), tileType == "blogs" && (includeHost ?
133
- _jsxs("div", { className: "flex items-center gap-3 pt-3 border-t min-h-12 max-h-15", children: [_jsx(Image, { src: (_b = host === null || host === void 0 ? void 0 : host.image) !== null && _b !== void 0 ? _b : "/images/profile_placeholder.webp", alt: "Host Image", width: 40, height: 40, className: "rounded-full object-cover" }), _jsxs("div", { className: "flex-1", children: [_jsxs("p", { className: "font-medium", children: ["By ", truncateText((_c = host === null || host === void 0 ? void 0 : host.name) !== null && _c !== void 0 ? _c : "Host", 18)] }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["on ", formatDate(date)] })] })] }) :
71
+ _jsx("p", { className: "text-sm text-muted-foreground truncate-text-3", children: description }), tileType == "opportunities" && skills.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2 mt-2 truncate-text", children: skills.slice(0, 3).map((skill, index) => (_jsx(Badge, { variant: "secondary", children: truncateText(skill, 10) }, index))) })), tileType == "blogs" && (includeHost ?
72
+ _jsxs("div", { className: "flex items-center gap-3 pt-3 border-t min-h-12 max-h-15", children: [_jsx(Image, { src: (_a = host === null || host === void 0 ? void 0 : host.image) !== null && _a !== void 0 ? _a : "/images/profile_placeholder.webp", alt: "Host Image", width: 40, height: 40, className: "rounded-full object-cover" }), _jsxs("div", { className: "flex-1", children: [_jsxs("p", { className: "font-medium", children: ["By ", truncateText((_b = host === null || host === void 0 ? void 0 : host.name) !== null && _b !== void 0 ? _b : "Host", 18)] }), _jsxs("p", { className: "text-xs text-muted-foreground", children: ["on ", formatDate(date)] })] })] }) :
134
73
  _jsxs("div", { className: "flex justify-between items-center text-xs text-gray-500", children: [_jsx("span", { children: formatDate(date) }), _jsxs("span", { children: [rating, " likes"] })] })), tileType == "packages" && (_jsxs("div", { className: "flex items-center justify-between pt-3 border-t border-gray-100", children: [_jsxs("div", { className: "flex items-center gap-1 text-gray-600 whitespace-nowrap", children: [_jsx(Clock, { className: "w-4 h-4 mr-1" }), _jsxs("span", { className: "text-sm", children: [duration, " Days"] })] }), includeHost ?
135
- _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Image, { src: (_d = host === null || host === void 0 ? void 0 : host.image) !== null && _d !== void 0 ? _d : "/images/profile_placeholder.webp", alt: (_e = host === null || host === void 0 ? void 0 : host.name) !== null && _e !== void 0 ? _e : "DP", width: 25, height: 25, className: "rounded-full" }), _jsx("span", { className: "text-sm text-gray-500 max-w-40", children: host === null || host === void 0 ? void 0 : host.name })] }) :
74
+ _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Image, { src: (_c = host === null || host === void 0 ? void 0 : host.image) !== null && _c !== void 0 ? _c : "/images/profile_placeholder.webp", alt: (_d = host === null || host === void 0 ? void 0 : host.name) !== null && _d !== void 0 ? _d : "DP", width: 25, height: 25, className: "rounded-full" }), _jsx("span", { className: "text-sm text-gray-500 max-w-40", children: host === null || host === void 0 ? void 0 : host.name })] }) :
136
75
  _jsx("div", { className: "flex justify-between items-center text-xs text-gray-500", children: _jsx("span", { children: formatDate(date) }) })] }))] })] }));
137
76
  }
@@ -1,43 +1,17 @@
1
1
  "use client";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __rest = (this && this.__rest) || function (s, e) {
14
- var t = {};
15
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
16
- t[p] = s[p];
17
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
18
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
19
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
20
- t[p[i]] = s[p[i]];
21
- }
22
- return t;
23
- };
24
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
3
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
26
4
  import { cn } from "@myrjfa/state/dist/lib/utils";
27
- function TooltipProvider(_a) {
28
- var _b = _a.delayDuration, delayDuration = _b === void 0 ? 0 : _b, props = __rest(_a, ["delayDuration"]);
29
- return (_jsx(TooltipPrimitive.Provider, __assign({ "data-slot": "tooltip-provider", delayDuration: delayDuration }, props)));
5
+ function TooltipProvider({ delayDuration = 0, ...props }) {
6
+ return (_jsx(TooltipPrimitive.Provider, { "data-slot": "tooltip-provider", delayDuration: delayDuration, ...props }));
30
7
  }
31
- function Tooltip(_a) {
32
- var props = __rest(_a, []);
33
- return (_jsx(TooltipProvider, { children: _jsx(TooltipPrimitive.Root, __assign({ "data-slot": "tooltip" }, props)) }));
8
+ function Tooltip({ ...props }) {
9
+ return (_jsx(TooltipProvider, { children: _jsx(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props }) }));
34
10
  }
35
- function TooltipTrigger(_a) {
36
- var props = __rest(_a, []);
37
- return _jsx(TooltipPrimitive.Trigger, __assign({ "data-slot": "tooltip-trigger" }, props));
11
+ function TooltipTrigger({ ...props }) {
12
+ return _jsx(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
38
13
  }
39
- function TooltipContent(_a) {
40
- var className = _a.className, _b = _a.sideOffset, sideOffset = _b === void 0 ? 0 : _b, children = _a.children, props = __rest(_a, ["className", "sideOffset", "children"]);
41
- return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, __assign({ "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance", className) }, props, { children: [children, _jsx(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] })) }));
14
+ function TooltipContent({ className, sideOffset = 0, children, ...props }) {
15
+ return (_jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance", className), ...props, children: [children, _jsx(TooltipPrimitive.Arrow, { className: "bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })] }) }));
42
16
  }
43
17
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
@@ -1,4 +1,4 @@
1
- export type SocialPlatformType = "instagram" | "youtube" | "linkedin" | "googleBusiness";
1
+ import { SocialPlatformType } from "@myrjfa/state/dist/lib/utils/socialMediaUrl";
2
2
  interface SocialLinkFieldProps {
3
3
  platform: SocialPlatformType;
4
4
  url?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"socialLink.d.ts","sourceRoot":"","sources":["../../src/profile/socialLink.tsx"],"names":[],"mappings":"AAQA,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAEzF,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvF;AAYD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,GAAG,EACH,aAAa,EACb,oBAAoB,GACvB,EAAE,oBAAoB,kDA8CtB"}
1
+ {"version":3,"file":"socialLink.d.ts","sourceRoot":"","sources":["../../src/profile/socialLink.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAsB,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAGrG,UAAU,oBAAoB;IAC1B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;IACvB,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvF;AAeD,wBAAgB,eAAe,CAAC,EAC5B,QAAQ,EACR,GAAG,EACH,aAAa,EACb,oBAAoB,GACvB,EAAE,oBAAoB,kDAgFtB"}
@@ -1,81 +1,65 @@
1
1
  "use client";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
39
3
  import { useState } from "react";
40
4
  import { Input } from "../misc/input";
41
5
  import { Button } from "../misc/button";
42
- import { InstagramIcon, YoutubeIcon, LinkedinIcon, StoreIcon } from "lucide-react";
43
- import { useRouter } from "next/navigation";
44
- var platformConfig = {
45
- instagram: { label: "Instagram", icon: InstagramIcon, color: "hover:text-pink-600" },
46
- youtube: { label: "YouTube", icon: YoutubeIcon, color: "hover:text-red-600" },
47
- linkedin: { label: "LinkedIn", icon: LinkedinIcon, color: "hover:text-blue-600" },
48
- googleBusiness: { label: "Google Business", icon: StoreIcon, color: "hover:text-green-600" },
6
+ import { GithubIcon, InstagramIcon, StoreIcon, YoutubeIcon } from "lucide-react";
7
+ import { normalizeSocialUrl } from "@myrjfa/state/dist/lib/utils/socialMediaUrl";
8
+ import { FacebookIcon, LinkedinIcon, TwitterIcon } from "react-share";
9
+ const platformConfig = {
10
+ instagram: { label: "Instagram", icon: InstagramIcon, color: "hover:text-pink-600", hint: "Enter username or profile URL" },
11
+ youtube: { label: "YouTube", icon: YoutubeIcon, color: "hover:text-red-600", hint: "Enter @handle or profile URL" },
12
+ twitter: { label: "Twitter", icon: TwitterIcon, color: "hover:text-blue-600", hint: "Enter @handle or profile URL" },
13
+ facebook: { label: "Facebook", icon: FacebookIcon, color: "hover:text-blue-600", hint: "Enter @handle or profile URL" },
14
+ github: { label: "GitHub", icon: GithubIcon, color: "hover:text-blue-600", hint: "Enter @handle or profile URL" },
15
+ linkedin: { label: "LinkedIn", icon: LinkedinIcon, color: "hover:text-blue-600", hint: "Enter username or profile URL" },
16
+ googleBusiness: { label: "Google Business", icon: StoreIcon, color: "hover:text-green-600", hint: "Enter full Google Business URL" },
49
17
  };
50
- export function SocialLinkField(_a) {
51
- var _this = this;
52
- var platform = _a.platform, url = _a.url, isCurrentUser = _a.isCurrentUser, updateUserSocialLink = _a.updateUserSocialLink;
53
- var _b = useState(url), input = _b[0], setInput = _b[1];
54
- var _c = useState(false), loading = _c[0], setLoading = _c[1];
55
- var router = useRouter();
56
- var _d = platformConfig[platform], label = _d.label, Icon = _d.icon, color = _d.color;
18
+ export function SocialLinkField({ platform, url, isCurrentUser, updateUserSocialLink, }) {
19
+ const [input, setInput] = useState(url !== null && url !== void 0 ? url : "");
20
+ const [urlError, setUrlError] = useState(null);
21
+ const [loading, setLoading] = useState(false);
22
+ const { label, icon: Icon, color, hint } = platformConfig[platform];
23
+ // #13: Validate and normalize the URL when focus leaves the input
24
+ const handleBlur = () => {
25
+ if (!input.trim() || platform === "googleBusiness")
26
+ return;
27
+ const { url: normalized, error } = normalizeSocialUrl(platform, input);
28
+ setUrlError(error);
29
+ if (!error)
30
+ setInput(normalized); // auto-correct the field to canonical URL
31
+ };
32
+ const handleSave = async () => {
33
+ if (!input.trim() || !updateUserSocialLink)
34
+ return;
35
+ // Final normalization before saving
36
+ let finalUrl = input;
37
+ if (platform !== "googleBusiness") {
38
+ const { url: normalized, error } = normalizeSocialUrl(platform, input);
39
+ if (error) {
40
+ setUrlError(error);
41
+ return;
42
+ }
43
+ finalUrl = normalized;
44
+ setInput(normalized);
45
+ }
46
+ try {
47
+ setLoading(true);
48
+ await updateUserSocialLink(platform, finalUrl);
49
+ setUrlError(null);
50
+ }
51
+ finally {
52
+ setLoading(false);
53
+ }
54
+ };
57
55
  if (isCurrentUser) {
58
- return (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Input, { type: "url", placeholder: "".concat(label, " profile url"), value: input, onChange: function (e) { return setInput(e.target.value); } }), updateUserSocialLink &&
59
- _jsx(Button, { disabled: loading || !input, onClick: function () { return __awaiter(_this, void 0, void 0, function () {
60
- return __generator(this, function (_a) {
61
- switch (_a.label) {
62
- case 0:
63
- _a.trys.push([0, , 2, 3]);
64
- setLoading(true);
65
- return [4 /*yield*/, updateUserSocialLink(platform, input)];
66
- case 1:
67
- _a.sent();
68
- return [3 /*break*/, 3];
69
- case 2:
70
- setLoading(false);
71
- return [7 /*endfinally*/];
72
- case 3: return [2 /*return*/];
73
- }
74
- });
75
- }); }, children: "Add" })] }));
56
+ return (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Icon, { className: `h-5 w-5 shrink-0 text-gray-400 ${color}` }), _jsx(Input, { type: "text", placeholder: hint, value: input, onChange: (e) => {
57
+ setInput(e.target.value);
58
+ setUrlError(null);
59
+ }, onBlur: handleBlur, className: urlError ? "border-red-400 focus:ring-red-400" : "" }), _jsx(Button, { disabled: loading || !input.trim(), onClick: handleSave, children: loading ? "Adding..." : "Add" })] }), urlError && (_jsx("p", { className: "text-xs text-red-500 ml-6", children: urlError }))] }));
76
60
  }
77
61
  else if (url) {
78
- return (_jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: "text-gray-500 ".concat(color, " flex flex-row gap-1"), children: _jsx(Icon, { className: "h-5 w-5" }) }));
62
+ return (_jsx("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: `text-gray-500 ${color} flex flex-row gap-1`, children: _jsx(Icon, { className: "h-5 w-5" }) }));
79
63
  }
80
64
  else
81
65
  return null;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utility functions for checking browser permissions
3
+ */
4
+ export declare const checkPhonePermission: () => Promise<boolean>;
5
+ export declare const checkMicrophonePermission: () => Promise<boolean>;
6
+ export declare const checkCameraPermission: () => Promise<boolean>;
7
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/utils/permissions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,oBAAoB,QAAa,OAAO,CAAC,OAAO,CAI5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAa,OAAO,CAAC,OAAO,CAejE,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAa,OAAO,CAAC,OAAO,CAa7D,CAAC"}