@caseparts-org/caseblocks 0.0.139 → 0.0.141
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { HideAtProps } from '../HideAt';
|
|
3
|
+
export interface HorizontalScrollProps extends PropsWithChildren, HideAtProps {
|
|
3
4
|
className?: string;
|
|
4
5
|
childrenContainerClassName?: string;
|
|
5
6
|
childrenSpacing?: number | string;
|
|
@@ -13,4 +14,5 @@ export interface HorizontalScrollProps extends PropsWithChildren {
|
|
|
13
14
|
showIndicators?: boolean;
|
|
14
15
|
hideHeader?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare function HorizontalScroll({ className, childrenContainerClassName, childrenSpacing, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerContainerClassName, headerClassName, showIndicators, hideHeader,
|
|
17
|
+
export declare function HorizontalScroll({ className, childrenContainerClassName, childrenSpacing, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerContainerClassName, headerClassName, showIndicators, hideHeader, // new default
|
|
18
|
+
hideAt }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
-
import { jsxs as d, jsx as l, Fragment as
|
|
1
|
+
import { jsxs as d, jsx as l, Fragment as K } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as g, useState as h, useEffect as m } from "react";
|
|
3
|
-
import { Icon as
|
|
4
|
-
import { Text as
|
|
3
|
+
import { Icon as S } from "../Icon/Icon.js";
|
|
4
|
+
import { Text as q } from "../Text/Text.js";
|
|
5
5
|
import { c as i } from "../../clsx-OuTLNxxd.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
import { getHideAtStyles as G } from "../HideAt.js";
|
|
7
|
+
import '../../assets/HorizontalScroll.css';const I = "_root_1565i_1", U = "_header_1565i_5", $ = "_caption_1565i_13", J = "_controls_1565i_21", Q = "_controlBtn_1565i_26", Z = "_container_1565i_45", tt = "_dragging_1565i_58", et = "_noOverflow_1565i_61", rt = "_viewport_1565i_74", nt = "_indicator_1565i_77", ot = "_left_1565i_87", lt = "_right_1565i_93", it = "_hidden_1565i_99", e = {
|
|
8
|
+
root: I,
|
|
9
|
+
header: U,
|
|
10
|
+
caption: $,
|
|
11
|
+
controls: J,
|
|
12
|
+
controlBtn: Q,
|
|
13
|
+
container: Z,
|
|
14
|
+
dragging: tt,
|
|
15
|
+
noOverflow: et,
|
|
15
16
|
"scrollVisibility--false": "_scrollVisibility--false_1565i_66",
|
|
16
|
-
viewport:
|
|
17
|
-
indicator:
|
|
18
|
-
left:
|
|
19
|
-
right:
|
|
20
|
-
hidden:
|
|
17
|
+
viewport: rt,
|
|
18
|
+
indicator: nt,
|
|
19
|
+
left: ot,
|
|
20
|
+
right: lt,
|
|
21
|
+
hidden: it
|
|
21
22
|
};
|
|
22
|
-
function
|
|
23
|
-
className:
|
|
23
|
+
function _t({
|
|
24
|
+
className: N,
|
|
24
25
|
childrenContainerClassName: E,
|
|
25
26
|
childrenSpacing: C,
|
|
26
27
|
showScrollbar: D = !1,
|
|
@@ -31,24 +32,25 @@ function ft({
|
|
|
31
32
|
rightButtonContent: O,
|
|
32
33
|
headerContainerClassName: B,
|
|
33
34
|
headerClassName: M,
|
|
34
|
-
showIndicators:
|
|
35
|
-
hideHeader:
|
|
35
|
+
showIndicators: A = !0,
|
|
36
|
+
hideHeader: P = !1,
|
|
36
37
|
// new default
|
|
38
|
+
hideAt: R
|
|
37
39
|
}) {
|
|
38
|
-
const n = g(null), [b, x] = h(!1), c = g({ x: 0, scroll: 0 }), u = g(!1), X = 5, [_, k] = h(!0), [v,
|
|
40
|
+
const n = g(null), [b, x] = h(!1), c = g({ x: 0, scroll: 0 }), u = g(!1), X = 5, [_, k] = h(!0), [v, H] = h(!1), [s, T] = h(!1), a = () => {
|
|
39
41
|
const t = n.current;
|
|
40
42
|
if (!t) return;
|
|
41
43
|
const r = t.scrollWidth - t.clientWidth;
|
|
42
|
-
|
|
43
|
-
}, T = (t) => {
|
|
44
|
-
!n.current || !s || (x(!0), c.current.x = t.clientX, c.current.scroll = n.current.scrollLeft, u.current = !1);
|
|
44
|
+
T(t.scrollWidth > t.clientWidth + 1), k(t.scrollLeft <= 0), H(t.scrollLeft >= r - 1);
|
|
45
45
|
}, V = (t) => {
|
|
46
|
+
!n.current || !s || (x(!0), c.current.x = t.clientX, c.current.scroll = n.current.scrollLeft, u.current = !1);
|
|
47
|
+
}, Y = (t) => {
|
|
46
48
|
if (!b || !n.current) return;
|
|
47
49
|
const r = t.clientX - c.current.x;
|
|
48
50
|
n.current.scrollLeft = c.current.scroll - r, Math.abs(t.clientX - c.current.x) > X && (u.current = !0);
|
|
49
51
|
}, y = () => {
|
|
50
52
|
n.current && x(!1);
|
|
51
|
-
},
|
|
53
|
+
}, j = (t) => {
|
|
52
54
|
u.current && (t.preventDefault(), t.stopPropagation(), u.current = !1);
|
|
53
55
|
}, w = (t) => {
|
|
54
56
|
const r = n.current;
|
|
@@ -75,10 +77,10 @@ function ft({
|
|
|
75
77
|
const r = new ResizeObserver(() => a());
|
|
76
78
|
return r.observe(t), () => r.disconnect();
|
|
77
79
|
}, []);
|
|
78
|
-
const
|
|
79
|
-
return /* @__PURE__ */ d("div", { className: i(e.root,
|
|
80
|
-
!
|
|
81
|
-
|
|
80
|
+
const F = () => f == null ? null : typeof f == "string" ? /* @__PURE__ */ l(q, { variant: "display", size: "2xl", className: i(M, e.caption), children: f }) : f;
|
|
81
|
+
return /* @__PURE__ */ d("div", { className: i(e.root, N, G(R)), children: [
|
|
82
|
+
!P && /* @__PURE__ */ d("div", { className: i(B, e.header), children: [
|
|
83
|
+
F(),
|
|
82
84
|
s && /* @__PURE__ */ d("div", { className: e.controls, children: [
|
|
83
85
|
/* @__PURE__ */ l(
|
|
84
86
|
"button",
|
|
@@ -89,7 +91,7 @@ function ft({
|
|
|
89
91
|
"aria-label": "Scroll left",
|
|
90
92
|
disabled: _,
|
|
91
93
|
"aria-disabled": _,
|
|
92
|
-
children: z ?? /* @__PURE__ */ l(
|
|
94
|
+
children: z ?? /* @__PURE__ */ l(S, { iconKey: "fa-regular fa-chevron-left", size: "sm" })
|
|
93
95
|
}
|
|
94
96
|
),
|
|
95
97
|
/* @__PURE__ */ l(
|
|
@@ -101,7 +103,7 @@ function ft({
|
|
|
101
103
|
"aria-label": "Scroll right",
|
|
102
104
|
disabled: v,
|
|
103
105
|
"aria-disabled": v,
|
|
104
|
-
children: O ?? /* @__PURE__ */ l(
|
|
106
|
+
children: O ?? /* @__PURE__ */ l(S, { iconKey: "fa-regular fa-chevron-right", size: "sm" })
|
|
105
107
|
}
|
|
106
108
|
)
|
|
107
109
|
] })
|
|
@@ -119,15 +121,15 @@ function ft({
|
|
|
119
121
|
!s && e.noOverflow,
|
|
120
122
|
E
|
|
121
123
|
),
|
|
122
|
-
onPointerDown:
|
|
123
|
-
onPointerMove:
|
|
124
|
+
onPointerDown: V,
|
|
125
|
+
onPointerMove: Y,
|
|
124
126
|
onPointerLeave: y,
|
|
125
127
|
onPointerUp: y,
|
|
126
|
-
onClickCapture:
|
|
128
|
+
onClickCapture: j,
|
|
127
129
|
children: W
|
|
128
130
|
}
|
|
129
131
|
),
|
|
130
|
-
|
|
132
|
+
A && /* @__PURE__ */ d(K, { children: [
|
|
131
133
|
/* @__PURE__ */ l(
|
|
132
134
|
"div",
|
|
133
135
|
{
|
|
@@ -153,5 +155,5 @@ function ft({
|
|
|
153
155
|
] });
|
|
154
156
|
}
|
|
155
157
|
export {
|
|
156
|
-
|
|
158
|
+
_t as HorizontalScroll
|
|
157
159
|
};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { HideAtProps } from '../HideAt';
|
|
2
|
-
type IconSet = "fa-kit" | "fa-solid" | "fa-regular" | "fa-light" | "fa-thin" | "fa-brands";
|
|
3
|
-
type IconVariant = "fa-sharp" | "fa-duotone" | "fa-sharp-duotone";
|
|
4
|
-
type IconColorToken = "inherit" | "default" | "default-inverted" | "secondary" | "warning" | "error-warning" | "success";
|
|
5
|
-
interface IconProps extends React.HTMLAttributes<HTMLSpanElement>, HideAtProps {
|
|
2
|
+
export type IconSet = "fa-kit" | "fa-solid" | "fa-regular" | "fa-light" | "fa-thin" | "fa-brands";
|
|
3
|
+
export type IconVariant = "fa-sharp" | "fa-duotone" | "fa-sharp-duotone";
|
|
4
|
+
export type IconColorToken = "inherit" | "default" | "default-inverted" | "secondary" | "warning" | "error-warning" | "success";
|
|
5
|
+
export interface IconProps extends React.HTMLAttributes<HTMLSpanElement>, HideAtProps {
|
|
6
6
|
iconKey: `${IconSet} ${string}` | `${IconVariant} ${IconSet} ${string}`;
|
|
7
7
|
size?: "sm" | "md" | "lg";
|
|
8
8
|
colorToken?: IconColorToken;
|
|
9
9
|
}
|
|
10
10
|
export declare function Icon({ iconKey, size, hideAt, className, colorToken, ...otherProps }: IconProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
package/dist/main-server.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { Grid, Column } from './atoms/Grid/Grid';
|
|
|
6
6
|
export type { GridProps, ColumnProps } from './atoms/Grid/Grid';
|
|
7
7
|
export { Head } from './atoms/Root/Head';
|
|
8
8
|
export { Icon } from './atoms/Icon/Icon';
|
|
9
|
+
export type { IconProps, IconColorToken, IconSet, IconVariant } from './atoms/Icon/Icon';
|
|
9
10
|
export { Root } from './atoms/Root/Root';
|
|
10
11
|
export { Separator } from './atoms/Separator/Separator';
|
|
11
12
|
export type { SeparatorProps } from './atoms/Separator/Separator';
|