@geneui/components 3.0.0-next-7b678fb-11102024 → 3.0.0-next-524bb85-15102024

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/Charts/index.js CHANGED
@@ -18,6 +18,7 @@ import '../_rollupPluginBabelHelpers-a83240e1.js';
18
18
  import '../configs-00612ce0.js';
19
19
  import '../hooks/useWindowSize.js';
20
20
  import '../hooks/useDebounce.js';
21
+ import '../InfoOutline-dd2e89d9.js';
21
22
  import '../ArrowLeft-b88e2ba8.js';
22
23
  import '../index-a1b8ec78.js';
23
24
  import '../GeneUIProvider/index.js';
package/Counter/index.js CHANGED
@@ -16,6 +16,7 @@ import 'react-dom';
16
16
  import '../tslib.es6-f211516f.js';
17
17
  import '../Icon/index.js';
18
18
  import '../_rollupPluginBabelHelpers-a83240e1.js';
19
+ import '../InfoOutline-dd2e89d9.js';
19
20
  import '../ArrowLeft-b88e2ba8.js';
20
21
  import '../useEllipsisDetection-c1c9ad94.js';
21
22
  import '../hooks/useDebounce.js';
package/Info/index.js ADDED
@@ -0,0 +1,41 @@
1
+ import React__default, { useState, useMemo } from 'react';
2
+ import { c as classnames } from '../index-031ff73c.js';
3
+ import { S as SvgInfoOutline } from '../InfoOutline-dd2e89d9.js';
4
+ import { T as Tooltip } from '../index-a1b8ec78.js';
5
+ import { s as styleInject } from '../style-inject.es-746bb8ed.js';
6
+ import '../ArrowLeft-b88e2ba8.js';
7
+ import '../tslib.es6-f211516f.js';
8
+ import 'react-dom';
9
+ import '../GeneUIProvider/index.js';
10
+
11
+ var css_248z = "[data-gene-ui-version=\"2.16.1\"] .info{border-radius:var(--guit-ref-radius-3xsmall);line-height:0}[data-gene-ui-version=\"2.16.1\"] .info_appearance_default{color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.1\"] .info_appearance_brand{color:var(--guit-sem-color-foreground-brand)}[data-gene-ui-version=\"2.16.1\"] .info_appearance_inverse{color:var(--guit-sem-color-foreground-inverse)}[data-gene-ui-version=\"2.16.1\"] .info_disabled{color:var(--guit-sem-color-foreground-disabled);pointer-events:none}";
12
+ styleInject(css_248z);
13
+
14
+ const iconSizes = {
15
+ small: 24,
16
+ smallNudge: 20,
17
+ XSmall: 16
18
+ };
19
+ /**
20
+ * Info icon component used to provide additional contextual information to users. It appears as a small icon, and is placed near elements where further explanation or clarification is useful.
21
+ */
22
+ const Info = ({ infoText, disabled, size = 'smallNudge', appearance = 'default', className }) => {
23
+ const [alwaysShow, setAlwaysShow] = useState(false);
24
+ const keyDownHandler = (event) => {
25
+ if (disabled)
26
+ return;
27
+ if (event.key === 'Enter') {
28
+ setAlwaysShow((prev) => !prev);
29
+ }
30
+ };
31
+ const handleBlur = () => !disabled && alwaysShow && setAlwaysShow(false);
32
+ const buttonClassNames = useMemo(() => classnames('info', className, {
33
+ [`info_appearance_${appearance}`]: appearance,
34
+ info_disabled: disabled
35
+ }), [appearance, className, disabled]);
36
+ return (React__default.createElement(Tooltip, { text: infoText, alwaysShow: alwaysShow, appearance: appearance === 'inverse' ? 'inverse' : 'default' },
37
+ React__default.createElement("button", { disabled: disabled, "aria-pressed": alwaysShow, className: buttonClassNames, onKeyDown: keyDownHandler, onBlur: handleBlur },
38
+ React__default.createElement(SvgInfoOutline, { className: "info__icon", size: iconSizes[size] }))));
39
+ };
40
+
41
+ export { Info as default };
@@ -0,0 +1,29 @@
1
+ import { _ as _objectWithoutProperties, a as _extends } from './ArrowLeft-b88e2ba8.js';
2
+ import React__default from 'react';
3
+
4
+ var _excluded = ["size", "color"];
5
+ var SvgInfoOutline = function SvgInfoOutline(_ref) {
6
+ var _ref$size = _ref.size,
7
+ size = _ref$size === void 0 ? 24 : _ref$size,
8
+ _ref$color = _ref.color,
9
+ color = _ref$color === void 0 ? "currentColor" : _ref$color,
10
+ props = _objectWithoutProperties(_ref, _excluded);
11
+ return /*#__PURE__*/React__default.createElement("svg", _extends({
12
+ width: size,
13
+ height: size,
14
+ viewBox: "0 0 24 24",
15
+ fill: color,
16
+ xmlns: "http://www.w3.org/2000/svg"
17
+ }, props), /*#__PURE__*/React__default.createElement("path", {
18
+ d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18.5a8.5 8.5 0 1 1 8.5-8.5 8.51 8.51 0 0 1-8.5 8.5Z",
19
+ fill: color
20
+ }), /*#__PURE__*/React__default.createElement("path", {
21
+ d: "M11.97 10.237a.75.75 0 0 0-.75.75v5.243a.75.75 0 0 0 1.5 0v-5.243a.75.75 0 0 0-.75-.75Z",
22
+ fill: color
23
+ }), /*#__PURE__*/React__default.createElement("path", {
24
+ d: "M11.969 6.995a.914.914 0 1 0 0 1.829.914.914 0 0 0 0-1.829Z",
25
+ fill: color
26
+ }));
27
+ };
28
+
29
+ export { SvgInfoOutline as S };
package/Label/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React__default, { useRef } from 'react';
2
- import { _ as _objectWithoutProperties, a as _extends } from '../ArrowLeft-b88e2ba8.js';
2
+ import { S as SvgInfoOutline } from '../InfoOutline-dd2e89d9.js';
3
3
  import { c as classnames } from '../index-031ff73c.js';
