stone-kit 0.0.617 → 0.0.618

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,548 @@
1
+ import { jsxs as u, jsx as e, Fragment as P } from "react/jsx-runtime";
2
+ import { NewIcon as A } from "./components/NewIcon/ui/NewIcon.js";
3
+ import { M as J } from "./Modal-BZv6nlLe.js";
4
+ import { forwardRef as Q, useState as R, useRef as q, useEffect as z } from "react";
5
+ import { Text as H } from "./components/Text/ui/Text.js";
6
+ import { c as V, g as U } from "./index-rKuIKazb.js";
7
+ import { Button as E } from "./components/Button/ui/Button.js";
8
+ import "./components/mobileButton/ui/MobileButton.js";
9
+ import "./components/DestinationTab/ui/DestinationTab.js";
10
+ import "./components/RoundButton/ui/RoundButton.js";
11
+ import "./components/Tag/ui/Tag.js";
12
+ import "./components/Switcher/ui/Switcher.js";
13
+ import "./components/Flex/ui/Flex.js";
14
+ import "./components/Input/ui/Input.js";
15
+ import "./components/GroupedInput/ui/GroupedInputs.js";
16
+ import "./components/MetroTag/ui/MetroTag.js";
17
+ import "./components/LotCard/ui/LotCard.js";
18
+ import "./components/Select/ui/Select.js";
19
+ import { useClientWidth as F } from "./shared/useClientWidth.js";
20
+ import { s as d, u as X } from "./useSortSelect-CjZXLFOG.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
+ import { O as T } from "./Option-CyYM1iBJ.js";
26
+ const Y = "_root_2bilg_1", Z = "_text_2bilg_18", tt = "_textMini_2bilg_26", et = "_rootCol_2bilg_32", it = "_item_2bilg_38", rt = "_whiteRow_2bilg_57", nt = "_firstItem_2bilg_68", st = "_lastItem_2bilg_72", at = "_apart_2bilg_103", ot = "_isLong_2bilg_103", lt = "_autoWidth_2bilg_128", ct = "_mini_2bilg_132", dt = "_isDisabled_2bilg_140", mt = "_grayRow_2bilg_164", _ = {
27
+ root: Y,
28
+ text: Z,
29
+ textMini: tt,
30
+ rootCol: et,
31
+ item: it,
32
+ whiteRow: rt,
33
+ firstItem: nt,
34
+ lastItem: st,
35
+ apart: at,
36
+ isLong: ot,
37
+ autoWidth: lt,
38
+ mini: ct,
39
+ isDisabled: dt,
40
+ grayRow: mt
41
+ }, L = V.bind(_), pt = ({
42
+ children: a,
43
+ variant: n = "whiteRow",
44
+ isApart: o = !1,
45
+ addClassName: C = "",
46
+ col: l = !1
47
+ }) => /* @__PURE__ */ e("div", { className: L(_.root, _[n], C, { [_.rootCol]: l, [_.apart]: o }), children: a }), G = Q((a, n) => {
48
+ const { isTablet: o, isDesktop: C } = F(), {
49
+ index: l,
50
+ children: t,
51
+ addItemClassName: r,
52
+ addTextClass: c,
53
+ disabled: v = !1,
54
+ itemsLength: S = 0,
55
+ isLongOn: b = !0,
56
+ width: m,
57
+ width_m: p,
58
+ width_l: h,
59
+ mini: g = !1,
60
+ ...f
61
+ } = a, w = (t != null && t.toString().length ? (t == null ? void 0 : t.toString().length) > 2 : !1) && b, W = (x, B) => x && p ? p : B && h ? h : m, N = !m && !p && !h && w;
62
+ return /* @__PURE__ */ u("label", { className: L({ [_.isLong]: w }), children: [
63
+ /* @__PURE__ */ e(
64
+ "input",
65
+ {
66
+ ref: n,
67
+ type: "checkbox",
68
+ ...f,
69
+ disabled: v
70
+ }
71
+ ),
72
+ /* @__PURE__ */ e(
73
+ "div",
74
+ {
75
+ style: { width: W(o, C) },
76
+ className: L(
77
+ L(
78
+ _.item,
79
+ { [_.firstItem]: l === 0 },
80
+ { [_.lastItem]: l === S - 1 },
81
+ { [_.isDisabled]: v },
82
+ { [_.autoWidth]: N },
83
+ { [_.mini]: g }
84
+ ),
85
+ r
86
+ ),
87
+ children: /* @__PURE__ */ e(H, { className: L(_.text, { [_.textMini]: g }, c), children: t })
88
+ }
89
+ )
90
+ ] });
91
+ });
92
+ G.displayName = "TabSwitcherItem";
93
+ const j = Object.assign(pt, { Item: G }), $ = V.bind(d), ht = ({
94
+ options: a,
95
+ selectedOption: n,
96
+ placeholder: o = "",
97
+ error: C,
98
+ disabled: l,
99
+ additionalClass: t = "",
100
+ onChange: r,
101
+ onBlur: c,
102
+ mini: v,
103
+ openOnTop: S = !1,
104
+ onClickItem: b,
105
+ onCLickSelect: m
106
+ }) => {
107
+ const [p, h] = R(!1), g = q(null), { isMobile: f } = F(), { handleBlur: w, getInputValue: W, getOption: N, handleDocumentClick: x } = X(
108
+ {
109
+ selectedOption: n,
110
+ onClickOption: b,
111
+ setSelectedOption: r,
112
+ setIsOpen: h,
113
+ containerRef: g,
114
+ isOpen: p,
115
+ isMobile: f,
116
+ placeholder: o,
117
+ onChange: r,
118
+ onBlur: c
119
+ }
120
+ );
121
+ return z(() => (document.addEventListener("click", x), () => {
122
+ document.removeEventListener("click", x);
123
+ }), []), /* @__PURE__ */ u(
124
+ "div",
125
+ {
126
+ ref: g,
127
+ className: $(
128
+ d.sortSelectWrapper,
129
+ { [d.sortSelectWrapperError]: C },
130
+ { [d.sortSelectWrapperTop]: S },
131
+ t
132
+ ),
133
+ tabIndex: 0,
134
+ onBlur: w,
135
+ onClick: () => {
136
+ m && m();
137
+ },
138
+ children: [
139
+ /* @__PURE__ */ u("div", { className: $(d.inputWrapper), children: [
140
+ /* @__PURE__ */ e(
141
+ "input",
142
+ {
143
+ type: "text",
144
+ readOnly: !0,
145
+ value: W(),
146
+ className: $(
147
+ d.selectedOptions,
148
+ { [d.selectOptionsDisabled]: l },
149
+ { [d.selectionOptionMini]: v }
150
+ ),
151
+ onClick: () => h(!p)
152
+ }
153
+ ),
154
+ /* @__PURE__ */ e(
155
+ A,
156
+ {
157
+ name: "twoArrows",
158
+ size: "24",
159
+ additionalClass: d.icon
160
+ }
161
+ )
162
+ ] }),
163
+ p && f && /* @__PURE__ */ u(
164
+ J,
165
+ {
166
+ isOpen: p,
167
+ emitIsOpen: h,
168
+ additionalClassModalBody: d.modalAddBody,
169
+ additionalClass: d.selectModal,
170
+ createPortalObj: { domNode: document.querySelector("body") },
171
+ isTransparentBack: !0,
172
+ children: [
173
+ /* @__PURE__ */ u("div", { className: d.mobileSortHeader, children: [
174
+ /* @__PURE__ */ e(H, { children: "Сортировка" }),
175
+ /* @__PURE__ */ e("div", { onClick: () => h(!1), children: /* @__PURE__ */ e(
176
+ A,
177
+ {
178
+ name: "close",
179
+ size: "20"
180
+ }
181
+ ) })
182
+ ] }),
183
+ /* @__PURE__ */ e("div", { className: d.mobileOptionList, children: a == null ? void 0 : a.map((B) => N(B)) })
184
+ ]
185
+ }
186
+ ),
187
+ p && !f && /* @__PURE__ */ e("div", { className: $(d.optionsList, { [d.optionListOnTop]: S }), children: a == null ? void 0 : a.map((B) => N(B)) })
188
+ ]
189
+ }
190
+ );
191
+ };
192
+ ht.displayName = "SortSelect";
193
+ const ut = "_root_1wv7y_1", _t = "_filterWithSaveModal_1wv7y_15", vt = "_modalAddBody_1wv7y_20", ft = "_closeBtn_1wv7y_29", wt = "_btnName_1wv7y_35", Nt = "_modalTitle_1wv7y_39", yt = "_tabSWitcherWrapper_1wv7y_48", Wt = "_switcherTitle_1wv7y_56", Ct = "_switcherScroll_1wv7y_63", gt = "_tabs_1wv7y_67", Ot = "_selectWrapper_1wv7y_72", kt = "_filterOption_1wv7y_76", St = "_btnWrapper_1wv7y_83", bt = "_resetBtn_1wv7y_89", xt = "_saveBtn_1wv7y_90", Bt = "_desktopWrapper_1wv7y_94", It = "_desktopWrapperOpen_1wv7y_117", i = {
194
+ root: ut,
195
+ filterWithSaveModal: _t,
196
+ modalAddBody: vt,
197
+ closeBtn: ft,
198
+ btnName: wt,
199
+ modalTitle: Nt,
200
+ tabSWitcherWrapper: yt,
201
+ switcherTitle: Wt,
202
+ switcherScroll: Ct,
203
+ tabs: gt,
204
+ selectWrapper: Ot,
205
+ filterOption: kt,
206
+ btnWrapper: St,
207
+ resetBtn: bt,
208
+ saveBtn: xt,
209
+ desktopWrapper: Bt,
210
+ desktopWrapperOpen: It
211
+ };
212
+ var K = { exports: {} };
213
+ /*!
214
+ Copyright (c) 2018 Jed Watson.
215
+ Licensed under the MIT License (MIT), see
216
+ http://jedwatson.github.io/classnames
217
+ */
218
+ (function(a) {
219
+ (function() {
220
+ var n = {}.hasOwnProperty;
221
+ function o() {
222
+ for (var t = "", r = 0; r < arguments.length; r++) {
223
+ var c = arguments[r];
224
+ c && (t = l(t, C.call(this, c)));
225
+ }
226
+ return t;
227
+ }
228
+ function C(t) {
229
+ if (typeof t == "string" || typeof t == "number")
230
+ return this && this[t] || t;
231
+ if (typeof t != "object")
232
+ return "";
233
+ if (Array.isArray(t))
234
+ return o.apply(this, t);
235
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
236
+ return t.toString();
237
+ var r = "";
238
+ for (var c in t)
239
+ n.call(t, c) && t[c] && (r = l(r, this && this[c] || c));
240
+ return r;
241
+ }
242
+ function l(t, r) {
243
+ return r ? t ? t + " " + r : t + r : t;
244
+ }
245
+ a.exports ? (o.default = o, a.exports = o) : window.classNames = o;
246
+ })();
247
+ })(K);
248
+ var Mt = K.exports;
249
+ const Rt = /* @__PURE__ */ U(Mt), Lt = ({
250
+ selectedTabs: a = [],
251
+ selectedValues: n = [],
252
+ onClickItem: o,
253
+ disabledOptions: C = [],
254
+ tabs: l = [],
255
+ onChange: t,
256
+ setSelectedTabs: r
257
+ }) => {
258
+ const { isMobile: c } = F(), [v, S] = R(!1), b = q(null), [m, p] = R(a), [h] = R(n), [g, f] = R(m), [w, W] = R(h), N = (s) => {
259
+ if (o && o(s), C.some((k) => k.value === s.value))
260
+ return;
261
+ const y = w.some((k) => k.value === s.value) ? w.filter((k) => k.value !== s.value) : [...w, s];
262
+ W(y);
263
+ }, x = () => {
264
+ p(l), f(l), W([]), t && (t([]), r == null || r(l));
265
+ }, B = () => {
266
+ W(n), f(a);
267
+ }, D = () => {
268
+ B(), S(!1);
269
+ }, O = (s) => {
270
+ s.stopPropagation(), t && (r == null || r(g), t(w)), S(!1);
271
+ };
272
+ return z(() => {
273
+ v || f((s) => JSON.stringify(s) !== JSON.stringify(a) ? a : s);
274
+ }, [v, a]), z(() => {
275
+ const s = (y) => {
276
+ b.current && (b.current.contains(y.target) || D());
277
+ };
278
+ return v ? document.addEventListener("click", s) : document.removeEventListener("click", s), () => {
279
+ document.removeEventListener("click", s);
280
+ };
281
+ }, [v]), {
282
+ isMobile: c,
283
+ handleClearClick: x,
284
+ handleCloseModal: D,
285
+ handleOptionClick: N,
286
+ handleSaveClick: O,
287
+ localSelectedTabs: g,
288
+ selectedOptions: w,
289
+ setSelectedOptions: W,
290
+ isModalOpen: v,
291
+ setIsModalOpen: S,
292
+ setLocalSelectedTabs: f,
293
+ containerRef: b
294
+ };
295
+ }, At = Rt.bind(i), ae = ({
296
+ disabledOptions: a,
297
+ tabs: n = [],
298
+ selectOptions: o = [],
299
+ onChange: C,
300
+ selectedValues: l,
301
+ setSelectedTabs: t,
302
+ selectedTabs: r,
303
+ onClickItem: c,
304
+ onCLickSelect: v,
305
+ btnName: S = "Фильтр"
306
+ }) => {
307
+ const {
308
+ handleCloseModal: b,
309
+ localSelectedTabs: m,
310
+ selectedOptions: p,
311
+ isMobile: h,
312
+ handleOptionClick: g,
313
+ handleClearClick: f,
314
+ handleSaveClick: w,
315
+ isModalOpen: W,
316
+ setLocalSelectedTabs: N,
317
+ setIsModalOpen: x,
318
+ containerRef: B
319
+ } = Lt({
320
+ selectedTabs: r,
321
+ onClickItem: c,
322
+ setSelectedTabs: t,
323
+ tabs: n,
324
+ onChange: C,
325
+ disabledOptions: a,
326
+ selectedValues: l
327
+ }), D = () => /* @__PURE__ */ u(P, { children: [
328
+ /* @__PURE__ */ e(
329
+ "div",
330
+ {
331
+ className: i.closeBtn,
332
+ onClick: () => {
333
+ b();
334
+ },
335
+ children: /* @__PURE__ */ e(
336
+ A,
337
+ {
338
+ name: "close",
339
+ size: "24"
340
+ }
341
+ )
342
+ }
343
+ ),
344
+ /* @__PURE__ */ e("div", { className: i.modalTitle, children: "Фильтры" }),
345
+ /* @__PURE__ */ u("div", { className: i.tabSWitcherWrapper, children: [
346
+ /* @__PURE__ */ e("div", { className: i.switcherTitle, children: "Готовность" }),
347
+ /* @__PURE__ */ e("div", { className: i.switcherScroll, children: /* @__PURE__ */ e(
348
+ j,
349
+ {
350
+ variant: "grayRow",
351
+ addClassName: i.tabs,
352
+ isApart: !0,
353
+ children: n == null ? void 0 : n.map((O, s) => {
354
+ var k;
355
+ const y = O.value;
356
+ return /* @__PURE__ */ e(
357
+ j.Item,
358
+ {
359
+ itemsLength: n == null ? void 0 : n.length,
360
+ mini: !0,
361
+ value: y,
362
+ onClick: () => {
363
+ },
364
+ checked: ((k = m == null ? void 0 : m.find((M) => M.value === y)) == null ? void 0 : k.state) ?? !1,
365
+ onChange: () => {
366
+ N == null || N(
367
+ (M) => M.map((I) => I.value === y ? { ...I, state: !I.state } : I)
368
+ );
369
+ },
370
+ index: s,
371
+ addItemClassName: i.tabSwitcher,
372
+ children: y
373
+ },
374
+ s
375
+ );
376
+ })
377
+ }
378
+ ) })
379
+ ] }),
380
+ /* @__PURE__ */ e("div", { className: i.selectWrapper, children: o == null ? void 0 : o.map((O, s) => /* @__PURE__ */ e(
381
+ T,
382
+ {
383
+ addClassName: i.filterOption,
384
+ disabledOptions: [],
385
+ clickableOptions: [],
386
+ selectedOptions: p,
387
+ option: O,
388
+ handleOptionClick: g
389
+ },
390
+ s
391
+ )) }),
392
+ /* @__PURE__ */ u("div", { className: i.btnWrapper, children: [
393
+ /* @__PURE__ */ e(
394
+ E,
395
+ {
396
+ as: "button",
397
+ variant: "gray",
398
+ additionalClass: i.resetBtn,
399
+ onClick: f,
400
+ children: "Сбросить"
401
+ }
402
+ ),
403
+ /* @__PURE__ */ e(
404
+ E,
405
+ {
406
+ as: "button",
407
+ additionalClass: i.saveBtn,
408
+ onClick: w,
409
+ children: "Сохранить"
410
+ }
411
+ )
412
+ ] })
413
+ ] });
414
+ return /* @__PURE__ */ u(P, { children: [
415
+ /* @__PURE__ */ u("div", { style: { position: "relative" }, children: [
416
+ /* @__PURE__ */ u(
417
+ "div",
418
+ {
419
+ className: i.root,
420
+ onClick: () => {
421
+ v && v(), h ? x((O) => !O) : W || x(!0);
422
+ },
423
+ children: [
424
+ /* @__PURE__ */ e("div", { className: i.btnName, children: S }),
425
+ /* @__PURE__ */ e(
426
+ A,
427
+ {
428
+ name: "filter",
429
+ size: "16"
430
+ }
431
+ )
432
+ ]
433
+ }
434
+ ),
435
+ !h && /* @__PURE__ */ u(
436
+ "div",
437
+ {
438
+ ref: B,
439
+ className: At(i.desktopWrapper, { [i.desktopWrapperOpen]: W }),
440
+ children: [
441
+ /* @__PURE__ */ e(
442
+ "div",
443
+ {
444
+ className: i.closeBtn,
445
+ onClick: () => {
446
+ b();
447
+ },
448
+ children: /* @__PURE__ */ e(
449
+ A,
450
+ {
451
+ name: "close",
452
+ size: "24"
453
+ }
454
+ )
455
+ }
456
+ ),
457
+ /* @__PURE__ */ e("div", { className: i.modalTitle, children: "Фильтры" }),
458
+ /* @__PURE__ */ u("div", { className: i.tabSWitcherWrapper, children: [
459
+ /* @__PURE__ */ e("div", { className: i.switcherTitle, children: "Готовность" }),
460
+ /* @__PURE__ */ e("div", { className: i.switcherScroll, children: /* @__PURE__ */ e(
461
+ j,
462
+ {
463
+ variant: "grayRow",
464
+ addClassName: i.tabs,
465
+ isApart: !0,
466
+ children: n == null ? void 0 : n.map((O, s) => {
467
+ var k;
468
+ const y = O.value;
469
+ return /* @__PURE__ */ e(
470
+ j.Item,
471
+ {
472
+ itemsLength: n == null ? void 0 : n.length,
473
+ mini: !0,
474
+ value: y,
475
+ onClick: () => {
476
+ },
477
+ checked: ((k = m == null ? void 0 : m.find((M) => M.value === y)) == null ? void 0 : k.state) ?? !1,
478
+ onChange: () => {
479
+ N == null || N(
480
+ (M) => M.map((I) => I.value === y ? { ...I, state: !I.state } : I)
481
+ );
482
+ },
483
+ index: s,
484
+ addItemClassName: i.tabSwitcher,
485
+ children: y
486
+ },
487
+ s
488
+ );
489
+ })
490
+ }
491
+ ) })
492
+ ] }),
493
+ /* @__PURE__ */ e("div", { className: i.selectWrapper, children: o == null ? void 0 : o.map((O, s) => /* @__PURE__ */ e(
494
+ T,
495
+ {
496
+ addClassName: i.filterOption,
497
+ disabledOptions: [],
498
+ clickableOptions: [],
499
+ selectedOptions: p,
500
+ option: O,
501
+ handleOptionClick: g
502
+ },
503
+ s
504
+ )) }),
505
+ /* @__PURE__ */ u("div", { className: i.btnWrapper, children: [
506
+ /* @__PURE__ */ e(
507
+ E,
508
+ {
509
+ as: "button",
510
+ variant: "gray",
511
+ additionalClass: i.resetBtn,
512
+ onClick: f,
513
+ children: "Сбросить"
514
+ }
515
+ ),
516
+ /* @__PURE__ */ e(
517
+ E,
518
+ {
519
+ as: "button",
520
+ additionalClass: i.saveBtn,
521
+ onClick: w,
522
+ children: "Сохранить"
523
+ }
524
+ )
525
+ ] })
526
+ ]
527
+ }
528
+ )
529
+ ] }),
530
+ h && /* @__PURE__ */ e(
531
+ J,
532
+ {
533
+ isOpen: W,
534
+ emitIsOpen: x,
535
+ isTransparentBack: !0,
536
+ additionalClassModalBody: i.modalAddBody,
537
+ additionalClass: i.filterWithSaveModal,
538
+ children: /* @__PURE__ */ e(D, {})
539
+ }
540
+ )
541
+ ] });
542
+ };
543
+ export {
544
+ ae as F,
545
+ j as S,
546
+ ht as a,
547
+ Lt as u
548
+ };
@@ -0,0 +1,42 @@
1
+ import { TOption } from '../../Select/ui/Select.types';
2
+
3
+ interface IuseFilterWithSave {
4
+ selectOptions?: TOption[];
5
+ disabledOptions?: TOption[];
6
+ selectedValues?: TOption[];
7
+ tabs?: {
8
+ value: string;
9
+ state: boolean;
10
+ }[];
11
+ selectedTabs?: {
12
+ value: string;
13
+ state: boolean;
14
+ }[];
15
+ setSelectedTabs?: React.Dispatch<React.SetStateAction<{
16
+ value: string;
17
+ state: boolean;
18
+ }[]>>;
19
+ onChange?: (selectedOptions: TOption[]) => unknown;
20
+ onClickItem?: (option: TOption | TOption[]) => void;
21
+ }
22
+ export declare const useFilterWithSave: ({ selectedTabs, selectedValues, onClickItem, disabledOptions, tabs, onChange, setSelectedTabs, }: IuseFilterWithSave) => {
23
+ isMobile: boolean;
24
+ handleClearClick: () => void;
25
+ handleCloseModal: () => void;
26
+ handleOptionClick: (option: TOption) => void;
27
+ handleSaveClick: import('react').MouseEventHandler<HTMLButtonElement>;
28
+ localSelectedTabs: {
29
+ value: string;
30
+ state: boolean;
31
+ }[];
32
+ selectedOptions: TOption[];
33
+ setSelectedOptions: import('react').Dispatch<import('react').SetStateAction<TOption[]>>;
34
+ isModalOpen: boolean;
35
+ setIsModalOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
36
+ setLocalSelectedTabs: import('react').Dispatch<import('react').SetStateAction<{
37
+ value: string;
38
+ state: boolean;
39
+ }[]>>;
40
+ containerRef: import('react').MutableRefObject<HTMLDivElement | null>;
41
+ };
42
+ export {};
@@ -0,0 +1,27 @@
1
+ import "react";
2
+ import "../../Button/ui/Button.js";
3
+ import "../../mobileButton/ui/MobileButton.js";
4
+ import "../../NewIcon/ui/NewIcon.js";
5
+ import "../../DestinationTab/ui/DestinationTab.js";
6
+ import "../../RoundButton/ui/RoundButton.js";
7
+ import "../../Tag/ui/Tag.js";
8
+ import "../../Switcher/ui/Switcher.js";
9
+ import "../../Text/ui/Text.js";
10
+ import "../../Flex/ui/Flex.js";
11
+ import "../../Input/ui/Input.js";
12
+ import "react/jsx-runtime";
13
+ import "../../../Modal-BZv6nlLe.js";
14
+ import { u as q } from "../../../FilterWithSave-BZpDGJy2.js";
15
+ import "../../GroupedInput/ui/GroupedInputs.js";
16
+ import "../../../index-rKuIKazb.js";
17
+ import "../../MetroTag/ui/MetroTag.js";
18
+ import "../../LotCard/ui/LotCard.js";
19
+ import "../../Select/ui/Select.js";
20
+ import "../../../shared/useClientWidth.js";
21
+ import "../../SliderNavigation/ui/SliderNavigation.js";
22
+ import "../../LotCardSkeleton/ui/LotCardSkeleton.js";
23
+ import "../../TabSelect/ui/TabSelect.js";
24
+ import "../../FormModal/ui/ModalForm.js";
25
+ export {
26
+ q as useFilterWithSave
27
+ };
@@ -1,28 +1,9 @@
1
1
  import "react/jsx-runtime";
