@flamingo-stack/openframe-frontend-core 0.0.627 → 0.0.628-2170.6181.1

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 (182) hide show
  1. package/dist/{chunk-25UWKNII.js → chunk-2E543KJD.js} +8 -10
  2. package/dist/{chunk-25UWKNII.js.map → chunk-2E543KJD.js.map} +1 -1
  3. package/dist/{chunk-RAPPN6MN.cjs → chunk-2MMEPNSX.cjs} +3 -3
  4. package/dist/{chunk-RAPPN6MN.cjs.map → chunk-2MMEPNSX.cjs.map} +1 -1
  5. package/dist/{chunk-P7UT2YSC.cjs → chunk-3IXDZI3R.cjs} +3 -3
  6. package/dist/{chunk-P7UT2YSC.cjs.map → chunk-3IXDZI3R.cjs.map} +1 -1
  7. package/dist/{chunk-JRYS4VMV.js → chunk-5LIDR7HL.js} +79 -4
  8. package/dist/{chunk-JRYS4VMV.js.map → chunk-5LIDR7HL.js.map} +1 -1
  9. package/dist/{chunk-4PIHIFJM.js → chunk-6AFJQOT2.js} +4 -4
  10. package/dist/{chunk-BC726XIQ.cjs → chunk-6QLOSGE7.cjs} +47 -49
  11. package/dist/chunk-6QLOSGE7.cjs.map +1 -0
  12. package/dist/{chunk-BJGAFPG5.cjs → chunk-BND25SXU.cjs} +42 -42
  13. package/dist/{chunk-BJGAFPG5.cjs.map → chunk-BND25SXU.cjs.map} +1 -1
  14. package/dist/{chunk-ZOMGXH7C.js → chunk-BVQEU5JB.js} +2 -2
  15. package/dist/{chunk-VUAEDAUN.cjs → chunk-C3DDNRJG.cjs} +6 -6
  16. package/dist/{chunk-VUAEDAUN.cjs.map → chunk-C3DDNRJG.cjs.map} +1 -1
  17. package/dist/{chunk-VOZZQ6HQ.cjs → chunk-CCWI3622.cjs} +4 -4
  18. package/dist/{chunk-VOZZQ6HQ.cjs.map → chunk-CCWI3622.cjs.map} +1 -1
  19. package/dist/{chunk-GQ7267OV.cjs → chunk-E523WX5V.cjs} +5 -5
  20. package/dist/{chunk-GQ7267OV.cjs.map → chunk-E523WX5V.cjs.map} +1 -1
  21. package/dist/{chunk-4E7XCEV3.cjs → chunk-EHAYNUOL.cjs} +2 -77
  22. package/dist/chunk-EHAYNUOL.cjs.map +1 -0
  23. package/dist/{chunk-X5NN4NJM.js → chunk-F2KBCLUG.js} +2 -2
  24. package/dist/{chunk-USIRWQJ3.js → chunk-FKBM6U43.js} +1 -76
  25. package/dist/{chunk-USIRWQJ3.js.map → chunk-FKBM6U43.js.map} +1 -1
  26. package/dist/{chunk-ZCQVUIPH.cjs → chunk-GH4WLDPS.cjs} +18 -18
  27. package/dist/{chunk-ZCQVUIPH.cjs.map → chunk-GH4WLDPS.cjs.map} +1 -1
  28. package/dist/{chunk-WZ6CUZMM.js → chunk-HLZKMYST.js} +4 -4
  29. package/dist/{chunk-PKSH6PAK.js → chunk-HNNR5CGX.js} +8 -10
  30. package/dist/{chunk-PKSH6PAK.js.map → chunk-HNNR5CGX.js.map} +1 -1
  31. package/dist/{chunk-QIVX7F3N.cjs → chunk-JJUV7Z4L.cjs} +27 -27
  32. package/dist/{chunk-QIVX7F3N.cjs.map → chunk-JJUV7Z4L.cjs.map} +1 -1
  33. package/dist/{chunk-53ARMJHM.cjs → chunk-JONR3BDJ.cjs} +37 -37
  34. package/dist/{chunk-53ARMJHM.cjs.map → chunk-JONR3BDJ.cjs.map} +1 -1
  35. package/dist/{chunk-NLADJ4IX.js → chunk-JVLLA3Z7.js} +6 -6
  36. package/dist/{chunk-CAQ5MNLJ.js → chunk-JWXEEZKD.js} +3 -3
  37. package/dist/{chunk-HIZAMJPT.js → chunk-K43T7N7O.js} +12 -12
  38. package/dist/{chunk-N6XNJX25.cjs → chunk-KT47FRJC.cjs} +15 -15
  39. package/dist/{chunk-N6XNJX25.cjs.map → chunk-KT47FRJC.cjs.map} +1 -1
  40. package/dist/{chunk-VZQ3VVFH.cjs → chunk-KTBZJP5J.cjs} +20 -22
  41. package/dist/chunk-KTBZJP5J.cjs.map +1 -0
  42. package/dist/{chunk-4SXZT7JP.cjs → chunk-L6GJV7E7.cjs} +83 -83
  43. package/dist/{chunk-4SXZT7JP.cjs.map → chunk-L6GJV7E7.cjs.map} +1 -1
  44. package/dist/{chunk-DH3YH3TV.js → chunk-LCMXGM2P.js} +8 -8
  45. package/dist/{chunk-KXDYBRRR.js → chunk-LLSX5T7X.js} +7 -7
  46. package/dist/{chunk-G47XRVZA.js → chunk-MB4IEWLH.js} +3 -3
  47. package/dist/{chunk-L5FEAOGJ.js → chunk-ON7663OW.js} +354 -8
  48. package/dist/chunk-ON7663OW.js.map +1 -0
  49. package/dist/{chunk-55X46LKR.cjs → chunk-OQHFHKUG.cjs} +100 -450
  50. package/dist/chunk-OQHFHKUG.cjs.map +1 -0
  51. package/dist/{chunk-SLT5C3PQ.cjs → chunk-Q544C4Z7.cjs} +25 -25
  52. package/dist/{chunk-SLT5C3PQ.cjs.map → chunk-Q544C4Z7.cjs.map} +1 -1
  53. package/dist/{chunk-2J7EFH4V.js → chunk-QS2QCXBH.js} +30 -380
  54. package/dist/chunk-QS2QCXBH.js.map +1 -0
  55. package/dist/{chunk-76HB456V.js → chunk-S6WBBSII.js} +5 -5
  56. package/dist/{chunk-FR6EDA3P.cjs → chunk-SWJ6QLD7.cjs} +105 -105
  57. package/dist/{chunk-FR6EDA3P.cjs.map → chunk-SWJ6QLD7.cjs.map} +1 -1
  58. package/dist/{chunk-G46NJNTL.cjs → chunk-TDKOW2C5.cjs} +26 -28
  59. package/dist/chunk-TDKOW2C5.cjs.map +1 -0
  60. package/dist/{chunk-ZGZ7YAJH.js → chunk-TUUSLED7.js} +8 -10
  61. package/dist/{chunk-ZGZ7YAJH.js.map → chunk-TUUSLED7.js.map} +1 -1
  62. package/dist/{chunk-CK2CPZXB.js → chunk-U4UNC3RP.js} +12 -12
  63. package/dist/{chunk-6I3KNDBF.cjs → chunk-U7TTQV4N.cjs} +3 -3
  64. package/dist/{chunk-6I3KNDBF.cjs.map → chunk-U7TTQV4N.cjs.map} +1 -1
  65. package/dist/{chunk-R3SJ6PMI.cjs → chunk-UBX3ATG5.cjs} +292 -280
  66. package/dist/chunk-UBX3ATG5.cjs.map +1 -0
  67. package/dist/{chunk-ZYDNPUSH.cjs → chunk-UNI3POHU.cjs} +625 -279
  68. package/dist/chunk-UNI3POHU.cjs.map +1 -0
  69. package/dist/{chunk-4E3UZZ2J.cjs → chunk-VCY2KHOE.cjs} +34 -34
  70. package/dist/{chunk-4E3UZZ2J.cjs.map → chunk-VCY2KHOE.cjs.map} +1 -1
  71. package/dist/{chunk-J6ATJUEE.js → chunk-WBZ4HP7D.js} +4 -4
  72. package/dist/{chunk-QCSWM3VU.cjs → chunk-WIP5JO2O.cjs} +9 -9
  73. package/dist/{chunk-QCSWM3VU.cjs.map → chunk-WIP5JO2O.cjs.map} +1 -1
  74. package/dist/{chunk-32P6KUZP.js → chunk-X3LC6R37.js} +2 -2
  75. package/dist/{chunk-5E55S5SI.js → chunk-XQ4II4BK.js} +4 -4
  76. package/dist/{chunk-OAXASIVG.cjs → chunk-Y5QXDVPP.cjs} +7 -7
  77. package/dist/{chunk-OAXASIVG.cjs.map → chunk-Y5QXDVPP.cjs.map} +1 -1
  78. package/dist/{chunk-CMUNJZWN.js → chunk-YQCA4ZEJ.js} +2 -2
  79. package/dist/{chunk-ZI27ALYX.cjs → chunk-YXWGSDK4.cjs} +80 -5
  80. package/dist/chunk-YXWGSDK4.cjs.map +1 -0
  81. package/dist/{chunk-PTP5LSYM.js → chunk-YZJL6WGP.js} +28 -16
  82. package/dist/{chunk-PTP5LSYM.js.map → chunk-YZJL6WGP.js.map} +1 -1
  83. package/dist/{chunk-Y3MIFC5M.js → chunk-ZRCWXJDW.js} +4 -4
  84. package/dist/components/case-studies/index.cjs +14 -14
  85. package/dist/components/case-studies/index.js +8 -8
  86. package/dist/components/chat/index.cjs +5 -5
  87. package/dist/components/chat/index.js +4 -4
  88. package/dist/components/contact/index.cjs +9 -9
  89. package/dist/components/contact/index.js +8 -8
  90. package/dist/components/docs/index.cjs +12 -12
  91. package/dist/components/docs/index.js +11 -11
  92. package/dist/components/embeds/index.cjs +9 -9
  93. package/dist/components/embeds/index.js +8 -8
  94. package/dist/components/faq/index.cjs +10 -10
  95. package/dist/components/faq/index.js +9 -9
  96. package/dist/components/features/index.cjs +8 -8
  97. package/dist/components/features/index.js +7 -7
  98. package/dist/components/help-center-pages/index.cjs +31 -31
  99. package/dist/components/help-center-pages/index.js +22 -22
  100. package/dist/components/index.cjs +69 -71
  101. package/dist/components/index.cjs.map +1 -1
  102. package/dist/components/index.js +24 -26
  103. package/dist/components/index.js.map +1 -1
  104. package/dist/components/meeting-scheduler/index.cjs +49 -49
  105. package/dist/components/meeting-scheduler/index.js +9 -9
  106. package/dist/components/navigation/index.cjs +11 -11
  107. package/dist/components/navigation/index.js +10 -10
  108. package/dist/components/onboarding-guides/index.cjs +12 -12
  109. package/dist/components/onboarding-guides/index.js +11 -11
  110. package/dist/components/related-content/index.cjs +6 -6
  111. package/dist/components/related-content/index.js +5 -5
  112. package/dist/components/tickets/index.cjs +13 -13
  113. package/dist/components/tickets/index.js +12 -12
  114. package/dist/components/ui/color-preset-select.d.ts +5 -4
  115. package/dist/components/ui/color-preset-select.d.ts.map +1 -1
  116. package/dist/components/ui/department-badge.d.ts +3 -3
  117. package/dist/components/ui/index.cjs +8 -10
  118. package/dist/components/ui/index.cjs.map +1 -1
  119. package/dist/components/ui/index.js +7 -9
  120. package/dist/components/ui/palette-badge.d.ts +6 -8
  121. package/dist/components/ui/palette-badge.d.ts.map +1 -1
  122. package/dist/components/ui/status-badge.d.ts +1 -1
  123. package/dist/components/ui/status-badge.d.ts.map +1 -1
  124. package/dist/hooks/index.cjs +5 -5
  125. package/dist/hooks/index.js +4 -4
  126. package/dist/index.cjs +18 -18
  127. package/dist/index.cjs.map +1 -1
  128. package/dist/index.js +46 -46
  129. package/dist/types/department.d.ts +1 -1
  130. package/dist/types/department.d.ts.map +1 -1
  131. package/dist/utils/badge-palette.d.ts +18 -0
  132. package/dist/utils/badge-palette.d.ts.map +1 -0
  133. package/dist/utils/index.cjs +21 -24
  134. package/dist/utils/index.cjs.map +1 -1
  135. package/dist/utils/index.d.ts +1 -1
  136. package/dist/utils/index.d.ts.map +1 -1
  137. package/dist/utils/index.js +19 -22
  138. package/dist/utils/index.js.map +1 -1
  139. package/package.json +1 -1
  140. package/src/components/ui/.department-badge.md +2 -2
  141. package/src/components/ui/.palette-badge.md +2 -2
  142. package/src/components/ui/.status-badge.md +2 -2
  143. package/src/components/ui/__tests__/department-badge.test.tsx +23 -21
  144. package/src/components/ui/color-preset-select.tsx +21 -5
  145. package/src/components/ui/department-badge.tsx +3 -3
  146. package/src/components/ui/palette-badge.tsx +8 -13
  147. package/src/components/ui/status-badge.tsx +5 -0
  148. package/src/types/department.ts +1 -1
  149. package/src/utils/.badge-palette.md +2 -0
  150. package/src/utils/badge-palette.ts +38 -0
  151. package/src/utils/index.ts +2 -1
  152. package/dist/chunk-2J7EFH4V.js.map +0 -1
  153. package/dist/chunk-4E7XCEV3.cjs.map +0 -1
  154. package/dist/chunk-55X46LKR.cjs.map +0 -1
  155. package/dist/chunk-BC726XIQ.cjs.map +0 -1
  156. package/dist/chunk-G46NJNTL.cjs.map +0 -1
  157. package/dist/chunk-L5FEAOGJ.js.map +0 -1
  158. package/dist/chunk-R3SJ6PMI.cjs.map +0 -1
  159. package/dist/chunk-VZQ3VVFH.cjs.map +0 -1
  160. package/dist/chunk-ZI27ALYX.cjs.map +0 -1
  161. package/dist/chunk-ZYDNPUSH.cjs.map +0 -1
  162. package/dist/utils/color-presets.d.ts +0 -24
  163. package/dist/utils/color-presets.d.ts.map +0 -1
  164. package/src/utils/.color-presets.md +0 -2
  165. package/src/utils/color-presets.ts +0 -48
  166. /package/dist/{chunk-4PIHIFJM.js.map → chunk-6AFJQOT2.js.map} +0 -0
  167. /package/dist/{chunk-ZOMGXH7C.js.map → chunk-BVQEU5JB.js.map} +0 -0
  168. /package/dist/{chunk-X5NN4NJM.js.map → chunk-F2KBCLUG.js.map} +0 -0
  169. /package/dist/{chunk-WZ6CUZMM.js.map → chunk-HLZKMYST.js.map} +0 -0
  170. /package/dist/{chunk-NLADJ4IX.js.map → chunk-JVLLA3Z7.js.map} +0 -0
  171. /package/dist/{chunk-CAQ5MNLJ.js.map → chunk-JWXEEZKD.js.map} +0 -0
  172. /package/dist/{chunk-HIZAMJPT.js.map → chunk-K43T7N7O.js.map} +0 -0
  173. /package/dist/{chunk-DH3YH3TV.js.map → chunk-LCMXGM2P.js.map} +0 -0
  174. /package/dist/{chunk-KXDYBRRR.js.map → chunk-LLSX5T7X.js.map} +0 -0
  175. /package/dist/{chunk-G47XRVZA.js.map → chunk-MB4IEWLH.js.map} +0 -0
  176. /package/dist/{chunk-76HB456V.js.map → chunk-S6WBBSII.js.map} +0 -0
  177. /package/dist/{chunk-CK2CPZXB.js.map → chunk-U4UNC3RP.js.map} +0 -0
  178. /package/dist/{chunk-J6ATJUEE.js.map → chunk-WBZ4HP7D.js.map} +0 -0
  179. /package/dist/{chunk-32P6KUZP.js.map → chunk-X3LC6R37.js.map} +0 -0
  180. /package/dist/{chunk-5E55S5SI.js.map → chunk-XQ4II4BK.js.map} +0 -0
  181. /package/dist/{chunk-CMUNJZWN.js.map → chunk-YQCA4ZEJ.js.map} +0 -0
  182. /package/dist/{chunk-Y3MIFC5M.js.map → chunk-ZRCWXJDW.js.map} +0 -0
