@de-kit/st-ui 0.0.0-stage → 0.1.1
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/components/button/button.cjs +47 -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.scss +93 -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 +27 -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.scss +108 -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 +18 -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.scss +64 -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 +27 -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.scss +109 -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 +54 -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.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 +28 -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.scss +58 -0
- package/dist/index.cjs +14 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +8 -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 +186 -0
- package/dist/styles/vars.scss +36 -0
- package/package.json +91 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import "./styles/vars.scss";
|
|
8
|
+
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
|
+
/** Условный класс. Пустая строка и `undefined` в `cn` не попадают. */
|
|
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/** Условный класс. Пустая строка и `undefined` в `cn` не попадают. */\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
|
+
/** Условный класс. Пустая строка и `undefined` в `cn` не попадают. */
|
|
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/** Условный класс. Пустая строка и `undefined` в `cn` не попадают. */\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
|
+
// Токены (`--color-*`) подключает вход пакета, этот файл их не эмитит.
|
|
3
|
+
|
|
4
|
+
:root {
|
|
5
|
+
--pink: #ff00ff;
|
|
6
|
+
--blue: #00aaff;
|
|
7
|
+
--window-max-height: 100vh;
|
|
8
|
+
--wrapper-padding: 20px;
|
|
9
|
+
|
|
10
|
+
@media (min-width: 680px) {
|
|
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: var(--font-sans);
|
|
36
|
+
-webkit-font-smoothing: antialiased;
|
|
37
|
+
-moz-osx-font-smoothing: grayscale;
|
|
38
|
+
color: var(--color-black);
|
|
39
|
+
background-color: var(--color-white);
|
|
40
|
+
font-size: var(--text-sm);
|
|
41
|
+
line-height: 20px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
|
|
44
|
+
&::after {
|
|
45
|
+
content: '';
|
|
46
|
+
display: block;
|
|
47
|
+
background-color: color-mix(in srgb, var(--color-black) 30%, transparent);
|
|
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: 680px) {
|
|
95
|
+
max-width: 680px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
@media (min-width: 1000px) {
|
|
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: var(--color-black);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
button {
|
|
122
|
+
color: var(--color-black);
|
|
123
|
+
font-size: var(--text-sm);
|
|
124
|
+
font-family: var(--font-sans);
|
|
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 var(--color-border);
|
|
148
|
+
padding: 15px 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
tr:last-of-type td {
|
|
152
|
+
border-bottom: 1px solid var(--color-border);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
th {
|
|
156
|
+
color: color-mix(in srgb, var(--color-black) 50%, transparent);
|
|
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: 680px) {
|
|
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,186 @@
|
|
|
1
|
+
@mixin btn-focus {
|
|
2
|
+
&:focus {
|
|
3
|
+
outline: initial;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
&:focus:not(:focus-visible) {
|
|
7
|
+
outline: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
&:focus-visible {
|
|
11
|
+
outline: 1px solid var(--color-black);
|
|
12
|
+
background: transparent;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@mixin reset-list {
|
|
17
|
+
padding: 0;
|
|
18
|
+
margin: 0;
|
|
19
|
+
list-style: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@mixin reset-btn {
|
|
23
|
+
padding: 0;
|
|
24
|
+
border: none;
|
|
25
|
+
background-color: transparent;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin reset-input {
|
|
29
|
+
border: none;
|
|
30
|
+
background-color: transparent;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@mixin btn-min {
|
|
34
|
+
display: block;
|
|
35
|
+
width: fit-content;
|
|
36
|
+
height: 30px;
|
|
37
|
+
padding: 0 9px;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
font-weight: 700;
|
|
40
|
+
color: var(--color-white);
|
|
41
|
+
background-color: var(--color-blue);
|
|
42
|
+
border: none;
|
|
43
|
+
border-radius: 5px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
transition: all var(--default-transition-duration) var(--default-transition-timing-function);
|
|
46
|
+
|
|
47
|
+
&:disabled {
|
|
48
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
49
|
+
color: rgba(0, 0, 0, 0.5);
|
|
50
|
+
pointer-events: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&:active,
|
|
54
|
+
&:hover {
|
|
55
|
+
background-color: var(--color-black);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@mixin input-min {
|
|
60
|
+
height: 38px;
|
|
61
|
+
border-radius: var(--radius-sm);
|
|
62
|
+
border: 4px solid var(--color-white);
|
|
63
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
64
|
+
padding: 0 15px;
|
|
65
|
+
font-size: 14px;
|
|
66
|
+
transition: all var(--default-transition-duration) var(--default-transition-timing-function);
|
|
67
|
+
background-color: var(--color-white);
|
|
68
|
+
appearance: none;
|
|
69
|
+
outline: none;
|
|
70
|
+
|
|
71
|
+
&:hover,
|
|
72
|
+
&:focus {
|
|
73
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--recommend {
|
|
77
|
+
background-color: color-mix(in srgb, var(--color-yellow) 10%, transparent);
|
|
78
|
+
|
|
79
|
+
&:not([value='']) {
|
|
80
|
+
background-color: var(--color-white);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&:required {
|
|
85
|
+
background-color: rgba(#ff002a, 0.1);
|
|
86
|
+
|
|
87
|
+
&:valid {
|
|
88
|
+
background-color: var(--color-white);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:disabled {
|
|
93
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
94
|
+
border-color: var(--color-border);
|
|
95
|
+
color: color-mix(in srgb, var(--color-black) 50%, transparent);
|
|
96
|
+
outline-offset: 0;
|
|
97
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
98
|
+
|
|
99
|
+
&:hover,
|
|
100
|
+
&:focus {
|
|
101
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&::-webkit-input-placeholder {
|
|
106
|
+
color: color-mix(in srgb, var(--color-black) 50%, transparent);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (max-width: 680px) {
|
|
110
|
+
font-size: 16px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@mixin linkActiveElement {
|
|
115
|
+
content: '';
|
|
116
|
+
position: absolute;
|
|
117
|
+
z-index: 1;
|
|
118
|
+
bottom: -2px;
|
|
119
|
+
left: 0;
|
|
120
|
+
display: block;
|
|
121
|
+
width: calc(100% - 1px);
|
|
122
|
+
height: 2px;
|
|
123
|
+
background-color: var(--color-black);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@mixin popupShow {
|
|
127
|
+
visibility: visible;
|
|
128
|
+
opacity: 1;
|
|
129
|
+
z-index: 12;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@mixin popupHide {
|
|
133
|
+
visibility: hidden;
|
|
134
|
+
opacity: 0;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@mixin popupStyle($maxWidth: 360px, $padding: 24px 30px) {
|
|
138
|
+
position: absolute;
|
|
139
|
+
z-index: 0;
|
|
140
|
+
max-width: $maxWidth;
|
|
141
|
+
padding: $padding;
|
|
142
|
+
box-shadow: var(--shadow-xl);
|
|
143
|
+
background: var(--color-white);
|
|
144
|
+
border-radius: 5px;
|
|
145
|
+
text-align: left;
|
|
146
|
+
color: var(--color-black);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
@mixin buttonArea($width: 20px) {
|
|
150
|
+
position: relative;
|
|
151
|
+
|
|
152
|
+
&::after {
|
|
153
|
+
content: '';
|
|
154
|
+
display: block;
|
|
155
|
+
position: absolute;
|
|
156
|
+
top: -#{$width * 0.5};
|
|
157
|
+
left: -#{$width * 0.5};
|
|
158
|
+
width: calc(100% + #{$width});
|
|
159
|
+
height: calc(100% + #{$width});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
@mixin h2 {
|
|
164
|
+
margin: 0 0 10px;
|
|
165
|
+
font-size: 18px;
|
|
166
|
+
line-height: 20px;
|
|
167
|
+
font-weight: 900;
|
|
168
|
+
|
|
169
|
+
@media (min-width: 680px) {
|
|
170
|
+
margin-bottom: 15px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
@mixin imgWrap {
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: center;
|
|
178
|
+
border: 1px solid var(--color-border);
|
|
179
|
+
overflow: hidden;
|
|
180
|
+
|
|
181
|
+
img {
|
|
182
|
+
z-index: -1;
|
|
183
|
+
object-fit: contain;
|
|
184
|
+
margin-inline: auto;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Токены splittest. Имена как у Tailwind, значения свои — не дефолтная шкала.
|
|
2
|
+
// В @media custom properties нельзя: там те же px, что у --breakpoint-*.
|
|
3
|
+
:root {
|
|
4
|
+
--color-black: #000;
|
|
5
|
+
--color-white: #fff;
|
|
6
|
+
--color-blue: #002bff;
|
|
7
|
+
--color-red: #ff0000;
|
|
8
|
+
--color-green: #00a66f;
|
|
9
|
+
--color-yellow: #ffbf00;
|
|
10
|
+
--color-orange: #ff7f00;
|
|
11
|
+
--color-gray: #808080;
|
|
12
|
+
--color-neutral-100: #f7f7f7;
|
|
13
|
+
--color-neutral-200: #e5e5e5;
|
|
14
|
+
--color-neutral-500: #727272;
|
|
15
|
+
--color-input: #d9d9d9;
|
|
16
|
+
--color-border: color-mix(in srgb, var(--color-black) 10%, transparent);
|
|
17
|
+
--color-sidebar: color-mix(in srgb, var(--color-black) 3%, transparent);
|
|
18
|
+
|
|
19
|
+
--radius-sm: 5px;
|
|
20
|
+
--radius-lg: 10px;
|
|
21
|
+
|
|
22
|
+
--font-sans: 'Inter', sans-serif;
|
|
23
|
+
--text-sm: 14px;
|
|
24
|
+
|
|
25
|
+
--shadow-xl: 0 10px 40px 0 rgb(0 0 0 / 0.15);
|
|
26
|
+
--shadow-t: 0 -1px 0 0 var(--color-border);
|
|
27
|
+
--shadow-b: 0 1px 0 0 var(--color-border);
|
|
28
|
+
|
|
29
|
+
--breakpoint-sm: 576px;
|
|
30
|
+
--breakpoint-md: 680px;
|
|
31
|
+
--breakpoint-lg: 1000px;
|
|
32
|
+
--breakpoint-xl: 1200px;
|
|
33
|
+
|
|
34
|
+
--default-transition-duration: 0.3s;
|
|
35
|
+
--default-transition-timing-function: ease;
|
|
36
|
+
}
|
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.1",
|
|
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
|
}
|