oolib 2.235.0 → 2.235.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.
@@ -101,6 +101,13 @@ var ActionMenu = function (_a) {
101
101
  var buttonSize = M ? { M: true } : {};
102
102
  var genOptionIcon = function (iconName) {
103
103
  var IconComp = icons_1.icons[iconName];
104
+ if (!IconComp) {
105
+ if (process.env.NODE_ENV !== "production") {
106
+ // eslint-disable-next-line no-console
107
+ console.warn("[ActionMenu] Unknown icon \"".concat(iconName, "\" \u2014 skipping."));
108
+ }
109
+ return null;
110
+ }
104
111
  return react_1.default.createElement(IconComp, { size: 16 });
105
112
  };
106
113
  (0, react_1.useEffect)(function () {
@@ -168,6 +168,7 @@ export namespace icons {
168
168
  export { Selection };
169
169
  export { Flask };
170
170
  export { Shuffle };
171
+ export { Bookmark };
171
172
  export { OkeGoogleIcon };
172
173
  export { LetterH };
173
174
  export { IndexIcon };
@@ -406,6 +407,7 @@ import { ArrowCounterClockwiseIcon as ArrowCounterClockwise } from "@phosphor-ic
406
407
  import { SelectionIcon as Selection } from "@phosphor-icons/react";
407
408
  import { FlaskIcon as Flask } from "@phosphor-icons/react";
408
409
  import { ShuffleIcon as Shuffle } from "@phosphor-icons/react";
410
+ import { BookmarkIcon as Bookmark } from "@phosphor-icons/react";
409
411
  import { OkeGoogleIcon } from "./custom";
410
412
  import { LetterH } from "./custom";
411
413
  import { IndexIcon } from "./custom";
@@ -173,6 +173,7 @@ exports.icons = {
173
173
  Selection: react_1.SelectionIcon,
174
174
  Flask: react_1.FlaskIcon,
175
175
  Shuffle: react_1.ShuffleIcon,
176
+ Bookmark: react_1.BookmarkIcon,
176
177
  //custom icons
177
178
  OkeGoogleIcon: custom_1.OkeGoogleIcon,
178
179
  LetterH: custom_1.LetterH,
@@ -52,7 +52,6 @@ var react_1 = __importStar(require("react"));
52
52
  var SelectTagsInput_1 = require("../comps/SelectTagsInput");
53
53
  var SelectDropdown_1 = require("../comps/SelectDropdown");
54
54
  var OptionsMulti_1 = require("../comps/OptionsMulti");
55
- var DisplayCompSingle_1 = require("../comps/DisplayCompSingle");
56
55
  var handlers_1 = require("../handlers");
57
56
  var useHideShowOptions_1 = require("../utils/useHideShowOptions");
58
57
  var useCreateDropdownRefs_1 = require("../utils/useCreateDropdownRefs");
@@ -66,7 +65,7 @@ var styled_1 = require("../styled");
66
65
  var BlockLabel_1 = require("../../BlockLabel");
67
66
  var getBlockLabelProps_1 = require("../../../../utils/getBlockLabelProps");
68
67
  var List_1 = require("../../List");
69
- var Typo2_1 = require("../../Typo2");
68
+ var Tags_1 = require("../../Tags");
70
69
  function DropdownMulti(_a) {
71
70
  var saveValueAsString = _a.saveValueAsString, valueProp = _a.value, id = _a.id, parentOnChange = _a.onChange, className = _a.className,
72
71
  // injectOtherOption,
@@ -175,10 +174,7 @@ function DropdownMulti(_a) {
175
174
  var genDisplayComp = function () {
176
175
  if (!(value === null || value === void 0 ? void 0 : value.length) > 0)
177
176
  return null;
178
- return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { var _a; return (0, genTagComp_1.genTagComp)(id, d, { display: true, theme: theme, color: tagColor, usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }); }))) : (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" } }, value.map(function (v, i) { return react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, { key: v.value },
179
- v.display,
180
- " ",
181
- i !== value.length - 1 ? ',' : ''); })));
177
+ return isTagsStyle ? (react_1.default.createElement(styled_1.StyledTagsInputWrapper, null, value.map(function (d) { var _a; return (0, genTagComp_1.genTagComp)(id, d, { display: true, theme: theme, color: tagColor, usedOnContentType: (_a = content === null || content === void 0 ? void 0 : content.meta) === null || _a === void 0 ? void 0 : _a.kp_content_type }); }))) : (react_1.default.createElement("div", { style: { display: "flex", flexWrap: "wrap", gap: "0.5rem" } }, value.map(function (v) { return (react_1.default.createElement(Tags_1.TagDisplay, { key: v.value, display: v.display, colorPreset: "default" })); })));
182
178
  };
