@dss-kit/ui-kit 1.0.3 → 1.1.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 (59) hide show
  1. package/README.md +19 -0
  2. package/dist/components/builders/Sheet/SheetLayer.js +95 -83
  3. package/dist/components/builders/Sheet/hooks/index.d.ts +1 -0
  4. package/dist/components/builders/Sheet/hooks/useMotionValueStyle.d.ts +8 -0
  5. package/dist/components/builders/Sheet/hooks/useMotionValueStyle.js +14 -0
  6. package/dist/components/builders/Table/TablePagination/TablePagination.d.ts +10 -4
  7. package/dist/components/builders/Table/TablePagination/TablePagination.js +230 -177
  8. package/dist/components/builders/Text/Text.d.ts +4 -1
  9. package/dist/components/builders/Text/Text.js +78 -76
  10. package/dist/components/controls/Button/Button.d.ts +1 -1
  11. package/dist/components/controls/Button/Button.js +47 -46
  12. package/dist/components/controls/OtpInput/OtpInput.js +121 -143
  13. package/dist/components/controls/OtpInput/styles.d.ts +1 -0
  14. package/dist/components/controls/OtpInput/styles.js +9 -3
  15. package/dist/components/controls/Select/Select.js +72 -70
  16. package/dist/components/controls/Switch/Switch.d.ts +10 -6
  17. package/dist/components/controls/Switch/Switch.js +109 -86
  18. package/dist/components/controls/Switch/styles.d.ts +3 -2
  19. package/dist/components/controls/Switch/styles.js +76 -73
  20. package/dist/components/shared/Toast/ToastContainer.d.ts +1 -1
  21. package/dist/components/shared/Toast/ToastContainer.js +25 -23
  22. package/dist/fonts/inter-cyrillic-ext-400.woff2 +0 -0
  23. package/dist/fonts/inter-cyrillic-ext-500.woff2 +0 -0
  24. package/dist/fonts/inter-cyrillic-ext-600.woff2 +0 -0
  25. package/dist/fonts/inter-cyrillic-ext-700.woff2 +0 -0
  26. package/dist/fonts/inter-cyrillic-ext-800.woff2 +0 -0
  27. package/dist/fonts/inter-latin-cyrillic-400.woff2 +0 -0
  28. package/dist/fonts/inter-latin-cyrillic-500.woff2 +0 -0
  29. package/dist/fonts/inter-latin-cyrillic-600.woff2 +0 -0
  30. package/dist/fonts/inter-latin-cyrillic-700.woff2 +0 -0
  31. package/dist/fonts/inter-latin-cyrillic-800.woff2 +0 -0
  32. package/dist/fonts/inter-latin-ext-400.woff2 +0 -0
  33. package/dist/fonts/inter-latin-ext-500.woff2 +0 -0
  34. package/dist/fonts/inter-latin-ext-600.woff2 +0 -0
  35. package/dist/fonts/inter-latin-ext-700.woff2 +0 -0
  36. package/dist/fonts/inter-latin-ext-800.woff2 +0 -0
  37. package/dist/index.js +34 -32
  38. package/dist/providers/MotionProvider/MotionProvider.d.ts +9 -0
  39. package/dist/providers/MotionProvider/MotionProvider.js +21 -0
  40. package/dist/providers/MotionProvider/MotionProvider.types.d.ts +12 -0
  41. package/dist/providers/MotionProvider/features.d.ts +1 -0
  42. package/dist/providers/MotionProvider/features.js +4 -0
  43. package/dist/providers/MotionProvider/index.d.ts +2 -0
  44. package/dist/providers/MotionProvider/loadMotionFeatures.d.ts +13 -0
  45. package/dist/providers/MotionProvider/loadMotionFeatures.js +9 -0
  46. package/dist/providers/index.d.ts +1 -0
  47. package/dist/styles/utils/breakpoints.d.ts +12 -0
  48. package/dist/styles/utils/breakpoints.js +20 -13
  49. package/dist/styles/utils/breakpoints.ts +32 -0
  50. package/dist/ui-kit.cjs +8 -8
  51. package/dist/ui-kit.css +1 -1
  52. package/package.json +3 -1
  53. package/dist/fonts/inter-normal-200.woff2 +0 -0
  54. package/dist/fonts/inter-normal-300.woff2 +0 -0
  55. package/dist/fonts/inter-normal-400.woff2 +0 -0
  56. package/dist/fonts/inter-normal-500.woff2 +0 -0
  57. package/dist/fonts/inter-normal-600.woff2 +0 -0
  58. package/dist/fonts/inter-normal-700.woff2 +0 -0
  59. package/dist/fonts/inter-normal-800.woff2 +0 -0
