@shmidko61/lc-ui-kit 0.13.0 → 0.16.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.
Files changed (67) hide show
  1. package/README.md +61 -0
  2. package/dist/box/box.d.ts +2 -1
  3. package/dist/box/box.types.d.ts +2 -2
  4. package/dist/box/helpers/box-animation.helpers.d.ts +8 -0
  5. package/dist/box/helpers/box-scrollbar.helpers.d.ts +7 -0
  6. package/dist/box/helpers/index.d.ts +2 -0
  7. package/dist/box/types/box-animation.types.d.ts +3 -0
  8. package/dist/box/types/box-scrollbar.types.d.ts +7 -0
  9. package/dist/box/types/index.d.ts +2 -0
  10. package/dist/box.cjs +1 -1
  11. package/dist/box.js +476 -307
  12. package/dist/button.cjs +1 -1
  13. package/dist/button.js +163 -156
  14. package/dist/flex/flex.d.ts +1 -0
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.d.ts +4 -0
  17. package/dist/index.js +70 -62
  18. package/dist/loader/helpers/index.d.ts +1 -0
  19. package/dist/loader/helpers/loader.helpers.d.ts +2 -0
  20. package/dist/loader/index.d.ts +2 -0
  21. package/dist/loader/loader.d.ts +5 -0
  22. package/dist/loader/types/index.d.ts +1 -0
  23. package/dist/loader/types/loader.types.d.ts +28 -0
  24. package/dist/loader-Daam055i.js +104 -0
  25. package/dist/loader-ODTCTLKE.cjs +1 -0
  26. package/dist/loader.cjs +1 -0
  27. package/dist/loader.js +4 -0
  28. package/dist/media-gallery.cjs +1 -1
  29. package/dist/media-gallery.js +42 -30
  30. package/dist/progress-bar/helpers/index.d.ts +1 -0
  31. package/dist/progress-bar/helpers/progress-bar.helpers.d.ts +6 -0
  32. package/dist/progress-bar/index.d.ts +2 -0
  33. package/dist/progress-bar/progress-bar.d.ts +5 -0
  34. package/dist/progress-bar/types/index.d.ts +1 -0
  35. package/dist/progress-bar/types/progress-bar.types.d.ts +80 -0
  36. package/dist/progress-bar-D4CL9r42.js +236 -0
  37. package/dist/progress-bar-XIJDb_UM.cjs +1 -0
  38. package/dist/progress-bar.cjs +1 -0
  39. package/dist/progress-bar.js +4 -0
  40. package/dist/shared/responsive-style/index.d.ts +1 -0
  41. package/dist/styles.css +1 -1
  42. package/dist/tabs/helpers/index.d.ts +1 -0
  43. package/dist/tabs/helpers/tabs.helpers.d.ts +7 -0
  44. package/dist/tabs/hooks/index.d.ts +1 -0
  45. package/dist/tabs/hooks/tabs.hooks.d.ts +5 -0
  46. package/dist/tabs/index.d.ts +2 -0
  47. package/dist/tabs/tabs.d.ts +4 -0
  48. package/dist/tabs/types/index.d.ts +1 -0
  49. package/dist/tabs/types/tabs.types.d.ts +95 -0
  50. package/dist/tabs-BNZDJRz_.cjs +1 -0
  51. package/dist/tabs-DIPSJX1z.js +264 -0
  52. package/dist/tabs.cjs +1 -0
  53. package/dist/tabs.js +5 -0
  54. package/dist/tooltip/helpers/index.d.ts +1 -0
  55. package/dist/tooltip/helpers/tooltip.helpers.d.ts +7 -0
  56. package/dist/tooltip/index.d.ts +2 -0
  57. package/dist/tooltip/tooltip.d.ts +5 -0
  58. package/dist/tooltip/types/index.d.ts +1 -0
  59. package/dist/tooltip/types/tooltip.types.d.ts +51 -0
  60. package/dist/tooltip-0RbTCYn_.cjs +1 -0
  61. package/dist/tooltip-CWnHAfbI.js +166 -0
  62. package/dist/tooltip.cjs +1 -0
  63. package/dist/tooltip.js +4 -0
  64. package/dist/types/animation.types.d.ts +35 -0
  65. package/dist/types/index.d.ts +2 -0
  66. package/dist/types/scrollbar.types.d.ts +33 -0
  67. package/package.json +44 -4
package/dist/index.js CHANGED
@@ -1,40 +1,44 @@
1
- import { Accordion as r, AccordionItem as a, AccordionRoot as n } from "./accordion.js";
1
+ import { Accordion as e, AccordionItem as a, AccordionRoot as n } from "./accordion.js";
2
2
  import { A as i } from "./alert-CTIWpkmD.js";
3
3
  import { Box as s } from "./box.js";
4
- import { Button as I, buttonSizeBorderRadius as l, buttonSizeBoxProps as f, buttonSizeClassNames as m, buttonVariantClassNames as d, buttonVariants as x } from "./button.js";
5
- import { U as b, u, a as k, b as C } from "./ui-kit-provider-C6Mk5g_7.js";
4
+ import { Button as l, buttonSizeBorderRadius as I, buttonSizeBoxProps as f, buttonSizeClassNames as m, buttonVariantClassNames as x, buttonVariants as T } from "./button.js";
5
+ import { U as b, u, a as k, b as g } from "./ui-kit-provider-C6Mk5g_7.js";
6
6
  import { Flex as h } from "./flex.js";
