oolib 2.18.0 → 2.18.1

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,7 +1,8 @@
1
- export function ActionMenu({ icon, invert, actions, align, iconSize }: {
1
+ export function ActionMenu({ icon, invert, actions, align, iconSize, ButtonComp: _ButtonComp }: {
2
2
  icon?: string;
3
3
  invert: any;
4
4
  actions: any;
5
5
  align?: string;
6
6
  iconSize?: string;
7
+ ButtonComp?: string;
7
8
  }): JSX.Element;
@@ -36,23 +36,24 @@ var __importStar = (this && this.__importStar) || function (mod) {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.ActionMenu = void 0;
38
38
  var react_1 = __importStar(require("react"));
39
- var Buttons_1 = require("../Buttons");
39
+ var ButtonComps = __importStar(require("../Buttons"));
40
40
  var Typo_1 = require("../Typo");
41
41
  var utils_1 = require("./utils");
42
42
  var styled_1 = require("./styled");
43
43
  var ActionMenu = function (_a) {
44
44
  var _b, _c;
45
45
  var _d = _a.icon, icon = _d === void 0 ? 'DotsThree' : _d, //most likely will never change
46
- invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f;
46
+ invert = _a.invert, actions = _a.actions, _e = _a.align, align = _e === void 0 ? 'right' : _e, _f = _a.iconSize, iconSize = _f === void 0 ? 'S' : _f, _g = _a.ButtonComp, _ButtonComp = _g === void 0 ? 'ButtonGhost' : _g;
47
47
  var actionMenuRef = (0, react_1.useRef)(null);
48
48
  var optionsWrapperRef = (0, react_1.useRef)(null);
49
- var _g = (0, react_1.useState)(false), showActions = _g[0], setShowActions = _g[1];
49
+ var _h = (0, react_1.useState)(false), showActions = _h[0], setShowActions = _h[1];
50
50
  (0, utils_1.useTrackFocus)(actionMenuRef, setShowActions);
51
51
  if (!actions || actions.length === 0)
52
52
  return null;
53
53
  var getOpsRect = function () { var _a; return (_a = optionsWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect(); };
54
+ var ButtonComp = ButtonComps[_ButtonComp];
54
55
  return (react_1.default.createElement(styled_1.StyledActionMenu, { ref: actionMenuRef },
55
- react_1.default.createElement(Buttons_1.ButtonGhost, { icon: icon, iconSize: iconSize, invert: invert, onClick: function (e) {
56
+ react_1.default.createElement(ButtonComp, { icon: icon, iconSize: iconSize, invert: invert, onClick: function (e) {
56
57
  e.stopPropagation();
57
58
  setShowActions(!showActions);
58
59
  }, active: showActions }),
@@ -22,7 +22,9 @@ var BlockLabel = function (props) {
22
22
  var errText = errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.map(function (er) { return (typeof er === "object" ? er.text : er); }).join(", ");
23
23
  //next 2 vars is for 'test link' usecase
24
24
  var errLink = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 ? undefined : errorMsgs[0].link;
25
- var errType = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 ? "danger" : errorMsgs[0].type || "danger";
25
+ var errType = (errorMsgs === null || errorMsgs === void 0 ? void 0 : errorMsgs.length) !== 1 //this first condition seems like a proper hack..
26
+ ? "danger"
27
+ : errorMsgs[0].type || "danger";
26
28
  return (shouldCompRender && (react_1.default.createElement(index_styled_1.StyledBlockLabel, { style: style, className: className },
27
29
  react_1.default.createElement("div", { style: { display: "flex", gap: "1rem" } },
28
30
  (label || inputOnlyLabel) && (react_1.default.createElement(Typo_1.SANS_3, { invert: invert, bold: true, capitalize: true }, label || inputOnlyLabel)),
@@ -1 +1,7 @@
1
- export function InlineAlert(props: any): JSX.Element;
1
+ export function InlineAlert({ text, link, type, style, invert }: {
2
+ text: any;
3
+ link: any;
4
+ type?: string;
5
+ style: any;
6
+ invert: any;
7
+ }): JSX.Element;
@@ -19,8 +19,8 @@ var react_1 = __importDefault(require("react"));
19
19
  var colors_1 = require("../../themes/colors");
20
20
  var utilsOolib_1 = require("../../utilsOolib");
21
21
  var red = colors_1.colors.red, white = colors_1.colors.white, green = colors_1.colors.green, black = colors_1.colors.black, darkGrey = colors_1.colors.darkGrey, greyColor100 = colors_1.colors.greyColor100;
22
- var InlineAlert = function (props) {
23
- var text = props.text, link = props.link, type = props.type, style = props.style, invert = props.invert;
22
+ var InlineAlert = function (_a) {
23
+ var text = _a.text, link = _a.link, _b = _a.type, type = _b === void 0 ? 'neutral' : _b, style = _a.style, invert = _a.invert;
24
24
  var localize = (0, utilsOolib_1.useLocale)();
25
25
  var typeColor = {
26
26
  success: green,
@@ -44,5 +44,5 @@ var LoaderDiv = function (_a) {
44
44
  var _b = (0, utils_1.getTypoAndLoaderDimensions)(size), TypoComp = _b.TypoComp, trackThickness = _b.trackThickness, diameter = _b.diameter;
45
45
  return (react_1.default.createElement(styled_1.StyledLoaderWrapper, { isBlock: isBlock },
46
46
  react_1.default.createElement(styled_1.StyledLoader, __assign({}, { diameter: diameter, trackThickness: trackThickness, invert: invert })),
47
- (text || ((theme === null || theme === void 0 ? void 0 : theme._Branch) === "dev" && debug)) && (react_1.default.createElement(TypoComp, __assign({ invert: invert }, (size === 'L' ? { bold: true } : { semibold: true })), "".concat((theme === null || theme === void 0 ? void 0 : theme._Branch) === "dev" && debug ? "".concat(debug, " ") : "").concat(text || '')))));
47
+ (text || ((theme === null || theme === void 0 ? void 0 : theme.ENV) === "dev" && debug)) && (react_1.default.createElement(TypoComp, __assign({ invert: invert }, (size === 'L' ? { bold: true } : { semibold: true })), "".concat((theme === null || theme === void 0 ? void 0 : theme.ENV) === "dev" && debug ? "".concat(debug, " ") : "").concat(text || '')))));
48
48
  };
@@ -35,6 +35,7 @@ export namespace icons {
35
35
  export { Checks };
36
36
  export { Check };
37
37
  export { ArrowClockwise };
38
+ export { ArrowsClockwise };
38
39
  export { ArrowsIn };
39
40
  export { ArrowsOut };
40
41
  export { MapPin };
@@ -121,6 +122,7 @@ import { Envelope } from "phosphor-react";
121
122
  import { Checks } from "phosphor-react";
122
123
  import { Check } from "phosphor-react";
123
124
  import { ArrowClockwise } from "phosphor-react";
125
+ import { ArrowsClockwise } from "phosphor-react";
124
126
  import { ArrowsIn } from "phosphor-react";
125
127
  import { ArrowsOut } from "phosphor-react";
126
128
  import { MapPin } from "phosphor-react";
@@ -40,6 +40,7 @@ exports.icons = {
40
40
  Checks: phosphor_react_1.Checks,
41
41
  Check: phosphor_react_1.Check,
42
42
  ArrowClockwise: phosphor_react_1.ArrowClockwise,
43
+ ArrowsClockwise: phosphor_react_1.ArrowsClockwise,
43
44
  ArrowsIn: phosphor_react_1.ArrowsIn,
44
45
  ArrowsOut: phosphor_react_1.ArrowsOut,
45
46
  MapPin: phosphor_react_1.MapPin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",