@telicent-oss/ds 0.21.1 → 0.23.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/ds.js CHANGED
@@ -55119,9 +55119,9 @@ const DownArrow = ({
55119
55119
  ...iconProps
55120
55120
  }) => {
55121
55121
  const theme = useTheme$1();
55122
- return /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faAngleDown, css: /* @__PURE__ */ css({
55122
+ return /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faAngleDown, size: "sm", css: /* @__PURE__ */ css({
55123
55123
  color: color2 === "primary" ? theme.palette.primary.main : "inherit"
55124
- }, process.env.NODE_ENV === "production" ? "" : ";label:DownArrow;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3RlbGljZW50LWRzL3RlbGljZW50LWRzL3NyYy92MS9jb21wb25lbnRzL2RhdGEtZGlzcGxheS9Gb250QXdlc29tZUljb25zL0Rvd25BcnJvd0ljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCTSIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay90ZWxpY2VudC1kcy90ZWxpY2VudC1kcy9zcmMvdjEvY29tcG9uZW50cy9kYXRhLWRpc3BsYXkvRm9udEF3ZXNvbWVJY29ucy9Eb3duQXJyb3dJY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7XG4gIEZvbnRBd2Vzb21lSWNvbixcbiAgRm9udEF3ZXNvbWVJY29uUHJvcHMsXG59IGZyb20gXCJAZm9ydGF3ZXNvbWUvcmVhY3QtZm9udGF3ZXNvbWVcIjtcbmltcG9ydCB7IGZhQW5nbGVEb3duIH0gZnJvbSBcIkBmb3J0YXdlc29tZS9mcmVlLXNvbGlkLXN2Zy1pY29uc1wiO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tIFwiQG11aS9tYXRlcmlhbC9zdHlsZXNcIjtcblxudHlwZSBEb3duQXJyb3dJY29uUHJvcHMgPSBPbWl0PEZvbnRBd2Vzb21lSWNvblByb3BzLCBcImljb25cIj4gJiB7XG4gIGNvbG9yPzogXCJwcmltYXJ5XCIgfCBcImluaGVyaXRcIjtcbn07XG5cbmNvbnN0IERvd25BcnJvdzogUmVhY3QuRkM8RG93bkFycm93SWNvblByb3BzPiA9ICh7IGNvbG9yLCAuLi5pY29uUHJvcHMgfSkgPT4ge1xuICBjb25zdCB0aGVtZSA9IHVzZVRoZW1lKCk7XG5cbiAgcmV0dXJuIChcbiAgICA8Rm9udEF3ZXNvbWVJY29uXG4gICAgICBpY29uPXtmYUFuZ2xlRG93bn1cbiAgICAgIGNzcz17e1xuICAgICAgICBjb2xvcjogY29sb3IgPT09IFwicHJpbWFyeVwiID8gdGhlbWUucGFsZXR0ZS5wcmltYXJ5Lm1haW4gOiBcImluaGVyaXRcIixcbiAgICAgIH19XG4gICAgICB7Li4uaWNvblByb3BzfVxuICAgIC8+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBEb3duQXJyb3c7XG4iXX0= */"), ...iconProps });
55124
+ }, process.env.NODE_ENV === "production" ? "" : ";label:DownArrow;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3RlbGljZW50LWRzL3RlbGljZW50LWRzL3NyYy92MS9jb21wb25lbnRzL2RhdGEtZGlzcGxheS9Gb250QXdlc29tZUljb25zL0Rvd25BcnJvd0ljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CTSIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay90ZWxpY2VudC1kcy90ZWxpY2VudC1kcy9zcmMvdjEvY29tcG9uZW50cy9kYXRhLWRpc3BsYXkvRm9udEF3ZXNvbWVJY29ucy9Eb3duQXJyb3dJY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7XG4gIEZvbnRBd2Vzb21lSWNvbixcbiAgRm9udEF3ZXNvbWVJY29uUHJvcHMsXG59IGZyb20gXCJAZm9ydGF3ZXNvbWUvcmVhY3QtZm9udGF3ZXNvbWVcIjtcbmltcG9ydCB7IGZhQW5nbGVEb3duIH0gZnJvbSBcIkBmb3J0YXdlc29tZS9mcmVlLXNvbGlkLXN2Zy1pY29uc1wiO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tIFwiQG11aS9tYXRlcmlhbC9zdHlsZXNcIjtcblxudHlwZSBEb3duQXJyb3dJY29uUHJvcHMgPSBPbWl0PEZvbnRBd2Vzb21lSWNvblByb3BzLCBcImljb25cIj4gJiB7XG4gIGNvbG9yPzogXCJwcmltYXJ5XCIgfCBcImluaGVyaXRcIjtcbn07XG5cbmNvbnN0IERvd25BcnJvdzogUmVhY3QuRkM8RG93bkFycm93SWNvblByb3BzPiA9ICh7IGNvbG9yLCAuLi5pY29uUHJvcHMgfSkgPT4ge1xuICBjb25zdCB0aGVtZSA9IHVzZVRoZW1lKCk7XG5cbiAgcmV0dXJuIChcbiAgICA8Rm9udEF3ZXNvbWVJY29uXG4gICAgICBpY29uPXtmYUFuZ2xlRG93bn1cbiAgICAgIHNpemU9XCJzbVwiXG4gICAgICBjc3M9e3tcbiAgICAgICAgY29sb3I6IGNvbG9yID09PSBcInByaW1hcnlcIiA/IHRoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWluIDogXCJpbmhlcml0XCIsXG4gICAgICB9fVxuICAgICAgey4uLmljb25Qcm9wc31cbiAgICAvPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgRG93bkFycm93O1xuIl19 */"), ...iconProps });
55125
55125
  };