@@ -3,15 +3,11 @@ import {
3
3
  next_image_default
4
4
  } from "./chunk-MDKCTSDS.js";
5
5
  import {
6
- PLATFORM_THEME,
7
- clamp,
8
- getPlatformAccentColor,
9
6
  getPlatformBrandClasses,
10
- getPlatformDisplayName,
11
7
  useAuthedImageSrc,
12
8
  useImageEdgeColor,
13
9
  useOgPlaceholderUrl
14
- } from "./chunk-USIRWQJ3.js";
10
+ } from "./chunk-FKBM6U43.js";
15
11
  import {
16
12
  FigmaIcon,
17
13
  ImageIcon,
@@ -511,332 +507,6 @@ var SquareAvatar = memo(
511
507
  );
512
508
  SquareAvatar.displayName = "SquareAvatar";
513
509
 
514
- // src/utils/color-analysis.ts
515
- var DESIGN_PALETTE = [
516
- { name: "yellow", hex: "#FFC008", rgb: [255, 192, 8] },
517
- { name: "black", hex: "#161616", rgb: [22, 22, 22] },
518
- { name: "gray", hex: "#888888", rgb: [136, 136, 136] }
519
- ];
520
- function hexToRgb(hex) {
521
- const normalized = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (_, r, g, b) => `${r}${r}${g}${g}${b}${b}`);
522
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(normalized);
523
- return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : [0, 0, 0];
524
- }
525
- function getLuminance(rgb) {
526
- const [r, g, b] = rgb.map((channel) => {
527
- const c = channel / 255;
528
- return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
529
- });
530
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
531
- }
532
- function getContrastRatio(color1, color2) {
533
- const lum1 = getLuminance(color1);
534
- const lum2 = getLuminance(color2);
535
- const brightest = Math.max(lum1, lum2);
536
- const darkest = Math.min(lum1, lum2);
537
- return (brightest + 0.05) / (darkest + 0.05);
538
- }
539
- function pickReadableTextColor(bgHex) {
540
- const bg = hexToRgb(bgHex);
541
- const darkContrast = getContrastRatio(bg, [26, 26, 26]);
542
- const lightContrast = getContrastRatio(bg, [250, 250, 250]);
543
- return darkContrast >= lightContrast ? "dark" : "light";
544
- }
545
- function extractDominantColor(canvas) {
546
- const ctx = canvas.getContext("2d");
547
- if (!ctx) return [128, 128, 128];
548
- const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
549
- const data = imageData.data;
550
- const sampleSize = Math.max(1, Math.floor(data.length / (4 * 1e3)));
551
- const colorCounts = {};
552
- for (let i = 0; i < data.length; i += 4 * sampleSize) {
553
- const r = data[i];
554
- const g = data[i + 1];
555
- const b = data[i + 2];
556
- const alpha = data[i + 3];
557
- if (alpha < 128) continue;
558
- const bucketR = Math.round(r / 32) * 32;
559
- const bucketG = Math.round(g / 32) * 32;
560
- const bucketB = Math.round(b / 32) * 32;
561
- const key = `${bucketR},${bucketG},${bucketB}`;
562
- colorCounts[key] = (colorCounts[key] || 0) + 1;
563
- }
564
- let maxCount = 0;
565
- let dominantColor = [128, 128, 128];
566
- for (const [colorKey, count] of Object.entries(colorCounts)) {
567
- if (count > maxCount) {
568
- maxCount = count;
569
- const [r, g, b] = colorKey.split(",").map(Number);
570
- dominantColor = [r, g, b];
571
- }
572
- }
573
- return dominantColor;
574
- }
575
- function getBestContrastColor(imageColor) {
576
- let bestColor = DESIGN_PALETTE[0];
577
- let bestContrast = 0;
578
- for (const color of DESIGN_PALETTE) {
579
- const contrast = getContrastRatio(imageColor, color.rgb);
580
- if (contrast > bestContrast) {
581
- bestContrast = contrast;
582
- bestColor = color;
583
- }
584
- }
585
- return bestContrast >= 3 ? bestColor : DESIGN_PALETTE.find((c) => c.name === "black") || bestColor;
586
- }
587
- function analyzeImageColor(imageSrc) {
588
- return new Promise((resolve, reject) => {
589
- const img = new Image();
590
- img.crossOrigin = "anonymous";
591
- img.onload = () => {
592
- try {
593
- const canvas = document.createElement("canvas");
594
- const ctx = canvas.getContext("2d");
595
- if (!ctx) {
596
- reject(new Error("Could not get canvas context"));
597
- return;
598
- }
599
- const maxSize = 100;
600
- const scale = Math.min(maxSize / img.width, maxSize / img.height);
601
- canvas.width = img.width * scale;
602
- canvas.height = img.height * scale;
603
- ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
604
- const dominantColor = extractDominantColor(canvas);
605
- const bestContrastColor = getBestContrastColor(dominantColor);
606
- resolve(bestContrastColor);
607
- } catch (error) {
608
- reject(error);
609
- }
610
- };
611
- img.onerror = () => reject(new Error("Failed to load image"));
612
- img.src = imageSrc;
613
- });
614
- }
615
- async function extractImageEdgeColorAsync(imageUrl) {
616
- return new Promise((resolve) => {
617
- if (typeof window === "undefined") {
618
- resolve("#000000");
619
- return;
620
- }
621
- const img = new Image();
622
- img.crossOrigin = "anonymous";
623
- img.onload = () => {
624
- try {
625
- const canvas = document.createElement("canvas");
626
- const ctx = canvas.getContext("2d");
627
- if (!ctx) {
628
- resolve("#000000");
629
- return;
630
- }
631
- const maxSize = 50;
632
- const scale = Math.min(maxSize / img.naturalWidth, maxSize / img.naturalHeight);
633
- const w = Math.round(img.naturalWidth * scale);
634
- const h = Math.round(img.naturalHeight * scale);
635
- canvas.width = w;
636
- canvas.height = h;
637
- ctx.drawImage(img, 0, 0, w, h);
638
- const data = ctx.getImageData(0, 0, w, h).data;
639
- const edgeW = Math.max(2, Math.round(w * 0.15));
640
- const edgeH = Math.max(2, Math.round(h * 0.15));
641
- const bucketSize = 32;
642
- const buckets = /* @__PURE__ */ new Map();
643
- for (let y = 0; y < h; y++) {
644
- for (let x = 0; x < w; x++) {
645
- if (!(x < edgeW || x >= w - edgeW || y < edgeH || y >= h - edgeH)) continue;
646
- const i = (y * w + x) * 4;
647
- if (data[i + 3] < 128) continue;
648
- const br = Math.floor(data[i] / bucketSize) * bucketSize;
649
- const bg = Math.floor(data[i + 1] / bucketSize) * bucketSize;
650
- const bb = Math.floor(data[i + 2] / bucketSize) * bucketSize;
651
- const key = `${br},${bg},${bb}`;
652
- const existing = buckets.get(key);
653
- if (existing) {
654
- existing.r += data[i];
655
- existing.g += data[i + 1];
656
- existing.b += data[i + 2];
657
- existing.count++;
658
- } else {
659
- buckets.set(key, { r: data[i], g: data[i + 1], b: data[i + 2], count: 1 });
660
- }
661
- }
662
- }
663
- let best = { r: 0, g: 0, b: 0, count: 0 };
664
- for (const b2 of buckets.values()) {
665
- if (b2.count > best.count) best = b2;
666
- }
667
- if (best.count === 0) {
668
- resolve("#000000");
669
- return;
670
- }
671
- const r = Math.round(best.r / best.count), g = Math.round(best.g / best.count), b = Math.round(best.b / best.count);
672
- resolve(
673
- `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`
674
- );
675
- } catch {
676
- resolve("#000000");
677
- }
678
- };
679
- img.onerror = () => resolve("#000000");
680
- img.src = imageUrl;
681
- });
682
- }
683
-
684
- // src/utils/ods-color-tokens-stub.ts
685
- var colorTokens = {
686
- primary: "#FFC008",
687
- secondary: "#161616",
688
- background: "#FAFAFA",
689
- surface: "#FFFFFF",
690
- text: {
691
- primary: "#161616",
692
- secondary: "#666666",
693
- inverse: "#FFFFFF"
694
- },
695
- border: "#E5E5E5"
696
- };
697
-
698
- // src/utils/ods-color-utils.ts
699
- var TOKEN_MAP = colorTokens;
700
- function lookupToken(tokenKey) {
701
- const value = TOKEN_MAP[tokenKey];
702
- return typeof value === "string" ? value : void 0;
703
- }
704
- function getODSToken(category, color, variant = "base") {
705
- const tokenKey = `${category}-${color}-${variant}`;
706
- return lookupToken(tokenKey);
707
- }
708
- function getCurrentPlatform() {
709
- if (typeof window === "undefined") {
710
- return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
711
- }
712
- const domPlatform = document.documentElement.getAttribute("data-app-type");
713
- if (domPlatform) {
714
- return domPlatform;
715
- }
716
- return process.env.NEXT_PUBLIC_APP_TYPE || "openmsp";
717
- }
718
- function switchPlatformTheme(platform) {
719
- if (typeof window === "undefined") return;
720
- const root = document.documentElement;
721
- root.setAttribute("data-app-type", platform);
722
- window.dispatchEvent(
723
- new CustomEvent("platformThemeChanged", {
724
- detail: { platform }
725
- })
726
- );
727
- }
728
- function getSemanticColor(semanticName, platform) {
729
- if (typeof window === "undefined") return void 0;
730
- const currentPlatform = platform || getCurrentPlatform();
731
- const originalPlatform = getCurrentPlatform();
732
- if (currentPlatform !== originalPlatform) {
733
- switchPlatformTheme(currentPlatform);
734
- }
735
- const testElement = document.createElement("div");
736
- document.body.appendChild(testElement);
737
- const computedStyle = getComputedStyle(testElement);
738
- const colorValue = computedStyle.getPropertyValue(`--color-${semanticName}`);
739
- document.body.removeChild(testElement);
740
- if (currentPlatform !== originalPlatform) {
741
- switchPlatformTheme(originalPlatform);
742
- }
743
- return colorValue.trim() || void 0;
744
- }
745
- function getPlatformConfig(platform) {
746
- const currentPlatform = platform || getCurrentPlatform();
747
- const isDarkTheme = PLATFORM_THEME === "dark";
748
- return {
749
- platform: currentPlatform,
750
- accentColor: getPlatformAccentColor(currentPlatform),
751
- isDarkTheme,
752
- isLightTheme: !isDarkTheme,
753
- brandName: getPlatformDisplayName(currentPlatform)
754
- };
755
- }
756
- function usePlatformColors(platform) {
757
- const currentPlatform = platform || getCurrentPlatform();
758
- const config = getPlatformConfig(currentPlatform);
759
- return {
760
- platform: currentPlatform,
761
- accentColor: config.accentColor,
762
- isDarkTheme: config.isDarkTheme,
763
- isLightTheme: config.isLightTheme,
764
- brandName: config.brandName,
765
- getToken: (category, color, variant) => getODSToken(category, color, variant),
766
- switchTheme: (newPlatform) => switchPlatformTheme(newPlatform),
767
- getSemanticColor: (semanticName) => getSemanticColor(semanticName, currentPlatform)
768
- };
769
- }
770
- function getReadableTextColor(hex) {
771
- return pickReadableTextColor(hex) === "dark" ? "#212121" : "#fafafa";
772
- }
773
- var HEX_PATTERN = /^#[0-9a-fA-F]{6}$/;
774
- function hexToRgb2(hex) {
775
- if (!HEX_PATTERN.test(hex)) return null;
776
- const n = Number.parseInt(hex.slice(1), 16);
777
- return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
778
- }
779
- function rgbToHex(r, g, b) {
780
- const to = (n) => clamp(Math.round(n), 0, 255).toString(16).padStart(2, "0");
781
- return `#${to(r)}${to(g)}${to(b)}`;
782
- }
783
- var HOVER_DARKEN_STEP = 10;
784
- var ACTIVE_DARKEN_STEP = 20;
785
- function darkenByStep(hex, step) {
786
- const rgb = hexToRgb2(hex);
787
- if (!rgb) return hex;
788
- return rgbToHex(rgb.r - step, rgb.g - step, rgb.b - step);
789
- }
790
- function deriveHoverColor(hex) {
791
- return darkenByStep(hex, HOVER_DARKEN_STEP);
792
- }
793
- function deriveActiveColor(hex) {
794
- return darkenByStep(hex, ACTIVE_DARKEN_STEP);
795
- }
796
- function rgbToHsl(r, g, b) {
797
- const rn = r / 255;
798
- const gn = g / 255;
799
- const bn = b / 255;
800
- const max = Math.max(rn, gn, bn);
801
- const min = Math.min(rn, gn, bn);
802
- const l = (max + min) / 2;
803
- if (max === min) return { h: 0, s: 0, l: Math.round(l * 100) };
804
- const d = max - min;
805
- const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
806
- let h;
807
- if (max === rn) h = (gn - bn) / d + (gn < bn ? 6 : 0);
808
- else if (max === gn) h = (bn - rn) / d + 2;
809
- else h = (rn - gn) / d + 4;
810
- h *= 60;
811
- return { h: Math.round(h), s: Math.round(s * 100), l: Math.round(l * 100) };
812
- }
813
- function hslToRgb(h, s, l) {
814
- const sn = clamp(s, 0, 100) / 100;
815
- const ln = clamp(l, 0, 100) / 100;
816
- const hn = (h % 360 + 360) % 360;
817
- if (sn === 0) {
818
- const v = Math.round(ln * 255);
819
- return { r: v, g: v, b: v };
820
- }
821
- const q = ln < 0.5 ? ln * (1 + sn) : ln + sn - ln * sn;
822
- const p = 2 * ln - q;
823
- const hue2rgb = (t) => {
824
- let tn = t;
825
- if (tn < 0) tn += 1;
826
- if (tn > 1) tn -= 1;
827
- if (tn < 1 / 6) return p + (q - p) * 6 * tn;
828
- if (tn < 1 / 2) return q;
829
- if (tn < 2 / 3) return p + (q - p) * (2 / 3 - tn) * 6;
830
- return p;
831
- };
832
- const hk = hn / 360;
833
- return {
834
- r: Math.round(hue2rgb(hk + 1 / 3) * 255),
835
- g: Math.round(hue2rgb(hk) * 255),
836
- b: Math.round(hue2rgb(hk - 1 / 3) * 255)
837
- };
838
- }
839
-
840
510
  // src/components/ui/interactive-card.tsx
