@caratlogic/design-system 0.1.19 → 0.1.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ShareModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AAyB1D,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA6N3E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA+BxC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA2C5C,CAAC"}
1
+ {"version":3,"file":"ShareModal.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA0B1D,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AA4O3E,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAiCxC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA6C5C,CAAC"}
@@ -1,9 +1,21 @@
1
1
  import type { ReactNode } from 'react';
2
+ export interface ShareItem {
3
+ /** One-line description of the item, e.g. "Emerald · RRT1 · 2.50 ct". */
4
+ label: string;
5
+ /** Public URL for that item. */
6
+ url: string;
7
+ }
2
8
  export interface ShareContentProps {
3
9
  /** Public URL to share (single-item mode). */
4
10
  url: string;
5
11
  /** Multiple public URLs to share as one message (bulk mode). When non-empty, single-URL social tiles (Facebook/X) are hidden. */
6
12
  urls?: string[];
13
+ /**
14
+ * Bulk mode with a caption per link, shared as a numbered list. Preferred over
15
+ * `urls`, which sends bare links the recipient cannot tell apart. Takes
16
+ * precedence when both are given.
17
+ */
18
+ items?: ShareItem[];
7
19
  /** Title used in social share prefills. */
8
20
  title?: string;
9
21
  /** Entity label used in the subtitle copy ("public view of this {entityLabel}."). Default "item". */
@@ -1 +1 @@
1
- {"version":3,"file":"ShareModal.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,iIAAiI;IACjI,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxD,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,0GAA0G;IAC1G,QAAQ,EAAE,SAAS,CAAC;IACpB,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
1
+ {"version":3,"file":"ShareModal.types.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,SAAS;IACxB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,8CAA8C;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,iIAAiI;IACjI,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qGAAqG;IACrG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACxD,iDAAiD;IACjD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,+EAA+E;IAC/E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,iBAAiB;IACvD,0GAA0G;IAC1G,QAAQ,EAAE,SAAS,CAAC;IACpB,sCAAsC;IACtC,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;IACnC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,4CAA4C;IAC5C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,6BAA6B;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,4CAA4C;IAC5C,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB"}
@@ -1,3 +1,4 @@
1
+ import type { ShareItem } from './ShareModal.types';
1
2
  export declare const buildInventoryPublicUrl: (entity: "gem" | "diamond", id?: string | null) => string;
2
3
  export interface InventoryShareTitleParams {
3
4
  entity: 'gem' | 'diamond';
@@ -11,4 +12,10 @@ export declare const buildFacebookUrl: (url: string) => string;
11
12
  export declare const buildXUrl: (text: string, url: string) => string;
12
13
  export declare const isWebShareAvailable: () => boolean;
13
14
  export declare const isValidEmail: (value: string) => boolean;
15
+ /**
16
+ * Bulk share message: the title, then one numbered entry per item with its
17
+ * caption above its link. Blank lines between entries stop chat clients from
18
+ * running the links together.
19
+ */
20
+ export declare const buildBulkShareMessage: (title: string, items: ShareItem[]) => string;
14
21
  //# sourceMappingURL=ShareModal.utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ShareModal.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.utils.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,uBAAuB,GAClC,QAAQ,KAAK,GAAG,SAAS,EACzB,KAAK,MAAM,GAAG,IAAI,KACjB,MAKF,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB,GAAI,qCAItC,yBAAyB,KAAG,MAY9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,KAAK,GAAG,SAAS,EACzB,OAAO,MAAM,KACZ,MAAiE,CAAC;AAErE,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,KAAG,MACS,CAAC;AAEvE,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAC4B,CAAC;AAE5E,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,KAAG,MAC8C,CAAC;AAErG,eAAO,MAAM,mBAAmB,QAAO,OACoC,CAAC;AAE5E,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OACI,CAAC"}
1
+ {"version":3,"file":"ShareModal.utils.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/ShareModal.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAIpD,eAAO,MAAM,uBAAuB,GAClC,QAAQ,KAAK,GAAG,SAAS,EACzB,KAAK,MAAM,GAAG,IAAI,KACjB,MAKF,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,KAAK,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACtC;AAED,eAAO,MAAM,wBAAwB,GAAI,qCAItC,yBAAyB,KAAG,MAY9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,QAAQ,KAAK,GAAG,SAAS,EACzB,OAAO,MAAM,KACZ,MAAiE,CAAC;AAErE,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,KAAG,MACS,CAAC;AAEvE,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,KAAG,MAC4B,CAAC;AAE5E,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,KAAK,MAAM,KAAG,MAC8C,CAAC;AAErG,eAAO,MAAM,mBAAmB,QAAO,OACoC,CAAC;AAE5E,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,OACI,CAAC;AAElD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,EACb,OAAO,SAAS,EAAE,KACjB,MAMW,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export { ShareMenu, ShareDialog } from './ShareModal';
2
2
  export type { ShareMenuProps, ShareDialogProps } from './ShareModal';
3
- export { buildInventoryShareTitle, buildInventoryPublicUrl, buildBulkShareTitle, buildWhatsappUrl, } from './ShareModal.utils';
3
+ export type { ShareItem } from './ShareModal.types';
4
+ export { buildInventoryShareTitle, buildInventoryPublicUrl, buildBulkShareTitle, buildBulkShareMessage, buildWhatsappUrl, } from './ShareModal.utils';
4
5
  export type { InventoryShareTitleParams } from './ShareModal.utils';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/ShareModal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrE,YAAY,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -66692,16 +66692,43 @@ const buildFacebookUrl = (url) => `https://www.facebook.com/sharer/sharer.php?u=
66692
66692
  const buildXUrl = (text, url) => `https://twitter.com/intent/tweet?text=${encodeURIComponent(text)}&url=${encodeURIComponent(url)}`;
66693
66693
  const isWebShareAvailable = () => typeof navigator !== 'undefined' && typeof navigator.share === 'function';
66694
66694
  const isValidEmail = (value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value.trim());
66695
+ /**
66696
+ * Bulk share message: the title, then one numbered entry per item with its
66697
+ * caption above its link. Blank lines between entries stop chat clients from
66698
+ * running the links together.
66699
+ */
66700
+ const buildBulkShareMessage = (title, items) => [
66701
+ title,
66702
+ ...items.map((item, index) => `\n${index + 1}. ${item.label}\n${item.url}`),
66703
+ ].join('\n');
66695
66704
 
66696
66705
  const WhatsappIcon = ({ className }) => (jsxRuntime.jsxs("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", className: className, children: [jsxRuntime.jsx("path", { d: "M17.5 14.4c-.3-.1-1.7-.8-1.9-.9-.3-.1-.5-.1-.7.1s-.8.9-1 1.1-.4.2-.7.1c-1.6-.8-2.7-1.4-3.7-3.2-.3-.5.3-.5.8-1.5.1-.2.1-.4 0-.5l-.9-2.1c-.2-.6-.5-.5-.7-.5h-.6c-.2 0-.5.1-.8.4-.3.3-1 1-1 2.5s1.1 2.9 1.2 3.1c.2.2 2.2 3.3 5.3 4.6 2 .8 2.7.9 3.7.8.6-.1 1.7-.7 1.9-1.3.2-.7.2-1.2.2-1.3-.1-.2-.3-.3-.6-.4Z" }), jsxRuntime.jsx("path", { d: "M20 4A11 11 0 0 0 4 4a10.9 10.9 0 0 0-1.7 13.4L1 23l5.7-1.5A11 11 0 0 0 23 12 10.9 10.9 0 0 0 20 4Zm-8 18a9.1 9.1 0 0 1-4.6-1.3l-.3-.2-3.4.9.9-3.3-.2-.4A9 9 0 1 1 12 22Z" })] }));
66697
66706
  const SocialTile = ({ icon, label, bg, fg, onClick }) => (jsxRuntime.jsxs("button", { type: "button", onClick: onClick, className: "flex cursor-pointer flex-col items-center gap-2 focus-visible:outline-none", children: [jsxRuntime.jsx("span", { className: cn('flex h-12 w-12 items-center justify-center rounded-full transition-transform hover:scale-105', bg, fg), children: icon }), jsxRuntime.jsx("span", { className: "text-xs text-foreground", children: label })] }));
66698
- const ShareBody = ({ url, urls, title = 'Check this out', entityLabel = 'item', onInviteEmail, hideInvite = false, hideHeader = false, }) => {
66707
+ const ShareBody = ({ url, urls, items, title = 'Check this out', entityLabel = 'item', onInviteEmail, hideInvite = false, hideHeader = false, }) => {
66699
66708
  const [email, setEmail] = React.useState('');
66700
66709
  const [sending, setSending] = React.useState(false);
66701
- const isMulti = (urls?.length ?? 0) > 0;
66702
- const shareUrls = isMulti ? (urls ?? []) : url ? [url] : [];
66710
+ const shareItems = items ?? [];
66711
+ const isMulti = shareItems.length > 0 || (urls?.length ?? 0) > 0;
66712
+ const shareUrls = shareItems.length
66713
+ ? shareItems.map((item) => item.url)
66714
+ : isMulti
66715
+ ? (urls ?? [])
66716
+ : url
66717
+ ? [url]
66718
+ : [];
66703
66719
  const hasContent = shareUrls.length > 0;
66704
- const shareBody = isMulti ? [title, ...shareUrls].join('\n') : url;
66720
+ // Captioned items read as a numbered list; bare urls keep the older format.
66721
+ const shareBody = shareItems.length
66722
+ ? buildBulkShareMessage(title, shareItems)
66723
+ : isMulti
66724
+ ? [title, ...shareUrls].join('\n')
66725
+ : url;
66726
+ /**
66727
+ * What chat apps receive. A single share puts its link on its own line, the
66728
+ * same shape as one entry of a bulk message — glued to the caption it reads
66729
+ * as one run-on sentence. Copy Link still copies the bare url.
66730
+ */
66731
+ const shareMessage = isMulti ? shareBody : [title, url].filter(Boolean).join('\n');
66705
66732
  const openInPopup = (href) => {
66706
66733
  if (!hasContent)
66707
66734
  return;
@@ -66728,7 +66755,7 @@ const ShareBody = ({ url, urls, title = 'Check this out', entityLabel = 'item',
66728
66755
  return;
66729
66756
  }
66730
66757
  try {
66731
- await navigator.share(isMulti ? { title, text: shareBody } : { url, title });
66758
+ await navigator.share(isMulti ? { title, text: shareMessage } : { url, title, text: shareMessage });
66732
66759
  }
66733
66760
  catch (e) {
66734
66761
  const err = e;
@@ -66763,16 +66790,14 @@ const ShareBody = ({ url, urls, title = 'Check this out', entityLabel = 'item',
66763
66790
  };
66764
66791
  return (jsxRuntime.jsxs("div", { className: "flex flex-col gap-3", children: [!hideHeader && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("header", { className: "flex flex-col gap-1", children: [jsxRuntime.jsx("h3", { className: "text-base font-semibold text-foreground", children: "Share" }), jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: isMulti
66765
66792
  ? `Anyone with these links can open the public view of the selected ${entityLabel}s.`
66766
- : `Anyone with the link can open the public view of this ${entityLabel}.` })] }), jsxRuntime.jsx(Separator, {})] })), jsxRuntime.jsxs("section", { className: "flex flex-col gap-3", children: [jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground", children: "Social" }), jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(WhatsappIcon, { className: "h-6 w-6" }), label: "Whatsapp", bg: "bg-[#25D366]", fg: "text-white", onClick: () => openInPopup(isMulti
66767
- ? buildWhatsappUrl('', shareBody)
66768
- : buildWhatsappUrl(title, url)) }), !isMulti && (jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Facebook, { className: "h-6 w-6", fill: "currentColor" }), label: "Facebook", bg: "bg-[#1877F2]", fg: "text-white", onClick: () => openInPopup(buildFacebookUrl(url)) })), !isMulti && (jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(X$2, { className: "h-6 w-6", strokeWidth: 2.5 }), label: "X", bg: "bg-black", fg: "text-white", onClick: () => openInPopup(buildXUrl(title, url)) })), jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Link2, { className: "h-6 w-6", strokeWidth: 1.5 }), label: "Copy Link", bg: "bg-muted", fg: "text-foreground", onClick: handleCopy }), jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Share2, { className: "h-6 w-6", strokeWidth: 1.5 }), label: "System Share", bg: "bg-muted", fg: "text-foreground", onClick: handleSystemShare })] })] }), !hideInvite && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs("section", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground", children: "Invite your Merchants" }), jsxRuntime.jsxs("form", { className: "flex items-center gap-2", onSubmit: (e) => {
66793
+ : `Anyone with the link can open the public view of this ${entityLabel}.` })] }), jsxRuntime.jsx(Separator, {})] })), jsxRuntime.jsxs("section", { className: "flex flex-col gap-3", children: [jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground", children: "Social" }), jsxRuntime.jsxs("div", { className: "grid grid-cols-3 gap-3", children: [jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(WhatsappIcon, { className: "h-6 w-6" }), label: "Whatsapp", bg: "bg-[#25D366]", fg: "text-white", onClick: () => openInPopup(buildWhatsappUrl('', shareMessage)) }), !isMulti && (jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Facebook, { className: "h-6 w-6", fill: "currentColor" }), label: "Facebook", bg: "bg-[#1877F2]", fg: "text-white", onClick: () => openInPopup(buildFacebookUrl(url)) })), !isMulti && (jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(X$2, { className: "h-6 w-6", strokeWidth: 2.5 }), label: "X", bg: "bg-black", fg: "text-white", onClick: () => openInPopup(buildXUrl(title, url)) })), jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Link2, { className: "h-6 w-6", strokeWidth: 1.5 }), label: "Copy Link", bg: "bg-muted", fg: "text-foreground", onClick: handleCopy }), jsxRuntime.jsx(SocialTile, { icon: jsxRuntime.jsx(Share2, { className: "h-6 w-6", strokeWidth: 1.5 }), label: "System Share", bg: "bg-muted", fg: "text-foreground", onClick: handleSystemShare })] })] }), !hideInvite && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Separator, {}), jsxRuntime.jsxs("section", { className: "flex flex-col gap-2", children: [jsxRuntime.jsx("h4", { className: "text-sm font-medium text-foreground", children: "Invite your Merchants" }), jsxRuntime.jsxs("form", { className: "flex items-center gap-2", onSubmit: (e) => {
66769
66794
  e.preventDefault();
66770
66795
  void handleSend();
66771
66796
  }, children: [jsxRuntime.jsx("input", { type: "email", value: email, onChange: (e) => setEmail(e.target.value), placeholder: "Example@gmail.com", className: "flex-1 rounded-md border border-border bg-input-background px-3 py-2 text-sm text-foreground outline-none placeholder:text-muted-foreground focus:border-primary focus:ring-2 focus:ring-primary/10" }), jsxRuntime.jsx(Button$1, { type: "submit", size: "sm", style: { width: '118px' }, className: "bg-primary text-primary-foreground hover:bg-primary/90", disabled: sending, children: sending ? 'Sending…' : 'Send' })] })] })] }))] }));
