@cgi-learning-hub/ui 1.12.0-dev.1771407294 → 1.12.0-dev.1771430232
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/index.cjs.js +36 -20
- package/dist/index.d.ts +10 -9
- package/dist/index.es.js +36 -20
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -8,6 +8,8 @@ const ReactDOM = require("react-dom");
|
|
|
8
8
|
const reactColor = require("react-color");
|
|
9
9
|
const dayjs = require("dayjs");
|
|
10
10
|
const reactDropzone = require("react-dropzone");
|
|
11
|
+
const iconsMaterial = require("@mui/icons-material");
|
|
12
|
+
const material = require("@mui/material");
|
|
11
13
|
function _interopNamespaceDefault(e) {
|
|
12
14
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
13
15
|
if (e) {
|
|
@@ -63631,12 +63633,6 @@ const TreeView = ({
|
|
|
63631
63633
|
}
|
|
63632
63634
|
) });
|
|
63633
63635
|
};
|
|
63634
|
-
const AddRoundedIcon = createSvgIcon(/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
63635
|
-
d: "M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"
|
|
63636
|
-
}), "AddRounded");
|
|
63637
|
-
const RemoveRoundedIcon = createSvgIcon(/* @__PURE__ */ jsxRuntime.jsx("path", {
|
|
63638
|
-
d: "M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1"
|
|
63639
|
-
}), "RemoveRounded");
|
|
63640
63636
|
const GREY = "rgba(238, 238, 238, 0.75)";
|
|
63641
63637
|
const LIGHT_GREY = "#D6D6D6";
|
|
63642
63638
|
const WHITE = "#FFFFFF";
|
|
@@ -63686,22 +63682,42 @@ const labelStyle = {
|
|
|
63686
63682
|
opacity: 0.8
|
|
63687
63683
|
}
|
|
63688
63684
|
};
|
|
63689
|
-
const
|
|
63690
|
-
|
|
63691
|
-
|
|
63692
|
-
|
|
63693
|
-
|
|
63694
|
-
|
|
63695
|
-
resetZoom,
|
|
63685
|
+
const ZoomControl = ({
|
|
63686
|
+
step = 10,
|
|
63687
|
+
value = 50,
|
|
63688
|
+
onChange,
|
|
63689
|
+
max: max2 = 100,
|
|
63690
|
+
min: min2 = 0,
|
|
63696
63691
|
label = "Zoom",
|
|
63692
|
+
opacity = 1,
|
|
63697
63693
|
slotProps = {}
|
|
63698
63694
|
}) => {
|
|
63699
|
-
const isMinZoom =
|
|
63700
|
-
const isMaxZoom =
|
|
63701
|
-
|
|
63702
|
-
|
|
63703
|
-
|
|
63704
|
-
|
|
63695
|
+
const isMinZoom = value === min2;
|
|
63696
|
+
const isMaxZoom = value === max2;
|
|
63697
|
+
const initialValue = React.useRef(value);
|
|
63698
|
+
const handleDecrease = () => onChange?.(Math.max(value - step, min2));
|
|
63699
|
+
const handleIncrease = () => onChange?.(Math.min(value + step, max2));
|
|
63700
|
+
const handleReset = () => onChange?.(initialValue.current);
|
|
63701
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: containerStyle({ opacity }), ...slotProps.root, children: [
|
|
63702
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
63703
|
+
material.IconButton,
|
|
63704
|
+
{
|
|
63705
|
+
onClick: handleDecrease,
|
|
63706
|
+
disabled: isMinZoom,
|
|
63707
|
+
sx: iconButtonStyle,
|
|
63708
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.RemoveRounded, { sx: iconStyle({ disabled: isMinZoom }) })
|
|
63709
|
+
}
|
|
63710
|
+
),
|
|
63711
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.Typography, { onClick: handleReset, sx: labelStyle, component: "button", children: label }),
|
|
63712
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
63713
|
+
material.IconButton,
|
|
63714
|
+
{
|
|
63715
|
+
onClick: handleIncrease,
|
|
63716
|
+
disabled: isMaxZoom,
|
|
63717
|
+
sx: iconButtonStyle,
|
|
63718
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.AddRounded, { sx: iconStyle({ disabled: isMaxZoom }) })
|
|
63719
|
+
}
|
|
63720
|
+
)
|
|
63705
63721
|
] });
|
|
63706
63722
|
};
|
|
63707
63723
|
Object.defineProperty(exports, "css", {
|
|
@@ -63841,7 +63857,7 @@ exports.Tooltip = Tooltip;
|
|
|
63841
63857
|
exports.TreeView = TreeView;
|
|
63842
63858
|
exports.Typography = Typography;
|
|
63843
63859
|
exports.Zoom = Zoom;
|
|
63844
|
-
exports.
|
|
63860
|
+
exports.ZoomControl = ZoomControl;
|
|
63845
63861
|
exports.accordionActionsClasses = accordionActionsClasses;
|
|
63846
63862
|
exports.accordionClasses = accordionClasses;
|
|
63847
63863
|
exports.accordionDetailsClasses = accordionDetailsClasses;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { BackdropProps } from '@mui/material/Backdrop';
|
|
|
12
12
|
import { default as Badge } from '@mui/material/Badge';
|
|
13
13
|
import { default as Box } from '@mui/material/Box';
|
|
14
14
|
import { BoxProps } from '@mui/material/Box';
|
|
15
|
+
import { BoxProps as BoxProps_2 } from '@mui/material';
|
|
15
16
|
import { default as Breadcrumbs } from '@mui/material/Breadcrumbs';
|
|
16
17
|
import { default as ButtonGroup } from '@mui/material/ButtonGroup';
|
|
17
18
|
import { ButtonProps } from '@mui/material/Button';
|
|
@@ -652,18 +653,18 @@ export { useMediaQuery }
|
|
|
652
653
|
|
|
653
654
|
export { Zoom }
|
|
654
655
|
|
|
655
|
-
export declare const
|
|
656
|
+
export declare const ZoomControl: FC<ZoomControlProps>;
|
|
656
657
|
|
|
657
|
-
declare interface
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
resetZoom: () => void;
|
|
658
|
+
declare interface ZoomControlProps {
|
|
659
|
+
step?: number;
|
|
660
|
+
value: number;
|
|
661
|
+
onChange: (value: number) => void;
|
|
662
|
+
max?: number;
|
|
663
|
+
min?: number;
|
|
664
664
|
label?: string;
|
|
665
|
+
opacity?: number;
|
|
665
666
|
slotProps?: {
|
|
666
|
-
|
|
667
|
+
root?: BoxProps_2;
|
|
667
668
|
};
|
|
668
669
|
}
|
|
669
670
|
|
package/dist/index.es.js
CHANGED
|
@@ -9,6 +9,8 @@ import ReactDOM__default from "react-dom";
|
|
|
9
9
|
import { CirclePicker } from "react-color";
|
|
10
10
|
import dayjs from "dayjs";
|
|
11
11
|
import { useDropzone } from "react-dropzone";
|
|
12
|
+
import { RemoveRounded, AddRounded } from "@mui/icons-material";
|
|
13
|
+
import { Box as Box$1, IconButton as IconButton$1, Typography as Typography$1 } from "@mui/material";
|
|
12
14
|
function getDefaultExportFromCjs(x) {
|
|
13
15
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
14
16
|
}
|
|
@@ -63614,12 +63616,6 @@ const TreeView = ({
|
|
|
63614
63616
|
}
|
|
63615
63617
|
) });
|
|
63616
63618
|
};
|
|
63617
|
-
const AddRoundedIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
|
|
63618
|
-
d: "M18 13h-5v5c0 .55-.45 1-1 1s-1-.45-1-1v-5H6c-.55 0-1-.45-1-1s.45-1 1-1h5V6c0-.55.45-1 1-1s1 .45 1 1v5h5c.55 0 1 .45 1 1s-.45 1-1 1"
|
|
63619
|
-
}), "AddRounded");
|
|
63620
|
-
const RemoveRoundedIcon = createSvgIcon(/* @__PURE__ */ jsx("path", {
|
|
63621
|
-
d: "M18 13H6c-.55 0-1-.45-1-1s.45-1 1-1h12c.55 0 1 .45 1 1s-.45 1-1 1"
|
|
63622
|
-
}), "RemoveRounded");
|
|
63623
63619
|
const GREY = "rgba(238, 238, 238, 0.75)";
|
|
63624
63620
|
const LIGHT_GREY = "#D6D6D6";
|
|
63625
63621
|
const WHITE = "#FFFFFF";
|
|
@@ -63669,22 +63665,42 @@ const labelStyle = {
|
|
|
63669
63665
|
opacity: 0.8
|
|
63670
63666
|
}
|
|
63671
63667
|
};
|
|
63672
|
-
const
|
|
63673
|
-
|
|
63674
|
-
|
|
63675
|
-
|
|
63676
|
-
|
|
63677
|
-
|
|
63678
|
-
resetZoom,
|
|
63668
|
+
const ZoomControl = ({
|
|
63669
|
+
step = 10,
|
|
63670
|
+
value = 50,
|
|
63671
|
+
onChange,
|
|
63672
|
+
max: max2 = 100,
|
|
63673
|
+
min: min2 = 0,
|
|
63679
63674
|
label = "Zoom",
|
|
63675
|
+
opacity = 1,
|
|
63680
63676
|
slotProps = {}
|
|
63681
63677
|
}) => {
|
|
63682
|
-
const isMinZoom =
|
|
63683
|
-
const isMaxZoom =
|
|
63684
|
-
|
|
63685
|
-
|
|
63686
|
-
|
|
63687
|
-
|
|
63678
|
+
const isMinZoom = value === min2;
|
|
63679
|
+
const isMaxZoom = value === max2;
|
|
63680
|
+
const initialValue = useRef(value);
|
|
63681
|
+
const handleDecrease = () => onChange?.(Math.max(value - step, min2));
|
|
63682
|
+
const handleIncrease = () => onChange?.(Math.min(value + step, max2));
|
|
63683
|
+
const handleReset = () => onChange?.(initialValue.current);
|
|
63684
|
+
return /* @__PURE__ */ jsxs(Box$1, { sx: containerStyle({ opacity }), ...slotProps.root, children: [
|
|
63685
|
+
/* @__PURE__ */ jsx(
|
|
63686
|
+
IconButton$1,
|
|
63687
|
+
{
|
|
63688
|
+
onClick: handleDecrease,
|
|
63689
|
+
disabled: isMinZoom,
|
|
63690
|
+
sx: iconButtonStyle,
|
|
63691
|
+
children: /* @__PURE__ */ jsx(RemoveRounded, { sx: iconStyle({ disabled: isMinZoom }) })
|
|
63692
|
+
}
|
|
63693
|
+
),
|
|
63694
|
+
/* @__PURE__ */ jsx(Typography$1, { onClick: handleReset, sx: labelStyle, component: "button", children: label }),
|
|
63695
|
+
/* @__PURE__ */ jsx(
|
|
63696
|
+
IconButton$1,
|
|
63697
|
+
{
|
|
63698
|
+
onClick: handleIncrease,
|
|
63699
|
+
disabled: isMaxZoom,
|
|
63700
|
+
sx: iconButtonStyle,
|
|
63701
|
+
children: /* @__PURE__ */ jsx(AddRounded, { sx: iconStyle({ disabled: isMaxZoom }) })
|
|
63702
|
+
}
|
|
63703
|
+
)
|
|
63688
63704
|
] });
|
|
63689
63705
|
};
|
|
63690
63706
|
export {
|
|
@@ -63817,7 +63833,7 @@ export {
|
|
|
63817
63833
|
TreeView,
|
|
63818
63834
|
Typography,
|
|
63819
63835
|
Zoom,
|
|
63820
|
-
|
|
63836
|
+
ZoomControl,
|
|
63821
63837
|
accordionActionsClasses,
|
|
63822
63838
|
accordionClasses,
|
|
63823
63839
|
accordionDetailsClasses,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgi-learning-hub/ui",
|
|
3
|
-
"version": "1.12.0-dev.
|
|
3
|
+
"version": "1.12.0-dev.1771430232",
|
|
4
4
|
"description": "React component library for Hub's design system, built on Material UI with custom and extended components.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cgi-learning-hub",
|