841
511
  import React from "react";
842
512
  import { jsx as jsx3 } from "react/jsx-runtime";
@@ -1087,6 +757,11 @@ var statusBadgeVariants = cva("inline-flex items-center justify-center rounded",
1087
757
  yellow: "border border-ods-border bg-ods-accent text-ods-text-on-accent",
1088
758
  green: "bg-ods-success text-ods-text-on-accent",
1089
759
  purple: "bg-ods-flamingo-pink text-ods-text-on-accent",
760
+ // Solid and soft ODS palette fills (`BADGE_PALETTE`): tokens only, no hex.
761
+ cyanSoft: "bg-ods-flamingo-cyan-secondary text-ods-flamingo-cyan",
762
+ pinkSoft: "bg-ods-flamingo-pink-secondary text-ods-flamingo-pink",
763
+ openYellow: "bg-ods-open-yellow text-ods-text-on-accent",
764
+ red: "bg-ods-error text-ods-text-on-accent",
1090
765
  success: "bg-ods-success-secondary text-ods-success",
1091
766
  error: "bg-ods-error-secondary text-ods-error",
1092
767
  warning: "bg-ods-warning-secondary text-ods-warning",
@@ -1137,48 +812,43 @@ function StatusBadge({ text, variant, colorScheme, className, singleLine, gen, s
1137
812
  );
1138
813
  }
1139
814
 
1140
- // src/utils/color-presets.ts
1141
- var COLOR_PRESETS = [
1142
- { key: "green", label: "Green", color: "#5ea62e" },
1143
- { key: "lime", label: "Lime", color: "#8bc34a" },
1144
- { key: "teal", label: "Teal", color: "#4db6ac" },
1145
- { key: "sky", label: "Sky", color: "#4fc3f7" },
1146
- { key: "periwinkle", label: "Periwinkle", color: "#7e9cd8" },
1147
- { key: "lavender", label: "Lavender", color: "#b39ddb" },
1148
- { key: "yellow", label: "Yellow", color: "#e1b32f" },
1149
- { key: "sand", label: "Sand", color: "#f0c674" },
1150
- { key: "peach", label: "Peach", color: "#f39c7a" },
1151
- { key: "red", label: "Red", color: "#f36666" },
1152
- { key: "pink", label: "Pink", color: "#e988a8" },
1153
- { key: "neutral", label: "Neutral", color: "#b0b0b0" }
815
+ // src/utils/badge-palette.ts
816
+ var BADGE_PALETTE = [
817
+ "cyan",
818
+ "cyanSoft",
819
+ "pink",
820
+ "pinkSoft",
821
+ "openYellow",
822
+ "warning",
823
+ "green",
824
+ "success",
825
+ "red",
826
+ "error"
1154
827
  ];
1155
- function colorPreset(key) {
1156
- return key ? COLOR_PRESETS.find((preset) => preset.key === key) : void 0;
828
+ function isBadgePaletteKey(value) {
829
+ return typeof value === "string" && BADGE_PALETTE.includes(value);
1157
830
  }
1158
- function pickPresetColor({
831
+ function pickBadgePaletteColor({
1159
832
  avoid = [],
1160
833
  random = Math.random
1161
834
  } = {}) {
1162
- const colours = COLOR_PRESETS.filter((preset) => preset.key !== "neutral");
1163
835
  const used = new Set(avoid);
1164
- const free = colours.filter((preset) => !used.has(preset.key));
1165
- const pool = free.length > 0 ? free : colours;
1166
- return pool[Math.floor(random() * pool.length) % pool.length].key;
836
+ const free = BADGE_PALETTE.filter((key) => !used.has(key));
837
+ const pool = free.length > 0 ? free : BADGE_PALETTE;
838
+ return pool[Math.floor(random() * pool.length) % pool.length];
1167
839
  }
1168
840
 
1169
841
  // src/components/ui/palette-badge.tsx
1170
842
  import { jsx as jsx7 } from "react/jsx-runtime";
1171
843
  function PaletteBadge({ text, color, className, variant = "button" }) {
1172
- const fill = colorPreset(color)?.color ?? (color && HEX_PATTERN.test(color) ? color : null);
1173
844
  return /* @__PURE__ */ jsx7(
1174
845
  StatusBadge,
1175
846
  {
1176
847
  text,
1177
- colorScheme: "default",
848
+ colorScheme: isBadgePaletteKey(color) ? color : "default",
1178
849
  variant,
1179
850
  singleLine: true,
1180
- className,
1181
- style: fill ? { backgroundColor: fill, color: getReadableTextColor(fill) } : void 0
851
+ className
1182
852
  }
1183
853
  );
1184
854
  }
@@ -4428,26 +4098,6 @@ export {
4428
4098
  formatPricingModel,
4429
4099
  formatBioText,
4430
4100
  SquareAvatar,
4431
- DESIGN_PALETTE,
4432
- getContrastRatio,
4433
- pickReadableTextColor,
4434
- extractDominantColor,
4435
- getBestContrastColor,
4436
- analyzeImageColor,
4437
- extractImageEdgeColorAsync,
4438
- getCurrentPlatform,
4439
- switchPlatformTheme,
4440
- getSemanticColor,
4441
- getPlatformConfig,
4442
- usePlatformColors,
4443
- getReadableTextColor,
4444
- HEX_PATTERN,
4445
- hexToRgb2 as hexToRgb,
4446
- rgbToHex,
4447
- deriveHoverColor,
4448
- deriveActiveColor,
4449
- rgbToHsl,
4450
- hslToRgb,
4451
4101
  InteractiveCard,
4452
4102
  Modal,
4453
4103
  ModalContent,
@@ -4459,9 +4109,9 @@ export {
4459
4109
  genBadgeBgOpacity,
4460
4110
  generationTierFromLabel,
4461
4111
  StatusBadge,
4462
- COLOR_PRESETS,
4463
- colorPreset,
4464
- pickPresetColor,
4112
+ BADGE_PALETTE,
4113
+ isBadgePaletteKey,
4114
+ pickBadgePaletteColor,
4465
4115
  PaletteBadge,
4466
4116
  DepartmentBadge,
4467
4117
  getProxiedImageUrl,
@@ -4559,4 +4209,4 @@ export {
4559
4209
  canonicalContentRefType,
4560
4210
  buildListUrl
4561
4211
  };
4562
- //# sourceMappingURL=chunk-2J7EFH4V.js.map
4212
+ //# sourceMappingURL=chunk-QS2QCXBH.js.map