@geneui/components 2.15.0-canary-2c19c64-17052024 → 2.15.0-canary-25f0015-20052024

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.
@@ -477,7 +477,7 @@ function DateRangePickerInput(_ref) {
477
477
  const end = dayjsWithPlugins(endDate);
478
478
  setStartDate(start);
479
479
  setEndDate(end);
480
- if (!withTime) {
480
+ if (!withTime && !isMobile) {
481
481
  inputRef.current.blur();
482
482
  setPopoverState(false);
483
483
  }
@@ -0,0 +1,81 @@
1
+ import { _ as __rest } from '../tslib.es6-f211516f.js';
2
+ import React__default, { useRef } from 'react';
3
+ import { c as classnames } from '../index-031ff73c.js';
4
+ import Icon from '../Icon/index.js';
5
+ import Switcher from '../Switcher/index.js';
6
+ import Tag from '../Tag/index.js';
7
+ import Tooltip from '../Tooltip/index.js';
8
+ import 'prop-types';
9
+ import '../dateValidation-67caec66.js';
10
+ import 'react-dom';
11
+ import '../configs-1fb8eed2.js';
12
+ import { u as useEllipsisDetection } from '../useEllipsisDetection-4d997d5d.js';
13
+ import { s as styleInject } from '../style-inject.es-746bb8ed.js';
14
+ import '../_rollupPluginBabelHelpers-e8fb2e5c.js';
15
+ import '../index-a0e4e333.js';
16
+ import '../hooks/useKeyDown.js';
17
+ import '../checkboxRadioSwitcher-5b69d7bd.js';
18
+ import '../guid-8ddf77b3.js';
19
+ import '../_commonjsHelpers-24198af3.js';
20
+ import '../Popover-f4d1cac0.js';
21
+ import '../hooks/useDeviceType.js';
22
+ import '../hooks/useWindowSize.js';
23
+ import '../hooks/useDebounce.js';
24
+ import '../GeneUIProvider/index.js';
25
+
26
+ const InteractiveWidgetIcon = ({ children, iconColor, appearance, iconBackground }) => {
27
+ return (React__default.createElement("div", { className: `widgetIcon widgetIcon-${appearance}`, style: iconColor ? { '--icon-color': iconColor, filter: 'alpha(opacity=60)' } : {} },
28
+ iconBackground && React__default.createElement("div", { className: "widgetIcon__background" }),
29
+ typeof children === 'string' ? (
30
+ // @ts-ignore
31
+ React__default.createElement(Icon, { type: children, className: classnames({ widgetIcon__iconDefault: appearance === 'default' }) })) : (children)));
32
+ };
33
+
34
+ var css_248z = "[data-gene-ui-version=\"2.14.0\"] .interactiveWidget{background:var(--background);border-radius:1.6rem;box-sizing:border-box;display:flex;height:10.4rem;min-width:1px;padding:2rem;width:100%}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget:focus-visible{outline:.2rem var(--hero) solid}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget-border{border:.2rem solid rgba(var(--background-sc-rgb),.05)}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget-border:hover{border:.2rem solid var(--hero)}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget-pointer{cursor:pointer}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget-pointer:hover{background:rgba(var(--hero-rgb),.1)}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget-disabled{opacity:.6;pointer-events:none}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__wrapper{align-items:center;display:flex;height:100%;min-width:0;width:100%}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__content{display:flex;flex-direction:column;height:100%;justify-content:flex-start;min-width:0;overflow:hidden;width:100%}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__header{align-items:center;display:flex;margin-bottom:.6rem;min-width:0;width:100%}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__titleWrapper{display:flex;flex:1;max-width:100%;min-width:0;padding-inline-end:1.6rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__title{font-size:1.6rem;font-weight:700}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__infoIcon{margin-inline-start:.4rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__components{align-items:center;display:flex;flex:0 0 auto}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__switcher{margin-inline-start:1.6rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget__description{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;font-size:1.2rem;line-height:1.6rem;opacity:.7;overflow:hidden;text-overflow:ellipsis}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon{fill:var(--icon-color);align-items:center;color:var(--icon-color);display:flex;flex:0 0 auto;justify-content:center;margin-inline-end:2rem;position:relative;z-index:1}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon-default{box-sizing:border-box;height:6.4rem;padding:1rem;width:6.4rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon-compact{height:2.4rem;width:2.4rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon-compact .widgetIcon__background{display:none}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon__iconDefault{font-size:4rem}[data-gene-ui-version=\"2.14.0\"] .interactiveWidget .widgetIcon__background{background:var(--icon-color);border-radius:100%;height:100%;left:0;opacity:.07;position:absolute;top:0;width:100%;z-index:-1}";
35
+ styleInject(css_248z);
36
+
37
+ const InteractiveWidget = (_a) => {
38
+ var { className, withBorder = true, onClick, disabled = false, icon, title, appearance = 'default', iconColor = 'var(--background-sc)', tagName, tagColor, switcherProps, titleInfo, description, iconBackground = true } = _a, restProps = __rest(_a, ["className", "withBorder", "onClick", "disabled", "icon", "title", "appearance", "iconColor", "tagName", "tagColor", "switcherProps", "titleInfo", "description", "iconBackground"]);
39
+ const titleRef = useRef(null);
40
+ const descriptionRef = useRef(null);
41
+ const isTitleTruncated = useEllipsisDetection(titleRef);
42
+ const isDescriptionTruncated = useEllipsisDetection(descriptionRef);
43
+ return (React__default.createElement("div", Object.assign({ className: classnames('interactiveWidget', {
44
+ 'interactiveWidget-border': withBorder,
45
+ 'interactiveWidget-pointer': onClick,
46
+ 'interactiveWidget-disabled': disabled
47
+ }, className), tabIndex: 0, onClick: (event) => {
48
+ onClick && onClick(event);
49
+ }, onKeyDown: (event) => {
50
+ if (disabled)
51
+ return;
52
+ onClick && onClick(event);
53
+ } }, restProps),
54
+ React__default.createElement("div", { className: 'interactiveWidget__wrapper' },
55
+ icon && appearance === 'default' && (React__default.createElement(InteractiveWidgetIcon, { children: icon, appearance: appearance, iconColor: iconColor, iconBackground: iconBackground })),
56
+ React__default.createElement("div", { className: 'interactiveWidget__content' },
57
+ React__default.createElement("div", { className: `interactiveWidget__header interactiveWidget__header-${appearance}` },
58
+ icon && appearance === 'compact' && (React__default.createElement(InteractiveWidgetIcon, { children: icon, appearance: appearance, iconColor: iconColor })),
59
+ React__default.createElement("div", { className: "interactiveWidget__titleWrapper" },
60
+ title && (
61
+ // @ts-ignore
62
+ React__default.createElement(Tooltip, { text: title, isVisible: isTitleTruncated },
63
+ React__default.createElement("h3", { className: 'interactiveWidget__title ellipsis-text', ref: titleRef }, title))),
64
+ titleInfo && title && (
65
+ // @ts-ignore
66
+ React__default.createElement(Tooltip, { text: titleInfo },
67
+ React__default.createElement(Icon, { className: 'interactiveWidget__infoIcon', type: 'bc-icon-info-48' })))),
68
+ (switcherProps || tagName) && (React__default.createElement("div", { className: "interactiveWidget__components" },
69
+ tagName && (
70
+ // @ts-ignore
71
+ React__default.createElement(Tag, { name: tagName, color: tagColor, appearance: "outline", size: "small", cornerRadius: 'smooth-radius' })),
72
+ switcherProps && (
73
+ // @ts-ignore
74
+ React__default.createElement(Switcher, Object.assign({ className: 'interactiveWidget__switcher', changeOnEnter: true }, switcherProps)))))),
75
+ description && (
76
+ //@ts-ignore
77
+ React__default.createElement(Tooltip, { text: description, isVisible: isDescriptionTruncated },
78
+ React__default.createElement("p", { className: "interactiveWidget__description", ref: descriptionRef }, description)))))));
79
+ };
80
+
81
+ export { InteractiveWidget as default };
package/Range/index.js CHANGED
@@ -2,7 +2,7 @@ import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
2
2
  import React__default, { useState, useRef, useCallback } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classnames } from '../index-031ff73c.js';
5
- import { c as createSliderWithTooltip, R as Range } from '../rangeAndSlider-740a236c.js';
5
+ import { c as createSliderWithTooltip, R as Range } from '../rangeAndSlider-693a3d41.js';
6
6
  import useWidth from '../hooks/useWidth.js';
7
7
  import '../dateValidation-67caec66.js';
8
8
  import 'react-dom';
package/Slider/index.js CHANGED
@@ -2,7 +2,7 @@ import { _ as _extends } from '../_rollupPluginBabelHelpers-e8fb2e5c.js';
2
2
  import React__default, { useState, useRef, useCallback, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classnames } from '../index-031ff73c.js';
5
- import { c as createSliderWithTooltip, S as Slider } from '../rangeAndSlider-740a236c.js';
5
+ import { c as createSliderWithTooltip, S as Slider } from '../rangeAndSlider-693a3d41.js';
6
6
  import useWidth from '../hooks/useWidth.js';
7
7
  import '../dateValidation-67caec66.js';
8
8
  import 'react-dom';
package/index.d.ts CHANGED
@@ -66,6 +66,7 @@ export { default as Textarea } from './lib/molecules/Textarea';
66
66
  export { default as Counter } from './lib/molecules/Counter';
67
67
  export { default as AdvancedSearch } from './lib/molecules/AdvancedSearch';
68
68
  export { default as Copy } from './lib/molecules/Copy';
69
+ export { default as InteractiveWidget } from './lib/molecules/InteractiveWidget';
69
70
  export { default as FormableMultiSelectDropdown } from './lib/organisms/Form/Formables/FormableMultiSelectDropdown';
70
71
  export { default as FormableNumberInput } from './lib/organisms/Form/Formables/FormableNumberInput';
71
72
  export { default as FormableDatePicker } from './lib/organisms/Form/Formables/FormableDatePicker';
package/index.js CHANGED
@@ -75,6 +75,7 @@ export { default as Textarea } from './Textarea/index.js';
75
75
  export { default as Counter } from './Counter/index.js';
76
76
  export { default as AdvancedSearch } from './AdvancedSearch/index.js';
77
77
  export { default as Copy } from './Copy/index.js';
78
+ export { default as InteractiveWidget } from './InteractiveWidget/index.js';
78
79
  export { default as FormableMultiSelectDropdown } from './FormableMultiSelectDropdown/index.js';
79
80
  export { default as FormableNumberInput } from './FormableNumberInput/index.js';
80
81
  export { default as FormableDatePicker } from './FormableDatePicker/index.js';
@@ -139,7 +140,7 @@ import './localization-4ba17032.js';
139
140
  import './Popover-f4d1cac0.js';
140
141
  import './index-122432cd.js';
141
142
  import './debounce-4419bc2f.js';
142
- import './rangeAndSlider-740a236c.js';
143
+ import './rangeAndSlider-693a3d41.js';
143
144
  import './index-45eafea6.js';
144
145
  import './react-lifecycles-compat.es-6e1f3768.js';
145
146
  import './SuggestionList/index.js';
@@ -0,0 +1,70 @@
1
+ import { FC, MouseEvent, KeyboardEvent, ReactNode } from 'react';
2
+ import Switcher from '../../atoms/Switcher';
3
+ import { IHTMLDivElementAttributes } from '../../../types';
4
+ import './InteractiveWidget.scss';
5
+ interface IInteractiveWidgetProps extends IHTMLDivElementAttributes {
6
+ /**
7
+ * Show/Hide border.
8
+ */
9
+ withBorder?: boolean;
10
+ /**
11
+ * Additional className will be applied on the wrapper element.
12
+ */
13
+ className?: string;
14
+ /**
15
+ * Fires an event on Widget click `((event: Event) => void)`.
16
+ */
17
+ onClick?: (event: MouseEvent | KeyboardEvent) => void;
18
+ /**
19
+ * Disabled state.
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * The `icon` prop determines the representation of an icon within the component.
24
+ * It can be a string, such as a URL for an SVG image, or a React component for example <Icon> component.
25
+ */
26
+ icon?: ReactNode;
27
+ /**
28
+ * This property controls the size of the icon, influencing the appearance of the component.<br>
29
+ * Possible values: `'default' | 'compact'`
30
+ */
31
+ appearance?: 'default' | 'compact';
32
+ /**
33
+ * The prop determines the color of the icon in the component.
34
+ * It should be a string representing a valid CSS color value.
35
+ */
36
+ iconColor?: string;
37
+ /**
38
+ * Label for tag component.
39
+ * Adding props you will add the `<Tag/>` component.
40
+ */
41
+ tagName?: string;
42
+ /**
43
+ * Color value for tag component.
44
+ */
45
+ tagColor?: string;
46
+ /**
47
+ * Props for `<Switcher/>` component (see `<Switcher/>` component documentation).
48
+ * Adding props you wil add the component.
49
+ */
50
+ switcherProps?: typeof Switcher.propTypes;
51
+ /**
52
+ * The main descriptive text or title for the component.
53
+ */
54
+ title?: string;
55
+ /**
56
+ * Additional information or tooltip string that appears when hovering over the info icon next to the title.
57
+ * If not provided, the info icon will not be displayed.
58
+ */
59
+ titleInfo?: string;
60
+ /**
61
+ * Description paragraph.
62
+ */
63
+ description?: string;
64
+ /**
65
+ * Icon background color for default appearance.
66
+ */
67
+ iconBackground?: boolean;
68
+ }
69
+ declare const InteractiveWidget: FC<IInteractiveWidgetProps>;
70
+ export { IInteractiveWidgetProps, InteractiveWidget as default };
@@ -0,0 +1,8 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ interface IInteractiveWidgetIconProps extends PropsWithChildren {
3
+ appearance?: 'default' | 'compact';
4
+ iconColor?: string;
5
+ iconBackground?: boolean;
6
+ }
7
+ declare const InteractiveWidgetIcon: FC<IInteractiveWidgetIconProps>;
8
+ export default InteractiveWidgetIcon;
@@ -0,0 +1 @@
1
+ export { IInteractiveWidgetProps, default as default } from './InteractiveWidget';
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": "2.15.0-canary-2c19c64-17052024",
4
+ "version": "2.15.0-canary-25f0015-20052024",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {
@@ -360,16 +360,24 @@ var _uid = function (key) {
360
360
  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id$1 + px).toString(36));
361
361
  };
