@shmidko61/lc-ui-kit 0.0.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 +38 -0
- package/dist/accordion/accordion-context.d.ts +3 -0
- package/dist/accordion/accordion-item.d.ts +48 -0
- package/dist/accordion/accordion-root.d.ts +5 -0
- package/dist/accordion/accordion.d.ts +8 -0
- package/dist/accordion.cjs +1 -0
- package/dist/accordion.js +206 -0
- package/dist/arrow-CS6d64Y4.cjs +1 -0
- package/dist/arrow-DBc2opRL.js +5 -0
- package/dist/box/box.d.ts +7 -0
- package/dist/box/box.helpers.d.ts +11 -0
- package/dist/box/box.types.d.ts +62 -0
- package/dist/box.cjs +1 -0
- package/dist/box.js +342 -0
- package/dist/button/button.d.ts +22 -0
- package/dist/button/button.helpers.d.ts +119 -0
- package/dist/button.cjs +1 -0
- package/dist/button.js +438 -0
- package/dist/design-tokens/color.tokens.d.ts +6 -0
- package/dist/design-tokens/typography.tokens.d.ts +9 -0
- package/dist/drop-down-CdIuWbLC.cjs +1 -0
- package/dist/drop-down-DH2_3qXq.js +5 -0
- package/dist/eye-open-5zYaeyLp.cjs +1 -0
- package/dist/eye-open-CoTSj5cT.js +5 -0
- package/dist/flex/flex.d.ts +5 -0
- package/dist/flex/flex.helpers.d.ts +9 -0
- package/dist/flex/flex.types.d.ts +12 -0
- package/dist/flex.cjs +1 -0
- package/dist/flex.js +128 -0
- package/dist/grid/grid.d.ts +25 -0
- package/dist/grid/grid.helpers.d.ts +13 -0
- package/dist/grid/grid.types.d.ts +49 -0
- package/dist/grid.cjs +1 -0
- package/dist/grid.js +103 -0
- package/dist/icons/icons.d.ts +30 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.js +38 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +97 -0
- package/dist/input/input.d.ts +49 -0
- package/dist/input/input.helpers.d.ts +9 -0
- package/dist/input.cjs +1 -0
- package/dist/input.js +85 -0
- package/dist/media-card/components/media-card-pick-indicator.d.ts +6 -0
- package/dist/media-card/components/media-card-preview.d.ts +7 -0
- package/dist/media-card/components/media-card-upload-footer.d.ts +7 -0
- package/dist/media-card/components/media-card-upload.d.ts +5 -0
- package/dist/media-card/media-card-pick.d.ts +5 -0
- package/dist/media-card/media-card.d.ts +4 -0
- package/dist/media-card/media-card.types.d.ts +10 -0
- package/dist/media-card.cjs +1 -0
- package/dist/media-card.js +104 -0
- package/dist/media-gallery/media-gallery.d.ts +12 -0
- package/dist/media-gallery/media-gallery.helpers.d.ts +27 -0
- package/dist/media-gallery/media-gallery.types.d.ts +59 -0
- package/dist/media-gallery.cjs +1 -0
- package/dist/media-gallery.js +100 -0
- package/dist/media-picture-BN4saEVT.js +6 -0
- package/dist/media-picture-BmERSmsd.cjs +1 -0
- package/dist/modal/modal.d.ts +50 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.js +143 -0
- package/dist/pagination/pagination.d.ts +22 -0
- package/dist/pagination.cjs +1 -0
- package/dist/pagination.js +155 -0
- package/dist/picture/picture.d.ts +12 -0
- package/dist/picture/picture.helpers.d.ts +9 -0
- package/dist/picture/picture.types.d.ts +56 -0
- package/dist/picture.cjs +1 -0
- package/dist/picture.js +55 -0
- package/dist/responsive-style.config-B2m9jVlX.cjs +1 -0
- package/dist/responsive-style.config-DFuATrIM.js +19 -0
- package/dist/responsive-style.utils-BdyoDkKg.cjs +1 -0
- package/dist/responsive-style.utils-D10sC561.js +25 -0
- package/dist/select/select.d.ts +55 -0
- package/dist/select/select.helpers.d.ts +14 -0
- package/dist/select/select.types.d.ts +12 -0
- package/dist/select.cjs +1 -0
- package/dist/select.js +179 -0
- package/dist/shared/lib/cn.d.ts +2 -0
- package/dist/shared/responsive-style/responsive-style.config.d.ts +20 -0
- package/dist/shared/responsive-style/responsive-style.types.d.ts +52 -0
- package/dist/shared/responsive-style/responsive-style.utils.d.ts +17 -0
- package/dist/status-badge/status-badge.d.ts +11 -0
- package/dist/status-badge.cjs +1 -0
- package/dist/status-badge.js +39 -0
- package/dist/styles.css +1 -0
- package/dist/switch/switch.d.ts +34 -0
- package/dist/switch.cjs +1 -0
- package/dist/switch.js +127 -0
- package/dist/table/data-table.d.ts +3 -0
- package/dist/table/table-container.d.ts +8 -0
- package/dist/table/table-primitives.d.ts +40 -0
- package/dist/table/table-status.d.ts +12 -0
- package/dist/table/table.d.ts +8 -0
- package/dist/table/table.types.d.ts +48 -0
- package/dist/table-container-BsE-uIE1.js +242 -0
- package/dist/table-container-DqqqkChm.cjs +1 -0
- package/dist/table.cjs +1 -0
- package/dist/table.js +16 -0
- package/dist/telephone-DVftjRG9.cjs +1 -0
- package/dist/telephone-DvXakgBQ.js +26 -0
- package/dist/time-clock-DOwPzcx7.cjs +1 -0
- package/dist/time-clock-DjqcZ8tI.js +5 -0
- package/dist/types/flex.types.d.ts +25 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/interaction.types.d.ts +8 -0
- package/dist/types/layout.types.d.ts +52 -0
- package/dist/types/shared.types.d.ts +8 -0
- package/dist/types/spacing.types.d.ts +123 -0
- package/dist/types/typography.types.d.ts +75 -0
- package/dist/types/visual.types.d.ts +82 -0
- package/dist/types.cjs +1 -0
- package/dist/types.js +1 -0
- package/dist/typography/typography.d.ts +39 -0
- package/dist/typography/typography.helpers.d.ts +237 -0
- package/dist/typography.cjs +1 -0
- package/dist/typography.js +469 -0
- package/dist/ui-kit-provider/ui-kit-provider.d.ts +53 -0
- package/dist/ui-kit-provider-C6Mk5g_7.js +167 -0
- package/dist/ui-kit-provider-raEFsUm0.cjs +1 -0
- package/dist/ui-kit-provider.cjs +1 -0
- package/dist/ui-kit-provider.js +8 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/x-mark-DId-ylR6.cjs +1 -0
- package/dist/x-mark-WU1eT82T.js +5 -0
- package/package.json +219 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BoxAs, BoxBreakpointProps, BoxProps } from '../box/box.types';
|
|
3
|
+
import { ResponsiveStyleBreakpoint } from '../shared/responsive-style/responsive-style.types';
|
|
4
|
+
/**
|
|
5
|
+
* Допустимое количество колонок в Grid.
|
|
6
|
+
*
|
|
7
|
+
* Ограничение до 12 держит API близким к привычным дизайн-сеткам и защищает
|
|
8
|
+
* компонент от случайных значений вроде `37`.
|
|
9
|
+
*/
|
|
10
|
+
export type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
|
+
/**
|
|
12
|
+
* Значение зазора между элементами Grid.
|
|
13
|
+
*
|
|
14
|
+
* Число трактуется как px, строка передаётся как готовое CSS-значение: `1rem`,
|
|
15
|
+
* `clamp(...)`, `var(...)` и т.д.
|
|
16
|
+
*/
|
|
17
|
+
export type GridGap = number | string;
|
|
18
|
+
/**
|
|
19
|
+
* Набор настроек Grid для одного responsive-состояния.
|
|
20
|
+
*
|
|
21
|
+
* Grid breakpoint наследует все layout/background props Box и добавляет только
|
|
22
|
+
* grid-специфичные `cols` и `gap`. Поэтому в `md/lg/xl` можно одновременно
|
|
23
|
+
* менять размеры, фон и параметры сетки.
|
|
24
|
+
*/
|
|
25
|
+
export interface GridBreakpointProps extends BoxBreakpointProps {
|
|
26
|
+
/** Количество колонок. */
|
|
27
|
+
cols?: GridCols;
|
|
28
|
+
/** Зазор между ячейками. */
|
|
29
|
+
gap?: GridGap;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Props Grid.
|
|
33
|
+
*
|
|
34
|
+
* Grid является специализацией Box: он принимает все допустимые props Box
|
|
35
|
+
* (`as`, размеры, background/backgroundColor и HTML attributes) и добавляет
|
|
36
|
+
* только grid-настройки `cols` и `gap`.
|
|
37
|
+
*/
|
|
38
|
+
export type GridProps = Omit<BoxProps<BoxAs>, keyof BoxBreakpointProps | 'md' | 'lg' | 'xl'> & GridBreakpointProps & Partial<Record<ResponsiveStyleBreakpoint, GridBreakpointProps>> & {
|
|
39
|
+
children?: ReactNode;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Props отдельной ячейки Grid.
|
|
43
|
+
*
|
|
44
|
+
* Сейчас это тонкая обёртка над div, но отдельный компонент оставлен для
|
|
45
|
+
* будущих возможностей: span, order, area и других grid-specific настроек.
|
|
46
|
+
*/
|
|
47
|
+
export interface GridItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
children?: ReactNode;
|
|
49
|
+
}
|
package/dist/grid.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),v=require("./box.cjs"),g=require("./responsive-style.config-B2m9jVlX.cjs");function j(i){const n=[],t={},s={md:i.md,lg:i.lg,xl:i.xl};l(i,n,t);for(const e of g.responsiveBreakpoints){const o=s[e];o&&l(o,n,t,`${e}:`,`${e}-`)}return{className:n.join(" "),style:Object.keys(t).length>0?t:void 0}}function l({cols:i,gap:n},t,s,e="",o=""){if(i!==void 0){const r=`${o}grid-template-columns`;s[`--${r}`]=`repeat(${i}, minmax(0, 1fr))`,t.push(`${e}${u("grid-cols",`var(--${r})`)}`)}if(n!==void 0){const r=`${o}grid-gap`;s[`--${r}`]=G(n),t.push(`${e}${u("gap",`var(--${r})`)}`)}}function u(i,n){return[i,"-[",n,"]"].join("")}function G(i){return typeof i=="number"?`${i}px`:i}function N({children:i,className:n,cols:t=1,gap:s=0,md:e,lg:o,xl:r,style:a,...f}){const d=j({cols:t,gap:s,md:e,lg:o,xl:r}),x=c(e),$=c(o),y=c(r),b=d.style||a?{...d.style,...a}:void 0;return m.jsx(v.Box,{...f,display:"grid",className:g.cn(d.className,n),md:x,lg:$,xl:y,style:b,children:i})}function h({children:i,className:n,...t}){return m.jsx("div",{className:n,...t,children:i})}const w=Object.assign(N,{Item:h});function c(i){if(i)return{background:i.background,backgroundColor:i.backgroundColor,height:i.height,maxHeight:i.maxHeight,maxWidth:i.maxWidth,minHeight:i.minHeight,minWidth:i.minWidth,width:i.width}}exports.Grid=w;exports.GridItem=h;
|
package/dist/grid.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { Box as v } from "./box.js";
|
|
3
|
+
import { a as y, c as b } from "./responsive-style.config-DFuATrIM.js";
|
|
4
|
+
function N(i) {
|
|
5
|
+
const n = [], t = {}, r = {
|
|
6
|
+
md: i.md,
|
|
7
|
+
lg: i.lg,
|
|
8
|
+
xl: i.xl
|
|
9
|
+
};
|
|
10
|
+
m(i, n, t);
|
|
11
|
+
for (const o of y) {
|
|
12
|
+
const e = r[o];
|
|
13
|
+
e && m(
|
|
14
|
+
e,
|
|
15
|
+
n,
|
|
16
|
+
t,
|
|
17
|
+
`${o}:`,
|
|
18
|
+
`${o}-`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
className: n.join(" "),
|
|
23
|
+
style: Object.keys(t).length > 0 ? t : void 0
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function m({ cols: i, gap: n }, t, r, o = "", e = "") {
|
|
27
|
+
if (i !== void 0) {
|
|
28
|
+
const a = `${e}grid-template-columns`;
|
|
29
|
+
r[`--${a}`] = `repeat(${i}, minmax(0, 1fr))`, t.push(`${o}${l(
|
|
30
|
+
"grid-cols",
|
|
31
|
+
`var(--${a})`
|
|
32
|
+
)}`);
|
|
33
|
+
}
|
|
34
|
+
if (n !== void 0) {
|
|
35
|
+
const a = `${e}grid-gap`;
|
|
36
|
+
r[`--${a}`] = j(n), t.push(`${o}${l(
|
|
37
|
+
"gap",
|
|
38
|
+
`var(--${a})`
|
|
39
|
+
)}`);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function l(i, n) {
|
|
43
|
+
return [i, "-[", n, "]"].join("");
|
|
44
|
+
}
|
|
45
|
+
function j(i) {
|
|
46
|
+
return typeof i == "number" ? `${i}px` : i;
|
|
47
|
+
}
|
|
48
|
+
function w({
|
|
49
|
+
children: i,
|
|
50
|
+
className: n,
|
|
51
|
+
cols: t = 1,
|
|
52
|
+
gap: r = 0,
|
|
53
|
+
md: o,
|
|
54
|
+
lg: e,
|
|
55
|
+
xl: a,
|
|
56
|
+
style: c,
|
|
57
|
+
...g
|
|
58
|
+
}) {
|
|
59
|
+
const s = N({ cols: t, gap: r, md: o, lg: e, xl: a }), h = d(o), f = d(e), $ = d(a), x = s.style || c ? {
|
|
60
|
+
...s.style,
|
|
61
|
+
...c
|
|
62
|
+
} : void 0;
|
|
63
|
+
return /* @__PURE__ */ u(
|
|
64
|
+
v,
|
|
65
|
+
{
|
|
66
|
+
...g,
|
|
67
|
+
display: "grid",
|
|
68
|
+
className: b(s.className, n),
|
|
69
|
+
md: h,
|
|
70
|
+
lg: f,
|
|
71
|
+
xl: $,
|
|
72
|
+
style: x,
|
|
73
|
+
children: i
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function B({
|
|
78
|
+
children: i,
|
|
79
|
+
className: n,
|
|
80
|
+
...t
|
|
81
|
+
}) {
|
|
82
|
+
return /* @__PURE__ */ u("div", { className: n, ...t, children: i });
|
|
83
|
+
}
|
|
84
|
+
const W = Object.assign(w, {
|
|
85
|
+
Item: B
|
|
86
|
+
});
|
|
87
|
+
function d(i) {
|
|
88
|
+
if (i)
|
|
89
|
+
return {
|
|
90
|
+
background: i.background,
|
|
91
|
+
backgroundColor: i.backgroundColor,
|
|
92
|
+
height: i.height,
|
|
93
|
+
maxHeight: i.maxHeight,
|
|
94
|
+
maxWidth: i.maxWidth,
|
|
95
|
+
minHeight: i.minHeight,
|
|
96
|
+
minWidth: i.minWidth,
|
|
97
|
+
width: i.width
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
W as Grid,
|
|
102
|
+
B as GridItem
|
|
103
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as ArrowCornerIcon } from '../../assets/icons/arrow-corner.svg?react';
|
|
2
|
+
import { default as ArrowIcon } from '../../assets/icons/arrow.svg?react';
|
|
3
|
+
import { default as BurgerIcon } from '../../assets/icons/burger.svg?react';
|
|
4
|
+
import { default as CheckIcon } from '../../assets/icons/check.svg?react';
|
|
5
|
+
import { default as CopyIcon } from '../../assets/icons/copy.svg?react';
|
|
6
|
+
import { default as EyeOpenIcon } from '../../assets/icons/eye-open.svg?react';
|
|
7
|
+
import { default as FileIcon } from '../../assets/icons/file.svg?react';
|
|
8
|
+
import { default as LockClosedIcon } from '../../assets/icons/lock-closed.svg?react';
|
|
9
|
+
import { default as LockOpenIcon } from '../../assets/icons/lock-open.svg?react';
|
|
10
|
+
import { default as LogoutIcon } from '../../assets/icons/logout.svg?react';
|
|
11
|
+
import { default as MediaMaxIcon } from '../../assets/icons/media-max.svg?react';
|
|
12
|
+
import { default as MediaPictureIcon } from '../../assets/icons/media-picture.svg?react';
|
|
13
|
+
import { default as MediaTgIcon } from '../../assets/icons/media-tg.svg?react';
|
|
14
|
+
import { default as MediaVkIcon } from '../../assets/icons/media-vk.svg?react';
|
|
15
|
+
import { default as MediaWaIcon } from '../../assets/icons/media-wa.svg?react';
|
|
16
|
+
import { default as NetUploadIcon } from '../../assets/icons/net-upload.svg?react';
|
|
17
|
+
import { default as PaperclipIcon } from '../../assets/icons/paperclip.svg?react';
|
|
18
|
+
import { default as PlusIcon } from '../../assets/icons/plus.svg?react';
|
|
19
|
+
import { default as SaveIcon } from '../../assets/icons/save.svg?react';
|
|
20
|
+
import { default as SparkleIcon } from '../../assets/icons/sparkle.svg?react';
|
|
21
|
+
import { default as TimeClockIcon } from '../../assets/icons/time-clock.svg?react';
|
|
22
|
+
import { default as TrashIcon } from '../../assets/icons/trash.svg?react';
|
|
23
|
+
import { default as XMarkIcon } from '../../assets/icons/x-mark.svg?react';
|
|
24
|
+
import { default as DropDown } from '../../assets/icons/drop-down.svg?react';
|
|
25
|
+
import { default as PhoneIcon } from '../../assets/icons/phone.svg?react';
|
|
26
|
+
import { default as GeoIcon } from '../../assets/icons/geo.svg?react';
|
|
27
|
+
import { default as MailIcon } from '../../assets/icons/mail.svg?react';
|
|
28
|
+
import { default as SparkIcon } from '../../assets/icons/spark-icon.svg?react';
|
|
29
|
+
import { default as TelephoneIcon } from '../../assets/icons/telephone.svg?react';
|
|
30
|
+
export { ArrowCornerIcon, ArrowIcon, BurgerIcon, CheckIcon, CopyIcon, EyeOpenIcon, FileIcon, LockClosedIcon, LockOpenIcon, LogoutIcon, MediaMaxIcon, MediaPictureIcon, MediaTgIcon, MediaVkIcon, MediaWaIcon, NetUploadIcon, PaperclipIcon, PlusIcon, SaveIcon, SparkleIcon, TimeClockIcon, TrashIcon, XMarkIcon, DropDown, GeoIcon, MailIcon, PhoneIcon, TelephoneIcon, SparkIcon, };
|
package/dist/icons.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./telephone-DVftjRG9.cjs"),n=require("./arrow-CS6d64Y4.cjs"),o=require("./media-picture-BmERSmsd.cjs"),r=require("./eye-open-5zYaeyLp.cjs"),c=require("./time-clock-DOwPzcx7.cjs"),g=require("./x-mark-DId-ylR6.cjs"),S=require("./drop-down-CdIuWbLC.cjs");exports.ArrowCornerIcon=e.SvgArrowCorner;exports.BurgerIcon=e.SvgBurger;exports.CopyIcon=e.SvgCopy;exports.FileIcon=e.SvgFile;exports.GeoIcon=e.SvgGeo;exports.LockClosedIcon=e.SvgLockClosed;exports.LockOpenIcon=e.SvgLockOpen;exports.LogoutIcon=e.SvgLogout;exports.MailIcon=e.SvgMail;exports.MediaMaxIcon=e.SvgMediaMax;exports.MediaTgIcon=e.SvgMediaTg;exports.MediaVkIcon=e.SvgMediaVk;exports.MediaWaIcon=e.SvgMediaWa;exports.NetUploadIcon=e.SvgNetUpload;exports.PaperclipIcon=e.SvgPaperclip;exports.PhoneIcon=e.SvgPhone;exports.PlusIcon=e.SvgPlus;exports.SaveIcon=e.SvgSave;exports.SparkIcon=e.SvgSparkIcon;exports.SparkleIcon=e.SvgSparkle;exports.TelephoneIcon=e.SvgTelephone;exports.TrashIcon=e.SvgTrash;exports.ArrowIcon=n.SvgArrow;exports.CheckIcon=o.SvgCheck;exports.MediaPictureIcon=o.SvgMediaPicture;exports.EyeOpenIcon=r.SvgEyeOpen;exports.TimeClockIcon=c.SvgTimeClock;exports.XMarkIcon=g.SvgXMark;exports.DropDown=S.SvgDropDown;
|
package/dist/icons.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { S as c, a as n, b as s, c as e, d as r, e as I, f as p, g as i, h as t, i as l, j as S, k, l as m, m as d, n as f, o as x, p as M, q as h, r as u, s as C, t as g, u as P } from "./telephone-DvXakgBQ.js";
|
|
2
|
+
import { S as w } from "./arrow-DBc2opRL.js";
|
|
3
|
+
import { S as y, a as A } from "./media-picture-BN4saEVT.js";
|
|
4
|
+
import { S as O } from "./eye-open-CoTSj5cT.js";
|
|
5
|
+
import { S as j } from "./time-clock-DjqcZ8tI.js";
|
|
6
|
+
import { S as v } from "./x-mark-WU1eT82T.js";
|
|
7
|
+
import { S as E } from "./drop-down-DH2_3qXq.js";
|
|
8
|
+
export {
|
|
9
|
+
c as ArrowCornerIcon,
|
|
10
|
+
w as ArrowIcon,
|
|
11
|
+
n as BurgerIcon,
|
|
12
|
+
y as CheckIcon,
|
|
13
|
+
s as CopyIcon,
|
|
14
|
+
E as DropDown,
|
|
15
|
+
O as EyeOpenIcon,
|
|
16
|
+
e as FileIcon,
|
|
17
|
+
r as GeoIcon,
|
|
18
|
+
I as LockClosedIcon,
|
|
19
|
+
p as LockOpenIcon,
|
|
20
|
+
i as LogoutIcon,
|
|
21
|
+
t as MailIcon,
|
|
22
|
+
l as MediaMaxIcon,
|
|
23
|
+
A as MediaPictureIcon,
|
|
24
|
+
S as MediaTgIcon,
|
|
25
|
+
k as MediaVkIcon,
|
|
26
|
+
m as MediaWaIcon,
|
|
27
|
+
d as NetUploadIcon,
|
|
28
|
+
f as PaperclipIcon,
|
|
29
|
+
x as PhoneIcon,
|
|
30
|
+
M as PlusIcon,
|
|
31
|
+
h as SaveIcon,
|
|
32
|
+
u as SparkIcon,
|
|
33
|
+
C as SparkleIcon,
|
|
34
|
+
g as TelephoneIcon,
|
|
35
|
+
j as TimeClockIcon,
|
|
36
|
+
P as TrashIcon,
|
|
37
|
+
v as XMarkIcon
|
|
38
|
+
};
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./accordion.cjs"),s=require("./box.cjs"),r=require("./button.cjs"),a=require("./ui-kit-provider-raEFsUm0.cjs"),u=require("./flex.cjs"),n=require("./grid.cjs"),e=require("./telephone-DVftjRG9.cjs"),d=require("./arrow-CS6d64Y4.cjs"),t=require("./media-picture-BmERSmsd.cjs"),p=require("./eye-open-5zYaeyLp.cjs"),g=require("./time-clock-DOwPzcx7.cjs"),S=require("./x-mark-DId-ylR6.cjs"),T=require("./drop-down-CdIuWbLC.cjs"),b=require("./input.cjs"),v=require("./media-card.cjs"),I=require("./media-gallery.cjs"),C=require("./pagination.cjs"),y=require("./picture.cjs"),k=require("./select.cjs"),q=require("./status-badge.cjs"),M=require("./switch.cjs"),o=require("./table-container-DqqqkChm.cjs"),c=require("./typography.cjs"),l=require("./responsive-style.config-B2m9jVlX.cjs");exports.Accordion=i.Accordion;exports.AccordionItem=i.AccordionItem;exports.AccordionRoot=i.AccordionRoot;exports.Box=s.Box;exports.Button=r.Button;exports.buttonSizeBorderRadius=r.buttonSizeBorderRadius;exports.buttonSizeBoxProps=r.buttonSizeBoxProps;exports.buttonSizeClassNames=r.buttonSizeClassNames;exports.buttonVariantClassNames=r.buttonVariantClassNames;exports.buttonVariants=r.buttonVariants;exports.UiKitProvider=a.UiKitProvider;exports.uiKitColorTokens=a.uiKitColorTokens;exports.uiKitTypographyTokens=a.uiKitTypographyTokens;exports.useUiKitConfig=a.useUiKitConfig;exports.Flex=u.Flex;exports.Grid=n.Grid;exports.GridItem=n.GridItem;exports.ArrowCornerIcon=e.SvgArrowCorner;exports.BurgerIcon=e.SvgBurger;exports.CopyIcon=e.SvgCopy;exports.FileIcon=e.SvgFile;exports.GeoIcon=e.SvgGeo;exports.LockClosedIcon=e.SvgLockClosed;exports.LockOpenIcon=e.SvgLockOpen;exports.LogoutIcon=e.SvgLogout;exports.MailIcon=e.SvgMail;exports.MediaMaxIcon=e.SvgMediaMax;exports.MediaTgIcon=e.SvgMediaTg;exports.MediaVkIcon=e.SvgMediaVk;exports.MediaWaIcon=e.SvgMediaWa;exports.NetUploadIcon=e.SvgNetUpload;exports.PaperclipIcon=e.SvgPaperclip;exports.PhoneIcon=e.SvgPhone;exports.PlusIcon=e.SvgPlus;exports.SaveIcon=e.SvgSave;exports.SparkIcon=e.SvgSparkIcon;exports.SparkleIcon=e.SvgSparkle;exports.TelephoneIcon=e.SvgTelephone;exports.TrashIcon=e.SvgTrash;exports.ArrowIcon=d.SvgArrow;exports.CheckIcon=t.SvgCheck;exports.MediaPictureIcon=t.SvgMediaPicture;exports.EyeOpenIcon=p.SvgEyeOpen;exports.TimeClockIcon=g.SvgTimeClock;exports.XMarkIcon=S.SvgXMark;exports.DropDown=T.SvgDropDown;exports.Input=b.Input;exports.MediaCard=v.MediaCard;exports.MediaGallery=I.MediaGallery;exports.Pagination=C.Pagination;exports.Picture=y.Picture;exports.Select=k.Select;exports.StatusBadge=q.StatusBadge;exports.Switch=M.Switch;exports.DataTable=o.DataTable;exports.Table=o.Table;exports.TableBody=o.TableBody;exports.TableCaption=o.TableCaption;exports.TableCell=o.TableCell;exports.TableContainer=o.TableContainer;exports.TableFooter=o.TableFooter;exports.TableHead=o.TableHead;exports.TableHeader=o.TableHeader;exports.TableRow=o.TableRow;exports.TableScrollArea=o.TableScrollArea;exports.TableStatus=o.TableStatus;exports.TableToolbar=o.TableToolbar;exports.Typography=c.Typography;exports.typographyVariants=c.typographyVariants;exports.responsiveBreakpointMinWidth=l.responsiveBreakpointMinWidth;exports.responsiveBreakpoints=l.responsiveBreakpoints;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './accordion/accordion';
|
|
2
|
+
export * from './box/box';
|
|
3
|
+
export * from './button/button';
|
|
4
|
+
export * from './design-tokens/color.tokens';
|
|
5
|
+
export * from './design-tokens/typography.tokens';
|
|
6
|
+
export * from './flex/flex';
|
|
7
|
+
export * from './grid/grid';
|
|
8
|
+
export * from './icons/icons';
|
|
9
|
+
export * from './input/input';
|
|
10
|
+
export * from './media-card/media-card';
|
|
11
|
+
export * from './media-gallery/media-gallery';
|
|
12
|
+
export * from './pagination/pagination';
|
|
13
|
+
export * from './picture/picture';
|
|
14
|
+
export * from './select/select';
|
|
15
|
+
export * from './status-badge/status-badge';
|
|
16
|
+
export * from './switch/switch';
|
|
17
|
+
export * from './table/table';
|
|
18
|
+
export * from './typography/typography';
|
|
19
|
+
export * from './ui-kit-provider/ui-kit-provider';
|
|
20
|
+
export type * from './types';
|
|
21
|
+
export * from './shared/responsive-style/responsive-style.config';
|
|
22
|
+
export type * from './shared/responsive-style/responsive-style.types';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Accordion as e, AccordionItem as r, AccordionRoot as s } from "./accordion.js";
|
|
2
|
+
import { Box as n } from "./box.js";
|
|
3
|
+
import { Button as p, buttonSizeBorderRadius as c, buttonSizeBoxProps as l, buttonSizeClassNames as I, buttonVariantClassNames as m, buttonVariants as x } from "./button.js";
|
|
4
|
+
import { U as d, u as T, a as b, b as u } from "./ui-kit-provider-C6Mk5g_7.js";
|
|
5
|
+
import { Flex as k } from "./flex.js";
|
|
6
|
+
import { Grid as g, GridItem as h } from "./grid.js";
|
|
7
|
+
import { S as y, a as B, b as P, c as A, d as w, e as v, f as D, g as G, h as K, i as U, j as V, k as z, l as F, m as L, n as N, o as R, p as j, q as H, r as O, s as W, t as q, u as E } from "./telephone-DvXakgBQ.js";
|
|
8
|
+
import { S as J } from "./arrow-DBc2opRL.js";
|
|
9
|
+
import { S as Y, a as Z } from "./media-picture-BN4saEVT.js";
|
|
10
|
+
import { S as $ } from "./eye-open-CoTSj5cT.js";
|
|
11
|
+
import { S as ao } from "./time-clock-DjqcZ8tI.js";
|
|
12
|
+
import { S as ro } from "./x-mark-WU1eT82T.js";
|
|
13
|
+
import { S as to } from "./drop-down-DH2_3qXq.js";
|
|
14
|
+
import { Input as io } from "./input.js";
|
|
15
|
+
import { MediaCard as co } from "./media-card.js";
|
|
16
|
+
import { MediaGallery as Io } from "./media-gallery.js";
|
|
17
|
+
import { Pagination as xo } from "./pagination.js";
|
|
18
|
+
import { Picture as To } from "./picture.js";
|
|
19
|
+
import { Select as uo } from "./select.js";
|
|
20
|
+
import { StatusBadge as ko } from "./status-badge.js";
|
|
21
|
+
import { Switch as go } from "./switch.js";
|
|
22
|
+
import { D as Mo, T as yo, a as Bo, b as Po, c as Ao, d as wo, e as vo, f as Do, g as Go, h as Ko, i as Uo, j as Vo, k as zo } from "./table-container-BsE-uIE1.js";
|
|
23
|
+
import { Typography as Lo, typographyVariants as No } from "./typography.js";
|
|
24
|
+
import { r as jo, a as Ho } from "./responsive-style.config-DFuATrIM.js";
|
|
25
|
+
export {
|
|
26
|
+
e as Accordion,
|
|
27
|
+
r as AccordionItem,
|
|
28
|
+
s as AccordionRoot,
|
|
29
|
+
y as ArrowCornerIcon,
|
|
30
|
+
J as ArrowIcon,
|
|
31
|
+
n as Box,
|
|
32
|
+
B as BurgerIcon,
|
|
33
|
+
p as Button,
|
|
34
|
+
Y as CheckIcon,
|
|
35
|
+
P as CopyIcon,
|
|
36
|
+
Mo as DataTable,
|
|
37
|
+
to as DropDown,
|
|
38
|
+
$ as EyeOpenIcon,
|
|
39
|
+
A as FileIcon,
|
|
40
|
+
k as Flex,
|
|
41
|
+
w as GeoIcon,
|
|
42
|
+
g as Grid,
|
|
43
|
+
h as GridItem,
|
|
44
|
+
io as Input,
|
|
45
|
+
v as LockClosedIcon,
|
|
46
|
+
D as LockOpenIcon,
|
|
47
|
+
G as LogoutIcon,
|
|
48
|
+
K as MailIcon,
|
|
49
|
+
co as MediaCard,
|
|
50
|
+
Io as MediaGallery,
|
|
51
|
+
U as MediaMaxIcon,
|
|
52
|
+
Z as MediaPictureIcon,
|
|
53
|
+
V as MediaTgIcon,
|
|
54
|
+
z as MediaVkIcon,
|
|
55
|
+
F as MediaWaIcon,
|
|
56
|
+
L as NetUploadIcon,
|
|
57
|
+
xo as Pagination,
|
|
58
|
+
N as PaperclipIcon,
|
|
59
|
+
R as PhoneIcon,
|
|
60
|
+
To as Picture,
|
|
61
|
+
j as PlusIcon,
|
|
62
|
+
H as SaveIcon,
|
|
63
|
+
uo as Select,
|
|
64
|
+
O as SparkIcon,
|
|
65
|
+
W as SparkleIcon,
|
|
66
|
+
ko as StatusBadge,
|
|
67
|
+
go as Switch,
|
|
68
|
+
yo as Table,
|
|
69
|
+
Bo as TableBody,
|
|
70
|
+
Po as TableCaption,
|
|
71
|
+
Ao as TableCell,
|
|
72
|
+
wo as TableContainer,
|
|
73
|
+
vo as TableFooter,
|
|
74
|
+
Do as TableHead,
|
|
75
|
+
Go as TableHeader,
|
|
76
|
+
Ko as TableRow,
|
|
77
|
+
Uo as TableScrollArea,
|
|
78
|
+
Vo as TableStatus,
|
|
79
|
+
zo as TableToolbar,
|
|
80
|
+
q as TelephoneIcon,
|
|
81
|
+
ao as TimeClockIcon,
|
|
82
|
+
E as TrashIcon,
|
|
83
|
+
Lo as Typography,
|
|
84
|
+
d as UiKitProvider,
|
|
85
|
+
ro as XMarkIcon,
|
|
86
|
+
c as buttonSizeBorderRadius,
|
|
87
|
+
l as buttonSizeBoxProps,
|
|
88
|
+
I as buttonSizeClassNames,
|
|
89
|
+
m as buttonVariantClassNames,
|
|
90
|
+
x as buttonVariants,
|
|
91
|
+
jo as responsiveBreakpointMinWidth,
|
|
92
|
+
Ho as responsiveBreakpoints,
|
|
93
|
+
No as typographyVariants,
|
|
94
|
+
T as uiKitColorTokens,
|
|
95
|
+
b as uiKitTypographyTokens,
|
|
96
|
+
u as useUiKitConfig
|
|
97
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ChangeEventHandler, InputHTMLAttributes, JSX, ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
/** Варианты отображения поля ввода. */
|
|
3
|
+
type InputVariant = 'default' | 'password' | 'textarea';
|
|
4
|
+
/** Общие props для input и textarea режимов. */
|
|
5
|
+
type InputBaseProps = {
|
|
6
|
+
/** Класс внешнего контейнера с label, control и сообщением. */
|
|
7
|
+
containerClassName?: string;
|
|
8
|
+
/** Состояние ошибки. ReactNode отображается как текст ошибки под полем. */
|
|
9
|
+
error?: boolean | ReactNode;
|
|
10
|
+
/** Подсказка под полем, показывается когда нет текстовой ошибки. */
|
|
11
|
+
helperText?: ReactNode;
|
|
12
|
+
/** Label над полем. */
|
|
13
|
+
label?: ReactNode;
|
|
14
|
+
/** Иконка слева внутри поля. */
|
|
15
|
+
leftIcon?: ReactNode;
|
|
16
|
+
/** Иконка справа внутри поля. В password-варианте заменяется кнопкой показа пароля. */
|
|
17
|
+
rightIcon?: ReactNode;
|
|
18
|
+
/** Вариант поля: обычный input, password или textarea. */
|
|
19
|
+
variant?: InputVariant;
|
|
20
|
+
};
|
|
21
|
+
/** Props для native input-режимов. */
|
|
22
|
+
type NativeInputProps = InputBaseProps & Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> & {
|
|
23
|
+
/** Флаг оставлен для совместимости с возможным controlled API, textarea выбирается через variant. */
|
|
24
|
+
multiline?: false;
|
|
25
|
+
/** Native input не может принимать textarea-вариант. */
|
|
26
|
+
variant?: Exclude<InputVariant, 'textarea'>;
|
|
27
|
+
};
|
|
28
|
+
/** Props для textarea-режима. */
|
|
29
|
+
type TextareaInputProps = InputBaseProps & Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'> & {
|
|
30
|
+
/** Явно фиксирует multiline-режим для textarea. */
|
|
31
|
+
multiline?: true;
|
|
32
|
+
/** У textarea нет native type, поэтому prop запрещён типами. */
|
|
33
|
+
type?: never;
|
|
34
|
+
/** Textarea включается только через этот variant. */
|
|
35
|
+
variant: 'textarea';
|
|
36
|
+
};
|
|
37
|
+
/** Props универсального поля ввода UI kit. */
|
|
38
|
+
export type InputProps = NativeInputProps | TextareaInputProps;
|
|
39
|
+
/**
|
|
40
|
+
* Универсальный input-компонент дизайн-системы.
|
|
41
|
+
*
|
|
42
|
+
* Компонент покрывает обычный input, password input с переключателем видимости и
|
|
43
|
+
* textarea. Label, helper/error text и иконки встроены в компонент, чтобы
|
|
44
|
+
* приложения использовали единый визуальный и accessibility-паттерн.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Input({ className, containerClassName, disabled, error, helperText, id, label, leftIcon, rightIcon, variant, ...props }: InputProps): JSX.Element;
|
|
47
|
+
/** Универсальный тип change handler для input и textarea режимов. */
|
|
48
|
+
export type InputChangeHandler = ChangeEventHandler<HTMLInputElement | HTMLTextAreaElement>;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Возвращает текст сообщения под полем.
|
|
4
|
+
*
|
|
5
|
+
* Если `error` передан как ReactNode, он имеет приоритет над helper text и
|
|
6
|
+
* отображается как сообщение ошибки. Boolean `error` только включает визуальное
|
|
7
|
+
* состояние ошибки, поэтому в таком случае показываем `helperText`, если он есть.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getInputMessage(error: boolean | ReactNode, helperText: ReactNode): ReactNode;
|
package/dist/input.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("react"),S=require("./eye-open-5zYaeyLp.cjs"),l=require("./responsive-style.config-B2m9jVlX.cjs"),g=require("./typography.cjs");function _(r,o){return r&&typeof r!="boolean"?r:o}const f="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 I({className:r,containerClassName:o,disabled:s,error:d=!1,helperText:m,id:h,label:p,leftIcon:n,rightIcon:j,variant:u="default",...a}){const w=b.useId(),i=h??w,[y,k]=b.useState(!1),t=!!d,x=_(d,m),N=u==="textarea",v=u==="password",c=v?e.jsx("button",{"aria-label":y?"Скрыть значение":"Показать значение",disabled:s,type:"button",onClick:()=>k(q=>!q),children:e.jsx(S.SvgEyeOpen,{})}):j;return e.jsxs("div",{className:l.cn("grid w-full gap-2",o),children:[p?e.jsx(g.Typography,{as:"label",color:"--color-text-secondary",htmlFor:i,variant:"b3",children:p}):null,e.jsxs("div",{className:"relative w-full",children:[n&&e.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:n}),N?e.jsx("textarea",{...a,"aria-invalid":t||a["aria-invalid"],className:l.cn(f,"min-h-[109px] resize-y px-4 py-3",t&&"border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",n&&"pl-12",r),disabled:s,id:i}):e.jsx("input",{...a,"aria-invalid":t||a["aria-invalid"],className:l.cn(f,"min-h-[42px] py-3",t&&"border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",n&&"pl-12",c&&"pr-12",r),disabled:s,id:i,type:v&&!y?"password":a.type??"text"}),c&&e.jsx("span",{className:"absolute right-2 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5",children:c})]}),x?e.jsx(g.Typography,{as:"p",color:t?"--color-secondary-accent-2":"--color-text-secondary",variant:"b3",children:x}):null]})}exports.Input=I;
|
package/dist/input.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { jsxs as x, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useId as I, useState as P } from "react";
|
|
3
|
+
import { S } from "./eye-open-CoTSj5cT.js";
|
|
4
|
+
import { c as l } from "./responsive-style.config-DFuATrIM.js";
|
|
5
|
+
import { Typography as b } from "./typography.js";
|
|
6
|
+
function j(a, n) {
|
|
7
|
+
return a && typeof a != "boolean" ? a : n;
|
|
8
|
+
}
|
|
9
|
+
const f = "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";
|
|
10
|
+
function F({
|
|
11
|
+
className: a,
|
|
12
|
+
containerClassName: n,
|
|
13
|
+
disabled: i,
|
|
14
|
+
error: d = !1,
|
|
15
|
+
helperText: g,
|
|
16
|
+
id: h,
|
|
17
|
+
label: p,
|
|
18
|
+
leftIcon: t,
|
|
19
|
+
rightIcon: w,
|
|
20
|
+
variant: u = "default",
|
|
21
|
+
...r
|
|
22
|
+
}) {
|
|
23
|
+
const k = I(), s = h ?? k, [v, N] = P(!1), o = !!d, y = j(d, g), _ = u === "textarea", m = u === "password", c = m ? /* @__PURE__ */ e(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
"aria-label": v ? "Скрыть значение" : "Показать значение",
|
|
27
|
+
disabled: i,
|
|
28
|
+
type: "button",
|
|
29
|
+
onClick: () => N((z) => !z),
|
|
30
|
+
children: /* @__PURE__ */ e(S, {})
|
|
31
|
+
}
|
|
32
|
+
) : w;
|
|
33
|
+
return /* @__PURE__ */ x("div", { className: l("grid w-full gap-2", n), children: [
|
|
34
|
+
p ? /* @__PURE__ */ e(b, { as: "label", color: "--color-text-secondary", htmlFor: s, variant: "b3", children: p }) : null,
|
|
35
|
+
/* @__PURE__ */ x("div", { className: "relative w-full", children: [
|
|
36
|
+
t && /* @__PURE__ */ e("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: t }),
|
|
37
|
+
_ ? /* @__PURE__ */ e(
|
|
38
|
+
"textarea",
|
|
39
|
+
{
|
|
40
|
+
...r,
|
|
41
|
+
"aria-invalid": o || r["aria-invalid"],
|
|
42
|
+
className: l(
|
|
43
|
+
f,
|
|
44
|
+
"min-h-[109px] resize-y px-4 py-3",
|
|
45
|
+
o && "border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",
|
|
46
|
+
t && "pl-12",
|
|
47
|
+
a
|
|
48
|
+
),
|
|
49
|
+
disabled: i,
|
|
50
|
+
id: s
|
|
51
|
+
}
|
|
52
|
+
) : /* @__PURE__ */ e(
|
|
53
|
+
"input",
|
|
54
|
+
{
|
|
55
|
+
...r,
|
|
56
|
+
"aria-invalid": o || r["aria-invalid"],
|
|
57
|
+
className: l(
|
|
58
|
+
f,
|
|
59
|
+
"min-h-[42px] py-3",
|
|
60
|
+
o && "border-[var(--color-secondary-accent-2)] focus-visible:ring-[var(--color-secondary-accent-2)]",
|
|
61
|
+
t && "pl-12",
|
|
62
|
+
c && "pr-12",
|
|
63
|
+
a
|
|
64
|
+
),
|
|
65
|
+
disabled: i,
|
|
66
|
+
id: s,
|
|
67
|
+
type: m && !v ? "password" : r.type ?? "text"
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
c && /* @__PURE__ */ e("span", { className: "absolute right-2 top-1/2 flex -translate-y-1/2 text-[var(--color-text-secondary)] [&_svg]:size-5", children: c })
|
|
71
|
+
] }),
|
|
72
|
+
y ? /* @__PURE__ */ e(
|
|
73
|
+
b,
|
|
74
|
+
{
|
|
75
|
+
as: "p",
|
|
76
|
+
color: o ? "--color-secondary-accent-2" : "--color-text-secondary",
|
|
77
|
+
variant: "b3",
|
|
78
|
+
children: y
|
|
79
|
+
}
|
|
80
|
+
) : null
|
|
81
|
+
] });
|
|
82
|
+
}
|
|
83
|
+
export {
|
|
84
|
+
F as Input
|
|
85
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
type MediaCardPreviewProps = PropsWithChildren<{
|
|
3
|
+
fileName: string;
|
|
4
|
+
imgUrl?: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function MediaCardPreview({ fileName, imgUrl, children }: MediaCardPreviewProps): ReactNode;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { MediaCardProps } from '../media-card.types';
|
|
3
|
+
type MediaCardUploadProps = Pick<MediaCardProps, 'className' | 'fileName' | 'imgUrl' | 'onDelete'>;
|
|
4
|
+
export declare function MediaCardUpload({ className, fileName, imgUrl, onDelete, }: MediaCardUploadProps): JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { MediaCardProps } from './media-card.types';
|
|
3
|
+
type MediaCardPickProps = Pick<MediaCardProps, 'className' | 'fileName' | 'imgUrl' | 'isPicked' | 'onSubmit'>;
|
|
4
|
+
export declare function MediaCardPick({ className, fileName, imgUrl, isPicked, onSubmit, }: MediaCardPickProps): JSX.Element;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { MediaCardProps, MediaCardVariant } from './media-card.types';
|
|
3
|
+
export declare function MediaCard({ className, fileName, imgUrl, isPicked, onDelete, onSubmit, variant, }: MediaCardProps): JSX.Element;
|
|
4
|
+
export type { MediaCardProps, MediaCardVariant };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./responsive-style.config-B2m9jVlX.cjs"),o=require("./media-picture-BmERSmsd.cjs"),u=require("./x-mark-DId-ylR6.cjs"),x=require("./typography.cjs");function p({isPicked:r}){return e.jsx("span",{className:c.cn("absolute right-[4px] top-[4px] inline-flex size-[20px] items-center justify-center rounded-full ",r?" bg-[var(--color-primary-accent)] text-[var(--color-background-default)]":"bg-[var(--color-background-default)] text-transparent"),"aria-hidden":"true",children:e.jsx(o.SvgCheck,{className:"size-[18px]"})})}function s({fileName:r,imgUrl:n,children:t}){return e.jsxs("div",{className:"relative flex aspect-square w-full items-center justify-center rounded-[8px] overflow-hidden bg-[var(--color-background-subtle)]",children:[n?e.jsx("img",{className:"w-full object-contain",src:n,alt:r}):e.jsx(o.SvgMediaPicture,{className:"size-[40px] text-[var(--color-text-secondary)]"}),t]})}function b({className:r,fileName:n,imgUrl:t,isPicked:a=!1,onSubmit:i}){return e.jsx("button",{type:"button",className:c.cn("block w-full overflow-hidden rounded-[10px] border border-[var(--color-primary-accent)] outline-none transition-colors focus-visible:ring-2 focus-visible:ring-[color-mix(in_srgb,var(--color-primary-accent)_35%,transparent)]",r),onClick:i,children:e.jsx(s,{fileName:n,imgUrl:t,children:e.jsx(p,{isPicked:a})})})}function f({fileName:r,onDelete:n}){return e.jsxs("div",{className:"flex justify-between items-center gap-[8px]",children:[e.jsx(x.Typography,{variant:"b3",children:r}),n?e.jsx("button",{type:"button","aria-label":`Удалить ${r}`,onClick:n,children:e.jsx(u.SvgXMark,{className:"size-[16px]"})}):null]})}function j({className:r,fileName:n,imgUrl:t,onDelete:a}){return e.jsxs("div",{className:c.cn("flex flex-col w-full gap-[4px] rounded-[10px] bg-[var(--color-background-subtle)] p-[4px]",r),children:[e.jsx(s,{fileName:n,imgUrl:t}),e.jsx(f,{fileName:n,onDelete:a})]})}function v({className:r,fileName:n,imgUrl:t,isPicked:a,onDelete:i,onSubmit:l,variant:d}){return d==="img-pick"?e.jsx(b,{className:r,fileName:n,imgUrl:t,isPicked:a,onSubmit:l}):e.jsx(j,{className:r,fileName:n,imgUrl:t,onDelete:i})}exports.MediaCard=v;
|