55126
55126
  const Download = ({
55127
55127
  color: color2,
@@ -57729,6 +57729,90 @@ const UserStatus = ({
57729
57729
  /* @__PURE__ */ jsx$1(Grid, { item: true, xs: 5, children: children2 })
57730
57730
  ] })
57731
57731
  ] });
57732
+ const DropdownButtonMenuItem = ({
57733
+ onClick,
57734
+ faIcon,
57735
+ id: id2,
57736
+ icon: icon2,
57737
+ value,
57738
+ selected = false
57739
+ }) => {
57740
+ const Icon2 = icon2;
57741
+ const theme = useExtendedTheme();
57742
+ return /* @__PURE__ */ jsxs(MenuItem, { onClick, id: id2, selected, sx: {
57743
+ display: "flex",
57744
+ alignItems: "center",
57745
+ marginX: 1,
57746
+ borderRadius: "4px",
57747
+ border: "1px solid rgba(0, 0, 0, 0)",
57748
+ "&.Mui-selected.Mui-selected": {
57749
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)"
57750
+ },
57751
+ "&.Mui-selected.Mui-selected:hover": {
57752
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)"
57753
+ },
57754
+ "&:hover": {
57755
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)",
57756
+ border: `1px solid ${theme.palette.primary.main}`
57757
+ }
57758
+ }, children: [
57759
+ (Icon2 || faIcon) && /* @__PURE__ */ jsxs(ListItemIcon$1, { children: [
57760
+ Icon2 && /* @__PURE__ */ jsx$1(Icon2, { color: selected ? "primary" : "inherit" }),
57761
+ faIcon && /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faIcon, fontSize: "medium", color: selected ? theme.palette.primary.main : "white" })
57762
+ ] }),
57763
+ /* @__PURE__ */ jsx$1(ListItemText$1, { children: /* @__PURE__ */ jsx$1(Typography, { variant: "h1", sx: {
57764
+ marginTop: 0.5,
57765
+ fontFamily: "Figtree",
57766
+ fontSize: 16,
57767
+ fontWeight: 400,
57768
+ color: `${selected ? theme.palette.primary.main : "primary"}`,
57769
+ display: "flex",
57770
+ alignItems: "center"
57771
+ }, children: value }) })
57772
+ ] });
57773
+ };
57774
+ const DropdownButton = ({
57775
+ ariaLabel,
57776
+ id: id2,
57777
+ menuItems
57778
+ }) => {
57779
+ const [anchorEl, setAnchorEl] = useState(null);
57780
+ const [selectedMenuItem, setSelectedMenuItem] = useState(menuItems.find((menuItem) => menuItem.default) ?? menuItems[0]);
57781
+ const theme = useExtendedTheme();
57782
+ const open = Boolean(anchorEl);
57783
+ const handleClick = (event) => {
57784
+ setAnchorEl(event.currentTarget);
57785
+ };
57786
+ const handleClose = () => {
57787
+ setAnchorEl(null);
57788
+ };
57789
+ return /* @__PURE__ */ jsxs(FlexBox, { children: [
57790
+ /* @__PURE__ */ jsxs(IconButton2, { "aria-label": ariaLabel, "aria-controls": open ? id2 : void 0, "aria-haspopup": "true", sx: {
57791
+ border: 0,
57792
+ "&:hover": {
57793
+ backgroundColor: "rgba(255, 255, 255, 0.08)"
57794
+ }
57795
+ }, "aria-expanded": open ? "true" : void 0, onClick: handleClick, color: "primary", children: [
57796
+ selectedMenuItem.icon && /* @__PURE__ */ jsx$1(selectedMenuItem.icon, { color: "primary", className: "mr-2" }),
57797
+ selectedMenuItem.faIcon && /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: selectedMenuItem.faIcon, fontSize: "medium", color: theme.palette.primary.main ?? "white", className: "mr-2" }),
57798
+ /* @__PURE__ */ jsx$1(DownArrow, {})
57799
+ ] }),
57800
+ /* @__PURE__ */ jsx$1(Menu, { id: id2, anchorEl, open, transformOrigin: {
57801
+ vertical: -20,
57802
+ horizontal: "left"
57803
+ }, onClose: handleClose, MenuListProps: {
57804
+ "aria-labelledby": id2
57805
+ }, sx: {
57806
+ "& .MuiPaper-root": {
57807
+ backgroundColor: theme.palette.mode === "dark" ? "#2A2A2A" : "#ffffff"
57808
+ }
57809
+ }, children: menuItems.map((menuItem, index) => /* @__PURE__ */ jsx$1(DropdownButtonMenuItem, { id: `${id2}-item-${index}`, onClick: () => {
57810
+ menuItem.onClick(menuItem.value);
57811
+ setSelectedMenuItem(menuItem);
57812
+ handleClose();
57813
+ }, icon: menuItem == null ? void 0 : menuItem.icon, faIcon: menuItem == null ? void 0 : menuItem.faIcon, value: menuItem.value, selected: menuItem.value === selectedMenuItem.value }, `${id2}-item-${index}`)) })
57814
+ ] });
57815
+ };
57732
57816
  const LinearProgress2 = ({
57733
57817
  // isActive,
57734
57818
  // transition = 500,
@@ -57742,19 +57826,19 @@ const LinearProgress2 = ({
57742
57826
  );
57743
57827
  };
57744
57828
  const Skeleton2 = Skeleton$1;
57745
- const PrimaryButton = (buttonProps) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", color: "primary", ...buttonProps, children: buttonProps.children });
57746
- const SecondaryButton = (buttonProps) => {
57829
+ const PrimaryButton = forwardRef((buttonProps, ref) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", ref, color: "primary", ...buttonProps, children: buttonProps.children }));
57830
+ const SecondaryButton = forwardRef((buttonProps, ref) => {
57747
57831
  if (buttonProps.disableElevation) {
57748
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, children: buttonProps.children });
57832
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, ref, children: buttonProps.children });
57749
57833
  }
57750
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, children: buttonProps.children });
57751
- };
57752
- const LinkButton = (buttonProps) => {
57834
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, ref, children: buttonProps.children });
57835
+ });
57836
+ const LinkButton = forwardRef((buttonProps, ref) => {
57753
57837
  const theme = useTheme$1();
57754
57838
  return /* @__PURE__ */ jsxs(Box, { sx: {
57755
57839
  width: "fit-content"
57756
57840
  }, children: [
57757
- /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57841
+ /* @__PURE__ */ jsx$1(Button$1, { ref, variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57758
57842
  minWidth: "fit-content",
57759
57843
  padding: 0,
57760
57844
  ":hover": {
@@ -57775,17 +57859,18 @@ const LinkButton = (buttonProps) => {
57775
57859
  transitionTimingFunction: "cubic-bezier(0.39, 0.58, 0.57, 1)"
57776
57860
  } })
57777
57861
  ] });
57778
- };
57779
- const Button2 = ({
57780
- variant = "primary",
57781
- color: color2 = "primary",
57782
- ...buttonProps
57783
- }) => {
57784
- if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps });
57785
- if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps });
57786
- if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps });
57787
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, children: buttonProps.children });
57788
- };
57862
+ });
57863
+ const Button2 = forwardRef((props, ref) => {
57864
+ const {
57865
+ variant = "primary",
57866
+ color: color2 = "primary",
57867
+ ...buttonProps
57868
+ } = props;
57869
+ if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps, ref });
57870
+ if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps, ref });
57871
+ if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps, ref });
57872
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, ref, children: buttonProps.children });
57873
+ });
57789
57874
  const TextField2 = (props) => /* @__PURE__ */ jsx$1(TextField$1, { ...props });
