@oliasoft-open-source/react-ui-library 6.12.0-beta-4 → 6.12.0-beta-6

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.js CHANGED
@@ -1384,52 +1384,52 @@ var Ur = /* @__PURE__ */ function(e) {
1384
1384
  enterActive: "_enterActive_rwod1_12",
1385
1385
  fullWidthStyleFix: "_fullWidthStyleFix_rwod1_17",
1386
1386
  dismiss: "_dismiss_rwod1_22"
1387
- }, ka = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: s, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p }) => {
1388
- let g = c(U), x = m(null), [S, C] = f === void 0 ? h(!1) : [f, p], w = () => {
1389
- !u && !g && C && C(!1);
1390
- }, T = () => {
1391
- u || g || C && C(!S);
1387
+ }, ka = ({ children: t, content: n, placement: r = "top-center", closeOnOutsideClick: i = !0, fullWidth: a = !1, showCloseButton: o = !1, testId: s, disabled: u = !1, overflowContainer: d = !1, isOpen: f, onToggle: p, toggleOnTriggerClick: g = !0 }) => {
1388
+ let x = c(U), S = m(null), [C, w] = f === void 0 ? h(!1) : [f, p], T = () => {
1389
+ !u && !x && w && w(!1);
1390
+ }, E = () => {
1391
+ u || x || w && w(!C);
1392
1392
  };
1393
1393
  l(() => {
1394
- (u || g) && w();
1395
- }, [u, g]);
1396
- let { renderLayer: E, arrowProps: D, layerProps: O, triggerProps: k } = wi({
1397
- isOpen: S,
1394
+ (u || x) && T();
1395
+ }, [u, x]);
1396
+ let { renderLayer: D, arrowProps: O, layerProps: k, triggerProps: A } = wi({
1397
+ isOpen: C,
1398
1398
  placement: r,
1399
1399
  triggerOffset: 6,
1400
- onOutsideClick: i ? w : void 0,
1400
+ onOutsideClick: i ? T : void 0,
1401
1401
  overflowContainer: d
1402
- }), A = Yt([x, O.ref]);
1402
+ }), j = Yt([S, k.ref]);
1403
1403
  return /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y("div", {
1404
- ref: k.ref,
1405
- onClick: T,
1404
+ ref: A.ref,
1405
+ onClick: g ? E : void 0,
1406
1406
  "data-testid": s,
1407
1407
  children: t
1408
1408
  }), /* @__PURE__ */ y(jt, {
1409
- nodeRef: x,
1410
- in: S,
1409
+ nodeRef: S,
1410
+ in: C,
1411
1411
  timeout: 100,
1412
1412
  classNames: {
1413
1413
  enter: Oa.enter,
1414
1414
  enterActive: Oa.enterActive
1415
1415
  },
1416
1416
  unmountOnExit: !0,
1417
- children: /* @__PURE__ */ y(v, { children: S && E(/* @__PURE__ */ b("div", {
1417
+ children: /* @__PURE__ */ y(v, { children: C && D(/* @__PURE__ */ b("div", {
1418
1418
  className: a ? _(Oa.toggleBox, Oa.fullWidthStyleFix) : _(Oa.toggleBox),
1419
- ...O,
1420
- ref: A,
1419
+ ...k,
1420
+ ref: j,
1421
1421
  "data-testid": `${s}-layer`,
1422
- children: [/* @__PURE__ */ b("div", { children: [e.isValidElement(n) && typeof n.type != "string" ? e.cloneElement(n, { close: w }) : n, o && /* @__PURE__ */ y("div", {
1422
+ children: [/* @__PURE__ */ b("div", { children: [e.isValidElement(n) && typeof n.type != "string" ? e.cloneElement(n, { close: T }) : n, o && /* @__PURE__ */ y("div", {
1423
1423
  className: Oa.dismiss,
1424
1424
  children: /* @__PURE__ */ y(K, {
1425
1425
  small: !0,
1426
1426
  round: !0,
1427
- onClick: w,
1427
+ onClick: T,
1428
1428
  icon: H.CLOSE
1429
1429
  })
1430
- })] }), D.context && /* @__PURE__ */ y(Mt, {
1431
- context: D.context,
1432
- ref: D.ref,
1430
+ })] }), O.context && /* @__PURE__ */ y(Mt, {
1431
+ context: O.context,
1432
+ ref: O.ref,
1433
1433
  width: 12,
1434
1434
  height: 6,
1435
1435
  tipRadius: 1,
@@ -3647,21 +3647,21 @@ var La = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ra =
3647
3647
  })
3648
3648
  })
3649
3649
  }), zc = {
3650
- container: "_container_1rezb_1",
3651
- small: "_small_1rezb_9",
3652
- vertical: "_vertical_1rezb_12",
3653
- hasArrows: "_hasArrows_1rezb_16",
3654
- button: "_button_1rezb_20",
3655
- thumb: "_thumb_1rezb_23",
3656
- slider: "_slider_1rezb_28",
3657
- track: "_track_1rezb_60",
3658
- range: "_range_1rezb_72",
3659
- marks: "_marks_1rezb_110",
3660
- mark: "_mark_1rezb_110",
3661
- dot: "_dot_1rezb_138",
3662
- markActive: "_markActive_1rezb_146",
3663
- sliderDisabled: "_sliderDisabled_1rezb_149",
3664
- label: "_label_1rezb_156"
3650
+ container: "_container_3cdfx_1",
3651
+ small: "_small_3cdfx_9",
3652
+ vertical: "_vertical_3cdfx_12",
3653
+ hasArrows: "_hasArrows_3cdfx_16",
3654
+ button: "_button_3cdfx_20",
3655
+ thumb: "_thumb_3cdfx_23",
3656
+ slider: "_slider_3cdfx_28",
3657
+ track: "_track_3cdfx_60",
3658
+ range: "_range_3cdfx_72",
3659
+ marks: "_marks_3cdfx_110",
3660
+ mark: "_mark_3cdfx_110",
3661
+ dot: "_dot_3cdfx_138",
3662
+ markActive: "_markActive_3cdfx_146",
3663
+ sliderDisabled: "_sliderDisabled_3cdfx_149",
3664
+ label: "_label_3cdfx_161"
3665
3665
  }, Bc = (e, t) => gn(nn(e) ? e : [e]).slice(0, t ? 2 : 1), Vc = (e, t) => t ? e : e[0], Hc = vr((e) => e.map(({ label: e, tooltip: t, value: n }) => ({
3666
3666
  label: e,
3667
3667
  tooltip: t,
@@ -6474,14 +6474,13 @@ var La = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ra =
6474
6474
  width: t,
6475
6475
  height: n
6476
6476
  }), pd = {
6477
- wrapper: "_wrapper_4rfwh_1",
6478
- label: "_label_4rfwh_5",
6479
- input: "_input_4rfwh_9",
6480
- inputSmall: "_inputSmall_4rfwh_18",
6481
- editable: "_editable_4rfwh_22",
6482
- inputControl: "_inputControl_4rfwh_25",
6483
- actionsWrapper: "_actionsWrapper_4rfwh_28",
6484
- actions: "_actions_4rfwh_28"
6477
+ wrapper: "_wrapper_j8x9r_1",
6478
+ label: "_label_j8x9r_5",
6479
+ input: "_input_j8x9r_9",
6480
+ inputSmall: "_inputSmall_j8x9r_18",
6481
+ editable: "_editable_j8x9r_22",
6482
+ inputControl: "_inputControl_j8x9r_25",
6483
+ actions: "_actions_j8x9r_28"
6485
6484
  }, md = () => {
6486
6485
  let e = m(null);
6487
6486
  return d(() => {
@@ -6831,21 +6830,35 @@ var La = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ra =
6831
6830
  l(() => {
6832
6831
  O || D(T);
6833
6832
  }, [O, T]);
6834
- let [A = "", j = c] = ir(E), M = Number(A), N = NaN;
6833
+ let [A = "", j = c] = ir(E), M = or(A), N = null;
6835
6834
  if (A.trim() !== "" && Number.isFinite(M)) try {
6836
6835
  N = v ? M : Un(M, c, j);
6837
6836
  } catch {
6838
- N = NaN;
6837
+ N = null;
6839
6838
  }
6840
- let P = Number.isFinite(N) ? N < n ? C(n) : N > r ? w(r) : "" : "Must be a numerical value", F = () => {
6839
+ let P = N === null ? "Must be a numerical value" : N < n ? C(n) : N > r ? w(r) : "", F = () => {
6841
6840
  !u || d || (D(T), k(!0));
6842
6841
  }, I = () => {
6843
6842
  D(T), k(!1);
6844
6843
  }, L = () => {
6845
- P || (o(Nd(e, N)), s == null || s(Nd(e, N)), k(!1));
6844
+ P || N === null || (o(Nd(e, N)), s == null || s(Nd(e, N)), k(!1));
6846
6845
  }, R = (e) => {
6847
6846
  e.key === "Enter" && L(), e.key === "Escape" && I();
6848
- }, z = d || O;
6847
+ }, z = d || O, ee = /* @__PURE__ */ b("div", {
6848
+ className: pd.actions,
6849
+ children: [/* @__PURE__ */ y(K, {
6850
+ icon: "close",
6851
+ small: !0,
6852
+ onClick: I,
6853
+ testId: g && `${g}-cancel`
6854
+ }), /* @__PURE__ */ y(K, {
6855
+ icon: "checkmark",
6856
+ small: !0,
6857
+ disabled: !!P,
6858
+ onClick: L,
6859
+ testId: g && `${g}-confirm`
6860
+ })]
6861
+ });
6849
6862
  return /* @__PURE__ */ b("div", {
6850
6863
  className: pd.wrapper,
6851
6864
  "data-testid": g && `${g}-wrapper`,
@@ -6857,43 +6870,38 @@ var La = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ra =
6857
6870
  children: i
6858
6871
  })
6859
6872
  }),
6860
- f && /* @__PURE__ */ b("div", {
6861
- className: _(pd.input, x && pd.inputSmall, u && pd.editable),
6862
- children: [/* @__PURE__ */ y("div", {
6863
- className: pd.inputControl,
6864
- "data-testid": g && `${g}-edit-trigger`,
6865
- onClick: F,
6866
- onKeyDown: R,
6867
- children: /* @__PURE__ */ y(Md, {
6868
- name: e,
6869
- value: O ? E : T,
6870
- unitkey: m,
6871
- initUnit: c,
6872
- noConversion: v,
6873
- onChange: (e) => D(e.target.value),
6874
- disabled: !O || d,
6875
- error: O ? P : null,
6876
- small: x,
6877
- testId: g && `${g}-unit-input`
6878
- })
6879
- }), O && /* @__PURE__ */ y("div", {
6880
- className: pd.actionsWrapper,
6881
- children: /* @__PURE__ */ b("div", {
6882
- className: pd.actions,
6883
- children: [/* @__PURE__ */ y(K, {
6884
- icon: "close",
6885
- small: !0,
6886
- onClick: I,
6887
- testId: g && `${g}-cancel`
6888
- }), /* @__PURE__ */ y(K, {
6889
- icon: "checkmark",
6890
- small: !0,
6891
- disabled: !!P,
6892
- onClick: L,
6893
- testId: g && `${g}-confirm`
6894
- })]
6873
+ f && /* @__PURE__ */ y("div", {
6874
+ className: _(pd.input, x && pd.inputSmall, u && !d && pd.editable),
6875
+ children: /* @__PURE__ */ y(Aa, {
6876
+ content: ee,
6877
+ isOpen: O,
6878
+ onToggle: (e) => {
6879
+ e || I();
6880
+ },
6881
+ overflowContainer: !0,
6882
+ placement: "bottom-start",
6883
+ testId: g && `${g}-edit-popover`,
6884
+ toggleOnTriggerClick: !1,
6885
+ children: /* @__PURE__ */ y("div", {
6886
+ className: pd.inputControl,
6887
+ "data-testid": g && `${g}-edit-trigger`,
6888
+ onClick: F,
6889
+ onKeyDown: R,
6890
+ children: /* @__PURE__ */ y(Md, {
6891
+ name: e,
6892
+ value: O ? E : T,
6893
+ unitkey: m,
6894
+ initUnit: c,
6895
+ noConversion: v,
6896
+ onChange: (e) => D(e.target.value),
6897
+ onFocus: F,
6898
+ disabled: d,
6899
+ error: O ? P : null,
6900
+ small: x,
6901
+ testId: g && `${g}-unit-input`
6902
+ })
6895
6903
  })
6896
- })]
6904
+ })
6897
6905
  }),
6898
6906
  /* @__PURE__ */ y(Uc, {
6899
6907
  name: e,
@@ -6904,7 +6912,7 @@ var La = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Ra =
6904
6912
  onChange: o,
6905
6913
  onChangeComplete: s,
6906
6914
  showArrows: p,
6907
- showTooltip: !0,
6915
+ showTooltip: !z,
6908
6916
  tooltipFormatter: () => ur(T),
6909
6917
  disabled: z,
6910
6918
  small: x,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "6.12.0-beta-4",
3
+ "version": "6.12.0-beta-6",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {