oolib 2.152.0 → 2.153.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.
@@ -1,10 +1,11 @@
1
1
  import React from "react";
2
+ import { To } from 'react-router-dom';
2
3
  export type IconColor = 'red' | 'green' | 'yellow' | 'dark' | 'grey';
3
4
  export interface DisplayIconProps {
4
5
  color: IconColor;
5
6
  }
6
7
  export interface BannerCTA {
7
- to?: string;
8
+ to?: To;
8
9
  action?: () => void;
9
10
  text: string;
10
11
  }
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
14
  if (k2 === undefined) k2 = k;
4
15
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -85,7 +96,7 @@ var Banner = function (_a) {
85
96
  };
86
97
  var genCTA = function (cta) {
87
98
  var LinkWrapper = cta.to ? react_router_dom_1.Link : react_1.Fragment;
88
- return (react_1.default.createElement(LinkWrapper, { to: cta.to },
99
+ return (react_1.default.createElement(LinkWrapper, __assign({}, (cta.to ? { to: cta.to } : {})),
89
100
  react_1.default.createElement(Buttons_1.ButtonSecondary, { style: { marginTop: "0.5rem", marginBottom: "0.5rem" }, S: true, onClick: !cta.to && cta.action, invert: color === "dark" }, cta === null || cta === void 0 ? void 0 : cta.text)));
90
101
  };
91
102
  return (react_1.default.createElement(styled_1.BannerAnimateStyled, { key: id, ref: ContainerRef, height: height },
@@ -1,3 +1,6 @@
1
+ /// <reference types="react" />
1
2
  declare const StyledBreadcrumbs: import("styled-components").StyledComponent<"div", any, {}, never>;
2
- declare const StyledLinkCrumb: import("styled-components").StyledComponent<any, any, any, any>;
3
+ declare const StyledLinkCrumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react-router-dom").LinkProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {
4
+ invert: boolean;
5
+ }, never>;
3
6
  export { StyledBreadcrumbs, StyledLinkCrumb };
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { To } from "react-router-dom";
2
3
  export interface DisplayIconProps {
3
4
  icon: string;
4
5
  size: number;
@@ -8,7 +9,7 @@ export interface DisplayIconProps {
8
9
  export interface ButtonProps {
9
10
  id?: string;
10
11
  link?: {
11
- val: string;
12
+ val: To;
12
13
  displayText?: string;
13
14
  };
14
15
  children?: React.ReactNode;
@@ -48,7 +48,7 @@ var HomeCover = function (_a) {
48
48
  var title = _a.title, subtitle = _a.subtitle, desc = _a.desc, CTALink = _a.CTALink, customComp = _a.customComp, coverImagesConfig = _a.coverImagesConfig, _b = _a.variant, variant = _b === void 0 ? "default" : _b;
49
49
  var screenWidth = (0, useScreenWidth_1.useScreenWidth)();
50
50
  var isDesktop = screenWidth > (0, mixins_1.getBreakPoint)("md");
51
- var history = (0, react_router_dom_1.useHistory)();
51
+ var navigate = (0, react_router_dom_1.useNavigate)();
52
52
  // const {deployment: {_CoverImages : coverImagesConfig}} = useGetQueryData('platformConfigs');
53
53
  //backwards compat
54
54
  var _CoverImages = coverImagesConfig.every(function (c) { return typeof c === "string"; })
@@ -132,7 +132,7 @@ var HomeCover = function (_a) {
132
132
  var genCTALink = function (_a) {
133
133
  var CTALink = _a.CTALink, variant = _a.variant, isDesktop = _a.isDesktop;
134
134
  return CTALink && (react_1.default.createElement(Buttons_1.ButtonPrimary, { className: "HomeCover__cta", icon: "CaretRight", M: variant === "small" && !isDesktop && true, style: __assign({ position: "absolute", bottom: 0, borderRadius: 0, right: variant === "small" && !isDesktop ? "2rem" : 0 }, (variant === "small" && !isDesktop ? { zIndex: 100 } : {})), onClick: function () {
135
- history.push(CTALink);
135
+ navigate(CTALink);
136
136
  } }));
137
137
  };
138
138
  var TitleTypoComp = variant === "small" ? Typo_1.SERIF_8_9 : Typo_1.SERIF_9_10;
@@ -1,8 +1,9 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import { To } from 'react-router-dom';
2
3
  import { DisplayIconProps } from '../../utils/comps/DisplayIcon';
3
4
  import { icons } from '../../icons';
4
5
  export interface OKELinkProps {
5
- to?: string;
6
+ to?: To;
6
7
  link?: string;
7
8
  onClick?: (e: React.MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;
8
9
  icon?: keyof typeof icons;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { SIZES } from "../styled";
2
- export declare const StyledLink: import("styled-components").StyledComponent<any, any, any, any>;
3
+ export declare const StyledLink: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("react-router-dom").NavLinkProps & import("react").RefAttributes<HTMLAnchorElement>>, any, {}, never>;
3
4
  export interface TagLinkStyleProps {
4
5
  variant: 'primary' | 'secondary';
5
6
  invert?: boolean;
@@ -28,5 +28,5 @@ exports.SERIF_8_9_STYLED = styled_components_1.default.h2(templateObject_15 || (
28
28
  exports.SERIF_9_10_STYLED = styled_components_1.default.h1(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), index_1.typo.SERIF_9_10);
29
29
  exports.LABEL_STYLED = styled_components_1.default.h6(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), index_1.typo.LABEL);
30
30
  exports.BLOCKQUOTE_STYLED = styled_components_1.default.h3(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), index_1.typo.BLOCKQUOTE);
31
- exports.TYPOCLASSES = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n .SANS_0 {\n ", "\n }\n\n .SANS_2 {\n ", "\n }\n\n .SANS_3 {\n ", "\n }\n\n .SANS_4 {\n ", "\n }\n\n .SERIF_3 {\n ", "\n }\n\n .SANS_4_5 {\n ", "\n }\n\n .SANS_5_6 {\n ", "\n }\n\n .SERIF_3_4 {\n ", "\n }\n\n .SERIF_4_5 {\n ", "\n }\n\n .SERIF_5_6 {\n ", "\n }\n\n .SERIF_6_7 {\n ", "\n }\n\n .SERIF_7_8 {\n ", "\n }\n\n .SERIF_8_9 {\n ", "\n }\n\n .SERIF_9_10 {\n ", "\n }\n\n .LABEL {\n ", "\n }\n\n .SANS_7_8 {\n ", "\n }\n\n .BLOCKQUOTE {\n ", "\n }\n\n .OKE-markdown {\n a,\n p {\n ", "\n }\n }\n"], ["\n .SANS_0 {\n ", "\n }\n\n .SANS_2 {\n ", "\n }\n\n .SANS_3 {\n ", "\n }\n\n .SANS_4 {\n ", "\n }\n\n .SERIF_3 {\n ", "\n }\n\n .SANS_4_5 {\n ", "\n }\n\n .SANS_5_6 {\n ", "\n }\n\n .SERIF_3_4 {\n ", "\n }\n\n .SERIF_4_5 {\n ", "\n }\n\n .SERIF_5_6 {\n ", "\n }\n\n .SERIF_6_7 {\n ", "\n }\n\n .SERIF_7_8 {\n ", "\n }\n\n .SERIF_8_9 {\n ", "\n }\n\n .SERIF_9_10 {\n ", "\n }\n\n .LABEL {\n ", "\n }\n\n .SANS_7_8 {\n ", "\n }\n\n .BLOCKQUOTE {\n ", "\n }\n\n .OKE-markdown {\n a,\n p {\n ", "\n }\n }\n"])), index_1.typo.SANS_0, index_1.typo.SANS_2, index_1.typo.SANS_3, index_1.typo.SANS_4, index_1.typo.SERIF_3, index_1.typo.SANS_4_5, index_1.typo.SANS_5_6, index_1.typo.SERIF_3_4, index_1.typo.SERIF_4_5, index_1.typo.SERIF_5_6, index_1.typo.SERIF_6_7, index_1.typo.SERIF_7_8, index_1.typo.SERIF_8_9, index_1.typo.SERIF_9_10, index_1.typo.LABEL, index_1.typo.SANS_7_8, index_1.typo.BLOCKQUOTE, index_1.typo.SANS_3);
31
+ exports.TYPOCLASSES = styled_components_1.default.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n .SANS_0 {\n ", "\n }\n\n .SANS_2 {\n ", "\n }\n\n .SANS_3 {\n ", "\n }\n\n .SANS_4 {\n ", "\n }\n\n .SERIF_3 {\n ", "\n }\n\n .SANS_4_5 {\n ", "\n }\n\n .SANS_5_6 {\n ", "\n }\n\n .SERIF_3_4 {\n ", "\n }\n\n .SERIF_4_5 {\n ", "\n }\n\n .SERIF_5_6 {\n ", "\n }\n\n .SERIF_6_7 {\n ", "\n }\n\n .SERIF_7_8 {\n ", "\n }\n\n .SERIF_8_9 {\n ", "\n }\n\n .SERIF_9_10 {\n ", "\n }\n\n .LABEL {\n ", "\n }\n\n .SANS_7_8 {\n ", "\n }\n\n .BLOCKQUOTE {\n ", "\n }\n\n"], ["\n .SANS_0 {\n ", "\n }\n\n .SANS_2 {\n ", "\n }\n\n .SANS_3 {\n ", "\n }\n\n .SANS_4 {\n ", "\n }\n\n .SERIF_3 {\n ", "\n }\n\n .SANS_4_5 {\n ", "\n }\n\n .SANS_5_6 {\n ", "\n }\n\n .SERIF_3_4 {\n ", "\n }\n\n .SERIF_4_5 {\n ", "\n }\n\n .SERIF_5_6 {\n ", "\n }\n\n .SERIF_6_7 {\n ", "\n }\n\n .SERIF_7_8 {\n ", "\n }\n\n .SERIF_8_9 {\n ", "\n }\n\n .SERIF_9_10 {\n ", "\n }\n\n .LABEL {\n ", "\n }\n\n .SANS_7_8 {\n ", "\n }\n\n .BLOCKQUOTE {\n ", "\n }\n\n"])), index_1.typo.SANS_0, index_1.typo.SANS_2, index_1.typo.SANS_3, index_1.typo.SANS_4, index_1.typo.SERIF_3, index_1.typo.SANS_4_5, index_1.typo.SANS_5_6, index_1.typo.SERIF_3_4, index_1.typo.SERIF_4_5, index_1.typo.SERIF_5_6, index_1.typo.SERIF_6_7, index_1.typo.SERIF_7_8, index_1.typo.SERIF_8_9, index_1.typo.SERIF_9_10, index_1.typo.LABEL, index_1.typo.SANS_7_8, index_1.typo.BLOCKQUOTE);
32
32
  var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19;
@@ -2,7 +2,9 @@ export function decideLinkCompAndTarget({ to, openInNewTab }: {
2
2
  to: any;
3
3
  openInNewTab: any;
4
4
  }): {
5
- LinkComp: any;
5
+ LinkComp: string | import("react").ExoticComponent<{
6
+ children?: import("react").ReactNode;
7
+ }>;
6
8
  target: string;
7
9
  externalUrl: boolean;
8
10
  };
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { To } from "react-router-dom";
2
3
  export interface DisplayIconProps {
3
4
  icon: string;
4
5
  size: number;
@@ -8,7 +9,7 @@ export interface DisplayIconProps {
8
9
  export interface ButtonProps {
9
10
  id?: string;
10
11
  link?: {
11
- val: string;
12
+ val: To;
12
13
  displayText?: string;
13
14
  };
14
15
  children?: React.ReactNode;
@@ -1,8 +1,9 @@
1
1
  import React, { FunctionComponent } from 'react';
2
+ import { To } from 'react-router-dom';
2
3
  import { DisplayIconProps } from '../../../utils/comps/DisplayIcon';
3
4
  import { icons } from '../../../icons';
4
5
  export interface OKELinkProps {
5
- to?: string;
6
+ to?: To;
6
7
  link?: string;
7
8
  onClick?: (e: React.MouseEvent<HTMLSpanElement | HTMLAnchorElement>) => void;
8
9
  icon?: keyof typeof icons;
@@ -2,7 +2,9 @@ export function decideLinkCompAndTarget({ to, openInNewTab }: {
2
2
  to: any;
3
3
  openInNewTab: any;
4
4
  }): {
5
- LinkComp: any;
5
+ LinkComp: string | import("react").ExoticComponent<{
6
+ children?: import("react").ReactNode;
7
+ }>;
6
8
  target: string;
7
9
  externalUrl: boolean;
8
10
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.152.0",
3
+ "version": "2.153.0",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -65,7 +65,7 @@
65
65
  "react": "^17.0.2",
66
66
  "react-dom": "^17.0.2",
67
67
  "react-json-view": "^1.21.3",
68
- "react-router-dom": "^5.1.2",
68
+ "react-router-dom": "^6.28.0",
69
69
  "semantic-release": "^18.0.0",
70
70
  "storybook": "^7.2.1",
71
71
  "typescript": "^5.4.3"
@@ -73,7 +73,7 @@
73
73
  "peerDependencies": {
74
74
  "react": "^17.0.2",
75
75
  "react-dom": "^17.0.2",
76
- "react-router-dom": "^5.1.2",
76
+ "react-router-dom": "^6.28.0",
77
77
  "styled-components": "^5.3.3"
78
78
  },
79
79
  "config": {