@thecb/components 11.2.2-beta.0 → 11.2.3-beta.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.
package/dist/index.cjs.js CHANGED
@@ -6256,6 +6256,38 @@ var adjustHexColor = function adjustHexColor(hex, percent, action) {
6256
6256
  return "#".concat(((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).padStart(6, "0"));
6257
6257
  };
6258
6258
 
6259
+ /**
6260
+ * Converts a hex color code to an RGBA color string with the specified alpha value.
6261
+ *
6262
+ * @param {string} hex - The hex color code (e.g., "#3498db" or "3498db").
6263
+ * @param {number} alpha - The alpha value (opacity) between 0 and 1.
6264
+ * @returns {string} - The RGBA color string (e.g., "rgba(52, 152, 219, 0.5)").
6265
+ * @throws {Error} - Throws an error if the hex code is not a valid 3 or 6-digit hex color.
6266
+ */
6267
+ var hexToRGBA = function hexToRGBA(hex, alpha) {
6268
+ // Remove hash at the start if present
6269
+ hex = hex.replace(/^\s*#/, "");
6270
+
6271
+ // If hex is 3 characters, convert it to 6 characters.
6272
+ if (hex.length === 3) {
6273
+ hex = hex.split("").map(function (_char) {
6274
+ return _char + _char;
6275
+ }).join("");
6276
+ }
6277
+
6278
+ // Validate hex length
6279
+ if (hex.length !== 6) {
6280
+ throw new Error("Invalid hex color provided. Expected a 3 or 6-digit hex color.");
6281
+ }
6282
+
6283
+ // Parse the hex color components
6284
+ var bigint = parseInt(hex, 16);
6285
+ var r = bigint >> 16 & 255;
6286
+ var g = bigint >> 8 & 255;
6287
+ var b = bigint & 255;
6288
+ return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
6289
+ };
6290
+
6259
6291
  var general = /*#__PURE__*/Object.freeze({
6260
6292
  __proto__: null,
6261
6293
  noop: noop$1,
@@ -6277,7 +6309,8 @@ var general = /*#__PURE__*/Object.freeze({
6277
6309
  titleCaseString: titleCaseString,
6278
6310
  kebabCaseString: kebabCaseString,
6279
6311
  wrapIndex: wrapIndex,
6280
- adjustHexColor: adjustHexColor
6312
+ adjustHexColor: adjustHexColor,
6313
+ hexToRGBA: hexToRGBA
6281
6314
  });
6282
6315
 
6283
6316
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
@@ -16170,7 +16203,7 @@ var ExternalLinkIcon = function ExternalLinkIcon(_ref) {
16170
16203
  x: "-0.0864258",
16171
16204
  width: "14",
16172
16205
  height: "14",
16173
- fill: linkColor
16206
+ fill: "none"
16174
16207
  })));
16175
16208
  };
16176
16209
 