2
- import "react";
3
2
  import "../../NewIcon/ui/NewIcon.js";
4
- import { F as w } from "../../../FilterWithSave-XwXzp2ZI.js";
3
+ import { F as a } from "../../../FilterWithSave-BZpDGJy2.js";
5
4
  import "../../../Modal-BZv6nlLe.js";
6
5
  import "../../../Option-CyYM1iBJ.js";
7
6
  import "../../Button/ui/Button.js";
8
- import "../../mobileButton/ui/MobileButton.js";
9
- import "../../DestinationTab/ui/DestinationTab.js";
10
- import "../../RoundButton/ui/RoundButton.js";
11
- import "../../Tag/ui/Tag.js";
12
- import "../../Switcher/ui/Switcher.js";
13
- import "../../Text/ui/Text.js";
14
- import "../../Flex/ui/Flex.js";
15
- import "../../Input/ui/Input.js";
16
- import "../../GroupedInput/ui/GroupedInputs.js";
17
- import "../../../index-rKuIKazb.js";
18
- import "../../MetroTag/ui/MetroTag.js";
19
- import "../../LotCard/ui/LotCard.js";
20
- import "../../Select/ui/Select.js";
21
- import "../../../shared/useClientWidth.js";
22
- import "../../SliderNavigation/ui/SliderNavigation.js";
23
- import "../../LotCardSkeleton/ui/LotCardSkeleton.js";
24
- import "../../TabSelect/ui/TabSelect.js";
25
- import "../../FormModal/ui/ModalForm.js";
26
7
  export {
27
- w as FilterWithSave
8
+ a as FilterWithSave
28
9
  };
