@dbcdk/react-components 0.0.213 → 0.0.214

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.
@@ -11,11 +11,13 @@ var SidebarItems = require('../../../../components/sidebar/components/sidebar-it
11
11
  var SidenavFiltering = require('../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering');
12
12
  var SidebarProvider = require('../../../../components/sidebar/providers/SidebarProvider');
13
13
  var styles = require('./SidebarContainer.module.css');
14
+ var scrollbarStyles = require('../../../../styles/HoverScrollbar.module.css');
14
15
 
15
16
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
16
17
 
17
18
  var SidenavFiltering__default = /*#__PURE__*/_interopDefault(SidenavFiltering);
18
19
  var styles__default = /*#__PURE__*/_interopDefault(styles);
20
+ var scrollbarStyles__default = /*#__PURE__*/_interopDefault(scrollbarStyles);
19
21
 
20
22
  function clamp(n, min, max) {
21
23
  return Math.max(min, Math.min(max, n));
@@ -163,7 +165,7 @@ function SidebarContainer({
163
165
  {
164
166
  ref: containerRef,
165
167
  role: "complementary",
166
- className: `${styles__default.default.container} ${isSidebarCollapsed ? styles__default.default.collapsed : ""} ${isResizing ? styles__default.default.resizing : ""}`,
168
+ className: `${scrollbarStyles__default.default.region} ${scrollbarStyles__default.default.scrollArea} ${styles__default.default.container} ${isSidebarCollapsed ? styles__default.default.collapsed : ""} ${isResizing ? styles__default.default.resizing : ""}`,
167
169
  style: containerStyle,
168
170
  children: [
169
171
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.header, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.productHeader, children: [
@@ -184,9 +186,9 @@ function SidebarContainer({
184
186
  }
185
187
  )
186
188
  ] }) }),
187
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.content, children: [
189
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `${styles__default.default.content} ${scrollbarStyles__default.default.scrollArea}`, children: [
188
190
  !hideSearch && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.filter, children: /* @__PURE__ */ jsxRuntime.jsx(SidenavFiltering__default.default, { placeholder: searchPlaceholder, showSettings }) }),
189
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.links, children: /* @__PURE__ */ jsxRuntime.jsx(SidebarItems.SidebarItems, { activeLink }) })
191
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: `${styles__default.default.links} ${scrollbarStyles__default.default.scrollArea}`, children: /* @__PURE__ */ jsxRuntime.jsx(SidebarItems.SidebarItems, { activeLink }) })
190
192
  ] }),
191
193
  footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.footerSlot, children: footer }),
