stone-kit 0.0.621 → 0.0.623

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,553 +0,0 @@
1
- import { jsxs as _, 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 m, 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-8X0Ft_zQ.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", at = "_lastItem_2bilg_72", st = "_apart_2bilg_103", ot = "_isLong_2bilg_103", lt = "_autoWidth_2bilg_128", ct = "_mini_2bilg_132", dt = "_isDisabled_2bilg_140", mt = "_grayRow_2bilg_164", f = {
27
- root: Y,
28
- text: Z,
29
- textMini: tt,
30
- rootCol: et,
31
- item: it,
32
- whiteRow: rt,
33
- firstItem: nt,
34
- lastItem: at,
35
- apart: st,
36
- isLong: ot,
37
- autoWidth: lt,
38
- mini: ct,
39
- isDisabled: dt,
40
- grayRow: mt
41
- }, L = V.bind(f), pt = ({
42
- children: s,
43
- variant: n = "whiteRow",
44
- isApart: o = !1,
45
- addClassName: O = "",
46
- col: l = !1
47
- }) => /* @__PURE__ */ e("div", { className: L(f.root, f[n], O, { [f.rootCol]: l, [f.apart]: o }), children: s }), G = Q((s, n) => {
48
- const { isTablet: o, isDesktop: O } = F(), {
49
- index: l,
50
- children: t,
51
- addItemClassName: r,
52
- addTextClass: c,
53
- disabled: v = !1,
54
- itemsLength: b = 0,
55
- isLongOn: y = !0,
56
- width: p,
57
- width_m: h,
58
- width_l: u,
59
- mini: k = !1,
60
- ...N
61
- } = s, W = (t != null && t.toString().length ? (t == null ? void 0 : t.toString().length) > 2 : !1) && y, w = (x, B) => x && h ? h : B && u ? u : p, g = !p && !h && !u && W;
62
- return /* @__PURE__ */ _("label", { className: L({ [f.isLong]: W }), children: [
63
- /* @__PURE__ */ e(
64
- "input",
65
- {
66
- ref: n,
67
- type: "checkbox",
68
- ...N,
69
- disabled: v
70
- }
71
- ),
72
- /* @__PURE__ */ e(
73
- "div",
74
- {
75
- style: { width: w(o, O) },
76
- className: L(
77
- L(
78
- f.item,
79
- { [f.firstItem]: l === 0 },
80
- { [f.lastItem]: l === b - 1 },
81
- { [f.isDisabled]: v },
82
- { [f.autoWidth]: g },
83
- { [f.mini]: k }
84
- ),
85
- r
86
- ),
87
- children: /* @__PURE__ */ e(H, { className: L(f.text, { [f.textMini]: k }, c), children: t })
88
- }
89
- )
90
- ] });
91
- });
92
- G.displayName = "TabSwitcherItem";
93
- const j = Object.assign(pt, { Item: G }), $ = V.bind(m), ht = ({
94
- options: s,
95
- selectedOption: n,
96
- placeholder: o = "",
97
- error: O,
98
- disabled: l,
99
- additionalClass: t = "",
100
- onChange: r,
101
- onBlur: c,
102
- mini: v,
103
- openOnTop: b = !1,
104
- onClickItem: y,
105
- onCLickSelect: p
106
- }) => {
107
- const [h, u] = R(!1), k = q(null), { isMobile: N } = F(), { handleBlur: W, getInputValue: w, getOption: g, handleDocumentClick: x } = X(
108
- {
109
- selectedOption: n,
110
- onClickOption: y,
111
- setSelectedOption: r,
112
- setIsOpen: u,
113
- containerRef: k,
114
- isOpen: h,
115
- isMobile: N,
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__ */ _(
124
- "div",
125
- {
126
- ref: k,
127
- className: $(
128
- m.sortSelectWrapper,
129
- { [m.sortSelectWrapperError]: O },
130
- { [m.sortSelectWrapperTop]: b },
131
- t
132
- ),
133
- tabIndex: 0,
134
- onBlur: W,
135
- onClick: () => {
136
- p && p();
137
- },
138
- children: [
139
- /* @__PURE__ */ _("div", { className: $(m.inputWrapper), children: [
140
- /* @__PURE__ */ e(
141
- "input",
142
- {
143
- type: "text",
144
- readOnly: !0,
145
- value: w(),
146
- className: $(
147
- m.selectedOptions,
148
- { [m.selectOptionsDisabled]: l },
149
- { [m.selectionOptionMini]: v }
150
- ),
151
- onClick: () => u(!h)
152
- }
153
- ),
154
- /* @__PURE__ */ e(
155
- A,
156
- {
157
- name: "twoArrows",
158
- size: "24",
159
- additionalClass: m.icon
160
- }
161
- )
162
- ] }),
163
- h && N && /* @__PURE__ */ _(
164
- J,
165
- {
166
- isOpen: h,
167
- emitIsOpen: u,
168
- additionalClassModalBody: m.modalAddBody,
169
- additionalClass: m.selectModal,
170
- createPortalObj: { domNode: document.querySelector("body") },
171
- isTransparentBack: !0,
172
- children: [
173
- /* @__PURE__ */ _("div", { className: m.mobileSortHeader, children: [
174
- /* @__PURE__ */ e(H, { children: "Сортировка" }),
175
- /* @__PURE__ */ e("div", { onClick: () => u(!1), children: /* @__PURE__ */ e(
176
- A,
177
- {
178
- name: "close",
179
- size: "20"
180
- }
181
- ) })
182
- ] }),
183
- /* @__PURE__ */ e("div", { className: m.mobileOptionList, children: s == null ? void 0 : s.map((B) => g(B)) })
184
- ]
185
- }
186
- ),
187
- h && !N && /* @__PURE__ */ e("div", { className: $(m.optionsList, { [m.optionListOnTop]: b }), children: s == null ? void 0 : s.map((B) => g(B)) })
188
- ]
189
- }
190
- );
191
- };
192
- ht.displayName = "SortSelect";
193
- const ut = "_root_1t65a_1", _t = "_filterWithSaveModal_1t65a_15", ft = "_modalAddBody_1t65a_20", vt = "_closeBtn_1t65a_29", Nt = "_btnName_1t65a_35", Wt = "_modalTitle_1t65a_39", gt = "_tabSWitcherWrapper_1t65a_48", Ct = "_switcherTitle_1t65a_56", wt = "_switcherScroll_1t65a_63", Ot = "_tabs_1t65a_72", kt = "_selectWrapper_1t65a_77", St = "_filterOption_1t65a_81", bt = "_btnWrapper_1t65a_88", yt = "_resetBtn_1t65a_94", xt = "_saveBtn_1t65a_95", Bt = "_desktopWrapper_1t65a_99", It = "_desktopWrapperOpen_1t65a_122", i = {
194
- root: ut,
195
- filterWithSaveModal: _t,
196
- modalAddBody: ft,
197
- closeBtn: vt,
198
- btnName: Nt,
199
- modalTitle: Wt,
200
- tabSWitcherWrapper: gt,
201
- switcherTitle: Ct,
202
- switcherScroll: wt,
203
- tabs: Ot,
204
- selectWrapper: kt,
205
- filterOption: St,
206
- btnWrapper: bt,
207
- resetBtn: yt,
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(s) {
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, O.call(this, c)));
225
- }
226
- return t;
227
- }
228
- function O(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
- s.exports ? (o.default = o, s.exports = o) : window.classNames = o;
246
- })();
247
- })(K);
248
- var Mt = K.exports;
249
- const Rt = /* @__PURE__ */ U(Mt), Lt = ({
250
- selectedTabs: s = [],
251
- selectedValues: n = [],
252
- onClickItem: o,
253
- disabledOptions: O = [],
254
- tabs: l = [],
255
- onChange: t,
256
- setSelectedTabs: r
257
- }) => {
258
- const { isMobile: c } = F(), [v, b] = R(!1), y = q(null), [p, h] = R(s), [u] = R(n), [k, N] = R(p), [W, w] = R(u), g = (a) => {
259
- if (o && o(a), O.some((d) => d.value === a.value))
260
- return;
261
- const C = W.some((d) => d.value === a.value) ? W.filter((d) => d.value !== a.value) : [...W, a];
262
- w(C);
263
- }, x = () => {
264
- h(l), N(l), w([]), t && (t([]), r == null || r(l));
265
- }, B = () => {
266
- w(n), N(s);
267
- }, D = () => {
268
- B(), b(!1);
269
- }, S = (a) => {
270
- a.stopPropagation(), t && (r == null || r(k), t(W)), b(!1);
271
- };
272
- return z(() => {
273
- v || N((a) => JSON.stringify(a) !== JSON.stringify(s) ? s : a);
274
- }, [v, s]), z(() => {
275
- const a = (C) => {
276
- if (!y.current)
277
- return;
278
- const d = C.target;
279
- if (console.log(d), y.current.contains(d))
280
- return d.closest("svg"), void 0;
281
- D();
282
- };
283
- return v ? document.addEventListener("click", a) : document.removeEventListener("click", a), () => {
284
- document.removeEventListener("click", a);
285
- };
286
- }, [v]), {
287
- isMobile: c,
288
- handleClearClick: x,
289
- handleCloseModal: D,
290
- handleOptionClick: g,
291
- handleSaveClick: S,
292
- localSelectedTabs: k,
293
- selectedOptions: W,
294
- setSelectedOptions: w,
295
- isModalOpen: v,
296
- setIsModalOpen: b,
297
- setLocalSelectedTabs: N,
298
- containerRef: y
299
- };
300
- }, At = Rt.bind(i), se = ({
301
- disabledOptions: s,
302
- tabs: n = [],
303
- selectOptions: o = [],
304
- onChange: O,
305
- selectedValues: l,
306
- setSelectedTabs: t,
307
- selectedTabs: r,
308
- onClickItem: c,
309
- onCLickSelect: v,
310
- btnName: b = "Фильтр"
311
- }) => {
312
- const {
313
- handleCloseModal: y,
314
- localSelectedTabs: p,
315
- selectedOptions: h,
316
- isMobile: u,
317
- handleOptionClick: k,
318
- handleClearClick: N,
319
- handleSaveClick: W,
320
- isModalOpen: w,
321
- setLocalSelectedTabs: g,
322
- setIsModalOpen: x,
323
- containerRef: B
324
- } = Lt({
325
- selectedTabs: r,
326
- onClickItem: c,
327
- setSelectedTabs: t,
328
- tabs: n,
329
- onChange: O,
330
- disabledOptions: s,
331
- selectedValues: l
332
- }), D = () => /* @__PURE__ */ _(P, { children: [
333
- /* @__PURE__ */ e(
334
- "div",
335
- {
336
- className: i.closeBtn,
337
- onClick: () => {
338
- y();
339
- },
340
- children: /* @__PURE__ */ e(
341
- A,
342
- {
343
- name: "close",
344
- size: "24"
345
- }
346
- )
347
- }
348
- ),
349
- /* @__PURE__ */ e("div", { className: i.modalTitle, children: "Фильтры" }),
350
- /* @__PURE__ */ _("div", { className: i.tabSWitcherWrapper, children: [
351
- /* @__PURE__ */ e("div", { className: i.switcherTitle, children: "Готовность" }),
352
- /* @__PURE__ */ e("div", { className: i.switcherScroll, children: /* @__PURE__ */ e(
353
- j,
354
- {
355
- variant: "grayRow",
356
- addClassName: i.tabs,
357
- isApart: !0,
358
- children: n == null ? void 0 : n.map((S, a) => {
359
- var d;
360
- const C = S.value;
361
- return /* @__PURE__ */ e(
362
- j.Item,
363
- {
364
- itemsLength: n == null ? void 0 : n.length,
365
- mini: !0,
366
- value: C,
367
- onClick: () => {
368
- },
369
- checked: ((d = p == null ? void 0 : p.find((M) => M.value === C)) == null ? void 0 : d.state) ?? !1,
370
- onChange: () => {
371
- g == null || g(
372
- (M) => M.map((I) => I.value === C ? { ...I, state: !I.state } : I)
373
- );
374
- },
375
- index: a,
376
- addItemClassName: i.tabSwitcher,
377
- children: C
378
- },
379
- a
380
- );
381
- })
382
- }
383
- ) })
384
- ] }),
385
- /* @__PURE__ */ e("div", { className: i.selectWrapper, children: o == null ? void 0 : o.map((S, a) => /* @__PURE__ */ e(
386
- T,
387
- {
388
- addClassName: i.filterOption,
389
- disabledOptions: [],
390
- clickableOptions: [],
391
- selectedOptions: h,
392
- option: S,
393
- handleOptionClick: k
394
- },
395
- a
396
- )) }),
397
- /* @__PURE__ */ _("div", { className: i.btnWrapper, children: [
398
- /* @__PURE__ */ e(
399
- E,
400
- {
401
- as: "button",
402
- variant: "gray",
403
- additionalClass: i.resetBtn,
404
- onClick: N,
405
- children: "Сбросить"
406
- }
407
- ),
408
- /* @__PURE__ */ e(
409
- E,
410
- {
411
- as: "button",
412
- additionalClass: i.saveBtn,
413
- onClick: W,
414
- children: "Сохранить"
415
- }
416
- )
417
- ] })
418
- ] });
419
- return /* @__PURE__ */ _(P, { children: [
420
- /* @__PURE__ */ _("div", { style: { position: "relative" }, children: [
421
- /* @__PURE__ */ _(
422
- "div",
423
- {
424
- className: i.root,
425
- onClick: () => {
426
- v && v(), u ? x((S) => !S) : w || x(!0);
427
- },
428
- children: [
429
- /* @__PURE__ */ e("div", { className: i.btnName, children: b }),
430
- /* @__PURE__ */ e(
431
- A,
432
- {
433
- name: "filter",
434
- size: "16"
435
- }
436
- )
437
- ]
438
- }
439
- ),
440
- !u && /* @__PURE__ */ _(
441
- "div",
442
- {
443
- ref: B,
444
- className: At(i.desktopWrapper, { [i.desktopWrapperOpen]: w }),
445
- children: [
446
- /* @__PURE__ */ e(
447
- "div",
448
- {
449
- className: i.closeBtn,
450
- onClick: () => {
451
- y();
452
- },
453
- children: /* @__PURE__ */ e(
454
- A,
455
- {
456
- name: "close",
457
- size: "24"
458
- }
459
- )
460
- }
461
- ),
462
- /* @__PURE__ */ e("div", { className: i.modalTitle, children: "Фильтры" }),
463
- /* @__PURE__ */ _("div", { className: i.tabSWitcherWrapper, children: [
464
- /* @__PURE__ */ e("div", { className: i.switcherTitle, children: "Готовность" }),
465
- /* @__PURE__ */ e("div", { className: i.switcherScroll, children: /* @__PURE__ */ e(
466
- j,
467
- {
468
- variant: "grayRow",
469
- addClassName: i.tabs,
470
- isApart: !0,
471
- children: n == null ? void 0 : n.map((S, a) => {
472
- var d;
473
- const C = S.value;
474
- return /* @__PURE__ */ e(
475
- j.Item,
476
- {
477
- itemsLength: n == null ? void 0 : n.length,
478
- mini: !0,
479
- value: C,
480
- onClick: () => {
481
- },
482
- checked: ((d = p == null ? void 0 : p.find((M) => M.value === C)) == null ? void 0 : d.state) ?? !1,
483
- onChange: () => {
484
- g == null || g(
485
- (M) => M.map((I) => I.value === C ? { ...I, state: !I.state } : I)
486
- );
487
- },
488
- index: a,
489
- addItemClassName: i.tabSwitcher,
490
- children: C
491
- },
492
- a
493
- );
494
- })
495
- }
496
- ) })
497
- ] }),
498
- /* @__PURE__ */ e("div", { className: i.selectWrapper, children: o == null ? void 0 : o.map((S, a) => /* @__PURE__ */ e(
499
- T,
500
- {
501
- addClassName: i.filterOption,
502
- disabledOptions: [],
503
- clickableOptions: [],
504
- selectedOptions: h,
505
- option: S,
506
- handleOptionClick: k
507
- },
508
- a
509
- )) }),
510
- /* @__PURE__ */ _("div", { className: i.btnWrapper, children: [
511
- /* @__PURE__ */ e(
512
- E,
513
- {
514
- as: "button",
515
- variant: "gray",
516
- additionalClass: i.resetBtn,
517
- onClick: N,
518
- children: "Сбросить"
519
- }
520
- ),
521
- /* @__PURE__ */ e(
522
- E,
523
- {
524
- as: "button",
525
- additionalClass: i.saveBtn,
526
- onClick: W,
527
- children: "Сохранить"
528
- }
529
- )
530
- ] })
531
- ]
532
- }
533
- )
534
- ] }),
535
- u && /* @__PURE__ */ e(
536
- J,
537
- {
538
- isOpen: w,
539
- emitIsOpen: x,
540
- isTransparentBack: !0,
541
- additionalClassModalBody: i.modalAddBody,
542
- additionalClass: i.filterWithSaveModal,
543
- children: /* @__PURE__ */ e(D, {})
544
- }
545
- )
546
- ] });
547
- };
548
- export {
549
- se as F,
550
- j as S,
551
- ht as a,
552
- Lt as u
553
- };