@oliasoft-open-source/react-ui-library 5.14.1-beta-2 → 5.15.0

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/dist/index.d.ts CHANGED
@@ -97,6 +97,8 @@ export declare enum Color {
97
97
  MUTED = "muted"
98
98
  }
99
99
 
100
+ export declare const ColorInput: ({ columns, disabled, options, small, value, onChange, }: IColorInputProps) => JSX_2.Element;
101
+
100
102
  export declare const Column: ({ background, borderLeft, borderRight, children, flex, flexbox, padding, scroll, showScrollbar, spacing, width, widthMobile, widthTablet, testId, }: ILayoutColumnProps) => JSX_2.Element;
101
103
 
102
104
  export declare const Dialog: ({ dialog }: IDialogProps) => JSX_2.Element;
@@ -335,6 +337,18 @@ export declare interface ICollapseProps {
335
337
  expanded: boolean;
336
338
  }
337
339
 
340
+ export declare interface IColorInputProps {
341
+ columns?: number;
342
+ disabled?: boolean;
343
+ options?: {
344
+ value: string;
345
+ label: string;
346
+ }[];
347
+ small?: boolean;
348
+ value?: string;
349
+ onChange?: (value: string) => void;
350
+ }
351
+
338
352
  /**
339
353
  * Icon wrapper component to support different icon formats:
340
354
  * - string names (default recommendation)
package/dist/index.js CHANGED
@@ -1273,6 +1273,119 @@ const Card = ({ bordered: e = !0, heading: t = null, children: n, margin: r = "0
1273
1273
  children: n
1274
1274
  })]
1275
1275
  });
1276
+ var popover_module_default = {
1277
+ toggleBox: "_toggleBox_rwod1_1",
1278
+ enter: "_enter_rwod1_8",
1279
+ enterActive: "_enterActive_rwod1_12",
1280
+ fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
1281
+ dismiss: "_dismiss_rwod1_22"
1282
+ };
1283
+ const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: h }) => {
1284
+ let _ = useContext(DisabledContext), v = useRef(null), [y, b] = f === void 0 ? useState(!1) : [f, h], x = () => {
1285
+ !u && !_ && b && b(!1);
1286
+ }, S = () => {
1287
+ u || _ || b && b(!y);
1288
+ };
1289
+ useEffect(() => {
1290
+ (u || _) && x();
1291
+ }, [u, _]);
1292
+ let { renderLayer: C, arrowProps: w, layerProps: T, triggerProps: E } = useLayer({
1293
+ isOpen: y,
1294
+ placement: r,
1295
+ auto: !0,
1296
+ triggerOffset: 6,
1297
+ onOutsideClick: i ? x : void 0,
1298
+ ResizeObserver: ResizeObserver$1,
1299
+ overflowContainer: d
1300
+ });
1301
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
1302
+ ref: E.ref,
1303
+ onClick: S,
1304
+ "data-testid": l,
1305
+ children: t
1306
+ }), /* @__PURE__ */ jsx(CSSTransition, {
1307
+ nodeRef: v,
1308
+ in: y,
1309
+ timeout: 100,
1310
+ classNames: {
1311
+ enter: popover_module_default.enter,
1312
+ enterActive: popover_module_default.enterActive
1313
+ },
1314
+ unmountOnExit: !0,
1315
+ children: /* @__PURE__ */ jsx(Fragment$1, { children: y && C(/* @__PURE__ */ jsxs("div", {
1316
+ className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
1317
+ ...T,
1318
+ ref: (e) => {
1319
+ v.current = e, T.ref(e);
1320
+ },
1321
+ children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: x }) : n, o && /* @__PURE__ */ jsx("div", {
1322
+ className: popover_module_default.dismiss,
1323
+ children: /* @__PURE__ */ jsx(Button, {
1324
+ small: !0,
1325
+ round: !0,
1326
+ onClick: x,
1327
+ icon: IconType.CLOSE
1328
+ })
1329
+ })] }), /* @__PURE__ */ jsx(Arrow, {
1330
+ ...w,
1331
+ backgroundColor: "var(--color-background-layer)",
1332
+ borderColor: "var(--color-border)",
1333
+ borderWidth: 1,
1334
+ size: 6
1335
+ })]
1336
+ })) })
1337
+ })] });
1338
+ };
1339
+ var color_input_module_default = {
1340
+ colorInput: "_colorInput_hb750_1",
1341
+ trigger: "_trigger_hb750_8",
1342
+ buttonColor: "_buttonColor_hb750_12",
1343
+ options: "_options_hb750_17",
1344
+ option: "_option_hb750_17"
1345
+ };
1346
+ const ColorInput = ({ columns: e = 9, disabled: t, options: n = [], small: r, value: i, onChange: a }) => {
1347
+ var o;
1348
+ let [s, c] = useState(!1), l = (o = n.find((e) => e.value === i)) == null ? void 0 : o.label;
1349
+ return /* @__PURE__ */ jsx("div", {
1350
+ className: color_input_module_default.colorInput,
1351
+ children: /* @__PURE__ */ jsx(Popover, {
1352
+ placement: "bottom-start",
1353
+ isOpen: s,
1354
+ onToggle: c,
1355
+ content: /* @__PURE__ */ jsx("div", {
1356
+ className: color_input_module_default.options,
1357
+ style: { gridTemplateColumns: `repeat(${e}, auto)` },
1358
+ children: n.map((e) => /* @__PURE__ */ jsx("div", {
1359
+ className: color_input_module_default.option,
1360
+ children: /* @__PURE__ */ jsx(Button, {
1361
+ basic: !0,
1362
+ disabled: t,
1363
+ width: "var(--size)",
1364
+ tooltip: e.label,
1365
+ label: /* @__PURE__ */ jsx("div", {
1366
+ className: color_input_module_default.buttonColor,
1367
+ style: { backgroundColor: e.value }
1368
+ }),
1369
+ onClick: () => {
1370
+ a == null || a(e.value), c(!1);
1371
+ }
1372
+ }, e.value)
1373
+ }))
1374
+ }),
1375
+ children: /* @__PURE__ */ jsx(Button, {
1376
+ disabled: t,
1377
+ small: r,
1378
+ active: s,
1379
+ width: r ? "var(--size-sm)" : "var(--size)",
1380
+ tooltip: l,
1381
+ label: /* @__PURE__ */ jsx("div", {
1382
+ className: color_input_module_default.buttonColor,
1383
+ style: { backgroundColor: i }
1384
+ })
1385
+ })
1386
+ })
1387
+ });
1388
+ };
1276
1389
  var noScrollbars = css`
1277
1390
  scrollbar-width: none;
1278
1391
  -ms-overflow-style: none;
@@ -3450,70 +3563,7 @@ const Slider = ({ name: e, label: t, width: n = "100%", labelWidth: r = "auto",
3450
3563
  children: /* @__PURE__ */ jsx(Icon, { icon: n })
3451
3564
  })
3452
3565
  });
3453
- }, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions });
3454
- var popover_module_default = {
3455
- toggleBox: "_toggleBox_rwod1_1",
3456
- enter: "_enter_rwod1_8",
3457
- enterActive: "_enterActive_rwod1_12",
3458
- fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
3459
- dismiss: "_dismiss_rwod1_22"
3460
- };
3461
- const Popover = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: l, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: h }) => {
3462
- let _ = useContext(DisabledContext), v = useRef(null), [y, b] = f === void 0 ? useState(!1) : [f, h], x = () => {
3463
- !u && !_ && b && b(!1);
3464
- }, S = () => {
3465
- u || _ || b && b(!y);
3466
- };
3467
- useEffect(() => {
3468
- (u || _) && x();
3469
- }, [u, _]);
3470
- let { renderLayer: C, arrowProps: w, layerProps: T, triggerProps: E } = useLayer({
3471
- isOpen: y,
3472
- placement: r,
3473
- auto: !0,
3474
- triggerOffset: 6,
3475
- onOutsideClick: i ? x : void 0,
3476
- ResizeObserver: ResizeObserver$1,
3477
- overflowContainer: d
3478
- });
3479
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
3480
- ref: E.ref,
3481
- onClick: S,
3482
- "data-testid": l,
3483
- children: t
3484
- }), /* @__PURE__ */ jsx(CSSTransition, {
3485
- nodeRef: v,
3486
- in: y,
3487
- timeout: 100,
3488
- classNames: {
3489
- enter: popover_module_default.enter,
3490
- enterActive: popover_module_default.enterActive
3491
- },
3492
- unmountOnExit: !0,
3493
- children: /* @__PURE__ */ jsx(Fragment$1, { children: y && C(/* @__PURE__ */ jsxs("div", {
3494
- className: a ? cx(popover_module_default.toggleBox, popover_module_default.fullWidthStyleFix) : cx(popover_module_default.toggleBox),
3495
- ...T,
3496
- ref: (e) => {
3497
- v.current = e, T.ref(e);
3498
- },
3499
- children: [/* @__PURE__ */ jsxs("div", { children: [React.isValidElement(n) ? React.cloneElement(n, { close: x }) : n, o && /* @__PURE__ */ jsx("div", {
3500
- className: popover_module_default.dismiss,
3501
- children: /* @__PURE__ */ jsx(Button, {
3502
- small: !0,
3503
- round: !0,
3504
- onClick: x,
3505
- icon: IconType.CLOSE
3506
- })
3507
- })] }), /* @__PURE__ */ jsx(Arrow, {
3508
- ...w,
3509
- backgroundColor: "var(--color-background-layer)",
3510
- borderColor: "var(--color-border)",
3511
- borderWidth: 1,
3512
- size: 6
3513
- })]
3514
- })) })
3515
- })] });
3516
- }, CellHelpIcon = ({ cell: e }) => {
3566
+ }, ActionsCell = ({ cell: e }) => /* @__PURE__ */ jsx(Actions, { actions: e.actions }), CellHelpIcon = ({ cell: e }) => {
3517
3567
  let { helpIcon: t } = e;
3518
3568
  return t ? /* @__PURE__ */ jsx("div", {
3519
3569
  className: cell_module_default.icon,
@@ -6577,30 +6627,30 @@ var tree_module_default = {
6577
6627
  placeholderContainer: "_placeholderContainer_1cqsz_38"
6578
6628
  };
6579
6629
  const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, draggable: o, icons: s, onDrop: c }) => {
6580
- let { id: l, data: u } = t, { active: d, disabled: f, testId: p, onClick: m, actions: h = [] } = u, [_, v] = React.useState(!1), [y, b] = React.useState(0), x = (e) => {
6630
+ let { id: l, data: u } = t, { active: d, testId: f, onClick: p, actions: m = [] } = u, [h, _] = React.useState(!1), [v, y] = React.useState(0), b = (e) => {
6581
6631
  e.stopPropagation(), i(l);
6632
+ }, x = (e) => {
6633
+ e.preventDefault(), e.stopPropagation(), h || (_(!0), y((/* @__PURE__ */ new Date()).getTime()));
6582
6634
  }, S = (e) => {
6583
- e.preventDefault(), e.stopPropagation(), _ || (v(!0), b((/* @__PURE__ */ new Date()).getTime()));
6635
+ e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - v > 20 && _(!1);
6584
6636
  }, C = (e) => {
6585
- e.preventDefault(), e.stopPropagation(), (/* @__PURE__ */ new Date()).getTime() - y > 20 && v(!1);
6637
+ e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - v > 200 && b(e);
6586
6638
  }, w = (e) => {
6587
- e.preventDefault(), e.stopPropagation(), a && !r && (/* @__PURE__ */ new Date()).getTime() - y > 200 && x(e);
6588
- }, T = (e) => {
6589
- e.preventDefault(), e.stopPropagation(), v(!1), b((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
6639
+ e.preventDefault(), e.stopPropagation(), _(!1), y((/* @__PURE__ */ new Date()).getTime()), c == null || c(e);
6590
6640
  };
6591
6641
  return /* @__PURE__ */ jsx("div", {
6592
- className: cx(list_module_default.item, f ? "" : list_module_default.action, d ? list_module_default.active : "", f ? list_module_default.disabled : "", n > 0 ? list_module_default.indented : "", _ ? list_module_default.bordered : ""),
6642
+ className: cx(list_module_default.item, list_module_default.action, d ? list_module_default.active : "", n > 0 ? list_module_default.indented : "", h ? list_module_default.bordered : ""),
6593
6643
  style: { marginInlineStart: n * 24 },
6594
- "data-testid": p,
6644
+ "data-testid": f,
6595
6645
  onClick: (e) => {
6596
- f || (m ? m(e) : a && x(e));
6646
+ p ? p(e) : a && b(e);
6597
6647
  },
6598
- onDrop: (e) => c ? T(e) : {},
6599
- onDragEnter: (e) => c ? S(e) : {},
6600
- onDragOver: (e) => c ? w(e) : {},
6601
- onDragLeave: (e) => c ? C(e) : {},
6648
+ onDrop: (e) => c ? w(e) : {},
6649
+ onDragEnter: (e) => c ? x(e) : {},
6650
+ onDragOver: (e) => c ? C(e) : {},
6651
+ onDragLeave: (e) => c ? S(e) : {},
6602
6652
  children: /* @__PURE__ */ jsxs("div", {
6603
- className: cx(list_module_default.itemHeader, _ ? list_module_default.noPointerEvents : ""),
6653
+ className: cx(list_module_default.itemHeader, h ? list_module_default.noPointerEvents : ""),
6604
6654
  children: [
6605
6655
  a && /* @__PURE__ */ jsx("div", {
6606
6656
  className: tree_module_default.toggle,
@@ -6610,7 +6660,7 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
6610
6660
  small: !0,
6611
6661
  round: !0,
6612
6662
  icon: r ? (s == null ? void 0 : s.collapse) || IconType.COLLAPSE : (s == null ? void 0 : s.expand) || IconType.EXPAND,
6613
- onClick: x
6663
+ onClick: b
6614
6664
  })
6615
6665
  }),
6616
6666
  o && /* @__PURE__ */ jsx("div", {
@@ -6620,9 +6670,9 @@ const TreeItem = ({ node: t, depth: n, isOpen: r, onToggle: i, hasChild: a, drag
6620
6670
  /* @__PURE__ */ jsx(MetaContent, { item: u }),
6621
6671
  /* @__PURE__ */ jsx("div", {
6622
6672
  className: list_module_default.right,
6623
- children: !f && h.length > 0 && /* @__PURE__ */ jsx("div", {
6673
+ children: /* @__PURE__ */ jsx("div", {
6624
6674
  className: list_module_default.actions,
6625
- children: /* @__PURE__ */ jsx(Actions, { actions: h })
6675
+ children: /* @__PURE__ */ jsx(Actions, { actions: m })
6626
6676
  })
6627
6677
  })
6628
6678
  ]
@@ -9127,4 +9177,4 @@ const ComparisonViewModal = ({ auditLog: e, auditLogs: t, data: n, isOpen: r, se
9127
9177
  e === ConfigKeyType.Translations ? setConfig(e, getTranslations(t)) : setConfig(e, isPrimitiveValue(t) ? t : { ...t });
9128
9178
  });
9129
9179
  };
9130
- export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
9180
+ export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, Column, Dialog, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, RichTextInput, Row, Select, SettingField, SideBar, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "5.14.1-beta-2",
3
+ "version": "5.15.0",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {