stone-kit 0.0.513 → 0.0.515

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.
@@ -0,0 +1,66 @@
1
+ import { jsxs as r, jsx as i } from "react/jsx-runtime";
2
+ import { NewIcon as p } from "./components/NewIcon/ui/NewIcon.js";
3
+ import { c as h } from "./index-rKuIKazb.js";
4
+ const m = "_multiSelectWrapper_1h59t_1", u = "_selectedOptions_1h59t_8", O = "_selectedOptionsBtn_1h59t_27", b = "_selectedOptionsOpened_1h59t_31", v = "_selectedOptionsNotEmpty_1h59t_35", C = "_selectOptionsDisabled_1h59t_40", g = "_optionsList_1h59t_47", k = "_listRight_1h59t_63", y = "_inputWrapper_1h59t_67", D = "_option_1h59t_47", f = "_category_1h59t_88", N = "_leftSide_1h59t_92", S = "_optionCategory_1h59t_97", W = "_optionDisabled_1h59t_103", x = "_optionClickable_1h59t_107", B = "_icon_1h59t_111", s = {
5
+ multiSelectWrapper: m,
6
+ selectedOptions: u,
7
+ selectedOptionsBtn: O,
8
+ selectedOptionsOpened: b,
9
+ selectedOptionsNotEmpty: v,
10
+ selectOptionsDisabled: C,
11
+ optionsList: g,
12
+ listRight: k,
13
+ inputWrapper: y,
14
+ option: D,
15
+ category: f,
16
+ leftSide: N,
17
+ optionCategory: S,
18
+ optionDisabled: W,
19
+ optionClickable: x,
20
+ icon: B
21
+ }, E = h.bind(s), U = ({
22
+ option: e,
23
+ selectedOptions: o,
24
+ disabledOptions: _,
25
+ clickableOptions: c,
26
+ handleOptionClick: a,
27
+ isOptionCategory: n,
28
+ sizeIcon: l,
29
+ addClassName: d = ""
30
+ }) => /* @__PURE__ */ r(
31
+ "div",
32
+ {
33
+ className: E(
34
+ s.option,
35
+ {
36
+ [s.selected]: o.some((t) => t.value === e.value),
37
+ [s.optionDisabled]: _.some((t) => t.value === e.value),
38
+ [s.optionCategory]: n,
39
+ [s.optionClickable]: c && c.includes(`${e.value}`)
40
+ },
41
+ d
42
+ ),
43
+ onClick: () => a(e),
44
+ children: [
45
+ n && /* @__PURE__ */ i(
46
+ p,
47
+ {
48
+ size: l ?? "20",
49
+ name: o.some((t) => t.value === e.value) ? "selectChecked" : "selectUnchecked"
50
+ }
51
+ ),
52
+ /* @__PURE__ */ i("div", { children: e.label }),
53
+ !n && /* @__PURE__ */ i(
54
+ p,
55
+ {
56
+ size: l ?? "20",
57
+ name: o.some((t) => t.value === e.value) ? "selectChecked" : "selectUnchecked"
58
+ }
59
+ )
60
+ ]
61
+ }
62
+ );
63
+ export {
64
+ U as O,
65
+ s
66
+ };
@@ -0,0 +1,194 @@
1
+ import { jsxs as v, jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as T, useState as D, useRef as M, useEffect as B } from "react";
3
+ import { c as L } from "./index-rKuIKazb.js";
4
+ import { s as t, u as j } from "./useSortSelect-CjZXLFOG.js";
5
+ import { NewIcon as C } from "./components/NewIcon/ui/NewIcon.js";
6
+ import "./components/Button/ui/Button.js";
7
+ import "./components/mobileButton/ui/MobileButton.js";
8
+ import "./components/DestinationTab/ui/DestinationTab.js";
9
+ import "./components/RoundButton/ui/RoundButton.js";
10
+ import "./components/Tag/ui/Tag.js";
11
+ import "./components/Switcher/ui/Switcher.js";
12
+ import { Text as W } from "./components/Text/ui/Text.js";
13
+ import "./components/Flex/ui/Flex.js";
14
+ import "./components/Input/ui/Input.js";
15
+ import { M as E } from "./Modal-BZv6nlLe.js";
16
+ import "./components/GroupedInput/ui/GroupedInputs.js";
17
+ import "./components/MetroTag/ui/MetroTag.js";
18
+ import "./components/LotCard/ui/LotCard.js";
19
+ import "./components/Select/ui/Select.js";
20
+ import { useClientWidth as R } from "./shared/useClientWidth.js";
21
+ import "./components/SliderNavigation/ui/SliderNavigation.js";
22
+ import "./components/LotCardSkeleton/ui/LotCardSkeleton.js";
23
+ import "./components/TabSelect/ui/TabSelect.js";
24
+ import "./components/FormModal/ui/ModalForm.js";
25
+ const A = "_root_nwvsv_1", z = "_text_nwvsv_18", $ = "_rootCol_nwvsv_26", q = "_item_nwvsv_32", H = "_whiteRow_nwvsv_51", P = "_firstItem_nwvsv_62", V = "_lastItem_nwvsv_66", F = "_apart_nwvsv_97", G = "_isLong_nwvsv_97", J = "_autoWidth_nwvsv_122", K = "_mini_nwvsv_126", Q = "_isDisabled_nwvsv_137", U = "_grayRow_nwvsv_161", e = {
26
+ root: A,
27
+ text: z,
28
+ rootCol: $,
29
+ item: q,
30
+ whiteRow: H,
31
+ firstItem: P,
32
+ lastItem: V,
33
+ apart: F,
34
+ isLong: G,
35
+ autoWidth: J,
36
+ mini: K,
37
+ isDisabled: Q,
38
+ grayRow: U
39
+ }, w = L.bind(e), X = ({
40
+ children: i,
41
+ variant: l = "whiteRow",
42
+ isApart: c = !1,
43
+ addClassName: m = "",
44
+ col: n = !1
45
+ }) => /* @__PURE__ */ s("div", { className: w(e.root, e[l], m, { [e.rootCol]: n, [e.apart]: c }), children: i }), k = T((i, l) => {
46
+ const { isTablet: c, isDesktop: m } = R(), {
47
+ index: n,
48
+ children: o,
49
+ addItemClassName: u,
50
+ addTextClass: x,
51
+ disabled: h = !1,
52
+ itemsLength: f = 0,
53
+ isLongOn: O = !0,
54
+ width: d,
55
+ width_m: r,
56
+ width_l: a,
57
+ mini: b = !1,
58
+ ...p
59
+ } = i, S = (o != null && o.toString().length ? (o == null ? void 0 : o.toString().length) > 2 : !1) && O, y = (I, _) => I && r ? r : _ && a ? a : d, g = !d && !r && !a && S;
60
+ return /* @__PURE__ */ v("label", { className: w({ [e.isLong]: S }), children: [
61
+ /* @__PURE__ */ s(
62
+ "input",
63
+ {
64
+ ref: l,
65
+ type: "checkbox",
66
+ ...p,
67
+ disabled: h
68
+ }
69
+ ),
70
+ /* @__PURE__ */ s(
71
+ "div",
72
+ {
73
+ style: { width: y(c, m) },
74
+ className: w(
75
+ w(
76
+ e.item,
77
+ { [e.firstItem]: n === 0 },
78
+ { [e.lastItem]: n === f - 1 },
79
+ { [e.isDisabled]: h },
80
+ { [e.autoWidth]: g },
81
+ { [e.mini]: b }
82
+ ),
83
+ u
84
+ ),
85
+ children: /* @__PURE__ */ s(W, { className: w(e.text, x), children: o })
86
+ }
87
+ )
88
+ ] });
89
+ });
90
+ k.displayName = "TabSwitcherItem";
91
+ const Nt = Object.assign(X, { Item: k }), N = L.bind(t), Y = ({
92
+ options: i,
93
+ selectedOption: l,
94
+ placeholder: c = "",
95
+ error: m,
96
+ disabled: n,
97
+ additionalClass: o = "",
98
+ onChange: u,
99
+ onBlur: x,
100
+ mini: h,
101
+ openOnTop: f = !1,
102
+ onClickItem: O,
103
+ onCLickSelect: d
104
+ }) => {
105
+ const [r, a] = D(!1), b = M(null), { isMobile: p } = R(), { handleBlur: S, getInputValue: y, getOption: g, handleDocumentClick: I } = j(
106
+ {
107
+ selectedOption: l,
108
+ onClickOption: O,
109
+ setSelectedOption: u,
110
+ setIsOpen: a,
111
+ containerRef: b,
112
+ isOpen: r,
113
+ isMobile: p,
114
+ placeholder: c,
115
+ onChange: u,
116
+ onBlur: x
117
+ }
118
+ );
119
+ return B(() => (document.addEventListener("click", I), () => {
120
+ document.removeEventListener("click", I);
121
+ }), []), /* @__PURE__ */ v(
122
+ "div",
123
+ {
124
+ ref: b,
125
+ className: N(
126
+ t.sortSelectWrapper,
127
+ { [t.sortSelectWrapperError]: m },
128
+ { [t.sortSelectWrapperTop]: f },
129
+ o
130
+ ),
131
+ tabIndex: 0,
132
+ onBlur: S,
133
+ onClick: () => {
134
+ d && d();
135
+ },
136
+ children: [
137
+ /* @__PURE__ */ v("div", { className: N(t.inputWrapper), children: [
138
+ /* @__PURE__ */ s(
139
+ "input",
140
+ {
141
+ type: "text",
142
+ readOnly: !0,
143
+ value: y(),
144
+ className: N(
145
+ t.selectedOptions,
146
+ { [t.selectOptionsDisabled]: n },
147
+ { [t.selectionOptionMini]: h }
148
+ ),
149
+ onClick: () => a(!r)
150
+ }
151
+ ),
152
+ /* @__PURE__ */ s(
153
+ C,
154
+ {
155
+ name: "twoArrows",
156
+ size: "24",
157
+ additionalClass: t.icon
158
+ }
159
+ )
160
+ ] }),
161
+ r && p && /* @__PURE__ */ v(
162
+ E,
163
+ {
164
+ isOpen: r,
165
+ emitIsOpen: a,
166
+ additionalClassModalBody: t.modalAddBody,
167
+ additionalClass: t.selectModal,
168
+ createPortalObj: { domNode: document.querySelector("body") },
169
+ isTransparentBack: !0,
170
+ children: [
171
+ /* @__PURE__ */ v("div", { className: t.mobileSortHeader, children: [
172
+ /* @__PURE__ */ s(W, { children: "Сортировка" }),
173
+ /* @__PURE__ */ s("div", { onClick: () => a(!1), children: /* @__PURE__ */ s(
174
+ C,
175
+ {
176
+ name: "close",
177
+ size: "20"
178
+ }
179
+ ) })
180
+ ] }),
181
+ /* @__PURE__ */ s("div", { className: t.mobileOptionList, children: i == null ? void 0 : i.map((_) => g(_)) })
182
+ ]
183
+ }
184
+ ),
185
+ r && !p && /* @__PURE__ */ s("div", { className: N(t.optionsList, { [t.optionListOnTop]: f }), children: i == null ? void 0 : i.map((_) => g(_)) })
186
+ ]
187
+ }
188
+ );
189
+ };
190
+ Y.displayName = "SortSelect";
191
+ export {
192
+ Nt as S,
193
+ Y as a
194
+ };
@@ -0,0 +1,14 @@
1
+ import { TOption } from '../Select/ui/Select.types';
2
+
3
+ interface IFilterWithSave {
4
+ selectOptions?: TOption[];
5
+ disabledOptions?: TOption[];
6
+ selectedValues?: TOption[];
7
+ tabs?: {
8
+ value: string;
9
+ state: boolean;
10
+ }[];
11
+ onChange?: (selectedOptions: TOption[]) => unknown;
12
+ }
13
+ export declare const FilterWithSave: ({ disabledOptions, tabs, selectOptions, onChange, selectedValues, }: IFilterWithSave) => import("react/jsx-runtime").JSX.Element;
14
+ export {};
@@ -0,0 +1,145 @@
1
+ import { jsxs as m, Fragment as k, jsx as t } from "react/jsx-runtime";
2
+ import { useState as p } from "react";
3
+ import { NewIcon as f } from "../NewIcon/ui/NewIcon.js";
4
+ import { M } from "../../Modal-BZv6nlLe.js";
5
+ import { S as u } from "../../SortSelect-Bw2LP_j1.js";
6
+ import { O as b } from "../../Option-CyYM1iBJ.js";
7
+ import { Button as W } from "../Button/ui/Button.js";
8
+ const g = "_root_18z0m_1", y = "_filterWithSaveModal_18z0m_11", T = "_modalAddBody_18z0m_16", w = "_closeBtn_18z0m_25", A = "_modalTitle_18z0m_31", I = "_tabSWitcherWrapper_18z0m_40", x = "_tabs_18z0m_45", j = "_selectWrapper_18z0m_50", F = "_filterOption_18z0m_54", L = "_btnWrapper_18z0m_61", R = "_resetBtn_18z0m_67", q = "_saveBtn_18z0m_68", e = {
9
+ root: g,
10
+ filterWithSaveModal: y,
11
+ modalAddBody: T,
12
+ closeBtn: w,
13
+ modalTitle: A,
14
+ tabSWitcherWrapper: I,
15
+ tabs: x,
16
+ selectWrapper: j,
17
+ filterOption: F,
18
+ btnWrapper: L,
19
+ resetBtn: R,
20
+ saveBtn: q
21
+ }, Q = ({
22
+ disabledOptions: B = [],
23
+ tabs: r = [],
24
+ selectOptions: i = [],
25
+ onChange: S,
26
+ selectedValues: z = []
27
+ }) => {
28
+ const [C, d] = p(!1), [O, _] = p(r), [s, h] = p(z);
29
+ console.log(S);
30
+ const N = (a) => {
31
+ if (B.some((l) => l.value === a.value))
32
+ return;
33
+ const n = s.some((l) => l.value === a.value) ? s.filter((l) => l.value !== a.value) : [...s, a];
34
+ h(n);
35
+ };
36
+ return /* @__PURE__ */ m(k, { children: [
37
+ /* @__PURE__ */ t(
38
+ "div",
39
+ {
40
+ className: e.root,
41
+ onClick: () => d((a) => !a),
42
+ children: /* @__PURE__ */ t(
43
+ f,
44
+ {
45
+ name: "filter",
46
+ size: "16"
47
+ }
48
+ )
49
+ }
50
+ ),
51
+ /* @__PURE__ */ m(
52
+ M,
53
+ {
54
+ isOpen: C,
55
+ emitIsOpen: d,
56
+ isTransparentBack: !0,
57
+ additionalClassModalBody: e.modalAddBody,
58
+ additionalClass: e.filterWithSaveModal,
59
+ children: [
60
+ /* @__PURE__ */ t(
61
+ "div",
62
+ {
63
+ className: e.closeBtn,
64
+ onClick: () => d(!1),
65
+ children: /* @__PURE__ */ t(
66
+ f,
67
+ {
68
+ name: "close",
69
+ size: "24"
70
+ }
71
+ )
72
+ }
73
+ ),
74
+ /* @__PURE__ */ t("div", { className: e.modalTitle, children: "Фильтры" }),
75
+ /* @__PURE__ */ t("div", { className: e.tabSWitcherWrapper, children: /* @__PURE__ */ t(
76
+ u,
77
+ {
78
+ variant: "grayRow",
79
+ addClassName: e.tabs,
80
+ isApart: !0,
81
+ children: r == null ? void 0 : r.map((a, n) => {
82
+ var v;
83
+ const l = a.value;
84
+ return /* @__PURE__ */ t(
85
+ u.Item,
86
+ {
87
+ itemsLength: r == null ? void 0 : r.length,
88
+ mini: !0,
89
+ value: l,
90
+ onClick: () => {
91
+ },
92
+ checked: ((v = O.find((c) => c.value === l)) == null ? void 0 : v.state) ?? !1,
93
+ onChange: () => _((c) => c.map((o) => o.value === l ? { ...o, state: !o.state } : o)),
94
+ index: n,
95
+ addItemClassName: e.tabSwitcher,
96
+ children: l
97
+ },
98
+ n
99
+ );
100
+ })
101
+ }
102
+ ) }),
103
+ /* @__PURE__ */ t("div", { className: e.selectWrapper, children: i == null ? void 0 : i.map((a, n) => /* @__PURE__ */ t(
104
+ b,
105
+ {
106
+ addClassName: e.filterOption,
107
+ disabledOptions: [],
108
+ clickableOptions: [],
109
+ selectedOptions: s,
110
+ option: a,
111
+ handleOptionClick: N
112
+ },
113
+ n
114
+ )) }),
115
+ /* @__PURE__ */ m("div", { className: e.btnWrapper, children: [
116
+ /* @__PURE__ */ t(
117
+ W,
118
+ {
119
+ as: "button",
120
+ variant: "gray",
121
+ additionalClass: e.resetBtn,
122
+ onClick: () => {
123
+ _(r), h([]);
124
+ },
125
+ children: "Сбросить"
126
+ }
127
+ ),
128
+ /* @__PURE__ */ t(
129
+ W,
130
+ {
131
+ as: "button",
132
+ additionalClass: e.saveBtn,
133
+ onClick: () => null,
134
+ children: "Сохранить"
135
+ }
136
+ )
137
+ ] })
138
+ ]
139
+ }
140
+ )
141
+ ] });
142
+ };
143
+ export {
144
+ Q as FilterWithSave
145
+ };