@telicent-oss/ds 0.21.0 → 0.22.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
@@ -57742,19 +57742,19 @@ const LinearProgress2 = ({
57742
57742
  );
57743
57743
  };
57744
57744
  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) => {
57745
+ const PrimaryButton = forwardRef((buttonProps, ref) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", ref, color: "primary", ...buttonProps, children: buttonProps.children }));
57746
+ const SecondaryButton = forwardRef((buttonProps, ref) => {
57747
57747
  if (buttonProps.disableElevation) {
57748
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, children: buttonProps.children });
57748
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, ref, children: buttonProps.children });
57749
57749
  }
57750
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, children: buttonProps.children });
57751
- };
57752
- const LinkButton = (buttonProps) => {
57750
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, ref, children: buttonProps.children });
57751
+ });
57752
+ const LinkButton = forwardRef((buttonProps, ref) => {
57753
57753
  const theme = useTheme$1();
57754
57754
  return /* @__PURE__ */ jsxs(Box, { sx: {
57755
57755
  width: "fit-content"
57756
57756
  }, children: [
57757
- /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57757
+ /* @__PURE__ */ jsx$1(Button$1, { ref, variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57758
57758
  minWidth: "fit-content",
57759
57759
  padding: 0,
57760
57760
  ":hover": {
@@ -57775,17 +57775,18 @@ const LinkButton = (buttonProps) => {
57775
57775
  transitionTimingFunction: "cubic-bezier(0.39, 0.58, 0.57, 1)"
57776
57776
  } })
57777
57777
  ] });
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
- };
57778
+ });
57779
+ const Button2 = forwardRef((props, ref) => {
57780
+ const {
57781
+ variant = "primary",
57782
+ color: color2 = "primary",
57783
+ ...buttonProps
57784
+ } = props;
57785
+ if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps, ref });
57786
+ if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps, ref });
57787
+ if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps, ref });
57788
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, ref, children: buttonProps.children });
57789
+ });
57789
57790
  const TextField2 = (props) => /* @__PURE__ */ jsx$1(TextField$1, { ...props });
