oolib 2.225.9 → 2.225.11

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.
@@ -29,14 +29,15 @@ var ListItem_1 = require("../../../v2/components/List/comps/ListItem");
29
29
  var dropdownOptions_1 = require("./Dropdown/dropdownOptions");
30
30
  var availableColors = __spreadArray([undefined], Object.keys(__1.colors2).sort(), true);
31
31
  var availableIcons = __spreadArray([undefined], Object.keys(__1.icons).sort(), true);
32
+ var longText = "If music be the food of love, play on;\n Give me excess of it, that, surfeiting,\n The appetite may sicken, and so die.\n That strain again! it had a dying fall:\n O, it came o'er my ear like the sweet sound,\n That breathes upon a bank of violets,\n Stealing and giving odour! Enough; no more:\n 'Tis not so sweet now as it was before.\n O spirit of love! how quick and fresh art thou,\n That, notwithstanding thy capacity\n Receiveth as the sea, nought enters there,\n Of what validity and pitch soe'er,\n But falls into abatement and low price,\n Even in a minute: so full of shapes is fancy\n That it alone is high fantastical.";
32
33
  var dropdownOptions = [
33
34
  {
34
- display: "Option with a slightly longer name",
35
+ display: longText,
35
36
  value: "india",
36
37
  color: themes_1.colors.lightRed,
37
38
  // image: "xyz",
38
39
  icon: "CirclesFour",
39
- desc: "There is this one very annoying bug in the list component. basically the options ka description na, I was trying to put a 3 line line clamp on it. but for that to work, the outer wrapper of both the display and description cannot have ellipsis. but if I remove that ellipsis horizontal scroll comes. its a complete brain fry\u2026 could you check it out? in case you have a quick solution for it?",
40
+ desc: longText,
40
41
  // desc: "This is a story about schnil-tu, a.k.a tubito senpai. Tubito senpai loves to say bhai-god. Lol.",
41
42
  },
42
43
  {
@@ -75,11 +75,34 @@ var useFloatingPosition = function (_a) {
75
75
  var delayGroupContext = (0, react_1.useDelayGroup)(context, {
76
76
  enabled: enableDelayGroups,
77
77
  });
78
- var delayGroupDelay = enableDelayGroups && delayGroupContext
79
- ? delayGroupContext.delay
80
- : undefined;
81
78
  var enableHover = "enableHover" in options ? options.enableHover : true;
82
- var hover = (0, react_1.useHover)(context, __assign(__assign({}, ("hoverOptions" in options ? options.hoverOptions : {})), { enabled: !enableTriggerOnClick && enableHover !== false, delay: enableDelayGroups ? delayGroupDelay : undefined }));
79
+ var hoverOpts = "hoverOptions" in options ? options.hoverOptions : {};
80
+ // Determine the delay for hover interactions:
81
+ // - When delay groups are disabled, use the custom hoverOptions delay
82
+ // - When in instant phase (rapidly moving between tooltips in a group), use group delay
83
+ // - When inside an active FloatingDelayGroup (delay > 0), use group delay
84
+ // - Otherwise use custom hoverOptions delay
85
+ var getDelay = function () {
86
+ var _a, _b;
87
+ if (!enableDelayGroups) {
88
+ return hoverOpts === null || hoverOpts === void 0 ? void 0 : hoverOpts.delay;
89
+ }
90
+ var groupDelay = delayGroupContext === null || delayGroupContext === void 0 ? void 0 : delayGroupContext.delay;
91
+ // Check if we're inside an actual FloatingDelayGroup
92
+ // (delay is 0 by default if no provider exists)
93
+ var hasGroupProvider = typeof groupDelay === "number"
94
+ ? groupDelay > 0
95
+ : typeof groupDelay === "object" &&
96
+ groupDelay !== null &&
97
+ (((_a = groupDelay.open) !== null && _a !== void 0 ? _a : 0) > 0 || ((_b = groupDelay.close) !== null && _b !== void 0 ? _b : 0) > 0);
98
+ // In instant phase or inside an active group, use group delay
99
+ if ((delayGroupContext === null || delayGroupContext === void 0 ? void 0 : delayGroupContext.isInstantPhase) || hasGroupProvider) {
100
+ return groupDelay;
101
+ }
102
+ // No active group, use custom delay
103
+ return hoverOpts === null || hoverOpts === void 0 ? void 0 : hoverOpts.delay;
104
+ };
105
+ var hover = (0, react_1.useHover)(context, __assign(__assign({}, hoverOpts), { enabled: !enableTriggerOnClick && enableHover !== false, delay: getDelay() }));
83
106
  var click = (0, react_1.useClick)(context, __assign(__assign({}, ("clickOptions" in options ? options.clickOptions : {})), { enabled: enableTriggerOnClick }));
84
107
  var focus = (0, react_1.useFocus)(context, focusOptions);
85
108
  var role = (0, react_1.useRole)(context, roleOptions);
@@ -96,7 +96,8 @@ var ListItem = function (_a) {
96
96
  marginTop: "0.1rem",
97
97
  display: "flex",
98
98
  alignItems: "center",
99
- gap: "0.5rem"
99
+ gap: "0.5rem",
100
+ flex: "none"
100
101
  } },
101
102
  alignCheckbox === "left" && renderCheckBox(),
102
103
  icon &&
@@ -13,6 +13,8 @@ var themes_1 = require("../../../themes");
13
13
  var getDynamicColors_1 = require("../../../themes/utils/getDynamicColors");
14
14
  var mixins_1 = require("../../../../themes/mixins");
15
15
  var grey10 = themes_1.colors.grey10;
16
+ var textLineClamp = 2;
17
+ var descriptionLineClamp = 3;
16
18
  exports.StyledListItemWrapper = styled_components_1.default.li(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n /* padding: ", "; */\n padding: 0.8rem;\n border-radius: 0.4rem;\n gap: 1rem;\n\n justify-content: space-between;\n\n background-color: ", ";\n\n .OKE-Dropdown__optionText {\n color: ", ";\n }\n\n .OKE-Dropdown__optionIcon {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:first-of-type {\n /* margin-top: 0.4rem; */\n }\n\n &:last-of-type {\n /* margin-bottom: 0.4rem; */\n }\n\n .OKE-Dropdown__optionDesc {\n ", "\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-top: 0.2rem;\n flex-shrink: 0;\n }\n"], ["\n display: flex;\n align-items: center;\n /* padding: ", "; */\n padding: 0.8rem;\n border-radius: 0.4rem;\n gap: 1rem;\n\n justify-content: space-between;\n\n background-color: ", ";\n\n .OKE-Dropdown__optionText {\n color: ", ";\n }\n\n .OKE-Dropdown__optionIcon {\n color: ", ";\n }\n\n &:hover {\n background-color: ", ";\n }\n\n &:first-of-type {\n /* margin-top: 0.4rem; */\n }\n\n &:last-of-type {\n /* margin-bottom: 0.4rem; */\n }\n\n .OKE-Dropdown__optionDesc {\n ", "\n white-space: normal;\n }\n\n .OKE-Dropdown__optionImg {\n flex: 0 0 auto;\n }\n\n .OKE-Dropdown__checkboxClickArea {\n position: absolute;\n width: 2rem;\n height: 2rem;\n }\n .OKE-Dropdown__checkboxClickArea-box {\n margin-top: 0.2rem;\n flex-shrink: 0;\n }\n"])), function (_a) {
17
19
  var S = _a.S;
18
20
  return (S ? "0.8rem" : "0.6rem 0.8rem");
@@ -28,7 +30,7 @@ exports.StyledListItemWrapper = styled_components_1.default.li(templateObject_1
28
30
  }, themes_1.colors.grey80, themes_1.colors.grey80, function (_a) {
29
31
  var theme = _a.theme;
30
32
  return "".concat(grey10);
31
- }, (0, mixins_1.clampText)(3));
33
+ }, (0, mixins_1.clampText)(descriptionLineClamp));
32
34
  exports.StyledRightSection = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n margin-top: 0.1rem;\n display: flex;\n gap: 0.5rem;\n align-self: flex-start;\n justify-content: space-between;\n"], ["\n margin-top: 0.1rem;\n display: flex;\n gap: 0.5rem;\n align-self: flex-start;\n justify-content: space-between;\n"])));
33
- exports.StyledWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow: hidden;\n min-width: 0;\n flex: 1;\n \n /* Ensure direct child divs can shrink below content width */\n > div {\n min-width: 0;\n }\n \n .OKE-Dropdown__optionText {\n ", "\n }\n"], ["\n overflow: hidden;\n min-width: 0;\n flex: 1;\n \n /* Ensure direct child divs can shrink below content width */\n > div {\n min-width: 0;\n }\n \n .OKE-Dropdown__optionText {\n ", "\n }\n"])), mixins_1.ellipsis);
35
+ exports.StyledWrapper = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n overflow: hidden;\n min-width: 0;\n flex: 1;\n \n /* Ensure direct child divs can shrink below content width */\n > div {\n min-width: 0;\n }\n \n .OKE-Dropdown__optionText {\n ", "\n white-space: normal;\n }\n"], ["\n overflow: hidden;\n min-width: 0;\n flex: 1;\n \n /* Ensure direct child divs can shrink below content width */\n > div {\n min-width: 0;\n }\n \n .OKE-Dropdown__optionText {\n ", "\n white-space: normal;\n }\n"])), (0, mixins_1.clampText)(textLineClamp));
34
36
  var templateObject_1, templateObject_2, templateObject_3;
@@ -53,7 +53,7 @@ var utils_1 = require("./utils");
53
53
  var styled_1 = require("./styled");
54
54
  var CURSOR_HEIGHT = 20;
55
55
  function Tooltip(_a) {
56
- var text = _a.text, heading = _a.heading, primaryContent = _a.primaryContent, secondaryContent = _a.secondaryContent, _b = _a.progressiveDelay, progressiveDelay = _b === void 0 ? 1000 : _b, _c = _a.progressiveGap, progressiveGap = _c === void 0 ? 8 : _c, children = _a.children, _d = _a.placement, placement = _d === void 0 ? 'top' : _d, _e = _a.showPointer, showPointer = _e === void 0 ? true : _e, _f = _a.showDelay, showDelay = _f === void 0 ? 0 : _f, _g = _a.hideDelay, hideDelay = _g === void 0 ? 0 : _g, _h = _a.animation, animation = _h === void 0 ? 'none' : _h, _j = _a.followCursor, followCursor = _j === void 0 ? false : _j, _k = _a.cursorOffset, cursorOffset = _k === void 0 ? 10 : _k, _l = _a.invert, invert = _l === void 0 ? false : _l, wrapperDisplay = _a.wrapperDisplay, _m = _a.trigger, trigger = _m === void 0 ? 'hover' : _m, style = _a.style;
56
+ var text = _a.text, heading = _a.heading, primaryContent = _a.primaryContent, secondaryContent = _a.secondaryContent, _b = _a.progressiveDelay, progressiveDelay = _b === void 0 ? 600 : _b, _c = _a.progressiveGap, progressiveGap = _c === void 0 ? 8 : _c, children = _a.children, _d = _a.placement, placement = _d === void 0 ? 'top' : _d, _e = _a.showPointer, showPointer = _e === void 0 ? true : _e, _f = _a.showDelay, showDelay = _f === void 0 ? 600 : _f, _g = _a.hideDelay, hideDelay = _g === void 0 ? 0 : _g, _h = _a.animation, animation = _h === void 0 ? 'fade' : _h, _j = _a.followCursor, followCursor = _j === void 0 ? false : _j, _k = _a.cursorOffset, cursorOffset = _k === void 0 ? 10 : _k, _l = _a.invert, invert = _l === void 0 ? false : _l, wrapperDisplay = _a.wrapperDisplay, _m = _a.trigger, trigger = _m === void 0 ? 'hover' : _m, style = _a.style;
57
57
  var bgColor = invert ? __1.colors2.white : __1.colors2.black;
58
58
  var textColor = invert ? __1.colors2.black : __1.colors2.white;
59
59
  var resolvedPrimaryContent = (0, utils_1.resolvePrimaryContent)(text, heading, primaryContent);
@@ -116,7 +116,7 @@ function Tooltip(_a) {
116
116
  disableAutoUpdate: followCursor,
117
117
  enableDelayGroups: !isClickTrigger,
118
118
  enableTriggerOnClick: isClickTrigger,
119
- enableHover: !isClickTrigger && !isPinned && !followCursor,
119
+ enableHover: true,
120
120
  hoverOptions: {
121
121
  delay: { open: showDelay, close: hideDelay },
122
122
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.225.9",
3
+ "version": "2.225.11",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",