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