57790
57791
  const StyledPopper = styled$1("div")({
57791
57792
  position: "relative",
@@ -61097,6 +61098,7 @@ const modalPropsSchema = allModalPropsSchema.omit({
61097
61098
  }).passthrough();
61098
61099
  const Modal2 = ({
61099
61100
  children: children2,
61101
+ hideCloseButton,
61100
61102
  ...props
61101
61103
  }) => {
61102
61104
  modalPropsSchema.parse({
@@ -61123,7 +61125,7 @@ const Modal2 = ({
61123
61125
  /* @__PURE__ */ jsx$1(Box, { sx: {
61124
61126
  display: "flex",
61125
61127
  justifyContent: "flex-end"
61126
- }, children: /* @__PURE__ */ jsxs(Button$1, { onClick: (event) => {
61128
+ }, children: !hideCloseButton && /* @__PURE__ */ jsxs(Button$1, { onClick: (event) => {
61127
61129
  var _a2;
61128
61130
  return (_a2 = props.onClose) == null ? void 0 : _a2.call(props, event, "closeButtonClick");
61129
61131
  }, color: "inherit", sx: {
package/dist/ds.umd.cjs CHANGED
@@ -57760,19 +57760,19 @@ Please use another name.` : formatMuiErrorMessage$1(18));
57760
57760
  );
57761
57761
  };
57762
57762
  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) => {
57763
+ const PrimaryButton = React$2.forwardRef((buttonProps, ref) => /* @__PURE__ */ jsx$1(Button$1, { variant: "contained", ref, color: "primary", ...buttonProps, children: buttonProps.children }));
57764
+ const SecondaryButton = React$2.forwardRef((buttonProps, ref) => {
57765
57765
  if (buttonProps.disableElevation) {
57766
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, children: buttonProps.children });
57766
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "primary", ...buttonProps, ref, children: buttonProps.children });
57767
57767
  }
57768
- return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, children: buttonProps.children });
57769
- };
57770
- const LinkButton = (buttonProps) => {
57768
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "outlined", color: "inherit", ...buttonProps, ref, children: buttonProps.children });
57769
+ });
57770
+ const LinkButton = React$2.forwardRef((buttonProps, ref) => {
57771
57771
  const theme = useTheme$1();
57772
57772
  return /* @__PURE__ */ jsxs(Box, { sx: {
57773
57773
  width: "fit-content"
57774
57774
  }, children: [
57775
- /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57775
+ /* @__PURE__ */ jsx$1(Button$1, { ref, variant: "text", color: "primary", ...buttonProps, disableRipple: true, sx: {
57776
57776
  minWidth: "fit-content",
57777
57777
  padding: 0,
57778
57778
  ":hover": {
@@ -57793,17 +57793,18 @@ Please use another name.` : formatMuiErrorMessage$1(18));
57793
57793
  transitionTimingFunction: "cubic-bezier(0.39, 0.58, 0.57, 1)"
57794
57794
  } })
57795
57795
  ] });
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
- };
57796
+ });
57797
+ const Button = React$2.forwardRef((props, ref) => {
57798
+ const {
57799
+ variant = "primary",
57800
+ color: color2 = "primary",
57801
+ ...buttonProps
57802
+ } = props;
57803
+ if (variant === "primary") return /* @__PURE__ */ jsx$1(PrimaryButton, { ...buttonProps, ref });
57804
+ if (variant === "secondary") return /* @__PURE__ */ jsx$1(SecondaryButton, { ...buttonProps, ref });
57805
+ if (variant === "link") return /* @__PURE__ */ jsx$1(LinkButton, { ...buttonProps, ref });
57806
+ return /* @__PURE__ */ jsx$1(Button$1, { variant: "text", color: color2, ...buttonProps, ref, children: buttonProps.children });
57807
+ });
57807
57808
  const TextField = (props) => /* @__PURE__ */ jsx$1(TextField$1, { ...props });
57808
57809
  const StyledPopper = styled$1("div")({
57809
57810
  position: "relative",
@@ -61115,6 +61116,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
61115
61116
  }).passthrough();
61116
61117
  const Modal = ({
61117
61118
  children: children2,
61119
+ hideCloseButton,
61118
61120
  ...props
61119
61121
  }) => {
61120
61122
  modalPropsSchema.parse({
@@ -61141,7 +61143,7 @@ Please use another name.` : formatMuiErrorMessage$1(18));
61141
61143
  /* @__PURE__ */ jsx$1(Box, { sx: {
61142
61144
  display: "flex",
61143
61145
  justifyContent: "flex-end"
61144
- }, children: /* @__PURE__ */ jsxs(Button$1, { onClick: (event) => {
61146
+ }, children: !hideCloseButton && /* @__PURE__ */ jsxs(Button$1, { onClick: (event) => {
61145
61147
  var _a2;
61146
61148
  return (_a2 = props.onClose) == null ? void 0 : _a2.call(props, event, "closeButtonClick");
61147
61149
  }, color: "inherit", sx: {
@@ -0,0 +1 @@
1
+ export {};
@@ -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;
@@ -3,6 +3,7 @@ import { ModalProps as MUIModalProps } from '@mui/material/Modal';
3
3
 
4
4
  export type ModalProps = Omit<MUIModalProps, "slots" | "slotProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "components" | "componentsProps" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disableRestoreFocus" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onTransitionEnter" | "onTransitionExit"> & {
5
5
  onClose: ((event: {}, reason: "backdropClick" | "escapeKeyDown" | "closeButtonClick") => void) | undefined;
6
+ hideCloseButton?: boolean;
6
7
  };
7
8
  export declare const Modal: React.FC<ModalProps>;
8
9
  export default Modal;
@@ -5,3 +5,4 @@ declare const meta: Meta<typeof Modal>;
5
5
  export default meta;
6
6
  type Story = StoryObj<typeof Modal>;
7
7
  export declare const Example: Story;
8
+ export declare const WithNoCloseButton: Story;
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.0",
10
+ "version": "0.22.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": "*",
@@ -213,4 +216,4 @@
213
216
  "WARNING: TSC CHECK NO ERROR": true
214
217
  }
215
218
  }
216
- }
219
+ }