@luscii-healthtech/web-ui 55.2.9 → 56.0.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/index.development.js +58 -137
- package/dist/index.development.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/src/generated/index.d.ts +0 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/stories/Select.stories.d.ts +10 -0
- package/dist/web-ui-tailwind.css +0 -10
- package/dist/web-ui.esm.js +1 -1
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/src/components/CheckBoxListModal/CheckboxListModal.d.ts +0 -35
- package/dist/src/generated/components/CheckBoxListModal/CheckboxListModal.d.ts +0 -35
- package/dist/stories/CheckBoxListModal.stories.d.ts +0 -145
|
@@ -3966,129 +3966,6 @@ const CheckboxList = ({ groups, onChange, onStateChange, className }) => {
|
|
|
3966
3966
|
}) });
|
|
3967
3967
|
};
|
|
3968
3968
|
|
|
3969
|
-
const Divider = (props) => {
|
|
3970
|
-
if ("version" in props) {
|
|
3971
|
-
switch (props.variant) {
|
|
3972
|
-
case "vertical-flow":
|
|
3973
|
-
return jsxRuntime.jsx(VerticalFlowDivider, Object.assign({}, props));
|
|
3974
|
-
case "horizontal-flow":
|
|
3975
|
-
return jsxRuntime.jsx(HorizontalFlowDivider, Object.assign({}, props));
|
|
3976
|
-
case "vertical":
|
|
3977
|
-
return jsxRuntime.jsx(VerticalDivider, Object.assign({}, props));
|
|
3978
|
-
default:
|
|
3979
|
-
return jsxRuntime.jsx(HrDivider, Object.assign({}, props));
|
|
3980
|
-
}
|
|
3981
|
-
}
|
|
3982
|
-
const { className, dark } = props, rest = __rest(props, ["className", "dark"]);
|
|
3983
|
-
const darkTheme = Boolean(dark);
|
|
3984
|
-
return jsxRuntime.jsx("div", Object.assign({ className: classNames__default.default("ui:border-color ui:block ui:w-full ui:border-b ui:border-solid ui:last:border-b-0", className, {
|
|
3985
|
-
"ui:border-color-divider": !darkTheme,
|
|
3986
|
-
"ui:border-slate-600": darkTheme
|
|
3987
|
-
}) }, rest));
|
|
3988
|
-
};
|
|
3989
|
-
const HrDivider = (props) => {
|
|
3990
|
-
const { className, color = "border" } = props;
|
|
3991
|
-
return jsxRuntime.jsx("hr", { className: classNames__default.default({
|
|
3992
|
-
"ui:border-color-divider": color === "divider",
|
|
3993
|
-
"ui:border-color-border": color === "border",
|
|
3994
|
-
"ui:border-neutral-border-high-contrast": color === "high-contrast",
|
|
3995
|
-
"ui:border-neutral-border-low-contrast": color === "low-contrast"
|
|
3996
|
-
}, className) });
|
|
3997
|
-
};
|
|
3998
|
-
const VerticalDivider = (props) => {
|
|
3999
|
-
const {
|
|
4000
|
-
className,
|
|
4001
|
-
color = "border",
|
|
4002
|
-
// Strip discriminant props so they don't land on the DOM element.
|
|
4003
|
-
version: _version,
|
|
4004
|
-
variant: _variant
|
|
4005
|
-
} = props, rest = __rest(props, ["className", "color", "version", "variant"]);
|
|
4006
|
-
return jsxRuntime.jsx("div", Object.assign({ role: "separator", "aria-orientation": "vertical", className: classNames__default.default("ui:self-stretch ui:w-0 ui:border-l ui:border-solid", {
|
|
4007
|
-
"ui:border-color-divider": color === "divider",
|
|
4008
|
-
"ui:border-color-border": color === "border",
|
|
4009
|
-
"ui:border-neutral-border-high-contrast": color === "high-contrast",
|
|
4010
|
-
"ui:border-neutral-border-low-contrast": color === "low-contrast"
|
|
4011
|
-
}, className) }, rest));
|
|
4012
|
-
};
|
|
4013
|
-
const VerticalFlowDivider = (props) => {
|
|
4014
|
-
return jsxRuntime.jsx(Stack, Object.assign({ width: "full", align: "center", role: "separator", pb: "xxxxs" }, props, { children: jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 29, fill: "none", children: [jsxRuntime.jsx("path", { fill: "#94A3B8", d: "M7.293 28.707a1 1 0 0 0 1.414 0l6.364-6.364a1 1 0 0 0-1.414-1.414L8 26.586l-5.657-5.657A1 1 0 0 0 .93 22.343l6.364 6.364ZM7 0v28h2V0H7Z" }), jsxRuntime.jsx("circle", { cx: 8, cy: 3, r: 2.5, fill: "#CBD5E1", stroke: "#64748B" })] }) }));
|
|
4015
|
-
};
|
|
4016
|
-
const HorizontalFlowDivider = (props) => {
|
|
4017
|
-
return jsxRuntime.jsx(Stack, Object.assign({ axis: "x", align: "center", role: "separator" }, props, { children: jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M16.6269 12.7491H5.25C5.03718 12.7491 4.85898 12.6773 4.7154 12.5337C4.5718 12.3901 4.5 12.2119 4.5 11.9991C4.5 11.7863 4.5718 11.6081 4.7154 11.4645C4.85898 11.3209 5.03718 11.2491 5.25 11.2491H16.6269L11.4577 6.07985C11.309 5.93114 11.2356 5.7571 11.2375 5.55775C11.2394 5.35839 11.3179 5.18114 11.4731 5.02603C11.6282 4.88116 11.8038 4.80616 12 4.80103C12.1961 4.79589 12.3718 4.87089 12.5269 5.02603L18.8672 11.3664C18.9608 11.46 19.0269 11.5587 19.0653 11.6626C19.1038 11.7664 19.123 11.8786 19.123 11.9991C19.123 12.1196 19.1038 12.2318 19.0653 12.3356C19.0269 12.4395 18.9608 12.5382 18.8672 12.6318L12.5269 18.9721C12.3884 19.1106 12.217 19.1814 12.0125 19.1846C11.808 19.1878 11.6282 19.117 11.4731 18.9721C11.3179 18.817 11.2404 18.6388 11.2404 18.4375C11.2404 18.2362 11.3179 18.058 11.4731 17.9029L16.6269 12.7491Z", fill: "#64748B" }) }) }));
|
|
4018
|
-
};
|
|
4019
|
-
|
|
4020
|
-
const transformToGroups = (items) => {
|
|
4021
|
-
const pinned = items.find((option) => option.isPinned);
|
|
4022
|
-
const itemsWithGroup = items.filter((option) => option.group);
|
|
4023
|
-
const groups = Object.entries(lodashEs.groupBy(itemsWithGroup, "group")).map((group) => ({
|
|
4024
|
-
title: group[0],
|
|
4025
|
-
items: group[1].sort((a, b) => a.label > b.label ? 1 : b.label > a.label ? -1 : 0)
|
|
4026
|
-
}));
|
|
4027
|
-
const itemsWithoutGroup = items.filter((option) => !option.group);
|
|
4028
|
-
const restGroup = {
|
|
4029
|
-
name: void 0,
|
|
4030
|
-
items: itemsWithoutGroup
|
|
4031
|
-
};
|
|
4032
|
-
if (pinned) {
|
|
4033
|
-
const myGroup = {
|
|
4034
|
-
items: [pinned]
|
|
4035
|
-
};
|
|
4036
|
-
return [myGroup, ...groups, restGroup];
|
|
4037
|
-
}
|
|
4038
|
-
return [...groups, restGroup];
|
|
4039
|
-
};
|
|
4040
|
-
const CheckboxListModal = ({
|
|
4041
|
-
texts,
|
|
4042
|
-
accessory,
|
|
4043
|
-
initialItems,
|
|
4044
|
-
isLoadingInitialItems,
|
|
4045
|
-
isOpen,
|
|
4046
|
-
onSave,
|
|
4047
|
-
onCloseClick,
|
|
4048
|
-
/**
|
|
4049
|
-
* Predicate used in this component to set the visible items
|
|
4050
|
-
* in the list based on the search query.
|
|
4051
|
-
*/
|
|
4052
|
-
filterItem = () => true,
|
|
4053
|
-
hasSearch = false
|
|
4054
|
-
}) => {
|
|
4055
|
-
const [items, setItems] = React.useState([]);
|
|
4056
|
-
const [visibleItems, setVisibleItems] = React.useState([]);
|
|
4057
|
-
const [groups, setGroups] = React.useState([]);
|
|
4058
|
-
const [search, setSearch] = React.useState("");
|
|
4059
|
-
React.useEffect(() => {
|
|
4060
|
-
setItems(initialItems);
|
|
4061
|
-
}, [initialItems]);
|
|
4062
|
-
React.useEffect(() => {
|
|
4063
|
-
setVisibleItems(items.filter((item) => filterItem(item, search)));
|
|
4064
|
-
}, [items, search]);
|
|
4065
|
-
React.useEffect(() => {
|
|
4066
|
-
setGroups(transformToGroups(visibleItems));
|
|
4067
|
-
}, [visibleItems]);
|
|
4068
|
-
const handleOnItemChange = (event) => {
|
|
4069
|
-
const updatedItems = [...items];
|
|
4070
|
-
const index = updatedItems.findIndex((item) => item.id === event.id);
|
|
4071
|
-
updatedItems[index].isChecked = event.newCheckedValue;
|
|
4072
|
-
setItems(updatedItems);
|
|
4073
|
-
};
|
|
4074
|
-
const handleOnCloseClick = (event) => {
|
|
4075
|
-
event.stopPropagation();
|
|
4076
|
-
onCloseClick();
|
|
4077
|
-
};
|
|
4078
|
-
const handleOnSaveClick = () => {
|
|
4079
|
-
onSave(items.filter((item) => item.isChecked));
|
|
4080
|
-
onCloseClick();
|
|
4081
|
-
};
|
|
4082
|
-
const handleOnSearchChange = (event) => {
|
|
4083
|
-
var _a;
|
|
4084
|
-
setSearch((_a = event.currentTarget.value) !== null && _a !== void 0 ? _a : "");
|
|
4085
|
-
};
|
|
4086
|
-
return jsxRuntime.jsxs(Modal, { isOpen, title: texts.title, onCloseClick: handleOnCloseClick, footerTrailingComponents: {
|
|
4087
|
-
primaryButton: jsxRuntime.jsx(PrimaryButton, { dataTestId: "modal-footer-trailing-primary-button", onClick: handleOnSaveClick, children: texts.confirmLabel }),
|
|
4088
|
-
secondaryButton: jsxRuntime.jsx(SecondaryButton, { dataTestId: "modal-footer-trailing-secondary-button", onClick: handleOnCloseClick, children: texts.cancelLabel })
|
|
4089
|
-
}, scrollableContent: true, children: [accessory && jsxRuntime.jsxs("div", { className: "ui:mb-6 ui:flex ui:flex-col ui:space-y-6", children: [accessory, jsxRuntime.jsx(Divider, { version: "v2", color: "divider" })] }), isLoadingInitialItems && jsxRuntime.jsx(LoadingIndicator, {}), hasSearch && !isLoadingInitialItems && jsxRuntime.jsx("div", { className: "ui:mb-2", children: jsxRuntime.jsxs("label", { htmlFor: "checkbox-list-search", className: "ui:flex ui:flex-col ui:space-y-2", children: [texts.searchInputLabel && jsxRuntime.jsx(Text, { variant: "strong", children: texts.searchInputLabel }), jsxRuntime.jsx(SearchInput, { id: "checkbox-list-search", width: "full", value: search, placeholder: texts.searchPlaceHolder, onChange: handleOnSearchChange })] }) }), !isLoadingInitialItems && (items === null || items === void 0 ? void 0 : items.length) > 0 && jsxRuntime.jsx(CheckboxList, { groups, onChange: handleOnItemChange }), !isLoadingInitialItems && (items === null || items === void 0 ? void 0 : items.length) === 0 && jsxRuntime.jsx(Text, { text: texts.emptyState })] });
|
|
4090
|
-
};
|
|
4091
|
-
|
|
4092
3969
|
const NavLayout = (props) => {
|
|
4093
3970
|
const { patientSidebar = null, isNavDisabled, menu, disableScrolling, pageHeader, children, isInViewer, secondaryNavigation = null, rowBreakpoint = "lg" } = props, rest = __rest(props, ["patientSidebar", "isNavDisabled", "menu", "disableScrolling", "pageHeader", "children", "isInViewer", "secondaryNavigation", "rowBreakpoint"]);
|
|
4094
3971
|
const rowBreakpointClasses = {
|
|
@@ -4306,6 +4183,57 @@ const PageTitle = (props) => {
|
|
|
4306
4183
|
) }));
|
|
4307
4184
|
};
|
|
4308
4185
|
|
|
4186
|
+
const Divider = (props) => {
|
|
4187
|
+
if ("version" in props) {
|
|
4188
|
+
switch (props.variant) {
|
|
4189
|
+
case "vertical-flow":
|
|
4190
|
+
return jsxRuntime.jsx(VerticalFlowDivider, Object.assign({}, props));
|
|
4191
|
+
case "horizontal-flow":
|
|
4192
|
+
return jsxRuntime.jsx(HorizontalFlowDivider, Object.assign({}, props));
|
|
4193
|
+
case "vertical":
|
|
4194
|
+
return jsxRuntime.jsx(VerticalDivider, Object.assign({}, props));
|
|
4195
|
+
default:
|
|
4196
|
+
return jsxRuntime.jsx(HrDivider, Object.assign({}, props));
|
|
4197
|
+
}
|
|
4198
|
+
}
|
|
4199
|
+
const { className, dark } = props, rest = __rest(props, ["className", "dark"]);
|
|
4200
|
+
const darkTheme = Boolean(dark);
|
|
4201
|
+
return jsxRuntime.jsx("div", Object.assign({ className: classNames__default.default("ui:border-color ui:block ui:w-full ui:border-b ui:border-solid ui:last:border-b-0", className, {
|
|
4202
|
+
"ui:border-color-divider": !darkTheme,
|
|
4203
|
+
"ui:border-slate-600": darkTheme
|
|
4204
|
+
}) }, rest));
|
|
4205
|
+
};
|
|
4206
|
+
const HrDivider = (props) => {
|
|
4207
|
+
const { className, color = "border" } = props;
|
|
4208
|
+
return jsxRuntime.jsx("hr", { className: classNames__default.default({
|
|
4209
|
+
"ui:border-color-divider": color === "divider",
|
|
4210
|
+
"ui:border-color-border": color === "border",
|
|
4211
|
+
"ui:border-neutral-border-high-contrast": color === "high-contrast",
|
|
4212
|
+
"ui:border-neutral-border-low-contrast": color === "low-contrast"
|
|
4213
|
+
}, className) });
|
|
4214
|
+
};
|
|
4215
|
+
const VerticalDivider = (props) => {
|
|
4216
|
+
const {
|
|
4217
|
+
className,
|
|
4218
|
+
color = "border",
|
|
4219
|
+
// Strip discriminant props so they don't land on the DOM element.
|
|
4220
|
+
version: _version,
|
|
4221
|
+
variant: _variant
|
|
4222
|
+
} = props, rest = __rest(props, ["className", "color", "version", "variant"]);
|
|
4223
|
+
return jsxRuntime.jsx("div", Object.assign({ role: "separator", "aria-orientation": "vertical", className: classNames__default.default("ui:self-stretch ui:w-0 ui:border-l ui:border-solid", {
|
|
4224
|
+
"ui:border-color-divider": color === "divider",
|
|
4225
|
+
"ui:border-color-border": color === "border",
|
|
4226
|
+
"ui:border-neutral-border-high-contrast": color === "high-contrast",
|
|
4227
|
+
"ui:border-neutral-border-low-contrast": color === "low-contrast"
|
|
4228
|
+
}, className) }, rest));
|
|
4229
|
+
};
|
|
4230
|
+
const VerticalFlowDivider = (props) => {
|
|
4231
|
+
return jsxRuntime.jsx(Stack, Object.assign({ width: "full", align: "center", role: "separator", pb: "xxxxs" }, props, { children: jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 29, fill: "none", children: [jsxRuntime.jsx("path", { fill: "#94A3B8", d: "M7.293 28.707a1 1 0 0 0 1.414 0l6.364-6.364a1 1 0 0 0-1.414-1.414L8 26.586l-5.657-5.657A1 1 0 0 0 .93 22.343l6.364 6.364ZM7 0v28h2V0H7Z" }), jsxRuntime.jsx("circle", { cx: 8, cy: 3, r: 2.5, fill: "#CBD5E1", stroke: "#64748B" })] }) }));
|
|
4232
|
+
};
|
|
4233
|
+
const HorizontalFlowDivider = (props) => {
|
|
4234
|
+
return jsxRuntime.jsx(Stack, Object.assign({ axis: "x", align: "center", role: "separator" }, props, { children: jsxRuntime.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M16.6269 12.7491H5.25C5.03718 12.7491 4.85898 12.6773 4.7154 12.5337C4.5718 12.3901 4.5 12.2119 4.5 11.9991C4.5 11.7863 4.5718 11.6081 4.7154 11.4645C4.85898 11.3209 5.03718 11.2491 5.25 11.2491H16.6269L11.4577 6.07985C11.309 5.93114 11.2356 5.7571 11.2375 5.55775C11.2394 5.35839 11.3179 5.18114 11.4731 5.02603C11.6282 4.88116 11.8038 4.80616 12 4.80103C12.1961 4.79589 12.3718 4.87089 12.5269 5.02603L18.8672 11.3664C18.9608 11.46 19.0269 11.5587 19.0653 11.6626C19.1038 11.7664 19.123 11.8786 19.123 11.9991C19.123 12.1196 19.1038 12.2318 19.0653 12.3356C19.0269 12.4395 18.9608 12.5382 18.8672 12.6318L12.5269 18.9721C12.3884 19.1106 12.217 19.1814 12.0125 19.1846C11.808 19.1878 11.6282 19.117 11.4731 18.9721C11.3179 18.817 11.2404 18.6388 11.2404 18.4375C11.2404 18.2362 11.3179 18.058 11.4731 17.9029L16.6269 12.7491Z", fill: "#64748B" }) }) }));
|
|
4235
|
+
};
|
|
4236
|
+
|
|
4309
4237
|
const PageHeader = ({ navigation, breadcrumbs, dataTestId, accessories, isPolling, title, contained, className, truncateBreadcrumbsAfter, renderBreadcrumbItem, banner }) => {
|
|
4310
4238
|
var _a, _b;
|
|
4311
4239
|
const withContained = { "ui:max-w-3xl ui:m-auto": contained };
|
|
@@ -4635,6 +4563,13 @@ function generateCustomStyles(hasError) {
|
|
|
4635
4563
|
menu: (baseStyles) => Object.assign(Object.assign({}, baseStyles), { zIndex: 20 })
|
|
4636
4564
|
};
|
|
4637
4565
|
}
|
|
4566
|
+
function getDataAttributes(selectProps) {
|
|
4567
|
+
return Object.fromEntries(Object.entries(selectProps).filter(([prop]) => prop.includes("data-")));
|
|
4568
|
+
}
|
|
4569
|
+
const CustomContainer = (_a) => {
|
|
4570
|
+
var { children } = _a, containerProps = __rest(_a, ["children"]);
|
|
4571
|
+
return jsxRuntime.jsx(ReactSelect.components.SelectContainer, Object.assign({}, containerProps, { innerProps: Object.assign(Object.assign({}, containerProps.innerProps), getDataAttributes(containerProps.selectProps)), children }));
|
|
4572
|
+
};
|
|
4638
4573
|
const Select = React__namespace.default.forwardRef((_a, innerRef) => {
|
|
4639
4574
|
var _b, _c;
|
|
4640
4575
|
var { isError = false, styles, options, onChange, value, width = "full", isMulti, className, skipValueProcessing, isCreatable = false, onCreateOption, formatCreateLabel } = _a, otherProps = __rest(_a, ["isError", "styles", "options", "onChange", "value", "width", "isMulti", "className", "skipValueProcessing", "isCreatable", "onCreateOption", "formatCreateLabel"]);
|
|
@@ -4664,19 +4599,6 @@ const Select = React__namespace.default.forwardRef((_a, innerRef) => {
|
|
|
4664
4599
|
const flatmappedOptions = !options ? [] : isOptionsGrouped ? options.flatMap((g) => g.options) : options;
|
|
4665
4600
|
const onChangeWrapped = !onChange ? void 0 : isMulti ? (val, a) => onChange(val.map((v) => v.value), a) : (val, a) => onChange(val === null || val === void 0 ? void 0 : val.value, a);
|
|
4666
4601
|
const valueWrapped = !value || !options ? value : isMulti ? flatmappedOptions.filter((o) => value.includes(o.value)) : flatmappedOptions.find((o) => o.value === value);
|
|
4667
|
-
const getDataAttributes = () => {
|
|
4668
|
-
const dataProps = {};
|
|
4669
|
-
for (const prop in otherProps) {
|
|
4670
|
-
if (prop.includes("data-")) {
|
|
4671
|
-
dataProps[prop] = otherProps[prop];
|
|
4672
|
-
}
|
|
4673
|
-
}
|
|
4674
|
-
return dataProps;
|
|
4675
|
-
};
|
|
4676
|
-
const CustomContainer = (_a2) => {
|
|
4677
|
-
var { children } = _a2, commonProps2 = __rest(_a2, ["children"]);
|
|
4678
|
-
return jsxRuntime.jsx(ReactSelect.components.SelectContainer, Object.assign({}, commonProps2, { innerProps: Object.assign({}, commonProps2.innerProps, Object.assign({}, getDataAttributes())), children }));
|
|
4679
|
-
};
|
|
4680
4602
|
const commonProps = Object.assign(Object.assign({}, otherProps), {
|
|
4681
4603
|
ref: mergedRef,
|
|
4682
4604
|
styles: mergedStyles,
|
|
@@ -7212,7 +7134,6 @@ exports.CheckFilledColoredIcon = CheckFilledColoredIcon;
|
|
|
7212
7134
|
exports.CheckIcon = CheckIcon;
|
|
7213
7135
|
exports.Checkbox = Checkbox;
|
|
7214
7136
|
exports.CheckboxList = CheckboxList;
|
|
7215
|
-
exports.CheckboxListModal = CheckboxListModal;
|
|
7216
7137
|
exports.ChevronDoubleIcon = ChevronDoubleIcon;
|
|
7217
7138
|
exports.ChevronDownIcon = ChevronDownIcon;
|
|
7218
7139
|
exports.ChevronLeftIcon = LeftArrowIcon;
|