@dbcdk/react-components 0.0.108 → 0.0.109

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.
@@ -108,6 +108,9 @@
108
108
  padding-inline: var(--spacing-sm);
109
109
  }
110
110
 
111
+ .button.sm {
112
+ gap: var(--spacing-xxs);
113
+ }
111
114
  .button.sm svg {
112
115
  inline-size: var(--icon-size-sm);
113
116
  block-size: var(--icon-size-sm);
@@ -70,7 +70,10 @@
70
70
  --card-padding: var(--spacing-xl);
71
71
  }
72
72
 
73
- .md .content,
73
+ .md .content {
74
+ gap: var(--spacing-md);
75
+ }
76
+
74
77
  .lg .content {
75
78
  gap: var(--spacing-lg);
76
79
  }
@@ -30,7 +30,7 @@ function _interopNamespace(e) {
30
30
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
31
  var styles__default = /*#__PURE__*/_interopDefault(styles);
32
32
 
33
- const INTERACTIVE_SELECTOR = 'a:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"]), [role="menuitem"]:not([aria-disabled="true"]), [role="option"]:not([aria-disabled="true"])';
33
+ const INTERACTIVE_SELECTOR = 'a:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"]), [role="menuitem"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"]), [role="option"]:not([aria-disabled="true"])';
34
34
  function getMenuItems(el) {
35
35
  return Array.from(el.querySelectorAll(INTERACTIVE_SELECTOR));
36
36
  }
@@ -211,7 +211,26 @@ const MenuCheckItem = React__namespace.forwardRef(
211
211
  );
212
212
  MenuCheckItem.displayName = "Menu.CheckItem";
213
213
  const MenuRadioItem = React__namespace.forwardRef(
214
- ({ name, value, checked, disabled, label, onValueChange, className, ...liProps }, ref) => {
214
+ ({
215
+ name,
216
+ value,
217
+ checked,
218
+ active,
219
+ disabled,
220
+ label,
221
+ interactiveRef,
222
+ interactiveProps,
223
+ onValueChange,
224
+ className,
225
+ ...liProps
226
+ }, ref) => {
227
+ var _a, _b;
228
+ const interactiveClass = [
229
+ styles__default.default.interactiveChild,
230
+ styles__default.default.item,
231
+ active ? styles__default.default.active : "",
232
+ checked ? styles__default.default.selected : ""
233
+ ].filter(Boolean).join(" ");
215
234
  return /* @__PURE__ */ jsxRuntime.jsx(
216
235
  "li",
217
236
  {
@@ -222,14 +241,32 @@ const MenuRadioItem = React__namespace.forwardRef(
222
241
  children: /* @__PURE__ */ jsxRuntime.jsx(
223
242
  "div",
224
243
  {
225
- className: styles__default.default.interactiveChild,
244
+ ref: interactiveRef,
245
+ role: (_a = interactiveProps == null ? void 0 : interactiveProps.role) != null ? _a : "menuitemradio",
246
+ tabIndex: (_b = interactiveProps == null ? void 0 : interactiveProps.tabIndex) != null ? _b : 0,
247
+ "aria-checked": checked || void 0,
248
+ "aria-selected": checked || void 0,
249
+ "aria-disabled": disabled || void 0,
250
+ className: interactiveClass,
251
+ ...interactiveProps,
226
252
  onClick: (event) => {
227
- var _a;
253
+ var _a2, _b2;
254
+ (_a2 = interactiveProps == null ? void 0 : interactiveProps.onClick) == null ? void 0 : _a2.call(interactiveProps, event);
255
+ if (event.defaultPrevented) return;
228
256
  if (disabled) return;
229
257
  const target = event.target;
230
- if ((_a = target.closest("label")) != null ? _a : target.closest("input")) return;
258
+ if ((_b2 = target.closest("label")) != null ? _b2 : target.closest("input")) return;
231
259
  onValueChange == null ? void 0 : onValueChange(value);
232
260
  },
261
+ onKeyDown: (event) => {
262
+ var _a2;
263
+ (_a2 = interactiveProps == null ? void 0 : interactiveProps.onKeyDown) == null ? void 0 : _a2.call(interactiveProps, event);
264
+ if (event.defaultPrevented || disabled) return;
265
+ if (event.key === "Enter" || event.key === " ") {
266
+ event.preventDefault();
267
+ onValueChange == null ? void 0 : onValueChange(value);
268
+ }
269
+ },
233
270
  children: /* @__PURE__ */ jsxRuntime.jsx(
234
271
  RadioButton.RadioButton,
235
272
  {
@@ -40,8 +40,11 @@ export interface MenuRadioItemProps extends Omit<React.LiHTMLAttributes<HTMLLIEl
40
40
  name: string;
41
41
  value: string;
42
42
  checked: boolean;
43
+ active?: boolean;
43
44
  disabled?: boolean;
44
45
  label: string;
46
+ interactiveRef?: React.Ref<HTMLDivElement>;
47
+ interactiveProps?: React.HTMLAttributes<HTMLDivElement>;
45
48
  onValueChange?: (value: string) => void;
46
49
  }
47
50
  export declare const Menu: React.ForwardRefExoticComponent<MenuProps & React.RefAttributes<HTMLUListElement>> & {
@@ -5,7 +5,7 @@ import styles from './Menu.module.css';
5
5
  import { Checkbox } from '../forms/checkbox/Checkbox';
6
6
  import { RadioButton } from '../forms/radio-buttons/RadioButton';
7
7
 
8
- const INTERACTIVE_SELECTOR = 'a:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"]), [role="menuitem"]:not([aria-disabled="true"]), [role="option"]:not([aria-disabled="true"])';
8
+ const INTERACTIVE_SELECTOR = 'a:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"]), [role="menuitem"]:not([aria-disabled="true"]), [role="menuitemradio"]:not([aria-disabled="true"]), [role="menuitemcheckbox"]:not([aria-disabled="true"]), [role="option"]:not([aria-disabled="true"])';
9
9
  function getMenuItems(el) {
10
10
  return Array.from(el.querySelectorAll(INTERACTIVE_SELECTOR));
11
11
  }
@@ -186,7 +186,26 @@ const MenuCheckItem = React.forwardRef(
186
186
  );
187
187
  MenuCheckItem.displayName = "Menu.CheckItem";
188
188
  const MenuRadioItem = React.forwardRef(
189
- ({ name, value, checked, disabled, label, onValueChange, className, ...liProps }, ref) => {
189
+ ({
190
+ name,
191
+ value,
192
+ checked,
193
+ active,
194
+ disabled,
195
+ label,
196
+ interactiveRef,
197
+ interactiveProps,
198
+ onValueChange,
199
+ className,
200
+ ...liProps
201
+ }, ref) => {
202
+ var _a, _b;
203
+ const interactiveClass = [
204
+ styles.interactiveChild,
205
+ styles.item,
206
+ active ? styles.active : "",
207
+ checked ? styles.selected : ""
208
+ ].filter(Boolean).join(" ");
190
209
  return /* @__PURE__ */ jsx(
191
210
  "li",
192
211
  {
@@ -197,14 +216,32 @@ const MenuRadioItem = React.forwardRef(
197
216
  children: /* @__PURE__ */ jsx(
198
217
  "div",
199
218
  {
200
- className: styles.interactiveChild,
219
+ ref: interactiveRef,
220
+ role: (_a = interactiveProps == null ? void 0 : interactiveProps.role) != null ? _a : "menuitemradio",
221
+ tabIndex: (_b = interactiveProps == null ? void 0 : interactiveProps.tabIndex) != null ? _b : 0,
222
+ "aria-checked": checked || void 0,
223
+ "aria-selected": checked || void 0,
224
+ "aria-disabled": disabled || void 0,
225
+ className: interactiveClass,
226
+ ...interactiveProps,
201
227
  onClick: (event) => {
202
- var _a;
228
+ var _a2, _b2;
229
+ (_a2 = interactiveProps == null ? void 0 : interactiveProps.onClick) == null ? void 0 : _a2.call(interactiveProps, event);
230
+ if (event.defaultPrevented) return;
203
231
  if (disabled) return;
204
232
  const target = event.target;
205
- if ((_a = target.closest("label")) != null ? _a : target.closest("input")) return;
233
+ if ((_b2 = target.closest("label")) != null ? _b2 : target.closest("input")) return;
206
234
  onValueChange == null ? void 0 : onValueChange(value);
207
235
  },
236
+ onKeyDown: (event) => {
237
+ var _a2;
238
+ (_a2 = interactiveProps == null ? void 0 : interactiveProps.onKeyDown) == null ? void 0 : _a2.call(interactiveProps, event);
239
+ if (event.defaultPrevented || disabled) return;
240
+ if (event.key === "Enter" || event.key === " ") {
241
+ event.preventDefault();
242
+ onValueChange == null ? void 0 : onValueChange(value);
243
+ }
244
+ },
208
245
  children: /* @__PURE__ */ jsx(
209
246
  RadioButton,
210
247
  {
@@ -8,15 +8,22 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var styles__default = /*#__PURE__*/_interopDefault(styles);
10
10
 
11
+ function toSize(v) {
12
+ return typeof v === "number" ? `${v}px` : v;
13
+ }
11
14
  function MetricTile({
12
15
  severity,
13
16
  label,
14
17
  value,
15
18
  tooltip,
16
19
  size = "md",
17
- width
20
+ minWidth,
21
+ maxWidth
18
22
  }) {
19
- const style = width != null ? { width: typeof width === "number" ? `${width}px` : width } : void 0;
23
+ const style = minWidth != null || maxWidth != null ? {
24
+ ...minWidth != null ? { minWidth: toSize(minWidth) } : {},
25
+ ...maxWidth != null ? { maxWidth: toSize(maxWidth) } : {}
26
+ } : void 0;
20
27
  return /* @__PURE__ */ jsxRuntime.jsx(client.Tooltip, { content: tooltip, placement: "bottom", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.tile, "data-severity": severity, "data-size": size, style, children: [
21
28
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.label, children: label }),
22
29
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.value, children: value })
@@ -1,13 +1,15 @@
1
1
  import type { ReactNode, JSX } from 'react';
2
2
  import { Severity } from '../../constants/severity.types';
3
3
  type MetricTileSize = 'sm' | 'md' | 'lg';
4
+ type SizeValue = number | string;
4
5
  interface MetricTileProps {
5
6
  severity: Severity;
6
7
  label: string;
7
8
  value: string | number;
8
9
  tooltip?: ReactNode;
9
10
  size?: MetricTileSize;
10
- width?: number | string;
11
+ minWidth?: SizeValue;
12
+ maxWidth?: SizeValue;
11
13
  }
12
- export declare function MetricTile({ severity, label, value, tooltip, size, width, }: MetricTileProps): JSX.Element;
14
+ export declare function MetricTile({ severity, label, value, tooltip, size, minWidth, maxWidth, }: MetricTileProps): JSX.Element;
13
15
  export {};
@@ -2,15 +2,22 @@ import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import { Tooltip } from '../../client';
3
3
  import styles from './MetricTile.module.css';
4
4
 
5
+ function toSize(v) {
6
+ return typeof v === "number" ? `${v}px` : v;
7
+ }
5
8
  function MetricTile({
6
9
  severity,
7
10
  label,
8
11
  value,
9
12
  tooltip,
10
13
  size = "md",
11
- width
14
+ minWidth,
15
+ maxWidth
12
16
  }) {
13
- const style = width != null ? { width: typeof width === "number" ? `${width}px` : width } : void 0;
17
+ const style = minWidth != null || maxWidth != null ? {
18
+ ...minWidth != null ? { minWidth: toSize(minWidth) } : {},
19
+ ...maxWidth != null ? { maxWidth: toSize(maxWidth) } : {}
20
+ } : void 0;
14
21
  return /* @__PURE__ */ jsx(Tooltip, { content: tooltip, placement: "bottom", children: /* @__PURE__ */ jsxs("span", { className: styles.tile, "data-severity": severity, "data-size": size, style, children: [
15
22
  /* @__PURE__ */ jsx("span", { className: styles.label, children: label }),
16
23
  /* @__PURE__ */ jsx("span", { className: styles.value, children: value })
@@ -3,9 +3,9 @@
3
3
  flex-direction: column;
4
4
  align-items: center;
5
5
  justify-content: center;
6
- gap: var(--spacing-2xs);
7
- padding: var(--spacing-sm) var(--spacing-md);
8
- min-width: 72px;
6
+ gap: 2px;
7
+ padding: var(--spacing-xs) var(--spacing-sm);
8
+ min-width: 64px;
9
9
  overflow: hidden;
10
10
  box-sizing: border-box;
11
11
  border-radius: var(--border-radius-md);
@@ -14,35 +14,37 @@
14
14
  }
15
15
 
16
16
  .tile[data-size='sm'] {
17
- padding: var(--spacing-xs) var(--spacing-sm);
17
+ gap: 1px;
18
+ padding: 6px var(--spacing-sm);
18
19
  min-width: 56px;
19
20
  border-radius: var(--border-radius-sm);
20
21
  }
21
22
 
22
23
  .tile[data-size='lg'] {
24
+ gap: var(--spacing-2xs);
23
25
  padding: var(--spacing-md) var(--spacing-lg);
24
26
  min-width: 96px;
25
27
  border-radius: var(--border-radius-lg);
26
28
  }
27
29
 
28
30
  .tile[data-severity='success'] {
29
- background-color: var(--color-status-success-bg);
30
- color: var(--color-status-success-fg);
31
+ background-color: var(--color-status-success-bg-soft);
32
+ color: var(--color-status-success-fg-soft);
31
33
  }
32
34
 
33
35
  .tile[data-severity='error'] {
34
- background-color: var(--color-status-error-bg);
35
- color: var(--color-status-error-fg);
36
+ background-color: var(--color-status-error-bg-soft);
37
+ color: var(--color-status-error-fg-soft);
36
38
  }
37
39
 
38
40
  .tile[data-severity='warning'] {
39
- background-color: var(--color-status-warning-bg);
40
- color: var(--color-status-warning-fg);
41
+ background-color: var(--color-status-warning-bg-soft);
42
+ color: var(--color-status-warning-fg-soft);
41
43
  }
42
44
 
43
45
  .tile[data-severity='info'] {
44
- background-color: var(--color-status-info-bg);
45
- color: var(--color-status-info-fg);
46
+ background-color: var(--color-status-info-bg-soft);
47
+ color: var(--color-status-info-fg-soft);
46
48
  }
47
49
 
48
50
  .tile[data-severity='neutral'] {
@@ -57,7 +59,7 @@
57
59
 
58
60
  .label {
59
61
  font-size: var(--font-size-xs);
60
- font-weight: var(--font-weight-medium);
62
+ font-weight: var(--font-weight-semibold, 600);
61
63
  text-transform: uppercase;
62
64
  letter-spacing: var(--letter-spacing-wide);
63
65
  line-height: 1;
@@ -69,9 +71,10 @@
69
71
  }
70
72
 
71
73
  .value {
72
- font-size: var(--font-size-lg);
74
+ font-size: var(--font-size-md);
73
75
  font-weight: var(--font-weight-bold);
74
76
  line-height: 1;
77
+ font-variant-numeric: tabular-nums;
75
78
  max-width: 100%;
76
79
  overflow: hidden;
77
80
  white-space: nowrap;
@@ -79,7 +82,8 @@
79
82
  }
80
83
 
81
84
  .tile[data-size='sm'] .label {
82
- font-size: var(--font-size-sm);
85
+ font-size: var(--font-size-xs);
86
+ letter-spacing: normal;
83
87
  }
84
88
 
85
89
  .tile[data-size='sm'] .value {
@@ -4,6 +4,21 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var react = require('react');
5
5
  var useTooltipTrigger = require('./useTooltipTrigger');
6
6
 
7
+ function mergeRefs(...refs) {
8
+ return (node) => {
9
+ for (const ref of refs) {
10
+ if (!ref) continue;
11
+ if (typeof ref === "function") ref(node);
12
+ else ref.current = node;
13
+ }
14
+ };
15
+ }
16
+ function composeHandlers(childHandler, tooltipHandler) {
17
+ return (event) => {
18
+ childHandler == null ? void 0 : childHandler(event);
19
+ tooltipHandler == null ? void 0 : tooltipHandler(event);
20
+ };
21
+ }
7
22
  function Tooltip({
8
23
  children,
9
24
  content,
@@ -11,10 +26,9 @@ function Tooltip({
11
26
  open,
12
27
  offset = 8,
13
28
  delayOpenMs,
14
- delayCloseMs,
15
- className,
16
- ...rest
29
+ delayCloseMs
17
30
  }) {
31
+ var _a;
18
32
  const { triggerProps } = useTooltipTrigger.useTooltipTrigger({
19
33
  content,
20
34
  placement,
@@ -23,12 +37,20 @@ function Tooltip({
23
37
  delayOpenMs,
24
38
  delayCloseMs
25
39
  });
26
- const rootClass = react.useMemo(
27
- () => ["TooltipContainer", className].filter(Boolean).join(" "),
28
- [className]
29
- );
30
40
  if (!content) return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
31
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: rootClass, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "TooltipTrigger", tabIndex: 0, ...triggerProps, children }) });
41
+ const child = children;
42
+ const childProps = child.props;
43
+ const childRef = (_a = childProps.ref) != null ? _a : child.ref;
44
+ return react.cloneElement(child, {
45
+ ...childProps,
46
+ ref: mergeRefs(childRef, triggerProps.ref),
47
+ onPointerEnter: composeHandlers(childProps.onPointerEnter, triggerProps.onPointerEnter),
48
+ onPointerLeave: composeHandlers(childProps.onPointerLeave, triggerProps.onPointerLeave),
49
+ onPointerDown: composeHandlers(childProps.onPointerDown, triggerProps.onPointerDown),
50
+ onFocus: composeHandlers(childProps.onFocus, triggerProps.onFocus),
51
+ onBlur: composeHandlers(childProps.onBlur, triggerProps.onBlur),
52
+ "aria-describedby": [childProps["aria-describedby"], triggerProps["aria-describedby"]].filter(Boolean).join(" ") || void 0
53
+ });
32
54
  }
33
55
 
34
56
  exports.Tooltip = Tooltip;
@@ -1,13 +1,12 @@
1
- import { type ReactNode, type HTMLAttributes, type ReactElement } from 'react';
1
+ import { type ReactElement, type ReactNode } from 'react';
2
2
  import { TooltipPlacement } from './TooltipProvider';
3
- export interface TooltipProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'content'> {
4
- children: ReactNode;
3
+ export interface TooltipProps {
4
+ children: ReactElement;
5
5
  content: ReactNode;
6
6
  placement?: TooltipPlacement;
7
7
  open?: boolean;
8
8
  offset?: number;
9
9
  delayOpenMs?: number;
10
10
  delayCloseMs?: number;
11
- className?: string;
12
11
  }
13
- export declare function Tooltip({ children, content, placement, open, offset, delayOpenMs, delayCloseMs, className, ...rest }: TooltipProps): ReactElement;
12
+ export declare function Tooltip({ children, content, placement, open, offset, delayOpenMs, delayCloseMs, }: TooltipProps): ReactElement;
@@ -1,7 +1,22 @@
1
1
  import { jsx, Fragment } from 'react/jsx-runtime';
2
- import { useMemo } from 'react';
2
+ import { cloneElement } from 'react';
3
3
  import { useTooltipTrigger } from './useTooltipTrigger';
4
4
 
5
+ function mergeRefs(...refs) {
6
+ return (node) => {
7
+ for (const ref of refs) {
8
+ if (!ref) continue;
9
+ if (typeof ref === "function") ref(node);
10
+ else ref.current = node;
11
+ }
12
+ };
13
+ }
14
+ function composeHandlers(childHandler, tooltipHandler) {
15
+ return (event) => {
16
+ childHandler == null ? void 0 : childHandler(event);
17
+ tooltipHandler == null ? void 0 : tooltipHandler(event);
18
+ };
19
+ }
5
20
  function Tooltip({
6
21
  children,
7
22
  content,
@@ -9,10 +24,9 @@ function Tooltip({
9
24
  open,
10
25
  offset = 8,
11
26
  delayOpenMs,
12
- delayCloseMs,
13
- className,
14
- ...rest
27
+ delayCloseMs
15
28
  }) {
29
+ var _a;
16
30
  const { triggerProps } = useTooltipTrigger({
17
31
  content,
18
32
  placement,
@@ -21,12 +35,20 @@ function Tooltip({
21
35
  delayOpenMs,
22
36
  delayCloseMs
23
37
  });
24
- const rootClass = useMemo(
25
- () => ["TooltipContainer", className].filter(Boolean).join(" "),
26
- [className]
27
- );
28
38
  if (!content) return /* @__PURE__ */ jsx(Fragment, { children });
29
- return /* @__PURE__ */ jsx("span", { className: rootClass, ...rest, children: /* @__PURE__ */ jsx("span", { className: "TooltipTrigger", tabIndex: 0, ...triggerProps, children }) });
39
+ const child = children;
40
+ const childProps = child.props;
41
+ const childRef = (_a = childProps.ref) != null ? _a : child.ref;
42
+ return cloneElement(child, {
43
+ ...childProps,
44
+ ref: mergeRefs(childRef, triggerProps.ref),
45
+ onPointerEnter: composeHandlers(childProps.onPointerEnter, triggerProps.onPointerEnter),
46
+ onPointerLeave: composeHandlers(childProps.onPointerLeave, triggerProps.onPointerLeave),
47
+ onPointerDown: composeHandlers(childProps.onPointerDown, triggerProps.onPointerDown),
48
+ onFocus: composeHandlers(childProps.onFocus, triggerProps.onFocus),
49
+ onBlur: composeHandlers(childProps.onBlur, triggerProps.onBlur),
50
+ "aria-describedby": [childProps["aria-describedby"], triggerProps["aria-describedby"]].filter(Boolean).join(" ") || void 0
51
+ });
30
52
  }
31
53
 
32
54
  export { Tooltip };
@@ -49,6 +49,7 @@ function Table({
49
49
  showGoToPage,
50
50
  showPageSize,
51
51
  pageSizeOptions,
52
+ showHeader = true,
52
53
  getRowSeverity,
53
54
  onRowClick,
54
55
  onRowMouseEnter,
@@ -143,6 +144,7 @@ function Table({
143
144
  {
144
145
  className: styles__default.default.tableElement,
145
146
  "aria-rowcount": data.length,
147
+ "data-show-header": showHeader,
146
148
  style: tableWidth != null ? { width: tableWidth } : void 0,
147
149
  children: [
148
150
  /* @__PURE__ */ jsxRuntime.jsxs("colgroup", { children: [
@@ -155,7 +157,7 @@ function Table({
155
157
  column.id
156
158
  ))
157
159
  ] }),
158
- /* @__PURE__ */ jsxRuntime.jsx(
160
+ showHeader && /* @__PURE__ */ jsxRuntime.jsx(
159
161
  TableHeader.TableHeader,
160
162
  {
161
163
  columns: visibleColumns,
@@ -1,4 +1,4 @@
1
1
  import type { JSX } from 'react';
2
2
  import type { TableProps } from './Table.types';
3
- export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode, striped, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, showGoToPage, showPageSize, pageSizeOptions, getRowSeverity, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
3
+ export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode, striped, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, showGoToPage, showPageSize, pageSizeOptions, showHeader, getRowSeverity, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
4
4
  export type { ColumnItem } from './Table.types';
@@ -43,6 +43,7 @@ function Table({
43
43
  showGoToPage,
44
44
  showPageSize,
45
45
  pageSizeOptions,
46
+ showHeader = true,
46
47
  getRowSeverity,
47
48
  onRowClick,
48
49
  onRowMouseEnter,
@@ -137,6 +138,7 @@ function Table({
137
138
  {
138
139
  className: styles.tableElement,
139
140
  "aria-rowcount": data.length,
141
+ "data-show-header": showHeader,
140
142
  style: tableWidth != null ? { width: tableWidth } : void 0,
141
143
  children: [
142
144
  /* @__PURE__ */ jsxs("colgroup", { children: [
@@ -149,7 +151,7 @@ function Table({
149
151
  column.id
150
152
  ))
151
153
  ] }),
152
- /* @__PURE__ */ jsx(
154
+ showHeader && /* @__PURE__ */ jsx(
153
155
  TableHeader,
154
156
  {
155
157
  columns: visibleColumns,
@@ -71,6 +71,10 @@
71
71
  .primary {
72
72
  }
73
73
 
74
+ .embedded .cell {
75
+ border-block-end: none;
76
+ }
77
+
74
78
  .embedded {
75
79
  --table-component-header-bg: transparent;
76
80
  --table-component-header-fg: var(--color-fg-subtle);
@@ -138,7 +142,7 @@
138
142
  min-block-size: 0;
139
143
  }
140
144
 
141
- .body .row:first-child .cell {
145
+ [data-show-header='true'] .body .row:first-child .cell {
142
146
  border-block-start: var(--spacing-xs) solid var(--table-component-row-bg);
143
147
  }
144
148
 
@@ -324,6 +328,17 @@
324
328
  word-break: normal;
325
329
  }
326
330
 
331
+ .allowOverflow {
332
+ overflow: visible;
333
+ }
334
+
335
+ .allowOverflow .cellContent,
336
+ .allowOverflow .cellValueEllipsis,
337
+ .allowOverflow .cellValueNoEllipsis {
338
+ overflow: visible;
339
+ text-overflow: clip;
340
+ }
341
+
327
342
  .thInner {
328
343
  display: flex;
329
344
  align-items: center;
@@ -485,15 +500,25 @@
485
500
  text-overflow: ellipsis;
486
501
  }
487
502
 
488
- .cellContent[data-align='left'] .cellValueEllipsis {
503
+ .cellValueNoEllipsis {
504
+ display: block;
505
+ inline-size: 100%;
506
+ min-width: 0;
507
+ max-inline-size: 100%;
508
+ }
509
+
510
+ .cellContent[data-align='left'] .cellValueEllipsis,
511
+ .cellContent[data-align='left'] .cellValueNoEllipsis {
489
512
  text-align: left;
490
513
  }
491
514
 
492
- .cellContent[data-align='center'] .cellValueEllipsis {
515
+ .cellContent[data-align='center'] .cellValueEllipsis,
516
+ .cellContent[data-align='center'] .cellValueNoEllipsis {
493
517
  text-align: center;
494
518
  }
495
519
 
496
- .cellContent[data-align='right'] .cellValueEllipsis {
520
+ .cellContent[data-align='right'] .cellValueEllipsis,
521
+ .cellContent[data-align='right'] .cellValueNoEllipsis {
497
522
  text-align: right;
498
523
  }
499
524
 
@@ -59,6 +59,7 @@ export type TableProps<T extends Record<string, any>> = Omit<HTMLAttributes<HTML
59
59
  showGoToPage?: boolean;
60
60
  showPageSize?: boolean;
61
61
  pageSizeOptions?: number[];
62
+ showHeader?: boolean;
62
63
  getRowSeverity?: (row: T) => Severity | undefined;
63
64
  onRowClick?: (row: T) => void;
64
65
  onRowMouseEnter?: (row: T) => void;
@@ -116,13 +116,14 @@ function TableRow({
116
116
  columns.map((column) => {
117
117
  var _a2, _b, _c, _d;
118
118
  const allowWrap = table_utils.shouldAllowWrap(column.allowWrap, isSelected, viewMode);
119
- column.allowOverflow;
119
+ const allowOverflow = column.allowOverflow;
120
120
  const cellValue = table_utils.getCellDisplayValue(row, column);
121
121
  return /* @__PURE__ */ jsxRuntime.jsx(
122
122
  "td",
123
123
  {
124
124
  className: table_classes.cx(
125
125
  styles__default.default.cell,
126
+ allowOverflow && styles__default.default.allowOverflow,
126
127
  allowWrap ? styles__default.default.allowWrap : styles__default.default.nowrap,
127
128
  column.divider === "left" && styles__default.default.dividerLeft,
128
129
  column.divider === "right" && styles__default.default.dividerRight
@@ -136,7 +137,13 @@ function TableRow({
136
137
  className: styles__default.default.cellContent,
137
138
  "data-align": (_c = column.align) != null ? _c : "left",
138
139
  "data-vertical-align": (_d = column.verticalAlign) != null ? _d : "top",
139
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.cellValueEllipsis, children: cellValue })
140
+ children: /* @__PURE__ */ jsxRuntime.jsx(
141
+ "div",
142
+ {
143
+ className: allowOverflow ? styles__default.default.cellValueNoEllipsis : styles__default.default.cellValueEllipsis,
144
+ children: cellValue
145
+ }
146
+ )
140
147
  }
141
148
  )
142
149
  },
@@ -110,13 +110,14 @@ function TableRow({
110
110
  columns.map((column) => {
111
111
  var _a2, _b, _c, _d;
112
112
  const allowWrap = shouldAllowWrap(column.allowWrap, isSelected, viewMode);
113
- column.allowOverflow;
113
+ const allowOverflow = column.allowOverflow;
114
114
  const cellValue = getCellDisplayValue(row, column);
115
115
  return /* @__PURE__ */ jsx(
116
116
  "td",
117
117
  {
118
118
  className: cx(
119
119
  styles.cell,
120
+ allowOverflow && styles.allowOverflow,
120
121
  allowWrap ? styles.allowWrap : styles.nowrap,
121
122
  column.divider === "left" && styles.dividerLeft,
122
123
  column.divider === "right" && styles.dividerRight
@@ -130,7 +131,13 @@ function TableRow({
130
131
  className: styles.cellContent,
131
132
  "data-align": (_c = column.align) != null ? _c : "left",
132
133
  "data-vertical-align": (_d = column.verticalAlign) != null ? _d : "top",
133
- children: /* @__PURE__ */ jsx("div", { className: styles.cellValueEllipsis, children: cellValue })
134
+ children: /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ className: allowOverflow ? styles.cellValueNoEllipsis : styles.cellValueEllipsis,
138
+ children: cellValue
139
+ }
140
+ )
134
141
  }
135
142
  )
136
143
  },
@@ -236,6 +236,10 @@ body.dbc-app {
236
236
  color: var(--color-fg-subtle);
237
237
  }
238
238
 
239
+ .dbc-tabular-nums {
240
+ font-variant-numeric: tabular-nums;
241
+ }
242
+
239
243
  .dbc-sm-text {
240
244
  font-size: var(--font-size-xs);
241
245
  }
@@ -144,6 +144,33 @@ html {
144
144
  --color-status-info-border: color-mix(in srgb, var(--dbc-info-500) 24%, transparent);
145
145
  --color-status-info-fg: var(--dbc-info-700);
146
146
 
147
+ /* Soft status surfaces — for compact chips/badges, not alerts */
148
+ --color-status-success-bg-soft: color-mix(
149
+ in srgb,
150
+ var(--color-status-success) 10%,
151
+ var(--color-bg-surface)
152
+ );
153
+ --color-status-warning-bg-soft: color-mix(
154
+ in srgb,
155
+ var(--color-status-warning) 10%,
156
+ var(--color-bg-surface)
157
+ );
158
+ --color-status-error-bg-soft: color-mix(
159
+ in srgb,
160
+ var(--color-status-error) 8%,
161
+ var(--color-bg-surface)
162
+ );
163
+ --color-status-info-bg-soft: color-mix(
164
+ in srgb,
165
+ var(--color-status-info) 10%,
166
+ var(--color-bg-surface)
167
+ );
168
+
169
+ --color-status-success-fg-soft: var(--color-status-success-fg);
170
+ --color-status-warning-fg-soft: var(--color-status-warning-fg);
171
+ --color-status-error-fg-soft: var(--color-status-error-fg);
172
+ --color-status-info-fg-soft: var(--color-status-info-fg);
173
+
147
174
  /* Chart colors */
148
175
  --color-chart-empty: color-mix(in srgb, var(--color-fg-muted) 15%, rgb(255 255 255 / 0));
149
176
  --color-chart-neutral: color-mix(in srgb, var(--color-fg-muted) 25%, rgb(255 255 255 / 0));
package/dist/styles.css CHANGED
@@ -236,6 +236,10 @@ body.dbc-app {
236
236
  color: var(--color-fg-subtle);
237
237
  }
238
238
 
239
+ .dbc-tabular-nums {
240
+ font-variant-numeric: tabular-nums;
241
+ }
242
+
239
243
  .dbc-sm-text {
240
244
  font-size: var(--font-size-xs);
241
245
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbcdk/react-components",
3
- "version": "0.0.108",
3
+ "version": "0.0.109",
4
4
  "description": "Reusable React components for DBC projects",
5
5
  "license": "ISC",
6
6
  "author": "",