@dbcdk/react-components 0.0.98 → 0.0.102
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/Accordion.d.ts +3 -1
- package/dist/components/accordion/components/AccordionRow.d.ts +3 -1
- package/dist/components/card/Card.d.ts +2 -0
- package/dist/components/headline/Headline.d.ts +2 -1
- package/dist/components/inline-status/InlineStatus.d.ts +11 -0
- package/dist/components/page/Page.d.ts +3 -1
- package/dist/components/page-layout/components/{layout-footer/LayoutFooter.d.ts → footer/Footer.d.ts} +5 -4
- package/dist/components/segmented-progress-bar/SegmentedProgressBar.d.ts +2 -1
- package/dist/index.cjs +630 -547
- package/dist/index.css +216 -70
- package/dist/index.d.ts +2 -1
- package/dist/index.js +180 -98
- package/dist/styles/styles.css +7 -3
- package/dist/styles/themes/dbc/colors.css +14 -9
- package/dist/styles.css +7 -3
- package/dist/tanstack.cjs +114 -114
- package/dist/tanstack.css +12 -8
- package/dist/tanstack.js +34 -34
- package/package.json +1 -1
- package/dist/components/page-layout/components/page-layout-hero/PageLayoutHero.d.ts +0 -1
package/dist/tanstack.css
CHANGED
|
@@ -194,12 +194,6 @@
|
|
|
194
194
|
.Button_icon2 {
|
|
195
195
|
display: inline-flex;
|
|
196
196
|
}
|
|
197
|
-
.Button_button2.Button_xs2 {
|
|
198
|
-
height: var(--component-size-xs);
|
|
199
|
-
min-block-size: var(--component-size-xs);
|
|
200
|
-
padding-inline: var(--spacing-xs);
|
|
201
|
-
font-size: var(--font-size-xs);
|
|
202
|
-
}
|
|
203
197
|
.Button_button2.Button_sm2 {
|
|
204
198
|
height: var(--component-size-sm);
|
|
205
199
|
min-block-size: var(--component-size-sm);
|
|
@@ -314,6 +308,17 @@
|
|
|
314
308
|
.Button_inline2.Button_active2:hover {
|
|
315
309
|
color: var(--button-bg-primary-hover);
|
|
316
310
|
}
|
|
311
|
+
.Button_button2.Button_xs2 {
|
|
312
|
+
height: auto;
|
|
313
|
+
min-block-size: 0;
|
|
314
|
+
padding-block: 0;
|
|
315
|
+
padding-inline: var(--spacing-xs);
|
|
316
|
+
font-size: var(--font-size-xs);
|
|
317
|
+
}
|
|
318
|
+
.Button_button2.Button_xs2 svg {
|
|
319
|
+
inline-size: var(--icon-size-sm);
|
|
320
|
+
block-size: var(--icon-size-sm);
|
|
321
|
+
}
|
|
317
322
|
|
|
318
323
|
/* src/components/menu/Menu.module.css */
|
|
319
324
|
.Menu_container2 {
|
|
@@ -625,7 +630,6 @@
|
|
|
625
630
|
.InputContainer_inputContainer2[data-modified] label:not(.InputContainer_label2) {
|
|
626
631
|
background-color: color-mix(in srgb, var(--color-status-warning-bg) 35%, transparent);
|
|
627
632
|
border-radius: var(--border-radius-default);
|
|
628
|
-
padding: 2px 6px;
|
|
629
633
|
}
|
|
630
634
|
|
|
631
635
|
/* src/components/forms/radio-buttons/RadioButtons.module.css */
|
|
@@ -766,7 +770,7 @@
|
|
|
766
770
|
padding: var(--spacing-xxs);
|
|
767
771
|
z-index: var(--z-popover);
|
|
768
772
|
overflow: auto;
|
|
769
|
-
box-shadow:
|
|
773
|
+
box-shadow: var(--shadow-md);
|
|
770
774
|
}
|
|
771
775
|
.Popover_content2[hidden] {
|
|
772
776
|
display: none;
|
package/dist/tanstack.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useReactTable, getSortedRowModel, getCoreRowModel } from '@tanstack/react-table';
|
|
2
|
-
import * as
|
|
2
|
+
import * as React8 from 'react';
|
|
3
3
|
import { createContext, forwardRef, useId, useState, useRef, useEffect, useCallback, useImperativeHandle, useLayoutEffect, useContext, useMemo } from 'react';
|
|
4
4
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
5
|
import { LoaderCircle, ChevronUp, ChevronDown, Check, ListChevronsDownUp, Settings, ChevronsLeft, ArrowLeft, ArrowRight, ChevronsRight, ArrowUp, ArrowDown } from 'lucide-react';
|
|
@@ -150,7 +150,6 @@ var Button_default = {
|
|
|
150
150
|
rounded: "Button_rounded2",
|
|
151
151
|
link: "Button_link2",
|
|
152
152
|
icon: "Button_icon2",
|
|
153
|
-
xs: "Button_xs2",
|
|
154
153
|
sm: "Button_sm2",
|
|
155
154
|
lg: "Button_lg2",
|
|
156
155
|
fullWidth: "Button_fullWidth2",
|
|
@@ -161,7 +160,8 @@ var Button_default = {
|
|
|
161
160
|
active: "Button_active2",
|
|
162
161
|
success: "Button_success2",
|
|
163
162
|
danger: "Button_danger2",
|
|
164
|
-
inline: "Button_inline2"
|
|
163
|
+
inline: "Button_inline2",
|
|
164
|
+
xs: "Button_xs2"
|
|
165
165
|
};
|
|
166
166
|
function cx(...parts) {
|
|
167
167
|
return parts.filter(Boolean).join(" ");
|
|
@@ -175,7 +175,7 @@ function mergeRefs(...refs) {
|
|
|
175
175
|
}
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
var Button =
|
|
178
|
+
var Button = React8.forwardRef(function Button2({
|
|
179
179
|
variant = "outlined",
|
|
180
180
|
shape = "default",
|
|
181
181
|
size = "md",
|
|
@@ -204,8 +204,8 @@ var Button = React9.forwardRef(function Button2({
|
|
|
204
204
|
userClassName
|
|
205
205
|
);
|
|
206
206
|
const tooltipEnabled = Boolean(tooltip);
|
|
207
|
-
const childRef = isLink &&
|
|
208
|
-
const mergedRef =
|
|
207
|
+
const childRef = isLink && React8.isValidElement(children) ? (_a = children.ref) != null ? _a : null : null;
|
|
208
|
+
const mergedRef = React8.useMemo(() => mergeRefs(childRef, ref), [childRef, ref]);
|
|
209
209
|
const { triggerProps, id: tooltipId } = useTooltipTrigger({
|
|
210
210
|
content: tooltipEnabled ? tooltip : null,
|
|
211
211
|
placement: tooltipPlacement,
|
|
@@ -222,7 +222,7 @@ var Button = React9.forwardRef(function Button2({
|
|
|
222
222
|
loading && /* @__PURE__ */ jsx("span", { style: { display: "flex", opacity: 0.5 }, className: "spin", children: /* @__PURE__ */ jsx(LoaderCircle, {}) })
|
|
223
223
|
] });
|
|
224
224
|
let buttonEl;
|
|
225
|
-
if (isLink &&
|
|
225
|
+
if (isLink && React8.isValidElement(children)) {
|
|
226
226
|
const childClassName = typeof children.props.className === "string" ? children.props.className : "";
|
|
227
227
|
const { disabled, onClick, ...linkButtonProps } = buttonProps;
|
|
228
228
|
const handleClick = (e) => {
|
|
@@ -232,7 +232,7 @@ var Button = React9.forwardRef(function Button2({
|
|
|
232
232
|
}
|
|
233
233
|
onClick == null ? void 0 : onClick(e);
|
|
234
234
|
};
|
|
235
|
-
buttonEl =
|
|
235
|
+
buttonEl = React8.cloneElement(children, {
|
|
236
236
|
...linkButtonProps,
|
|
237
237
|
ref: mergedRef,
|
|
238
238
|
className: cx(childClassName, computedClassName, Button_default.buttonLink),
|
|
@@ -554,9 +554,9 @@ var INTERACTIVE_SELECTOR = 'a:not([disabled]), button:not([disabled]), [tabindex
|
|
|
554
554
|
function getMenuItems(el) {
|
|
555
555
|
return Array.from(el.querySelectorAll(INTERACTIVE_SELECTOR));
|
|
556
556
|
}
|
|
557
|
-
var MenuBase =
|
|
557
|
+
var MenuBase = React8.forwardRef(
|
|
558
558
|
({ children, className, itemRole = "menuitem", gap, onKeyDown, ...props }, ref) => {
|
|
559
|
-
const internalRef =
|
|
559
|
+
const internalRef = React8.useRef(null);
|
|
560
560
|
const handleKeyDown = (e) => {
|
|
561
561
|
const ul = internalRef.current;
|
|
562
562
|
if (!ul) return;
|
|
@@ -599,16 +599,16 @@ var MenuBase = React9.forwardRef(
|
|
|
599
599
|
}
|
|
600
600
|
);
|
|
601
601
|
MenuBase.displayName = "Menu";
|
|
602
|
-
var isInteractiveEl = (el) =>
|
|
602
|
+
var isInteractiveEl = (el) => React8.isValidElement(el) && (typeof el.type === "string" ? el.type === "a" || el.type === "button" : true);
|
|
603
603
|
function applyMenuItemPropsToElement(child, opts) {
|
|
604
604
|
var _a, _b, _c, _d;
|
|
605
605
|
const { active, selected, disabled, role, tabIndex = 0, className } = opts;
|
|
606
606
|
const childClass = [Menu_default.item, active ? Menu_default.active : "", selected ? Menu_default.selected : ""].filter(Boolean).join(" ");
|
|
607
|
-
const nextImmediate =
|
|
607
|
+
const nextImmediate = React8.cloneElement(child, {
|
|
608
608
|
className: [child.props.className, Menu_default.interactiveChild, className].filter(Boolean).join(" ")
|
|
609
609
|
});
|
|
610
610
|
if (typeof child.type === "string" && (child.type === "a" || child.type === "button")) {
|
|
611
|
-
return
|
|
611
|
+
return React8.cloneElement(child, {
|
|
612
612
|
role: (_a = child.props.role) != null ? _a : role,
|
|
613
613
|
tabIndex: (_b = child.props.tabIndex) != null ? _b : tabIndex,
|
|
614
614
|
"aria-selected": selected || void 0,
|
|
@@ -617,7 +617,7 @@ function applyMenuItemPropsToElement(child, opts) {
|
|
|
617
617
|
...child.type === "button" ? { disabled } : {}
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
|
-
return
|
|
620
|
+
return React8.cloneElement(nextImmediate, {
|
|
621
621
|
role: (_c = nextImmediate.props.role) != null ? _c : role,
|
|
622
622
|
tabIndex: (_d = nextImmediate.props.tabIndex) != null ? _d : tabIndex,
|
|
623
623
|
"aria-selected": selected || void 0,
|
|
@@ -626,7 +626,7 @@ function applyMenuItemPropsToElement(child, opts) {
|
|
|
626
626
|
disabled
|
|
627
627
|
});
|
|
628
628
|
}
|
|
629
|
-
var MenuItem =
|
|
629
|
+
var MenuItem = React8.forwardRef(
|
|
630
630
|
({ children, active, selected, disabled, className, itemRole, variant, ...liProps }, ref) => {
|
|
631
631
|
const resolvedRole = itemRole != null ? itemRole : "menuitem";
|
|
632
632
|
const isBordered = variant === "bordered";
|
|
@@ -664,7 +664,7 @@ var MenuItem = React9.forwardRef(
|
|
|
664
664
|
}
|
|
665
665
|
);
|
|
666
666
|
MenuItem.displayName = "Menu.Item";
|
|
667
|
-
var MenuCheckItem =
|
|
667
|
+
var MenuCheckItem = React8.forwardRef(
|
|
668
668
|
({
|
|
669
669
|
label,
|
|
670
670
|
checked,
|
|
@@ -730,7 +730,7 @@ var MenuCheckItem = React9.forwardRef(
|
|
|
730
730
|
}
|
|
731
731
|
);
|
|
732
732
|
MenuCheckItem.displayName = "Menu.CheckItem";
|
|
733
|
-
var MenuRadioItem =
|
|
733
|
+
var MenuRadioItem = React8.forwardRef(
|
|
734
734
|
({ name, value, checked, disabled, label, onValueChange, className, ...liProps }, ref) => {
|
|
735
735
|
return /* @__PURE__ */ jsx(
|
|
736
736
|
"li",
|
|
@@ -770,7 +770,7 @@ var MenuRadioItem = React9.forwardRef(
|
|
|
770
770
|
}
|
|
771
771
|
);
|
|
772
772
|
MenuRadioItem.displayName = "Menu.RadioItem";
|
|
773
|
-
var MenuSeparator =
|
|
773
|
+
var MenuSeparator = React8.forwardRef(
|
|
774
774
|
({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
775
775
|
"li",
|
|
776
776
|
{
|
|
@@ -782,7 +782,7 @@ var MenuSeparator = React9.forwardRef(
|
|
|
782
782
|
)
|
|
783
783
|
);
|
|
784
784
|
MenuSeparator.displayName = "Menu.Separator";
|
|
785
|
-
var MenuHeader =
|
|
785
|
+
var MenuHeader = React8.forwardRef(
|
|
786
786
|
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
787
787
|
"li",
|
|
788
788
|
{
|
|
@@ -1042,7 +1042,7 @@ var Popover = forwardRef(function Popover2({
|
|
|
1042
1042
|
(_b = (_a = triggerElRef.current) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
|
|
1043
1043
|
}, [isOpen, returnFocus]);
|
|
1044
1044
|
const icon = isOpen ? /* @__PURE__ */ jsx(ChevronUp, { className: "dbc-muted-text", size: 20 }) : /* @__PURE__ */ jsx(ChevronDown, { className: "dbc-muted-text", size: 20 });
|
|
1045
|
-
const setOverlayRef =
|
|
1045
|
+
const setOverlayRef = React8.useCallback(
|
|
1046
1046
|
(node) => {
|
|
1047
1047
|
assignRef(overlayRef, node);
|
|
1048
1048
|
},
|
|
@@ -1637,7 +1637,7 @@ function TableRow({
|
|
|
1637
1637
|
columns.map((column) => {
|
|
1638
1638
|
var _a2, _b, _c, _d;
|
|
1639
1639
|
const allowWrap = shouldAllowWrap(column.allowWrap, isSelected, viewMode);
|
|
1640
|
-
|
|
1640
|
+
column.allowOverflow;
|
|
1641
1641
|
const cellValue = getCellDisplayValue(row, column);
|
|
1642
1642
|
return /* @__PURE__ */ jsx(
|
|
1643
1643
|
"td",
|
|
@@ -1657,7 +1657,7 @@ function TableRow({
|
|
|
1657
1657
|
className: Table_default.cellContent,
|
|
1658
1658
|
"data-align": (_c = column.align) != null ? _c : "left",
|
|
1659
1659
|
"data-vertical-align": (_d = column.verticalAlign) != null ? _d : "top",
|
|
1660
|
-
children:
|
|
1660
|
+
children: /* @__PURE__ */ jsx("div", { className: Table_default.cellValueEllipsis, children: cellValue })
|
|
1661
1661
|
}
|
|
1662
1662
|
)
|
|
1663
1663
|
},
|
|
@@ -2259,19 +2259,19 @@ function TanstackTable(props) {
|
|
|
2259
2259
|
...tableProps
|
|
2260
2260
|
} = props;
|
|
2261
2261
|
const isControlledSorting = controlledSorting != null;
|
|
2262
|
-
const [uiSorting, setUiSorting] =
|
|
2263
|
-
|
|
2262
|
+
const [uiSorting, setUiSorting] = React8.useState(controlledSorting != null ? controlledSorting : []);
|
|
2263
|
+
React8.useEffect(() => {
|
|
2264
2264
|
if (!isControlledSorting) return;
|
|
2265
2265
|
if (sortingEqual(uiSorting, controlledSorting)) return;
|
|
2266
2266
|
setUiSorting(controlledSorting);
|
|
2267
2267
|
}, [isControlledSorting, controlledSorting, uiSorting]);
|
|
2268
|
-
const columnVisibility =
|
|
2268
|
+
const columnVisibility = React8.useMemo(
|
|
2269
2269
|
() => buildColumnVisibilityFromVisibleIds(columns, visibleColumnIds),
|
|
2270
2270
|
[columns, visibleColumnIds]
|
|
2271
2271
|
);
|
|
2272
|
-
const [columnSizing, setColumnSizing] =
|
|
2273
|
-
const containerRef =
|
|
2274
|
-
const [availableWidth, setAvailableWidth] =
|
|
2272
|
+
const [columnSizing, setColumnSizing] = React8.useState({});
|
|
2273
|
+
const containerRef = React8.useRef(null);
|
|
2274
|
+
const [availableWidth, setAvailableWidth] = React8.useState(void 0);
|
|
2275
2275
|
const table = useReactTable({
|
|
2276
2276
|
data,
|
|
2277
2277
|
columns,
|
|
@@ -2297,7 +2297,7 @@ function TanstackTable(props) {
|
|
|
2297
2297
|
size: DEFAULT_COLUMN_PX
|
|
2298
2298
|
}
|
|
2299
2299
|
});
|
|
2300
|
-
|
|
2300
|
+
React8.useLayoutEffect(() => {
|
|
2301
2301
|
const el = containerRef.current;
|
|
2302
2302
|
if (!el) return;
|
|
2303
2303
|
const updateWidth = () => {
|
|
@@ -2313,7 +2313,7 @@ function TanstackTable(props) {
|
|
|
2313
2313
|
observer.observe(el);
|
|
2314
2314
|
return () => observer.disconnect();
|
|
2315
2315
|
}, []);
|
|
2316
|
-
const distributedLayout =
|
|
2316
|
+
const distributedLayout = React8.useMemo(() => {
|
|
2317
2317
|
if (availableWidth == null) return null;
|
|
2318
2318
|
return buildDistributedColumnWidths({
|
|
2319
2319
|
table,
|
|
@@ -2324,7 +2324,7 @@ function TanstackTable(props) {
|
|
|
2324
2324
|
});
|
|
2325
2325
|
}, [table, selectedRows, onRowSelect, dataKey, columnSizing, availableWidth]);
|
|
2326
2326
|
const initialLayoutReady = availableWidth != null;
|
|
2327
|
-
const resolvedLayout =
|
|
2327
|
+
const resolvedLayout = React8.useMemo(() => {
|
|
2328
2328
|
const next = {};
|
|
2329
2329
|
table.getVisibleLeafColumns().forEach((column) => {
|
|
2330
2330
|
next[column.id] = {
|
|
@@ -2333,13 +2333,13 @@ function TanstackTable(props) {
|
|
|
2333
2333
|
});
|
|
2334
2334
|
return next;
|
|
2335
2335
|
}, [table, distributedLayout]);
|
|
2336
|
-
const columnItems =
|
|
2336
|
+
const columnItems = React8.useMemo(
|
|
2337
2337
|
() => mapDefsToColumnItems(columns, columnVisibility, resolvedLayout),
|
|
2338
2338
|
[columns, columnVisibility, resolvedLayout]
|
|
2339
2339
|
);
|
|
2340
2340
|
const visibleData = table.getRowModel().rows.map((r) => r.original);
|
|
2341
2341
|
const { sortById, sortDirection } = getSortPropsFromSorting(uiSorting);
|
|
2342
|
-
const handleSortChange =
|
|
2342
|
+
const handleSortChange = React8.useCallback(
|
|
2343
2343
|
(column, direction) => {
|
|
2344
2344
|
const next = direction == null ? [] : [{ id: column.id, desc: direction === "desc" }];
|
|
2345
2345
|
if (optimisticSortingUi) setUiSorting(next);
|
|
@@ -2347,7 +2347,7 @@ function TanstackTable(props) {
|
|
|
2347
2347
|
},
|
|
2348
2348
|
[optimisticSortingUi, onSortingChange]
|
|
2349
2349
|
);
|
|
2350
|
-
const headerExtras =
|
|
2350
|
+
const headerExtras = React8.useCallback(
|
|
2351
2351
|
({ index }) => {
|
|
2352
2352
|
var _a, _b, _c, _d;
|
|
2353
2353
|
const headerGroups = table.getHeaderGroups();
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|