@@ -1,4 +1,4 @@
1
- import { a as r } from "../../FilterWithSave-XwXzp2ZI.js";
1
+ import { a as r } from "../../FilterWithSave-BZpDGJy2.js";
2
2
  export {
3
3
  r as SortSelect
4
4
  };
@@ -13,7 +13,7 @@ import "../../Text/ui/Text.js";
13
13
  import "../../Flex/ui/Flex.js";
14
14
  import "../../Input/ui/Input.js";
15
15
  import "../../../Modal-BZv6nlLe.js";
16
- import { a as z } from "../../../FilterWithSave-XwXzp2ZI.js";
16
+ import { a as z } from "../../../FilterWithSave-BZpDGJy2.js";
17
17
  import "../../GroupedInput/ui/GroupedInputs.js";
18
18
  import "../../MetroTag/ui/MetroTag.js";
19
19
  import "../../LotCard/ui/LotCard.js";
@@ -1,4 +1,4 @@
1
- import { S as e } from "../../FilterWithSave-XwXzp2ZI.js";
1
+ import { S as e } from "../../FilterWithSave-BZpDGJy2.js";
2
2
  export {
3
3
  e as TabSwitcher
4
4
  };
@@ -1,6 +1,6 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
- import { S as v } from "../../../FilterWithSave-XwXzp2ZI.js";
3
+ import { S as v } from "../../../FilterWithSave-BZpDGJy2.js";
4
4
  import "../../Text/ui/Text.js";
