@clyrex-digital/clyrex-controls-dev 0.8.1-dev.20260829085511 → 0.8.1-dev.20260829103736

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.
package/dist/index.js CHANGED
@@ -6542,72 +6542,51 @@ var Commentrenderer_default = CommentRenderer;
6542
6542
  // src/components/controls/view/AvatarView.tsx
6543
6543
  var import_jsx_runtime28 = require("react/jsx-runtime");
6544
6544
  var AVATAR_COLORS = [
6545
- "#1abc9c",
6546
- "#2ecc71",
6547
- "#3498db",
6548
- "#9b59b6",
6549
- "#e67e22",
6550
- "#e74c3c",
6551
- "#16a085",
6552
- "#27ae60",
6553
- "#2980b9",
6554
- "#8e44ad",
6555
- "#f39c12",
6556
- "#d35400",
6557
- "#c0392b",
6558
- "#7f8c8d",
6559
- "#2c3e50"
6545
+ "bg-error-strong",
6546
+ "bg-accent-base",
6547
+ "bg-warning-base",
6548
+ "bg-success-base",
6549
+ "bg-info-base",
6550
+ "bg-primary-base",
6551
+ "bg-secondary-base"
6560
6552
  ];
6561
- var hashString = (text) => {
6553
+ var getAvatarColor = (text) => {
6562
6554
  let hash = 0;
6563
6555
  for (let i = 0; i < text.length; i += 1) {
6564
- hash = (hash << 5) - hash + text.charCodeAt(i);
6565
- hash |= 0;
6556
+ hash = hash * 31 + text.charCodeAt(i) >>> 0;
6566
6557
  }
6567
- return Math.abs(hash);
6558
+ return AVATAR_COLORS[hash % AVATAR_COLORS.length];
6568
6559
  };
6569
6560
  var getInitials = (text) => {
6570
6561
  const words = text.trim().split(/\s+/).filter(Boolean);
6571
6562
  if (words.length === 0) {
6572
- return "";
6563
+ return "?";
6573
6564
  }
6574
6565
  if (words.length === 1) {
6575
6566
  return words[0].slice(0, 2).toUpperCase();
6576
6567
  }
6577
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
6568
+ return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
6578
6569
  };
6579
6570
  var AvatarView = (props) => {
6580
6571
  const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
6581
6572
  if (!text) {
6582
6573
  return null;
6583
6574
  }
6584
- const initials = getInitials(text);
6585
- const backgroundColor = AVATAR_COLORS[hashString(text) % AVATAR_COLORS.length];
6586
- const size = props.width ?? "2rem";
6575
+ const size = props.width ?? "1.75rem";
6587
6576
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
6588
6577
  "span",
6589
6578
  {
6590
- className: "avatar-view",
6579
+ className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(text)}`,
6591
6580
  title: text,
6592
6581
  "aria-label": text,
6593
6582
  style: {
6594
- display: "inline-flex",
6595
- alignItems: "center",
6596
- justifyContent: "center",
6597
6583
  width: size,
6598
6584
  height: size,
6599
- borderRadius: "9999px",
6600
- backgroundColor,
6601
- color: "#fff",
6602
- fontWeight: 600,
6603
- fontSize: "0.75em",
6604
- lineHeight: 1,
6605
- textTransform: "uppercase",
6606
- userSelect: "none",
6607
- flexShrink: 0,
6608
- overflow: "hidden"
6585
+ fontSize: "0.6875rem",
6586
+ letterSpacing: "0.02em",
6587
+ lineHeight: 1
6609
6588
  },
6610
- children: initials
6589
+ children: getInitials(text)
6611
6590
  }
6612
6591
  );
6613
6592
  };
package/dist/index.mjs CHANGED
@@ -420,72 +420,51 @@ var Commentrenderer_default = CommentRenderer;
420
420
  // src/components/controls/view/AvatarView.tsx
421
421
  import { jsx as jsx15 } from "react/jsx-runtime";
422
422
  var AVATAR_COLORS = [
423
- "#1abc9c",
424
- "#2ecc71",
425
- "#3498db",
426
- "#9b59b6",
427
- "#e67e22",
428
- "#e74c3c",
429
- "#16a085",
430
- "#27ae60",
431
- "#2980b9",
432
- "#8e44ad",
433
- "#f39c12",
434
- "#d35400",
435
- "#c0392b",
436
- "#7f8c8d",
437
- "#2c3e50"
423
+ "bg-error-strong",
424
+ "bg-accent-base",
425
+ "bg-warning-base",
426
+ "bg-success-base",
427
+ "bg-info-base",
428
+ "bg-primary-base",
429
+ "bg-secondary-base"
438
430
  ];
439
- var hashString = (text) => {
431
+ var getAvatarColor = (text) => {
440
432
  let hash = 0;
441
433
  for (let i = 0; i < text.length; i += 1) {
442
- hash = (hash << 5) - hash + text.charCodeAt(i);
443
- hash |= 0;
434
+ hash = hash * 31 + text.charCodeAt(i) >>> 0;
444
435
  }
445
- return Math.abs(hash);
436
+ return AVATAR_COLORS[hash % AVATAR_COLORS.length];
446
437
  };
447
438
  var getInitials = (text) => {
448
439
  const words = text.trim().split(/\s+/).filter(Boolean);
449
440
  if (words.length === 0) {
450
- return "";
441
+ return "?";
451
442
  }
452
443
  if (words.length === 1) {
453
444
  return words[0].slice(0, 2).toUpperCase();
454
445
  }
455
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
446
+ return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
456
447
  };
457
448
  var AvatarView = (props) => {
458
449
  const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
459
450
  if (!text) {
460
451
  return null;
461
452
  }
462
- const initials = getInitials(text);
463
- const backgroundColor = AVATAR_COLORS[hashString(text) % AVATAR_COLORS.length];
464
- const size = props.width ?? "2rem";
453
+ const size = props.width ?? "1.75rem";
465
454
  return /* @__PURE__ */ jsx15(
466
455
  "span",
467
456
  {
468
- className: "avatar-view",
457
+ className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(text)}`,
469
458
  title: text,
470
459
  "aria-label": text,
471
460
  style: {
472
- display: "inline-flex",
473
- alignItems: "center",
474
- justifyContent: "center",
475
461
  width: size,
476
462
  height: size,
477
- borderRadius: "9999px",
478
- backgroundColor,
479
- color: "#fff",
480
- fontWeight: 600,
481
- fontSize: "0.75em",
482
- lineHeight: 1,
483
- textTransform: "uppercase",
484
- userSelect: "none",
485
- flexShrink: 0,
486
- overflow: "hidden"
463
+ fontSize: "0.6875rem",
464
+ letterSpacing: "0.02em",
465
+ lineHeight: 1
487
466
  },
488
- children: initials
467
+ children: getInitials(text)
489
468
  }
490
469
  );