@@ -50088,11 +50121,13 @@ var fallbackValues$X = {
50088
50121
  var TabSidebar = function TabSidebar(_ref) {
50089
50122
  var links = _ref.links,
50090
50123
  isMobile = _ref.isMobile,
50091
- themeValues = _ref.themeValues;
50124
+ themeValues = _ref.themeValues,
50125
+ _ref$minHeight = _ref.minHeight,
50126
+ minHeight = _ref$minHeight === void 0 ? "100%" : _ref$minHeight;
50092
50127
  return /*#__PURE__*/React__default.createElement(Box, {
50093
50128
  padding: "0",
50094
50129
  background: COOL_GREY_05,
50095
- minHeight: "100%",
50130
+ minHeight: minHeight,
50096
50131
  role: "region",
50097
50132
  "aria-label": "Profile tabs",
50098
50133
  boxShadow: isMobile && "inset 0px -1px 0px 0px rgb(202, 206, 216)"
@@ -51279,6 +51314,116 @@ var MultipleSelectFilter = function MultipleSelectFilter(_ref) {
51279
51314
  };
51280
51315
  var MultipleSelectFilter$1 = themeComponent(MultipleSelectFilter, "MultipleSelectFilter", fallbackValues$$);
51281
51316
 
51317
+ var Container$1 = styled__default(Box).withConfig({
51318
+ displayName: "ContactCardstyled__Container",
51319
+ componentId: "sc-1v62a1n-0"
51320
+ })(["height:fit-content;display:flex;padding:1rem;flex-direction:column;align-items:flex-start;gap:1.5rem;border-radius:8px;"]);
51321
+ var Title$3 = styled__default(Heading$1).withConfig({
51322
+ displayName: "ContactCardstyled__Title",
51323
+ componentId: "sc-1v62a1n-1"
51324
+ })(["display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:stretch;overflow:hidden;text-overflow:ellipsis;background-color:transparent;font-weight:", ";"], FONT_WEIGHT_SEMIBOLD);
51325
+ var Content = styled__default(Box).withConfig({
51326
+ displayName: "ContactCardstyled__Content",
51327
+ componentId: "sc-1v62a1n-2"
51328
+ })(["padding:0;font-size:", ";line-height:1.313rem;overflow-wrap:normal;letter-spacing:0.14px;"], FONT_SIZE.SM);
51329
+ var Footer$1 = styled__default(Stack).withConfig({
51330
+ displayName: "ContactCardstyled__Footer",
51331
+ componentId: "sc-1v62a1n-3"
51332
+ })(["width:100%;"]);
51333
+ var Divider = styled__default(Box).withConfig({
51334
+ displayName: "ContactCardstyled__Divider",
51335
+ componentId: "sc-1v62a1n-4"
51336
+ })(["padding:0;height:1px;width:100%;"]);
51337
+
51338
+ var ContactCard = function ContactCard(_ref) {
51339
+ var title = _ref.title,
51340
+ _ref$secondTitle = _ref.secondTitle,
51341
+ secondTitle = _ref$secondTitle === void 0 ? "Helpful Links" : _ref$secondTitle,
51342
+ _ref$content = _ref.content,
51343
+ content = _ref$content === void 0 ? "" : _ref$content,
51344
+ _ref$links = _ref.links,
51345
+ links = _ref$links === void 0 ? [] : _ref$links,
51346
+ _ref$extraStyles = _ref.extraStyles,
51347
+ extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
51348
+ _ref$titleVariant = _ref.titleVariant,
51349
+ titleVariant = _ref$titleVariant === void 0 ? "h3" : _ref$titleVariant,
51350
+ _ref$ariaLabel = _ref.ariaLabel,
51351
+ ariaLabel = _ref$ariaLabel === void 0 ? "Contact Information" : _ref$ariaLabel,
51352
+ _ref$linkVariant = _ref.linkVariant,
51353
+ linkVariant = _ref$linkVariant === void 0 ? "primary" : _ref$linkVariant;
51354
+ var themeContext = React.useContext(styled.ThemeContext);
51355
+ var isMobile = themeContext.isMobile;
51356
+ var linkFallbackValues = {
51357
+ externalLinkColor: ROYAL_BLUE_VIVID
51358
+ };
51359
+ var linkThemeValues = createThemeValues(themeContext, linkFallbackValues, "Link", linkVariant);
51360
+ return /*#__PURE__*/React__default.createElement(Container$1, {
51361
+ borderRadius: "8px",
51362
+ boxShadow: "0px 2px 4px rgba(0, 0, 0, 0.25)",
51363
+ dataQa: createIdFromString(title, "contact-card"),
51364
+ maxWidth: isMobile ? "100%" : "208px",
51365
+ minWidth: isMobile ? "240px" : "208px",
51366
+ minHeight: "141px",
51367
+ padding: "1.5rem",
51368
+ extraStyles: extraStyles,
51369
+ role: "complementary",
51370
+ "aria-label": ariaLabel
51371
+ }, /*#__PURE__*/React__default.createElement(Stack, {
51372
+ childGap: "8px",
51373
+ bottomItem: 3,
51374
+ justify: "space-between",
51375
+ style: {
51376
+ width: "100%"
51377
+ },
51378
+ fullHeight: true
51379
+ }, /*#__PURE__*/React__default.createElement(Box, {
51380
+ padding: 0,
51381
+ width: "100%"
51382
+ }, /*#__PURE__*/React__default.createElement(Title$3, {
51383
+ variant: titleVariant,
51384
+ margin: 0,
51385
+ fontSize: FONT_SIZE.MD
51386
+ }, title)), /*#__PURE__*/React__default.createElement(Box, {
51387
+ padding: "0",
51388
+ width: "100%"
51389
+ }, /*#__PURE__*/React__default.createElement(Content, null, content))), links.length > 0 && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(SolidDivider$1, {
51390
+ "aria-hidden": true
51391
+ }), /*#__PURE__*/React__default.createElement(Stack, {
51392
+ childGap: "8px",
51393
+ bottomItem: 3,
51394
+ justify: "space-between",
51395
+ style: {
51396
+ width: "100%"
51397
+ },
51398
+ fullHeight: true
51399
+ }, /*#__PURE__*/React__default.createElement(Title$3, {
51400
+ variant: titleVariant,
51401
+ margin: 0,
51402
+ fontSize: FONT_SIZE.MD
51403
+ }, secondTitle), /*#__PURE__*/React__default.createElement(Stack, {
51404
+ childGap: "4px",
51405
+ justify: "space-between",
51406
+ style: {
51407
+ width: "100%"
51408
+ },
51409
+ fullHeight: true
51410
+ }, links.map(function (link) {
51411
+ var linkID = createIdFromString(link.text, "contact-card-link");
51412
+ return /*#__PURE__*/React__default.createElement(ExternalLink, {
51413
+ key: linkID,
51414
+ dataQa: linkID,
51415
+ href: link.link,
51416
+ newTab: true,
51417
+ extraStyles: "\n flex-direction: row;\n align-items: center;\n align-content: flex-start;\n justify-content: space-between;\n ",
51418
+ size: FONT_SIZE.SM,
51419
+ lineHeight: "1.313rem"
51420
+ }, link.text, /*#__PURE__*/React__default.createElement(ExternalLinkIcon, {
51421
+ linkColor: linkThemeValues.externalLinkColor,
51422
+ text: link.text
51423
+ }));
51424
+ })))));
51425
+ };
51426
+
51282
51427
  var pageBackground = "#FBFCFD";
51283
51428
  var fallbackValues$10 = {
51284
51429
  pageBackground: pageBackground
@@ -51663,6 +51808,7 @@ exports.ChevronIcon = ChevronIcon$1;
51663
51808
  exports.CloseIcon = CloseIcon;
51664
51809
  exports.Cluster = Cluster;
51665
51810
  exports.CollapsibleSection = CollapsibleSection$1;
51811
+ exports.ContactCard = ContactCard;
51666
51812
  exports.Copyable = Copyable;
51667
51813
  exports.CountryDropdown = CountryDropdown;
51668
51814
  exports.Cover = Cover;