66772
66797
  };
66773
- const ShareMenu = ({ children, url, urls, title, entityLabel, onInviteEmail, hideInvite, side = 'bottom', align = 'end', open, onOpenChange, }) => (jsxRuntime.jsxs(Popover, { open: open, onOpenChange: onOpenChange, children: [jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: children }), jsxRuntime.jsx(PopoverContent, { side: side, align: align, sideOffset: 8, className: "w-[360px] p-4", children: jsxRuntime.jsx(ShareBody, { url: url, urls: urls, title: title, entityLabel: entityLabel, onInviteEmail: onInviteEmail, hideInvite: hideInvite }) })] }));
66774
- const ShareDialog = ({ open, onOpenChange, url, urls, title, entityLabel = 'item', onInviteEmail, hideInvite, stockId, }) => {
66775
- const count = urls?.length ?? 0;
66798
+ const ShareMenu = ({ children, url, urls, items, title, entityLabel, onInviteEmail, hideInvite, side = 'bottom', align = 'end', open, onOpenChange, }) => (jsxRuntime.jsxs(Popover, { open: open, onOpenChange: onOpenChange, children: [jsxRuntime.jsx(PopoverTrigger, { asChild: true, children: children }), jsxRuntime.jsx(PopoverContent, { side: side, align: align, sideOffset: 8, className: "w-[360px] p-4", children: jsxRuntime.jsx(ShareBody, { url: url, urls: urls, items: items, title: title, entityLabel: entityLabel, onInviteEmail: onInviteEmail, hideInvite: hideInvite }) })] }));
66799
+ const ShareDialog = ({ open, onOpenChange, url, urls, items, title, entityLabel = 'item', onInviteEmail, hideInvite, stockId, }) => {
66800
+ const count = items?.length ?? urls?.length ?? 0;
66776
66801
  const isMulti = count > 0;
66777
66802
  const trimmedStockId = stockId?.trim();
66778
66803
  const heading = isMulti
@@ -66782,7 +66807,7 @@ const ShareDialog = ({ open, onOpenChange, url, urls, title, entityLabel = 'item
66782
66807
  : 'Share';
66783
66808
  return (jsxRuntime.jsx(Dialog, { open: open, onOpenChange: onOpenChange, children: jsxRuntime.jsxs(DialogContent, { className: "sm:max-w-[400px]", children: [jsxRuntime.jsxs(DialogHeader, { children: [jsxRuntime.jsx(DialogTitle, { children: heading }), jsxRuntime.jsx(DialogDescription, { children: isMulti
66784
66809
  ? `Anyone with these links can open the public view of the selected ${entityLabel}s.`
66785
- : `Anyone with the link can open the public view of this ${entityLabel}.` })] }), jsxRuntime.jsx(ShareBody, { url: url, urls: urls, title: title, entityLabel: entityLabel, onInviteEmail: onInviteEmail, hideInvite: hideInvite, hideHeader: true })] }) }));
66810
+ : `Anyone with the link can open the public view of this ${entityLabel}.` })] }), jsxRuntime.jsx(ShareBody, { url: url, urls: urls, items: items, title: title, entityLabel: entityLabel, onInviteEmail: onInviteEmail, hideInvite: hideInvite, hideHeader: true })] }) }));
66786
66811
  };
66787
66812
 
66788
66813
  const Table = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsx("table", { ref: ref, className: cn('w-full text-sm text-left border-collapse', className), ...props })));
@@ -77832,6 +77857,7 @@ exports.ZoomSplitViewer = ZoomSplitViewer;
77832
77857
  exports.asList = asList;
77833
77858
  exports.asText = asText;
77834
77859
  exports.badgeVariants = badgeVariants;
77860
+ exports.buildBulkShareMessage = buildBulkShareMessage;
77835
77861
  exports.buildBulkShareTitle = buildBulkShareTitle;
77836
77862
  exports.buildInventoryPublicUrl = buildInventoryPublicUrl;
77837
77863
  exports.buildInventoryRowProps = buildInventoryRowProps;