57790
57875
  const StyledPopper = styled$1("div")({
57791
57876
  position: "relative",
@@ -80695,6 +80780,7 @@ export {
80695
80780
  DownArrow as DownArrowIcon,
80696
80781
  Download as DownloadIcon,
80697
80782
  DragHandleIcon,
80783
+ DropdownButton,
80698
80784
  ENCODE_SEARCH_PARAMS_MODES_Schema,
80699
80785
  FeatureMap,
80700
80786
  Panel as FixedPanel,
package/dist/ds.umd.cjs CHANGED
@@ -55137,9 +55137,9 @@ Please use another name.` : formatMuiErrorMessage$1(18));
55137
55137
  ...iconProps
55138
55138
  }) => {
55139
55139
  const theme = useTheme$1();
55140
- return /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faAngleDown, css: /* @__PURE__ */ css({
55140
+ return /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faAngleDown, size: "sm", css: /* @__PURE__ */ css({
55141
55141
  color: color2 === "primary" ? theme.palette.primary.main : "inherit"
55142
- }, process.env.NODE_ENV === "production" ? "" : ";label:DownArrow;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3RlbGljZW50LWRzL3RlbGljZW50LWRzL3NyYy92MS9jb21wb25lbnRzL2RhdGEtZGlzcGxheS9Gb250QXdlc29tZUljb25zL0Rvd25BcnJvd0ljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWtCTSIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay90ZWxpY2VudC1kcy90ZWxpY2VudC1kcy9zcmMvdjEvY29tcG9uZW50cy9kYXRhLWRpc3BsYXkvRm9udEF3ZXNvbWVJY29ucy9Eb3duQXJyb3dJY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7XG4gIEZvbnRBd2Vzb21lSWNvbixcbiAgRm9udEF3ZXNvbWVJY29uUHJvcHMsXG59IGZyb20gXCJAZm9ydGF3ZXNvbWUvcmVhY3QtZm9udGF3ZXNvbWVcIjtcbmltcG9ydCB7IGZhQW5nbGVEb3duIH0gZnJvbSBcIkBmb3J0YXdlc29tZS9mcmVlLXNvbGlkLXN2Zy1pY29uc1wiO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tIFwiQG11aS9tYXRlcmlhbC9zdHlsZXNcIjtcblxudHlwZSBEb3duQXJyb3dJY29uUHJvcHMgPSBPbWl0PEZvbnRBd2Vzb21lSWNvblByb3BzLCBcImljb25cIj4gJiB7XG4gIGNvbG9yPzogXCJwcmltYXJ5XCIgfCBcImluaGVyaXRcIjtcbn07XG5cbmNvbnN0IERvd25BcnJvdzogUmVhY3QuRkM8RG93bkFycm93SWNvblByb3BzPiA9ICh7IGNvbG9yLCAuLi5pY29uUHJvcHMgfSkgPT4ge1xuICBjb25zdCB0aGVtZSA9IHVzZVRoZW1lKCk7XG5cbiAgcmV0dXJuIChcbiAgICA8Rm9udEF3ZXNvbWVJY29uXG4gICAgICBpY29uPXtmYUFuZ2xlRG93bn1cbiAgICAgIGNzcz17e1xuICAgICAgICBjb2xvcjogY29sb3IgPT09IFwicHJpbWFyeVwiID8gdGhlbWUucGFsZXR0ZS5wcmltYXJ5Lm1haW4gOiBcImluaGVyaXRcIixcbiAgICAgIH19XG4gICAgICB7Li4uaWNvblByb3BzfVxuICAgIC8+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBEb3duQXJyb3c7XG4iXX0= */"), ...iconProps });
55142
+ }, process.env.NODE_ENV === "production" ? "" : ";label:DownArrow;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL3RlbGljZW50LWRzL3RlbGljZW50LWRzL3NyYy92MS9jb21wb25lbnRzL2RhdGEtZGlzcGxheS9Gb250QXdlc29tZUljb25zL0Rvd25BcnJvd0ljb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQW1CTSIsImZpbGUiOiIvaG9tZS9ydW5uZXIvd29yay90ZWxpY2VudC1kcy90ZWxpY2VudC1kcy9zcmMvdjEvY29tcG9uZW50cy9kYXRhLWRpc3BsYXkvRm9udEF3ZXNvbWVJY29ucy9Eb3duQXJyb3dJY29uLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7XG4gIEZvbnRBd2Vzb21lSWNvbixcbiAgRm9udEF3ZXNvbWVJY29uUHJvcHMsXG59IGZyb20gXCJAZm9ydGF3ZXNvbWUvcmVhY3QtZm9udGF3ZXNvbWVcIjtcbmltcG9ydCB7IGZhQW5nbGVEb3duIH0gZnJvbSBcIkBmb3J0YXdlc29tZS9mcmVlLXNvbGlkLXN2Zy1pY29uc1wiO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tIFwiQG11aS9tYXRlcmlhbC9zdHlsZXNcIjtcblxudHlwZSBEb3duQXJyb3dJY29uUHJvcHMgPSBPbWl0PEZvbnRBd2Vzb21lSWNvblByb3BzLCBcImljb25cIj4gJiB7XG4gIGNvbG9yPzogXCJwcmltYXJ5XCIgfCBcImluaGVyaXRcIjtcbn07XG5cbmNvbnN0IERvd25BcnJvdzogUmVhY3QuRkM8RG93bkFycm93SWNvblByb3BzPiA9ICh7IGNvbG9yLCAuLi5pY29uUHJvcHMgfSkgPT4ge1xuICBjb25zdCB0aGVtZSA9IHVzZVRoZW1lKCk7XG5cbiAgcmV0dXJuIChcbiAgICA8Rm9udEF3ZXNvbWVJY29uXG4gICAgICBpY29uPXtmYUFuZ2xlRG93bn1cbiAgICAgIHNpemU9XCJzbVwiXG4gICAgICBjc3M9e3tcbiAgICAgICAgY29sb3I6IGNvbG9yID09PSBcInByaW1hcnlcIiA/IHRoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWluIDogXCJpbmhlcml0XCIsXG4gICAgICB9fVxuICAgICAgey4uLmljb25Qcm9wc31cbiAgICAvPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgRG93bkFycm93O1xuIl19 */"), ...iconProps });
55143
55143
  };
55144
55144
  const Download = ({
55145
55145
  color: color2,
@@ -57747,6 +57747,90 @@ Please use another name.` : formatMuiErrorMessage$1(18));
57747
57747
  /* @__PURE__ */ jsx$1(Grid, { item: true, xs: 5, children: children2 })
57748
57748
  ] })