7
- import { Grid as S, GridItem as y } from "./grid.js";
8
- import { ArrowCornerIcon as B, ArrowIcon as P, ArrowLongLeftIcon as w, ArrowheadRightIcon as N, BlockIcon as v, BurgerIcon as D, CheckIcon as G, CopyIcon as L, DoubleCheckIcon as K, DropDown as R, ExclamationMarkIcon as U, EyeOpenIcon as V, FileIcon as z, GeminiStarIcon as F, GeoIcon as W, InfoCircleIcon as E, LockClosedIcon as H, LockOpenIcon as O, LogoutIcon as j, MailIcon as X, MediaMaxIcon as q, MediaPictureIcon as J, MediaTgIcon as Q, MediaVkIcon as Y, MediaWaIcon as Z, NetUploadIcon as _, PaperclipIcon as $, PdfIcon as oo, PhoneIcon as eo, PlusIcon as ro, SaveIcon as ao, SparkIcon as no, SparkleIcon as to, TelephoneIcon as io, TimeClockIcon as co, TrashIcon as so, WarningTriangleIcon as po, XMarkIcon as Io } from "./icons.js";
7
+ import { Grid as P, GridItem as S } from "./grid.js";
8
+ import { ArrowCornerIcon as y, ArrowIcon as A, ArrowLongLeftIcon as w, ArrowheadRightIcon as L, BlockIcon as N, BurgerIcon as v, CheckIcon as D, CopyIcon as G, DoubleCheckIcon as K, DropDown as R, ExclamationMarkIcon as U, EyeOpenIcon as V, FileIcon as z, GeminiStarIcon as F, GeoIcon as W, InfoCircleIcon as E, LockClosedIcon as H, LockOpenIcon as O, LogoutIcon as j, MailIcon as X, MediaMaxIcon as q, MediaPictureIcon as J, MediaTgIcon as Q, MediaVkIcon as Y, MediaWaIcon as Z, NetUploadIcon as _, PaperclipIcon as $, PdfIcon as oo, PhoneIcon as ro, PlusIcon as eo, SaveIcon as ao, SparkIcon as no, SparkleIcon as to, TelephoneIcon as io, TimeClockIcon as co, TrashIcon as so, WarningTriangleIcon as po, XMarkIcon as lo } from "./icons.js";
9
9
  import { Input as fo } from "./input.js";
