@geneui/components 3.0.0-next-02b4659-17022025 → 3.0.0-next-e1ffab5-19022025
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/KeyValue.js +49 -0
- package/TextLink.js +9 -6
- package/components/atoms/TextLink/TextLink.d.ts +6 -4
- package/components/molecules/KeyValue/Key.d.ts +7 -0
- package/components/molecules/KeyValue/KeyValue.d.ts +38 -0
- package/components/molecules/KeyValue/Value.d.ts +6 -0
- package/components/molecules/KeyValue/index.d.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
package/KeyValue.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React__default, { createContext, useMemo, useContext, cloneElement } from 'react';
|
|
2
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
4
|
+
import Info from './Info.js';
|
|
5
|
+
import './InfoOutline-dd2e89d9.js';
|
|
6
|
+
import './ArrowLeft-b88e2ba8.js';
|
|
7
|
+
import './Tooltip.js';
|
|
8
|
+
import './floating-ui.react-0485e4db.js';
|
|
9
|
+
import 'react-dom';
|
|
10
|
+
import './GeneUIProvider.js';
|
|
11
|
+
|
|
12
|
+
var css_248z = ".keyValue{display:inline-flex;max-width:100%}.keyValue_direction_vertical{flex-direction:column}.keyValue_direction_horizontal.keyValue_spaceBetween{width:100%}.keyValue__content{align-items:center;color:var(--guit-sem-color-foreground-neutral-2);display:flex;flex:1}.keyValue__value{color:var(--guit-sem-color-foreground-neutral-1);word-break:break-word}.keyValue_size_large{gap:var(--guit-ref-spacing-medium)}.keyValue_size_large .keyValue__content{gap:var(--guit-ref-spacing-xsmall)}.keyValue_size_large .keyValue__title,.keyValue_size_large .keyValue__value{font-family:var(--guit-sem-font-label-large-default-medium-font-family),sans-serif;font-size:var(--guit-sem-font-label-large-default-semibold-font-size);font-weight:var(--guit-sem-font-label-large-default-medium-font-weight);line-height:var(--guit-sem-font-label-large-default-semibold-line-height)}.keyValue_size_medium{gap:var(--guit-ref-spacing-medium)}.keyValue_size_medium .keyValue__content{gap:var(--guit-ref-spacing-xsmall)}.keyValue_size_medium .keyValue__title,.keyValue_size_medium .keyValue__value{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-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}";
|
|
13
|
+
styleInject(css_248z);
|
|
14
|
+
|
|
15
|
+
const KeyValueContext = createContext({});
|
|
16
|
+
/**
|
|
17
|
+
* Key Value components present data in a key-value format, typically used to display information obtained from other components. A common use case is setting up a Key Value component to show detailed information from a selected table row.
|
|
18
|
+
*/
|
|
19
|
+
const KeyValue = ({ className, direction = "vertical", size = "medium", children, spaceBetween = false }) => {
|
|
20
|
+
const memoizedKeyValueContextValue = useMemo(() => ({
|
|
21
|
+
size
|
|
22
|
+
}), [size]);
|
|
23
|
+
return (React__default.createElement(KeyValueContext.Provider, { value: memoizedKeyValueContextValue },
|
|
24
|
+
React__default.createElement("div", { className: classNames(`keyValue keyValue_direction_${direction} keyValue_size_${size}`, className, {
|
|
25
|
+
keyValue_spaceBetween: spaceBetween
|
|
26
|
+
}) }, children)));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const infoSize = {
|
|
30
|
+
large: "small",
|
|
31
|
+
medium: "smallNudge"
|
|
32
|
+
};
|
|
33
|
+
const Key = ({ infoText, children }) => {
|
|
34
|
+
const { size } = useContext(KeyValueContext);
|
|
35
|
+
return (React__default.createElement("div", { className: "keyValue__content" },
|
|
36
|
+
React__default.createElement("span", { className: "keyValue__title" }, children),
|
|
37
|
+
infoText && size && React__default.createElement(Info, { className: "keyValue__icon", infoText: infoText, size: infoSize[size] })));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const pillSize = {
|
|
41
|
+
large: "medium",
|
|
42
|
+
medium: "small"
|
|
43
|
+
};
|
|
44
|
+
const Value = ({ children }) => {
|
|
45
|
+
const { size } = useContext(KeyValueContext);
|
|
46
|
+
return (React__default.createElement(React__default.Fragment, null, typeof children === "string" ? (React__default.createElement("span", { className: "keyValue__value" }, children)) : (size && cloneElement(children, { size: pillSize[size] }))));
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export { Key, KeyValue, Value };
|
package/TextLink.js
CHANGED
|
@@ -2,19 +2,22 @@ import React__default from 'react';
|
|
|
2
2
|
import { c as classNames } from './index-ce02421b.js';
|
|
3
3
|
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
4
4
|
|
|
5
|
-
var css_248z = ".textLink{border-radius:var(--guit-ref-radius-4xsmall);cursor:pointer;display:inline-flex;word-break:break-word}.textLink_underline .textLink__text{font-family:var(--guit-sem-font-body-
|
|
5
|
+
var css_248z = ".textLink{border-radius:var(--guit-ref-radius-4xsmall);cursor:pointer;display:inline-flex;word-break:break-word}.textLink_size_large.textLink_underline .textLink__text{font-family:var(--guit-sem-font-body-large-underline-medium-font-family),sans-serif;font-size:var(--guit-sem-font-body-large-underline-medium-font-size);font-weight:var(--guit-sem-font-body-large-underline-medium-font-weight);line-height:var(--guit-sem-font-body-large-underline-medium-line-height);-webkit-text-decoration:var(--guit-ref-font-text-decoration-underline);text-decoration:var(--guit-ref-font-text-decoration-underline)}.textLink_size_large:not(.textLink_underline) .textLink__text{font-family:var(--guit-sem-font-body-large-default-medium-font-family),sans-serif;font-size:var(--guit-sem-font-body-large-default-medium-font-size);font-weight:var(--guit-sem-font-body-large-default-medium-font-weight);line-height:var(--guit-sem-font-body-large-default-medium-line-height)}.textLink_size_medium.textLink_underline .textLink__text{font-family:var(--guit-sem-font-body-medium-underline-medium-font-family),sans-serif;font-size:var(--guit-sem-font-body-medium-underline-medium-font-size);font-weight:var(--guit-sem-font-body-medium-underline-medium-font-weight);line-height:var(--guit-sem-font-body-medium-underline-medium-line-height);-webkit-text-decoration:var(--guit-ref-font-text-decoration-underline);text-decoration:var(--guit-ref-font-text-decoration-underline)}.textLink_size_medium:not(.textLink_underline) .textLink__text{font-family:var(--guit-sem-font-body-medium-default-medium-font-family),sans-serif;font-size:var(--guit-sem-font-body-medium-default-medium-font-size);font-weight:var(--guit-sem-font-body-medium-default-medium-font-weight);line-height:var(--guit-sem-font-body-medium-default-medium-line-height)}.textLink_color_primary{color:var(--guit-sem-color-foreground-brand)}.textLink_color_primary:hover{color:var(--guit-sem-color-foreground-brand-hover)}.textLink_color_primary:active{color:var(--guit-sem-color-foreground-brand-pressed)}.textLink_color_secondary{color:var(--guit-sem-color-foreground-neutral-2)}.textLink_color_secondary:hover{color:var(--guit-sem-color-foreground-neutral-2-hover)}.textLink_color_secondary:active{color:var(--guit-sem-color-foreground-neutral-2-pressed)}.textLink_color_inverse{color:var(--guit-sem-color-foreground-inverse)}.textLink_color_inverse:hover{color:var(--guit-sem-color-foreground-inverse-hover)}.textLink_color_inverse:active{color:var(--guit-sem-color-foreground-inverse-pressed)}.textLink_disabled{pointer-events:none}.textLink_disabled:not(.textLink_color_inverse){color:var(--guit-sem-color-foreground-disabled)}.textLink_disabled.textLink_color_inverse{color:var(--guit-sem-color-foreground-inverse-disabled)}.textLink__icon{flex:0 0 auto;vertical-align:middle}.textLink__icon_before{margin-inline-end:var(--guit-ref-spacing-3xsmall)}.textLink__icon_after{margin-inline-start:var(--guit-ref-spacing-3xsmall)}";
|
|
6
6
|
styleInject(css_248z);
|
|
7
7
|
|
|
8
|
+
const iconSize = {
|
|
9
|
+
medium: 20,
|
|
10
|
+
large: 24
|
|
11
|
+
};
|
|
8
12
|
/**
|
|
9
13
|
* A link is styled text that navigates users to another location, either within the current experience or to a different app or website.
|
|
10
14
|
*/
|
|
11
|
-
const TextLink = ({ text, href, iconBefore, rel, target = "self", underline, appearance = "primary", disabled, onClick, isLoading, Icon, className }) => isLoading ? (React__default.createElement("span", null, "skeleton")) : (React__default.createElement("a", Object.assign({ target: `_${target}`, rel: rel, className: classNames(`textLink textLink_color_${appearance}`, className, {
|
|
15
|
+
const TextLink = ({ text, href, iconBefore, rel, target = "self", underline, appearance = "primary", size = "medium", disabled, onClick, isLoading, Icon, className }) => isLoading ? (React__default.createElement("span", null, "skeleton")) : (React__default.createElement("a", Object.assign({ target: `_${target}`, rel: rel, className: classNames(`textLink textLink_size_${size} textLink_color_${appearance}`, className, {
|
|
12
16
|
textLink_underline: underline,
|
|
13
17
|
textLink_disabled: disabled
|
|
14
18
|
}), href: href, onClick: onClick }, (disabled && { tabIndex: -1 })),
|
|
15
|
-
React__default.createElement(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Icon && !iconBefore && React__default.createElement(Icon, { className: "textLink__icon textLink__icon_after", size: 20 }))));
|
|
19
|
+
Icon && iconBefore && React__default.createElement(Icon, { className: "textLink__icon textLink__icon_before", size: iconSize[size] }),
|
|
20
|
+
React__default.createElement("span", { className: "textLink__text" }, text),
|
|
21
|
+
Icon && !iconBefore && React__default.createElement(Icon, { className: "textLink__icon textLink__icon_after", size: iconSize[size] })));
|
|
19
22
|
|
|
20
23
|
export { TextLink as default };
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import React, { FC } from "react";
|
|
2
|
+
import { IconProps } from "@geneui/icons";
|
|
2
3
|
import "./TextLink.scss";
|
|
3
|
-
interface IconProps extends React.SVGProps<SVGSVGElement> {
|
|
4
|
-
size?: 16 | 20 | 24 | 28 | 32 | 48;
|
|
5
|
-
color?: string;
|
|
6
|
-
}
|
|
7
4
|
interface ITextLinkProps {
|
|
8
5
|
/**
|
|
9
6
|
* Main visible content in the link.
|
|
@@ -39,6 +36,11 @@ interface ITextLinkProps {
|
|
|
39
36
|
* Possible values: <code>primary | secondary | inverse </code>
|
|
40
37
|
*/
|
|
41
38
|
appearance?: "primary" | "secondary" | "inverse";
|
|
39
|
+
/**
|
|
40
|
+
* Defines the size of the Text Link.<br>
|
|
41
|
+
* Possible values: `medium | large`
|
|
42
|
+
*/
|
|
43
|
+
size?: "medium" | "large";
|
|
42
44
|
/**
|
|
43
45
|
* When `true`, the link is disabled and not clickable.
|
|
44
46
|
*/
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React, { FC, ReactElement } from "react";
|
|
2
|
+
import "./KeyValue.scss";
|
|
3
|
+
import { IKeyProps } from "./Key";
|
|
4
|
+
import { IValueProps } from "./Value";
|
|
5
|
+
interface IKeyValueContextProps {
|
|
6
|
+
/**
|
|
7
|
+
* Size
|
|
8
|
+
* Possible values: `medium | large`;
|
|
9
|
+
*/
|
|
10
|
+
size?: "medium" | "large";
|
|
11
|
+
}
|
|
12
|
+
interface IKeyValueProps extends IKeyValueContextProps {
|
|
13
|
+
/**
|
|
14
|
+
* Additional class for the parent element.
|
|
15
|
+
* This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Key - Value direction <br/>
|
|
20
|
+
* Possible values: `vertical | horizontal`
|
|
21
|
+
*/
|
|
22
|
+
direction?: "vertical" | "horizontal";
|
|
23
|
+
/**
|
|
24
|
+
* Adds space between key and value in horizontal direction.
|
|
25
|
+
*/
|
|
26
|
+
spaceBetween?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Children - value direction <br/>
|
|
29
|
+
* Possible values: `Key | Value`
|
|
30
|
+
*/
|
|
31
|
+
children: [ReactElement<IKeyProps>, ReactElement<IValueProps>];
|
|
32
|
+
}
|
|
33
|
+
declare const KeyValueContext: React.Context<IKeyValueContextProps>;
|
|
34
|
+
/**
|
|
35
|
+
* Key Value components present data in a key-value format, typically used to display information obtained from other components. A common use case is setting up a Key Value component to show detailed information from a selected table row.
|
|
36
|
+
*/
|
|
37
|
+
declare const KeyValue: FC<IKeyValueProps>;
|
|
38
|
+
export { IKeyValueProps, KeyValueContext, KeyValue as default };
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export { default as Tooltip } from "./components/molecules/Tooltip";
|
|
|
14
14
|
export { default as ProgressBar } from "./components/molecules/ProgressBar";
|
|
15
15
|
export { Steps, Step, IStepProps, IStepsProps } from "./components/molecules/Steps";
|
|
16
16
|
export { default as Tag, ITagProps } from "./components/molecules/Tag";
|
|
17
|
+
export { KeyValue, Key, Value, IKeyValueProps, IKeyProps, IValueProps } from "./components/molecules/KeyValue";
|
|
17
18
|
export { default as GeneUIProvider, GeneUIDesignSystemContext, IGeneUIDesignSystemContext, IGeneUIProviderProps } from "./components/providers/GeneUIProvider";
|
|
18
19
|
export { default as useDebounce } from "./hooks/useDebounceCallback";
|
|
19
20
|
export { default as useEllipsisDetection } from "./hooks/useEllipsisDetection";
|
package/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export { default as Tooltip } from './Tooltip.js';
|
|
|
14
14
|
export { default as ProgressBar } from './ProgressBar.js';
|
|
15
15
|
export { Step, Steps } from './Steps.js';
|
|
16
16
|
export { default as Tag } from './Tag.js';
|
|
17
|
+
export { Key, KeyValue, Value } from './KeyValue.js';
|
|
17
18
|
export { GeneUIDesignSystemContext, default as GeneUIProvider } from './GeneUIProvider.js';
|
|
18
19
|
export { u as useDebounce } from './useDebounceCallback-999deae7.js';
|
|
19
20
|
export { u as useEllipsisDetection } from './useEllipsisDetection-e545ae62.js';
|
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-
|
|
4
|
+
"version": "3.0.0-next-e1ffab5-19022025",
|
|
5
5
|
"author": "SoftConstruct",
|
|
6
6
|
"homepage": "https://github.com/softconstruct/gene-ui-components#readme",
|
|
7
7
|
"repository": {
|