57749
57749
  ] });
57750
+ const DropdownButtonMenuItem = ({
57751
+ onClick,
57752
+ faIcon,
57753
+ id: id2,
57754
+ icon: icon2,
57755
+ value,
57756
+ selected = false
57757
+ }) => {
57758
+ const Icon2 = icon2;
57759
+ const theme = useExtendedTheme();
57760
+ return /* @__PURE__ */ jsxs(MenuItem, { onClick, id: id2, selected, sx: {
57761
+ display: "flex",
57762
+ alignItems: "center",
57763
+ marginX: 1,
57764
+ borderRadius: "4px",
57765
+ border: "1px solid rgba(0, 0, 0, 0)",
57766
+ "&.Mui-selected.Mui-selected": {
57767
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)"
57768
+ },
57769
+ "&.Mui-selected.Mui-selected:hover": {
57770
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)"
57771
+ },
57772
+ "&:hover": {
57773
+ backgroundColor: theme.palette.mode === "dark" ? theme.palette.background.default : "rgba(0, 0, 0, 0.04)",
57774
+ border: `1px solid ${theme.palette.primary.main}`
57775
+ }
57776
+ }, children: [
57777
+ (Icon2 || faIcon) && /* @__PURE__ */ jsxs(ListItemIcon$1, { children: [
57778
+ Icon2 && /* @__PURE__ */ jsx$1(Icon2, { color: selected ? "primary" : "inherit" }),
57779
+ faIcon && /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: faIcon, fontSize: "medium", color: selected ? theme.palette.primary.main : "white" })
57780
+ ] }),
57781
+ /* @__PURE__ */ jsx$1(ListItemText$1, { children: /* @__PURE__ */ jsx$1(Typography, { variant: "h1", sx: {
57782
+ marginTop: 0.5,
57783
+ fontFamily: "Figtree",
57784
+ fontSize: 16,
57785
+ fontWeight: 400,
57786
+ color: `${selected ? theme.palette.primary.main : "primary"}`,
57787
+ display: "flex",
57788
+ alignItems: "center"
57789
+ }, children: value }) })
57790
+ ] });
57791
+ };
57792
+ const DropdownButton = ({
57793
+ ariaLabel,
57794
+ id: id2,
57795
+ menuItems
57796
+ }) => {
57797
+ const [anchorEl, setAnchorEl] = React$2.useState(null);
57798
+ const [selectedMenuItem, setSelectedMenuItem] = React$2.useState(menuItems.find((menuItem) => menuItem.default) ?? menuItems[0]);
57799
+ const theme = useExtendedTheme();
57800
+ const open = Boolean(anchorEl);
57801
+ const handleClick = (event) => {
57802
+ setAnchorEl(event.currentTarget);
57803
+ };
57804
+ const handleClose = () => {
57805
+ setAnchorEl(null);
57806
+ };
57807
+ return /* @__PURE__ */ jsxs(FlexBox, { children: [
57808
+ /* @__PURE__ */ jsxs(IconButton, { "aria-label": ariaLabel, "aria-controls": open ? id2 : void 0, "aria-haspopup": "true", sx: {
57809
+ border: 0,
57810
+ "&:hover": {
57811
+ backgroundColor: "rgba(255, 255, 255, 0.08)"
57812
+ }
57813
+ }, "aria-expanded": open ? "true" : void 0, onClick: handleClick, color: "primary", children: [
57814
+ selectedMenuItem.icon && /* @__PURE__ */ jsx$1(selectedMenuItem.icon, { color: "primary", className: "mr-2" }),
57815
+ selectedMenuItem.faIcon && /* @__PURE__ */ jsx$1(FontAwesomeIcon, { icon: selectedMenuItem.faIcon, fontSize: "medium", color: theme.palette.primary.main ?? "white", className: "mr-2" }),
57816
+ /* @__PURE__ */ jsx$1(DownArrow, {})
57817
+ ] }),
57818
+ /* @__PURE__ */ jsx$1(Menu, { id: id2, anchorEl, open, transformOrigin: {
57819
+ vertical: -20,
57820
+ horizontal: "left"
57821
+ }, onClose: handleClose, MenuListProps: {
57822
+ "aria-labelledby": id2
57823
+ }, sx: {
57824
+ "& .MuiPaper-root": {
57825
+ backgroundColor: theme.palette.mode === "dark" ? "#2A2A2A" : "#ffffff"
57826
+ }
57827
+ }, children: menuItems.map((menuItem, index) => /* @__PURE__ */ jsx$1(DropdownButtonMenuItem, { id: `${id2}-item-${index}`, onClick: () => {
57828
+ menuItem.onClick(menuItem.value);
57829
+ setSelectedMenuItem(menuItem);
57830
+ handleClose();
57831
+ }, icon: menuItem == null ? void 0 : menuItem.icon, faIcon: menuItem == null ? void 0 : menuItem.faIcon, value: menuItem.value, selected: menuItem.value === selectedMenuItem.value }, `${id2}-item-${index}`)) })
57832
+ ] });
57833
+ };
57750
57834
  const LinearProgress = ({
57751
57835
  // isActive,
57752
57836
  // transition = 500,
@@ -57760,19 +57844,19 @@ Please use another name.` : formatMuiErrorMessage$1(18));
57760
57844
  );
57761
57845
  };
57762
57846
  const Skeleton = Skeleton$1;
57763
- const PrimaryButton = (buttonProps) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", color: "primary", ...buttonProps, children: buttonProps.children });
57764
- const SecondaryButton = (buttonProps) => {
57847
+ const PrimaryButton = React$2.forwardRef((buttonProps, ref) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", ref, color: "primary", ...buttonProps, children: buttonProps.children }));
57848
+ const SecondaryButton = React$2.forwardRef((buttonProps, ref) => {
57765
57849
  if (buttonProps.disableElevation) {
57766
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, children: buttonProps.children });
57850
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, ref, children: buttonProps.children });
57767
57851
  }
57768
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, children: buttonProps.children });
57769
- };
57770
- const LinkButton = (buttonProps) => {
57852
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, ref, children: buttonProps.children });
57853
+ });
57854
+ const LinkButton = React$2.forwardRef((buttonProps, ref) => {
57771
57855
  const theme = useTheme$1();
57772
57856
  return /* @__PURE__ */ jsxs(Box, { sx: {
57773
57857
  width: "fit-content"
57774
57858
  }, children: [
57775
- /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57859
+ /* @__PURE__ */ jsx$1(Button$1, { ref, variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57776
57860
  minWidth: "fit-content",
57777
57861
  padding: 0,
57778
57862
  ":hover": {
@@ -57793,17 +57877,18 @@ Please use another name.` : formatMuiErrorMessage$1(18));
57793
57877
  transitionTimingFunction: "cubic-bezier(0.39, 0.58, 0.57, 1)"
57794
57878
  } })
