opus-toolkit-components 1.4.9 → 1.5.2

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.
@@ -573,7 +573,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, ``, "",{"version":3,"sources":[],"names
573
573
 
574
574
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
575
575
  // Module
576
- ___CSS_LOADER_EXPORT___.push([module.id, `.navbar .nav-logo{max-height:40px}`, "",{"version":3,"sources":["webpack://./src/components/Navbar/navbar.scss"],"names":[],"mappings":"AACI,kBACI,eAAA","sourcesContent":[".navbar {\r\n .nav-logo {\r\n max-height: 40px;\r\n }\r\n}"],"sourceRoot":""}]);
576
+ ___CSS_LOADER_EXPORT___.push([module.id, `.navbar .nav-logo{height:40px;width:auto}`, "",{"version":3,"sources":["webpack://./src/components/Navbar/navbar.scss"],"names":[],"mappings":"AACI,kBACI,WAAA,CACA,UAAA","sourcesContent":[".navbar {\r\n .nav-logo {\r\n height: 40px;\r\n width: auto;\r\n }\r\n}"],"sourceRoot":""}]);
577
577
  // Exports
578
578
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
579
579
 
@@ -802,50 +802,51 @@ const getDataCy = function () {
802
802
  return name || '';
803
803
  };
804
804
  ;// ./src/components/Text/Text.jsx
805
- const _excluded = ["variant", "as", "className", "children", "name", "dataCy"];
805
+ const _excluded = ["variant", "as", "className", "color", "children", "name", "dataCy"];
806
806
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
807
807
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
808
808
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
809
809
 
810
810
 
811
811
  const variantMap = {
812
- h1: 'text-4xl font-bold leading-tight text-[--color-text-strong]',
813
- h2: 'text-3xl leading-snug text-[--color-text-strong]',
814
- h3: 'text-2xl font-semibold leading-snug text-[--color-text-strong]',
815
- h4: 'text-xl font-medium text-[--color-text-strong]',
816
- h5: 'text-lg font-medium text-[--color-text-strong]',
817
- h6: 'text-base font-medium text-[--color-text-strong]',
818
- body: 'text-base text-[--color-text-strong]',
819
- small: 'text-sm text-[--color-text-strong]',
820
- caption: 'text-xs text-[--color-text-strong]',
821
- label: 'text-md text-[--color-text-weak]'
812
+ h1: "text-4xl font-bold leading-tight",
813
+ h2: "text-3xl leading-snug",
814
+ h3: "text-2xl font-semibold leading-snug",
815
+ h4: "text-xl font-medium",
816
+ h5: "text-lg font-medium",
817
+ h6: "text-base font-medium",
818
+ body: "text-base",
819
+ small: "text-sm",
820
+ caption: "text-xs",
821
+ label: "text-md"
822
822
  };
823
823
  const elementMap = {
824
- h1: 'h1',
825
- h2: 'h2',
826
- h3: 'h3',
827
- h4: 'h4',
828
- h5: 'h5',
829
- h6: 'h6',
830
- body: 'p',
831
- small: 'small',
832
- caption: 'span',
833
- label: 'label'
824
+ h1: "h1",
825
+ h2: "h2",
826
+ h3: "h3",
827
+ h4: "h4",
828
+ h5: "h5",
829
+ h6: "h6",
830
+ body: "p",
831
+ small: "small",
832
+ caption: "span",
833
+ label: "label"
834
834
  };
835
835
  function Text(_ref) {
836
836
  let {
837
- variant = 'body',
837
+ variant = "body",
838
838
  as,
839
- className = '',
839
+ className = "",
840
+ color = "text-[--color-text-strong]",
840
841
  children,
841
842
  name,
842
843
  dataCy
843
844
  } = _ref,
844
845
  rest = _objectWithoutProperties(_ref, _excluded);
845
- const Component = as || elementMap[variant] || 'p';
846
+ const Component = as || elementMap[variant] || "p";
846
847
  const variantClass = variantMap[variant] || variantMap.body;
847
848
  return /*#__PURE__*/external_react_default().createElement(Component, _extends({
848
- className: "".concat(variantClass, " ").concat(className),
849
+ className: "".concat(variantClass, " ").concat(color, " ").concat(className),
849
850
  "data-cy": getDataCy({
850
851
  name,
851
852
  dataCy
@@ -4121,24 +4122,24 @@ const RadioButton = _ref => {
4121
4122
  let {
4122
4123
  label,
4123
4124
  options = [{
4124
- value: 'single',
4125
- label: 'Single'
4125
+ value: "single",
4126
+ label: "Single"
4126
4127
  }, {
4127
- value: 'married',
4128
- label: 'Married / Living with Partner'
4128
+ value: "married",
4129
+ label: "Married / Living with Partner"
4129
4130
  }, {
4130
- value: 'divorced',
4131
- label: 'Divorced'
4131
+ value: "divorced",
4132
+ label: "Divorced"
4132
4133
  }, {
4133
- value: 'other',
4134
- label: 'Other'
4134
+ value: "other",
4135
+ label: "Other"
4135
4136
  }],
4136
4137
  name,
4137
4138
  value,
4138
4139
  onChange,
4139
- className = '',
4140
- tabIndex = '',
4141
- title = '',
4140
+ className = "",
4141
+ tabIndex = "",
4142
+ title = "",
4142
4143
  isValid = true,
4143
4144
  errorMessage = "".concat(label, " is required"),
4144
4145
  required = false,
@@ -4157,15 +4158,15 @@ const RadioButton = _ref => {
4157
4158
  onChange === null || onChange === void 0 || onChange(event);
4158
4159
  };
4159
4160
  return /*#__PURE__*/external_react_default().createElement("div", {
4160
- className: "flex flex-col mb-4 ".concat(className)
4161
+ className: "mb-4 flex flex-col ".concat(className)
4161
4162
  }, /*#__PURE__*/external_react_default().createElement(Text, {
4162
4163
  as: "label",
4163
4164
  variant: "label",
4164
- className: "text-[--color-text-strong] mb-2 flex items-center"
4165
+ className: "mb-2 flex items-center text-[--color-text-strong]"
4165
4166
  }, label, required && /*#__PURE__*/external_react_default().createElement(Text, {
4166
4167
  as: "span",
4167
4168
  variant: "small",
4168
- className: "text-[--color-util-red] ml-1"
4169
+ className: "ml-1 text-[--color-util-red]"
4169
4170
  }, "*")), /*#__PURE__*/external_react_default().createElement("div", {
4170
4171
  className: "flex flex-wrap gap-4 md:flex-nowrap md:gap-0 md:space-x-4"
4171
4172
  }, options.map(option => {
@@ -4173,7 +4174,7 @@ const RadioButton = _ref => {
4173
4174
  return /*#__PURE__*/external_react_default().createElement("label", {
4174
4175
  key: option.value,
4175
4176
  htmlFor: id,
4176
- className: "py-2 px-4 mb-1 text-center whitespace-break-spaces border hover:border-[--color-primary-btn] rounded-lg transition duration-200 flex items-center ".concat(selectedValue === option.value ? 'bg-[--color-primary-btn] text-[--color-white] border-[--color-stroke]' : "bg-[--color-input-bg] text-[--color-text-strong] ".concat(!isValid && selectedValue === '' ? 'border-[--color-util-red]' : 'border-[--color-stroke]'), " ").concat(disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer')
4177
+ className: "mb-1 flex items-center whitespace-break-spaces rounded-lg border px-4 py-2 text-center transition duration-200 hover:border-[--color-primary-btn] ".concat(selectedValue === option.value ? "border-[--color-stroke] bg-[--color-primary-btn] text-[--color-white]" : "bg-[--color-input-bg] text-[--color-text-strong] ".concat(!isValid && selectedValue === "" ? "border-[--color-util-red]" : "border-[--color-stroke]"), " ").concat(disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer")
4177
4178
  }, /*#__PURE__*/external_react_default().createElement("input", {
4178
4179
  id: id,
4179
4180
  type: "radio",
@@ -4199,7 +4200,7 @@ const RadioButton = _ref => {
4199
4200
  className: "text-[--color-util-red]"
4200
4201
  }, errorMessage));
4201
4202
  };
4202
- RadioButton.displayName = 'RadioButton';
4203
+ RadioButton.displayName = "RadioButton";
4203
4204
  /* harmony default export */ const Radios_RadioButton = (RadioButton);
4204
4205
  ;// ./src/components/Forms/Checkbox/Checkbox.jsx
4205
4206
 
@@ -12989,31 +12990,38 @@ var navbar_update = injectStylesIntoStyleTag_default()(navbar/* default */.A, na
12989
12990
 
12990
12991
  /* harmony default export */ const Navbar_navbar = (navbar/* default */.A && navbar/* default */.A.locals ? navbar/* default */.A.locals : undefined);
12991
12992
 
12992
- ;// external "opus-toolkit-styles/assets/logos/c247-icon-only.svg"
12993
- const c247_icon_only_svg_namespaceObject = require("opus-toolkit-styles/assets/logos/c247-icon-only.svg");
12994
- var c247_icon_only_svg_default = /*#__PURE__*/__webpack_require__.n(c247_icon_only_svg_namespaceObject);
12993
+ ;// external "opus-toolkit-styles/assets/logos/c247-icon-only.png"
12994
+ const c247_icon_only_png_namespaceObject = require("opus-toolkit-styles/assets/logos/c247-icon-only.png");
12995
+ var c247_icon_only_png_default = /*#__PURE__*/__webpack_require__.n(c247_icon_only_png_namespaceObject);
12996
+ ;// external "opus-toolkit-styles/assets/logos/c247-icon-only-2x.png"
12997
+ const c247_icon_only_2x_png_namespaceObject = require("opus-toolkit-styles/assets/logos/c247-icon-only-2x.png");
12998
+ var c247_icon_only_2x_png_default = /*#__PURE__*/__webpack_require__.n(c247_icon_only_2x_png_namespaceObject);
12995
12999
  ;// ./src/components/Navbar/Navbar.jsx
12996
13000
 
12997
13001
 
12998
13002
 
13003
+ // Default logo variants
13004
+
13005
+
12999
13006
  const Navbar = _ref => {
13000
13007
  let {
13001
13008
  children,
13002
13009
  logo,
13003
- className = '',
13004
- maxWidth = '1200px'
13010
+ className = "",
13011
+ maxWidth = "1200px"
13005
13012
  } = _ref;
13006
13013
  return /*#__PURE__*/external_react_default().createElement("nav", {
13007
- className: "p-4 w-full bg-[--color-primary-bg] shadow-lg navbar ".concat(className)
13014
+ className: "navbar w-full bg-[--color-primary-bg] p-4 shadow-lg ".concat(className)
13008
13015
  }, /*#__PURE__*/external_react_default().createElement("div", {
13009
- className: "mx-auto flex items-center justify-between w-full",
13016
+ className: "mx-auto flex w-full items-center justify-between",
13010
13017
  style: {
13011
13018
  maxWidth
13012
13019
  }
13013
13020
  }, /*#__PURE__*/external_react_default().createElement("img", {
13014
- src: logo || (c247_icon_only_svg_default()),
13021
+ src: logo || (c247_icon_only_png_default()),
13022
+ srcSet: "".concat((c247_icon_only_png_default()), " 1x, ").concat((c247_icon_only_2x_png_default()), " 2x"),
13015
13023
  alt: "Navbar Logo",
13016
- className: "nav-logo"
13024
+ className: "nav-logo h-10 w-auto"
13017
13025
  }), /*#__PURE__*/external_react_default().createElement("div", {
13018
13026
  className: "right-content text-[--color-text-strong]"
13019
13027
  }, children)));
@@ -13143,23 +13151,27 @@ const Modal = _ref => {
13143
13151
  }, footer)));
13144
13152
  };
13145
13153
  /* harmony default export */ const Modals_Modal = (Modal);
13146
- ;// external "opus-toolkit-styles/assets/logos/footer-logos.svg"
13147
- const footer_logos_svg_namespaceObject = require("opus-toolkit-styles/assets/logos/footer-logos.svg");
13148
- var footer_logos_svg_default = /*#__PURE__*/__webpack_require__.n(footer_logos_svg_namespaceObject);
13154
+ ;// external "opus-toolkit-styles/assets/logos/footer-logo-group.png"
13155
+ const footer_logo_group_png_namespaceObject = require("opus-toolkit-styles/assets/logos/footer-logo-group.png");
13156
+ var footer_logo_group_png_default = /*#__PURE__*/__webpack_require__.n(footer_logo_group_png_namespaceObject);
13157
+ ;// external "opus-toolkit-styles/assets/logos/footer-logo-group-2x.png"
13158
+ const footer_logo_group_2x_png_namespaceObject = require("opus-toolkit-styles/assets/logos/footer-logo-group-2x.png");
13159
+ var footer_logo_group_2x_png_default = /*#__PURE__*/__webpack_require__.n(footer_logo_group_2x_png_namespaceObject);
13149
13160
  ;// ./src/components/Cookie/Cookie.jsx
13150
13161
 
13151
13162
 
13152
13163
 
13153
13164
 
13165
+
13154
13166
  const CookieBanner = _ref => {
13155
13167
  let {
13156
13168
  logo,
13157
- policyTxt = 'This website uses cookies to ensure you get the best experience on our site. By clicking Accept, you consent to the use of cookies.',
13158
- linkTxt = 'Learn More',
13169
+ policyTxt = "This website uses cookies to ensure you get the best experience on our site. By clicking Accept, you consent to the use of cookies.",
13170
+ linkTxt = "Learn More",
13159
13171
  isVisible = true,
13160
13172
  onAccept = () => {},
13161
13173
  onLearnMore = () => {},
13162
- intent = 'brandSecondary'
13174
+ intent = "brandSecondary"
13163
13175
  } = _ref;
13164
13176
  const [show, setShow] = (0,external_react_.useState)(false);
13165
13177
  const [render, setRender] = (0,external_react_.useState)(isVisible);
@@ -13184,13 +13196,14 @@ const CookieBanner = _ref => {
13184
13196
  if (!render) return null;
13185
13197
  return /*#__PURE__*/external_react_default().createElement(Card, {
13186
13198
  intent: intent,
13187
- className: "\n md:flex \n items-center \n justify-between \n p-4 space-x-4 \n transition-all duration-300 ease-in-out \n ".concat(show ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-3', "\n ")
13199
+ className: "items-center justify-between space-x-4 p-4 transition-all duration-300 ease-in-out md:flex ".concat(show ? "translate-y-0 opacity-100" : "translate-y-3 opacity-0", " ")
13188
13200
  }, /*#__PURE__*/external_react_default().createElement("div", {
13189
- className: "md:flex items-center"
13201
+ className: "items-center md:flex"
13190
13202
  }, /*#__PURE__*/external_react_default().createElement("div", {
13191
- className: "flex-shrink-0 mr-4"
13203
+ className: "flex-shrink-1 mr-4"
13192
13204
  }, /*#__PURE__*/external_react_default().createElement("img", {
13193
- src: logo || (footer_logos_svg_default()),
13205
+ src: logo || (footer_logo_group_png_default()),
13206
+ srcSet: "".concat((footer_logo_group_png_default()), " 1x, ").concat((footer_logo_group_2x_png_default()), " 2x"),
13194
13207
  alt: "C247 Logo",
13195
13208
  className: "w-full object-contain",
13196
13209
  onLoad: () => setImageLoaded(true)