4
4
  import { T as Tooltip } from '../index-a1b8ec78.js';
5
5
  import 'prop-types';
@@ -8,36 +8,12 @@ import 'react-dom';
8
8
  import '../configs-00612ce0.js';
9
9
  import { u as useEllipsisDetection } from '../useEllipsisDetection-c1c9ad94.js';
10
10
  import { s as styleInject } from '../style-inject.es-746bb8ed.js';
11
+ import '../ArrowLeft-b88e2ba8.js';
11
12
  import '../tslib.es6-f211516f.js';
12
13
  import '../GeneUIProvider/index.js';
13
14
  import '../_commonjsHelpers-24198af3.js';
14
15
  import '../hooks/useDebounce.js';
15
16
 
16
- var _excluded = ["size", "color"];
17
- var SvgInfoOutline = function SvgInfoOutline(_ref) {
18
- var _ref$size = _ref.size,
19
- size = _ref$size === void 0 ? 24 : _ref$size,
20
- _ref$color = _ref.color,
21
- color = _ref$color === void 0 ? "currentColor" : _ref$color,
22
- props = _objectWithoutProperties(_ref, _excluded);
23
- return /*#__PURE__*/React__default.createElement("svg", _extends({
24
- width: size,
25
- height: size,
26
- viewBox: "0 0 24 24",
27
- fill: color,
28
- xmlns: "http://www.w3.org/2000/svg"
29
- }, props), /*#__PURE__*/React__default.createElement("path", {
30
- d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18.5a8.5 8.5 0 1 1 8.5-8.5 8.51 8.51 0 0 1-8.5 8.5Z",
31
- fill: color
32
- }), /*#__PURE__*/React__default.createElement("path", {
33
- d: "M11.97 10.237a.75.75 0 0 0-.75.75v5.243a.75.75 0 0 0 1.5 0v-5.243a.75.75 0 0 0-.75-.75Z",
34
- fill: color
35
- }), /*#__PURE__*/React__default.createElement("path", {
36
- d: "M11.969 6.995a.914.914 0 1 0 0 1.829.914.914 0 0 0 0-1.829Z",
37
- fill: color
38
- }));
39
- };
40
-
41
17
  var css_248z = "[data-gene-ui-version=\"2.16.1\"] .label{align-items:center;display:inline-flex;max-width:100%;min-width:0}[data-gene-ui-version=\"2.16.1\"] .label__container{align-items:center;display:flex;gap:var(--guit-ref-spacing-3xsmall);min-width:0;width:100%}[data-gene-ui-version=\"2.16.1\"] .label__container-inner{align-items:center;display:flex;gap:var(--guit-ref-spacing-4xsmall)}[data-gene-ui-version=\"2.16.1\"] .label__asterisk,[data-gene-ui-version=\"2.16.1\"] .label__text{color:var(--guit-sem-color-foreground-neutral-2)}[data-gene-ui-version=\"2.16.1\"] .label__asterisk_size_medium,[data-gene-ui-version=\"2.16.1\"] .label__text_size_medium{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}[data-gene-ui-version=\"2.16.1\"] .label__asterisk_size_small,[data-gene-ui-version=\"2.16.1\"] .label__text_size_small{font-family:var(--guit-sem-font-label-small-default-medium-font-family);font-size:var(--guit-sem-font-label-small-default-medium-font-size);font-weight:var(--guit-sem-font-label-small-default-medium-font-weight);line-height:var(--guit-sem-font-label-small-default-medium-line-height)}[data-gene-ui-version=\"2.16.1\"] .label__asterisk_disabled,[data-gene-ui-version=\"2.16.1\"] .label__text_disabled{color:var(--guit-sem-color-foreground-disabled)}[data-gene-ui-version=\"2.16.1\"] .label__icon{color:var(--guit-sem-color-foreground-neutral-2);flex:0 0 auto}[data-gene-ui-version=\"2.16.1\"] .label__icon_disabled{color:var(--guit-sem-color-foreground-disabled)}";
