@luscii-healthtech/web-ui 58.3.0 → 58.4.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,50 @@ 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
+
5080
5124
  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
5125
  styleInject(css_248z$1);
5082
5126
 
@@ -5641,17 +5685,6 @@ const TextLink = (props) => {
5641
5685
  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
5686
  };
5643
5687
 
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
5688
  const TimelineStep = React__namespace.default.forwardRef(({ content, type = "base", dataTestId, title }, ref) => {
5656
5689
  const isWideStep = type === "wide";
5657
5690
  const borderClassNames = "ui:ml-4 ui:pl-6 ui:border-primary ui:border-l-2";
@@ -7178,6 +7211,7 @@ exports.AccordionList = AccordionList;
7178
7211
  exports.AccordionTemporary = Accordion;
7179
7212
  exports.ActionBloodPressureColoredIcon = ActionBloodPressureColoredIcon;
7180
7213
  exports.ActionCalculationColoredIcon = ActionCalculationColoredIcon;
7214
+ exports.ActionCard = ActionCard;
7181
7215
  exports.ActionContactColoredIcon = ActionContactColoredIcon;
7182
7216
  exports.ActionController = ActionController;
7183
7217
  exports.ActionHeartRateColoredIcon = ActionHeartRateColoredIcon;