@@ -1,128 +1,131 @@
1
- import { css as i } from "@emotion/css";
2
- import { theme as c } from "../../../utils/theme/index.js";
3
- const { color: t, cornerRadius: r, height: h, spacing: s, transition: e } = c, l = {
4
- container: i({
1
+ import { css as t } from "@emotion/css";
2
+ import { theme as s } from "../../../utils/theme/index.js";
3
+ const { color: i, cornerRadius: h, height: e, spacing: r, transition: c } = s, l = {
4
+ container: t({
5
5
  width: "100%",
6
6
  cursor: "pointer",
7
- outline: "none",
8
7
  userSelect: "none",
9
8
  display: "flex",
10
9
  justifyContent: "space-between",
11
- gap: s.md,
12
- "&.disabled": {
13
- cursor: "not-allowed",
14
- opacity: 0.5
15
- },
16
- "&.reverse": {
17
- flexDirection: "row-reverse"
18
- }
10
+ gap: r.md
19
11
  }),
20
- disabled: i({
12
+ disabled: t({
21
13
  cursor: "not-allowed",
22
14
  opacity: 0.5
23
15
  }),
24
- reverse: i({
16
+ reverse: t({
25
17
  flexDirection: "row-reverse"
26
18
  }),
27
- switchContainer: i({
19
+ switchContainer: t({
20
+ position: "relative",
21
+ display: "flex",
22
+ flexShrink: 0,
23
+ alignSelf: "flex-start",
28
24
  "--width-switch-sm": "34px",
29
25
  "--width-switch-md": "40px",
30
26
  "--width-switch-lg": "52px",
31
27
  "--size-thumb-sm": "18px",
32
28
  "--size-thumb-md": "20px",
33
29
  "--size-thumb-lg": "28px",
34
- "--thumb-translate": "0px",
35
- "&:has(input:checked)": {
36
- "--thumb-translate": "calc(var(--switch-width) - var(--thumb-width) - 4px)"
37
- }
30
+ // Выключенное состояние у всех вариантов одинаковое
31
+ "--switch-bg-unchecked": i.fill.bg_tertiary,
32
+ "--thumb-bg-unchecked": i.fill.bg_primary
38
33
  }),
39
- // Variant classes — each handles both checked and unchecked states
40
- variant_accent: i({
41
- "&:has(input:not(:checked))": {
42
- "--switch-bg-color": t.fill.bg_tertiary,
43
- "--thumb-bg-color": t.fill.bg_primary
44
- },
45
- "&:has(input:checked)": {
46
- "--switch-bg-color": t.fill.accent_primary,
47
- "--thumb-bg-color": t.fill.bg_primary
48
- }
34
+ // Нативный input прозрачен и лежит поверх трека: остаётся в tab-порядке и
35
+ // в дереве доступности, а relative-контейнер не даёт фокусу прокручивать
36
+ // страницу к случайной точке.
37
+ input: t({
38
+ position: "absolute",
39
+ inset: 0,
40
+ width: "100%",
41
+ height: "100%",
42
+ margin: 0,
43
+ opacity: 0,
44
+ cursor: "inherit"
49
45
  }),
50
- variant_secondary: i({
51
- "&:has(input:not(:checked))": {
52
- "--switch-bg-color": t.fill.bg_tertiary,
53
- "--thumb-bg-color": t.fill.bg_primary
54
- },
55
- "&:has(input:checked)": {
56
- "--switch-bg-color": t.fill.accent_secondary,
57
- "--thumb-bg-color": t.fill.accent_primary
58
- }
46
+ // Variant classes — задают цвета включённого состояния
47
+ variant_accent: t({
48
+ "--switch-bg-checked": i.fill.accent_primary,
49
+ "--thumb-bg-checked": i.fill.bg_primary
59
50
  }),
60
- variant_positive: i({
61
- "&:has(input:not(:checked))": {
62
- "--switch-bg-color": t.fill.bg_tertiary,
63
- "--thumb-bg-color": t.fill.bg_primary
64
- },
65
- "&:has(input:checked)": {
66
- "--switch-bg-color": t.fill.positive_primary,
67
- "--thumb-bg-color": t.fill.bg_primary
68
- }
51
+ variant_secondary: t({
52
+ "--switch-bg-checked": i.fill.accent_secondary,
53
+ "--thumb-bg-checked": i.fill.accent_primary
69
54
  }),
70
- variant_theme: i({
71
- "&:has(input:not(:checked))": {
72
- "--switch-bg-color": t.fill.bg_tertiary,
73
- "--thumb-bg-color": t.fill.bg_primary
74
- },
75
- "&:has(input:checked)": {
76
- "--switch-bg-color": t.fill.bg_secondary,
77
- "--thumb-bg-color": t.fill.bg_tertiary
78
- }
55
+ variant_positive: t({
56
+ "--switch-bg-checked": i.fill.positive_primary,
57
+ "--thumb-bg-checked": i.fill.bg_primary
58
+ }),
59
+ variant_theme: t({
60
+ "--switch-bg-checked": i.fill.bg_secondary,
61
+ "--thumb-bg-checked": i.fill.bg_tertiary
79
62
  }),
80
63
  // Size classes
81
- size_sm: i({
64
+ size_sm: t({
82
65
  "--switch-width": "var(--width-switch-sm)",
83
- "--switch-height": h.switch.sm,
66
+ "--switch-height": e.switch.sm,
84
67
  "--thumb-width": "var(--size-thumb-sm)",
85
68
  "--thumb-height": "var(--size-thumb-sm)"
86
69
  }),
87
- size_md: i({
70
+ size_md: t({
88
71
  "--switch-width": "var(--width-switch-md)",
89
- "--switch-height": h.switch.md,
72
+ "--switch-height": e.switch.md,
90
73
  "--thumb-width": "var(--size-thumb-md)",
91
74
  "--thumb-height": "var(--size-thumb-md)"
92
75
  }),
93
- size_lg: i({
76
+ size_lg: t({
94
77
  "--switch-width": "var(--width-switch-lg)",
95
- "--switch-height": h.switch.lg,
78
+ "--switch-height": e.switch.lg,
96
79
  "--thumb-width": "var(--size-thumb-lg)",
97
80
  "--thumb-height": "var(--size-thumb-lg)"
98
81
  }),
99
- switch: i({
82
+ switch: t({
83
+ "--switch-bg-color": "var(--switch-bg-unchecked)",
84
+ "--thumb-bg-color": "var(--thumb-bg-unchecked)",
85
+ "--thumb-translate": "0px",
100
86
  width: "var(--switch-width)",
101
87
  height: "var(--switch-height)",
102
- transition: e.general,
88
+ transition: c.general,
89
+ transitionProperty: "background-color",
103
90
  display: "flex",
104
91
  alignItems: "center",
105
92
  padding: 2,
106
93
  backgroundColor: "var(--switch-bg-color)",
107
- borderRadius: r.xl
94
+ borderRadius: h.xl,
95
+ // Прозрачный outline не виден, но в режиме высокой контрастности
96
+ // (forced-colors) браузер красит его системным цветом — без него фон
97
+ // трека и ручки заменяется на Canvas и переключатель пропадает.
98
+ outline: "1px solid transparent",
99
+ "input:checked + &": {
100
+ "--switch-bg-color": "var(--switch-bg-checked)",
101
+ "--thumb-bg-color": "var(--thumb-bg-checked)",
102
+ "--thumb-translate": "calc(var(--switch-width) - var(--thumb-width) - 4px)"
103
+ },
104
+ "input:focus-visible + &": {
105
+ outline: `2px solid ${i.border.accent_primary}`,
106
+ outlineOffset: 2
107
+ }
108
108
  }),
109
- thumb: i({
109
+ thumb: t({
110
110
  display: "flex",
111
111
  alignItems: "center",
112
112
  justifyContent: "center",
113
113
  padding: 4,
114
- transition: e.general,
114
+ transition: c.general,
115
+ transitionProperty: "transform, background-color",
115
116
  transform: "translateX(var(--thumb-translate, 0))",
116
117
  width: "var(--thumb-width)",
117
118
  height: "var(--thumb-height)",
118
119
  backgroundColor: "var(--thumb-bg-color)",
119
- borderRadius: r.fullRound
120
+ borderRadius: h.fullRound,
121
+ outline: "1px solid transparent"
120
122
  }),
121
- moon: i({
122
- width: "100%",
123
- height: "100%"
123
+ labelsContainer: t({
124
+ display: "flex",
125
+ flexDirection: "column",
126
+ gap: r.xs
124
127
  }),
125
- fire: i({
128
+ icon: t({
126
129
  width: "100%",
127
130
  height: "100%"
128
131
  })
@@ -3,7 +3,7 @@ interface ToastContainerProps {
3
3
  position?: ToastPosition;
4
4
  /** Кастомный CSS-класс для корневого `<div>` контейнера тостов. */
5
5
  className?: string;
6
- /** Класс для каждого `motion.div` обёртки тоста. */
6
+ /** Класс для каждого `m.div` обёртки тоста. */
7
7
  itemClassName?: string;
8
8
  /** Класс, прокидываемый в каждый `Toast` (на корневой `Box`). */
9
9
  toastClassName?: string;
@@ -1,11 +1,13 @@
1
1
  import { jsx as n } from "react/jsx-runtime";
2
2
  import { cx as m, css as c } from "@emotion/css";
3
- import { AnimatePresence as p, motion as f } from "framer-motion";
3
+ import { AnimatePresence as f, m as p } from "framer-motion";
4
4
  import { useSyncExternalStore as d } from "react";
5
- import { Toast as h } from "./Toast.js";
5
+ import { getLoadedMotionFeatures as h } from "../../../providers/MotionProvider/loadMotionFeatures.js";
6
+ import { Toast as g } from "./Toast.js";
6
7
  import { toastStore as o } from "./Toast.store.js";
7
- import { Portal as g } from "../../builders/Portal/Portal.js";
8
- const x = {
8
+ import { Portal as x } from "../../builders/Portal/Portal.js";
9
+ import { MotionProvider as u } from "../../../providers/MotionProvider/MotionProvider.js";
10
+ const y = {
9
11
  "top-left": { top: 16, left: 16, alignItems: "flex-start" },
10
12
  "top-center": {
11
13
  top: 16,
@@ -22,14 +24,14 @@ const x = {
22
24
  alignItems: "center"
23
25
  },
24
26
  "bottom-right": { bottom: 16, right: 16, alignItems: "flex-end" }
25
- }, u = (t) => {
26
- const s = t.startsWith("top"), r = t.endsWith("left"), a = t.endsWith("right"), l = t.endsWith("center"), i = r ? -40 : a ? 40 : 0;
27
+ }, b = (t) => {
28
+ const r = t.startsWith("top"), s = t.endsWith("left"), a = t.endsWith("right"), l = t.endsWith("center"), i = s ? -40 : a ? 40 : 0;
27
29
  return {
28
- initial: { opacity: 0, x: i, y: s ? -16 : 16, scale: 0.95 },
30
+ initial: { opacity: 0, x: i, y: r ? -16 : 16, scale: 0.95 },
29
31
  animate: { opacity: 1, x: 0, y: 0, scale: 1 },
30
32
  exit: { opacity: 0, x: i, scale: 0.95, transition: { duration: 0.15 } }
31
33
  };
32
- }, y = c({
34
+ }, I = c({
33
35
  position: "fixed",
34
36
  zIndex: 2,
35
37
  display: "flex",
@@ -38,37 +40,37 @@ const x = {
38
40
  pointerEvents: "none",
39
41
  maxWidth: 325,
40
42
  width: "100%"
41
- }), b = c({
43
+ }), v = c({
42
44
  pointerEvents: "auto",
43
45
  width: "100%"
44
46
  });
45
- function N({
47
+ function M({
46
48
  position: t = "top-right",
47
- className: s,
48
- itemClassName: r,
49
+ className: r,
50
+ itemClassName: s,
49
51
  toastClassName: a
50
52
  }) {
51
53
  const l = d(
52
54
  o.subscribe,
53
55
  o.getSnapshot,
54
56
  o.getSnapshot
55
- ), i = u(t);
56
- return /* @__PURE__ */ n(g, { children: /* @__PURE__ */ n(
57
+ ), i = b(t);
58
+ return /* @__PURE__ */ n(x, { children: /* @__PURE__ */ n(
57
59
  "div",
58
60
  {
59
- className: m(y, s),
60
- style: x[t],
61
- children: /* @__PURE__ */ n(p, { initial: !1, children: l.map((e) => /* @__PURE__ */ n(
62
- f.div,
61
+ className: m(I, r),
62
+ style: y[t],
63
+ children: /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n(f, { initial: !1, children: l.map((e) => /* @__PURE__ */ n(
64
+ p.div,
63
65
  {
64
- className: m(b, r),
66
+ className: m(v, s),
65
67
  layout: !0,
66
- initial: i.initial,
68
+ initial: h() ? i.initial : !1,
67
69
  animate: i.animate,
68
70
  exit: i.exit,
69
71
  transition: { type: "spring", stiffness: 400, damping: 30 },
70
72
  children: /* @__PURE__ */ n(
71
- h,
73
+ g,
72
74
  {
73
75
  title: e.title,
74
76
  subtitle: e.subtitle,
@@ -80,10 +82,10 @@ function N({
80
82
  )
81
83
  },
82
84
  e.id
83
- )) })
85
+ )) }) })
84
86
  }
85
87
  ) });
86
88
  }
87
89
  export {
88
- N as ToastContainer
90
+ M as ToastContainer
89
91
  };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { UiKitLocaleProvider as t } from "./locale/UiKitLocaleProvider/UiKitLocaleProvider.js";
3
3
  import { Box as m } from "./components/builders/Box/Box.js";
4
4
  import { Loader as f } from "./components/builders/Loader/Loader.js";
5
- import { Modal as n } from "./components/builders/Modal/index.js";
5
+ import { Modal as i } from "./components/builders/Modal/index.js";
6
6
  import { Portal as T } from "./components/builders/Portal/Portal.js";
7
7
  import { Ripple as l } from "./components/builders/Ripple/Ripple.js";
8
8
  import { Sheet as C } from "./components/builders/Sheet/index.js";
@@ -12,8 +12,8 @@ import { AnimatedText as k, Text as A } from "./components/builders/Text/Text.js
12
12
  import { LineChart as S } from "./components/charts/LineChart/LineChart.js";
13
13
  import { PieProgressChart as P } from "./components/charts/PieProgressChart/PieProgressChart.js";
14
14
  import { Button as _ } from "./components/controls/Button/Button.js";
15
- import { Checkbox as I } from "./components/controls/Checkbox/Checkbox.js";
16
- import { IconButton as v } from "./components/controls/IconButton/IconButton.js";
15
+ import { Checkbox as v } from "./components/controls/Checkbox/Checkbox.js";
16
+ import { IconButton as L } from "./components/controls/IconButton/IconButton.js";
17
17
  import { Input as D } from "./components/controls/Input/Input.js";
18
18
  import { MarkdownToolbarAction as O } from "./components/controls/MarkdownTextEditor/hooks/useToolbarActions/useToolbarActions.const.js";
19
19
  import { MARKDOWN_TEXT_EDITOR_LOCALE_KEY as U } from "./components/controls/MarkdownTextEditor/MarkdownTextEditor.locale.js";
@@ -29,7 +29,7 @@ import { Breadcrumbs as eo } from "./components/navigation/Breadcrumbs/Breadcrum
29
29
  import { Avatar as po } from "./components/shared/Avatar/Avatar.js";
30
30
  import { Badge as xo } from "./components/shared/Badge/Badge.js";
31
31
  import { Counter as ao } from "./components/shared/Counter/Counter.js";
32
- import { Dot as io } from "./components/shared/Dot/Dot.js";
32
+ import { Dot as no } from "./components/shared/Dot/Dot.js";
33
33
  import { Hint as so } from "./components/shared/Hint/Hint.js";
34
34
  import { MarkdownText as Co } from "./components/shared/MarkdownText/MarkdownText.js";
35
35
  import { Popover as ho } from "./components/shared/Popover/Popover.js";
@@ -39,31 +39,32 @@ import { Toast as Eo } from "./components/shared/Toast/Toast.js";
39
39
  import { useToast as Mo } from "./components/shared/Toast/Toast.hooks.js";
40
40
  import { toast as Ro } from "./components/shared/Toast/Toast.utils.js";
41
41
  import { ToastContainer as bo } from "./components/shared/Toast/ToastContainer.js";
42
- import { Tooltip as Lo } from "./components/shared/Tooltip/Tooltip.js";
43
- import { ThemeProviderScoped as wo } from "./providers/ThemeProviderScoped/ThemeProviderScoped.js";
44
- import { THEME_DATA_ATTRIBUTE as Ko } from "./providers/ThemeProviderScoped/ThemeProviderScoped.const.js";
45
- import { ThemeContext as Ho, useUiKitTheme as Uo } from "./providers/ThemeProviderScoped/ThemeProviderScoped.context.js";
46
- import { useControlled as yo } from "./utils/hooks/useControlled.js";
47
- import { useBreakpoint as Fo } from "./utils/hooks/breakpoints/useBreakpoint/useBreakpoint.js";
48
- import { Breakpoints as No, BreakpointsBase as Xo } from "./utils/hooks/breakpoints/useBreakpoint/useBreakpoint.const.js";
49
- import { getFontWeightClass as jo } from "./utils/styles/getFontWeightClass/getFontWeightClass.js";
50
- import { getSizeClass as Jo } from "./utils/styles/getSizeClass/getSizeClass.js";
51
- import { getStyleClass as Vo } from "./utils/styles/getStyleClass/getStyleClass.js";
52
- import { theme as $o } from "./utils/theme/index.js";
42
+ import { Tooltip as Io } from "./components/shared/Tooltip/Tooltip.js";
43
+ import { MotionProvider as wo } from "./providers/MotionProvider/MotionProvider.js";
44
+ import { ThemeProviderScoped as Ko } from "./providers/ThemeProviderScoped/ThemeProviderScoped.js";
45
+ import { THEME_DATA_ATTRIBUTE as Ho } from "./providers/ThemeProviderScoped/ThemeProviderScoped.const.js";
46
+ import { ThemeContext as Wo, useUiKitTheme as yo } from "./providers/ThemeProviderScoped/ThemeProviderScoped.context.js";
47
+ import { useControlled as Fo } from "./utils/hooks/useControlled.js";
48
+ import { useBreakpoint as No } from "./utils/hooks/breakpoints/useBreakpoint/useBreakpoint.js";
49
+ import { Breakpoints as Yo, BreakpointsBase as jo } from "./utils/hooks/breakpoints/useBreakpoint/useBreakpoint.const.js";
50
+ import { getFontWeightClass as Jo } from "./utils/styles/getFontWeightClass/getFontWeightClass.js";
51
+ import { getSizeClass as Vo } from "./utils/styles/getSizeClass/getSizeClass.js";
52
+ import { getStyleClass as $o } from "./utils/styles/getStyleClass/getStyleClass.js";
53
+ import { theme as rr } from "./utils/theme/index.js";
53
54
  export {
54
55
  k as AnimatedText,
55
56
  po as Avatar,
56
57
  xo as Badge,
57
58
  m as Box,
58
59
  eo as Breadcrumbs,
59
- No as Breakpoints,
60
- Xo as BreakpointsBase,
60
+ Yo as Breakpoints,
61
+ jo as BreakpointsBase,
61
62
  _ as Button,
62
- I as Checkbox,
63
+ v as Checkbox,
63
64
  ao as Counter,
64
- io as Dot,
65
+ no as Dot,
65
66
  so as Hint,
66
- v as IconButton,
67
+ L as IconButton,
67
68
  D as Input,
68
69
  S as LineChart,
69
70
  f as Loader,
@@ -71,7 +72,8 @@ export {
71
72
  Co as MarkdownText,
72
73
  y as MarkdownTextEditor,
73
74
  O as MarkdownToolbarAction,
74
- n as Modal,
75
+ i as Modal,
76
+ wo as MotionProvider,
75
77
  F as OtpInput,
76
78
  P as PieProgressChart,
77
79
  ho as Popover,
@@ -84,25 +86,25 @@ export {
84
86
  C as Sheet,
85
87
  co as Skeleton,
86
88
  Z as Switch,
87
- Ko as THEME_DATA_ATTRIBUTE,
89
+ Ho as THEME_DATA_ATTRIBUTE,
88
90
  h as Table,
89
91
  oo as Tabs,
90
92
  ko as Tag,
91
93
  A as Text,
92
- Ho as ThemeContext,
93
- wo as ThemeProviderScoped,
94
+ Wo as ThemeContext,
95
+ Ko as ThemeProviderScoped,
94
96
  Eo as Toast,
95
97
  bo as ToastContainer,
96
- Lo as Tooltip,
98
+ Io as Tooltip,
97
99
  t as UiKitLocaleProvider,
98
100
  c as createColumnHelper,
99
- jo as getFontWeightClass,
100
- Jo as getSizeClass,
101
- Vo as getStyleClass,
102
- $o as theme,
101
+ Jo as getFontWeightClass,
102
+ Vo as getSizeClass,
103
+ $o as getStyleClass,
104
+ rr as theme,
103
105
  Ro as toast,
104
- Fo as useBreakpoint,
105
- yo as useControlled,
106
+ No as useBreakpoint,
107
+ Fo as useControlled,
106
108
  Mo as useToast,
107
- Uo as useUiKitTheme
109
+ yo as useUiKitTheme
108
110
  };
@@ -0,0 +1,9 @@
1
+ import { IMotionProviderProps } from './MotionProvider.types';
2
+ /**
3
+ * Подгружает фичи Motion (анимации, жесты, exit, drag, layout) отдельным
4
+ * чанком. Без провайдера `m.*` рендерится, но не анимируется.
5
+ *
6
+ * Компоненты UI Kit оборачивают себя сами, приложению провайдер нужен только
7
+ * для собственных `m.*` компонентов.
8
+ */
9
+ export declare function MotionProvider({ children, strict, }: IMotionProviderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as o, Fragment as i } from "react/jsx-runtime";
2
+ import { LazyMotion as n } from "framer-motion";
3
+ import { useContext as s, createContext as a } from "react";
4
+ import { loadMotionFeatures as f, getLoadedMotionFeatures as m } from "./loadMotionFeatures.js";
5
+ const r = a(!1);
6
+ function l({
7
+ children: e,
8
+ strict: t = !1
9
+ }) {
10
+ return s(r) && !t ? /* @__PURE__ */ o(i, { children: e }) : /* @__PURE__ */ o(r.Provider, { value: !0, children: /* @__PURE__ */ o(
11
+ n,
12
+ {
13
+ features: m() ?? f,
14
+ strict: t,
15
+ children: e
16
+ }
17
+ ) });
18
+ }
19
+ export {
20
+ l as MotionProvider
21
+ };
@@ -0,0 +1,12 @@
1
+ import { PropsWithChildren } from 'react';
2
+ export interface IMotionProviderProps extends PropsWithChildren {
3
+ /**
4
+ * Бросать ошибку, если внутри провайдера отрендерен `motion.*` вместо `m.*`
5
+ * (только в dev). `motion.*` тянет все фичи Motion во вход приложения.
6
+ *
7
+ * Строгость распространяется на всё поддерево, включая children,
8
+ * переданные потребителем, поэтому компоненты UI Kit её не включают.
9
+ * @default false
10
+ */
11
+ strict?: boolean;
12
+ }
@@ -0,0 +1 @@
1
+ export { domMax as default } from 'framer-motion';
@@ -0,0 +1,4 @@
1
+ import { domMax as d } from "framer-motion";
2
+ export {
3
+ d as default
4
+ };
@@ -0,0 +1,2 @@
1
+ export * from './MotionProvider';
2
+ export type * from './MotionProvider.types';
@@ -0,0 +1,13 @@
1
+ import { FeatureBundle } from 'framer-motion';
2
+ /** Фичи Motion, если чанк уже загружен, иначе `undefined`. */
3
+ export declare const getLoadedMotionFeatures: () => FeatureBundle | undefined;
4
+ /**
5
+ * Загружает фичи Motion одним запросом на всё приложение.
6
+ *
7
+ * LazyMotion не обрабатывает ошибку загрузки, поэтому при сбое отдаём пустой
8
+ * бандл: компоненты остаются статичными, а не сыплют необработанным rejection
9
+ * из каждого провайдера. Промис при этом сбрасывается, и следующий
10
+ * смонтированный провайдер попробует ещё раз, если браузер не закэшировал
11
+ * неудачный импорт.
12
+ */
13
+ export declare const loadMotionFeatures: () => Promise<FeatureBundle>;
@@ -0,0 +1,9 @@
1
+ let o, t;
2
+ const r = () => o, n = () => (t || (t = import("./features.js").then(
3
+ (e) => (o = e.default, e.default),
4
+ (e) => (t = void 0, console.error("[ui-kit] Не удалось загрузить фичи Motion:", e), {})
5
+ )), t);
6
+ export {
7
+ r as getLoadedMotionFeatures,
8
+ n as loadMotionFeatures
9
+ };
@@ -1 +1,2 @@
1
+ export * from './MotionProvider';
1
2
  export * from './ThemeProviderScoped';
@@ -11,3 +11,15 @@ export declare const bp: {
11
11
  readonly bp1440: (direction?: BreakpointDirection) => string;
12
12
  readonly bp1920: (direction?: BreakpointDirection) => string;
13
13
  };
14
+ /**
15
+ * Брейкпоинты `bp` для контейнерных запросов: ориентир — ширина ближайшего
16
+ * предка с `container-name: <name>`, а не окна. Смысл `direction` тот же:
17
+ * `max` — уже брейкпоинта, `min` — от него и шире.
18
+ */
19
+ export declare const bpContainer: {
20
+ readonly xs: (name: string, direction?: BreakpointDirection) => string;
21
+ readonly sm: (name: string, direction?: BreakpointDirection) => string;
22
+ readonly md: (name: string, direction?: BreakpointDirection) => string;
23
+ readonly lg: (name: string, direction?: BreakpointDirection) => string;
24
+ readonly xl: (name: string, direction?: BreakpointDirection) => string;
25
+ };
@@ -1,16 +1,23 @@
1
- import { BreakpointsBase as x, Breakpoints as p } from "../../utils/hooks/breakpoints/useBreakpoint/useBreakpoint.const.js";
2
- const a = (m, i = "max") => i === "min" ? `@media (min-width: ${m}px)` : `@media (max-width: ${m - 1}px)`, r = {
3
- xs: (m = "max") => a(p.xs, m),
4
- sm: (m = "max") => a(p.sm, m),
5
- md: (m = "max") => a(p.md, m),
6
- lg: (m = "max") => a(p.lg, m),
7
- xl: (m = "max") => a(p.xl, m),
8
- bp375: (m = "max") => a(x._375, m),
9
- bp1024: (m = "max") => a(x._1024, m),
10
- bp1280: (m = "max") => a(x._1280, m),
11
- bp1440: (m = "max") => a(x._1440, m),
12
- bp1920: (m = "max") => a(x._1920, m)
1
+ import { BreakpointsBase as t, Breakpoints as n } from "../../utils/hooks/breakpoints/useBreakpoint/useBreakpoint.const.js";
2
+ const a = (m, x = "max") => x === "min" ? `@media (min-width: ${m}px)` : `@media (max-width: ${m - 1}px)`, o = {
3
+ xs: (m = "max") => a(n.xs, m),
4
+ sm: (m = "max") => a(n.sm, m),
5
+ md: (m = "max") => a(n.md, m),
6
+ lg: (m = "max") => a(n.lg, m),
7
+ xl: (m = "max") => a(n.xl, m),
8
+ bp375: (m = "max") => a(t._375, m),
9
+ bp1024: (m = "max") => a(t._1024, m),
10
+ bp1280: (m = "max") => a(t._1280, m),
11
+ bp1440: (m = "max") => a(t._1440, m),
12
+ bp1920: (m = "max") => a(t._1920, m)
13
+ }, i = (m, x, r = "max") => r === "min" ? `@container ${m} (width >= ${x}px)` : `@container ${m} (width < ${x}px)`, p = {
14
+ xs: (m, x = "max") => i(m, n.xs, x),
15
+ sm: (m, x = "max") => i(m, n.sm, x),
16
+ md: (m, x = "max") => i(m, n.md, x),
17
+ lg: (m, x = "max") => i(m, n.lg, x),
18
+ xl: (m, x = "max") => i(m, n.xl, x)
13
19
  };
14
20
  export {
15
- r as bp
21
+ o as bp,
22
+ p as bpContainer
16
23
  };