5
5
  import "../../../index-rKuIKazb.js";
6
6
  import "../../Button/ui/Button.js";
@@ -11,7 +11,7 @@ import "../../Flex/ui/Flex.js";
11
11
  import "../../Input/ui/Input.js";
12
12
  import "react";
13
13
  import "../../../Modal-BZv6nlLe.js";
14
- import "../../../FilterWithSave-XwXzp2ZI.js";
14
+ import "../../../FilterWithSave-BZpDGJy2.js";
15
15
  import "../../GroupedInput/ui/GroupedInputs.js";
16
16
  import "../../../index-rKuIKazb.js";
17
17
  import "../../MetroTag/ui/MetroTag.js";
package/dist/main.js CHANGED
@@ -10,7 +10,7 @@ import { Flex as T } from "./components/Flex/ui/Flex.js";
10
10
  import { Input as F } from "./components/Input/ui/Input.js";
11
11
  import { M as g } from "./Modal-BZv6nlLe.js";
12
12
  import { FieldInput as I } from "./components/FieldInput/ui/FieldInput.js";
13
- import { F as B, a as L, S as k } from "./FilterWithSave-XwXzp2ZI.js";
13
+ import { F as B, a as L, S as k } from "./FilterWithSave-BZpDGJy2.js";
14
14
  import { GroupedInputs as N } from "./components/GroupedInput/ui/GroupedInputs.js";
