@shmidko61/lc-ui-kit 0.6.0 → 0.8.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/dist/grid.cjs +1 -1
- package/dist/grid.js +20 -18
- package/dist/icons/icons.d.ts +4 -0
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +34 -32
- package/dist/index.cjs +1 -1
- package/dist/index.js +64 -62
- package/dist/input/input.d.ts +4 -4
- package/dist/input/input.helpers.d.ts +6 -1
- package/dist/input/input.types.d.ts +17 -2
- package/dist/input.cjs +1 -1
- package/dist/input.js +101 -73
- package/dist/styles.css +1 -1
- package/dist/types/spacing.types.d.ts +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,90 +1,92 @@
|
|
|
1
|
-
import { Accordion as
|
|
1
|
+
import { Accordion as r, AccordionItem as a, AccordionRoot as n } from "./accordion.js";
|
|
2
2
|
import { Box as i } from "./box.js";
|
|
3
3
|
import { Button as s, buttonSizeBorderRadius as p, buttonSizeBoxProps as l, buttonSizeClassNames as I, buttonVariantClassNames as d, buttonVariants as m } from "./button.js";
|
|
4
4
|
import { U as x, u as b, a as f, b as u } from "./ui-kit-provider-C6Mk5g_7.js";
|
|
5
5
|
import { Flex as C } from "./flex.js";
|
|
6
|
-
import { Grid as
|
|
7
|
-
import { ArrowCornerIcon as y, ArrowIcon as B,
|
|
8
|
-
import { Input as
|
|
9
|
-
import { MediaCard as
|
|
10
|
-
import { MediaGallery as
|
|
11
|
-
import { Pagination as
|
|
12
|
-
import { Picture as
|
|
13
|
-
import { Select as
|
|
14
|
-
import { r as
|
|
15
|
-
import { StatusBadge as
|
|
16
|
-
import { Switch as
|
|
17
|
-
import { D as Mo, T as
|
|
6
|
+
import { Grid as h, GridItem as S } from "./grid.js";
|
|
7
|
+
import { ArrowCornerIcon as y, ArrowIcon as B, ArrowLongLeftIcon as A, ArrowheadRightIcon as P, BurgerIcon as w, CheckIcon as G, CopyIcon as L, DropDown as v, EyeOpenIcon as D, FileIcon as K, GeminiStarIcon as R, GeoIcon as U, LockClosedIcon as V, LockOpenIcon as z, LogoutIcon as F, MailIcon as N, MediaMaxIcon as H, MediaPictureIcon as O, MediaTgIcon as W, MediaVkIcon as j, MediaWaIcon as E, NetUploadIcon as X, PaperclipIcon as q, PhoneIcon as J, PlusIcon as Q, SaveIcon as Y, SparkIcon as Z, SparkleIcon as _, TelephoneIcon as $, TimeClockIcon as oo, TrashIcon as eo, XMarkIcon as ro } from "./icons.js";
|
|
8
|
+
import { Input as no } from "./input.js";
|
|
9
|
+
import { MediaCard as io } from "./media-card.js";
|
|
10
|
+
import { MediaGallery as so } from "./media-gallery.js";
|
|
11
|
+
import { Pagination as lo } from "./pagination.js";
|
|
12
|
+
import { Picture as mo } from "./picture.js";
|
|
13
|
+
import { Select as xo } from "./select.js";
|
|
14
|
+
import { r as fo, a as uo } from "./responsive-style.config-DFuATrIM.js";
|
|
15
|
+
import { StatusBadge as Co } from "./status-badge.js";
|
|
16
|
+
import { Switch as ho } from "./switch.js";
|
|
17
|
+
import { D as Mo, T as yo, a as Bo, b as Ao, c as Po, d as wo, e as Go, f as Lo, g as vo, h as Do, i as Ko, j as Ro, k as Uo } from "./table-container-BsE-uIE1.js";
|
|
18
18
|
import { Typography as zo, typographyVariants as Fo } from "./typography.js";
|
|
19
19
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
r as Accordion,
|
|
21
|
+
a as AccordionItem,
|
|
22
22
|
n as AccordionRoot,
|
|
23
23
|
y as ArrowCornerIcon,
|
|
24
24
|
B as ArrowIcon,
|
|
25
|
+
A as ArrowLongLeftIcon,
|
|
26
|
+
P as ArrowheadRightIcon,
|
|
25
27
|
i as Box,
|
|
26
|
-
|
|
28
|
+
w as BurgerIcon,
|
|
27
29
|
s as Button,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
G as CheckIcon,
|
|
31
|
+
L as CopyIcon,
|
|
30
32
|
Mo as DataTable,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
v as DropDown,
|
|
34
|
+
D as EyeOpenIcon,
|
|
35
|
+
K as FileIcon,
|
|
34
36
|
C as Flex,
|
|
35
|
-
|
|
37
|
+
R as GeminiStarIcon,
|
|
36
38
|
U as GeoIcon,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
h as Grid,
|
|
40
|
+
S as GridItem,
|
|
41
|
+
no as Input,
|
|
40
42
|
V as LockClosedIcon,
|
|
41
43
|
z as LockOpenIcon,
|
|
42
44
|
F as LogoutIcon,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
N as MailIcon,
|
|
46
|
+
io as MediaCard,
|
|
47
|
+
so as MediaGallery,
|
|
48
|
+
H as MediaMaxIcon,
|
|
49
|
+
O as MediaPictureIcon,
|
|
50
|
+
W as MediaTgIcon,
|
|
51
|
+
j as MediaVkIcon,
|
|
52
|
+
E as MediaWaIcon,
|
|
53
|
+
X as NetUploadIcon,
|
|
54
|
+
lo as Pagination,
|
|
55
|
+
q as PaperclipIcon,
|
|
56
|
+
J as PhoneIcon,
|
|
57
|
+
mo as Picture,
|
|
58
|
+
Q as PlusIcon,
|
|
59
|
+
Y as SaveIcon,
|
|
60
|
+
xo as Select,
|
|
61
|
+
Z as SparkIcon,
|
|
62
|
+
_ as SparkleIcon,
|
|
63
|
+
Co as StatusBadge,
|
|
64
|
+
ho as Switch,
|
|
65
|
+
yo as Table,
|
|
66
|
+
Bo as TableBody,
|
|
67
|
+
Ao as TableCaption,
|
|
68
|
+
Po as TableCell,
|
|
69
|
+
wo as TableContainer,
|
|
70
|
+
Go as TableFooter,
|
|
71
|
+
Lo as TableHead,
|
|
72
|
+
vo as TableHeader,
|
|
73
|
+
Do as TableRow,
|
|
74
|
+
Ko as TableScrollArea,
|
|
75
|
+
Ro as TableStatus,
|
|
74
76
|
Uo as TableToolbar,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
$ as TelephoneIcon,
|
|
78
|
+
oo as TimeClockIcon,
|
|
79
|
+
eo as TrashIcon,
|
|
78
80
|
zo as Typography,
|
|
79
81
|
x as UiKitProvider,
|
|
80
|
-
|
|
82
|
+
ro as XMarkIcon,
|
|
81
83
|
p as buttonSizeBorderRadius,
|
|
82
84
|
l as buttonSizeBoxProps,
|
|
83
85
|
I as buttonSizeClassNames,
|
|
84
86
|
d as buttonVariantClassNames,
|
|
85
87
|
m as buttonVariants,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
fo as responsiveBreakpointMinWidth,
|
|
89
|
+
uo as responsiveBreakpoints,
|
|
88
90
|
Fo as typographyVariants,
|
|
89
91
|
b as uiKitColorTokens,
|
|
90
92
|
f as uiKitTypographyTokens,
|
package/dist/input/input.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ChangeEventHandler, InputHTMLAttributes, JSX, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
-
import { InputPlaceholderProps } from './input.types';
|
|
3
|
-
export type { InputPlaceholderProps, InputPlaceholderStyleProps } from './input.types';
|
|
2
|
+
import { InputPlaceholderProps, InputTextProps } from './input.types';
|
|
3
|
+
export type { InputPlaceholderProps, InputPlaceholderStyleProps, InputTextProps, InputTextStyleProps, } from './input.types';
|
|
4
4
|
/** Варианты отображения поля ввода. */
|
|
5
5
|
type InputVariant = 'default' | 'password' | 'textarea';
|
|
6
6
|
/** Общие props для input и textarea режимов. */
|
|
7
|
-
type InputBaseProps = {
|
|
7
|
+
type InputBaseProps = InputTextProps & {
|
|
8
8
|
/** Оформление placeholder с overrides md, lg, xl; по умолчанию сохраняется стиль UI-kit. */
|
|
9
9
|
placeholderProps?: InputPlaceholderProps;
|
|
10
10
|
/** Класс внешнего контейнера с label, control и сообщением. */
|
|
@@ -47,6 +47,6 @@ export type InputProps = NativeInputProps | TextareaInputProps;
|
|
|
47
47
|
* textarea. Label, helper/error text и иконки встроены в компонент, чтобы
|
|
48
48
|
* приложения использовали единый визуальный и accessibility-паттерн.
|
|
49
49
|
*/
|
|
50
|
-
export declare function Input({ className, containerClassName, disabled, error, helperText, id, label, leftIcon, placeholderProps, style, rightIcon, variant, ...props }: InputProps): JSX.Element;
|
|
50
|
+
export declare function Input({ className, containerClassName, disabled, error, helperText, id, label, leftIcon, fontSize, fontWeight, lineHeight, letterSpacing, fontFamily, md, lg, xl, placeholderProps, style, rightIcon, variant, ...props }: InputProps): JSX.Element;
|
|
51
51
|
/** Универсальный тип change handler для input и textarea режимов. */
|
|
52
52
|
export type InputChangeHandler = ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import { InputPlaceholderProps } from './input.types';
|
|
2
|
+
import { InputPlaceholderProps, InputTextProps } from './input.types';
|
|
3
|
+
/** Генерирует типографику control через общий механизм CSS-переменных. */
|
|
4
|
+
export declare function getInputTextPlan(props: InputTextProps): {
|
|
5
|
+
className: string;
|
|
6
|
+
style: CSSProperties;
|
|
7
|
+
};
|
|
3
8
|
/** Генерирует CSS-переменные и responsive-классы только для заданных свойств подсказки. */
|
|
4
9
|
export declare function getInputPlaceholderPlan(props?: InputPlaceholderProps): {
|
|
5
10
|
className: string;
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
2
|
-
import { TypographyColorValue, TypographyFontSizeValue, TypographyFontWeightValue } from '../types';
|
|
2
|
+
import { TypographyColorValue, TypographyFontSizeValue, TypographyFontWeightValue, TypographyLetterSpacingValue, TypographyLineHeightValue } from '../types';
|
|
3
|
+
/** Типографика текста поля; числовой lineHeight — безразмерный множитель. */
|
|
4
|
+
export type InputTextStyleProps = {
|
|
5
|
+
/** Размер текста: число в px, CSS-строка или токен. */
|
|
6
|
+
fontSize?: TypographyFontSizeValue;
|
|
7
|
+
/** Насыщенность текста или токен. */
|
|
8
|
+
fontWeight?: TypographyFontWeightValue;
|
|
9
|
+
/** Высота строки: множитель, CSS-строка или токен. */
|
|
10
|
+
lineHeight?: TypographyLineHeightValue;
|
|
11
|
+
/** Межбуквенное расстояние: число в px или CSS-строка; normal сбрасывает значение. */
|
|
12
|
+
letterSpacing?: TypographyLetterSpacingValue;
|
|
13
|
+
/** Семейство шрифта или токен; inherit возвращает наследование. */
|
|
14
|
+
fontFamily?: string;
|
|
15
|
+
};
|
|
16
|
+
/** Типографика control с наследованием отдельных свойств base → md → lg → xl. */
|
|
17
|
+
export type InputTextProps = InputTextStyleProps & Partial<Record<ResponsiveStyleBreakpoint, InputTextStyleProps>>;
|
|
3
18
|
/** Оформление placeholder; не влияет на введённый текст. */
|
|
4
|
-
export type InputPlaceholderStyleProps = {
|
|
19
|
+
export type InputPlaceholderStyleProps = InputTextStyleProps & {
|
|
5
20
|
/** CSS-цвет или цветовой токен UI-kit. */
|
|
6
21
|
color?: TypographyColorValue;
|
|
7
22
|
/** Размер шрифта; число преобразуется в пиксели. */
|
package/dist/input.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),N=require("react"),V=require("./icons.cjs"),y=require("./responsive-style.config-B2m9jVlX.cjs"),$=require("./typography.cjs");function k(e,s){const i=[],c={};for(const r of[void 0,...y.responsiveBreakpoints]){const t=r?e?.[r]:e;if(!t)continue;const p={color:t.color,"font-size":t.fontSize,"font-weight":t.fontWeight,"line-height":t.lineHeight,"letter-spacing":t.letterSpacing,"font-family":t.fontFamily,opacity:t.opacity,"font-style":t.italic===void 0?void 0:t.italic?"italic":"normal"};for(const[a,o]of Object.entries(p)){if(o===void 0)continue;const u=`--input-${s?"placeholder":"text"}-${r?`${r}-`:""}${a}`;c[u]=typeof o=="string"&&o.startsWith("--")?`var(${o})`:(a==="font-size"||a==="letter-spacing")&&typeof o=="number"?`${o}px`:o,i.push(`${r?`${r}:`:""}${s?"placeholder:":""}[${a}:var(${u})]`)}}return{className:i.join(" "),style:c}}function W(e){return k(e,!1)}function H(e){return k(e,!0)}function A(e,s){return e&&typeof e!="boolean"?e:s}const P="w-full rounded-[8px] border border-transparent bg-[var(--color-background-subtle)] px-4 text-[14px] font-normal leading-[120%] text-[var(--color-text-primary)] outline-none transition-colors placeholder:text-[var(--color-text-secondary)] focus-visible:border-[var(--color-primary-accent)] focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] disabled:cursor-not-allowed disabled:opacity-50 [font-family:var(--font-family)] [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none";function D({className:e,containerClassName:s,disabled:i,error:c=!1,helperText:r,id:t,label:p,leftIcon:a,fontSize:o,fontWeight:u,lineHeight:I,letterSpacing:S,fontFamily:z,md:q,lg:T,xl:_,placeholderProps:O,style:R,rightIcon:B,variant:b="default",...l}){const C=N.useId(),f=H(O),v=W({fontSize:o,fontWeight:u,lineHeight:I,letterSpacing:S,fontFamily:z,md:q,lg:T,xl:_}),h={...v.style,...f.style,...R},x=t??C,[m,E]=N.useState(!1),d=!!c,j=A(c,r),F=b==="textarea",w=b==="password",g=w?n.jsx("button",{"aria-label":m?"Скрыть значение":"Показать значение",disabled:i,type:"button",onClick:()=>E(M=>!M),children:n.jsx(V.EyeOpenIcon,{})}):B;return n.jsxs("div",{className:y.cn("grid w-full gap-2",s),children:[p?n.jsx($.Typography,{as:"label",color:"--color-text-secondary",htmlFor:x,variant:"b3",children:p}):null,n.jsxs("div",{className:"relative w-full",children:[a&&n.jsx("span",{className:"pointer-events-none absolute left-4 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5",children:a}),F?n.jsx("textarea",{...l,"aria-invalid":d||l["aria-invalid"],className:y.cn(P,f.className,v.className,"min-h-[109px] resize-y px-4 py-3",d&&"border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",a&&"pl-12",e),disabled:i,style:h,id:x}):n.jsx("input",{...l,"aria-invalid":d||l["aria-invalid"],className:y.cn(P,f.className,v.className,"min-h-[42px] py-3",d&&"border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",a&&"pl-12",g&&"pr-12",e),disabled:i,style:h,id:x,type:w&&!m?"password":l.type??"text"}),g&&n.jsx("span",{className:"absolute right-2 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5",children:g})]}),j?n.jsx($.Typography,{as:"p",color:d?"--color-secondary-accent-2":"--color-text-secondary",variant:"b3",children:j}):null]})}exports.Input=D;
|
package/dist/input.js
CHANGED
|
@@ -1,113 +1,141 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useId as
|
|
3
|
-
import { EyeOpenIcon as
|
|
4
|
-
import { a as
|
|
5
|
-
import { Typography as
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
for (const
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
1
|
+
import { jsxs as $, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useId as M, useState as R } from "react";
|
|
3
|
+
import { EyeOpenIcon as q } from "./icons.js";
|
|
4
|
+
import { a as A, c as b } from "./responsive-style.config-DFuATrIM.js";
|
|
5
|
+
import { Typography as P } from "./typography.js";
|
|
6
|
+
function I(e, i) {
|
|
7
|
+
const s = [], l = {};
|
|
8
|
+
for (const n of [void 0, ...A]) {
|
|
9
|
+
const t = n ? e?.[n] : e;
|
|
10
|
+
if (!t) continue;
|
|
11
11
|
const p = {
|
|
12
|
-
color:
|
|
13
|
-
"font-size":
|
|
14
|
-
"font-weight":
|
|
15
|
-
|
|
16
|
-
"
|
|
12
|
+
color: t.color,
|
|
13
|
+
"font-size": t.fontSize,
|
|
14
|
+
"font-weight": t.fontWeight,
|
|
15
|
+
"line-height": t.lineHeight,
|
|
16
|
+
"letter-spacing": t.letterSpacing,
|
|
17
|
+
"font-family": t.fontFamily,
|
|
18
|
+
opacity: t.opacity,
|
|
19
|
+
"font-style": t.italic === void 0 ? void 0 : t.italic ? "italic" : "normal"
|
|
17
20
|
};
|
|
18
|
-
for (const [
|
|
19
|
-
if (
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
`${
|
|
21
|
+
for (const [a, o] of Object.entries(p)) {
|
|
22
|
+
if (o === void 0) continue;
|
|
23
|
+
const u = `--input-${i ? "placeholder" : "text"}-${n ? `${n}-` : ""}${a}`;
|
|
24
|
+
l[u] = typeof o == "string" && o.startsWith("--") ? `var(${o})` : (a === "font-size" || a === "letter-spacing") && typeof o == "number" ? `${o}px` : o, s.push(
|
|
25
|
+
`${n ? `${n}:` : ""}${i ? "placeholder:" : ""}[${a}:var(${u})]`
|
|
23
26
|
);
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
|
-
return { className:
|
|
29
|
+
return { className: s.join(" "), style: l };
|
|
27
30
|
}
|
|
28
|
-
function
|
|
29
|
-
return
|
|
31
|
+
function D(e) {
|
|
32
|
+
return I(e, !1);
|
|
30
33
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
function G(e) {
|
|
35
|
+
return I(e, !0);
|
|
36
|
+
}
|
|
37
|
+
function J(e, i) {
|
|
38
|
+
return e && typeof e != "boolean" ? e : i;
|
|
39
|
+
}
|
|
40
|
+
const k = "w-full rounded-[8px] border border-transparent bg-[var(--color-background-subtle)] px-4 text-[14px] font-normal leading-[120%] text-[var(--color-text-primary)] outline-none transition-colors placeholder:text-[var(--color-text-secondary)] focus-visible:border-[var(--color-primary-accent)] focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)] disabled:cursor-not-allowed disabled:opacity-50 [font-family:var(--font-family)] [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none";
|
|
41
|
+
function Y({
|
|
42
|
+
className: e,
|
|
43
|
+
containerClassName: i,
|
|
35
44
|
disabled: s,
|
|
36
|
-
error:
|
|
37
|
-
helperText:
|
|
38
|
-
id:
|
|
39
|
-
label:
|
|
40
|
-
leftIcon:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
error: l = !1,
|
|
46
|
+
helperText: n,
|
|
47
|
+
id: t,
|
|
48
|
+
label: p,
|
|
49
|
+
leftIcon: a,
|
|
50
|
+
fontSize: o,
|
|
51
|
+
fontWeight: u,
|
|
52
|
+
lineHeight: z,
|
|
53
|
+
letterSpacing: S,
|
|
54
|
+
fontFamily: j,
|
|
55
|
+
md: _,
|
|
56
|
+
lg: T,
|
|
57
|
+
xl: B,
|
|
58
|
+
placeholderProps: C,
|
|
59
|
+
style: E,
|
|
60
|
+
rightIcon: F,
|
|
61
|
+
variant: x = "default",
|
|
62
|
+
...c
|
|
46
63
|
}) {
|
|
47
|
-
const
|
|
64
|
+
const O = M(), f = G(C), y = D({
|
|
65
|
+
fontSize: o,
|
|
66
|
+
fontWeight: u,
|
|
67
|
+
lineHeight: z,
|
|
68
|
+
letterSpacing: S,
|
|
69
|
+
fontFamily: j,
|
|
70
|
+
md: _,
|
|
71
|
+
lg: T,
|
|
72
|
+
xl: B
|
|
73
|
+
}), g = { ...y.style, ...f.style, ...E }, v = t ?? O, [h, V] = R(!1), d = !!l, w = J(l, n), W = x === "textarea", N = x === "password", m = N ? /* @__PURE__ */ r(
|
|
48
74
|
"button",
|
|
49
75
|
{
|
|
50
|
-
"aria-label":
|
|
76
|
+
"aria-label": h ? "Скрыть значение" : "Показать значение",
|
|
51
77
|
disabled: s,
|
|
52
78
|
type: "button",
|
|
53
|
-
onClick: () =>
|
|
54
|
-
children: /* @__PURE__ */ r(
|
|
79
|
+
onClick: () => V((H) => !H),
|
|
80
|
+
children: /* @__PURE__ */ r(q, {})
|
|
55
81
|
}
|
|
56
|
-
) :
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
|
|
61
|
-
|
|
82
|
+
) : F;
|
|
83
|
+
return /* @__PURE__ */ $("div", { className: b("grid w-full gap-2", i), children: [
|
|
84
|
+
p ? /* @__PURE__ */ r(P, { as: "label", color: "--color-text-secondary", htmlFor: v, variant: "b3", children: p }) : null,
|
|
85
|
+
/* @__PURE__ */ $("div", { className: "relative w-full", children: [
|
|
86
|
+
a && /* @__PURE__ */ r("span", { className: "pointer-events-none absolute left-4 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5", children: a }),
|
|
87
|
+
W ? /* @__PURE__ */ r(
|
|
62
88
|
"textarea",
|
|
63
89
|
{
|
|
64
|
-
...
|
|
65
|
-
"aria-invalid":
|
|
66
|
-
className:
|
|
67
|
-
|
|
90
|
+
...c,
|
|
91
|
+
"aria-invalid": d || c["aria-invalid"],
|
|
92
|
+
className: b(
|
|
93
|
+
k,
|
|
68
94
|
f.className,
|
|
95
|
+
y.className,
|
|
69
96
|
"min-h-[109px] resize-y px-4 py-3",
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
97
|
+
d && "border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",
|
|
98
|
+
a && "pl-12",
|
|
99
|
+
e
|
|
73
100
|
),
|
|
74
101
|
disabled: s,
|
|
75
|
-
style:
|
|
76
|
-
id:
|
|
102
|
+
style: g,
|
|
103
|
+
id: v
|
|
77
104
|
}
|
|
78
105
|
) : /* @__PURE__ */ r(
|
|
79
106
|
"input",
|
|
80
107
|
{
|
|
81
|
-
...
|
|
82
|
-
"aria-invalid":
|
|
83
|
-
className:
|
|
84
|
-
|
|
108
|
+
...c,
|
|
109
|
+
"aria-invalid": d || c["aria-invalid"],
|
|
110
|
+
className: b(
|
|
111
|
+
k,
|
|
85
112
|
f.className,
|
|
113
|
+
y.className,
|
|
86
114
|
"min-h-[42px] py-3",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
115
|
+
d && "border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",
|
|
116
|
+
a && "pl-12",
|
|
117
|
+
m && "pr-12",
|
|
118
|
+
e
|
|
91
119
|
),
|
|
92
120
|
disabled: s,
|
|
93
|
-
style:
|
|
94
|
-
id:
|
|
95
|
-
type:
|
|
121
|
+
style: g,
|
|
122
|
+
id: v,
|
|
123
|
+
type: N && !h ? "password" : c.type ?? "text"
|
|
96
124
|
}
|
|
97
125
|
),
|
|
98
|
-
|
|
126
|
+
m && /* @__PURE__ */ r("span", { className: "absolute right-2 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5", children: m })
|
|
99
127
|
] }),
|
|
100
|
-
|
|
101
|
-
|
|
128
|
+
w ? /* @__PURE__ */ r(
|
|
129
|
+
P,
|
|
102
130
|
{
|
|
103
131
|
as: "p",
|
|
104
|
-
color:
|
|
132
|
+
color: d ? "--color-secondary-accent-2" : "--color-text-secondary",
|
|
105
133
|
variant: "b3",
|
|
106
|
-
children:
|
|
134
|
+
children: w
|
|
107
135
|
}
|
|
108
136
|
) : null
|
|
109
137
|
] });
|
|
110
138
|
}
|
|
111
139
|
export {
|
|
112
|
-
|
|
140
|
+
Y as Input
|
|
113
141
|
};
|