@luscii-healthtech/web-ui 23.2.1 → 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.
@@ -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
 
@@ -3202,51 +3200,87 @@ Dropdown.propTypes = {
3202
3200
  wider: PropTypes__default.default.bool
3203
3201
  };
3204
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
+
3205
3244
  const InfoField = (props) => {
3206
- React.useEffect(() => {
3207
- const clipboard = new ClipboardJS__default.default("button");
3208
- clipboard.on("success", function(e) {
3209
- var _a;
3210
- (_a = props.onCopyToClipboard) === null || _a === void 0 ? void 0 : _a.call(props, e.text);
3211
- e.clearSelection();
3212
- });
3213
- return () => clipboard.destroy();
3214
- }, [props.onCopyToClipboard]);
3215
- let containerProps;
3245
+ let boxProps = {};
3216
3246
  switch (props.linkType) {
3217
3247
  case "link":
3218
- containerProps = {
3219
- element: "a",
3248
+ boxProps = {
3249
+ as: "a",
3220
3250
  href: props.value,
3221
3251
  target: "_blank",
3222
3252
  rel: "noopener noreferrer"
3223
3253
  };
3224
3254
  break;
3225
3255
  case "tel":
3226
- containerProps = { element: "a", href: `tel:${props.value}` };
3256
+ boxProps = {
3257
+ as: "a",
3258
+ href: `tel:${props.value}`
3259
+ };
3227
3260
  break;
3228
3261
  case "clipboard":
3229
- containerProps = {
3230
- element: "button",
3262
+ boxProps = {
3263
+ as: "button",
3231
3264
  type: "button",
3232
- "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
+ }
3233
3272
  };
3234
3273
  break;
3235
- case "none":
3236
- default:
3237
- containerProps = { element: "div" };
3238
- break;
3239
3274
  }
3240
- const ContainerElement = containerProps.element;
3241
3275
  return React__namespace.default.createElement(
3242
- "div",
3243
- { 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 },
3244
3278
  props.icon,
3245
3279
  React__namespace.default.createElement(
3246
- ContainerElement,
3247
- Object.assign({ className: "ui-ml-3 ui-flex ui-flex-col ui-overflow-hidden first:ui-ml-0" }, containerProps),
3248
- 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 }) }),
3249
- 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)
3250
3284
  )
3251
3285
  );
3252
3286
  };
@@ -5085,47 +5119,6 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
5085
5119
  return React__namespace.default.createElement(ImagePickerInner, Object.assign({}, mappedProps, { innerRef: ref }));
5086
5120
  });
5087
5121
 
5088
- const spacingKeys = [
5089
- "p",
5090
- "pt",
5091
- "pr",
5092
- "pb",
5093
- "pl",
5094
- "px",
5095
- "py",
5096
- "m",
5097
- "mt",
5098
- "mr",
5099
- "mb",
5100
- "ml",
5101
- "mx",
5102
- "my"
5103
- ];
5104
- const createSpacingClassNames = (keys, spacingProps) => {
5105
- return keys.filter((key) => spacingProps[key]).map((key) => `ui-${key}-${spacingProps[key]}`).join(" ");
5106
- };
5107
- const Box = (props) => {
5108
- const { as: Element = "div", className, elevation, width } = props, attributes = __rest(props, ["as", "className", "elevation", "width"]);
5109
- const spacingClasses = createSpacingClassNames(spacingKeys, props);
5110
- const attributesWithoutSpacingKeys = omit__default.default(attributes, spacingKeys);
5111
- return React__namespace.default.createElement(Element, Object.assign({ className: classNames__default.default(spacingClasses, {
5112
- [`ui-shadow-${elevation}`]: elevation,
5113
- "ui-w-full": width === "full"
5114
- }, className) }, attributesWithoutSpacingKeys));
5115
- };
5116
-
5117
- const Stack = (props) => {
5118
- const { children, gap, align = "start", justify = "normal", axis = "y", className, reverse } = props, attributes = __rest(props, ["children", "gap", "align", "justify", "axis", "className", "reverse"]);
5119
- const stackClasses = classNames__default.default(`ui-flex`, {
5120
- "ui-flex-row": axis === "x",
5121
- "ui-flex-col": axis === "y",
5122
- "ui-flex-row-reverse": axis === "x" && reverse,
5123
- "ui-flex-col-reverse": axis === "y" && reverse,
5124
- [`ui-gap-${gap}`]: gap
5125
- }, `ui-items-${align} ui-justify-${justify}`);
5126
- return React__namespace.default.createElement(Box, Object.assign({ className: classNames__default.default(stackClasses, className) }, attributes), children);
5127
- };
5128
-
5129
5122
  const TagGroup = ({ children, tags, tagSize = "base", className }) => React__namespace.default.createElement(
5130
5123
  "div",
5131
5124
  { className: classNames__default.default("ui-flex ui-flex-row ui-flex-wrap ui-gap-2", className) },