@luscii-healthtech/web-ui 58.3.0 → 58.5.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.
@@ -5050,7 +5050,7 @@ const MediaPicker = React__namespace.default.forwardRef((props, ref) => {
5050
5050
 
5051
5051
  const TagGroup = ({ children, tags, tagSize = "large", className }) => jsxRuntime.jsxs("div", { className: classNames__default.default("ui:flex ui:flex-row ui:flex-wrap ui:gap-2", className), children: [children, tags === null || tags === void 0 ? void 0 : tags.map((tag) => jsxRuntime.jsx(Tag, Object.assign({ _size: tagSize }, tag)))] });
5052
5052
 
5053
- const typeIcons = {
5053
+ const typeIcons$1 = {
5054
5054
  info: BookOpenIcon,
5055
5055
  questionnaire: ClipboardListIcon,
5056
5056
  numeric: HashIcon,
@@ -5063,7 +5063,7 @@ const typeIcons = {
5063
5063
  const InstrumentCard = ({ type, title, category, meta, id, count, variant = "compact", state = "default", errorMessage, className }) => {
5064
5064
  const isDetailed = variant === "detailed";
5065
5065
  const isError = state === "error";
5066
- const TypeIcon = isError ? ExclamationMarkIcon : typeIcons[type];
5066
+ const TypeIcon = isError ? ExclamationMarkIcon : typeIcons$1[type];
5067
5067
  const textColor = isError ? "error" : "neutral";
5068
5068
  if (!isDetailed) {
5069
5069
  return jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", _py: "base", _pl: "base", _pr: "m", className: classNames__default.default("ui:inline-flex ui:bg-background-neutral-primary-default ui:[border-radius:var(--ui-semantic-radius-m)]", className), children: [jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 14, height: 14, className: classNames__default.default("ui:shrink-0", {
@@ -5077,6 +5077,76 @@ const InstrumentCard = ({ type, title, category, meta, id, count, variant = "com
5077
5077
  }) }) }), jsxRuntime.jsxs(Stack, { _gap: "base", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsx(Text, { variant: "body-medium-regular", color: textColor, truncate: true, className: "ui:min-w-0", children: title }), isError && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "error", children: errorMessage }), !isError && (category || meta) && jsxRuntime.jsxs(Stack, { axis: "x", align: "center", children: [category && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: category }), category && meta && jsxRuntime.jsx(Box, { _mx: "base", className: "ui:h-[12px] ui:w-px ui:shrink-0 ui:bg-border-neutral-primary-default" }), meta && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral", children: meta })] }), id && jsxRuntime.jsx(Tag, { _size: "small", _variant: "bordered", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), children: id })] })] }), count !== void 0 && jsxRuntime.jsx(Tag, { _size: "small", _variant: "flat", _leadingIcon: jsxRuntime.jsx(CopyToClipboardIcon, { "aria-hidden": true }), className: "ui:shrink-0", children: jsxRuntime.jsx(Text, { variant: "body-small-bold", as: "span", children: count }) })] });
5078
5078
  };
5079
5079
 
5080
+ const variantClasses = {
5081
+ h1: "ui-typo-h1 ui:text-text-brand-primary-default",
5082
+ h2: "ui-typo-h2 ui:text-text-neutral-primary-default",
5083
+ h3: "ui-typo-h3 ui:text-text-neutral-primary-default",
5084
+ h4: "ui-typo-h4 ui:text-text-neutral-primary-default"
5085
+ };
5086
+ const Heading = (_a) => {
5087
+ var { as: Element = "h2", variant = "h2", className, children } = _a, rest = __rest(_a, ["as", "variant", "className", "children"]);
5088
+ return jsxRuntime.jsx(Element, Object.assign({ className: classNames__default.default(variantClasses[variant], className) }, rest, { children }));
5089
+ };
5090
+
5091
+ const typeIcons = {
5092
+ information: ActionInformationColoredIcon,
5093
+ contact: ActionContactColoredIcon,
5094
+ lesson: ActionLessonColoredIcon,
5095
+ calculation: ActionCalculationColoredIcon,
5096
+ measurement: ActionBloodPressureColoredIcon
5097
+ };
5098
+ const ActionCard = ({ type, title, metadata, instruments, actions, draggable = false, titleAs = "h3", variant = "default", onClick, className }) => {
5099
+ const TypeIcon = typeIcons[type];
5100
+ const isCompact = variant === "compact";
5101
+ const isList = variant === "list";
5102
+ return jsxRuntime.jsx(Card, { borderRadius: "m", elevation: isList ? "surface" : "small", elevationOnHover: isList ? void 0 : "medium", padding: false, className: classNames__default.default("ui:w-full", className), children: jsxRuntime.jsxs(Stack, { axis: "x", align: "start", justify: "between", _gap: "base", _p: "l", children: [draggable && jsxRuntime.jsx(Box, { className: "ui:relative ui:z-[1] ui:shrink-0 ui:self-center", children: jsxRuntime.jsx(DragHandle, { grabbing: false }) }), jsxRuntime.jsxs(Stack, { _gap: isCompact ? "s" : "m", className: "ui:min-w-0 ui:flex-1", children: [jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", children: [jsxRuntime.jsx(TypeIcon, { "aria-hidden": true, width: 20, height: 20, className: "ui:shrink-0" }), jsxRuntime.jsx(Heading, { as: titleAs, variant: "h4", className: "ui:min-w-0", children: onClick ? (
5103
+ /**
5104
+ * The whole card is the click target, but it cannot be a
5105
+ * `<button>` because the `actions` slot and the drag handle
5106
+ * are interactive themselves and nesting them inside a button
5107
+ * is invalid HTML. Instead a real button wraps the title and
5108
+ * stretches an `::after` overlay across the card, which keeps
5109
+ * the component keyboard accessible and gives it an
5110
+ * announceable name. Interactive slots opt out by sitting
5111
+ * above the overlay.
5112
+ */
5113
+ jsxRuntime.jsx("button", { type: "button", onClick, className: "ui:cursor-pointer ui:text-left ui:after:absolute ui:after:inset-0 ui:after:content-[''] ui:focus:outline-primary", children: title })
5114
+ ) : title })] }), metadata && metadata.length > 0 && jsxRuntime.jsx(Stack, { axis: "x", _gap: "base", wrap: !isCompact, children: metadata.map(({ label, bordered }, index) => jsxRuntime.jsx(
5115
+ Tag,
5116
+ { _size: "small", _type: "neutral", _variant: bordered ? "bordered" : "flat", _truncate: isCompact, children: label },
5117
+ `${index}-${label}`
5118
+ )) }), !isCompact && instruments && instruments.length > 0 && jsxRuntime.jsx(Stack, { axis: "x", _gap: "base", wrap: true, children: instruments.map((instrument) => {
5119
+ var _a;
5120
+ return React.createElement(InstrumentCard, Object.assign({}, instrument, { variant: "compact", key: (_a = instrument.id) !== null && _a !== void 0 ? _a : `${instrument.type}-${instrument.title}` }));
5121
+ }) })] }), actions && jsxRuntime.jsx(Box, { className: "ui:relative ui:z-[1] ui:shrink-0 ui:self-center", children: actions })] }) });
5122
+ };
5123
+
5124
+ const actionIcons = {
5125
+ information: ActionInformationColoredIcon,
5126
+ contact: ActionContactColoredIcon,
5127
+ lesson: ActionLessonColoredIcon,
5128
+ calculation: ActionCalculationColoredIcon,
5129
+ measurement: ActionBloodPressureColoredIcon
5130
+ };
5131
+ const ScheduleItem = ({ icon, label, value, detail }) => jsxRuntime.jsxs(Stack, { axis: "x", align: "start", _gap: "base", children: [jsxRuntime.jsx(Box, { "aria-hidden": true, _p: "s", className: "ui:size-[var(--ui-semantic-size-xl)] ui:shrink-0 ui:[border-radius:var(--ui-semantic-radius-s)]", children: icon }), jsxRuntime.jsxs(Stack, { _gap: "none", className: "ui:min-w-0", children: [jsxRuntime.jsxs(Stack, { axis: "x", align: "baseline", _gap: "s", wrap: true, children: [jsxRuntime.jsx(Text, { variant: "body-base-light", color: "neutral-secondary", children: label }), jsxRuntime.jsx(Text, { variant: "body-base-regular", color: "neutral-secondary", children: value })] }), detail && jsxRuntime.jsx(Text, { variant: "body-small-regular", color: "neutral-secondary", children: detail })] })] });
5132
+ const ActionCardDetailed = ({ type, title, category, metadata, schedule, scheduleHeading = "Schedule settings", instruments, instrumentsHeading = "Instruments in this action", onEdit, onDelete, onClose, className }) => {
5133
+ const ActionIcon = actionIcons[type];
5134
+ const hasActions = onEdit || onDelete || onClose;
5135
+ return jsxRuntime.jsx(Card, { border: true, borderRadius: "m", elevation: "medium", className: classNames__default.default("ui:w-full ui:max-w-[600px]", className), children: jsxRuntime.jsxs(Stack, { _gap: "xl", width: "full", children: [jsxRuntime.jsxs(Stack, { axis: "x", align: "start", justify: "between", _gap: "base", width: "full", children: [jsxRuntime.jsxs(Stack, { axis: "x", align: "start", _gap: "base", className: "ui:min-w-0", children: [jsxRuntime.jsx(ActionIcon, { "aria-hidden": true, width: 24, height: 24, className: "ui:shrink-0" }), jsxRuntime.jsxs(Stack, { _gap: "none", className: "ui:min-w-0", children: [jsxRuntime.jsx(Heading, { variant: "h3", children: title }), category && jsxRuntime.jsx(Text, { variant: "body-base-regular", color: "neutral-secondary", children: category })] })] }), hasActions && jsxRuntime.jsxs(Stack, { axis: "x", align: "center", _gap: "base", className: "ui:shrink-0", children: [onEdit && jsxRuntime.jsx(TertiaryIconButton, { label: "Edit action", onClick: onEdit, children: jsxRuntime.jsx(PencilIcon, { "aria-hidden": true }) }), onDelete && jsxRuntime.jsx(TertiaryIconButton, { label: "Delete action", onClick: onDelete, children: jsxRuntime.jsx(TrashBinIcon, { "aria-hidden": true }) }), onClose && jsxRuntime.jsx(TertiaryIconButton, { label: "Close action details", onClick: onClose, children: jsxRuntime.jsx(CrossIcon, { "aria-hidden": true }) })] })] }), metadata && metadata.length > 0 && jsxRuntime.jsx(Stack, { axis: "x", _gap: "base", wrap: true, children: metadata.map((item, index) => jsxRuntime.jsx(
5136
+ Tag,
5137
+ { _size: "large", _type: "neutral", _variant: "flat", children: item },
5138
+ `${index}-${item}`
5139
+ )) }), schedule && schedule.length > 0 && jsxRuntime.jsxs(Stack, { _gap: "base", width: "full", children: [jsxRuntime.jsx(Heading, { variant: "h4", children: scheduleHeading }), jsxRuntime.jsx(Stack, { _gap: "l", width: "full", children: schedule.map((row, index) => jsxRuntime.jsx(
5140
+ ScheduleItem,
5141
+ Object.assign({}, row),
5142
+ index
5143
+ )) })] }), instruments && instruments.length > 0 && jsxRuntime.jsxs(Stack, { _gap: "base", width: "full", children: [jsxRuntime.jsx(Heading, { variant: "h4", children: instrumentsHeading }), jsxRuntime.jsx(Stack, { _gap: "base", width: "full", children: instruments.map((instrument, index) => jsxRuntime.jsx(
5144
+ InstrumentCard,
5145
+ Object.assign({}, instrument, { variant: "detailed" }),
5146
+ index
5147
+ )) })] })] }) });
5148
+ };
5149
+
5080
5150
  var css_248z$1 = "/*! tailwindcss v4.1.12 | MIT License | https://tailwindcss.com */\n.cweb-textarea {\n resize: none;\n background-color: field;\n}\n.cweb-textarea.has-icon {\n background-size: 24px;\n background-position: 10px 10px;\n background-repeat: no-repeat;\n padding-left: 44px;\n}\n.cweb-textarea.resizable {\n resize: both;\n}\n.cweb-textarea.resizable-x {\n resize: horizontal;\n}\n.cweb-textarea.resizable-y {\n resize: vertical;\n}\n.cweb-textarea:focus {\n border-color: var(--color-primary);\n}\n.cweb-textarea:disabled {\n cursor: not-allowed;\n}\n.cweb-textarea.has-error {\n border: 1px solid #b91c1c;\n color: #991b1b;\n}";
