stone-kit 0.0.796 → 0.0.798
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
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
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MultiSelectProps } from './Select.types';
|
|
2
2
|
|
|
3
|
-
export declare const Select: ({ options, placeholder, error, disabled, disabledOptions, additionalClass, additionalClassOption, additionalClassBtn, onChange, onBlur, selectedValues, isBtn, btnName, clickableOptions, isListRight, sizeIcon, mode, onClickItem, onCLickSelect, size_s, size_m, size_l, isDisabledNotClickable, isLast, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const Select: ({ options, customPlaceholder, placeholder, error, disabled, disabledOptions, additionalClass, additionalClassOption, additionalClassBtn, onChange, onBlur, selectedValues, isBtn, btnName, clickableOptions, isListRight, sizeIcon, mode, onClickItem, onCLickSelect, size_s, size_m, size_l, isDisabledNotClickable, isLast, }: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,57 +1,58 @@
|
|
|
1
|
-
import { jsxs as m, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { c as
|
|
4
|
-
import { s as e, O as
|
|
5
|
-
import { NewIcon as
|
|
6
|
-
import { Category as
|
|
7
|
-
import { handleClickModeOption as
|
|
8
|
-
const a =
|
|
1
|
+
import { jsxs as m, Fragment as L, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as W, useRef as j, useEffect as z } from "react";
|
|
3
|
+
import { c as Q } from "../../../index-rKuIKazb.js";
|
|
4
|
+
import { s as e, O as T } from "../../../Option-BVIm7wOW.js";
|
|
5
|
+
import { NewIcon as B } from "../../NewIcon/ui/NewIcon.js";
|
|
6
|
+
import { Category as U } from "./Category.js";
|
|
7
|
+
import { handleClickModeOption as X, handleClickModeCategory as Y } from "../model/selectMode.js";
|
|
8
|
+
const a = Q.bind(e), ne = ({
|
|
9
9
|
options: t,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
customPlaceholder: h,
|
|
11
|
+
placeholder: D = "Выберите опции",
|
|
12
|
+
error: M,
|
|
13
|
+
disabled: u,
|
|
14
|
+
disabledOptions: d = [],
|
|
15
|
+
additionalClass: F = "",
|
|
16
|
+
additionalClassOption: _,
|
|
17
|
+
additionalClassBtn: q,
|
|
18
|
+
onChange: G,
|
|
19
|
+
onBlur: O,
|
|
20
|
+
selectedValues: i = [],
|
|
21
|
+
isBtn: y = !1,
|
|
22
|
+
btnName: v,
|
|
23
|
+
clickableOptions: C,
|
|
24
|
+
isListRight: H = !1,
|
|
25
|
+
sizeIcon: f,
|
|
26
|
+
mode: c = "options",
|
|
27
|
+
onClickItem: S,
|
|
28
|
+
onCLickSelect: N,
|
|
29
|
+
size_s: $ = "large",
|
|
30
|
+
size_m: k,
|
|
31
|
+
size_l: x,
|
|
32
|
+
isDisabledNotClickable: A,
|
|
33
|
+
isLast: J
|
|
33
34
|
}) => {
|
|
34
35
|
t = Array.isArray(t) ? [.../* @__PURE__ */ new Set([...t])] : [];
|
|
35
|
-
const [
|
|
36
|
-
|
|
36
|
+
const [s, E] = W(i), [o, g] = W(!1), p = j(null), R = (r) => {
|
|
37
|
+
S && S(r);
|
|
37
38
|
const n = {
|
|
38
39
|
option: r,
|
|
39
|
-
selectedOptions:
|
|
40
|
-
disabledOptions:
|
|
41
|
-
setSelectedOptions:
|
|
42
|
-
onChange:
|
|
43
|
-
mode:
|
|
40
|
+
selectedOptions: s,
|
|
41
|
+
disabledOptions: d,
|
|
42
|
+
setSelectedOptions: E,
|
|
43
|
+
onChange: G,
|
|
44
|
+
mode: c,
|
|
44
45
|
optionsParentArr: t
|
|
45
46
|
};
|
|
46
|
-
Array.isArray(r) ?
|
|
47
|
-
},
|
|
48
|
-
|
|
47
|
+
Array.isArray(r) ? Y(n) : X(n);
|
|
48
|
+
}, K = () => {
|
|
49
|
+
O && O(s);
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
z(() => {
|
|
51
52
|
const r = (n) => {
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
if (
|
|
53
|
+
const P = n.target;
|
|
54
|
+
if (p.current && !p.current.contains(n.target)) {
|
|
55
|
+
if (P.closest("svg"))
|
|
55
56
|
return;
|
|
56
57
|
g(!1);
|
|
57
58
|
}
|
|
@@ -60,70 +61,70 @@ const a = K.bind(e), te = ({
|
|
|
60
61
|
document.removeEventListener("click", r);
|
|
61
62
|
};
|
|
62
63
|
}, []);
|
|
63
|
-
const
|
|
64
|
-
return
|
|
65
|
-
|
|
66
|
-
}, [
|
|
64
|
+
const w = j(i);
|
|
65
|
+
return z(() => {
|
|
66
|
+
i.length !== w.current.length && (E(i), w.current = i);
|
|
67
|
+
}, [i]), /* @__PURE__ */ m(
|
|
67
68
|
"div",
|
|
68
69
|
{
|
|
69
|
-
ref:
|
|
70
|
-
className: a(e.multiSelectWrapper, { [e.multiSelectWrapperError]:
|
|
70
|
+
ref: p,
|
|
71
|
+
className: a(e.multiSelectWrapper, { [e.multiSelectWrapperError]: M }, F),
|
|
71
72
|
tabIndex: 0,
|
|
72
|
-
onBlur:
|
|
73
|
+
onBlur: K,
|
|
73
74
|
children: [
|
|
74
75
|
/* @__PURE__ */ m("div", { className: a(e.inputWrapper), children: [
|
|
75
|
-
!
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
!y && /* @__PURE__ */ m(L, { children: [
|
|
77
|
+
/* @__PURE__ */ l(
|
|
77
78
|
"div",
|
|
78
79
|
{
|
|
79
80
|
className: a(
|
|
80
81
|
e.selectedOptions,
|
|
81
|
-
e[`${
|
|
82
|
-
e[`${
|
|
83
|
-
e[`${
|
|
84
|
-
{ [e.selectedOptionsNotEmpty]:
|
|
85
|
-
{ [e.selectOptionsDisabled]:
|
|
82
|
+
e[`${$}-size`],
|
|
83
|
+
e[`${k}-size_m`],
|
|
84
|
+
e[`${x}-size)_l`],
|
|
85
|
+
{ [e.selectedOptionsNotEmpty]: s.length > 0 },
|
|
86
|
+
{ [e.selectOptionsDisabled]: u }
|
|
86
87
|
),
|
|
87
88
|
onClick: () => g(!o),
|
|
88
|
-
children:
|
|
89
|
+
children: h || (s.length === 0 ? D : "Выбрано " + s.length)
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
|
|
92
|
+
/* @__PURE__ */ l(
|
|
93
|
+
B,
|
|
93
94
|
{
|
|
94
95
|
name: "arrowShort",
|
|
95
96
|
deg: o ? "180" : "0",
|
|
96
|
-
size:
|
|
97
|
+
size: f ?? "24",
|
|
97
98
|
additionalClass: e.icon
|
|
98
99
|
}
|
|
99
100
|
)
|
|
100
101
|
] }),
|
|
101
|
-
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
y && /* @__PURE__ */ m(L, { children: [
|
|
103
|
+
/* @__PURE__ */ l(
|
|
103
104
|
"button",
|
|
104
105
|
{
|
|
105
106
|
className: a(
|
|
106
107
|
e.selectedOptions,
|
|
107
|
-
e[`${
|
|
108
|
-
e[`${
|
|
109
|
-
e[`${
|
|
108
|
+
e[`${$}-size`],
|
|
109
|
+
e[`${k}-size_m`],
|
|
110
|
+
e[`${x}-size_l`],
|
|
110
111
|
e.selectedOptionsBtn,
|
|
111
|
-
{ [e.selectOptionsDisabled]:
|
|
112
|
-
|
|
112
|
+
{ [e.selectOptionsDisabled]: u },
|
|
113
|
+
q
|
|
113
114
|
),
|
|
114
115
|
onClick: () => {
|
|
115
|
-
|
|
116
|
+
N && N(), g(!o);
|
|
116
117
|
},
|
|
117
|
-
children:
|
|
118
|
+
children: v
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
121
|
+
/* @__PURE__ */ l(
|
|
122
|
+
B,
|
|
122
123
|
{
|
|
123
124
|
name: "filter",
|
|
124
125
|
deg: o ? "180" : "0",
|
|
125
|
-
size:
|
|
126
|
-
additionalClass: a(e.icon, { [e.iconBtn]: !
|
|
126
|
+
size: f ?? "24",
|
|
127
|
+
additionalClass: a(e.icon, { [e.iconBtn]: !v })
|
|
127
128
|
}
|
|
128
129
|
)
|
|
129
130
|
] })
|
|
@@ -133,36 +134,36 @@ const a = K.bind(e), te = ({
|
|
|
133
134
|
{
|
|
134
135
|
className: a(
|
|
135
136
|
e.optionsList,
|
|
136
|
-
{ [e.listRight]:
|
|
137
|
-
{ [e.lastList]:
|
|
138
|
-
|
|
137
|
+
{ [e.listRight]: H },
|
|
138
|
+
{ [e.lastList]: J },
|
|
139
|
+
_
|
|
139
140
|
),
|
|
140
141
|
children: [
|
|
141
|
-
(
|
|
142
|
-
|
|
142
|
+
(c === "options" || c === "single") && (t == null ? void 0 : t.map((r, n) => /* @__PURE__ */ l(
|
|
143
|
+
T,
|
|
143
144
|
{
|
|
144
|
-
disabledOptions:
|
|
145
|
-
clickableOptions:
|
|
146
|
-
selectedOptions:
|
|
147
|
-
sizeIcon:
|
|
145
|
+
disabledOptions: d,
|
|
146
|
+
clickableOptions: C,
|
|
147
|
+
selectedOptions: s,
|
|
148
|
+
sizeIcon: f,
|
|
148
149
|
option: r,
|
|
149
|
-
handleOptionClick:
|
|
150
|
-
isDisabledNotClickable:
|
|
150
|
+
handleOptionClick: R,
|
|
151
|
+
isDisabledNotClickable: A
|
|
151
152
|
},
|
|
152
153
|
n
|
|
153
154
|
))),
|
|
154
|
-
(
|
|
155
|
-
|
|
155
|
+
(c === "category" || c === "double") && (t == null ? void 0 : t.map((r, n) => "options" in r ? /* @__PURE__ */ l(
|
|
156
|
+
U,
|
|
156
157
|
{
|
|
157
|
-
disabledOptions:
|
|
158
|
-
clickableOptions:
|
|
159
|
-
selectedOptions:
|
|
160
|
-
sizeIcon:
|
|
158
|
+
disabledOptions: d,
|
|
159
|
+
clickableOptions: C,
|
|
160
|
+
selectedOptions: s,
|
|
161
|
+
sizeIcon: f,
|
|
161
162
|
category: r,
|
|
162
|
-
mode:
|
|
163
|
-
selectedValues:
|
|
164
|
-
handleOptionClick:
|
|
165
|
-
isDisabledNotClickable:
|
|
163
|
+
mode: c,
|
|
164
|
+
selectedValues: i,
|
|
165
|
+
handleOptionClick: R,
|
|
166
|
+
isDisabledNotClickable: A
|
|
166
167
|
},
|
|
167
168
|
n
|
|
168
169
|
) : null))
|
|
@@ -174,5 +175,5 @@ const a = K.bind(e), te = ({
|
|
|
174
175
|
);
|
|
175
176
|
};
|
|
176
177
|
export {
|
|
177
|
-
|
|
178
|
+
ne as Select
|
|
178
179
|
};
|
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.
|
|
5
|
+
"version": "0.0.798",
|
|
6
6
|
"author": "Mollycodd1e",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"type": "module",
|
|
@@ -20,8 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@react-input/mask": "^1.2.5",
|
|
23
|
-
"react-imask": "^7.6.1"
|
|
24
|
-
"react-input-mask": "^3.0.0-alpha.2"
|
|
23
|
+
"react-imask": "^7.6.1"
|
|
25
24
|
},
|
|
26
25
|
"peerDependencies": {
|
|
27
26
|
"classnames": "^2.5.1",
|