@caseparts-org/caseblocks 0.0.135 → 0.0.136

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 +1 @@
1
- ._root_12m2a_1{width:100%}._header_12m2a_5{display:flex;align-items:center;justify-content:space-between;width:100%;gap:var(--spacing-spacing-2xs);margin-bottom:var(--spacing-spacing-2xs)}._controls_12m2a_13{display:flex;align-items:center;gap:var(--spacing-spacing-2xs)}._controlBtn_12m2a_18{cursor:pointer;padding:0;border:none;background-color:transparent;line-height:1;display:flex;align-items:center;justify-content:center}._controlBtn_12m2a_18:hover{color:var(--color-brand-primary-primary-teal-blue)}._controlBtn_12m2a_18:disabled:hover{cursor:default;color:var(--color-neutrals-neutral-3)}._container_12m2a_37{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;overflow-x:auto;width:100%;-webkit-overflow-scrolling:touch;cursor:grab;-webkit-user-select:none;user-select:none;overscroll-behavior:contain;touch-action:pan-x}._dragging_12m2a_50{cursor:grabbing}._noOverflow_12m2a_53{cursor:default}._scrollVisibility--false_12m2a_58{scrollbar-width:none;-ms-overflow-style:none}._scrollVisibility--false_12m2a_58::-webkit-scrollbar{display:none}._viewport_12m2a_66{position:relative}._indicator_12m2a_69{position:absolute;top:0;bottom:0;width:48px;pointer-events:none;opacity:1;transition:opacity .25s;z-index:1}._left_12m2a_79{left:0;background:linear-gradient(to right,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._right_12m2a_85{right:0;background:linear-gradient(to left,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._hidden_12m2a_91{opacity:0}
1
+ ._root_1565i_1{width:100%}._header_1565i_5{display:flex;align-items:center;justify-content:space-between;width:100%;gap:var(--spacing-spacing-2xs);margin-bottom:var(--spacing-spacing-2xs)}._caption_1565i_13{font-size:var(--font-size-2xl);line-height:var(--line-height-2xl)}@media (max-width:768px){._caption_1565i_13{font-size:var(--font-size-lg);line-height:var(--line-height-lg)}}._controls_1565i_21{display:flex;align-items:center;gap:var(--spacing-spacing-2xs)}._controlBtn_1565i_26{cursor:pointer;padding:0;border:none;background-color:transparent;line-height:1;display:flex;align-items:center;justify-content:center}._controlBtn_1565i_26:hover{color:var(--color-brand-primary-primary-teal-blue)}._controlBtn_1565i_26:disabled:hover{cursor:default;color:var(--color-neutrals-neutral-3)}._container_1565i_45{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;overflow-x:auto;width:100%;-webkit-overflow-scrolling:touch;cursor:grab;-webkit-user-select:none;user-select:none;overscroll-behavior:contain;touch-action:pan-x}._dragging_1565i_58{cursor:grabbing}._noOverflow_1565i_61{cursor:default}._scrollVisibility--false_1565i_66{scrollbar-width:none;-ms-overflow-style:none}._scrollVisibility--false_1565i_66::-webkit-scrollbar{display:none}._viewport_1565i_74{position:relative}._indicator_1565i_77{position:absolute;top:0;bottom:0;width:48px;pointer-events:none;opacity:1;transition:opacity .25s;z-index:1}._left_1565i_87{left:0;background:linear-gradient(to right,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._right_1565i_93{right:0;background:linear-gradient(to left,var(--horizontal-scroll-indicator-color, rgba(0,0,0,.15)) 0%,rgba(0,0,0,0) 100%)}._hidden_1565i_99{opacity:0}
@@ -8,8 +8,9 @@ export interface HorizontalScrollProps extends PropsWithChildren {
8
8
  scrollStep?: number;
9
9
  leftButtonContent?: ReactNode;
10
10
  rightButtonContent?: ReactNode;
11
+ headerContainerClassName?: string;
11
12
  headerClassName?: string;
12
13
  showIndicators?: boolean;
13
14
  hideHeader?: boolean;
14
15
  }
15
- export declare function HorizontalScroll({ className, childrenContainerClassName, childrenSpacing, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerClassName, showIndicators, hideHeader, }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function HorizontalScroll({ className, childrenContainerClassName, childrenSpacing, showScrollbar, children, caption, scrollStep, leftButtonContent, rightButtonContent, headerContainerClassName, headerClassName, showIndicators, hideHeader, }: HorizontalScrollProps): import("react/jsx-runtime").JSX.Element;
@@ -1,24 +1,25 @@
1
- import { jsxs as i, jsx as l, Fragment as j } from "react/jsx-runtime";
2
- import { useRef as v, useState as h, useEffect as g } from "react";
1
+ import { jsxs as d, jsx as l, Fragment as F } from "react/jsx-runtime";
2
+ import { useRef as g, useState as h, useEffect as m } from "react";
3
3
  import { Icon as N } from "../Icon/Icon.js";
4
- import { Text as F } from "../Text/Text.js";
5
- import { c as d } from "../../clsx-OuTLNxxd.js";
6
- import '../../assets/HorizontalScroll.css';const K = "_root_12m2a_1", q = "_header_12m2a_5", G = "_controls_12m2a_13", I = "_controlBtn_12m2a_18", U = "_container_12m2a_37", $ = "_dragging_12m2a_50", J = "_noOverflow_12m2a_53", Q = "_viewport_12m2a_66", Z = "_indicator_12m2a_69", tt = "_left_12m2a_79", et = "_right_12m2a_85", rt = "_hidden_12m2a_91", e = {
7
- root: K,
8
- header: q,
9
- controls: G,
10
- controlBtn: I,
11
- container: U,
12
- dragging: $,
13
- noOverflow: J,
14
- "scrollVisibility--false": "_scrollVisibility--false_12m2a_58",
15
- viewport: Q,
16
- indicator: Z,
17
- left: tt,
18
- right: et,
19
- hidden: rt
4
+ import { Text as K } from "../Text/Text.js";
5
+ import { c as i } from "../../clsx-OuTLNxxd.js";
6
+ import '../../assets/HorizontalScroll.css';const q = "_root_1565i_1", G = "_header_1565i_5", I = "_caption_1565i_13", U = "_controls_1565i_21", $ = "_controlBtn_1565i_26", J = "_container_1565i_45", Q = "_dragging_1565i_58", Z = "_noOverflow_1565i_61", tt = "_viewport_1565i_74", et = "_indicator_1565i_77", rt = "_left_1565i_87", nt = "_right_1565i_93", ot = "_hidden_1565i_99", e = {
7
+ root: q,
8
+ header: G,
9
+ caption: I,
10
+ controls: U,
11
+ controlBtn: $,
12
+ container: J,
13
+ dragging: Q,
14
+ noOverflow: Z,
15
+ "scrollVisibility--false": "_scrollVisibility--false_1565i_66",
16
+ viewport: tt,
17
+ indicator: et,
18
+ left: rt,
19
+ right: nt,
20
+ hidden: ot
20
21
  };
21
- function it({
22
+ function ft({
22
23
  className: S,
23
24
  childrenContainerClassName: E,
24
25
  childrenSpacing: C,
@@ -28,25 +29,26 @@ function it({
28
29
  scrollStep: p = 160,
29
30
  leftButtonContent: z,
30
31
  rightButtonContent: O,
31
- headerClassName: B,
32
- showIndicators: M = !0,
33
- hideHeader: P = !1
32
+ headerContainerClassName: B,
33
+ headerClassName: M,
34
+ showIndicators: P = !0,
35
+ hideHeader: R = !1
34
36
  // new default
35
37
  }) {
36
- const n = v(null), [b, x] = h(!1), s = v({ x: 0, scroll: 0 }), u = v(!1), R = 5, [m, X] = h(!0), [_, k] = h(!1), [c, A] = h(!1), a = () => {
38
+ const n = g(null), [b, x] = h(!1), c = g({ x: 0, scroll: 0 }), u = g(!1), X = 5, [_, k] = h(!0), [v, A] = h(!1), [s, H] = h(!1), a = () => {
37
39
  const t = n.current;
38
40
  if (!t) return;
39
41
  const r = t.scrollWidth - t.clientWidth;
40
- A(t.scrollWidth > t.clientWidth + 1), X(t.scrollLeft <= 0), k(t.scrollLeft >= r - 1);
41
- }, H = (t) => {
42
- !n.current || !c || (x(!0), s.current.x = t.clientX, s.current.scroll = n.current.scrollLeft, u.current = !1);
42
+ H(t.scrollWidth > t.clientWidth + 1), k(t.scrollLeft <= 0), A(t.scrollLeft >= r - 1);
43
43
  }, T = (t) => {
44
+ !n.current || !s || (x(!0), c.current.x = t.clientX, c.current.scroll = n.current.scrollLeft, u.current = !1);
45
+ }, V = (t) => {
44
46
  if (!b || !n.current) return;
45
- const r = t.clientX - s.current.x;
46
- n.current.scrollLeft = s.current.scroll - r, Math.abs(t.clientX - s.current.x) > R && (u.current = !0);
47
+ const r = t.clientX - c.current.x;
48
+ n.current.scrollLeft = c.current.scroll - r, Math.abs(t.clientX - c.current.x) > X && (u.current = !0);
47
49
  }, y = () => {
48
50
  n.current && x(!1);
49
- }, V = (t) => {
51
+ }, Y = (t) => {
50
52
  u.current && (t.preventDefault(), t.stopPropagation(), u.current = !1);
51
53
  }, w = (t) => {
52
54
  const r = n.current;
@@ -54,7 +56,7 @@ function it({
54
56
  const o = Math.max(0, Math.min(r.scrollLeft + t, r.scrollWidth - r.clientWidth));
55
57
  r.scrollTo({ left: o, behavior: "smooth" }), requestAnimationFrame(a);
56
58
  };
57
- g(() => {
59
+ m(() => {
58
60
  const t = n.current;
59
61
  if (!t) return;
60
62
  const r = (o) => {
@@ -63,21 +65,21 @@ function it({
63
65
  L !== 0 ? (o.preventDefault(), t.scrollLeft += L) : o.preventDefault();
64
66
  };
65
67
  return t.addEventListener("wheel", r, { passive: !1 }), () => t.removeEventListener("wheel", r);
66
- }, []), g(() => {
68
+ }, []), m(() => {
67
69
  const t = n.current;
68
70
  if (t)
69
71
  return a(), t.addEventListener("scroll", a), () => t.removeEventListener("scroll", a);
70
- }, []), g(() => {
72
+ }, []), m(() => {
71
73
  const t = n.current;
72
74
  if (!t || typeof ResizeObserver > "u") return;
73
75
  const r = new ResizeObserver(() => a());
74
76
  return r.observe(t), () => r.disconnect();
75
77
  }, []);
76
- const Y = () => f == null ? null : typeof f == "string" ? /* @__PURE__ */ l(F, { variant: "display", size: "2xl", className: e.caption, children: f }) : f;
77
- return /* @__PURE__ */ i("div", { className: d(e.root, S), children: [
78
- !P && /* @__PURE__ */ i("div", { className: d(e.header, B), children: [
79
- Y(),
80
- c && /* @__PURE__ */ i("div", { className: e.controls, children: [
78
+ const j = () => f == null ? null : typeof f == "string" ? /* @__PURE__ */ l(K, { variant: "display", size: "2xl", className: i(M, e.caption), children: f }) : f;
79
+ return /* @__PURE__ */ d("div", { className: i(e.root, S), children: [
80
+ !R && /* @__PURE__ */ d("div", { className: i(B, e.header), children: [
81
+ j(),
82
+ s && /* @__PURE__ */ d("div", { className: e.controls, children: [
81
83
  /* @__PURE__ */ l(
82
84
  "button",
83
85
  {
@@ -85,8 +87,8 @@ function it({
85
87
  className: e.controlBtn,
86
88
  onClick: () => w(-p),
87
89
  "aria-label": "Scroll left",
88
- disabled: m,
89
- "aria-disabled": m,
90
+ disabled: _,
91
+ "aria-disabled": _,
90
92
  children: z ?? /* @__PURE__ */ l(N, { iconKey: "fa-regular fa-chevron-left", size: "sm" })
91
93
  }
92
94
  ),
@@ -97,52 +99,52 @@ function it({
97
99
  className: e.controlBtn,
98
100
  onClick: () => w(p),
99
101
  "aria-label": "Scroll right",
100
- disabled: _,
101
- "aria-disabled": _,
102
+ disabled: v,
103
+ "aria-disabled": v,
102
104
  children: O ?? /* @__PURE__ */ l(N, { iconKey: "fa-regular fa-chevron-right", size: "sm" })
103
105
  }
104
106
  )
105
107
  ] })
106
108
  ] }),
107
- /* @__PURE__ */ i("div", { className: e.viewport, children: [
109
+ /* @__PURE__ */ d("div", { className: e.viewport, children: [
108
110
  /* @__PURE__ */ l(
109
111
  "div",
110
112
  {
111
113
  ref: n,
112
114
  style: { gap: C ?? "var(--spacing-spacing-3xs)" },
113
- className: d(
115
+ className: i(
114
116
  e.container,
115
117
  e[`scrollVisibility--${D}`],
116
118
  b ? e.dragging : "",
117
- !c && e.noOverflow,
119
+ !s && e.noOverflow,
118
120
  E
119
121
  ),
120
- onPointerDown: H,
121
- onPointerMove: T,
122
+ onPointerDown: T,
123
+ onPointerMove: V,
122
124
  onPointerLeave: y,
123
125
  onPointerUp: y,
124
- onClickCapture: V,
126
+ onClickCapture: Y,
125
127
  children: W
126
128
  }
127
129
  ),
128
- M && /* @__PURE__ */ i(j, { children: [
130
+ P && /* @__PURE__ */ d(F, { children: [
129
131
  /* @__PURE__ */ l(
130
132
  "div",
131
133
  {
132
- className: d(
134
+ className: i(
133
135
  e.indicator,
134
136
  e.left,
135
- (m || !c) && e.hidden
137
+ (_ || !s) && e.hidden
136
138
  )
137
139
  }
138
140
  ),
139
141
  /* @__PURE__ */ l(
140
142
  "div",
141
143
  {
142
- className: d(
144
+ className: i(
143
145
  e.indicator,
144
146
  e.right,
145
- (_ || !c) && e.hidden
147
+ (v || !s) && e.hidden
146
148
  )
147
149
  }
148
150
  )
@@ -151,5 +153,5 @@ function it({
151
153
  ] });
152
154
  }
153
155
  export {
154
- it as HorizontalScroll
156
+ ft as HorizontalScroll
155
157
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@caseparts-org/caseblocks",
3
3
  "private": false,
4
- "version": "0.0.135",
4
+ "version": "0.0.136",
5
5
  "type": "module",
6
6
  "module": "dist/main.js",
7
7
  "types": "dist/main.d.ts",