@simplybusiness/mobius 5.31.8 → 5.32.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 5.32.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 041546c: Add new Trustpilot variant
8
+
9
+ ## 5.31.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 3964fcb: Allow alert atom to receive any variant string, using default info
14
+
3
15
  ## 5.31.8
4
16
 
5
17
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -1892,17 +1892,22 @@ var import_icons4 = require("@simplybusiness/icons");
1892
1892
  var import_dedupe11 = __toESM(require("classnames/dedupe"));
1893
1893
  var import_react27 = require("react");
1894
1894
  var import_jsx_runtime14 = require("react/jsx-runtime");
1895
+ function isAlertVariant(value) {
1896
+ return value === "info" || value === "success" || value === "warning" || value === "error";
1897
+ }
1895
1898
  var Alert = (0, import_react27.forwardRef)(
1896
1899
  (props, ref) => {
1897
1900
  const {
1898
1901
  elementType: Element = "div",
1899
- variant = "info",
1902
+ variant: variantProp,
1900
1903
  show = true,
1901
1904
  header,
1902
1905
  children,
1903
1906
  ...otherProps
1904
1907
  } = props;
1905
1908
  if (!show) return null;
1909
+ const variant = variantProp && isAlertVariant(variantProp) ? variantProp : "info";
1910
+ const colorValue = variant === "success" ? `var(--color-valid)` : `var(--color-${variant})`;
1906
1911
  const classes = (0, import_dedupe11.default)(
1907
1912
  "mobius",
1908
1913
  "mobius-alert",
@@ -1925,7 +1930,7 @@ var Alert = (0, import_react27.forwardRef)(
1925
1930
  const iconClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__icon");
1926
1931
  const contentClasses = (0, import_dedupe11.default)("mobius", "mobius-alert__content");
1927
1932
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Element, { ref, role: "alert", ...otherProps, className: classes, children: [
1928
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { icon: icon[variant] }) }),
1933
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: iconClasses, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Icon, { icon: icon[variant], color: colorValue }) }),
1929
1934
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
1930
1935
  header && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: headerClasses, children: header }),
1931
1936
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: contentClasses, children })
@@ -4258,7 +4263,8 @@ var TRUSTPILOT_TEMPLATE_IDS = {
4258
4263
  "micro-combo": "5419b6ffb0d04a076446a9af",
4259
4264
  mini: "53aa8807dec7e10d38f59f32",
4260
4265
  carousel: "53aa8912dec7e10d38f59f36",
4261
- horizontal: "5406e65db0d04a09e042d5fc"
4266
+ horizontal: "5406e65db0d04a09e042d5fc",
4267
+ "micro-star": "5419b732fbfb950b10de65e5"
4262
4268
  };
4263
4269
  var TRUSTPILOT_WIDGET = {
4264
4270
  // Keys based on actual widget names
@@ -4291,6 +4297,13 @@ var TRUSTPILOT_WIDGET = {
4291
4297
  styles: {
4292
4298
  height: "28px"
4293
4299
  }
4300
+ },
4301
+ "micro-star": {
4302
+ templateId: TRUSTPILOT_TEMPLATE_IDS["micro-star"],
4303
+ className: "--is-variant-micro-star",
4304
+ styles: {
4305
+ height: "24px"
4306
+ }
4294
4307
  }
4295
4308
  };
4296
4309