@dbcdk/react-components 0.0.157 → 0.0.159
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/accordion/components/AccordionRow.cjs +1 -1
- package/dist/components/accordion/components/AccordionRow.js +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +3 -6
- package/dist/components/button/Button.module.css +1 -1
- package/dist/components/forms/input/Input.module.css +12 -0
- package/dist/components/forms/radio-buttons/RadioButtons.module.css +10 -3
- package/dist/components/headline/CollapsibleHeadline.cjs +1 -0
- package/dist/components/headline/CollapsibleHeadline.js +1 -0
- package/dist/components/headline/Headline.module.css +2 -26
- package/dist/components/icon/Icon.cjs +16 -5
- package/dist/components/icon/Icon.d.ts +3 -1
- package/dist/components/icon/Icon.js +17 -6
- package/dist/components/icon/Icon.module.css +1 -1
- package/dist/components/menu/Menu.module.css +12 -0
- package/dist/components/nav-bar/NavBar.cjs +4 -1
- package/dist/components/nav-bar/NavBar.js +4 -1
- package/dist/components/nav-bar/NavBar.module.css +18 -0
- package/dist/components/sidebar/Sidebar.cjs +2 -0
- package/dist/components/sidebar/Sidebar.d.ts +1 -1
- package/dist/components/sidebar/Sidebar.js +2 -0
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.cjs +6 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.d.ts +1 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.js +6 -1
- package/dist/components/sidebar/components/sidebar-container/SidebarContainer.module.css +30 -2
- package/dist/components/table/Table.cjs +17 -3
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/Table.js +18 -4
- package/dist/components/table/Table.module.css +57 -50
- package/dist/components/table/Table.types.d.ts +1 -1
- package/dist/components/table/components/TableBody.cjs +9 -5
- package/dist/components/table/components/TableBody.d.ts +4 -2
- package/dist/components/table/components/TableBody.js +9 -5
- package/dist/components/table/components/TableHeaderCell.cjs +3 -4
- package/dist/components/table/components/TableHeaderCell.js +4 -5
- package/dist/components/table/components/TableRow.cjs +39 -18
- package/dist/components/table/components/TableRow.d.ts +4 -1
- package/dist/components/table/components/TableRow.js +40 -19
- package/dist/components/table/components/table-settings/TableSettings.cjs +1 -1
- package/dist/components/table/components/table-settings/TableSettings.js +2 -2
- package/dist/components/table/table.utils.cjs +2 -0
- package/dist/components/table/table.utils.d.ts +1 -0
- package/dist/components/table/table.utils.js +2 -1
- package/dist/components/tabs/Tabs.module.css +1 -1
- package/dist/styles/styles.css +37 -61
- package/dist/styles/themes/dbc/colors.css +8 -3
- package/dist/styles/themes/filmstriben-budget/theme.css +22 -0
- package/dist/styles.css +37 -61
- package/dist/themes/filmstriben-budget.css +3 -0
- package/dist/utils/date/formatDate.cjs +15 -1
- package/dist/utils/date/formatDate.d.ts +9 -1
- package/dist/utils/date/formatDate.js +15 -1
- package/package.json +1 -1
|
@@ -57,7 +57,7 @@ function AccordionRow({
|
|
|
57
57
|
renderMode = "lazy"
|
|
58
58
|
}) {
|
|
59
59
|
const isDisabled = !!item.disabled;
|
|
60
|
-
const headlineWeight =
|
|
60
|
+
const headlineWeight = variant === "outlined" ? 400 : 500;
|
|
61
61
|
const buttonId = `${uid}-acc-btn-${index}`;
|
|
62
62
|
const panelId = `${uid}-acc-panel-${index}`;
|
|
63
63
|
const { innerRef, height, onTransitionEnd } = useCollapsibleHeight(isOpen, shouldAnimate);
|
|
@@ -51,7 +51,7 @@ function AccordionRow({
|
|
|
51
51
|
renderMode = "lazy"
|
|
52
52
|
}) {
|
|
53
53
|
const isDisabled = !!item.disabled;
|
|
54
|
-
const headlineWeight =
|
|
54
|
+
const headlineWeight = variant === "outlined" ? 400 : 500;
|
|
55
55
|
const buttonId = `${uid}-acc-btn-${index}`;
|
|
56
56
|
const panelId = `${uid}-acc-panel-${index}`;
|
|
57
57
|
const { innerRef, height, onTransitionEnd } = useCollapsibleHeight(isOpen, shouldAnimate);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
.breadcrumbs ul {
|
|
6
6
|
display: flex;
|
|
7
7
|
align-items: center;
|
|
8
|
+
gap: var(--spacing-xs);
|
|
8
9
|
list-style: none;
|
|
9
10
|
margin: 0;
|
|
10
11
|
padding: 0;
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
gap: var(--spacing-xxs);
|
|
18
19
|
padding-block: calc(var(--spacing-xxs) + var(--density));
|
|
19
20
|
padding-inline: 0;
|
|
20
|
-
color: var(--color-fg-
|
|
21
|
+
color: var(--color-fg-muted);
|
|
21
22
|
border-radius: var(--border-radius-sm);
|
|
22
23
|
position: relative;
|
|
23
24
|
transition:
|
|
@@ -27,7 +28,6 @@
|
|
|
27
28
|
|
|
28
29
|
.breadcrumbs li:hover button {
|
|
29
30
|
color: var(--color-fg-default);
|
|
30
|
-
background-color: var(--color-bg-contextual);
|
|
31
31
|
cursor: pointer;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -39,14 +39,12 @@
|
|
|
39
39
|
|
|
40
40
|
.breadcrumbs li[aria-current='page'] button,
|
|
41
41
|
.breadcrumbs li:last-of-type button {
|
|
42
|
-
background-color: var(--color-bg-contextual) !important;
|
|
43
42
|
font-weight: var(--font-weight-medium);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.separator {
|
|
47
46
|
display: flex;
|
|
48
47
|
align-items: center;
|
|
49
|
-
padding: 0 var(--spacing-xs);
|
|
50
48
|
color: var(--color-fg-subtle);
|
|
51
49
|
font-size: var(--font-size-md);
|
|
52
50
|
}
|
|
@@ -62,8 +60,7 @@
|
|
|
62
60
|
all: unset;
|
|
63
61
|
color: inherit;
|
|
64
62
|
border-radius: var(--border-radius-default);
|
|
65
|
-
|
|
66
|
-
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
63
|
+
padding-block: var(--spacing-xxs);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
.breadcrumbs a:focus-visible,
|
|
@@ -464,3 +464,15 @@
|
|
|
464
464
|
min-inline-size: calc(16px + (var(--spacing-xxs) * 2));
|
|
465
465
|
min-block-size: calc(16px + (var(--spacing-xxs) * 2));
|
|
466
466
|
}
|
|
467
|
+
|
|
468
|
+
.clearSlot > * {
|
|
469
|
+
opacity: 0;
|
|
470
|
+
pointer-events: none;
|
|
471
|
+
transition: opacity var(--transition-fast) var(--ease-standard);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.field:hover .clearSlot > *,
|
|
475
|
+
.field:focus-within .clearSlot > * {
|
|
476
|
+
opacity: 1;
|
|
477
|
+
pointer-events: auto;
|
|
478
|
+
}
|
|
@@ -56,9 +56,16 @@
|
|
|
56
56
|
transform: scale(1);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/* hover (only when not disabled)
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
/* hover (only when not disabled/checked) — triggers from anywhere in the
|
|
60
|
+
control, not just the input itself, so hovering the label or an
|
|
61
|
+
interactive endAdornment (e.g. a menu trigger) also highlights the radio
|
|
62
|
+
icon. Reads a CSS variable (rather than a hardcoded color) so an
|
|
63
|
+
ancestor outside this module — e.g. a Menu row that already shows its
|
|
64
|
+
own hover feedback — can suppress this by setting the variable; that
|
|
65
|
+
works across CSS-module file boundaries where class-name hashing would
|
|
66
|
+
otherwise prevent one module's selectors from targeting another's. */
|
|
67
|
+
.container:hover .radio:not(.disabled):not(.checked) {
|
|
68
|
+
border-color: var(--radio-hover-border-color, var(--color-brand-hover));
|
|
62
69
|
}
|
|
63
70
|
|
|
64
71
|
/* focus ring */
|
|
@@ -52,34 +52,10 @@
|
|
|
52
52
|
display: contents;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/* CollapsibleHeadline toggle button */
|
|
56
|
-
.toggleButton {
|
|
57
|
-
all: unset;
|
|
58
|
-
box-sizing: border-box;
|
|
59
|
-
display: inline-flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
justify-content: center;
|
|
62
|
-
flex: 0 0 auto;
|
|
63
|
-
padding: var(--spacing-2xs);
|
|
64
|
-
border-radius: var(--border-radius-sm);
|
|
65
|
-
cursor: pointer;
|
|
66
|
-
color: var(--color-fg-subtle);
|
|
67
|
-
transition: color var(--transition-fast) var(--ease-standard);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.toggleButton:hover {
|
|
71
|
-
color: var(--color-fg-default);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.toggleButton:focus-visible {
|
|
75
|
-
outline: none;
|
|
76
|
-
box-shadow: var(--focus-ring);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
55
|
.toggleChevron {
|
|
80
56
|
display: block;
|
|
81
|
-
width:
|
|
82
|
-
height:
|
|
57
|
+
width: 0.85em;
|
|
58
|
+
height: 0.85em;
|
|
83
59
|
transition: transform var(--transition-normal) var(--ease-standard);
|
|
84
60
|
}
|
|
85
61
|
|
|
@@ -17,11 +17,22 @@ const SeverityIcon = {
|
|
|
17
17
|
brand: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, {}),
|
|
18
18
|
accent: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, {})
|
|
19
19
|
};
|
|
20
|
-
function Icon({
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
function Icon({
|
|
21
|
+
severity,
|
|
22
|
+
label,
|
|
23
|
+
customIcon,
|
|
24
|
+
size = "md",
|
|
25
|
+
iconPosition = "start"
|
|
26
|
+
}) {
|
|
27
|
+
const iconEl = /* @__PURE__ */ jsxRuntime.jsx("span", { className: `${styles__default.default.icon} ${severity ? styles__default.default[severity] : ""} dbc-icon`, children: customIcon ? customIcon : severity ? SeverityIcon[severity] : null });
|
|
28
|
+
const labelEl = label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label });
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.container, "data-size": size, children: iconPosition === "end" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
30
|
+
labelEl,
|
|
31
|
+
iconEl
|
|
32
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33
|
+
iconEl,
|
|
34
|
+
labelEl
|
|
35
|
+
] }) });
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
exports.Icon = Icon;
|
|
@@ -2,11 +2,13 @@ import type { ReactNode, JSX } from 'react';
|
|
|
2
2
|
import { Severity } from '../../constants/severity.types';
|
|
3
3
|
export declare const SeverityIcon: Record<Severity, ReactNode>;
|
|
4
4
|
type IconSize = 'xs' | 'md';
|
|
5
|
+
type IconPosition = 'start' | 'end';
|
|
5
6
|
interface IconProps {
|
|
6
7
|
severity?: Severity;
|
|
7
8
|
customIcon?: ReactNode;
|
|
8
9
|
label?: string;
|
|
9
10
|
size?: IconSize;
|
|
11
|
+
iconPosition?: IconPosition;
|
|
10
12
|
}
|
|
11
|
-
export declare function Icon({ severity, label, customIcon, size }: IconProps): JSX.Element;
|
|
13
|
+
export declare function Icon({ severity, label, customIcon, size, iconPosition, }: IconProps): JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Sparkles, Building2, CircleAlert, Info, CircleX, CircleCheck } from 'lucide-react';
|
|
3
3
|
import styles from './Icon.module.css';
|
|
4
4
|
|
|
@@ -11,11 +11,22 @@ const SeverityIcon = {
|
|
|
11
11
|
brand: /* @__PURE__ */ jsx(Building2, {}),
|
|
12
12
|
accent: /* @__PURE__ */ jsx(Sparkles, {})
|
|
13
13
|
};
|
|
14
|
-
function Icon({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
function Icon({
|
|
15
|
+
severity,
|
|
16
|
+
label,
|
|
17
|
+
customIcon,
|
|
18
|
+
size = "md",
|
|
19
|
+
iconPosition = "start"
|
|
20
|
+
}) {
|
|
21
|
+
const iconEl = /* @__PURE__ */ jsx("span", { className: `${styles.icon} ${severity ? styles[severity] : ""} dbc-icon`, children: customIcon ? customIcon : severity ? SeverityIcon[severity] : null });
|
|
22
|
+
const labelEl = label && /* @__PURE__ */ jsx("span", { children: label });
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { className: styles.container, "data-size": size, children: iconPosition === "end" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
labelEl,
|
|
25
|
+
iconEl
|
|
26
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
iconEl,
|
|
28
|
+
labelEl
|
|
29
|
+
] }) });
|
|
19
30
|
}
|
|
20
31
|
|
|
21
32
|
export { Icon, SeverityIcon };
|
|
@@ -133,6 +133,18 @@
|
|
|
133
133
|
background-color: var(--color-bg-toolbar-hover);
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
/* The row already conveys hover via the background color above, covering
|
|
137
|
+
the whole item consistently. Suppress RadioButton's own icon hover
|
|
138
|
+
border here — otherwise it only lights up when the pointer happens to
|
|
139
|
+
be over the icon/label/endAdornment rather than anywhere in the row.
|
|
140
|
+
RadioButton's hashed class names can't be targeted directly from this
|
|
141
|
+
module, so this relies on a CSS custom property that RadioButton's own
|
|
142
|
+
hover rule reads — custom properties inherit through the DOM regardless
|
|
143
|
+
of CSS-module class hashing. */
|
|
144
|
+
.row:hover > .interactiveChild {
|
|
145
|
+
--radio-hover-border-color: var(--color-border-default);
|
|
146
|
+
}
|
|
147
|
+
|
|
136
148
|
/* Focus ring: support both cases */
|
|
137
149
|
.interactive:focus-visible {
|
|
138
150
|
outline: none;
|
|
@@ -48,7 +48,10 @@ function NavBar({
|
|
|
48
48
|
});
|
|
49
49
|
const productNameContent = productName ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
50
50
|
/* @__PURE__ */ jsxRuntime.jsx(logo.Logo, {}),
|
|
51
|
-
/* @__PURE__ */ jsxRuntime.
|
|
51
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.productNameLabel, children: [
|
|
52
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.productNameSquare }),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { disableMargin: true, size: 1, children: productName })
|
|
54
|
+
] })
|
|
52
55
|
] }) : null;
|
|
53
56
|
const productNameNode = (() => {
|
|
54
57
|
if (!productName || !productNameContent) return null;
|
|
@@ -42,7 +42,10 @@ function NavBar({
|
|
|
42
42
|
});
|
|
43
43
|
const productNameContent = productName ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
44
44
|
/* @__PURE__ */ jsx(Logo, {}),
|
|
45
|
-
/* @__PURE__ */
|
|
45
|
+
/* @__PURE__ */ jsxs("span", { className: styles.productNameLabel, children: [
|
|
46
|
+
/* @__PURE__ */ jsx("span", { className: styles.productNameSquare }),
|
|
47
|
+
/* @__PURE__ */ jsx(Headline, { disableMargin: true, size: 1, children: productName })
|
|
48
|
+
] })
|
|
46
49
|
] }) : null;
|
|
47
50
|
const productNameNode = (() => {
|
|
48
51
|
if (!productName || !productNameContent) return null;
|
|
@@ -111,6 +111,24 @@
|
|
|
111
111
|
color: inherit;
|
|
112
112
|
text-decoration: none;
|
|
113
113
|
}
|
|
114
|
+
|
|
115
|
+
.productNameLabel {
|
|
116
|
+
display: inline-flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
gap: var(--spacing-xs);
|
|
119
|
+
color: var(--color-fg-default);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.productNameSquare {
|
|
123
|
+
inline-size: 5px;
|
|
124
|
+
block-size: 5px;
|
|
125
|
+
flex: 0 0 auto;
|
|
126
|
+
background-color: var(--color-logo);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.productNameLabel h1 {
|
|
130
|
+
font-size: var(--font-size-sm);
|
|
131
|
+
}
|
|
114
132
|
.productName svg {
|
|
115
133
|
inline-size: auto;
|
|
116
134
|
block-size: var(--icon-size-md);
|
|
@@ -6,6 +6,7 @@ var SidebarProvider = require('./providers/SidebarProvider');
|
|
|
6
6
|
|
|
7
7
|
function Sidebar({
|
|
8
8
|
items,
|
|
9
|
+
productName,
|
|
9
10
|
productLogo,
|
|
10
11
|
activeLink,
|
|
11
12
|
version,
|
|
@@ -21,6 +22,7 @@ function Sidebar({
|
|
|
21
22
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarProvider.SidebarProvider, { items, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
22
23
|
SidebarContainer.SidebarContainer,
|
|
23
24
|
{
|
|
25
|
+
productName,
|
|
24
26
|
productLogo,
|
|
25
27
|
activeLink,
|
|
26
28
|
version,
|
|
@@ -19,5 +19,5 @@ interface SidebarProps {
|
|
|
19
19
|
minWidth?: number;
|
|
20
20
|
storageKey?: string;
|
|
21
21
|
}
|
|
22
|
-
export declare function Sidebar({ items, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarProps): JSX.Element;
|
|
22
|
+
export declare function Sidebar({ items, productName, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarProps): JSX.Element;
|
|
23
23
|
export {};
|
|
@@ -4,6 +4,7 @@ import { SidebarProvider } from './providers/SidebarProvider';
|
|
|
4
4
|
|
|
5
5
|
function Sidebar({
|
|
6
6
|
items,
|
|
7
|
+
productName,
|
|
7
8
|
productLogo,
|
|
8
9
|
activeLink,
|
|
9
10
|
version,
|
|
@@ -19,6 +20,7 @@ function Sidebar({
|
|
|
19
20
|
return /* @__PURE__ */ jsx(SidebarProvider, { items, children: /* @__PURE__ */ jsx(
|
|
20
21
|
SidebarContainer,
|
|
21
22
|
{
|
|
23
|
+
productName,
|
|
22
24
|
productLogo,
|
|
23
25
|
activeLink,
|
|
24
26
|
version,
|
|
@@ -6,6 +6,7 @@ var lucideReact = require('lucide-react');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var logo = require('../../../../assets/logo');
|
|
8
8
|
var Button = require('../../../../components/button/Button');
|
|
9
|
+
var Headline = require('../../../../components/headline/Headline');
|
|
9
10
|
var SidebarItems = require('../../../../components/sidebar/components/sidebar-items/SidebarItems');
|
|
10
11
|
var SidenavFiltering = require('../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering');
|
|
11
12
|
var SidebarProvider = require('../../../../components/sidebar/providers/SidebarProvider');
|
|
@@ -43,6 +44,7 @@ function removeStoredWidth(key) {
|
|
|
43
44
|
}
|
|
44
45
|
function SidebarContainer({
|
|
45
46
|
logo: logo$1,
|
|
47
|
+
productName,
|
|
46
48
|
productLogo,
|
|
47
49
|
activeLink,
|
|
48
50
|
version,
|
|
@@ -165,7 +167,10 @@ function SidebarContainer({
|
|
|
165
167
|
style: containerStyle,
|
|
166
168
|
children: [
|
|
167
169
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.header, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.productHeader, children: [
|
|
168
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productLogo, children: productLogo }),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productGroup, children: productLogo ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.productLogo, children: productLogo }) : productName && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.productNameLabel, children: [
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.productNameSquare }),
|
|
172
|
+
/* @__PURE__ */ jsxRuntime.jsx(Headline.Headline, { disableMargin: true, size: 1, allowWrap: false, children: productName })
|
|
173
|
+
] }) }),
|
|
169
174
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
170
175
|
Button.Button,
|
|
171
176
|
{
|
|
@@ -14,5 +14,5 @@ interface SidebarContainerProps {
|
|
|
14
14
|
minWidth?: number;
|
|
15
15
|
storageKey?: string;
|
|
16
16
|
}
|
|
17
|
-
export declare function SidebarContainer({ logo, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarContainerProps): JSX.Element;
|
|
17
|
+
export declare function SidebarContainer({ logo, productName, productLogo, activeLink, version, hideSearch, searchPlaceholder, showSettings, footer, resizable, defaultWidth, minWidth, storageKey, }: SidebarContainerProps): JSX.Element;
|
|
18
18
|
export {};
|
|
@@ -4,6 +4,7 @@ import { PanelLeftOpen, PanelLeft } from 'lucide-react';
|
|
|
4
4
|
import { useState, useRef, useCallback, useEffect, useMemo } from 'react';
|
|
5
5
|
import { Logo } from '../../../../assets/logo';
|
|
6
6
|
import { Button } from '../../../../components/button/Button';
|
|
7
|
+
import { Headline } from '../../../../components/headline/Headline';
|
|
7
8
|
import { SidebarItems } from '../../../../components/sidebar/components/sidebar-items/SidebarItems';
|
|
8
9
|
import SidenavFiltering from '../../../../components/sidebar/components/sidenav-filteirng/SidenavFiltering';
|
|
9
10
|
import { useSidebar } from '../../../../components/sidebar/providers/SidebarProvider';
|
|
@@ -36,6 +37,7 @@ function removeStoredWidth(key) {
|
|
|
36
37
|
}
|
|
37
38
|
function SidebarContainer({
|
|
38
39
|
logo,
|
|
40
|
+
productName,
|
|
39
41
|
productLogo,
|
|
40
42
|
activeLink,
|
|
41
43
|
version,
|
|
@@ -158,7 +160,10 @@ function SidebarContainer({
|
|
|
158
160
|
style: containerStyle,
|
|
159
161
|
children: [
|
|
160
162
|
/* @__PURE__ */ jsx("div", { className: styles.header, children: /* @__PURE__ */ jsxs("div", { className: styles.productHeader, children: [
|
|
161
|
-
/* @__PURE__ */ jsx("div", { className: styles.productLogo, children: productLogo }),
|
|
163
|
+
/* @__PURE__ */ jsx("div", { className: styles.productGroup, children: productLogo ? /* @__PURE__ */ jsx("div", { className: styles.productLogo, children: productLogo }) : productName && /* @__PURE__ */ jsxs("span", { className: styles.productNameLabel, children: [
|
|
164
|
+
/* @__PURE__ */ jsx("span", { className: styles.productNameSquare }),
|
|
165
|
+
/* @__PURE__ */ jsx(Headline, { disableMargin: true, size: 1, allowWrap: false, children: productName })
|
|
166
|
+
] }) }),
|
|
162
167
|
/* @__PURE__ */ jsx(
|
|
163
168
|
Button,
|
|
164
169
|
{
|
|
@@ -64,6 +64,15 @@
|
|
|
64
64
|
flex-grow: 1;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* Product logo + name group */
|
|
68
|
+
.productGroup {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: var(--spacing-xs);
|
|
72
|
+
min-width: 0;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
}
|
|
75
|
+
|
|
67
76
|
/* Product logo container */
|
|
68
77
|
.productLogo {
|
|
69
78
|
display: flex;
|
|
@@ -73,6 +82,25 @@
|
|
|
73
82
|
min-width: 0;
|
|
74
83
|
}
|
|
75
84
|
|
|
85
|
+
.productNameLabel {
|
|
86
|
+
display: inline-flex;
|
|
87
|
+
align-items: center;
|
|
88
|
+
gap: var(--spacing-xxs);
|
|
89
|
+
color: var(--color-fg-default);
|
|
90
|
+
min-width: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.productNameSquare {
|
|
94
|
+
inline-size: 7px;
|
|
95
|
+
block-size: 7px;
|
|
96
|
+
flex: 0 0 auto;
|
|
97
|
+
background-color: var(--color-logo);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.productNameLabel h1 {
|
|
101
|
+
font-size: var(--font-size-md);
|
|
102
|
+
}
|
|
103
|
+
|
|
76
104
|
/* Let wrapper elements such as Next.js <Link> inherit the logo sizing context */
|
|
77
105
|
.productLogo > * {
|
|
78
106
|
display: flex;
|
|
@@ -245,8 +273,8 @@
|
|
|
245
273
|
}
|
|
246
274
|
|
|
247
275
|
/* === Collapsed header behavior ===
|
|
248
|
-
Hide product logo entirely so the collapse button can truly center. */
|
|
249
|
-
.container.collapsed .
|
|
276
|
+
Hide product logo + name entirely so the collapse button can truly center. */
|
|
277
|
+
.container.collapsed .productGroup {
|
|
250
278
|
display: none;
|
|
251
279
|
}
|
|
252
280
|
|
|
@@ -31,7 +31,6 @@ function Table({
|
|
|
31
31
|
variant = "primary",
|
|
32
32
|
size = "md",
|
|
33
33
|
viewMode,
|
|
34
|
-
striped,
|
|
35
34
|
fillViewport = false,
|
|
36
35
|
fillViewportBottomOffset = 16,
|
|
37
36
|
containScrolling = true,
|
|
@@ -53,6 +52,7 @@ function Table({
|
|
|
53
52
|
getRowSeverity,
|
|
54
53
|
getContextMenuItems,
|
|
55
54
|
showContextMenuOnHover = true,
|
|
55
|
+
expandableRows = false,
|
|
56
56
|
onRowClick,
|
|
57
57
|
onRowMouseEnter,
|
|
58
58
|
onRowSelect,
|
|
@@ -67,6 +67,18 @@ function Table({
|
|
|
67
67
|
const tableRootRefWrapper = react.useRef(tableRootRef);
|
|
68
68
|
const hasSelection = Boolean(selectedRows && onRowSelect);
|
|
69
69
|
const hasPagination = Boolean(onPageChange && (loading || data.length > 0));
|
|
70
|
+
const [expandedRows, setExpandedRows] = react.useState(() => /* @__PURE__ */ new Set());
|
|
71
|
+
const handleToggleRowExpand = react.useCallback((rowId) => {
|
|
72
|
+
setExpandedRows((prev) => {
|
|
73
|
+
const next = new Set(prev);
|
|
74
|
+
if (next.has(rowId)) {
|
|
75
|
+
next.delete(rowId);
|
|
76
|
+
} else {
|
|
77
|
+
next.add(rowId);
|
|
78
|
+
}
|
|
79
|
+
return next;
|
|
80
|
+
});
|
|
81
|
+
}, []);
|
|
70
82
|
const paginationOffset = hasPagination ? 72 : 0;
|
|
71
83
|
const { style: viewportFillStyle, maxHeight } = useViewportFill.useViewportFill(internalTableRootRef, {
|
|
72
84
|
bottomOffset: fillViewportBottomOffset + paginationOffset,
|
|
@@ -94,7 +106,6 @@ function Table({
|
|
|
94
106
|
data,
|
|
95
107
|
dataKey,
|
|
96
108
|
columns: visibleColumns,
|
|
97
|
-
striped,
|
|
98
109
|
selectedRows,
|
|
99
110
|
hasSelection,
|
|
100
111
|
selectionMode,
|
|
@@ -103,9 +114,12 @@ function Table({
|
|
|
103
114
|
getRowSeverity,
|
|
104
115
|
getContextMenuItems,
|
|
105
116
|
showContextMenuOnHover,
|
|
117
|
+
expandableRows,
|
|
118
|
+
expandedRows,
|
|
106
119
|
onRowClick,
|
|
107
120
|
onRowMouseEnter,
|
|
108
|
-
onRowSelect
|
|
121
|
+
onRowSelect,
|
|
122
|
+
onToggleRowExpand: handleToggleRowExpand
|
|
109
123
|
}
|
|
110
124
|
);
|
|
111
125
|
const paginationEl = hasPagination ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -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,
|
|
3
|
+
export declare function Table<T extends Record<string, any>>({ data, dataKey, columns, selectedRows, selectionMode, allRowsSelected, sortById, sortDirection, loading, emptyConfig, variant, size, viewMode, fillViewport, fillViewportBottomOffset, containScrolling, stickyHeader, tableWidth, tableRootRef, measuringLayout, toolbar, headerExtras, take, skip, totalItemsCount, paginationPlacement, showFirstLast, showGoToPage, showPageSize, pageSizeOptions, showHeader, getRowSeverity, getContextMenuItems, showContextMenuOnHover, expandableRows, onRowClick, onRowMouseEnter, onRowSelect, onSelectAllRows, onSortChange, onPageChange, ...rest }: TableProps<T>): JSX.Element;
|
|
4
4
|
export type { ColumnItem } from './Table.types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useMemo, useId, useRef, useCallback } from 'react';
|
|
3
|
+
import { useMemo, useId, useRef, useState, useCallback } from 'react';
|
|
4
4
|
import { Pagination } from '../../components/pagination/Pagination';
|
|
5
5
|
import { SkeletonLoader } from '../../components/skeleton-loader/SkeletonLoader';
|
|
6
6
|
import { useViewportFill } from '../../hooks/useViewportFill';
|
|
@@ -25,7 +25,6 @@ function Table({
|
|
|
25
25
|
variant = "primary",
|
|
26
26
|
size = "md",
|
|
27
27
|
viewMode,
|
|
28
|
-
striped,
|
|
29
28
|
fillViewport = false,
|
|
30
29
|
fillViewportBottomOffset = 16,
|
|
31
30
|
containScrolling = true,
|
|
@@ -47,6 +46,7 @@ function Table({
|
|
|
47
46
|
getRowSeverity,
|
|
48
47
|
getContextMenuItems,
|
|
49
48
|
showContextMenuOnHover = true,
|
|
49
|
+
expandableRows = false,
|
|
50
50
|
onRowClick,
|
|
51
51
|
onRowMouseEnter,
|
|
52
52
|
onRowSelect,
|
|
@@ -61,6 +61,18 @@ function Table({
|
|
|
61
61
|
const tableRootRefWrapper = useRef(tableRootRef);
|
|
62
62
|
const hasSelection = Boolean(selectedRows && onRowSelect);
|
|
63
63
|
const hasPagination = Boolean(onPageChange && (loading || data.length > 0));
|
|
64
|
+
const [expandedRows, setExpandedRows] = useState(() => /* @__PURE__ */ new Set());
|
|
65
|
+
const handleToggleRowExpand = useCallback((rowId) => {
|
|
66
|
+
setExpandedRows((prev) => {
|
|
67
|
+
const next = new Set(prev);
|
|
68
|
+
if (next.has(rowId)) {
|
|
69
|
+
next.delete(rowId);
|
|
70
|
+
} else {
|
|
71
|
+
next.add(rowId);
|
|
72
|
+
}
|
|
73
|
+
return next;
|
|
74
|
+
});
|
|
75
|
+
}, []);
|
|
64
76
|
const paginationOffset = hasPagination ? 72 : 0;
|
|
65
77
|
const { style: viewportFillStyle, maxHeight } = useViewportFill(internalTableRootRef, {
|
|
66
78
|
bottomOffset: fillViewportBottomOffset + paginationOffset,
|
|
@@ -88,7 +100,6 @@ function Table({
|
|
|
88
100
|
data,
|
|
89
101
|
dataKey,
|
|
90
102
|
columns: visibleColumns,
|
|
91
|
-
striped,
|
|
92
103
|
selectedRows,
|
|
93
104
|
hasSelection,
|
|
94
105
|
selectionMode,
|
|
@@ -97,9 +108,12 @@ function Table({
|
|
|
97
108
|
getRowSeverity,
|
|
98
109
|
getContextMenuItems,
|
|
99
110
|
showContextMenuOnHover,
|
|
111
|
+
expandableRows,
|
|
112
|
+
expandedRows,
|
|
100
113
|
onRowClick,
|
|
101
114
|
onRowMouseEnter,
|
|
102
|
-
onRowSelect
|
|
115
|
+
onRowSelect,
|
|
116
|
+
onToggleRowExpand: handleToggleRowExpand
|
|
103
117
|
}
|
|
104
118
|
);
|
|
105
119
|
const paginationEl = hasPagination ? /* @__PURE__ */ jsx(
|