oolib 2.226.2 → 2.227.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.
@@ -153,6 +153,8 @@ export namespace icons {
153
153
  export { CaretUpDown };
154
154
  export { FunnelSimple };
155
155
  export { Question };
156
+ export { Database };
157
+ export { Function };
156
158
  export { OkeGoogleIcon };
157
159
  export { LetterH };
158
160
  export { IndexIcon };
@@ -376,6 +378,8 @@ import { ArrowElbowDownLeftIcon as ArrowElbowDownLeft } from "@phosphor-icons/re
376
378
  import { CaretUpDownIcon as CaretUpDown } from "@phosphor-icons/react";
377
379
  import { FunnelSimpleIcon as FunnelSimple } from "@phosphor-icons/react";
378
380
  import { QuestionIcon as Question } from "@phosphor-icons/react";
381
+ import { DatabaseIcon as Database } from "@phosphor-icons/react";
382
+ import { FunctionIcon as Function } from "@phosphor-icons/react";
379
383
  import { OkeGoogleIcon } from "./custom";
380
384
  import { LetterH } from "./custom";
381
385
  import { IndexIcon } from "./custom";
@@ -158,6 +158,8 @@ exports.icons = {
158
158
  CaretUpDown: react_1.CaretUpDownIcon,
159
159
  FunnelSimple: react_1.FunnelSimpleIcon,
160
160
  Question: react_1.QuestionIcon,
161
+ Database: react_1.DatabaseIcon,
162
+ Function: react_1.FunctionIcon,
161
163
  //custom icons
162
164
  OkeGoogleIcon: custom_1.OkeGoogleIcon,
163
165
  LetterH: custom_1.LetterH,
package/dist/index.d.ts CHANGED
@@ -88,3 +88,4 @@ export { ButtonPrimary as ButtonPrimaryV2, ButtonSecondary as ButtonSecondaryV2,
88
88
  export { colors as colors2, typo as typoV2_CSS } from "./v2/themes";
89
89
  export { RadioInput, RadioButton } from "./v2/components/RadioAndCheckbox/comps/RadioList/comps/RadioInput/index";
90
90
  export { SwitchSingle, SwitchDouble } from "./v2/components/Switches";
91
+ export { useFloatingPosition, FloatingFocusManager, FloatingPortal } from "./utils/customHooks/useFloatingPosition";
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
42
  exports.BannerInfo = exports.BannerAlert = exports.GroupQuestionsInputSingle = exports.ResourceInput = exports.IFrameInput = exports.PDFInput = exports.AudioInput = exports.VideoInput = exports.ProfileImageInput = exports.ImageInput = exports.MetaBlock = exports.parseCardConfig = exports.ListProfile = exports.CardProfile = exports.CardEmbed = exports.DateTimeRangePicker = exports.DateTimePicker = exports.TimeRangePicker = exports.TimePicker = exports.DateRangePicker = exports.DatePicker = exports.TextLoader = exports.PageScrollIndicator = exports.HomeCover = exports.EmptyStates = exports.ModalSmall = exports.Modal = exports.ModalForms = exports.ModalConfirm = exports.SkeletonLoader = exports.Divider = exports.PercentCompletedPie = exports.Accordion = exports.ActionMenu = exports.Tooltip = exports.OKELink = exports.UserRoleBadge = exports.Section = exports.TagDisplay = exports.TagSelect = exports.TagLink = exports.TagClear = exports.LoaderOverlay = exports.Loader = exports.ProgressBar = exports.LoaderCircle = exports.applyBlackOverlayOnHover = exports.icons = exports.colors = exports.GlobalStyles = void 0;
43
43
  exports.List = exports.SwitchDouble = exports.SwitchSingle = exports.RadioButton = exports.RadioInput = exports.RadioList = exports.CheckboxButton = exports.CheckboxInput = exports.CheckboxList = exports.AccordionV2 = exports.HomeCoverV2 = exports.DateRangePickerV2 = exports.MetaBlockV2 = exports.typoV2_CSS = exports.colors2 = exports.TabBarV2 = exports.ButtonUpload = exports.ButtonGhostCompact = exports.ButtonTertiaryCompact = exports.ButtonSecondaryCompact = exports.ButtonPrimaryCompact = exports.ButtonGhostV2 = exports.ButtonTertiaryV2 = exports.ButtonSecondaryV2 = exports.ButtonPrimaryV2 = exports.TagClearV2 = exports.TagLinkV2 = exports.TagDisplayV2 = exports.generateOptions = exports.genTagComp = exports.OptionsSingle = exports.DropdownMulti = exports.DropdownSingle = exports.HintsProvider = exports.BlockLabel = exports.ListContent = exports.CardContent = exports.URLInput = exports.PasswordInput = exports.PhoneInput = exports.NumberInput = exports.EmailInput = exports.TextInput = exports.TableCellResizerPlugin = exports.styledOKELinkCSS = exports.SimpleTable = exports.ModalConfirmAction = exports.BannerProvider = exports.useBannerContext = exports.BannerContext = void 0;
44
- exports.baseStyling = exports.TooltipV2 = exports.ListItem = void 0;
44
+ exports.FloatingPortal = exports.FloatingFocusManager = exports.useFloatingPosition = exports.baseStyling = exports.TooltipV2 = exports.ListItem = void 0;
45
45
  //css and styling related ( styled-components )
46
46
  var globalStyles_1 = require("./globalStyles");
47
47
  Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return globalStyles_1.GlobalStyles; } });