5081
5151
  styleInject(css_248z$1);
5082
5152
 
@@ -5641,17 +5711,6 @@ const TextLink = (props) => {
5641
5711
  return jsxRuntime.jsx("a", { href: props.href, rel: props.rel, target: props.target, onClick: props.onClick, className: classNames__default.default(className, props.className), children: props.text });
5642
5712
  };
5643
5713
 
5644
- const variantClasses = {
5645
- h1: "ui-typo-h1 ui:text-text-brand-primary-default",
5646
- h2: "ui-typo-h2 ui:text-text-neutral-primary-default",
5647
- h3: "ui-typo-h3 ui:text-text-neutral-primary-default",
5648
- h4: "ui-typo-h4 ui:text-text-neutral-primary-default"
5649
- };
5650
- const Heading = (_a) => {
5651
- var { as: Element = "h2", variant = "h2", className, children } = _a, rest = __rest(_a, ["as", "variant", "className", "children"]);
5652
- return jsxRuntime.jsx(Element, Object.assign({ className: classNames__default.default(variantClasses[variant], className) }, rest, { children }));
5653
- };
5654
-
5655
5714
  const TimelineStep = React__namespace.default.forwardRef(({ content, type = "base", dataTestId, title }, ref) => {
5656
5715
  const isWideStep = type === "wide";
5657
5716
  const borderClassNames = "ui:ml-4 ui:pl-6 ui:border-primary ui:border-l-2";
@@ -7178,6 +7237,8 @@ exports.AccordionList = AccordionList;
7178
7237
  exports.AccordionTemporary = Accordion;
7179
7238
  exports.ActionBloodPressureColoredIcon = ActionBloodPressureColoredIcon;
7180
7239
  exports.ActionCalculationColoredIcon = ActionCalculationColoredIcon;
7240
+ exports.ActionCard = ActionCard;
7241
+ exports.ActionCardDetailed = ActionCardDetailed;
7181
7242
  exports.ActionContactColoredIcon = ActionContactColoredIcon;
7182
7243
  exports.ActionController = ActionController;
7183
7244
  exports.ActionHeartRateColoredIcon = ActionHeartRateColoredIcon;