stone-kit 0.0.132 → 0.0.136

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.
@@ -2,8 +2,8 @@ import { MouseEvent } from 'react';
2
2
  import { Option } from '../ui/SortSelect.types';
3
3
 
4
4
  interface IUseSortSelect {
5
- selectedOption?: Option;
6
- setSelectedOption?: (event: Option | undefined) => void;
5
+ selectedOption: Option | null;
6
+ setSelectedOption?: (event: Option | null) => void;
7
7
  setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
8
8
  containerRef: React.RefObject<HTMLDivElement>;
9
9
  isOpen: boolean;
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { u as m } from "../../../useSortSelect-Dfs-72R7.js";
2
+ import { u as m } from "../../../useSortSelect-BTrKnFKx.js";
3
3
  import "../../../index-DIxK0V-G.js";
4
4
  export {
5
5
  m as useSortSelect
@@ -1,7 +1,7 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as C, useRef as I, useEffect as B } from "react";
3
3
  import { c as E } from "../../../index-DIxK0V-G.js";
4
- import { s as e, u as L } from "../../../useSortSelect-Dfs-72R7.js";
4
+ import { s as e, u as L } from "../../../useSortSelect-BTrKnFKx.js";
5
5
  import { NewIcon as u } from "../../NewIcon/ui/NewIcon.js";
6
6
  import "../../Button/ui/Button.js";
7
7
  import "../../mobileButton/ui/MobileButton.js";
@@ -4,11 +4,11 @@ export interface Option {
4
4
  }
5
5
  export interface SortSelectProps {
6
6
  options: Option[];
7
- selectedOption?: Option;
7
+ selectedOption: Option | null;
8
8
  placeholder?: string;
9
9
  error?: boolean;
10
10
  disabled?: boolean;
11
- onChange?: (event: Option | undefined) => void;
11
+ onChange?: (event: Option | null) => void;
12
12
  onBlur?: (event: Option) => void;
13
13
  additionalClass?: string;
14
14
  mini?: boolean;
@@ -1,12 +1,12 @@
1
1
  import { jsxs as h, jsx as c } from "react/jsx-runtime";
2
2
  import { c as p } from "./index-DIxK0V-G.js";
3
- const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_selectionOptionMini_vmknt_33", C = "_selectedOptionsOpened_vmknt_37", f = "_selectOptionsDisabled_vmknt_41", S = "_optionsList_vmknt_48", g = "_mobileOptionList_vmknt_63", L = "_mobileSortHeader_vmknt_70", W = "_modalAddBody_vmknt_84", D = "_inputWrapper_vmknt_90", N = "_option_vmknt_48", y = "_icon_vmknt_117", A = "_checkBox_vmknt_124", H = "_checkBoxChecked_vmknt_131", M = "_innerCheck_vmknt_138", o = {
3
+ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_selectionOptionMini_vmknt_33", C = "_selectedOptionsOpened_vmknt_37", S = "_selectOptionsDisabled_vmknt_41", f = "_optionsList_vmknt_48", g = "_mobileOptionList_vmknt_63", L = "_mobileSortHeader_vmknt_70", W = "_modalAddBody_vmknt_84", D = "_inputWrapper_vmknt_90", N = "_option_vmknt_48", y = "_icon_vmknt_117", A = "_checkBox_vmknt_124", H = "_checkBoxChecked_vmknt_131", M = "_innerCheck_vmknt_138", e = {
4
4
  sortSelectWrapper: b,
5
5
  selectedOptions: x,
6
6
  selectionOptionMini: B,
7
7
  selectedOptionsOpened: C,
8
- selectOptionsDisabled: f,
9
- optionsList: S,
8
+ selectOptionsDisabled: S,
9
+ optionsList: f,
10
10
  mobileOptionList: g,
11
11
  mobileSortHeader: L,
12
12
  modalAddBody: W,
@@ -16,43 +16,42 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
16
16
  checkBox: A,
17
17
  checkBoxChecked: H,
18
18
  innerCheck: M
19
- }, m = p.bind(o), q = ({
19
+ }, l = p.bind(e), q = ({
20
20
  selectedOption: n,
21
21
  setSelectedOption: s,
22
- setIsOpen: i,
22
+ setIsOpen: m,
23
23
  containerRef: r,
24
- onBlur: a,
25
- onChange: _,
24
+ onBlur: i,
25
+ onChange: a,
26
26
  isDesktop: k,
27
27
  placeholder: u
28
28
  }) => {
29
- const v = (t) => (e) => {
30
- e.stopPropagation();
31
- const l = (n == null ? void 0 : n.value) === t.value ? void 0 : t;
32
- if (s && s(l), _) {
29
+ const v = (t) => (o) => {
30
+ o.stopPropagation();
31
+ const _ = (n == null ? void 0 : n.value) === t.value ? null : t;
32
+ if (s && s(_), a) {
33
33
  const d = {
34
- ...e,
35
- target: { value: l }
34
+ ...o,
35
+ target: { value: _ }
36
36
  };
37
- _(d);
37
+ a(d);
38
38
  }
39
- i(!1);
40
39
  };
41
40
  return { handleDocumentClick: (t) => {
42
- r.current && !r.current.contains(t.target) && i(!1);
41
+ r.current && !r.current.contains(t.target) && m(!1);
43
42
  }, handleBlur: (t) => {
44
- if (a) {
45
- const e = {
43
+ if (i) {
44
+ const o = {
46
45
  ...t,
47
46
  target: { value: n }
48
47
  };
49
- a(e);
48
+ i(o);
50
49
  }
51
50
  }, getInputValue: () => k ? n ? n.label : u : "", getOption: (t) => /* @__PURE__ */ h(
52
51
  "div",
53
52
  {
54
- className: m(o.option, {
55
- [o.selected]: (n == null ? void 0 : n.value) === t.value
53
+ className: l(e.option, {
54
+ [e.selected]: (n == null ? void 0 : n.value) === t.value
56
55
  }),
57
56
  onClick: v(t),
58
57
  children: [
@@ -60,10 +59,10 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
60
59
  /* @__PURE__ */ c(
61
60
  "div",
62
61
  {
63
- className: m(o.checkBox, {
64
- [o.checkBoxChecked]: (n == null ? void 0 : n.value) === t.value
62
+ className: l(e.checkBox, {
63
+ [e.checkBoxChecked]: (n == null ? void 0 : n.value) === t.value
65
64
  }),
66
- children: (n == null ? void 0 : n.value) === t.value && /* @__PURE__ */ c("div", { className: o.innerCheck })
65
+ children: (n == null ? void 0 : n.value) === t.value && /* @__PURE__ */ c("div", { className: e.innerCheck })
67
66
  }
68
67
  )
69
68
  ]
@@ -72,6 +71,6 @@ const b = "_sortSelectWrapper_vmknt_1", x = "_selectedOptions_vmknt_10", B = "_s
72
71
  ) };
73
72
  };
74
73
  export {
75
- o as s,
74
+ e as s,
76
75
  q as u
77
76
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "stone-kit",
3
3
  "description": "uikit for redesign",
4
4
  "private": false,
5
- "version": "0.0.132",
5
+ "version": "0.0.136",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",