@geneui/components 3.0.0-next-e1bd79a-05032026 → 3.0.0-next-91e9add-19032026

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.
package/Accordion.js CHANGED
@@ -7,7 +7,7 @@ import { a as SvgChevronLeft, S as SvgChevronRight } from './ChevronRight-af87e2
7
7
  import Button from './Button.js';
8
8
  import Scrollbar from './Scrollbar.js';
9
9
  import Text from './Text.js';
10
- import { B as ButtonGroup } from './index-8724e0c0.js';
10
+ import { B as ButtonGroup } from './index-29bde3c5.js';
11
11
  import Tooltip from './Tooltip.js';
12
12
  import { u as useEllipsisDetection } from './useEllipsisDetection-c5f9b175.js';
13
13
  import { a as AccordionContext } from './Accordion-3e20a13f.js';
@@ -18,8 +18,8 @@ import './style-inject.es-746bb8ed.js';
18
18
  import 'prop-types';
19
19
  import 'react-dom';
20
20
  import './useDebounceCallback-999deae7.js';
21
- import './ButtonGroup-dd6816d7.js';
22
- import './PopoverBody-f9b55763.js';
21
+ import './ButtonGroup-711d215c.js';
22
+ import './PopoverBody-69518dcc.js';
23
23
  import './floating-ui.react-a6c3b969.js';
24
24
  import './Info-0f0741e0.js';
25
25
  import './X-20da3b4a.js';
package/Banner.js CHANGED
@@ -5,14 +5,14 @@ import { S as SvgInfo } from './Info-0f0741e0.js';
5
5
  import { S as SvgX } from './X-20da3b4a.js';
6
6
  import Button from './Button.js';
7
7
  import Text from './Text.js';
8
- import { B as ButtonGroup } from './index-8724e0c0.js';
8
+ import { B as ButtonGroup } from './index-29bde3c5.js';
9
9
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
10
10
  import './Banner-09cf6dea.js';
11
11
  import './Loader.js';
12
12
  import './style-inject.es-746bb8ed.js';
13
- import './ButtonGroup-dd6816d7.js';
13
+ import './ButtonGroup-711d215c.js';
14
14
  import './tslib.es6-f211516f.js';
15
- import './PopoverBody-f9b55763.js';
15
+ import './PopoverBody-69518dcc.js';
16
16
  import './floating-ui.react-a6c3b969.js';
17
17
  import 'react-dom';
18
18
  import './index-4159d61d.js';
@@ -2,7 +2,7 @@ import { _ as __rest } from './tslib.es6-f211516f.js';
2
2
  import React__default, { createContext, useState, useRef, useContext, useEffect, useCallback, useMemo, Children, cloneElement } from 'react';
3
3
  import { c as classNames } from './index-ce02421b.js';
4
4
  import Loader from './Loader.js';
5
- import { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
5
+ import { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
6
6
  import Scrollbar from './Scrollbar.js';
7
7
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
8
8
  import { a as useClickOutside } from './index-4159d61d.js';
package/ButtonGroup.js CHANGED
@@ -1,11 +1,11 @@
1
- export { B as default } from './index-8724e0c0.js';
2
- import './ButtonGroup-dd6816d7.js';
1
+ export { B as default } from './index-29bde3c5.js';
2
+ import './ButtonGroup-711d215c.js';
3
3
  import './tslib.es6-f211516f.js';
4
4
  import 'react';
5
5
  import './index-ce02421b.js';
6
6
  import './Loader.js';
7
7
  import './style-inject.es-746bb8ed.js';
8
- import './PopoverBody-f9b55763.js';
8
+ import './PopoverBody-69518dcc.js';
9
9
  import './floating-ui.react-a6c3b969.js';
10
10
  import 'react-dom';
11
11
  import './Info-0f0741e0.js';
package/DataCard.js CHANGED
@@ -6,8 +6,8 @@ import { S as Spreadsheet } from './index-4159d61d.js';
6
6
  import TextLink from './TextLink.js';
7
7
  import { K as KeyValue } from './KeyValue-2fdb0641.js';
8
8
  import { Key, Value } from './KeyValue.js';
9
- import { M as Menu } from './ButtonGroup-dd6816d7.js';
10
- import { M as MenuItem } from './index-8724e0c0.js';
9
+ import { M as Menu } from './ButtonGroup-711d215c.js';
10
+ import { M as MenuItem } from './index-29bde3c5.js';
11
11
  import './DataCard-3601ca38.js';
12
12
  import './Loader.js';
13
13
  import './style-inject.es-746bb8ed.js';
@@ -29,7 +29,7 @@ import './TextLink-ef998d00.js';
29
29
  import './Info.js';
30
30
  import './Info-0f0741e0.js';
31
31
  import './tslib.es6-f211516f.js';
32
- import './PopoverBody-f9b55763.js';
32
+ import './PopoverBody-69518dcc.js';
33
33
  import './X-20da3b4a.js';
34
34
  import './index-15303b91.js';
35
35
  import './ThreeDotsHorizontal-479c2b4b.js';
package/DataCardList.js CHANGED
@@ -28,11 +28,11 @@ import './KeyValue-2fdb0641.js';
28
28
  import './KeyValue.js';
29
29
  import './Info.js';
30
30
  import './Info-0f0741e0.js';
31
- import './ButtonGroup-dd6816d7.js';
31
+ import './ButtonGroup-711d215c.js';
32
32
  import './tslib.es6-f211516f.js';
33
- import './PopoverBody-f9b55763.js';
33
+ import './PopoverBody-69518dcc.js';
34
34
  import './X-20da3b4a.js';
35
- import './index-8724e0c0.js';
35
+ import './index-29bde3c5.js';
36
36
  import './index-15303b91.js';
37
37
  import './ThreeDotsHorizontal-479c2b4b.js';
38
38
  import './Text.js';
package/Drawer.js CHANGED
@@ -5,7 +5,7 @@ import { S as SvgX } from './X-20da3b4a.js';
5
5
  import Button from './Button.js';
6
6
  import Scrollbar from './Scrollbar.js';
7
7
  import Text from './Text.js';
8
- import { B as ButtonGroup } from './index-8724e0c0.js';
8
+ import { B as ButtonGroup } from './index-29bde3c5.js';
9
9
  import Tooltip from './Tooltip.js';
10
10
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
11
11
  import { u as useEllipsisDetection } from './useEllipsisDetection-c5f9b175.js';
@@ -15,9 +15,9 @@ import './Loader.js';
15
15
  import './style-inject.es-746bb8ed.js';
16
16
  import 'prop-types';
17
17
  import './useDebounceCallback-999deae7.js';
18
- import './ButtonGroup-dd6816d7.js';
18
+ import './ButtonGroup-711d215c.js';
19
19
  import './tslib.es6-f211516f.js';
20
- import './PopoverBody-f9b55763.js';
20
+ import './PopoverBody-69518dcc.js';
21
21
  import './floating-ui.react-a6c3b969.js';
22
22
  import './Info-0f0741e0.js';
23
23
  import './index-4159d61d.js';
package/Empty.js CHANGED
@@ -1,11 +1,11 @@
1
- export { E as default } from './index-8724e0c0.js';
2
- import './ButtonGroup-dd6816d7.js';
1
+ export { E as default } from './index-29bde3c5.js';
2
+ import './ButtonGroup-711d215c.js';
3
3
  import './tslib.es6-f211516f.js';
4
4
  import 'react';
5
5
  import './index-ce02421b.js';
6
6
  import './Loader.js';
7
7
  import './style-inject.es-746bb8ed.js';
8
- import './PopoverBody-f9b55763.js';
8
+ import './PopoverBody-69518dcc.js';
9
9
  import './floating-ui.react-a6c3b969.js';
10
10
  import 'react-dom';
11
11
  import './Info-0f0741e0.js';
package/GlobalHeader.js CHANGED
@@ -4,13 +4,13 @@ import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b
4
4
  import Button from './Button.js';
5
5
  import Divider from './Divider.js';
6
6
  import Logo from './Logo.js';
7
- import { P as Products } from './Products-5d602730.js';
7
+ import { P as Products } from './Products-2d8aa944.js';
8
8
  import { ProductsMainSection, Product, ProductsSecondarySection } from './Products.js';
9
9
  import Profile from './Profile.js';
10
10
  import Text from './Text.js';
11
11
  import { S as SvgCaretDownFilled } from './CaretDownFilled-924e7189.js';
12
12
  import Loader from './Loader.js';
13
- import { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
13
+ import { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
14
14
  import Scrollbar from './Scrollbar.js';
15
15
  import { P as PartnerItem } from './GlobalHeader-e3be2af9.js';
16
16
  import { a as useClickOutside } from './index-4159d61d.js';
@@ -30,9 +30,9 @@ import './X-20da3b4a.js';
30
30
  import 'prop-types';
31
31
  import './index-82e2cf4c.js';
32
32
  import './Avatar-243146ad.js';
33
- import './ButtonGroup-dd6816d7.js';
33
+ import './ButtonGroup-711d215c.js';
34
34
  import './tslib.es6-f211516f.js';
35
- import './index-8724e0c0.js';
35
+ import './index-29bde3c5.js';
36
36
  import './index-15303b91.js';
37
37
  import './ThreeDotsHorizontal-479c2b4b.js';
38
38
  import './index-a2688a52.js';
package/Image.js CHANGED
@@ -4,15 +4,15 @@ import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b
4
4
  import Button from './Button.js';
5
5
  import Loader from './Loader.js';
6
6
  import Text from './Text.js';
7
- import { B as ButtonGroup } from './index-8724e0c0.js';
7
+ import { B as ButtonGroup } from './index-29bde3c5.js';
8
8
  import Checkbox from './Checkbox.js';
9
9
  import Tooltip from './Tooltip.js';
10
10
  import { u as useEllipsisDetection } from './useEllipsisDetection-c5f9b175.js';
11
11
  import './Image-4f135206.js';
12
12
  import './style-inject.es-746bb8ed.js';
13
- import './ButtonGroup-dd6816d7.js';
13
+ import './ButtonGroup-711d215c.js';
14
14
  import './tslib.es6-f211516f.js';
15
- import './PopoverBody-f9b55763.js';
15
+ import './PopoverBody-69518dcc.js';
16
16
  import './floating-ui.react-a6c3b969.js';
17
17
  import 'react-dom';
18
18
  import './Info-0f0741e0.js';
package/Menu.js CHANGED
@@ -1,11 +1,11 @@
1
- export { M as Menu } from './ButtonGroup-dd6816d7.js';
2
- export { M as MenuItem } from './index-8724e0c0.js';
1
+ export { M as Menu } from './ButtonGroup-711d215c.js';
2
+ export { M as MenuItem } from './index-29bde3c5.js';
3
3
  import './tslib.es6-f211516f.js';
4
4
  import 'react';
5
5
  import './index-ce02421b.js';
6
6
  import './Loader.js';
7
7
  import './style-inject.es-746bb8ed.js';
8
- import './PopoverBody-f9b55763.js';
8
+ import './PopoverBody-69518dcc.js';
9
9
  import './floating-ui.react-a6c3b969.js';
10
10
  import 'react-dom';
11
11
  import './Info-0f0741e0.js';
package/Modal.js CHANGED
@@ -8,7 +8,7 @@ import { S as SvgX } from './X-20da3b4a.js';
8
8
  import Button from './Button.js';
9
9
  import Scrollbar from './Scrollbar.js';
10
10
  import Text from './Text.js';
11
- import { B as ButtonGroup } from './index-8724e0c0.js';
11
+ import { B as ButtonGroup } from './index-29bde3c5.js';
12
12
  import Tooltip from './Tooltip.js';
13
13
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
14
14
  import { u as useEllipsisDetection } from './useEllipsisDetection-c5f9b175.js';
@@ -18,9 +18,9 @@ import './Loader.js';
18
18
  import './style-inject.es-746bb8ed.js';
19
19
  import 'prop-types';
20
20
  import './useDebounceCallback-999deae7.js';
21
- import './ButtonGroup-dd6816d7.js';
21
+ import './ButtonGroup-711d215c.js';
22
22
  import './tslib.es6-f211516f.js';
23
- import './PopoverBody-f9b55763.js';
23
+ import './PopoverBody-69518dcc.js';
24
24
  import './floating-ui.react-a6c3b969.js';
25
25
  import './index-4159d61d.js';
26
26
  import './index-15303b91.js';
package/Navigation.js CHANGED
@@ -5,10 +5,10 @@ import { S as SvgPlus } from './Plus-f0726053.js';
5
5
  import { S as SvgThreeDotsHorizontal } from './ThreeDotsHorizontal-479c2b4b.js';
6
6
  import { S as SvgX } from './X-20da3b4a.js';
7
7
  import Button from './Button.js';
8
- import { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
8
+ import { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
9
9
  import Scrollbar from './Scrollbar.js';
10
- import { M as Menu } from './ButtonGroup-dd6816d7.js';
11
- import { M as MenuItem } from './index-8724e0c0.js';
10
+ import { M as Menu } from './ButtonGroup-711d215c.js';
11
+ import { M as MenuItem } from './index-29bde3c5.js';
12
12
  import { S as SvgChevronRight } from './ChevronRight-af87e2a4.js';
13
13
  import Text from './Text.js';
14
14
  import Tooltip from './Tooltip.js';
@@ -437,7 +437,7 @@ const Navigation = ({ className, open, onOpenChange, navigationData = [], active
437
437
  React__default.createElement("div", { className: "navigation__listItems", ref: navColRef }, clonedNavigationData === null || clonedNavigationData === void 0 ? void 0 : clonedNavigationData.map((item, index) => (React__default.createElement(Fragment, { key: `${item.title}-${item.path}` },
438
438
  React__default.createElement(NavigationColItem, { isVisible: index < maxVisibleItems, Icon: item.Icon, title: item.title, onClick: onNavigationColItemClick, index: index, path: item.path, opened: forceOpen, currentSelected: currentDataIndex === index, selected: index === (activePathIndex === null || activePathIndex === void 0 ? void 0 : activePathIndex[0]), onMouseEnter: onMouseEnterHandler, disabled: item.disabled, propsForPopover: hoverDataIndex === index ? propsForPopover : {}, hasChildren: item.children && item.children.length > 0, render: render, compact: compact }),
439
439
  hoverDataIndex !== null && item.children && item.children.length > 0 && (React__default.createElement(Popover, { setProps: setPropsForPopover, size: "small", position: "right-top", withArrow: true, trigger: "hover", margin: 20, disableReposition: false, ref: popoverRef },
440
- React__default.createElement(PopoverBody, { withPadding: false, withScrollbar: false },
440
+ React__default.createElement(PopoverBody, { withPadding: false, withScrollbar: false, className: "navigation__content" },
441
441
  React__default.createElement(NavigationMenuHeader, { title: clonedNavigationData[hoverDataIndex].title }),
442
442
  React__default.createElement(Scrollbar, null,
443
443
  React__default.createElement("div", { className: "navigation__items" },
package/Notification.js CHANGED
@@ -7,14 +7,14 @@ import { S as SvgTriangleAlert } from './TriangleAlert-ba250f4c.js';
7
7
  import { S as SvgX } from './X-20da3b4a.js';
8
8
  import Button from './Button.js';
9
9
  import Text from './Text.js';
10
- import { B as ButtonGroup } from './index-8724e0c0.js';
10
+ import { B as ButtonGroup } from './index-29bde3c5.js';
11
11
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
12
12
  import './Notification-c2697ece.js';
13
13
  import './Loader.js';
14
14
  import './style-inject.es-746bb8ed.js';
15
- import './ButtonGroup-dd6816d7.js';
15
+ import './ButtonGroup-711d215c.js';
16
16
  import './tslib.es6-f211516f.js';
17
- import './PopoverBody-f9b55763.js';
17
+ import './PopoverBody-69518dcc.js';
18
18
  import './floating-ui.react-a6c3b969.js';
19
19
  import './Info-0f0741e0.js';
20
20
  import './index-4159d61d.js';
@@ -112,7 +112,7 @@ const Notification = ({ className, open, variant = "toast", onClose, status = "i
112
112
  React__default.createElement("div", { className: "notification__textGroup" },
113
113
  title && (React__default.createElement(Text, { as: "h6", variant: "labelMediumSemibold", className: "notification__title" }, title)),
114
114
  description && (React__default.createElement(Text, { as: "p", variant: "bodyMediumMedium", className: "notification__description" }, description)))),
115
- React__default.createElement(Button, { appearance: "secondary", layout: "text", size: "small", className: "notification__button", onClick: onClose, Icon: SvgX })),
115
+ onClose && (React__default.createElement(Button, { appearance: "secondary", layout: "text", size: "small", className: "notification__button", onClick: onClose, Icon: SvgX }))),
116
116
  React__default.createElement(ButtonGroup, { className: "notification__actions", size: actionsButtonsSize },
117
117
  !!secondaryActionText && (React__default.createElement(Button, { appearance: "secondary", className: "notification__button", onClick: onSecondaryActionClick, layout: "text" }, secondaryActionText)),
118
118
  !!primaryActionText && (React__default.createElement(Button, { appearance: "primary", className: "notification__button", onClick: onPrimaryActionClick }, primaryActionText)))));
@@ -0,0 +1,63 @@
1
+ import React__default, { forwardRef, memo } from 'react';
2
+ import { c as classNames } from './index-ce02421b.js';
3
+ import { s as styleInject } from './style-inject.es-746bb8ed.js';
4
+
5
+ const OTP_LENGTH = 6;
6
+ const OTP_INDICES = Array.from({ length: OTP_LENGTH }, (_, i) => i);
7
+ const DIGIT_PATTERN = /^\d$/;
8
+ const helperTextSizeMap = {
9
+ large: "medium",
10
+ medium: "medium"
11
+ };
12
+ const createEmptyDigits = () => {
13
+ return Array.from({ length: OTP_LENGTH }, () => "");
14
+ };
15
+ const normalizeDigitsLength = (digits) => {
16
+ if (digits.length === OTP_LENGTH)
17
+ return digits;
18
+ if (digits.length > OTP_LENGTH) {
19
+ return digits.slice(0, OTP_LENGTH);
20
+ }
21
+ return [...digits, ...createEmptyDigits().slice(0, OTP_LENGTH - digits.length)];
22
+ };
23
+ const stringToDigits = (value) => {
24
+ const digits = createEmptyDigits();
25
+ if (value === undefined || value === "")
26
+ return digits;
27
+ if (typeof value === "number") {
28
+ if (!Number.isInteger(value) || value < 0)
29
+ return digits;
30
+ const str = String(value);
31
+ for (let i = 0; i < OTP_LENGTH && i < str.length; i += 1) {
32
+ digits[i] = str[i];
33
+ }
34
+ return digits;
35
+ }
36
+ const onlyDigits = value.replace(/\D/g, "");
37
+ for (let i = 0; i < OTP_LENGTH && i < onlyDigits.length; i += 1) {
38
+ digits[i] = onlyDigits[i];
39
+ }
40
+ return digits;
41
+ };
42
+ const digitsToString = (digits) => {
43
+ return digits.join("");
44
+ };
45
+
46
+ var css_248z$1 = ".otpFieldInput{align-items:center;background-color:initial;border:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-neutral-2);color:var(--guit-sem-color-foreground-neutral-2);display:flex;flex-shrink:0;font-family:var(--guit-sem-font-body-medium-default-medium-font-family);font-size:var(--guit-sem-font-body-medium-default-medium-font-size);font-weight:var(--guit-sem-font-body-medium-default-medium-font-weight);justify-content:center;line-height:var(--guit-sem-font-body-medium-default-medium-line-height);overflow:hidden;text-align:center}.otpFieldInput_size_large{border-radius:var(--guit-ref-radius-2xsmall);height:var(--guit-sem-dimension-height-large);width:var(--guit-sem-dimension-width-large)}.otpFieldInput_size_medium{border-radius:var(--guit-ref-radius-3xsmall);height:var(--guit-sem-dimension-height-medium);width:var(--guit-sem-dimension-width-medium)}.otpFieldInput_status_error{border-color:var(--guit-sem-color-border-error)}.otpFieldInput_disabled{border-color:var(--guit-sem-color-border-disabled-1);color:var(--guit-sem-color-foreground-disabled);pointer-events:none;-webkit-user-select:none;user-select:none}";
47
+ styleInject(css_248z$1);
48
+
49
+ const OTPFieldInputBase = forwardRef(({ className, index, size, status = "rest", disabled, autoComplete, value, onChange, onKeyDown, onFocus, onBlur, onClick, "aria-label": ariaLabel }, ref) => {
50
+ const inputClassName = classNames("otpFieldInput", `otpFieldInput_size_${size}`, {
51
+ [`otpFieldInput_status_${status}`]: !disabled,
52
+ otpFieldInput_disabled: disabled
53
+ }, className);
54
+ return (React__default.createElement("input", { ref: ref, "data-index": index, type: "text", inputMode: "numeric", autoComplete: autoComplete, className: inputClassName, disabled: disabled, value: value, onChange: onChange, onKeyDown: onKeyDown, onFocus: onFocus, onBlur: onBlur, onClick: onClick, "aria-label": ariaLabel }));
55
+ });
56
+ OTPFieldInputBase.displayName = "OTPFieldInputBase";
57
+ const OTPFieldInput = memo(OTPFieldInputBase);
58
+ OTPFieldInput.displayName = "OTPFieldInput";
59
+
60
+ var css_248z = ".otpField{display:flex;flex-direction:column;gap:var(--guit-ref-spacing-large);width:100%}.otpField_size_large{max-width:28rem}.otpField_size_medium{max-width:23.2rem}.otpField__wrapper{display:flex;flex-direction:column;gap:var(--guit-ref-spacing-3xsmall)}.otpField__content,.otpField__textFieldWrapper{display:flex;gap:var(--guit-ref-spacing-xsmall)}.otpField__helperText{flex:1;min-width:var(--guit-ref-spacing-xsmall)}.otpField__timer{-webkit-margin-start:auto;flex:0 0 auto;margin-inline-start:auto}.otpField__timer_disabled{color:var(--guit-sem-color-foreground-disabled)}";
61
+ styleInject(css_248z);
62
+
63
+ export { DIGIT_PATTERN as D, OTP_LENGTH as O, OTP_INDICES as a, OTPFieldInput as b, digitsToString as d, helperTextSizeMap as h, normalizeDigitsLength as n, stringToDigits as s };
package/OTPField.js ADDED
@@ -0,0 +1,230 @@
1
+ import React__default, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
2
+ import { c as classNames } from './index-ce02421b.js';
3
+ import HelperText from './HelperText.js';
4
+ import Text from './Text.js';
5
+ import Notification from './Notification.js';
6
+ import { s as stringToDigits, n as normalizeDigitsLength, d as digitsToString, O as OTP_LENGTH, D as DIGIT_PATTERN, a as OTP_INDICES, b as OTPFieldInput, h as helperTextSizeMap } from './OTPField-af15abb1.js';
7
+ import './ErrorFilled-f4226310.js';
8
+ import './ActivityRecent-b88e2ba8.js';
9
+ import './TriangleAlert-ba250f4c.js';
10
+ import './style-inject.es-746bb8ed.js';
11
+ import 'react-dom';
12
+ import './X-20da3b4a.js';
13
+ import './Button.js';
14
+ import './Loader.js';
15
+ import './index-29bde3c5.js';
16
+ import './ButtonGroup-711d215c.js';
17
+ import './tslib.es6-f211516f.js';
18
+ import './PopoverBody-69518dcc.js';
19
+ import './floating-ui.react-a6c3b969.js';
20
+ import './Info-0f0741e0.js';
21
+ import './index-4159d61d.js';
22
+ import './Scrollbar.js';
23
+ import 'prop-types';
24
+ import './useDebounceCallback-999deae7.js';
25
+ import './index-f83efe58.js';
26
+ import './useWindowSize-6faa0d0f.js';
27
+ import './useDeviceInfo-8340f573.js';
28
+ import './index-15303b91.js';
29
+ import './ThreeDotsHorizontal-479c2b4b.js';
30
+ import './index-a2688a52.js';
31
+ import './CheckMark-34798545.js';
32
+ import './ChevronRight-af87e2a4.js';
33
+ import './Divider.js';
34
+ import './Divider-047dfad9.js';
35
+ import './Notification-c2697ece.js';
36
+
37
+ const formatTime = (totalSeconds) => {
38
+ const minutes = Math.floor(totalSeconds / 60);
39
+ const seconds = totalSeconds % 60;
40
+ return `${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
41
+ };
42
+ const useCountdown = ({ duration, onExpire }) => {
43
+ const [remaining, setRemaining] = useState(duration);
44
+ const onExpireRef = useRef(onExpire);
45
+ onExpireRef.current = onExpire;
46
+ useEffect(() => {
47
+ setRemaining(duration);
48
+ }, [duration]);
49
+ /* eslint consistent-return: off */
50
+ useEffect(() => {
51
+ var _a;
52
+ // Do not run countdown logic when duration is zero or negative.
53
+ if (duration <= 0) {
54
+ if (remaining !== 0) {
55
+ setRemaining(0);
56
+ }
57
+ return;
58
+ }
59
+ if (remaining <= 0) {
60
+ (_a = onExpireRef.current) === null || _a === void 0 ? void 0 : _a.call(onExpireRef);
61
+ return;
62
+ }
63
+ const intervalId = setInterval(() => {
64
+ setRemaining((prev) => {
65
+ if (prev <= 1) {
66
+ clearInterval(intervalId);
67
+ return 0;
68
+ }
69
+ return prev - 1;
70
+ });
71
+ }, 1000);
72
+ return () => {
73
+ clearInterval(intervalId);
74
+ };
75
+ }, [remaining, duration]);
76
+ return {
77
+ remaining,
78
+ formatted: formatTime(remaining),
79
+ isExpired: remaining <= 0
80
+ };
81
+ };
82
+
83
+ /**
84
+ * The OTP Field component is an input field designed for entering a one-time password, often used for multi-factor authentication. The OTP Field component ensures that applications can securely verify user actions and identities, thereby protecting against unauthorized access and enhancing overall security.
85
+ */
86
+ const OTPField = ({ className, size = "large", value: controlledValue, defaultValue = "", disabled = false, status = "rest", helperText, timerDuration, onTimerExpire, notification, onChange, onComplete, onFocus, onBlur, autoFocus = false }) => {
87
+ const isControlled = controlledValue !== undefined;
88
+ const [internalDigits, setInternalDigits] = useState(() => stringToDigits(isControlled ? controlledValue : defaultValue));
89
+ const inputRefs = useRef([]);
90
+ const lastEmittedValue = useRef(isControlled ? String(controlledValue !== null && controlledValue !== void 0 ? controlledValue : "") : "");
91
+ // Refs for handler stability — handlers read the latest values without re-creating.
92
+ const digitsRef = useRef([]);
93
+ const onChangeRef = useRef(onChange);
94
+ const onCompleteRef = useRef(onComplete);
95
+ const onFocusRef = useRef(onFocus);
96
+ const onBlurRef = useRef(onBlur);
97
+ onChangeRef.current = onChange;
98
+ onCompleteRef.current = onComplete;
99
+ onFocusRef.current = onFocus;
100
+ onBlurRef.current = onBlur;
101
+ useEffect(() => {
102
+ if (isControlled && String(controlledValue) !== lastEmittedValue.current) {
103
+ setInternalDigits(stringToDigits(controlledValue));
104
+ }
105
+ }, [controlledValue, isControlled]);
106
+ const digits = useMemo(() => normalizeDigitsLength(internalDigits), [internalDigits]);
107
+ digitsRef.current = digits;
108
+ const htSize = helperTextSizeMap[size];
109
+ const { formatted: timerFormatted } = useCountdown({
110
+ duration: timerDuration !== null && timerDuration !== void 0 ? timerDuration : 0,
111
+ onExpire: onTimerExpire
112
+ });
113
+ const showTimer = timerDuration !== undefined && timerDuration > 0;
114
+ const emitValueChange = useCallback((nextDigits) => {
115
+ var _a, _b;
116
+ const normalized = normalizeDigitsLength(nextDigits);
117
+ const nextValue = digitsToString(normalized);
118
+ lastEmittedValue.current = nextValue;
119
+ setInternalDigits(normalized);
120
+ (_a = onChangeRef.current) === null || _a === void 0 ? void 0 : _a.call(onChangeRef, nextValue);
121
+ if (nextValue.length === OTP_LENGTH) {
122
+ (_b = onCompleteRef.current) === null || _b === void 0 ? void 0 : _b.call(onCompleteRef, nextValue);
123
+ }
124
+ }, []);
125
+ const focusInput = useCallback((index) => {
126
+ var _a;
127
+ const clamped = Math.max(0, Math.min(index, OTP_LENGTH - 1));
128
+ (_a = inputRefs.current[clamped]) === null || _a === void 0 ? void 0 : _a.focus();
129
+ }, []);
130
+ useEffect(() => {
131
+ if (autoFocus && !disabled) {
132
+ focusInput(0);
133
+ }
134
+ }, [autoFocus, disabled, focusInput]);
135
+ const handleInputFocus = useCallback((event) => {
136
+ var _a;
137
+ if (!disabled) {
138
+ event.currentTarget.select();
139
+ }
140
+ (_a = onFocusRef.current) === null || _a === void 0 ? void 0 : _a.call(onFocusRef, event);
141
+ }, [disabled]);
142
+ const handleInputClick = useCallback((event) => {
143
+ if (!disabled) {
144
+ event.currentTarget.select();
145
+ }
146
+ }, [disabled]);
147
+ const handleInputBlur = useCallback((event) => {
148
+ var _a;
149
+ (_a = onBlurRef.current) === null || _a === void 0 ? void 0 : _a.call(onBlurRef, event);
150
+ }, []);
151
+ const handleChange = useCallback((event) => {
152
+ if (disabled)
153
+ return;
154
+ const index = Number(event.currentTarget.dataset.index);
155
+ const inputValue = event.target.value;
156
+ const nextDigits = [...digitsRef.current];
157
+ if (inputValue === "") {
158
+ nextDigits[index] = "";
159
+ emitValueChange(nextDigits);
160
+ return;
161
+ }
162
+ const digit = inputValue.slice(-1);
163
+ if (!DIGIT_PATTERN.test(digit))
164
+ return;
165
+ nextDigits[index] = digit;
166
+ emitValueChange(nextDigits);
167
+ if (index < OTP_LENGTH - 1) {
168
+ focusInput(index + 1);
169
+ }
170
+ }, [disabled, emitValueChange, focusInput]);
171
+ const handleKeyDown = useCallback((event) => {
172
+ if (disabled)
173
+ return;
174
+ const index = Number(event.currentTarget.dataset.index);
175
+ if (event.key === "Backspace") {
176
+ event.preventDefault();
177
+ const nextDigits = [...digitsRef.current];
178
+ if (nextDigits[index]) {
179
+ nextDigits[index] = "";
180
+ emitValueChange(nextDigits);
181
+ }
182
+ else if (index > 0) {
183
+ nextDigits[index - 1] = "";
184
+ emitValueChange(nextDigits);
185
+ focusInput(index - 1);
186
+ }
187
+ }
188
+ else if (event.key === "ArrowLeft") {
189
+ event.preventDefault();
190
+ focusInput(index - 1);
191
+ }
192
+ else if (event.key === "ArrowRight") {
193
+ event.preventDefault();
194
+ focusInput(index + 1);
195
+ }
196
+ }, [disabled, emitValueChange, focusInput]);
197
+ const handlePaste = useCallback((event) => {
198
+ event.preventDefault();
199
+ if (disabled)
200
+ return;
201
+ const pasted = event.clipboardData.getData("text").replace(/\D/g, "").slice(0, OTP_LENGTH);
202
+ const nextDigits = [...digitsRef.current];
203
+ for (let i = 0; i < OTP_LENGTH && i < pasted.length; i += 1) {
204
+ nextDigits[i] = pasted[i];
205
+ }
206
+ emitValueChange(nextDigits);
207
+ const lastIndex = Math.min(pasted.length - 1, OTP_LENGTH - 1);
208
+ if (lastIndex >= 0) {
209
+ focusInput(lastIndex);
210
+ }
211
+ }, [disabled, emitValueChange, focusInput]);
212
+ const refCallbacks = useMemo(() => Array.from({ length: OTP_LENGTH }, (_, i) => (el) => {
213
+ inputRefs.current[i] = el;
214
+ }), []);
215
+ const showNotification = status === "error" && !!notification;
216
+ return (React__default.createElement("div", { className: classNames("otpField", `otpField_size_${size}`, className) },
217
+ React__default.createElement("div", { className: "otpField__wrapper" },
218
+ React__default.createElement("div", { className: "otpField__textFieldWrapper", role: "group", "aria-label": "One-time password", "aria-invalid": status === "error" || undefined, onPaste: handlePaste }, OTP_INDICES.map((index) => {
219
+ var _a;
220
+ return (React__default.createElement(OTPFieldInput, { key: index, ref: refCallbacks[index], index: index, className: "otpField__textField", size: size, value: (_a = digits[index]) !== null && _a !== void 0 ? _a : "", disabled: disabled, status: status, autoComplete: index === 0 ? "one-time-code" : "off", onChange: handleChange, onKeyDown: handleKeyDown, onFocus: handleInputFocus, onBlur: handleInputBlur, onClick: handleInputClick, "aria-label": `Digit ${index + 1} of ${OTP_LENGTH}` }));
221
+ })),
222
+ (helperText || showTimer) && (React__default.createElement("div", { className: "otpField__content" },
223
+ helperText && (React__default.createElement(HelperText, { className: "otpField__helperText", text: helperText, disabled: disabled, size: htSize })),
224
+ showTimer && (React__default.createElement(Text, { className: classNames("otpField__timer", {
225
+ otpField__timer_disabled: disabled
226
+ }), as: "span", variant: "bodyMediumMedium" }, timerFormatted))))),
227
+ showNotification && (React__default.createElement(Notification, { variant: "sectionMessage", open: true, status: "error", description: notification }))));
228
+ };
229
+
230
+ export { OTPField as default };
package/Popover.js CHANGED
@@ -1,4 +1,4 @@
1
- export { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
1
+ export { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
2
2
  import React__default from 'react';
3
3
  import './floating-ui.react-a6c3b969.js';
4
4
  import 'react-dom';
@@ -9,7 +9,7 @@ import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
9
9
  import { s as styleInject } from './style-inject.es-746bb8ed.js';
10
10
  import Scrollbar from './Scrollbar.js';
11
11
 
12
- var css_248z = ".popover{background-color:var(--guit-sem-color-background-neutral-1-nudge);border-top-left-radius:var(--guit-ref-radius-2xsmall);border-top-right-radius:var(--guit-ref-radius-2xsmall);filter:drop-shadow(var(--guit-sem-shadow-floating-2-position-x-1) var(--guit-sem-shadow-floating-2-position-y-1) var(--guit-sem-shadow-floating-2-blur-1) var(--guit-sem-color-floating-2-rgba-1)) drop-shadow(var(--guit-sem-shadow-floating-2-position-x-2) var(--guit-sem-shadow-floating-2-position-y-2) var(--guit-sem-shadow-floating-2-blur-2) var(--guit-sem-color-floating-2-rgba-2))}.popover:not(.popover_size_mobile){border-bottom-left-radius:var(--guit-ref-radius-2xsmall);border-bottom-right-radius:var(--guit-ref-radius-2xsmall)}.popover:not(.popover_size_mobile) .popover__arrow{position:absolute}.popover:not(.popover_size_mobile) .popover__arrowPath{fill:var(--guit-sem-color-background-neutral-1-nudge)}.popover_position_top .popover__arrow{transform:rotate(180deg)}.popover_position_bottom .popover__arrow{transform:rotate(0deg)}.popover_position_left .popover__arrow{transform:rotate(90deg)}.popover_position_right .popover__arrow{transform:rotate(-90deg)}.popover_size_xLarge .popover__container{max-height:82rem;max-width:82rem;min-width:64rem}.popover_size_large .popover__container{max-height:64rem;max-width:64rem;min-width:52rem}.popover_size_medium .popover__container{max-height:52rem;max-width:52rem;min-width:28rem}.popover_size_small .popover__container{max-height:52rem;max-width:28rem;min-width:16rem}.popover_size_large .popover__footer,.popover_size_xLarge .popover__footer{height:6.4rem}.popover_size_fitContent{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.popover_size_reference{min-width:auto;width:var(--parent-width)}.popover__container{display:grid;grid-template-rows:auto 1fr auto}.popover__container_height_full{display:flex;flex-direction:column;height:100%;justify-content:space-between}.popover__header{border-bottom:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-neutral-2);flex:none;height:4.8rem;justify-content:space-between;padding-inline:var(--guit-ref-spacing-large)}.popover__header,.popover__title{align-items:center;column-gap:var(--guit-ref-spacing-xsmall);display:flex;overflow:hidden}.popover__title{color:var(--guit-sem-color-foreground-neutral-2);flex:1}.popover__title_icon{flex:0 0 auto}.popover__title_text{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family),sans-serif;font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-semibold-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.popover__close{flex:0 0 auto}.popover__body{flex:1;height:100%;min-height:0;min-width:0}.popover__body_withPadding{padding-block:var(--guit-ref-spacing-large);padding-inline:var(--guit-ref-spacing-large)}.popover__content{height:100%;width:100%}.popover__footer{border-top:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-neutral-2);flex:none;justify-content:space-between;overflow:hidden;padding-block:var(--guit-ref-spacing-large);padding-inline:var(--guit-ref-spacing-large)}.popover__footer,.popover__footer_buttons{align-items:center;column-gap:var(--guit-ref-spacing-xsmall);display:flex}.popover__footer_buttons{-webkit-margin-start:auto;margin-inline-start:auto}";
12
+ var css_248z = ".popover{background-color:var(--guit-sem-color-background-neutral-1-nudge);border-top-left-radius:var(--guit-ref-radius-2xsmall);border-top-right-radius:var(--guit-ref-radius-2xsmall);filter:drop-shadow(var(--guit-sem-shadow-floating-2-position-x-1) var(--guit-sem-shadow-floating-2-position-y-1) var(--guit-sem-shadow-floating-2-blur-1) var(--guit-sem-color-floating-2-rgba-1)) drop-shadow(var(--guit-sem-shadow-floating-2-position-x-2) var(--guit-sem-shadow-floating-2-position-y-2) var(--guit-sem-shadow-floating-2-blur-2) var(--guit-sem-color-floating-2-rgba-2))}.popover:not(.popover_size_mobile){border-bottom-left-radius:var(--guit-ref-radius-2xsmall);border-bottom-right-radius:var(--guit-ref-radius-2xsmall)}.popover:not(.popover_size_mobile) .popover__arrow{position:absolute}.popover:not(.popover_size_mobile) .popover__arrowPath{fill:var(--guit-sem-color-background-neutral-1-nudge)}.popover_position_top .popover__arrow{transform:rotate(180deg)}.popover_position_bottom .popover__arrow{transform:rotate(0deg)}.popover_position_left .popover__arrow{transform:rotate(90deg)}.popover_position_right .popover__arrow{transform:rotate(-90deg)}.popover_size_xLarge .popover__container{max-height:82rem;max-width:82rem;min-width:64rem}.popover_size_large .popover__container{max-height:64rem;max-width:64rem;min-width:52rem}.popover_size_medium .popover__container{max-height:52rem;max-width:52rem;min-width:28rem}.popover_size_small .popover__container{max-height:52rem;max-width:28rem;min-width:16rem}.popover_size_large .popover__footer,.popover_size_xLarge .popover__footer{height:6.4rem}.popover_size_fitContent{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.popover_size_reference{min-width:auto;width:var(--parent-width)}.popover__container{display:grid;grid-template-rows:auto 1fr auto}.popover__container_height_full{display:flex;flex-direction:column;height:100%;justify-content:space-between}.popover__header{border-bottom:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-neutral-2);flex:none;height:4.8rem;justify-content:space-between;padding-inline:var(--guit-ref-spacing-large)}.popover__header,.popover__title{align-items:center;column-gap:var(--guit-ref-spacing-xsmall);display:flex;overflow:hidden}.popover__title{color:var(--guit-sem-color-foreground-neutral-2);flex:1}.popover__title_icon{flex:0 0 auto}.popover__title_text{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family),sans-serif;font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-semibold-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.popover__close{flex:0 0 auto}.popover__body{flex:1;height:100%;min-height:0;min-width:0}.popover__body_withPadding{padding-block:var(--guit-ref-spacing-large);padding-inline:var(--guit-ref-spacing-large)}.popover__footer{border-top:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-neutral-2);flex:none;justify-content:space-between;overflow:hidden;padding-block:var(--guit-ref-spacing-large);padding-inline:var(--guit-ref-spacing-large)}.popover__footer,.popover__footer_buttons{align-items:center;column-gap:var(--guit-ref-spacing-xsmall);display:flex}.popover__footer_buttons{-webkit-margin-start:auto;margin-inline-start:auto}";
13
13
  styleInject(css_248z);
14
14
 
15
15
  const getPositionRect = (currentPopoverRect, position) => {
@@ -314,8 +314,7 @@ const Popover = forwardRef(({ size = "medium", fitReference, position = "bottom-
314
314
  });
315
315
 
316
316
  const PopoverBody = ({ children, withPadding = true, className, withScrollbar = true }) => {
317
- return (React__default.createElement("div", { className: classNames("popover__body", { popover__body_withPadding: withPadding }, className) },
318
- React__default.createElement("div", { className: "popover__content navigation__content" }, withScrollbar ? React__default.createElement(Scrollbar, null, children) : children)));
317
+ return (React__default.createElement("div", { className: classNames("popover__body", { popover__body_withPadding: withPadding }, className) }, withScrollbar ? React__default.createElement(Scrollbar, null, children) : children));
319
318
  };
320
319
 
321
320
  export { Popover as P, PopoverBody as a };
@@ -2,7 +2,7 @@ import React__default, { createContext, useContext, useState, useRef, useMemo }
2
2
  import { c as classNames } from './index-ce02421b.js';
3
3
  import { _ as _objectWithoutProperties, a as _extends } from './ActivityRecent-b88e2ba8.js';
4
4
  import Button from './Button.js';
5
- import { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
5
+ import { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
6
6
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
7
7
  import { a as useClickOutside } from './index-4159d61d.js';
8
8
  import { s as styleInject } from './style-inject.es-746bb8ed.js';
package/Products.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ProductsContext } from './Products-5d602730.js';
2
- export { P as Products } from './Products-5d602730.js';
1
+ import { a as ProductsContext } from './Products-2d8aa944.js';
2
+ export { P as Products } from './Products-2d8aa944.js';
3
3
  import React__default, { useContext, isValidElement, cloneElement } from 'react';
4
4
  import { c as classNames } from './index-ce02421b.js';
5
5
  import Badge from './Badge.js';
@@ -9,7 +9,7 @@ import './ActivityRecent-b88e2ba8.js';
9
9
  import './Button.js';
10
10
  import './Loader.js';
11
11
  import './style-inject.es-746bb8ed.js';
12
- import './PopoverBody-f9b55763.js';
12
+ import './PopoverBody-69518dcc.js';
13
13
  import './floating-ui.react-a6c3b969.js';
14
14
  import 'react-dom';
15
15
  import './Info-0f0741e0.js';
package/Profile.js CHANGED
@@ -2,8 +2,8 @@ import React__default, { useState, useContext } from 'react';
2
2
  import { c as classNames } from './index-ce02421b.js';
3
3
  import { S as SvgCaretDownFilled } from './CaretDownFilled-924e7189.js';
4
4
  import { A as Avatar, S as SvgPersonFilled } from './index-82e2cf4c.js';
5
- import { M as Menu } from './ButtonGroup-dd6816d7.js';
6
- import { M as MenuItem } from './index-8724e0c0.js';
5
+ import { M as Menu } from './ButtonGroup-711d215c.js';
6
+ import { M as MenuItem } from './index-29bde3c5.js';
7
7
  import { a as GeneUIDesignSystemContext } from './index-f83efe58.js';
8
8
  import './Profile-e9e508cb.js';
9
9
  import './ActivityRecent-b88e2ba8.js';
@@ -11,7 +11,7 @@ import './Avatar-243146ad.js';
11
11
  import './style-inject.es-746bb8ed.js';
12
12
  import './tslib.es6-f211516f.js';
13
13
  import './Loader.js';
14
- import './PopoverBody-f9b55763.js';
14
+ import './PopoverBody-69518dcc.js';
15
15
  import './floating-ui.react-a6c3b969.js';
16
16
  import 'react-dom';
17
17
  import './Info-0f0741e0.js';
@@ -16,14 +16,14 @@ import './Logo-0b408682.js';
16
16
  import './Rate-f5be2365.js';
17
17
  import Text from './Text.js';
18
18
  import './TextLink-ef998d00.js';
19
- import './PopoverBody-f9b55763.js';
19
+ import './PopoverBody-69518dcc.js';
20
20
  import './Scrollbar.js';
21
21
  import './Badge-3f37427d.js';
22
22
  import './Grid-6fd088b8.js';
23
23
  import './Skeleton-d7cc727c.js';
24
24
  import 'react-dom';
25
25
  import './index-4159d61d.js';
26
- import './ButtonGroup-dd6816d7.js';
26
+ import './ButtonGroup-711d215c.js';
27
27
  import './SplitButton-65849c84.js';
28
28
  import './Tabs-e8fccd4f.js';
29
29
  import './ProgressBar-f544bfa4.js';
@@ -31,7 +31,7 @@ import './Steps-b3f53e8c.js';
31
31
  import './Tag-8d30266b.js';
32
32
  import './Switch-24ef29ea.js';
33
33
  import './Timeline-3f100bf0.js';
34
- import './Products-5d602730.js';
34
+ import './Products-2d8aa944.js';
35
35
  import './QRCode-4620857a.js';
36
36
  import './KeyValue-2fdb0641.js';
37
37
  import './tslib.es6-f211516f.js';
@@ -56,6 +56,7 @@ import './NumberField-2d272636.js';
56
56
  import './InteractiveCard-05c16126.js';
57
57
  import './Section-513d5f5a.js';
58
58
  import './Image-4f135206.js';
59
+ import './OTPField-af15abb1.js';
59
60
  import './GlobalHeader-e3be2af9.js';
60
61
  import './DataCardList-eb674418.js';
61
62
  import './useEllipsisDetection-c5f9b175.js';
package/SplitButton.js CHANGED
@@ -3,13 +3,13 @@ import { c as classNames } from './index-ce02421b.js';
3
3
  import { S as SvgCaretDownFilled } from './CaretDownFilled-924e7189.js';
4
4
  import Button from './Button.js';
5
5
  import Loader from './Loader.js';
6
- import { M as Menu } from './ButtonGroup-dd6816d7.js';
7
- import { M as MenuItem } from './index-8724e0c0.js';
6
+ import { M as Menu } from './ButtonGroup-711d215c.js';
7
+ import { M as MenuItem } from './index-29bde3c5.js';
8
8
  import './SplitButton-65849c84.js';
9
9
  import './ActivityRecent-b88e2ba8.js';
10
10
  import './style-inject.es-746bb8ed.js';
11
11
  import './tslib.es6-f211516f.js';
12
- import './PopoverBody-f9b55763.js';
12
+ import './PopoverBody-69518dcc.js';
13
13
  import './floating-ui.react-a6c3b969.js';
14
14
  import 'react-dom';
15
15
  import './Info-0f0741e0.js';
@@ -46,6 +46,9 @@ interface INotificationProps {
46
46
  secondaryActionText?: string;
47
47
  /**
48
48
  * Callback function triggered when the close (X) button is clicked.
49
+ * When provided, the close (X) button is displayed; when omitted, the button is hidden.
50
+ * Use this to control whether the notification can be manually dismissed (e.g. persistent
51
+ * form errors vs. dismissible toasts).
49
52
  */
50
53
  onClose?: () => void;
51
54
  /**
@@ -0,0 +1,77 @@
1
+ import { FC, FocusEvent } from "react";
2
+ import { IOTPFieldInputProps } from "@components/molecules/OTPField/OTPFieldInput/OTPFieldInput";
3
+ import "./OTPField.scss";
4
+ interface IOTPFieldProps {
5
+ /**
6
+ * Additional class for the parent element.
7
+ * This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
8
+ */
9
+ className?: string;
10
+ /**
11
+ * Size of the OTP input boxes.<br>
12
+ */
13
+ size?: IOTPFieldInputProps["size"];
14
+ /**
15
+ * Controlled value. Each character maps to one digit input.
16
+ * Accepts a string (`"1234"`) or a non-negative integer (`1234`).
17
+ */
18
+ value?: string | number;
19
+ /**
20
+ * Default value for uncontrolled usage.
21
+ * Accepts a string (`"1234"`) or a non-negative integer (`1234`).
22
+ */
23
+ defaultValue?: string | number;
24
+ /**
25
+ * Disables the OTP field, preventing interaction.
26
+ */
27
+ disabled?: boolean;
28
+ /**
29
+ * Determines the input appearance based on its status.<br>
30
+ */
31
+ status?: "rest" | "error";
32
+ /**
33
+ * Helper text displayed below the inputs (e.g. "Code is valid for").
34
+ */
35
+ helperText?: string;
36
+ /**
37
+ * Countdown duration in seconds (e.g. `180` for 3 minutes).
38
+ * When provided, the component starts an internal countdown timer displayed as `MM:SS` next to the helper text.
39
+ */
40
+ timerDuration?: number;
41
+ /**
42
+ * Callback fired when the countdown timer reaches zero.
43
+ */
44
+ onTimerExpire?: () => void;
45
+ /**
46
+ * Error notification description. Displayed as an inline `sectionMessage` when `status` is `error`.
47
+ */
48
+ notification?: string;
49
+ /**
50
+ * Callback when the value changes.
51
+ * @param value - The current OTP string
52
+ */
53
+ onChange?: (value: string) => void;
54
+ /**
55
+ * Callback when all digits have been entered.
56
+ * @param value - The complete OTP string
57
+ */
58
+ onComplete?: (value: string) => void;
59
+ /**
60
+ * Callback when an input receives focus.
61
+ */
62
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
63
+ /**
64
+ * Callback when an input loses focus.
65
+ */
66
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
67
+ /**
68
+ * When `true`, focuses the first OTP input on mount (if not disabled).<br>
69
+ * Default is `false`.
70
+ */
71
+ autoFocus?: boolean;
72
+ }
73
+ /**
74
+ * The OTP Field component is an input field designed for entering a one-time password, often used for multi-factor authentication. The OTP Field component ensures that applications can securely verify user actions and identities, thereby protecting against unauthorized access and enhancing overall security.
75
+ */
76
+ declare const OTPField: FC<IOTPFieldProps>;
77
+ export { IOTPFieldProps, OTPField as default };
@@ -0,0 +1,58 @@
1
+ import React, { ChangeEvent, FocusEvent, KeyboardEvent, MouseEvent } from "react";
2
+ import "./OTPFieldInput.scss";
3
+ interface IOTPFieldInputProps {
4
+ /**
5
+ * Additional class for the input element. Use for placement using BEM conventions.
6
+ */
7
+ className?: string;
8
+ /**
9
+ * Position index within the OTP group. Rendered as `data-index` for event delegation.
10
+ */
11
+ index: number;
12
+ /**
13
+ * Size of the OTP input box.<br>
14
+ */
15
+ size: "large" | "medium";
16
+ /**
17
+ * Visual state of the input.<br>
18
+ */
19
+ status?: "rest" | "error";
20
+ /**
21
+ * Whether the input is disabled.
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * HTML autocomplete attribute.
26
+ */
27
+ autoComplete?: string;
28
+ /**
29
+ * Current value of the input.
30
+ */
31
+ value: string;
32
+ /**
33
+ * Change handler for the input.
34
+ */
35
+ onChange: (event: ChangeEvent<HTMLInputElement>) => void;
36
+ /**
37
+ * Key down handler for the input.
38
+ */
39
+ onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
40
+ /**
41
+ * Focus handler for the input.
42
+ */
43
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
44
+ /**
45
+ * Blur handler for the input.
46
+ */
47
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
48
+ /**
49
+ * Click handler for the input.
50
+ */
51
+ onClick?: (event: MouseEvent<HTMLInputElement>) => void;
52
+ /**
53
+ * Accessible label for screen readers.
54
+ */
55
+ "aria-label": string;
56
+ }
57
+ declare const OTPFieldInput: React.MemoExoticComponent<React.ForwardRefExoticComponent<IOTPFieldInputProps & React.RefAttributes<HTMLInputElement>>>;
58
+ export { IOTPFieldInputProps, OTPFieldInput as default };
@@ -0,0 +1,16 @@
1
+ interface IUseCountdownOptions {
2
+ /** Duration in seconds to count down from. */
3
+ duration: number;
4
+ /** Callback fired when countdown reaches zero. */
5
+ onExpire?: () => void;
6
+ }
7
+ interface IUseCountdownReturn {
8
+ /** Remaining seconds. */
9
+ remaining: number;
10
+ /** Formatted time string as `MM:SS`. */
11
+ formatted: string;
12
+ /** Whether the countdown has expired (reached zero). */
13
+ isExpired: boolean;
14
+ }
15
+ declare const useCountdown: ({ duration, onExpire }: IUseCountdownOptions) => IUseCountdownReturn;
16
+ export default useCountdown;
@@ -0,0 +1 @@
1
+ export { IOTPFieldProps, default } from "./OTPField";
@@ -0,0 +1,13 @@
1
+ declare const OTP_LENGTH = 6;
2
+ type OTPIndices = number[];
3
+ declare const OTP_INDICES: OTPIndices;
4
+ declare const DIGIT_PATTERN: RegExp;
5
+ declare const helperTextSizeMap: {
6
+ readonly large: "medium";
7
+ readonly medium: "medium";
8
+ };
9
+ declare const createEmptyDigits: () => string[];
10
+ declare const normalizeDigitsLength: (digits: string[]) => string[];
11
+ declare const stringToDigits: (value: string | number | undefined) => string[];
12
+ declare const digitsToString: (digits: string[]) => string;
13
+ export { DIGIT_PATTERN, OTP_LENGTH, OTP_INDICES, createEmptyDigits, digitsToString, helperTextSizeMap, normalizeDigitsLength, stringToDigits };
@@ -75,17 +75,19 @@ interface IGlobalHeaderProps {
75
75
  /**
76
76
  * The time zone to display the time in.
77
77
  * If not provided, it will use the local time zone of the user's device.
78
- * example: "America/New_York", "Europe/London"
78
+ * Example: "America/New_York", "Europe/London".
79
+ * To render the time section at all, you must provide at least one of `timeZone`, `timeFormat`, or `timeLabel`.
79
80
  */
80
81
  timeZone?: string;
81
82
  /**
82
83
  * The format of the time to display.
83
- * Possible values: "24h" or "12h"
84
- * Default is "24h"
84
+ * Default is "24h".
85
+ * To render the time section at all, you must provide at least one of `timeZone`, `timeFormat`, or `timeLabel`.
85
86
  */
86
87
  timeFormat?: "24h" | "12h";
87
88
  /**
88
- * Label for the time section, in mobile Breakpoint default is "Time"
89
+ * Label for the time section; in the mobile breakpoint the default is "Time".
90
+ * To render the time section at all, you must provide at least one of `timeZone`, `timeFormat`, or `timeLabel`.
89
91
  */
90
92
  timeLabel?: string;
91
93
  /**
@@ -1,4 +1,4 @@
1
- import { a as MenuContext, p as popoverSizeMapping, i as isActiveElementInside, M as Menu } from './ButtonGroup-dd6816d7.js';
1
+ import { a as MenuContext, p as popoverSizeMapping, i as isActiveElementInside, M as Menu } from './ButtonGroup-711d215c.js';
2
2
  import React__default, { useMemo, useState, useRef, useContext, useEffect, Children, isValidElement, cloneElement } from 'react';
3
3
  import { c as classNames } from './index-ce02421b.js';
4
4
  import { n as nanoid } from './index-15303b91.js';
@@ -6,7 +6,7 @@ import { S as SvgThreeDotsHorizontal } from './ThreeDotsHorizontal-479c2b4b.js';
6
6
  import Button from './Button.js';
7
7
  import { r as reactIsExports } from './index-a2688a52.js';
8
8
  import Loader from './Loader.js';
9
- import { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
9
+ import { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
10
10
  import Scrollbar from './Scrollbar.js';
11
11
  import Text from './Text.js';
12
12
  import { S as SvgCheckMark } from './CheckMark-34798545.js';
package/index.d.ts CHANGED
@@ -53,6 +53,7 @@ export { default as NumberField, INumberFieldProps } from "./components/molecule
53
53
  export { default as InteractiveCard, IInteractiveCardProps } from "./components/molecules/InteractiveCard";
54
54
  export { default as Section, ISectionProps } from "./components/molecules/Section";
55
55
  export { default as Image, IImageProps } from "./components/molecules/Image";
56
+ export { default as OTPField, IOTPFieldProps } from "./components/molecules/OTPField";
56
57
  export { default as GlobalHeader, IGlobalHeaderProps, IAction, IProducts } from "./components/organisms/GlobalHeader";
57
58
  export { default as DataCardList, IDataCardListProps } from "@components/organisms/DataCardList";
58
59
  export { default as GeneUIProvider, GeneUIDesignSystemContext, IGeneUIDesignSystemContext, IGeneUIProviderProps } from "./components/providers/GeneUIProvider";
package/index.js CHANGED
@@ -10,7 +10,7 @@ export { default as Logo } from './Logo.js';
10
10
  export { default as Rate } from './Rate.js';
11
11
  export { default as Text } from './Text.js';
12
12
  export { default as TextLink } from './TextLink.js';
13
- export { P as Popover, a as PopoverBody } from './PopoverBody-f9b55763.js';
13
+ export { P as Popover, a as PopoverBody } from './PopoverBody-69518dcc.js';
14
14
  export { PopoverFooter, PopoverFooterActions } from './Popover.js';
15
15
  export { default as Badge } from './Badge.js';
16
16
  export { default as Scrollbar } from './Scrollbar.js';
@@ -29,13 +29,13 @@ export { default as Tag } from './Tag.js';
29
29
  export { default as Switch } from './Switch.js';
30
30
  export { T as Timelines } from './Timeline-3f100bf0.js';
31
31
  export { TimelinePoint } from './Timeline.js';
32
- export { P as Products } from './Products-5d602730.js';
32
+ export { P as Products } from './Products-2d8aa944.js';
33
33
  export { Product, ProductsMainSection, ProductsSecondarySection } from './Products.js';
34
34
  export { default as QRCode } from './QRCode.js';
35
35
  export { K as KeyValue } from './KeyValue-2fdb0641.js';
36
36
  export { Key, Value } from './KeyValue.js';
37
- export { M as Menu } from './ButtonGroup-dd6816d7.js';
38
- export { B as ButtonGroup, E as Empty, M as MenuItem } from './index-8724e0c0.js';
37
+ export { M as Menu } from './ButtonGroup-711d215c.js';
38
+ export { B as ButtonGroup, E as Empty, M as MenuItem } from './index-29bde3c5.js';
39
39
  export { default as Navigation } from './Navigation.js';
40
40
  export { default as Checkbox } from './Checkbox.js';
41
41
  export { default as Radio } from './Radio.js';
@@ -60,6 +60,7 @@ export { default as NumberField } from './NumberField.js';
60
60
  export { default as InteractiveCard } from './InteractiveCard.js';
61
61
  export { default as Section } from './Section.js';
62
62
  export { default as Image } from './Image.js';
63
+ export { default as OTPField } from './OTPField.js';
63
64
  export { default as GlobalHeader } from './GlobalHeader.js';
64
65
  export { default as DataCardList } from './DataCardList.js';
65
66
  export { a as GeneUIDesignSystemContext, G as GeneUIProvider, u as useBreakpoint } from './index-f83efe58.js';
@@ -125,6 +126,7 @@ import './NumberField-2d272636.js';
125
126
  import './InteractiveCard-05c16126.js';
126
127
  import './Section-513d5f5a.js';
127
128
  import './Image-4f135206.js';
129
+ import './OTPField-af15abb1.js';
128
130
  import './GlobalHeader-e3be2af9.js';
129
131
  import './DataCardList-eb674418.js';
130
132
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@geneui/components",
3
3
  "description": "The Gene UI components library designed for BI tools",
4
- "version": "3.0.0-next-e1bd79a-05032026",
4
+ "version": "3.0.0-next-91e9add-19032026",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {