@luscii-healthtech/web-ui 23.2.0 → 23.2.2

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.
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { IconProps } from "./types/IconProps.type";
3
+ declare const _default: (props: IconProps) => JSX.Element;
4
+ export default _default;
@@ -27,6 +27,7 @@ export { default as EmailIcon } from "./EmailIcon";
27
27
  export { default as EmptyIcon } from "./EmptyIcon";
28
28
  export { default as ExclamationMarkIcon } from "./ExclamationMarkIcon";
29
29
  export { default as ExportIcon } from "./ExportIcon";
30
+ export { default as ExternalLinkIcon } from "./ExternalLinkIcon";
30
31
  export { default as EyeClosedIcon } from "./EyeClosedIcon";
31
32
  export { default as EyeOpenIcon } from "./EyeOpenIcon";
32
33
  export { default as FilterIcon } from "./FilterIcon";
@@ -6,7 +6,7 @@ export declare const StyledInput: React.ForwardRefExoticComponent<Omit<Omit<Reac
6
6
  type?: AllowedTextInputTypes | undefined;
7
7
  suffix?: string | undefined;
8
8
  prefix?: string | undefined;
9
- icon?: "BellIcon" | "BluetoothIcon" | "BrushIcon" | "CalendarDayIcon" | "CalendarMonthIcon" | "CalendarRepeatIcon" | "ChartBarsIcon" | "ChartLineAndBarsIcon" | "ChatBubbleIcon" | "ChatBubbleWithTextIcon" | "CheckIcon" | "ChevronDoubleIcon" | "ChevronDownIcon" | "ChevronLeftIcon" | "ChevronRightIcon" | "ClockIcon" | "CogwheelIcon" | "CopyToClipboardIcon" | "CrossIcon" | "CrossInCircleIcon" | "CrossInFilledCircleIcon" | "DatabaseIcon" | "DragIndicatorIcon" | "EarthIcon" | "EmailIcon" | "EmptyIcon" | "ExclamationMarkIcon" | "ExportIcon" | "EyeClosedIcon" | "EyeOpenIcon" | "FilterIcon" | "FireIcon" | "FirstAidKitIcon" | "FlagIcon" | "ForwardIcon" | "GroupIcon" | "GroupOfThreeIcon" | "HamburgerIcon" | "HandshakeIcon" | "HeartIcon" | "HomeIcon" | "ImageIcon" | "InfoIcon" | "LifebuoyIcon" | "LightBulbIcon" | "LinkIcon" | "LockIcon" | "LogInIcon" | "LogOutIcon" | "MessageWithArrowIcon" | "MoreIcon" | "MouseIcon" | "NoteIcon" | "PageViewIcon" | "PatientIcon" | "PencilIcon" | "PhoneIcon" | "PieChartIcon" | "PinIcon" | "PlusIcon" | "PrinterIcon" | "RobotIcon" | "RocketIcon" | "SearchIcon" | "ShareIcon" | "SmallCircleIcon" | "SmallDiamondIcon" | "SmallSquareIcon" | "StarIcon" | "TrashBinIcon" | "TreeIcon" | "AddIcon" | "AlertsIcon" | "ChartIcon" | "ChatBoxIcon" | "DeleteIcon" | "DragIcon" | "EditIcon" | "EyeIcon" | "EyeIconSlashed" | "GearIcon" | "MessagesIcon" | "NotesIcon" | "PrintIcon" | "SpaceRocketIcon" | "SettingsIcon" | "RightArrowIcon" | "DownArrowIcon" | "LeftArrowIcon" | "WarningIcon" | "ChartLineColoredIcon" | "GearColoredIcon" | "GroupColoredIcon" | "StatusColoredIcon" | React.FC<IconProps> | undefined;
9
+ icon?: "BellIcon" | "BluetoothIcon" | "BrushIcon" | "CalendarDayIcon" | "CalendarMonthIcon" | "CalendarRepeatIcon" | "ChartBarsIcon" | "ChartLineAndBarsIcon" | "ChatBubbleIcon" | "ChatBubbleWithTextIcon" | "CheckIcon" | "ChevronDoubleIcon" | "ChevronDownIcon" | "ChevronLeftIcon" | "ChevronRightIcon" | "ClockIcon" | "CogwheelIcon" | "CopyToClipboardIcon" | "CrossIcon" | "CrossInCircleIcon" | "CrossInFilledCircleIcon" | "DatabaseIcon" | "DragIndicatorIcon" | "EarthIcon" | "EmailIcon" | "EmptyIcon" | "ExclamationMarkIcon" | "ExportIcon" | "ExternalLinkIcon" | "EyeClosedIcon" | "EyeOpenIcon" | "FilterIcon" | "FireIcon" | "FirstAidKitIcon" | "FlagIcon" | "ForwardIcon" | "GroupIcon" | "GroupOfThreeIcon" | "HamburgerIcon" | "HandshakeIcon" | "HeartIcon" | "HomeIcon" | "ImageIcon" | "InfoIcon" | "LifebuoyIcon" | "LightBulbIcon" | "LinkIcon" | "LockIcon" | "LogInIcon" | "LogOutIcon" | "MessageWithArrowIcon" | "MoreIcon" | "MouseIcon" | "NoteIcon" | "PageViewIcon" | "PatientIcon" | "PencilIcon" | "PhoneIcon" | "PieChartIcon" | "PinIcon" | "PlusIcon" | "PrinterIcon" | "RobotIcon" | "RocketIcon" | "SearchIcon" | "ShareIcon" | "SmallCircleIcon" | "SmallDiamondIcon" | "SmallSquareIcon" | "StarIcon" | "TrashBinIcon" | "TreeIcon" | "AddIcon" | "AlertsIcon" | "ChartIcon" | "ChatBoxIcon" | "DeleteIcon" | "DragIcon" | "EditIcon" | "EyeIcon" | "EyeIconSlashed" | "GearIcon" | "MessagesIcon" | "NotesIcon" | "PrintIcon" | "SpaceRocketIcon" | "SettingsIcon" | "RightArrowIcon" | "DownArrowIcon" | "LeftArrowIcon" | "WarningIcon" | "ChartLineColoredIcon" | "GearColoredIcon" | "GroupColoredIcon" | "StatusColoredIcon" | React.FC<IconProps> | undefined;
10
10
  width?: FormFieldWidth | undefined;
