@luscii-healthtech/web-ui 2.59.0 → 2.60.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/components/Button/Button.d.ts +4 -0
- package/dist/components/Page/CRUDPage.types.d.ts +5 -3
- package/dist/web-ui.cjs.development.js +50 -15
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +50 -15
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { BUTTON_ROLES, ButtonProps } from "./Button.types";
|
|
2
|
+
/**
|
|
3
|
+
* TODO: We have to probably use [ButtonV2.tsx](../../components/ButtonV2/ButtonV2.tsx)
|
|
4
|
+
* to replace this component at some point.
|
|
5
|
+
*/
|
|
2
6
|
declare function Button(props: ButtonProps): JSX.Element;
|
|
3
7
|
export default Button;
|
|
4
8
|
export { BUTTON_ROLES };
|
|
@@ -15,10 +15,12 @@ declare type CRUDPagePropsWithoutHeaderOrTitle = {
|
|
|
15
15
|
className?: string;
|
|
16
16
|
isLoading?: boolean;
|
|
17
17
|
isSubmitting?: boolean;
|
|
18
|
-
stepTitles?: StepsProps["orderedStepTitles"];
|
|
19
|
-
currentStep?: StepsProps["currentStep"];
|
|
20
|
-
localization?: StepsProps["localization"];
|
|
21
18
|
children?: React.ReactNode;
|
|
19
|
+
steps?: {
|
|
20
|
+
titles: StepsProps["orderedStepTitles"];
|
|
21
|
+
currentStep: StepsProps["currentStep"];
|
|
22
|
+
localization: StepsProps["localization"];
|
|
23
|
+
};
|
|
22
24
|
};
|
|
23
25
|
export declare type CRUDPageProps = (CRUDPagePropsWithoutHeaderOrTitle & {
|
|
24
26
|
title: CRUDPageTitle;
|
|
@@ -12,6 +12,7 @@ var lodash = require('lodash');
|
|
|
12
12
|
var core = require('@dnd-kit/core');
|
|
13
13
|
var sortable = require('@dnd-kit/sortable');
|
|
14
14
|
var utilities = require('@dnd-kit/utilities');
|
|
15
|
+
var ReactTooltip = _interopDefault(require('react-tooltip'));
|
|
15
16
|
var ReactModal = _interopDefault(require('react-modal'));
|
|
16
17
|
var PropTypes = _interopDefault(require('prop-types'));
|
|
17
18
|
var Glider = _interopDefault(require('react-glider'));
|
|
@@ -3061,7 +3062,7 @@ var Spinner = function Spinner(props) {
|
|
|
3061
3062
|
}));
|
|
3062
3063
|
};
|
|
3063
3064
|
|
|
3064
|
-
var _excluded$b = ["onClick", "text", "textColor", "textHoverColor", "icon", "isDisabled", "isPending", "className"];
|
|
3065
|
+
var _excluded$b = ["onClick", "text", "textColor", "textHoverColor", "icon", "isDisabled", "isPending", "className", "title"];
|
|
3065
3066
|
var ButtonV2 = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef) {
|
|
3066
3067
|
var onClick = _ref.onClick,
|
|
3067
3068
|
text = _ref.text,
|
|
@@ -3071,8 +3072,12 @@ var ButtonV2 = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef)
|
|
|
3071
3072
|
isDisabled = _ref.isDisabled,
|
|
3072
3073
|
isPending = _ref.isPending,
|
|
3073
3074
|
className = _ref.className,
|
|
3075
|
+
title = _ref.title,
|
|
3074
3076
|
otherAttributes = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
|
3075
3077
|
|
|
3078
|
+
var generatedId = React__default.useId();
|
|
3079
|
+
var buttonTooltipId = otherAttributes.id ? "button-tooltip-id-" + otherAttributes.id : "button-tooltip-id-" + generatedId;
|
|
3080
|
+
|
|
3076
3081
|
function handleClick(event) {
|
|
3077
3082
|
event.stopPropagation();
|
|
3078
3083
|
onClick == null ? void 0 : onClick(event);
|
|
@@ -3092,7 +3097,11 @@ var ButtonV2 = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef)
|
|
|
3092
3097
|
"pointer-events-none": isPending
|
|
3093
3098
|
}, className);
|
|
3094
3099
|
var textColorClass = allowedColors[textColor != null ? textColor : "base"];
|
|
3095
|
-
|
|
3100
|
+
var tooltipAttrs = title ? {
|
|
3101
|
+
"data-tip": true,
|
|
3102
|
+
"data-for": buttonTooltipId
|
|
3103
|
+
} : {};
|
|
3104
|
+
var buttonComponent = /*#__PURE__*/React__default.createElement("button", _extends({
|
|
3096
3105
|
ref: innerRef
|
|
3097
3106
|
}, otherAttributes, {
|
|
3098
3107
|
className: buttonClassName,
|
|
@@ -3100,7 +3109,7 @@ var ButtonV2 = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef)
|
|
|
3100
3109
|
onClick: handleClick,
|
|
3101
3110
|
disabled: isDisabled,
|
|
3102
3111
|
"aria-disabled": isDisabled
|
|
3103
|
-
}), icon && !isPending && /*#__PURE__*/React__default.createElement(IconComponentOrKey, {
|
|
3112
|
+
}, tooltipAttrs), icon && !isPending && /*#__PURE__*/React__default.createElement(IconComponentOrKey, {
|
|
3104
3113
|
name: icon,
|
|
3105
3114
|
className: "w-6 h-6 " + textColorClass
|
|
3106
3115
|
}), isPending && /*#__PURE__*/React__default.createElement("span", {
|
|
@@ -3124,6 +3133,15 @@ var ButtonV2 = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef)
|
|
|
3124
3133
|
hoverColor: textHoverColor,
|
|
3125
3134
|
hoverInGroup: true
|
|
3126
3135
|
}));
|
|
3136
|
+
|
|
3137
|
+
if (title) {
|
|
3138
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ReactTooltip, {
|
|
3139
|
+
effect: "solid",
|
|
3140
|
+
id: buttonTooltipId
|
|
3141
|
+
}, title), buttonComponent);
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
return buttonComponent;
|
|
3127
3145
|
});
|
|
3128
3146
|
|
|
3129
3147
|
var SecondaryButton = /*#__PURE__*/React__default.forwardRef(function (props, innerRef) {
|
|
@@ -3632,6 +3650,11 @@ var BUTTON_ROLES = {
|
|
|
3632
3650
|
|
|
3633
3651
|
var _excluded$e = ["text", "role", "type", "title", "link", "isPending", "isDisabled", "onClick", "className", "iconName", "hasIcon", "dynamicIcon"];
|
|
3634
3652
|
|
|
3653
|
+
/**
|
|
3654
|
+
* TODO: We have to probably use [ButtonV2.tsx](../../components/ButtonV2/ButtonV2.tsx)
|
|
3655
|
+
* to replace this component at some point.
|
|
3656
|
+
*/
|
|
3657
|
+
|
|
3635
3658
|
function Button(props) {
|
|
3636
3659
|
var _props$text = props.text,
|
|
3637
3660
|
text = _props$text === void 0 ? "" : _props$text,
|
|
@@ -3657,6 +3680,8 @@ function Button(props) {
|
|
|
3657
3680
|
dynamicIcon = props.dynamicIcon,
|
|
3658
3681
|
otherAttributes = _objectWithoutPropertiesLoose(props, _excluded$e);
|
|
3659
3682
|
|
|
3683
|
+
var generatedId = React__default.useId();
|
|
3684
|
+
var buttonTooltipId = otherAttributes.id ? "button-tooltip-id-" + otherAttributes.id : "button-tooltip-id-" + generatedId;
|
|
3660
3685
|
var hasAddIcon = className.includes("add-button");
|
|
3661
3686
|
var hasEditIcon = className.includes("edit-button");
|
|
3662
3687
|
var hasDeleteIcon = className.includes("delete-button");
|
|
@@ -3735,7 +3760,11 @@ function Button(props) {
|
|
|
3735
3760
|
hidden: !text,
|
|
3736
3761
|
"ml-3": hasIcon
|
|
3737
3762
|
});
|
|
3738
|
-
|
|
3763
|
+
var tooltipAttrs = title ? {
|
|
3764
|
+
"data-tip": true,
|
|
3765
|
+
"data-for": buttonTooltipId
|
|
3766
|
+
} : {};
|
|
3767
|
+
var buttonComponent = /*#__PURE__*/React__default.createElement("button", _extends({}, otherAttributes, {
|
|
3739
3768
|
"aria-disabled": isButtonDisabled,
|
|
3740
3769
|
disabled: isButtonDisabled,
|
|
3741
3770
|
className: containerClassName,
|
|
@@ -3743,7 +3772,7 @@ function Button(props) {
|
|
|
3743
3772
|
type: type,
|
|
3744
3773
|
title: title,
|
|
3745
3774
|
"data-role": role
|
|
3746
|
-
}), hasAddIcon && /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
3775
|
+
}, tooltipAttrs), hasAddIcon && /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
3747
3776
|
className: "w-5 h-5"
|
|
3748
3777
|
}), hasEditIcon && /*#__PURE__*/React__default.createElement(EditIcon, {
|
|
3749
3778
|
className: "w-5 h-5"
|
|
@@ -3775,6 +3804,15 @@ function Button(props) {
|
|
|
3775
3804
|
})), /*#__PURE__*/React__default.createElement("span", {
|
|
3776
3805
|
className: buttonTextClasses
|
|
3777
3806
|
}, text));
|
|
3807
|
+
|
|
3808
|
+
if (title) {
|
|
3809
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(ReactTooltip, {
|
|
3810
|
+
effect: "solid",
|
|
3811
|
+
id: buttonTooltipId
|
|
3812
|
+
}, title), buttonComponent);
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
return buttonComponent;
|
|
3778
3816
|
}
|
|
3779
3817
|
|
|
3780
3818
|
var css_248z$8 = ".entity-preview-dots.glider-dots {\n padding-top: 1rem;\n}\n\n.entity-preview-dots.glider-dots .glider-dot {\n height: 0.5rem;\n width: 0.5rem;\n margin: 0.25rem;\n --bg-opacity: 1;\n background-color: #F2FAFD;\n background-color: rgba(242, 250, 253, var(--bg-opacity));\n}\n\n.entity-preview-dots.glider-dots .glider-dot:focus {\n outline: 4px solid rgba(0, 159, 227, 0.3);\n outline-offset: 0;\n}\n\n.entity-preview-dots.glider-dots .glider-dot.active, .entity-preview-dots.glider-dots .glider-dot:focus {\n --bg-opacity: 1;\n background-color: #0074DD;\n background-color: rgba(0, 116, 221, var(--bg-opacity));\n}";
|
|
@@ -6656,20 +6694,17 @@ var PageHeader = function PageHeader(_ref) {
|
|
|
6656
6694
|
};
|
|
6657
6695
|
|
|
6658
6696
|
var CRUDPage = function CRUDPage(_ref) {
|
|
6659
|
-
var
|
|
6660
|
-
_ref$currentStep = _ref.currentStep,
|
|
6661
|
-
currentStep = _ref$currentStep === void 0 ? 1 : _ref$currentStep,
|
|
6662
|
-
submitButtonProps = _ref.submitButtonProps,
|
|
6697
|
+
var submitButtonProps = _ref.submitButtonProps,
|
|
6663
6698
|
cancelButtonProps = _ref.cancelButtonProps,
|
|
6664
6699
|
className = _ref.className,
|
|
6665
6700
|
children = _ref.children,
|
|
6666
6701
|
isLoading = _ref.isLoading,
|
|
6667
6702
|
isSubmitting = _ref.isSubmitting,
|
|
6668
|
-
localization = _ref.localization,
|
|
6669
6703
|
_ref$dataTestId = _ref.dataTestId,
|
|
6670
6704
|
dataTestId = _ref$dataTestId === void 0 ? "page" : _ref$dataTestId,
|
|
6671
6705
|
title = _ref.title,
|
|
6672
|
-
header = _ref.header
|
|
6706
|
+
header = _ref.header,
|
|
6707
|
+
steps = _ref.steps;
|
|
6673
6708
|
var mergedClasses = classNames("cweb-crud-page", "w-full mb-0 mx-auto pb-8", className);
|
|
6674
6709
|
var submitButton = submitButtonProps && /*#__PURE__*/React__default.createElement(PrimaryButton, _extends({
|
|
6675
6710
|
"data-test-id": "submit-button",
|
|
@@ -6722,11 +6757,11 @@ var CRUDPage = function CRUDPage(_ref) {
|
|
|
6722
6757
|
className: "flex flex-row justify-start align-center"
|
|
6723
6758
|
}, pageHeader), /*#__PURE__*/React__default.createElement("div", {
|
|
6724
6759
|
className: classNames("cweb-crud-page-form-container", "max-w-3xl mx-auto bg-white rounded lg p-6 mt-4")
|
|
6725
|
-
},
|
|
6726
|
-
orderedStepTitles: stepTitles,
|
|
6727
|
-
currentStep: currentStep,
|
|
6760
|
+
}, steps && /*#__PURE__*/React__default.createElement(Steps, {
|
|
6728
6761
|
className: "mb-4",
|
|
6729
|
-
|
|
6762
|
+
orderedStepTitles: steps.titles,
|
|
6763
|
+
currentStep: steps.currentStep,
|
|
6764
|
+
localization: steps.localization
|
|
6730
6765
|
}), children, /*#__PURE__*/React__default.createElement(Line, {
|
|
6731
6766
|
left: [cancelButton],
|
|
6732
6767
|
right: [submitButton],
|