@luscii-healthtech/web-ui 2.29.2 → 2.31.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/CheckboxList/CheckboxGroup.d.ts +1 -1
- package/dist/components/CheckboxList/CheckboxList.d.ts +1 -1
- package/dist/components/CheckboxList/CheckboxList.types.d.ts +2 -0
- package/dist/web-ui-tailwind.css +4 -0
- package/dist/web-ui.cjs.development.js +24 -8
- 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 +24 -8
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxGroupProps } from "./CheckboxList.types";
|
|
3
|
-
export declare const CheckboxGroup: ({ title, items, onChange, className, isCollapsed, }: CheckboxGroupProps) => JSX.Element;
|
|
3
|
+
export declare const CheckboxGroup: ({ title, items, onChange, className, hasDividers, isCollapsed, }: CheckboxGroupProps) => JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckboxListProps } from "./CheckboxList.types";
|
|
3
3
|
export { CheckboxListProps };
|
|
4
|
-
export declare const CheckboxList: ({ groups, onChange, className, }: CheckboxListProps) => JSX.Element;
|
|
4
|
+
export declare const CheckboxList: ({ groups, onChange, className, hasDividers, }: CheckboxListProps) => JSX.Element;
|
|
5
5
|
export default CheckboxList;
|
|
@@ -6,12 +6,14 @@ export declare enum CheckboxState {
|
|
|
6
6
|
export interface CheckboxListProps {
|
|
7
7
|
groups: CheckboxGroup[];
|
|
8
8
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
9
|
+
hasDividers?: boolean;
|
|
9
10
|
className?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface CheckboxGroupProps {
|
|
12
13
|
title?: string;
|
|
13
14
|
items: CheckboxListItem[];
|
|
14
15
|
onChange: (event: CheckboxChangeEvent) => void;
|
|
16
|
+
hasDividers?: boolean;
|
|
15
17
|
className?: string;
|
|
16
18
|
isCollapsed?: boolean;
|
|
17
19
|
}
|
package/dist/web-ui-tailwind.css
CHANGED
|
@@ -3563,6 +3563,7 @@ function TableBodyRowDataCell(props) {
|
|
|
3563
3563
|
})
|
|
3564
3564
|
}, content.map(function (action) {
|
|
3565
3565
|
return action && /*#__PURE__*/React__default.createElement(TertiaryButton, {
|
|
3566
|
+
"data-test-id": action.key + "-button",
|
|
3566
3567
|
className: "ml-2 first:ml-0",
|
|
3567
3568
|
key: action.key,
|
|
3568
3569
|
icon: action.icon,
|
|
@@ -4069,7 +4070,7 @@ var CheckboxListItem = function CheckboxListItem(_ref) {
|
|
|
4069
4070
|
};
|
|
4070
4071
|
|
|
4071
4072
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
4072
|
-
className: classNames("flex flex-row space-between cursor-pointer", className),
|
|
4073
|
+
className: classNames("flex flex-row space-between cursor-pointer items-center", className),
|
|
4073
4074
|
"item-id": id,
|
|
4074
4075
|
onClick: handleItemClick
|
|
4075
4076
|
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
@@ -4096,6 +4097,8 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
4096
4097
|
items = _ref.items,
|
|
4097
4098
|
onChange = _ref.onChange,
|
|
4098
4099
|
className = _ref.className,
|
|
4100
|
+
_ref$hasDividers = _ref.hasDividers,
|
|
4101
|
+
hasDividers = _ref$hasDividers === void 0 ? false : _ref$hasDividers,
|
|
4099
4102
|
_ref$isCollapsed = _ref.isCollapsed,
|
|
4100
4103
|
isCollapsed = _ref$isCollapsed === void 0 ? true : _ref$isCollapsed;
|
|
4101
4104
|
|
|
@@ -4178,10 +4181,19 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
4178
4181
|
return item == null ? void 0 : item.isChecked;
|
|
4179
4182
|
}).length;
|
|
4180
4183
|
var groupTitle = checkedItemsCount > 0 ? title + " (" + checkedItemsCount + ")" : title;
|
|
4184
|
+
var itemClassName = hasDividers ? "py-3 last:border-b-0 border-b border-slate-200" : "my-1";
|
|
4181
4185
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
4182
|
-
className: classNames("flex flex-col", className
|
|
4186
|
+
className: classNames("flex flex-col ", className, {
|
|
4187
|
+
"last:border-b-0 border-b border-slate-200": hasDividers && isCollapsed,
|
|
4188
|
+
"border-b-0": hasDividers && !isCollapsed
|
|
4189
|
+
})
|
|
4183
4190
|
}, title && /*#__PURE__*/React__default.createElement("div", {
|
|
4184
|
-
className: "flex flex-row
|
|
4191
|
+
className: classNames("flex flex-row items-center w-full space-between", {
|
|
4192
|
+
"border-b border-slate-200 py-3": hasDividers,
|
|
4193
|
+
"my-1": !hasDividers
|
|
4194
|
+
}, {
|
|
4195
|
+
"last:border-b-0": hasDividers && isCollapsed
|
|
4196
|
+
})
|
|
4185
4197
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
4186
4198
|
className: "h-6 cursor-pointer mr-auto flex flex-row items-center text-slate-300 hover:text-slate-500 transition duration-300",
|
|
4187
4199
|
onClick: handleGroupCollapse
|
|
@@ -4192,7 +4204,7 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
4192
4204
|
}), /*#__PURE__*/React__default.createElement(Text, {
|
|
4193
4205
|
type: "strong",
|
|
4194
4206
|
text: groupTitle || "",
|
|
4195
|
-
className: "
|
|
4207
|
+
className: "ml-4"
|
|
4196
4208
|
}), " "), /*#__PURE__*/React__default.createElement(Checkbox, {
|
|
4197
4209
|
onChange: handleGroupClick,
|
|
4198
4210
|
className: "ml-auto",
|
|
@@ -4207,7 +4219,7 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
4207
4219
|
onChange: onChange,
|
|
4208
4220
|
isChecked: item.isChecked,
|
|
4209
4221
|
isDisabled: item.isDisabled,
|
|
4210
|
-
className: "ml-10
|
|
4222
|
+
className: classNames("ml-10", itemClassName)
|
|
4211
4223
|
});
|
|
4212
4224
|
}));
|
|
4213
4225
|
};
|
|
@@ -4215,7 +4227,10 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
|
|
|
4215
4227
|
var CheckboxList = function CheckboxList(_ref) {
|
|
4216
4228
|
var groups = _ref.groups,
|
|
4217
4229
|
onChange = _ref.onChange,
|
|
4218
|
-
className = _ref.className
|
|
4230
|
+
className = _ref.className,
|
|
4231
|
+
_ref$hasDividers = _ref.hasDividers,
|
|
4232
|
+
hasDividers = _ref$hasDividers === void 0 ? false : _ref$hasDividers;
|
|
4233
|
+
var itemClassName = hasDividers ? "py-3 border-b border-slate-200 last:border-b-0" : "my-1";
|
|
4219
4234
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
4220
4235
|
className: classNames("flex flex-col", className)
|
|
4221
4236
|
}, (groups == null ? void 0 : groups.length) > 0 && groups.map(function (group) {
|
|
@@ -4225,7 +4240,8 @@ var CheckboxList = function CheckboxList(_ref) {
|
|
|
4225
4240
|
items: group.items,
|
|
4226
4241
|
title: group.title,
|
|
4227
4242
|
isCollapsed: group.isCollapsed,
|
|
4228
|
-
onChange: onChange
|
|
4243
|
+
onChange: onChange,
|
|
4244
|
+
hasDividers: hasDividers
|
|
4229
4245
|
});
|
|
4230
4246
|
} else {
|
|
4231
4247
|
return group.items.map(function (item) {
|
|
@@ -4236,7 +4252,7 @@ var CheckboxList = function CheckboxList(_ref) {
|
|
|
4236
4252
|
onChange: onChange,
|
|
4237
4253
|
isChecked: item.isChecked,
|
|
4238
4254
|
isDisabled: item.isDisabled,
|
|
4239
|
-
className:
|
|
4255
|
+
className: itemClassName
|
|
4240
4256
|
});
|
|
4241
4257
|
});
|
|
4242
4258
|
}
|