11
11
  isError?: boolean | undefined;
12
12
  isClearIconVisible?: boolean | undefined;
@@ -24,12 +24,11 @@ var de = require('date-fns/locale/de');
24
24
  var fr = require('date-fns/locale/fr');
25
25
  var pt = require('date-fns/locale/pt');
26
26
  require('react-datepicker-v2/dist/react-datepicker.min.css');
27
- var ClipboardJS = require('clipboard');
27
+ var omit = require('lodash.omit');
28
28
  var ReactSelect = require('react-select');
29
29
  var groupBy = require('lodash/groupBy');
30
30
  var debounce = require('lodash.debounce');
31
31
  var reactLazyLoadImageComponent = require('react-lazy-load-image-component');
32
- var omit = require('lodash.omit');
33
32
  var ReactQuill = require('react-quill');
34
33
  require('react-quill/dist/quill.snow.css');
35
34
  var react = require('@headlessui/react');
@@ -66,11 +65,10 @@ var ReactDatePicker__default = /*#__PURE__*/_interopDefault(ReactDatePicker);
66
65
  var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
67
66
  var moment__default = /*#__PURE__*/_interopDefault(moment);
68
67
  var ReactDatePicker__default$1 = /*#__PURE__*/_interopDefault(ReactDatePicker$1);
69
- var ClipboardJS__default = /*#__PURE__*/_interopDefault(ClipboardJS);
68
+ var omit__default = /*#__PURE__*/_interopDefault(omit);
70
69
  var ReactSelect__default = /*#__PURE__*/_interopDefault(ReactSelect);
71
70
  var groupBy__default = /*#__PURE__*/_interopDefault(groupBy);
72
71
  var debounce__default = /*#__PURE__*/_interopDefault(debounce);
73
- var omit__default = /*#__PURE__*/_interopDefault(omit);
74
72
  var ReactQuill__default = /*#__PURE__*/_interopDefault(ReactQuill);
75
73
  var ToggleGroup__namespace = /*#__PURE__*/_interopNamespace(ToggleGroup);
76
74
 
@@ -394,6 +392,14 @@ const SvgExportIcon = (props) => React__namespace.default.createElement(
394
392
  );
395
393
  var ExportIcon = IconWrapper(SvgExportIcon);
396
394
 
395
+ const SvgExternalLinkIcon = (props) => React__namespace.default.createElement(
396
+ "svg",
397
+ Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24" }, props),
398
+ React__namespace.default.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeWidth: 2, d: "M10.563 6H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-4.563" }),
399
+ React__namespace.default.createElement("path", { stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 16 20 5m0 0h-5m5 0v5" })
400
+ );
401
+ var ExternalLinkIcon = IconWrapper(SvgExternalLinkIcon);
402
+
397
403
  const SvgEyeClosedIcon = (props) => React__namespace.default.createElement(
398
404
  "svg",
399
405
  Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, fill: "none", viewBox: "0 0 24 24" }, props),
