@purpur/library 9.5.0 → 9.6.0

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 (94) hide show
  1. package/CHANGELOG.json +21 -0
  2. package/CHANGELOG.md +11 -1
  3. package/dist/LICENSE.txt +23 -2
  4. package/dist/avatar-CYnD57o4.js +2 -0
  5. package/dist/avatar-CYnD57o4.js.map +1 -0
  6. package/dist/avatar-CzbDD1MK.mjs +27 -0
  7. package/dist/avatar-CzbDD1MK.mjs.map +1 -0
  8. package/dist/avatar.cjs.js +2 -0
  9. package/dist/avatar.cjs.js.map +1 -0
  10. package/dist/avatar.es.js +5 -0
  11. package/dist/avatar.es.js.map +1 -0
  12. package/dist/color-dot-BEE5rKco.js +2 -0
  13. package/dist/color-dot-BEE5rKco.js.map +1 -0
  14. package/dist/color-dot-Dz9yzVX3.mjs +28 -0
  15. package/dist/color-dot-Dz9yzVX3.mjs.map +1 -0
  16. package/dist/color-dot.cjs.js +1 -1
  17. package/dist/color-dot.es.js +4 -3
  18. package/dist/comparison-table-CZMKl1TX.mjs +292 -0
  19. package/dist/comparison-table-CZMKl1TX.mjs.map +1 -0
  20. package/dist/comparison-table-Nhp5W6Yc.js +2 -0
  21. package/dist/comparison-table-Nhp5W6Yc.js.map +1 -0
  22. package/dist/comparison-table.cjs.js +1 -1
  23. package/dist/comparison-table.es.js +1 -1
  24. package/dist/components/avatar/src/avatar-constants.d.ts +2 -0
  25. package/dist/components/avatar/src/avatar-constants.d.ts.map +1 -0
  26. package/dist/components/avatar/src/avatar.d.ts +26 -0
  27. package/dist/components/avatar/src/avatar.d.ts.map +1 -0
  28. package/dist/components/color-dot/src/color-dot.d.ts +18 -8
  29. package/dist/components/color-dot/src/color-dot.d.ts.map +1 -1
  30. package/dist/components/comparison-table/src/components/OptionCard/option-card.d.ts.map +1 -1
  31. package/dist/components/loading/src/loading-dots.d.ts +19 -0
  32. package/dist/components/loading/src/loading-dots.d.ts.map +1 -0
  33. package/dist/components/loading/src/loading-text.d.ts +21 -0
  34. package/dist/components/loading/src/loading-text.d.ts.map +1 -0
  35. package/dist/components/loading/src/loading.d.ts +10 -0
  36. package/dist/components/loading/src/loading.d.ts.map +1 -0
  37. package/dist/components/message/src/message-bubble.d.ts +22 -0
  38. package/dist/components/message/src/message-bubble.d.ts.map +1 -0
  39. package/dist/components/message/src/message-stamp.d.ts +26 -0
  40. package/dist/components/message/src/message-stamp.d.ts.map +1 -0
  41. package/dist/components/message/src/message-utils.d.ts +3 -0
  42. package/dist/components/message/src/message-utils.d.ts.map +1 -0
  43. package/dist/components/message/src/message.d.ts +42 -0
  44. package/dist/components/message/src/message.d.ts.map +1 -0
  45. package/dist/components-metadata.js +33 -2
  46. package/dist/libraries/library/src/avatar.d.ts +6 -0
  47. package/dist/libraries/library/src/avatar.d.ts.map +1 -0
  48. package/dist/libraries/library/src/library.d.ts +3 -0
  49. package/dist/libraries/library/src/library.d.ts.map +1 -1
  50. package/dist/libraries/library/src/loading.d.ts +6 -0
  51. package/dist/libraries/library/src/loading.d.ts.map +1 -0
  52. package/dist/libraries/library/src/message.d.ts +6 -0
  53. package/dist/libraries/library/src/message.d.ts.map +1 -0
  54. package/dist/library.cjs.js +1 -1
  55. package/dist/library.es.js +632 -625
  56. package/dist/library.es.js.map +1 -1
  57. package/dist/loading-Dwtkjstg.js +2 -0
  58. package/dist/loading-Dwtkjstg.js.map +1 -0
  59. package/dist/loading-r23nxJSz.mjs +107 -0
  60. package/dist/loading-r23nxJSz.mjs.map +1 -0
  61. package/dist/loading.cjs.js +2 -0
  62. package/dist/loading.cjs.js.map +1 -0
  63. package/dist/loading.es.js +5 -0
  64. package/dist/loading.es.js.map +1 -0
  65. package/dist/message-0yTS5pOF.js +3 -0
  66. package/dist/message-0yTS5pOF.js.map +1 -0
  67. package/dist/message-D9CDwcw9.mjs +132 -0
  68. package/dist/message-D9CDwcw9.mjs.map +1 -0
  69. package/dist/message.cjs.js +2 -0
  70. package/dist/message.cjs.js.map +1 -0
  71. package/dist/message.es.js +5 -0
  72. package/dist/message.es.js.map +1 -0
  73. package/dist/{product-card-CoY1KggV.js → product-card-8X-Ld2d_.js} +2 -2
  74. package/dist/{product-card-CoY1KggV.js.map → product-card-8X-Ld2d_.js.map} +1 -1
  75. package/dist/{product-card-C3_N0t-R.mjs → product-card-Bt-F0wKr.mjs} +10 -10
  76. package/dist/{product-card-C3_N0t-R.mjs.map → product-card-Bt-F0wKr.mjs.map} +1 -1
  77. package/dist/product-card.cjs.js +1 -1
  78. package/dist/product-card.es.js +1 -1
  79. package/dist/purpur.css +1 -1
  80. package/package.json +24 -21
  81. package/src/aliases.ts +12 -0
  82. package/src/avatar.ts +6 -0
  83. package/src/entries.js +3 -0
  84. package/src/library.ts +6 -0
  85. package/src/loading.ts +6 -0
  86. package/src/message.ts +6 -0
  87. package/dist/color-dot-6Mxngvce.mjs +0 -34
  88. package/dist/color-dot-6Mxngvce.mjs.map +0 -1
  89. package/dist/color-dot-B9w_ucWb.js +0 -2
  90. package/dist/color-dot-B9w_ucWb.js.map +0 -1
  91. package/dist/comparison-table-C74IAVqz.js +0 -2
  92. package/dist/comparison-table-C74IAVqz.js.map +0 -1
  93. package/dist/comparison-table-DctKxmX9.mjs +0 -267
  94. package/dist/comparison-table-DctKxmX9.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"library.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"library.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const t=require("react/jsx-runtime"),d=require("react"),y=require("./visually-hidden-C2CKovZx.js"),x=require("./bind-DeUYJ6m9.js"),m=require("./paragraph-By4jMjnH.js"),N={"purpur-loading-dots":"_purpur-loading-dots_kw4ys_1","purpur-loading-dots__dot":"_purpur-loading-dots__dot_kw4ys_7","purpur-loading-dots-bounce":"_purpur-loading-dots-bounce_kw4ys_1","purpur-loading-dots__dot--left":"_purpur-loading-dots__dot--left_kw4ys_22","purpur-loading-dots__dot--middle":"_purpur-loading-dots__dot--middle_kw4ys_25","purpur-loading-dots__dot--right":"_purpur-loading-dots__dot--right_kw4ys_28","purpur-loading-dots--negative":"_purpur-loading-dots--negative_kw4ys_31"},n=x.c.bind(N),a="purpur-loading-dots",w=({className:s,negative:r=!1,"aria-label":e,role:u="status","aria-atomic":p="true","aria-live":_="polite"})=>{const[l,i]=d.useState("");return d.useEffect(()=>{const c=window.setTimeout(()=>{i(e)},0);return()=>window.clearTimeout(c)},[e]),t.jsxs("div",{className:n(a,s,{[`${a}--negative`]:r}),role:u,"aria-atomic":p,"aria-live":_,children:[t.jsx(y.VisuallyHidden,{children:l}),t.jsx("span",{"aria-hidden":"true",className:n(`${a}__dot`,`${a}__dot--left`)}),t.jsx("span",{"aria-hidden":"true",className:n(`${a}__dot`,`${a}__dot--middle`)}),t.jsx("span",{"aria-hidden":"true",className:n(`${a}__dot`,`${a}__dot--right`)})]})};w.displayName="Loading.Dots";const b={"purpur-loading":"_purpur-loading_ugc3y_1","purpur-loading--deep-thinking":"_purpur-loading--deep-thinking_ugc3y_5","purpur-loading__deep-thinking-text":"_purpur-loading__deep-thinking-text_ugc3y_8","purpur-loading-shimmer":"_purpur-loading-shimmer_ugc3y_1","purpur-paragraph":"_purpur-paragraph_ugc3y_29","purpur-loading--negative":"_purpur-loading--negative_ugc3y_33"},h=x.c.bind(b),o="purpur-loading",k=({className:s,negative:r=!1,label:e,"aria-label":u,role:p="status","aria-atomic":_="true","aria-live":l="polite"})=>{const i=u??e,[c,v]=d.useState("");return d.useEffect(()=>{const $=window.setTimeout(()=>{v(i)},0);return()=>window.clearTimeout($)},[i]),t.jsxs("div",{className:h(o,`${o}--deep-thinking`,s,{[`${o}--negative`]:r}),role:p,"aria-atomic":_,"aria-live":l,children:[t.jsx(y.VisuallyHidden,{children:c}),t.jsx(m.Paragraph,{"aria-hidden":"true",className:h(`${o}__deep-thinking-text`),negative:r,variant:m.ParagraphVariant.PARAGRAPH100MEDIUM,children:e})]})};k.displayName="Loading.Text";const g={};g.Dots=w;g.Text=k;exports.Loading=g;
