@de-kit/st-ui 0.0.0-stage → 0.1.0
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 +73 -2
- package/dist/_virtual/_rolldown/runtime.cjs +22 -0
- package/dist/components/button/button.cjs +49 -0
- package/dist/components/button/button.cjs.map +1 -0
- package/dist/components/button/button.d.cts +21 -0
- package/dist/components/button/button.d.ts +21 -0
- package/dist/components/button/button.js +47 -0
- package/dist/components/button/button.js.map +1 -0
- package/dist/components/button/button.module.scss +95 -0
- package/dist/components/button/index.d.cts +2 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/checkbox/checkbox.cjs +29 -0
- package/dist/components/checkbox/checkbox.cjs.map +1 -0
- package/dist/components/checkbox/checkbox.d.cts +8 -0
- package/dist/components/checkbox/checkbox.d.ts +8 -0
- package/dist/components/checkbox/checkbox.js +27 -0
- package/dist/components/checkbox/checkbox.js.map +1 -0
- package/dist/components/checkbox/checkbox.module.scss +110 -0
- package/dist/components/checkbox/index.d.cts +2 -0
- package/dist/components/checkbox/index.d.ts +2 -0
- package/dist/components/input/index.d.cts +2 -0
- package/dist/components/input/index.d.ts +2 -0
- package/dist/components/input/input.cjs +20 -0
- package/dist/components/input/input.cjs.map +1 -0
- package/dist/components/input/input.d.cts +7 -0
- package/dist/components/input/input.d.ts +7 -0
- package/dist/components/input/input.js +18 -0
- package/dist/components/input/input.js.map +1 -0
- package/dist/components/input/input.module.scss +66 -0
- package/dist/components/radio/index.d.cts +2 -0
- package/dist/components/radio/index.d.ts +2 -0
- package/dist/components/radio/radio.cjs +29 -0
- package/dist/components/radio/radio.cjs.map +1 -0
- package/dist/components/radio/radio.d.cts +7 -0
- package/dist/components/radio/radio.d.ts +7 -0
- package/dist/components/radio/radio.js +27 -0
- package/dist/components/radio/radio.js.map +1 -0
- package/dist/components/radio/radio.module.scss +108 -0
- package/dist/components/spinner/index.d.cts +2 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/spinner/spinner.cjs +56 -0
- package/dist/components/spinner/spinner.cjs.map +1 -0
- package/dist/components/spinner/spinner.d.cts +13 -0
- package/dist/components/spinner/spinner.d.ts +13 -0
- package/dist/components/spinner/spinner.js +54 -0
- package/dist/components/spinner/spinner.js.map +1 -0
- package/dist/components/spinner/spinner.module.scss +12 -0
- package/dist/components/textarea/index.d.cts +2 -0
- package/dist/components/textarea/index.d.ts +2 -0
- package/dist/components/textarea/textarea.cjs +30 -0
- package/dist/components/textarea/textarea.cjs.map +1 -0
- package/dist/components/textarea/textarea.d.cts +9 -0
- package/dist/components/textarea/textarea.d.ts +9 -0
- package/dist/components/textarea/textarea.js +28 -0
- package/dist/components/textarea/textarea.js.map +1 -0
- package/dist/components/textarea/textarea.module.scss +60 -0
- package/dist/index.cjs +13 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -0
- package/dist/lib/cn.cjs +25 -0
- package/dist/lib/cn.cjs.map +1 -0
- package/dist/lib/cn.js +24 -0
- package/dist/lib/cn.js.map +1 -0
- package/dist/styles/global.scss +195 -0
- package/dist/styles/mixins.scss +188 -0
- package/dist/styles/vars.scss +39 -0
- package/package.json +91 -3
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Button, ButtonComponentProps, ButtonLinkProps, ButtonProps } from "./components/button/button.js";
|
|
2
|
+
import "./components/button/index.js";
|
|
3
|
+
import { CheckboxInput, CheckboxInputProps } from "./components/checkbox/checkbox.js";
|
|
4
|
+
import "./components/checkbox/index.js";
|
|
5
|
+
import { Input, InputProps } from "./components/input/input.js";
|
|
6
|
+
import "./components/input/index.js";
|
|
7
|
+
import { RadioInput, RadioInputProps } from "./components/radio/radio.js";
|
|
8
|
+
import "./components/radio/index.js";
|
|
9
|
+
import { Spinner, SpinnerPosition, SpinnerProps } from "./components/spinner/spinner.js";
|
|
10
|
+
import "./components/spinner/index.js";
|
|
11
|
+
import { TextArea, TextAreaProps } from "./components/textarea/textarea.js";
|
|
12
|
+
import "./components/textarea/index.js";
|
|
13
|
+
export { Button, type ButtonComponentProps, type ButtonLinkProps, type ButtonProps, CheckboxInput, type CheckboxInputProps, Input, type InputProps, RadioInput, type RadioInputProps, Spinner, type SpinnerPosition, type SpinnerProps, TextArea, type TextAreaProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Button } from "./components/button/button.js";
|
|
2
|
+
import { CheckboxInput } from "./components/checkbox/checkbox.js";
|
|
3
|
+
import { Input } from "./components/input/input.js";
|
|
4
|
+
import { RadioInput } from "./components/radio/radio.js";
|
|
5
|
+
import { Spinner } from "./components/spinner/spinner.js";
|
|
6
|
+
import { TextArea } from "./components/textarea/textarea.js";
|
|
7
|
+
export { Button, CheckboxInput, Input, RadioInput, Spinner, TextArea };
|
package/dist/lib/cn.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// src/lib/cn.ts
|
|
2
|
+
const pushClass = (classes, value) => {
|
|
3
|
+
if (!value) return;
|
|
4
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
5
|
+
classes.push(String(value));
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
value.forEach((item) => pushClass(classes, item));
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
for (const key of Object.keys(value)) if (value[key]) classes.push(key);
|
|
13
|
+
};
|
|
14
|
+
/** Склейка классов. Без tailwind-merge: в модулях класс один, конфликт решает последний в списке. */
|
|
15
|
+
const cn = (...inputs) => {
|
|
16
|
+
const classes = [];
|
|
17
|
+
inputs.forEach((input) => pushClass(classes, input));
|
|
18
|
+
return classes.join(" ");
|
|
19
|
+
};
|
|
20
|
+
/** Класс из CSS-модуля. Индекс `*.scss` под `noUncheckedIndexedAccess` — `string | undefined`. */
|
|
21
|
+
const when = (enabled, className) => Boolean(enabled) && className ? className : false;
|
|
22
|
+
exports.cn = cn;
|
|
23
|
+
exports.when = when;
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=cn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.cjs","names":[],"sources":["../../src/lib/cn.ts"],"sourcesContent":["type ClassDictionary = Record<string, boolean | null | undefined>;\ntype ClassValue =\n | string\n | number\n | null\n | undefined\n | false\n | ClassDictionary\n | ClassValue[];\n\nconst pushClass = (classes: string[], value: ClassValue): void => {\n if (!value) return;\n\n if (typeof value === 'string' || typeof value === 'number') {\n classes.push(String(value));\n return;\n }\n\n if (Array.isArray(value)) {\n value.forEach(item => pushClass(classes, item));\n return;\n }\n\n for (const key of Object.keys(value)) {\n if (value[key]) classes.push(key);\n }\n};\n\n/** Склейка классов. Без tailwind-merge: в модулях класс один, конфликт решает последний в списке. */\nexport const cn = (...inputs: ClassValue[]): string => {\n const classes: string[] = [];\n inputs.forEach(input => pushClass(classes, input));\n return classes.join(' ');\n};\n\n/** Класс из CSS-модуля. Индекс `*.scss` под `noUncheckedIndexedAccess` — `string | undefined`. */\nexport const when = (\n enabled: boolean | undefined,\n className: string | undefined,\n): string | false => (Boolean(enabled) && className ? className : false);\n"],"mappings":";AAUA,MAAM,aAAa,SAAmB,UAA4B;CAChE,IAAI,CAAC,OAAO;CAEZ,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;EAC1D,QAAQ,KAAK,OAAO,KAAK,CAAC;EAC1B;CACF;CAEA,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,MAAM,SAAQ,SAAQ,UAAU,SAAS,IAAI,CAAC;EAC9C;CACF;CAEA,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GACjC,IAAI,MAAM,MAAM,QAAQ,KAAK,GAAG;AAEpC;;AAGA,MAAa,MAAM,GAAG,WAAiC;CACrD,MAAM,UAAoB,CAAC;CAC3B,OAAO,SAAQ,UAAS,UAAU,SAAS,KAAK,CAAC;CACjD,OAAO,QAAQ,KAAK,GAAG;AACzB;;AAGA,MAAa,QACX,SACA,cACoB,QAAQ,OAAO,KAAK,YAAY,YAAY"}
|
package/dist/lib/cn.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// src/lib/cn.ts
|
|
2
|
+
const pushClass = (classes, value) => {
|
|
3
|
+
if (!value) return;
|
|
4
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
5
|
+
classes.push(String(value));
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
if (Array.isArray(value)) {
|
|
9
|
+
value.forEach((item) => pushClass(classes, item));
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
for (const key of Object.keys(value)) if (value[key]) classes.push(key);
|
|
13
|
+
};
|
|
14
|
+
/** Склейка классов. Без tailwind-merge: в модулях класс один, конфликт решает последний в списке. */
|
|
15
|
+
const cn = (...inputs) => {
|
|
16
|
+
const classes = [];
|
|
17
|
+
inputs.forEach((input) => pushClass(classes, input));
|
|
18
|
+
return classes.join(" ");
|
|
19
|
+
};
|
|
20
|
+
/** Класс из CSS-модуля. Индекс `*.scss` под `noUncheckedIndexedAccess` — `string | undefined`. */
|
|
21
|
+
const when = (enabled, className) => Boolean(enabled) && className ? className : false;
|
|
22
|
+
export { cn, when };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=cn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","names":[],"sources":["../../src/lib/cn.ts"],"sourcesContent":["type ClassDictionary = Record<string, boolean | null | undefined>;\ntype ClassValue =\n | string\n | number\n | null\n | undefined\n | false\n | ClassDictionary\n | ClassValue[];\n\nconst pushClass = (classes: string[], value: ClassValue): void => {\n if (!value) return;\n\n if (typeof value === 'string' || typeof value === 'number') {\n classes.push(String(value));\n return;\n }\n\n if (Array.isArray(value)) {\n value.forEach(item => pushClass(classes, item));\n return;\n }\n\n for (const key of Object.keys(value)) {\n if (value[key]) classes.push(key);\n }\n};\n\n/** Склейка классов. Без tailwind-merge: в модулях класс один, конфликт решает последний в списке. */\nexport const cn = (...inputs: ClassValue[]): string => {\n const classes: string[] = [];\n inputs.forEach(input => pushClass(classes, input));\n return classes.join(' ');\n};\n\n/** Класс из CSS-модуля. Индекс `*.scss` под `noUncheckedIndexedAccess` — `string | undefined`. */\nexport const when = (\n enabled: boolean | undefined,\n className: string | undefined,\n): string | false => (Boolean(enabled) && className ? className : false);\n"],"mappings":";AAUA,MAAM,aAAa,SAAmB,UAA4B;CAChE,IAAI,CAAC,OAAO;CAEZ,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;EAC1D,QAAQ,KAAK,OAAO,KAAK,CAAC;EAC1B;CACF;CAEA,IAAI,MAAM,QAAQ,KAAK,GAAG;EACxB,MAAM,SAAQ,SAAQ,UAAU,SAAS,IAAI,CAAC;EAC9C;CACF;CAEA,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GACjC,IAAI,MAAM,MAAM,QAAQ,KAAK,GAAG;AAEpC;;AAGA,MAAa,MAAM,GAAG,WAAiC;CACrD,MAAM,UAAoB,CAAC;CAC3B,OAAO,SAAQ,UAAS,UAAU,SAAS,KAAK,CAAC;CACjD,OAAO,QAAQ,KAAK,GAAG;AACzB;;AAGA,MAAa,QACX,SACA,cACoB,QAAQ,OAAO,KAAK,YAAY,YAAY"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
// База приложения. Шрифт Inter подключает хост — файлы лежат в splittest-frontend/src/app/fonts.
|
|
2
|
+
@import './vars.scss';
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--pink: #ff00ff;
|
|
6
|
+
--blue: #00aaff;
|
|
7
|
+
--window-max-height: 100vh;
|
|
8
|
+
--wrapper-padding: 20px;
|
|
9
|
+
|
|
10
|
+
@media (min-width: $tabletWidth) {
|
|
11
|
+
--wrapper-padding: 30px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
*,
|
|
16
|
+
*:before,
|
|
17
|
+
*:after {
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
html,
|
|
26
|
+
body {
|
|
27
|
+
height: 100%;
|
|
28
|
+
scrollbar-gutter: stable;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
margin: 0;
|
|
35
|
+
font-family: $mainFontName;
|
|
36
|
+
-webkit-font-smoothing: antialiased;
|
|
37
|
+
-moz-osx-font-smoothing: grayscale;
|
|
38
|
+
color: $colorBlack;
|
|
39
|
+
background-color: $mainBgColor;
|
|
40
|
+
font-size: $bodyFontSize;
|
|
41
|
+
line-height: 20px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
|
|
44
|
+
&::after {
|
|
45
|
+
content: '';
|
|
46
|
+
display: block;
|
|
47
|
+
background-color: rgba($colorBlack, 0.3);
|
|
48
|
+
position: fixed;
|
|
49
|
+
left: 0;
|
|
50
|
+
top: 0;
|
|
51
|
+
right: 0;
|
|
52
|
+
bottom: 0;
|
|
53
|
+
z-index: 100;
|
|
54
|
+
opacity: 0;
|
|
55
|
+
visibility: hidden;
|
|
56
|
+
transition:
|
|
57
|
+
opacity 0.3s ease,
|
|
58
|
+
visibility 0.3s ease;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.body {
|
|
63
|
+
&--close {
|
|
64
|
+
height: 100vh;
|
|
65
|
+
overflow-y: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--modal {
|
|
69
|
+
&::after {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
visibility: visible;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#root {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
height: 100%;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.main {
|
|
83
|
+
flex: 1 0 auto;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wrapper {
|
|
87
|
+
min-width: 340px;
|
|
88
|
+
width: 100%;
|
|
89
|
+
margin-left: auto;
|
|
90
|
+
margin-right: auto;
|
|
91
|
+
padding-left: var(--wrapper-padding);
|
|
92
|
+
padding-right: var(--wrapper-padding);
|
|
93
|
+
|
|
94
|
+
@media (min-width: $tabletWidth) {
|
|
95
|
+
max-width: 680px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (min-width: $laptopWidth) {
|
|
99
|
+
max-width: 1000px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.scroll-block::-webkit-scrollbar {
|
|
104
|
+
-webkit-appearance: none;
|
|
105
|
+
width: 8px;
|
|
106
|
+
height: 8px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.scroll-block::-webkit-scrollbar-thumb {
|
|
110
|
+
border-radius: 4px;
|
|
111
|
+
background-color: #c3c3c3;
|
|
112
|
+
box-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
a {
|
|
116
|
+
text-decoration: none;
|
|
117
|
+
transition: color 0.3s ease;
|
|
118
|
+
color: $colorBlack;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button {
|
|
122
|
+
color: $colorBlack;
|
|
123
|
+
font-size: $bodyFontSize;
|
|
124
|
+
font-family: $mainFontName;
|
|
125
|
+
|
|
126
|
+
&:not(:disabled) {
|
|
127
|
+
cursor: pointer;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
img {
|
|
132
|
+
display: block;
|
|
133
|
+
max-width: 100%;
|
|
134
|
+
max-height: 100%;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
table {
|
|
138
|
+
width: 100%;
|
|
139
|
+
border-collapse: collapse;
|
|
140
|
+
|
|
141
|
+
tr {
|
|
142
|
+
vertical-align: top;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
td {
|
|
146
|
+
word-break: break-word;
|
|
147
|
+
border-top: 1px solid $borderColor;
|
|
148
|
+
padding: 15px 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
tr:last-of-type td {
|
|
152
|
+
border-bottom: 1px solid $borderColor;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
th {
|
|
156
|
+
color: rgba($colorBlack, 0.5);
|
|
157
|
+
font-size: 11px;
|
|
158
|
+
line-height: 15px;
|
|
159
|
+
text-align: left;
|
|
160
|
+
font-weight: normal;
|
|
161
|
+
padding: 15px 0;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
h1,
|
|
166
|
+
h2,
|
|
167
|
+
h3 {
|
|
168
|
+
text-align: left;
|
|
169
|
+
font-weight: 900;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
h1 {
|
|
173
|
+
font-size: 28px;
|
|
174
|
+
line-height: 30px;
|
|
175
|
+
|
|
176
|
+
@media (min-width: $tabletWidth) {
|
|
177
|
+
font-size: 45px;
|
|
178
|
+
line-height: 50px;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
h2 {
|
|
183
|
+
font-size: 28px;
|
|
184
|
+
line-height: 30px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
h3 {
|
|
188
|
+
font-size: 18px;
|
|
189
|
+
line-height: 20px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
h4 {
|
|
193
|
+
font-size: 14px;
|
|
194
|
+
line-height: 20px;
|
|
195
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
@import './vars.scss';
|
|
2
|
+
|
|
3
|
+
@mixin btn-focus {
|
|
4
|
+
&:focus {
|
|
5
|
+
outline: initial;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
&:focus:not(:focus-visible) {
|
|
9
|
+
outline: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:focus-visible {
|
|
13
|
+
outline: 1px solid $colorBlack;
|
|
14
|
+
background: transparent;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
@mixin reset-list {
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
list-style: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@mixin reset-btn {
|
|
25
|
+
padding: 0;
|
|
26
|
+
border: none;
|
|
27
|
+
background-color: transparent;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@mixin reset-input {
|
|
31
|
+
border: none;
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@mixin btn-min {
|
|
36
|
+
display: block;
|
|
37
|
+
width: fit-content;
|
|
38
|
+
height: 30px;
|
|
39
|
+
padding: 0 9px;
|
|
40
|
+
font-size: 14px;
|
|
41
|
+
font-weight: 700;
|
|
42
|
+
color: $colorWhite;
|
|
43
|
+
background-color: $colorBlue;
|
|
44
|
+
border: none;
|
|
45
|
+
border-radius: 5px;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
transition: $tr;
|
|
48
|
+
|
|
49
|
+
&:disabled {
|
|
50
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
51
|
+
color: rgba(0, 0, 0, 0.5);
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&:active,
|
|
56
|
+
&:hover {
|
|
57
|
+
background-color: $colorBlack;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@mixin input-min {
|
|
62
|
+
height: 38px;
|
|
63
|
+
border-radius: $borderRadius;
|
|
64
|
+
border: 4px solid $colorWhite;
|
|
65
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
66
|
+
padding: 0 15px;
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
transition: $tr;
|
|
69
|
+
background-color: $colorWhite;
|
|
70
|
+
appearance: none;
|
|
71
|
+
outline: none;
|
|
72
|
+
|
|
73
|
+
&:hover,
|
|
74
|
+
&:focus {
|
|
75
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&--recommend {
|
|
79
|
+
background-color: rgba(#ffbf00, 0.1);
|
|
80
|
+
|
|
81
|
+
&:not([value='']) {
|
|
82
|
+
background-color: $colorWhite;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:required {
|
|
87
|
+
background-color: rgba(#ff002a, 0.1);
|
|
88
|
+
|
|
89
|
+
&:valid {
|
|
90
|
+
background-color: $colorWhite;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&:disabled {
|
|
95
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
96
|
+
border-color: $borderColor;
|
|
97
|
+
color: rgba($colorBlack, 0.5);
|
|
98
|
+
outline-offset: 0;
|
|
99
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
100
|
+
|
|
101
|
+
&:hover,
|
|
102
|
+
&:focus {
|
|
103
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&::-webkit-input-placeholder {
|
|
108
|
+
color: rgba($colorBlack, 0.5);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (max-width: $tabletWidth) {
|
|
112
|
+
font-size: 16px;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@mixin linkActiveElement {
|
|
117
|
+
content: '';
|
|
118
|
+
position: absolute;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
bottom: -2px;
|
|
121
|
+
left: 0;
|
|
122
|
+
display: block;
|
|
123
|
+
width: calc(100% - 1px);
|
|
124
|
+
height: 2px;
|
|
125
|
+
background-color: $colorBlack;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
@mixin popupShow {
|
|
129
|
+
visibility: visible;
|
|
130
|
+
opacity: 1;
|
|
131
|
+
z-index: 12;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
@mixin popupHide {
|
|
135
|
+
visibility: hidden;
|
|
136
|
+
opacity: 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@mixin popupStyle($maxWidth: 360px, $padding: 24px 30px) {
|
|
140
|
+
position: absolute;
|
|
141
|
+
z-index: 0;
|
|
142
|
+
max-width: $maxWidth;
|
|
143
|
+
padding: $padding;
|
|
144
|
+
box-shadow: $popupBoxShadow;
|
|
145
|
+
background: $colorWhite;
|
|
146
|
+
border-radius: 5px;
|
|
147
|
+
text-align: left;
|
|
148
|
+
color: $colorBlack;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@mixin buttonArea($width: 20px) {
|
|
152
|
+
position: relative;
|
|
153
|
+
|
|
154
|
+
&::after {
|
|
155
|
+
content: '';
|
|
156
|
+
display: block;
|
|
157
|
+
position: absolute;
|
|
158
|
+
top: -#{$width * 0.5};
|
|
159
|
+
left: -#{$width * 0.5};
|
|
160
|
+
width: calc(100% + #{$width});
|
|
161
|
+
height: calc(100% + #{$width});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@mixin h2 {
|
|
166
|
+
margin: 0 0 10px;
|
|
167
|
+
font-size: 18px;
|
|
168
|
+
line-height: 20px;
|
|
169
|
+
font-weight: 900;
|
|
170
|
+
|
|
171
|
+
@media (min-width: $tabletWidth) {
|
|
172
|
+
margin-bottom: 15px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@mixin imgWrap {
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
border: 1px solid $borderColor;
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
|
|
183
|
+
img {
|
|
184
|
+
z-index: -1;
|
|
185
|
+
object-fit: contain;
|
|
186
|
+
margin-inline: auto;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Токены splittest. Источник: splittest-frontend/src/app/styles/vars.scss
|
|
2
|
+
$colorBlack: #000;
|
|
3
|
+
$colorWhite: #fff;
|
|
4
|
+
|
|
5
|
+
$colorBlue: #002bff;
|
|
6
|
+
$colorRed: #ff0000;
|
|
7
|
+
$colorGreen: #00a66f;
|
|
8
|
+
$colorYellow: #ffbf00;
|
|
9
|
+
$colorGray: #e5e5e5;
|
|
10
|
+
$colorGrayIcon: #727272;
|
|
11
|
+
$colorGrayTwo: #808080;
|
|
12
|
+
$colorOrange: #ff7f00;
|
|
13
|
+
$colorBackground: #f7f7f7;
|
|
14
|
+
|
|
15
|
+
$borderRadius: 5px;
|
|
16
|
+
$borderRadiusBig: 10px;
|
|
17
|
+
$borderColor: rgba($colorBlack, 0.1);
|
|
18
|
+
$borderShadowTop: 0 -1px 0 0 $borderColor;
|
|
19
|
+
$borderShadowBottom: 0 1px 0 0 $borderColor;
|
|
20
|
+
$borderInputColor: #d9d9d9;
|
|
21
|
+
$tr: all 0.3s ease;
|
|
22
|
+
$trParam: 0.3s ease;
|
|
23
|
+
$trBg: background-color 0.3s ease;
|
|
24
|
+
$popupBoxShadow: 0px 10px 40px 0px rgba(0, 0, 0, 0.15);
|
|
25
|
+
$bgColorSidebarBlock: rgba(0, 0, 0, 0.03);
|
|
26
|
+
|
|
27
|
+
$inputRecomendBg: rgba(#ffbf00, 0.1);
|
|
28
|
+
$inputRequiredBg: rgba(#ff0000, 0.1);
|
|
29
|
+
$inputErrorBorder: rgba(#ff0000, 0.5);
|
|
30
|
+
|
|
31
|
+
$desktopWidth: 1200px;
|
|
32
|
+
$laptopWidth: 1000px;
|
|
33
|
+
$tabletWidth: 680px;
|
|
34
|
+
$mobileWidth: 576px;
|
|
35
|
+
|
|
36
|
+
$mainFontName: 'Inter', sans-serif;
|
|
37
|
+
$bodyFontSize: 14px;
|
|
38
|
+
$mainBgColor: #fff;
|
|
39
|
+
$mainIndexBgColor: #f0f1f5;
|
package/package.json
CHANGED
|
@@ -1,6 +1,94 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@de-kit/st-ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "React-компоненты splittest: SCSS-модули и токены из основного фронтенда",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/apocalipsizzz/splittest-ui.git"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": [
|
|
16
|
+
"**/*.scss",
|
|
17
|
+
"**/*.css"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./dist/index.d.cts",
|
|
30
|
+
"default": "./dist/index.cjs"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"./global.scss": "./dist/styles/global.scss",
|
|
34
|
+
"./vars.scss": "./dist/styles/vars.scss",
|
|
35
|
+
"./mixins.scss": "./dist/styles/mixins.scss",
|
|
36
|
+
"./package.json": "./package.json"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
43
|
+
"@changesets/cli": "^3.0.3",
|
|
44
|
+
"@storybook/addon-a11y": "^10.6.3",
|
|
45
|
+
"@storybook/addon-docs": "^10.6.3",
|
|
46
|
+
"@storybook/react-vite": "^10.6.3",
|
|
47
|
+
"@testing-library/dom": "^10.4.2",
|
|
48
|
+
"@testing-library/jest-dom": "^7.0.1",
|
|
49
|
+
"@testing-library/react": "^16.3.3",
|
|
50
|
+
"@testing-library/user-event": "^14.6.8",
|
|
51
|
+
"@types/node": "^26.6.5",
|
|
52
|
+
"@types/react": "^19.3.0",
|
|
53
|
+
"@types/react-dom": "^19.3.0",
|
|
54
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
55
|
+
"jsdom": "^30.1.3",
|
|
56
|
+
"oxfmt": "^0.74.0",
|
|
57
|
+
"oxlint": "^1.89.0",
|
|
58
|
+
"publint": "^0.3.25",
|
|
59
|
+
"react": "^19.3.1",
|
|
60
|
+
"react-dom": "^19.3.1",
|
|
61
|
+
"sass": "^1.93.2",
|
|
62
|
+
"storybook": "^10.6.3",
|
|
63
|
+
"tsdown": "^0.23.2",
|
|
64
|
+
"typescript": "^6.0.3",
|
|
65
|
+
"vite": "^8.3.5",
|
|
66
|
+
"vitest": "^5.0.5"
|
|
67
|
+
},
|
|
68
|
+
"peerDependencies": {
|
|
69
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
70
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
71
|
+
},
|
|
72
|
+
"engines": {
|
|
73
|
+
"node": ">=20"
|
|
74
|
+
},
|
|
75
|
+
"scripts": {
|
|
76
|
+
"dev": "storybook dev -p 6007 --no-open",
|
|
77
|
+
"build": "pnpm run build:js && pnpm run build:styles",
|
|
78
|
+
"build:js": "tsdown",
|
|
79
|
+
"build:styles": "node scripts/copy-styles.mjs",
|
|
80
|
+
"build:storybook": "storybook build -o storybook-static",
|
|
81
|
+
"typecheck": "tsc --noEmit",
|
|
82
|
+
"lint": "oxlint",
|
|
83
|
+
"lint:fix": "oxlint --fix",
|
|
84
|
+
"format": "oxfmt --check",
|
|
85
|
+
"format:fix": "oxfmt",
|
|
86
|
+
"test": "vitest run",
|
|
87
|
+
"test:watch": "vitest",
|
|
88
|
+
"check:exports": "publint && attw --pack . --exclude-entrypoints global.scss vars.scss mixins.scss",
|
|
89
|
+
"verify": "pnpm run typecheck && pnpm run lint && pnpm run test && pnpm run build && pnpm run check:exports",
|
|
90
|
+
"changeset": "changeset",
|
|
91
|
+
"version": "changeset version",
|
|
92
|
+
"release": "pnpm run verify && changeset publish"
|
|
93
|
+
}
|
|
6
94
|
}
|