10
- import { MediaCard as xo } from "./media-card.js";
11
- import { MediaGallery as bo } from "./media-gallery.js";
12
- import { N as ko, u as Co } from "./notification-provider-WLUaZyMB.js";
13
- import { Pagination as ho } from "./pagination.js";
14
- import { Picture as So } from "./picture.js";
15
- import { Select as Ao } from "./select.js";
16
- import { r as Po, a as wo } from "./responsive-style.config-DFuATrIM.js";
17
- import { StatusBadge as vo } from "./status-badge.js";
18
- import { Switch as Go } from "./switch.js";
19
- import { D as Ko, T as Ro, a as Uo, b as Vo, c as zo, d as Fo, e as Wo, f as Eo, g as Ho, h as Oo, i as jo, j as Xo, k as qo } from "./table-container-BsE-uIE1.js";
20
- import { T as Qo } from "./toast-DpjugQ8H.js";
21
- import { Typography as Zo, typographyVariants as _o } from "./typography.js";
10
+ import { L as xo } from "./loader-Daam055i.js";
11
+ import { MediaCard as bo } from "./media-card.js";
12
+ import { MediaGallery as ko } from "./media-gallery.js";
13
+ import { N as Co, u as ho } from "./notification-provider-WLUaZyMB.js";
14
+ import { Pagination as Po } from "./pagination.js";
15
+ import { Picture as Bo } from "./picture.js";
16
+ import { P as Ao } from "./progress-bar-D4CL9r42.js";
17
+ import { Select as Lo } from "./select.js";
18
+ import { r as vo, a as Do } from "./responsive-style.config-DFuATrIM.js";
19
+ import { StatusBadge as Ko } from "./status-badge.js";
20
+ import { Switch as Uo } from "./switch.js";
21
+ import { D as zo, T as Fo, a as Wo, b as Eo, c as Ho, d as Oo, e as jo, f as Xo, g as qo, h as Jo, i as Qo, j as Yo, k as Zo } from "./table-container-BsE-uIE1.js";
22
+ import { T as $o } from "./tabs-DIPSJX1z.js";
23
+ import { T as rr } from "./toast-DpjugQ8H.js";
24
+ import { T as ar } from "./tooltip-CWnHAfbI.js";
25
+ import { Typography as tr, typographyVariants as ir } from "./typography.js";
22
26
  export {
23
- r as Accordion,
27
+ e as Accordion,
24
28
  a as AccordionItem,
25
29
  n as AccordionRoot,
26
30
  i as Alert,
27
- B as ArrowCornerIcon,
28
- P as ArrowIcon,
31
+ y as ArrowCornerIcon,
32
+ A as ArrowIcon,
29
33
  w as ArrowLongLeftIcon,
30
- N as ArrowheadRightIcon,
31
- v as BlockIcon,
34
+ L as ArrowheadRightIcon,
35
+ N as BlockIcon,
32
36
  s as Box,
33
- D as BurgerIcon,
34
- I as Button,
35
- G as CheckIcon,
36
- L as CopyIcon,
37
- Ko as DataTable,
37
+ v as BurgerIcon,
38
+ l as Button,
39
+ D as CheckIcon,
40
+ G as CopyIcon,
41
+ zo as DataTable,
38
42
  K as DoubleCheckIcon,
39
43
  R as DropDown,
40
44
  U as ExclamationMarkIcon,
@@ -43,65 +47,69 @@ export {
43
47
  h as Flex,
44
48
  F as GeminiStarIcon,
45
49
  W as GeoIcon,
46
- S as Grid,
47
- y as GridItem,
50
+ P as Grid,
51
+ S as GridItem,
48
52
  E as InfoCircleIcon,
49
53
  fo as Input,
54
+ xo as Loader,
50
55
  H as LockClosedIcon,
51
56
  O as LockOpenIcon,
52
57
  j as LogoutIcon,
53
58
  X as MailIcon,
54
- xo as MediaCard,
55
- bo as MediaGallery,
59
+ bo as MediaCard,
60
+ ko as MediaGallery,
56
61
  q as MediaMaxIcon,
57
62
  J as MediaPictureIcon,
58
63
  Q as MediaTgIcon,
59
64
  Y as MediaVkIcon,
60
65
  Z as MediaWaIcon,
61
66
  _ as NetUploadIcon,
62
- ko as NotificationProvider,
63
- ho as Pagination,
67
+ Co as NotificationProvider,
68
+ Po as Pagination,
64
69
  $ as PaperclipIcon,
65
70
  oo as PdfIcon,
66
- eo as PhoneIcon,
67
- So as Picture,
68
- ro as PlusIcon,
71
+ ro as PhoneIcon,
72
+ Bo as Picture,
73
+ eo as PlusIcon,
74
+ Ao as ProgressBar,
69
75
  ao as SaveIcon,
70
- Ao as Select,
76
+ Lo as Select,
71
77
  no as SparkIcon,
72
78
  to as SparkleIcon,
73
- vo as StatusBadge,
74
- Go as Switch,
75
- Ro as Table,
76
- Uo as TableBody,
77
- Vo as TableCaption,
78
- zo as TableCell,
79
- Fo as TableContainer,
80
- Wo as TableFooter,
81
- Eo as TableHead,
82
- Ho as TableHeader,
83
- Oo as TableRow,
84
- jo as TableScrollArea,
85
- Xo as TableStatus,
86
- qo as TableToolbar,
79
+ Ko as StatusBadge,
80
+ Uo as Switch,
81
+ Fo as Table,
82
+ Wo as TableBody,
83
+ Eo as TableCaption,
84
+ Ho as TableCell,
85
+ Oo as TableContainer,
86
+ jo as TableFooter,
87
+ Xo as TableHead,
88
+ qo as TableHeader,
89
+ Jo as TableRow,
90
+ Qo as TableScrollArea,
91
+ Yo as TableStatus,
92
+ Zo as TableToolbar,
93
+ $o as Tabs,
87
94
  io as TelephoneIcon,
88
95
  co as TimeClockIcon,
89
- Qo as Toast,
96
+ rr as Toast,
97
+ ar as Tooltip,
90
98
  so as TrashIcon,
91
- Zo as Typography,
99
+ tr as Typography,
92
100
  b as UiKitProvider,
93
101
  po as WarningTriangleIcon,
94
- Io as XMarkIcon,
95
- l as buttonSizeBorderRadius,
102
+ lo as XMarkIcon,
103
+ I as buttonSizeBorderRadius,
96
104
  f as buttonSizeBoxProps,
97
105
  m as buttonSizeClassNames,
98
- d as buttonVariantClassNames,
99
- x as buttonVariants,
100
- Po as responsiveBreakpointMinWidth,
101
- wo as responsiveBreakpoints,
102
- _o as typographyVariants,
106
+ x as buttonVariantClassNames,
107
+ T as buttonVariants,
108
+ vo as responsiveBreakpointMinWidth,
109
+ Do as responsiveBreakpoints,
110
+ ir as typographyVariants,
103
111
  u as uiKitColorTokens,
104
112
  k as uiKitTypographyTokens,
105
- Co as useNotifications,
106
- C as useUiKitConfig
113
+ ho as useNotifications,
114
+ g as useUiKitConfig
107
115
  };
@@ -0,0 +1 @@
1
+ export { normalizeLoaderValue } from './loader.helpers';
@@ -0,0 +1,2 @@
1
+ /** Ограничивает конечное значение прогресса диапазоном 0–100; некорректное число становится 0. */
2
+ export declare function normalizeLoaderValue(value: number): number;
@@ -0,0 +1,2 @@
1
+ export { Loader } from './loader';
2
+ export type { LoaderProps } from './types/index';
@@ -0,0 +1,5 @@
1
+ import { JSX } from 'react';
2
+ import { LoaderProps } from './types/index';
3
+ /** Индикатор загрузки: value задаёт progressbar, без value используется неопределённый статус. */
4
+ export declare function Loader({ value, showValue, children, label, ariaLabel, indicatorProps, spinnerProps, labelProps, trackColor, strokeWidth, indicator, ...props }: LoaderProps): JSX.Element;
5
+ export type { LoaderProps } from './types/index';
@@ -0,0 +1 @@
1
+ export type { LoaderProps } from './loader.types';
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { BoxProps } from '../../box/index';
3
+ import { FlexProps } from '../../flex/index';
4
+ /** Настройки индикатора и обёртки; стандартные props Flex поддерживают md/lg/xl и наследование. */
5
+ export type LoaderProps = Omit<FlexProps, 'children'> & {
6
+ /** Прогресс от 0 до 100; без value отображается вращающийся индикатор. */
7
+ value?: number;
8
+ /** Показывать процент внутри определённого индикатора; по умолчанию true. */
9
+ showValue?: boolean;
10
+ /** Пользовательское содержимое центра; null явно скрывает его. */
11
+ children?: ReactNode;
12
+ /** Подпись под индикатором; по умолчанию отсутствует. */
13
+ label?: ReactNode;
14
+ /** Доступное имя, по умолчанию «Загрузка». */
15
+ ariaLabel?: string;
16
+ /** Стандартные Box props индикатора; width/height и md/lg/xl управляют размером. Явный style приоритетнее. */
17
+ indicatorProps?: Omit<BoxProps, 'children' | 'as'>;
18
+ /** Props SVG на базе Box: animation и md/lg/xl управляют вращением. По умолчанию spin только без value; style имеет приоритет. */
19
+ spinnerProps?: Omit<BoxProps<'svg'>, 'children' | 'as'>;
20
+ /** Стандартные Box props подписи, включая responsive и style. */
21
+ labelProps?: Omit<BoxProps, 'children' | 'as'>;
22
+ /** Цвет дорожки SVG, по умолчанию токен background-subtle; принимает currentColor и CSS. */
23
+ trackColor?: string;
24
+ /** Ширина линии в системе координат 64×64, по умолчанию 4; ограничена диапазоном 0–64. */
25
+ strokeWidth?: number;
26
+ /** Пользовательский индикатор вместо SVG; применяется к обоим режимам. */
27
+ indicator?: ReactNode;
28
+ };
@@ -0,0 +1,104 @@
1
+ import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
+ import { Flex as m } from "./flex.js";
3
+ import { Box as a } from "./box.js";
4
+ function y(e) {
5
+ return Number.isFinite(e) ? Math.min(100, Math.max(0, e)) : 0;
6
+ }
7
+ function M({
8
+ value: e,
9
+ showValue: p = !0,
10
+ children: t,
11
+ label: s,
12
+ ariaLabel: u = "Загрузка",
13
+ indicatorProps: x,
14
+ spinnerProps: f,
15
+ labelProps: l,
16
+ trackColor: g = "var(--color-background-subtle)",
17
+ strokeWidth: c = 4,
18
+ indicator: d,
19
+ ...v
20
+ }) {
21
+ const r = e === void 0 ? void 0 : y(e), i = Number.isFinite(c) ? Math.min(64, Math.max(0, c)) : 4, h = (64 - i) / 2;
22
+ return /* @__PURE__ */ n(
23
+ m,
24
+ {
25
+ flexDirection: "column",
26
+ align: "center",
27
+ gap: 8,
28
+ color: "--color-primary-accent",
29
+ role: "progressbar",
30
+ "aria-label": u,
31
+ "aria-valuemin": 0,
32
+ "aria-valuemax": 100,
33
+ "aria-valuenow": r,
34
+ ...v,
35
+ children: [
36
+ /* @__PURE__ */ n(a, { position: { type: "relative" }, width: 64, height: 64, ...x, children: [
37
+ d === void 0 ? /* @__PURE__ */ n(
38
+ a,
39
+ {
40
+ as: "svg",
41
+ "aria-hidden": "true",
42
+ width: "100%",
43
+ height: "100%",
44
+ viewBox: "0 0 64 64",
45
+ animation: r === void 0 ? "spin" : "none",
46
+ ...f,
47
+ children: [
48
+ /* @__PURE__ */ o(
49
+ "circle",
50
+ {
51
+ cx: "32",
52
+ cy: "32",
53
+ r: h,
54
+ fill: "none",
55
+ stroke: g,
56
+ strokeWidth: i
57
+ }
58
+ ),
59
+ /* @__PURE__ */ o(
60
+ "circle",
61
+ {
62
+ cx: "32",
63
+ cy: "32",
64
+ r: h,
65
+ fill: "none",
66
+ stroke: "currentColor",
67
+ strokeWidth: i,
68
+ strokeLinecap: "round",
69
+ strokeOpacity: r === 0 ? 0 : 1,
70
+ pathLength: 100,
71
+ strokeDasharray: r === void 0 ? "25 100" : String(r) + " 100",
72
+ transform: "rotate(-90 32 32)"
73
+ }
74
+ )
75
+ ]
76
+ }
77
+ ) : d,
78
+ (t !== void 0 || r !== void 0 && p) && /* @__PURE__ */ o(
79
+ m,
80
+ {
81
+ position: { type: "absolute", top: 0, bottom: 0, left: 0, right: 0 },
82
+ align: "center",
83
+ justify: "center",
84
+ style: { fontSize: "18px", lineHeight: "22px" },
85
+ children: t !== void 0 ? t : Math.round(r ?? 0) + "%"
86
+ }
87
+ )
88
+ ] }),
89
+ s != null && /* @__PURE__ */ o(
90
+ a,
91
+ {
92
+ color: "--color-text-secondary",
93
+ ...l,
94
+ style: { fontSize: "14px", lineHeight: "18px", ...l?.style },
95
+ children: s
96
+ }
97
+ )
98
+ ]
99
+ }
100
+ );
101
+ }
102
+ export {
103
+ M as L
104
+ };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("react/jsx-runtime"),u=require("./flex.cjs"),n=require("./box.cjs");function f(t){return Number.isFinite(t)?Math.min(100,Math.max(0,t)):0}function y({value:t,showValue:d=!0,children:i,label:a,ariaLabel:h="Загрузка",indicatorProps:p,spinnerProps:m,labelProps:s,trackColor:g="var(--color-background-subtle)",strokeWidth:c=4,indicator:l,...v}){const e=t===void 0?void 0:f(t),o=Number.isFinite(c)?Math.min(64,Math.max(0,c)):4,x=(64-o)/2;return r.jsxs(u.Flex,{flexDirection:"column",align:"center",gap:8,color:"--color-primary-accent",role:"progressbar","aria-label":h,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e,...v,children:[r.jsxs(n.Box,{position:{type:"relative"},width:64,height:64,...p,children:[l===void 0?r.jsxs(n.Box,{as:"svg","aria-hidden":"true",width:"100%",height:"100%",viewBox:"0 0 64 64",animation:e===void 0?"spin":"none",...m,children:[r.jsx("circle",{cx:"32",cy:"32",r:x,fill:"none",stroke:g,strokeWidth:o}),r.jsx("circle",{cx:"32",cy:"32",r:x,fill:"none",stroke:"currentColor",strokeWidth:o,strokeLinecap:"round",strokeOpacity:e===0?0:1,pathLength:100,strokeDasharray:e===void 0?"25 100":String(e)+" 100",transform:"rotate(-90 32 32)"})]}):l,(i!==void 0||e!==void 0&&d)&&r.jsx(u.Flex,{position:{type:"absolute",top:0,bottom:0,left:0,right:0},align:"center",justify:"center",style:{fontSize:"18px",lineHeight:"22px"},children:i!==void 0?i:Math.round(e??0)+"%"})]}),a!=null&&r.jsx(n.Box,{color:"--color-text-secondary",...s,style:{fontSize:"14px",lineHeight:"18px",...s?.style},children:a})]})}exports.Loader=y;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./loader-ODTCTLKE.cjs");exports.Loader=e.Loader;
package/dist/loader.js ADDED
@@ -0,0 +1,4 @@
1
+ import { L as a } from "./loader-Daam055i.js";
2
+ export {
3
+ a as Loader
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),q=require("./grid.cjs"),N=require("./icons.cjs"),P=require("./media-card.cjs"),p=require("./responsive-style.config-B2m9jVlX.cjs"),c=require("./typography.cjs");function C({itemsCount:e,maxHeight:l,scrollable:n,scrollThreshold:o}){return{maxHeightValue:T(l??420),shouldUseScroll:n??e>o}}function M({columns:e,gap:l,lg:n,md:o,xl:s}){return{cols:e??4,gap:l??8,md:t(o),lg:t(n),xl:t(s)}}function t(e){if(e)return{cols:e.columns,gap:e.gap}}function T(e){return typeof e=="number"?`${e}px`:e}function k({className:e,columns:l,errorMessage:n,emptyMessage:o="В галерее пока нет изображений.",gap:s,gridClassName:g,items:i,isLoading:d=!1,lg:x,maxHeight:y,md:h,onSubmit:m,scrollable:f,scrollThreshold:v=6,xl:j,...b}){const{maxHeightValue:S,shouldUseScroll:u}=C({itemsCount:i.length,maxHeight:y,scrollable:f,scrollThreshold:v}),G=M({columns:l,gap:s,lg:x,md:h,xl:j});return r.jsxs("div",{className:p.cn("grid gap-[12px]",e),...b,children:[d?r.jsxs("div",{className:"flex items-center gap-[8px] text-[var(--color-text-secondary)]",children:[r.jsx(N.TimeClockIcon,{className:"size-[16px] animate-spin"}),r.jsx(c.Typography,{as:"span",variant:"b3",children:"Загружаем галерею..."})]}):null,n?r.jsx(c.Typography,{as:"p",color:"--color-secondary-accent-2",variant:"b3",children:n}):null,i.length>0?r.jsx(q.Grid,{...G,className:p.cn(u&&"overflow-y-auto rounded-[12px] bg-[var(--color-background-subtle)] p-[8px]",g),style:u?{maxHeight:S}:void 0,children:i.map(a=>r.jsx(P.MediaCard,{fileName:a.fileName,imgUrl:a.imgUrl,isPicked:a.isPicked,variant:"img-pick",onSubmit:()=>m?.(a)},a.id))}):null,!d&&i.length===0?r.jsx(c.Typography,{as:"p",color:"--color-text-secondary",variant:"b3",children:o}):null]})}exports.MediaGallery=k;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),G=require("./grid.cjs"),P=require("./icons.cjs"),k=require("./media-card.cjs"),p=require("./responsive-style.config-B2m9jVlX.cjs"),s=require("./typography.cjs"),C=require("./box.cjs");function M({itemsCount:e,maxHeight:i,scrollable:n,scrollThreshold:l}){return{maxHeightValue:T(i??420),shouldUseScroll:n??e>l}}function N({columns:e,gap:i,lg:n,md:l,xl:t}){return{cols:e??4,gap:i??8,md:c(l),lg:c(n),xl:c(t)}}function c(e){if(e)return{cols:e.columns,gap:e.gap}}function T(e){return typeof e=="number"?`${e}px`:e}function U({className:e,columns:i,errorMessage:n,emptyMessage:l="В галерее пока нет изображений.",gap:t,gridClassName:g,items:a,isLoading:d=!1,lg:h,maxHeight:x,md:y,onSubmit:m,scrollable:f,scrollThreshold:j=6,xl:v,...b}){const{maxHeightValue:S,shouldUseScroll:u}=M({itemsCount:a.length,maxHeight:x,scrollable:f,scrollThreshold:j}),q=N({columns:i,gap:t,lg:h,md:y,xl:v});return r.jsxs("div",{className:p.cn("grid gap-[12px]",e),...b,children:[d?r.jsxs("div",{className:"flex items-center gap-[8px] text-[var(--color-text-secondary)]",children:[r.jsx(C.Box,{as:"span",display:"inline-block",width:16,height:16,animation:"spin","aria-hidden":"true",children:r.jsx(P.TimeClockIcon,{width:16,height:16})}),r.jsx(s.Typography,{as:"span",variant:"b3",children:"Загружаем галерею..."})]}):null,n?r.jsx(s.Typography,{as:"p",color:"--color-secondary-accent-2",variant:"b3",children:n}):null,a.length>0?r.jsx(G.Grid,{...q,className:p.cn(u&&"overflow-y-auto rounded-[12px] bg-[var(--color-background-subtle)] p-[8px]",g),style:u?{maxHeight:S}:void 0,children:a.map(o=>r.jsx(k.MediaCard,{fileName:o.fileName,imgUrl:o.imgUrl,isPicked:o.isPicked,variant:"img-pick",onSubmit:()=>m?.(o)},o.id))}):null,!d&&a.length===0?r.jsx(s.Typography,{as:"p",color:"--color-text-secondary",variant:"b3",children:l}):null]})}exports.MediaGallery=U;
@@ -1,36 +1,37 @@
1
1
  import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import { Grid as k } from "./grid.js";
