@luscii-healthtech/web-ui 2.30.0 → 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.
@@ -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
  }
@@ -1088,6 +1088,10 @@ video {
1088
1088
  border-width: 1px;
1089
1089
  }
1090
1090
 
1091
+ .border-b-0 {
1092
+ border-bottom-width: 0;
1093
+ }
1094
+
1091
1095
  .border-l-2 {
1092
1096
  border-left-width: 2px;
1093
1097
  }
@@ -4070,7 +4070,7 @@ var CheckboxListItem = function CheckboxListItem(_ref) {
4070
4070
  };
4071
4071
 
4072
4072
  return /*#__PURE__*/React__default.createElement("div", {
4073
- className: classNames("flex flex-row space-between cursor-pointer", className),
4073
+ className: classNames("flex flex-row space-between cursor-pointer items-center", className),
4074
4074
  "item-id": id,
4075
4075
  onClick: handleItemClick
4076
4076
  }, /*#__PURE__*/React__default.createElement(Text, {
@@ -4097,6 +4097,8 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
4097
4097
  items = _ref.items,
4098
4098
  onChange = _ref.onChange,
4099
4099
  className = _ref.className,
4100
+ _ref$hasDividers = _ref.hasDividers,
4101
+ hasDividers = _ref$hasDividers === void 0 ? false : _ref$hasDividers,
4100
4102
  _ref$isCollapsed = _ref.isCollapsed,
4101
4103
  isCollapsed = _ref$isCollapsed === void 0 ? true : _ref$isCollapsed;
4102
4104
 
@@ -4179,10 +4181,19 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
4179
4181
  return item == null ? void 0 : item.isChecked;
4180
4182
  }).length;
4181
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";
4182
4185
  return /*#__PURE__*/React__default.createElement("div", {
4183
- 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
+ })
4184
4190
  }, title && /*#__PURE__*/React__default.createElement("div", {
4185
- className: "flex flex-row my-1 items-center w-full space-between"
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
+ })
4186
4197
  }, /*#__PURE__*/React__default.createElement("div", {
4187
4198
  className: "h-6 cursor-pointer mr-auto flex flex-row items-center text-slate-300 hover:text-slate-500 transition duration-300",
4188
4199
  onClick: handleGroupCollapse
@@ -4193,7 +4204,7 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
4193
4204
  }), /*#__PURE__*/React__default.createElement(Text, {
4194
4205
  type: "strong",
4195
4206
  text: groupTitle || "",
4196
- className: " ml-4"
4207
+ className: "ml-4"
4197
4208
  }), " "), /*#__PURE__*/React__default.createElement(Checkbox, {
4198
4209
  onChange: handleGroupClick,
4199
4210
  className: "ml-auto",
@@ -4208,7 +4219,7 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
4208
4219
  onChange: onChange,
4209
4220
  isChecked: item.isChecked,
4210
4221
  isDisabled: item.isDisabled,
4211
- className: "ml-10 my-1"
4222
+ className: classNames("ml-10", itemClassName)
4212
4223
  });
4213
4224
  }));
4214
4225
  };
@@ -4216,7 +4227,10 @@ var CheckboxGroup = function CheckboxGroup(_ref) {
4216
4227
  var CheckboxList = function CheckboxList(_ref) {
4217
4228
  var groups = _ref.groups,
4218
4229
  onChange = _ref.onChange,
4219
- 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";
4220
4234
  return /*#__PURE__*/React__default.createElement("div", {
4221
4235
  className: classNames("flex flex-col", className)
4222
4236
  }, (groups == null ? void 0 : groups.length) > 0 && groups.map(function (group) {
@@ -4226,7 +4240,8 @@ var CheckboxList = function CheckboxList(_ref) {
4226
4240
  items: group.items,
4227
4241
  title: group.title,
4228
4242
  isCollapsed: group.isCollapsed,
4229
- onChange: onChange
4243
+ onChange: onChange,
4244
+ hasDividers: hasDividers
4230
4245
  });
4231
4246
  } else {
4232
4247
  return group.items.map(function (item) {
@@ -4237,7 +4252,7 @@ var CheckboxList = function CheckboxList(_ref) {
4237
4252
  onChange: onChange,
4238
4253
  isChecked: item.isChecked,
4239
4254
  isDisabled: item.isDisabled,
4240
- className: "my-1"
4255
+ className: itemClassName
4241
4256
  });
4242
4257
  });
4243
4258
  }