@carbonorm/carbonreact 3.0.6 → 3.0.8

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/README.md CHANGED
@@ -8,3 +8,8 @@ The Carbon Node is currently under development and is not yet ready for use.
8
8
 
9
9
  ## Links
10
10
  https://saturncloud.io/blog/whats-the-difference-between-dependencies-devdependencies-and-peerdependencies-in-npm-packagejson-file/
11
+
12
+ ## @notes
13
+ https://fontawesome.com/v4/icons/
14
+
15
+
@@ -1,9 +1,9 @@
1
+ import { PropsWithChildren } from "react";
1
2
  interface iPopupProperties {
2
3
  open?: boolean;
3
4
  handleClose: () => any;
4
- children: any;
5
5
  minWidth?: string;
6
6
  maxWidth?: string;
7
7
  }
8
- export default function Popup({ open, handleClose, children, maxWidth, }: iPopupProperties): import("react/jsx-runtime").JSX.Element | null;
8
+ export default function Popup({ open, handleClose, children, maxWidth, }: PropsWithChildren<iPopupProperties>): import("react/jsx-runtime").JSX.Element | null;
9
9
  export {};
@@ -0,0 +1,2 @@
1
+ import { AxiosResponse } from "axios";
2
+ export default function setCookies(cookies: string[], req?: AxiosResponse | undefined): void;
package/dist/index.cjs.js CHANGED
@@ -3946,10 +3946,11 @@ function getStyles(overrides) {
3946
3946
  function Popup(_a) {
3947
3947
  var _b = _a.open, open = _b === void 0 ? true : _b, handleClose = _a.handleClose, children = _a.children, maxWidth = _a.maxWidth;
3948
3948
  if (false === open) {
3949
+ // @link https://legacy.reactjs.org/docs/conditional-rendering.html#preventing-component-from-rendering
3949
3950
  return null;
3950
3951
  }
3951
3952
  var dig = getStyles();
3952
- return jsxRuntime_1(jsxRuntime_3, { children: jsxRuntime_1("div", { className: classNames(dig.modal, dig.fade, dig.show, dig.dBlock), style: { backgroundColor: "rgba(0,0,0,0.8)" }, id: "exampleModalCenter", tabIndex: -1, "aria-labelledby": "exampleModalCenterTitle", "aria-modal": "true", role: "dialog", children: jsxRuntime_1("div", { style: { maxWidth: maxWidth }, className: classNames(dig.modalDialog, dig.modalDialogCentered), children: jsxRuntime_1(OutsideClickHandler, { onOutsideClick: function () { return handleClose(); }, children: jsxRuntime_1("div", { className: classNames(dig.modalContent, dig.bgTransparent, dig.modalDialogScrollable), children: children }) }) }) }) });
3953
+ return jsxRuntime_1("div", { className: classNames(dig.modal, dig.fade, dig.show, dig.dBlock), style: { backgroundColor: "rgba(0,0,0,0.8)" }, id: "exampleModalCenter", tabIndex: -1, "aria-labelledby": "exampleModalCenterTitle", "aria-modal": "true", role: "dialog", children: jsxRuntime_1("div", { style: { maxWidth: maxWidth }, className: classNames(dig.modalDialog, dig.modalDialogCentered), children: jsxRuntime_1(OutsideClickHandler, { onOutsideClick: function () { return handleClose(); }, children: jsxRuntime_1("div", { className: classNames(dig.modalContent, dig.bgTransparent, dig.modalDialogScrollable), children: children }) }) }) });
3953
3954
  }
3954
3955
 
3955
3956
  var isProduction = window.location.host.split(".")[0] === "www";
@@ -4185,6 +4186,27 @@ function ScrollIntoViewDirective(el) {
4185
4186
  el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: 'auto', block: 'nearest' });
4186
4187
  }
4187
4188
 
4189
+ function setCookies(cookies, req) {
4190
+ if (req === void 0) { req = undefined; }
4191
+ console.log("Setting cookies", cookies);
4192
+ cookies.map(function (cookie) {
4193
+ var newCookie = cookie
4194
+ .replace("HttpOnly", "")
4195
+ .replace("secure", "");
4196
+ if (document === undefined || document === null) {
4197
+ var getStackTrace_1 = function () {
4198
+ var obj = {};
4199
+ Error.captureStackTrace(obj, getStackTrace_1);
4200
+ return obj.stack;
4201
+ };
4202
+ console.error(req);
4203
+ console.log('Testing error, document not defined', req);
4204
+ throw new Error("Document is undefined while trying to set cookie: (" + newCookie + ") in axiosInterceptors.tsx after (" + JSON.stringify([req === null || req === void 0 ? void 0 : req.config, req === null || req === void 0 ? void 0 : req.data], undefined, 4) + ") Please make sure all requests are wrapped in an act() from import {act} from '@testing-library/react'; (" + JSON.stringify(getStackTrace_1(), undefined, 4) + ")");
4205
+ }
4206
+ document.cookie = newCookie;
4207
+ });
4208
+ }
4209
+
4188
4210
  // @link https://www.benmvp.com/blog/mocking-window-location-methods-jest-jsdom/
4189
4211
  function setUrl(host, https) {
4190
4212
  if (host === void 0) { host = 'www.example.com'; }
@@ -4450,6 +4472,7 @@ exports.photos = photos;
4450
4472
  exports.range = range;
4451
4473
  exports.reports = reports;
4452
4474
  exports.scrollIntoView = ScrollIntoViewDirective;
4475
+ exports.setCookies = setCookies;
4453
4476
  exports.setUrl = setUrl;
4454
4477
  exports.toDataURL = toDataURL;
4455
4478
  exports.updateRestfulObjectArrays = updateRestfulObjectArrays;