stone-kit 0.0.617 → 0.0.619

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,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
- };