57795
57879
  ] });
57796
- };
57797
- const Button = ({
57798
- variant = "primary",
57799
- color: color2 = "primary",
57800
- ...buttonProps
57801
- }) => {
57802
- if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps });
57803
- if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps });
57804
- if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps });
57805
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, children: buttonProps.children });
57806
- };
57880
+ });
57881
+ const Button = React$2.forwardRef((props, ref) => {
57882
+ const {
57883
+ variant = "primary",
57884
+ color: color2 = "primary",
57885
+ ...buttonProps
57886
+ } = props;
57887
+ if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps, ref });
57888
+ if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps, ref });
57889
+ if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps, ref });
57890
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, ref, children: buttonProps.children });
57891
+ });
57807
57892
  const TextField = (props) => /* @__PURE__ */ jsx$1(TextField$1, { ...props });
57808
57893
  const StyledPopper = styled$1("div")({
57809
57894
  position: "relative",
@@ -80717,6 +80802,7 @@ uniform ${i3} ${s4} u_${a3};
80717
80802
  exports2.DownArrowIcon = DownArrow;
80718
80803
  exports2.DownloadIcon = Download;
80719
80804
  exports2.DragHandleIcon = DragHandleIcon;
80805
+ exports2.DropdownButton = DropdownButton;
80720
80806
  exports2.ENCODE_SEARCH_PARAMS_MODES_Schema = ENCODE_SEARCH_PARAMS_MODES_Schema;
80721
80807
  exports2.FeatureMap = FeatureMap;
80722
80808
  exports2.FixedPanel = Panel;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { SvgIconProps } from '@mui/material/SvgIcon';
2
+ import { default as React } from 'react';
3
+ import { IconProp } from '@fortawesome/fontawesome-svg-core';
4
+
5
+ export interface DropdownButtonProps {
6
+ ariaLabel: string;
7
+ id: string;
8
+ menuItems: DropDownButtonMenuItemProps[];
9
+ }
10
+ export interface DropDownButtonMenuItemProps {
11
+ id: string;
12
+ onClick: (val: string) => void;
13
+ faIcon?: IconProp;
14
+ icon?: React.ElementType<SvgIconProps>;
15
+ value: string;
16
+ default?: boolean;
17
+ selected: boolean;
18
+ }
19
+ declare const DropdownButton: React.FC<DropdownButtonProps>;
20
+ export default DropdownButton;
@@ -0,0 +1,47 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: import('react').FC<import('./DropdownButton').DropdownButtonProps>;
6
+ tags: string[];
7
+ parameters: {
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
13
+ id: string;
14
+ ariaLabel: string;
15
+ menuItems: {
16
+ id: string;
17
+ icon: (() => import("@emotion/react/jsx-runtime").JSX.Element) | (() => import("@emotion/react/jsx-runtime").JSX.Element);
18
+ value: string;
19
+ default: boolean;
20
+ onClick: () => void;
21
+ selected: boolean;
22
+ }[];
23
+ };
24
+ argTypes: {
25
+ ariaLabel: {
26
+ control: "text";
27
+ description: string;
28
+ };
29
+ id: {
30
+ control: "text";
31
+ description: string;
32
+ };
33
+ menuItems: {
34
+ control: "object";
35
+ description: string;
36
+ };
37
+ };
38
+ decorators: (Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
39
+ ariaLabel: string;
40
+ id: string;
41
+ menuItems: import('./DropdownButton').DropDownButtonMenuItemProps[];
42
+ }>) => import("@emotion/react/jsx-runtime").JSX.Element;
43
+ };
44
+ export default meta;
45
+ type Story = StoryObj<typeof meta>;
46
+ export declare const DropdownWithFontAwesome: Story;
47
+ export declare const DropdownWithCustomIcons: Story;
@@ -0,0 +1,2 @@
1
+ export declare const TestCatalogIcon: () => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const TestGraphIcon: () => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -18,3 +18,4 @@ export { default as UserProfileContent } from './UserProfile/UserProfileContent/
18
18
  export { default as TitleAndContent } from './Text/TitleAndContent/TitleAndContent';
