@dbcdk/react-components 0.0.128 → 0.0.130

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.
@@ -99,7 +99,7 @@ const PageLayoutBase = ({
99
99
  slots.Banner || envBanner ? styles__default.default.hasBanner : ""
100
100
  ].filter(Boolean).join(" ");
101
101
  const banner = (_b = slots.Banner) != null ? _b : envBanner;
102
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rootClass, children: [
102
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: rootClass, "data-contain-scrolling": containScrolling || void 0, children: [
103
103
  banner ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.banner, children: banner }) : null,
104
104
  slots.Sidebar ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.sidebar, children: slots.Sidebar }) : null,
105
105
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.mainColumn, children: [
@@ -93,7 +93,7 @@ const PageLayoutBase = ({
93
93
  slots.Banner || envBanner ? styles.hasBanner : ""
94
94
  ].filter(Boolean).join(" ");
95
95
  const banner = (_b = slots.Banner) != null ? _b : envBanner;
96
- return /* @__PURE__ */ jsxs("div", { className: rootClass, children: [
96
+ return /* @__PURE__ */ jsxs("div", { className: rootClass, "data-contain-scrolling": containScrolling || void 0, children: [
97
97
  banner ? /* @__PURE__ */ jsx("div", { className: styles.banner, children: banner }) : null,
98
98
  slots.Sidebar ? /* @__PURE__ */ jsx("div", { className: styles.sidebar, children: slots.Sidebar }) : null,
99
99
  /* @__PURE__ */ jsxs("div", { className: styles.mainColumn, children: [
@@ -1,3 +1,9 @@
1
+ /* When PageLayout owns scrolling, the body shouldn't reserve scrollbar gutter space.
2
+ This prevents the right-side gap that body { overflow-y: scroll } would otherwise create. */
3
+ :global(body):has([data-contain-scrolling]) {
4
+ overflow: hidden;
5
+ }
6
+
1
7
  /* Root shell */
2
8
  .root {
3
9
  width: 100%;
@@ -149,7 +155,7 @@
149
155
  }
150
156
 
151
157
  .vertical .content {
152
- padding: var(--spacing-lg) var(--spacing-md);
158
+ padding: var(--spacing-md);
153
159
  }
154
160
 
155
161
  .footer {
@@ -177,7 +177,7 @@ function TanstackTable(props) {
177
177
  dataKey,
178
178
  data: visibleData,
179
179
  columns: columnItems,
180
- tableWidth: distributedLayout == null ? void 0 : distributedLayout.totalWidth,
180
+ tableWidth: (distributedLayout == null ? void 0 : distributedLayout.shouldOverflow) ? distributedLayout.totalWidth : void 0,
181
181
  measuringLayout: !initialLayoutReady,
182
182
  sortById,
183
183
  sortDirection,
@@ -152,7 +152,7 @@ function TanstackTable(props) {
152
152
  dataKey,
153
153
  data: visibleData,
154
154
  columns: columnItems,
155
- tableWidth: distributedLayout == null ? void 0 : distributedLayout.totalWidth,
155
+ tableWidth: (distributedLayout == null ? void 0 : distributedLayout.shouldOverflow) ? distributedLayout.totalWidth : void 0,
156
156
  measuringLayout: !initialLayoutReady,
157
157
  sortById,
158
158
  sortDirection,
@@ -93,7 +93,14 @@ function toIntegerTrackWidths(tracks, targetWidth) {
93
93
  return Object.fromEntries(floored.map((track) => [track.id, track.width]));
94
94
  }
95
95
  function buildDistributedColumnWidths(args) {
96
- const { table, hasSelection, hasContextMenu, defaultMinPx, columnSizing, availableWidth } = args;
96
+ const {
97
+ table,
98
+ hasSelection,
99
+ hasContextMenu = false,
100
+ defaultMinPx,
101
+ columnSizing,
102
+ availableWidth
103
+ } = args;
97
104
  const leaf = table.getVisibleLeafColumns();
98
105
  const selectionWidth = hasSelection ? table_utils.SELECTION_COLUMN_PX : 0;
99
106
  const contextMenuWidth = hasContextMenu ? table_utils.CONTEXT_MENU_COLUMN_PX : 0;
@@ -155,15 +162,14 @@ function buildDistributedColumnWidths(args) {
155
162
  maxTrackWidth
156
163
  );
157
164
  const widths = toIntegerTrackWidths(tracks, targetTrackWidth);
158
- const totalWidth = Math.min(
159
- selectionWidth + contextMenuWidth + Object.values(widths).reduce((sum, width) => sum + width, 0),
160
- availableWidth
161
- );
165
+ const totalWidth = selectionWidth + contextMenuWidth + Object.values(widths).reduce((sum, width) => sum + width, 0);
162
166
  return {
163
167
  selectionWidth: hasSelection ? table_utils.SELECTION_COLUMN_PX : void 0,
164
168
  contextMenuWidth: hasContextMenu ? table_utils.CONTEXT_MENU_COLUMN_PX : void 0,
165
169
  widths,
166
- totalWidth
170
+ totalWidth,
171
+ availableWidth,
172
+ shouldOverflow: totalWidth > availableWidth
167
173
  };
168
174
  }
169
175
 
@@ -14,7 +14,7 @@ export declare function getSortPropsFromSorting(sorting: SortingState): {
14
14
  export declare function buildDistributedColumnWidths(args: {
15
15
  table: any;
16
16
  hasSelection: boolean;
17
- hasContextMenu: boolean;
17
+ hasContextMenu?: boolean;
18
18
  defaultMinPx: number;
19
19
  columnSizing: ColumnSizingState;
20
20
  availableWidth: number;
@@ -23,5 +23,7 @@ export declare function buildDistributedColumnWidths(args: {
23
23
  contextMenuWidth?: number;
24
24
  widths: Record<string, number>;
25
25
  totalWidth: number;
26
+ availableWidth: number;
27
+ shouldOverflow: boolean;
26
28
  };
27
29
  export {};
@@ -91,7 +91,14 @@ function toIntegerTrackWidths(tracks, targetWidth) {
91
91
  return Object.fromEntries(floored.map((track) => [track.id, track.width]));
92
92
  }
93
93
  function buildDistributedColumnWidths(args) {
94
- const { table, hasSelection, hasContextMenu, defaultMinPx, columnSizing, availableWidth } = args;
94
+ const {
95
+ table,
96
+ hasSelection,
97
+ hasContextMenu = false,
98
+ defaultMinPx,
99
+ columnSizing,
100
+ availableWidth
101
+ } = args;
95
102
  const leaf = table.getVisibleLeafColumns();
96
103
  const selectionWidth = hasSelection ? SELECTION_COLUMN_PX : 0;
97
104
  const contextMenuWidth = hasContextMenu ? CONTEXT_MENU_COLUMN_PX : 0;
@@ -153,15 +160,14 @@ function buildDistributedColumnWidths(args) {
153
160
  maxTrackWidth
154
161
  );
155
162
  const widths = toIntegerTrackWidths(tracks, targetTrackWidth);
156
- const totalWidth = Math.min(
157
- selectionWidth + contextMenuWidth + Object.values(widths).reduce((sum, width) => sum + width, 0),
158
- availableWidth
159
- );
163
+ const totalWidth = selectionWidth + contextMenuWidth + Object.values(widths).reduce((sum, width) => sum + width, 0);
160
164
  return {
161
165
  selectionWidth: hasSelection ? SELECTION_COLUMN_PX : void 0,
162
166
  contextMenuWidth: hasContextMenu ? CONTEXT_MENU_COLUMN_PX : void 0,
163
167
  widths,
164
- totalWidth
168
+ totalWidth,
169
+ availableWidth,
170
+ shouldOverflow: totalWidth > availableWidth
165
171
  };
166
172
  }
167
173
 
@@ -29,7 +29,7 @@ html {
29
29
  --dbc-neutral-900: light-dark(#1a1a1a, #f9fafb);
30
30
  --dbc-neutral-700: light-dark(#374151, #d1d5db);
31
31
  --dbc-neutral-600: light-dark(#5f6368, #9ca3af);
32
- --dbc-neutral-200: light-dark(#e5e7eb, #374151);
32
+ --dbc-neutral-200: light-dark(#e8eaee, #374151);
33
33
  --dbc-neutral-100: light-dark(#f3f4f6, #1f2937);
34
34
 
35
35
  /* Added fixed surface neutrals */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.128",
3
+ "version": "0.0.130",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",