stone-kit 0.0.503 → 0.0.505
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.
- package/README.md +59 -59
- package/dist/SortSelect-DT1o6Lco.js +188 -0
- package/dist/components/LotCard/ui/LotCard.js +114 -108
- package/dist/components/SortSelect/hooks/useSortSelect.d.ts +3 -1
- package/dist/components/SortSelect/hooks/useSortSelect.js +1 -1
- package/dist/components/SortSelect/index.js +1 -1
- package/dist/components/SortSelect/ui/SortSelect.js +2 -2
- package/dist/components/SortSelect/ui/SortSelect.types.d.ts +4 -0
- package/dist/components/TabSwitcher/index.js +1 -1
- package/dist/components/TabSwitcher/ui/TabSwitcher.js +1 -1
- package/dist/components/ZoomControls/ui/ZoomControls.js +1 -1
- package/dist/main.js +1 -1
- package/dist/style.css +1 -1
- package/dist/useSortSelect-CjZXLFOG.js +80 -0
- package/package.json +1 -1
- package/dist/SortSelect-jks4qMel.js +0 -180
- package/dist/useSortSelect-D7K1wk0E.js +0 -79
package/README.md
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# Stone-kit
|
|
2
|
-
|
|
3
|
-
Uikit for stone redesign 2.0
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
Package installation:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i stone-kit@latest
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
For Next.js page router in App.tsx:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
import 'stone-kit/dist/style.css'
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
and then:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
import {Button} from 'stone-kit'
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
For other projects u can immediately:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
import {Button} from 'stone-kit'
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Docs
|
|
34
|
-
|
|
35
|
-
### ButtonProps
|
|
36
|
-
|
|
37
|
-
size: optional, size of button. types : 'large' | 'medium' | 'small' | 'tiny'
|
|
38
|
-
|
|
39
|
-
pre: optional, insert icon/text before button text. type: ReactNode
|
|
40
|
-
|
|
41
|
-
post: optional, insert icon/text after button text. type: ReactNode
|
|
42
|
-
|
|
43
|
-
variant: optional, color variants of button. type:
|
|
44
|
-
'blue',
|
|
45
|
-
'gray',
|
|
46
|
-
'whiteStroke',
|
|
47
|
-
'sokolniki',
|
|
48
|
-
'black',
|
|
49
|
-
'whiteFilled'
|
|
50
|
-
|
|
51
|
-
width: optional, width of button. type: 'auto' | 'full'
|
|
52
|
-
|
|
53
|
-
additionalClass: optional, add your custom class to button. type: 'string'
|
|
54
|
-
|
|
55
|
-
as: optional, u can convert button to link. type: 'button' | 'link'. 'button' by default.
|
|
56
|
-
|
|
57
|
-
### MobileButtonProps
|
|
58
|
-
|
|
59
|
-
### Tag
|
|
1
|
+
# Stone-kit
|
|
2
|
+
|
|
3
|
+
Uikit for stone redesign 2.0
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Package installation:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i stone-kit@latest
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
For Next.js page router in App.tsx:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
import 'stone-kit/dist/style.css'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
and then:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
import {Button} from 'stone-kit'
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For other projects u can immediately:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
import {Button} from 'stone-kit'
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Docs
|
|
34
|
+
|
|
35
|
+
### ButtonProps
|
|
36
|
+
|
|
37
|
+
size: optional, size of button. types : 'large' | 'medium' | 'small' | 'tiny'
|
|
38
|
+
|
|
39
|
+
pre: optional, insert icon/text before button text. type: ReactNode
|
|
40
|
+
|
|
41
|
+
post: optional, insert icon/text after button text. type: ReactNode
|
|
42
|
+
|
|
43
|
+
variant: optional, color variants of button. type:
|
|
44
|
+
'blue',
|
|
45
|
+
'gray',
|
|
46
|
+
'whiteStroke',
|
|
47
|
+
'sokolniki',
|
|
48
|
+
'black',
|
|
49
|
+
'whiteFilled'
|
|
50
|
+
|
|
51
|
+
width: optional, width of button. type: 'auto' | 'full'
|
|
52
|
+
|
|
53
|
+
additionalClass: optional, add your custom class to button. type: 'string'
|
|
54
|
+
|
|
55
|
+
as: optional, u can convert button to link. type: 'button' | 'link'. 'button' by default.
|
|
56
|
+
|
|
57
|
+
### MobileButtonProps
|
|
58
|
+
|
|
59
|
+
### Tag
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { jsxs as _, jsx as o } 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 v } 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_1ol37_1", z = "_text_1ol37_18", $ = "_rootCol_1ol37_26", q = "_item_1ol37_32", H = "_whiteRow_1ol37_51", P = "_firstItem_1ol37_62", V = "_lastItem_1ol37_66", F = "_apart_1ol37_97", G = "_isLong_1ol37_97", J = "_autoWidth_1ol37_122", K = "_isDisabled_1ol37_129", Q = "_grayRow_1ol37_153", 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
|
+
isDisabled: K,
|
|
37
|
+
grayRow: Q
|
|
38
|
+
}, u = L.bind(e), U = ({
|
|
39
|
+
children: s,
|
|
40
|
+
variant: c = "whiteRow",
|
|
41
|
+
isApart: m = !1,
|
|
42
|
+
addClassName: d = "",
|
|
43
|
+
col: l = !1
|
|
44
|
+
}) => /* @__PURE__ */ o("div", { className: u(e.root, e[c], d, { [e.rootCol]: l, [e.apart]: m }), children: s }), k = T((s, c) => {
|
|
45
|
+
const { isTablet: m, isDesktop: d } = R(), {
|
|
46
|
+
index: l,
|
|
47
|
+
children: i,
|
|
48
|
+
addItemClassName: h,
|
|
49
|
+
addTextClass: N,
|
|
50
|
+
disabled: f = !1,
|
|
51
|
+
itemsLength: w = 0,
|
|
52
|
+
isLongOn: x = !0,
|
|
53
|
+
width: p,
|
|
54
|
+
width_m: r,
|
|
55
|
+
width_l: a,
|
|
56
|
+
...b
|
|
57
|
+
} = s, n = (i != null && i.toString().length ? (i == null ? void 0 : i.toString().length) > 2 : !1) && x, O = (S, g) => S && r ? r : g && a ? a : p, y = !p && !r && !a && n;
|
|
58
|
+
return /* @__PURE__ */ _("label", { className: u({ [e.isLong]: n }), children: [
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
"input",
|
|
61
|
+
{
|
|
62
|
+
ref: c,
|
|
63
|
+
type: "checkbox",
|
|
64
|
+
...b,
|
|
65
|
+
disabled: f
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
/* @__PURE__ */ o(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
style: { width: O(m, d) },
|
|
72
|
+
className: u(u(
|
|
73
|
+
e.item,
|
|
74
|
+
{ [e.firstItem]: l === 0 },
|
|
75
|
+
{ [e.lastItem]: l === w - 1 },
|
|
76
|
+
{ [e.isDisabled]: f },
|
|
77
|
+
{ [e.autoWidth]: y }
|
|
78
|
+
), h),
|
|
79
|
+
children: /* @__PURE__ */ o(W, { className: u(e.text, N), children: i })
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] });
|
|
83
|
+
});
|
|
84
|
+
k.displayName = "TabSwitcherItem";
|
|
85
|
+
const Nt = Object.assign(U, { Item: k }), I = L.bind(t), X = ({
|
|
86
|
+
options: s,
|
|
87
|
+
selectedOption: c,
|
|
88
|
+
placeholder: m = "",
|
|
89
|
+
error: d,
|
|
90
|
+
disabled: l,
|
|
91
|
+
additionalClass: i = "",
|
|
92
|
+
onChange: h,
|
|
93
|
+
onBlur: N,
|
|
94
|
+
mini: f,
|
|
95
|
+
openOnTop: w = !1,
|
|
96
|
+
onClickItem: x,
|
|
97
|
+
onCLickSelect: p
|
|
98
|
+
}) => {
|
|
99
|
+
const [r, a] = D(!1), b = M(null), { isMobile: n } = R(), { handleBlur: O, getInputValue: y, getOption: S, handleDocumentClick: g } = j(
|
|
100
|
+
{
|
|
101
|
+
selectedOption: c,
|
|
102
|
+
onClickOption: x,
|
|
103
|
+
setSelectedOption: h,
|
|
104
|
+
setIsOpen: a,
|
|
105
|
+
containerRef: b,
|
|
106
|
+
isOpen: r,
|
|
107
|
+
isMobile: n,
|
|
108
|
+
placeholder: m,
|
|
109
|
+
onChange: h,
|
|
110
|
+
onBlur: N
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
return B(() => (document.addEventListener("click", g), () => {
|
|
114
|
+
document.removeEventListener("click", g);
|
|
115
|
+
}), []), /* @__PURE__ */ _(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
ref: b,
|
|
119
|
+
className: I(
|
|
120
|
+
t.sortSelectWrapper,
|
|
121
|
+
{ [t.sortSelectWrapperError]: d },
|
|
122
|
+
{ [t.sortSelectWrapperTop]: w },
|
|
123
|
+
i
|
|
124
|
+
),
|
|
125
|
+
tabIndex: 0,
|
|
126
|
+
onBlur: O,
|
|
127
|
+
onClick: () => {
|
|
128
|
+
p && p();
|
|
129
|
+
},
|
|
130
|
+
children: [
|
|
131
|
+
/* @__PURE__ */ _("div", { className: I(t.inputWrapper), children: [
|
|
132
|
+
/* @__PURE__ */ o(
|
|
133
|
+
"input",
|
|
134
|
+
{
|
|
135
|
+
type: "text",
|
|
136
|
+
readOnly: !0,
|
|
137
|
+
value: y(),
|
|
138
|
+
className: I(
|
|
139
|
+
t.selectedOptions,
|
|
140
|
+
{ [t.selectOptionsDisabled]: l },
|
|
141
|
+
{ [t.selectionOptionMini]: f }
|
|
142
|
+
),
|
|
143
|
+
onClick: () => a(!r)
|
|
144
|
+
}
|
|
145
|
+
),
|
|
146
|
+
/* @__PURE__ */ o(
|
|
147
|
+
v,
|
|
148
|
+
{
|
|
149
|
+
name: "twoArrows",
|
|
150
|
+
size: "24",
|
|
151
|
+
additionalClass: t.icon
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }),
|
|
155
|
+
r && n && /* @__PURE__ */ _(
|
|
156
|
+
E,
|
|
157
|
+
{
|
|
158
|
+
isOpen: r,
|
|
159
|
+
emitIsOpen: a,
|
|
160
|
+
additionalClassModalBody: t.modalAddBody,
|
|
161
|
+
additionalClass: t.selectModal,
|
|
162
|
+
createPortalObj: { domNode: document.querySelector("body") },
|
|
163
|
+
isTransparentBack: !0,
|
|
164
|
+
children: [
|
|
165
|
+
/* @__PURE__ */ _("div", { className: t.mobileSortHeader, children: [
|
|
166
|
+
/* @__PURE__ */ o(W, { children: "Сортировка" }),
|
|
167
|
+
/* @__PURE__ */ o("div", { onClick: () => a(!1), children: /* @__PURE__ */ o(
|
|
168
|
+
v,
|
|
169
|
+
{
|
|
170
|
+
name: "close",
|
|
171
|
+
size: "20"
|
|
172
|
+
}
|
|
173
|
+
) })
|
|
174
|
+
] }),
|
|
175
|
+
/* @__PURE__ */ o("div", { className: t.mobileOptionList, children: s == null ? void 0 : s.map((C) => S(C)) })
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
r && !n && /* @__PURE__ */ o("div", { className: I(t.optionsList, { [t.optionListOnTop]: w }), children: s == null ? void 0 : s.map((C) => S(C)) })
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
};
|
|
184
|
+
X.displayName = "SortSelect";
|
|
185
|
+
export {
|
|
186
|
+
Nt as S,
|
|
187
|
+
X as a
|
|
188
|
+
};
|