491
470
  };
package/dist/server.js CHANGED
@@ -6881,72 +6881,51 @@ var Commentrenderer_default = CommentRenderer;
6881
6881
  // src/components/controls/view/AvatarView.tsx
6882
6882
  var import_jsx_runtime39 = require("react/jsx-runtime");
6883
6883
  var AVATAR_COLORS = [
6884
- "#1abc9c",
6885
- "#2ecc71",
6886
- "#3498db",
6887
- "#9b59b6",
6888
- "#e67e22",
6889
- "#e74c3c",
6890
- "#16a085",
6891
- "#27ae60",
6892
- "#2980b9",
6893
- "#8e44ad",
6894
- "#f39c12",
6895
- "#d35400",
6896
- "#c0392b",
6897
- "#7f8c8d",
6898
- "#2c3e50"
6884
+ "bg-error-strong",
6885
+ "bg-accent-base",
6886
+ "bg-warning-base",
6887
+ "bg-success-base",
6888
+ "bg-info-base",
6889
+ "bg-primary-base",
6890
+ "bg-secondary-base"
6899
6891
  ];
6900
- var hashString = (text) => {
6892
+ var getAvatarColor = (text) => {
6901
6893
  let hash = 0;
6902
6894
  for (let i = 0; i < text.length; i += 1) {
6903
- hash = (hash << 5) - hash + text.charCodeAt(i);
6904
- hash |= 0;
6895
+ hash = hash * 31 + text.charCodeAt(i) >>> 0;
6905
6896
  }
6906
- return Math.abs(hash);
6897
+ return AVATAR_COLORS[hash % AVATAR_COLORS.length];
6907
6898
  };
6908
6899
  var getInitials = (text) => {
6909
6900
  const words = text.trim().split(/\s+/).filter(Boolean);
6910
6901
  if (words.length === 0) {
6911
- return "";
6902
+ return "?";
6912
6903
  }
6913
6904
  if (words.length === 1) {
6914
6905
  return words[0].slice(0, 2).toUpperCase();
6915
6906
  }
6916
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
6907
+ return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
6917
6908
  };
6918
6909
  var AvatarView = (props) => {
6919
6910
  const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
6920
6911
  if (!text) {
6921
6912
  return null;
6922
6913
  }
6923
- const initials = getInitials(text);
6924
- const backgroundColor = AVATAR_COLORS[hashString(text) % AVATAR_COLORS.length];
6925
- const size = props.width ?? "2rem";
6914
+ const size = props.width ?? "1.75rem";
6926
6915
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
6927
6916
  "span",
6928
6917
  {
6929
- className: "avatar-view",
6918
+ className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(text)}`,
6930
6919
  title: text,
6931
6920
  "aria-label": text,
6932
6921
  style: {
6933
- display: "inline-flex",
6934
- alignItems: "center",
6935
- justifyContent: "center",
6936
6922
  width: size,
6937
6923
  height: size,
6938
- borderRadius: "9999px",
6939
- backgroundColor,
6940
- color: "#fff",
6941
- fontWeight: 600,
6942
- fontSize: "0.75em",
6943
- lineHeight: 1,
6944
- textTransform: "uppercase",
6945
- userSelect: "none",
6946
- flexShrink: 0,
6947
- overflow: "hidden"
6924
+ fontSize: "0.6875rem",
6925
+ letterSpacing: "0.02em",
6926
+ lineHeight: 1
6948
6927
  },
6949
- children: initials
6928
+ children: getInitials(text)
6950
6929
  }
6951
6930
  );
6952
6931
  };
package/dist/server.mjs CHANGED
@@ -751,72 +751,51 @@ var Commentrenderer_default = CommentRenderer;
751
751
  // src/components/controls/view/AvatarView.tsx
752
752
  import { jsx as jsx21 } from "react/jsx-runtime";
753
753
  var AVATAR_COLORS = [
754
- "#1abc9c",
755
- "#2ecc71",
756
- "#3498db",
757
- "#9b59b6",
758
- "#e67e22",
759
- "#e74c3c",
760
- "#16a085",
761
- "#27ae60",
762
- "#2980b9",
763
- "#8e44ad",
764
- "#f39c12",
765
- "#d35400",
766
- "#c0392b",
767
- "#7f8c8d",
768
- "#2c3e50"
754
+ "bg-error-strong",
755
+ "bg-accent-base",
756
+ "bg-warning-base",
757
+ "bg-success-base",
758
+ "bg-info-base",
759
+ "bg-primary-base",
760
+ "bg-secondary-base"
769
761
  ];
770
- var hashString = (text) => {
762
+ var getAvatarColor = (text) => {
771
763
  let hash = 0;
772
764
  for (let i = 0; i < text.length; i += 1) {
773
- hash = (hash << 5) - hash + text.charCodeAt(i);
774
- hash |= 0;
765
+ hash = hash * 31 + text.charCodeAt(i) >>> 0;
775
766
  }
776
- return Math.abs(hash);
767
+ return AVATAR_COLORS[hash % AVATAR_COLORS.length];
777
768
  };
778
769
  var getInitials = (text) => {
779
770
  const words = text.trim().split(/\s+/).filter(Boolean);
780
771
  if (words.length === 0) {
781
- return "";
772
+ return "?";
782
773
  }
783
774
  if (words.length === 1) {
784
775
  return words[0].slice(0, 2).toUpperCase();
785
776
  }
786
- return (words[0][0] + words[words.length - 1][0]).toUpperCase();
777
+ return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
787
778
  };
788
779
  var AvatarView = (props) => {
789
780
  const text = props.value === null || props.value === void 0 ? "" : String(props.value).trim();
790
781
  if (!text) {
791
782
  return null;
792
783
  }
793
- const initials = getInitials(text);
794
- const backgroundColor = AVATAR_COLORS[hashString(text) % AVATAR_COLORS.length];
795
- const size = props.width ?? "2rem";
784
+ const size = props.width ?? "1.75rem";
796
785
  return /* @__PURE__ */ jsx21(
797
786
  "span",
798
787
  {
799
- className: "avatar-view",
788
+ className: `avatar-view inline-flex flex-shrink-0 items-center justify-center rounded-full font-semibold uppercase select-none overflow-hidden ${getAvatarColor(text)}`,
800
789
  title: text,
801
790
  "aria-label": text,
802
791
  style: {
803
- display: "inline-flex",
804
- alignItems: "center",
805
- justifyContent: "center",
806
792
  width: size,
807
793
  height: size,
808
- borderRadius: "9999px",
809
- backgroundColor,
810
- color: "#fff",
811
- fontWeight: 600,
812
- fontSize: "0.75em",
813
- lineHeight: 1,
814
- textTransform: "uppercase",
815
- userSelect: "none",
816
- flexShrink: 0,
817
- overflow: "hidden"
794
+ fontSize: "0.6875rem",
795
+ letterSpacing: "0.02em",
796
+ lineHeight: 1
818
797
  },
819
- children: initials
798
+ children: getInitials(text)
820
799
  }
821
800
  );
822
801
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clyrex-digital/clyrex-controls-dev",
3
- "version": "0.8.1-dev.20260829085511",
3
+ "version": "0.8.1-dev.20260829103736",
4
4
  "description": "Reusable React components",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",