@dbcdk/react-components 0.0.189 → 0.0.191
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/client.cjs +7 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.js +1 -0
- package/dist/components/accordion/Accordion.cjs +4 -8
- package/dist/components/accordion/Accordion.d.ts +1 -1
- package/dist/components/accordion/Accordion.js +4 -8
- package/dist/components/accordion/Accordion.module.css +55 -6
- package/dist/components/accordion/components/AccordionRow.cjs +2 -2
- package/dist/components/accordion/components/AccordionRow.d.ts +2 -2
- package/dist/components/accordion/components/AccordionRow.js +2 -2
- package/dist/components/accordion/components/AccordionRow.module.css +24 -2
- package/dist/components/breadcrumbs/Breadcrumbs.cjs +10 -7
- package/dist/components/breadcrumbs/Breadcrumbs.js +10 -7
- package/dist/components/breadcrumbs/Breadcrumbs.module.css +1 -5
- package/dist/components/button/Button.module.css +4 -2
- package/dist/components/button-select/ButtonSelect.cjs +2 -2
- package/dist/components/button-select/ButtonSelect.d.ts +1 -0
- package/dist/components/button-select/ButtonSelect.js +2 -2
- package/dist/components/button-select/ButtonSelect.module.css +14 -0
- package/dist/components/chip/Chip.module.css +38 -2
- package/dist/components/forms/checkbox/Checkbox.cjs +6 -1
- package/dist/components/forms/checkbox/Checkbox.js +6 -1
- package/dist/components/forms/checkbox/Checkbox.module.css +26 -0
- package/dist/components/forms/input/Input.module.css +2 -1
- package/dist/components/forms/input-container/InputContainer.d.ts +3 -3
- package/dist/components/forms/input-container/InputContainer.module.css +0 -7
- package/dist/components/grid/Grid.cjs +4 -2
- package/dist/components/grid/Grid.d.ts +2 -2
- package/dist/components/grid/Grid.js +4 -2
- package/dist/components/nav-bar/NavBar.d.ts +1 -0
- package/dist/components/overlay/side-panel/SidePanel.module.css +3 -1
- package/dist/components/page-layout/PageLayout.module.css +18 -2
- package/dist/components/sidebar/components/SidebarItem.cjs +2 -0
- package/dist/components/sidebar/components/SidebarItem.d.ts +2 -1
- package/dist/components/sidebar/components/SidebarItem.js +2 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs +4 -0
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts +2 -1
- package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.js +4 -0
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.cjs +6 -1
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.d.ts +2 -1
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.js +6 -1
- package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css +14 -0
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.cjs +13 -2
- package/dist/components/sidebar/components/sidebar-items/SidebarItems.js +13 -2
- package/dist/components/table/Table.module.css +2 -4
- package/dist/components/table/Table.types.d.ts +1 -0
- package/dist/components/table/components/TableHeaderCell.cjs +1 -1
- package/dist/components/table/components/TableHeaderCell.js +1 -1
- package/dist/components/table/components/TableRow.cjs +1 -0
- package/dist/components/table/components/TableRow.js +1 -0
- package/dist/components/table/tanstackTable.utils.cjs +3 -2
- package/dist/components/table/tanstackTable.utils.js +3 -2
- package/dist/components/tabs/Tabs.module.css +13 -4
- package/dist/hooks/useStickyLayout.cjs +99 -0
- package/dist/hooks/useStickyLayout.d.ts +22 -0
- package/dist/hooks/useStickyLayout.js +97 -0
- package/dist/index.cjs +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/styles/css-helper-classes/scrollbar.css +10 -0
- package/dist/styles/styles.css +40 -24
- package/dist/styles/themes/dbc/base.css +2 -2
- package/dist/styles.css +40 -24
- package/package.json +1 -1
- package/dist/styles/fonts/Roboto/OFL.txt +0 -93
- package/dist/styles/fonts/Roboto/README.txt +0 -118
- package/dist/styles/fonts/Roboto/Roboto-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_Condensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Black.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BlackItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Bold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-BoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ExtraLightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Italic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Light.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-LightItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Medium.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-MediumItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Regular.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBold.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-SemiBoldItalic.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-Thin.ttf +0 -0
- package/dist/styles/fonts/Roboto/Roboto_SemiCondensed-ThinItalic.ttf +0 -0
- package/dist/styles/fonts/Tajawal/OFL.txt +0 -93
- package/dist/styles/fonts/Tajawal/Tajawal-Black.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Bold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraBold.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-ExtraLight.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Light.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Medium.ttf +0 -0
- package/dist/styles/fonts/Tajawal/Tajawal-Regular.ttf +0 -0
|
@@ -3,9 +3,9 @@ export interface InputContainerProps {
|
|
|
3
3
|
label?: string;
|
|
4
4
|
labelAction?: React.ReactNode;
|
|
5
5
|
htmlFor?: string;
|
|
6
|
-
error?:
|
|
7
|
-
helpText?:
|
|
8
|
-
helpTextAddition?:
|
|
6
|
+
error?: React.ReactNode;
|
|
7
|
+
helpText?: React.ReactNode;
|
|
8
|
+
helpTextAddition?: React.ReactNode;
|
|
9
9
|
fullWidth?: boolean;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
children: React.ReactNode;
|
|
@@ -50,10 +50,3 @@
|
|
|
50
50
|
.messageRow {
|
|
51
51
|
min-height: 1lh;
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
/* Optional: keep this only for controls whose own label lives inside children,
|
|
55
|
-
such as checkbox/radio wrappers. It will not affect Input's top label. */
|
|
56
|
-
.inputContainer[data-modified] label:not(.label) {
|
|
57
|
-
background-color: color-mix(in srgb, var(--color-status-warning-bg) 35%, transparent);
|
|
58
|
-
border-radius: var(--border-radius-default);
|
|
59
|
-
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var react = require('react');
|
|
4
5
|
var styles = require('./Grid.module.css');
|
|
5
6
|
|
|
6
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -38,11 +39,12 @@ function Grid({
|
|
|
38
39
|
}
|
|
39
40
|
);
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
const GridItem = react.forwardRef(function GridItem2({ children, base = 12, md, lg, className, style }, ref) {
|
|
42
43
|
const toTrackSpan = (span) => span * 2;
|
|
43
44
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
44
45
|
"div",
|
|
45
46
|
{
|
|
47
|
+
ref,
|
|
46
48
|
className: [styles__default.default.item, className].filter(Boolean).join(" "),
|
|
47
49
|
style: {
|
|
48
50
|
"--span-base": toTrackSpan(base),
|
|
@@ -53,7 +55,7 @@ function GridItem({ children, base = 12, md, lg, className, style }) {
|
|
|
53
55
|
children
|
|
54
56
|
}
|
|
55
57
|
);
|
|
56
|
-
}
|
|
58
|
+
});
|
|
57
59
|
|
|
58
60
|
exports.Grid = Grid;
|
|
59
61
|
exports.GridItem = GridItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
export type GridGap = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
3
|
export interface GridMaxWidth {
|
|
4
4
|
base?: string;
|
|
@@ -26,4 +26,4 @@ export interface GridItemProps {
|
|
|
26
26
|
className?: string;
|
|
27
27
|
style?: CSSProperties;
|
|
28
28
|
}
|
|
29
|
-
export declare
|
|
29
|
+
export declare const GridItem: import("react").ForwardRefExoticComponent<GridItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import styles from './Grid.module.css';
|
|
3
4
|
|
|
4
5
|
const GAP_TOKEN = {
|
|
@@ -32,11 +33,12 @@ function Grid({
|
|
|
32
33
|
}
|
|
33
34
|
);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
const GridItem = forwardRef(function GridItem2({ children, base = 12, md, lg, className, style }, ref) {
|
|
36
37
|
const toTrackSpan = (span) => span * 2;
|
|
37
38
|
return /* @__PURE__ */ jsx(
|
|
38
39
|
"div",
|
|
39
40
|
{
|
|
41
|
+
ref,
|
|
40
42
|
className: [styles.item, className].filter(Boolean).join(" "),
|
|
41
43
|
style: {
|
|
42
44
|
"--span-base": toTrackSpan(base),
|
|
@@ -47,6 +49,6 @@ function GridItem({ children, base = 12, md, lg, className, style }) {
|
|
|
47
49
|
children
|
|
48
50
|
}
|
|
49
51
|
);
|
|
50
|
-
}
|
|
52
|
+
});
|
|
51
53
|
|
|
52
54
|
export { Grid, GridItem };
|
|
@@ -96,7 +96,9 @@
|
|
|
96
96
|
|
|
97
97
|
display: flex;
|
|
98
98
|
flex-direction: column;
|
|
99
|
-
|
|
99
|
+
/* Header/content spacing is defined by their own padding, so avoid adding another
|
|
100
|
+
gap that creates double spacing between the panel title and the content area. */
|
|
101
|
+
gap: 0;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
.header {
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
--page-layout-banner-height: calc(
|
|
17
17
|
var(--spacing-2xs) * 2 + var(--font-size-md) * var(--line-height-normal)
|
|
18
18
|
);
|
|
19
|
+
|
|
20
|
+
/* Structural bottom breathing room for all page content, so it doesn't sit
|
|
21
|
+
flush against the viewport edge. */
|
|
22
|
+
--page-layout-content-padding-bottom: var(--spacing-xl);
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
/* Viewport handling:
|
|
@@ -208,14 +212,26 @@
|
|
|
208
212
|
/* Content area (not a scroll container anymore) */
|
|
209
213
|
.content {
|
|
210
214
|
min-width: 0;
|
|
211
|
-
min-height:
|
|
215
|
+
/* Deliberately no min-height:0 here (unlike `.mainScroll` above, which does
|
|
216
|
+
need it): this lets `.content` size to its own natural content height —
|
|
217
|
+
including its own padding-block-end — instead of being flex-shrunk
|
|
218
|
+
shorter than that content. `.mainScroll` (overflow:auto) already has its
|
|
219
|
+
own min-height:0, which is what lets it stay bounded to the available
|
|
220
|
+
space and scroll; if `.content` could *also* shrink below its content,
|
|
221
|
+
that shrunk-but-visible-overflow content would spill straight past
|
|
222
|
+
wherever its own bottom padding was supposed to land, so it would never
|
|
223
|
+
actually render (this happened in practice before this comment existed). */
|
|
212
224
|
flex: 1 1 auto; /* take remaining space inside mainScroll */
|
|
213
225
|
display: flex; /* lets contentInner stretch */
|
|
214
226
|
flex-direction: column;
|
|
215
227
|
align-items: center;
|
|
216
228
|
|
|
217
229
|
background: var(--color-bg-surface);
|
|
218
|
-
padding: var(--spacing-md);
|
|
230
|
+
padding-block-start: var(--spacing-md);
|
|
231
|
+
padding-inline: var(--spacing-md);
|
|
232
|
+
padding-block-end: calc(
|
|
233
|
+
var(--page-layout-content-padding-bottom) + env(safe-area-inset-bottom, 0px)
|
|
234
|
+
);
|
|
219
235
|
overflow: visible;
|
|
220
236
|
}
|
|
221
237
|
|
|
@@ -7,6 +7,7 @@ function SidebarItem({
|
|
|
7
7
|
component: Component,
|
|
8
8
|
label,
|
|
9
9
|
icon,
|
|
10
|
+
badge,
|
|
10
11
|
href,
|
|
11
12
|
iconWidth,
|
|
12
13
|
truncateLabel
|
|
@@ -18,6 +19,7 @@ function SidebarItem({
|
|
|
18
19
|
SidebarItemContent.SidebarItemContent,
|
|
19
20
|
{
|
|
20
21
|
icon,
|
|
22
|
+
badge,
|
|
21
23
|
iconWidth,
|
|
22
24
|
label,
|
|
23
25
|
href,
|
|
@@ -3,9 +3,10 @@ interface SidebarItemProps {
|
|
|
3
3
|
component?: React.ElementType;
|
|
4
4
|
label: string;
|
|
5
5
|
icon: React.ReactNode;
|
|
6
|
+
badge?: number | string;
|
|
6
7
|
href?: string;
|
|
7
8
|
iconWidth?: string | number;
|
|
8
9
|
truncateLabel?: boolean;
|
|
9
10
|
}
|
|
10
|
-
export declare function SidebarItem({ component: Component, label, icon, href, iconWidth, truncateLabel, }: SidebarItemProps): React.ReactNode;
|
|
11
|
+
export declare function SidebarItem({ component: Component, label, icon, badge, href, iconWidth, truncateLabel, }: SidebarItemProps): React.ReactNode;
|
|
11
12
|
export {};
|
package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.cjs
CHANGED
|
@@ -21,6 +21,7 @@ function ExpandableSidebarItem({
|
|
|
21
21
|
items,
|
|
22
22
|
label,
|
|
23
23
|
icon,
|
|
24
|
+
badge,
|
|
24
25
|
component: Component,
|
|
25
26
|
href,
|
|
26
27
|
iconWidth,
|
|
@@ -85,6 +86,7 @@ function ExpandableSidebarItem({
|
|
|
85
86
|
items: (_b = item.children) != null ? _b : [],
|
|
86
87
|
label: item.label,
|
|
87
88
|
icon: item.icon,
|
|
89
|
+
badge: item.badge,
|
|
88
90
|
href: item.href,
|
|
89
91
|
iconWidth: item.iconWidth,
|
|
90
92
|
component: item.component
|
|
@@ -98,6 +100,7 @@ function ExpandableSidebarItem({
|
|
|
98
100
|
component: item.component,
|
|
99
101
|
label: item.label,
|
|
100
102
|
icon: item.icon,
|
|
103
|
+
badge: item.badge,
|
|
101
104
|
href: item.href,
|
|
102
105
|
iconWidth: item.iconWidth,
|
|
103
106
|
truncateLabel: item.truncateLabel
|
|
@@ -112,6 +115,7 @@ function ExpandableSidebarItem({
|
|
|
112
115
|
{
|
|
113
116
|
headerStyle: expanded,
|
|
114
117
|
icon,
|
|
118
|
+
badge,
|
|
115
119
|
iconWidth,
|
|
116
120
|
label,
|
|
117
121
|
href,
|
package/dist/components/sidebar/components/expandable-sidebar-item/ExpandableSidebarItem.d.ts
CHANGED
|
@@ -5,9 +5,10 @@ type ExpandableSidebarItemProps = {
|
|
|
5
5
|
label: string;
|
|
6
6
|
component: React.ElementType;
|
|
7
7
|
icon: React.ReactNode;
|
|
8
|
+
badge?: number | string;
|
|
8
9
|
href: string;
|
|
9
10
|
iconWidth?: string | number;
|
|
10
11
|
truncateLabel?: boolean;
|
|
11
12
|
};
|
|
12
|
-
export declare function ExpandableSidebarItem({ items, label, icon, component: Component, href, iconWidth, truncateLabel, }: ExpandableSidebarItemProps): React.ReactNode;
|
|
13
|
+
export declare function ExpandableSidebarItem({ items, label, icon, badge, component: Component, href, iconWidth, truncateLabel, }: ExpandableSidebarItemProps): React.ReactNode;
|
|
13
14
|
export {};
|
|
@@ -15,6 +15,7 @@ function ExpandableSidebarItem({
|
|
|
15
15
|
items,
|
|
16
16
|
label,
|
|
17
17
|
icon,
|
|
18
|
+
badge,
|
|
18
19
|
component: Component,
|
|
19
20
|
href,
|
|
20
21
|
iconWidth,
|
|
@@ -79,6 +80,7 @@ function ExpandableSidebarItem({
|
|
|
79
80
|
items: (_b = item.children) != null ? _b : [],
|
|
80
81
|
label: item.label,
|
|
81
82
|
icon: item.icon,
|
|
83
|
+
badge: item.badge,
|
|
82
84
|
href: item.href,
|
|
83
85
|
iconWidth: item.iconWidth,
|
|
84
86
|
component: item.component
|
|
@@ -92,6 +94,7 @@ function ExpandableSidebarItem({
|
|
|
92
94
|
component: item.component,
|
|
93
95
|
label: item.label,
|
|
94
96
|
icon: item.icon,
|
|
97
|
+
badge: item.badge,
|
|
95
98
|
href: item.href,
|
|
96
99
|
iconWidth: item.iconWidth,
|
|
97
100
|
truncateLabel: item.truncateLabel
|
|
@@ -106,6 +109,7 @@ function ExpandableSidebarItem({
|
|
|
106
109
|
{
|
|
107
110
|
headerStyle: expanded,
|
|
108
111
|
icon,
|
|
112
|
+
badge,
|
|
109
113
|
iconWidth,
|
|
110
114
|
label,
|
|
111
115
|
href,
|
|
@@ -5,6 +5,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var getHighlightedSegments = require('../../../../utils/text/get-highlighted-segments');
|
|
7
7
|
var styles = require('./SidebarItemContent.module.css');
|
|
8
|
+
var Chip = require('../../../chip/Chip');
|
|
8
9
|
var SidebarProvider = require('../../providers/SidebarProvider');
|
|
9
10
|
|
|
10
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -15,6 +16,7 @@ var styles__default = /*#__PURE__*/_interopDefault(styles);
|
|
|
15
16
|
function SidebarItemContent({
|
|
16
17
|
icon,
|
|
17
18
|
label,
|
|
19
|
+
badge,
|
|
18
20
|
suffixIcon,
|
|
19
21
|
href,
|
|
20
22
|
iconWidth,
|
|
@@ -45,7 +47,10 @@ function SidebarItemContent({
|
|
|
45
47
|
}
|
|
46
48
|
)
|
|
47
49
|
] }),
|
|
48
|
-
|
|
50
|
+
!isSidebarCollapsed && (badge != null || suffixIcon) ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: styles__default.default.trailing, children: [
|
|
51
|
+
badge != null ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.badge, children: /* @__PURE__ */ jsxRuntime.jsx(Chip.Chip, { size: "sm", children: typeof badge === "number" ? badge.toLocaleString("da-DK") : badge }) }) : null,
|
|
52
|
+
suffixIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles__default.default.suffixIcon, children: suffixIcon }) : null
|
|
53
|
+
] }) : null
|
|
49
54
|
]
|
|
50
55
|
}
|
|
51
56
|
);
|
|
@@ -3,6 +3,7 @@ import type { JSX } from 'react';
|
|
|
3
3
|
export interface SidebarItemContentProps {
|
|
4
4
|
icon?: React.ReactNode;
|
|
5
5
|
label: React.ReactNode;
|
|
6
|
+
badge?: number | string;
|
|
6
7
|
suffixIcon?: React.ReactNode;
|
|
7
8
|
href?: string;
|
|
8
9
|
iconWidth?: string | number;
|
|
@@ -10,4 +11,4 @@ export interface SidebarItemContentProps {
|
|
|
10
11
|
headerStyle?: boolean;
|
|
11
12
|
truncateLabel?: boolean;
|
|
12
13
|
}
|
|
13
|
-
export declare function SidebarItemContent({ icon, label, suffixIcon, href, iconWidth, disableActiveStyles, headerStyle, truncateLabel, }: SidebarItemContentProps): JSX.Element;
|
|
14
|
+
export declare function SidebarItemContent({ icon, label, badge, suffixIcon, href, iconWidth, disableActiveStyles, headerStyle, truncateLabel, }: SidebarItemContentProps): JSX.Element;
|
|
@@ -3,11 +3,13 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { getHighlightedSegments } from '../../../../utils/text/get-highlighted-segments';
|
|
5
5
|
import styles from './SidebarItemContent.module.css';
|
|
6
|
+
import { Chip } from '../../../chip/Chip';
|
|
6
7
|
import { useSidebar } from '../../providers/SidebarProvider';
|
|
7
8
|
|
|
8
9
|
function SidebarItemContent({
|
|
9
10
|
icon,
|
|
10
11
|
label,
|
|
12
|
+
badge,
|
|
11
13
|
suffixIcon,
|
|
12
14
|
href,
|
|
13
15
|
iconWidth,
|
|
@@ -38,7 +40,10 @@ function SidebarItemContent({
|
|
|
38
40
|
}
|
|
39
41
|
)
|
|
40
42
|
] }),
|
|
41
|
-
|
|
43
|
+
!isSidebarCollapsed && (badge != null || suffixIcon) ? /* @__PURE__ */ jsxs("span", { className: styles.trailing, children: [
|
|
44
|
+
badge != null ? /* @__PURE__ */ jsx("span", { className: styles.badge, children: /* @__PURE__ */ jsx(Chip, { size: "sm", children: typeof badge === "number" ? badge.toLocaleString("da-DK") : badge }) }) : null,
|
|
45
|
+
suffixIcon ? /* @__PURE__ */ jsx("span", { className: styles.suffixIcon, children: suffixIcon }) : null
|
|
46
|
+
] }) : null
|
|
42
47
|
]
|
|
43
48
|
}
|
|
44
49
|
);
|
package/dist/components/sidebar/components/sidebar-item-content/SidebarItemContent.module.css
CHANGED
|
@@ -87,6 +87,20 @@
|
|
|
87
87
|
color: inherit;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
.trailing {
|
|
91
|
+
display: inline-flex;
|
|
92
|
+
align-items: center;
|
|
93
|
+
gap: var(--spacing-xs);
|
|
94
|
+
flex: 0 0 auto;
|
|
95
|
+
margin-inline-start: auto;
|
|
96
|
+
min-inline-size: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.badge {
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
align-items: center;
|
|
102
|
+
}
|
|
103
|
+
|
|
90
104
|
.collapsed svg {
|
|
91
105
|
inline-size: var(--icon-size-md);
|
|
92
106
|
block-size: var(--icon-size-md);
|
|
@@ -26,13 +26,23 @@ function SidebarItems({ activeLink }) {
|
|
|
26
26
|
] }, key);
|
|
27
27
|
}
|
|
28
28
|
if (item.type === "expandable") {
|
|
29
|
-
const {
|
|
29
|
+
const {
|
|
30
|
+
component: Component2,
|
|
31
|
+
label: label2,
|
|
32
|
+
icon: icon2,
|
|
33
|
+
badge: badge2,
|
|
34
|
+
children,
|
|
35
|
+
href: href2,
|
|
36
|
+
iconWidth: iconWidth2,
|
|
37
|
+
truncateLabel: truncateLabel2
|
|
38
|
+
} = item;
|
|
30
39
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
31
40
|
ExpandableSidebarItem.ExpandableSidebarItem,
|
|
32
41
|
{
|
|
33
42
|
items: children,
|
|
34
43
|
label: label2,
|
|
35
44
|
icon: icon2,
|
|
45
|
+
badge: badge2,
|
|
36
46
|
href: href2,
|
|
37
47
|
iconWidth: iconWidth2,
|
|
38
48
|
truncateLabel: truncateLabel2,
|
|
@@ -41,13 +51,14 @@ function SidebarItems({ activeLink }) {
|
|
|
41
51
|
key
|
|
42
52
|
);
|
|
43
53
|
}
|
|
44
|
-
const { component: Component, label, icon, href, iconWidth, truncateLabel } = item;
|
|
54
|
+
const { component: Component, label, icon, badge, href, iconWidth, truncateLabel } = item;
|
|
45
55
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
56
|
SidebarItem.SidebarItem,
|
|
47
57
|
{
|
|
48
58
|
component: Component,
|
|
49
59
|
label,
|
|
50
60
|
icon,
|
|
61
|
+
badge,
|
|
51
62
|
href,
|
|
52
63
|
iconWidth,
|
|
53
64
|
truncateLabel
|
|
@@ -20,13 +20,23 @@ function SidebarItems({ activeLink }) {
|
|
|
20
20
|
] }, key);
|
|
21
21
|
}
|
|
22
22
|
if (item.type === "expandable") {
|
|
23
|
-
const {
|
|
23
|
+
const {
|
|
24
|
+
component: Component2,
|
|
25
|
+
label: label2,
|
|
26
|
+
icon: icon2,
|
|
27
|
+
badge: badge2,
|
|
28
|
+
children,
|
|
29
|
+
href: href2,
|
|
30
|
+
iconWidth: iconWidth2,
|
|
31
|
+
truncateLabel: truncateLabel2
|
|
32
|
+
} = item;
|
|
24
33
|
return /* @__PURE__ */ jsx(
|
|
25
34
|
ExpandableSidebarItem,
|
|
26
35
|
{
|
|
27
36
|
items: children,
|
|
28
37
|
label: label2,
|
|
29
38
|
icon: icon2,
|
|
39
|
+
badge: badge2,
|
|
30
40
|
href: href2,
|
|
31
41
|
iconWidth: iconWidth2,
|
|
32
42
|
truncateLabel: truncateLabel2,
|
|
@@ -35,13 +45,14 @@ function SidebarItems({ activeLink }) {
|
|
|
35
45
|
key
|
|
36
46
|
);
|
|
37
47
|
}
|
|
38
|
-
const { component: Component, label, icon, href, iconWidth, truncateLabel } = item;
|
|
48
|
+
const { component: Component, label, icon, badge, href, iconWidth, truncateLabel } = item;
|
|
39
49
|
return /* @__PURE__ */ jsx(
|
|
40
50
|
SidebarItem,
|
|
41
51
|
{
|
|
42
52
|
component: Component,
|
|
43
53
|
label,
|
|
44
54
|
icon,
|
|
55
|
+
badge,
|
|
45
56
|
href,
|
|
46
57
|
iconWidth,
|
|
47
58
|
truncateLabel
|
|
@@ -185,16 +185,15 @@
|
|
|
185
185
|
background: var(--table-component-row-bg);
|
|
186
186
|
overflow: hidden;
|
|
187
187
|
line-height: 20px;
|
|
188
|
-
height: 40px;
|
|
189
188
|
}
|
|
190
189
|
|
|
191
190
|
.md .headerCell {
|
|
192
|
-
padding-block: var(--spacing-
|
|
191
|
+
padding-block: var(--spacing-xs);
|
|
193
192
|
padding-inline: var(--spacing-xs);
|
|
194
193
|
}
|
|
195
194
|
|
|
196
195
|
.md .cell {
|
|
197
|
-
padding-block: var(--spacing-
|
|
196
|
+
padding-block: var(--spacing-xs);
|
|
198
197
|
padding-inline: var(--spacing-xs);
|
|
199
198
|
}
|
|
200
199
|
|
|
@@ -208,7 +207,6 @@
|
|
|
208
207
|
padding-inline: var(--spacing-sm);
|
|
209
208
|
font-size: var(--font-size-xs);
|
|
210
209
|
line-height: 20px;
|
|
211
|
-
height: 32px;
|
|
212
210
|
}
|
|
213
211
|
|
|
214
212
|
.sm .contextMenuTrigger {
|
|
@@ -31,7 +31,7 @@ function TableHeaderCell({
|
|
|
31
31
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
32
|
"th",
|
|
33
33
|
{
|
|
34
|
-
className: styles__default.default.headerCell,
|
|
34
|
+
className: table_classes.cx(styles__default.default.headerCell, column.muted && "dbc-muted-text"),
|
|
35
35
|
scope: "col",
|
|
36
36
|
"aria-sort": ariaSort,
|
|
37
37
|
"data-align": align,
|
|
@@ -144,6 +144,7 @@ function TableRow({
|
|
|
144
144
|
{
|
|
145
145
|
className: table_classes.cx(
|
|
146
146
|
styles__default.default.cell,
|
|
147
|
+
column.muted && "dbc-muted-text",
|
|
147
148
|
showRowActions && styles__default.default.actionCell,
|
|
148
149
|
allowOverflow && styles__default.default.allowOverflow,
|
|
149
150
|
allowWrap ? styles__default.default.allowWrap : styles__default.default.nowrap,
|
|
@@ -20,7 +20,7 @@ function buildColumnVisibilityFromVisibleIds(defs, visibleColumnIds) {
|
|
|
20
20
|
}
|
|
21
21
|
function mapDefsToColumnItems(defs, columnVisibility, resolvedLayout = {}) {
|
|
22
22
|
return defs.map((def, index) => {
|
|
23
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24
24
|
const id = getColumnId(def, index);
|
|
25
25
|
const accessorKey = def.accessorKey;
|
|
26
26
|
const accessorFn = def.accessorFn;
|
|
@@ -52,9 +52,10 @@ function mapDefsToColumnItems(defs, columnVisibility, resolvedLayout = {}) {
|
|
|
52
52
|
verticalAlign: meta.verticalAlign,
|
|
53
53
|
emptyPlaceholder: (_e = meta.emptyPlaceholder) != null ? _e : "-",
|
|
54
54
|
allowWrap: (_f = meta.allowWrap) != null ? _f : false,
|
|
55
|
+
muted: (_g = meta.muted) != null ? _g : false,
|
|
55
56
|
severity: meta.severity,
|
|
56
57
|
divider: meta.divider,
|
|
57
|
-
allowOverflow: (
|
|
58
|
+
allowOverflow: (_h = meta.allowOverflow) != null ? _h : false
|
|
58
59
|
};
|
|
59
60
|
});
|
|
60
61
|
}
|
|
@@ -18,7 +18,7 @@ function buildColumnVisibilityFromVisibleIds(defs, visibleColumnIds) {
|
|
|
18
18
|
}
|
|
19
19
|
function mapDefsToColumnItems(defs, columnVisibility, resolvedLayout = {}) {
|
|
20
20
|
return defs.map((def, index) => {
|
|
21
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22
22
|
const id = getColumnId(def, index);
|
|
23
23
|
const accessorKey = def.accessorKey;
|
|
24
24
|
const accessorFn = def.accessorFn;
|
|
@@ -50,9 +50,10 @@ function mapDefsToColumnItems(defs, columnVisibility, resolvedLayout = {}) {
|
|
|
50
50
|
verticalAlign: meta.verticalAlign,
|
|
51
51
|
emptyPlaceholder: (_e = meta.emptyPlaceholder) != null ? _e : "-",
|
|
52
52
|
allowWrap: (_f = meta.allowWrap) != null ? _f : false,
|
|
53
|
+
muted: (_g = meta.muted) != null ? _g : false,
|
|
53
54
|
severity: meta.severity,
|
|
54
55
|
divider: meta.divider,
|
|
55
|
-
allowOverflow: (
|
|
56
|
+
allowOverflow: (_h = meta.allowOverflow) != null ? _h : false
|
|
56
57
|
};
|
|
57
58
|
});
|
|
58
59
|
}
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
squeezing it. */
|
|
48
48
|
.tabListAddition {
|
|
49
49
|
display: flex;
|
|
50
|
-
align-items:
|
|
50
|
+
align-items: start;
|
|
51
51
|
flex-shrink: 0;
|
|
52
52
|
gap: var(--spacing-sm);
|
|
53
53
|
margin-inline-start: auto;
|
|
@@ -242,6 +242,15 @@
|
|
|
242
242
|
border-start-start-radius: var(--border-radius-md);
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
+
.filled > .tabList > .tabButtons > .tab > .tabButton {
|
|
246
|
+
padding-block: var(--spacing-xs);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.filled > .tabList > .tabButtons > .tab > .tabButton .icon svg {
|
|
250
|
+
inline-size: var(--icon-size-sm);
|
|
251
|
+
block-size: var(--icon-size-sm);
|
|
252
|
+
}
|
|
253
|
+
|
|
245
254
|
.filled > .tabList > .tabButtons.tabButtonsEnd {
|
|
246
255
|
border-start-end-radius: var(--border-radius-md);
|
|
247
256
|
}
|
|
@@ -260,6 +269,7 @@
|
|
|
260
269
|
.filled > .tabList > .tabButtons > .tab {
|
|
261
270
|
border: 1px solid transparent;
|
|
262
271
|
border-block-end-width: 1px;
|
|
272
|
+
margin-block-end: -1px;
|
|
263
273
|
color: var(--color-fg-muted);
|
|
264
274
|
position: relative;
|
|
265
275
|
transition:
|
|
@@ -281,7 +291,6 @@
|
|
|
281
291
|
border-block-end-color: var(--color-bg-surface);
|
|
282
292
|
border-start-start-radius: var(--border-radius-md);
|
|
283
293
|
border-start-end-radius: var(--border-radius-md);
|
|
284
|
-
margin-block-end: -1px;
|
|
285
294
|
z-index: 1;
|
|
286
295
|
color: var(--color-fg-default);
|
|
287
296
|
}
|
|
@@ -301,7 +310,7 @@
|
|
|
301
310
|
border-block-start: none;
|
|
302
311
|
border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
|
|
303
312
|
box-shadow: var(--shadow-xs);
|
|
304
|
-
padding: var(--spacing-md);
|
|
313
|
+
padding: calc(var(--spacing-md) + var(--spacing-xs)) var(--spacing-md) var(--spacing-md);
|
|
305
314
|
}
|
|
306
315
|
|
|
307
316
|
/* =========================
|
|
@@ -381,7 +390,7 @@
|
|
|
381
390
|
|
|
382
391
|
.filled > .tabContent,
|
|
383
392
|
.panelStyle.outlined > .tabContent {
|
|
384
|
-
padding-block: var(--spacing-sm);
|
|
393
|
+
padding-block: calc(var(--spacing-sm) + var(--spacing-xs)) var(--spacing-sm);
|
|
385
394
|
padding-inline: var(--spacing-sm);
|
|
386
395
|
}
|
|
387
396
|
|