gd-design-library 1.0.2 → 1.2.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 +2 -2
- package/ai/README.md +210 -16
- package/ai/schemas/components/Accordion.d.ts +84 -0
- package/ai/schemas/components/Button.d.ts +12 -0
- package/ai/schemas/components/ChatContainer.d.ts +0 -8
- package/ai/schemas/components/Column.d.ts +5 -5
- package/ai/schemas/components/InputFile.d.ts +17 -5
- package/ai/schemas/components/Menu.d.ts +37 -0
- package/ai/schemas/components/Row.d.ts +6 -6
- package/ai/schemas/components/Scroll.d.ts +7 -0
- package/ai/schemas/components/Typography.d.ts +0 -21
- package/assets/icons/account_circle.d.ts +1 -3
- package/assets/icons/account_circle.js +7 -14
- package/assets/icons/arrow-down.d.ts +2 -3
- package/assets/icons/arrow-down.js +6 -11
- package/assets/icons/arrow-forward.d.ts +1 -3
- package/assets/icons/arrow-forward.js +6 -13
- package/assets/icons/attachment.d.ts +1 -3
- package/assets/icons/attachment.js +7 -14
- package/assets/icons/check.d.ts +1 -3
- package/assets/icons/check.js +5 -11
- package/assets/icons/chevron-left.d.ts +1 -3
- package/assets/icons/chevron-left.js +7 -14
- package/assets/icons/chevron-right.d.ts +1 -3
- package/assets/icons/chevron-right.js +6 -13
- package/assets/icons/content-copy.d.ts +1 -3
- package/assets/icons/content-copy.js +7 -14
- package/assets/icons/delete_outlined.d.ts +1 -3
- package/assets/icons/delete_outlined.js +5 -12
- package/assets/icons/dot.d.ts +1 -3
- package/assets/icons/dot.js +5 -11
- package/assets/icons/error_outline.d.ts +1 -4
- package/assets/icons/error_outline.js +6 -18
- package/assets/icons/eye.d.ts +1 -3
- package/assets/icons/eye.js +7 -14
- package/assets/icons/file-copy.d.ts +1 -3
- package/assets/icons/file-copy.js +7 -13
- package/assets/icons/filter.d.ts +1 -3
- package/assets/icons/filter.js +6 -13
- package/assets/icons/folder.d.ts +1 -3
- package/assets/icons/folder.js +6 -13
- package/assets/icons/folderOpen.d.ts +1 -3
- package/assets/icons/folderOpen.js +7 -14
- package/assets/icons/home.d.ts +1 -3
- package/assets/icons/home.js +6 -13
- package/assets/icons/local_shipping.d.ts +1 -3
- package/assets/icons/local_shipping.js +4 -11
- package/assets/icons/minus.d.ts +1 -3
- package/assets/icons/minus.js +7 -13
- package/assets/icons/mobile_menu_button.d.ts +1 -3
- package/assets/icons/mobile_menu_button.js +7 -14
- package/assets/icons/paymentCard.d.ts +1 -3
- package/assets/icons/paymentCard.js +6 -13
- package/assets/icons/plus.d.ts +1 -3
- package/assets/icons/plus.js +5 -11
- package/assets/icons/portrait.d.ts +1 -3
- package/assets/icons/portrait.js +5 -12
- package/assets/icons/processing.d.ts +1 -3
- package/assets/icons/processing.js +6 -13
- package/assets/icons/ruler.d.ts +1 -3
- package/assets/icons/ruler.js +6 -13
- package/assets/icons/search.d.ts +1 -3
- package/assets/icons/search.js +6 -13
- package/assets/icons/shopping_bag.d.ts +1 -3
- package/assets/icons/shopping_bag.js +7 -14
- package/assets/icons/slash.d.ts +1 -3
- package/assets/icons/slash.js +6 -13
- package/assets/icons/star.d.ts +1 -3
- package/assets/icons/star.js +6 -12
- package/assets/icons/starOutlined.d.ts +1 -3
- package/assets/icons/starOutlined.js +5 -11
- package/assets/icons/toast_error.d.ts +1 -3
- package/assets/icons/toast_error.js +9 -15
- package/assets/icons/toast_info.d.ts +1 -3
- package/assets/icons/toast_info.js +7 -13
- package/assets/icons/toast_warning.d.ts +1 -3
- package/assets/icons/toast_warning.js +7 -13
- package/assets/icons/upload.d.ts +1 -3
- package/assets/icons/upload.js +6 -13
- package/assets/icons/volume-up.d.ts +1 -3
- package/assets/icons/volume-up.js +6 -13
- package/assets/icons/wifiTethering.d.ts +1 -3
- package/assets/icons/wifiTethering.js +4 -11
- package/components/core/Button/Button.js +30 -27
- package/components/core/Button/Button.types.d.ts +2 -2
- package/components/core/Button/ButtonStyled.js +40 -39
- package/components/core/Dropdown/Dropdown.d.ts +1 -1
- package/components/core/Dropdown/Dropdown.js +16 -16
- package/components/core/Dropdown/Dropdown.types.d.ts +3 -3
- package/components/core/Dropdown/DropdownStyled.js +13 -14
- package/components/core/Icon/Icon.js +41 -33
- package/components/core/Icon/Icon.types.d.ts +2 -1
- package/components/core/Icon/constants.d.ts +37 -109
- package/components/core/Input/Input.d.ts +1 -1
- package/components/core/InputFile/InputFile.d.ts +0 -32
- package/components/core/InputFile/InputFile.js +47 -33
- package/components/core/InputFile/InputFileStyled.js +24 -22
- package/components/core/Loader/Loader.js +19 -17
- package/components/core/Loader/Loader.types.d.ts +3 -1
- package/components/core/Loader/LoaderStyled.js +34 -30
- package/components/core/Menu/Menu.d.ts +2 -2
- package/components/core/Menu/Menu.js +113 -93
- package/components/core/Menu/Menu.types.d.ts +16 -11
- package/components/core/Menu/MenuStyled.d.ts +1 -1
- package/components/core/Menu/constants.js +4 -12
- package/components/core/Modal/Modal.js +60 -36
- package/components/core/Modal/ModalStyled.js +21 -22
- package/components/core/Scroll/Scroll.d.ts +6 -0
- package/components/core/Scroll/Scroll.js +53 -31
- package/components/core/Scroll/Scroll.types.d.ts +5 -0
- package/components/core/Scroll/ScrollBar.js +45 -43
- package/components/core/Scroll/ScrollStyled.js +46 -42
- package/components/core/Scroll/constants.d.ts +2 -0
- package/components/core/Scroll/constants.js +6 -4
- package/components/core/Select/Select.js +162 -134
- package/components/core/Select/Select.types.d.ts +2 -4
- package/components/core/Snackbar/Snackbar.js +60 -37
- package/components/core/Snackbar/Snackbar.types.d.ts +1 -2
- package/components/core/Snackbar/SnackbarManager.js +45 -30
- package/components/core/Snackbar/SnackbarStyled.d.ts +5 -5
- package/components/core/Snackbar/SnackbarStyled.js +111 -101
- package/components/core/Textarea/Textarea.d.ts +4 -0
- package/components/core/Tooltip/Tooltip.js +68 -44
- package/components/core/Tooltip/TooltipStyled.js +26 -27
- package/components/core/Tooltip/utils.js +47 -45
- package/components/core/Typography/Typography.js +18 -18
- package/components/core/Typography/Typography.types.d.ts +3 -3
- package/components/core/Typography/TypographyStyled.js +28 -29
- package/components/domainSpecific/Accordion/Accordion.d.ts +1 -1
- package/components/domainSpecific/Accordion/Accordion.js +19 -17
- package/components/domainSpecific/Accordion/Accordion.types.d.ts +7 -4
- package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionContent/AccordionContent.js +13 -12
- package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionHeader/AccordionHeader.js +15 -14
- package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.d.ts +1 -1
- package/components/domainSpecific/Accordion/AccordionItem/AccordionItem.js +18 -16
- package/components/domainSpecific/Accordion/AccordionStyled.js +44 -35
- package/components/domainSpecific/Card/Card.js +31 -27
- package/components/domainSpecific/Card/CardTitle/constants.js +4 -4
- package/components/domainSpecific/Header/Header.js +4 -4
- package/components/domainSpecific/SearchModal/SearchModal.js +0 -1
- package/components/domainSpecific/SearchModal/SearchModal.types.d.ts +1 -1
- package/components/index.types.d.ts +1 -0
- package/components/layout/ChatContainer/ChatContainer.d.ts +1 -1
- package/components/layout/ChatContainer/ChatContainer.js +58 -41
- package/components/layout/ChatContainer/ChatContainer.types.d.ts +8 -5
- package/components/layout/ChatContainer/ChatContainerStyled.d.ts +2 -0
- package/components/layout/ChatContainer/ChatContainerStyled.js +105 -84
- package/components/layout/Column/Column.types.d.ts +3 -1
- package/components/layout/Column/ColumnStyled.js +23 -23
- package/components/layout/FlexContainer/FlexContainerStyled.js +7 -8
- package/components/layout/Row/Row.d.ts +1 -1
- package/components/layout/Row/Row.js +20 -20
- package/components/layout/Row/Row.types.d.ts +3 -1
- package/components/layout/Row/RowStyled.js +26 -26
- package/constants/index.d.ts +0 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/useLogger/NoOpLogger.d.ts +11 -0
- package/hooks/useLogger/NoOpLogger.js +15 -0
- package/hooks/useLogger/index.d.ts +2 -0
- package/hooks/useLogger/useLogger.d.ts +4 -0
- package/hooks/useLogger/useLogger.js +27 -0
- package/hooks/useLogger/useLogger.types.d.ts +30 -0
- package/hooks/useTheme/NoOpTheme.d.ts +4050 -0
- package/hooks/useTheme/NoOpTheme.js +15 -0
- package/hooks/useTheme/useTheme.d.ts +3 -4
- package/hooks/useTheme/useTheme.js +62 -41
- package/hooks/useTheme/useTheme.types.d.ts +3 -2
- package/index.d.ts +4 -0
- package/index.js +354 -350
- package/llms.txt +39 -19
- package/package.json +1 -1
- package/tokens/accordion.d.ts +9 -3
- package/tokens/accordion.js +14 -11
- package/tokens/button.d.ts +17 -19
- package/tokens/button.js +54 -56
- package/tokens/card.d.ts +2 -3
- package/tokens/card.js +50 -53
- package/tokens/carousel.d.ts +2 -2
- package/tokens/carousel.js +8 -9
- package/tokens/chat.d.ts +69 -48
- package/tokens/chat.js +86 -68
- package/tokens/constants.d.ts +0 -1
- package/tokens/constants.js +1 -1
- package/tokens/defaultTheme.d.ts +199 -112
- package/tokens/defaultTheme.js +27 -25
- package/tokens/header.d.ts +1 -1
- package/tokens/header.js +3 -4
- package/tokens/index.d.ts +175 -104
- package/tokens/index.js +102 -101
- package/tokens/input.d.ts +2 -2
- package/tokens/input.js +25 -26
- package/tokens/inputfile.d.ts +1 -1
- package/tokens/inputfile.js +4 -4
- package/tokens/link.d.ts +5 -0
- package/tokens/loader.d.ts +3 -0
- package/tokens/loader.js +3 -0
- package/tokens/menu.d.ts +1 -0
- package/tokens/menu.js +1 -0
- package/tokens/modal.d.ts +6 -4
- package/tokens/modal.js +42 -60
- package/tokens/scroll.d.ts +19 -2
- package/tokens/scroll.js +23 -7
- package/tokens/select.d.ts +9 -7
- package/tokens/select.js +30 -29
- package/tokens/snackbar.d.ts +36 -20
- package/tokens/snackbar.js +92 -93
- package/tokens/stepper.d.ts +1 -1
- package/tokens/stepper.js +3 -3
- package/tokens/tabs.d.ts +1 -1
- package/tokens/tabs.js +1 -1
- package/tokens/textarea.d.ts +4 -0
- package/tokens/tooltip.d.ts +5 -1
- package/tokens/tooltip.js +23 -21
- package/tokens/typography.js +114 -116
- package/tokens/values.d.ts +5 -1
- package/tokens/values.js +12 -8
- package/tokens/wrapper.d.ts +2 -2
- package/tokens/wrapper.js +7 -7
- package/tokens/zIndex.d.ts +9 -0
- package/tokens/zIndex.js +12 -0
- package/types/index.d.ts +0 -1
- package/types/styles.d.ts +1 -0
- package/utils/helpers.js +14 -15
- package/CHANGELOG.md +0 -177
- package/constants/positioning.d.ts +0 -9
- package/constants/positioning.js +0 -11
- package/types/chat.d.ts +0 -5
- package/types/chat.js +0 -4
|
@@ -1,40 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { ScrollStyled as V, ScrollBarsStyled as
|
|
5
|
-
import { ScrollBar as
|
|
6
|
-
import { COMPONENT_NAME as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import { useAnimationFrame as
|
|
9
|
-
const
|
|
10
|
-
const [
|
|
11
|
-
theme:
|
|
12
|
-
} =
|
|
13
|
-
vertical:
|
|
14
|
-
horizontal:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { jsxs as g, jsx as i } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as _, useState as n, useRef as v, useCallback as x, useEffect as O, useImperativeHandle as R } from "react";
|
|
4
|
+
import { ScrollStyled as V, ScrollBarsStyled as C, ScrollContentStyled as W } from "./ScrollStyled.js";
|
|
5
|
+
import { ScrollBar as H } from "./ScrollBar.js";
|
|
6
|
+
import { AUTO_HIDE_TS as j, COMPONENT_NAME as a, ANIMATION_FRAME_TS as B } from "./constants.js";
|
|
7
|
+
import { useTheme as F } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
import { useAnimationFrame as L } from "../../../utils/animationFrame.js";
|
|
9
|
+
const J = _((N, u) => {
|
|
10
|
+
const [d, w] = n(!1), [f, E] = n(!1), [m, h] = n(!1), r = v(null), l = v(null), {
|
|
11
|
+
theme: o
|
|
12
|
+
} = F(), {
|
|
13
|
+
vertical: A = "auto",
|
|
14
|
+
horizontal: S = "auto",
|
|
15
|
+
autoHide: e = !1,
|
|
16
|
+
children: M,
|
|
17
|
+
...y
|
|
18
|
+
} = N, b = (t, s) => {
|
|
19
|
+
switch (t) {
|
|
20
|
+
case "visible":
|
|
21
|
+
return !0;
|
|
22
|
+
case "hidden":
|
|
23
|
+
return !1;
|
|
24
|
+
default:
|
|
25
|
+
return s;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
L(() => {
|
|
29
|
+
if (!r.current)
|
|
20
30
|
return;
|
|
21
31
|
const {
|
|
22
|
-
clientHeight:
|
|
23
|
-
scrollHeight:
|
|
24
|
-
clientWidth:
|
|
25
|
-
scrollWidth:
|
|
26
|
-
} =
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
clientHeight: t,
|
|
33
|
+
scrollHeight: s,
|
|
34
|
+
clientWidth: z,
|
|
35
|
+
scrollWidth: I
|
|
36
|
+
} = r.current, T = b(A, Math.ceil(t / s * 100) < 100), p = b(S, Math.ceil(z / I * 100) < 100);
|
|
37
|
+
T !== d && w(T), p !== f && E(p);
|
|
38
|
+
}, B);
|
|
39
|
+
const c = x(() => {
|
|
40
|
+
e && (h(!0), l.current && clearTimeout(l.current), l.current = setTimeout(() => {
|
|
41
|
+
h(!1);
|
|
42
|
+
}, j));
|
|
43
|
+
}, [e]);
|
|
44
|
+
return O(() => {
|
|
45
|
+
const t = r.current;
|
|
46
|
+
if (!(!t || !e))
|
|
47
|
+
return t.addEventListener("scroll", c), () => {
|
|
48
|
+
t.removeEventListener("scroll", c), l.current && clearTimeout(l.current);
|
|
49
|
+
};
|
|
50
|
+
}, [e, c]), R(u, () => r.current, []), /* @__PURE__ */ g(V, { className: "gd-scroll", ref: r, theme: o, ...y, "data-testid": a, children: [
|
|
51
|
+
/* @__PURE__ */ g(C, { className: "gd-scroll--scrollbars", theme: o, "data-testid": `${a}-scrollbars`, children: [
|
|
52
|
+
d && /* @__PURE__ */ i(H, { direction: "vertical", containerRef: r, autoHide: e, isScrolling: m }),
|
|
53
|
+
f && /* @__PURE__ */ i(H, { direction: "horizontal", containerRef: r, autoHide: e, isScrolling: m })
|
|
32
54
|
] }),
|
|
33
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ i(W, { ref: u, className: "gd-scroll--content", theme: o, style: S === "hidden" ? {
|
|
34
56
|
maxWidth: "100%"
|
|
35
|
-
} : void 0, "data-testid": `${
|
|
57
|
+
} : void 0, "data-testid": `${a}-content`, children: M })
|
|
36
58
|
] });
|
|
37
59
|
});
|
|
38
60
|
export {
|
|
39
|
-
|
|
61
|
+
J as Scroll
|
|
40
62
|
};
|
|
@@ -5,10 +5,13 @@ export type ScrollBarPosition = 'hidden' | 'visible' | 'auto';
|
|
|
5
5
|
export interface ScrollProps extends PropsWithChildren<CommonCssComponentProps> {
|
|
6
6
|
vertical?: ScrollBarPosition;
|
|
7
7
|
horizontal?: ScrollBarPosition;
|
|
8
|
+
autoHide?: boolean;
|
|
8
9
|
}
|
|
9
10
|
export interface ScrollBarProps extends CommonCssComponentProps {
|
|
10
11
|
direction?: ScrollDirection;
|
|
11
12
|
containerRef?: RefObject<HTMLElement>;
|
|
13
|
+
autoHide?: boolean;
|
|
14
|
+
isScrolling?: boolean;
|
|
12
15
|
}
|
|
13
16
|
export interface ScrollStyledProps extends PropsWithChildren<CommonCssComponentStyledProps> {
|
|
14
17
|
$vertical?: ScrollBarPosition;
|
|
@@ -16,4 +19,6 @@ export interface ScrollStyledProps extends PropsWithChildren<CommonCssComponentS
|
|
|
16
19
|
}
|
|
17
20
|
export interface ScrollBarStyledProps extends CommonCssComponentStyledProps {
|
|
18
21
|
$direction?: ScrollDirection;
|
|
22
|
+
$autoHide?: boolean;
|
|
23
|
+
$isScrolling?: boolean;
|
|
19
24
|
}
|
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { getThumbPosition as
|
|
5
|
-
import { SCROLL_BAR_ANIMATION_THROTTLE as
|
|
6
|
-
import { ScrollBarStyled as
|
|
7
|
-
import { useTheme as
|
|
8
|
-
import { useAnimationFrame as
|
|
9
|
-
const
|
|
2
|
+
import { jsx as v } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { useRef as A, useEffect as x } from "react";
|
|
4
|
+
import { getThumbPosition as C } from "./utils.js";
|
|
5
|
+
import { SCROLL_BAR_ANIMATION_THROTTLE as M, COMPONENT_NAME as E } from "./constants.js";
|
|
6
|
+
import { ScrollBarStyled as D, ScrollBarThumbStyled as I } from "./ScrollStyled.js";
|
|
7
|
+
import { useTheme as R } from "../../../hooks/useTheme/useTheme.js";
|
|
8
|
+
import { useAnimationFrame as V } from "../../../utils/animationFrame.js";
|
|
9
|
+
const q = (S) => {
|
|
10
10
|
const {
|
|
11
|
-
direction:
|
|
12
|
-
containerRef: t
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
direction: r,
|
|
12
|
+
containerRef: t,
|
|
13
|
+
autoHide: c = !1,
|
|
14
|
+
isScrolling: u = !1
|
|
15
|
+
} = S, s = A(null), {
|
|
16
|
+
theme: m
|
|
17
|
+
} = R();
|
|
18
|
+
return V(() => {
|
|
19
|
+
const o = t != null && t.current ? C(t.current, r) : {
|
|
18
20
|
position: 0,
|
|
19
21
|
size: 0
|
|
20
22
|
};
|
|
21
|
-
s.current && (
|
|
22
|
-
},
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
23
|
+
s.current && (r === "vertical" ? (s.current.style.top = `${o.position}%`, s.current.style.height = `${o.size}%`) : (s.current.style.left = `${o.position}%`, s.current.style.width = `${o.size}%`));
|
|
24
|
+
}, M), x(() => {
|
|
25
|
+
const o = s.current;
|
|
26
|
+
if (!o)
|
|
25
27
|
return;
|
|
26
|
-
let
|
|
27
|
-
const
|
|
28
|
+
let d = 0, a = 0;
|
|
29
|
+
const _ = ({
|
|
28
30
|
clientY: e
|
|
29
31
|
}, {
|
|
30
32
|
top: n,
|
|
31
33
|
height: l
|
|
32
|
-
}) => (e - n) / l,
|
|
34
|
+
}) => (e - n) / l, H = ({
|
|
33
35
|
clientX: e
|
|
34
36
|
}, {
|
|
35
37
|
left: n,
|
|
36
38
|
width: l
|
|
37
39
|
}) => (e - n) / l, N = (e, n, l) => {
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
+
const h = o.parentElement, i = t == null ? void 0 : t.current;
|
|
41
|
+
if (!h || !i)
|
|
40
42
|
return [0, 0];
|
|
41
43
|
const {
|
|
42
|
-
offsetHeight:
|
|
43
|
-
offsetWidth:
|
|
44
|
-
} =
|
|
44
|
+
offsetHeight: $,
|
|
45
|
+
offsetWidth: b
|
|
46
|
+
} = o, {
|
|
45
47
|
top: O,
|
|
46
|
-
left:
|
|
47
|
-
height:
|
|
48
|
-
width:
|
|
49
|
-
} =
|
|
50
|
-
return [
|
|
51
|
-
}, d = (e) => {
|
|
52
|
-
const [n, l] = N(e, u, m);
|
|
53
|
-
t != null && t.current && (o === "vertical" ? t.current.scrollTop = n : t.current.scrollLeft = l);
|
|
54
|
-
}, p = () => {
|
|
55
|
-
document.removeEventListener("pointermove", d), document.removeEventListener("pointerup", p);
|
|
48
|
+
left: w,
|
|
49
|
+
height: L,
|
|
50
|
+
width: T
|
|
51
|
+
} = h.getBoundingClientRect(), y = i.scrollHeight - L, B = i.scrollWidth - T, P = (e.clientY - O - $ * n) / (L - $), z = (e.clientX - w - b * l) / (T - b);
|
|
52
|
+
return [y * P, B * z];
|
|
56
53
|
}, f = (e) => {
|
|
54
|
+
const [n, l] = N(e, d, a);
|
|
55
|
+
t != null && t.current && (r === "vertical" ? t.current.scrollTop = n : t.current.scrollLeft = l);
|
|
56
|
+
}, p = () => {
|
|
57
|
+
document.removeEventListener("pointermove", f), document.removeEventListener("pointerup", p);
|
|
58
|
+
}, g = (e) => {
|
|
57
59
|
e.stopPropagation(), e.preventDefault();
|
|
58
|
-
const n =
|
|
59
|
-
|
|
60
|
+
const n = o.getBoundingClientRect();
|
|
61
|
+
d = _(e, n), a = H(e, n), document.addEventListener("pointermove", f), document.addEventListener("pointerup", p);
|
|
60
62
|
};
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
+
return o.addEventListener("pointerdown", g), () => {
|
|
64
|
+
o.removeEventListener("pointerdown", g);
|
|
63
65
|
};
|
|
64
|
-
}, [t, s,
|
|
66
|
+
}, [t, s, r]), /* @__PURE__ */ v(D, { className: `gd-scroll--scrollbar gd-scroll--scrollbar__${r}`, $direction: r, $autoHide: c, $isScrolling: u, theme: m, "data-testid": `${E}-scrollbar_${r}`, children: /* @__PURE__ */ v(I, { className: `gd-scroll--scrollbar-thumb gd-scroll--scrollbar-thumb__${r}`, ref: s, $direction: r, $autoHide: c, $isScrolling: u, theme: m, "data-testid": `${E}-scrollbar-thumb_${r}` }) });
|
|
65
67
|
};
|
|
66
68
|
export {
|
|
67
|
-
|
|
69
|
+
q as ScrollBar
|
|
68
70
|
};
|
|
@@ -1,62 +1,66 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { tokensHandler as
|
|
5
|
-
import { get as
|
|
6
|
-
const
|
|
2
|
+
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
3
|
+
import { forwardRef as S } from "react";
|
|
4
|
+
import { tokensHandler as u } from "../../../tokens/utils.js";
|
|
5
|
+
import { get as t } from "../../../utils/helpers.js";
|
|
6
|
+
const b = S((s, l) => {
|
|
7
7
|
const {
|
|
8
8
|
theme: {
|
|
9
|
-
scroll:
|
|
10
|
-
...
|
|
9
|
+
scroll: e,
|
|
10
|
+
...o
|
|
11
11
|
} = {},
|
|
12
|
-
styles:
|
|
13
|
-
...
|
|
14
|
-
} =
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
}),
|
|
12
|
+
styles: c = {},
|
|
13
|
+
...n
|
|
14
|
+
} = s, d = new Proxy(e || {}, u(o)), r = [t(d, "container.default", {}), c];
|
|
15
|
+
return /* @__PURE__ */ i("div", { css: r, ...n, ref: l });
|
|
16
|
+
}), P = S((s, l) => {
|
|
17
17
|
const {
|
|
18
18
|
theme: {
|
|
19
|
-
scroll:
|
|
20
|
-
...
|
|
19
|
+
scroll: e,
|
|
20
|
+
...o
|
|
21
21
|
} = {},
|
|
22
|
-
styles:
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
}),
|
|
22
|
+
styles: c = {},
|
|
23
|
+
...n
|
|
24
|
+
} = s, d = new Proxy(e || {}, u(o)), r = [t(d, "content.default", {}), c];
|
|
25
|
+
return /* @__PURE__ */ i("div", { css: r, ...n, ref: l });
|
|
26
|
+
}), $ = (s) => {
|
|
27
27
|
const {
|
|
28
28
|
theme: {
|
|
29
|
-
scroll:
|
|
30
|
-
...
|
|
29
|
+
scroll: l,
|
|
30
|
+
...e
|
|
31
31
|
} = {},
|
|
32
|
-
...
|
|
33
|
-
} =
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
}, x = (
|
|
32
|
+
...o
|
|
33
|
+
} = s, c = new Proxy(l || {}, u(e)), n = t(c, "scrollbars.default", {});
|
|
34
|
+
return /* @__PURE__ */ i("div", { css: n, ...o });
|
|
35
|
+
}, x = (s) => {
|
|
36
36
|
const {
|
|
37
|
-
$direction:
|
|
37
|
+
$direction: l,
|
|
38
|
+
$autoHide: e,
|
|
39
|
+
$isScrolling: o,
|
|
38
40
|
theme: {
|
|
39
|
-
scroll:
|
|
40
|
-
...
|
|
41
|
+
scroll: c,
|
|
42
|
+
...n
|
|
41
43
|
} = {},
|
|
42
|
-
...
|
|
43
|
-
} =
|
|
44
|
-
return /* @__PURE__ */
|
|
45
|
-
},
|
|
44
|
+
...d
|
|
45
|
+
} = s, r = new Proxy(c || {}, u(n)), m = [t(r, "scrollbar.default", {}), t(r, `scrollbar.${l}`, {}), e && t(r, "scrollbar.autoHide", {}), e && o && t(r, "scrollbar.autoHideScrolling", {})];
|
|
46
|
+
return /* @__PURE__ */ i("div", { css: m, ...d });
|
|
47
|
+
}, H = S((s, l) => {
|
|
46
48
|
const {
|
|
47
|
-
$direction:
|
|
49
|
+
$direction: e,
|
|
50
|
+
$autoHide: o,
|
|
51
|
+
$isScrolling: c,
|
|
48
52
|
theme: {
|
|
49
|
-
scroll:
|
|
50
|
-
...
|
|
53
|
+
scroll: n,
|
|
54
|
+
...d
|
|
51
55
|
} = {},
|
|
52
|
-
...
|
|
53
|
-
} =
|
|
54
|
-
return /* @__PURE__ */
|
|
56
|
+
...r
|
|
57
|
+
} = s, m = new Proxy(n || {}, u(d)), a = [t(m, "thumb.default", {}), t(m, `thumb.${e}`, {}), o && t(m, "thumb.autoHide", {}), o && c && t(m, "thumb.autoHideScrolling", {})];
|
|
58
|
+
return /* @__PURE__ */ i("div", { css: a, ...r, ref: l });
|
|
55
59
|
});
|
|
56
60
|
export {
|
|
57
61
|
x as ScrollBarStyled,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
H as ScrollBarThumbStyled,
|
|
63
|
+
$ as ScrollBarsStyled,
|
|
64
|
+
P as ScrollContentStyled,
|
|
65
|
+
b as ScrollStyled
|
|
62
66
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
const
|
|
1
|
+
const T = "Scroll", _ = 24, A = 50, N = 300, o = 1e3;
|
|
2
2
|
export {
|
|
3
|
-
N as
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
N as ANIMATION_FRAME_TS,
|
|
4
|
+
o as AUTO_HIDE_TS,
|
|
5
|
+
T as COMPONENT_NAME,
|
|
6
|
+
_ as MIN_WIDTH,
|
|
7
|
+
A as SCROLL_BAR_ANIMATION_THROTTLE
|
|
6
8
|
};
|