42
18
  styleInject(css_248z);
43
19
 
package/index.d.ts CHANGED
@@ -27,6 +27,7 @@ export { default as LinkButton } from './lib/atoms/LinkButton/index';
27
27
  export { default as HelperText } from './lib/atoms/HelperText';
28
28
  export { default as Loader } from './lib/atoms/Loader';
29
29
  export { default as Pill } from './lib/atoms/Pill';
30
+ export { default as Info } from './lib/atoms/Info';
30
31
  export { Row, Col } from './lib/molecules/Grid';
31
32
  export { Tab, Tabs } from './lib/molecules/Tabs';
32
33
  export { Step, Steps } from './lib/molecules/Steps';
package/index.js CHANGED
@@ -27,6 +27,7 @@ export { default as LinkButton } from './LinkButton/index.js';
27
27
  export { default as HelperText } from './HelperText/index.js';
28
28
  export { default as Loader } from './Loader/index.js';
29
29
  export { default as Pill } from './Pill/index.js';
30
+ export { default as Info } from './Info/index.js';
30
31
  export { Col, Row } from './Grid/index.js';
31
32
  export { Tab, Tabs } from './Tabs/index.js';
32
33
  export { Step, Steps } from './Steps/index.js';
@@ -131,6 +132,7 @@ export { u as useEllipsisDetection } from './useEllipsisDetection-c1c9ad94.js';
131
132
  import './index-031ff73c.js';
132
133
  import './style-inject.es-746bb8ed.js';
133
134
  import './tslib.es6-f211516f.js';
135
+ import './InfoOutline-dd2e89d9.js';
134
136
  import './ArrowLeft-b88e2ba8.js';
135
137
  import './dateValidation-67caec66.js';
136
138
  import './_commonjsHelpers-24198af3.js';
@@ -0,0 +1,35 @@
1
+ import { FC } from 'react';
2
+ import { IconProps } from '@geneui/icons';
3
+ import './Info.scss';
4
+ declare const iconSizes: Record<'small' | 'smallNudge' | 'XSmall', IconProps['size']>;
5
+ interface IInfoProps {
6
+ /**
7
+ * The text that will be displayed inside the tooltip when the user interacts with the info icon.
8
+ */
9
+ infoText: string;
10
+ /**
11
+ * Disables the info icon button, preventing any interaction (click, key down, or focus).<br>
12
+ * When `disabled` is true, the button becomes non-interactive, and the tooltip won't be shown.
13
+ */
14
+ disabled?: boolean;
15
+ /**
16
+ * Defines the size of the info icon.<br>
17
+ * Possible values: `small | smallNudge | XSmall`
18
+ */
19
+ size?: keyof typeof iconSizes;
20
+ /**
21
+ * Determines the visual appearance of the info icon.<br>
22
+ * Possible values: `default | brand | inverse`
23
+ */
24
+ appearance?: 'default' | 'brand' | 'inverse';
25
+ /**
26
+ * Additional class for the parent element.<br>
27
+ * This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
28
+ */
29
+ className?: string;
30
+ }
31
+ /**
32
+ * Info icon component used to provide additional contextual information to users. It appears as a small icon, and is placed near elements where further explanation or clarification is useful.
33
+ */
34
+ declare const Info: FC<IInfoProps>;
35
+ export { IInfoProps, Info as default };
@@ -0,0 +1 @@
1
+ export { IInfoProps, default as default } from './Info';
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-7b678fb-11102024",
4
+ "version": "3.0.0-next-524bb85-15102024",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {