am-shared-assets 1.0.13 → 1.0.14

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.
@@ -1,7 +1,7 @@
1
- import { Dispatch, SetStateAction } from 'react';
2
1
  interface IRangeSliderProps {
3
2
  value: number | number[];
4
- setValue: Dispatch<SetStateAction<any>>;
3
+ onChange: (value: number | number[]) => void;
4
+ onChangeCommitted: (value: number | number[]) => void;
5
5
  min?: number;
6
6
  max?: number;
7
7
  step?: number;
@@ -9,5 +9,5 @@ interface IRangeSliderProps {
9
9
  tooltipColor?: "default" | "primary" | "secondary" | "success" | "warning" | "danger";
10
10
  tooltipTextColor?: "white" | "black";
11
11
  }
12
- export declare const RangeSlider: ({ value, setValue, min, max, step, color, tooltipColor, tooltipTextColor, }: IRangeSliderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const RangeSlider: ({ value, onChange, onChangeCommitted, min, max, step, color, tooltipColor, tooltipTextColor, }: IRangeSliderProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export {};
@@ -1,4 +1,4 @@
1
- import { jsxs as l, jsx as a, Fragment as Y } from "react/jsx-runtime";
1
+ import { jsxs as u, jsx as a, Fragment as Y } from "react/jsx-runtime";
2
2
  import { I as z, c as S, b as W, W as q, T as V, a as G, C as J } from "./CheckIcon-DOBPX5J0.js";
3
3
  import { Slider as K, MenuItem as Q } from "@mui/material";
4
4
  import U from "@mui/material/Select";
@@ -13,7 +13,7 @@ function L(t) {
13
13
  } else for (s in t) t[s] && (r && (r += " "), r += s);
14
14
  return r;
15
15
  }
16
- function p() {
16
+ function f() {
17
17
  for (var t, e, s = 0, r = "", n = arguments.length; s < n; s++) (t = arguments[s]) && (e = L(t)) && (r && (r += " "), r += e);
18
18
  return r;
19
19
  }
@@ -91,49 +91,49 @@ const Z = {
91
91
  infoIconAlignment: o,
92
92
  isInfoIcon: i = !0,
93
93
  hasCloseButton: c = !0,
94
- hasButton: u = !1,
95
- buttonTitle: f,
94
+ hasButton: l = !1,
95
+ buttonTitle: b,
96
96
  buttonTextColor: m = "black",
97
97
  buttonClickHandler: x,
98
98
  closeAlertHandler: h,
99
- children: b
99
+ children: g
100
100
  }) => {
101
- const g = p(
101
+ const p = f(
102
102
  H[n],
103
103
  Z[r],
104
104
  ne[d],
105
105
  ee[s]
106
106
  );
107
- return b ? /* @__PURE__ */ l(
107
+ return g ? /* @__PURE__ */ u(
108
108
  "div",
109
109
  {
110
- className: `flex p-3 ${g} ${o && M[o]}`,
110
+ className: `flex p-3 ${p} ${o && M[o]}`,
111
111
  children: [
112
112
  /* @__PURE__ */ a("div", { className: "mt-[1px]", children: i || !$[s] ? /* @__PURE__ */ a(z, { color: B[s] }) : $[s] }),
113
- b
113
+ g
114
114
  ]
115
115
  }
116
- ) : /* @__PURE__ */ l("div", { className: `relative flex justify-between p-3 ${g}`, children: [
117
- /* @__PURE__ */ l(
116
+ ) : /* @__PURE__ */ u("div", { className: `relative flex justify-between p-3 ${p}`, children: [
117
+ /* @__PURE__ */ u(
118
118
  "div",
119
119
  {
120
- className: `flex ${o ? M[o] : u ? "items-center" : t && e ? "items-start" : "items-center"} gap-3`,
120
+ className: `flex ${o ? M[o] : l ? "items-center" : t && e ? "items-start" : "items-center"} gap-3`,
121
121
  children: [
122
122
  /* @__PURE__ */ a("div", { className: "mt-[1px]", children: i || !$[s] ? /* @__PURE__ */ a(z, { color: B[s] }) : $[s] }),
123
- /* @__PURE__ */ l("div", { children: [
123
+ /* @__PURE__ */ u("div", { children: [
124
124
  t && /* @__PURE__ */ a("h2", { className: `font-semibold ${re[s]}`, children: t }),
125
125
  e && /* @__PURE__ */ a("p", { className: se[s], children: e })
126
126
  ] })
127
127
  ]
128
128
  }
129
129
  ),
130
- u ? /* @__PURE__ */ l("div", { className: "flex items-center", children: [
130
+ l ? /* @__PURE__ */ u("div", { className: "flex items-center", children: [
131
131
  /* @__PURE__ */ a(
132
132
  "button",
133
133
  {
134
134
  onClick: x,
135
135
  className: `h-8 px-3 rounded-md ${te[s]} ${ae[m]}`,
136
- children: f
136
+ children: b
137
137
  }
138
138
  ),
139
139
  c && /* @__PURE__ */ a(
@@ -169,7 +169,7 @@ const Z = {
169
169
  size: r = "md",
170
170
  textColor: n = "black"
171
171
  }) => {
172
- const d = p(
172
+ const d = f(
173
173
  de[e],
174
174
  ie[n],
175
175
  oe[r],
@@ -249,24 +249,24 @@ const Z = {
249
249
  label: o,
250
250
  icon: i,
251
251
  iconPosition: c = "left",
252
- width: u = "auto",
253
- disabled: f = !1,
252
+ width: l = "auto",
253
+ disabled: b = !1,
254
254
  onClick: m
255
255
  }) => {
256
- const x = p(
257
- u === "full" ? "w-full" : "w-auto",
256
+ const x = f(
257
+ l === "full" ? "w-full" : "w-auto",
258
258
  c === "right" ? "flex-row" : "flex-row-reverse",
259
259
  ue[d],
260
260
  le[n],
261
261
  be(e, s, r)
262
262
  );
263
- return /* @__PURE__ */ l(
263
+ return /* @__PURE__ */ u(
264
264
  "button",
265
265
  {
266
266
  type: t,
267
267
  className: "flex items-center justify-center gap-2 font-semibold transition-all duration-300 " + x,
268
268
  onClick: m,
269
- disabled: f,
269
+ disabled: b,
270
270
  children: [
271
271
  i,
272
272
  o && /* @__PURE__ */ a("p", { children: o })
@@ -355,12 +355,12 @@ const Z = {
355
355
  rounded: d = "none",
356
356
  children: o
357
357
  }) => {
358
- const i = p(
358
+ const i = f(
359
359
  pe[d],
360
360
  ge[n],
361
361
  xe(t, e, s)
362
362
  );
363
- return /* @__PURE__ */ a("div", { className: `w-fit flex items-center justify-center gap-1 px-2 ${i}`, children: o || /* @__PURE__ */ l(Y, { children: [
363
+ return /* @__PURE__ */ a("div", { className: `w-fit flex items-center justify-center gap-1 px-2 ${i}`, children: o || /* @__PURE__ */ u(Y, { children: [
364
364
  /* @__PURE__ */ a("p", { children: r }),
365
365
  t === "dot" && /* @__PURE__ */ a("div", { className: `size-2 rounded-full ${me[e]}` })
366
366
  ] }) });
@@ -424,34 +424,34 @@ const Z = {
424
424
  onChange: o,
425
425
  isFocused: i = !1,
426
426
  placeHolder: c,
427
- variant: u = "flat",
428
- color: f = "default",
427
+ variant: l = "flat",
428
+ color: b = "default",
429
429
  size: m = "sm",
430
430
  rounded: x = "sm",
431
431
  description: h = "",
432
- icon: b,
433
- endIcon: g,
432
+ icon: g,
433
+ endIcon: p,
434
434
  errorMsg: v = "",
435
435
  hasError: N = !1
436
436
  }) => {
437
- const T = p(Ce[x], ke(u, f, N)), _ = p(he[m]);
438
- return /* @__PURE__ */ l("label", { className: "flex flex-col w-full", children: [
439
- e && /* @__PURE__ */ l(
437
+ const T = f(Ce[x], ke(l, b, N)), _ = f(he[m]);
438
+ return /* @__PURE__ */ u("label", { className: "flex flex-col w-full", children: [
439
+ e && /* @__PURE__ */ u(
440
440
  "div",
441
441
  {
442
- className: `h-4 text-xs mb-2 ${N ? "text-base-danger" : we[f]}`,
442
+ className: `h-4 text-xs mb-2 ${N ? "text-base-danger" : we[b]}`,
443
443
  children: [
444
444
  e,
445
445
  s && /* @__PURE__ */ a("span", { className: "text-base-danger text-sm", children: "*" })
446
446
  ]
447
447
  }
448
448
  ),
449
- /* @__PURE__ */ l(
449
+ /* @__PURE__ */ u(
450
450
  "div",
451
451
  {
452
452
  className: `${T} flex items-center px-1.5 transition-all duration-200`,
453
453
  children: [
454
- b,
454
+ g,
455
455
  r ? /* @__PURE__ */ a(
456
456
  "input",
457
457
  {
@@ -474,7 +474,7 @@ const Z = {
474
474
  autoFocus: i
475
475
  }
476
476
  ),
477
- g
477
+ p
478
478
  ]
479
479
  }
480
480
  ),
@@ -509,11 +509,11 @@ const Z = {
509
509
  color: o = "primary",
510
510
  children: i
511
511
  }) => {
512
- const c = p(
512
+ const c = f(
513
513
  Fe[d],
514
514
  s ? Ne[o] : "border-base-default hover:bg-default-100 transition-all duration-200"
515
515
  );
516
- return /* @__PURE__ */ l(
516
+ return /* @__PURE__ */ u(
517
517
  "label",
518
518
  {
519
519
  className: `flex items-center gap-2 ${r ? "opacity-50" : "cursor-pointer"}`,
@@ -525,7 +525,7 @@ const Z = {
525
525
  type: "radio",
526
526
  value: e,
527
527
  checked: s,
528
- onChange: (u) => n && n(u.target.value),
528
+ onChange: (l) => n && n(l.target.value),
529
529
  disabled: r,
530
530
  style: { display: "none" }
531
531
  }
@@ -601,13 +601,13 @@ const Z = {
601
601
  direction: d = "bottom",
602
602
  position: o = "center"
603
603
  }) => {
604
- const i = p(
604
+ const i = f(
605
605
  ze[r],
606
606
  E[e],
607
607
  Se[s],
608
608
  Ae[n]
609
609
  );
610
- return /* @__PURE__ */ l("div", { className: "relative", children: [
610
+ return /* @__PURE__ */ u("div", { className: "relative", children: [
611
611
  /* @__PURE__ */ a(
612
612
  "div",
613
613
  {
@@ -638,31 +638,33 @@ const Z = {
638
638
  danger: "#fdd0df"
639
639
  }, Ze = ({
640
640
  value: t,
641
- setValue: e,
642
- min: s = 0,
643
- max: r = 100,
644
- step: n = 1,
645
- color: d = "primary",
646
- tooltipColor: o = "primary",
647
- tooltipTextColor: i = "white"
641
+ onChange: e,
642
+ onChangeCommitted: s,
643
+ min: r = 0,
644
+ max: n = 100,
645
+ step: d = 1,
646
+ color: o = "primary",
647
+ tooltipColor: i = "primary",
648
+ tooltipTextColor: c = "white"
648
649
  }) => /* @__PURE__ */ a(
649
650
  K,
650
651
  {
651
652
  value: t,
652
- min: s,
653
- max: r,
654
- step: n,
655
- onChange: (c, u) => {
656
- e(u);
653
+ min: r,
654
+ max: n,
655
+ step: d,
656
+ onChange: (l, b) => {
657
+ e(b);
657
658
  },
658
- onChangeCommitted: (c) => {
659
+ onChangeCommitted: (l, b) => {
660
+ s(b);
659
661
  },
660
- valueLabelFormat: (c) => /* @__PURE__ */ a(
662
+ valueLabelFormat: (l) => /* @__PURE__ */ a(
661
663
  Be,
662
664
  {
663
- color: o,
664
- textColor: i,
665
- label: `${c.toLocaleString()}`
665
+ color: i,
666
+ textColor: c,
667
+ label: `${l.toLocaleString()}`
666
668
  }
667
669
  ),
668
670
  valueLabelDisplay: "auto",
@@ -675,20 +677,20 @@ const Z = {
675
677
  width: "16px",
676
678
  height: "16px",
677
679
  border: "2px solid",
678
- borderColor: R[d],
680
+ borderColor: R[o],
679
681
  color: "#fff"
680
682
  },
681
683
  "& .MuiSlider-thumb.Mui-focusVisible": {
682
- boxShadow: `0 0 0 4px ${F[d]}`
684
+ boxShadow: `0 0 0 4px ${F[o]}`
683
685
  },
684
686
  "& .MuiSlider-thumb.Mui-active": {
685
- boxShadow: `0 0 0 4px ${F[d]}`
687
+ boxShadow: `0 0 0 4px ${F[o]}`
686
688
  },
687
689
  "& .MuiSlider-thumb:hover": {
688
- boxShadow: `0 0 0 4px ${F[d]}`
690
+ boxShadow: `0 0 0 4px ${F[o]}`
689
691
  },
690
692
  "& .MuiSlider-track": {
691
- color: R[d]
693
+ color: R[o]
692
694
  },
693
695
  "& .MuiSlider-valueLabel": {
694
696
  backgroundColor: "transparent"
@@ -792,15 +794,15 @@ const Z = {
792
794
  color: d = "default",
793
795
  disabled: o = !1
794
796
  }) => {
795
- const i = p(
797
+ const i = f(
796
798
  r === "left" ? "flex-row" : "flex-row-reverse",
797
799
  o && "opacity-50"
798
- ), c = p(
800
+ ), c = f(
799
801
  Pe[n],
800
802
  t ? je[d] : "bg-default-700",
801
803
  o && "cursor-auto"
802
804
  );
803
- return /* @__PURE__ */ l("div", { className: `flex items-center gap-2 ${i}`, children: [
805
+ return /* @__PURE__ */ u("div", { className: `flex items-center gap-2 ${i}`, children: [
804
806
  /* @__PURE__ */ a(
805
807
  "button",
806
808
  {
@@ -838,13 +840,13 @@ const Z = {
838
840
  inputRef: o,
839
841
  size: i,
840
842
  variant: c,
841
- iconOnClick: u,
842
- endIconOnClick: f
843
- }) => /* @__PURE__ */ l("div", { ref: o, className: "relative", children: [
843
+ iconOnClick: l,
844
+ endIconOnClick: b
845
+ }) => /* @__PURE__ */ u("div", { ref: o, className: "relative", children: [
844
846
  r && /* @__PURE__ */ a(
845
847
  "button",
846
848
  {
847
- onClick: u,
849
+ onClick: l,
848
850
  className: "absolute top-1/2 -translate-y-1/2 right-2",
849
851
  children: r
850
852
  }
@@ -863,7 +865,7 @@ const Z = {
863
865
  n && /* @__PURE__ */ a(
864
866
  "button",
865
867
  {
866
- onClick: f,
868
+ onClick: b,
867
869
  className: "absolute top-1/2 -translate-y-1/2 left-2",
868
870
  children: n
869
871
  }
@@ -878,11 +880,11 @@ const Z = {
878
880
  onChange: o,
879
881
  size: i = "sm",
880
882
  variant: c = "flat",
881
- options: u,
882
- iconOnClick: f,
883
+ options: l,
884
+ iconOnClick: b,
883
885
  endIconOnClick: m
884
886
  }) => {
885
- const x = u.map((b, g) => ({ ...b, optionIndex: g })), h = u.map((b, g) => ({ data: b.data, optionIndex: g }));
887
+ const x = l.map((g, p) => ({ ...g, optionIndex: p })), h = l.map((g, p) => ({ data: g.data, optionIndex: p }));
886
888
  return /* @__PURE__ */ a(
887
889
  X,
888
890
  {
@@ -902,12 +904,12 @@ const Z = {
902
904
  }
903
905
  }
904
906
  },
905
- onChange: (b, g) => o && o(g),
907
+ onChange: (g, p) => o && o(p),
906
908
  getOptionLabel: () => "",
907
- renderOption: (b, g) => /* @__PURE__ */ a("li", { ...b, children: x.find(
908
- ({ optionIndex: v }) => v === g.optionIndex
909
+ renderOption: (g, p) => /* @__PURE__ */ a("li", { ...g, children: x.find(
910
+ ({ optionIndex: v }) => v === p.optionIndex
909
911
  )?.itemElement }),
910
- renderInput: (b) => /* @__PURE__ */ l("div", { children: [
912
+ renderInput: (g) => /* @__PURE__ */ u("div", { children: [
911
913
  t && /* @__PURE__ */ a("div", { className: "h-4 text-xs mb-2 text-default-600", children: t }),
912
914
  /* @__PURE__ */ a(
913
915
  Re,
@@ -917,11 +919,11 @@ const Z = {
917
919
  placeHolder: e,
918
920
  inputIcon: s,
919
921
  inputEndIcon: r,
920
- inputProps: b.slotProps.htmlInput,
921
- inputRef: b.slotProps.input.ref,
922
+ inputProps: g.slotProps.htmlInput,
923
+ inputRef: g.slotProps.input.ref,
922
924
  size: i,
923
925
  variant: c,
924
- iconOnClick: f,
926
+ iconOnClick: b,
925
927
  endIconOnClick: m
926
928
  }
927
929
  )
@@ -932,8 +934,8 @@ const Z = {
932
934
  xs: "size-4 min-w-4",
933
935
  sm: "size-5 min-w-5"
934
936
  }, sr = ({ checked: t, size: e = "xs", children: s, onClickHandler: r }) => {
935
- const n = p(Le[e], t ? "border-base-primary bg-base-primary" : "border-content-3 group-hover:bg-content-2");
936
- return /* @__PURE__ */ l("div", { onClick: r, className: "flex cursor-pointer group", children: [
937
+ const n = f(Le[e], t ? "border-base-primary bg-base-primary" : "border-content-3 group-hover:bg-content-2");
938
+ return /* @__PURE__ */ u("div", { onClick: r, className: "flex cursor-pointer group", children: [
937
939
  /* @__PURE__ */ a("div", { className: `flex items-center justify-center ${n} border-2 rounded-xs transition-all duration-300`, children: t && /* @__PURE__ */ a(J, { color: "#FFFFFF", size: e === "xs" ? 12 : 16 }) }),
938
940
  s
939
941
  ] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "am-shared-assets",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "",