@divayth/brick-ui 0.0.14 → 0.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.
- package/README.md +15 -3
- package/dist/app/Provider.d.ts +3 -5
- package/dist/app/Provider.d.ts.map +1 -1
- package/dist/app/Provider.js +46 -37
- package/dist/index.js +54 -46
- package/dist/lib/dates.d.ts +5 -0
- package/dist/lib/dates.d.ts.map +1 -0
- package/dist/lib/dates.js +12 -0
- package/dist/lib/index.d.ts +2 -3
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/themes.d.ts +39 -0
- package/dist/lib/themes.d.ts.map +1 -1
- package/dist/lib/{defaultThemes.js → themes.js} +20 -2
- package/dist/styles.css +1 -1
- package/dist/ui/Date/DateInput.d.ts +2 -3
- package/dist/ui/Date/DateInput.d.ts.map +1 -1
- package/dist/ui/Date/DateInput.js +70 -89
- package/dist/ui/Date/DateInput.module.css.js +5 -5
- package/dist/ui/DateText/DateText.d.ts +0 -1
- package/dist/ui/DateText/DateText.d.ts.map +1 -1
- package/dist/ui/DateText/DateText.js +9 -10
- package/dist/ui/Drawer/Drawer.d.ts +1 -1
- package/dist/ui/Drawer/Drawer.d.ts.map +1 -1
- package/dist/ui/Drawer/Drawer.js +50 -53
- package/dist/ui/FeedScroll/FeedScroll.d.ts.map +1 -1
- package/dist/ui/FeedScroll/FeedScroll.js +30 -33
- package/dist/ui/IconButton/IconButton.module.css.js +21 -21
- package/dist/ui/Popover/Popover.d.ts +14 -0
- package/dist/ui/Popover/Popover.d.ts.map +1 -0
- package/dist/ui/Popover/Popover.js +26 -0
- package/dist/ui/Portal/Portal.d.ts +6 -0
- package/dist/ui/Portal/Portal.d.ts.map +1 -0
- package/dist/ui/Portal/Portal.js +12 -0
- package/dist/ui/Select/Select.d.ts.map +1 -1
- package/dist/ui/Select/Select.js +105 -173
- package/dist/ui/Select/Select.module.css.js +18 -20
- package/dist/ui/Tooltip/Tooltip.d.ts +18 -0
- package/dist/ui/Tooltip/Tooltip.d.ts.map +1 -0
- package/dist/ui/Tooltip/Tooltip.js +44 -0
- package/dist/ui/Tooltip/Tooltip.module.css.js +7 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/package.json +9 -3
- package/src/theme.css +30 -0
- package/dist/lib/defaultThemes.d.ts +0 -35
- package/dist/lib/defaultThemes.d.ts.map +0 -1
- package/dist/lib/theme.d.ts +0 -7
- package/dist/lib/theme.d.ts.map +0 -1
- package/dist/lib/theme.js +0 -15
|
@@ -9,8 +9,7 @@ export type DateInputProps = Omit<Extract<InputProps, {
|
|
|
9
9
|
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
10
10
|
value?: Date | null;
|
|
11
11
|
onChange?: (value: Date) => void;
|
|
12
|
-
|
|
13
|
-
calendarProps?: Omit<DayPickerProps, "mode" | "required" | "selected" | "onSelect">;
|
|
12
|
+
calendarProps?: Omit<DayPickerProps, "mode" | "required" | "selected" | "onSelect" | "locale">;
|
|
14
13
|
};
|
|
15
|
-
export declare const DateInput: ({ value, onChange,
|
|
14
|
+
export declare const DateInput: ({ value, onChange, calendarProps, disabled, className, endIcon, label, onKeyDown, ref: forwardedRef, ...props }: DateInputProps) => import("react").JSX.Element;
|
|
16
15
|
//# sourceMappingURL=DateInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/Date/DateInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../../src/ui/Date/DateInput.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EAGvB,MAAM,OAAO,CAAC;AAKf,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK3D,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlE,OAAO,4BAA4B,CAAC;AAGpC,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,OAAO,CAAC,UAAU,EAAE;IAAE,SAAS,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,EACxC,MAAM,GACN,WAAW,GACX,OAAO,GACP,cAAc,GACd,UAAU,GACV,SAAS,GACT,WAAW,CACd,GAAG;IACF,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAC9C,KAAK,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,aAAa,CAAC,EAAE,IAAI,CAClB,cAAc,EACd,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CACzD,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,iHAWvB,cAAc,gCAqEhB,CAAC"}
|
|
@@ -1,103 +1,84 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Flex as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { useProvider as
|
|
2
|
+
import { jsx as o, jsxs as O } from "react/jsx-runtime";
|
|
3
|
+
import { useState as S, useRef as j } from "react";
|
|
4
|
+
import { useComposedRefs as k } from "@radix-ui/react-compose-refs";
|
|
5
|
+
import { Popover as s } from "../Popover/Popover.js";
|
|
6
|
+
import { Flex as v } from "../Flex/Flex.js";
|
|
7
|
+
import { Input as F } from "../Input/Input.js";
|
|
8
|
+
import { useProvider as A } from "../../app/Provider.js";
|
|
9
|
+
import { formatDate as E } from "../../lib/dates.js";
|
|
9
10
|
import p from "clsx";
|
|
10
|
-
import { CalendarDays as
|
|
11
|
-
import { DayPicker as
|
|
12
|
-
import { ru as
|
|
11
|
+
import { CalendarDays as K } from "lucide-react";
|
|
12
|
+
import { DayPicker as M } from "react-day-picker";
|
|
13
|
+
import { ru as T, enUS as U } from "react-day-picker/locale";
|
|
13
14
|
/* empty css */
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
value:
|
|
17
|
-
onChange:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
import l from "./DateInput.module.css.js";
|
|
16
|
+
const $ = ({
|
|
17
|
+
value: t,
|
|
18
|
+
onChange: f,
|
|
19
|
+
calendarProps: u,
|
|
20
|
+
disabled: r,
|
|
21
|
+
className: d,
|
|
22
|
+
endIcon: g,
|
|
23
|
+
label: m,
|
|
24
|
+
onKeyDown: h,
|
|
25
|
+
ref: D,
|
|
26
|
+
...x
|
|
21
27
|
}) => {
|
|
22
|
-
const { locale:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
e.style.left = `${Math.max(i, Math.min(a.left, window.innerWidth - c.width - i))}px`, e.style.top = `${a.bottom + c.height + i <= window.innerHeight ? a.bottom + i : Math.max(i, a.top - c.height - i)}px`;
|
|
33
|
-
const d = () => l(null), g = (o) => {
|
|
34
|
-
o.target instanceof Node && (e.contains(o.target) || n.contains(o.target)) || d();
|
|
35
|
-
}, h = (o) => {
|
|
36
|
-
o.key === "Escape" && (o.preventDefault(), o.stopPropagation(), d(), n.focus());
|
|
37
|
-
}, w = (o) => {
|
|
38
|
-
o.target instanceof Node && e.contains(o.target) || d();
|
|
39
|
-
};
|
|
40
|
-
return document.addEventListener("pointerdown", g, !0), document.addEventListener("keydown", h, !0), document.addEventListener("scroll", w, !0), window.addEventListener("resize", d), () => {
|
|
41
|
-
document.removeEventListener("pointerdown", g, !0), document.removeEventListener("keydown", h, !0), document.removeEventListener("scroll", w, !0), window.removeEventListener("resize", d), e.matches(":popover-open") && e.hidePopover();
|
|
42
|
-
};
|
|
43
|
-
}, [n, t.disabled]), /* @__PURE__ */ b(I, { direction: "col", className: "relative gap-0", children: [
|
|
44
|
-
/* @__PURE__ */ u(
|
|
45
|
-
M,
|
|
28
|
+
const { locale: i, messages: y } = A(), [c, n] = S(!1), a = j(null), C = k(a, D), {
|
|
29
|
+
className: N,
|
|
30
|
+
autoFocus: P = !0,
|
|
31
|
+
animate: w = !0,
|
|
32
|
+
defaultMonth: R = t ?? void 0,
|
|
33
|
+
...I
|
|
34
|
+
} = u ?? {};
|
|
35
|
+
return /* @__PURE__ */ o(s.Root, { open: c && !r, onOpenChange: n, children: /* @__PURE__ */ O(v, { direction: "col", gap: "none", className: "relative", children: [
|
|
36
|
+
/* @__PURE__ */ o(s.Trigger, { children: /* @__PURE__ */ o(
|
|
37
|
+
F,
|
|
46
38
|
{
|
|
47
|
-
|
|
48
|
-
value:
|
|
49
|
-
year: "numeric",
|
|
50
|
-
month: "2-digit",
|
|
51
|
-
day: "2-digit"
|
|
52
|
-
}).format(s) : "",
|
|
39
|
+
ref: C,
|
|
40
|
+
value: E(t, i),
|
|
53
41
|
type: "text",
|
|
54
42
|
readOnly: !0,
|
|
55
|
-
|
|
43
|
+
disabled: r,
|
|
44
|
+
label: m,
|
|
45
|
+
endIcon: g ?? K,
|
|
56
46
|
"aria-haspopup": "dialog",
|
|
57
|
-
"aria-expanded":
|
|
58
|
-
|
|
59
|
-
if (t.onClick?.(e), !t.disabled && !e.defaultPrevented) {
|
|
60
|
-
const a = e.currentTarget;
|
|
61
|
-
l((c) => c ? null : a);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
className: p({ "cursor-pointer": !t.disabled }, t.className),
|
|
47
|
+
"aria-expanded": c && !r,
|
|
48
|
+
className: p({ "cursor-pointer": !r }, d),
|
|
65
49
|
onKeyDown: (e) => {
|
|
66
|
-
|
|
67
|
-
}
|
|
50
|
+
h?.(e), !r && !e.defaultPrevented && ["Enter", " ", "ArrowDown"].includes(e.key) && (e.preventDefault(), n(!0));
|
|
51
|
+
},
|
|
52
|
+
...x
|
|
53
|
+
}
|
|
54
|
+
) }),
|
|
55
|
+
/* @__PURE__ */ o(
|
|
56
|
+
s.Content,
|
|
57
|
+
{
|
|
58
|
+
container: a.current?.closest("dialog"),
|
|
59
|
+
align: "start",
|
|
60
|
+
"aria-label": m ?? y.chooseDate,
|
|
61
|
+
className: l.dropdown,
|
|
62
|
+
children: /* @__PURE__ */ o(
|
|
63
|
+
M,
|
|
64
|
+
{
|
|
65
|
+
className: p(l.calendar, N),
|
|
66
|
+
autoFocus: P,
|
|
67
|
+
animate: w,
|
|
68
|
+
mode: "single",
|
|
69
|
+
locale: i.startsWith("ru") ? T : U,
|
|
70
|
+
defaultMonth: R,
|
|
71
|
+
selected: t ?? void 0,
|
|
72
|
+
onSelect: (e) => {
|
|
73
|
+
e && (f?.(e), n(!1), a.current?.focus());
|
|
74
|
+
},
|
|
75
|
+
...I
|
|
76
|
+
}
|
|
77
|
+
)
|
|
68
78
|
}
|
|
69
|
-
),
|
|
70
|
-
n && C(
|
|
71
|
-
/* @__PURE__ */ u(
|
|
72
|
-
R,
|
|
73
|
-
{
|
|
74
|
-
ref: f,
|
|
75
|
-
popover: "manual",
|
|
76
|
-
role: "dialog",
|
|
77
|
-
"aria-label": t.label ?? E.chooseDate,
|
|
78
|
-
className: y.dropdown,
|
|
79
|
-
children: /* @__PURE__ */ u(
|
|
80
|
-
S,
|
|
81
|
-
{
|
|
82
|
-
...r,
|
|
83
|
-
className: p(y.calendar, r?.className),
|
|
84
|
-
autoFocus: r?.autoFocus ?? !0,
|
|
85
|
-
animate: r?.animate ?? !0,
|
|
86
|
-
mode: "single",
|
|
87
|
-
locale: r?.locale ?? (m.startsWith("ru") ? B : K),
|
|
88
|
-
defaultMonth: r?.defaultMonth ?? s ?? void 0,
|
|
89
|
-
selected: s ?? void 0,
|
|
90
|
-
onSelect: (e) => {
|
|
91
|
-
e && (v?.(e), l(null), n.focus());
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
),
|
|
97
|
-
n.closest("dialog") ?? document.body
|
|
98
79
|
)
|
|
99
|
-
] });
|
|
80
|
+
] }) });
|
|
100
81
|
};
|
|
101
82
|
export {
|
|
102
|
-
|
|
83
|
+
$ as DateInput
|
|
103
84
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
dropdown:
|
|
3
|
-
calendar:
|
|
1
|
+
const d = "_dropdown_1uipl_1", o = "_calendar_1uipl_16", n = {
|
|
2
|
+
dropdown: d,
|
|
3
|
+
calendar: o
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
o as calendar,
|
|
7
7
|
n as default,
|
|
8
|
-
|
|
8
|
+
d as dropdown
|
|
9
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateText.d.ts","sourceRoot":"","sources":["../../../src/ui/DateText/DateText.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateText.d.ts","sourceRoot":"","sources":["../../../src/ui/DateText/DateText.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,GAAI,6BAItB,SAAS,gCAGX,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import {
|
|
6
|
-
import { Text as a } from "../Text/Text.js";
|
|
2
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { useProvider as i } from "../../app/Provider.js";
|
|
4
|
+
import { formatDate as f } from "../../lib/dates.js";
|
|
5
|
+
import { Text as p } from "../Text/Text.js";
|
|
7
6
|
const x = ({
|
|
8
|
-
value:
|
|
9
|
-
format:
|
|
10
|
-
...
|
|
7
|
+
value: r,
|
|
8
|
+
format: o = "DD MMMM YYYY",
|
|
9
|
+
...t
|
|
11
10
|
}) => {
|
|
12
|
-
const { locale:
|
|
13
|
-
return /* @__PURE__ */
|
|
11
|
+
const { locale: e } = i();
|
|
12
|
+
return /* @__PURE__ */ m(p, { ...t, children: f(r, e, o) });
|
|
14
13
|
};
|
|
15
14
|
export {
|
|
16
15
|
x as DateText
|
|
@@ -13,5 +13,5 @@ export interface DrawerProps {
|
|
|
13
13
|
closeLabel?: string;
|
|
14
14
|
className?: string;
|
|
15
15
|
}
|
|
16
|
-
export declare const Drawer: ({ isOpen, onClose, position, size, title, children, withCloseButton, closeOnOverlay, closeLabel, className, }: DrawerProps) => import("react").
|
|
16
|
+
export declare const Drawer: ({ isOpen, onClose, position, size, title, children, withCloseButton, closeOnOverlay, closeLabel, className, }: DrawerProps) => import("react").JSX.Element | null;
|
|
17
17
|
//# sourceMappingURL=Drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/ui/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAW5D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,GAAI,+GAWpB,WAAW,
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/ui/Drawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAW5D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,OAAO,CAAC;AAC9C,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,MAAM,GAAI,+GAWpB,WAAW,uCAqEb,CAAC"}
|
package/dist/ui/Drawer/Drawer.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx as r, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
import { useState as d, useEffect as k } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { Portal as C } from "../Portal/Portal.js";
|
|
5
5
|
import { Flex as u } from "../Flex/Flex.js";
|
|
6
6
|
import { IconButton as E } from "../IconButton/IconButton.js";
|
|
7
7
|
import p from "clsx";
|
|
@@ -11,12 +11,12 @@ import e from "./Drawer.module.css.js";
|
|
|
11
11
|
const X = ({
|
|
12
12
|
isOpen: o,
|
|
13
13
|
onClose: h,
|
|
14
|
-
position:
|
|
15
|
-
size:
|
|
14
|
+
position: x = "right",
|
|
15
|
+
size: b = "md",
|
|
16
16
|
title: a,
|
|
17
|
-
children:
|
|
17
|
+
children: v,
|
|
18
18
|
withCloseButton: s = !0,
|
|
19
|
-
closeOnOverlay:
|
|
19
|
+
closeOnOverlay: y = !0,
|
|
20
20
|
closeLabel: i,
|
|
21
21
|
className: N
|
|
22
22
|
}) => {
|
|
@@ -29,56 +29,53 @@ const X = ({
|
|
|
29
29
|
});
|
|
30
30
|
}, [o]);
|
|
31
31
|
const g = () => {
|
|
32
|
-
|
|
32
|
+
y && t(!1);
|
|
33
33
|
}, j = () => {
|
|
34
34
|
!f && m && (c(!1), o && h());
|
|
35
35
|
};
|
|
36
|
-
return m ? C(
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
] }),
|
|
80
|
-
document.body
|
|
81
|
-
) : null;
|
|
36
|
+
return m ? /* @__PURE__ */ r(C, { children: /* @__PURE__ */ n("div", { className: p(e.root, { [e.open]: f }), children: [
|
|
37
|
+
/* @__PURE__ */ r(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
type: "button",
|
|
41
|
+
"aria-label": i ?? l.close,
|
|
42
|
+
tabIndex: -1,
|
|
43
|
+
className: e.overlay,
|
|
44
|
+
onClick: g,
|
|
45
|
+
onTransitionEnd: j
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ n(
|
|
49
|
+
u,
|
|
50
|
+
{
|
|
51
|
+
direction: "col",
|
|
52
|
+
className: p(e.panel, e[x], e[b], N),
|
|
53
|
+
children: [
|
|
54
|
+
(a || s) && /* @__PURE__ */ n(
|
|
55
|
+
u,
|
|
56
|
+
{
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "between",
|
|
59
|
+
className: e.header,
|
|
60
|
+
children: [
|
|
61
|
+
a,
|
|
62
|
+
s && /* @__PURE__ */ r(
|
|
63
|
+
E,
|
|
64
|
+
{
|
|
65
|
+
"aria-label": i ?? l.close,
|
|
66
|
+
color: "secondary",
|
|
67
|
+
onClick: () => t(!1),
|
|
68
|
+
children: /* @__PURE__ */ r(F, { size: 20 })
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ r("div", { className: e.content, children: v })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
] }) }) : null;
|
|
82
79
|
};
|
|
83
80
|
export {
|
|
84
81
|
X as Drawer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedScroll.d.ts","sourceRoot":"","sources":["../../../src/ui/FeedScroll/FeedScroll.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAYtE,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,GAAI,kDAIxB,eAAe,
|
|
1
|
+
{"version":3,"file":"FeedScroll.d.ts","sourceRoot":"","sources":["../../../src/ui/FeedScroll/FeedScroll.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAyB,MAAM,OAAO,CAAC;AAYtE,MAAM,WAAW,eAAgB,SAAQ,iBAAiB;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,GAAI,kDAIxB,eAAe,gCAuFjB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as R, jsx as
|
|
3
|
-
import { useState as
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import { ArrowBigUp as
|
|
7
|
-
import { useProvider as
|
|
8
|
-
import { Flex as
|
|
2
|
+
import { jsxs as R, jsx as m } from "react/jsx-runtime";
|
|
3
|
+
import { useState as h, useCallback as S } from "react";
|
|
4
|
+
import { Portal as z } from "../Portal/Portal.js";
|
|
5
|
+
import H from "clsx";
|
|
6
|
+
import { ArrowBigUp as L } from "lucide-react";
|
|
7
|
+
import { useProvider as T } from "../../app/Provider.js";
|
|
8
|
+
import { Flex as y } from "../Flex/Flex.js";
|
|
9
9
|
import { IconButton as P } from "../IconButton/IconButton.js";
|
|
10
10
|
import p from "./FeedScroll.module.css.js";
|
|
11
11
|
const Y = ({
|
|
@@ -13,24 +13,24 @@ const Y = ({
|
|
|
13
13
|
scrollToTopLabel: b,
|
|
14
14
|
withScrollToTop: f = !0
|
|
15
15
|
}) => {
|
|
16
|
-
const { messages: v } =
|
|
16
|
+
const { messages: v } = T(), [n, w] = h(!1), [d, x] = h(
|
|
17
17
|
null
|
|
18
|
-
), [C, E] =
|
|
18
|
+
), [C, E] = h({ right: 8, bottom: 24 }), B = S((r) => {
|
|
19
19
|
if (!r) return;
|
|
20
20
|
let o = r.parentElement;
|
|
21
21
|
for (; o && !/(auto|scroll|overlay)/.test(getComputedStyle(o).overflowY); )
|
|
22
22
|
o = o.parentElement;
|
|
23
23
|
const t = o ?? document.scrollingElement, e = () => {
|
|
24
|
-
const s = t.getBoundingClientRect(), l = r.getBoundingClientRect(), M = Math.max(0, s.top),
|
|
24
|
+
const s = t.getBoundingClientRect(), l = r.getBoundingClientRect(), M = Math.max(0, s.top), u = Math.min(innerHeight, s.bottom);
|
|
25
25
|
w(
|
|
26
|
-
t.scrollHeight > t.clientHeight && t.scrollTop > 0 && l.bottom > M && l.top <
|
|
26
|
+
t.scrollHeight > t.clientHeight && t.scrollTop > 0 && l.bottom > M && l.top < u
|
|
27
27
|
);
|
|
28
28
|
const c = {
|
|
29
29
|
right: Math.max(
|
|
30
30
|
8,
|
|
31
31
|
innerWidth - Math.min(s.right, l.right, innerWidth) + 8
|
|
32
32
|
),
|
|
33
|
-
bottom: Math.max(24, innerHeight -
|
|
33
|
+
bottom: Math.max(24, innerHeight - u + 24)
|
|
34
34
|
};
|
|
35
35
|
E(
|
|
36
36
|
(a) => a.right === c.right && a.bottom === c.bottom ? a : c
|
|
@@ -42,28 +42,25 @@ const Y = ({
|
|
|
42
42
|
window.removeEventListener("scroll", e, !0), window.removeEventListener("resize", e), i.disconnect();
|
|
43
43
|
};
|
|
44
44
|
}, []);
|
|
45
|
-
return /* @__PURE__ */ R(
|
|
45
|
+
return /* @__PURE__ */ R(y, { ref: B, direction: "col", className: "w-full", children: [
|
|
46
46
|
g,
|
|
47
|
-
f && d &&
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
),
|
|
65
|
-
document.body
|
|
66
|
-
)
|
|
47
|
+
f && d && /* @__PURE__ */ m(z, { children: /* @__PURE__ */ m(
|
|
48
|
+
P,
|
|
49
|
+
{
|
|
50
|
+
size: "lg",
|
|
51
|
+
"aria-label": b ?? v.scrollToTop,
|
|
52
|
+
variant: "filled",
|
|
53
|
+
"aria-hidden": !n,
|
|
54
|
+
tabIndex: n ? 0 : -1,
|
|
55
|
+
className: H(p.button, { [p.visible]: n }),
|
|
56
|
+
style: C,
|
|
57
|
+
onClick: () => d.scrollTo({
|
|
58
|
+
top: 0,
|
|
59
|
+
behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth"
|
|
60
|
+
}),
|
|
61
|
+
children: /* @__PURE__ */ m(L, {})
|
|
62
|
+
}
|
|
63
|
+
) })
|
|
67
64
|
] });
|
|
68
65
|
};
|
|
69
66
|
export {
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
xs:
|
|
4
|
-
sm:
|
|
5
|
-
md:
|
|
6
|
-
lg:
|
|
1
|
+
const i = "_root_ivirq_2", _ = "_xs_ivirq_24", o = "_sm_ivirq_29", n = "_md_ivirq_34", r = "_lg_ivirq_39", s = "_xl_ivirq_44", t = "_primary_ivirq_49", d = "_secondary_ivirq_57", l = "_danger_ivirq_66", c = "_outlined_ivirq_75", e = "_filled_ivirq_79", a = "_disabled_ivirq_109", q = "_content_ivirq_122", v = "_loading_ivirq_130", g = {
|
|
2
|
+
root: i,
|
|
3
|
+
xs: _,
|
|
4
|
+
sm: o,
|
|
5
|
+
md: n,
|
|
6
|
+
lg: r,
|
|
7
7
|
xl: s,
|
|
8
8
|
primary: t,
|
|
9
|
-
secondary:
|
|
10
|
-
danger:
|
|
11
|
-
outlined:
|
|
12
|
-
filled:
|
|
13
|
-
disabled:
|
|
9
|
+
secondary: d,
|
|
10
|
+
danger: l,
|
|
11
|
+
outlined: c,
|
|
12
|
+
filled: e,
|
|
13
|
+
disabled: a,
|
|
14
14
|
content: q,
|
|
15
15
|
loading: v
|
|
16
16
|
};
|
|
17
17
|
export {
|
|
18
18
|
q as content,
|
|
19
|
-
|
|
19
|
+
l as danger,
|
|
20
20
|
g as default,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
a as disabled,
|
|
22
|
+
e as filled,
|
|
23
|
+
r as lg,
|
|
24
24
|
v as loading,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
n as md,
|
|
26
|
+
c as outlined,
|
|
27
27
|
t as primary,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
i as root,
|
|
29
|
+
d as secondary,
|
|
30
|
+
o as sm,
|
|
31
31
|
s as xl,
|
|
32
|
-
|
|
32
|
+
_ as xs
|
|
33
33
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
import { Popover as Primitive } from "radix-ui";
|
|
3
|
+
import { type PortalProps } from "../Portal/Portal.js";
|
|
4
|
+
export type PopoverRootProps = ComponentProps<typeof Primitive.Root>;
|
|
5
|
+
export type PopoverTriggerProps = ComponentProps<typeof Primitive.Trigger>;
|
|
6
|
+
export type PopoverContentProps = ComponentProps<typeof Primitive.Content> & Pick<PortalProps, "container">;
|
|
7
|
+
export declare const Popover: {
|
|
8
|
+
Root: import("react").FC<Primitive.PopoverProps>;
|
|
9
|
+
Anchor: (props: ComponentProps<typeof Primitive.Anchor>) => import("react").JSX.Element;
|
|
10
|
+
Trigger: (props: PopoverTriggerProps) => import("react").JSX.Element;
|
|
11
|
+
Content: ({ container, sideOffset, collisionPadding, ...props }: PopoverContentProps) => import("react").JSX.Element;
|
|
12
|
+
Close: import("react").ForwardRefExoticComponent<Primitive.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Popover.d.ts","sourceRoot":"","sources":["../../../src/ui/Popover/Popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;AACrE,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC3E,MAAM,MAAM,mBAAmB,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,OAAO,CAAC,GACxE,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAwBjC,eAAO,MAAM,OAAO;;oBAnBG,cAAc,CAAC,OAAO,SAAS,CAAC,MAAM,CAAC;qBAHtC,mBAAmB;qEAYxC,mBAAmB;;CAgBrB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as r } from "radix-ui";
|
|
4
|
+
import { Portal as i } from "../Portal/Portal.js";
|
|
5
|
+
const c = (o) => /* @__PURE__ */ t(r.Trigger, { asChild: !0, ...o }), p = (o) => /* @__PURE__ */ t(r.Anchor, { asChild: !0, ...o }), l = ({
|
|
6
|
+
container: o,
|
|
7
|
+
sideOffset: e = 8,
|
|
8
|
+
collisionPadding: n = 8,
|
|
9
|
+
...s
|
|
10
|
+
}) => /* @__PURE__ */ t(i, { container: o, children: /* @__PURE__ */ t(
|
|
11
|
+
r.Content,
|
|
12
|
+
{
|
|
13
|
+
sideOffset: e,
|
|
14
|
+
collisionPadding: n,
|
|
15
|
+
...s
|
|
16
|
+
}
|
|
17
|
+
) }), a = {
|
|
18
|
+
Root: r.Root,
|
|
19
|
+
Anchor: p,
|
|
20
|
+
Trigger: c,
|
|
21
|
+
Content: l,
|
|
22
|
+
Close: r.Close
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
a as Popover
|
|
26
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
export interface PortalProps extends PropsWithChildren {
|
|
3
|
+
container?: Element | DocumentFragment | null;
|
|
4
|
+
}
|
|
5
|
+
export declare const Portal: ({ container, children }: PortalProps) => import("react").ReactPortal | null;
|
|
6
|
+
//# sourceMappingURL=Portal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../src/ui/Portal/Portal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,OAAO,CAAC;AAGpE,MAAM,WAAW,WAAY,SAAQ,iBAAiB;IACpD,SAAS,CAAC,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAAI,CAAC;CAC/C;AAED,eAAO,MAAM,MAAM,GAAI,yBAAyB,WAAW,uCAU1D,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useState as u, useEffect as n } from "react";
|
|
3
|
+
import { createPortal as f } from "react-dom";
|
|
4
|
+
const a = ({ container: t, children: e }) => {
|
|
5
|
+
const [o, r] = u(!1);
|
|
6
|
+
return n(() => {
|
|
7
|
+
r(!0);
|
|
8
|
+
}, []), o ? f(e, t ?? document.body) : null;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
a as Portal
|
|
12
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/ui/Select/Select.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,OAAO,CAAC;AAGhE,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAU5D,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhE,MAAM,WAAW,WAAW,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IAC9D,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,CAAC;IACV,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;CACjC;AA4BD,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,WAAW,EAAE,oHAa3C,WAAW,CAAC,CAAC,CAAC,gCA6GhB,CAAC"}
|