362
362
 
363
- var shared$1 = _sharedExports('keys');
364
- var uid$2 = _uid;
365
- var _sharedKey = function (key) {
366
- return shared$1[key] || (shared$1[key] = uid$2(key));
367
- };
363
+ var _sharedKey;
364
+ var hasRequired_sharedKey;
365
+
366
+ function require_sharedKey () {
367
+ if (hasRequired_sharedKey) return _sharedKey;
368
+ hasRequired_sharedKey = 1;
369
+ var shared = _sharedExports('keys');
370
+ var uid = _uid;
371
+ _sharedKey = function (key) {
372
+ return shared[key] || (shared[key] = uid(key));
373
+ };
374
+ return _sharedKey;
375
+ }
368
376
 
369
377
  var has$5 = _has;
370
378
  var toIObject$5 = _toIobject;
371
379
  var arrayIndexOf = _arrayIncludes(false);
372
- var IE_PROTO$1 = _sharedKey('IE_PROTO');
380
+ var IE_PROTO$1 = require_sharedKey()('IE_PROTO');
373
381
 
374
382
  var _objectKeysInternal = function (object, names) {
375
383
  var O = toIObject$5(object);
@@ -633,7 +641,7 @@ function require_objectCreate () {
633
641
  var anObject = _anObject;
634
642
  var dPs = require_objectDps();
635
643
  var enumBugKeys = require_enumBugKeys();
636
- var IE_PROTO = _sharedKey('IE_PROTO');
644
+ var IE_PROTO = require_sharedKey()('IE_PROTO');
637
645
  var Empty = function () { /* empty */ };
638
646
  var PROTOTYPE = 'prototype';
639
647
 
@@ -715,7 +723,7 @@ var _iterCreate = function (Constructor, NAME, next) {
715
723
  // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
716
724
  var has$3 = _has;
717
725
  var toObject$3 = _toObject;
718
- var IE_PROTO = _sharedKey('IE_PROTO');
726
+ var IE_PROTO = require_sharedKey()('IE_PROTO');
719
727
  var ObjectProto$1 = Object.prototype;
720
728
 
721
729
  var _objectGpo = Object.getPrototypeOf || function (O) {
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export interface IHTMLDivElementAttributes extends Omit<HTMLAttributes<HTMLDivElement>, 'onKeyDown'> {
3
+ }