@seeqdev/qomponents 0.0.114 → 0.0.116

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.
@@ -1,12 +1,29 @@
1
- export interface ProgressBarProps {
2
- /** The progress value, between 0 and 100. */
1
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
2
+ /**
3
+ * The ProgressBar component displays a visual representation of a progress value.
4
+ */
5
+ interface ProgressIndicatorProps extends TooltipComponentProps {
6
+ /** Additional classes to apply to the progress indicator. */
7
+ extraClasses?: string;
8
+ /** The test id for the progress indicator. */
9
+ testId?: string;
10
+ /** The value of the progress indicator, between 0 and max. */
3
11
  value: number;
4
- /** The label to display above the progress bar. */
5
- label: string;
12
+ /** The color of the progress indicator. e.g. #ffffff */
13
+ color?: string;
14
+ /** The label to display on the progress indicator. */
15
+ label?: string;
16
+ /** Additional classes to apply to the label. */
17
+ labelClasses?: string;
18
+ }
19
+ export interface ProgressBarProps {
20
+ /** The indicator values */
21
+ values: ProgressIndicatorProps[];
6
22
  /** The maximum value of the progress bar. */
7
23
  max?: number;
8
- /** Additional classes to apply to the progress bar. */
9
- extraClasses?: string;
24
+ /** Additional classes to apply to the progress bar container. */
25
+ containerExtraClasses?: string;
10
26
  /** The test id for the progress bar. */
11
27
  testId?: string;
12
28
  }
29
+ export {};
package/dist/index.esm.js CHANGED
@@ -15948,7 +15948,7 @@ const InputGroup = React__default.forwardRef((props, ref) => {
15948
15948
  const fieldAppliedClasses = `${fieldClasses} ${extraClassNames} ${lightTheme} ${darkTheme} ${borderRadius} ${showError ? errorClasses : borderColorClasses} `;
15949
15949
  return (React__default.createElement("div", { id: id, className: appliedClasses },
15950
15950
  field ? (React__default.createElement("div", { "data-testid": testId, className: `tw-flex tw-flex-1 tw-cursor-pointer active:tw-z-50 ${fieldAppliedClasses}` }, field)) : (React__default.createElement(TextField, { testId: testId, readonly: readonly, onChange: onChange, onKeyUp: onKeyUp, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, name: name, ref: ref, showError: showError, value: value, required: required, placeholder: placeholder, autoComplete: autoComplete, autoFocus: autoFocus, id: id, type: type, disabled: disabled, step: step, min: min, max: max, maxLength: maxLength, minLength: minLength, extraClassNames: `tw-flex tw-flex-1 tw-w-full tw-rounded-r-none focus:tw-z-30 ${extraClassNames}`, ...tooltipData })),
15951
- append.filter(Boolean).map((item, index) => item?.variant === 'button' ? (React__default.createElement(Button, { key: index, extraClassNames: "tw-ml-[-1px] focus:tw-z-40 focus:tw-border tw-rounded-l-none tw-rounded-r-none last:tw-rounded-r-sm", onClick: item.buttonProps.onClick, variant: item.buttonProps.variant, icon: item.buttonProps.icon, iconColor: item.buttonProps.iconColor, testId: item.buttonProps.testId, disabled: item.buttonProps.disabled, label: item.buttonProps.label, iconStyle: item.buttonProps.iconStyle, tooltip: item.buttonProps.tooltip, tooltipOptions: item.buttonProps.tooltipOptions, tooltipTestId: item.buttonProps.tooltipTestId, isHtmlTooltip: item.buttonProps.isHtmlTooltip, type: item.buttonProps.type, iconPosition: item.buttonProps.iconPosition })) : (React__default.createElement("div", { key: index, className: `${borderColorClasses} tw-flex tw-items-center tw-justify-center tw-rounded-none tw-ml-[-1px] active:tw-z-30 active:tw-border tw-border last:tw-rounded-r-sm` }, item?.element)))));
15951
+ append.filter(Boolean).map((item, index) => item?.variant === 'button' ? (React__default.createElement(Button, { key: index, extraClassNames: "tw-ml-[-1px] focus:tw-z-40 focus:tw-border tw-rounded-l-none tw-rounded-r-none last:tw-rounded-r-sm", ...item.buttonProps })) : (React__default.createElement("div", { key: index, className: `${borderColorClasses} tw-flex tw-items-center tw-justify-center tw-rounded-none tw-ml-[-1px] active:tw-z-30 active:tw-border tw-border last:tw-rounded-r-sm` }, item?.element)))));
15952
15952
  });
15953
15953
 
15954
15954
  // packages/core/number/src/number.ts
@@ -17165,16 +17165,15 @@ Defaulting to \`null\`.`;
17165
17165
  var Root = Progress;
17166
17166
  var Indicator = ProgressIndicator;
17167
17167
 
17168
- const ProgressBar = ({ value, max = 100, label, extraClasses, testId }) => {
17169
- const tooltipData = getQTipData({ tooltip: label });
17170
- const [progress, setProgress] = React__default.useState(0);
17171
- React__default.useEffect(() => {
17172
- const timer = setTimeout(() => setProgress(value), 500);
17173
- return () => clearTimeout(timer);
17174
- }, []);
17175
- return (React__default.createElement("span", { "data-testid": testId, ...tooltipData },
17176
- React__default.createElement(Root, { className: "tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[2.5px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray", max: max, value: value },
17177
- React__default.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-h-full tw-bg-sq-color-dark tw-transition-transform tw-duration-[660ms] ${extraClasses}`, style: { transform: `translateX(-${100 - progress}%)` } }))));
17168
+ const ProgressBar = ({ values = [], max = 100, containerExtraClasses = '', }) => {
17169
+ return (React__default.createElement(Root, { className: `tw-relative tw-h-[18px] tw-w-full tw-overflow-hidden tw-rounded-[2.5px] tw-bg-sq-dark-gray dark:tw-bg-sq-dark-disabled-gray tw-flex tw-flex-1 ${containerExtraClasses}`, max: max, value: values.reduce((acc, { value }) => acc + value, 0) }, values.map(({ value, color = undefined, testId, label, extraClasses = '', labelClasses = '', ...tooltipProps }, i) => {
17170
+ const tooltipData = getQTipData(tooltipProps);
17171
+ return (React__default.createElement(Indicator, { className: `tw-ease-[cubic-bezier(0.65, 0, 0.35, 1)] tw-w-full tw-h-full tw-duration-[660ms] tw-flex tw-bg-sq-color-dark ${extraClasses}`, ...tooltipData, "data-qtip-text": tooltipProps.tooltip ? tooltipProps.tooltip : `${value}%`, "data-testid": `progress-bar-indicator-${testId ? testId : value}`, key: `${i}-${value}`, style: {
17172
+ // Background color will default to the theme color if undefined
17173
+ backgroundColor: values.length === 1 ? undefined : color,
17174
+ width: `${(Number(value) / Number(max)) * 100}%`,
17175
+ } }, label ? (React__default.createElement("span", { className: `tw-left-1 tw-text-xs tw-text-sq-text-color dark:tw-text-sq-dark-text tw-items-center ${labelClasses}` }, label)) : undefined));
17176
+ })));
17178
17177
  };
17179
17178
 
17180
17179
  export { Accordion, Alert, Button, ButtonWithDropdown, ButtonWithPopover, Checkbox, Icon, InputGroup, Modal, ProgressBar, QTip, SeeqActionDropdown, Select, components as SelectCompoents, Slider, Tabs, TextArea, TextField, ToolbarButton, Tooltip };