@@ -737,6 +743,7 @@ var Icons = /*#__PURE__*/Object.freeze({
737
743
  EmptyIcon: EmptyIcon,
738
744
  ExclamationMarkIcon: ExclamationMarkIcon,
739
745
  ExportIcon: ExportIcon,
746
+ ExternalLinkIcon: ExternalLinkIcon,
740
747
  EyeClosedIcon: EyeClosedIcon,
741
748
  EyeIcon: EyeOpenIcon,
742
749
  EyeIconSlashed: EyeClosedIcon,
@@ -3193,51 +3200,87 @@ Dropdown.propTypes = {
3193
3200
  wider: PropTypes__default.default.bool
3194
3201
  };
3195
3202
 
3203
+ const spacingKeys = [
3204
+ "p",
3205
+ "pt",
3206
+ "pr",
3207
+ "pb",
3208
+ "pl",
3209
+ "px",
3210
+ "py",
3211
+ "m",
3212
+ "mt",
3213
+ "mr",
3214
+ "mb",
3215
+ "ml",
3216
+ "mx",
3217
+ "my"
3218
+ ];
3219
+ const createSpacingClassNames = (keys, spacingProps) => {
3220
+ return keys.filter((key) => spacingProps[key]).map((key) => `ui-${key}-${spacingProps[key]}`).join(" ");
3221
+ };
3222
+ const Box = (props) => {
3223
+ const { as: Element = "div", className, elevation, width } = props, attributes = __rest(props, ["as", "className", "elevation", "width"]);
3224
+ const spacingClasses = createSpacingClassNames(spacingKeys, props);
3225
+ const attributesWithoutSpacingKeys = omit__default.default(attributes, spacingKeys);
3226
+ return React__namespace.default.createElement(Element, Object.assign({ className: classNames__default.default(spacingClasses, {
3227
+ [`ui-shadow-${elevation}`]: elevation,
3228
+ "ui-w-full": width === "full"
3229
+ }, className) }, attributesWithoutSpacingKeys));
3230
+ };
3231
+
3232
+ const Stack = (props) => {
3233
+ const { children, gap, align = "start", justify = "normal", axis = "y", className, reverse } = props, attributes = __rest(props, ["children", "gap", "align", "justify", "axis", "className", "reverse"]);
3234
+ const stackClasses = classNames__default.default(`ui-flex`, {
3235
+ "ui-flex-row": axis === "x",
3236
+ "ui-flex-col": axis === "y",
3237
+ "ui-flex-row-reverse": axis === "x" && reverse,
3238
+ "ui-flex-col-reverse": axis === "y" && reverse,
3239
+ [`ui-gap-${gap}`]: gap
3240
+ }, `ui-items-${align} ui-justify-${justify}`);
3241
+ return React__namespace.default.createElement(Box, Object.assign({ className: classNames__default.default(stackClasses, className) }, attributes), children);
3242
+ };
3243
+
3196
3244
  const InfoField = (props) => {
3197
- React.useEffect(() => {
3198
- const clipboard = new ClipboardJS__default.default("button");
3199
- clipboard.on("success", function(e) {
3200
- var _a;
3201
- (_a = props.onCopyToClipboard) === null || _a === void 0 ? void 0 : _a.call(props, e.text);
3202
- e.clearSelection();
3203
- });
3204
- return () => clipboard.destroy();
3205
- }, [props.onCopyToClipboard]);
3206
- let containerProps;
3245
+ let boxProps = {};
3207
3246
  switch (props.linkType) {
3208
3247
  case "link":
3209
- containerProps = {
3210
- element: "a",
3248
+ boxProps = {
3249
+ as: "a",
3211
3250
  href: props.value,
3212
3251
  target: "_blank",
3213
3252
  rel: "noopener noreferrer"
3214
3253
  };
3215
3254
  break;
3216
3255
  case "tel":
3217
- containerProps = { element: "a", href: `tel:${props.value}` };
3256
+ boxProps = {
3257
+ as: "a",
3258
+ href: `tel:${props.value}`
3259
+ };
3218
3260
  break;
3219
3261
  case "clipboard":
3220
- containerProps = {
3221
- element: "button",
3262
+ boxProps = {
3263
+ as: "button",
3222
3264
  type: "button",
3223
- "data-clipboard-text": props.value
3265
+ "data-clipboard-text": props.value,
3266
+ onClick: () => {
3267
+ window.navigator.clipboard.writeText(props.value).then(() => {
3268
+ var _a;
3269
+ return (_a = props.onCopyToClipboard) === null || _a === void 0 ? void 0 : _a.call(props, props.value);
3270
+ });
3271
+ }
3224
3272
  };
3225
3273
  break;
3226
- case "none":
3227
- default:
3228
- containerProps = { element: "div" };
3229
- break;
3230
3274
  }
3231
- const ContainerElement = containerProps.element;
3232
3275
  return React__namespace.default.createElement(
3233
- "div",
3234
- { className: classNames__default.default("ui-align-center ui-flex ui-flex-row ui-items-center", props.className) },
3276
+ Stack,
3277
+ { axis: "x", align: "center", gap: "s", className: props.className },
3235
3278
  props.icon,
3236
3279
  React__namespace.default.createElement(
3237
- ContainerElement,
3238
- Object.assign({ className: "ui-ml-3 ui-flex ui-flex-col ui-overflow-hidden first:ui-ml-0" }, containerProps),
3239
- React__namespace.default.createElement(Text, { text: props.label, type: "sm", color: "slate-500", className: classNames__default.default({ "ui-break-words": props.supportsMultiline }, { "ui-whitespace-no-wrap": !props.supportsMultiline }) }),
3240
- React__namespace.default.createElement(Text, { className: classNames__default.default({ "ui-break-words": props.supportsMultiline }, { "ui-whitespace-no-wrap": !props.supportsMultiline }), text: props.value, truncate: !props.supportsMultiline })
3280
+ Stack,
3281
+ Object.assign({}, boxProps, { className: "ui-overflow-hidden" }),
3282
+ React__namespace.default.createElement(Text, { type: "sm", color: "slate-500", className: classNames__default.default({ "ui-break-words": props.supportsMultiline }, { "ui-whitespace-no-wrap": !props.supportsMultiline }) }, props.label),
3283
+ React__namespace.default.createElement(Text, { className: classNames__default.default({ "ui-break-words": props.supportsMultiline }, { "ui-whitespace-no-wrap": !props.supportsMultiline }), truncate: !props.supportsMultiline }, props.value)
3241
3284
  )
3242
3285
  );
3243
3286
  };
@@ -5076,47 +5119,6 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
5076
5119
  return React__namespace.default.createElement(ImagePickerInner, Object.assign({}, mappedProps, { innerRef: ref }));
5077
5120
  });
5078
5121
 
5079
- const spacingKeys = [
5080
- "p",
5081
- "pt",
5082
- "pr",
5083
- "pb",
5084
- "pl",
5085
- "px",
5086
- "py",
5087
- "m",
5088
- "mt",
5089
- "mr",
5090
- "mb",
5091
- "ml",
5092
- "mx",
5093
- "my"
5094
- ];
5095
- const createSpacingClassNames = (keys, spacingProps) => {
5096
- return keys.filter((key) => spacingProps[key]).map((key) => `ui-${key}-${spacingProps[key]}`).join(" ");
5097
- };
5098
- const Box = (props) => {
5099
- const { as: Element = "div", className, elevation, width } = props, attributes = __rest(props, ["as", "className", "elevation", "width"]);
5100
- const spacingClasses = createSpacingClassNames(spacingKeys, props);
5101
- const attributesWithoutSpacingKeys = omit__default.default(attributes, spacingKeys);
5102
- return React__namespace.default.createElement(Element, Object.assign({ className: classNames__default.default(spacingClasses, {
5103
- [`ui-shadow-${elevation}`]: elevation,
5104
- "ui-w-full": width === "full"
5105
- }, className) }, attributesWithoutSpacingKeys));
5106
- };
5107
-
5108
- const Stack = (props) => {
5109
- const { children, gap, align = "start", justify = "normal", axis = "y", className, reverse } = props, attributes = __rest(props, ["children", "gap", "align", "justify", "axis", "className", "reverse"]);
5110
- const stackClasses = classNames__default.default(`ui-flex`, {
5111
- "ui-flex-row": axis === "x",
5112
- "ui-flex-col": axis === "y",
5113
- "ui-flex-row-reverse": axis === "x" && reverse,
5114
- "ui-flex-col-reverse": axis === "y" && reverse,
5115
- [`ui-gap-${gap}`]: gap
5116
- }, `ui-items-${align} ui-justify-${justify}`);
5117
- return React__namespace.default.createElement(Box, Object.assign({ className: classNames__default.default(stackClasses, className) }, attributes), children);
5118
- };
5119
-
5120
5122
  const TagGroup = ({ children, tags, tagSize = "base", className }) => React__namespace.default.createElement(
5121
5123
  "div",
5122
5124
  { className: classNames__default.default("ui-flex ui-flex-row ui-flex-wrap ui-gap-2", className) },
@@ -5961,6 +5963,7 @@ exports.EmptyIcon = EmptyIcon;
5961
5963
  exports.EmptyListMessage = EmptyListMessage;
5962
5964
  exports.ExclamationMarkIcon = ExclamationMarkIcon;
5963
5965
  exports.ExportIcon = ExportIcon;
5966
+ exports.ExternalLinkIcon = ExternalLinkIcon;
5964
5967
  exports.EyeClosedIcon = EyeClosedIcon;
5965
5968
  exports.EyeIcon = EyeOpenIcon;
5966
5969
  exports.EyeIconSlashed = EyeClosedIcon;