15
15
  import { Logo as j } from "./components/Logo/ui/Logo.js";
16
16
  import { MetroTag as D } from "./components/MetroTag/ui/MetroTag.js";
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.617",
5
+ "version": "0.0.618",
6
6
  "author": "Mollycodd1e",
7
7
  "license": "ISC",
8
8
  "type": "module",
@@ -1,419 +0,0 @@
1
- import { jsxs as v, jsx as e, Fragment as F } from "react/jsx-runtime";
2
- import { forwardRef as Z, useState as B, useRef as J, useEffect as D } from "react";
3
- import { NewIcon as R } from "./components/NewIcon/ui/NewIcon.js";
4
- import { M as q } from "./Modal-BZv6nlLe.js";
5
- import { Text as H } from "./components/Text/ui/Text.js";
6
- import { c as V, g as tt } from "./index-rKuIKazb.js";
7
- import { Button as P } from "./components/Button/ui/Button.js";
8
- import "./components/mobileButton/ui/MobileButton.js";
9
- import "./components/DestinationTab/ui/DestinationTab.js";
10
- import "./components/RoundButton/ui/RoundButton.js";
11
- import "./components/Tag/ui/Tag.js";
12
- import "./components/Switcher/ui/Switcher.js";
13
- import "./components/Flex/ui/Flex.js";
14
- import "./components/Input/ui/Input.js";
15
- import "./components/GroupedInput/ui/GroupedInputs.js";
16
- import "./components/MetroTag/ui/MetroTag.js";
17
- import "./components/LotCard/ui/LotCard.js";
18
- import "./components/Select/ui/Select.js";
19
- import { useClientWidth as E } from "./shared/useClientWidth.js";
20
- import { s as c, u as et } from "./useSortSelect-CjZXLFOG.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
- import { O as it } from "./Option-CyYM1iBJ.js";
26
- const rt = "_root_2bilg_1", nt = "_text_2bilg_18", st = "_textMini_2bilg_26", ot = "_rootCol_2bilg_32", at = "_item_2bilg_38", lt = "_whiteRow_2bilg_57", ct = "_firstItem_2bilg_68", dt = "_lastItem_2bilg_72", pt = "_apart_2bilg_103", mt = "_isLong_2bilg_103", _t = "_autoWidth_2bilg_128", ut = "_mini_2bilg_132", ht = "_isDisabled_2bilg_140", ft = "_grayRow_2bilg_164", p = {
27
- root: rt,
28
- text: nt,
29
- textMini: st,
30
- rootCol: ot,
31
- item: at,
32
- whiteRow: lt,
33
- firstItem: ct,
34
- lastItem: dt,
35
- apart: pt,
36
- isLong: mt,
37
- autoWidth: _t,
38
- mini: ut,
39
- isDisabled: ht,
40
- grayRow: ft
41
- }, I = V.bind(p), vt = ({
42
- children: o,
43
- variant: s = "whiteRow",
44
- isApart: a = !1,
45
- addClassName: _ = "",
46
- col: u = !1
47
- }) => /* @__PURE__ */ e("div", { className: I(p.root, p[s], _, { [p.rootCol]: u, [p.apart]: a }), children: o }), G = Z((o, s) => {
48
- const { isTablet: a, isDesktop: _ } = E(), {
49
- index: u,
50
- children: t,
51
- addItemClassName: i,
52
- addTextClass: d,
53
- disabled: g = !1,
54
- itemsLength: C = 0,
55
- isLongOn: O = !0,
56
- width: m,
57
- width_m: l,
58
- width_l: h,
59
- mini: S = !1,
60
- ...k
61
- } = o, x = (t != null && t.toString().length ? (t == null ? void 0 : t.toString().length) > 2 : !1) && O, N = (w, W) => w && l ? l : W && h ? h : m, f = !m && !l && !h && x;
62
- return /* @__PURE__ */ v("label", { className: I({ [p.isLong]: x }), children: [
63
- /* @__PURE__ */ e(
64
- "input",
65
- {
66
- ref: s,
67
- type: "checkbox",
68
- ...k,
69
- disabled: g
70
- }
71
- ),
72
- /* @__PURE__ */ e(
73
- "div",
74
- {
75
- style: { width: N(a, _) },
76
- className: I(
77
- I(
78
- p.item,
79
- { [p.firstItem]: u === 0 },
80
- { [p.lastItem]: u === C - 1 },
81
- { [p.isDisabled]: g },
82
- { [p.autoWidth]: f },
83
- { [p.mini]: S }
84
- ),
85
- i
86
- ),
87
- children: /* @__PURE__ */ e(H, { className: I(p.text, { [p.textMini]: S }, d), children: t })
88
- }
89
- )
90
- ] });
91
- });
92
- G.displayName = "TabSwitcherItem";
93
- const T = Object.assign(vt, { Item: G }), L = V.bind(c), wt = ({
94
- options: o,
95
- selectedOption: s,
96
- placeholder: a = "",
97
- error: _,
98
- disabled: u,
99
- additionalClass: t = "",
100
- onChange: i,
101
- onBlur: d,
102
- mini: g,
103
- openOnTop: C = !1,
104
- onClickItem: O,
105
- onCLickSelect: m
106
- }) => {
107
- const [l, h] = B(!1), S = J(null), { isMobile: k } = E(), { handleBlur: x, getInputValue: N, getOption: f, handleDocumentClick: w } = et(
108
- {
109
- selectedOption: s,
110
- onClickOption: O,
111
- setSelectedOption: i,
112
- setIsOpen: h,
113
- containerRef: S,
114
- isOpen: l,
115
- isMobile: k,
116
- placeholder: a,
117
- onChange: i,
118
- onBlur: d
119
- }
120
- );
121
- return D(() => (document.addEventListener("click", w), () => {
122
- document.removeEventListener("click", w);
123
- }), []), /* @__PURE__ */ v(
124
- "div",
125
- {
126
- ref: S,
127
- className: L(
128
- c.sortSelectWrapper,
129
- { [c.sortSelectWrapperError]: _ },
130
- { [c.sortSelectWrapperTop]: C },
131
- t
132
- ),
133
- tabIndex: 0,
134
- onBlur: x,
135
- onClick: () => {
136
- m && m();
137
- },
138
- children: [
139
- /* @__PURE__ */ v("div", { className: L(c.inputWrapper), children: [
140
- /* @__PURE__ */ e(
141
- "input",
142
- {
143
- type: "text",
144
- readOnly: !0,
145
- value: N(),
146
- className: L(
147
- c.selectedOptions,
148
- { [c.selectOptionsDisabled]: u },
149
- { [c.selectionOptionMini]: g }
150
- ),
151
- onClick: () => h(!l)
152
- }
153
- ),
154
- /* @__PURE__ */ e(
155
- R,
156
- {
157
- name: "twoArrows",
158
- size: "24",
159
- additionalClass: c.icon
160
- }
161
- )
162
- ] }),
163
- l && k && /* @__PURE__ */ v(
164
- q,
165
- {
166
- isOpen: l,
167
- emitIsOpen: h,
168
- additionalClassModalBody: c.modalAddBody,
169
- additionalClass: c.selectModal,
170
- createPortalObj: { domNode: document.querySelector("body") },
171
- isTransparentBack: !0,
172
- children: [
173
- /* @__PURE__ */ v("div", { className: c.mobileSortHeader, children: [
174
- /* @__PURE__ */ e(H, { children: "Сортировка" }),
175
- /* @__PURE__ */ e("div", { onClick: () => h(!1), children: /* @__PURE__ */ e(
176
- R,
177
- {
178
- name: "close",
179
- size: "20"
180
- }
181
- ) })
182
- ] }),
183
- /* @__PURE__ */ e("div", { className: c.mobileOptionList, children: o == null ? void 0 : o.map((W) => f(W)) })
184
- ]
185
- }
186
- ),
187
- l && !k && /* @__PURE__ */ e("div", { className: L(c.optionsList, { [c.optionListOnTop]: C }), children: o == null ? void 0 : o.map((W) => f(W)) })
188
- ]
189
- }
190
- );
191
- };
192
- wt.displayName = "SortSelect";
193
- const yt = "_root_1wv7y_1", Wt = "_filterWithSaveModal_1wv7y_15", Nt = "_modalAddBody_1wv7y_20", bt = "_closeBtn_1wv7y_29", gt = "_btnName_1wv7y_35", Ot = "_modalTitle_1wv7y_39", St = "_tabSWitcherWrapper_1wv7y_48", kt = "_switcherTitle_1wv7y_56", Ct = "_switcherScroll_1wv7y_63", xt = "_tabs_1wv7y_67", Bt = "_selectWrapper_1wv7y_72", It = "_filterOption_1wv7y_76", Mt = "_btnWrapper_1wv7y_83", Lt = "_resetBtn_1wv7y_89", Rt = "_saveBtn_1wv7y_90", At = "_desktopWrapper_1wv7y_94", Dt = "_desktopWrapperOpen_1wv7y_117", n = {
194
- root: yt,
195
- filterWithSaveModal: Wt,
196
- modalAddBody: Nt,
197
- closeBtn: bt,
198
- btnName: gt,
199
- modalTitle: Ot,
200
- tabSWitcherWrapper: St,
201
- switcherTitle: kt,
202
- switcherScroll: Ct,
203
- tabs: xt,
204
- selectWrapper: Bt,
205
- filterOption: It,
206
- btnWrapper: Mt,
207
- resetBtn: Lt,
208
- saveBtn: Rt,
209
- desktopWrapper: At,
210
- desktopWrapperOpen: Dt
211
- };
212
- var K = { exports: {} };
213
- /*!
214
- Copyright (c) 2018 Jed Watson.
215
- Licensed under the MIT License (MIT), see
216
- http://jedwatson.github.io/classnames
217
- */
218
- (function(o) {
219
- (function() {
220
- var s = {}.hasOwnProperty;
221
- function a() {
222
- for (var t = "", i = 0; i < arguments.length; i++) {
223
- var d = arguments[i];
224
- d && (t = u(t, _.call(this, d)));
225
- }
226
- return t;
227
- }
228
- function _(t) {
229
- if (typeof t == "string" || typeof t == "number")
230
- return this && this[t] || t;
231
- if (typeof t != "object")
232
- return "";
233
- if (Array.isArray(t))
234
- return a.apply(this, t);
235
- if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
236
- return t.toString();
237
- var i = "";
238
- for (var d in t)
239
- s.call(t, d) && t[d] && (i = u(i, this && this[d] || d));
240
- return i;
241
- }
242
- function u(t, i) {
243
- return i ? t ? t + " " + i : t + i : t;
244
- }
245
- o.exports ? (a.default = a, o.exports = a) : window.classNames = a;
246
- })();
247
- })(K);
248
- var Et = K.exports;
249
- const jt = /* @__PURE__ */ tt(Et), $t = jt.bind(n), de = ({
250
- disabledOptions: o = [],
251
- tabs: s = [],
252
- selectOptions: a = [],
253
- onChange: _,
254
- selectedValues: u = [],
255
- setSelectedTabs: t,
256
- selectedTabs: i = [],
257
- onClickItem: d,
258
- onCLickSelect: g,
259
- btnName: C = "Фильтр"
260
- }) => {
261
- const { isMobile: O } = E(), [m, l] = B(!1), h = J(null), [S, k] = B(i), [x] = B(u), [N, f] = B(S), [w, W] = B(x), Q = (r) => {
262
- if (d && d(r), o.some((y) => y.value === r.value))
263
- return;
264
- const b = w.some((y) => y.value === r.value) ? w.filter((y) => y.value !== r.value) : [...w, r];
265
- W(b);
266
- }, U = () => {
267
- k(s), f(s), W([]), _ && (_([]), t == null || t(s));
268
- }, X = () => {
269
- W(u), f(i);
270
- }, j = () => {
271
- X(), l(!1);
272
- }, Y = (r) => {
273
- r.stopPropagation(), _ && (t == null || t(N), _(w)), l(!1);
274
- };
275
- D(() => {
276
- m || f((r) => JSON.stringify(r) !== JSON.stringify(i) ? i : r);
277
- }, [m, i]), D(() => {
278
- const r = (b) => {
279
- h.current && (h.current.contains(b.target) || (console.log("я тут"), j()));
280
- };
281
- return m ? document.addEventListener("click", r) : document.removeEventListener("click", r), () => {
282
- document.removeEventListener("click", r);
283
- };
284
- }, [m]);
285
- const $ = () => /* @__PURE__ */ v(F, { children: [
286
- /* @__PURE__ */ e(
287
- "div",
288
- {
289
- className: n.closeBtn,
290
- onClick: () => {
291
- j();
292
- },
293
- children: /* @__PURE__ */ e(
294
- R,
295
- {
296
- name: "close",
297
- size: "24"
298
- }
299
- )
300
- }
301
- ),
302
- /* @__PURE__ */ e("div", { className: n.modalTitle, children: "Фильтры" }),
303
- /* @__PURE__ */ v("div", { className: n.tabSWitcherWrapper, children: [
304
- /* @__PURE__ */ e("div", { className: n.switcherTitle, children: "Готовность" }),
305
- /* @__PURE__ */ e("div", { className: n.switcherScroll, children: /* @__PURE__ */ e(
306
- T,
307
- {
308
- variant: "grayRow",
309
- addClassName: n.tabs,
310
- isApart: !0,
311
- children: s == null ? void 0 : s.map((r, b) => {
312
- var z;
313
- const y = r.value;
314
- return /* @__PURE__ */ e(
315
- T.Item,
316
- {
317
- itemsLength: s == null ? void 0 : s.length,
318
- mini: !0,
319
- value: y,
320
- onClick: () => {
321
- },
322
- checked: ((z = N == null ? void 0 : N.find((A) => A.value === y)) == null ? void 0 : z.state) ?? !1,
323
- onChange: () => {
324
- f == null || f(
325
- (A) => A.map((M) => M.value === y ? { ...M, state: !M.state } : M)
326
- );
327
- },
328
- index: b,
329
- addItemClassName: n.tabSwitcher,
330
- children: y
331
- },
332
- b
333
- );
334
- })
335
- }
336
- ) })
337
- ] }),
338
- /* @__PURE__ */ e("div", { className: n.selectWrapper, children: a == null ? void 0 : a.map((r, b) => /* @__PURE__ */ e(
339
- it,
340
- {
341
- addClassName: n.filterOption,
342
- disabledOptions: [],
343
- clickableOptions: [],
344
- selectedOptions: w,
345
- option: r,
346
- handleOptionClick: Q
347
- },
348
- b
349
- )) }),
350
- /* @__PURE__ */ v("div", { className: n.btnWrapper, children: [
351
- /* @__PURE__ */ e(
352
- P,
353
- {
354
- as: "button",
355
- variant: "gray",
356
- additionalClass: n.resetBtn,
357
- onClick: U,
358
- children: "Сбросить"
359
- }
360
- ),
361
- /* @__PURE__ */ e(
362
- P,
363
- {
364
- as: "button",
365
- additionalClass: n.saveBtn,
366
- onClick: Y,
367
- children: "Сохранить"
368
- }
369
- )
370
- ] })
371
- ] });
372
- return /* @__PURE__ */ v(F, { children: [
373
- /* @__PURE__ */ v("div", { style: { position: "relative" }, children: [
374
- /* @__PURE__ */ v(
375
- "div",
376
- {
377
- className: n.root,
378
- onClick: () => {
379
- g && g(), O ? l((r) => !r) : m || l(!0);
380
- },
381
- children: [
382
- /* @__PURE__ */ e("div", { className: n.btnName, children: C }),
383
- /* @__PURE__ */ e(
384
- R,
385
- {
386
- name: "filter",
387
- size: "16"
388
- }
389
- )
390
- ]
391
- }
392
- ),
393
- !O && /* @__PURE__ */ e(
394
- "div",
395
- {
396
- ref: h,
397
- className: $t(n.desktopWrapper, { [n.desktopWrapperOpen]: m }),
398
- children: /* @__PURE__ */ e($, {})
399
- }
400
- )
401
- ] }),
402
- O && /* @__PURE__ */ e(
403
- q,
404
- {
405
- isOpen: m,
406
- emitIsOpen: l,
407
- isTransparentBack: !0,
408
- additionalClassModalBody: n.modalAddBody,
409
- additionalClass: n.filterWithSaveModal,
410
- children: /* @__PURE__ */ e($, {})
411
- }
412
- )
413
- ] });
414
- };
415
- export {
416
- de as F,
417
- T as S,
418
- wt as a
419
- };