@odigos/ui-kit 0.0.44 → 0.0.45
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/CHANGELOG.md +12 -0
- package/lib/components.js +4 -4
- package/lib/containers.js +14 -11
- package/lib/functions/get-conditions-booleans/index.d.ts +4 -0
- package/lib/functions.js +2 -2
- package/lib/{index-Bup9Thvg.js → index-BSjQAYib.js} +2 -17
- package/lib/{index-AM8c03-E.js → index-C4uhvIMP.js} +6 -13
- package/lib/{index-Dxj04GUZ.js → index-CnbEaeQS.js} +1 -1
- package/lib/{index-BDBeg2A7.js → index-lkkeQEOt.js} +1 -1
- package/lib/{index-b8zuk7ta.js → index-qnmhJI4d.js} +25 -2
- package/lib/snippets.js +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.45](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.44...ui-kit-v0.0.45) (2025-06-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* re-use getConditionsBooleans function ([#188](https://github.com/odigos-io/ui-kit/issues/188)) ([e602132](https://github.com/odigos-io/ui-kit/commit/e60213239340354d44c4855abf8a39da44acdeee))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* initialize extend state with initialExtended prop in DataCard component ([#189](https://github.com/odigos-io/ui-kit/issues/189)) ([31604ca](https://github.com/odigos-io/ui-kit/commit/31604cabee2587c647354601fca37d3816a4807d))
|
|
14
|
+
|
|
3
15
|
## [0.0.44](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.43...ui-kit-v0.0.44) (2025-06-19)
|
|
4
16
|
|
|
5
17
|
|
package/lib/components.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { B as Button } from './index-
|
|
2
|
-
export { a as AutocompleteInput, b as Badge, a1 as CenterThis, C as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as Divider, i as DocsButton, j as Drawer, l as DrawerFooter, k as DrawerHeader, m as Dropdown, E as ExtendArrow, F as FadeLoader, n as FieldError, o as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, p as IconGroup, q as IconTitleBadge, r as IconWrapped, s as IconsNav, t as ImageControlled, u as Input, v as InputList, w as InputTable, x as InteractiveTable, K as KeyValueInputsList, M as Modal, a4 as ModalBody, y as MonitorsCheckboxes, z as MonitorsIcons, N as NavigationButtons, G as NoDataFound, J as NotificationNote, a3 as Overlay, S as ScrollX, L as SectionTitle, O as Segment, P as SelectionButton, Q as SkeletonLoader, R as Status, U as Stepper, a5 as TableContainer, a6 as TableTitleWrap, a7 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, a2 as VerticalScroll, _ as WarningModal } from './index-
|
|
3
|
-
export { C as CancelWarning, D as DeleteWarning } from './index-
|
|
1
|
+
import { B as Button } from './index-C4uhvIMP.js';
|
|
2
|
+
export { a as AutocompleteInput, b as Badge, a1 as CenterThis, C as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as Divider, i as DocsButton, j as Drawer, l as DrawerFooter, k as DrawerHeader, m as Dropdown, E as ExtendArrow, F as FadeLoader, n as FieldError, o as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, p as IconGroup, q as IconTitleBadge, r as IconWrapped, s as IconsNav, t as ImageControlled, u as Input, v as InputList, w as InputTable, x as InteractiveTable, K as KeyValueInputsList, M as Modal, a4 as ModalBody, y as MonitorsCheckboxes, z as MonitorsIcons, N as NavigationButtons, G as NoDataFound, J as NotificationNote, a3 as Overlay, S as ScrollX, L as SectionTitle, O as Segment, P as SelectionButton, Q as SkeletonLoader, R as Status, U as Stepper, a5 as TableContainer, a6 as TableTitleWrap, a7 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, a2 as VerticalScroll, _ as WarningModal } from './index-C4uhvIMP.js';
|
|
3
|
+
export { C as CancelWarning, D as DeleteWarning } from './index-CnbEaeQS.js';
|
|
4
4
|
import React, { Component, createElement, createContext } from 'react';
|
|
5
5
|
import { T as Theme } from './index-BD7meETN.js';
|
|
6
6
|
import './types.js';
|
|
7
7
|
import './index-CY3kjYr3.js';
|
|
8
|
-
import './index-
|
|
8
|
+
import './index-qnmhJI4d.js';
|
|
9
9
|
import 'styled-components';
|
|
10
10
|
import './index-DZWbhK14.js';
|
|
11
11
|
import './index-BV85P9UP.js';
|
package/lib/containers.js
CHANGED
|
@@ -2,19 +2,19 @@ import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, us
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { l as DISPLAY_TITLES, T as Theme, h as usePendingStore, g as useNotificationStore, b as useDrawerStore, B as BUTTON_TEXTS, c as useEntityStore, A as ACTION_OPTIONS, m as getActionIcon, f as useModalStore, F as FORM_ALERTS, d as useFilterStore, M as MONITORS_OPTIONS, $ as styleInject, i as useSelectedStore, e as useInstrumentStore, o as getInstrumentationRuleIcon, a as useDataStreamStore, n as getEntityId, S as STORAGE_KEYS, j as useSetupStore, I as INSTRUMENTATION_RULE_OPTIONS, u as useDarkMode } from './index-BD7meETN.js';
|
|
4
4
|
import { ActionType, ActionKeyTypes, InputTypes, FieldTypes, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, SignalType, HeadersCollectionKeyTypes, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType, K8sResourceKind } from './types.js';
|
|
5
|
-
import { f as DataCardFieldTypes, o as FieldLabel, C as Checkbox, n as FieldError, u as Input, w as InputTable, K as KeyValueInputsList, v as InputList, V as Text, O as Segment, L as SectionTitle, i as DocsButton, y as MonitorsCheckboxes, W as TextArea, j as Drawer, d as ConditionDetails, D as DataCard, a0 as FlexColumn, M as Modal, N as NavigationButtons, a4 as ModalBody, J as NotificationNote, a as AutocompleteInput, h as Divider, R as Status, $ as FlexRow, Y as Tooltip, r as IconWrapped, z as MonitorsIcons, a5 as TableContainer, a6 as TableTitleWrap, q as IconTitleBadge, a7 as TableWrap, x as InteractiveTable, a1 as CenterThis, G as NoDataFound, Z as TraceLoader, b as Badge, E as ExtendArrow, a2 as VerticalScroll, P as SelectionButton, B as Button, m as Dropdown, a8 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, A as AddButton$1, U as Stepper, I as IconButton, e as DataCardFields, s as IconsNav, p as IconGroup } from './index-
|
|
5
|
+
import { f as DataCardFieldTypes, o as FieldLabel, C as Checkbox, n as FieldError, u as Input, w as InputTable, K as KeyValueInputsList, v as InputList, V as Text, O as Segment, L as SectionTitle, i as DocsButton, y as MonitorsCheckboxes, W as TextArea, j as Drawer, d as ConditionDetails, D as DataCard, a0 as FlexColumn, M as Modal, N as NavigationButtons, a4 as ModalBody, J as NotificationNote, a as AutocompleteInput, h as Divider, R as Status, $ as FlexRow, Y as Tooltip, r as IconWrapped, z as MonitorsIcons, a5 as TableContainer, a6 as TableTitleWrap, q as IconTitleBadge, a7 as TableWrap, x as InteractiveTable, a1 as CenterThis, G as NoDataFound, Z as TraceLoader, b as Badge, E as ExtendArrow, a2 as VerticalScroll, P as SelectionButton, B as Button, m as Dropdown, a8 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, A as AddButton$1, U as Stepper, I as IconButton, e as DataCardFields, s as IconsNav, p as IconGroup } from './index-C4uhvIMP.js';
|
|
6
6
|
import { i as isEmpty, s as safeJsonParse } from './index-BV85P9UP.js';
|
|
7
7
|
import { C as CheckCircledIcon, O as OdigosLogo } from './index-DZWbhK14.js';
|
|
8
8
|
import { C as CrossCircledIcon, O as OdigosLogoText, a as OverviewIcon, F as FilterIcon, D as DataStreamsIcon, R as RetryIcon, N as NotificationIcon, S as SlackLogo, K as KeyIcon, T as TerminalIcon } from './index-BL1s2-bo.js';
|
|
9
9
|
import { u as useActionFormData, a as useClickNode, e as useSessionStorage, c as useDataStreamFormData, d as useDestinationFormData, b as useClickNotification, f as useSourceFormData, g as useSourceSelectionFormData } from './useSourceSelectionFormData-DmZnRueA.js';
|
|
10
10
|
import { d as useKeyDown, e as useOnClickOutside, u as useContainerSize, c as useInstrumentationRuleFormData, g as useTransition, f as useTimeAgo, a as useCopy } from './useTransition-BWC_F-Pl.js';
|
|
11
11
|
import { E as EditIcon, T as TrashIcon, S as SearchIcon, P as PlusIcon$1, h as CheckIcon, A as ArrowIcon, a as CopyIcon, i as CrossIcon } from './index-CY3kjYr3.js';
|
|
12
|
-
import { D as DeleteWarning, C as CancelWarning } from './index-
|
|
13
|
-
import { m as mapConditions,
|
|
14
|
-
import { f as filterActions,
|
|
12
|
+
import { D as DeleteWarning, C as CancelWarning } from './index-CnbEaeQS.js';
|
|
13
|
+
import { g as getConditionsBooleans, m as mapConditions, b as getStatusIcon, c as capitalizeFirstLetter } from './index-qnmhJI4d.js';
|
|
14
|
+
import { f as filterActions, m as getEntityLabel, l as getEntityIcon, v as sleep$1, o as getPlatformIcon, p as getPlatformLabel, h as formatBytes, j as getContainersIcons, q as getValueForRange, k as getDestinationIcon, g as filterSourcesByStream, e as filterSources, b as filterDestinationsByStream, a as filterDestinations, u as mapDestinationFieldsForDisplay, c as compareCondition, s as getYamlFieldsForDestination, d as deepClone, n as getMetricForEntity, r as getWorkloadId, i as getContainersInstrumentedCount, t as isOverTime } from './index-BSjQAYib.js';
|
|
15
15
|
import { createPortal } from 'react-dom';
|
|
16
16
|
import { m as mapExportedSignals } from './index-BlZKWuxe.js';
|
|
17
|
-
import { N as NoteBackToSummary, E as EditButton } from './index-
|
|
17
|
+
import { N as NoteBackToSummary, E as EditButton } from './index-lkkeQEOt.js';
|
|
18
18
|
import { D as DESTINATION_CATEGORIES } from './index-Dqief9td.js';
|
|
19
19
|
import { a6 as RulesIcon, a7 as SourcesIcon, a3 as ActionsIcon, a4 as DestinationsIcon } from './index-C3BU6Xe-.js';
|
|
20
20
|
|
|
@@ -852,16 +852,13 @@ const buildSpecCell$1 = (action) => {
|
|
|
852
852
|
};
|
|
853
853
|
|
|
854
854
|
const TableCellConditions = ({ conditions, id }) => {
|
|
855
|
-
const errors = useMemo(() => conditions
|
|
856
|
-
const warnings = useMemo(() => conditions?.filter(({ status }) => status === StatusType.Warning) || [], [conditions]);
|
|
857
|
-
const disableds = useMemo(() => conditions?.filter(({ status }) => status === OtherStatus.Disabled) || [], [conditions]);
|
|
858
|
-
const isLoading = useMemo(() => !conditions?.length || !!conditions?.find(({ status }) => status === OtherStatus.Loading), [conditions]);
|
|
855
|
+
const { errors, warnings, disableds, hasLoadings } = useMemo(() => getConditionsBooleans(conditions), [conditions]);
|
|
859
856
|
const conditionsToShow = errors.length > 0 ? errors : warnings.length > 0 ? warnings : disableds.length > 0 ? disableds : [];
|
|
860
857
|
if (conditionsToShow.length > 0) {
|
|
861
858
|
return (React.createElement("div", { style: { lineHeight: 1 } },
|
|
862
859
|
React.createElement(ConditionsStatuses, { conditions: conditionsToShow, id: id })));
|
|
863
860
|
}
|
|
864
|
-
const elseStatus =
|
|
861
|
+
const elseStatus = hasLoadings ? OtherStatus.Loading : StatusType.Success;
|
|
865
862
|
return (React.createElement("div", { style: { lineHeight: 1 } },
|
|
866
863
|
React.createElement(Status, { status: elseStatus, title: elseStatus, withBorder: true, withIcon: true })));
|
|
867
864
|
};
|
|
@@ -7028,6 +7025,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
7028
7025
|
let dragStarted = false;
|
|
7029
7026
|
let d3Selection = null;
|
|
7030
7027
|
let abortDrag = false; // prevents unintentional dragging on multitouch
|
|
7028
|
+
let nodePositionsChanged = false;
|
|
7031
7029
|
// public functions
|
|
7032
7030
|
function update({ noDragClassName, handleSelector, domNode, isSelectable, nodeId, nodeClickDistance = 0, }) {
|
|
7033
7031
|
d3Selection = select(domNode);
|
|
@@ -7084,6 +7082,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
7084
7082
|
dragItem.position = position;
|
|
7085
7083
|
dragItem.internals.positionAbsolute = positionAbsolute;
|
|
7086
7084
|
}
|
|
7085
|
+
nodePositionsChanged = nodePositionsChanged || hasChange;
|
|
7087
7086
|
if (!hasChange) {
|
|
7088
7087
|
return;
|
|
7089
7088
|
}
|
|
@@ -7155,6 +7154,7 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
7155
7154
|
const { domNode, nodeDragThreshold, transform, snapGrid, snapToGrid } = getStoreItems();
|
|
7156
7155
|
containerBounds = domNode?.getBoundingClientRect() || null;
|
|
7157
7156
|
abortDrag = false;
|
|
7157
|
+
nodePositionsChanged = false;
|
|
7158
7158
|
if (nodeDragThreshold === 0) {
|
|
7159
7159
|
startDrag(event);
|
|
7160
7160
|
}
|
|
@@ -7201,7 +7201,10 @@ function XYDrag({ onNodeMouseDown, getStoreItems, onDragStart, onDrag, onDragSto
|
|
|
7201
7201
|
cancelAnimationFrame(autoPanId);
|
|
7202
7202
|
if (dragItems.size > 0) {
|
|
7203
7203
|
const { nodeLookup, updateNodePositions, onNodeDragStop, onSelectionDragStop } = getStoreItems();
|
|
7204
|
-
|
|
7204
|
+
if (nodePositionsChanged) {
|
|
7205
|
+
updateNodePositions(dragItems, false);
|
|
7206
|
+
nodePositionsChanged = false;
|
|
7207
|
+
}
|
|
7205
7208
|
if (onDragStop || onNodeDragStop || (!nodeId && onSelectionDragStop)) {
|
|
7206
7209
|
const [currentNode, currentNodes] = getEventHandlerParams({
|
|
7207
7210
|
nodeId,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { StatusType, type Condition } from '@/types';
|
|
2
2
|
export declare const getConditionsBooleans: (conditions: Condition[]) => {
|
|
3
|
+
errors: Condition[];
|
|
3
4
|
hasErrors: boolean;
|
|
5
|
+
warnings: Condition[];
|
|
4
6
|
hasWarnings: boolean;
|
|
7
|
+
disableds: Condition[];
|
|
5
8
|
hasDisableds: boolean;
|
|
9
|
+
loadings: Condition[];
|
|
6
10
|
hasLoadings: boolean;
|
|
7
11
|
priorotizedStatus: StatusType | undefined;
|
|
8
12
|
};
|
package/lib/functions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { c as capitalizeFirstLetter, f as flattenObjectKeys, g as
|
|
2
|
-
export { c as compareCondition, d as deepClone, f as filterActions, a as filterDestinations, b as filterDestinationsByStream, e as filterSources, g as filterSourcesByStream, h as formatBytes,
|
|
1
|
+
export { c as capitalizeFirstLetter, f as flattenObjectKeys, g as getConditionsBooleans, a as getMonitorIcon, b as getStatusIcon, i as isValidVersion, m as mapConditions, n as numbersOnly, p as parseBooleanFromString, d as parseJsonStringToPrettyString, r as removeEmptyValuesFromObject, s as safeJsonStringify, e as splitCamelString } from './index-qnmhJI4d.js';
|
|
2
|
+
export { c as compareCondition, d as deepClone, f as filterActions, a as filterDestinations, b as filterDestinationsByStream, e as filterSources, g as filterSourcesByStream, h as formatBytes, j as getContainersIcons, i as getContainersInstrumentedCount, k as getDestinationIcon, l as getEntityIcon, m as getEntityLabel, n as getMetricForEntity, o as getPlatformIcon, p as getPlatformLabel, q as getValueForRange, r as getWorkloadId, s as getYamlFieldsForDestination, t as isOverTime, u as mapDestinationFieldsForDisplay, v as sleep } from './index-BSjQAYib.js';
|
|
3
3
|
export { m as getActionIcon, n as getEntityId, o as getInstrumentationRuleIcon, p as getProgrammingLanguageIcon } from './index-BD7meETN.js';
|
|
4
4
|
export { g as getIdFromSseTarget, i as isLegalK8sLabel, m as mapExportedSignals } from './index-BlZKWuxe.js';
|
|
5
5
|
import { EntityTypes } from './types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StatusType,
|
|
1
|
+
import { StatusType, DestinationTypes, EntityTypes, PlatformType } from './types.js';
|
|
2
2
|
import { k as DEFAULT_DATA_STREAM_NAME, p as getProgrammingLanguageIcon, v as KafkaLogo, K as K8sLogo } from './index-BD7meETN.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'styled-components';
|
|
@@ -95,21 +95,6 @@ const formatBytes = (bytes) => {
|
|
|
95
95
|
return `${value.toFixed(i === 0 ? 0 : 1)} ${sizes[i]}`;
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
const getConditionsBooleans = (conditions) => {
|
|
99
|
-
const hasErrors = !!conditions?.find(({ status }) => status === StatusType.Error);
|
|
100
|
-
const hasWarnings = !!conditions?.find(({ status }) => status === StatusType.Warning);
|
|
101
|
-
const hasDisableds = !!conditions?.find(({ status }) => status === OtherStatus.Disabled);
|
|
102
|
-
const hasLoadings = !!conditions?.find(({ status }) => status === OtherStatus.Loading);
|
|
103
|
-
const priorotizedStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : undefined;
|
|
104
|
-
return {
|
|
105
|
-
hasErrors,
|
|
106
|
-
hasWarnings,
|
|
107
|
-
hasDisableds,
|
|
108
|
-
hasLoadings,
|
|
109
|
-
priorotizedStatus,
|
|
110
|
-
};
|
|
111
|
-
};
|
|
112
|
-
|
|
113
98
|
const getContainersInstrumentedCount = (containers) => {
|
|
114
99
|
const instrumentedCount = containers?.reduce((prev, curr) => (curr.instrumented ? prev + 1 : prev), 0);
|
|
115
100
|
const totalCount = containers?.length || 0;
|
|
@@ -330,4 +315,4 @@ const mapDestinationFieldsForDisplay = (destination, yamlFields) => {
|
|
|
330
315
|
|
|
331
316
|
const sleep = async (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
332
317
|
|
|
333
|
-
export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h,
|
|
318
|
+
export { filterDestinations as a, filterDestinationsByStream as b, compareCondition as c, deepClone as d, filterSources as e, filterActions as f, filterSourcesByStream as g, formatBytes as h, getContainersInstrumentedCount as i, getContainersIcons as j, getDestinationIcon as k, getEntityIcon as l, getEntityLabel as m, getMetricForEntity as n, getPlatformIcon as o, getPlatformLabel as p, getValueForRange as q, getWorkloadId as r, getYamlFieldsForDestination as s, isOverTime as t, mapDestinationFieldsForDisplay as u, sleep as v };
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef, forwardRef, createElement, useCallb
|
|
|
2
2
|
import { T as Theme, t as ImageErrorIcon, M as MONITORS_OPTIONS, g as useNotificationStore, l as DISPLAY_TITLES, L as LANGUAGE_OPTIONS, F as FORM_ALERTS, p as getProgrammingLanguageIcon, D as DISPLAY_LANGUAGES, B as BUTTON_TEXTS } from './index-BD7meETN.js';
|
|
3
3
|
import { StatusType, OtherStatus, ProgrammingLanguages, SortDirection, IntrumentationStatus, InputTypes, FieldTypes } from './types.js';
|
|
4
4
|
import { M as MinusIcon, h as CheckIcon, L as ListIcon, C as CodeIcon, c as ExtendArrowIcon, E as EditIcon, i as CrossIcon, T as TrashIcon, e as SortArrowsIcon, b as EditedIcon, a as CopyIcon, d as NotebookIcon, X as XIcon, f as EyeClosedIcon, g as EyeOpenIcon, N as NoDataIcon, S as SearchIcon, P as PlusIcon, A as ArrowIcon } from './index-CY3kjYr3.js';
|
|
5
|
-
import {
|
|
5
|
+
import { b as getStatusIcon, r as removeEmptyValuesFromObject, s as safeJsonStringify, f as flattenObjectKeys, m as mapConditions, g as getConditionsBooleans, c as capitalizeFirstLetter, a as getMonitorIcon, i as isValidVersion, d as parseJsonStringToPrettyString, e as splitCamelString, p as parseBooleanFromString, n as numbersOnly } from './index-qnmhJI4d.js';
|
|
6
6
|
import styled, { css } from 'styled-components';
|
|
7
7
|
import { s as safeJsonParse, i as isEmpty } from './index-BV85P9UP.js';
|
|
8
8
|
import { b as useGenericForm, e as useOnClickOutside, d as useKeyDown, u as useContainerSize, a as useCopy, g as useTransition } from './useTransition-BWC_F-Pl.js';
|
|
@@ -3997,19 +3997,12 @@ const IconWrap$1 = styled(FlexColumn) `
|
|
|
3997
3997
|
const ConditionDetails = ({ conditions: c, headerLabelError = 'Something Failed', headerLabelWarning = "Something isn't right", headerLabelSuccess = 'Everything Successful', }) => {
|
|
3998
3998
|
const theme = Theme.useTheme();
|
|
3999
3999
|
const [extend, setExtend] = useState(false);
|
|
4000
|
-
const conditions = mapConditions(c);
|
|
4001
|
-
const errors = useMemo(() => conditions
|
|
4002
|
-
const hasErrors = !!errors.length;
|
|
4003
|
-
const warnings = useMemo(() => conditions.filter(({ status }) => status === StatusType.Warning), [conditions]);
|
|
4004
|
-
const hasWarnings = !!warnings.length;
|
|
4005
|
-
const disableds = useMemo(() => conditions.filter(({ status }) => status === OtherStatus.Disabled), [conditions]);
|
|
4006
|
-
const hasDisableds = !!disableds.length;
|
|
4007
|
-
const loadings = useMemo(() => conditions.filter(({ status }) => status === OtherStatus.Loading), [conditions]);
|
|
4008
|
-
const hasLoadings = !!loadings.length;
|
|
4009
|
-
const loading = (!conditions.length || hasLoadings) && !hasErrors && !hasWarnings && !hasDisableds;
|
|
4000
|
+
const conditions = useMemo(() => mapConditions(c), [c]);
|
|
4001
|
+
const { errors, hasErrors, warnings, hasWarnings, hasDisableds, hasLoadings } = useMemo(() => getConditionsBooleans(conditions), [conditions]);
|
|
4010
4002
|
useEffect(() => {
|
|
4011
4003
|
setExtend(hasErrors || hasWarnings || hasDisableds || hasLoadings);
|
|
4012
4004
|
}, [hasErrors, hasWarnings, hasDisableds, hasLoadings]);
|
|
4005
|
+
const loading = (!conditions.length || hasLoadings) && !hasErrors && !hasWarnings && !hasDisableds;
|
|
4013
4006
|
const overallStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : StatusType.Success;
|
|
4014
4007
|
const HeaderIcon = getStatusIcon(overallStatus, theme);
|
|
4015
4008
|
const headerText = hasErrors ? headerLabelError : hasWarnings ? headerLabelWarning : hasDisableds ? headerLabelWarning : loading ? 'Loading...' : headerLabelSuccess;
|
|
@@ -4806,8 +4799,8 @@ const ActionWrapper = styled(FlexRow) `
|
|
|
4806
4799
|
margin-left: auto;
|
|
4807
4800
|
gap: 8px;
|
|
4808
4801
|
`;
|
|
4809
|
-
const DataCard = ({ title = 'Details', titleBadge, description, action: Action, withExtend, data, children }) => {
|
|
4810
|
-
const [extend, setExtend] = useState(
|
|
4802
|
+
const DataCard = ({ title = 'Details', titleBadge, description, action: Action, withExtend, initialExtended = false, data, children }) => {
|
|
4803
|
+
const [extend, setExtend] = useState(initialExtended);
|
|
4811
4804
|
const [hovered, setHovered] = useState(false);
|
|
4812
4805
|
return (React.createElement(CardContainer, { "$hovered": hovered },
|
|
4813
4806
|
!!title || !!description || !!Action ? (React.createElement(Header$1, { "$clickable": withExtend || false, onClick: () => withExtend && setExtend((prev) => !prev), onMouseEnter: () => withExtend && setHovered(true), onMouseLeave: () => withExtend && setHovered(false) },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { T as Theme, B as BUTTON_TEXTS, l as DISPLAY_TITLES } from './index-BD7meETN.js';
|
|
3
3
|
import { E as EditIcon } from './index-CY3kjYr3.js';
|
|
4
|
-
import { B as Button, V as Text, J as NotificationNote } from './index-
|
|
4
|
+
import { B as Button, V as Text, J as NotificationNote } from './index-C4uhvIMP.js';
|
|
5
5
|
import { StatusType } from './types.js';
|
|
6
6
|
import 'styled-components';
|
|
7
7
|
import { I as InfoIcon } from './index-DZWbhK14.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StatusType, OtherStatus, SignalType } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import './index-BD7meETN.js';
|
|
4
4
|
import 'styled-components';
|
|
@@ -70,6 +70,29 @@ const flattenObjectKeys = (obj, prefix = '', result = {}) => {
|
|
|
70
70
|
return result;
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
+
const getConditionsBooleans = (conditions) => {
|
|
74
|
+
const errors = conditions?.filter(({ status }) => status === StatusType.Error);
|
|
75
|
+
const warnings = conditions?.filter(({ status }) => status === StatusType.Warning);
|
|
76
|
+
const disableds = conditions?.filter(({ status }) => status === OtherStatus.Disabled);
|
|
77
|
+
const loadings = conditions?.filter(({ status }) => status === OtherStatus.Loading);
|
|
78
|
+
const hasErrors = errors.length > 0;
|
|
79
|
+
const hasWarnings = warnings.length > 0;
|
|
80
|
+
const hasDisableds = disableds.length > 0;
|
|
81
|
+
const hasLoadings = loadings.length > 0;
|
|
82
|
+
const priorotizedStatus = hasErrors ? StatusType.Error : hasWarnings ? StatusType.Warning : hasDisableds ? StatusType.Info : undefined;
|
|
83
|
+
return {
|
|
84
|
+
errors,
|
|
85
|
+
hasErrors,
|
|
86
|
+
warnings,
|
|
87
|
+
hasWarnings,
|
|
88
|
+
disableds,
|
|
89
|
+
hasDisableds,
|
|
90
|
+
loadings,
|
|
91
|
+
hasLoadings,
|
|
92
|
+
priorotizedStatus,
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
73
96
|
const getMonitorIcon = (type) => {
|
|
74
97
|
const LOGOS = {
|
|
75
98
|
[SignalType.Logs]: LogsIcon,
|
|
@@ -192,4 +215,4 @@ const safeJsonStringify = (obj, indent = 2) => {
|
|
|
192
215
|
return JSON.stringify(obj || {}, null, indent);
|
|
193
216
|
};
|
|
194
217
|
|
|
195
|
-
export {
|
|
218
|
+
export { getMonitorIcon as a, getStatusIcon as b, capitalizeFirstLetter as c, parseJsonStringToPrettyString as d, splitCamelString as e, flattenObjectKeys as f, getConditionsBooleans as g, isValidVersion as i, mapConditions as m, numbersOnly as n, parseBooleanFromString as p, removeEmptyValuesFromObject as r, safeJsonStringify as s };
|
package/lib/snippets.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { A as AddButton } from './index-
|
|
2
|
-
export { E as EditButton, N as NoteBackToSummary } from './index-
|
|
1
|
+
export { A as AddButton } from './index-C4uhvIMP.js';
|
|
2
|
+
export { E as EditButton, N as NoteBackToSummary } from './index-lkkeQEOt.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import './index-BD7meETN.js';
|
|
5
5
|
import './types.js';
|
|
6
6
|
import 'styled-components';
|
|
7
7
|
import './index-CY3kjYr3.js';
|
|
8
|
-
import './index-
|
|
8
|
+
import './index-qnmhJI4d.js';
|
|
9
9
|
import './index-DZWbhK14.js';
|
|
10
10
|
import './index-BV85P9UP.js';
|
|
11
11
|
import './useTransition-BWC_F-Pl.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odigos/ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.45",
|
|
4
4
|
"author": "Odigos",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -114,12 +114,12 @@
|
|
|
114
114
|
"eslint": "^9.29.0",
|
|
115
115
|
"eslint-config-next": "^15.3.3",
|
|
116
116
|
"eslint-plugin-storybook": "9.0.11",
|
|
117
|
-
"next": "^15.3.
|
|
117
|
+
"next": "^15.3.4",
|
|
118
118
|
"postcss": "^8.5.6",
|
|
119
119
|
"rollup": "^4.43.0",
|
|
120
120
|
"rollup-plugin-postcss": "^4.0.2",
|
|
121
121
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
122
|
-
"storybook": "9.0.
|
|
122
|
+
"storybook": "9.0.12",
|
|
123
123
|
"typescript": "^5.8.3"
|
|
124
124
|
}
|
|
125
125
|
}
|