@@ -252,3 +252,8 @@ Object.defineProperty(exports, "ListItem", { enumerable: true, get: function ()
252
252
  var Tooltip_2 = require("./v2/components/Tooltip");
253
253
  Object.defineProperty(exports, "TooltipV2", { enumerable: true, get: function () { return __importDefault(Tooltip_2).default; } });
254
254
  exports.baseStyling = __importStar(require("./v2/themes/utils/baseStyling"));
255
+ // Floating UI hooks and utilities
256
+ var useFloatingPosition_1 = require("./utils/customHooks/useFloatingPosition");
257
+ Object.defineProperty(exports, "useFloatingPosition", { enumerable: true, get: function () { return useFloatingPosition_1.useFloatingPosition; } });
258
+ Object.defineProperty(exports, "FloatingFocusManager", { enumerable: true, get: function () { return useFloatingPosition_1.FloatingFocusManager; } });
259
+ Object.defineProperty(exports, "FloatingPortal", { enumerable: true, get: function () { return useFloatingPosition_1.FloatingPortal; } });
@@ -1,5 +1,22 @@
1
1
  import { type UseFloatingOptions, type OpenChangeReason, type UseHoverProps, type UseClickProps, type UseDismissProps, type UseFocusProps, type UseRoleProps, type ArrowOptions, type OffsetOptions, type ShiftOptions, type FlipOptions, type AutoPlacementOptions, type HideOptions, type UseTransitionStylesProps, type Middleware } from "@floating-ui/react";
2
- import { type CSSProperties } from "react";
2
+ import { type CSSProperties, type MutableRefObject } from "react";
3
+ export { FloatingFocusManager, FloatingPortal } from "@floating-ui/react";
4
+ export interface ListNavigationOptions {
5
+ enabled?: boolean;
6
+ listRef: MutableRefObject<(HTMLElement | null)[]>;
7
+ activeIndex: number | null;
8
+ onNavigate?: (index: number | null) => void;
9
+ loop?: boolean;
10
+ virtual?: boolean;
11
+ orientation?: "vertical" | "horizontal" | "both";
12
+ focusItemOnOpen?: boolean | "auto";
13
+ focusItemOnHover?: boolean;
14
+ openOnArrowKeyDown?: boolean;
15
+ disabledIndices?: number[];
16
+ allowEscape?: boolean;
17
+ cols?: number;
18
+ scrollItemIntoView?: boolean | ScrollIntoViewOptions;
19
+ }
3
20
  interface UseFloatingPositionPropsBase {
4
21
  placement?: UseFloatingOptions["placement"];
5
22
  strategy?: UseFloatingOptions["strategy"];
@@ -38,6 +55,7 @@ interface UseFloatingPositionPropsBase {
38
55
  config?: HideOptions;
39
56
  };
40
57
  };
58
+ listNavigationOptions?: ListNavigationOptions;
41
59
  }
42
60
  interface UseFloatingPositionPropsHover extends UseFloatingPositionPropsBase {
43
61
  enableTriggerOnClick?: false;
@@ -49,7 +67,7 @@ interface UseFloatingPositionPropsClick extends UseFloatingPositionPropsBase {
49
67
  clickOptions?: Omit<UseClickProps, "enabled">;
50
68
  }
51
69
  export type UseFloatingPositionProps = UseFloatingPositionPropsHover | UseFloatingPositionPropsClick;
52
- export declare const useFloatingPosition: ({ placement, strategy, transform, open, onOpenChange, enableTriggerOnClick, dismissOptions, focusOptions, roleOptions, showArrow, arrowRef, arrowPadding, enableDelayGroups, transitionOptions, customMiddleware, disableAutoUpdate, middlewareOptions, ...options }: UseFloatingPositionProps) => {
70
+ export declare const useFloatingPosition: ({ placement, strategy, transform, open, onOpenChange, enableTriggerOnClick, dismissOptions, focusOptions, roleOptions, showArrow, arrowRef, arrowPadding, enableDelayGroups, transitionOptions, customMiddleware, disableAutoUpdate, middlewareOptions, listNavigationOptions, ...options }: UseFloatingPositionProps) => {
53
71
  getReferenceProps: (userProps?: React.HTMLProps<Element>) => Record<string, unknown>;
54
72
  getFloatingProps: (userProps?: React.HTMLProps<HTMLElement>) => Record<string, unknown>;
55
73
  getItemProps: (userProps?: Omit<React.HTMLProps<HTMLElement>, "selected" | "active"> & {
@@ -61,7 +79,7 @@ export declare const useFloatingPosition: ({ placement, strategy, transform, ope
61
79
  x: number;
62
80
  floatingStyles: React.CSSProperties;
63
81
  refs: {
64
- reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType>;
82
+ reference: MutableRefObject<import("@floating-ui/react-dom").ReferenceType>;
65
83
  floating: React.MutableRefObject<HTMLElement | null>;
66
84
  setReference: (node: import("@floating-ui/react-dom").ReferenceType) => void;
67
85
  setFloating: (node: HTMLElement | null) => void;
@@ -96,4 +114,3 @@ export declare const useFloatingPosition: ({ placement, strategy, transform, ope
96
114
  transitionStyles: CSSProperties;
97
115
  update: () => void;
98
116
  };
99
- export {};
@@ -22,12 +22,17 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  return t;
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.useFloatingPosition = void 0;
25
+ exports.useFloatingPosition = exports.FloatingPortal = exports.FloatingFocusManager = void 0;
26
26
  var react_1 = require("@floating-ui/react");
27
27
  var react_2 = require("react");
28
+ // Re-export FloatingFocusManager and FloatingPortal for consumers
29
+ var react_3 = require("@floating-ui/react");
30
+ Object.defineProperty(exports, "FloatingFocusManager", { enumerable: true, get: function () { return react_3.FloatingFocusManager; } });
31
+ Object.defineProperty(exports, "FloatingPortal", { enumerable: true, get: function () { return react_3.FloatingPortal; } });
28
32
  var useFloatingPosition = function (_a) {
29
- var placement = _a.placement, strategy = _a.strategy, transform = _a.transform, open = _a.open, onOpenChange = _a.onOpenChange, _b = _a.enableTriggerOnClick, enableTriggerOnClick = _b === void 0 ? false : _b, dismissOptions = _a.dismissOptions, focusOptions = _a.focusOptions, roleOptions = _a.roleOptions, _c = _a.showArrow, showArrow = _c === void 0 ? false : _c, arrowRef = _a.arrowRef, arrowPadding = _a.arrowPadding, _d = _a.enableDelayGroups, enableDelayGroups = _d === void 0 ? true : _d, transitionOptions = _a.transitionOptions, customMiddleware = _a.customMiddleware, _e = _a.disableAutoUpdate, disableAutoUpdate = _e === void 0 ? false : _e, _f = _a.middlewareOptions, middlewareOptions = _f === void 0 ? {} : _f, options = __rest(_a, ["placement", "strategy", "transform", "open", "onOpenChange", "enableTriggerOnClick", "dismissOptions", "focusOptions", "roleOptions", "showArrow", "arrowRef", "arrowPadding", "enableDelayGroups", "transitionOptions", "customMiddleware", "disableAutoUpdate", "middlewareOptions"]);
30
- var _g = (0, react_2.useState)("unmounted"), state = _g[0], setState = _g[1];
33
+ var _b, _c, _d, _e, _f, _g, _h, _j;
34
+ var placement = _a.placement, strategy = _a.strategy, transform = _a.transform, open = _a.open, onOpenChange = _a.onOpenChange, _k = _a.enableTriggerOnClick, enableTriggerOnClick = _k === void 0 ? false : _k, dismissOptions = _a.dismissOptions, focusOptions = _a.focusOptions, roleOptions = _a.roleOptions, _l = _a.showArrow, showArrow = _l === void 0 ? false : _l, arrowRef = _a.arrowRef, arrowPadding = _a.arrowPadding, _m = _a.enableDelayGroups, enableDelayGroups = _m === void 0 ? true : _m, transitionOptions = _a.transitionOptions, customMiddleware = _a.customMiddleware, _o = _a.disableAutoUpdate, disableAutoUpdate = _o === void 0 ? false : _o, _p = _a.middlewareOptions, middlewareOptions = _p === void 0 ? {} : _p, listNavigationOptions = _a.listNavigationOptions, options = __rest(_a, ["placement", "strategy", "transform", "open", "onOpenChange", "enableTriggerOnClick", "dismissOptions", "focusOptions", "roleOptions", "showArrow", "arrowRef", "arrowPadding", "enableDelayGroups", "transitionOptions", "customMiddleware", "disableAutoUpdate", "middlewareOptions", "listNavigationOptions"]);
35
+ var _q = (0, react_2.useState)("unmounted"), state = _q[0], setState = _q[1];
31
36
  var middlewares = [];
32
37
  var offsetConfig = middlewareOptions.offset;
33
38
  if ((offsetConfig === null || offsetConfig === void 0 ? void 0 : offsetConfig.enabled) !== false) {
@@ -57,7 +62,7 @@ var useFloatingPosition = function (_a) {
57
62
  if ((hideConfig === null || hideConfig === void 0 ? void 0 : hideConfig.enabled) === true) {
58
63
  middlewares.push((0, react_1.hide)(hideConfig === null || hideConfig === void 0 ? void 0 : hideConfig.config));
59
64
  }
60
- var _h = (0, react_1.useFloating)({
65
+ var _r = (0, react_1.useFloating)({
61
66
  placement: placement,
62
67
  strategy: strategy,
63
68
  transform: transform,
@@ -71,7 +76,7 @@ var useFloatingPosition = function (_a) {
71
76
  },
72
77
  whileElementsMounted: disableAutoUpdate ? undefined : react_1.autoUpdate,
73
78
  middleware: middlewares,
74
- }), context = _h.context, middlewareData = _h.middlewareData, isPositioned = _h.isPositioned, computedPlacement = _h.placement, update = _h.update, rest = __rest(_h, ["context", "middlewareData", "isPositioned", "placement", "update"]);
79
+ }), context = _r.context, middlewareData = _r.middlewareData, isPositioned = _r.isPositioned, computedPlacement = _r.placement, update = _r.update, rest = __rest(_r, ["context", "middlewareData", "isPositioned", "placement", "update"]);
75
80
  var delayGroupContext = (0, react_1.useDelayGroup)(context, {
76
81
  enabled: enableDelayGroups,
77
82
  });
@@ -107,14 +112,32 @@ var useFloatingPosition = function (_a) {
107
112
  var focus = (0, react_1.useFocus)(context, focusOptions);
108
113
  var role = (0, react_1.useRole)(context, roleOptions);
109
114
  var dismiss = (0, react_1.useDismiss)(context, dismissOptions);
115
+ // List navigation for keyboard support (arrow keys)
116
+ var listNavigation = (0, react_1.useListNavigation)(context, {
117
+ listRef: (_b = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.listRef) !== null && _b !== void 0 ? _b : { current: [] },
118
+ activeIndex: (_c = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.activeIndex) !== null && _c !== void 0 ? _c : null,
119
+ onNavigate: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.onNavigate,
120
+ loop: (_d = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.loop) !== null && _d !== void 0 ? _d : true,
121
+ virtual: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.virtual,
122
+ orientation: (_e = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.orientation) !== null && _e !== void 0 ? _e : "vertical",
123
+ focusItemOnOpen: (_f = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.focusItemOnOpen) !== null && _f !== void 0 ? _f : "auto",
124
+ focusItemOnHover: (_g = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.focusItemOnHover) !== null && _g !== void 0 ? _g : true,
125
+ openOnArrowKeyDown: (_h = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.openOnArrowKeyDown) !== null && _h !== void 0 ? _h : true,
126
+ disabledIndices: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.disabledIndices,
127
+ allowEscape: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.allowEscape,
128
+ cols: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.cols,
129
+ scrollItemIntoView: listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.scrollItemIntoView,
130
+ enabled: (_j = listNavigationOptions === null || listNavigationOptions === void 0 ? void 0 : listNavigationOptions.enabled) !== null && _j !== void 0 ? _j : false,
131
+ });
110
132
  var interactionProps = (0, react_1.useInteractions)([
111
133
  hover,
112
134
  click,
113
135
  focus,
114
136
  role,
115
137
  dismiss,
138
+ listNavigation,
116
139
  ]);
117
- var _j = (0, react_1.useTransitionStyles)(context, transitionOptions), isMounted = _j.isMounted, transitionStyles = _j.styles;
140
+ var _s = (0, react_1.useTransitionStyles)(context, transitionOptions), isMounted = _s.isMounted, transitionStyles = _s.styles;
118
141
  (0, react_2.useLayoutEffect)(function () {
119
142
  if (isPositioned && state !== "positioned") {
120
143
  setState("positioned");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.226.2",
3
+ "version": "2.227.1",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",