@dbcdk/react-components 0.0.155 → 0.0.157
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.module.css +0 -4
- package/dist/components/alert/Alert.module.css +0 -1
- package/dist/components/button/Button.module.css +4 -1
- package/dist/components/card/Card.module.css +5 -1
- package/dist/components/icon/Icon.cjs +2 -2
- package/dist/components/icon/Icon.d.ts +3 -1
- package/dist/components/icon/Icon.js +2 -2
- package/dist/components/icon/Icon.module.css +9 -0
- package/dist/components/nav-bar/NavBar.module.css +1 -1
- package/dist/components/page/Page.cjs +6 -5
- package/dist/components/page/Page.js +6 -5
- package/dist/components/page-layout/PageLayout.cjs +5 -2
- package/dist/components/page-layout/PageLayout.d.ts +2 -1
- package/dist/components/page-layout/PageLayout.js +5 -2
- package/dist/components/page-layout/PageLayout.module.css +33 -10
- package/dist/components/table/Table.module.css +18 -7
- package/dist/components/tabs/Tabs.module.css +1 -1
- package/dist/styles/styles.css +2 -1
- package/dist/styles.css +2 -1
- package/package.json +1 -1
|
@@ -114,10 +114,6 @@
|
|
|
114
114
|
border-bottom: var(--acc-item-separator, none);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
.item[data-state='open'] .headerRow {
|
|
118
|
-
background: var(--color-bg-contextual);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
117
|
:global(.outlined) .item[data-state='open'] .headerRow {
|
|
122
118
|
box-shadow: inset 3px 0 0 var(--color-border-selected);
|
|
123
119
|
}
|
|
@@ -214,10 +214,13 @@
|
|
|
214
214
|
background-color: transparent;
|
|
215
215
|
border-color: transparent;
|
|
216
216
|
padding: var(--spacing-xxs);
|
|
217
|
+
color: var(--color-fg-default);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.button.inline:not(.sm):not(.lg):not(.xs) {
|
|
217
221
|
min-block-size: unset;
|
|
218
222
|
block-size: unset;
|
|
219
223
|
height: unset;
|
|
220
|
-
color: var(--color-fg-default);
|
|
221
224
|
}
|
|
222
225
|
|
|
223
226
|
.button.inline:hover {
|
|
@@ -17,8 +17,8 @@ const SeverityIcon = {
|
|
|
17
17
|
brand: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Building2, {}),
|
|
18
18
|
accent: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, {})
|
|
19
19
|
};
|
|
20
|
-
function Icon({ severity, label, customIcon }) {
|
|
21
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
20
|
+
function Icon({ severity, label, customIcon, size = "md" }) {
|
|
21
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.container, "data-size": size, children: [
|
|
22
22
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `${styles__default.default.icon} ${severity ? styles__default.default[severity] : ""} dbc-icon`, children: customIcon ? customIcon : severity ? SeverityIcon[severity] : null }),
|
|
23
23
|
label && /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
24
24
|
] });
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { ReactNode, JSX } from 'react';
|
|
2
2
|
import { Severity } from '../../constants/severity.types';
|
|
3
3
|
export declare const SeverityIcon: Record<Severity, ReactNode>;
|
|
4
|
+
type IconSize = 'xs' | 'md';
|
|
4
5
|
interface IconProps {
|
|
5
6
|
severity?: Severity;
|
|
6
7
|
customIcon?: ReactNode;
|
|
7
8
|
label?: string;
|
|
9
|
+
size?: IconSize;
|
|
8
10
|
}
|
|
9
|
-
export declare function Icon({ severity, label, customIcon }: IconProps): JSX.Element;
|
|
11
|
+
export declare function Icon({ severity, label, customIcon, size }: IconProps): JSX.Element;
|
|
10
12
|
export {};
|
|
@@ -11,8 +11,8 @@ const SeverityIcon = {
|
|
|
11
11
|
brand: /* @__PURE__ */ jsx(Building2, {}),
|
|
12
12
|
accent: /* @__PURE__ */ jsx(Sparkles, {})
|
|
13
13
|
};
|
|
14
|
-
function Icon({ severity, label, customIcon }) {
|
|
15
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
14
|
+
function Icon({ severity, label, customIcon, size = "md" }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.container, "data-size": size, children: [
|
|
16
16
|
/* @__PURE__ */ jsx("span", { className: `${styles.icon} ${severity ? styles[severity] : ""} dbc-icon`, children: customIcon ? customIcon : severity ? SeverityIcon[severity] : null }),
|
|
17
17
|
label && /* @__PURE__ */ jsx("span", { children: label })
|
|
18
18
|
] });
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
font-size: var(--font-size-sm);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.container[data-size='xs'] {
|
|
11
|
+
gap: 0;
|
|
12
|
+
font-size: var(--font-size-xs);
|
|
13
|
+
}
|
|
14
|
+
|
|
10
15
|
.icon {
|
|
11
16
|
display: flex;
|
|
12
17
|
}
|
|
@@ -16,6 +21,10 @@
|
|
|
16
21
|
width: auto;
|
|
17
22
|
}
|
|
18
23
|
|
|
24
|
+
.container[data-size='xs'] .icon svg {
|
|
25
|
+
height: var(--icon-size-sm);
|
|
26
|
+
}
|
|
27
|
+
|
|
19
28
|
.success {
|
|
20
29
|
color: var(--color-status-success);
|
|
21
30
|
}
|
|
@@ -27,15 +27,16 @@ function Page({
|
|
|
27
27
|
}) {
|
|
28
28
|
const showContentBox = contentBox && !disableContentBox;
|
|
29
29
|
const maxWidthClass = maxWidth ? styles__default.default[`maxWidth${maxWidth.charAt(0).toUpperCase()}${maxWidth.slice(1)}`] : "";
|
|
30
|
-
const
|
|
30
|
+
const showHeaderContainer = Boolean(header || headerAddition);
|
|
31
|
+
const showHeadline = Boolean(header || subheader);
|
|
31
32
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
33
|
"div",
|
|
33
34
|
{
|
|
34
35
|
className: `${styles__default.default.container} ${containScrolling ? styles__default.default.containScrolling : styles__default.default.documentScrolling} ${disableTopPadding ? styles__default.default.disableTopPadding : ""} ${maxWidthClass}`,
|
|
35
36
|
children: [
|
|
36
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.headerContainer, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.headerMain, children: [
|
|
37
|
+
showHeaderContainer ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles__default.default.headerContainer, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles__default.default.headerMain, children: [
|
|
37
38
|
breadcrumbs ? /* @__PURE__ */ jsxRuntime.jsx(Breadcrumbs.Breadcrumbs, { items: breadcrumbs }) : null,
|
|
38
|
-
|
|
39
|
+
showHeadline ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
40
|
Headline.Headline,
|
|
40
41
|
{
|
|
41
42
|
disableMargin: true,
|
|
@@ -46,8 +47,8 @@ function Page({
|
|
|
46
47
|
addition: headerAddition,
|
|
47
48
|
children: header
|
|
48
49
|
}
|
|
49
|
-
) :
|
|
50
|
-
] }) }),
|
|
50
|
+
) : headerAddition
|
|
51
|
+
] }) }) : null,
|
|
51
52
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
52
53
|
"div",
|
|
53
54
|
{
|
|
@@ -21,15 +21,16 @@ function Page({
|
|
|
21
21
|
}) {
|
|
22
22
|
const showContentBox = contentBox && !disableContentBox;
|
|
23
23
|
const maxWidthClass = maxWidth ? styles[`maxWidth${maxWidth.charAt(0).toUpperCase()}${maxWidth.slice(1)}`] : "";
|
|
24
|
-
const
|
|
24
|
+
const showHeaderContainer = Boolean(header || headerAddition);
|
|
25
|
+
const showHeadline = Boolean(header || subheader);
|
|
25
26
|
return /* @__PURE__ */ jsxs(
|
|
26
27
|
"div",
|
|
27
28
|
{
|
|
28
29
|
className: `${styles.container} ${containScrolling ? styles.containScrolling : styles.documentScrolling} ${disableTopPadding ? styles.disableTopPadding : ""} ${maxWidthClass}`,
|
|
29
30
|
children: [
|
|
30
|
-
/* @__PURE__ */ jsx("div", { className: styles.headerContainer, children: /* @__PURE__ */ jsxs("div", { className: styles.headerMain, children: [
|
|
31
|
+
showHeaderContainer ? /* @__PURE__ */ jsx("div", { className: styles.headerContainer, children: /* @__PURE__ */ jsxs("div", { className: styles.headerMain, children: [
|
|
31
32
|
breadcrumbs ? /* @__PURE__ */ jsx(Breadcrumbs, { items: breadcrumbs }) : null,
|
|
32
|
-
|
|
33
|
+
showHeadline ? /* @__PURE__ */ jsx(
|
|
33
34
|
Headline,
|
|
34
35
|
{
|
|
35
36
|
disableMargin: true,
|
|
@@ -40,8 +41,8 @@ function Page({
|
|
|
40
41
|
addition: headerAddition,
|
|
41
42
|
children: header
|
|
42
43
|
}
|
|
43
|
-
) :
|
|
44
|
-
] }) }),
|
|
44
|
+
) : headerAddition
|
|
45
|
+
] }) }) : null,
|
|
45
46
|
/* @__PURE__ */ jsx(
|
|
46
47
|
"div",
|
|
47
48
|
{
|
|
@@ -15,13 +15,16 @@ function getMaxWidthClass(value, styles2) {
|
|
|
15
15
|
return styles2.maxWidthMd;
|
|
16
16
|
}
|
|
17
17
|
const VALID_ENVIRONMENTS = ["production", "staging", "test"];
|
|
18
|
+
const ENVIRONMENT_ALIASES = { prod: "production" };
|
|
18
19
|
function resolveEnvBanner(environment, customEnv, customEnvSeverity) {
|
|
20
|
+
var _a;
|
|
19
21
|
if (customEnv != null && customEnvSeverity != null) {
|
|
20
22
|
return /* @__PURE__ */ jsxRuntime.jsx(EnvironmentBanner.EnvironmentBanner, { customLabel: customEnv, customSeverity: customEnvSeverity });
|
|
21
23
|
}
|
|
22
24
|
const normalised = environment == null ? void 0 : environment.toLowerCase();
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
const resolved = normalised != null ? (_a = ENVIRONMENT_ALIASES[normalised]) != null ? _a : normalised : void 0;
|
|
26
|
+
if (resolved != null && VALID_ENVIRONMENTS.includes(resolved)) {
|
|
27
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EnvironmentBanner.EnvironmentBanner, { environment: resolved });
|
|
25
28
|
}
|
|
26
29
|
return null;
|
|
27
30
|
}
|
|
@@ -11,7 +11,8 @@ export interface PageLayoutProps extends PropsWithChildren {
|
|
|
11
11
|
containScrolling?: boolean;
|
|
12
12
|
orientation?: Orientation;
|
|
13
13
|
/** Pass a deployment environment string (e.g. process.env.DEPLOYMENT_ENV).
|
|
14
|
-
* Renders a banner for 'production', 'staging', or 'test'.
|
|
14
|
+
* Renders a banner for 'production', 'staging', or 'test'. 'prod' is accepted as an alias for
|
|
15
|
+
* 'production'. Ignored for unknown values or undefined. */
|
|
15
16
|
environment?: string;
|
|
16
17
|
/** Custom banner label — requires customEnvSeverity. */
|
|
17
18
|
customEnv?: string;
|
|
@@ -9,13 +9,16 @@ function getMaxWidthClass(value, styles2) {
|
|
|
9
9
|
return styles2.maxWidthMd;
|
|
10
10
|
}
|
|
11
11
|
const VALID_ENVIRONMENTS = ["production", "staging", "test"];
|
|
12
|
+
const ENVIRONMENT_ALIASES = { prod: "production" };
|
|
12
13
|
function resolveEnvBanner(environment, customEnv, customEnvSeverity) {
|
|
14
|
+
var _a;
|
|
13
15
|
if (customEnv != null && customEnvSeverity != null) {
|
|
14
16
|
return /* @__PURE__ */ jsx(EnvironmentBanner, { customLabel: customEnv, customSeverity: customEnvSeverity });
|
|
15
17
|
}
|
|
16
18
|
const normalised = environment == null ? void 0 : environment.toLowerCase();
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
const resolved = normalised != null ? (_a = ENVIRONMENT_ALIASES[normalised]) != null ? _a : normalised : void 0;
|
|
20
|
+
if (resolved != null && VALID_ENVIRONMENTS.includes(resolved)) {
|
|
21
|
+
return /* @__PURE__ */ jsx(EnvironmentBanner, { environment: resolved });
|
|
19
22
|
}
|
|
20
23
|
return null;
|
|
21
24
|
}
|
|
@@ -64,17 +64,42 @@
|
|
|
64
64
|
grid-template-rows: auto 1fr;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
/* documentScrolling only has `min-height` (so long content can still grow the
|
|
68
|
+
page), which leaves the grid container's own block-size indefinite — and an
|
|
69
|
+
indefinite container makes the `1fr` row above size itself from its content
|
|
70
|
+
(i.e. from the sidebar's own capped height below) instead of from real
|
|
71
|
+
leftover viewport space. Any drift between --page-layout-banner-height's
|
|
72
|
+
estimate and the banner's real rendered height then inflated the whole page,
|
|
73
|
+
but only once the sidenav's content was tall enough to hit that cap — giving
|
|
74
|
+
this one combination a real, definite block-size makes the `1fr` row's size
|
|
75
|
+
come from the banner's actual rendered height, so the estimate is only ever
|
|
76
|
+
used below as a cap, never as the page's actual size. */
|
|
77
|
+
.documentScrolling.vertical.hasBanner {
|
|
78
|
+
height: 100vh;
|
|
79
|
+
height: 100dvh;
|
|
80
|
+
}
|
|
81
|
+
|
|
67
82
|
/* Sidebar */
|
|
68
83
|
.sidebar {
|
|
69
84
|
min-width: 0;
|
|
70
85
|
min-block-size: 0; /* CRITICAL: else a tall sidenav grows the grid row instead of scrolling */
|
|
71
86
|
overflow: hidden;
|
|
72
87
|
background: var(--color-bg-surface);
|
|
88
|
+
|
|
89
|
+
/* Hug the sidebar's own content width instead of stretching to fill the "auto"
|
|
90
|
+
column — some browsers size that column wider than the content once a
|
|
91
|
+
descendant scrollbar reserves space, leaving a visible gap otherwise. */
|
|
92
|
+
justify-self: start;
|
|
73
93
|
}
|
|
74
94
|
|
|
95
|
+
/* The Sidebar/SidebarContainer inside already owns its own internal scrolling
|
|
96
|
+
(its root is height:100%; overflow:auto). This wrapper only needs to cap the
|
|
97
|
+
available height — if it *also* reserves its own scrollbar, that scrollbar's
|
|
98
|
+
width gets folded into this box's max-content size (used by `justify-self:
|
|
99
|
+
start` above), making it a scrollbar's-width wider than the fixed-width
|
|
100
|
+
Sidebar inside and leaving a gap on the right edge. */
|
|
75
101
|
.containScrolling .sidebar {
|
|
76
|
-
overflow:
|
|
77
|
-
-webkit-overflow-scrolling: touch;
|
|
102
|
+
overflow: hidden;
|
|
78
103
|
}
|
|
79
104
|
|
|
80
105
|
/* Pin the sidebar to the viewport and let it scroll independently of the document.
|
|
@@ -85,8 +110,9 @@
|
|
|
85
110
|
top: 0;
|
|
86
111
|
max-block-size: 100vh;
|
|
87
112
|
max-block-size: 100dvh;
|
|
88
|
-
|
|
89
|
-
|
|
113
|
+
/* See the .containScrolling .sidebar comment above — same double-scrollbar
|
|
114
|
+
reasoning applies here. */
|
|
115
|
+
overflow: hidden;
|
|
90
116
|
}
|
|
91
117
|
|
|
92
118
|
/* Leave room for the banner's height, and stick below it instead of at top:0 so it
|
|
@@ -106,9 +132,10 @@
|
|
|
106
132
|
block-size: 100dvh;
|
|
107
133
|
}
|
|
108
134
|
|
|
109
|
-
/* In horizontal orientation, sidebar becomes a top block if used */
|
|
135
|
+
/* In horizontal orientation, sidebar becomes a full-width top block if used */
|
|
110
136
|
.horizontal .sidebar {
|
|
111
137
|
grid-column: 1 / -1;
|
|
138
|
+
justify-self: stretch;
|
|
112
139
|
border-right: none;
|
|
113
140
|
border-bottom: var(--border-width-thin) solid var(--color-border-subtle);
|
|
114
141
|
}
|
|
@@ -188,12 +215,8 @@
|
|
|
188
215
|
align-items: center;
|
|
189
216
|
|
|
190
217
|
background: var(--color-bg-surface);
|
|
191
|
-
padding: var(--spacing-xl) var(--spacing-xl);
|
|
192
|
-
overflow: visible;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
.vertical .content {
|
|
196
218
|
padding: var(--spacing-md);
|
|
219
|
+
overflow: visible;
|
|
197
220
|
}
|
|
198
221
|
|
|
199
222
|
.footer {
|
|
@@ -213,7 +213,6 @@
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
.sm .contextMenuOverlay {
|
|
216
|
-
inset-block: 0;
|
|
217
216
|
min-block-size: 0;
|
|
218
217
|
block-size: min(100%, 32px);
|
|
219
218
|
}
|
|
@@ -564,8 +563,8 @@
|
|
|
564
563
|
|
|
565
564
|
.contextMenuTrigger {
|
|
566
565
|
color: var(--color-fg-subtle);
|
|
567
|
-
min-inline-size:
|
|
568
|
-
min-block-size:
|
|
566
|
+
min-inline-size: var(--component-size-sm);
|
|
567
|
+
min-block-size: var(--component-size-sm);
|
|
569
568
|
border-radius: var(--border-radius-rounded);
|
|
570
569
|
}
|
|
571
570
|
|
|
@@ -576,21 +575,33 @@
|
|
|
576
575
|
|
|
577
576
|
.contextMenuAnchorCell .cellValueEllipsis,
|
|
578
577
|
.contextMenuAnchorCell .cellValueNoEllipsis {
|
|
579
|
-
padding-inline-end: calc(
|
|
578
|
+
padding-inline-end: calc(var(--component-size-sm) + var(--spacing-sm));
|
|
580
579
|
}
|
|
581
580
|
|
|
582
581
|
.contextMenuOverlay {
|
|
583
582
|
position: absolute;
|
|
584
|
-
inset-block
|
|
583
|
+
inset-block: 0;
|
|
585
584
|
inset-inline-end: 0;
|
|
586
585
|
display: inline-flex;
|
|
587
|
-
align-items: center;
|
|
588
586
|
justify-content: center;
|
|
589
587
|
min-inline-size: 40px;
|
|
590
|
-
block-size: min(100%, 40px);
|
|
591
588
|
z-index: 3;
|
|
592
589
|
}
|
|
593
590
|
|
|
591
|
+
/*
|
|
592
|
+
* Popover's own wrapper divs (.container/.triggerSlot) default to
|
|
593
|
+
* align-items: stretch so a trigger can fill a fixed-height form row.
|
|
594
|
+
* That stretches our small "sm" trigger button to the full row height
|
|
595
|
+
* instead of letting it size itself, so it's overridden here rather
|
|
596
|
+
* than in Popover.module.css to avoid affecting other Popover consumers.
|
|
597
|
+
* (.contextMenuOverlay itself has no align-items to override: its only
|
|
598
|
+
* child, Popover's .container, always sets an explicit height: 100%.)
|
|
599
|
+
*/
|
|
600
|
+
.contextMenuOverlay > div,
|
|
601
|
+
.contextMenuOverlay > div > div {
|
|
602
|
+
align-items: center;
|
|
603
|
+
}
|
|
604
|
+
|
|
594
605
|
.contextMenuOverlay:hover .contextMenuTrigger,
|
|
595
606
|
.contextMenuOverlay:focus-within .contextMenuTrigger {
|
|
596
607
|
background-color: var(--opac-bg-light);
|
package/dist/styles/styles.css
CHANGED
|
@@ -171,8 +171,9 @@ body.dbc-app {
|
|
|
171
171
|
|
|
172
172
|
.dbc-table--matrix th,
|
|
173
173
|
.dbc-table--matrix td {
|
|
174
|
-
padding: var(--spacing-
|
|
174
|
+
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
175
175
|
border-bottom: var(--border-width-thin) solid var(--table-border-subtle);
|
|
176
|
+
line-height: var(--line-height-tight);
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
.dbc-table--matrix thead th {
|
package/dist/styles.css
CHANGED
|
@@ -171,8 +171,9 @@ body.dbc-app {
|
|
|
171
171
|
|
|
172
172
|
.dbc-table--matrix th,
|
|
173
173
|
.dbc-table--matrix td {
|
|
174
|
-
padding: var(--spacing-
|
|
174
|
+
padding: var(--spacing-xxs) var(--spacing-sm);
|
|
175
175
|
border-bottom: var(--border-width-thin) solid var(--table-border-subtle);
|
|
176
|
+
line-height: var(--line-height-tight);
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
.dbc-table--matrix thead th {
|