2
+ import { Grid as S } from "./grid.js";
3
3
  import { TimeClockIcon as C } from "./icons.js";
4
4
  import { MediaCard as U } from "./media-card.js";
5
5
  import { c as u } from "./responsive-style.config-DFuATrIM.js";
6
6
  import { Typography as c } from "./typography.js";
7
+ import { Box as w } from "./box.js";
7
8
  function H({
8
9
  itemsCount: r,
9
10
  maxHeight: e,
10
11
  scrollable: l,
11
- scrollThreshold: a
12
+ scrollThreshold: i
12
13
  }) {
13
14
  return {
14
15
  maxHeightValue: j(e ?? 420),
15
- shouldUseScroll: l ?? r > a
16
+ shouldUseScroll: l ?? r > i
16
17
  };
17
18
  }
18
19
  function M({
19
20
  columns: r,
20
21
  gap: e,
21
22
  lg: l,
22
- md: a,
23
+ md: i,
23
24
  xl: t
24
25
  }) {
25
26
  return {
26
27
  cols: r ?? 4,
27
28
  gap: e ?? 8,
28
- md: s(a),
29
- lg: s(l),
30
- xl: s(t)
29
+ md: d(i),
30
+ lg: d(l),
31
+ xl: d(t)
31
32
  };
32
33
  }
