@odigos/ui-kit 0.0.22 → 0.0.23

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.23](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.22...ui-kit-v0.0.23) (2025-04-14)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * icon group and wrapper design ([#84](https://github.com/odigos-io/ui-kit/issues/84)) ([c4761b3](https://github.com/odigos-io/ui-kit/commit/c4761b399f36124696da4f01ba18a8e4c30eddef))
9
+ * text truncation logic and add word break support in Tooltip ([#83](https://github.com/odigos-io/ui-kit/issues/83)) ([afc7508](https://github.com/odigos-io/ui-kit/commit/afc7508b1c55330b2152b8fa3b52507e86143eaf))
10
+ * untyped destinations ([#82](https://github.com/odigos-io/ui-kit/issues/82)) ([ed93ecd](https://github.com/odigos-io/ui-kit/commit/ed93ecd5e192e247bd0ef29d19907245718618e3))
11
+
3
12
  ## [0.0.22](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.21...ui-kit-v0.0.22) (2025-04-10)
4
13
 
5
14
 
package/lib/components.js CHANGED
@@ -1,5 +1,5 @@
1
- import { B as Button } from './index-3mlRUlHD.js';
2
- export { A as AutocompleteInput, a as Badge, C as CancelWarning, a1 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a3 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a2 as Overlay, S as ScrollX, O as SectionTitle, P as Segment, Q as SkeletonLoader, R as Status, U as Stepper, a4 as TableContainer, a5 as TableTitleWrap, a6 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, _ as WarningModal } from './index-3mlRUlHD.js';
1
+ import { B as Button } from './index-BKyIuPoq.js';
2
+ export { A as AutocompleteInput, a as Badge, C as CancelWarning, a1 as CenterThis, b as Checkbox, c as Code, d as ConditionDetails, D as DataCard, f as DataCardFieldTypes, e as DataCardFields, g as DataTab, h as DeleteWarning, i as Divider, j as DocsButton, k as Drawer, m as DrawerFooter, l as DrawerHeader, n as Dropdown, E as ExtendArrow, F as FadeLoader, o as FieldError, p as FieldLabel, a0 as FlexColumn, $ as FlexRow, H as Header, I as IconButton, q as IconGroup, r as IconTitleBadge, s as IconWrapped, t as IconsNav, u as ImageControlled, v as Input, w as InputList, x as InputTable, y as InteractiveTable, K as KeyValueInputsList, M as Modal, a3 as ModalBody, z as MonitorsCheckboxes, G as MonitorsIcons, N as NavigationButtons, J as NoDataFound, L as NotificationNote, a2 as Overlay, S as ScrollX, O as SectionTitle, P as Segment, Q as SkeletonLoader, R as Status, U as Stepper, a4 as TableContainer, a5 as TableTitleWrap, a6 as TableWrap, V as Text, W as TextArea, X as Toggle, T as ToggleCodeComponent, Y as Tooltip, Z as TraceLoader, _ as WarningModal } from './index-BKyIuPoq.js';
3
3
  import React, { Component, createElement, createContext } from 'react';
4
4
  import Theme from './theme.js';
5
5
  import './types.js';
package/lib/containers.js CHANGED
@@ -3,7 +3,7 @@ import styled, { css } from 'styled-components';
3
3
  import { A as ACTION_OPTIONS, M as MONITORS_OPTIONS, I as INSTRUMENTATION_RULE_OPTIONS } from './index-D3sp5Hx7.js';
4
4
  import { D as DISPLAY_TITLES, F as FORM_ALERTS } from './index-C_0J5P9M.js';
5
5
  import { ActionType, EntityTypes, StatusType, Crud, OtherStatus, NodeTypes, AddNodeTypes, EdgeTypes, FieldTypes, SignalType, CodeAttributesKeyTypes, PayloadCollectionKeyTypes, InstrumentationRuleType } from './types.js';
6
- import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, V as Text, P as Segment, O as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, W as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a3 as ModalBody, A as AutocompleteInput, i as Divider, R as Status, $ as FlexRow, Y as Tooltip, s as IconWrapped, G as MonitorsIcons, a4 as TableContainer, a5 as TableTitleWrap, r as IconTitleBadge, a6 as TableWrap, y as InteractiveTable, a1 as CenterThis, J as NoDataFound, a0 as FlexColumn, Z as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a7 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, L as NotificationNote, U as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-3mlRUlHD.js';
6
+ import { f as DataCardFieldTypes, p as FieldLabel, b as Checkbox, o as FieldError, v as Input, x as InputTable, K as KeyValueInputsList, w as InputList, V as Text, P as Segment, O as SectionTitle, j as DocsButton, z as MonitorsCheckboxes, W as TextArea, k as Drawer, h as DeleteWarning, C as CancelWarning, d as ConditionDetails, D as DataCard, M as Modal, N as NavigationButtons, a3 as ModalBody, A as AutocompleteInput, i as Divider, R as Status, $ as FlexRow, Y as Tooltip, s as IconWrapped, G as MonitorsIcons, a4 as TableContainer, a5 as TableTitleWrap, r as IconTitleBadge, a6 as TableWrap, y as InteractiveTable, a1 as CenterThis, J as NoDataFound, a0 as FlexColumn, Z as TraceLoader, a as Badge, B as Button, E as ExtendArrow, n as Dropdown, a7 as getDefaultExportFromCjs, F as FadeLoader, g as DataTab, Q as SkeletonLoader, X as Toggle, L as NotificationNote, U as Stepper, I as IconButton, e as DataCardFields, t as IconsNav, q as IconGroup } from './index-BKyIuPoq.js';
7
7
  import { g as usePendingStore, f as useNotificationStore, a as useDrawerStore, b as useEntityStore, e as useModalStore, c as useFilterStore, s as styleInject, h as useSelectedStore, d as useInstrumentStore, k as getEntityId, i as useSetupStore, u as useDarkMode } from './index-DiTtXTRm.js';
8
8
  import Theme from './theme.js';
9
9
  import { i as isEmpty, s as safeJsonParse } from './index-BZS1ijMm.js';
@@ -13958,7 +13958,6 @@ const buildCard$2 = (destination, yamlFields) => {
13958
13958
  { title: DISPLAY_TITLES.NAME, value: destinationType.displayName },
13959
13959
  { title: DISPLAY_TITLES.TYPE, value: destinationType.type },
13960
13960
  { type: DataCardFieldTypes.Monitors, title: DISPLAY_TITLES.Monitors, value: buildMonitorsList(exportedSignals) },
13961
- { type: DataCardFieldTypes.Divider },
13962
13961
  ];
13963
13962
  const parsedFields = safeJsonParse(fields, {});
13964
13963
  const sortedParsedFields = yamlFields.map((field) => ({ key: field.name, value: parsedFields[field.name] ?? null })).filter((item) => item.value !== null) ||
@@ -13971,6 +13970,7 @@ const buildCard$2 = (destination, yamlFields) => {
13971
13970
  if (!shouldHide) {
13972
13971
  const { type } = safeJsonParse(componentProperties, { type: '' });
13973
13972
  const isSecret = (secret || type === 'password') && !!value.length ? new Array(10).fill('•').join('') : '';
13973
+ arr.push({ type: DataCardFieldTypes.Divider });
13974
13974
  if (!!customReadDataLabels?.length) {
13975
13975
  customReadDataLabels.forEach(({ condition, ...custom }) => {
13976
13976
  if (condition == value) {
@@ -14205,8 +14205,8 @@ const DestinationDrawer = ({ categories, updateDestination, deleteDestination, t
14205
14205
  }, [isOpen, drawerEntityId, destinations]);
14206
14206
  if (!thisItem)
14207
14207
  return null;
14208
- const thisOptionType = categories.map(({ items }) => items.filter(({ type }) => type === thisItem.destinationType.type)).filter((arr) => !!arr.length)?.[0]?.[0];
14209
- const { icon, iconSrc } = getDestinationIcon(thisOptionType.type);
14208
+ const thisOptionType = categories.flatMap((category) => category.items).find((option) => option.type === thisItem.destinationType.type);
14209
+ const { icon, iconSrc } = thisOptionType ? getDestinationIcon(thisOptionType?.type) : { icon: undefined, iconSrc: undefined };
14210
14210
  const handleEdit = (bool) => {
14211
14211
  setIsEditing(typeof bool === 'boolean' ? bool : true);
14212
14212
  };
@@ -397,6 +397,10 @@ const TooltipContainer = styled.div `
397
397
  gap: 4px;
398
398
  cursor: help;
399
399
  `;
400
+ const TextBreakWord = styled(Text) `
401
+ word-break: break-word;
402
+ white-space: pre-wrap;
403
+ `;
400
404
  const Tooltip = ({ withIcon, titleIcon: TitleIcon, title, text, timestamp, children }) => {
401
405
  const theme = Theme.useTheme();
402
406
  const [isHovered, setIsHovered] = useState(false);
@@ -426,7 +430,7 @@ const Tooltip = ({ withIcon, titleIcon: TitleIcon, title, text, timestamp, child
426
430
  title && React.createElement(React.Fragment, null,
427
431
  title,
428
432
  "\u00A0-\u00A0"))),
429
- React.createElement(Text, { size: 12, color: theme.text.info }, text),
433
+ React.createElement(TextBreakWord, { size: 12, color: theme.text.info }, text),
430
434
  !!timestamp && (React.createElement(Text, { size: 10, color: theme.text.darker_grey, family: 'secondary', style: { marginTop: '8px' } }, new Date(timestamp).toLocaleString())))))));
431
435
  };
432
436
  const PopupContainer = styled.div `
@@ -4085,7 +4089,7 @@ const Status = ({ title, subtitle, size = 12, family = 'secondary', status = Sta
4085
4089
  };
4086
4090
 
4087
4091
  const LimitedText = styled(Text) `
4088
- max-width: ${({ $maxWidth }) => `${$maxWidth}px` || 'unset'};
4092
+ max-width: ${({ $maxWidth }) => ($maxWidth ? `${$maxWidth}px` : 'unset')};
4089
4093
  white-space: nowrap;
4090
4094
  overflow-x: auto;
4091
4095
 
@@ -4095,23 +4099,22 @@ const LimitedText = styled(Text) `
4095
4099
  display: block;
4096
4100
  }
4097
4101
  `;
4098
- const ELIPSIS_WIDTH = 12;
4099
- const ScrollX = ({ maxWidth, text, textSize, textColor }) => {
4102
+ const ScrollX = ({ maxWidth, text, textSize = 16, textColor }) => {
4100
4103
  const [isOverflowed, setIsOverflowed] = useState(false);
4101
4104
  const ref = useRef(null);
4102
4105
  // Check if text is overflowed from maximum width
4103
4106
  useEffect(() => {
4104
4107
  if (ref.current) {
4105
4108
  const { clientWidth } = ref.current;
4106
- const marginUp = (maxWidth - ELIPSIS_WIDTH) * 1.05; // add 5%
4107
- const marginDown = (maxWidth - ELIPSIS_WIDTH) * 0.95; // subtract 5%
4109
+ const marginUp = (maxWidth - textSize) * 1.05; // add 5%
4110
+ const marginDown = (maxWidth - textSize) * 0.95; // subtract 5%
4108
4111
  setIsOverflowed(clientWidth < marginUp && clientWidth > marginDown);
4109
4112
  }
4110
- }, [maxWidth, text]);
4113
+ }, [maxWidth, textSize, text]);
4111
4114
  return (React.createElement(FlexRow, { "$gap": 0 },
4112
4115
  text && (React.createElement(Tooltip, { text: isOverflowed ? text : undefined },
4113
- React.createElement(LimitedText, { ref: ref, "$maxWidth": maxWidth - ELIPSIS_WIDTH, size: textSize, color: textColor }, text))),
4114
- isOverflowed && (React.createElement(LimitedText, { "$maxWidth": ELIPSIS_WIDTH, size: textSize, color: textColor }, "..."))));
4116
+ React.createElement(LimitedText, { ref: ref, "$maxWidth": maxWidth - textSize, size: textSize, color: textColor }, text))),
4117
+ isOverflowed && (React.createElement(LimitedText, { "$maxWidth": textSize, size: textSize, color: textColor }, "..."))));
4115
4118
  };
4116
4119
 
4117
4120
  const ImageControlled = ({ src = '', alt = '', size = 16 }) => {
@@ -4130,12 +4133,12 @@ const Container$o = styled.div `
4130
4133
  height: ${({ $size }) => $size}px;
4131
4134
  border-radius: 8px;
4132
4135
  background: ${({ $status, theme }) => {
4133
- const clr = $status ? theme.text[$status] : theme.text.secondary;
4134
- return `linear-gradient(180deg, ${clr + Theme.opacity.hex['020']} 0%, ${clr + Theme.opacity.hex['005']} 100%)`;
4136
+ const clr = theme.colors[$status || 'dropdown_bg_2'];
4137
+ return `linear-gradient(180deg, ${clr} 0%, ${clr + Theme.opacity.hex['030']} 100%)`;
4135
4138
  }};
4136
4139
  `;
4137
4140
  const IconWrapped = ({ icon: Icon, src = '', alt = '', status, size = 36 }) => {
4138
- return (React.createElement(Container$o, { "$status": status, "$size": size }, src ? React.createElement(ImageControlled, { src: src, alt: alt, size: size - 16 }) : !!Icon ? React.createElement(Icon, { size: size - 16 }) : React.createElement(ImageErrorIcon, { size: size - 16 })));
4141
+ return (React.createElement(Container$o, { "$status": status, "$size": size }, src ? React.createElement(ImageControlled, { src: src, alt: alt, size: size - 12 }) : !!Icon ? React.createElement(Icon, { size: size - 12 }) : React.createElement(ImageErrorIcon, { size: size - 12 })));
4139
4142
  };
4140
4143
 
4141
4144
  const Container$n = styled.div `
@@ -4146,11 +4149,6 @@ const Container$n = styled.div `
4146
4149
  justify-content: center;
4147
4150
  width: ${({ $size }) => $size}px;
4148
4151
  height: ${({ $size }) => $size}px;
4149
- border-radius: 8px;
4150
- background: ${({ $status, theme }) => {
4151
- const clr = $status ? theme.text[$status] : theme.text.secondary;
4152
- return `linear-gradient(180deg, ${clr + Theme.opacity.hex['020']} 0%, ${clr + Theme.opacity.hex['005']} 100%)`;
4153
- }};
4154
4152
  `;
4155
4153
  const IconWrapper$3 = styled.div `
4156
4154
  position: absolute;
@@ -4163,10 +4161,17 @@ const IconWrapper$3 = styled.div `
4163
4161
  width: ${({ $size }) => $size}px;
4164
4162
  height: ${({ $size }) => $size}px;
4165
4163
  border-radius: 100%;
4164
+ border: 1px solid ${({ theme, $status }) => ($status ? theme.text[$status] : theme.colors.border) + Theme.opacity.hex['030']};
4165
+ background: ${({ $status, theme }) => {
4166
+ const clr = theme.colors[$status || 'dropdown_bg_2'];
4167
+ return `linear-gradient(180deg, ${clr} 0%, ${clr + Theme.opacity.hex['030']} 100%)`;
4168
+ }};
4166
4169
  `;
4167
4170
  const IconGroup = ({ icons = [], iconSrcs = [], status, size = 36, id }) => {
4168
4171
  const theme = Theme.useTheme();
4169
- const imgSize = icons.length === 1 || iconSrcs.length === 1 ? size - 16 : size / 3;
4172
+ const SINGLE_ICON_PADDING = 12;
4173
+ const MULTI_ICON_SCALE_DIVIDER = 2.7;
4174
+ const imgSize = icons.length === 1 || iconSrcs.length === 1 ? size - SINGLE_ICON_PADDING : size / MULTI_ICON_SCALE_DIVIDER;
4170
4175
  if (iconSrcs.length > 0) {
4171
4176
  return React.createElement(IconGroup, { icons: iconSrcs.map((src) => (() => React.createElement(ImageControlled, { src: src, size: imgSize }))), status: status, size: size, id: id });
4172
4177
  }
@@ -4174,24 +4179,25 @@ const IconGroup = ({ icons = [], iconSrcs = [], status, size = 36, id }) => {
4174
4179
  return React.createElement(IconWrapped, { icon: icons[0], status: status, size: size });
4175
4180
  }
4176
4181
  const getTopPosition = (idx) => {
4177
- if (icons.length > 2) {
4178
- return idx === 0 || idx === 1 ? imgSize * 0.2 : imgSize * 1.4;
4179
- }
4180
- return imgSize * 0.7;
4182
+ // The multiplications are magic numbers chosen based on the divider of the image size (currently 2.7)
4183
+ if (icons.length <= 2)
4184
+ return imgSize * 0.5;
4185
+ if (idx === 0 || idx === 1)
4186
+ return 0;
4187
+ return imgSize * 1.15;
4181
4188
  };
4182
4189
  const getLeftPosition = (idx) => {
4183
- if (idx >= 2) {
4184
- return imgSize * 0.7;
4185
- }
4186
- else if (idx % 2 === 0) {
4187
- return imgSize * 0.05;
4188
- }
4189
- return imgSize * 1.4;
4190
+ // The multiplications are magic numbers chosen based on the divider of the image size (currently 2.7)
4191
+ if (idx === 0)
4192
+ return 0;
4193
+ if (idx === 1)
4194
+ return imgSize * 1.15;
4195
+ return imgSize * 1.15 * 0.5;
4190
4196
  };
4191
4197
  return (React.createElement(Container$n, { "$status": status, "$size": size }, icons.map((Icon, idx) => {
4192
4198
  if (idx > 2)
4193
4199
  return null;
4194
- return (React.createElement(IconWrapper$3, { key: `icon-${id}-${idx}`, "$size": imgSize * 1.5, "$top": getTopPosition(idx), "$left": getLeftPosition(idx), "$zIndex": idx + 1 }, idx === 2 && icons.length > 3 ? (React.createElement(Text, { family: 'secondary', color: theme.text.dark_grey, size: imgSize * 0.8 },
4200
+ return (React.createElement(IconWrapper$3, { key: `icon-${id}-${idx}`, "$status": status, "$size": imgSize * 1.5, "$top": getTopPosition(idx), "$left": getLeftPosition(idx), "$zIndex": idx + 1 }, idx === 2 && icons.length > 3 ? (React.createElement(Text, { family: 'secondary', color: theme.text.dark_grey, size: imgSize * 0.8 },
4195
4201
  "+",
4196
4202
  icons.length - 2)) : (React.createElement(Icon, { size: imgSize }))));
4197
4203
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odigos/ui-kit",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "author": "Odigos",
5
5
  "repository": {
6
6
  "type": "git",