183
179
  var _h = (0, react_1.useState)(false), focusSelectTagsInput = _h[0], setFocusSelectTagsInput = _h[1];
184
180
  var genSelectTagsInput = function (ops) {
@@ -1,6 +1,4 @@
1
- export function DisplayCompSingle({ value, injectComma, S }: {
1
+ export function DisplayCompSingle({ value }: {
2
2
  value: any;
3
- injectComma: any;
4
- S: any;
5
3
  }): React.JSX.Element;
6
4
  import React from "react";
@@ -1,33 +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
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
6
  exports.DisplayCompSingle = void 0;
18
7
  var react_1 = __importDefault(require("react"));
19
- var styled_components_1 = require("styled-components");
20
- var genProfileImg_1 = require("../../utils/genProfileImg");
21
- var genIcon_1 = require("../../utils/genIcon");
22
- var Typo2_1 = require("../../../Typo2");
8
+ var Tags_1 = require("../../../Tags");
23
9
  var DisplayCompSingle = function (_a) {
24
- var value = _a.value, injectComma = _a.injectComma, S = _a.S;
25
- var theme = (0, styled_components_1.useTheme)();
10
+ var value = _a.value;
26
11
  if (!value)
27
12
  return null;
28
- return (react_1.default.createElement("div", { style: { display: "flex", alignItems: "center", gap: '1rem' } },
29
- (0, genIcon_1.genIcon)({ icon: value === null || value === void 0 ? void 0 : value.icon, S: S }),
30
- (value === null || value === void 0 ? void 0 : value.image) && (0, genProfileImg_1.genProfileImg)(__assign(__assign({}, value), { theme: theme })),
31
- react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, null, value === null || value === void 0 ? void 0 : value.display)));
13
+ return (react_1.default.createElement(Tags_1.TagDisplay, { display: value === null || value === void 0 ? void 0 : value.display, colorPreset: "default" }));
32
14
  };
33
15
  exports.DisplayCompSingle = DisplayCompSingle;
@@ -54,6 +54,7 @@ var styled_1 = require("../../styled");
54
54
  var CheckboxInput_1 = require("./comps/CheckboxInput");
55
55
  var styled_2 = require("./styled");
56
56
  var Typo2_1 = require("../../../Typo2");
57
+ var Tags_1 = require("../../../../Tags");
57
58
  var OKELink_1 = require("../../../OKELink");
58
59
  var optionsContainers = {
59
60
  checkbox: styled_1.StyledOptionsContainer,
@@ -99,18 +100,7 @@ function CheckboxList(_a) {
99
100
  var blocklabelProps = (0, _EXPORTS_1.getBlockLabelProps)(props);
100
101
  return (react_1.default.createElement("div", { className: className, id: id },
101
102
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, blocklabelProps, { marginBottom: readOnly ? '0.4rem' : (blocklabelProps === null || blocklabelProps === void 0 ? void 0 : blocklabelProps.sublabel) ? '1.4rem' : '1.2rem' })),
102
- readOnly ? (react_1.default.createElement(styled_2.StyledDisplayTagsContainer, null, value === null || value === void 0 ? void 0 : value.map(function (selOp, idx) {
103
- return react_1.default.createElement(react_1.default.Fragment, null,
104
- react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, { key: selOp.value },
105
- selOp.display_desc || selOp.display,
106
- " ",
107
- value.length > 1 && idx < value.length - 1 ? ',' : ''));
108
- }
109
- // <TagDisplay key={selOp.value} //using old one till we figure out exactly what we want for readOnly
110
- // invert={invert}
111
- // display={selOp.display_desc || selOp.display}//prioritzing display_desc since display of 'other' option is just 'Other'
112
- // />
113
- ))) : (react_1.default.createElement(react_1.default.Fragment, null,
103
+ readOnly ? (react_1.default.createElement(styled_2.StyledDisplayTagsContainer, null, value === null || value === void 0 ? void 0 : value.map(function (selOp) { return (react_1.default.createElement(Tags_1.TagDisplay, { key: selOp.value, display: selOp.display_desc || selOp.display, colorPreset: "default" })); }))) : (react_1.default.createElement(react_1.default.Fragment, null,
114
104
  react_1.default.createElement(OptionsContainer, { style: style, listType: listType, S: S }, typicalOptions === null || typicalOptions === void 0 ? void 0 :
115
105
  typicalOptions.map(function (option, idx) { return idx < optionsLimit && (react_1.default.createElement(CheckboxInput_1.CheckboxInput, __assign({}, InputCommonProps, { option: option, key: option.value }))); }),
116
106
  shouldHideSomeOptions && // if we have the case of off limit options
@@ -53,7 +53,7 @@ var _EXPORTS_1 = require("../../../../../utils/_EXPORTS");
53
53
  var styled_1 = require("../../styled");
54
54
  var utils_1 = require("../../utils");
55
55
  var comps_1 = require("./comps");
56
- var Typo2_1 = require("../../../Typo2");
56
+ var Tags_1 = require("../../../../Tags");
57
57
  function RadioList(_a) {
58
58
  var id = _a.id, _b = _a.injectOtherOption, injectOtherOption = _b === void 0 ? false : _b, valueProp = _a.value, onChange = _a.onChange, saveValueAsString = _a.saveValueAsString, _c = _a.options, options = _c === void 0 ? [] : _c, commonIsCorrectDesc = _a.commonIsCorrectDesc, rightWrongResult = _a.rightWrongResult, _d = _a.optionsLimit, optionsLimit = _d === void 0 ? Infinity : _d, _e = _a.listType, listType = _e === void 0 ? 'horizontal' : _e, disabled = _a.disabled, invert = _a.invert, readOnly = _a.readOnly, S = _a.S;
59
59
  var props = arguments[0];
@@ -85,9 +85,7 @@ function RadioList(_a) {
85
85
  var blocklabelProps = (0, _EXPORTS_1.getBlockLabelProps)(props);
86
86
  return (react_1.default.createElement("div", { id: id },
87
87
  react_1.default.createElement(BlockLabel_1.BlockLabel, __assign({}, blocklabelProps, { marginBottom: readOnly ? '0.4rem' : (blocklabelProps === null || blocklabelProps === void 0 ? void 0 : blocklabelProps.sublabel) ? '1.4rem' : '1.2rem' })),
88
- readOnly ? ((value === null || value === void 0 ? void 0 : value.display) && react_1.default.createElement(Typo2_1.UI_BODY_SM_DF, null, value.display_desc || value.display)
89
- // <TagDisplay display={value.display_desc || value.display} invert={invert}/> //prioritzing display_desc since display of 'other' option is === other
90
- ) : (react_1.default.createElement(react_1.default.Fragment, null,
88
+ readOnly ? ((value === null || value === void 0 ? void 0 : value.display) && react_1.default.createElement(Tags_1.TagDisplay, { display: value.display_desc || value.display, colorPreset: "default" })) : (react_1.default.createElement(react_1.default.Fragment, null,
91
89
  react_1.default.createElement(styled_1.StyledOptionsContainer, { listType: listType, S: S }, typicalOptions === null || typicalOptions === void 0 ? void 0 :
92
90
  typicalOptions.map(function (option, idx) { return idx < optionsLimit && (react_1.default.createElement(comps_1.RadioInput, __assign({}, InputCommonProps, { option: option, key: option.value }))); }),
93
91
  shouldHideSomeOptions && // if we have the case of off limit options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.235.0",
3
+ "version": "2.235.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",