@oliasoft-open-source/react-ui-library 8.0.0-beta-9 → 8.0.0-beta-11

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
@@ -844,39 +844,34 @@ var _a = {
844
844
  let { sections: t } = e;
845
845
  return !s(t) && (!Array.isArray(t) || t.every((e) => cn(e)));
846
846
  }, J = {
847
- layerContainer: "_layerContainer_uahkz_1",
848
- layer: "_layer_uahkz_1",
849
- enter: "_enter_uahkz_17",
850
- enterActive: "_enterActive_uahkz_21",
851
- nested: "_nested_uahkz_26",
852
- fileInput: "_fileInput_uahkz_47",
853
- trigger: "_trigger_uahkz_53",
854
- heading: "_heading_uahkz_62",
855
- headingIcon: "_headingIcon_uahkz_68",
856
- clickable: "_clickable_uahkz_75",
857
- option: "_option_uahkz_79",
858
- active: "_active_uahkz_98",
859
- disabled: "_disabled_uahkz_103",
860
- selected: "_selected_uahkz_106",
861
- optionContent: "_optionContent_uahkz_113",
862
- inline: "_inline_uahkz_117",
863
- icon: "_icon_uahkz_122",
864
- check: "_check_uahkz_123",
865
- text: "_text_uahkz_149",
866
- label: "_label_uahkz_154",
867
- description: "_description_uahkz_166",
868
- arrow: "_arrow_uahkz_170",
869
- divider: "_divider_uahkz_174",
870
- deprecatedSemanticIcon: "_deprecatedSemanticIcon_uahkz_178",
871
- buttonLabel: "_buttonLabel_uahkz_186",
872
- component: "_component_uahkz_193",
873
- right: "_right_uahkz_199",
874
- actions: "_actions_uahkz_204",
875
- menuPopover: "_menuPopover_uahkz_211",
876
- menuPopoverNested: "_menuPopoverNested_uahkz_233",
877
- modalContainer: "_modalContainer_uahkz_236",
878
- menuItem: "_menuItem_uahkz_239",
879
- customSections: "_customSections_uahkz_254"
847
+ layer: "_layer_v9hv9_1",
848
+ nested: "_nested_v9hv9_14",
849
+ fileInput: "_fileInput_v9hv9_17",
850
+ trigger: "_trigger_v9hv9_23",
851
+ heading: "_heading_v9hv9_32",
852
+ headingIcon: "_headingIcon_v9hv9_38",
853
+ clickable: "_clickable_v9hv9_45",
854
+ option: "_option_v9hv9_49",
855
+ active: "_active_v9hv9_68",
856
+ disabled: "_disabled_v9hv9_73",
857
+ selected: "_selected_v9hv9_76",
858
+ optionContent: "_optionContent_v9hv9_83",
859
+ inline: "_inline_v9hv9_87",
860
+ icon: "_icon_v9hv9_92",
861
+ check: "_check_v9hv9_93",
862
+ label: "_label_v9hv9_119",
863
+ description: "_description_v9hv9_131",
864
+ arrow: "_arrow_v9hv9_135",
865
+ divider: "_divider_v9hv9_139",
866
+ buttonLabel: "_buttonLabel_v9hv9_147",
867
+ component: "_component_v9hv9_154",
868
+ right: "_right_v9hv9_160",
869
+ actions: "_actions_v9hv9_165",
870
+ menuPopover: "_menuPopover_v9hv9_172",
871
+ menuPopoverNested: "_menuPopoverNested_v9hv9_194",
872
+ modalContainer: "_modalContainer_v9hv9_197",
873
+ menuItem: "_menuItem_v9hv9_200",
874
+ customSections: "_customSections_v9hv9_215"
880
875
  }, Pa = ({ children: e, placement: t = "bottom-start", triggerRef: n, portalTriggerRef: r, isNested: i = !1, className: a, offset: o = 0 }) => {
881
876
  let s = i ? void 0 : xa((r == null ? n : r).current);
882
877
  return /* @__PURE__ */ x(On, {
@@ -1194,15 +1189,12 @@ var _a = {
1194
1189
  if (s(e) && Ea(e)) {
1195
1190
  var c;
1196
1191
  let s = e, l = (c = s.props["data-testid"]) == null ? s.props.testId : c, u = typeof s.type == "string", d = s.ref;
1197
- return /* @__PURE__ */ x("div", {
1198
- className: y(J.component, t ? J.disabled : null),
1199
- children: r(s, {
1200
- ...a,
1201
- ref: Za(o, d),
1202
- disabled: t || s.props.disabled,
1203
- ...u ? null : { active: !!(s.props.active || n) },
1204
- ...l ? null : u ? { "data-testid": i } : { testId: i }
1205
- })
1192
+ return r(s, {
1193
+ ...a,
1194
+ ref: Za(o, d),
1195
+ disabled: t || s.props.disabled,
1196
+ ...u ? null : { active: !!(s.props.active || n) },
1197
+ ...l ? null : u ? { "data-testid": i } : { testId: i }
1206
1198
  });
1207
1199
  }
1208
1200
  return /* @__PURE__ */ x("div", {
@@ -7062,82 +7054,96 @@ var So = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Co =
7062
7054
  }, yf = (e, t) => ({ target: {
7063
7055
  name: e,
7064
7056
  value: t
7065
- } }), bf = (e) => `Value cannot be less than ${e}`, xf = (e) => `Value cannot be greater than ${e}`, Sf = ({ name: e = "", value: t, min: n, max: r, label: i, step: a = .01, onChange: o, onChangeComplete: s, preferredUnit: c = "m", enableEditUnitInput: l = !1, disabled: u = !1, showUnitInput: f = !0, showArrows: p = !0, unitkey: m = "length", testId: h, noConversion: g = !1, small: v = !1, marks: b, minErrorMessage: C = bf, maxErrorMessage: w = xf }) => {
7066
- let T = Er(t, c), [E, D] = _(T), [O, k] = _(!1);
7057
+ } }), bf = (e) => `Value cannot be less than ${e}`, xf = (e) => `Value cannot be greater than ${e}`, Sf = ({ name: e = "", value: t, min: n, max: r, label: i, step: a = .01, onChange: o, onChangeComplete: s, preferredUnit: c = "m", onSwitchUnit: l, enableEditUnitInput: u = !1, disabled: f = !1, showUnitInput: p = !0, showArrows: m = !0, unitkey: h = "length", testId: g, noConversion: v = !1, small: b = !1, marks: C, minErrorMessage: w = bf, maxErrorMessage: T = xf }) => {
7058
+ let E = Er(t, c), [D, O] = _(E), [k, A] = _(!1), [j, M] = _(c);
7067
7059
  d(() => {
7068
- O || D(T);
7069
- }, [O, T]);
7070
- let [A = "", j = c] = yr(E), M = xr(A), N = null;
7071
- if (A.trim() !== "" && Number.isFinite(M)) try {
7072
- N = g ? M : ir(M, c, j);
7060
+ k || O(E);
7061
+ }, [k, E]), d(() => {
7062
+ M(c);
7063
+ }, [c]);
7064
+ let [N = "", P = c] = yr(D), F = xr(N), I = null;
7065
+ if (N.trim() !== "" && Number.isFinite(F)) try {
7066
+ I = v ? F : ir(F, c, P);
7073
7067
  } catch {
7074
- N = null;
7075
- }
7076
- let P = N === null ? "Must be a numerical value" : N < n ? C(n) : N > r ? w(r) : "", F = () => {
7077
- !l || u || (D(T), k(!0));
7078
- }, I = () => {
7079
- D(T), k(!1);
7080
- }, L = () => {
7081
- P || N === null || (o(yf(e, N)), s == null || s(yf(e, N)), k(!1));
7082
- }, R = (e) => {
7083
- e.key === "Enter" && L(), e.key === "Escape" && I();
7084
- }, z = u || O, B = /* @__PURE__ */ S("div", {
7068
+ I = null;
7069
+ }
7070
+ let L = I === null ? "Must be a numerical value" : I < n ? w(n) : I > r ? T(r) : "", R = () => {
7071
+ !u || f || (O(E), A(!0));
7072
+ }, z = () => {
7073
+ O(E), A(!1);
7074
+ }, B = () => {
7075
+ L || I === null || (o(yf(e, I)), s == null || s(yf(e, I)), A(!1));
7076
+ }, ee = (e) => {
7077
+ M(e), l == null || l(e);
7078
+ }, te = (e) => {
7079
+ let t = Array.isArray(e) ? e[0] : e;
7080
+ if (v || j === c) return Tr(hr(Er(t, j)));
7081
+ try {
7082
+ let e = ir(t, j, c);
7083
+ return Tr(hr(Er(e, j)));
7084
+ } catch {
7085
+ return Tr(hr(E));
7086
+ }
7087
+ }, ne = (e) => {
7088
+ e.key === "Enter" && B(), e.key === "Escape" && z();
7089
+ }, V = f || k, re = /* @__PURE__ */ S("div", {
7085
7090
  className: Qd.actions,
7086
7091
  children: [/* @__PURE__ */ x(q, {
7087
7092
  icon: "close",
7088
7093
  small: !0,
7089
- onClick: I,
7090
- testId: h && `${h}-cancel`
7094
+ onClick: z,
7095
+ testId: g && `${g}-cancel`
7091
7096
  }), /* @__PURE__ */ x(q, {
7092
7097
  icon: "checkmark",
7093
7098
  small: !0,
7094
- disabled: !!P,
7095
- onClick: L,
7096
- testId: h && `${h}-confirm`
7099
+ disabled: !!L,
7100
+ onClick: B,
7101
+ testId: g && `${g}-confirm`
7097
7102
  })]
7098
7103
  });
7099
7104
  return /* @__PURE__ */ S("div", {
7100
7105
  className: Qd.wrapper,
7101
- "data-testid": h && `${h}-wrapper`,
7106
+ "data-testid": g && `${g}-wrapper`,
7102
7107
  children: [
7103
7108
  i && /* @__PURE__ */ x("span", {
7104
7109
  className: Qd.label,
7105
7110
  children: /* @__PURE__ */ x(Ho, {
7106
- small: v,
7111
+ small: b,
7107
7112
  children: i
7108
7113
  })
7109
7114
  }),
7110
- f && /* @__PURE__ */ x("div", {
7111
- className: y(Qd.input, v && Qd.inputSmall, l && !u && Qd.editable),
7115
+ p && /* @__PURE__ */ x("div", {
7116
+ className: y(Qd.input, b && Qd.inputSmall, u && !f && Qd.editable),
7112
7117
  children: /* @__PURE__ */ x(ho, {
7113
- content: B,
7114
- isOpen: O,
7118
+ content: re,
7119
+ isOpen: k,
7115
7120
  isNonModal: !0,
7116
7121
  closeOnOutsideClick: !1,
7117
7122
  restoreTriggerFocusOnClose: !1,
7118
7123
  onToggle: (e) => {
7119
- e || I();
7124
+ e || z();
7120
7125
  },
7121
7126
  placement: "bottom-start",
7122
- testId: h && `${h}-edit-popover`,
7127
+ testId: g && `${g}-edit-popover`,
7123
7128
  toggleOnTriggerClick: !1,
7124
7129
  children: /* @__PURE__ */ x("div", {
7125
7130
  className: Qd.inputControl,
7126
- "data-testid": h && `${h}-edit-trigger`,
7127
- onClick: F,
7128
- onKeyDown: R,
7131
+ "data-testid": g && `${g}-edit-trigger`,
7132
+ onClick: R,
7133
+ onKeyDown: ne,
7129
7134
  children: /* @__PURE__ */ x(vf, {
7130
7135
  name: e,
7131
- value: O ? E : T,
7132
- unitkey: m,
7136
+ value: k ? D : E,
7137
+ unitkey: h,
7133
7138
  initUnit: c,
7134
- noConversion: g,
7135
- onChange: (e) => D(e.target.value),
7136
- onFocus: F,
7137
- disabled: u,
7138
- error: O ? P : null,
7139
- small: v,
7140
- testId: h && `${h}-unit-input`
7139
+ noConversion: v,
7140
+ onChange: (e) => O(e.target.value),
7141
+ onSwitchUnit: ee,
7142
+ onFocus: R,
7143
+ disabled: f,
7144
+ error: k ? L : null,
7145
+ small: b,
7146
+ testId: g && `${g}-unit-input`
7141
7147
  })
7142
7148
  })
7143
7149
  })
@@ -7150,13 +7156,13 @@ var So = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), Co =
7150
7156
  step: a,
7151
7157
  onChange: o,
7152
7158
  onChangeComplete: s,
7153
- showArrows: p,
7154
- showTooltip: !z,
7155
- tooltipFormatter: () => Tr(T),
7156
- disabled: z,
7157
- small: v,
7158
- marks: b,
7159
- testId: h && `${h}-slider`
7159
+ showArrows: m,
7160
+ showTooltip: !V,
7161
+ tooltipFormatter: te,
7162
+ disabled: V,
7163
+ small: b,
7164
+ marks: C,
7165
+ testId: g && `${g}-slider`
7160
7166
  })
7161
7167
  ]
7162
7168
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/react-ui-library",
3
- "version": "8.0.0-beta-9",
3
+ "version": "8.0.0-beta-11",
4
4
  "description": "Reusable UI components for React projects",
5
5
  "homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
6
6
  "bugs": {