@geneui/components 3.0.0-next-63cb5e7-01112024 → 3.0.0-next-f0c40b8-25112024

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/Button.js ADDED
@@ -0,0 +1,43 @@
1
+ import React__default, { forwardRef } from 'react';
2
+ import { c as classNames } from './index-ce02421b.js';
3
+ import { s as styleInject } from './style-inject.es-746bb8ed.js';
4
+ import Loader from './Loader.js';
5
+
6
+ var css_248z = ".button{align-items:center;border-style:var(--guit-ref-border-style-solid);border-width:var(--guit-ref-border-width-thin);cursor:pointer;display:inline-flex;justify-content:center;min-width:-webkit-max-content;min-width:max-content;position:relative;-webkit-user-select:none;user-select:none}.button:not(.button_type_outline){border-color:var(--guit-ref-color-transparent-neutral-0-0)}.button_icon_before{flex-direction:row}.button_icon_after{flex-direction:row-reverse}.button_color_primary.button_type_fill{background-color:var(--guit-sem-color-background-brand-2);color:var(--guit-sem-color-foreground-inverse)}.button_color_primary.button_type_fill:hover{background-color:var(--guit-sem-color-background-brand-2-hover)}.button_color_primary.button_type_fill:active{background-color:var(--guit-sem-color-background-brand-2-pressed)}.button_color_primary.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_primary.button_type_outline{border-color:var(--guit-sem-color-border-brand);color:var(--guit-sem-color-foreground-brand)}.button_color_primary.button_type_outline:hover{background-color:var(--guit-sem-color-background-brand-1-hover)}.button_color_primary.button_type_outline:active{background-color:var(--guit-sem-color-background-brand-1-pressed)}.button_color_primary.button_type_outline:disabled{border-color:var(--guit-sem-color-border-disabled-1)}.button_color_primary.button_type_text{color:var(--guit-sem-color-foreground-brand)}.button_color_primary.button_type_text:hover{background-color:var(--guit-sem-color-background-brand-1-hover)}.button_color_primary.button_type_text:active{background-color:var(--guit-sem-color-background-brand-1-pressed)}.button_color_secondary.button_type_fill{background-color:var(--guit-sem-color-background-neutral-2);color:var(--guit-sem-color-foreground-neutral-2)}.button_color_secondary.button_type_fill:hover{background-color:var(--guit-sem-color-background-neutral-2-hover)}.button_color_secondary.button_type_fill:active{background-color:var(--guit-sem-color-background-neutral-2-pressed)}.button_color_secondary.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_secondary.button_type_outline{background-color:var(--guit-sem-color-background-transparent-1);border-color:var(--guit-sem-color-border-neutral-2);color:var(--guit-sem-color-foreground-neutral-2)}.button_color_secondary.button_type_outline:hover{background-color:var(--guit-sem-color-background-transparent-1-hover)}.button_color_secondary.button_type_outline:active{background-color:var(--guit-sem-color-background-transparent-1-pressed)}.button_color_secondary.button_type_outline:disabled{border-color:var(--guit-sem-color-border-disabled-1)}.button_color_secondary.button_type_text{background-color:var(--guit-sem-color-background-transparent-1);color:var(--guit-sem-color-foreground-neutral-2)}.button_color_secondary.button_type_text:hover{background-color:var(--guit-sem-color-background-transparent-1-hover)}.button_color_secondary.button_type_text:active{background-color:var(--guit-sem-color-background-transparent-1-pressed)}.button_color_danger.button_type_fill{background-color:var(--guit-sem-color-background-error-2);color:var(--guit-sem-color-foreground-inverse)}.button_color_danger.button_type_fill:hover{background-color:var(--guit-sem-color-background-error-2-hover)}.button_color_danger.button_type_fill:active{background-color:var(--guit-sem-color-background-error-2-pressed)}.button_color_danger.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_danger.button_type_outline{border-color:var(--guit-sem-color-border-error);color:var(--guit-sem-color-foreground-error)}.button_color_danger.button_type_outline:hover{background-color:var(--guit-sem-color-background-error-1-hover)}.button_color_danger.button_type_outline:active{background-color:var(--guit-sem-color-background-error-1-pressed)}.button_color_danger.button_type_outline:disabled{border-color:var(--guit-sem-color-border-disabled-1)}.button_color_danger.button_type_text{background-color:var(--guit-sem-color-background-transparent-1);color:var(--guit-sem-color-foreground-error)}.button_color_danger.button_type_text:hover{background-color:var(--guit-sem-color-background-error-1-hover)}.button_color_danger.button_type_text:active{background-color:var(--guit-sem-color-background-error-1-pressed)}.button_color_success.button_type_fill{background-color:var(--guit-sem-color-background-success-2);color:var(--guit-sem-color-foreground-neutral-2-notheme)}.button_color_success.button_type_fill:hover{background-color:var(--guit-sem-color-background-success-2-hover)}.button_color_success.button_type_fill:active{background-color:var(--guit-sem-color-background-success-2-pressed)}.button_color_success.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_success.button_type_outline{border-color:var(--guit-sem-color-border-success);color:var(--guit-sem-color-foreground-success)}.button_color_success.button_type_outline:hover{background-color:var(--guit-sem-color-background-success-1-hover)}.button_color_success.button_type_outline:active{background-color:var(--guit-sem-color-background-success-1-pressed)}.button_color_success.button_type_outline:disabled{border-color:var(--guit-sem-color-border-disabled-1)}.button_color_success.button_type_text{background-color:var(--guit-sem-color-background-transparent-1);color:var(--guit-sem-color-foreground-success)}.button_color_success.button_type_text:hover{background-color:var(--guit-sem-color-background-success-1-hover)}.button_color_success.button_type_text:active{background-color:var(--guit-sem-color-background-success-1-pressed)}.button_color_inverse.button_type_fill{background-color:var(--guit-sem-color-background-inverse);color:var(--guit-sem-color-foreground-neutral-2)}.button_color_inverse.button_type_fill:hover{background-color:var(--guit-sem-color-background-inverse-hover)}.button_color_inverse.button_type_fill:active{background-color:var(--guit-sem-color-background-inverse-pressed)}.button_color_inverse.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_inverse.button_type_outline{background-color:var(--guit-sem-color-background-transparent-1);border-color:var(--guit-sem-color-border-inverse);color:var(--guit-sem-color-foreground-inverse)}.button_color_inverse.button_type_outline:hover{background-color:var(--guit-sem-color-background-transparent-1-hover)}.button_color_inverse.button_type_outline:active{background-color:var(--guit-sem-color-background-transparent-1-pressed)}.button_color_inverse.button_type_outline:disabled{border-color:var(--guit-sem-color-border-inverse-disabled);color:var(--guit-sem-color-foreground-inverse-disabled)}.button_color_inverse.button_type_text{background-color:var(--guit-sem-color-background-transparent-1);color:var(--guit-sem-color-foreground-inverse)}.button_color_inverse.button_type_text:hover{background-color:var(--guit-sem-color-background-transparent-1-hover)}.button_color_inverse.button_type_text:active{background-color:var(--guit-sem-color-background-transparent-1-pressed)}.button_color_inverse.button_type_text:disabled{color:var(--guit-sem-color-foreground-inverse-disabled)}.button_color_transparent.button_type_fill{background-color:var(--guit-sem-color-background-transparent-inverse-2);color:var(--guit-sem-color-foreground-inverse)}.button_color_transparent.button_type_fill:hover{background-color:var(--guit-sem-color-background-transparent-inverse-2-hover)}.button_color_transparent.button_type_fill:active{background-color:var(--guit-sem-color-background-transparent-inverse-2-pressed)}.button_color_transparent.button_type_fill:disabled{background-color:var(--guit-sem-color-background-disabled)}.button_color_transparent.button_type_outline{border-color:var(--guit-sem-color-border-inverse);color:var(--guit-sem-color-foreground-inverse)}.button_color_transparent.button_type_outline:hover{background-color:var(--guit-sem-color-background-transparent-inverse-2-hover)}.button_color_transparent.button_type_outline:active{background-color:var(--guit-sem-color-background-transparent-inverse-2-pressed)}.button_color_transparent.button_type_outline:disabled{border-color:var(--guit-sem-color-border-inverse-disabled);color:var(--guit-sem-color-foreground-disabled)}.button_color_transparent.button_type_text{background-color:var(--guit-sem-color-background-transparent-inverse-1);color:var(--guit-sem-color-foreground-inverse)}.button_color_transparent.button_type_text:hover{background-color:var(--guit-sem-color-background-transparent-inverse-2-hover)}.button_color_transparent.button_type_text:active{background-color:var(--guit-sem-color-background-transparent-inverse-2-pressed)}.button_color_transparent.button_type_text:disabled{color:var(--guit-sem-color-foreground-disabled)}.button_size_large{border-radius:var(--guit-ref-radius-2xsmall);gap:var(--guit-ref-spacing-xsmall);height:var(--guit-sem-dimension-height-large)}.button_size_large:not(.button_icon_only){padding-bottom:var(--guit-ref-spacing-small);padding-top:var(--guit-ref-spacing-small)}.button_size_large:not(.button_icon_before,.button_size_large.button_icon_after,.button_icon_only){min-width:var(--guit-sem-dimension-width-2xlarge);padding-inline-end:var(--guit-ref-spacing-large);padding-inline-start:var(--guit-ref-spacing-large)}.button_size_large.button_icon_after,.button_size_large.button_icon_before{min-width:var(--guit-sem-dimension-width-5xlarge)}.button_size_large.button_icon_before{padding-inline-end:var(--guit-ref-spacing-large);padding-inline-start:var(--guit-ref-spacing-medium)}.button_size_large.button_icon_after{padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-large)}.button_size_large.button_icon_only{min-width:var(--guit-sem-dimension-width-large);padding:var(--guit-ref-spacing-small)}.button_size_medium{border-radius:var(--guit-ref-radius-3xsmall);gap:var(--guit-ref-spacing-xsmall);height:var(--guit-sem-dimension-height-medium)}.button_size_medium:not(.button_icon_only){padding-bottom:var(--guit-ref-spacing-2xsmall);padding-top:var(--guit-ref-spacing-2xsmall)}.button_size_medium:not(.button_icon_before,.button_size_medium.button_icon_after,.button_icon_only){min-width:var(--guit-sem-dimension-width-2xlarge);padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-medium)}.button_size_medium.button_icon_after,.button_size_medium.button_icon_before{min-width:var(--guit-sem-dimension-width-3xlarge)}.button_size_medium.button_icon_before{padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-xsmall)}.button_size_medium.button_icon_after{padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-medium)}.button_size_medium.button_icon_only{min-width:var(--guit-sem-dimension-width-medium);padding:var(--guit-ref-spacing-2xsmall)}.button_size_small{border-radius:var(--guit-ref-radius-3xsmall);gap:var(--guit-ref-spacing-2xsmall);height:var(--guit-sem-dimension-height-small)}.button_size_small:not(.button_icon_only){padding-bottom:var(--guit-ref-spacing-4xsmall);padding-top:var(--guit-ref-spacing-4xsmall)}.button_size_small:not(.button_icon_before,.button_size_small.button_icon_after,.button_icon_only){min-width:var(--guit-sem-dimension-width-2xlarge);padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-medium)}.button_size_small.button_icon_after,.button_size_small.button_icon_before{min-width:var(--guit-sem-dimension-width-3xlarge)}.button_size_small.button_icon_before{padding-inline-end:var(--guit-ref-spacing-medium);padding-inline-start:var(--guit-ref-spacing-xsmall)}.button_size_small.button_icon_after{padding-inline-end:var(--guit-ref-spacing-xsmall);padding-inline-start:var(--guit-ref-spacing-medium)}.button_size_small.button_icon_only{min-width:var(--guit-sem-dimension-width-small);padding:var(--guit-ref-spacing-4xsmall)}.button_size_XSmall{border-radius:var(--guit-ref-radius-4xsmall);height:var(--guit-sem-dimension-height-small-nudge)}.button_size_XSmall.button_icon_only{min-width:var(--guit-sem-dimension-width-small-nudge);padding:var(--guit-ref-spacing-4xsmall)}.button_fullWidth{width:100%}.button_loading .button__loader{visibility:visible}.button_loading .button__icon,.button_loading .button__text{visibility:hidden}.button.disabled,.button:disabled{color:var(--guit-sem-color-foreground-disabled);pointer-events:none}.button__text{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-semibold-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.button__icon{flex:0 0 auto}.button__loader{align-items:center;border-radius:inherit;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;visibility:hidden;width:100%}";
7
+ styleInject(css_248z);
8
+
9
+ const iconSizes = {
10
+ large: 20,
11
+ medium: 20,
12
+ small: 20,
13
+ XSmall: 16
14
+ };
15
+ const loadingTypes = {
16
+ primary: { fill: "inverse", outline: "brand", text: "brand" },
17
+ secondary: { fill: "neutral", outline: "neutral", text: "neutral" },
18
+ danger: { fill: "inverse", outline: "neutral", text: "neutral" },
19
+ success: { fill: "neutral", outline: "neutral", text: "neutral" },
20
+ inverse: { fill: "neutral", outline: "inverse", text: "inverse" },
21
+ transparent: { fill: "inverse", outline: "inverse", text: "inverse" }
22
+ };
23
+ /**
24
+ * Button initiates an action or event. Use buttons for key actions like submitting a form, saving changes, or advancing to the next step.
25
+ */
26
+ const Button = forwardRef(({ appearance = "primary", disabled, fullWidth, name, size = "medium", displayType = "fill", text, Icon, onClick, className, iconAfter, isLoading }, ref) => {
27
+ const isSizeXS = size === "XSmall";
28
+ const isTextDisplayForXS = (appearance === "primary" || appearance === "danger" || appearance === "success") && isSizeXS;
29
+ return (React__default.createElement("button", { ref: ref, name: name, type: "button", onClick: onClick, disabled: disabled, className: classNames(`button button_size_${size}
30
+ button_color_${appearance}
31
+ button_type_${isTextDisplayForXS ? "text" : displayType}`, className, {
32
+ button_fullWidth: fullWidth,
33
+ button_icon_before: !iconAfter && Icon && text,
34
+ button_icon_after: iconAfter && Icon && text,
35
+ button_icon_only: (!text || isSizeXS) && Icon,
36
+ button_loading: isLoading
37
+ }) },
38
+ isLoading && (React__default.createElement(Loader, { size: "smallNudge", className: "button__loader", appearance: loadingTypes[appearance][displayType] })),
39
+ Icon && React__default.createElement(Icon, { size: iconSizes[size], className: "button__icon" }),
40
+ text && !isSizeXS && React__default.createElement("span", { className: "button__text" }, text)));
41
+ });
42
+
43
+ export { Button as default };
package/HelperText.js CHANGED
@@ -46,14 +46,14 @@ var SvgWarningFill = function SvgWarningFill(_ref) {
46
46
  var css_248z = ".helperText{display:inline-flex;gap:var(--guit-ref-spacing-3xsmall);max-width:100%}.helperText_size_medium .helperText__text{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)}.helperText_size_small .helperText__text{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)}.helperText_type_rest{color:var(--guit-sem-color-foreground-neutral-2)}.helperText_type_danger{color:var(--guit-sem-color-foreground-error)}.helperText_type_warning{color:var(--guit-sem-color-foreground-neutral-2)}.helperText_type_warning .helperText__icon{color:var(--guit-sem-color-foreground-warning)}.helperText_disabled,.helperText_disabled .helperText__icon{color:var(--guit-sem-color-foreground-disabled)}.helperText__icon{flex:0 0 auto}";
47
47
  styleInject(css_248z);
48
48
 
49
+ const iconSize = {
50
+ small: 16,
51
+ medium: 20
52
+ };
49
53
  /**
50
54
  * The Helper Text provides users with additional information or guidance related to a specific input field in a form. This text helps users understand the expected format, requirements, or purpose of the input, thereby improving form completion accuracy and user confidence.
51
55
  */
52
56
  const HelperText = ({ size = "medium", type = "rest", text, Icon, isDisabled, isLoading, className }) => {
53
- const iconSize = {
54
- small: 16,
55
- medium: 20
56
- };
57
57
  const iconMap = {
58
58
  danger: React__default.createElement(SvgErrorAlertFill, { size: iconSize[size] }),
59
59
  warning: React__default.createElement(SvgWarningFill, { size: iconSize[size] }),
package/Loader.js CHANGED
@@ -7,15 +7,15 @@ styleInject(css_248z);
7
7
  /**
8
8
  *Loading spinner is a visual indicator that informs users an operation is in progress. Typically displayed as a rotating icon or circular animation, it signals that the system is working on a task, such as loading data or processing a request, and that the user should wait until the process is complete.
9
9
  */
10
- const Loader = ({ isLoading = true, text, textPosition = "after", size = "medium", appearance = "brand", children = null }) => {
10
+ const Loader = ({ isLoading = true, text, textPosition = "after", size = "medium", appearance = "brand", children, className = "" }) => {
11
11
  if (isLoading) {
12
- return (React__default.createElement("span", { className: `loader loader_direction_${textPosition} loader_size_${size} loader_color_${appearance}` },
12
+ return (React__default.createElement("span", { className: `loader loader_direction_${textPosition} loader_size_${size} loader_color_${appearance} ${className}` },
13
13
  React__default.createElement("span", { className: "loader__spinnerWrapper" },
14
14
  React__default.createElement("svg", { className: "loader__spinner", viewBox: "0 0 50 50" },
15
15
  React__default.createElement("circle", { className: "loader__spinnerPath", cx: "25", cy: "25", r: "22", fill: "none", strokeWidth: "5" }))),
16
16
  text && React__default.createElement("span", { className: `loader__text loader__textColor_${appearance}` }, text)));
17
17
  }
18
- return children;
18
+ return React__default.createElement(React__default.Fragment, null, children);
19
19
  };
20
20
 
21
21
  export { Loader as default };
package/ProgressBar.js ADDED
@@ -0,0 +1,67 @@
1
+ import React__default, { useState, useMemo, useEffect } from 'react';
2
+ import { c as classNames } from './index-ce02421b.js';
3
+ import HelperText from './HelperText.js';
4
+ import Label from './Label.js';
5
+ import { s as styleInject } from './style-inject.es-746bb8ed.js';
6
+ import './ArrowLeft-b88e2ba8.js';
7
+ import './Tooltip.js';
8
+ import 'react-dom';
9
+ import './GeneUIProvider.js';
10
+ import './useEllipsisDetection-46d712b6.js';
11
+ import './Info.js';
12
+
13
+ var css_248z = ".progressBar{display:flex;flex-direction:column;gap:var(--guit-ref-spacing-3xsmall);min-width:24rem;width:100%}.progressBar_type_determinate .progressBar__loadingBar,.progressBar_type_indeterminate .progressBar__fill{display:none}.progressBar_type_indeterminate .progressBar__loadingBar{animation-duration:1.6s;animation-iteration-count:infinite;animation-timing-function:var(--guit-ref-motion-easing-standard);will-change:transform}[dir=ltr] .progressBar_type_indeterminate .progressBar__loadingBar{animation-name:progress-bar-loading-from-left}[dir=rtl] .progressBar_type_indeterminate .progressBar__loadingBar{animation-name:progress-bar-loading-from-right}.progressBar_size_large .progressBar__status,.progressBar_size_medium .progressBar__status{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)}.progressBar_size_large .progressBar__track{border-radius:var(--guit-ref-radius-xsmall);height:var(--guit-sem-dimension-height-xsmall)}.progressBar_size_medium .progressBar__track{border-radius:var(--guit-ref-radius-2xsmall);height:var(--guit-sem-dimension-height-2xsmall)}.progressBar_size_small .progressBar__track{border-radius:var(--guit-ref-radius-3xsmall);height:var(--guit-sem-dimension-height-3xsmall)}.progressBar_size_small .progressBar__status{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)}.progressBar_color_default .progressBar__fill,.progressBar_color_default .progressBar__loadingBar{background-color:var(--guit-sem-color-background-brand-2)}.progressBar_color_success .progressBar__fill,.progressBar_color_success .progressBar__loadingBar{background-color:var(--guit-sem-color-background-success-2)}.progressBar_color_error .progressBar__fill,.progressBar_color_error .progressBar__loadingBar{background-color:var(--guit-sem-color-background-error-2)}.progressBar__track{background-color:var(--guit-sem-color-background-neutral-2);overflow:hidden;width:100%}.progressBar__fill,.progressBar__loadingBar{border-radius:inherit;height:100%}.progressBar__loadingBar{width:50%}.progressBar__info{align-items:flex-start;display:flex;gap:var(--guit-ref-spacing-xsmall);justify-content:space-between;width:100%}.progressBar__helperText{word-break:break-word}.progressBar__status{color:var(--guit-sem-color-foreground-neutral-2);display:inline-flex;flex:0 0 auto;gap:.4rem;margin-inline-start:auto}.progressBar__uploadingText{display:inline-block}@keyframes progress-bar-loading-from-left{0%{transform:translate3d(-100%,0,0)}to{transform:translate3d(200%,0,0)}}@keyframes progress-bar-loading-from-right{0%{transform:translate3d(100%,0,0)}to{transform:translate3d(-200%,0,0)}}";
14
+ styleInject(css_248z);
15
+
16
+ const helperTextTypeMap = {
17
+ default: "rest",
18
+ success: "rest",
19
+ error: "danger"
20
+ };
21
+ const helperTextAndLabelSizeMap = {
22
+ large: "medium",
23
+ medium: "medium",
24
+ small: "small"
25
+ };
26
+ /**
27
+ * A progress bar offers visual feedback on the status and duration of a process, such as a download, file transfer, or installation, helping users understand how much longer they need to wait.
28
+ */
29
+ const ProgressBar = ({ className, size = "medium", type = "determinate", error, helperText, percent, uploadingText, infoText, label }) => {
30
+ const [status, setStatus] = useState("default");
31
+ const isDeterminate = type === "determinate";
32
+ const isTypeDefault = status === "default";
33
+ const isPercentLowerThanMax = percent !== undefined && percent < 100;
34
+ const processedPercent = useMemo(() => {
35
+ let result = percent || 0;
36
+ if (result < 0 && !error)
37
+ result = 0;
38
+ if (result >= 100 || error)
39
+ result = 100;
40
+ return `${result}%`;
41
+ }, [percent, error]);
42
+ useEffect(() => {
43
+ if (error && status !== "error") {
44
+ setStatus("error");
45
+ }
46
+ else if (percent !== undefined && !error) {
47
+ if (percent >= 100 && status !== "success" && isDeterminate) {
48
+ setStatus("success");
49
+ }
50
+ else if ((!isTypeDefault && isPercentLowerThanMax && isDeterminate) || !isDeterminate) {
51
+ setStatus("default");
52
+ }
53
+ }
54
+ }, [error, isTypeDefault, status, percent, isDeterminate]);
55
+ return (React__default.createElement("div", { className: classNames(`progressBar progressBar_type_${error ? "determinate" : type} progressBar_size_${size} progressBar_color_${status}`, className) },
56
+ React__default.createElement(Label, { labelText: label, size: helperTextAndLabelSizeMap[size], infoText: infoText }),
57
+ React__default.createElement("div", { className: "progressBar__track" },
58
+ (isDeterminate || error) && React__default.createElement("div", { className: "progressBar__fill", style: { width: processedPercent } }),
59
+ React__default.createElement("div", { className: "progressBar__loadingBar" })),
60
+ React__default.createElement("div", { className: "progressBar__info" },
61
+ helperText && (React__default.createElement(HelperText, { text: helperText, size: helperTextAndLabelSizeMap[size], type: helperTextTypeMap[status], className: "progressBar__helperText" })),
62
+ isDeterminate && isTypeDefault && isPercentLowerThanMax && (React__default.createElement("p", { className: "progressBar__status" },
63
+ React__default.createElement("span", { className: "progressBar__uploadingText" }, uploadingText),
64
+ React__default.createElement("span", { className: "progressBar__percent" }, processedPercent))))));
65
+ };
66
+
67
+ export { ProgressBar as default };
@@ -0,0 +1,64 @@
1
+ import React, { FC, MouseEvent } from "react";
2
+ import { IconProps } from "@geneui/icons";
3
+ import "./Button.scss";
4
+ interface IButtonProps {
5
+ /**
6
+ * Specifies the name of the `button`, which can be useful for form submission to identify which button was clicked.
7
+ */
8
+ name?: string;
9
+ /**
10
+ * Size <br>
11
+ * Possible values: `large | medium | small`
12
+ */
13
+ size?: "large" | "medium" | "small" | "XSmall";
14
+ /**
15
+ * If `true`, the `button` will stretch to occupy the full width of its container.
16
+ */
17
+ fullWidth?: boolean;
18
+ /**
19
+ * Indicates whether the `button` is `disabled`, preventing user interaction, focus, click etc...
20
+ */
21
+ disabled?: boolean;
22
+ /**
23
+ * Affect form styling point of view. <br>
24
+ * Possible values: `fill | outline | text`
25
+ */
26
+ displayType?: "fill" | "outline" | "text";
27
+ /**
28
+ * Indicates the action meaning. <br>
29
+ * Possible values: `primary | secondary | danger | success | inverse | transparent`
30
+ */
31
+ appearance?: "primary" | "secondary" | "danger" | "success" | "inverse" | "transparent";
32
+ /**
33
+ * The text will shown as content of the `button`.
34
+ */
35
+ text?: string;
36
+ /**
37
+ * The `Icon` prop accepts a React Functional Component that will be displayed alongside the button text.
38
+ */
39
+ Icon?: FC<IconProps>;
40
+ /**
41
+ * A callback function that is called when the `button` is clicked or entered. <br>
42
+ * It receives an argument containing the event object, which can be a mouse or keyboard event.
43
+ */
44
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
45
+ /**
46
+ * Icon position <br>
47
+ * If the prop is `true` the `Icon` will be shown after the `text` otherwise before the `text`.
48
+ */
49
+ iconAfter?: boolean;
50
+ /**
51
+ * The prop responsible for showing the loading spinner if passed `true`. The default value is `false`
52
+ */
53
+ isLoading?: boolean;
54
+ /**
55
+ * Additional class for the parent element.<br>
56
+ * This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
57
+ */
58
+ className?: string;
59
+ }
60
+ /**
61
+ * Button initiates an action or event. Use buttons for key actions like submitting a form, saving changes, or advancing to the next step.
62
+ */
63
+ declare const Button: React.ForwardRefExoticComponent<IButtonProps & React.RefAttributes<HTMLButtonElement>>;
64
+ export { IButtonProps, Button as default };
@@ -0,0 +1 @@
1
+ export { IButtonProps, default } from "./Button";
@@ -10,7 +10,7 @@ interface ILabelProps {
10
10
  * The text content of the `label`.
11
11
  * This is the main text displayed within the `label`.
12
12
  */
13
- labelText: string;
13
+ labelText?: string;
14
14
  /**
15
15
  * Indicates whether the label represents a required field.
16
16
  * When set to `true`, a visual indicator (asterisk) will be added to denote that the field is required.
@@ -28,6 +28,10 @@ interface ILoaderProps {
28
28
  * Possible values: `below | after`
29
29
  */
30
30
  textPosition?: "below" | "after";
31
+ /**
32
+ * Additional className
33
+ */
34
+ className?: string;
31
35
  }
32
36
  /**
33
37
  *Loading spinner is a visual indicator that informs users an operation is in progress. Typically displayed as a rotating icon or circular animation, it signals that the system is working on a task, such as loading data or processing a request, and that the user should wait until the process is complete.
@@ -0,0 +1,52 @@
1
+ import { FC } from "react";
2
+ import "./ProgressBar.scss";
3
+ interface IProgressBarProps {
4
+ /**
5
+ * Specifies the progress percentage displayed by the progress bar.<br>
6
+ * Valid values are between `0` and `100`. Values less than `0` will fallback to `0`,
7
+ * and values greater than `100` will fallback to `100`.<br>
8
+ * In case of value is `100` or greater the style of the component will be changed to success.
9
+ */
10
+ percent?: number;
11
+ /**
12
+ * Text displayed alongside the progress percentage.
13
+ */
14
+ uploadingText?: string;
15
+ /**
16
+ * Defines the size of the progress bar.<br>
17
+ * Possible values: `large | medium | small`
18
+ */
19
+ size?: "large" | "medium" | "small";
20
+ /**
21
+ * Sets the behavior of the bar for measurable or ongoing processes.<br>
22
+ * Possible values: `determinate | indeterminate`
23
+ */
24
+ type?: "determinate" | "indeterminate";
25
+ /**
26
+ * Indicates an error state for the progress bar.<br>
27
+ * When `true`, the progress bar appears in the error style.
28
+ */
29
+ error?: boolean;
30
+ /**
31
+ * Adds supplementary information below the progress bar.
32
+ */
33
+ helperText?: string;
34
+ /**
35
+ * Additional descriptive text shown with info icon and tooltip alongside of the label component.
36
+ */
37
+ infoText?: string;
38
+ /**
39
+ * The main label text describing the progress bar's purpose.
40
+ */
41
+ label?: string;
42
+ /**
43
+ * Additional class for the parent element.
44
+ * This prop should be used to set placement properties for the element relative to its parent using BEM conventions.
45
+ */
46
+ className?: string;
47
+ }
48
+ /**
49
+ * A progress bar offers visual feedback on the status and duration of a process, such as a download, file transfer, or installation, helping users understand how much longer they need to wait.
50
+ */
51
+ declare const ProgressBar: FC<IProgressBarProps>;
52
+ export { IProgressBarProps, ProgressBar as default };
@@ -0,0 +1 @@
1
+ export { IProgressBarProps, default } from "./ProgressBar";
package/index.d.ts CHANGED
@@ -5,7 +5,9 @@ export { default as Loader, ILoaderProps } from "./components/atoms/Loader";
5
5
  export { default as Pill, IPillProps } from "./components/atoms/Pill";
6
6
  export { default as Divider, IDividerProps } from "./components/atoms/Divider";
7
7
  export { default as Info, IInfoProps } from "./components/atoms/Info";
8
+ export { default as Button, IButtonProps } from "./components/atoms/Button";
8
9
  export { default as Tooltip } from "./components/molecules/Tooltip";
10
+ export { default as ProgressBar } from "./components/molecules/ProgressBar";
9
11
  export { default as GeneUIProvider, GeneUIDesignSystemContext, IGeneUIDesignSystemContext, IGeneUIProviderProps } from "./components/providers/GeneUIProvider";
10
12
  export { default as useDebounce } from "./hooks/useDebounceCallback";
11
13
  export { default as useEllipsisDetection } from "./hooks/useEllipsisDetection";
package/index.js CHANGED
@@ -5,7 +5,9 @@ export { default as Loader } from './Loader.js';
5
5
  export { default as Pill } from './Pill.js';
6
6
  export { default as Divider } from './Divider.js';
7
7
  export { default as Info } from './Info.js';
8
+ export { default as Button } from './Button.js';
8
9
  export { default as Tooltip } from './Tooltip.js';
10
+ export { default as ProgressBar } from './ProgressBar.js';
9
11
  export { GeneUIDesignSystemContext, default as GeneUIProvider } from './GeneUIProvider.js';
10
12
  export { u as useDebounce, a as useEllipsisDetection } from './useEllipsisDetection-46d712b6.js';
11
13
  import 'react';
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-63cb5e7-01112024",
4
+ "version": "3.0.0-next-f0c40b8-25112024",
5
5
  "author": "SoftConstruct",
6
6
  "homepage": "https://github.com/softconstruct/gene-ui-components#readme",
7
7
  "repository": {