2
+ //# sourceMappingURL=loading-Dwtkjstg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-Dwtkjstg.js","sources":["../../../components/loading/src/loading-dots.tsx","../../../components/loading/src/loading-text.tsx","../../../components/loading/src/loading.tsx"],"sourcesContent":["import React, { type AriaAttributes, type AriaRole, useEffect, useState } from \"react\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./loading-dots.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-loading-dots\";\n\nexport type LoadingDotsProps = {\n className?: string;\n negative?: boolean;\n /** Optional ARIA role for the live region. Defaults to `status`. */\n role?: AriaRole;\n /** Optional ARIA atomic setting for the live region. Defaults to `true`. */\n \"aria-atomic\"?: AriaAttributes[\"aria-atomic\"];\n /** Optional ARIA live politeness setting. Defaults to `polite`. */\n \"aria-live\"?: AriaAttributes[\"aria-live\"];\n /** Accessible label announced by assistive technologies for the typing indicator. */\n \"aria-label\": string;\n};\n\nconst LoadingDots = ({\n className,\n negative = false,\n \"aria-label\": ariaLabel,\n role = \"status\",\n \"aria-atomic\": ariaAtomic = \"true\",\n \"aria-live\": ariaLive = \"polite\",\n}: LoadingDotsProps) => {\n // Defer label text by one frame so the live region wrapper is already in the\n // accessibility tree when content appears. VoiceOver only announces content\n // that mutates an existing live region, not content present at mount time.\n const [announcedLabel, setAnnouncedLabel] = useState(\"\");\n\n useEffect(() => {\n const timer = window.setTimeout(() => {\n setAnnouncedLabel(ariaLabel);\n }, 0);\n return () => window.clearTimeout(timer);\n }, [ariaLabel]);\n\n return (\n <div\n className={cx(rootClassName, className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role={role}\n aria-atomic={ariaAtomic}\n aria-live={ariaLive}\n >\n <VisuallyHidden>{announcedLabel}</VisuallyHidden>\n <span aria-hidden=\"true\" className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--left`)} />\n <span\n aria-hidden=\"true\"\n className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--middle`)}\n />\n <span aria-hidden=\"true\" className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--right`)} />\n </div>\n );\n};\n\nLoadingDots.displayName = \"Loading.Dots\";\n\nexport { LoadingDots };\n","import React, { type AriaAttributes, type AriaRole, useEffect, useState } from \"react\";\nimport { Paragraph, ParagraphVariant } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./loading-text.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-loading\";\n\nexport type LoadingTextProps = {\n className?: string;\n negative?: boolean;\n /** Visible label displayed during the deep-thinking state. */\n label: string;\n /** Optional accessible label for deep-thinking. Falls back to `label` when omitted. */\n \"aria-label\"?: string;\n /** Optional ARIA role for the live region. Defaults to `status`. */\n role?: AriaRole;\n /** Optional ARIA atomic setting for the live region. Defaults to `true`. */\n \"aria-atomic\"?: AriaAttributes[\"aria-atomic\"];\n /** Optional ARIA live politeness setting. Defaults to `polite`. */\n \"aria-live\"?: AriaAttributes[\"aria-live\"];\n};\n\nconst LoadingText = ({\n className,\n negative = false,\n label,\n \"aria-label\": ariaLabel,\n role = \"status\",\n \"aria-atomic\": ariaAtomic = \"true\",\n \"aria-live\": ariaLive = \"polite\",\n}: LoadingTextProps) => {\n // Defer the announced label by one frame so the live region wrapper is\n // already in the accessibility tree when the text node appears.\n // VoiceOver only announces content that mutates an existing live region,\n // not content present at mount time.\n const announcement = ariaLabel ?? label;\n const [announcedLabel, setAnnouncedLabel] = useState(\"\");\n\n useEffect(() => {\n const timer = window.setTimeout(() => {\n setAnnouncedLabel(announcement);\n }, 0);\n return () => window.clearTimeout(timer);\n }, [announcement]);\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--deep-thinking`, className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role={role}\n aria-atomic={ariaAtomic}\n aria-live={ariaLive}\n >\n <VisuallyHidden>{announcedLabel}</VisuallyHidden>\n <Paragraph\n aria-hidden=\"true\"\n className={cx(`${rootClassName}__deep-thinking-text`)}\n negative={negative}\n variant={ParagraphVariant.PARAGRAPH100MEDIUM}\n >\n {label}\n </Paragraph>\n </div>\n );\n};\n\nLoadingText.displayName = \"Loading.Text\";\n\nexport { LoadingText };\n","import { LoadingDots, type LoadingDotsProps } from \"./loading-dots\";\nimport { LoadingText, type LoadingTextProps } from \"./loading-text\";\n\n// Root namespace component\ntype LoadingComponent = {\n Dots: typeof LoadingDots;\n Text: typeof LoadingText;\n};\n\nconst Loading = {} as LoadingComponent;\nLoading.Dots = LoadingDots;\nLoading.Text = LoadingText;\n\nexport { Loading };\nexport type { LoadingDotsProps, LoadingTextProps };\n"],"names":["cx","c","styles","rootClassName","LoadingDots","className","negative","ariaLabel","role","ariaAtomic","ariaLive","announcedLabel","setAnnouncedLabel","useState","useEffect","timer","jsxs","jsx","VisuallyHidden","LoadingText","label","announcement","Paragraph","ParagraphVariant","Loading"],"mappings":"oqBAMMA,EAAKC,EAAAA,EAAE,KAAKC,CAAM,EAClBC,EAAgB,sBAehBC,EAAc,CAAC,CACnB,UAAAC,EACA,SAAAC,EAAW,GACX,aAAcC,EACd,KAAAC,EAAO,SACP,cAAeC,EAAa,OAC5B,YAAaC,EAAW,QAC1B,IAAwB,CAItB,KAAM,CAACC,EAAgBC,CAAiB,EAAIC,EAAAA,SAAS,EAAE,EAEvDC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAQ,OAAO,WAAW,IAAM,CACpCH,EAAkBL,CAAS,CAC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AAC,GAAGF,CAAa,YAAY,EAAGG,CAAA,CACjC,EACD,KAAAE,EACA,cAAaC,EACb,YAAWC,EAEX,SAAA,CAAAO,EAAAA,IAACC,EAAAA,gBAAgB,SAAAP,CAAA,CAAe,EAChCM,EAAAA,IAACK,EAAAA,UAAA,CACC,cAAY,OACZ,UAAWtB,EAAG,GAAGG,CAAa,sBAAsB,EACpD,SAAAG,EACA,QAASiB,EAAAA,iBAAiB,mBAEzB,SAAAH,CAAA,CAAA,CACH,CAAA,CAAA,CAGN,EAEAD,EAAY,YAAc,eC7D1B,MAAMK,EAAU,CAAA,EAChBA,EAAQ,KAAOpB,EACfoB,EAAQ,KAAOL"}
@@ -0,0 +1,107 @@
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { useState as m, useEffect as h } from "react";
3
+ import { V as y } from "./visually-hidden-BYFkJEp1.mjs";
4
+ import { c as w } from "./bind-CU-R61T-.mjs";
5
+ import { P as N, a as L } from "./paragraph-DSxXmX_0.mjs";
6
+ const b = {
7
+ "purpur-loading-dots": "_purpur-loading-dots_kw4ys_1",
8
+ "purpur-loading-dots__dot": "_purpur-loading-dots__dot_kw4ys_7",
9
+ "purpur-loading-dots-bounce": "_purpur-loading-dots-bounce_kw4ys_1",
10
+ "purpur-loading-dots__dot--left": "_purpur-loading-dots__dot--left_kw4ys_22",
11
+ "purpur-loading-dots__dot--middle": "_purpur-loading-dots__dot--middle_kw4ys_25",
12
+ "purpur-loading-dots__dot--right": "_purpur-loading-dots__dot--right_kw4ys_28",
13
+ "purpur-loading-dots--negative": "_purpur-loading-dots--negative_kw4ys_31"
14
+ }, e = w.bind(b), a = "purpur-loading-dots", k = ({
15
+ className: d,
16
+ negative: i = !1,
17
+ "aria-label": t,
18
+ role: u = "status",
19
+ "aria-atomic": s = "true",
20
+ "aria-live": p = "polite"
21
+ }) => {
22
+ const [_, o] = m("");
23
+ return h(() => {
24
+ const l = window.setTimeout(() => {
25
+ o(t);
26
+ }, 0);
27
+ return () => window.clearTimeout(l);
28
+ }, [t]), /* @__PURE__ */ c(
29
+ "div",
30
+ {
31
+ className: e(a, d, {
32
+ [`${a}--negative`]: i
33
+ }),
34
+ role: u,
35
+ "aria-atomic": s,
36
+ "aria-live": p,
37
+ children: [
38
+ /* @__PURE__ */ r(y, { children: _ }),
39
+ /* @__PURE__ */ r("span", { "aria-hidden": "true", className: e(`${a}__dot`, `${a}__dot--left`) }),
40
+ /* @__PURE__ */ r(
41
+ "span",
42
+ {
43
+ "aria-hidden": "true",
44
+ className: e(`${a}__dot`, `${a}__dot--middle`)
45
+ }
46
+ ),
47
+ /* @__PURE__ */ r("span", { "aria-hidden": "true", className: e(`${a}__dot`, `${a}__dot--right`) })
48
+ ]
49
+ }
50
+ );
51
+ };
52
+ k.displayName = "Loading.Dots";
53
+ const T = {
54
+ "purpur-loading": "_purpur-loading_ugc3y_1",
55
+ "purpur-loading--deep-thinking": "_purpur-loading--deep-thinking_ugc3y_5",
56
+ "purpur-loading__deep-thinking-text": "_purpur-loading__deep-thinking-text_ugc3y_8",
57
+ "purpur-loading-shimmer": "_purpur-loading-shimmer_ugc3y_1",
58
+ "purpur-paragraph": "_purpur-paragraph_ugc3y_29",
59
+ "purpur-loading--negative": "_purpur-loading--negative_ugc3y_33"
60
+ }, g = w.bind(T), n = "purpur-loading", $ = ({
61
+ className: d,
62
+ negative: i = !1,
63
+ label: t,
64
+ "aria-label": u,
65
+ role: s = "status",
66
+ "aria-atomic": p = "true",
67
+ "aria-live": _ = "polite"
68
+ }) => {
69
+ const o = u ?? t, [l, v] = m("");
70
+ return h(() => {
71
+ const x = window.setTimeout(() => {
72
+ v(o);
73
+ }, 0);
74
+ return () => window.clearTimeout(x);
75
+ }, [o]), /* @__PURE__ */ c(
76
+ "div",
77
+ {
78
+ className: g(n, `${n}--deep-thinking`, d, {
79
+ [`${n}--negative`]: i
80
+ }),
81
+ role: s,
82
+ "aria-atomic": p,
83
+ "aria-live": _,
84
+ children: [
85
+ /* @__PURE__ */ r(y, { children: l }),
86
+ /* @__PURE__ */ r(
87
+ N,
88
+ {
89
+ "aria-hidden": "true",
90
+ className: g(`${n}__deep-thinking-text`),
91
+ negative: i,
92
+ variant: L.PARAGRAPH100MEDIUM,
93
+ children: t
94
+ }
95
+ )
96
+ ]
97
+ }
98
+ );
99
+ };
100
+ $.displayName = "Loading.Text";
101
+ const f = {};
102
+ f.Dots = k;
103
+ f.Text = $;
104
+ export {
105
+ f as L
106
+ };
107
+ //# sourceMappingURL=loading-r23nxJSz.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading-r23nxJSz.mjs","sources":["../../../components/loading/src/loading-dots.tsx","../../../components/loading/src/loading-text.tsx","../../../components/loading/src/loading.tsx"],"sourcesContent":["import React, { type AriaAttributes, type AriaRole, useEffect, useState } from \"react\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./loading-dots.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-loading-dots\";\n\nexport type LoadingDotsProps = {\n className?: string;\n negative?: boolean;\n /** Optional ARIA role for the live region. Defaults to `status`. */\n role?: AriaRole;\n /** Optional ARIA atomic setting for the live region. Defaults to `true`. */\n \"aria-atomic\"?: AriaAttributes[\"aria-atomic\"];\n /** Optional ARIA live politeness setting. Defaults to `polite`. */\n \"aria-live\"?: AriaAttributes[\"aria-live\"];\n /** Accessible label announced by assistive technologies for the typing indicator. */\n \"aria-label\": string;\n};\n\nconst LoadingDots = ({\n className,\n negative = false,\n \"aria-label\": ariaLabel,\n role = \"status\",\n \"aria-atomic\": ariaAtomic = \"true\",\n \"aria-live\": ariaLive = \"polite\",\n}: LoadingDotsProps) => {\n // Defer label text by one frame so the live region wrapper is already in the\n // accessibility tree when content appears. VoiceOver only announces content\n // that mutates an existing live region, not content present at mount time.\n const [announcedLabel, setAnnouncedLabel] = useState(\"\");\n\n useEffect(() => {\n const timer = window.setTimeout(() => {\n setAnnouncedLabel(ariaLabel);\n }, 0);\n return () => window.clearTimeout(timer);\n }, [ariaLabel]);\n\n return (\n <div\n className={cx(rootClassName, className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role={role}\n aria-atomic={ariaAtomic}\n aria-live={ariaLive}\n >\n <VisuallyHidden>{announcedLabel}</VisuallyHidden>\n <span aria-hidden=\"true\" className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--left`)} />\n <span\n aria-hidden=\"true\"\n className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--middle`)}\n />\n <span aria-hidden=\"true\" className={cx(`${rootClassName}__dot`, `${rootClassName}__dot--right`)} />\n </div>\n );\n};\n\nLoadingDots.displayName = \"Loading.Dots\";\n\nexport { LoadingDots };\n","import React, { type AriaAttributes, type AriaRole, useEffect, useState } from \"react\";\nimport { Paragraph, ParagraphVariant } from \"@purpur/paragraph\";\nimport { VisuallyHidden } from \"@purpur/visually-hidden\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./loading-text.module.scss\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-loading\";\n\nexport type LoadingTextProps = {\n className?: string;\n negative?: boolean;\n /** Visible label displayed during the deep-thinking state. */\n label: string;\n /** Optional accessible label for deep-thinking. Falls back to `label` when omitted. */\n \"aria-label\"?: string;\n /** Optional ARIA role for the live region. Defaults to `status`. */\n role?: AriaRole;\n /** Optional ARIA atomic setting for the live region. Defaults to `true`. */\n \"aria-atomic\"?: AriaAttributes[\"aria-atomic\"];\n /** Optional ARIA live politeness setting. Defaults to `polite`. */\n \"aria-live\"?: AriaAttributes[\"aria-live\"];\n};\n\nconst LoadingText = ({\n className,\n negative = false,\n label,\n \"aria-label\": ariaLabel,\n role = \"status\",\n \"aria-atomic\": ariaAtomic = \"true\",\n \"aria-live\": ariaLive = \"polite\",\n}: LoadingTextProps) => {\n // Defer the announced label by one frame so the live region wrapper is\n // already in the accessibility tree when the text node appears.\n // VoiceOver only announces content that mutates an existing live region,\n // not content present at mount time.\n const announcement = ariaLabel ?? label;\n const [announcedLabel, setAnnouncedLabel] = useState(\"\");\n\n useEffect(() => {\n const timer = window.setTimeout(() => {\n setAnnouncedLabel(announcement);\n }, 0);\n return () => window.clearTimeout(timer);\n }, [announcement]);\n\n return (\n <div\n className={cx(rootClassName, `${rootClassName}--deep-thinking`, className, {\n [`${rootClassName}--negative`]: negative,\n })}\n role={role}\n aria-atomic={ariaAtomic}\n aria-live={ariaLive}\n >\n <VisuallyHidden>{announcedLabel}</VisuallyHidden>\n <Paragraph\n aria-hidden=\"true\"\n className={cx(`${rootClassName}__deep-thinking-text`)}\n negative={negative}\n variant={ParagraphVariant.PARAGRAPH100MEDIUM}\n >\n {label}\n </Paragraph>\n </div>\n );\n};\n\nLoadingText.displayName = \"Loading.Text\";\n\nexport { LoadingText };\n","import { LoadingDots, type LoadingDotsProps } from \"./loading-dots\";\nimport { LoadingText, type LoadingTextProps } from \"./loading-text\";\n\n// Root namespace component\ntype LoadingComponent = {\n Dots: typeof LoadingDots;\n Text: typeof LoadingText;\n};\n\nconst Loading = {} as LoadingComponent;\nLoading.Dots = LoadingDots;\nLoading.Text = LoadingText;\n\nexport { Loading };\nexport type { LoadingDotsProps, LoadingTextProps };\n"],"names":["cx","c","styles","rootClassName","LoadingDots","className","negative","ariaLabel","role","ariaAtomic","ariaLive","announcedLabel","setAnnouncedLabel","useState","useEffect","timer","jsxs","jsx","VisuallyHidden","LoadingText","label","announcement","Paragraph","ParagraphVariant","Loading"],"mappings":";;;;;;;;;;;;;GAMMA,IAAKC,EAAE,KAAKC,CAAM,GAClBC,IAAgB,uBAehBC,IAAc,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,cAAcC;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,eAAeC,IAAa;AAAA,EAC5B,aAAaC,IAAW;AAC1B,MAAwB;AAItB,QAAM,CAACC,GAAgBC,CAAiB,IAAIC,EAAS,EAAE;AAEvD,SAAAC,EAAU,MAAM;AACd,U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AMC,IAAQ,OAAO,WAAW,MAAM;AACpC,MAAAH,EAAkBS,CAAY;AAAA,IAChC,GAAG,CAAC;AACJ,WAAO,MAAM,OAAO,aAAaN,CAAK;AAAA,EACxC,GAAG,CAACM,CAAY,CAAC,GAGf,gBAAAL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWhB,EAAGG,GAAe,GAAGA,CAAa,mBAAmBE,GAAW;AAAA,QACzE,CAAC,GAAGF,CAAa,YAAY,GAAGG;AAAA,MAAA,CACjC;AAAA,MACD,MAAAE;AAAA,MACA,eAAaC;AAAA,MACb,aAAWC;AAAA,MAEX,UAAA;AAAA,QAAA,gBAAAO,EAACC,KAAgB,UAAAP,EAAA,CAAe;AAAA,QAChC,gBAAAM;AAAA,UAACK;AAAA,UAAA;AAAA,YACC,eAAY;AAAA,YACZ,WAAWtB,EAAG,GAAGG,CAAa,sBAAsB;AAAA,YACpD,UAAAG;AAAA,YACA,SAASiB,EAAiB;AAAA,YAEzB,UAAAH;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAD,EAAY,cAAc;AC7D1B,MAAMK,IAAU,CAAA;AAChBA,EAAQ,OAAOpB;AACfoB,EAAQ,OAAOL;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./loading-Dwtkjstg.js");exports.Loading=e.Loading;
2
+ //# sourceMappingURL=loading.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { L as r } from "./loading-r23nxJSz.mjs";
2
+ export {
3
+ r as Loading
4
+ };
5
+ //# sourceMappingURL=loading.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loading.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,3 @@
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("./paragraph-By4jMjnH.js"),c=require("./bind-DeUYJ6m9.js"),j=require("./avatar-CYnD57o4.js"),I="_fadeIn_14a0h_1",l={"purpur-message--incoming":"_purpur-message--incoming_14a0h_1","purpur-message--with-avatar":"_purpur-message--with-avatar_14a0h_1","purpur-message__avatar":"_purpur-message__avatar_14a0h_6","purpur-message__content":"_purpur-message__content_14a0h_10","purpur-message--with-avatar-header-layout":"_purpur-message--with-avatar-header-layout_14a0h_15","purpur-message__header-container":"_purpur-message__header-container_14a0h_21","purpur-message__footer-container":"_purpur-message__footer-container_14a0h_35","purpur-message__header--bottom":"_purpur-message__header--bottom_14a0h_38","purpur-message--incoming-header-layout":"_purpur-message--incoming-header-layout_14a0h_41","purpur-message__bubble":"_purpur-message__bubble_14a0h_54","purpur-message--outgoing":"_purpur-message--outgoing_14a0h_58",fadeIn:I,"purpur-message__bubble--no-animation":"_purpur-message__bubble--no-animation_14a0h_75","purpur-message__stamp":"_purpur-message__stamp_14a0h_80","purpur-message__stamp--avatar":"_purpur-message__stamp--avatar_14a0h_83","purpur-message__stamp--text":"_purpur-message__stamp--text_14a0h_89","purpur-message__stamp--negative":"_purpur-message__stamp--negative_14a0h_94","purpur-message__stamp-divider":"_purpur-message__stamp-divider_14a0h_94","purpur-message__stamp-divider-row":"_purpur-message__stamp-divider-row_14a0h_97","purpur-message__header":"_purpur-message__header_14a0h_21","purpur-message__header-name":"_purpur-message__header-name_14a0h_113","purpur-message__header-timestamp":"_purpur-message__header-timestamp_14a0h_116"},f=c.c.bind(l),$=({text:a,animate:r=!0,className:t})=>{const i=a.replace(/\\n/g,`
2
+ `);return e.jsx("div",{className:f("purpur-message__bubble",t,{"purpur-message__bubble--no-animation":r===!1}),children:e.jsx(p.Paragraph,{className:f("purpur-message__text"),children:i})})};$.displayName="Message.Bubble";const _=c.c.bind(l),w=a=>{const{className:r,negative:t,text:i,variant:m}=a;return m==="avatar"?e.jsxs("div",{className:_("purpur-message__stamp","purpur-message__stamp--avatar",r,{"purpur-message__stamp--negative":t}),children:[e.jsxs("div",{className:_("purpur-message__stamp-divider-row"),children:[e.jsx("div",{className:_("purpur-message__stamp-divider")}),a.avatarAriaLabel?e.jsx(j.Avatar,{"aria-label":a.avatarAriaLabel,label:a.avatarLabel,size:"sm"}):e.jsx(j.Avatar,{decorative:!0,label:a.avatarLabel,size:"sm"}),e.jsx("div",{className:_("purpur-message__stamp-divider")})]}),e.jsx(p.Paragraph,{variant:"additional-100",negative:t,children:i})]}):e.jsx("div",{className:_("purpur-message__stamp",r,{"purpur-message__stamp--negative":t}),children:e.jsxs("div",{className:_("purpur-message__stamp-divider-row"),children:[e.jsx("div",{className:_("purpur-message__stamp-divider")}),e.jsx(p.Paragraph,{variant:"additional-100",negative:t,children:i}),e.jsx("div",{className:_("purpur-message__stamp-divider")})]})})};w.displayName="Message.Stamp";const L=a=>{const r=new Date(a);return Number.isNaN(r.getTime())?null:r},A=a=>{if(Number.isNaN(a.getTime()))return null;const t=new Date().getTime()-a.getTime();return t<0?null:t<1440*60*1e3?a.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):a.toLocaleDateString()},u=c.c.bind(l),s="purpur-message",y=({variant:a,negative:r,className:t,children:i,...m})=>{const g=a==="incoming",v=g?m.senderName:void 0,b=g?m.avatar:void 0,N=m.sentAt,d=g&&v!==void 0,n=b!==void 0,o=N===void 0?null:L(N),x=o?A(o):null,M=o!==null&&x!==null?e.jsx("div",{className:u(`${s}__footer-container`),children:e.jsx(p.Paragraph,{className:u(`${s}__header-timestamp`,`${s}__header--bottom`),negative:r,variant:"additional-100",children:e.jsx("time",{dateTime:o.toISOString(),children:x})})}):null,T=d?e.jsx("div",{className:u(`${s}__header-container`),children:e.jsx("div",{className:u(`${s}__header`),children:e.jsx(p.Paragraph,{className:u(`${s}__header-name`),negative:r,variant:"additional-100-medium",children:v})})}):null,S=d||n;return e.jsxs("div",{className:u(s,a==="incoming"?`${s}--incoming`:`${s}--outgoing`,{[`${s}--with-avatar`]:n,[`${s}--with-avatar-header-layout`]:d&&n,[`${s}--incoming-header-layout`]:d&&!n},t),children:[T,n&&e.jsx("div",{className:u(`${s}__avatar`),children:b}),S?e.jsx("div",{className:u(`${s}__content`),children:i}):i,M]})};y.displayName="Message";const h=y;h.Bubble=$;h.Stamp=w;exports.MessageNamespace=h;
3
+ //# sourceMappingURL=message-0yTS5pOF.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-0yTS5pOF.js","sources":["../../../components/message/src/message-bubble.tsx","../../../components/message/src/message-stamp.tsx","../../../components/message/src/message-utils.ts","../../../components/message/src/message.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type MessageBubbleProps = {\n /**\n * String message content.\n *\n * Real newline characters (`\\n`) are preserved as-is.\n * Escaped newline sequences (`\\\\n` — the two-character literal backslash-n) are\n * converted to real newlines, so API responses that serialize newlines as `\\\\n`\n * are rendered correctly without pre-processing by the caller.\n */\n text: string;\n /** Enables the entry animation. Defaults to true. */\n animate?: boolean;\n /** Optional class name for the bubble element. */\n className?: string;\n};\n\nconst MessageBubble = ({ text, animate = true, className }: MessageBubbleProps) => {\n const content = text.replace(/\\\\n/g, \"\\n\");\n\n return (\n <div\n className={cx(\"purpur-message__bubble\", className, {\n \"purpur-message__bubble--no-animation\": animate === false,\n })}\n >\n <Paragraph className={cx(\"purpur-message__text\")}>{content}</Paragraph>\n </div>\n );\n};\n\nMessageBubble.displayName = \"Message.Bubble\";\n\nexport { MessageBubble };\n","import React, { type ReactNode } from \"react\";\nimport { Avatar } from \"@purpur/avatar\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\n\nconst cx = c.bind(styles);\n\ntype MessageStampBaseProps = {\n /** Optional class name for the stamp element. */\n className?: string;\n /** Enables negative color tokens for dark surfaces. */\n negative?: boolean;\n /** Text content centered in the divider. */\n text: ReactNode;\n};\n\ntype MessageStampAvatarProps = MessageStampBaseProps & {\n variant: \"avatar\";\n /** Accessible label for the avatar. When omitted, avatar is rendered as decorative. */\n avatarAriaLabel?: string;\n /** Label content rendered inside the avatar, typically initials. */\n avatarLabel: ReactNode;\n};\n\ntype MessageStampTextProps = MessageStampBaseProps & {\n variant: \"text\";\n};\n\nexport type MessageStampProps = MessageStampAvatarProps | MessageStampTextProps;\n\nconst MessageStamp = (props: MessageStampProps) => {\n const { className, negative, text, variant } = props;\n\n if (variant === \"avatar\") {\n return (\n <div\n className={cx(\"purpur-message__stamp\", \"purpur-message__stamp--avatar\", className, {\n \"purpur-message__stamp--negative\": negative,\n })}\n >\n <div className={cx(\"purpur-message__stamp-divider-row\")}>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n {props.avatarAriaLabel ? (\n <Avatar aria-label={props.avatarAriaLabel} label={props.avatarLabel} size=\"sm\" />\n ) : (\n <Avatar decorative label={props.avatarLabel} size=\"sm\" />\n )}\n <div className={cx(\"purpur-message__stamp-divider\")} />\n </div>\n <Paragraph variant=\"additional-100\" negative={negative}>\n {text}\n </Paragraph>\n </div>\n );\n }\n\n return (\n <div\n className={cx(\"purpur-message__stamp\", className, {\n \"purpur-message__stamp--negative\": negative,\n })}\n >\n <div className={cx(\"purpur-message__stamp-divider-row\")}>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n <Paragraph variant=\"additional-100\" negative={negative}>\n {text}\n </Paragraph>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n </div>\n </div>\n );\n};\n\nMessageStamp.displayName = \"Message.Stamp\";\n\nexport { MessageStamp };\n","export const toValidDate = (value: Date | string | number) => {\n const nextDate = new Date(value);\n if (Number.isNaN(nextDate.getTime())) {\n return null;\n }\n return nextDate;\n};\n\nexport const formatTimestamp = (sentAtDate: Date) => {\n if (Number.isNaN(sentAtDate.getTime())) {\n return null;\n }\n\n const now = new Date();\n const diffInMs = now.getTime() - sentAtDate.getTime();\n if (diffInMs < 0) return null;\n\n if (diffInMs < 24 * 60 * 60 * 1000) {\n return sentAtDate.toLocaleTimeString([], {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n }\n\n return sentAtDate.toLocaleDateString();\n};\n","import React, { type ReactNode } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\nimport { MessageBubble, type MessageBubbleProps } from \"./message-bubble\";\nimport { MessageStamp, type MessageStampProps } from \"./message-stamp\";\nimport { formatTimestamp, toValidDate } from \"./message-utils\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-message\";\n\nexport type { MessageBubbleProps, MessageStampProps };\n\ntype MessageBaseProps = {\n /** Enables negative color tokens for dark surfaces. Applied to the header name and timestamp. */\n negative?: boolean;\n /** Optional class name for the message root element. */\n className?: string;\n /** Message content - can include Message.Bubble and Message.Stamp subcomponents. */\n children?: ReactNode;\n /** Timestamp source used for automatic time/date formatting. When provided, the timestamp is displayed. */\n sentAt?: Date | string | number;\n};\n\nexport type IncomingMessageProps = MessageBaseProps & {\n /** Message variant for incoming messages (assistant/employee). */\n variant: \"incoming\";\n /** Optional sender name displayed as a header above the bubbles. */\n senderName?: string;\n /** Optional avatar element rendered on the left. */\n avatar?: ReactNode;\n};\n\nexport type OutgoingMessageProps = MessageBaseProps & {\n /** Message variant for outgoing messages (user). */\n variant: \"outgoing\";\n /** Outgoing messages do not support sender metadata. */\n senderName?: never;\n /** Outgoing messages do not support avatars. */\n avatar?: never;\n};\n\n// Root Message component\nexport type MessageProps = IncomingMessageProps | OutgoingMessageProps;\n\nconst Message = ({ variant, negative, className, children, ...variantProps }: MessageProps) => {\n const isIncoming = variant === \"incoming\";\n const senderName = isIncoming ? variantProps.senderName : undefined;\n const avatar = isIncoming ? variantProps.avatar : undefined;\n const sentAt = variantProps.sentAt;\n\n const hasHeader = isIncoming && senderName !== undefined;\n const hasAvatar = avatar !== undefined;\n\n const sentAtDate = sentAt === undefined ? null : toValidDate(sentAt);\n const resolvedTimestamp = sentAtDate ? formatTimestamp(sentAtDate) : null;\n\n const footer =\n sentAtDate !== null && resolvedTimestamp !== null ? (\n <div className={cx(`${rootClassName}__footer-container`)}>\n <Paragraph\n className={cx(`${rootClassName}__header-timestamp`, `${rootClassName}__header--bottom`)}\n negative={negative}\n variant=\"additional-100\"\n >\n <time dateTime={sentAtDate.toISOString()}>{resolvedTimestamp}</time>\n </Paragraph>\n </div>\n ) : null;\n\n const header = hasHeader ? (\n <div className={cx(`${rootClassName}__header-container`)}>\n <div className={cx(`${rootClassName}__header`)}>\n <Paragraph\n className={cx(`${rootClassName}__header-name`)}\n negative={negative}\n variant=\"additional-100-medium\"\n >\n {senderName}\n </Paragraph>\n </div>\n </div>\n ) : null;\n\n const needsContentWrapper = hasHeader || hasAvatar;\n\n return (\n <div\n className={cx(\n rootClassName,\n variant === \"incoming\" ? `${rootClassName}--incoming` : `${rootClassName}--outgoing`,\n {\n [`${rootClassName}--with-avatar`]: hasAvatar,\n [`${rootClassName}--with-avatar-header-layout`]: hasHeader && hasAvatar,\n [`${rootClassName}--incoming-header-layout`]: hasHeader && !hasAvatar,\n },\n className\n )}\n >\n {header}\n {hasAvatar && <div className={cx(`${rootClassName}__avatar`)}>{avatar}</div>}\n {needsContentWrapper ? (\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n ) : (\n children\n )}\n {footer}\n </div>\n );\n};\n\nMessage.displayName = \"Message\";\n\ntype MessageComponent = typeof Message & {\n Bubble: typeof MessageBubble;\n Stamp: typeof MessageStamp;\n};\n\nconst MessageNamespace = Message as MessageComponent;\nMessageNamespace.Bubble = MessageBubble;\nMessageNamespace.Stamp = MessageStamp;\n\nexport { MessageNamespace as Message };\n"],"names":["cx","c","styles","MessageBubble","text","animate","className","content","jsx","Paragraph","MessageStamp","props","negative","variant","jsxs","Avatar","toValidDate","value","nextDate","formatTimestamp","sentAtDate","diffInMs","rootClassName","Message","children","variantProps","is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mBb,EACzBa,EAAiB,OAASjC,EAC1BiC,EAAiB,MAAQ1B"}
@@ -0,0 +1,132 @@
1
+ import { jsx as e, jsxs as g } from "react/jsx-runtime";
2
+ import { P as p } from "./paragraph-DSxXmX_0.mjs";
3
+ import { c } from "./bind-CU-R61T-.mjs";
4
+ import { A as $ } from "./avatar-CzbDD1MK.mjs";
5
+ const A = "_fadeIn_14a0h_1", h = {
6
+ "purpur-message--incoming": "_purpur-message--incoming_14a0h_1",
7
+ "purpur-message--with-avatar": "_purpur-message--with-avatar_14a0h_1",
8
+ "purpur-message__avatar": "_purpur-message__avatar_14a0h_6",
9
+ "purpur-message__content": "_purpur-message__content_14a0h_10",
10
+ "purpur-message--with-avatar-header-layout": "_purpur-message--with-avatar-header-layout_14a0h_15",
11
+ "purpur-message__header-container": "_purpur-message__header-container_14a0h_21",
12
+ "purpur-message__footer-container": "_purpur-message__footer-container_14a0h_35",
13
+ "purpur-message__header--bottom": "_purpur-message__header--bottom_14a0h_38",
14
+ "purpur-message--incoming-header-layout": "_purpur-message--incoming-header-layout_14a0h_41",
15
+ "purpur-message__bubble": "_purpur-message__bubble_14a0h_54",
16
+ "purpur-message--outgoing": "_purpur-message--outgoing_14a0h_58",
17
+ fadeIn: A,
18
+ "purpur-message__bubble--no-animation": "_purpur-message__bubble--no-animation_14a0h_75",
19
+ "purpur-message__stamp": "_purpur-message__stamp_14a0h_80",
20
+ "purpur-message__stamp--avatar": "_purpur-message__stamp--avatar_14a0h_83",
21
+ "purpur-message__stamp--text": "_purpur-message__stamp--text_14a0h_89",
22
+ "purpur-message__stamp--negative": "_purpur-message__stamp--negative_14a0h_94",
23
+ "purpur-message__stamp-divider": "_purpur-message__stamp-divider_14a0h_94",
24
+ "purpur-message__stamp-divider-row": "_purpur-message__stamp-divider-row_14a0h_97",
25
+ "purpur-message__header": "_purpur-message__header_14a0h_21",
26
+ "purpur-message__header-name": "_purpur-message__header-name_14a0h_113",
27
+ "purpur-message__header-timestamp": "_purpur-message__header-timestamp_14a0h_116"
28
+ }, w = c.bind(h), x = ({ text: a, animate: r = !0, className: t }) => {
29
+ const u = a.replace(/\\n/g, `
30
+ `);
31
+ return /* @__PURE__ */ e(
32
+ "div",
33
+ {
34
+ className: w("purpur-message__bubble", t, {
35
+ "purpur-message__bubble--no-animation": r === !1
36
+ }),
37
+ children: /* @__PURE__ */ e(p, { className: w("purpur-message__text"), children: u })
38
+ }
39
+ );
40
+ };
41
+ x.displayName = "Message.Bubble";
42
+ const _ = c.bind(h), y = (a) => {
43
+ const { className: r, negative: t, text: u, variant: i } = a;
44
+ return i === "avatar" ? /* @__PURE__ */ g(
45
+ "div",
46
+ {
47
+ className: _("purpur-message__stamp", "purpur-message__stamp--avatar", r, {
48
+ "purpur-message__stamp--negative": t
49
+ }),
50
+ children: [
51
+ /* @__PURE__ */ g("div", { className: _("purpur-message__stamp-divider-row"), children: [
52
+ /* @__PURE__ */ e("div", { className: _("purpur-message__stamp-divider") }),
53
+ a.avatarAriaLabel ? /* @__PURE__ */ e($, { "aria-label": a.avatarAriaLabel, label: a.avatarLabel, size: "sm" }) : /* @__PURE__ */ e($, { decorative: !0, label: a.avatarLabel, size: "sm" }),
54
+ /* @__PURE__ */ e("div", { className: _("purpur-message__stamp-divider") })
55
+ ] }),
56
+ /* @__PURE__ */ e(p, { variant: "additional-100", negative: t, children: u })
57
+ ]
58
+ }
59
+ ) : /* @__PURE__ */ e(
60
+ "div",
61
+ {
62
+ className: _("purpur-message__stamp", r, {
63
+ "purpur-message__stamp--negative": t
64
+ }),
65
+ children: /* @__PURE__ */ g("div", { className: _("purpur-message__stamp-divider-row"), children: [
66
+ /* @__PURE__ */ e("div", { className: _("purpur-message__stamp-divider") }),
67
+ /* @__PURE__ */ e(p, { variant: "additional-100", negative: t, children: u }),
68
+ /* @__PURE__ */ e("div", { className: _("purpur-message__stamp-divider") })
69
+ ] })
70
+ }
71
+ );
72
+ };
73
+ y.displayName = "Message.Stamp";
74
+ const B = (a) => {
75
+ const r = new Date(a);
76
+ return Number.isNaN(r.getTime()) ? null : r;
77
+ }, D = (a) => {
78
+ if (Number.isNaN(a.getTime()))
79
+ return null;
80
+ const t = (/* @__PURE__ */ new Date()).getTime() - a.getTime();
81
+ return t < 0 ? null : t < 1440 * 60 * 1e3 ? a.toLocaleTimeString([], {
82
+ hour: "2-digit",
83
+ minute: "2-digit"
84
+ }) : a.toLocaleDateString();
85
+ }, m = c.bind(h), s = "purpur-message", M = ({ variant: a, negative: r, className: t, children: u, ...i }) => {
86
+ const l = a === "incoming", v = l ? i.senderName : void 0, b = l ? i.avatar : void 0, N = i.sentAt, o = l && v !== void 0, n = b !== void 0, d = N === void 0 ? null : B(N), f = d ? D(d) : null, S = d !== null && f !== null ? /* @__PURE__ */ e("div", { className: m(`${s}__footer-container`), children: /* @__PURE__ */ e(
87
+ p,
88
+ {
89
+ className: m(`${s}__header-timestamp`, `${s}__header--bottom`),
90
+ negative: r,
91
+ variant: "additional-100",
92
+ children: /* @__PURE__ */ e("time", { dateTime: d.toISOString(), children: f })
93
+ }
94
+ ) }) : null, I = o ? /* @__PURE__ */ e("div", { className: m(`${s}__header-container`), children: /* @__PURE__ */ e("div", { className: m(`${s}__header`), children: /* @__PURE__ */ e(
95
+ p,
96
+ {
97
+ className: m(`${s}__header-name`),
98
+ negative: r,
99
+ variant: "additional-100-medium",
100
+ children: v
101
+ }
102
+ ) }) }) : null, L = o || n;
103
+ return /* @__PURE__ */ g(
104
+ "div",
105
+ {
106
+ className: m(
107
+ s,
108
+ a === "incoming" ? `${s}--incoming` : `${s}--outgoing`,
109
+ {
110
+ [`${s}--with-avatar`]: n,
111
+ [`${s}--with-avatar-header-layout`]: o && n,
112
+ [`${s}--incoming-header-layout`]: o && !n
113
+ },
114
+ t
115
+ ),
116
+ children: [
117
+ I,
118
+ n && /* @__PURE__ */ e("div", { className: m(`${s}__avatar`), children: b }),
119
+ L ? /* @__PURE__ */ e("div", { className: m(`${s}__content`), children: u }) : u,
120
+ S
121
+ ]
122
+ }
123
+ );
124
+ };
125
+ M.displayName = "Message";
126
+ const T = M;
127
+ T.Bubble = x;
128
+ T.Stamp = y;
129
+ export {
130
+ T as M
131
+ };
132
+ //# sourceMappingURL=message-D9CDwcw9.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-D9CDwcw9.mjs","sources":["../../../components/message/src/message-bubble.tsx","../../../components/message/src/message-stamp.tsx","../../../components/message/src/message-utils.ts","../../../components/message/src/message.tsx"],"sourcesContent":["import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type MessageBubbleProps = {\n /**\n * String message content.\n *\n * Real newline characters (`\\n`) are preserved as-is.\n * Escaped newline sequences (`\\\\n` — the two-character literal backslash-n) are\n * converted to real newlines, so API responses that serialize newlines as `\\\\n`\n * are rendered correctly without pre-processing by the caller.\n */\n text: string;\n /** Enables the entry animation. Defaults to true. */\n animate?: boolean;\n /** Optional class name for the bubble element. */\n className?: string;\n};\n\nconst MessageBubble = ({ text, animate = true, className }: MessageBubbleProps) => {\n const content = text.replace(/\\\\n/g, \"\\n\");\n\n return (\n <div\n className={cx(\"purpur-message__bubble\", className, {\n \"purpur-message__bubble--no-animation\": animate === false,\n })}\n >\n <Paragraph className={cx(\"purpur-message__text\")}>{content}</Paragraph>\n </div>\n );\n};\n\nMessageBubble.displayName = \"Message.Bubble\";\n\nexport { MessageBubble };\n","import React, { type ReactNode } from \"react\";\nimport { Avatar } from \"@purpur/avatar\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\n\nconst cx = c.bind(styles);\n\ntype MessageStampBaseProps = {\n /** Optional class name for the stamp element. */\n className?: string;\n /** Enables negative color tokens for dark surfaces. */\n negative?: boolean;\n /** Text content centered in the divider. */\n text: ReactNode;\n};\n\ntype MessageStampAvatarProps = MessageStampBaseProps & {\n variant: \"avatar\";\n /** Accessible label for the avatar. When omitted, avatar is rendered as decorative. */\n avatarAriaLabel?: string;\n /** Label content rendered inside the avatar, typically initials. */\n avatarLabel: ReactNode;\n};\n\ntype MessageStampTextProps = MessageStampBaseProps & {\n variant: \"text\";\n};\n\nexport type MessageStampProps = MessageStampAvatarProps | MessageStampTextProps;\n\nconst MessageStamp = (props: MessageStampProps) => {\n const { className, negative, text, variant } = props;\n\n if (variant === \"avatar\") {\n return (\n <div\n className={cx(\"purpur-message__stamp\", \"purpur-message__stamp--avatar\", className, {\n \"purpur-message__stamp--negative\": negative,\n })}\n >\n <div className={cx(\"purpur-message__stamp-divider-row\")}>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n {props.avatarAriaLabel ? (\n <Avatar aria-label={props.avatarAriaLabel} label={props.avatarLabel} size=\"sm\" />\n ) : (\n <Avatar decorative label={props.avatarLabel} size=\"sm\" />\n )}\n <div className={cx(\"purpur-message__stamp-divider\")} />\n </div>\n <Paragraph variant=\"additional-100\" negative={negative}>\n {text}\n </Paragraph>\n </div>\n );\n }\n\n return (\n <div\n className={cx(\"purpur-message__stamp\", className, {\n \"purpur-message__stamp--negative\": negative,\n })}\n >\n <div className={cx(\"purpur-message__stamp-divider-row\")}>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n <Paragraph variant=\"additional-100\" negative={negative}>\n {text}\n </Paragraph>\n <div className={cx(\"purpur-message__stamp-divider\")} />\n </div>\n </div>\n );\n};\n\nMessageStamp.displayName = \"Message.Stamp\";\n\nexport { MessageStamp };\n","export const toValidDate = (value: Date | string | number) => {\n const nextDate = new Date(value);\n if (Number.isNaN(nextDate.getTime())) {\n return null;\n }\n return nextDate;\n};\n\nexport const formatTimestamp = (sentAtDate: Date) => {\n if (Number.isNaN(sentAtDate.getTime())) {\n return null;\n }\n\n const now = new Date();\n const diffInMs = now.getTime() - sentAtDate.getTime();\n if (diffInMs < 0) return null;\n\n if (diffInMs < 24 * 60 * 60 * 1000) {\n return sentAtDate.toLocaleTimeString([], {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n }\n\n return sentAtDate.toLocaleDateString();\n};\n","import React, { type ReactNode } from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./message.module.scss\";\nimport { MessageBubble, type MessageBubbleProps } from \"./message-bubble\";\nimport { MessageStamp, type MessageStampProps } from \"./message-stamp\";\nimport { formatTimestamp, toValidDate } from \"./message-utils\";\n\nconst cx = c.bind(styles);\nconst rootClassName = \"purpur-message\";\n\nexport type { MessageBubbleProps, MessageStampProps };\n\ntype MessageBaseProps = {\n /** Enables negative color tokens for dark surfaces. Applied to the header name and timestamp. */\n negative?: boolean;\n /** Optional class name for the message root element. */\n className?: string;\n /** Message content - can include Message.Bubble and Message.Stamp subcomponents. */\n children?: ReactNode;\n /** Timestamp source used for automatic time/date formatting. When provided, the timestamp is displayed. */\n sentAt?: Date | string | number;\n};\n\nexport type IncomingMessageProps = MessageBaseProps & {\n /** Message variant for incoming messages (assistant/employee). */\n variant: \"incoming\";\n /** Optional sender name displayed as a header above the bubbles. */\n senderName?: string;\n /** Optional avatar element rendered on the left. */\n avatar?: ReactNode;\n};\n\nexport type OutgoingMessageProps = MessageBaseProps & {\n /** Message variant for outgoing messages (user). */\n variant: \"outgoing\";\n /** Outgoing messages do not support sender metadata. */\n senderName?: never;\n /** Outgoing messages do not support avatars. */\n avatar?: never;\n};\n\n// Root Message component\nexport type MessageProps = IncomingMessageProps | OutgoingMessageProps;\n\nconst Message = ({ variant, negative, className, children, ...variantProps }: MessageProps) => {\n const isIncoming = variant === \"incoming\";\n const senderName = isIncoming ? variantProps.senderName : undefined;\n const avatar = isIncoming ? variantProps.avatar : undefined;\n const sentAt = variantProps.sentAt;\n\n const hasHeader = isIncoming && senderName !== undefined;\n const hasAvatar = avatar !== undefined;\n\n const sentAtDate = sentAt === undefined ? null : toValidDate(sentAt);\n const resolvedTimestamp = sentAtDate ? formatTimestamp(sentAtDate) : null;\n\n const footer =\n sentAtDate !== null && resolvedTimestamp !== null ? (\n <div className={cx(`${rootClassName}__footer-container`)}>\n <Paragraph\n className={cx(`${rootClassName}__header-timestamp`, `${rootClassName}__header--bottom`)}\n negative={negative}\n variant=\"additional-100\"\n >\n <time dateTime={sentAtDate.toISOString()}>{resolvedTimestamp}</time>\n </Paragraph>\n </div>\n ) : null;\n\n const header = hasHeader ? (\n <div className={cx(`${rootClassName}__header-container`)}>\n <div className={cx(`${rootClassName}__header`)}>\n <Paragraph\n className={cx(`${rootClassName}__header-name`)}\n negative={negative}\n variant=\"additional-100-medium\"\n >\n {senderName}\n </Paragraph>\n </div>\n </div>\n ) : null;\n\n const needsContentWrapper = hasHeader || hasAvatar;\n\n return (\n <div\n className={cx(\n rootClassName,\n variant === \"incoming\" ? `${rootClassName}--incoming` : `${rootClassName}--outgoing`,\n {\n [`${rootClassName}--with-avatar`]: hasAvatar,\n [`${rootClassName}--with-avatar-header-layout`]: hasHeader && hasAvatar,\n [`${rootClassName}--incoming-header-layout`]: hasHeader && !hasAvatar,\n },\n className\n )}\n >\n {header}\n {hasAvatar && <div className={cx(`${rootClassName}__avatar`)}>{avatar}</div>}\n {needsContentWrapper ? (\n <div className={cx(`${rootClassName}__content`)}>{children}</div>\n ) : (\n children\n )}\n {footer}\n </div>\n );\n};\n\nMessage.displayName = \"Message\";\n\ntype MessageComponent = typeof Message & {\n Bubble: typeof MessageBubble;\n Stamp: typeof MessageStamp;\n};\n\nconst MessageNamespace = Message as MessageComponent;\nMessageNamespace.Bubble = MessageBubble;\nMessageNamespace.Stamp = MessageStamp;\n\nexport { MessageNamespace as Message };\n"],"names":["cx","styles","MessageBubble","text","animate","className","content","jsx","Paragraph","MessageStamp","props","negative","variant","jsxs","Avatar","toValidDate","value","nextDate","formatTimestamp","sentAtDate","diffInMs","rootClassName","Message","children","variantProps","isIncoming","senderName","avatar","sentAt","hasHeader","hasAvatar","resolvedTimestamp","footer","header","needsContentWrapper","MessageNamespace"],"mappings":";;;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A,MAAA;AAAA,MAGD,UAAA;AAAA,QAAA4B;AAAA,QACAH,uBAAc,OAAA,EAAI,WAAW9B,EAAG,GAAGqB,CAAa,UAAU,GAAI,UAAAM,EAAA,CAAO;AAAA,QACrEO,IACC,gBAAA3B,EAAC,OAAA,EAAI,WAAWP,EAAG,GAAGqB,CAAa,WAAW,GAAI,UAAAE,EAAA,CAAS,IAE3DA;AAAA,QAEDS;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGP;AAEAV,EAAQ,cAAc;AAOtB,MAAMa,IAAmBb;AACzBa,EAAiB,SAASjC;AAC1BiC,EAAiB,QAAQ1B;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./message-0yTS5pOF.js");exports.Message=e.MessageNamespace;
2
+ //# sourceMappingURL=message.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { M as a } from "./message-D9CDwcw9.mjs";
2
+ export {
3
+ a as Message
4
+ };
5
+ //# sourceMappingURL=message.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,2 +1,2 @@
1
- "use strict";const r=require("react/jsx-runtime"),Y=require("react"),c=require("./card-DFdUs5RG.js"),p=require("./paragraph-By4jMjnH.js"),l=require("./bind-DeUYJ6m9.js"),I=require("./color-dot-B9w_ucWb.js"),g=require("./alert-badge-DguuS7Qq.js"),T=require("./arrow-right.es-eH-IgGi9.js"),rr=require("./icon-DNHpBTHs-faYHqTXU.js"),tr={"purpur-colors":"_purpur-colors_1190y_1"},ar=l.c.bind(tr),cr="purpur-colors",R=({["aria-label"]:t,["data-testid"]:a="purpur-colors",colors:s,colorDotAriaLabels:o})=>!!s?.length&&r.jsx("ul",{className:ar(cr),"data-testid":a,"aria-label":t,children:s.map((d,x)=>r.jsx("li",{children:r.jsx(I.ColorDot,{"data-testid":`${a}-color-dot`,withBorder:!0,color:d,size:"xs","aria-label":o&&o[x]})},d))}),sr={"purpur-price":"_purpur-price_1lcgf_1","purpur-price__price-container":"_purpur-price__price-container_1lcgf_7","purpur-price__price-text--discount":"_purpur-price__price-text--discount_1lcgf_12"},$=l.c.bind(sr),m="purpur-price",B=({["data-testid"]:t="purpur-price",regularPriceText:a,priceDescription:s,priceText:o,pricePrefix:d})=>!a&&!o&&!d&&!s?null:r.jsxs("div",{className:$(m),"data-testid":t,children:[a&&r.jsx(p.Paragraph,{"data-testid":`${t}-regular`,variant:"additional-100",children:a}),r.jsxs("div",{className:$(`${m}__price-container`),children:[d&&r.jsx(p.Paragraph,{"data-testid":`${t}-from`,variant:"paragraph-200",children:d}),o&&r.jsx(p.Paragraph,{className:$(`${m}__price-text`,{[`${m}__price-text--discount`]:!!a}),"data-testid":`${t}-actual`,variant:"paragraph-100-bold",children:o})]}),s&&r.jsx(p.Paragraph,{"data-testid":`${t}-description`,variant:"additional-100",children:s})]}),or={"purpur-product-card__content-container":"_purpur-product-card__content-container_71zwa_1","purpur-product-card__product-image":"_purpur-product-card__product-image_71zwa_9","purpur-product-card__product-image--md":"_purpur-product-card__product-image--md_71zwa_17","purpur-product-card__product-image--lg":"_purpur-product-card__product-image--lg_71zwa_20","purpur-product-card__body":"_purpur-product-card__body_71zwa_24","purpur-product-card__footer":"_purpur-product-card__footer_71zwa_29","purpur-product-card-with-cta-text":"_purpur-product-card-with-cta-text_71zwa_34","purpur-product-card__cta-button":"_purpur-product-card__cta-button_71zwa_39"},dr={"purpur-product-header":"_purpur-product-header_1athi_1","purpur-product-header__product-image":"_purpur-product-header__product-image_1athi_7","purpur-product-header__product-information":"_purpur-product-header__product-information_1athi_21"},N=l.c.bind(dr),v="purpur-product-header",f=({["data-testid"]:t="purpur-product-header",children:a})=>a.productImage?r.jsxs("div",{className:N(v),"data-testid":t,children:[r.jsx("div",{className:N(`${v}__product-image`),children:a.productImage}),r.jsx("div",{className:N(`${v}__product-information`),children:r.jsx(c.Card.Content,{children:a.productInformation})})]}):a.productInformation,er={"purpur-stock-status":"_purpur-stock-status_dslay_1"},ur=l.c.bind(er),w={IN_STOCK:"in-stock",BACK_IN_STOCK:"back-in-stock",NOT_IN_STOCK:"not-in-stock"},ir={[w.IN_STOCK]:g.ALERT_BADGE_VARIANT.SUCCESS,[w.BACK_IN_STOCK]:g.ALERT_BADGE_VARIANT.WARNING,[w.NOT_IN_STOCK]:g.ALERT_BADGE_VARIANT.ERROR},pr="purpur-stock-status",z=({["data-testid"]:t="purpur-stock-status",stockStatus:a,stockStatusText:s})=>a&&s&&r.jsxs("div",{className:ur(pr),"data-testid":t,children:[r.jsx(g.AlertBadge,{variant:ir[a]}),r.jsx(p.Paragraph,{variant:"paragraph-100-medium",children:s})]}),nr={name:"cart",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M1.6 3a.9.9 0 0 1 .9-.9H5a.9.9 0 0 1 .88.713L8.275 14.1h10.54l2-7.2H10a.9.9 0 0 1 0-1.8h12a.9.9 0 0 1 .867 1.14l-2.5 9a.9.9 0 0 1-.867.66H8.656l.263 1.236a2.403 2.403 0 0 1 1.806 1.464h5.55a2.4 2.4 0 1 1 0 1.8h-5.55a2.4 2.4 0 1 1-3.567-2.89L4.27 3.9H2.5a.9.9 0 0 1-.9-.9Zm6.9 15.9a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Zm10 0a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Z" clip-rule="evenodd"/></svg>',keywords:["cart"],category:"other"},O=t=>r.jsx(rr.b,{...t,svg:nr});O.displayName="IconCart";const i=l.c.bind(or),e="purpur-product-card",n=Y.forwardRef(({["data-testid"]:t="purpur-product-card",badgeText:a,badgeVariant:s,bodyText:o,children:d,className:x,colorVariants:H,colorNames:P,colorListAriaLabel:q,ctaText:h,disabled:j,fullHeight:b=!0,footerContent:A,headingTag:K="h2",href:u,onClick:_,linkElement:k,listItems:S,loading:E=!1,overline:L,priceText:D,priceDescription:G,pricePrefix:V,image:y,imageSize:F="sm",title:Z,regularPriceText:M,stockStatus:U,stockStatusText:W,...J},Q)=>{const X=i(x,e),C={title:Z,titleTag:K,variant:"title-200","data-testid":`${t}-product-name`};return r.jsxs(c.Card,{className:X,"data-testid":t,fullHeight:b,ref:Q,...J,children:[r.jsx(c.Card.Badge,{text:a,variant:s,"data-testid":`${t}-badge`}),r.jsxs(c.Card.ContentContainer,{gapSize:"lg",className:i(`${e}__content-container`),fullHeight:b,children:[r.jsxs(c.Card.Content,{children:[r.jsx(f,{"data-testid":`${t}-product-header`,children:{productImage:y?r.jsx("div",{className:i(`${e}__product-image`,`${e}__product-image--${F}`),"data-testid":`${t}-product-image`,children:y}):null,productInformation:r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx(c.Card.Overline,{"data-testid":`${t}-overline`,overline:L}),u&&r.jsx(c.Card.Heading,{href:u,linkElement:k,disabled:j,onClick:_,...C}),_&&!u&&r.jsx(c.Card.Heading,{disabled:j,onClick:_,...C}),!u&&!_&&r.jsx(c.Card.Heading,{...C})]}),r.jsx(R,{colors:H,colorDotAriaLabels:P,"aria-label":q,"data-testid":`${t}-colors`})]})}}),(o||!!S?.length)&&r.jsxs("div",{className:i(`${e}__body`),children:[o&&r.jsx(p.Paragraph,{"data-testid":`${t}-body-text`,children:o}),r.jsx(c.Card.FeatureList,{"data-testid":`${t}-feature-list`,listItems:S})]})]}),d&&r.jsx(c.Card.Content,{className:`${e}__children`,"data-testid":`${t}-default-content`,children:d})]}),r.jsxs("div",{children:[r.jsxs(c.Card.ContentContainer,{isFooter:!0,children:[r.jsx(c.Card.Content,{children:r.jsxs("div",{className:i(`${e}__footer`,{[`${e}-with-cta-text`]:h}),children:[r.jsx(B,{"data-testid":`${t}-price`,pricePrefix:V,regularPriceText:M,priceDescription:G,priceText:D}),(u||_)&&r.jsx(c.Card.Cta,{className:i(`${e}__cta-button`),"data-testid":`${t}-cta-button`,disabled:j,iconPosition:h?u?"right":"left":void 0,loading:E,text:h,linkStyling:!!(u&&!h),children:u?r.jsx(T.i,{size:"sm"}):r.jsx(O,{size:"sm"})})]})}),A&&r.jsx(c.Card.Content,{"data-testid":`${t}-footer-content`,children:A})]}),r.jsx(z,{"data-testid":`${t}-stock-status`,stockStatus:U,stockStatusText:W})]})]})});n.Colors=R;n.Price=B;n.ProductHeader=f;n.StockStatus=z;n.displayName="ProductCard";exports.ProductCard=n;
2
- //# sourceMappingURL=product-card-CoY1KggV.js.map
1
+ "use strict";const r=require("react/jsx-runtime"),Y=require("react"),c=require("./card-DFdUs5RG.js"),p=require("./paragraph-By4jMjnH.js"),l=require("./bind-DeUYJ6m9.js"),I=require("./color-dot-BEE5rKco.js"),g=require("./alert-badge-DguuS7Qq.js"),T=require("./arrow-right.es-eH-IgGi9.js"),rr=require("./icon-DNHpBTHs-faYHqTXU.js"),tr={"purpur-colors":"_purpur-colors_1190y_1"},ar=l.c.bind(tr),cr="purpur-colors",R=({["aria-label"]:t,["data-testid"]:a="purpur-colors",colors:s,colorDotAriaLabels:o})=>!!s?.length&&r.jsx("ul",{className:ar(cr),"data-testid":a,"aria-label":t,children:s.map((d,x)=>r.jsx("li",{children:r.jsx(I.ColorDot,{"data-testid":`${a}-color-dot`,withBorder:!0,color:d,size:"xs","aria-label":o&&o[x]})},d))}),sr={"purpur-price":"_purpur-price_1lcgf_1","purpur-price__price-container":"_purpur-price__price-container_1lcgf_7","purpur-price__price-text--discount":"_purpur-price__price-text--discount_1lcgf_12"},$=l.c.bind(sr),m="purpur-price",B=({["data-testid"]:t="purpur-price",regularPriceText:a,priceDescription:s,priceText:o,pricePrefix:d})=>!a&&!o&&!d&&!s?null:r.jsxs("div",{className:$(m),"data-testid":t,children:[a&&r.jsx(p.Paragraph,{"data-testid":`${t}-regular`,variant:"additional-100",children:a}),r.jsxs("div",{className:$(`${m}__price-container`),children:[d&&r.jsx(p.Paragraph,{"data-testid":`${t}-from`,variant:"paragraph-200",children:d}),o&&r.jsx(p.Paragraph,{className:$(`${m}__price-text`,{[`${m}__price-text--discount`]:!!a}),"data-testid":`${t}-actual`,variant:"paragraph-100-bold",children:o})]}),s&&r.jsx(p.Paragraph,{"data-testid":`${t}-description`,variant:"additional-100",children:s})]}),or={"purpur-product-card__content-container":"_purpur-product-card__content-container_71zwa_1","purpur-product-card__product-image":"_purpur-product-card__product-image_71zwa_9","purpur-product-card__product-image--md":"_purpur-product-card__product-image--md_71zwa_17","purpur-product-card__product-image--lg":"_purpur-product-card__product-image--lg_71zwa_20","purpur-product-card__body":"_purpur-product-card__body_71zwa_24","purpur-product-card__footer":"_purpur-product-card__footer_71zwa_29","purpur-product-card-with-cta-text":"_purpur-product-card-with-cta-text_71zwa_34","purpur-product-card__cta-button":"_purpur-product-card__cta-button_71zwa_39"},dr={"purpur-product-header":"_purpur-product-header_1athi_1","purpur-product-header__product-image":"_purpur-product-header__product-image_1athi_7","purpur-product-header__product-information":"_purpur-product-header__product-information_1athi_21"},N=l.c.bind(dr),v="purpur-product-header",f=({["data-testid"]:t="purpur-product-header",children:a})=>a.productImage?r.jsxs("div",{className:N(v),"data-testid":t,children:[r.jsx("div",{className:N(`${v}__product-image`),children:a.productImage}),r.jsx("div",{className:N(`${v}__product-information`),children:r.jsx(c.Card.Content,{children:a.productInformation})})]}):a.productInformation,er={"purpur-stock-status":"_purpur-stock-status_dslay_1"},ur=l.c.bind(er),w={IN_STOCK:"in-stock",BACK_IN_STOCK:"back-in-stock",NOT_IN_STOCK:"not-in-stock"},ir={[w.IN_STOCK]:g.ALERT_BADGE_VARIANT.SUCCESS,[w.BACK_IN_STOCK]:g.ALERT_BADGE_VARIANT.WARNING,[w.NOT_IN_STOCK]:g.ALERT_BADGE_VARIANT.ERROR},pr="purpur-stock-status",z=({["data-testid"]:t="purpur-stock-status",stockStatus:a,stockStatusText:s})=>a&&s&&r.jsxs("div",{className:ur(pr),"data-testid":t,children:[r.jsx(g.AlertBadge,{variant:ir[a]}),r.jsx(p.Paragraph,{variant:"paragraph-100-medium",children:s})]}),nr={name:"cart",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M1.6 3a.9.9 0 0 1 .9-.9H5a.9.9 0 0 1 .88.713L8.275 14.1h10.54l2-7.2H10a.9.9 0 0 1 0-1.8h12a.9.9 0 0 1 .867 1.14l-2.5 9a.9.9 0 0 1-.867.66H8.656l.263 1.236a2.403 2.403 0 0 1 1.806 1.464h5.55a2.4 2.4 0 1 1 0 1.8h-5.55a2.4 2.4 0 1 1-3.567-2.89L4.27 3.9H2.5a.9.9 0 0 1-.9-.9Zm6.9 15.9a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Zm10 0a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Z" clip-rule="evenodd"/></svg>',keywords:["cart"],category:"other"},O=t=>r.jsx(rr.b,{...t,svg:nr});O.displayName="IconCart";const i=l.c.bind(or),e="purpur-product-card",n=Y.forwardRef(({["data-testid"]:t="purpur-product-card",badgeText:a,badgeVariant:s,bodyText:o,children:d,className:x,colorVariants:H,colorNames:P,colorListAriaLabel:q,ctaText:h,disabled:j,fullHeight:b=!0,footerContent:A,headingTag:K="h2",href:u,onClick:_,linkElement:k,listItems:S,loading:E=!1,overline:L,priceText:D,priceDescription:G,pricePrefix:V,image:y,imageSize:F="sm",title:Z,regularPriceText:M,stockStatus:U,stockStatusText:W,...J},Q)=>{const X=i(x,e),C={title:Z,titleTag:K,variant:"title-200","data-testid":`${t}-product-name`};return r.jsxs(c.Card,{className:X,"data-testid":t,fullHeight:b,ref:Q,...J,children:[r.jsx(c.Card.Badge,{text:a,variant:s,"data-testid":`${t}-badge`}),r.jsxs(c.Card.ContentContainer,{gapSize:"lg",className:i(`${e}__content-container`),fullHeight:b,children:[r.jsxs(c.Card.Content,{children:[r.jsx(f,{"data-testid":`${t}-product-header`,children:{productImage:y?r.jsx("div",{className:i(`${e}__product-image`,`${e}__product-image--${F}`),"data-testid":`${t}-product-image`,children:y}):null,productInformation:r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx(c.Card.Overline,{"data-testid":`${t}-overline`,overline:L}),u&&r.jsx(c.Card.Heading,{href:u,linkElement:k,disabled:j,onClick:_,...C}),_&&!u&&r.jsx(c.Card.Heading,{disabled:j,onClick:_,...C}),!u&&!_&&r.jsx(c.Card.Heading,{...C})]}),r.jsx(R,{colors:H,colorDotAriaLabels:P,"aria-label":q,"data-testid":`${t}-colors`})]})}}),(o||!!S?.length)&&r.jsxs("div",{className:i(`${e}__body`),children:[o&&r.jsx(p.Paragraph,{"data-testid":`${t}-body-text`,children:o}),r.jsx(c.Card.FeatureList,{"data-testid":`${t}-feature-list`,listItems:S})]})]}),d&&r.jsx(c.Card.Content,{className:`${e}__children`,"data-testid":`${t}-default-content`,children:d})]}),r.jsxs("div",{children:[r.jsxs(c.Card.ContentContainer,{isFooter:!0,children:[r.jsx(c.Card.Content,{children:r.jsxs("div",{className:i(`${e}__footer`,{[`${e}-with-cta-text`]:h}),children:[r.jsx(B,{"data-testid":`${t}-price`,pricePrefix:V,regularPriceText:M,priceDescription:G,priceText:D}),(u||_)&&r.jsx(c.Card.Cta,{className:i(`${e}__cta-button`),"data-testid":`${t}-cta-button`,disabled:j,iconPosition:h?u?"right":"left":void 0,loading:E,text:h,linkStyling:!!(u&&!h),children:u?r.jsx(T.i,{size:"sm"}):r.jsx(O,{size:"sm"})})]})}),A&&r.jsx(c.Card.Content,{"data-testid":`${t}-footer-content`,children:A})]}),r.jsx(z,{"data-testid":`${t}-stock-status`,stockStatus:U,stockStatusText:W})]})]})});n.Colors=R;n.Price=B;n.ProductHeader=f;n.StockStatus=z;n.displayName="ProductCard";exports.ProductCard=n;
2
+ //# sourceMappingURL=product-card-8X-Ld2d_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-card-CoY1KggV.js","sources":["../../../components/product-card/src/colors.tsx","../../../components/product-card/src/price.tsx","../../../components/product-card/src/product-header.tsx","../../../components/product-card/src/stock-status.tsx","../../../components/icon/dist/components/cart.es.js","../../../components/product-card/src/product-card.tsx"],"sourcesContent":["import React from \"react\";\nimport { ColorDot } from \"@purpur/color-dot\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./colors.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ColorsProps = {\n [\"aria-label\"]?: string;\n [\"data-testid\"]?: string;\n colors?: string[];\n colorDotAriaLabels?: string[];\n};\n\nconst rootClassName = \"purpur-colors\";\n\nexport const Colors = ({\n [\"aria-label\"]: ariaLabel,\n [\"data-testid\"]: dataTestId = \"purpur-colors\",\n colors,\n colorDotAriaLabels,\n}: ColorsProps) =>\n !!colors?.length && (\n <ul className={cx(rootClassName)} data-testid={dataTestId} aria-label={ariaLabel}>\n {colors.map((color: string, index: number) => (\n <li key={color}>\n <ColorDot\n data-testid={`${dataTestId}-color-dot`}\n withBorder\n color={color}\n size=\"xs\"\n aria-label={colorDotAriaLabels && colorDotAriaLabels[index]}\n />\n </li>\n ))}\n </ul>\n );\n","import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./price.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-price\";\n\nexport type PriceProps = {\n [\"data-testid\"]?: string;\n regularPriceText?: string;\n priceDescription?: string;\n priceText?: string;\n pricePrefix?: string;\n};\n\nexport const Price = ({\n [\"data-testid\"]: dataTestId = \"purpur-price\",\n regularPriceText,\n priceDescription,\n priceText,\n pricePrefix,\n}: PriceProps) => {\n if (!regularPriceText && !priceText && !pricePrefix && !priceDescription) {\n return null;\n }\n\n return (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n {regularPriceText && (\n <Paragraph data-testid={`${dataTestId}-regular`} variant=\"additional-100\">\n {regularPriceText}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__price-container`)}>\n {pricePrefix && (\n <Paragraph data-testid={`${dataTestId}-from`} variant=\"paragraph-200\">\n {pricePrefix}\n </Paragraph>\n )}\n {priceText && (\n <Paragraph\n className={cx(`${rootClassName}__price-text`, {\n [`${rootClassName}__price-text--discount`]: !!regularPriceText,\n })}\n data-testid={`${dataTestId}-actual`}\n variant=\"paragraph-100-bold\"\n >\n {priceText}\n </Paragraph>\n )}\n </div>\n {priceDescription && (\n <Paragraph data-testid={`${dataTestId}-description`} variant=\"additional-100\">\n {priceDescription}\n </Paragraph>\n )}\n </div>\n );\n};\n","import React, { type ReactNode } from \"react\";\nimport { Card } from \"@purpur/card\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./product-header.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type HeaderChildren = {\n productImage: ReactNode | null;\n productInformation: ReactNode;\n};\n\nexport type HeaderProps = { [\"data-testid\"]?: string; children: HeaderChildren };\n\nconst rootClassName = \"purpur-product-header\";\n\nexport const ProductHeader = ({\n [\"data-testid\"]: dataTestId = \"purpur-product-header\",\n children,\n}: HeaderProps) =>\n children.productImage ? (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n <div className={cx(`${rootClassName}__product-image`)}>{children.productImage}</div>\n <div className={cx(`${rootClassName}__product-information`)}>\n <Card.Content>{children.productInformation}</Card.Content>\n </div>\n </div>\n ) : (\n children.productInformation\n );\n","import React from \"react\";\nimport { ALERT_BADGE_VARIANT, AlertBadge } from \"@purpur/alert-badge\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./stock-status.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const STOCK_STATUS = {\n IN_STOCK: \"in-stock\",\n BACK_IN_STOCK: \"back-in-stock\",\n NOT_IN_STOCK: \"not-in-stock\",\n} as const;\n\nexport const StockStatusToAlertBadgeVariantMap = {\n [STOCK_STATUS.IN_STOCK]: ALERT_BADGE_VARIANT.SUCCESS,\n [STOCK_STATUS.BACK_IN_STOCK]: ALERT_BADGE_VARIANT.WARNING,\n [STOCK_STATUS.NOT_IN_STOCK]: ALERT_BADGE_VARIANT.ERROR,\n};\n\nexport type StockStatusVariants = (typeof STOCK_STATUS)[keyof typeof STOCK_STATUS];\n\nexport type StockStatusProps = {\n [\"data-testid\"]?: string;\n stockStatus?: StockStatusVariants;\n stockStatusText?: string;\n};\n\nconst rootClassName = \"purpur-stock-status\";\n\nexport const StockStatus = ({\n [\"data-testid\"]: dataTestId = \"purpur-stock-status\",\n stockStatus,\n stockStatusText,\n}: StockStatusProps) =>\n stockStatus &&\n stockStatusText && (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n <AlertBadge variant={StockStatusToAlertBadgeVariantMap[stockStatus]} />\n <Paragraph variant=\"paragraph-100-medium\">{stockStatusText}</Paragraph>\n </div>\n );\n","import { jsx as o } from \"react/jsx-runtime\";\nimport { I as r } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"cart\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M1.6 3a.9.9 0 0 1 .9-.9H5a.9.9 0 0 1 .88.713L8.275 14.1h10.54l2-7.2H10a.9.9 0 0 1 0-1.8h12a.9.9 0 0 1 .867 1.14l-2.5 9a.9.9 0 0 1-.867.66H8.656l.263 1.236a2.403 2.403 0 0 1 1.806 1.464h5.55a2.4 2.4 0 1 1 0 1.8h-5.55a2.4 2.4 0 1 1-3.567-2.89L4.27 3.9H2.5a.9.9 0 0 1-.9-.9Zm6.9 15.9a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Zm10 0a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"cart\"],\n category: \"other\"\n}, e = (a) => /* @__PURE__ */ o(r, { ...a, svg: t });\ne.displayName = \"IconCart\";\nexport {\n e as IconCart\n};\n//# sourceMappingURL=cart.es.js.map\n","import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport type { BadgeVariant } from \"@purpur/badge\";\nimport type {\n CardHeadingButtonProps,\n CardHeadingDefaultProps,\n CardHeadingLinkProps,\n CardHeadingNonInteractiveProps,\n CardProps,\n} from \"@purpur/card\";\nimport { Card } from \"@purpur/card\";\nimport type { HeadingTagType } from \"@purpur/heading\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { Colors } from \"./colors\";\nimport { Price } from \"./price\";\nimport styles from \"./product-card.module.scss\";\nimport { ProductHeader } from \"./product-header\";\nimport { StockStatus } from \"./stock-status\";\nexport type { StockStatusVariants } from \"./stock-status\";\nimport { IconArrowRight } from \"@purpur/icon/arrow-right\";\nimport { IconCart } from \"@purpur/icon/cart\";\n\nimport type { StockStatusVariants } from \"./stock-status\";\n\nconst cx = c.bind(styles);\n\nexport type ProductCardProps = Omit<CardProps, \"children\"> &\n (CardHeadingLinkProps | CardHeadingButtonProps | CardHeadingNonInteractiveProps) & {\n /**\n * The text that will be in the badge in the top right corner of the card. This is coupled with the badgeVariant prop. Both needs to be set for the badge to be displayed.\n */\n badgeText?: string;\n /**\n * The variant (color) of the badge in the top right corner of the card. This is coupled with the badgeText prop. Both needs to be set for the badge to be displayed.\n */\n badgeVariant?: BadgeVariant;\n /**\n * This is the descriptive text about the product displayed under the product name.\n */\n bodyText?: string;\n /**\n * ReactNode in the default slot under the feature list\n */\n children?: ReactNode;\n /**\n * This is the color dots informing the customers about the available colors. Send in a list of colors e.g. [\"#000000\", \"#F0E68C\", \"#B0C4DE\", \"#EFD9F4\"].\n */\n colorVariants?: string[];\n colorNames?: string[];\n colorListAriaLabel?: string;\n ctaText?: string;\n /**\n * Determine if the card should take up the full height of the parent. Useful for getting equal height cards when used in a flex grid. Defaults to true.\n */\n fullHeight?: boolean;\n /**\n * Any ReactElement that you want to put in under the price.\n */\n footerContent?: ReactNode;\n /**\n * This is the heading tag used for the product name in the card. Defaults to h2.\n */\n headingTag?: HeadingTagType;\n /**\n * This is the feature list where each entry is preceded by a checkmark.\n */\n listItems?: string[];\n /**\n * This is a loading flag used when using the product card as a button (not setting a href). This is so that the user can do some work in the clickHandler and display a loading state in the card. Defaults to false.\n */\n loading?: boolean;\n /**\n * This is the text above the product name. Used to for example render the product brand name.\n */\n overline?: string;\n /**\n * The actual price the customer will pay without the \"from\"-prefix. E.g. \"799 kr/mån\"\n */\n priceText?: string;\n /**\n * Here you can type additional information that will be displayed below the price. E.g. \"VAT excluded\"\n */\n priceDescription?: string;\n /**\n * The first part of the price text before the actual price. E.g. From 799kr/mån. It's the \"From\" part.\n */\n pricePrefix?: string;\n /**\n * Provide an image to be displayed at the top of the card. The image container height is set to --purpur-spacing-1600 (128px). So try not to use to big images. The image in the example is 100px width and 128px height giving ~4:5 aspect ratio.\n */\n image?: ReactNode;\n imageSize?: \"sm\" | \"md\" | \"lg\";\n /**\n * The name of the product.\n */\n title: string;\n /**\n * This is used if there is a discount. The priceText will receive additional styling if this field is set. E.g. Regular price 999 kr/mån\n */\n regularPriceText?: string;\n /**\n * Use this to display the stock status. It has three statuses. in-stock, back-in-stock and not-in-stock. This is to be used together with stockStatus text to display stock status.\n */\n stockStatus?: StockStatusVariants;\n /**\n * The text for stock status. Could be e.g \"In stock\", \"Back in stock 2024-08-11\" or \"Not in stock\".\n */\n stockStatusText?: string;\n };\n\nconst rootClassName = \"purpur-product-card\";\n\ntype ProductCardStatic = {\n Colors: typeof Colors;\n Price: typeof Price;\n ProductHeader: typeof ProductHeader;\n StockStatus: typeof StockStatus;\n};\n\ntype ProductCardComponent = ForwardRefExoticComponent<PropsWithoutRef<ProductCardProps>> &\n ProductCardStatic;\n\nexport const ProductCard = forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-product-card\",\n badgeText,\n badgeVariant,\n bodyText,\n children,\n className,\n colorVariants,\n colorNames,\n colorListAriaLabel,\n ctaText,\n disabled,\n fullHeight = true,\n footerContent,\n headingTag = \"h2\",\n href,\n onClick,\n linkElement,\n listItems,\n loading = false,\n overline,\n priceText,\n priceDescription,\n pricePrefix,\n image,\n imageSize = \"sm\",\n title,\n regularPriceText,\n stockStatus,\n stockStatusText,\n ...props\n },\n ref\n ) => {\n const classes = cx(className, rootClassName);\n\n const headingProps: Pick<\n CardHeadingDefaultProps,\n \"title\" | \"titleTag\" | \"variant\" | \"data-testid\"\n > = {\n title,\n titleTag: headingTag,\n variant: \"title-200\",\n \"data-testid\": `${dataTestId}-product-name`,\n };\n\n return (\n <Card\n className={classes}\n data-testid={dataTestId}\n fullHeight={fullHeight}\n ref={ref}\n {...props}\n >\n <Card.Badge text={badgeText} variant={badgeVariant} data-testid={`${dataTestId}-badge`} />\n <Card.ContentContainer\n gapSize=\"lg\"\n className={cx(`${rootClassName}__content-container`)}\n fullHeight={fullHeight}\n >\n <Card.Content>\n <ProductHeader data-testid={`${dataTestId}-product-header`}>\n {{\n productImage: image ? (\n <div\n className={cx(\n `${rootClassName}__product-image`,\n `${rootClassName}__product-image--${imageSize}`\n )}\n data-testid={`${dataTestId}-product-image`}\n >\n {image}\n </div>\n ) : null,\n productInformation: (\n <>\n <div>\n <Card.Overline data-testid={`${dataTestId}-overline`} overline={overline} />\n {href && (\n <Card.Heading\n href={href}\n linkElement={linkElement}\n disabled={disabled}\n onClick={onClick}\n {...headingProps}\n />\n )}\n {onClick && !href && (\n <Card.Heading disabled={disabled} onClick={onClick} {...headingProps} />\n )}\n {!href && !onClick && <Card.Heading {...headingProps} />}\n </div>\n <Colors\n colors={colorVariants}\n colorDotAriaLabels={colorNames}\n aria-label={colorListAriaLabel}\n data-testid={`${dataTestId}-colors`}\n />\n </>\n ),\n }}\n </ProductHeader>\n {(bodyText || !!listItems?.length) && (\n <div className={cx(`${rootClassName}__body`)}>\n {bodyText && (\n <Paragraph data-testid={`${dataTestId}-body-text`}>{bodyText}</Paragraph>\n )}\n <Card.FeatureList\n data-testid={`${dataTestId}-feature-list`}\n listItems={listItems}\n />\n </div>\n )}\n </Card.Content>\n {children && (\n <Card.Content\n className={`${rootClassName}__children`}\n data-testid={`${dataTestId}-default-content`}\n >\n {children}\n </Card.Content>\n )}\n </Card.ContentContainer>\n <div>\n <Card.ContentContainer isFooter>\n <Card.Content>\n <div\n className={cx(`${rootClassName}__footer`, {\n [`${rootClassName}-with-cta-text`]: ctaText,\n })}\n >\n <Price\n data-testid={`${dataTestId}-price`}\n pricePrefix={pricePrefix}\n regularPriceText={regularPriceText}\n priceDescription={priceDescription}\n priceText={priceText}\n />\n {(href || onClick) && (\n <Card.Cta\n className={cx(`${rootClassName}__cta-button`)}\n data-testid={`${dataTestId}-cta-button`}\n disabled={disabled}\n iconPosition={ctaText ? (href ? \"right\" : \"left\") : undefined}\n loading={loading}\n text={ctaText}\n linkStyling={Boolean(href && !ctaText)}\n >\n {href ? <IconArrowRight size=\"sm\" /> : <IconCart size=\"sm\" />}\n </Card.Cta>\n )}\n </div>\n </Card.Content>\n {footerContent && (\n <Card.Content data-testid={`${dataTestId}-footer-content`}>\n {footerContent}\n </Card.Content>\n )}\n </Card.ContentContainer>\n <StockStatus\n data-testid={`${dataTestId}-stock-status`}\n stockStatus={stockStatus}\n stockStatusText={stockStatusText}\n />\n </div>\n </Card>\n );\n }\n) as ProductCardComponent;\n\nProductCard.Colors = Colors;\nProductCard.Price = Price;\nProductCard.ProductHeader = ProductHeader;\nProductCard.StockStatus = StockStatus;\nProductCard.displayName = \"ProductCard\";\n"],"names":["cx","c","styles","rootClassName","Colors","ariaLabel","dataTestId","colors","colorDotAriaLabels","color","index","jsx","ColorDot","Price","regularPriceText","priceDescription","priceText","pricePrefix","Paragraph","ProductHeader","children","jsxs","Card","STOCK_STATUS","StockStatusToAlertBadgeVariantMap","ALERT_BADGE_VARIANT","StockStatus","stockStatus","stockStatusText","AlertBadge","t","e","a","o","r","ProductCard","forwardRef","badgeText","badgeVariant","bodyText","className","colorVariants","colorNames","colorListAriaLabel","ctaText","disabled","fullHeight","footerContent","headingTag","href","onClick","linkElement","listItems","loading","overline","image","imageSize","title","props","ref","classes","headingProps","Fragment","IconArrowRight","IconCart"],"mappings":"wXAMMA,GAAKC,EAAAA,EAAE,KAAKC,EAAM,EASlBC,GAAgB,gBAETC,EAAS,CAAC,CACrB,CAAC,cAAeC,EAChB,CAAC,eAAgBC,EAAa,gBAC9B,OAAAC,EACA,mBAAAC,CACF,IACE,CAAC,CAACD,GAAQ,cACP,KAAA,CAAG,UAAWP,GAAGG,EAAa,EAAG,cAAaG,EAAY,aAAYD,EACpE,SAAAE,EAAO,IAAI,CAACE,EAAeC,UACzB,KAAA,CACC,SAAAC,EAAAA,IAACC,EAAAA,SAAA,CACC,cAAa,GAAGN,CAAU,aAC1B,WAAU,GACV,MAAAG,EACA,KAAK,KACL,aAAYD,GAAsBA,EAAmBE,CAAK,CAAA,CAC5D,GAPOD,CAQT,CACD,EACH,2MC9BET,EAAKC,EAAAA,EAAE,KAAKC,EAAM,EAElBC,EAAgB,eAUTU,EAAQ,CAAC,CACpB,CAAC,eAAgBP,EAAa,eAC9B,iBAAAQ,EACA,iBAAAC,EACA,UAAAC,EACA,YAAAC,CACF,IACM,CAACH,GAAoB,CAACE,GAAa,CAACC,GAAe,CAACF,EAC/C,YAIN,MAAA,CAAI,UAAWf,EAAGG,CAAa,EAAG,cAAaG,EAC7C,SAAA,CAAAQ,GACCH,EAAAA,IAACO,EAAAA,WAAU,cAAa,GAAGZ,CAAU,WAAY,QAAQ,iBACtD,SAAAQ,CAAA,CACH,SAED,MAAA,CAAI,UAAWd,EAAG,GAAGG,CAAa,mBAAmB,EACnD,SAAA,CAAAc,GACCN,EAAAA,IAACO,EAAAA,WAAU,cAAa,GAAGZ,CAAU,QAAS,QAAQ,gBACnD,SAAAW,CAAA,CACH,EAEDD,GACCL,EAAAA,IAACO,EAAAA,UAAA,CACC,UAAWlB,EAAG,GAAGG,CAAa,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AAY,cAAgBhB,EAC5BgB,EAAY,YAAcT,EAC1BS,EAAY,YAAc"}
1
+ {"version":3,"file":"product-card-8X-Ld2d_.js","sources":["../../../components/product-card/src/colors.tsx","../../../components/product-card/src/price.tsx","../../../components/product-card/src/product-header.tsx","../../../components/product-card/src/stock-status.tsx","../../../components/icon/dist/components/cart.es.js","../../../components/product-card/src/product-card.tsx"],"sourcesContent":["import React from \"react\";\nimport { ColorDot } from \"@purpur/color-dot\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./colors.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type ColorsProps = {\n [\"aria-label\"]?: string;\n [\"data-testid\"]?: string;\n colors?: string[];\n colorDotAriaLabels?: string[];\n};\n\nconst rootClassName = \"purpur-colors\";\n\nexport const Colors = ({\n [\"aria-label\"]: ariaLabel,\n [\"data-testid\"]: dataTestId = \"purpur-colors\",\n colors,\n colorDotAriaLabels,\n}: ColorsProps) =>\n !!colors?.length && (\n <ul className={cx(rootClassName)} data-testid={dataTestId} aria-label={ariaLabel}>\n {colors.map((color: string, index: number) => (\n <li key={color}>\n <ColorDot\n data-testid={`${dataTestId}-color-dot`}\n withBorder\n color={color}\n size=\"xs\"\n aria-label={colorDotAriaLabels && colorDotAriaLabels[index]}\n />\n </li>\n ))}\n </ul>\n );\n","import React from \"react\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./price.module.scss\";\n\nconst cx = c.bind(styles);\n\nconst rootClassName = \"purpur-price\";\n\nexport type PriceProps = {\n [\"data-testid\"]?: string;\n regularPriceText?: string;\n priceDescription?: string;\n priceText?: string;\n pricePrefix?: string;\n};\n\nexport const Price = ({\n [\"data-testid\"]: dataTestId = \"purpur-price\",\n regularPriceText,\n priceDescription,\n priceText,\n pricePrefix,\n}: PriceProps) => {\n if (!regularPriceText && !priceText && !pricePrefix && !priceDescription) {\n return null;\n }\n\n return (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n {regularPriceText && (\n <Paragraph data-testid={`${dataTestId}-regular`} variant=\"additional-100\">\n {regularPriceText}\n </Paragraph>\n )}\n <div className={cx(`${rootClassName}__price-container`)}>\n {pricePrefix && (\n <Paragraph data-testid={`${dataTestId}-from`} variant=\"paragraph-200\">\n {pricePrefix}\n </Paragraph>\n )}\n {priceText && (\n <Paragraph\n className={cx(`${rootClassName}__price-text`, {\n [`${rootClassName}__price-text--discount`]: !!regularPriceText,\n })}\n data-testid={`${dataTestId}-actual`}\n variant=\"paragraph-100-bold\"\n >\n {priceText}\n </Paragraph>\n )}\n </div>\n {priceDescription && (\n <Paragraph data-testid={`${dataTestId}-description`} variant=\"additional-100\">\n {priceDescription}\n </Paragraph>\n )}\n </div>\n );\n};\n","import React, { type ReactNode } from \"react\";\nimport { Card } from \"@purpur/card\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./product-header.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport type HeaderChildren = {\n productImage: ReactNode | null;\n productInformation: ReactNode;\n};\n\nexport type HeaderProps = { [\"data-testid\"]?: string; children: HeaderChildren };\n\nconst rootClassName = \"purpur-product-header\";\n\nexport const ProductHeader = ({\n [\"data-testid\"]: dataTestId = \"purpur-product-header\",\n children,\n}: HeaderProps) =>\n children.productImage ? (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n <div className={cx(`${rootClassName}__product-image`)}>{children.productImage}</div>\n <div className={cx(`${rootClassName}__product-information`)}>\n <Card.Content>{children.productInformation}</Card.Content>\n </div>\n </div>\n ) : (\n children.productInformation\n );\n","import React from \"react\";\nimport { ALERT_BADGE_VARIANT, AlertBadge } from \"@purpur/alert-badge\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport styles from \"./stock-status.module.scss\";\n\nconst cx = c.bind(styles);\n\nexport const STOCK_STATUS = {\n IN_STOCK: \"in-stock\",\n BACK_IN_STOCK: \"back-in-stock\",\n NOT_IN_STOCK: \"not-in-stock\",\n} as const;\n\nexport const StockStatusToAlertBadgeVariantMap = {\n [STOCK_STATUS.IN_STOCK]: ALERT_BADGE_VARIANT.SUCCESS,\n [STOCK_STATUS.BACK_IN_STOCK]: ALERT_BADGE_VARIANT.WARNING,\n [STOCK_STATUS.NOT_IN_STOCK]: ALERT_BADGE_VARIANT.ERROR,\n};\n\nexport type StockStatusVariants = (typeof STOCK_STATUS)[keyof typeof STOCK_STATUS];\n\nexport type StockStatusProps = {\n [\"data-testid\"]?: string;\n stockStatus?: StockStatusVariants;\n stockStatusText?: string;\n};\n\nconst rootClassName = \"purpur-stock-status\";\n\nexport const StockStatus = ({\n [\"data-testid\"]: dataTestId = \"purpur-stock-status\",\n stockStatus,\n stockStatusText,\n}: StockStatusProps) =>\n stockStatus &&\n stockStatusText && (\n <div className={cx(rootClassName)} data-testid={dataTestId}>\n <AlertBadge variant={StockStatusToAlertBadgeVariantMap[stockStatus]} />\n <Paragraph variant=\"paragraph-100-medium\">{stockStatusText}</Paragraph>\n </div>\n );\n","import { jsx as o } from \"react/jsx-runtime\";\nimport { I as r } from \"../icon-DNHpBTHs.mjs\";\nconst t = {\n name: \"cart\",\n svg: '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M1.6 3a.9.9 0 0 1 .9-.9H5a.9.9 0 0 1 .88.713L8.275 14.1h10.54l2-7.2H10a.9.9 0 0 1 0-1.8h12a.9.9 0 0 1 .867 1.14l-2.5 9a.9.9 0 0 1-.867.66H8.656l.263 1.236a2.403 2.403 0 0 1 1.806 1.464h5.55a2.4 2.4 0 1 1 0 1.8h-5.55a2.4 2.4 0 1 1-3.567-2.89L4.27 3.9H2.5a.9.9 0 0 1-.9-.9Zm6.9 15.9a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Zm10 0a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2Z\" clip-rule=\"evenodd\"/></svg>',\n keywords: [\"cart\"],\n category: \"other\"\n}, e = (a) => /* @__PURE__ */ o(r, { ...a, svg: t });\ne.displayName = \"IconCart\";\nexport {\n e as IconCart\n};\n//# sourceMappingURL=cart.es.js.map\n","import React, {\n forwardRef,\n type ForwardRefExoticComponent,\n type PropsWithoutRef,\n type ReactNode,\n} from \"react\";\nimport type { BadgeVariant } from \"@purpur/badge\";\nimport type {\n CardHeadingButtonProps,\n CardHeadingDefaultProps,\n CardHeadingLinkProps,\n CardHeadingNonInteractiveProps,\n CardProps,\n} from \"@purpur/card\";\nimport { Card } from \"@purpur/card\";\nimport type { HeadingTagType } from \"@purpur/heading\";\nimport { Paragraph } from \"@purpur/paragraph\";\nimport c from \"classnames/bind\";\n\nimport { Colors } from \"./colors\";\nimport { Price } from \"./price\";\nimport styles from \"./product-card.module.scss\";\nimport { ProductHeader } from \"./product-header\";\nimport { StockStatus } from \"./stock-status\";\nexport type { StockStatusVariants } from \"./stock-status\";\nimport { IconArrowRight } from \"@purpur/icon/arrow-right\";\nimport { IconCart } from \"@purpur/icon/cart\";\n\nimport type { StockStatusVariants } from \"./stock-status\";\n\nconst cx = c.bind(styles);\n\nexport type ProductCardProps = Omit<CardProps, \"children\"> &\n (CardHeadingLinkProps | CardHeadingButtonProps | CardHeadingNonInteractiveProps) & {\n /**\n * The text that will be in the badge in the top right corner of the card. This is coupled with the badgeVariant prop. Both needs to be set for the badge to be displayed.\n */\n badgeText?: string;\n /**\n * The variant (color) of the badge in the top right corner of the card. This is coupled with the badgeText prop. Both needs to be set for the badge to be displayed.\n */\n badgeVariant?: BadgeVariant;\n /**\n * This is the descriptive text about the product displayed under the product name.\n */\n bodyText?: string;\n /**\n * ReactNode in the default slot under the feature list\n */\n children?: ReactNode;\n /**\n * This is the color dots informing the customers about the available colors. Send in a list of colors e.g. [\"#000000\", \"#F0E68C\", \"#B0C4DE\", \"#EFD9F4\"].\n */\n colorVariants?: string[];\n colorNames?: string[];\n colorListAriaLabel?: string;\n ctaText?: string;\n /**\n * Determine if the card should take up the full height of the parent. Useful for getting equal height cards when used in a flex grid. Defaults to true.\n */\n fullHeight?: boolean;\n /**\n * Any ReactElement that you want to put in under the price.\n */\n footerContent?: ReactNode;\n /**\n * This is the heading tag used for the product name in the card. Defaults to h2.\n */\n headingTag?: HeadingTagType;\n /**\n * This is the feature list where each entry is preceded by a checkmark.\n */\n listItems?: string[];\n /**\n * This is a loading flag used when using the product card as a button (not setting a href). This is so that the user can do some work in the clickHandler and display a loading state in the card. Defaults to false.\n */\n loading?: boolean;\n /**\n * This is the text above the product name. Used to for example render the product brand name.\n */\n overline?: string;\n /**\n * The actual price the customer will pay without the \"from\"-prefix. E.g. \"799 kr/mån\"\n */\n priceText?: string;\n /**\n * Here you can type additional information that will be displayed below the price. E.g. \"VAT excluded\"\n */\n priceDescription?: string;\n /**\n * The first part of the price text before the actual price. E.g. From 799kr/mån. It's the \"From\" part.\n */\n pricePrefix?: string;\n /**\n * Provide an image to be displayed at the top of the card. The image container height is set to --purpur-spacing-1600 (128px). So try not to use to big images. The image in the example is 100px width and 128px height giving ~4:5 aspect ratio.\n */\n image?: ReactNode;\n imageSize?: \"sm\" | \"md\" | \"lg\";\n /**\n * The name of the product.\n */\n title: string;\n /**\n * This is used if there is a discount. The priceText will receive additional styling if this field is set. E.g. Regular price 999 kr/mån\n */\n regularPriceText?: string;\n /**\n * Use this to display the stock status. It has three statuses. in-stock, back-in-stock and not-in-stock. This is to be used together with stockStatus text to display stock status.\n */\n stockStatus?: StockStatusVariants;\n /**\n * The text for stock status. Could be e.g \"In stock\", \"Back in stock 2024-08-11\" or \"Not in stock\".\n */\n stockStatusText?: string;\n };\n\nconst rootClassName = \"purpur-product-card\";\n\ntype ProductCardStatic = {\n Colors: typeof Colors;\n Price: typeof Price;\n ProductHeader: typeof ProductHeader;\n StockStatus: typeof StockStatus;\n};\n\ntype ProductCardComponent = ForwardRefExoticComponent<PropsWithoutRef<ProductCardProps>> &\n ProductCardStatic;\n\nexport const ProductCard = forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n [\"data-testid\"]: dataTestId = \"purpur-product-card\",\n badgeText,\n badgeVariant,\n bodyText,\n children,\n className,\n colorVariants,\n colorNames,\n colorListAriaLabel,\n ctaText,\n disabled,\n fullHeight = true,\n footerContent,\n headingTag = \"h2\",\n href,\n onClick,\n linkElement,\n listItems,\n loading = false,\n overline,\n priceText,\n priceDescription,\n pricePrefix,\n image,\n imageSize = \"sm\",\n title,\n regularPriceText,\n stockStatus,\n stockStatusText,\n ...props\n },\n ref\n ) => {\n const classes = cx(className, rootClassName);\n\n const headingProps: Pick<\n CardHeadingDefaultProps,\n \"title\" | \"titleTag\" | \"variant\" | \"data-testid\"\n > = {\n title,\n titleTag: headingTag,\n variant: \"title-200\",\n \"data-testid\": `${dataTestId}-product-name`,\n };\n\n return (\n <Card\n className={classes}\n data-testid={dataTestId}\n fullHeight={fullHeight}\n ref={ref}\n {...props}\n >\n <Card.Badge text={badgeText} variant={badgeVariant} data-testid={`${dataTestId}-badge`} />\n <Card.ContentContainer\n gapSize=\"lg\"\n className={cx(`${rootClassName}__content-container`)}\n fullHeight={fullHeight}\n >\n <Card.Content>\n <ProductHeader data-testid={`${dataTestId}-product-header`}>\n {{\n productImage: image ? (\n <div\n className={cx(\n `${rootClassName}__product-image`,\n `${rootClassName}__product-image--${imageSize}`\n )}\n data-testid={`${dataTestId}-product-image`}\n >\n {image}\n </div>\n ) : null,\n productInformation: (\n <>\n <div>\n <Card.Overline data-testid={`${dataTestId}-overline`} overline={overline} />\n {href && (\n <Card.Heading\n href={href}\n linkElement={linkElement}\n disabled={disabled}\n onClick={onClick}\n {...headingProps}\n />\n )}\n {onClick && !href && (\n <Card.Heading disabled={disabled} onClick={onClick} {...headingProps} />\n )}\n {!href && !onClick && <Card.Heading {...headingProps} />}\n </div>\n <Colors\n colors={colorVariants}\n colorDotAriaLabels={colorNames}\n aria-label={colorListAriaLabel}\n data-testid={`${dataTestId}-colors`}\n />\n </>\n ),\n }}\n </ProductHeader>\n {(bodyText || !!listItems?.length) && (\n <div className={cx(`${rootClassName}__body`)}>\n {bodyText && (\n <Paragraph data-testid={`${dataTestId}-body-text`}>{bodyText}</Paragraph>\n )}\n <Card.FeatureList\n data-testid={`${dataTestId}-feature-list`}\n listItems={listItems}\n />\n </div>\n )}\n </Card.Content>\n {children && (\n <Card.Content\n className={`${rootClassName}__children`}\n data-testid={`${dataTestId}-default-content`}\n >\n {children}\n </Card.Content>\n )}\n </Card.ContentContainer>\n <div>\n <Card.ContentContainer isFooter>\n <Card.Content>\n <div\n className={cx(`${rootClassName}__footer`, {\n [`${rootClassName}-with-cta-text`]: ctaText,\n })}\n >\n <Price\n data-testid={`${dataTestId}-price`}\n pricePrefix={pricePrefix}\n regularPriceText={regularPriceText}\n priceDescription={priceDescription}\n priceText={priceText}\n />\n {(href || onClick) && (\n <Card.Cta\n className={cx(`${rootClassName}__cta-button`)}\n data-testid={`${dataTestId}-cta-button`}\n disabled={disabled}\n iconPosition={ctaText ? (href ? \"right\" : \"left\") : undefined}\n loading={loading}\n text={ctaText}\n linkStyling={Boolean(href && !ctaText)}\n >\n {href ? <IconArrowRight size=\"sm\" /> : <IconCart size=\"sm\" />}\n </Card.Cta>\n )}\n </div>\n </Card.Content>\n {footerContent && (\n <Card.Content data-testid={`${dataTestId}-footer-content`}>\n {footerContent}\n </Card.Content>\n )}\n </Card.ContentContainer>\n <StockStatus\n data-testid={`${dataTestId}-stock-status`}\n stockStatus={stockStatus}\n stockStatusText={stockStatusText}\n />\n </div>\n </Card>\n );\n }\n) as ProductCardComponent;\n\nProductCard.Colors = Colors;\nProductCard.Price = Price;\nProductCard.ProductHeader = ProductHeader;\nProductCard.StockStatus = StockStatus;\nProductCard.displayName = \"ProductCard\";\n"],"names":["cx","c","styles","rootClassName","Colors","ariaLabel","dataTestId","colors","colorDotAriaLabels","color","index","jsx","ColorDot","Price","regularPriceText","priceDescription","priceText","pricePrefix","Paragraph","ProductHeader","children","jsxs","Card","STOCK_STATUS","StockStatusToAlertBadgeVariantMap","ALERT_BADGE_VARIANT","StockStatus","stockStatus","stockStatusText","AlertBadge","t","e","a","o","r","ProductCard","forwardRef","badgeText","badgeVariant","bodyText","className","colorVariants","colorNames","colorListAriaLabel","ctaText","disabled","fullHeight","footerContent","headingTag","href","onClick","linkElement","listItems","loading","overline","image","imageSize","title","props","ref","classes","headingProps","Fragment","IconArrowRight","IconCart"],"mappings":"wXAMMA,GAAKC,EAAAA,EAAE,KAAKC,EAAM,EASlBC,GAAgB,gBAETC,EAAS,CAAC,CACrB,CAAC,cAAeC,EAChB,CAAC,eAAgBC,EAAa,gBAC9B,OAAAC,EACA,mBAAAC,CACF,IACE,CAAC,CAACD,GAAQ,cACP,KAAA,CAAG,UAAWP,GAAGG,EAAa,EAAG,cAAaG,EAAY,aAAYD,EACpE,SAAAE,EAAO,IAAI,CAACE,EAAeC,UACzB,KAAA,CACC,SAAAC,EAAAA,IAACC,EAAAA,SAAA,CACC,cAAa,GAAGN,CAAU,aAC1B,WAAU,GACV,MAAAG,EACA,KAAK,KACL,aAAYD,GAAsBA,EAAmBE,CAAK,CAAA,CAC5D,GAPOD,CAQT,CACD,EACH,2MC9BET,EAAKC,EAAAA,EAAE,KAAKC,EAAM,EAElBC,EAAgB,eAUTU,EAAQ,CAAC,CACpB,CAAC,eAAgBP,EAAa,eAC9B,iBAAAQ,EACA,iBAAAC,EACA,UAAAC,EACA,YAAAC,CACF,IACM,CAACH,GAAoB,CAACE,GAAa,CAACC,GAAe,CAACF,EAC/C,YAIN,MAAA,CAAI,UAAWf,EAAGG,CAAa,EAAG,cAAaG,EAC7C,SAAA,CAAAQ,GACCH,EAAAA,IAACO,EAAAA,WAAU,cAAa,GAAGZ,CAAU,WAAY,QAAQ,iBACtD,SAAAQ,CAAA,CACH,SAED,MAAA,CAAI,UAAWd,EAAG,GAAGG,CAAa,mBAAmB,EACnD,SAAA,CAAAc,GACCN,EAAAA,IAACO,EAAAA,WAAU,cAAa,GAAGZ,CAAU,QAAS,QAAQ,gBACnD,SA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