192
194
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.footer, children: [
@@ -9,6 +9,7 @@ import { SidebarItems } from '../../../../components/sidebar/components/sidebar-
9
9
  import SidenavFiltering from '../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering';
10
10
  import { useSidebar } from '../../../../components/sidebar/providers/SidebarProvider';
11
11
  import styles from './SidebarContainer.module.css';
12
+ import scrollbarStyles from '../../../../styles/HoverScrollbar.module.css';
12
13
 
13
14
  function clamp(n, min, max) {
14
15
  return Math.max(min, Math.min(max, n));
@@ -156,7 +157,7 @@ function SidebarContainer({
156
157
  {
157
158
  ref: containerRef,
158
159
  role: "complementary",
159
- className: `${styles.container} ${isSidebarCollapsed ? styles.collapsed : ""} ${isResizing ? styles.resizing : ""}`,
160
+ className: `${scrollbarStyles.region} ${scrollbarStyles.scrollArea} ${styles.container} ${isSidebarCollapsed ? styles.collapsed : ""} ${isResizing ? styles.resizing : ""}`,
160
161
  style: containerStyle,
161
162
  children: [
162
163
  /* @__PURE__ */ jsx("div", { className: styles.header, children: /* @__PURE__ */ jsxs("div", { className: styles.productHeader, children: [
@@ -177,9 +178,9 @@ function SidebarContainer({
177
178
  }
178
179
  )
179
180
  ] }) }),
180
- /* @__PURE__ */ jsxs("div", { className: styles.content, children: [
181
+ /* @__PURE__ */ jsxs("div", { className: `${styles.content} ${scrollbarStyles.scrollArea}`, children: [
181
182
  !hideSearch && /* @__PURE__ */ jsx("div", { className: styles.filter, children: /* @__PURE__ */ jsx(SidenavFiltering, { placeholder: searchPlaceholder, showSettings }) }),
182
- /* @__PURE__ */ jsx("div", { className: styles.links, children: /* @__PURE__ */ jsx(SidebarItems, { activeLink }) })
183
+ /* @__PURE__ */ jsx("div", { className: `${styles.links} ${scrollbarStyles.scrollArea}`, children: /* @__PURE__ */ jsx(SidebarItems, { activeLink }) })
183
184
  ] }),
184
185
  footer && /* @__PURE__ */ jsx("div", { className: styles.footerSlot, children: footer }),
185
186
  /* @__PURE__ */ jsxs("div", { className: styles.footer, children: [
@@ -15,46 +15,6 @@
15
15
  inline-size var(--transition-fast) var(--ease-standard);
16
16
  }
17
17
 
18
- /* Keep native scrolling visible without competing with navigation content. */
19
- :is(.container, .content, .links) {
20
- scrollbar-width: thin;
21
- scrollbar-color: var(--color-border-subtle) transparent;
22
- }
23
-
24
- :is(.container, .content, .links):is(:hover, :focus-within) {
25
- scrollbar-color: var(--color-border-default) transparent;
26
- }
27
-
28
- /* Non-auto standard properties override WebKit thumb styling in Chromium. */
29
- @supports selector(::-webkit-scrollbar) {
30
- :is(.container, .content, .links),
31
- :is(.container, .content, .links):is(:hover, :focus-within) {
32
- scrollbar-width: auto;
33
- scrollbar-color: auto;
34
- }
35
- }
36
-
37
- :is(.container, .content, .links)::-webkit-scrollbar {
38
- width: calc(var(--spacing-xxs) + 2 * var(--border-width-thin));
39
- height: calc(var(--spacing-xxs) + 2 * var(--border-width-thin));
40
- }
41
-
42
- :is(.container, .content, .links)::-webkit-scrollbar-track {
43
- background: transparent;
44
- }
45
-
46
- :is(.container, .content, .links)::-webkit-scrollbar-thumb {
47
- background-color: var(--color-border-subtle);
48
- background-clip: padding-box;
49
- border: var(--border-width-thin) solid transparent;
50
- border-radius: var(--border-radius-default);
51
- }
52
-
53
- :is(.container, .content, .links)::-webkit-scrollbar-thumb:hover,
54
- :is(.container, .content, .links):focus-within::-webkit-scrollbar-thumb {
55
- background-color: var(--color-border-default);
56
- }
57
-
58
18
  .sidebarIcon {
59
19
  inline-size: var(--icon-size-sm);
60
20
  block-size: var(--icon-size-sm);
@@ -7,6 +7,7 @@ var Pagination = require('../../components/pagination/Pagination');
7
7
  var useViewportFill = require('../../hooks/useViewportFill');
8
8
  var refs_utils = require('../../utils/refs.utils');
9
9
  var columnLayout_utils = require('./columnLayout.utils');
10
+ var scrollbarStyles = require('../../styles/HoverScrollbar.module.css');
10
11
  var EmptyState = require('./components/empty-state/EmptyState');
11
12
  var TableHeaderSettings = require('./components/table-settings/TableHeaderSettings');
12
13
  var TableBody = require('./components/TableBody');
@@ -20,6 +21,7 @@ var tableSettings_utils = require('./tableSettings.utils');
20
21
 
21
22
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
22
23
 
24
+ var scrollbarStyles__default = /*#__PURE__*/_interopDefault(scrollbarStyles);
23
25
  var styles__default = /*#__PURE__*/_interopDefault(styles);
24
26
 
25
27
  const DEFAULT_SKELETON_ROWS = 10;
@@ -211,6 +213,7 @@ function Table({
211
213
  ) : null;
212
214
  const tableClassName = table_classes.cx(
213
215
  styles__default.default.tableRoot,
216
+ scrollbarStyles__default.default.region,
214
217
  styles__default.default[variant],
215
218
  styles__default.default[size],
216
219
  (measuringLayout || distributeWidths && !distributedLayout) && styles__default.default.measuringLayout,
@@ -222,7 +225,7 @@ function Table({
222
225
  "div",
223
226
  {
224
227
  ref: setTableRootRef,
225
- className: styles__default.default.tableScroll,
228
+ className: table_classes.cx(styles__default.default.tableScroll, scrollbarStyles__default.default.scrollArea),
226
229
  style: fillViewportActive ? viewportFillStyle : !containScrolling ? { overflow: "visible" } : void 0,
227
230
  children: !loading && !data.length ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.emptyStateSlot, children: /* @__PURE__ */ jsxRuntime.jsx(EmptyState.TableEmptyState, { config: emptyConfig }) }) : /* @__PURE__ */ jsxRuntime.jsxs(
228
231
  "table",
@@ -5,6 +5,7 @@ import { Pagination } from '../../components/pagination/Pagination';
5
5
  import { useViewportFill } from '../../hooks/useViewportFill';
6
6
  import { mergeRefs } from '../../utils/refs.utils';
7
7
  import { usesDistributedWidths, distributeColumnWidths, buildColumnTracks } from './columnLayout.utils';
8
+ import scrollbarStyles from '../../styles/HoverScrollbar.module.css';
8
9
  import { TableEmptyState } from './components/empty-state/EmptyState';
9
10
  import { TableHeaderSettings } from './components/table-settings/TableHeaderSettings';
10
11
  import { TableBody } from './components/TableBody';
@@ -205,6 +206,7 @@ function Table({
205
206
  ) : null;
206
207
  const tableClassName = cx(
207
208
  styles.tableRoot,
209
+ scrollbarStyles.region,
208
210
  styles[variant],
209
211
  styles[size],
210
212
  (measuringLayout || distributeWidths && !distributedLayout) && styles.measuringLayout,
@@ -216,7 +218,7 @@ function Table({
216
218
  "div",
217
219
  {
218
220
  ref: setTableRootRef,
219
- className: styles.tableScroll,
221
+ className: cx(styles.tableScroll, scrollbarStyles.scrollArea),
220
222
  style: fillViewportActive ? viewportFillStyle : !containScrolling ? { overflow: "visible" } : void 0,
221
223
  children: !loading && !data.length ? /* @__PURE__ */ jsx("div", { className: styles.emptyStateSlot, children: /* @__PURE__ */ jsx(TableEmptyState, { config: emptyConfig }) }) : /* @__PURE__ */ jsxs(
222
224
  "table",
@@ -0,0 +1,46 @@
1
+ /* Put region on the hover/focus boundary and scrollArea on each native scroller.
2
+ They can share an element. Keep overflow, sizing and gutter policy with callers. */
3
+ .region {
4
+ --hover-scrollbar-thumb: transparent;
5
+ }
6
+
7
+ .region:is(:hover, :focus-within) {
8
+ --hover-scrollbar-thumb: var(--color-border-subtle);
9
+ }
10
+
11
+ .scrollArea {
12
+ /* Use the regular native width where explicit scrollbar sizing is unsupported. */
13
+ scrollbar-width: auto;
14
+ scrollbar-color: var(--hover-scrollbar-thumb, transparent) transparent;
15
+ }
16
+
17
+ /* Non-auto standard values suppress WebKit styling and can leave native
18
+ overlay scrollbars hidden until scrolling starts in Chromium/macOS. */
19
+ @supports selector(::-webkit-scrollbar) {
20
+ .scrollArea {
21
+ scrollbar-width: auto;
22
+ scrollbar-color: auto;
23
+ }
24
+ }
25
+
26
+ .scrollArea::-webkit-scrollbar {
27
+ width: var(--spacing-sm);
28
+ height: var(--spacing-sm);
29
+ }
30
+
31
+ .scrollArea::-webkit-scrollbar-track,
32
+ .scrollArea::-webkit-scrollbar-corner {
33
+ background: transparent;
34
+ }
35
+
36
+ .scrollArea::-webkit-scrollbar-thumb {
37
+ background-color: var(--hover-scrollbar-thumb, transparent);
38
+ background-clip: padding-box;
39
+ /* A 12px track with 3px transparent edges leaves a 6px visible thumb. */
40
+ border: calc(var(--spacing-sm) / 4) solid transparent;
41
+ border-radius: var(--border-radius-md);
42
+ }
43
+
44
+ .scrollArea::-webkit-scrollbar-thumb:hover {
45
+ background-color: var(--color-border-default);
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.213",
3
+ "version": "0.0.214",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",