@de-kit/st-ui 0.1.5 → 0.1.6
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 -17
- package/dist/components/button/button.cjs +37 -17
- package/dist/components/button/button.cjs.map +1 -1
- package/dist/components/button/button.d.cts +7 -2
- package/dist/components/button/button.d.ts +7 -2
- package/dist/components/button/button.js +37 -17
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button/button.scss +65 -27
- package/dist/components/checkbox/checkbox.cjs +50 -8
- package/dist/components/checkbox/checkbox.cjs.map +1 -1
- package/dist/components/checkbox/checkbox.d.cts +11 -4
- package/dist/components/checkbox/checkbox.d.ts +11 -4
- package/dist/components/checkbox/checkbox.js +51 -9
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/checkbox/checkbox.scss +55 -26
- package/dist/components/field/field-context.cjs +9 -0
- package/dist/components/field/field-context.cjs.map +1 -0
- package/dist/components/field/field-context.js +8 -0
- package/dist/components/field/field-context.js.map +1 -0
- package/dist/components/field/field.cjs +105 -0
- package/dist/components/field/field.cjs.map +1 -0
- package/dist/components/field/field.d.cts +24 -0
- package/dist/components/field/field.d.ts +24 -0
- package/dist/components/field/field.js +105 -0
- package/dist/components/field/field.js.map +1 -0
- package/dist/components/field/field.scss +43 -0
- package/dist/components/field/index.d.cts +2 -0
- package/dist/components/field/index.d.ts +2 -0
- package/dist/components/input/index.d.cts +2 -2
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/input.cjs +88 -8
- package/dist/components/input/input.cjs.map +1 -1
- package/dist/components/input/input.d.cts +8 -1
- package/dist/components/input/input.d.ts +8 -1
- package/dist/components/input/input.js +90 -10
- package/dist/components/input/input.js.map +1 -1
- package/dist/components/input/input.scss +77 -14
- package/dist/components/radio/index.d.cts +2 -2
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/radio/radio.cjs +47 -5
- package/dist/components/radio/radio.cjs.map +1 -1
- package/dist/components/radio/radio.d.cts +12 -2
- package/dist/components/radio/radio.d.ts +12 -2
- package/dist/components/radio/radio.js +48 -7
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/radio/radio.scss +50 -15
- package/dist/components/spinner/spinner.cjs +38 -16
- package/dist/components/spinner/spinner.cjs.map +1 -1
- package/dist/components/spinner/spinner.d.cts +5 -3
- package/dist/components/spinner/spinner.d.ts +5 -3
- package/dist/components/spinner/spinner.js +39 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/spinner/spinner.scss +18 -1
- package/dist/components/textarea/index.d.cts +2 -2
- package/dist/components/textarea/index.d.ts +2 -2
- package/dist/components/textarea/textarea.cjs +68 -9
- package/dist/components/textarea/textarea.cjs.map +1 -1
- package/dist/components/textarea/textarea.d.cts +4 -2
- package/dist/components/textarea/textarea.d.ts +4 -2
- package/dist/components/textarea/textarea.js +69 -10
- package/dist/components/textarea/textarea.js.map +1 -1
- package/dist/components/textarea/textarea.scss +50 -23
- package/dist/icons/index.cjs +2 -2
- package/dist/icons/index.js +2 -2
- package/dist/index.cjs +3 -0
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +3 -2
- package/dist/styles/global.scss +33 -27
- package/dist/styles/mixins.scss +37 -174
- package/dist/styles/vars.scss +73 -22
- package/package.json +1 -1
|
@@ -1,24 +1,83 @@
|
|
|
1
1
|
import { cn, when } from "../../lib/cn.js";
|
|
2
|
-
import {
|
|
2
|
+
import { useFieldControl } from "../field/field-context.js";
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useId, useRef, useState } from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import "./textarea.scss";
|
|
5
6
|
// src/components/textarea/textarea.tsx
|
|
6
|
-
const
|
|
7
|
+
const assignRef = (ref, node) => {
|
|
8
|
+
if (typeof ref === "function") {
|
|
9
|
+
ref(node);
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (ref) ref.current = node;
|
|
13
|
+
};
|
|
14
|
+
const TextArea = forwardRef(function TextArea({ maxLength, value, size = "md", recommended, error, counter = true, className, id, onChange, "aria-describedby": ariaDescribedBy, ...props }, ref) {
|
|
15
|
+
const autoId = useId();
|
|
16
|
+
const field = useFieldControl();
|
|
17
|
+
const reportValue = field?.reportValue;
|
|
18
|
+
const textareaId = field?.id ?? id ?? autoId;
|
|
19
|
+
const textareaRef = useRef(null);
|
|
20
|
+
const [length, setLength] = useState(0);
|
|
21
|
+
const withCounter = maxLength !== void 0 && counter;
|
|
22
|
+
const isInvalid = Boolean(error) || Boolean(field?.invalid);
|
|
23
|
+
const setRef = useCallback((node) => {
|
|
24
|
+
textareaRef.current = node;
|
|
25
|
+
assignRef(ref, node);
|
|
26
|
+
}, [ref]);
|
|
27
|
+
/**
|
|
28
|
+
* ponytail: длину счётчик читает из DOM — одинаково для `value` и `defaultValue`,
|
|
29
|
+
* включая автозаполнение. Потолок: reset формы в неконтролируемом режиме счётчик
|
|
30
|
+
* не слышит и догоняет на следующем вводе; апгрейд — слушать `reset`, как `Input`.
|
|
31
|
+
* Тот же проход отдаёт показанную строку в Field.
|
|
32
|
+
*/
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const node = textareaRef.current;
|
|
35
|
+
if (!node) return;
|
|
36
|
+
if (withCounter) setLength(node.value.length);
|
|
37
|
+
reportValue?.(node.value);
|
|
38
|
+
}, [
|
|
39
|
+
reportValue,
|
|
40
|
+
value,
|
|
41
|
+
withCounter
|
|
42
|
+
]);
|
|
43
|
+
const handleChange = (event) => {
|
|
44
|
+
if (withCounter) setLength(event.target.value.length);
|
|
45
|
+
if (value === void 0) reportValue?.(event.target.value);
|
|
46
|
+
onChange?.(event);
|
|
47
|
+
};
|
|
48
|
+
const counterId = withCounter ? `${textareaId}-counter` : void 0;
|
|
49
|
+
const describedBy = [
|
|
50
|
+
field?.describedBy,
|
|
51
|
+
counterId,
|
|
52
|
+
ariaDescribedBy
|
|
53
|
+
].filter((part) => Boolean(part)).join(" ");
|
|
7
54
|
return /* @__PURE__ */ jsxs("div", {
|
|
8
55
|
className: "textarea__wrap",
|
|
9
56
|
children: [/* @__PURE__ */ jsx("textarea", {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
57
|
+
...props,
|
|
58
|
+
ref: setRef,
|
|
59
|
+
id: textareaId,
|
|
60
|
+
className: cn("textarea", className, when(size !== "md", `textarea--${size}`), when(recommended, "textarea--recommended"), when(isInvalid, "textarea--error")),
|
|
61
|
+
...value !== void 0 ? { value } : {},
|
|
13
62
|
maxLength,
|
|
14
|
-
|
|
15
|
-
...
|
|
16
|
-
|
|
63
|
+
onChange: handleChange,
|
|
64
|
+
...isInvalid ? { "aria-invalid": true } : {},
|
|
65
|
+
...field?.required ? {
|
|
66
|
+
"required": true,
|
|
67
|
+
"aria-required": true
|
|
68
|
+
} : {},
|
|
69
|
+
...describedBy ? { "aria-describedby": describedBy } : {},
|
|
70
|
+
...field?.errorId ? { "aria-errormessage": field.errorId } : {}
|
|
71
|
+
}), withCounter ? /* @__PURE__ */ jsxs("span", {
|
|
72
|
+
id: counterId,
|
|
17
73
|
className: "textarea__counter",
|
|
18
74
|
children: [
|
|
19
|
-
"
|
|
75
|
+
"Осталось ",
|
|
76
|
+
Math.max(0, (maxLength ?? 0) - length),
|
|
77
|
+
" из ",
|
|
20
78
|
maxLength,
|
|
21
|
-
"
|
|
79
|
+
" ",
|
|
80
|
+
"символов"
|
|
22
81
|
]
|
|
23
82
|
}) : null]
|
|
24
83
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/textarea/textarea.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"textarea.js","names":[],"sources":["../../../src/components/textarea/textarea.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ChangeEvent,\n type Ref,\n type TextareaHTMLAttributes,\n} from 'react';\n\nimport { useFieldControl } from '@/components/field/field-context';\nimport { cn, when } from '@/lib/cn';\nimport './textarea.scss';\n\nexport type TextAreaSize = 'sm' | 'md' | 'lg';\n\nexport interface TextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {\n size?: TextAreaSize;\n recommended?: boolean;\n error?: boolean;\n /** Счётчик остатка при `maxLength`. `false` — то, что в приложении было `noMaxMoty`. */\n counter?: boolean;\n}\n\nconst assignRef = (\n ref: Ref<HTMLTextAreaElement> | undefined,\n node: HTMLTextAreaElement | null,\n) => {\n if (typeof ref === 'function') {\n ref(node);\n return;\n }\n\n if (ref) ref.current = node;\n};\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n maxLength,\n value,\n size = 'md',\n recommended,\n error,\n counter = true,\n className,\n id,\n onChange,\n 'aria-describedby': ariaDescribedBy,\n ...props\n },\n ref,\n ) {\n const autoId = useId();\n const field = useFieldControl();\n const reportValue = field?.reportValue;\n const textareaId = field?.id ?? id ?? autoId;\n const textareaRef = useRef<HTMLTextAreaElement>(null);\n const [length, setLength] = useState(0);\n const withCounter = maxLength !== undefined && counter;\n const isInvalid = Boolean(error) || Boolean(field?.invalid);\n\n const setRef = useCallback(\n (node: HTMLTextAreaElement | null) => {\n textareaRef.current = node;\n assignRef(ref, node);\n },\n [ref],\n );\n\n /**\n * ponytail: длину счётчик читает из DOM — одинаково для `value` и `defaultValue`,\n * включая автозаполнение. Потолок: reset формы в неконтролируемом режиме счётчик\n * не слышит и догоняет на следующем вводе; апгрейд — слушать `reset`, как `Input`.\n * Тот же проход отдаёт показанную строку в Field.\n */\n useEffect(() => {\n const node = textareaRef.current;\n if (!node) return;\n\n if (withCounter) setLength(node.value.length);\n reportValue?.(node.value);\n }, [reportValue, value, withCounter]);\n\n const handleChange = (event: ChangeEvent<HTMLTextAreaElement>) => {\n if (withCounter) setLength(event.target.value.length);\n if (value === undefined) reportValue?.(event.target.value);\n onChange?.(event);\n };\n\n const counterId = withCounter ? `${textareaId}-counter` : undefined;\n const describedBy = [field?.describedBy, counterId, ariaDescribedBy]\n .filter(part => Boolean(part))\n .join(' ');\n\n return (\n <div className=\"textarea__wrap\">\n <textarea\n {...props}\n ref={setRef}\n id={textareaId}\n className={cn(\n 'textarea',\n className,\n when(size !== 'md', `textarea--${size}`),\n when(recommended, 'textarea--recommended'),\n when(isInvalid, 'textarea--error'),\n )}\n {...(value !== undefined ? { value } : {})}\n maxLength={maxLength}\n onChange={handleChange}\n {...(isInvalid ? { 'aria-invalid': true } : {})}\n {...(field?.required\n ? { 'required': true, 'aria-required': true }\n : {})}\n {...(describedBy ? { 'aria-describedby': describedBy } : {})}\n {...(field?.errorId ? { 'aria-errormessage': field.errorId } : {})}\n />\n {withCounter ? (\n <span id={counterId} className=\"textarea__counter\">\n Осталось {Math.max(0, (maxLength ?? 0) - length)} из {maxLength}{' '}\n символов\n </span>\n ) : null}\n </div>\n );\n },\n);\n"],"mappings":";;;;;;AA0BA,MAAM,aACJ,KACA,SACG;CACH,IAAI,OAAO,QAAQ,YAAY;EAC7B,IAAI,IAAI;EACR;CACF;CAEA,IAAI,KAAK,IAAI,UAAU;AACzB;AAEA,MAAa,WAAW,WACtB,SAAS,SACP,EACE,WACA,OACA,OAAO,MACP,aACA,OACA,UAAU,MACV,WACA,IACA,UACA,oBAAoB,iBACpB,GAAG,SAEL,KACA;CACA,MAAM,SAAS,MAAM;CACrB,MAAM,QAAQ,gBAAgB;CAC9B,MAAM,cAAc,OAAO;CAC3B,MAAM,aAAa,OAAO,MAAM,MAAM;CACtC,MAAM,cAAc,OAA4B,IAAI;CACpD,MAAM,CAAC,QAAQ,aAAa,SAAS,CAAC;CACtC,MAAM,cAAc,cAAc,KAAA,KAAa;CAC/C,MAAM,YAAY,QAAQ,KAAK,KAAK,QAAQ,OAAO,OAAO;CAE1D,MAAM,SAAS,aACZ,SAAqC;EACpC,YAAY,UAAU;EACtB,UAAU,KAAK,IAAI;CACrB,GACA,CAAC,GAAG,CACN;;;;;;;CAQA,gBAAgB;EACd,MAAM,OAAO,YAAY;EACzB,IAAI,CAAC,MAAM;EAEX,IAAI,aAAa,UAAU,KAAK,MAAM,MAAM;EAC5C,cAAc,KAAK,KAAK;CAC1B,GAAG;EAAC;EAAa;EAAO;CAAW,CAAC;CAEpC,MAAM,gBAAgB,UAA4C;EAChE,IAAI,aAAa,UAAU,MAAM,OAAO,MAAM,MAAM;EACpD,IAAI,UAAU,KAAA,GAAW,cAAc,MAAM,OAAO,KAAK;EACzD,WAAW,KAAK;CAClB;CAEA,MAAM,YAAY,cAAc,GAAG,WAAW,YAAY,KAAA;CAC1D,MAAM,cAAc;EAAC,OAAO;EAAa;EAAW;CAAe,CAAC,CACjE,QAAO,SAAQ,QAAQ,IAAI,CAAC,CAAC,CAC7B,KAAK,GAAG;CAEX,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,YAAD;GACE,GAAI;GACJ,KAAK;GACL,IAAI;GACJ,WAAW,GACT,YACA,WACA,KAAK,SAAS,MAAM,aAAa,MAAM,GACvC,KAAK,aAAa,uBAAuB,GACzC,KAAK,WAAW,iBAAiB,CACnC;GACA,GAAK,UAAU,KAAA,IAAY,EAAE,MAAM,IAAI,CAAC;GAC7B;GACX,UAAU;GACV,GAAK,YAAY,EAAE,gBAAgB,KAAK,IAAI,CAAC;GAC7C,GAAK,OAAO,WACR;IAAE,YAAY;IAAM,iBAAiB;GAAK,IAC1C,CAAC;GACL,GAAK,cAAc,EAAE,oBAAoB,YAAY,IAAI,CAAC;GAC1D,GAAK,OAAO,UAAU,EAAE,qBAAqB,MAAM,QAAQ,IAAI,CAAC;EACjE,CAAA,GACA,cACC,qBAAC,QAAD;GAAM,IAAI;GAAW,WAAU;GAA/B,UAAA;IAAmD;IACvC,KAAK,IAAI,IAAI,aAAa,KAAK,MAAM;IAAE;IAAK;IAAW;IAAI;GAEjE;EACJ,CAAA,IAAA,IACD;;AAET,CACF"}
|
|
@@ -1,58 +1,85 @@
|
|
|
1
|
+
@use '../../styles/mixins.scss' as mixins;
|
|
2
|
+
|
|
1
3
|
.textarea__wrap {
|
|
2
4
|
position: relative;
|
|
3
5
|
}
|
|
4
6
|
|
|
5
7
|
.textarea {
|
|
8
|
+
// Паддинги как у Input соответствующего размера, высота — 0.75 / 1 / 1.25 от md.
|
|
9
|
+
--textarea-padding-y: var(--space-2);
|
|
10
|
+
--textarea-padding-x: var(--space-3);
|
|
11
|
+
--textarea-min-height: 160px;
|
|
6
12
|
box-sizing: border-box;
|
|
7
13
|
width: 100%;
|
|
8
|
-
min-height:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
font-size: 14px;
|
|
13
|
-
line-height: 20px;
|
|
14
|
+
min-height: var(--textarea-min-height);
|
|
15
|
+
padding: var(--textarea-padding-y) var(--textarea-padding-x);
|
|
16
|
+
font-size: var(--text-sm);
|
|
17
|
+
line-height: var(--text-sm--line-height);
|
|
14
18
|
background-color: transparent;
|
|
15
|
-
color: var(--color-
|
|
19
|
+
color: var(--color-foreground);
|
|
16
20
|
border-radius: var(--radius-sm);
|
|
17
|
-
resize:
|
|
21
|
+
resize: vertical;
|
|
18
22
|
font-family: var(--font-sans);
|
|
19
23
|
border: 1px solid var(--color-input);
|
|
20
|
-
outline:
|
|
24
|
+
outline: var(--focus-ring-width) solid transparent;
|
|
21
25
|
transition:
|
|
22
26
|
background 0.3s,
|
|
23
27
|
border-color 0.3s,
|
|
24
28
|
box-shadow 0.2s;
|
|
25
29
|
|
|
26
30
|
&:focus {
|
|
27
|
-
border-color: var(--color-
|
|
28
|
-
outline:
|
|
31
|
+
border-color: var(--color-ring);
|
|
32
|
+
outline: var(--focus-ring-width) solid var(--focus-ring-color);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
&:disabled {
|
|
32
|
-
background-color: var(--color-
|
|
33
|
-
border-color: var(--color-
|
|
34
|
-
color:
|
|
35
|
-
fill: var(--color-
|
|
36
|
+
background-color: var(--color-muted);
|
|
37
|
+
border-color: var(--color-muted);
|
|
38
|
+
color: var(--color-muted-foreground);
|
|
39
|
+
fill: var(--color-muted-foreground);
|
|
40
|
+
resize: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@include mixins.min-width(md) {
|
|
44
|
+
--textarea-min-height: 80px;
|
|
36
45
|
}
|
|
37
46
|
|
|
38
|
-
|
|
39
|
-
|
|
47
|
+
// Медиазапрос базы стоит выше и при равной специфичности проиграет, поэтому у
|
|
48
|
+
// каждого размера своя пара значений.
|
|
49
|
+
&--sm {
|
|
50
|
+
--textarea-padding-y: 4px;
|
|
51
|
+
--textarea-padding-x: 12px;
|
|
52
|
+
--textarea-min-height: 120px;
|
|
53
|
+
|
|
54
|
+
@include mixins.min-width(md) {
|
|
55
|
+
--textarea-min-height: 60px;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--lg {
|
|
60
|
+
--textarea-padding-y: var(--space-3);
|
|
61
|
+
--textarea-padding-x: 24px;
|
|
62
|
+
--textarea-min-height: 200px;
|
|
63
|
+
|
|
64
|
+
@include mixins.min-width(md) {
|
|
65
|
+
--textarea-min-height: 100px;
|
|
66
|
+
}
|
|
40
67
|
}
|
|
41
68
|
|
|
42
69
|
&--recommended {
|
|
43
|
-
background-color:
|
|
70
|
+
background-color: var(--color-recommended);
|
|
44
71
|
}
|
|
45
72
|
|
|
46
73
|
&--error {
|
|
47
|
-
border-color: color-mix(in srgb, var(--color-
|
|
74
|
+
border-color: color-mix(in srgb, var(--color-destructive) 50%, transparent);
|
|
48
75
|
}
|
|
49
76
|
}
|
|
50
77
|
|
|
51
78
|
.textarea__counter {
|
|
52
79
|
display: block;
|
|
53
|
-
margin-top:
|
|
54
|
-
font-size:
|
|
55
|
-
line-height:
|
|
56
|
-
color:
|
|
80
|
+
margin-top: var(--space-1);
|
|
81
|
+
font-size: var(--text-xs);
|
|
82
|
+
line-height: var(--text-sm--line-height);
|
|
83
|
+
color: var(--color-muted-foreground);
|
|
57
84
|
text-align: left;
|
|
58
85
|
}
|
package/dist/icons/index.cjs
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_icon_spinner = require("./icon-spinner.cjs");
|
|
3
|
+
const require_icon_cross = require("./icon-cross.cjs");
|
|
2
4
|
const require_control_mark_checkbox = require("./control-mark-checkbox.cjs");
|
|
3
5
|
const require_control_mark_radiobutton = require("./control-mark-radiobutton.cjs");
|
|
4
6
|
const require_icon_adult = require("./icon-adult.cjs");
|
|
@@ -26,7 +28,6 @@ const require_icon_conveyor = require("./icon-conveyor.cjs");
|
|
|
26
28
|
const require_icon_copy = require("./icon-copy.cjs");
|
|
27
29
|
const require_icon_correct = require("./icon-correct.cjs");
|
|
28
30
|
const require_icon_crop = require("./icon-crop.cjs");
|
|
29
|
-
const require_icon_cross = require("./icon-cross.cjs");
|
|
30
31
|
const require_icon_cycle = require("./icon-cycle.cjs");
|
|
31
32
|
const require_icon_divide = require("./icon-divide.cjs");
|
|
32
33
|
const require_icon_download = require("./icon-download.cjs");
|
|
@@ -79,7 +80,6 @@ const require_icon_search = require("./icon-search.cjs");
|
|
|
79
80
|
const require_icon_shield = require("./icon-shield.cjs");
|
|
80
81
|
const require_icon_sms_code = require("./icon-sms-code.cjs");
|
|
81
82
|
const require_icon_sort = require("./icon-sort.cjs");
|
|
82
|
-
const require_icon_spinner = require("./icon-spinner.cjs");
|
|
83
83
|
const require_icon_star = require("./icon-star.cjs");
|
|
84
84
|
const require_icon_switch_off = require("./icon-switch-off.cjs");
|
|
85
85
|
const require_icon_switch_on = require("./icon-switch-on.cjs");
|
package/dist/icons/index.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { IconSpinner } from "./icon-spinner.js";
|
|
2
|
+
import { IconCross } from "./icon-cross.js";
|
|
1
3
|
import { ControlMarkCheckbox } from "./control-mark-checkbox.js";
|
|
2
4
|
import { ControlMarkRadiobutton } from "./control-mark-radiobutton.js";
|
|
3
5
|
import { IconAdult } from "./icon-adult.js";
|
|
@@ -25,7 +27,6 @@ import { IconConveyor } from "./icon-conveyor.js";
|
|
|
25
27
|
import { IconCopy } from "./icon-copy.js";
|
|
26
28
|
import { IconCorrect } from "./icon-correct.js";
|
|
27
29
|
import { IconCrop } from "./icon-crop.js";
|
|
28
|
-
import { IconCross } from "./icon-cross.js";
|
|
29
30
|
import { IconCycle } from "./icon-cycle.js";
|
|
30
31
|
import { IconDivide } from "./icon-divide.js";
|
|
31
32
|
import { IconDownload } from "./icon-download.js";
|
|
@@ -78,7 +79,6 @@ import { IconSearch } from "./icon-search.js";
|
|
|
78
79
|
import { IconShield } from "./icon-shield.js";
|
|
79
80
|
import { IconSmsCode } from "./icon-sms-code.js";
|
|
80
81
|
import { IconSort } from "./icon-sort.js";
|
|
81
|
-
import { IconSpinner } from "./icon-spinner.js";
|
|
82
82
|
import { IconStar } from "./icon-star.js";
|
|
83
83
|
import { IconSwitchOff } from "./icon-switch-off.js";
|
|
84
84
|
import { IconSwitchOn } from "./icon-switch-on.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_button = require("./components/button/button.cjs");
|
|
3
3
|
const require_checkbox = require("./components/checkbox/checkbox.cjs");
|
|
4
|
+
const require_field = require("./components/field/field.cjs");
|
|
4
5
|
const require_input = require("./components/input/input.cjs");
|
|
5
6
|
const require_radio = require("./components/radio/radio.cjs");
|
|
6
7
|
const require_spinner = require("./components/spinner/spinner.cjs");
|
|
@@ -8,7 +9,9 @@ const require_textarea = require("./components/textarea/textarea.cjs");
|
|
|
8
9
|
require("./styles/vars.scss");
|
|
9
10
|
exports.Button = require_button.Button;
|
|
10
11
|
exports.CheckboxInput = require_checkbox.CheckboxInput;
|
|
12
|
+
exports.Field = require_field.Field;
|
|
11
13
|
exports.Input = require_input.Input;
|
|
14
|
+
exports.RadioGroup = require_radio.RadioGroup;
|
|
12
15
|
exports.RadioInput = require_radio.RadioInput;
|
|
13
16
|
exports.Spinner = require_spinner.Spinner;
|
|
14
17
|
exports.TextArea = require_textarea.TextArea;
|
package/dist/index.d.cts
CHANGED
|
@@ -2,12 +2,14 @@ import { Button, ButtonComponentProps, ButtonLinkProps, ButtonProps, ButtonSize,
|
|
|
2
2
|
import "./components/button/index.cjs";
|
|
3
3
|
import { CheckboxInput, CheckboxInputProps } from "./components/checkbox/checkbox.cjs";
|
|
4
4
|
import "./components/checkbox/index.cjs";
|
|
5
|
-
import {
|
|
5
|
+
import { Field, FieldHintPlacement, FieldProps } from "./components/field/field.cjs";
|
|
6
|
+
import "./components/field/index.cjs";
|
|
7
|
+
import { Input, InputProps, InputSize } from "./components/input/input.cjs";
|
|
6
8
|
import "./components/input/index.cjs";
|
|
7
|
-
import { RadioInput, RadioInputProps } from "./components/radio/radio.cjs";
|
|
9
|
+
import { RadioGroup, RadioGroupProps, RadioInput, RadioInputProps } from "./components/radio/radio.cjs";
|
|
8
10
|
import "./components/radio/index.cjs";
|
|
9
11
|
import { Spinner, SpinnerPosition, SpinnerProps } from "./components/spinner/spinner.cjs";
|
|
10
12
|
import "./components/spinner/index.cjs";
|
|
11
|
-
import { TextArea, TextAreaProps } from "./components/textarea/textarea.cjs";
|
|
13
|
+
import { TextArea, TextAreaProps, TextAreaSize } from "./components/textarea/textarea.cjs";
|
|
12
14
|
import "./components/textarea/index.cjs";
|
|
13
|
-
export { Button, type ButtonComponentProps, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, Input, type InputProps, RadioInput, type RadioInputProps, Spinner, type SpinnerPosition, type SpinnerProps, TextArea, type TextAreaProps };
|
|
15
|
+
export { Button, type ButtonComponentProps, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, Field, type FieldHintPlacement, type FieldProps, Input, type InputProps, type InputSize, RadioGroup, type RadioGroupProps, RadioInput, type RadioInputProps, Spinner, type SpinnerPosition, type SpinnerProps, TextArea, type TextAreaProps, type TextAreaSize };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import { Button, ButtonComponentProps, ButtonLinkProps, ButtonProps, ButtonSize,
|
|
|
2
2
|
import "./components/button/index.js";
|
|
3
3
|
import { CheckboxInput, CheckboxInputProps } from "./components/checkbox/checkbox.js";
|
|
4
4
|
import "./components/checkbox/index.js";
|
|
5
|
-
import {
|
|
5
|
+
import { Field, FieldHintPlacement, FieldProps } from "./components/field/field.js";
|
|
6
|
+
import "./components/field/index.js";
|
|
7
|
+
import { Input, InputProps, InputSize } from "./components/input/input.js";
|
|
6
8
|
import "./components/input/index.js";
|
|
7
|
-
import { RadioInput, RadioInputProps } from "./components/radio/radio.js";
|
|
9
|
+
import { RadioGroup, RadioGroupProps, RadioInput, RadioInputProps } from "./components/radio/radio.js";
|
|
8
10
|
import "./components/radio/index.js";
|
|
9
11
|
import { Spinner, SpinnerPosition, SpinnerProps } from "./components/spinner/spinner.js";
|
|
10
12
|
import "./components/spinner/index.js";
|
|
11
|
-
import { TextArea, TextAreaProps } from "./components/textarea/textarea.js";
|
|
13
|
+
import { TextArea, TextAreaProps, TextAreaSize } from "./components/textarea/textarea.js";
|
|
12
14
|
import "./components/textarea/index.js";
|
|
13
|
-
export { Button, type ButtonComponentProps, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, Input, type InputProps, RadioInput, type RadioInputProps, Spinner, type SpinnerPosition, type SpinnerProps, TextArea, type TextAreaProps };
|
|
15
|
+
export { Button, type ButtonComponentProps, type ButtonLinkProps, type ButtonProps, type ButtonSize, type ButtonVariant, CheckboxInput, type CheckboxInputProps, Field, type FieldHintPlacement, type FieldProps, Input, type InputProps, type InputSize, RadioGroup, type RadioGroupProps, RadioInput, type RadioInputProps, Spinner, type SpinnerPosition, type SpinnerProps, TextArea, type TextAreaProps, type TextAreaSize };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Button } from "./components/button/button.js";
|
|
2
2
|
import { CheckboxInput } from "./components/checkbox/checkbox.js";
|
|
3
|
+
import { Field } from "./components/field/field.js";
|
|
3
4
|
import { Input } from "./components/input/input.js";
|
|
4
|
-
import { RadioInput } from "./components/radio/radio.js";
|
|
5
|
+
import { RadioGroup, RadioInput } from "./components/radio/radio.js";
|
|
5
6
|
import { Spinner } from "./components/spinner/spinner.js";
|
|
6
7
|
import { TextArea } from "./components/textarea/textarea.js";
|
|
7
8
|
import "./styles/vars.scss";
|
|
8
|
-
export { Button, CheckboxInput, Input, RadioInput, Spinner, TextArea };
|
|
9
|
+
export { Button, CheckboxInput, Field, Input, RadioGroup, RadioInput, Spinner, TextArea };
|
package/dist/styles/global.scss
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
// База приложения. Шрифт Inter подключает хост — файлы лежат в splittest-frontend/src/app/fonts.
|
|
2
2
|
// Токены (`--color-*`) подключает вход пакета, этот файл их не эмитит.
|
|
3
|
+
@use './mixins.scss' as mixins;
|
|
3
4
|
|
|
4
5
|
:root {
|
|
5
|
-
--pink: #ff00ff;
|
|
6
|
-
--blue: #00aaff;
|
|
7
6
|
--window-max-height: 100vh;
|
|
8
7
|
--wrapper-padding: 20px;
|
|
9
8
|
|
|
10
|
-
@
|
|
9
|
+
@include mixins.min-width(md) {
|
|
11
10
|
--wrapper-padding: 30px;
|
|
12
11
|
}
|
|
13
12
|
}
|
|
@@ -35,16 +34,16 @@ body {
|
|
|
35
34
|
font-family: var(--font-sans);
|
|
36
35
|
-webkit-font-smoothing: antialiased;
|
|
37
36
|
-moz-osx-font-smoothing: grayscale;
|
|
38
|
-
color: var(--color-
|
|
39
|
-
background-color: var(--color-
|
|
37
|
+
color: var(--color-foreground);
|
|
38
|
+
background-color: var(--color-background);
|
|
40
39
|
font-size: var(--text-sm);
|
|
41
|
-
line-height:
|
|
40
|
+
line-height: var(--text-sm--line-height);
|
|
42
41
|
font-weight: 400;
|
|
43
42
|
|
|
44
43
|
&::after {
|
|
45
44
|
content: '';
|
|
46
45
|
display: block;
|
|
47
|
-
background-color:
|
|
46
|
+
background-color: var(--color-overlay);
|
|
48
47
|
position: fixed;
|
|
49
48
|
left: 0;
|
|
50
49
|
top: 0;
|
|
@@ -91,11 +90,11 @@ body {
|
|
|
91
90
|
padding-left: var(--wrapper-padding);
|
|
92
91
|
padding-right: var(--wrapper-padding);
|
|
93
92
|
|
|
94
|
-
@
|
|
93
|
+
@include mixins.min-width(md) {
|
|
95
94
|
max-width: 680px;
|
|
96
95
|
}
|
|
97
96
|
|
|
98
|
-
@
|
|
97
|
+
@include mixins.min-width(lg) {
|
|
99
98
|
max-width: 1000px;
|
|
100
99
|
}
|
|
101
100
|
}
|
|
@@ -106,20 +105,27 @@ body {
|
|
|
106
105
|
height: 8px;
|
|
107
106
|
}
|
|
108
107
|
|
|
108
|
+
// Ползунок — производная от текста, обводка — от фона: в тёмной теме
|
|
109
|
+
// ползунок светлеет вместе с ней, как и остальные серые в этом файле.
|
|
109
110
|
.scroll-block::-webkit-scrollbar-thumb {
|
|
110
111
|
border-radius: 4px;
|
|
111
|
-
background-color:
|
|
112
|
-
|
|
112
|
+
background-color: color-mix(
|
|
113
|
+
in srgb,
|
|
114
|
+
var(--color-foreground) 24%,
|
|
115
|
+
var(--color-background)
|
|
116
|
+
);
|
|
117
|
+
box-shadow: 0 0 1px
|
|
118
|
+
color-mix(in srgb, var(--color-background) 50%, transparent);
|
|
113
119
|
}
|
|
114
120
|
|
|
115
121
|
a {
|
|
116
122
|
text-decoration: none;
|
|
117
123
|
transition: color 0.3s ease;
|
|
118
|
-
color: var(--color-
|
|
124
|
+
color: var(--color-foreground);
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
button {
|
|
122
|
-
color: var(--color-
|
|
128
|
+
color: var(--color-foreground);
|
|
123
129
|
font-size: var(--text-sm);
|
|
124
130
|
font-family: var(--font-sans);
|
|
125
131
|
|
|
@@ -153,9 +159,9 @@ table {
|
|
|
153
159
|
}
|
|
154
160
|
|
|
155
161
|
th {
|
|
156
|
-
color:
|
|
157
|
-
font-size:
|
|
158
|
-
line-height:
|
|
162
|
+
color: var(--color-muted-foreground);
|
|
163
|
+
font-size: var(--text-xs);
|
|
164
|
+
line-height: var(--text-xs--line-height);
|
|
159
165
|
text-align: left;
|
|
160
166
|
font-weight: normal;
|
|
161
167
|
padding: 15px 0;
|
|
@@ -170,26 +176,26 @@ h3 {
|
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
h1 {
|
|
173
|
-
font-size:
|
|
174
|
-
line-height:
|
|
179
|
+
font-size: var(--text-2xl);
|
|
180
|
+
line-height: var(--text-2xl--line-height);
|
|
175
181
|
|
|
176
|
-
@
|
|
177
|
-
font-size:
|
|
178
|
-
line-height:
|
|
182
|
+
@include mixins.min-width(md) {
|
|
183
|
+
font-size: var(--text-3xl);
|
|
184
|
+
line-height: var(--text-3xl--line-height);
|
|
179
185
|
}
|
|
180
186
|
}
|
|
181
187
|
|
|
182
188
|
h2 {
|
|
183
|
-
font-size:
|
|
184
|
-
line-height:
|
|
189
|
+
font-size: var(--text-2xl);
|
|
190
|
+
line-height: var(--text-2xl--line-height);
|
|
185
191
|
}
|
|
186
192
|
|
|
187
193
|
h3 {
|
|
188
|
-
font-size:
|
|
189
|
-
line-height:
|
|
194
|
+
font-size: var(--text-lg);
|
|
195
|
+
line-height: var(--text-lg--line-height);
|
|
190
196
|
}
|
|
191
197
|
|
|
192
198
|
h4 {
|
|
193
|
-
font-size:
|
|
194
|
-
line-height:
|
|
199
|
+
font-size: var(--text-sm);
|
|
200
|
+
line-height: var(--text-sm--line-height);
|
|
195
201
|
}
|