@dss-kit/ui-kit 1.0.2 → 1.0.4

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 (75) hide show
  1. package/dist/components/builders/Dialog/Dialog.const.d.ts +9 -0
  2. package/dist/components/builders/Dialog/Dialog.const.js +4 -0
  3. package/dist/components/builders/Dialog/Dialog.context.d.ts +12 -0
  4. package/dist/components/builders/{Modal/context.js → Dialog/Dialog.context.js} +5 -5
  5. package/dist/components/builders/Dialog/Dialog.parts.d.ts +11 -0
  6. package/dist/components/builders/Dialog/Dialog.parts.js +11 -0
  7. package/dist/components/builders/Dialog/Dialog.types.d.ts +44 -0
  8. package/dist/components/builders/Dialog/DialogCloseButton/DialogCloseButton.d.ts +10 -0
  9. package/dist/components/builders/Dialog/DialogCloseButton/DialogCloseButton.js +34 -0
  10. package/dist/components/builders/Dialog/DialogCloseButton/index.d.ts +2 -0
  11. package/dist/components/builders/{Modal/ModalFooter/ModalFooter.d.ts → Dialog/DialogFooter/DialogFooter.d.ts} +13 -22
  12. package/dist/components/builders/Dialog/DialogFooter/DialogFooter.js +48 -0
  13. package/dist/components/builders/Dialog/DialogFooter/index.d.ts +2 -0
  14. package/dist/components/builders/{Modal/ModalHeader/ModalHeader.d.ts → Dialog/DialogHeader/DialogHeader.d.ts} +10 -6
  15. package/dist/components/builders/Dialog/DialogHeader/DialogHeader.js +97 -0
  16. package/dist/components/builders/Dialog/DialogHeader/index.d.ts +2 -0
  17. package/dist/components/builders/{Modal/ModalMain/ModalMain.d.ts → Dialog/DialogMain/DialogMain.d.ts} +18 -17
  18. package/dist/components/builders/{Modal/ModalMain/ModalMain.js → Dialog/DialogMain/DialogMain.js} +39 -29
  19. package/dist/components/builders/Dialog/DialogMain/index.d.ts +2 -0
  20. package/dist/components/builders/Dialog/DialogMain/styles.d.ts +6 -0
  21. package/dist/components/builders/{Modal/ModalMain → Dialog/DialogMain}/styles.js +16 -0
  22. package/dist/components/builders/Dialog/hooks/index.d.ts +3 -0
  23. package/dist/components/builders/Dialog/hooks/useBackdropClose.d.ts +10 -0
  24. package/dist/components/builders/Dialog/hooks/useBackdropClose.js +15 -0
  25. package/dist/components/builders/Dialog/hooks/useBodyScrollLock.d.ts +6 -0
  26. package/dist/components/builders/Dialog/hooks/useBodyScrollLock.js +13 -0
  27. package/dist/components/builders/Dialog/hooks/useCloseOnEsc.d.ts +6 -0
  28. package/dist/components/builders/Dialog/hooks/useCloseOnEsc.js +21 -0
  29. package/dist/components/builders/Dialog/index.d.ts +10 -0
  30. package/dist/components/builders/Modal/Modal.d.ts +8 -28
  31. package/dist/components/builders/Modal/Modal.js +50 -78
  32. package/dist/components/builders/Modal/index.d.ts +6 -11
  33. package/dist/components/builders/Modal/index.js +7 -9
  34. package/dist/components/builders/Modal/styles.js +6 -7
  35. package/dist/components/builders/Sheet/Sheet.const.d.ts +50 -0
  36. package/dist/components/builders/Sheet/Sheet.const.js +38 -0
  37. package/dist/components/builders/Sheet/Sheet.d.ts +12 -0
  38. package/dist/components/builders/Sheet/Sheet.js +55 -0
  39. package/dist/components/builders/Sheet/Sheet.types.d.ts +82 -0
  40. package/dist/components/builders/Sheet/Sheet.utils.d.ts +34 -0
  41. package/dist/components/builders/Sheet/Sheet.utils.js +50 -0
  42. package/dist/components/builders/Sheet/SheetLayer.d.ts +22 -0
  43. package/dist/components/builders/Sheet/SheetLayer.js +115 -0
  44. package/dist/components/builders/Sheet/hooks/index.d.ts +2 -0
  45. package/dist/components/builders/Sheet/hooks/useSheetGesture.d.ts +24 -0
  46. package/dist/components/builders/Sheet/hooks/useSheetGesture.js +67 -0
  47. package/dist/components/builders/Sheet/hooks/useSheetMotion.d.ts +31 -0
  48. package/dist/components/builders/Sheet/hooks/useSheetMotion.js +74 -0
  49. package/dist/components/builders/Sheet/hooks/useSheetPointer.d.ts +31 -0
  50. package/dist/components/builders/Sheet/hooks/useSheetPointer.js +81 -0
  51. package/dist/components/builders/Sheet/index.d.ts +15 -0
  52. package/dist/components/builders/Sheet/index.js +9 -0
  53. package/dist/components/builders/Sheet/styles.d.ts +17 -0
  54. package/dist/components/builders/Sheet/styles.js +135 -0
  55. package/dist/components/builders/Table/TablePagination/TablePagination.js +1 -1
  56. package/dist/components/builders/Text/Text.d.ts +1 -1
  57. package/dist/components/builders/index.d.ts +1 -0
  58. package/dist/components/controls/Checkbox/Checkbox.js +6 -6
  59. package/dist/components/controls/Select/Select.js +6 -6
  60. package/dist/components/controls/Switch/Switch.d.ts +10 -6
  61. package/dist/components/controls/Switch/Switch.js +109 -86
  62. package/dist/components/controls/Switch/styles.d.ts +3 -2
  63. package/dist/components/controls/Switch/styles.js +76 -73
  64. package/dist/index.js +93 -91
  65. package/dist/ui-kit.cjs +8 -8
  66. package/dist/utils/hooks/useLatestRef.d.ts +6 -0
  67. package/dist/utils/hooks/useLatestRef.js +10 -0
  68. package/package.json +1 -1
  69. package/dist/components/builders/Modal/ModalFooter/ModalFooter.js +0 -35
  70. package/dist/components/builders/Modal/ModalFooter/index.d.ts +0 -2
  71. package/dist/components/builders/Modal/ModalHeader/ModalHeader.js +0 -86
  72. package/dist/components/builders/Modal/ModalHeader/index.d.ts +0 -2
  73. package/dist/components/builders/Modal/ModalMain/index.d.ts +0 -2
  74. package/dist/components/builders/Modal/ModalMain/styles.d.ts +0 -3
  75. package/dist/components/builders/Modal/context.d.ts +0 -8
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Ref с последним значением — для колбэков, которые вызываются вне рендера
3
+ * (события клавиатуры и указателя, завершение анимации) и должны видеть
4
+ * актуальные пропсы.
5
+ */
6
+ export declare function useLatestRef<T>(value: T): import('react').MutableRefObject<T>;
@@ -0,0 +1,10 @@
1
+ import { useRef as r, useLayoutEffect as f } from "react";
2
+ function u(e) {
3
+ const t = r(e);
4
+ return f(() => {
5
+ t.current = e;
6
+ }), t;
7
+ }
8
+ export {
9
+ u as useLatestRef
10
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dss-kit/ui-kit",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "main": "./dist/ui-kit.cjs",
6
6
  "module": "./dist/index.js",
@@ -1,35 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { cx as c, css as f } from "@emotion/css";
3
- import { forwardRef as d } from "react";
4
- import { Box as n } from "../../Box/Box.js";
5
- import { theme as o } from "../../../../utils/theme/index.js";
6
- const x = f({
7
- borderTop: `1px solid ${o.color.border.neutral_alpha_basic}`
8
- }), u = d(
9
- ({
10
- children: r,
11
- row: t = !0,
12
- flex: e = !0,
13
- gap: a = o.spacing.lg,
14
- p: m = o.spacing["2xl"],
15
- className: s,
16
- // Остальные пропсы передаются в компонент Box
17
- ...p
18
- }, l) => /* @__PURE__ */ i(
19
- n,
20
- {
21
- flex: e,
22
- row: t,
23
- gap: a,
24
- p: m,
25
- className: c(x, s),
26
- ref: l,
27
- ...p,
28
- children: r
29
- }
30
- )
31
- );
32
- u.displayName = "ModalFooter";
33
- export {
34
- u as ModalFooter
35
- };
@@ -1,2 +0,0 @@
1
- export type { ModalFooterProps } from './ModalFooter';
2
- export { ModalFooter } from './ModalFooter';
@@ -1,86 +0,0 @@
1
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as v } from "react";
3
- import W from "../../../../assets/svg/modal/close.svg.js";
4
- import { useModalContext as B } from "../context.js";
5
- import { Box as t } from "../../Box/Box.js";
6
- import { theme as r } from "../../../../utils/theme/index.js";
7
- import { Text as i } from "../../Text/Text.js";
8
- import { IconButton as M } from "../../../controls/IconButton/IconButton.js";
9
- const j = v(
10
- ({
11
- title: a,
12
- subtitle: l,
13
- w: m = "full",
14
- p: s,
15
- py: d,
16
- px: n = r.spacing["2xl"],
17
- pt: c = r.spacing["2xl"],
18
- pb: p = r.spacing.lg,
19
- row: f = !0,
20
- justifyContent: h = "space-between",
21
- showCloseButton: b = !1,
22
- className: g,
23
- titleClassName: x,
24
- subtitleClassName: u,
25
- closeButtonClassName: N
26
- }, y) => {
27
- const { onClose: C } = B();
28
- return /* @__PURE__ */ e(
29
- t,
30
- {
31
- w: m,
32
- p: s,
33
- py: d,
34
- px: n,
35
- pt: c,
36
- pb: p,
37
- row: f,
38
- justifyContent: h,
39
- ref: y,
40
- borderColor: r.color.border.neutral_alpha_basic,
41
- borderWidth: 0,
42
- borderBottomWidth: 1,
43
- borderStyle: "solid",
44
- className: g,
45
- children: [
46
- /* @__PURE__ */ e(t, { gap: r.spacing.sm, children: [
47
- /* @__PURE__ */ o(
48
- i,
49
- {
50
- variant: "title-3",
51
- colorName: "primary",
52
- fontWeight: "semibold",
53
- className: x,
54
- children: a
55
- }
56
- ),
57
- /* @__PURE__ */ o(
58
- i,
59
- {
60
- variant: "body-1",
61
- colorName: "tertiary",
62
- fontWeight: "medium",
63
- className: u,
64
- children: l
65
- }
66
- )
67
- ] }),
68
- b && /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
69
- M,
70
- {
71
- onClick: C,
72
- color: "neutral",
73
- className: N,
74
- size: "xs",
75
- children: /* @__PURE__ */ o(W, {})
76
- }
77
- ) })
78
- ]
79
- }
80
- );
81
- }
82
- );
83
- j.displayName = "ModalHeader";
84
- export {
85
- j as ModalHeader
86
- };
@@ -1,2 +0,0 @@
1
- export type { ModalHeaderProps } from './ModalHeader';
2
- export { ModalHeader } from './ModalHeader';
@@ -1,2 +0,0 @@
1
- export type { ModalMainProps, ModalMainRef } from './ModalMain';
2
- export { ModalMain } from './ModalMain';
@@ -1,3 +0,0 @@
1
- export declare const styles: {
2
- main: string;
3
- };
@@ -1,8 +0,0 @@
1
- export declare const ModalContext: import('react').Context<{
2
- isOpen: boolean;
3
- onClose: () => void;
4
- }>;
5
- export declare const useModalContext: () => {
6
- isOpen: boolean;
7
- onClose: () => void;
8
- };