@dbcdk/react-components 0.0.107 → 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.
- package/dist/components/button/Button.module.css +3 -0
- package/dist/components/card/Card.module.css +4 -1
- package/dist/components/grid/Grid.cjs +15 -2
- package/dist/components/grid/Grid.d.ts +7 -1
- package/dist/components/grid/Grid.js +15 -2
- package/dist/components/grid/Grid.module.css +9 -0
- package/dist/components/headline/Headline.cjs +1 -1
- package/dist/components/headline/Headline.js +1 -1
- package/dist/components/menu/Menu.cjs +42 -5
- package/dist/components/menu/Menu.d.ts +3 -0
- package/dist/components/menu/Menu.js +42 -5
- package/dist/components/metric-tile/MetricTile.cjs +9 -2
- package/dist/components/metric-tile/MetricTile.d.ts +4 -2
- package/dist/components/metric-tile/MetricTile.js +9 -2
- package/dist/components/metric-tile/MetricTile.module.css +19 -15
- package/dist/components/overlay/tooltip/Tooltip.cjs +30 -8
- package/dist/components/overlay/tooltip/Tooltip.d.ts +4 -5
- package/dist/components/overlay/tooltip/Tooltip.js +31 -9
- package/dist/components/stack/Stack.cjs +10 -1
- package/dist/components/stack/Stack.d.ts +2 -0
- package/dist/components/stack/Stack.js +10 -1
- package/dist/components/stack/Stack.module.css +16 -0
- package/dist/components/table/Table.cjs +3 -1
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +3 -1
- package/dist/components/table/Table.module.css +30 -9
- package/dist/components/table/Table.types.d.ts +1 -0
- package/dist/components/table/components/TableRow.cjs +9 -2
- package/dist/components/table/components/TableRow.js +9 -2
- package/dist/styles/styles.css +4 -0
- package/dist/styles/themes/dbc/colors.css +27 -0
- package/dist/styles.css +4 -0
- package/package.json +1 -1
|
@@ -15,12 +15,25 @@ const GAP_TOKEN = {
|
|
|
15
15
|
lg: "var(--spacing-lg)",
|
|
16
16
|
xl: "var(--spacing-xl)"
|
|
17
17
|
};
|
|
18
|
-
function Grid({
|
|
18
|
+
function Grid({
|
|
19
|
+
children,
|
|
20
|
+
gap = "md",
|
|
21
|
+
equalHeight = false,
|
|
22
|
+
maxWidth,
|
|
23
|
+
className,
|
|
24
|
+
style
|
|
25
|
+
}) {
|
|
19
26
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
20
27
|
"div",
|
|
21
28
|
{
|
|
22
29
|
className: [styles__default.default.grid, equalHeight && styles__default.default.equalHeight, className].filter(Boolean).join(" "),
|
|
23
|
-
style: {
|
|
30
|
+
style: {
|
|
31
|
+
gap: GAP_TOKEN[gap],
|
|
32
|
+
...(maxWidth == null ? void 0 : maxWidth.base) != null ? { "--max-width-base": maxWidth.base } : {},
|
|
33
|
+
...(maxWidth == null ? void 0 : maxWidth.md) != null ? { "--max-width-md": maxWidth.md } : {},
|
|
34
|
+
...(maxWidth == null ? void 0 : maxWidth.lg) != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
35
|
+
...style
|
|
36
|
+
},
|
|
24
37
|
children
|
|
25
38
|
}
|
|
26
39
|
);
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
export type GridGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export interface GridMaxWidth {
|
|
4
|
+
base?: string;
|
|
5
|
+
md?: string;
|
|
6
|
+
lg?: string;
|
|
7
|
+
}
|
|
3
8
|
export interface GridProps {
|
|
4
9
|
children?: ReactNode;
|
|
5
10
|
gap?: GridGap;
|
|
6
11
|
/** Stretch direct children so cards/items in the same row get equal height */
|
|
7
12
|
equalHeight?: boolean;
|
|
13
|
+
maxWidth?: GridMaxWidth;
|
|
8
14
|
className?: string;
|
|
9
15
|
style?: CSSProperties;
|
|
10
16
|
}
|
|
11
|
-
export declare function Grid({ children, gap, equalHeight, className, style }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Grid({ children, gap, equalHeight, maxWidth, className, style, }: GridProps): import("react/jsx-runtime").JSX.Element;
|
|
12
18
|
export interface GridItemProps {
|
|
13
19
|
children?: ReactNode;
|
|
14
20
|
/** Default span: <768px */
|
|
@@ -9,12 +9,25 @@ const GAP_TOKEN = {
|
|
|
9
9
|
lg: "var(--spacing-lg)",
|
|
10
10
|
xl: "var(--spacing-xl)"
|
|
11
11
|
};
|
|
12
|
-
function Grid({
|
|
12
|
+
function Grid({
|
|
13
|
+
children,
|
|
14
|
+
gap = "md",
|
|
15
|
+
equalHeight = false,
|
|
16
|
+
maxWidth,
|
|
17
|
+
className,
|
|
18
|
+
style
|
|
19
|
+
}) {
|
|
13
20
|
return /* @__PURE__ */ jsx(
|
|
14
21
|
"div",
|
|
15
22
|
{
|
|
16
23
|
className: [styles.grid, equalHeight && styles.equalHeight, className].filter(Boolean).join(" "),
|
|
17
|
-
style: {
|
|
24
|
+
style: {
|
|
25
|
+
gap: GAP_TOKEN[gap],
|
|
26
|
+
...(maxWidth == null ? void 0 : maxWidth.base) != null ? { "--max-width-base": maxWidth.base } : {},
|
|
27
|
+
...(maxWidth == null ? void 0 : maxWidth.md) != null ? { "--max-width-md": maxWidth.md } : {},
|
|
28
|
+
...(maxWidth == null ? void 0 : maxWidth.lg) != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
29
|
+
...style
|
|
30
|
+
},
|
|
18
31
|
children
|
|
19
32
|
}
|
|
20
33
|
);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: grid;
|
|
3
3
|
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
4
4
|
align-items: start;
|
|
5
|
+
max-width: var(--max-width-base);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
.equalHeight {
|
|
@@ -23,12 +24,20 @@
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
@media (min-width: 768px) {
|
|
27
|
+
.grid {
|
|
28
|
+
max-width: var(--max-width-md, var(--max-width-base));
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
.item {
|
|
27
32
|
grid-column: span var(--span-md, var(--span-base, 12));
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
@media (min-width: 1200px) {
|
|
37
|
+
.grid {
|
|
38
|
+
max-width: var(--max-width-lg, var(--max-width-md, var(--max-width-base)));
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
.item {
|
|
33
42
|
grid-column: span var(--span-lg, var(--span-md, var(--span-base, 12)));
|
|
34
43
|
}
|
|
@@ -45,7 +45,7 @@ function Headline({
|
|
|
45
45
|
},
|
|
46
46
|
className: headlineClassName,
|
|
47
47
|
children: [
|
|
48
|
-
icon || severity$1 && !marker ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { customIcon: icon, severity: severity$1 }) }) : null,
|
|
48
|
+
icon || severity$1 && !marker ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.icon, children: /* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { customIcon: icon, severity: icon ? void 0 : severity$1 }) }) : null,
|
|
49
49
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: textClassName, children })
|
|
50
50
|
]
|
|
51
51
|
}
|
|
@@ -39,7 +39,7 @@ function Headline({
|
|
|
39
39
|
},
|
|
40
40
|
className: headlineClassName,
|
|
41
41
|
children: [
|
|
42
|
-
icon || severity && !marker ? /* @__PURE__ */ jsx("span", { className: styles.icon, children: /* @__PURE__ */ jsx(Icon, { customIcon: icon, severity }) }) : null,
|
|
42
|
+
icon || severity && !marker ? /* @__PURE__ */ jsx("span", { className: styles.icon, children: /* @__PURE__ */ jsx(Icon, { customIcon: icon, severity: icon ? void 0 : severity }) }) : null,
|
|
43
43
|
/* @__PURE__ */ jsx("span", { className: textClassName, children })
|
|
44
44
|
]
|
|
45
45
|
}
|
|
@@ -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
|
-
({
|
|
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
|
-
|
|
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
|
|
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 ((
|
|
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
|
-
({
|
|
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
|
-
|
|
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
|
|
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 ((
|
|
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
|
-
|
|
20
|
+
minWidth,
|
|
21
|
+
maxWidth
|
|
18
22
|
}) {
|
|
19
|
-
const style =
|
|
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
|
-
|
|
11
|
+
minWidth?: SizeValue;
|
|
12
|
+
maxWidth?: SizeValue;
|
|
11
13
|
}
|
|
12
|
-
export declare function MetricTile({ severity, label, value, tooltip, size,
|
|
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
|
-
|
|
14
|
+
minWidth,
|
|
15
|
+
maxWidth
|
|
12
16
|
}) {
|
|
13
|
-
const style =
|
|
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:
|
|
7
|
-
padding: var(--spacing-
|
|
8
|
-
min-width:
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
|
|
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
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
2
|
import { TooltipPlacement } from './TooltipProvider';
|
|
3
|
-
export interface TooltipProps
|
|
4
|
-
children:
|
|
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,
|
|
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 {
|
|
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
|
-
|
|
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 };
|
|
@@ -22,10 +22,18 @@ const Stack = react.forwardRef(function Stack2({
|
|
|
22
22
|
mobileAlign,
|
|
23
23
|
mobileJustify,
|
|
24
24
|
mobileWrap = false,
|
|
25
|
+
maxWidth,
|
|
25
26
|
className,
|
|
27
|
+
style,
|
|
26
28
|
...rest
|
|
27
29
|
}, ref) {
|
|
28
30
|
const Tag = as != null ? as : "div";
|
|
31
|
+
const resolvedStyle = maxWidth != null ? {
|
|
32
|
+
...maxWidth.base != null ? { "--max-width-base": maxWidth.base } : {},
|
|
33
|
+
...maxWidth.md != null ? { "--max-width-md": maxWidth.md } : {},
|
|
34
|
+
...maxWidth.lg != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
35
|
+
...style
|
|
36
|
+
} : style;
|
|
29
37
|
const classes = [
|
|
30
38
|
"dbc-flex",
|
|
31
39
|
direction === "column" ? "dbc-flex-column" : void 0,
|
|
@@ -39,9 +47,10 @@ const Stack = react.forwardRef(function Stack2({
|
|
|
39
47
|
mobileAlign ? styles__default.default[`mobileAlign${mobileAlign.charAt(0).toUpperCase()}${mobileAlign.slice(1)}`] : void 0,
|
|
40
48
|
mobileJustify ? styles__default.default[`mobileJustify${mobileJustify.charAt(0).toUpperCase()}${mobileJustify.slice(1)}`] : void 0,
|
|
41
49
|
mobileWrap ? styles__default.default.mobileWrap : void 0,
|
|
50
|
+
maxWidth != null ? styles__default.default.maxWidth : void 0,
|
|
42
51
|
className
|
|
43
52
|
].filter(Boolean).join(" ");
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { ref, className: classes, ...rest });
|
|
53
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Tag, { ref, className: classes, style: resolvedStyle, ...rest });
|
|
45
54
|
});
|
|
46
55
|
|
|
47
56
|
exports.Stack = Stack;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { ElementType } from 'react';
|
|
2
|
+
import type { GridMaxWidth } from '../../components/grid/Grid';
|
|
2
3
|
type GapSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl';
|
|
3
4
|
type StackDirection = 'row' | 'column';
|
|
4
5
|
type StackAlign = 'start' | 'center' | 'end';
|
|
@@ -15,6 +16,7 @@ type StackOwnProps = {
|
|
|
15
16
|
mobileAlign?: StackAlign;
|
|
16
17
|
mobileJustify?: StackJustify;
|
|
17
18
|
mobileWrap?: boolean;
|
|
19
|
+
maxWidth?: GridMaxWidth;
|
|
18
20
|
};
|
|
19
21
|
export type StackProps<C extends ElementType = 'div'> = StackOwnProps & {
|
|
20
22
|
as?: C;
|
|
@@ -16,10 +16,18 @@ const Stack = forwardRef(function Stack2({
|
|
|
16
16
|
mobileAlign,
|
|
17
17
|
mobileJustify,
|
|
18
18
|
mobileWrap = false,
|
|
19
|
+
maxWidth,
|
|
19
20
|
className,
|
|
21
|
+
style,
|
|
20
22
|
...rest
|
|
21
23
|
}, ref) {
|
|
22
24
|
const Tag = as != null ? as : "div";
|
|
25
|
+
const resolvedStyle = maxWidth != null ? {
|
|
26
|
+
...maxWidth.base != null ? { "--max-width-base": maxWidth.base } : {},
|
|
27
|
+
...maxWidth.md != null ? { "--max-width-md": maxWidth.md } : {},
|
|
28
|
+
...maxWidth.lg != null ? { "--max-width-lg": maxWidth.lg } : {},
|
|
29
|
+
...style
|
|
30
|
+
} : style;
|
|
23
31
|
const classes = [
|
|
24
32
|
"dbc-flex",
|
|
25
33
|
direction === "column" ? "dbc-flex-column" : void 0,
|
|
@@ -33,9 +41,10 @@ const Stack = forwardRef(function Stack2({
|
|
|
33
41
|
mobileAlign ? styles[`mobileAlign${mobileAlign.charAt(0).toUpperCase()}${mobileAlign.slice(1)}`] : void 0,
|
|
34
42
|
mobileJustify ? styles[`mobileJustify${mobileJustify.charAt(0).toUpperCase()}${mobileJustify.slice(1)}`] : void 0,
|
|
35
43
|
mobileWrap ? styles.mobileWrap : void 0,
|
|
44
|
+
maxWidth != null ? styles.maxWidth : void 0,
|
|
36
45
|
className
|
|
37
46
|
].filter(Boolean).join(" ");
|
|
38
|
-
return /* @__PURE__ */ jsx(Tag, { ref, className: classes, ...rest });
|
|
47
|
+
return /* @__PURE__ */ jsx(Tag, { ref, className: classes, style: resolvedStyle, ...rest });
|
|
39
48
|
});
|
|
40
49
|
|
|
41
50
|
export { Stack };
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
.maxWidth {
|
|
2
|
+
max-width: var(--max-width-base);
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
@media (min-width: 768px) {
|
|
6
|
+
.maxWidth {
|
|
7
|
+
max-width: var(--max-width-md, var(--max-width-base));
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (min-width: 1200px) {
|
|
12
|
+
.maxWidth {
|
|
13
|
+
max-width: var(--max-width-lg, var(--max-width-md, var(--max-width-base)));
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
1
17
|
@media (max-width: 767px) {
|
|
2
18
|
.mobileDirectionRow {
|
|
3
19
|
flex-direction: row;
|
|
@@ -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);
|
|
@@ -83,11 +87,7 @@
|
|
|
83
87
|
transparent
|
|
84
88
|
);
|
|
85
89
|
--table-component-row-bg-hover: var(--color-bg-contextual-subtle);
|
|
86
|
-
--table-component-row-bg-selected: color-mix(
|
|
87
|
-
in srgb,
|
|
88
|
-
var(--color-bg-selected) 55%,
|
|
89
|
-
transparent
|
|
90
|
-
);
|
|
90
|
+
--table-component-row-bg-selected: color-mix(in srgb, var(--color-bg-selected) 55%, transparent);
|
|
91
91
|
--table-component-row-bg-selected-hover: color-mix(
|
|
92
92
|
in srgb,
|
|
93
93
|
var(--color-bg-selected-hover) 60%,
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
min-block-size: 0;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
.body .row:first-child .cell {
|
|
145
|
+
[data-show-header='true'] .body .row:first-child .cell {
|
|
146
146
|
border-block-start: var(--spacing-xs) solid var(--table-component-row-bg);
|
|
147
147
|
}
|
|
148
148
|
|
|
@@ -328,6 +328,17 @@
|
|
|
328
328
|
word-break: normal;
|
|
329
329
|
}
|
|
330
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
|
+
|
|
331
342
|
.thInner {
|
|
332
343
|
display: flex;
|
|
333
344
|
align-items: center;
|
|
@@ -489,15 +500,25 @@
|
|
|
489
500
|
text-overflow: ellipsis;
|
|
490
501
|
}
|
|
491
502
|
|
|
492
|
-
.
|
|
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 {
|
|
493
512
|
text-align: left;
|
|
494
513
|
}
|
|
495
514
|
|
|
496
|
-
.cellContent[data-align='center'] .cellValueEllipsis
|
|
515
|
+
.cellContent[data-align='center'] .cellValueEllipsis,
|
|
516
|
+
.cellContent[data-align='center'] .cellValueNoEllipsis {
|
|
497
517
|
text-align: center;
|
|
498
518
|
}
|
|
499
519
|
|
|
500
|
-
.cellContent[data-align='right'] .cellValueEllipsis
|
|
520
|
+
.cellContent[data-align='right'] .cellValueEllipsis,
|
|
521
|
+
.cellContent[data-align='right'] .cellValueNoEllipsis {
|
|
501
522
|
text-align: right;
|
|
502
523
|
}
|
|
503
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(
|
|
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(
|
|
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
|
},
|
package/dist/styles/styles.css
CHANGED
|
@@ -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