33
- function s(r) {
34
+ function d(r) {
34
35
  if (r)
35
36
  return {
36
37
  cols: r.columns,
@@ -40,46 +41,57 @@ function s(r) {
40
41
  function j(r) {
41
42
  return typeof r == "number" ? `${r}px` : r;
42
43
  }
43
- function $({
44
+ function A({
44
45
  className: r,
45
46
  columns: e,
46
47
  errorMessage: l,
47
- emptyMessage: a = "В галерее пока нет изображений.",
48
+ emptyMessage: i = "В галерее пока нет изображений.",
48
49
  gap: t,
49
50
  gridClassName: g,
50
- items: i,
51
- isLoading: d = !1,
52
- lg: f,
53
- maxHeight: x,
54
- md: h,
51
+ items: a,
52
+ isLoading: s = !1,
53
+ lg: h,
54
+ maxHeight: f,
55
+ md: x,
55
56
  onSubmit: y,
56
57
  scrollable: v,
57
58
  scrollThreshold: b = 6,
58
59
  xl: G,
59
- ...N
60
+ ...k
60
61
  }) {
61
- const { maxHeightValue: P, shouldUseScroll: p } = H({
62
- itemsCount: i.length,
63
- maxHeight: x,
62
+ const { maxHeightValue: N, shouldUseScroll: p } = H({
63
+ itemsCount: a.length,
64
+ maxHeight: f,
64
65
  scrollable: v,
65
66
  scrollThreshold: b
66
- }), S = M({ columns: e, gap: t, lg: f, md: h, xl: G });
67
- return /* @__PURE__ */ m("div", { className: u("grid gap-[12px]", r), ...N, children: [
68
- d ? /* @__PURE__ */ m("div", { className: "flex items-center gap-[8px] text-[var(--color-text-secondary)]", children: [
69
- /* @__PURE__ */ o(C, { className: "size-[16px] animate-spin" }),
67
+ }), P = M({ columns: e, gap: t, lg: h, md: x, xl: G });
68
+ return /* @__PURE__ */ m("div", { className: u("grid gap-[12px]", r), ...k, children: [
69
+ s ? /* @__PURE__ */ m("div", { className: "flex items-center gap-[8px] text-[var(--color-text-secondary)]", children: [
70
+ /* @__PURE__ */ o(
71
+ w,
72
+ {
73
+ as: "span",
74
+ display: "inline-block",
75
+ width: 16,
76
+ height: 16,
77
+ animation: "spin",
78
+ "aria-hidden": "true",
79
+ children: /* @__PURE__ */ o(C, { width: 16, height: 16 })
80
+ }
81
+ ),
70
82
  /* @__PURE__ */ o(c, { as: "span", variant: "b3", children: "Загружаем галерею..." })
71
83
  ] }) : null,
72
84
  l ? /* @__PURE__ */ o(c, { as: "p", color: "--color-secondary-accent-2", variant: "b3", children: l }) : null,
73
- i.length > 0 ? /* @__PURE__ */ o(
74
- k,
85
+ a.length > 0 ? /* @__PURE__ */ o(
86
+ S,
75
87
  {
76
- ...S,
88
+ ...P,
77
89
  className: u(
78
90
  p && "overflow-y-auto rounded-[12px] bg-[var(--color-background-subtle)] p-[8px]",
79
91
  g
80
92
  ),
81
- style: p ? { maxHeight: P } : void 0,
82
- children: i.map((n) => /* @__PURE__ */ o(
93
+ style: p ? { maxHeight: N } : void 0,
94
+ children: a.map((n) => /* @__PURE__ */ o(
83
95
  U,
84
96
  {
85
97
  fileName: n.fileName,
@@ -92,9 +104,9 @@ function $({
92
104
  ))
93
105
  }
94
106
  ) : null,
95
- !d && i.length === 0 ? /* @__PURE__ */ o(c, { as: "p", color: "--color-text-secondary", variant: "b3", children: a }) : null
107
+ !s && a.length === 0 ? /* @__PURE__ */ o(c, { as: "p", color: "--color-text-secondary", variant: "b3", children: i }) : null
96
108
  ] });
97
109
  }
98
110
  export {
99
- $ as MediaGallery
111
+ A as MediaGallery
100
112
  };
@@ -0,0 +1 @@
1
+ export { normalizeProgressBarRange, renderProgressBarView } from './progress-bar.helpers';
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ import { ProgressBarRange, ProgressBarViewProps } from '../types/index';
3
+ /** Нормализует диапазон и конечное значение; процент всегда лежит в 0..100. */
4
+ export declare function normalizeProgressBarRange(value: number, min?: number, max?: number): ProgressBarRange;
5
+ /** Единая отрисовка дорожки, подписей и информационных отметок для готовых вариантов. */
6
+ export declare function renderProgressBarView({ range, variant, valuePlacement, marks, valueLabel, trackProps, fillProps, markerProps, renderMark, }: ProgressBarViewProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ProgressBar } from './progress-bar';
2
+ export type { ProgressBarBreakpointProps, ProgressBarMark, ProgressBarMarkContext, ProgressBarOwnStyleProps, ProgressBarPartProps, ProgressBarProps, ProgressBarValuePlacement, ProgressBarVariant, } from './types/index';
@@ -0,0 +1,5 @@
1
+ import { JSX } from 'react';
2
+ import { ProgressBarProps } from './types/index';
3
+ /** Линейный прогресс с четырьмя вариантами; адаптивные представления переключаются CSS без определения ширины в JS. */
4
+ export declare function ProgressBar({ value, min, max, variant, valuePlacement, label, ariaLabel, marks, valueLabel, trackProps, fillProps, markerProps, renderMark, md, lg, xl, ...props }: ProgressBarProps): JSX.Element;
5
+ export type { ProgressBarBreakpointProps, ProgressBarMark, ProgressBarMarkContext, ProgressBarOwnStyleProps, ProgressBarPartProps, ProgressBarProps, ProgressBarValuePlacement, ProgressBarVariant, } from './types/index';
@@ -0,0 +1 @@
1
+ export type { ProgressBarBreakpointProps, ProgressBarMark, ProgressBarMarkContext, ProgressBarOwnStyleProps, ProgressBarPartProps, ProgressBarProps, ProgressBarRange, ProgressBarValuePlacement, ProgressBarVariant, ProgressBarViewProps, } from './progress-bar.types';
@@ -0,0 +1,80 @@
1
+ import { ReactNode } from 'react';
2
+ import { BoxProps } from '../../box/index';
3
+ import { FlexBreakpointProps, FlexProps } from '../../flex/index';
4
+ /** Готовое оформление: полоса, шаги, текущее значение на полосе или крупные контрольные точки. */
5
+ export type ProgressBarVariant = 'line' | 'steps' | 'marker' | 'checkpoints';
6
+ /** Место подписи значения; none явно скрывает её, в том числе на следующем breakpoint. */
7
+ export type ProgressBarValuePlacement = 'start' | 'end' | 'marker' | 'none';
8
+ /** Информационная отметка в диапазоне min–max; не является интерактивной кнопкой. */
9
+ export type ProgressBarMark = {
10
+ /** Числовое положение отметки; ограничивается диапазоном. */
11
+ value: number;
12
+ /** Произвольная подпись над отметкой. */
13
+ label?: ReactNode;
14
+ /** Содержимое точки; по умолчанию число для checkpoints и пустой круг для steps. */
15
+ content?: ReactNode;
16
+ };
17
+ /** Контекст renderMark: состояния рассчитываются по положению относительно текущего значения. */
18
+ export type ProgressBarMarkContext = {
19
+ /** Исходная отметка. */
20
+ mark: ProgressBarMark;
21
+ /** Индекс в переданном массиве. */
22
+ index: number;
23
+ /** completed — позади текущего значения, current — совпадает, pending — впереди. */
24
+ state: 'completed' | 'current' | 'pending';
25
+ };
26
+ /** Стандартные props Box для части компонента; style имеет итоговый приоритет. */
27
+ export type ProgressBarPartProps = Omit<BoxProps, 'as' | 'children'>;
28
+ /** Визуальные настройки, доступные в base и responsive overrides. */
29
+ export type ProgressBarOwnStyleProps = {
30
+ /** Вариант оформления, по умолчанию line. */
31
+ variant?: ProgressBarVariant;
32
+ /** Положение значения; line по умолчанию start, marker — marker, steps/checkpoints — none. */
33
+ valuePlacement?: ProgressBarValuePlacement;
34
+ };
35
+ /** Переопределения от одного breakpoint: стандартные Flex props и настройки варианта. */
36
+ export type ProgressBarBreakpointProps = FlexBreakpointProps & ProgressBarOwnStyleProps;
37
+ /** Прогресс на базе Flex; md/lg/xl наследуются, явный style приоритетнее style props. */
38
+ export type ProgressBarProps = Omit<FlexProps, 'children' | 'md' | 'lg' | 'xl'> & ProgressBarOwnStyleProps & {
39
+ /** Текущее значение, ограничивается диапазоном; нечисловое конечное значение трактуется как min. */
40
+ value: number;
41
+ /** Начало диапазона, по умолчанию 0; нечисловое значение заменяется на 0. */
42
+ min?: number;
43
+ /** Конец диапазона, по умолчанию 100. Некорректный диапазон заменяется на min..min+100, а если он непредставим — на 0..100. */
44
+ max?: number;
45
+ /** Общая подпись над компонентом, принимает ReactNode. */
46
+ label?: ReactNode;
47
+ /** Доступное имя, по умолчанию «Прогресс». */
48
+ ariaLabel?: string;
49
+ /** Отметки; для steps/checkpoints по умолчанию min, середина и max. */
50
+ marks?: ReadonlyArray<ProgressBarMark>;
51
+ /** Собственная подпись вместо процента; null явно скрывает текст. */
52
+ valueLabel?: ReactNode;
53
+ /** Props дорожки, включая responsive размеры, className, style. */
54
+ trackProps?: ProgressBarPartProps;
55
+ /** Props заполнения; фон по умолчанию currentColor, ширина следует value. */
56
+ fillProps?: ProgressBarPartProps;
57
+ /** Props текущего маркера и точек, включая responsive размеры и style. */
58
+ markerProps?: ProgressBarPartProps;
59
+ /** Содержимое отдельной точки; не заменяет её позиционирующую обёртку. */
60
+ renderMark?: (context: ProgressBarMarkContext) => ReactNode;
61
+ /** Overrides от 768 px. */
62
+ md?: ProgressBarBreakpointProps;
63
+ /** Overrides от 1024 px; пропущенные значения наследуются от md. */
64
+ lg?: ProgressBarBreakpointProps;
65
+ /** Overrides от 1440 px; пропущенные значения наследуются от lg. */
66
+ xl?: ProgressBarBreakpointProps;
67
+ };
68
+ /** Внутренние нормализованные числовые параметры. */
69
+ export type ProgressBarRange = {
70
+ min: number;
71
+ max: number;
72
+ value: number;
73
+ percent: number;
74
+ };
75
+ /** Внутренний контекст отрисовки одного из адаптивных представлений. */
76
+ export type ProgressBarViewProps = Pick<ProgressBarProps, 'marks' | 'valueLabel' | 'trackProps' | 'fillProps' | 'markerProps' | 'renderMark'> & {
77
+ range: ProgressBarRange;
78
+ variant: ProgressBarVariant;
79
+ valuePlacement: ProgressBarValuePlacement;
80
+ };