@bwp-web/components 0.13.5 → 0.14.0
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/BiampBanner/BiampBanner.d.ts +32 -0
- package/dist/BiampBanner/BiampBanner.d.ts.map +1 -0
- package/dist/BiampBanner/index.d.ts +2 -0
- package/dist/BiampBanner/index.d.ts.map +1 -0
- package/dist/BiampTable/BiampTable.d.ts.map +1 -1
- package/dist/index.cjs +81 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -38
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BoxProps, TypographyProps, type AlertColor } from '@mui/material';
|
|
3
|
+
export type BiampBannerProps = {
|
|
4
|
+
show: boolean;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
severity: AlertColor;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A full-width notification banner that slides in/out with a Collapse animation.
|
|
10
|
+
* Uses MUI's AlertColor severity to set background and text colors from the theme.
|
|
11
|
+
* Compose with `BiampBannerIcon`, `BiampBannerContent`, and `BiampBannerActions`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BiampBanner({ show, children, severity }: BiampBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export type BiampBannerIconProps = {
|
|
15
|
+
severity?: AlertColor;
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Icon slot for `BiampBanner`. Pass a `severity` to render the matching
|
|
20
|
+
* default icon, or pass `children` to render a custom icon.
|
|
21
|
+
*/
|
|
22
|
+
export declare function BiampBannerIcon({ severity, children }: BiampBannerIconProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Content slot for `BiampBanner`. Text is centered by default.
|
|
25
|
+
*/
|
|
26
|
+
export declare function BiampBannerContent({ children, ...props }: TypographyProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Actions slot for `BiampBanner`. Renders children in a horizontal flex row
|
|
29
|
+
* with 8px gap, aligned to the trailing edge of the banner.
|
|
30
|
+
*/
|
|
31
|
+
export declare function BiampBannerActions({ children, ...props }: BoxProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=BiampBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BiampBanner.d.ts","sourceRoot":"","sources":["../../src/BiampBanner/BiampBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,QAAQ,EAGR,eAAe,EACf,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAQvB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,EAAE,UAAU,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAqBzE;AAUD,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,oBAAoB,2CAE3E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,2CAMzE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,QAAQ,2CAMlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/BiampBanner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BiampTable.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"BiampTable.d.ts","sourceRoot":"","sources":["../../src/BiampTable/BiampTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAWd,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAwB,KAAK,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAc,EAAE,KAAK,SAAS,EAAU,MAAM,OAAO,CAAC;AAOtD,KAAK,aAAa,CAAC,KAAK,IACpB;IACE,qFAAqF;IACrF,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,OAAO,CAAC;CAC1C,GACD;IACE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,CAAC;AAGN,KAAK,uBAAuB,GACxB;IACE,8DAA8D;IAC9D,kBAAkB,EAAE,IAAI,CAAC;IACzB,uFAAuF;IACvF,eAAe,EAAE,IAAI,CAAC;IACtB,iGAAiG;IACjG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,4FAA4F;IAC5F,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC,GACD;IACE,8DAA8D;IAC9D,kBAAkB,EAAE,IAAI,CAAC;IACzB,eAAe,CAAC,EAAE,KAAK,CAAC;IACxB,iGAAiG;IACjG,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wBAAwB,CAAC,EAAE,KAAK,CAAC;CAClC,GACD;IACE,kBAAkB,CAAC,EAAE,KAAK,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,KAAK,CAAC;IACtB,wBAAwB,CAAC,EAAE,KAAK,CAAC;CAClC,CAAC;AAEN,MAAM,MAAM,eAAe,CAAC,KAAK,IAAI,QAAQ,GAC3C,aAAa,CAAC,KAAK,CAAC,GACpB,uBAAuB,GAAG;IACxB,6CAA6C;IAC7C,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACpB,oEAAoE;IACpE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wKAAwK;IACxK,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,SAAS,CAAC;IACpC,6IAA6I;IAC7I,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,gIAAgI;IAChI,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,MAAM,CAAC;CACtC,CAAC;AAiRJ,wBAAgB,UAAU,CAAC,KAAK,EAAE,EAChC,KAAK,EACL,UAAU,EACV,cAAc,EACd,OAAO,EACP,KAAK,EACL,KAAK,EACL,kBAA0B,EAC1B,eAAuB,EACvB,aAAa,EACb,wBAAgC,EAChC,WAAW,EACX,EAAE,EACF,GAAG,QAAQ,EACZ,EAAE,eAAe,CAAC,KAAK,CAAC,2CAyJxB"}
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,10 @@ __export(index_exports, {
|
|
|
34
34
|
BiampAppDialog: () => BiampAppDialog,
|
|
35
35
|
BiampAppDialogItem: () => BiampAppDialogItem,
|
|
36
36
|
BiampAppPopover: () => BiampAppPopover,
|
|
37
|
+
BiampBanner: () => BiampBanner,
|
|
38
|
+
BiampBannerActions: () => BiampBannerActions,
|
|
39
|
+
BiampBannerContent: () => BiampBannerContent,
|
|
40
|
+
BiampBannerIcon: () => BiampBannerIcon,
|
|
37
41
|
BiampHeader: () => BiampHeader,
|
|
38
42
|
BiampHeaderActions: () => BiampHeaderActions,
|
|
39
43
|
BiampHeaderButton: () => BiampHeaderButton,
|
|
@@ -719,25 +723,9 @@ var checkboxHiddenSx = { visibility: "hidden" };
|
|
|
719
723
|
var expandCellBaseSx = {
|
|
720
724
|
display: "flex",
|
|
721
725
|
alignItems: "center",
|
|
722
|
-
gap:
|
|
726
|
+
gap: "2px"
|
|
723
727
|
};
|
|
724
|
-
var
|
|
725
|
-
color: ({ palette }) => palette.text.secondary,
|
|
726
|
-
transition: "transform 150ms ease",
|
|
727
|
-
transform: "rotate(90deg)",
|
|
728
|
-
width: 16,
|
|
729
|
-
height: 16,
|
|
730
|
-
cursor: "pointer"
|
|
731
|
-
};
|
|
732
|
-
var chevronCollapsedSx = {
|
|
733
|
-
color: ({ palette }) => palette.text.secondary,
|
|
734
|
-
transition: "transform 150ms ease",
|
|
735
|
-
transform: "rotate(0deg)",
|
|
736
|
-
width: 16,
|
|
737
|
-
height: 16,
|
|
738
|
-
cursor: "pointer"
|
|
739
|
-
};
|
|
740
|
-
var expandPlaceholderSx = { width: 16 };
|
|
728
|
+
var expandPlaceholderSx = { width: 28 };
|
|
741
729
|
var headerSelectionCellSx = {
|
|
742
730
|
position: "sticky",
|
|
743
731
|
left: 0,
|
|
@@ -747,6 +735,8 @@ var headerSelectionCellSx = {
|
|
|
747
735
|
var checkboxHiddenHeaderSx = { visibility: "hidden" };
|
|
748
736
|
function BiampTableRowInner({
|
|
749
737
|
row,
|
|
738
|
+
isExpanded,
|
|
739
|
+
isSelected,
|
|
750
740
|
onRowClick,
|
|
751
741
|
isRowClickable,
|
|
752
742
|
enableRowSelection,
|
|
@@ -760,7 +750,7 @@ function BiampTableRowInner({
|
|
|
760
750
|
import_material7.TableRow,
|
|
761
751
|
{
|
|
762
752
|
hover: clickable,
|
|
763
|
-
selected: enableRowSelection ?
|
|
753
|
+
selected: enableRowSelection ? isSelected : void 0,
|
|
764
754
|
role: clickable ? "button" : void 0,
|
|
765
755
|
tabIndex: clickable ? 0 : void 0,
|
|
766
756
|
sx: clickable ? rowCursorPointerSx : void 0,
|
|
@@ -775,7 +765,7 @@ function BiampTableRowInner({
|
|
|
775
765
|
enableRowSelection && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material7.TableCell, { padding: "checkbox", sx: selectionCellSx, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
776
766
|
import_material7.Checkbox,
|
|
777
767
|
{
|
|
778
|
-
checked:
|
|
768
|
+
checked: isSelected,
|
|
779
769
|
disabled: !row.getCanSelect(),
|
|
780
770
|
onChange: (e) => row.toggleSelected(e.target.checked, {
|
|
781
771
|
selectChildren: selectChildrenWithParent
|
|
@@ -800,7 +790,10 @@ function BiampTableRowInner({
|
|
|
800
790
|
import_material7.TableCell,
|
|
801
791
|
{
|
|
802
792
|
"data-sticky": sticky || void 0,
|
|
803
|
-
sx:
|
|
793
|
+
sx: {
|
|
794
|
+
...cellSx(sticky, cell.column.columnDef.meta?.minWidth, 2),
|
|
795
|
+
pl: isExpandCell ? "6px" : "12px"
|
|
796
|
+
},
|
|
804
797
|
children: (() => {
|
|
805
798
|
if (sticky) return content;
|
|
806
799
|
const truncate = cell.column.columnDef.meta?.truncate ?? true;
|
|
@@ -813,16 +806,32 @@ function BiampTableRowInner({
|
|
|
813
806
|
sx: row.depth > 0 ? { ...expandCellBaseSx, pl: `${row.depth * 12}px` } : expandCellBaseSx,
|
|
814
807
|
children: [
|
|
815
808
|
row.getCanExpand() ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
816
|
-
|
|
809
|
+
import_material7.IconButton,
|
|
817
810
|
{
|
|
811
|
+
variant: "none",
|
|
818
812
|
onClick: (e) => {
|
|
819
813
|
e.stopPropagation();
|
|
820
814
|
row.toggleExpanded();
|
|
821
815
|
},
|
|
822
|
-
"aria-label":
|
|
823
|
-
"aria-expanded":
|
|
824
|
-
|
|
825
|
-
|
|
816
|
+
"aria-label": isExpanded ? `Collapse ${rowLabel}` : `Expand ${rowLabel}`,
|
|
817
|
+
"aria-expanded": isExpanded,
|
|
818
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
819
|
+
import_assets5.ChevronDownIcon,
|
|
820
|
+
{
|
|
821
|
+
variant: "xs",
|
|
822
|
+
sx: {
|
|
823
|
+
color: ({ palette }) => palette.text.secondary
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
827
|
+
import_assets5.ChevronRightIcon,
|
|
828
|
+
{
|
|
829
|
+
variant: "xs",
|
|
830
|
+
sx: {
|
|
831
|
+
color: ({ palette }) => palette.text.secondary
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
)
|
|
826
835
|
}
|
|
827
836
|
) : hasExpandableRows ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material7.Box, { sx: expandPlaceholderSx }) : null,
|
|
828
837
|
truncated
|
|
@@ -840,7 +849,7 @@ function BiampTableRowInner({
|
|
|
840
849
|
);
|
|
841
850
|
}
|
|
842
851
|
function biampTableRowPropsAreEqual(prev, next) {
|
|
843
|
-
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.
|
|
852
|
+
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.isExpanded === next.isExpanded && prev.row.getVisibleCells().length === next.row.getVisibleCells().length && prev.enableRowSelection === next.enableRowSelection && prev.enableExpanding === next.enableExpanding && prev.hasExpandableRows === next.hasExpandableRows && prev.selectChildrenWithParent === next.selectChildrenWithParent && prev.onRowClick === next.onRowClick && prev.isRowClickable === next.isRowClickable && prev.getRowLabel === next.getRowLabel;
|
|
844
853
|
}
|
|
845
854
|
var BiampTableRow = import_react4.default.memo(
|
|
846
855
|
BiampTableRowInner,
|
|
@@ -884,8 +893,6 @@ function BiampTable({
|
|
|
884
893
|
display: "flex",
|
|
885
894
|
flexDirection: "column",
|
|
886
895
|
height: "100%",
|
|
887
|
-
overflow: "auto",
|
|
888
|
-
overscrollBehavior: "none",
|
|
889
896
|
position: "relative",
|
|
890
897
|
...sx
|
|
891
898
|
},
|
|
@@ -949,6 +956,8 @@ function BiampTable({
|
|
|
949
956
|
BiampTableRow,
|
|
950
957
|
{
|
|
951
958
|
row,
|
|
959
|
+
isExpanded: row.getIsExpanded(),
|
|
960
|
+
isSelected: row.getIsSelected(),
|
|
952
961
|
onRowClick,
|
|
953
962
|
isRowClickable,
|
|
954
963
|
enableRowSelection,
|
|
@@ -1860,12 +1869,55 @@ function downloadCsv(csvContent, filename) {
|
|
|
1860
1869
|
document.body.removeChild(link);
|
|
1861
1870
|
URL.revokeObjectURL(url);
|
|
1862
1871
|
}
|
|
1872
|
+
|
|
1873
|
+
// src/BiampBanner/BiampBanner.tsx
|
|
1874
|
+
var import_material18 = require("@mui/material");
|
|
1875
|
+
var import_assets10 = require("@bwp-web/assets");
|
|
1876
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1877
|
+
function BiampBanner({ show, children, severity }) {
|
|
1878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Collapse, { in: show, unmountOnExit: true, component: "aside", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1879
|
+
import_material18.Box,
|
|
1880
|
+
{
|
|
1881
|
+
bgcolor: ({ palette }) => palette.background[severity],
|
|
1882
|
+
display: "flex",
|
|
1883
|
+
flexDirection: "row",
|
|
1884
|
+
alignItems: "center",
|
|
1885
|
+
justifyContent: "space-between",
|
|
1886
|
+
gap: 1,
|
|
1887
|
+
px: { xs: 2, sm: 2.5 },
|
|
1888
|
+
minHeight: 48,
|
|
1889
|
+
sx: {
|
|
1890
|
+
borderBottom: ({ palette }) => `0.6px solid ${palette[severity].main}`
|
|
1891
|
+
},
|
|
1892
|
+
children
|
|
1893
|
+
}
|
|
1894
|
+
) });
|
|
1895
|
+
}
|
|
1896
|
+
var iconMapping = {
|
|
1897
|
+
error: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets10.ErrorStatusIcon, { color: "error", sx: { width: 14, height: 14 } }),
|
|
1898
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets10.WarningStatusIcon, { color: "warning", sx: { width: 16, height: 14 } }),
|
|
1899
|
+
success: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets10.SuccessStatusIcon, { color: "success", sx: { width: 14, height: 14 } }),
|
|
1900
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_assets10.InfoStatusIcon, { color: "info", sx: { width: 14, height: 14 } })
|
|
1901
|
+
};
|
|
1902
|
+
function BiampBannerIcon({ severity, children }) {
|
|
1903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: severity ? iconMapping[severity] : children });
|
|
1904
|
+
}
|
|
1905
|
+
function BiampBannerContent({ children, ...props }) {
|
|
1906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Typography, { textAlign: "center", variant: "h3", ...props, children });
|
|
1907
|
+
}
|
|
1908
|
+
function BiampBannerActions({ children, ...props }) {
|
|
1909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material18.Box, { display: "flex", gap: 1, alignItems: "center", ...props, children });
|
|
1910
|
+
}
|
|
1863
1911
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1864
1912
|
0 && (module.exports = {
|
|
1865
1913
|
BIAMP_TABLE_DEBOUNCE_DELAY,
|
|
1866
1914
|
BiampAppDialog,
|
|
1867
1915
|
BiampAppDialogItem,
|
|
1868
1916
|
BiampAppPopover,
|
|
1917
|
+
BiampBanner,
|
|
1918
|
+
BiampBannerActions,
|
|
1919
|
+
BiampBannerContent,
|
|
1920
|
+
BiampBannerIcon,
|
|
1869
1921
|
BiampHeader,
|
|
1870
1922
|
BiampHeaderActions,
|
|
1871
1923
|
BiampHeaderButton,
|