19
19
  export { default as UserStatus } from './UserProfile/UserProfileContent/UserStatus';
20
20
  export type { UserStatusProps } from './UserProfile/UserProfileContent/UserStatus';
21
+ export { default as DropdownButton } from './DropdownButton/DropdownButton';
@@ -47,5 +47,5 @@ export interface ButtonProps extends Omit<MUIButtonProps, "color" | "component"
47
47
  */
48
48
  variant?: "primary" | "secondary" | "tertiary" | "link" | "text";
49
49
  }
50
- declare const Button: React.FC<ButtonProps>;
50
+ declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
51
51
  export default Button;
@@ -2,7 +2,7 @@ import { StoryObj } from '@storybook/react';
2
2
 
3
3
  declare const meta: {
4
4
  title: string;
5
- component: import('react').FC<import('./Button').ButtonProps>;
5
+ component: import('react').ForwardRefExoticComponent<Omit<import('./Button').ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
6
6
  parameters: {
7
7
  docs: {
8
8
  description: {
@@ -16,15 +16,6 @@ declare const meta: {
16
16
  onClick: import('@vitest/spy').Mock<(...args: any[]) => any>;
17
17
  };
18
18
  decorators: (Story: import('@storybook/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
19
- color?: ("primary" | "inherit") | undefined;
20
- component?: import('@mui/material').ButtonProps["component"];
21
- disabled?: boolean | undefined;
22
- disableElevation?: boolean | undefined;
23
- endIcon?: import('react').ReactNode;
24
- fullWidth?: boolean | undefined;
25
- size?: import('@mui/material').ButtonProps["size"];
26
- startIcon?: import('react').ReactNode;
27
- variant?: ("primary" | "secondary" | "tertiary" | "link" | "text") | undefined;
28
19
  children?: import('react').ReactNode;
29
20
  defaultChecked?: boolean | undefined;
30
21
  defaultValue?: string | number | readonly string[] | undefined;
@@ -64,6 +55,7 @@ declare const meta: {
64
55
  vocab?: string | undefined;
65
56
  autoCorrect?: string | undefined;
66
57
  autoSave?: string | undefined;
58
+ color?: ("primary" | "inherit") | undefined;
67
59
  itemProp?: string | undefined;
68
60
  itemScope?: boolean | undefined;
69
61
  itemType?: string | undefined;
@@ -291,12 +283,15 @@ declare const meta: {
291
283
  onTransitionEnd?: import('react').TransitionEventHandler<HTMLButtonElement> | undefined;
292
284
  onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLButtonElement> | undefined;
293
285
  form?: string | undefined;
294
- ref?: ((instance: HTMLButtonElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLButtonElement> | null | undefined;
295
286
  key?: import('react').Key | null | undefined;
287
+ size?: import('@mui/material').ButtonProps["size"];
296
288
  type?: "submit" | "reset" | "button" | undefined;
297
289
  name?: string | undefined;
290
+ component?: import('@mui/material').ButtonProps["component"];
298
291
  action?: import('react').Ref<import('@mui/material').ButtonBaseActions> | undefined;
292
+ variant?: ("primary" | "secondary" | "tertiary" | "link" | "text") | undefined;
299
293
  centerRipple?: boolean | undefined;
294
+ disabled?: boolean | undefined;
300
295
  disableRipple?: boolean | undefined;
301
296
  disableTouchRipple?: boolean | undefined;
302
297
  focusRipple?: boolean | undefined;
@@ -311,7 +306,12 @@ declare const meta: {
311
306
  formMethod?: string | undefined;
312
307
  formNoValidate?: boolean | undefined;
313
308
  formTarget?: string | undefined;
309
+ disableElevation?: boolean | undefined;
310
+ fullWidth?: boolean | undefined;
311
+ startIcon?: import('react').ReactNode;
312
+ endIcon?: import('react').ReactNode;
314
313
  disableFocusRipple?: boolean | undefined;
314
+ ref?: import('react').LegacyRef<HTMLButtonElement> | undefined;
315
315
  }>) => import("@emotion/react/jsx-runtime").JSX.Element;
316
316
  };
317
317
  export default meta;
@@ -2,5 +2,5 @@ import { default as React } from 'react';
2
2
  import { ButtonProps as MUIButtonProps } from '@mui/material/Button';
3
3
 
4
4
  type LinkButtonProps = Omit<MUIButtonProps, "variant" | "color">;
5
- declare const LinkButton: React.FC<LinkButtonProps>;
5
+ declare const LinkButton: React.ForwardRefExoticComponent<Omit<LinkButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
6
  export default LinkButton;
@@ -2,5 +2,5 @@ import { default as React } from 'react';
2
2
  import { ButtonProps } from '@mui/material';
3
3
 
4
4
  type PrimaryButtonProps = Omit<ButtonProps, "variant" | "color">;
5
- declare const PrimaryButton: React.FC<PrimaryButtonProps>;
5
+ declare const PrimaryButton: React.ForwardRefExoticComponent<Omit<PrimaryButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
6
  export default PrimaryButton;
@@ -2,5 +2,5 @@ import { default as React } from 'react';
2
2
  import { ButtonProps as MUIButtonProps } from '@mui/material/Button';
3
3
 
4
4
  type SecondaryButtonProps = Omit<MUIButtonProps, "variant" | "color">;
5
- declare const SecondaryButton: React.FC<SecondaryButtonProps>;
5
+ declare const SecondaryButton: React.ForwardRefExoticComponent<Omit<SecondaryButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
6
6
  export default SecondaryButton;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "https://github.com/telicent-oss/telicent-ds.git"
8
8
  },
9
9
  "type": "module",
10
- "version": "0.21.1",
10
+ "version": "0.23.0",
11
11
  "private": false,
12
12
  "dependencies": {
13
13
  "@emotion/react": "^11.10.6",
@@ -24,16 +24,17 @@
24
24
  "@telicent-oss/ontology-icon-lib": "0.3.0",
25
25
  "@telicent-oss/ontologyservice": "0.31.3-TELFE654.0",
26
26
  "@telicent-oss/react-lib": "^0.5.0",
27
+ "@telicent-oss/telicent-frontend-cli": "^1.2.1",
27
28
  "classnames": "^2.3.1",
28
29
  "d3": "^7.8.2",
29
30
  "lodash": "^4.17.21",
30
31
  "maplibre-gl": "^3.5.0",
31
32
  "react": "18.2.0",
32
33
  "react-dom": "18.2.0",
33
- "react-router-dom": "^6.23.1",
34
34
  "react-error-boundary": "^5.0.0",
35
35
  "react-map-gl": "^7.1.6",
36
36
  "react-rnd": "^10.4.13",
37
+ "react-router-dom": "^6.23.1",
37
38
  "zod": "^3.21.4"
38
39
  },
39
40
  "resolutions": {
@@ -65,7 +66,9 @@
65
66
  "prebuild": "yarn clean",
66
67
  "bump:prerelease": "yarn version --prerelease && git push && git push --tags",
67
68
  "bump:pre": "yarn bump:prerelease",
68
- "link-to-local-packages": "./scripts/link-to-local-packages.sh"
69
+ "link-to-local-packages": "./scripts/link-to-local-packages.sh",
70
+ "postinstall": "[ \"$LOCAL_MACHINE\" = \"false\" ] && echo 'Skipping tefe hook-postinstall' || tefe hook-postinstall",
71
+ "prepare": "husky install"
69
72
  },
70
73
  "peerDependencies": {
71
74
  "@telicent-oss/ontology-icon-lib": "*",
@@ -98,6 +101,7 @@
98
101
  "@storybook/react": "8.4.0",
99
102
  "@storybook/react-vite": "8.4.0",
100
103
  "@storybook/test": "8.4.0",
104
+ "@storybook/theming": "^8.6.12",
101
105
  "@testing-library/dom": "^10.4.0",
102
106
  "@testing-library/jest-dom": "^6.6.3",
103
107
  "@testing-library/react": "^16.0.1",
@@ -213,4 +217,4 @@
213
217
  "WARNING: TSC CHECK NO ERROR": true
214
218
  }
215
219
  }
216
- }
220
+ }